diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-08-09 13:57:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-09 15:18:57 -0400 |
commit | 94597ab23ea10b3bdcba534be00a9f7b35791c07 (patch) | |
tree | f896a856c542b5f4f5623670bcf112a3b83f65a9 /drivers/net/wireless/iwlwifi/iwl-agn-tx.c | |
parent | fe100acddf438591ecf3582cb57241e560da70b7 (diff) |
iwlagn: fix rts cts protection
Currently the driver will try to protect all frames,
which leads to a lot of odd things like sending an
RTS with a zeroed RA before multicast frames, which
is clearly bogus.
In order to fix all of this, we need to take a step
back and see what we need to achieve:
* we need RTS/CTS protection if requested by
the AP for the BSS, mac80211 tells us this
* in that case, CTS-to-self should only be
enabled when mac80211 tells us
* additionally, as a hardware workaround, on
some devices we have to protect aggregated
frames with RTS
To achieve the first two items, set up the RXON
accordingly and set the protection required flag
in the transmit command when mac80211 requests
protection for the frame.
To achieve the last item, set the rate-control
RTS-requested flag for all stations that we have
aggregation sessions with, and set the protection
required flag when sending aggregated frames (on
those devices where this is required).
Since otherwise bugs can occur, do not allow the
user to override the RTS-for-aggregation setting
from sysfs any more.
Finally, also clean up the way all these flags get
set in the driver and move everything into the
device-specific functions.
Cc: stable@kernel.org [2.6.35]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-tx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c index d04502d54df3..69155aa448fb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c | |||
@@ -379,10 +379,7 @@ static void iwlagn_tx_cmd_build_basic(struct iwl_priv *priv, | |||
379 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; | 379 | tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; |
380 | } | 380 | } |
381 | 381 | ||
382 | priv->cfg->ops->utils->rts_tx_cmd_flag(info, &tx_flags); | 382 | priv->cfg->ops->utils->tx_cmd_protection(priv, info, fc, &tx_flags); |
383 | |||
384 | if ((tx_flags & TX_CMD_FLG_RTS_MSK) || (tx_flags & TX_CMD_FLG_CTS_MSK)) | ||
385 | tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; | ||
386 | 383 | ||
387 | tx_flags &= ~(TX_CMD_FLG_ANT_SEL_MSK); | 384 | tx_flags &= ~(TX_CMD_FLG_ANT_SEL_MSK); |
388 | if (ieee80211_is_mgmt(fc)) { | 385 | if (ieee80211_is_mgmt(fc)) { |
@@ -456,21 +453,6 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv, | |||
456 | if ((rate_idx >= IWL_FIRST_CCK_RATE) && (rate_idx <= IWL_LAST_CCK_RATE)) | 453 | if ((rate_idx >= IWL_FIRST_CCK_RATE) && (rate_idx <= IWL_LAST_CCK_RATE)) |
457 | rate_flags |= RATE_MCS_CCK_MSK; | 454 | rate_flags |= RATE_MCS_CCK_MSK; |
458 | 455 | ||
459 | /* Set up RTS and CTS flags for certain packets */ | ||
460 | switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) { | ||
461 | case cpu_to_le16(IEEE80211_STYPE_AUTH): | ||
462 | case cpu_to_le16(IEEE80211_STYPE_DEAUTH): | ||
463 | case cpu_to_le16(IEEE80211_STYPE_ASSOC_REQ): | ||
464 | case cpu_to_le16(IEEE80211_STYPE_REASSOC_REQ): | ||
465 | if (tx_cmd->tx_flags & TX_CMD_FLG_RTS_MSK) { | ||
466 | tx_cmd->tx_flags &= ~TX_CMD_FLG_RTS_MSK; | ||
467 | tx_cmd->tx_flags |= TX_CMD_FLG_CTS_MSK; | ||
468 | } | ||
469 | break; | ||
470 | default: | ||
471 | break; | ||
472 | } | ||
473 | |||
474 | /* Set up antennas */ | 456 | /* Set up antennas */ |
475 | priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, | 457 | priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, |
476 | priv->hw_params.valid_tx_ant); | 458 | priv->hw_params.valid_tx_ant); |