diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2010-06-01 05:44:19 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-06-03 14:14:41 -0400 |
commit | 764580f577a46adce6ad6717a9b34aa8e3a09159 (patch) | |
tree | 445e3a863c4d3fe2e27df5578ab54a23e9155e4e | |
parent | 21d5130b8cb8e19a3e69e704aa29d918624fce49 (diff) |
ath9k_htc: Fix fair beacon distribution
This patch fixes beacon distribution in IBSS mode
by configuring the hardware beacon queue properly.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 23 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_main.c | 8 |
3 files changed, 31 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index ba86458a3cae..051b8d89b9f2 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h | |||
@@ -411,6 +411,7 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz) | |||
411 | common->bus_ops->read_cachesize(common, csz); | 411 | common->bus_ops->read_cachesize(common, csz); |
412 | } | 412 | } |
413 | 413 | ||
414 | void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv); | ||
414 | void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv, | 415 | void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv, |
415 | struct ieee80211_vif *vif); | 416 | struct ieee80211_vif *vif); |
416 | void ath9k_htc_swba(struct ath9k_htc_priv *priv, u8 beacon_pending); | 417 | void ath9k_htc_swba(struct ath9k_htc_priv *priv, u8 beacon_pending); |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c index c10c7d002eb7..12a3bb0a9159 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | |||
@@ -222,6 +222,29 @@ void ath9k_htc_swba(struct ath9k_htc_priv *priv, u8 beacon_pending) | |||
222 | spin_unlock_bh(&priv->beacon_lock); | 222 | spin_unlock_bh(&priv->beacon_lock); |
223 | } | 223 | } |
224 | 224 | ||
225 | /* Currently, only for IBSS */ | ||
226 | void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv) | ||
227 | { | ||
228 | struct ath_hw *ah = priv->ah; | ||
229 | struct ath9k_tx_queue_info qi, qi_be; | ||
230 | int qnum = priv->hwq_map[ATH9K_WME_AC_BE]; | ||
231 | |||
232 | memset(&qi, 0, sizeof(struct ath9k_tx_queue_info)); | ||
233 | memset(&qi_be, 0, sizeof(struct ath9k_tx_queue_info)); | ||
234 | |||
235 | ath9k_hw_get_txq_props(ah, qnum, &qi_be); | ||
236 | |||
237 | qi.tqi_aifs = qi_be.tqi_aifs; | ||
238 | qi.tqi_cwmin = 4*qi_be.tqi_cwmin; | ||
239 | qi.tqi_cwmax = qi_be.tqi_cwmax; | ||
240 | |||
241 | if (!ath9k_hw_set_txq_props(ah, priv->beaconq, &qi)) { | ||
242 | ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, | ||
243 | "Unable to update beacon queue %u!\n", qnum); | ||
244 | } else { | ||
245 | ath9k_hw_resettxqueue(ah, priv->beaconq); | ||
246 | } | ||
247 | } | ||
225 | 248 | ||
226 | void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv, | 249 | void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv, |
227 | struct ieee80211_vif *vif) | 250 | struct ieee80211_vif *vif) |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index 6bc05fe9be8c..e776dee6f074 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -1574,9 +1574,15 @@ static int ath9k_htc_conf_tx(struct ieee80211_hw *hw, u16 queue, | |||
1574 | params->cw_max, params->txop); | 1574 | params->cw_max, params->txop); |
1575 | 1575 | ||
1576 | ret = ath_htc_txq_update(priv, qnum, &qi); | 1576 | ret = ath_htc_txq_update(priv, qnum, &qi); |
1577 | if (ret) | 1577 | if (ret) { |
1578 | ath_print(common, ATH_DBG_FATAL, "TXQ Update failed\n"); | 1578 | ath_print(common, ATH_DBG_FATAL, "TXQ Update failed\n"); |
1579 | goto out; | ||
1580 | } | ||
1579 | 1581 | ||
1582 | if ((priv->ah->opmode == NL80211_IFTYPE_ADHOC) && | ||
1583 | (qnum == priv->hwq_map[ATH9K_WME_AC_BE])) | ||
1584 | ath9k_htc_beaconq_config(priv); | ||
1585 | out: | ||
1580 | ath9k_htc_ps_restore(priv); | 1586 | ath9k_htc_ps_restore(priv); |
1581 | mutex_unlock(&priv->mutex); | 1587 | mutex_unlock(&priv->mutex); |
1582 | 1588 | ||