Commit 3742928a authored by Wen Gong's avatar Wen Gong Committed by Kalle Valo
Browse files

wifi: ath12k: change to use dynamic memory for channel list of scan



Currently there are about 60 channels for 6 GHz, then the size of
chan_list in struct scan_req_params which is 40 is not enough to
fill all the channel list of 6 GHz.

Use dynamic memory to save the channel list of scan.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230717033431.21983-1-quic_wgong@quicinc.com
parent 68c35cc3
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2773,6 +2773,14 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw,

	if (req->n_channels) {
		arg.num_chan = req->n_channels;
		arg.chan_list = kcalloc(arg.num_chan, sizeof(*arg.chan_list),
					GFP_KERNEL);

		if (!arg.chan_list) {
			ret = -ENOMEM;
			goto exit;
		}

		for (i = 0; i < arg.num_chan; i++)
			arg.chan_list[i] = req->channels[i]->center_freq;
	}
@@ -2791,6 +2799,8 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw,
						      ATH12K_MAC_SCAN_TIMEOUT_MSECS));

exit:
	kfree(arg.chan_list);

	if (req->ie_len)
		kfree(arg.extraie.ptr);

+1 −2
Original line number Diff line number Diff line
@@ -3034,7 +3034,6 @@ enum scan_dwelltime_adaptive_mode {

#define WLAN_SCAN_MAX_NUM_SSID          10
#define WLAN_SCAN_MAX_NUM_BSSID         10
#define WLAN_SCAN_MAX_NUM_CHANNELS      40

struct ath12k_wmi_element_info_arg {
	u32 len;
@@ -3243,7 +3242,7 @@ struct ath12k_wmi_scan_req_arg {
	u32 num_bssid;
	u32 num_ssids;
	u32 n_probes;
	u32 chan_list[WLAN_SCAN_MAX_NUM_CHANNELS];
	u32 *chan_list;
	u32 notify_scan_events;
	struct cfg80211_ssid ssid[WLAN_SCAN_MAX_NUM_SSID];
	struct ath12k_wmi_mac_addr_params bssid_list[WLAN_SCAN_MAX_NUM_BSSID];