aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-01-06 11:07:11 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-01-21 18:51:08 -0500
commit940739196c78576590dd155c1b9d8a705cea2af1 (patch)
tree2bf053dc8920ae79e4e5194c3e867381ea454b50
parent9b9190d9688ccf531a3a5dac84d7b9654a08bfc5 (diff)
iwlwifi: replace minimum slot time constant
There are a number of places where the minimum slot time is hardcoded to 20 TU, add a new constant for that and use it everywhere. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h5
3 files changed, 13 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
index fa6cf2a3326d..41543ad4cb84 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
@@ -308,7 +308,7 @@ static int iwlagn_set_pan_params(struct iwl_priv *priv)
308 if (priv->_agn.hw_roc_channel) { 308 if (priv->_agn.hw_roc_channel) {
309 /* both contexts must be used for this to happen */ 309 /* both contexts must be used for this to happen */
310 slot1 = priv->_agn.hw_roc_duration; 310 slot1 = priv->_agn.hw_roc_duration;
311 slot0 = 20; 311 slot0 = IWL_MIN_SLOT_TIME;
312 } else if (ctx_bss->vif && ctx_pan->vif) { 312 } else if (ctx_bss->vif && ctx_pan->vif) {
313 int bcnint = ctx_pan->vif->bss_conf.beacon_int; 313 int bcnint = ctx_pan->vif->bss_conf.beacon_int;
314 int dtim = ctx_pan->vif->bss_conf.dtim_period ?: 1; 314 int dtim = ctx_pan->vif->bss_conf.dtim_period ?: 1;
@@ -334,12 +334,12 @@ static int iwlagn_set_pan_params(struct iwl_priv *priv)
334 if (test_bit(STATUS_SCAN_HW, &priv->status) || 334 if (test_bit(STATUS_SCAN_HW, &priv->status) ||
335 (!ctx_bss->vif->bss_conf.idle && 335 (!ctx_bss->vif->bss_conf.idle &&
336 !ctx_bss->vif->bss_conf.assoc)) { 336 !ctx_bss->vif->bss_conf.assoc)) {
337 slot0 = dtim * bcnint * 3 - 20; 337 slot0 = dtim * bcnint * 3 - IWL_MIN_SLOT_TIME;
338 slot1 = 20; 338 slot1 = IWL_MIN_SLOT_TIME;
339 } else if (!ctx_pan->vif->bss_conf.idle && 339 } else if (!ctx_pan->vif->bss_conf.idle &&
340 !ctx_pan->vif->bss_conf.assoc) { 340 !ctx_pan->vif->bss_conf.assoc) {
341 slot1 = bcnint * 3 - 20; 341 slot1 = bcnint * 3 - IWL_MIN_SLOT_TIME;
342 slot0 = 20; 342 slot0 = IWL_MIN_SLOT_TIME;
343 } 343 }
344 } else if (ctx_pan->vif) { 344 } else if (ctx_pan->vif) {
345 slot0 = 0; 345 slot0 = 0;
@@ -348,8 +348,8 @@ static int iwlagn_set_pan_params(struct iwl_priv *priv)
348 slot1 = max_t(int, DEFAULT_BEACON_INTERVAL, slot1); 348 slot1 = max_t(int, DEFAULT_BEACON_INTERVAL, slot1);
349 349
350 if (test_bit(STATUS_SCAN_HW, &priv->status)) { 350 if (test_bit(STATUS_SCAN_HW, &priv->status)) {
351 slot0 = slot1 * 3 - 20; 351 slot0 = slot1 * 3 - IWL_MIN_SLOT_TIME;
352 slot1 = 20; 352 slot1 = IWL_MIN_SLOT_TIME;
353 } 353 }
354 } 354 }
355 355
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 51e5ea4aeb2a..02771ef787fd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3792,7 +3792,7 @@ static int iwl_mac_remain_on_channel(struct ieee80211_hw *hw,
3792 queue_delayed_work(priv->workqueue, &priv->_agn.hw_roc_work, 3792 queue_delayed_work(priv->workqueue, &priv->_agn.hw_roc_work,
3793 msecs_to_jiffies(duration + 20)); 3793 msecs_to_jiffies(duration + 20));
3794 3794
3795 msleep(20); 3795 msleep(IWL_MIN_SLOT_TIME); /* TU is almost ms */
3796 ieee80211_ready_on_channel(priv->hw); 3796 ieee80211_ready_on_channel(priv->hw);
3797 3797
3798 out: 3798 out:
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index abe2479215f0..935b19e2c260 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -4370,6 +4370,11 @@ int iwl_agn_check_rxon_cmd(struct iwl_priv *priv);
4370 * REPLY_WIPAN_PARAMS = 0xb2 (Commands and Notification) 4370 * REPLY_WIPAN_PARAMS = 0xb2 (Commands and Notification)
4371 */ 4371 */
4372 4372
4373/*
4374 * Minimum slot time in TU
4375 */
4376#define IWL_MIN_SLOT_TIME 20
4377
4373/** 4378/**
4374 * struct iwl_wipan_slot 4379 * struct iwl_wipan_slot
4375 * @width: Time in TU 4380 * @width: Time in TU