From bc921892e292717ac430f2f64d1e7c17412ea144 Mon Sep 17 00:00:00 2001 From: Andy Boyett Date: Sat, 31 Jan 2009 16:17:30 +0000 Subject: [PATCH] merge r14306, r14307, r14309, and r14311 to 8.09: [package] broadcom,madwifi,mac80211: move txpower from wifi-iface to wifi-device but retain backward compatiblity SVN-Revision: 14312 --- docs/wireless.tex | 8 ++++++-- package/broadcom-wl/Makefile | 6 +++--- package/broadcom-wl/files/lib/wifi/broadcom.sh | 11 ++++++++--- package/mac80211/Makefile | 2 +- package/mac80211/files/lib/wifi/mac80211.sh | 14 ++++++++++---- package/madwifi/Makefile | 8 ++++---- package/madwifi/files/lib/wifi/madwifi.sh | 14 +++++++++++++- 7 files changed, 45 insertions(+), 18 deletions(-) diff --git a/docs/wireless.tex b/docs/wireless.tex index bc41b0e054..dd6ec43dd9 100644 --- a/docs/wireless.tex +++ b/docs/wireless.tex @@ -102,12 +102,13 @@ config wifi-device wifi device name option hwmode 11b, 11g, 11a, 11bg (atheros, mac80211) option rxantenna 0,1,2 (atheros, broadcom) option txantenna 0,1,2 (atheros, broadcom) + option txpower transmission power in dBm config wifi-iface option network the interface you want wifi to bridge with option device wifi0, wifi1, wifi2, wifiN option mode ap, sta, adhoc, monitor, or wds - option txpower transmission power in dBm + option txpower (deprecated) transmission power in dBm option ssid ssid name option bssid bssid address option encryption none, wep, psk, psk2, wpa, wpa2 @@ -152,6 +153,9 @@ config wifi-iface \item \texttt{txantenna} \\ Optional: Antenna identifier (0, 1 or 2) for emission. This feature is supported by atheros and some broadcom chipsets. + \item \texttt{txpower} + Set the transmission power to be used. The amount is specified in dBm. + \end{itemize} \paragraph{Options for the \texttt{wifi-iface}:} @@ -192,7 +196,7 @@ config wifi-iface Set the BSSID address to be used for wds to set the mac address of the other wds unit. \item \texttt{txpower} - Set the transmission power to be used. The amount is specified in dBm. + (Deprecated, set in wifi-device) Set the transmission power to be used. The amount is specified in dBm. \item \texttt{encryption} \\ Encryption setting. Accepts the following values: diff --git a/package/broadcom-wl/Makefile b/package/broadcom-wl/Makefile index 345f849994..e49fc50a88 100644 --- a/package/broadcom-wl/Makefile +++ b/package/broadcom-wl/Makefile @@ -1,5 +1,5 @@ -# -# Copyright (C) 2006 OpenWrt.org +# +# Copyright (C) 2006-2009 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=broadcom-wl PKG_VERSION:=4.150.10.5.3 -PKG_RELEASE:=1 +PKG_RELEASE:=2 WLC_VERSION:=0.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 diff --git a/package/broadcom-wl/files/lib/wifi/broadcom.sh b/package/broadcom-wl/files/lib/wifi/broadcom.sh index 46d93a8fbd..912e6d750a 100644 --- a/package/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/broadcom-wl/files/lib/wifi/broadcom.sh @@ -122,7 +122,8 @@ enable_broadcom() { config_get_bool frameburst "$device" frameburst config_get macfilter "$device" macfilter config_get maclist "$device" maclist - local vif_pre_up vif_post_up vif_do_up txpower + config_get txpower "$device" txpower + local vif_pre_up vif_post_up vif_do_up vif_txpower _c=0 nas="$(which nas)" @@ -151,7 +152,7 @@ enable_broadcom() { esac for vif in $vifs; do - config_get txpower "$vif" txpower + config_get vif_txpower "$vif" txpower config_get mode "$vif" mode append vif_pre_up "vif $_c" "$N" @@ -303,7 +304,11 @@ EOF wlc stdin <>>>>>> ade9976... [package] broadcom,madwifi,mac80211: move txpower from wifi-iface to wifi-device but retain backward compatiblity:package/mac80211/files/lib/wifi/mac80211.sh local first=1 for vif in $vifs; do ifconfig "$ifname" down 2>/dev/null @@ -112,10 +117,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 diff --git a/package/madwifi/Makefile b/package/madwifi/Makefile index e6d13a936b..943a13c215 100644 --- a/package/madwifi/Makefile +++ b/package/madwifi/Makefile @@ -1,5 +1,5 @@ -# -# Copyright (C) 2006-2008 OpenWrt.org +# +# Copyright (C) 2006-2009 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -13,7 +13,7 @@ PKG_NAME:=madwifi ifneq ($(CONFIG_MADWIFI_UPSTREAM),) PKG_VERSION:=0.9.4 - PKG_RELEASE:=1 + PKG_RELEASE:=2 PKG_SOURCE:=madwifi-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://downloads.sourceforge.net/madwifi/ @@ -26,7 +26,7 @@ else # PKG_BRANCH:=madwifi-dfs PKG_REV:=3314 PKG_VERSION:=r$(PKG_REV) - PKG_RELEASE:=1 + PKG_RELEASE:=2 PKG_SOURCE_PROTO:=svn PKG_SOURCE_VERSION:=$(PKG_REV) diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh index 90a27cf7bc..eae82a7f04 100755 --- a/package/madwifi/files/lib/wifi/madwifi.sh +++ b/package/madwifi/files/lib/wifi/madwifi.sh @@ -69,12 +69,13 @@ enable_atheros() { local device="$1" 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 @@ -290,6 +291,17 @@ enable_atheros() { [ -n "$ssid" ] && iwconfig "$ifname" essid on iwconfig "$ifname" essid "$ssid" set_wifi_up "$vif" "$ifname" + + # TXPower settings only work if device is up already + # 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) config_get_bool isolate "$vif" isolate 0 -- 2.30.2