ar71xx: change failsafe message
[openwrt.git] / package / mac80211 / files / lib / wifi / mac80211.sh
index 06f4b84..dea5722 100644 (file)
@@ -77,9 +77,11 @@ enable_mac80211() {
        config_get vifs "$device" vifs
        config_get txpower "$device" txpower
        config_get country "$device" country
+       config_get distance "$device" distance
        find_mac80211_phy "$device" || return 0
        config_get phy "$device" phy
        local i=0
+       local macidx=0
        fixed=""
 
        [ -n "$country" ] && iw reg set "$country"
@@ -87,6 +89,8 @@ enable_mac80211() {
                fixed=1
        }
 
+       [ -n "$distance" ] && iw phy "$phy" set distance "$distance"
+
        export channel fixed
        # convert channel to frequency
        local freq="$(get_freq "$phy" "${fixed:+$channel}")"
@@ -144,12 +148,13 @@ enable_mac80211() {
 
                config_get vif_mac "$vif" macaddr
                [ -n "$vif_mac" ] || {
-                       if [ "$i" -gt 0 ]; then
-                               offset="$(( 2 + $i * 4 ))"
+                       if [ "$macidx" -gt 0 ]; then
+                               offset="$(( 2 + $macidx * 4 ))"
                        else
                                offset="0"
                        fi
                        vif_mac="$( printf %02x $((0x$mac_1 + $offset)) ):$mac_2"
+                       macidx="$(($macidx + 1))"
                }
                ifconfig "$ifname" hw ether "$vif_mac"
 
@@ -314,7 +319,7 @@ detect_mac80211() {
                mode_band="g"
                channel="5"
                ht_cap=0
-               for cap in $(iw phy "$dev" info | grep 'HT capabilities' | cut -d: -f2); do
+               for cap in $(iw phy "$dev" info | grep 'Capabilities:' | cut -d: -f2); do
                        ht_cap="$(($ht_cap | $cap))"
                done
                ht_capab="";
This page took 0.034801 seconds and 4 git commands to generate.