mac80211: apply txpower after bringing up the interface, should fix #10113
authorFelix Fietkau <nbd@openwrt.org>
Sun, 18 Dec 2011 22:19:21 +0000 (22:19 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 18 Dec 2011 22:19:21 +0000 (22:19 +0000)
SVN-Revision: 29566

package/mac80211/files/lib/wifi/mac80211.sh

index 7a4e29d0f7fa109da196523d4a30cea9028586bc..11e0b044599c86c075d9dbe0cd0ad5be791913e1 100644 (file)
@@ -394,12 +394,6 @@ enable_mac80211() {
                        [ -n "$fixed" -a -n "$channel" ] && iw dev "$ifname" set channel "$channel"
                fi
 
-               config_get vif_txpower "$vif" txpower
-               # use vif_txpower (from wifi-iface) to override txpower (from
-               # wifi-device) if the latter doesn't exist
-               txpower="${txpower:-$vif_txpower}"
-               [ -z "$txpower" ] || iw dev "$ifname" set txpower fixed "${txpower%%.*}00"
-
                i=$(($i + 1))
        done
 
@@ -434,6 +428,12 @@ enable_mac80211() {
                [ ! "$mode" = "ap" ] || continue
                ifconfig "$ifname" up
 
+               config_get vif_txpower "$vif" txpower
+               # use vif_txpower (from wifi-iface) to override txpower (from
+               # wifi-device) if the latter doesn't exist
+               txpower="${txpower:-$vif_txpower}"
+               [ -z "$txpower" ] || iw dev "$ifname" set txpower fixed "${txpower%%.*}00"
+
                if [ ! "$mode" = "ap" ]; then
                        ifconfig "$ifname" up
                        case "$mode" in