wlan-ap-Telecominfraproject/feeds/ipq95xx/mac80211/patches/qca/352-mac80211-allow-nss-change-only-upto-max_nss.patch
John Crispin 144c5d00f4 ipq95xx/mac80211: update to ATH12.3-CS
Signed-off-by: John Crispin <john@phrozen.org>
2024-02-28 18:56:21 +01:00

85 lines
3.4 KiB
Diff

From a9f303fac615abea52fca82a54c8a84d34fd91bc Mon Sep 17 00:00:00 2001
From: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Date: Thu, 7 Apr 2022 15:12:09 +0530
Subject: [PATCH] mac80211: allow nss change only upto max_nss
Stations can update Bandwidth/nss change in
VHT action frame with action type Operating Mode Notification
IEEE Std 802.11ac - 8.4.1.50 Operating Mode field.
For Operating Mode Notification allow rx_nss change only
upto max_nss that is negotiated during association.
During VHT action frame Anamoly injection test, nss change with
nss = 7 is sent whereas AP supports only 4x4 NSS.
Due to this FW asserts are seen as during sta_rc_update host will try to
set nss of associated peer to a value greater than NSS supported by AP.
[ 511.244423] ath11k_pci 0004:01:00.0: mac update sta 00:c0:ca:a8:6a:d4 nss 7
[ 511.253268] ath11k_pci 0004:01:00.0: WMI vdev 2 peer 0x00:c0:ca:a8:6a:d4 set param 5 value 7
[ 511.364859] ath11k_pci 0004:01:00.0: mhi notify status reason MHI_CB_EE_RDDM
[ 511.373613] ath11k_pci 0004:01:00.0: reset starting
[ 511.459150] mhi mhi1: CRASHED - [DID:DOMAIN:BUS:SLOT] - 1104:0004:01:00
[ 511.459260] mhi mhi1: Fatal error received from wcss software!
[ 511.459260]
[ 511.459260] QC Image Version: QC_IMAGE_VERSION_STRING=WLAN.HK.2.7.0.1-01468-QCAHKSWPL_SILICONZ-1
[ 511.459260] Image Variant : IMAGE_VARIANT_STRING=9000.wlanfw.eval_v1Q
[ 511.459260] Oem Image Version: OEM_IMAGE_VERSION_STRING=ip-10-195-205-232
[ 511.459260] Oem Image UUID: OEM_IMAGE_UUID_STRING=Q_SENTINEL_{81A6C1BD-EB68-4203-A7DD-90F239087A32}_20220330_0758
[ 511.459260]
[ 511.459260] ratectrl.c:2597 Assertion num_nss <= 4 failedparam0 :zero, param1 :zero, param2 :zero.
[ 511.459260] Thread ID : 0x00000014 Thread name : WLAN_SCHED0 Process ID : 0
[ 511.459260] Register:
[ 511.459260] SP : 0x01629640
[ 511.459260] FP : 0x01629648
[ 511.459260] PC : 0x0082ecd8
[ 511.459260] SSR : 0x00000008
[ 511.459260] BADVA : 0x018015a8
[ 511.459260] LR : 0x0082ed80
Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
---
net/mac80211/vht.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
--- a/net/mac80211/vht.c
+++ b/net/mac80211/vht.c
@@ -614,7 +614,7 @@ u32 __ieee80211_vht_handle_opmode(struct
enum ieee80211_sta_rx_bandwidth new_bw;
struct sta_opmode_info sta_opmode = {};
u32 changed = 0;
- u8 nss;
+ u8 nss, cur_nss;
/* ignore - no support for BF yet */
if (opmode & IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF)
@@ -625,10 +625,24 @@ u32 __ieee80211_vht_handle_opmode(struct
nss += 1;
if (link_sta->pub->rx_nss != nss) {
- link_sta->pub->rx_nss = nss;
- sta_opmode.rx_nss = nss;
- changed |= IEEE80211_RC_NSS_CHANGED;
- sta_opmode.changed |= STA_OPMODE_N_SS_CHANGED;
+ cur_nss = link_sta->pub->rx_nss;
+ link_sta->pub->rx_nss = 0;
+ ieee80211_sta_set_rx_nss(link_sta);
+ /*
+ * Do not allow an nss change to rx_nss greater than max_nss
+ * negotiated during association.
+ */
+ if (nss <= link_sta->pub->rx_nss) {
+ link_sta->pub->rx_nss = nss;
+ sta_opmode.rx_nss = nss;
+ changed |= IEEE80211_RC_NSS_CHANGED;
+ sta_opmode.changed |= STA_OPMODE_N_SS_CHANGED;
+ } else {
+ link_sta->pub->rx_nss = cur_nss;
+ pr_warn_ratelimited("Ignoring VHT Operating Mode Notification from STA"
+ " %pM with invalid nss %d",
+ link_sta->pub->addr, nss);
+ }
}
switch (opmode & IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK) {