diff options
author | Vivek Natarajan <vnatarajan@atheros.com> | 2010-04-05 05:18:06 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-07 14:37:59 -0400 |
commit | 1c3652a5732879263aeebe606ca7af9e66fe0b2f (patch) | |
tree | eb6ead5e3d4726cb2ec949f30f8ecb931fd752ae /drivers | |
parent | bde748a40d4d5a9915def6772e208848c105e616 (diff) |
ath9k_htc: Configure the beacon timers once the scan is completed.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 41 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_main.c | 6 |
3 files changed, 43 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index 0160e83f8fb..78213fc71b0 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h | |||
@@ -309,6 +309,14 @@ struct ath_led { | |||
309 | int brightness; | 309 | int brightness; |
310 | }; | 310 | }; |
311 | 311 | ||
312 | struct htc_beacon_config { | ||
313 | u16 beacon_interval; | ||
314 | u16 listen_interval; | ||
315 | u16 dtim_period; | ||
316 | u16 bmiss_timeout; | ||
317 | u8 dtim_count; | ||
318 | }; | ||
319 | |||
312 | #define OP_INVALID BIT(0) | 320 | #define OP_INVALID BIT(0) |
313 | #define OP_SCANNING BIT(1) | 321 | #define OP_SCANNING BIT(1) |
314 | #define OP_FULL_RESET BIT(2) | 322 | #define OP_FULL_RESET BIT(2) |
@@ -353,6 +361,7 @@ struct ath9k_htc_priv { | |||
353 | spinlock_t tx_lock; | 361 | spinlock_t tx_lock; |
354 | 362 | ||
355 | struct ieee80211_vif *vif; | 363 | struct ieee80211_vif *vif; |
364 | struct htc_beacon_config cur_beacon_conf; | ||
356 | unsigned int rxfilter; | 365 | unsigned int rxfilter; |
357 | struct tasklet_struct wmi_tasklet; | 366 | struct tasklet_struct wmi_tasklet; |
358 | struct tasklet_struct rx_tasklet; | 367 | struct tasklet_struct rx_tasklet; |
@@ -394,8 +403,7 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz) | |||
394 | } | 403 | } |
395 | 404 | ||
396 | void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv, | 405 | void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv, |
397 | struct ieee80211_vif *vif, | 406 | struct ieee80211_vif *vif); |
398 | struct ieee80211_bss_conf *bss_conf); | ||
399 | void ath9k_htc_swba(struct ath9k_htc_priv *priv, u8 beacon_pending); | 407 | void ath9k_htc_swba(struct ath9k_htc_priv *priv, u8 beacon_pending); |
400 | void ath9k_htc_beacon_update(struct ath9k_htc_priv *priv, | 408 | void ath9k_htc_beacon_update(struct ath9k_htc_priv *priv, |
401 | struct ieee80211_vif *vif); | 409 | struct ieee80211_vif *vif); |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c index 25f5b5377ba..5e21f4d92ff 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #define FUDGE 2 | 19 | #define FUDGE 2 |
20 | 20 | ||
21 | static void ath9k_htc_beacon_config_sta(struct ath9k_htc_priv *priv, | 21 | static void ath9k_htc_beacon_config_sta(struct ath9k_htc_priv *priv, |
22 | struct ieee80211_bss_conf *bss_conf) | 22 | struct htc_beacon_config *bss_conf) |
23 | { | 23 | { |
24 | struct ath_common *common = ath9k_hw_common(priv->ah); | 24 | struct ath_common *common = ath9k_hw_common(priv->ah); |
25 | struct ath9k_beacon_state bs; | 25 | struct ath9k_beacon_state bs; |
@@ -34,8 +34,8 @@ static void ath9k_htc_beacon_config_sta(struct ath9k_htc_priv *priv, | |||
34 | 34 | ||
35 | memset(&bs, 0, sizeof(bs)); | 35 | memset(&bs, 0, sizeof(bs)); |
36 | 36 | ||
37 | intval = bss_conf->beacon_int & ATH9K_BEACON_PERIOD; | 37 | intval = bss_conf->beacon_interval & ATH9K_BEACON_PERIOD; |
38 | bmiss_timeout = (ATH_DEFAULT_BMISS_LIMIT * bss_conf->beacon_int); | 38 | bmiss_timeout = (ATH_DEFAULT_BMISS_LIMIT * bss_conf->beacon_interval); |
39 | 39 | ||
40 | /* | 40 | /* |
41 | * Setup dtim and cfp parameters according to | 41 | * Setup dtim and cfp parameters according to |
@@ -138,7 +138,7 @@ static void ath9k_htc_beacon_config_sta(struct ath9k_htc_priv *priv, | |||
138 | } | 138 | } |
139 | 139 | ||
140 | static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv, | 140 | static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv, |
141 | struct ieee80211_bss_conf *bss_conf) | 141 | struct htc_beacon_config *bss_conf) |
142 | { | 142 | { |
143 | struct ath_common *common = ath9k_hw_common(priv->ah); | 143 | struct ath_common *common = ath9k_hw_common(priv->ah); |
144 | enum ath9k_int imask = 0; | 144 | enum ath9k_int imask = 0; |
@@ -146,7 +146,7 @@ static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv, | |||
146 | int ret; | 146 | int ret; |
147 | u8 cmd_rsp; | 147 | u8 cmd_rsp; |
148 | 148 | ||
149 | intval = bss_conf->beacon_int & ATH9K_BEACON_PERIOD; | 149 | intval = bss_conf->beacon_interval & ATH9K_BEACON_PERIOD; |
150 | nexttbtt = intval; | 150 | nexttbtt = intval; |
151 | intval |= ATH9K_BEACON_ENA; | 151 | intval |= ATH9K_BEACON_ENA; |
152 | if (priv->op_flags & OP_ENABLE_BEACON) | 152 | if (priv->op_flags & OP_ENABLE_BEACON) |
@@ -154,7 +154,7 @@ static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv, | |||
154 | 154 | ||
155 | ath_print(common, ATH_DBG_BEACON, | 155 | ath_print(common, ATH_DBG_BEACON, |
156 | "IBSS Beacon config, intval: %d, imask: 0x%x\n", | 156 | "IBSS Beacon config, intval: %d, imask: 0x%x\n", |
157 | bss_conf->beacon_int, imask); | 157 | bss_conf->beacon_interval, imask); |
158 | 158 | ||
159 | WMI_CMD(WMI_DISABLE_INTR_CMDID); | 159 | WMI_CMD(WMI_DISABLE_INTR_CMDID); |
160 | ath9k_hw_beaconinit(priv->ah, nexttbtt, intval); | 160 | ath9k_hw_beaconinit(priv->ah, nexttbtt, intval); |
@@ -239,18 +239,35 @@ void ath9k_htc_swba(struct ath9k_htc_priv *priv, u8 beacon_pending) | |||
239 | spin_unlock_bh(&priv->beacon_lock); | 239 | spin_unlock_bh(&priv->beacon_lock); |
240 | } | 240 | } |
241 | 241 | ||
242 | |||
242 | void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv, | 243 | void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv, |
243 | struct ieee80211_vif *vif, | 244 | struct ieee80211_vif *vif) |
244 | struct ieee80211_bss_conf *bss_conf) | ||
245 | { | 245 | { |
246 | struct ath_common *common = ath9k_hw_common(priv->ah); | 246 | struct ath_common *common = ath9k_hw_common(priv->ah); |
247 | 247 | enum nl80211_iftype iftype; | |
248 | switch (vif->type) { | 248 | struct htc_beacon_config *cur_conf = &priv->cur_beacon_conf; |
249 | |||
250 | if (vif) { | ||
251 | struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; | ||
252 | iftype = vif->type; | ||
253 | cur_conf->beacon_interval = bss_conf->beacon_int; | ||
254 | cur_conf->dtim_period = bss_conf->dtim_period; | ||
255 | cur_conf->listen_interval = 1; | ||
256 | cur_conf->dtim_count = 1; | ||
257 | cur_conf->bmiss_timeout = | ||
258 | ATH_DEFAULT_BMISS_LIMIT * cur_conf->beacon_interval; | ||
259 | } else | ||
260 | iftype = priv->ah->opmode; | ||
261 | |||
262 | if (cur_conf->beacon_interval == 0) | ||
263 | cur_conf->beacon_interval = 100; | ||
264 | |||
265 | switch (iftype) { | ||
249 | case NL80211_IFTYPE_STATION: | 266 | case NL80211_IFTYPE_STATION: |
250 | ath9k_htc_beacon_config_sta(priv, bss_conf); | 267 | ath9k_htc_beacon_config_sta(priv, cur_conf); |
251 | break; | 268 | break; |
252 | case NL80211_IFTYPE_ADHOC: | 269 | case NL80211_IFTYPE_ADHOC: |
253 | ath9k_htc_beacon_config_adhoc(priv, bss_conf); | 270 | ath9k_htc_beacon_config_adhoc(priv, cur_conf); |
254 | break; | 271 | break; |
255 | default: | 272 | default: |
256 | ath_print(common, ATH_DBG_CONFIG, | 273 | ath_print(common, ATH_DBG_CONFIG, |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index e04452f888e..eb7722b2cfc 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -1549,7 +1549,7 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw, | |||
1549 | ((changed & BSS_CHANGED_BEACON_ENABLED) && | 1549 | ((changed & BSS_CHANGED_BEACON_ENABLED) && |
1550 | bss_conf->enable_beacon)) { | 1550 | bss_conf->enable_beacon)) { |
1551 | priv->op_flags |= OP_ENABLE_BEACON; | 1551 | priv->op_flags |= OP_ENABLE_BEACON; |
1552 | ath9k_htc_beacon_config(priv, vif, bss_conf); | 1552 | ath9k_htc_beacon_config(priv, vif); |
1553 | } | 1553 | } |
1554 | 1554 | ||
1555 | if (changed & BSS_CHANGED_BEACON) | 1555 | if (changed & BSS_CHANGED_BEACON) |
@@ -1558,7 +1558,7 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw, | |||
1558 | if ((changed & BSS_CHANGED_BEACON_ENABLED) && | 1558 | if ((changed & BSS_CHANGED_BEACON_ENABLED) && |
1559 | !bss_conf->enable_beacon) { | 1559 | !bss_conf->enable_beacon) { |
1560 | priv->op_flags &= ~OP_ENABLE_BEACON; | 1560 | priv->op_flags &= ~OP_ENABLE_BEACON; |
1561 | ath9k_htc_beacon_config(priv, vif, bss_conf); | 1561 | ath9k_htc_beacon_config(priv, vif); |
1562 | } | 1562 | } |
1563 | 1563 | ||
1564 | if (changed & BSS_CHANGED_ERP_PREAMBLE) { | 1564 | if (changed & BSS_CHANGED_ERP_PREAMBLE) { |
@@ -1686,6 +1686,8 @@ static void ath9k_htc_sw_scan_complete(struct ieee80211_hw *hw) | |||
1686 | priv->op_flags &= ~OP_SCANNING; | 1686 | priv->op_flags &= ~OP_SCANNING; |
1687 | spin_unlock_bh(&priv->beacon_lock); | 1687 | spin_unlock_bh(&priv->beacon_lock); |
1688 | priv->op_flags |= OP_FULL_RESET; | 1688 | priv->op_flags |= OP_FULL_RESET; |
1689 | if (priv->op_flags & OP_ASSOCIATED) | ||
1690 | ath9k_htc_beacon_config(priv, NULL); | ||
1689 | ath_start_ani(priv); | 1691 | ath_start_ani(priv); |
1690 | mutex_unlock(&priv->mutex); | 1692 | mutex_unlock(&priv->mutex); |
1691 | ath9k_htc_ps_restore(priv); | 1693 | ath9k_htc_ps_restore(priv); |