This kind of functionality should really be abstracted into a place
that supports all hardware. What is the appropriate place to put
common functionality for different wireless cards?

wt

On Tue, Jan 27, 2009 at 3:44 AM,  <[email protected]> wrote:
>
> This patch introduces the 'hwsuffix' boolean parameter in the
> wifi-iface section. By setting hwsuffix to 1, the interface's
> mac address will be appended to the ssid. Works only with madwifi.
>
> Signed-off-by: Roberto Riggio <[email protected]>
>
> ---
>
> Index: package/madwifi/files/lib/wifi/madwifi.sh
> ===================================================================
> --- package/madwifi/files/lib/wifi/madwifi.sh   (revision 14219)
> +++ package/madwifi/files/lib/wifi/madwifi.sh   (working copy)
> @@ -295,7 +295,11 @@
>                        start_net "$ifname" "$net_cfg"
>                }
>                [ -n "$ssid" ] && iwconfig "$ifname" essid on
> -               iwconfig "$ifname" essid "$ssid"
> +               config_get_bool hwsuffix "$vif" hwsuffix
> +               [ -n "$hwsuffix" ] && {
> +                       hwaddr=$(ifconfig "$ifname" | grep -o -E 
> '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' | sed 's/://g')
> +                       iwconfig "$ifname" essid "$ssid-$hwaddr"
> +               } || iwconfig "$ifname" essid "$ssid"
>                set_wifi_up "$vif" "$ifname"
>
>                # TXPower settings only work if device is up already
> _______________________________________________
> openwrt-devel mailing list
> [email protected]
> http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to