wifi: ath12k: incorrect channel survey dump
authorHarshitha Prem <quic_hprem@quicinc.com>
Mon, 20 Mar 2023 09:12:08 +0000 (14:42 +0530)
committerKalle Valo <quic_kvalo@quicinc.com>
Fri, 24 Mar 2023 14:49:31 +0000 (16:49 +0200)
commit25d165c498025f401eed6503f03115c1fb896c47
tree0d7606292592df8a3458e6967285b1bf4527c19b
parent392b6b76fd3940ba9978ecd8fe30d9ed979d3bf7
wifi: ath12k: incorrect channel survey dump

When underlying hardware supports more than one band, then wiphy
is aware of all the frequency bands present. Example, say
wiphy0 is aware of 2 GHz, 5 GHz and 6 GHz band information.
Hence, when an virtual AP interface is brought up in auto channel
selection on each band. Survey is initiated from the userspace application
for all the virtual AP interfaces simultaneously.

For survey dump collection, freq_to_idx() api is used to map the index of
particular frequency to populate its survey. When the dump was collected,
the index fetched was incorrect. Example, in case of multi-hardware,
the index of channel 36 was reported as 14, because wiphy0 had index 0-13
for 2 GHz channels, instead of 0 for that ar which resulted in invalid
survey sent to userspace application.

The incorrect index was because of the mapping did not consider whether
the freq band is present in its radio structure (ar) or not.

To handle this, the freq_to_idx() api should map index for the
particular band in the ar structure.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1

Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230320091208.25535-1-quic_hprem@quicinc.com
drivers/net/wireless/ath/ath12k/wmi.c