From 85a240a6c0bfb979117bbd7a69843b6f12708d81 Mon Sep 17 00:00:00 2001 From: Dundi Raviteja Date: Mon, 10 Sep 2018 15:03:07 +0530 Subject: [PATCH] qcacld-3.0: Relocate IE whitelist cfg items Relocate IE whitelist config items to FW offload component. Change-Id: Idcb665f4d6069c0723b0a8ae17e54d8cbe71239d CRs-Fixed: 2316597 --- .../core/inc/wlan_fw_offload_main.h | 26 ++ .../core/src/wlan_fw_offload_main.c | 28 +- .../fw_offload/dispatcher/inc/cfg_fwol.h | 2 + .../dispatcher/inc/cfg_ie_whitelist.h | 288 ++++++++++++++++++ .../dispatcher/inc/wlan_fwol_ucfg_api.h | 39 +++ .../dispatcher/src/wlan_fwol_ucfg_api.c | 71 +++++ core/hdd/inc/wlan_hdd_cfg.h | 237 -------------- core/hdd/inc/wlan_hdd_main.h | 4 +- core/hdd/src/wlan_hdd_cfg.c | 94 ++---- core/hdd/src/wlan_hdd_cfg80211.c | 2 +- core/hdd/src/wlan_hdd_main.c | 65 +++- 11 files changed, 521 insertions(+), 335 deletions(-) create mode 100644 components/fw_offload/dispatcher/inc/cfg_ie_whitelist.h diff --git a/components/fw_offload/core/inc/wlan_fw_offload_main.h b/components/fw_offload/core/inc/wlan_fw_offload_main.h index 40e87a2020..82c97e857a 100644 --- a/components/fw_offload/core/inc/wlan_fw_offload_main.h +++ b/components/fw_offload/core/inc/wlan_fw_offload_main.h @@ -83,14 +83,40 @@ struct wlan_fwol_thermal_temp { uint16_t thermal_temp_max_level3; }; +/** + * struct wlan_fwol_ie_whitelist - Probe request IE whitelist config items + * ie_whitelist: IE whitelist flag + * ie_bitmap_0: IE bitmap 0 + * ie_bitmap_1: IE bitmap 1 + * ie_bitmap_2: IE bitmap 2 + * ie_bitmap_3: IE bitmap 3 + * ie_bitmap_4: IE bitmap 4 + * ie_bitmap_5: IE bitmap 5 + * ie_bitmap_6: IE bitmap 6 + * ie_bitmap_7: IE bitmap 7 + */ +struct wlan_fwol_ie_whitelist { + bool ie_whitelist; + uint32_t ie_bitmap_0; + uint32_t ie_bitmap_1; + uint32_t ie_bitmap_2; + uint32_t ie_bitmap_3; + uint32_t ie_bitmap_4; + uint32_t ie_bitmap_5; + uint32_t ie_bitmap_6; + uint32_t ie_bitmap_7; +}; + /** * struct wlan_fwol_cfg - fwol config items * coex_config: coex config items * thermal_temp_cfg: Thermal temperature related config items + * ie_whitelist_cfg: IE Whitelist related config items */ struct wlan_fwol_cfg { struct wlan_fwol_coex_config coex_config; struct wlan_fwol_thermal_temp thermal_temp_cfg; + struct wlan_fwol_ie_whitelist ie_whitelist_cfg; }; /** diff --git a/components/fw_offload/core/src/wlan_fw_offload_main.c b/components/fw_offload/core/src/wlan_fw_offload_main.c index 2564be83ad..c4b05d788f 100644 --- a/components/fw_offload/core/src/wlan_fw_offload_main.c +++ b/components/fw_offload/core/src/wlan_fw_offload_main.c @@ -29,8 +29,8 @@ struct wlan_fwol_psoc_obj *fwol_get_psoc_obj(struct wlan_objmgr_psoc *psoc) } static void -fwol_update_coex_config_in_cfg(struct wlan_objmgr_psoc *psoc, - struct wlan_fwol_coex_config *coex_config) +fwol_init_coex_config_in_cfg(struct wlan_objmgr_psoc *psoc, + struct wlan_fwol_coex_config *coex_config) { coex_config->btc_mode = cfg_get(psoc, CFG_BTC_MODE); coex_config->antenna_isolation = cfg_get(psoc, CFG_ANTENNA_ISOLATION); @@ -55,8 +55,8 @@ fwol_update_coex_config_in_cfg(struct wlan_objmgr_psoc *psoc, } static void -fwol_update_thermal_temp_in_cfg(struct wlan_objmgr_psoc *psoc, - struct wlan_fwol_thermal_temp *thermal_temp) +fwol_init_thermal_temp_in_cfg(struct wlan_objmgr_psoc *psoc, + struct wlan_fwol_thermal_temp *thermal_temp) { thermal_temp->thermal_temp_min_level0 = cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL0); @@ -76,6 +76,21 @@ fwol_update_thermal_temp_in_cfg(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL3); } +static void +fwol_init_ie_whiltelist_in_cfg(struct wlan_objmgr_psoc *psoc, + struct wlan_fwol_ie_whitelist *whitelist) +{ + whitelist->ie_whitelist = cfg_get(psoc, CFG_PROBE_REQ_IE_WHITELIST); + whitelist->ie_bitmap_0 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP0); + whitelist->ie_bitmap_1 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP1); + whitelist->ie_bitmap_2 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP2); + whitelist->ie_bitmap_3 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP3); + whitelist->ie_bitmap_4 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP4); + whitelist->ie_bitmap_5 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP5); + whitelist->ie_bitmap_6 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP6); + whitelist->ie_bitmap_7 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP7); +} + QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc) { QDF_STATUS status = QDF_STATUS_SUCCESS; @@ -90,8 +105,9 @@ QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc) fwol_cfg = &fwol_obj->cfg; - fwol_update_coex_config_in_cfg(psoc, &fwol_cfg->coex_config); - fwol_update_thermal_temp_in_cfg(psoc, &fwol_cfg->thermal_temp_cfg); + fwol_init_coex_config_in_cfg(psoc, &fwol_cfg->coex_config); + fwol_init_thermal_temp_in_cfg(psoc, &fwol_cfg->thermal_temp_cfg); + fwol_init_ie_whiltelist_in_cfg(psoc, &fwol_cfg->ie_whitelist_cfg); return status; } diff --git a/components/fw_offload/dispatcher/inc/cfg_fwol.h b/components/fw_offload/dispatcher/inc/cfg_fwol.h index ef00a7d93f..3596bdd45e 100644 --- a/components/fw_offload/dispatcher/inc/cfg_fwol.h +++ b/components/fw_offload/dispatcher/inc/cfg_fwol.h @@ -25,9 +25,11 @@ #include "cfg_coex.h" #include "cfg_thermal_temp.h" +#include "cfg_ie_whitelist.h" #define CFG_FWOL_ALL \ CFG_COEX_ALL \ + CFG_IE_WHITELIST \ CFG_THERMAL_TEMP_ALL #endif /* __CFG_FWOL_H */ diff --git a/components/fw_offload/dispatcher/inc/cfg_ie_whitelist.h b/components/fw_offload/dispatcher/inc/cfg_ie_whitelist.h new file mode 100644 index 0000000000..50d31b037f --- /dev/null +++ b/components/fw_offload/dispatcher/inc/cfg_ie_whitelist.h @@ -0,0 +1,288 @@ +/* + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/** + * DOC: This file contains centralized definitions of converged configuration. + */ + +#ifndef __CFG_IE_WHITELIST_H +#define __CFG_IE_WHITELIST_H + +/* + * + * g_enable_probereq_whitelist_ies - Enable IE white listing + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable/disable probe request IE white listing feature. + * Values 0 and 1 are used to disable and enable respectively, by default this + * feature is disabled. + * + * Related: None + * + * Supported Feature: Probe request IE whitelisting + * + * Usage: Internal/External + * + * + */ +#define CFG_PROBE_REQ_IE_WHITELIST CFG_INI_BOOL( \ + "g_enable_probereq_whitelist_ies", \ + 0, \ + "Enable IE whitelisting") + +/* + * For IE white listing in Probe Req, following ini parameters from + * g_probe_req_ie_bitmap_0 to g_probe_req_ie_bitmap_7 are used. User needs to + * input this values in hexa decimal format, when bit is set in bitmap, + * corresponding IE needs to be included in probe request. + * + * Example: + * ======== + * If IE 221 needs to be in the probe request, set the corresponding bit + * as follows: + * a= IE/32 = 221/32 = 6 = g_probe_req_ie_bitmap_6 + * b = IE modulo 32 = 29, + * means set the bth bit in g_probe_req_ie_bitmap_a, + * therefore set 29th bit in g_probe_req_ie_bitmap_6, + * as a result, g_probe_req_ie_bitmap_6=20000000 + * + * Note: For IE 221, its mandatory to set the gProbeReqOUIs. + */ + +/* + * + * g_probe_req_ie_bitmap_0 - Used to set the bitmap of IEs from 0 to 31 + * @Min: 0x00000000 + * @Max: 0xFFFFFFFF + * @Default: 0x00000000 + * + * This ini is used to include the IEs from 0 to 31 in probe request, + * when corresponding bit is set. + * + * Related: Need to enable g_enable_probereq_whitelist_ies. + * + * Supported Feature: Probe request ie whitelisting + * + * Usage: Internal/External + * + * + */ +#define CFG_PROBE_REQ_IE_BIT_MAP0 CFG_INI_UINT( \ + "g_probe_req_ie_bitmap_0", \ + 0x00000000, \ + 0xFFFFFFFF, \ + 0x00000000, \ + CFG_VALUE_OR_DEFAULT, \ + "IE Bitmap 0") + +/* + * + * g_probe_req_ie_bitmap_1 - Used to set the bitmap of IEs from 32 to 63 + * @Min: 0x00000000 + * @Max: 0xFFFFFFFF + * @Default: 0x00000000 + * + * This ini is used to include the IEs from 32 to 63 in probe request, + * when corresponding bit is set. + * + * Related: Need to enable g_enable_probereq_whitelist_ies. + * + * Supported Feature: Probe request ie whitelisting + * + * Usage: Internal/External + * + * + */ +#define CFG_PROBE_REQ_IE_BIT_MAP1 CFG_INI_UINT( \ + "g_probe_req_ie_bitmap_1", \ + 0x00000000, \ + 0xFFFFFFFF, \ + 0x00000000, \ + CFG_VALUE_OR_DEFAULT, \ + "IE Bitmap 1") + +/* + * + * g_probe_req_ie_bitmap_2 - Used to set the bitmap of IEs from 64 to 95 + * @Min: 0x00000000 + * @Max: 0xFFFFFFFF + * @Default: 0x00000000 + * + * This ini is used to include the IEs from 64 to 95 in probe request, + * when corresponding bit is set. + * + * Related: Need to enable g_enable_probereq_whitelist_ies. + * + * Supported Feature: Probe request ie whitelisting + * + * Usage: Internal/External + * + * + */ +#define CFG_PROBE_REQ_IE_BIT_MAP2 CFG_INI_UINT( \ + "g_probe_req_ie_bitmap_2", \ + 0x00000000, \ + 0xFFFFFFFF, \ + 0x00000000, \ + CFG_VALUE_OR_DEFAULT, \ + "IE Bitmap 2") + +/* + * + * g_probe_req_ie_bitmap_3 - Used to set the bitmap of IEs from 96 to 127 + * @Min: 0x00000000 + * @Max: 0xFFFFFFFF + * @Default: 0x00000000 + * + * This ini is used to include the IEs from 96 to 127 in probe request, + * when corresponding bit is set. + * + * Related: Need to enable g_enable_probereq_whitelist_ies. + * + * Supported Feature: Probe request ie whitelisting + * + * Usage: Internal/External + * + * + */ +#define CFG_PROBE_REQ_IE_BIT_MAP3 CFG_INI_UINT( \ + "g_probe_req_ie_bitmap_3", \ + 0x00000000, \ + 0xFFFFFFFF, \ + 0x00000000, \ + CFG_VALUE_OR_DEFAULT, \ + "IE Bitmap 3") + +/* + * + * g_probe_req_ie_bitmap_4 - Used to set the bitmap of IEs from 128 to 159 + * @Min: 0x00000000 + * @Max: 0xFFFFFFFF + * @Default: 0x00000000 + * + * This ini is used to include the IEs from 128 to 159 in probe request, + * when corresponding bit is set. + * + * Related: Need to enable g_enable_probereq_whitelist_ies. + * + * Supported Feature: Probe request ie whitelisting + * + * Usage: Internal/External + * + * + */ +#define CFG_PROBE_REQ_IE_BIT_MAP4 CFG_INI_UINT( \ + "g_probe_req_ie_bitmap_4", \ + 0x00000000, \ + 0xFFFFFFFF, \ + 0x00000000, \ + CFG_VALUE_OR_DEFAULT, \ + "IE Bitmap 4") + +/* + * + * g_probe_req_ie_bitmap_5 - Used to set the bitmap of IEs from 160 to 191 + * @Min: 0x00000000 + * @Max: 0xFFFFFFFF + * @Default: 0x00000000 + * + * This ini is used to include the IEs from 160 to 191 in probe request, + * when corresponding bit is set. + * + * Related: Need to enable g_enable_probereq_whitelist_ies. + * + * Supported Feature: Probe request ie whitelisting + * + * Usage: Internal/External + * + * + */ +#define CFG_PROBE_REQ_IE_BIT_MAP5 CFG_INI_UINT( \ + "g_probe_req_ie_bitmap_5", \ + 0x00000000, \ + 0xFFFFFFFF, \ + 0x00000000, \ + CFG_VALUE_OR_DEFAULT, \ + "IE Bitmap 5") + +/* + * + * g_probe_req_ie_bitmap_6 - Used to set the bitmap of IEs from 192 to 223 + * @Min: 0x00000000 + * @Max: 0xFFFFFFFF + * @Default: 0x00000000 + * + * This ini is used to include the IEs from 192 to 223 in probe request, + * when corresponding bit is set. + * + * Related: Need to enable g_enable_probereq_whitelist_ies. + * + * Supported Feature: Probe request ie whitelisting + * + * Usage: Internal/External + * + * + */ +#define CFG_PROBE_REQ_IE_BIT_MAP6 CFG_INI_UINT( \ + "g_probe_req_ie_bitmap_6", \ + 0x00000000, \ + 0xFFFFFFFF, \ + 0x00000000, \ + CFG_VALUE_OR_DEFAULT, \ + "IE Bitmap 6") + +/* + * + * g_probe_req_ie_bitmap_7 - Used to set the bitmap of IEs from 224 to 255 + * @Min: 0x00000000 + * @Max: 0xFFFFFFFF + * @Default: 0x00000000 + * + * This ini is used to include the IEs from 224 to 255 in probe request, + * when corresponding bit is set. + * + * Related: Need to enable g_enable_probereq_whitelist_ies. + * + * Supported Feature: Probe request ie whitelisting + * + * Usage: Internal/External + * + * + */ +#define CFG_PROBE_REQ_IE_BIT_MAP7 CFG_INI_UINT( \ + "g_probe_req_ie_bitmap_7", \ + 0x00000000, \ + 0xFFFFFFFF, \ + 0x00000000, \ + CFG_VALUE_OR_DEFAULT, \ + "IE Bitmap 7") + +#define CFG_IE_WHITELIST \ + CFG(CFG_PROBE_REQ_IE_WHITELIST) \ + CFG(CFG_PROBE_REQ_IE_BIT_MAP0) \ + CFG(CFG_PROBE_REQ_IE_BIT_MAP1) \ + CFG(CFG_PROBE_REQ_IE_BIT_MAP2) \ + CFG(CFG_PROBE_REQ_IE_BIT_MAP3) \ + CFG(CFG_PROBE_REQ_IE_BIT_MAP4) \ + CFG(CFG_PROBE_REQ_IE_BIT_MAP5) \ + CFG(CFG_PROBE_REQ_IE_BIT_MAP6) \ + CFG(CFG_PROBE_REQ_IE_BIT_MAP7) + +#endif diff --git a/components/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h b/components/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h index 852ef0a80c..8dd495756d 100644 --- a/components/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h +++ b/components/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h @@ -89,4 +89,43 @@ QDF_STATUS ucfg_fwol_get_thermal_temp(struct wlan_objmgr_psoc *psoc, struct wlan_fwol_thermal_temp *thermal_temp); +/** + * ucfg_fwol_get_ie_whitelist() - Get IE whitelist param value + * @psoc: Pointer to psoc object + * @ie_whitelist: Pointer to return the IE whitelist param value + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_fwol_get_ie_whitelist(struct wlan_objmgr_psoc *psoc, bool *ie_whitelist); + +/** + * ucfg_fwol_set_ie_whitelist() - Set IE whitelist param value + * @psoc: Pointer to psoc object + * @ie_whitelist: Value to set IE whitelist param + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_fwol_set_ie_whitelist(struct wlan_objmgr_psoc *psoc, bool ie_whitelist); + +/** + * ucfg_validate_ie_bitmaps() - Validate all IE whitelist bitmap param values + * @psoc: Pointer to psoc object + * + * Return: True if all bitmap values are valid, else false + */ +bool ucfg_validate_ie_bitmaps(struct wlan_objmgr_psoc *psoc); + +/** + * ucfg_fwol_get_all_whitelist_params() - Get all IE whitelist param values + * @psoc: Pointer to psoc object + * @whitelist: Pointer to struct wlan_fwol_ie_whitelist + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_fwol_get_all_whitelist_params(struct wlan_objmgr_psoc *psoc, + struct wlan_fwol_ie_whitelist *whitelist); + #endif /* _WLAN_FWOL_UCFG_API_H_ */ diff --git a/components/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c b/components/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c index 82d703b8bd..fb842e003b 100644 --- a/components/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c +++ b/components/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c @@ -182,3 +182,74 @@ ucfg_fwol_get_thermal_temp(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } + +QDF_STATUS +ucfg_fwol_get_ie_whitelist(struct wlan_objmgr_psoc *psoc, bool *ie_whitelist) +{ + struct wlan_fwol_psoc_obj *fwol_obj; + + fwol_obj = fwol_get_psoc_obj(psoc); + if (!fwol_obj) { + fwol_err("Failed to get fwol obj"); + return QDF_STATUS_E_FAILURE; + } + + *ie_whitelist = fwol_obj->cfg.ie_whitelist_cfg.ie_whitelist; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_fwol_set_ie_whitelist(struct wlan_objmgr_psoc *psoc, bool ie_whitelist) +{ + struct wlan_fwol_psoc_obj *fwol_obj; + + fwol_obj = fwol_get_psoc_obj(psoc); + if (!fwol_obj) { + fwol_err("Failed to get fwol obj"); + return QDF_STATUS_E_FAILURE; + } + + fwol_obj->cfg.ie_whitelist_cfg.ie_whitelist = ie_whitelist; + + return QDF_STATUS_SUCCESS; +} + +bool ucfg_validate_ie_bitmaps(struct wlan_objmgr_psoc *psoc) +{ + struct wlan_fwol_psoc_obj *fwol_obj; + struct wlan_fwol_ie_whitelist whitelist = {0}; + + fwol_obj = fwol_get_psoc_obj(psoc); + if (!fwol_obj) { + fwol_err("Failed to get fwol obj"); + return false; + } + + whitelist = fwol_obj->cfg.ie_whitelist_cfg; + + if (whitelist.ie_bitmap_0 && whitelist.ie_bitmap_1 && + whitelist.ie_bitmap_2 && whitelist.ie_bitmap_3 && + whitelist.ie_bitmap_4 && whitelist.ie_bitmap_5 && + whitelist.ie_bitmap_6 && whitelist.ie_bitmap_7) + return true; + + return false; +} + +QDF_STATUS +ucfg_fwol_get_all_whitelist_params(struct wlan_objmgr_psoc *psoc, + struct wlan_fwol_ie_whitelist *whitelist) +{ + struct wlan_fwol_psoc_obj *fwol_obj; + + fwol_obj = fwol_get_psoc_obj(psoc); + if (!fwol_obj) { + fwol_err("Failed to get fwol obj"); + return QDF_STATUS_E_FAILURE; + } + + *whitelist = fwol_obj->cfg.ie_whitelist_cfg; + + return QDF_STATUS_SUCCESS; +} diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 2524295deb..d393e8b61a 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -9068,233 +9068,6 @@ enum hdd_wext_control { #define CFG_TIMER_MULTIPLIER_DEFAULT (1) #endif -/* Begin of probe request IE whitelisting feature ini params */ -/* - * - * g_enable_probereq_whitelist_ies - Enable IE white listing - * @Min: 0 - * @Max: 1 - * @Default: 0 - * - * This ini is used to enable/disable probe request IE white listing feature. - * Values 0 and 1 are used to disable and enable respectively, by default this - * feature is disabled. - * - * Related: None - * - * Supported Feature: Probe request IE whitelisting - * - * Usage: Internal/External - * - * - */ -#define CFG_PRB_REQ_IE_WHITELIST_NAME "g_enable_probereq_whitelist_ies" -#define CFG_PRB_REQ_IE_WHITELIST_MIN (0) -#define CFG_PRB_REQ_IE_WHITELIST_MAX (1) -#define CFG_PRB_REQ_IE_WHITELIST_DEFAULT (0) - -/* - * For IE white listing in Probe Req, following ini parameters from - * g_probe_req_ie_bitmap_0 to g_probe_req_ie_bitmap_7 are used. User needs to - * input this values in hexa decimal format, when bit is set in bitmap, - * corresponding IE needs to be included in probe request. - * - * Example: - * If IE 221 needs to be in the probe request, set the corresponding bit - * as follows: - * a= IE/32 = 221/32 = 6 = g_probe_req_ie_bitmap_6 - * b = IE modulo 32 = 29, - * means set the bth bit in g_probe_req_ie_bitmap_a, - * therefore set 29th bit in g_probe_req_ie_bitmap_6, - * as a result, g_probe_req_ie_bitmap_6=20000000 - * - * Note: For IE 221, its mandatory to set the gProbeReqOUIs. - */ - -/* - * - * g_probe_req_ie_bitmap_0 - Used to set the bitmap of IEs from 0 to 31 - * @Min: 0x00000000 - * @Max: 0xFFFFFFFF - * @Default: 0x00000000 - * - * This ini is used to include the IEs from 0 to 31 in probe request, - * when corresponding bit is set. - * - * Related: Need to enable g_enable_probereq_whitelist_ies. - * - * Supported Feature: Probe request ie whitelisting - * - * Usage: Internal/External - * - * - */ -#define CFG_PRB_REQ_IE_BIT_MAP0_NAME "g_probe_req_ie_bitmap_0" -#define CFG_PRB_REQ_IE_BIT_MAP0_MIN (0x00000000) -#define CFG_PRB_REQ_IE_BIT_MAP0_MAX (0xFFFFFFFF) -#define CFG_PRB_REQ_IE_BIT_MAP0_DEFAULT (0x00000000) - -/* - * - * g_probe_req_ie_bitmap_1 - Used to set the bitmap of IEs from 32 to 63 - * @Min: 0x00000000 - * @Max: 0xFFFFFFFF - * @Default: 0x00000000 - * - * This ini is used to include the IEs from 32 to 63 in probe request, - * when corresponding bit is set. - * - * Related: Need to enable g_enable_probereq_whitelist_ies. - * - * Supported Feature: Probe request ie whitelisting - * - * Usage: Internal/External - * - * - */ -#define CFG_PRB_REQ_IE_BIT_MAP1_NAME "g_probe_req_ie_bitmap_1" -#define CFG_PRB_REQ_IE_BIT_MAP1_MIN (0x00000000) -#define CFG_PRB_REQ_IE_BIT_MAP1_MAX (0xFFFFFFFF) -#define CFG_PRB_REQ_IE_BIT_MAP1_DEFAULT (0x00000000) - -/* - * - * g_probe_req_ie_bitmap_2 - Used to set the bitmap of IEs from 64 to 95 - * @Min: 0x00000000 - * @Max: 0xFFFFFFFF - * @Default: 0x00000000 - * - * This ini is used to include the IEs from 64 to 95 in probe request, - * when corresponding bit is set. - * - * Related: Need to enable g_enable_probereq_whitelist_ies. - * - * Supported Feature: Probe request ie whitelisting - * - * Usage: Internal/External - * - * - */ -#define CFG_PRB_REQ_IE_BIT_MAP2_NAME "g_probe_req_ie_bitmap_2" -#define CFG_PRB_REQ_IE_BIT_MAP2_MIN (0x00000000) -#define CFG_PRB_REQ_IE_BIT_MAP2_MAX (0xFFFFFFFF) -#define CFG_PRB_REQ_IE_BIT_MAP2_DEFAULT (0x00000000) - -/* - * - * g_probe_req_ie_bitmap_3 - Used to set the bitmap of IEs from 96 to 127 - * @Min: 0x00000000 - * @Max: 0xFFFFFFFF - * @Default: 0x00000000 - * - * This ini is used to include the IEs from 96 to 127 in probe request, - * when corresponding bit is set. - * - * Related: Need to enable g_enable_probereq_whitelist_ies. - * - * Supported Feature: Probe request ie whitelisting - * - * Usage: Internal/External - * - * - */ -#define CFG_PRB_REQ_IE_BIT_MAP3_NAME "g_probe_req_ie_bitmap_3" -#define CFG_PRB_REQ_IE_BIT_MAP3_MIN (0x00000000) -#define CFG_PRB_REQ_IE_BIT_MAP3_MAX (0xFFFFFFFF) -#define CFG_PRB_REQ_IE_BIT_MAP3_DEFAULT (0x00000000) - -/* - * - * g_probe_req_ie_bitmap_4 - Used to set the bitmap of IEs from 128 to 159 - * @Min: 0x00000000 - * @Max: 0xFFFFFFFF - * @Default: 0x00000000 - * - * This ini is used to include the IEs from 128 to 159 in probe request, - * when corresponding bit is set. - * - * Related: Need to enable g_enable_probereq_whitelist_ies. - * - * Supported Feature: Probe request ie whitelisting - * - * Usage: Internal/External - * - * - */ -#define CFG_PRB_REQ_IE_BIT_MAP4_NAME "g_probe_req_ie_bitmap_4" -#define CFG_PRB_REQ_IE_BIT_MAP4_MIN (0x00000000) -#define CFG_PRB_REQ_IE_BIT_MAP4_MAX (0xFFFFFFFF) -#define CFG_PRB_REQ_IE_BIT_MAP4_DEFAULT (0x00000000) - -/* - * - * g_probe_req_ie_bitmap_5 - Used to set the bitmap of IEs from 160 to 191 - * @Min: 0x00000000 - * @Max: 0xFFFFFFFF - * @Default: 0x00000000 - * - * This ini is used to include the IEs from 160 to 191 in probe request, - * when corresponding bit is set. - * - * Related: Need to enable g_enable_probereq_whitelist_ies. - * - * Supported Feature: Probe request ie whitelisting - * - * Usage: Internal/External - * - * - */ -#define CFG_PRB_REQ_IE_BIT_MAP5_NAME "g_probe_req_ie_bitmap_5" -#define CFG_PRB_REQ_IE_BIT_MAP5_MIN (0x00000000) -#define CFG_PRB_REQ_IE_BIT_MAP5_MAX (0xFFFFFFFF) -#define CFG_PRB_REQ_IE_BIT_MAP5_DEFAULT (0x00000000) - -/* - * - * g_probe_req_ie_bitmap_6 - Used to set the bitmap of IEs from 192 to 223 - * @Min: 0x00000000 - * @Max: 0xFFFFFFFF - * @Default: 0x00000000 - * - * This ini is used to include the IEs from 192 to 223 in probe request, - * when corresponding bit is set. - * - * Related: Need to enable g_enable_probereq_whitelist_ies. - * - * Supported Feature: Probe request ie whitelisting - * - * Usage: Internal/External - * - * - */ -#define CFG_PRB_REQ_IE_BIT_MAP6_NAME "g_probe_req_ie_bitmap_6" -#define CFG_PRB_REQ_IE_BIT_MAP6_MIN (0x00000000) -#define CFG_PRB_REQ_IE_BIT_MAP6_MAX (0xFFFFFFFF) -#define CFG_PRB_REQ_IE_BIT_MAP6_DEFAULT (0x00000000) - -/* - * - * g_probe_req_ie_bitmap_7 - Used to set the bitmap of IEs from 224 to 255 - * @Min: 0x00000000 - * @Max: 0xFFFFFFFF - * @Default: 0x00000000 - * - * This ini is used to include the IEs from 224 to 255 in probe request, - * when corresponding bit is set. - * - * Related: Need to enable g_enable_probereq_whitelist_ies. - * - * Supported Feature: Probe request ie whitelisting - * - * Usage: Internal/External - * - * - */ -#define CFG_PRB_REQ_IE_BIT_MAP7_NAME "g_probe_req_ie_bitmap_7" -#define CFG_PRB_REQ_IE_BIT_MAP7_MIN (0x00000000) -#define CFG_PRB_REQ_IE_BIT_MAP7_MAX (0xFFFFFFFF) -#define CFG_PRB_REQ_IE_BIT_MAP7_DEFAULT (0x00000000) - /* * For vendor specific IE, Probe Req OUI types and sub types which are * to be white listed are specified in gProbeReqOUIs in the following @@ -11283,16 +11056,6 @@ struct hdd_config { bool ani_enabled; bool tx_orphan_enable; - bool probe_req_ie_whitelist; - /* probe request bit map ies */ - uint32_t probe_req_ie_bitmap_0; - uint32_t probe_req_ie_bitmap_1; - uint32_t probe_req_ie_bitmap_2; - uint32_t probe_req_ie_bitmap_3; - uint32_t probe_req_ie_bitmap_4; - uint32_t probe_req_ie_bitmap_5; - uint32_t probe_req_ie_bitmap_6; - uint32_t probe_req_ie_bitmap_7; /* Probe Request multiple vendor OUIs */ uint8_t probe_req_ouis[MAX_PRB_REQ_VENDOR_OUI_INI_LEN]; uint32_t no_of_probe_req_ouis; diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index b4f0f60147..1f17d62f2d 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -3115,12 +3115,12 @@ void hdd_chip_pwr_save_fail_detected_cb(hdd_handle_t hdd_handle, /** * hdd_update_ie_whitelist_attr() - Copy probe req ie whitelist attrs from cfg * @ie_whitelist: output parameter - * @cfg: pointer to hdd config + * @hdd_ctx: pointer to hdd context * * Return: None */ void hdd_update_ie_whitelist_attr(struct probe_req_whitelist_attr *ie_whitelist, - struct hdd_config *cfg); + struct hdd_context *hdd_ctx); /** * hdd_get_rssi_snr_by_bssid() - gets the rssi and snr by bssid from scan cache diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 83132b0f34..34db1bf019 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -44,6 +44,7 @@ #include "wlan_hdd_twt.h" #include "wlan_mlme_ucfg_api.h" #include "wlan_mlme_public_struct.h" +#include "wlan_fwol_ucfg_api.h" static void cb_notify_set_roam_prefer5_g_hz(struct hdd_context *hdd_ctx, @@ -3641,69 +3642,6 @@ struct reg_table_entry g_registry_table[] = { CFG_TIMER_MULTIPLIER_MIN, CFG_TIMER_MULTIPLIER_MAX), - REG_VARIABLE(CFG_PRB_REQ_IE_WHITELIST_NAME, WLAN_PARAM_Integer, - struct hdd_config, probe_req_ie_whitelist, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_PRB_REQ_IE_WHITELIST_DEFAULT, - CFG_PRB_REQ_IE_WHITELIST_MIN, - CFG_PRB_REQ_IE_WHITELIST_MAX), - - REG_VARIABLE(CFG_PRB_REQ_IE_BIT_MAP0_NAME, WLAN_PARAM_HexInteger, - struct hdd_config, probe_req_ie_bitmap_0, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP0_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP0_MIN, - CFG_PRB_REQ_IE_BIT_MAP0_MAX), - - REG_VARIABLE(CFG_PRB_REQ_IE_BIT_MAP1_NAME, WLAN_PARAM_HexInteger, - struct hdd_config, probe_req_ie_bitmap_1, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP1_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP1_MIN, - CFG_PRB_REQ_IE_BIT_MAP1_MAX), - - REG_VARIABLE(CFG_PRB_REQ_IE_BIT_MAP2_NAME, WLAN_PARAM_HexInteger, - struct hdd_config, probe_req_ie_bitmap_2, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP2_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP2_MIN, - CFG_PRB_REQ_IE_BIT_MAP2_MAX), - - REG_VARIABLE(CFG_PRB_REQ_IE_BIT_MAP3_NAME, WLAN_PARAM_HexInteger, - struct hdd_config, probe_req_ie_bitmap_3, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP3_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP3_MIN, - CFG_PRB_REQ_IE_BIT_MAP3_MAX), - - REG_VARIABLE(CFG_PRB_REQ_IE_BIT_MAP4_NAME, WLAN_PARAM_HexInteger, - struct hdd_config, probe_req_ie_bitmap_4, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP4_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP4_MIN, - CFG_PRB_REQ_IE_BIT_MAP4_MAX), - - REG_VARIABLE(CFG_PRB_REQ_IE_BIT_MAP5_NAME, WLAN_PARAM_HexInteger, - struct hdd_config, probe_req_ie_bitmap_5, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP5_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP5_MIN, - CFG_PRB_REQ_IE_BIT_MAP5_MAX), - - REG_VARIABLE(CFG_PRB_REQ_IE_BIT_MAP6_NAME, WLAN_PARAM_HexInteger, - struct hdd_config, probe_req_ie_bitmap_6, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP6_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP6_MIN, - CFG_PRB_REQ_IE_BIT_MAP6_MAX), - - REG_VARIABLE(CFG_PRB_REQ_IE_BIT_MAP7_NAME, WLAN_PARAM_HexInteger, - struct hdd_config, probe_req_ie_bitmap_7, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP7_DEFAULT, - CFG_PRB_REQ_IE_BIT_MAP7_MIN, - CFG_PRB_REQ_IE_BIT_MAP7_MAX), - REG_VARIABLE_STRING(CFG_PROBE_REQ_OUI_NAME, WLAN_PARAM_String, struct hdd_config, probe_req_ouis, VAR_FLAGS_OPTIONAL, @@ -6260,15 +6198,23 @@ void hdd_get_pmkid_modes(struct hdd_context *hdd_ctx, bool hdd_validate_prb_req_ie_bitmap(struct hdd_context *hdd_ctx) { - if (!(hdd_ctx->config->probe_req_ie_bitmap_0 || - hdd_ctx->config->probe_req_ie_bitmap_1 || - hdd_ctx->config->probe_req_ie_bitmap_2 || - hdd_ctx->config->probe_req_ie_bitmap_3 || - hdd_ctx->config->probe_req_ie_bitmap_4 || - hdd_ctx->config->probe_req_ie_bitmap_5 || - hdd_ctx->config->probe_req_ie_bitmap_6 || - hdd_ctx->config->probe_req_ie_bitmap_7)) + struct wlan_fwol_ie_whitelist whitelist = {0}; + struct wlan_objmgr_psoc *psoc = hdd_ctx->psoc; + QDF_STATUS status; + + if (!psoc) { + hdd_err("HDD psoc got NULL"); return false; + } + + if (!ucfg_validate_ie_bitmaps(psoc)) + return false; + + status = ucfg_fwol_get_all_whitelist_params(psoc, &whitelist); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("Could not get IE bitmap 6"); + return false; + } /* * check whether vendor oui IE is set and OUIs are present, each OUI @@ -6276,14 +6222,12 @@ bool hdd_validate_prb_req_ie_bitmap(struct hdd_context *hdd_ctx) * for atleast one OUI, minimum length is 8 and hence this string length * is checked for minimum of 8 */ - if ((hdd_ctx->config->probe_req_ie_bitmap_6 & - VENDOR_SPECIFIC_IE_BITMAP) && + if ((whitelist.ie_bitmap_6 & VENDOR_SPECIFIC_IE_BITMAP) && (strlen(hdd_ctx->config->probe_req_ouis) < 8)) return false; /* check whether vendor oui IE is not set but OUIs are present */ - if (!(hdd_ctx->config->probe_req_ie_bitmap_6 & - VENDOR_SPECIFIC_IE_BITMAP) && + if (!(whitelist.ie_bitmap_6 & VENDOR_SPECIFIC_IE_BITMAP) && (strlen(hdd_ctx->config->probe_req_ouis) > 0)) return false; diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 49c7405f2a..c32883014a 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3223,7 +3223,7 @@ __wlan_hdd_cfg80211_set_scanning_mac_oui(struct wiphy *wiphy, hdd_debug("Oui (%02x:%02x:%02x), vdev_id = %d", pReqMsg->oui[0], pReqMsg->oui[1], pReqMsg->oui[2], pReqMsg->vdev_id); - hdd_update_ie_whitelist_attr(&pReqMsg->ie_whitelist, hdd_ctx->config); + hdd_update_ie_whitelist_attr(&pReqMsg->ie_whitelist, hdd_ctx); mac_handle = hdd_ctx->mac_handle; status = sme_set_scanning_mac_oui(mac_handle, pReqMsg); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 87829d938a..cf287d5aae 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9081,14 +9081,30 @@ list_destroy: */ static int ie_whitelist_attrs_init(struct hdd_context *hdd_ctx) { + struct wlan_objmgr_psoc *psoc = hdd_ctx->psoc; int ret; + QDF_STATUS status; + bool is_ie_whitelist_enable = false; - if (!hdd_ctx->config->probe_req_ie_whitelist) + if (!psoc) { + hdd_err("HDD psoc got NULL"); + return -EINVAL; + } + + status = ucfg_fwol_get_ie_whitelist(psoc, &is_ie_whitelist_enable); + if (QDF_IS_STATUS_ERROR(status)) + return qdf_status_to_os_return(status); + + if (!is_ie_whitelist_enable) return 0; if (!hdd_validate_prb_req_ie_bitmap(hdd_ctx)) { hdd_err("invalid ie bitmap and ouis: disable ie whitelisting"); - hdd_ctx->config->probe_req_ie_whitelist = false; + status = ucfg_fwol_set_ie_whitelist(psoc, false); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("Could not set IE whitelist param"); + return qdf_status_to_os_return(status); + } return -EINVAL; } @@ -9096,7 +9112,11 @@ static int ie_whitelist_attrs_init(struct hdd_context *hdd_ctx) ret = hdd_parse_probe_req_ouis(hdd_ctx); if (ret) { hdd_err("parsing error: disable ie whitelisting"); - hdd_ctx->config->probe_req_ie_whitelist = false; + status = ucfg_fwol_set_ie_whitelist(psoc, false); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("Could not set IE whitelist param"); + return qdf_status_to_os_return(status); + } } return ret; @@ -13836,22 +13856,39 @@ hdd_update_pno_config(struct pno_user_cfg *pno_cfg, #endif void hdd_update_ie_whitelist_attr(struct probe_req_whitelist_attr *ie_whitelist, - struct hdd_config *cfg) + struct hdd_context *hdd_ctx) { + struct wlan_fwol_ie_whitelist whitelist = {0}; + struct wlan_objmgr_psoc *psoc = hdd_ctx->psoc; + struct hdd_config *cfg = hdd_ctx->config; + QDF_STATUS status; + bool is_ie_whitelist_enable = false; uint8_t i = 0; - ie_whitelist->white_list = cfg->probe_req_ie_whitelist; + status = ucfg_fwol_get_ie_whitelist(psoc, &is_ie_whitelist_enable); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("Unable to get IE whitelist param"); + return; + } + + ie_whitelist->white_list = is_ie_whitelist_enable; if (!ie_whitelist->white_list) return; - ie_whitelist->ie_bitmap[0] = cfg->probe_req_ie_bitmap_0; - ie_whitelist->ie_bitmap[1] = cfg->probe_req_ie_bitmap_1; - ie_whitelist->ie_bitmap[2] = cfg->probe_req_ie_bitmap_2; - ie_whitelist->ie_bitmap[3] = cfg->probe_req_ie_bitmap_3; - ie_whitelist->ie_bitmap[4] = cfg->probe_req_ie_bitmap_4; - ie_whitelist->ie_bitmap[5] = cfg->probe_req_ie_bitmap_5; - ie_whitelist->ie_bitmap[6] = cfg->probe_req_ie_bitmap_6; - ie_whitelist->ie_bitmap[7] = cfg->probe_req_ie_bitmap_7; + status = ucfg_fwol_get_all_whitelist_params(psoc, &whitelist); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("Unable to get all whitelist params"); + return; + } + + ie_whitelist->ie_bitmap[0] = whitelist.ie_bitmap_0; + ie_whitelist->ie_bitmap[1] = whitelist.ie_bitmap_1; + ie_whitelist->ie_bitmap[2] = whitelist.ie_bitmap_2; + ie_whitelist->ie_bitmap[3] = whitelist.ie_bitmap_3; + ie_whitelist->ie_bitmap[4] = whitelist.ie_bitmap_4; + ie_whitelist->ie_bitmap[5] = whitelist.ie_bitmap_5; + ie_whitelist->ie_bitmap[6] = whitelist.ie_bitmap_6; + ie_whitelist->ie_bitmap[7] = whitelist.ie_bitmap_7; ie_whitelist->num_vendor_oui = cfg->no_of_probe_req_ouis; for (i = 0; i < ie_whitelist->num_vendor_oui; i++) @@ -13983,7 +14020,7 @@ static int hdd_update_scan_config(struct hdd_context *hdd_ctx) scan_cfg.sta_miracast_mcc_rest_time = cfg->sta_miracast_mcc_rest_time_val; hdd_update_pno_config(&scan_cfg.pno_cfg, cfg); - hdd_update_ie_whitelist_attr(&scan_cfg.ie_whitelist, cfg); + hdd_update_ie_whitelist_attr(&scan_cfg.ie_whitelist, hdd_ctx); status = hdd_update_score_config(&scan_cfg.score_config, cfg); if (QDF_IS_STATUS_ERROR(status)) {