aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-core.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 8ccb6d205b6d..2c03c6e20a72 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -401,21 +401,38 @@ void iwlcore_free_geos(struct iwl_priv *priv)
401EXPORT_SYMBOL(iwlcore_free_geos); 401EXPORT_SYMBOL(iwlcore_free_geos);
402 402
403/* 403/*
404 * iwlcore_rts_tx_cmd_flag: Set rts/cts. 3945 and 4965 only share this 404 * iwlcore_tx_cmd_protection: Set rts/cts. 3945 and 4965 only share this
405 * function. 405 * function.
406 */ 406 */
407void iwlcore_rts_tx_cmd_flag(struct ieee80211_tx_info *info, 407void iwlcore_tx_cmd_protection(struct iwl_priv *priv,
408 __le32 *tx_flags) 408 struct ieee80211_tx_info *info,
409 __le16 fc, __le32 *tx_flags)
409{ 410{
410 if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) { 411 if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) {
411 *tx_flags |= TX_CMD_FLG_RTS_MSK; 412 *tx_flags |= TX_CMD_FLG_RTS_MSK;
412 *tx_flags &= ~TX_CMD_FLG_CTS_MSK; 413 *tx_flags &= ~TX_CMD_FLG_CTS_MSK;
414 *tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK;
415
416 if (!ieee80211_is_mgmt(fc))
417 return;
418
419 switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) {
420 case cpu_to_le16(IEEE80211_STYPE_AUTH):
421 case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
422 case cpu_to_le16(IEEE80211_STYPE_ASSOC_REQ):
423 case cpu_to_le16(IEEE80211_STYPE_REASSOC_REQ):
424 *tx_flags &= ~TX_CMD_FLG_RTS_MSK;
425 *tx_flags |= TX_CMD_FLG_CTS_MSK;
426 break;
427 }
413 } else if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) { 428 } else if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) {
414 *tx_flags &= ~TX_CMD_FLG_RTS_MSK; 429 *tx_flags &= ~TX_CMD_FLG_RTS_MSK;
415 *tx_flags |= TX_CMD_FLG_CTS_MSK; 430 *tx_flags |= TX_CMD_FLG_CTS_MSK;
431 *tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK;
416 } 432 }
417} 433}
418EXPORT_SYMBOL(iwlcore_rts_tx_cmd_flag); 434EXPORT_SYMBOL(iwlcore_tx_cmd_protection);
435
419 436
420static bool is_single_rx_stream(struct iwl_priv *priv) 437static bool is_single_rx_stream(struct iwl_priv *priv)
421{ 438{
@@ -1869,6 +1886,10 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
1869 priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK; 1886 priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK;
1870 else 1887 else
1871 priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK; 1888 priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK;
1889 if (bss_conf->use_cts_prot)
1890 priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN;
1891 else
1892 priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN;
1872 } 1893 }
1873 1894
1874 if (changes & BSS_CHANGED_BASIC_RATES) { 1895 if (changes & BSS_CHANGED_BASIC_RATES) {