diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2008-12-23 18:58:38 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:59:28 -0500 |
commit | 96742256aba8c458d49af42610557977245be82d (patch) | |
tree | 5eef9aae2a70bf76fa39758837566e3c1ac0cafc /drivers/net/wireless/ath9k/xmit.c | |
parent | 030bb495c0c34aa74903ab8cf9c35e4f2f0aedea (diff) |
ath9k: remove cache of rate preference when using 11g protection
No need to cache when we want to use 2Mbit/s for all protection
frames for 802.11g as we can determine that dynamically on
ath_buf_set_rate() itself.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/xmit.c')
-rw-r--r-- | drivers/net/wireless/ath9k/xmit.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index c92f0c6e4adc..3e192fd9591c 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -546,7 +546,8 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | |||
546 | struct ieee80211_tx_info *tx_info; | 546 | struct ieee80211_tx_info *tx_info; |
547 | struct ieee80211_tx_rate *rates; | 547 | struct ieee80211_tx_rate *rates; |
548 | struct ieee80211_hdr *hdr; | 548 | struct ieee80211_hdr *hdr; |
549 | int i, flags, rtsctsena = 0; | 549 | struct ieee80211_hw *hw = sc->hw; |
550 | int i, flags, rtsctsena = 0, enable_g_protection = 0; | ||
550 | u32 ctsduration = 0; | 551 | u32 ctsduration = 0; |
551 | u8 rix = 0, cix, ctsrate = 0; | 552 | u8 rix = 0, cix, ctsrate = 0; |
552 | __le16 fc; | 553 | __le16 fc; |
@@ -578,6 +579,12 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | |||
578 | flags = (bf->bf_flags & (ATH9K_TXDESC_RTSENA | ATH9K_TXDESC_CTSENA)); | 579 | flags = (bf->bf_flags & (ATH9K_TXDESC_RTSENA | ATH9K_TXDESC_CTSENA)); |
579 | cix = rt->info[rix].ctrl_rate; | 580 | cix = rt->info[rix].ctrl_rate; |
580 | 581 | ||
582 | /* All protection frames are transmited at 2Mb/s for 802.11g, | ||
583 | * otherwise we transmit them at 1Mb/s */ | ||
584 | if (hw->conf.channel->band == IEEE80211_BAND_2GHZ && | ||
585 | !conf_is_ht(&hw->conf)) | ||
586 | enable_g_protection = 1; | ||
587 | |||
581 | /* | 588 | /* |
582 | * If 802.11g protection is enabled, determine whether to use RTS/CTS or | 589 | * If 802.11g protection is enabled, determine whether to use RTS/CTS or |
583 | * just CTS. Note that this is only done for OFDM/HT unicast frames. | 590 | * just CTS. Note that this is only done for OFDM/HT unicast frames. |
@@ -590,7 +597,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | |||
590 | else if (sc->sc_protmode == PROT_M_CTSONLY) | 597 | else if (sc->sc_protmode == PROT_M_CTSONLY) |
591 | flags = ATH9K_TXDESC_CTSENA; | 598 | flags = ATH9K_TXDESC_CTSENA; |
592 | 599 | ||
593 | cix = rt->info[sc->sc_protrix].ctrl_rate; | 600 | cix = rt->info[enable_g_protection].ctrl_rate; |
594 | rtsctsena = 1; | 601 | rtsctsena = 1; |
595 | } | 602 | } |
596 | 603 | ||
@@ -608,7 +615,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | |||
608 | if (sc->sc_config.ath_aggr_prot && | 615 | if (sc->sc_config.ath_aggr_prot && |
609 | (!bf_isaggr(bf) || (bf_isaggr(bf) && bf->bf_al < 8192))) { | 616 | (!bf_isaggr(bf) || (bf_isaggr(bf) && bf->bf_al < 8192))) { |
610 | flags = ATH9K_TXDESC_RTSENA; | 617 | flags = ATH9K_TXDESC_RTSENA; |
611 | cix = rt->info[sc->sc_protrix].ctrl_rate; | 618 | cix = rt->info[enable_g_protection].ctrl_rate; |
612 | rtsctsena = 1; | 619 | rtsctsena = 1; |
613 | } | 620 | } |
614 | 621 | ||