From e9575c6635fa2361d4bab8ca372c21ee2401cadf Mon Sep 17 00:00:00 2001 From: nbd Date: Thu, 26 Mar 2009 23:04:23 +0000 Subject: madwifi: add config option for adjusting the beacon power relative to the full tx power (needs testing, units/scale still unknown, defaults to max.) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15054 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/madwifi/files/lib/wifi/madwifi.sh | 3 + package/madwifi/patches/417-beacon_txpower.patch | 81 ++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 package/madwifi/patches/417-beacon_txpower.patch (limited to 'package/madwifi') diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh index 52086f04bd..3c4112a4ff 100755 --- a/package/madwifi/files/lib/wifi/madwifi.sh +++ b/package/madwifi/files/lib/wifi/madwifi.sh @@ -257,6 +257,9 @@ enable_atheros() { config_get_bool turbo "$vif" turbo [ -n "$turbo" ] && iwpriv "$ifname" turbo "$turbo" + config_get_bool beacon_power "$vif" beacon_power + [ -n "$beacon_power" ] && iwpriv "$ifname" beacon_pwr "$beacon_power" + config_get_bool doth "$vif" doth 0 [ -n "$doth" ] && iwpriv "$ifname" doth "$doth" diff --git a/package/madwifi/patches/417-beacon_txpower.patch b/package/madwifi/patches/417-beacon_txpower.patch new file mode 100644 index 0000000000..4746116c41 --- /dev/null +++ b/package/madwifi/patches/417-beacon_txpower.patch @@ -0,0 +1,81 @@ +--- a/ath/if_ath.c ++++ b/ath/if_ath.c +@@ -395,7 +395,7 @@ static int bstuck_thresh = BSTUCK_THRESH + static char *autocreate = NULL; + static char *ratectl = DEF_RATE_CTL; + static int rfkill = 0; +-static int tpc = 0; ++static int tpc = 1; + static int countrycode = -1; + static int maxvaps = -1; + static int outdoor = -1; +@@ -4923,6 +4923,7 @@ ath_beacon_setup(struct ath_softc *sc, s + (((_ic)->ic_flags & (IEEE80211_F_SHPREAMBLE | IEEE80211_F_USEBARKER))\ + == IEEE80211_F_SHPREAMBLE) + struct ieee80211com *ic = bf->bf_node->ni_ic; ++ struct ieee80211vap *vap = bf->bf_node->ni_vap; + struct sk_buff *skb = bf->bf_skb; + struct ath_hal *ah = sc->sc_ah; + struct ath_desc *ds; +@@ -4990,7 +4991,7 @@ ath_beacon_setup(struct ath_softc *sc, s + skb->len + IEEE80211_CRC_LEN, /* frame length */ + sizeof(struct ieee80211_frame), /* header length */ + HAL_PKT_TYPE_BEACON, /* Atheros packet type */ +- bf->bf_node->ni_txpower, /* txpower XXX */ ++ (vap->iv_beacon_txpow ? vap->iv_beacon_txpow : 63), + rate, 1, /* series 0 rate/tries */ + HAL_TXKEYIX_INVALID, /* no encryption */ + antenna, /* antenna mode */ +--- a/net80211/ieee80211_ioctl.h ++++ b/net80211/ieee80211_ioctl.h +@@ -652,6 +652,7 @@ enum { + IEEE80211_PARAM_WDS_SEP = 82, /* move wds stations into separate interfaces */ + IEEE80211_PARAM_MAXASSOC = 83, /* maximum associated stations */ + IEEE80211_PARAM_PROBEREQ = 84, /* enable handling of probe requests */ ++ IEEE80211_PARAM_BEACON_TXP = 85, /* set beacon tx power */ + }; + + #define SIOCG80211STATS (SIOCDEVPRIVATE+2) +--- a/net80211/ieee80211_var.h ++++ b/net80211/ieee80211_var.h +@@ -254,6 +254,7 @@ struct ieee80211vap { + u_int8_t iv_dtim_period; /* DTIM period */ + u_int8_t iv_dtim_count; /* DTIM count from last bcn */ + /* set/unset aid pwrsav state */ ++ u_int8_t iv_beacon_txpow; /* beacon tx power */ + void (*iv_set_tim)(struct ieee80211_node *, int); + u_int8_t iv_uapsdinfo; /* sta mode QoS Info flags */ + struct ieee80211_node *iv_bss; /* information for this node */ +--- a/net80211/ieee80211_wireless.c ++++ b/net80211/ieee80211_wireless.c +@@ -2862,6 +2862,9 @@ ieee80211_ioctl_setparam(struct net_devi + case IEEE80211_PARAM_PROBEREQ: + vap->iv_no_probereq = !value; + break; ++ case IEEE80211_PARAM_BEACON_TXP: ++ vap->iv_beacon_txpow = value; ++ break; + #ifdef ATH_REVERSE_ENGINEERING + case IEEE80211_PARAM_DUMPREGS: + ieee80211_dump_registers(dev, info, w, extra); +@@ -3227,6 +3230,9 @@ ieee80211_ioctl_getparam(struct net_devi + case IEEE80211_PARAM_PROBEREQ: + param[0] = !vap->iv_no_probereq; + break; ++ case IEEE80211_PARAM_BEACON_TXP: ++ param[0] = vap->iv_beacon_txpow; ++ break; + default: + return -EOPNOTSUPP; + } +@@ -5801,6 +5807,10 @@ static const struct iw_priv_args ieee802 + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "probereq"}, + { IEEE80211_PARAM_PROBEREQ, + 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_probereq"}, ++ { IEEE80211_PARAM_BEACON_TXP, ++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "beacon_pwr"}, ++ { IEEE80211_PARAM_BEACON_TXP, ++ 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_beacon_pwr"}, + + #ifdef ATH_REVERSE_ENGINEERING + /* -- cgit v1.2.3