Move txpower settings after the interface comes up. Thanks alisonken1
authorTravis Kemen <thepeople@openwrt.org>
Wed, 3 Dec 2008 21:34:04 +0000 (21:34 +0000)
committerTravis Kemen <thepeople@openwrt.org>
Wed, 3 Dec 2008 21:34:04 +0000 (21:34 +0000)
SVN-Revision: 13502

package/madwifi/files/lib/wifi/madwifi.sh

index 0ff929260056cf2680944f15aec3b5758ee24b76..638640a96236d7ca580ff3a4c4a5609a43c9bb48 100755 (executable)
@@ -211,9 +211,6 @@ enable_atheros() {
                config_get distance "$device" distance
                [ -n "$distance" ] && athctrl -i "$device" -d "$distance" >&-
 
-               config_get txpwr "$vif" txpower
-               [ -n "$txpwr" ] && iwconfig "$ifname" txpower "${txpwr%%.*}"
-
                config_get rate "$vif" rate
                [ -n "$rate" ] && iwconfig "$ifname" rate "${rate%%.*}"
 
@@ -277,6 +274,11 @@ enable_atheros() {
                esac
 
                ifconfig "$ifname" up
+
+               # TXPower settings only work if device is up already
+               config_get txpwr "$vif" txpower
+               [ -n "$txpwr" ] && iwconfig "$ifname" txpower "${txpwr%%.*}"
+
                local net_cfg bridge
                net_cfg="$(find_net_config "$vif")"
                [ -z "$net_cfg" ] || {