mac80211: add pending ath9k/ath10k patches
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 311-ath10k-fill-HT-VHT-MCS-rateset-only-for-configured-c.patch
1 From: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
2 Date: Tue, 27 Oct 2015 17:51:12 +0530
3 Subject: [PATCH] ath10k: fill HT/VHT MCS rateset only for configured
4 chainmask
5
6 HT/VHT MCS rateset should be filled only for configured chainmask
7 rather that max supported chainmask. Fix that by checking configured
8 chainmask while filling HT/VHT MCS rate map.
9
10 Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
11 Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 ---
13
14 --- a/drivers/net/wireless/ath/ath10k/mac.c
15 +++ b/drivers/net/wireless/ath/ath10k/mac.c
16 @@ -6984,7 +6984,7 @@ static struct ieee80211_sta_vht_cap ath1
17
18 mcs_map = 0;
19 for (i = 0; i < 8; i++) {
20 - if (i < ar->num_rf_chains)
21 + if ((i < ar->num_rf_chains) && (ar->cfg_tx_chainmask & BIT(i)))
22 mcs_map |= IEEE80211_VHT_MCS_SUPPORT_0_9 << (i*2);
23 else
24 mcs_map |= IEEE80211_VHT_MCS_NOT_SUPPORTED << (i*2);
25 @@ -7051,8 +7051,10 @@ static struct ieee80211_sta_ht_cap ath10
26 if (ar->vht_cap_info & WMI_VHT_CAP_MAX_MPDU_LEN_MASK)
27 ht_cap.cap |= IEEE80211_HT_CAP_MAX_AMSDU;
28
29 - for (i = 0; i < ar->num_rf_chains; i++)
30 - ht_cap.mcs.rx_mask[i] = 0xFF;
31 + for (i = 0; i < ar->num_rf_chains; i++) {
32 + if (ar->cfg_rx_chainmask & BIT(i))
33 + ht_cap.mcs.rx_mask[i] = 0xFF;
34 + }
35
36 ht_cap.mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED;
37