Commit cea7f78d authored by Wen Gong's avatar Wen Gong Committed by Kalle Valo

ath11k: 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: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
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/20211129110939.15711-1-quic_wgong@quicinc.com
parent 18ae1ab0
...@@ -3501,6 +3501,14 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw, ...@@ -3501,6 +3501,14 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw,
if (req->n_channels) { if (req->n_channels) {
arg.num_chan = 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++) for (i = 0; i < arg.num_chan; i++)
arg.chan_list[i] = req->channels[i]->center_freq; arg.chan_list[i] = req->channels[i]->center_freq;
} }
...@@ -3519,6 +3527,8 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw, ...@@ -3519,6 +3527,8 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw,
ATH11K_MAC_SCAN_TIMEOUT_MSECS)); ATH11K_MAC_SCAN_TIMEOUT_MSECS));
exit: exit:
kfree(arg.chan_list);
if (req->ie_len) if (req->ie_len)
kfree(arg.extraie.ptr); kfree(arg.extraie.ptr);
......
...@@ -3082,7 +3082,6 @@ enum scan_dwelltime_adaptive_mode { ...@@ -3082,7 +3082,6 @@ enum scan_dwelltime_adaptive_mode {
#define WLAN_SCAN_MAX_NUM_SSID 10 #define WLAN_SCAN_MAX_NUM_SSID 10
#define WLAN_SCAN_MAX_NUM_BSSID 10 #define WLAN_SCAN_MAX_NUM_BSSID 10
#define WLAN_SCAN_MAX_NUM_CHANNELS 40
#define WLAN_SSID_MAX_LEN 32 #define WLAN_SSID_MAX_LEN 32
...@@ -3303,7 +3302,7 @@ struct scan_req_params { ...@@ -3303,7 +3302,7 @@ struct scan_req_params {
u32 num_bssid; u32 num_bssid;
u32 num_ssids; u32 num_ssids;
u32 n_probes; u32 n_probes;
u32 chan_list[WLAN_SCAN_MAX_NUM_CHANNELS]; u32 *chan_list;
u32 notify_scan_events; u32 notify_scan_events;
struct wlan_ssid ssid[WLAN_SCAN_MAX_NUM_SSID]; struct wlan_ssid ssid[WLAN_SCAN_MAX_NUM_SSID];
struct wmi_mac_addr bssid_list[WLAN_SCAN_MAX_NUM_BSSID]; struct wmi_mac_addr bssid_list[WLAN_SCAN_MAX_NUM_BSSID];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment