]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ath10k: fix the wrong RX rate idx report at 11G mode
authorYanbo Li <yanbol@qca.qualcomm.com>
Thu, 12 Nov 2015 18:36:10 +0000 (10:36 -0800)
committerKalle Valo <kvalo@qca.qualcomm.com>
Mon, 16 Nov 2015 19:48:53 +0000 (21:48 +0200)
The RX rate idx is not correct for 11G mode OFDM packet.
Because the bitrate table start with CCK index instead of OFDM.

Signed-off-by: Yanbo Li <yanbol@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/htt_rx.c
drivers/net/wireless/ath/ath10k/mac.c
drivers/net/wireless/ath/ath10k/mac.h

index d1dc1ba2435eb20f49d788a53f2a8b18da8f0f98..396645b508e226ad884901a94eb06e6a35c3265e 100644 (file)
@@ -674,7 +674,7 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar,
                rate &= ~RX_PPDU_START_RATE_FLAG;
 
                sband = &ar->mac.sbands[status->band];
-               status->rate_idx = ath10k_mac_hw_rate_to_idx(sband, rate);
+               status->rate_idx = ath10k_mac_hw_rate_to_idx(sband, rate, cck);
                break;
        case HTT_RX_HT:
        case HTT_RX_HT_WITH_TXBF:
index 76484a9477550880ba27644fa328a0387b22a8c9..66378544f3c924bb9d8d4b50425c38d7b8bc8c38 100644 (file)
@@ -90,7 +90,7 @@ static u8 ath10k_mac_bitrate_to_rate(int bitrate)
 }
 
 u8 ath10k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,
-                            u8 hw_rate)
+                            u8 hw_rate, bool cck)
 {
        const struct ieee80211_rate *rate;
        int i;
@@ -98,6 +98,9 @@ u8 ath10k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,
        for (i = 0; i < sband->n_bitrates; i++) {
                rate = &sband->bitrates[i];
 
+               if (ath10k_mac_bitrate_is_cck(rate->bitrate) != cck)
+                       continue;
+
                if (rate->hw_value == hw_rate)
                        return i;
                else if (rate->flags & IEEE80211_RATE_SHORT_PREAMBLE &&
index f5048049b870d9a904d03c1a4a18a8a5ad50f8ff..53091588090d0c5645989a347c1d5a95a5033ecb 100644 (file)
@@ -66,7 +66,7 @@ void ath10k_mac_handle_tx_pause_vdev(struct ath10k *ar, u32 vdev_id,
                                     enum wmi_tlv_tx_pause_action action);
 
 u8 ath10k_mac_hw_rate_to_idx(const struct ieee80211_supported_band *sband,
-                            u8 hw_rate);
+                            u8 hw_rate, bool cck);
 u8 ath10k_mac_bitrate_to_idx(const struct ieee80211_supported_band *sband,
                             u32 bitrate);