aboutsummaryrefslogtreecommitdiffstats
path: root/package/madwifi/files/lib
diff options
context:
space:
mode:
authorAndy Boyett <agb@openwrt.org>2009-01-31 16:08:57 +0000
committerAndy Boyett <agb@openwrt.org>2009-01-31 16:08:57 +0000
commitcdc6c574ad92dc69037253469d505269f1358a3a (patch)
tree7dcb35490867e3fd2edc435d8ae622f511da1059 /package/madwifi/files/lib
parent28216492767f0ffe8b7a82f5dac6efd87adfaf74 (diff)
downloadmaster-187ad058-cdc6c574ad92dc69037253469d505269f1358a3a.tar.gz
master-187ad058-cdc6c574ad92dc69037253469d505269f1358a3a.tar.bz2
master-187ad058-cdc6c574ad92dc69037253469d505269f1358a3a.zip
[package] madwifi: mode txpower to wifi-device section, but remain backwards compatible
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14307 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/madwifi/files/lib')
-rwxr-xr-xpackage/madwifi/files/lib/wifi/madwifi.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh
index 550bba7e55..52086f04bd 100755
--- a/package/madwifi/files/lib/wifi/madwifi.sh
+++ b/package/madwifi/files/lib/wifi/madwifi.sh
@@ -78,12 +78,13 @@ enable_atheros() {
fi
config_get channel "$device" channel
config_get vifs "$device" vifs
+ config_get txpower "$device" txpower
[ auto = "$channel" ] && channel=0
local first=1
for vif in $vifs; do
- local start_hostapd
+ local start_hostapd vif_txpower
nosbeacon=
config_get ifname "$vif" ifname
config_get enc "$vif" encryption
@@ -299,8 +300,14 @@ enable_atheros() {
set_wifi_up "$vif" "$ifname"
# TXPower settings only work if device is up already
- config_get txpwr "$vif" txpower
- [ -n "$txpwr" ] && iwconfig "$ifname" txpower "${txpwr%%.*}"
+ # while atheros hardware theoretically is capable of per-vif (even per-packet) txpower
+ # adjustment it does not work with the current atheros hal/madwifi driver
+
+ config_get vif_txpower "$vif" txpower
+ # use vif_txpower (from wifi-iface) instead of txpower (from wifi-device) if
+ # the latter doesn't exist
+ txpower="${txpower:-$vif_txpower}"
+ [ -z "$txpower" ] || iwconfig "$ifname" txpower "${txpower%%.*}"
case "$mode" in
ap)