mac80211: move txpower to wifi-device section, but remain backwards compatible
authorAndy Boyett <agb@openwrt.org>
Sat, 31 Jan 2009 16:09:39 +0000 (16:09 +0000)
committerAndy Boyett <agb@openwrt.org>
Sat, 31 Jan 2009 16:09:39 +0000 (16:09 +0000)
SVN-Revision: 14309

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

index 4f14e93b65801ed5e8683900e4794cf9b6a76948..0448f0063a6ac1096ef810a8a81f4f39f2425120 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=mac80211
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 ifneq ($(CONFIG_LINUX_2_6_27)$(CONFIG_LINUX_2_6_28),)
   PKG_VERSION:=2009-01-29
index 6144ce40ae775f05453f0b9e5994f51d7ad1b897..8f3ed4a25ad46be7d4e9fde18f168df64fb41dfb 100644 (file)
@@ -50,6 +50,7 @@ enable_mac80211() {
        local device="$1"
        config_get channel "$device" channel
        config_get vifs "$device" vifs
+       config_get txpower "$device" txpower
 
        local first=1
        for vif in $vifs; do
@@ -112,10 +113,11 @@ enable_mac80211() {
                esac
                config_get ssid "$vif" ssid
 
-               config_get txpwr "$vif" txpower
-               if [ -n "$txpwr" ]; then
-                       iwconfig "$ifname" txpower "${txpwr%%.*}"
-               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" ] || iwconfig "$ifname" txpower "${txpower%%.*}"
 
                config_get frag "$vif" frag
                if [ -n "$frag" ]; then