]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
wifi: ath12k: fix survey dump collection in 6 GHz
authorPradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Wed, 8 May 2024 17:36:52 +0000 (10:36 -0700)
committerKalle Valo <quic_kvalo@quicinc.com>
Thu, 16 May 2024 08:13:58 +0000 (11:13 +0300)
When ath12k receives survey request, choose the 6 GHz band
when enabled. Without this, survey requests do not include
any 6 GHz band results, leading to failures in auto channel
selection.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240508173655.22191-4-quic_pradeepc@quicinc.com
drivers/net/wireless/ath/ath12k/mac.c

index ae9f41a17b4f6c19276a68b914532b4eeadc4d64..8af450cdace6608975740214aec0ef7aeb0492ce 100644 (file)
@@ -8031,6 +8031,17 @@ static int ath12k_mac_op_get_survey(struct ieee80211_hw *hw, int idx,
 
        if (!sband)
                sband = hw->wiphy->bands[NL80211_BAND_5GHZ];
+       if (sband && idx >= sband->n_channels) {
+               idx -= sband->n_channels;
+               sband = NULL;
+       }
+
+       if (!sband)
+               sband = hw->wiphy->bands[NL80211_BAND_6GHZ];
+       if (!sband || idx >= sband->n_channels) {
+               idx -= sband->n_channels;
+               sband = NULL;
+       }
 
        if (!sband || idx >= sband->n_channels)
                return -ENOENT;