diff options
-rw-r--r-- | drivers/net/wireless/ath9k/core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/xmit.c | 13 |
3 files changed, 13 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index 4ca2aed236e0..2bb35dda6b94 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h | |||
@@ -718,7 +718,6 @@ struct ath_softc { | |||
718 | u32 sc_keymax; | 718 | u32 sc_keymax; |
719 | DECLARE_BITMAP(sc_keymap, ATH_KEYMAX); | 719 | DECLARE_BITMAP(sc_keymap, ATH_KEYMAX); |
720 | u8 sc_splitmic; | 720 | u8 sc_splitmic; |
721 | u8 sc_protrix; | ||
722 | enum ath9k_int sc_imask; | 721 | enum ath9k_int sc_imask; |
723 | enum PROT_MODE sc_protmode; | 722 | enum PROT_MODE sc_protmode; |
724 | enum ath9k_ht_extprotspacing sc_ht_extprotspacing; | 723 | enum ath9k_ht_extprotspacing sc_ht_extprotspacing; |
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 699d248efc4c..e26a9a6fbfcf 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -61,12 +61,6 @@ static void bus_read_cachesize(struct ath_softc *sc, int *csz) | |||
61 | 61 | ||
62 | static void ath_setcurmode(struct ath_softc *sc, struct ieee80211_conf *conf) | 62 | static void ath_setcurmode(struct ath_softc *sc, struct ieee80211_conf *conf) |
63 | { | 63 | { |
64 | /* | ||
65 | * All protection frames are transmited at 2Mb/s for | ||
66 | * 11g, otherwise at 1Mb/s. | ||
67 | * XXX select protection rate index from rate table. | ||
68 | */ | ||
69 | sc->sc_protrix = 0; | ||
70 | switch (conf->channel->band) { | 64 | switch (conf->channel->band) { |
71 | case IEEE80211_BAND_2GHZ: | 65 | case IEEE80211_BAND_2GHZ: |
72 | if (conf_is_ht20(conf)) | 66 | if (conf_is_ht20(conf)) |
@@ -78,11 +72,9 @@ static void ath_setcurmode(struct ath_softc *sc, struct ieee80211_conf *conf) | |||
78 | else if (conf_is_ht40_plus(conf)) | 72 | else if (conf_is_ht40_plus(conf)) |
79 | sc->cur_rate_table = | 73 | sc->cur_rate_table = |
80 | sc->hw_rate_table[ATH9K_MODE_11NG_HT40PLUS]; | 74 | sc->hw_rate_table[ATH9K_MODE_11NG_HT40PLUS]; |
81 | else { | 75 | else |
82 | sc->sc_protrix = 1; | ||
83 | sc->cur_rate_table = | 76 | sc->cur_rate_table = |
84 | sc->hw_rate_table[ATH9K_MODE_11G]; | 77 | sc->hw_rate_table[ATH9K_MODE_11G]; |
85 | } | ||
86 | break; | 78 | break; |
87 | case IEEE80211_BAND_5GHZ: | 79 | case IEEE80211_BAND_5GHZ: |
88 | if (conf_is_ht20(conf)) | 80 | if (conf_is_ht20(conf)) |
@@ -95,7 +87,8 @@ static void ath_setcurmode(struct ath_softc *sc, struct ieee80211_conf *conf) | |||
95 | sc->cur_rate_table = | 87 | sc->cur_rate_table = |
96 | sc->hw_rate_table[ATH9K_MODE_11NA_HT40PLUS]; | 88 | sc->hw_rate_table[ATH9K_MODE_11NA_HT40PLUS]; |
97 | else | 89 | else |
98 | sc->cur_rate_table = sc->hw_rate_table[ATH9K_MODE_11A]; | 90 | sc->cur_rate_table = |
91 | sc->hw_rate_table[ATH9K_MODE_11A]; | ||
99 | break; | 92 | break; |
100 | default: | 93 | default: |
101 | break; | 94 | break; |
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 | ||