Skip to content

Commit cea7f78

Browse files
Wen Gongkvalo
authored andcommitted
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: Wen Gong <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 18ae1ab commit cea7f78

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

drivers/net/wireless/ath/ath11k/mac.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3501,6 +3501,14 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw,
35013501

35023502
if (req->n_channels) {
35033503
arg.num_chan = req->n_channels;
3504+
arg.chan_list = kcalloc(arg.num_chan, sizeof(*arg.chan_list),
3505+
GFP_KERNEL);
3506+
3507+
if (!arg.chan_list) {
3508+
ret = -ENOMEM;
3509+
goto exit;
3510+
}
3511+
35043512
for (i = 0; i < arg.num_chan; i++)
35053513
arg.chan_list[i] = req->channels[i]->center_freq;
35063514
}
@@ -3519,6 +3527,8 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw,
35193527
ATH11K_MAC_SCAN_TIMEOUT_MSECS));
35203528

35213529
exit:
3530+
kfree(arg.chan_list);
3531+
35223532
if (req->ie_len)
35233533
kfree(arg.extraie.ptr);
35243534

drivers/net/wireless/ath/ath11k/wmi.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3082,7 +3082,6 @@ enum scan_dwelltime_adaptive_mode {
30823082

30833083
#define WLAN_SCAN_MAX_NUM_SSID 10
30843084
#define WLAN_SCAN_MAX_NUM_BSSID 10
3085-
#define WLAN_SCAN_MAX_NUM_CHANNELS 40
30863085

30873086
#define WLAN_SSID_MAX_LEN 32
30883087

@@ -3303,7 +3302,7 @@ struct scan_req_params {
33033302
u32 num_bssid;
33043303
u32 num_ssids;
33053304
u32 n_probes;
3306-
u32 chan_list[WLAN_SCAN_MAX_NUM_CHANNELS];
3305+
u32 *chan_list;
33073306
u32 notify_scan_events;
33083307
struct wlan_ssid ssid[WLAN_SCAN_MAX_NUM_SSID];
33093308
struct wmi_mac_addr bssid_list[WLAN_SCAN_MAX_NUM_BSSID];

0 commit comments

Comments
 (0)