diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-06-18 14:33:15 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-06-25 18:20:41 -0400 |
commit | cfecc6b492162fb49209a83dc207f182b87ea27a (patch) | |
tree | 1d8ab7172cf202196742c8900983138468f06a37 | |
parent | 0ab84cff8befbea342576cd6dc21026d5c9244df (diff) |
iwlwifi: turn on RTS/CTS after aggregation become operational
If RTS/CTS protection is needed for HT, wait until get operational
notification from mac80211, then inform uCode to switch to RTS/CTS
through RXON command.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 28 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 9 |
3 files changed, 41 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 40933a5de027..35c86d22b14b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -324,18 +324,11 @@ static void rs_tl_turn_on_agg(struct iwl_priv *priv, u8 tid, | |||
324 | struct iwl_lq_sta *lq_data, | 324 | struct iwl_lq_sta *lq_data, |
325 | struct ieee80211_sta *sta) | 325 | struct ieee80211_sta *sta) |
326 | { | 326 | { |
327 | if ((tid < TID_MAX_LOAD_COUNT) && | 327 | if (tid < TID_MAX_LOAD_COUNT) |
328 | !rs_tl_turn_on_agg_for_tid(priv, lq_data, tid, sta)) { | 328 | rs_tl_turn_on_agg_for_tid(priv, lq_data, tid, sta); |
329 | if (priv->cfg->use_rts_for_ht) { | 329 | else |
330 | /* | 330 | IWL_ERR(priv, "tid exceeds max load count: %d/%d\n", |
331 | * switch to RTS/CTS if it is the prefer protection | 331 | tid, TID_MAX_LOAD_COUNT); |
332 | * method for HT traffic | ||
333 | */ | ||
334 | IWL_DEBUG_HT(priv, "use RTS/CTS protection for HT\n"); | ||
335 | priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN; | ||
336 | iwlcore_commit_rxon(priv); | ||
337 | } | ||
338 | } | ||
339 | } | 332 | } |
340 | 333 | ||
341 | static inline int get_num_of_ant_from_rate(u32 rate_n_flags) | 334 | static inline int get_num_of_ant_from_rate(u32 rate_n_flags) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 7488a68b83b1..3368cfd25a99 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -3368,6 +3368,25 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3368 | return ret; | 3368 | return ret; |
3369 | } | 3369 | } |
3370 | 3370 | ||
3371 | /* | ||
3372 | * switch to RTS/CTS for TX | ||
3373 | */ | ||
3374 | static void iwl_enable_rts_cts(struct iwl_priv *priv) | ||
3375 | { | ||
3376 | |||
3377 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | ||
3378 | return; | ||
3379 | |||
3380 | priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN; | ||
3381 | if (!test_bit(STATUS_SCANNING, &priv->status)) { | ||
3382 | IWL_DEBUG_INFO(priv, "use RTS/CTS protection\n"); | ||
3383 | iwlcore_commit_rxon(priv); | ||
3384 | } else { | ||
3385 | /* scanning, defer the request until scan completed */ | ||
3386 | IWL_DEBUG_INFO(priv, "defer setting RTS/CTS protection\n"); | ||
3387 | } | ||
3388 | } | ||
3389 | |||
3371 | static int iwl_mac_ampdu_action(struct ieee80211_hw *hw, | 3390 | static int iwl_mac_ampdu_action(struct ieee80211_hw *hw, |
3372 | struct ieee80211_vif *vif, | 3391 | struct ieee80211_vif *vif, |
3373 | enum ieee80211_ampdu_mlme_action action, | 3392 | enum ieee80211_ampdu_mlme_action action, |
@@ -3416,7 +3435,14 @@ static int iwl_mac_ampdu_action(struct ieee80211_hw *hw, | |||
3416 | ret = 0; | 3435 | ret = 0; |
3417 | break; | 3436 | break; |
3418 | case IEEE80211_AMPDU_TX_OPERATIONAL: | 3437 | case IEEE80211_AMPDU_TX_OPERATIONAL: |
3419 | /* do nothing, return value ignored */ | 3438 | if (priv->cfg->use_rts_for_ht) { |
3439 | /* | ||
3440 | * switch to RTS/CTS if it is the prefer protection | ||
3441 | * method for HT traffic | ||
3442 | */ | ||
3443 | iwl_enable_rts_cts(priv); | ||
3444 | } | ||
3445 | ret = 0; | ||
3420 | break; | 3446 | break; |
3421 | } | 3447 | } |
3422 | mutex_unlock(&priv->mutex); | 3448 | mutex_unlock(&priv->mutex); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 798f93e0ff50..2a7c399fee1e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -537,6 +537,15 @@ void iwl_bg_scan_completed(struct work_struct *work) | |||
537 | /* Since setting the TXPOWER may have been deferred while | 537 | /* Since setting the TXPOWER may have been deferred while |
538 | * performing the scan, fire one off */ | 538 | * performing the scan, fire one off */ |
539 | iwl_set_tx_power(priv, priv->tx_power_user_lmt, true); | 539 | iwl_set_tx_power(priv, priv->tx_power_user_lmt, true); |
540 | |||
541 | /* | ||
542 | * Since setting the RXON may have been deferred while | ||
543 | * performing the scan, fire one off if needed | ||
544 | */ | ||
545 | if (memcmp(&priv->active_rxon, | ||
546 | &priv->staging_rxon, sizeof(priv->staging_rxon))) | ||
547 | iwlcore_commit_rxon(priv); | ||
548 | |||
540 | out: | 549 | out: |
541 | mutex_unlock(&priv->mutex); | 550 | mutex_unlock(&priv->mutex); |
542 | 551 | ||