From 0f16cba633db41d32a35b6da46d55d6f9490fac4 Mon Sep 17 00:00:00 2001 From: Abhijit Pradhan Date: Mon, 25 Nov 2019 14:07:17 +0530 Subject: [PATCH] qcacmn: Control the size of the freq and chan_num (Scan) Depending on the requirement, a bigger size or a smaller size for the frequency variable can be chosen. The advantages of each size are described below:- Advantage of a bigger size: When two technologies (e.g. 802.11AX and 802.11AD ) are controlled by the same driver software, the frequency range may be very large and a bigger size (e.g. 32bit integer) is more appropriate. Advantage of a smaller size: When the frequency range is not very large, a smaller size(e.g. 16bit integer) can be used. It saves a large amount of space especially when many large arrays containing elements of this type/size are defined in the driver. Also, change the size of the IEEE channel variables to unsigned 8-bit integer. Change-Id: Ie503623ec6e4473abe8ee95c19dc4470853326dd CRs-Fixed: 2586177 --- umac/scan/dispatcher/inc/wlan_scan_public_structs.h | 4 ++-- umac/scan/dispatcher/src/wlan_scan_ucfg_api.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h index 98ef25fcb4af..fde2a5a55ad0 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h +++ b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h @@ -810,7 +810,7 @@ struct probe_req_whitelist_attr { * @phymode: phymode in which @frequency should be scanned */ struct chan_info { - uint32_t freq; + qdf_freq_t freq; uint32_t phymode; }; @@ -821,7 +821,7 @@ struct chan_info { * @chan: channel parameters used for this scan */ struct chan_list { - uint32_t num_chan; + uint8_t num_chan; struct chan_info chan[NUM_CHANNELS]; }; diff --git a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c index 3a8e3ec9897a..06777b31ce60 100644 --- a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c @@ -1278,8 +1278,8 @@ ucfg_scan_init_bssid_params(struct scan_start_request *req, */ static bool is_chan_enabled_for_scan(struct regulatory_channel *reg_chan, - uint32_t low_2g, uint32_t high_2g, uint32_t low_5g, - uint32_t high_5g) + qdf_freq_t low_2g, qdf_freq_t high_2g, qdf_freq_t low_5g, + qdf_freq_t high_5g) { if (reg_chan->state == CHANNEL_STATE_DISABLE) return false; @@ -1307,7 +1307,7 @@ ucfg_scan_init_chanlist_params(struct scan_start_request *req, uint32_t idx; QDF_STATUS status; struct regulatory_channel *reg_chan_list = NULL; - uint32_t low_2g, high_2g, low_5g, high_5g; + qdf_freq_t low_2g, high_2g, low_5g, high_5g; struct wlan_objmgr_pdev *pdev = NULL; uint32_t *scan_freqs = NULL; uint32_t max_chans = sizeof(req->scan_req.chan_list.chan) /