diff options
author | Sujith Manoharan <Sujith.Manoharan@atheros.com> | 2011-04-13 01:53:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-13 15:22:22 -0400 |
commit | 2493a547ee81e6daca812d5dd7cf9357aebc379b (patch) | |
tree | 19512b267e3244425b6077b9ff75877836d64f9e /drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | |
parent | 9b674a0207c9b75ddcdcdb07e46843fac8267507 (diff) |
ath9k_htc: Configure the beacon queue
Set operating parameters (cwmin, cwmax) for the beacon queue
in AP mode.
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/htc_drv_beacon.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 77 |
1 files changed, 46 insertions, 31 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c index 2fad613add51..7aafd2179398 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | |||
@@ -18,6 +18,50 @@ | |||
18 | 18 | ||
19 | #define FUDGE 2 | 19 | #define FUDGE 2 |
20 | 20 | ||
21 | void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv) | ||
22 | { | ||
23 | struct ath_hw *ah = priv->ah; | ||
24 | struct ath9k_tx_queue_info qi, qi_be; | ||
25 | |||
26 | memset(&qi, 0, sizeof(struct ath9k_tx_queue_info)); | ||
27 | memset(&qi_be, 0, sizeof(struct ath9k_tx_queue_info)); | ||
28 | |||
29 | ath9k_hw_get_txq_props(ah, priv->beaconq, &qi); | ||
30 | |||
31 | if (priv->ah->opmode == NL80211_IFTYPE_AP) { | ||
32 | qi.tqi_aifs = 1; | ||
33 | qi.tqi_cwmin = 0; | ||
34 | qi.tqi_cwmax = 0; | ||
35 | } else if (priv->ah->opmode == NL80211_IFTYPE_ADHOC) { | ||
36 | int qnum = priv->hwq_map[WME_AC_BE]; | ||
37 | |||
38 | ath9k_hw_get_txq_props(ah, qnum, &qi_be); | ||
39 | |||
40 | qi.tqi_aifs = qi_be.tqi_aifs; | ||
41 | |||
42 | /* | ||
43 | * For WIFI Beacon Distribution | ||
44 | * Long slot time : 2x cwmin | ||
45 | * Short slot time : 4x cwmin | ||
46 | */ | ||
47 | if (ah->slottime == ATH9K_SLOT_TIME_20) | ||
48 | qi.tqi_cwmin = 2*qi_be.tqi_cwmin; | ||
49 | else | ||
50 | qi.tqi_cwmin = 4*qi_be.tqi_cwmin; | ||
51 | |||
52 | qi.tqi_cwmax = qi_be.tqi_cwmax; | ||
53 | |||
54 | } | ||
55 | |||
56 | if (!ath9k_hw_set_txq_props(ah, priv->beaconq, &qi)) { | ||
57 | ath_err(ath9k_hw_common(ah), | ||
58 | "Unable to update beacon queue %u!\n", priv->beaconq); | ||
59 | } else { | ||
60 | ath9k_hw_resettxqueue(ah, priv->beaconq); | ||
61 | } | ||
62 | } | ||
63 | |||
64 | |||
21 | static void ath9k_htc_beacon_config_sta(struct ath9k_htc_priv *priv, | 65 | static void ath9k_htc_beacon_config_sta(struct ath9k_htc_priv *priv, |
22 | struct htc_beacon_config *bss_conf) | 66 | struct htc_beacon_config *bss_conf) |
23 | { | 67 | { |
@@ -176,6 +220,8 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv, | |||
176 | "imask: 0x%x\n", | 220 | "imask: 0x%x\n", |
177 | bss_conf->beacon_interval, nexttbtt, imask); | 221 | bss_conf->beacon_interval, nexttbtt, imask); |
178 | 222 | ||
223 | ath9k_htc_beaconq_config(priv); | ||
224 | |||
179 | WMI_CMD(WMI_DISABLE_INTR_CMDID); | 225 | WMI_CMD(WMI_DISABLE_INTR_CMDID); |
180 | ath9k_hw_beaconinit(priv->ah, TU_TO_USEC(nexttbtt), TU_TO_USEC(intval)); | 226 | ath9k_hw_beaconinit(priv->ah, TU_TO_USEC(nexttbtt), TU_TO_USEC(intval)); |
181 | priv->cur_beacon_conf.bmiss_cnt = 0; | 227 | priv->cur_beacon_conf.bmiss_cnt = 0; |
@@ -347,37 +393,6 @@ void ath9k_htc_swba(struct ath9k_htc_priv *priv) | |||
347 | ath9k_htc_send_beacon(priv, slot); | 393 | ath9k_htc_send_beacon(priv, slot); |
348 | } | 394 | } |
349 | 395 | ||
350 | /* Currently, only for IBSS */ | ||
351 | void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv) | ||
352 | { | ||
353 | struct ath_hw *ah = priv->ah; | ||
354 | struct ath9k_tx_queue_info qi, qi_be; | ||
355 | int qnum = priv->hwq_map[WME_AC_BE]; | ||
356 | |||
357 | memset(&qi, 0, sizeof(struct ath9k_tx_queue_info)); | ||
358 | memset(&qi_be, 0, sizeof(struct ath9k_tx_queue_info)); | ||
359 | |||
360 | ath9k_hw_get_txq_props(ah, qnum, &qi_be); | ||
361 | |||
362 | qi.tqi_aifs = qi_be.tqi_aifs; | ||
363 | /* For WIFI Beacon Distribution | ||
364 | * Long slot time : 2x cwmin | ||
365 | * Short slot time : 4x cwmin | ||
366 | */ | ||
367 | if (ah->slottime == ATH9K_SLOT_TIME_20) | ||
368 | qi.tqi_cwmin = 2*qi_be.tqi_cwmin; | ||
369 | else | ||
370 | qi.tqi_cwmin = 4*qi_be.tqi_cwmin; | ||
371 | qi.tqi_cwmax = qi_be.tqi_cwmax; | ||
372 | |||
373 | if (!ath9k_hw_set_txq_props(ah, priv->beaconq, &qi)) { | ||
374 | ath_err(ath9k_hw_common(ah), | ||
375 | "Unable to update beacon queue %u!\n", qnum); | ||
376 | } else { | ||
377 | ath9k_hw_resettxqueue(ah, priv->beaconq); | ||
378 | } | ||
379 | } | ||
380 | |||
381 | void ath9k_htc_assign_bslot(struct ath9k_htc_priv *priv, | 396 | void ath9k_htc_assign_bslot(struct ath9k_htc_priv *priv, |
382 | struct ieee80211_vif *vif) | 397 | struct ieee80211_vif *vif) |
383 | { | 398 | { |