diff options
author | Vivek Natarajan <vnatarajan@atheros.com> | 2009-11-25 01:31:54 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-28 15:04:52 -0500 |
commit | 94db29368a658b13a088db87c7b0bf59b1a7492d (patch) | |
tree | 5d6a5a2f8d4d31c0ed29d0f464200587b4a05253 | |
parent | f4709fdf683e1ed37b321c258b614ebe39752bf3 (diff) |
ath9k: Ensure a fair beacon distribution in IBSS mode.
Update the beacon queue parameters with best effort queue parameters for
IBSS mode. This reduces the number of beacons generated by ath9k and
ensures a fair beacon distribution when there are multiple IBSS stations.
Also CWmin is quadrupled to achieve the expected percentage of
distribution.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/beacon.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 4 |
3 files changed, 14 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 3eb9677b2dfe..42f79caa870b 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -329,6 +329,7 @@ void ath_beacon_tasklet(unsigned long data); | |||
329 | void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif); | 329 | void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif); |
330 | int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif); | 330 | int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif); |
331 | void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp); | 331 | void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp); |
332 | int ath_beaconq_config(struct ath_softc *sc); | ||
332 | 333 | ||
333 | /*******/ | 334 | /*******/ |
334 | /* ANI */ | 335 | /* ANI */ |
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index cb774cc828a3..1660ef17aaf5 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c | |||
@@ -23,11 +23,12 @@ | |||
23 | * the operating mode of the station (AP or AdHoc). Parameters are AIFS | 23 | * the operating mode of the station (AP or AdHoc). Parameters are AIFS |
24 | * settings and channel width min/max | 24 | * settings and channel width min/max |
25 | */ | 25 | */ |
26 | static int ath_beaconq_config(struct ath_softc *sc) | 26 | int ath_beaconq_config(struct ath_softc *sc) |
27 | { | 27 | { |
28 | struct ath_hw *ah = sc->sc_ah; | 28 | struct ath_hw *ah = sc->sc_ah; |
29 | struct ath_common *common = ath9k_hw_common(ah); | 29 | struct ath_common *common = ath9k_hw_common(ah); |
30 | struct ath9k_tx_queue_info qi; | 30 | struct ath9k_tx_queue_info qi, qi_be; |
31 | int qnum; | ||
31 | 32 | ||
32 | ath9k_hw_get_txq_props(ah, sc->beacon.beaconq, &qi); | 33 | ath9k_hw_get_txq_props(ah, sc->beacon.beaconq, &qi); |
33 | if (sc->sc_ah->opmode == NL80211_IFTYPE_AP) { | 34 | if (sc->sc_ah->opmode == NL80211_IFTYPE_AP) { |
@@ -37,9 +38,12 @@ static int ath_beaconq_config(struct ath_softc *sc) | |||
37 | qi.tqi_cwmax = 0; | 38 | qi.tqi_cwmax = 0; |
38 | } else { | 39 | } else { |
39 | /* Adhoc mode; important thing is to use 2x cwmin. */ | 40 | /* Adhoc mode; important thing is to use 2x cwmin. */ |
40 | qi.tqi_aifs = sc->beacon.beacon_qi.tqi_aifs; | 41 | qnum = ath_tx_get_qnum(sc, ATH9K_TX_QUEUE_DATA, |
41 | qi.tqi_cwmin = 2*sc->beacon.beacon_qi.tqi_cwmin; | 42 | ATH9K_WME_AC_BE); |
42 | qi.tqi_cwmax = sc->beacon.beacon_qi.tqi_cwmax; | 43 | ath9k_hw_get_txq_props(ah, qnum, &qi_be); |
44 | qi.tqi_aifs = qi_be.tqi_aifs; | ||
45 | qi.tqi_cwmin = 4*qi_be.tqi_cwmin; | ||
46 | qi.tqi_cwmax = qi_be.tqi_cwmax; | ||
43 | } | 47 | } |
44 | 48 | ||
45 | if (!ath9k_hw_set_txq_props(ah, sc->beacon.beaconq, &qi)) { | 49 | if (!ath9k_hw_set_txq_props(ah, sc->beacon.beaconq, &qi)) { |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index cfe710b01d85..b9598148767b 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -2882,6 +2882,10 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue, | |||
2882 | if (ret) | 2882 | if (ret) |
2883 | ath_print(common, ATH_DBG_FATAL, "TXQ Update failed\n"); | 2883 | ath_print(common, ATH_DBG_FATAL, "TXQ Update failed\n"); |
2884 | 2884 | ||
2885 | if (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) | ||
2886 | if ((qnum == sc->tx.hwq_map[ATH9K_WME_AC_BE]) && !ret) | ||
2887 | ath_beaconq_config(sc); | ||
2888 | |||
2885 | mutex_unlock(&sc->mutex); | 2889 | mutex_unlock(&sc->mutex); |
2886 | 2890 | ||
2887 | return ret; | 2891 | return ret; |