diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2012-08-10 07:16:57 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-08-10 15:27:15 -0400 |
commit | 2e546755b947c08cdc1c4f2bdba70130c6ed0736 (patch) | |
tree | 51099bb38ea808f4fcd001e6bcc0e8329c4af979 /drivers/net | |
parent | 97f7e8a785b9877098d7f255654b25bf85ae9d6a (diff) |
ath9k: Fix RTS/CTS rate selection
The current method of assigning the RTS/CTS rate is completely
broken for HT mode and breaks P2P operation. Fix this by using
the basic_rates provided to the driver by mac80211. For now,
choose the lowest supported basic rate for HT frames.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/rc.c | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 78192c19fe54..a94c52b24a0b 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
@@ -699,37 +699,25 @@ static void ath_rc_rate_set_rtscts(struct ath_softc *sc, | |||
699 | const struct ath_rate_table *rate_table, | 699 | const struct ath_rate_table *rate_table, |
700 | struct ieee80211_tx_info *tx_info) | 700 | struct ieee80211_tx_info *tx_info) |
701 | { | 701 | { |
702 | struct ieee80211_tx_rate *rates = tx_info->control.rates; | 702 | struct ieee80211_bss_conf *bss_conf; |
703 | int i = 0, rix = 0, cix, enable_g_protection = 0; | ||
704 | 703 | ||
705 | /* get the cix for the lowest valid rix */ | 704 | if (!tx_info->control.vif) |
706 | for (i = 3; i >= 0; i--) { | 705 | return; |
707 | if (rates[i].count && (rates[i].idx >= 0)) { | 706 | /* |
708 | rix = ath_rc_get_rateindex(rate_table, &rates[i]); | 707 | * For legacy frames, mac80211 takes care of CTS protection. |
709 | break; | 708 | */ |
710 | } | 709 | if (!(tx_info->control.rates[0].flags & IEEE80211_TX_RC_MCS)) |
711 | } | 710 | return; |
712 | cix = rate_table->info[rix].ctrl_rate; | 711 | |
712 | bss_conf = &tx_info->control.vif->bss_conf; | ||
713 | 713 | ||
714 | /* All protection frames are transmited at 2Mb/s for 802.11g, | 714 | if (!bss_conf->basic_rates) |
715 | * otherwise we transmit them at 1Mb/s */ | 715 | return; |
716 | if (sc->hw->conf.channel->band == IEEE80211_BAND_2GHZ && | ||
717 | !conf_is_ht(&sc->hw->conf)) | ||
718 | enable_g_protection = 1; | ||
719 | 716 | ||
720 | /* | 717 | /* |
721 | * If 802.11g protection is enabled, determine whether to use RTS/CTS or | 718 | * For now, use the lowest allowed basic rate for HT frames. |
722 | * just CTS. Note that this is only done for OFDM/HT unicast frames. | ||
723 | */ | 719 | */ |
724 | if ((tx_info->control.vif && | 720 | tx_info->control.rts_cts_rate_idx = __ffs(bss_conf->basic_rates); |
725 | tx_info->control.vif->bss_conf.use_cts_prot) && | ||
726 | (rate_table->info[rix].phy == WLAN_RC_PHY_OFDM || | ||
727 | WLAN_RC_PHY_HT(rate_table->info[rix].phy))) { | ||
728 | rates[0].flags |= IEEE80211_TX_RC_USE_CTS_PROTECT; | ||
729 | cix = rate_table->info[enable_g_protection].ctrl_rate; | ||
730 | } | ||
731 | |||
732 | tx_info->control.rts_cts_rate_idx = cix; | ||
733 | } | 721 | } |
734 | 722 | ||
735 | static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | 723 | static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, |
@@ -853,7 +841,6 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | |||
853 | rates[0].count = ATH_TXMAXTRY; | 841 | rates[0].count = ATH_TXMAXTRY; |
854 | } | 842 | } |
855 | 843 | ||
856 | /* Setup RTS/CTS */ | ||
857 | ath_rc_rate_set_rtscts(sc, rate_table, tx_info); | 844 | ath_rc_rate_set_rtscts(sc, rate_table, tx_info); |
858 | } | 845 | } |
859 | 846 | ||