a2c9d597cec0a26d95f506d5d1613a2851a1cecc
[openwrt/staging/jow.git] /
1 From: Johannes Berg <johannes.berg@intel.com>
2 Date: Fri, 9 Apr 2021 12:40:20 +0300
3 Subject: [PATCH] wireless: align HE capabilities A-MPDU Length Exponent
4 Extension
5
6 The A-MPDU length exponent extension is defined differently in
7 802.11ax D6.1, align with that.
8
9 Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
10 Link: https://lore.kernel.org/r/iwlwifi.20210409123755.c2a257d3e2df.I3455245d388c52c61dace7e7958dbed7e807cfb6@changeid
11 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 ---
13
14 --- a/drivers/net/wireless/ath/ath11k/mac.c
15 +++ b/drivers/net/wireless/ath/ath11k/mac.c
16 @@ -1290,9 +1290,8 @@ static void ath11k_peer_assoc_h_he(struc
17 * request, then use MAX_AMPDU_LEN_FACTOR as 16 to calculate max_ampdu
18 * length.
19 */
20 - ampdu_factor = (he_cap->he_cap_elem.mac_cap_info[3] &
21 - IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK) >>
22 - IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_SHIFT;
23 + ampdu_factor = u8_get_bits(he_cap->he_cap_elem.mac_cap_info[3],
24 + IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK);
25
26 if (ampdu_factor) {
27 if (sta->vht_cap.vht_supported)
28 --- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
29 +++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
30 @@ -596,7 +596,7 @@ static struct ieee80211_sband_iftype_dat
31 IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP,
32 .mac_cap_info[3] =
33 IEEE80211_HE_MAC_CAP3_OMI_CONTROL |
34 - IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2,
35 + IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_2,
36 .mac_cap_info[4] =
37 IEEE80211_HE_MAC_CAP4_AMSDU_IN_AMPDU |
38 IEEE80211_HE_MAC_CAP4_MULTI_TID_AGG_TX_QOS_B39,
39 @@ -680,7 +680,7 @@ static struct ieee80211_sband_iftype_dat
40 IEEE80211_HE_MAC_CAP2_BSR,
41 .mac_cap_info[3] =
42 IEEE80211_HE_MAC_CAP3_OMI_CONTROL |
43 - IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2,
44 + IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_2,
45 .mac_cap_info[4] =
46 IEEE80211_HE_MAC_CAP4_AMSDU_IN_AMPDU,
47 .mac_cap_info[5] =
48 --- a/drivers/net/wireless/mac80211_hwsim.c
49 +++ b/drivers/net/wireless/mac80211_hwsim.c
50 @@ -2817,7 +2817,7 @@ static const struct ieee80211_sband_ifty
51 IEEE80211_HE_MAC_CAP2_ACK_EN,
52 .mac_cap_info[3] =
53 IEEE80211_HE_MAC_CAP3_OMI_CONTROL |
54 - IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2,
55 + IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3,
56 .mac_cap_info[4] = IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU,
57 .phy_cap_info[1] =
58 IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK |
59 @@ -2861,7 +2861,7 @@ static const struct ieee80211_sband_ifty
60 IEEE80211_HE_MAC_CAP2_ACK_EN,
61 .mac_cap_info[3] =
62 IEEE80211_HE_MAC_CAP3_OMI_CONTROL |
63 - IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2,
64 + IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3,
65 .mac_cap_info[4] = IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU,
66 .phy_cap_info[1] =
67 IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK |
68 @@ -2907,7 +2907,7 @@ static const struct ieee80211_sband_ifty
69 IEEE80211_HE_MAC_CAP2_ACK_EN,
70 .mac_cap_info[3] =
71 IEEE80211_HE_MAC_CAP3_OMI_CONTROL |
72 - IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2,
73 + IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3,
74 .mac_cap_info[4] = IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU,
75 .phy_cap_info[0] =
76 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G |
77 @@ -2955,7 +2955,7 @@ static const struct ieee80211_sband_ifty
78 IEEE80211_HE_MAC_CAP2_ACK_EN,
79 .mac_cap_info[3] =
80 IEEE80211_HE_MAC_CAP3_OMI_CONTROL |
81 - IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2,
82 + IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3,
83 .mac_cap_info[4] = IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU,
84 .phy_cap_info[0] =
85 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G |
86 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
87 +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
88 @@ -425,7 +425,7 @@ mt7915_init_he_caps(struct mt7915_phy *p
89 IEEE80211_HE_MAC_CAP0_HTC_HE;
90 he_cap_elem->mac_cap_info[3] =
91 IEEE80211_HE_MAC_CAP3_OMI_CONTROL |
92 - IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_RESERVED;
93 + IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3;
94 he_cap_elem->mac_cap_info[4] =
95 IEEE80211_HE_MAC_CAP4_AMSDU_IN_AMPDU;
96
97 --- a/include/linux/ieee80211.h
98 +++ b/include/linux/ieee80211.h
99 @@ -2051,17 +2051,15 @@ int ieee80211_get_vht_max_nss(struct iee
100 * A-MDPU Length Exponent field in the HT capabilities, VHT capabilities and the
101 * same field in the HE capabilities.
102 */
103 -#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_USE_VHT 0x00
104 -#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_1 0x08
105 -#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2 0x10
106 -#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_RESERVED 0x18
107 +#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_0 0x00
108 +#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_1 0x08
109 +#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_2 0x10
110 +#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3 0x18
111 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK 0x18
112 #define IEEE80211_HE_MAC_CAP3_AMSDU_FRAG 0x20
113 #define IEEE80211_HE_MAC_CAP3_FLEX_TWT_SCHED 0x40
114 #define IEEE80211_HE_MAC_CAP3_RX_CTRL_FRAME_TO_MULTIBSS 0x80
115
116 -#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_SHIFT 3
117 -
118 #define IEEE80211_HE_MAC_CAP4_BSRP_BQRP_A_MPDU_AGG 0x01
119 #define IEEE80211_HE_MAC_CAP4_QTP 0x02
120 #define IEEE80211_HE_MAC_CAP4_BQR 0x04
121 --- a/net/mac80211/debugfs_sta.c
122 +++ b/net/mac80211/debugfs_sta.c
123 @@ -711,17 +711,17 @@ static ssize_t sta_he_capa_read(struct f
124 PFLAG(MAC, 3, OFDMA_RA, "OFDMA-RA");
125
126 switch (cap[3] & IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK) {
127 - case IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_USE_VHT:
128 - PRINT("MAX-AMPDU-LEN-EXP-USE-VHT");
129 + case IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_0:
130 + PRINT("MAX-AMPDU-LEN-EXP-USE-EXT-0");
131 break;
132 - case IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_1:
133 - PRINT("MAX-AMPDU-LEN-EXP-VHT-1");
134 + case IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_1:
135 + PRINT("MAX-AMPDU-LEN-EXP-VHT-EXT-1");
136 break;
137 - case IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2:
138 - PRINT("MAX-AMPDU-LEN-EXP-VHT-2");
139 + case IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_2:
140 + PRINT("MAX-AMPDU-LEN-EXP-VHT-EXT-2");
141 break;
142 - case IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_RESERVED:
143 - PRINT("MAX-AMPDU-LEN-EXP-RESERVED");
144 + case IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3:
145 + PRINT("MAX-AMPDU-LEN-EXP-VHT-EXT-3");
146 break;
147 }
148