1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Thu, 17 Sep 2020 12:07:19 +0200
3 Subject: [PATCH] mac80211: do not allow bigger VHT MPDUs than the hardware
6 Limit maximum VHT MPDU size by local capability
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 --- a/net/mac80211/vht.c
12 +++ b/net/mac80211/vht.c
13 @@ -168,10 +168,7 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(stru
14 /* take some capabilities as-is */
15 cap_info = le32_to_cpu(vht_cap_ie->vht_cap_info);
16 vht_cap->cap = cap_info;
17 - vht_cap->cap &= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 |
18 - IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 |
19 - IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 |
20 - IEEE80211_VHT_CAP_RXLDPC |
21 + vht_cap->cap &= IEEE80211_VHT_CAP_RXLDPC |
22 IEEE80211_VHT_CAP_VHT_TXOP_PS |
23 IEEE80211_VHT_CAP_HTC_VHT |
24 IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK |
25 @@ -180,6 +177,9 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(stru
26 IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN |
27 IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN;
29 + vht_cap->cap |= min_t(u32, cap_info & IEEE80211_VHT_CAP_MAX_MPDU_MASK,
30 + own_cap.cap & IEEE80211_VHT_CAP_MAX_MPDU_MASK);
32 /* and some based on our own capabilities */
33 switch (own_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) {
34 case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ: