broadcom-wl: change interface names
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 11 Nov 2013 21:57:26 +0000 (21:57 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 11 Nov 2013 21:57:26 +0000 (21:57 +0000)
'netifd' treats all devices with a "." in their name as vlan devices.
Modify the name of virtual/WDS interfaces created by broadcom-wl to use
a "-" instead of a ".", so they will be treated as simple devices
by 'netifd'.

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
SVN-Revision: 38748

package/kernel/broadcom-wl/files/etc/hotplug.d/net/20-broadcom_wds
package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
package/kernel/broadcom-wl/patches/013-interface-name.patch [new file with mode: 0644]

index 0a563c2dbd3c3109e4bfdb950d01c8b6113f7ed1..4e56d21acfa4dcdbbdab340919a7c0cf5d2f854a 100644 (file)
@@ -56,6 +56,6 @@ setup_broadcom_wds() {
 
 case "$ACTION" in
        add|register)
-               [ "${INTERFACE%%0.*}" = wds ] && setup_broadcom_wds "$INTERFACE"
+               [ "${INTERFACE%%0-*}" = wds ] && setup_broadcom_wds "$INTERFACE"
        ;;
 esac
index 4d81bcb1b4e6e205c64c53c85c27fbf81c2c8060..506b077ef2b70669c14ee6fefa05780daa2fe713 100644 (file)
@@ -45,7 +45,7 @@ scan_broadcom() {
 
        local _c=
        for vif in ${adhoc_if:-$sta_if $ap_if $mon_if}; do
-               config_set "$vif" ifname "${device}${_c:+.$_c}"
+               config_set "$vif" ifname "${device}${_c:+-$_c}"
                _c=$((${_c:-0} + 1))
        done
        config_set "$device" vifs "${adhoc_if:-$sta_if $ap_if $mon_if}"
@@ -102,7 +102,7 @@ disable_broadcom() {
                include /lib/network
 
                # make sure the interfaces are down and removed from all bridges
-               for dev in $device ${device}.1 ${device}.2 ${device}.3; do
+               for dev in $device ${device}-1 ${device}-2 ${device}-3; do
                        ifconfig "$dev" down 2>/dev/null >/dev/null && {
                                unbridge "$dev"
                        }
diff --git a/package/kernel/broadcom-wl/patches/013-interface-name.patch b/package/kernel/broadcom-wl/patches/013-interface-name.patch
new file mode 100644 (file)
index 0000000..3a136de
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/driver/wl_linux.c
++++ b/driver/wl_linux.c
+@@ -1556,7 +1556,7 @@ wl_add_if(wl_info_t *wl, struct wlc_if*
+       wl_if_setup(wlif->dev);
+-      sprintf(wlif->dev->name, "%s%d.%d", devname, wl->pub->unit, wlif->subunit);
++      sprintf(wlif->dev->name, "%s%d-%d", devname, wl->pub->unit, wlif->subunit);
+       if (remote)
+               bcopy(remote, &wlif->remote, ETHER_ADDR_LEN);