Ignore:
Timestamp:
2011-11-06T19:49:17+01:00 (5 years ago)
Author:
jow
Message:

[package] mac80211: change wireless ifname numbering schema
Instead of simply counting up until we hit a free iface, group ifnames by wiphy so that the first wlanX on a phy gets the phy number
and following ifaces an index-suffix, e.g. wlan0 for network 1 on phy 1 and wlan0-1 for network 2 on phy 1.
This fixes state var confusion when operating multiple radios and allows to reliably take down and restart one radio only, even if
the number of networks changes in between. This should, along with other changes in LuCI, fix #10335.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/mac80211/files/lib/wifi/mac80211.sh

    r28387 r28784  
    330330        wifi_fixup_hwmode "$device" "g" 
    331331        for vif in $vifs; do 
    332                 while [ -d "/sys/class/net/wlan$i" ]; do 
    333                         i=$(($i + 1)) 
    334                 done 
    335  
    336332                config_get ifname "$vif" ifname 
    337333                [ -n "$ifname" ] || { 
    338                         ifname="wlan$i" 
     334                        [ $i -gt 0 ] && ifname="wlan${phy#phy}-$i" || ifname="wlan${phy#phy}" 
    339335                } 
    340336                config_set "$vif" ifname "$ifname" 
     
    352348                                # it's accompanying monitor 
    353349                                apidx="$(($apidx + 1))" 
    354                                 i=$(($i + 1)) 
    355350                                [ "$apidx" -gt 1 ] || iw phy "$phy" interface add "$ifname" type managed 
    356351                        ;; 
     
    405400                txpower="${txpower:-$vif_txpower}" 
    406401                [ -z "$txpower" ] || iw dev "$ifname" set txpower fixed "${txpower%%.*}00" 
     402 
     403                i=$(($i + 1)) 
    407404        done 
    408405 
Note: See TracChangeset for help on using the changeset viewer.