From e20db7ae44689b7f7fb0f4b2eb56c0e948bf88e7 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Thu, 30 Jul 2020 18:46:41 +0530 Subject: [PATCH] qcacld-3.0: Add ini to retain the NOL across reg domain change Currently driver sets the NOL state of the channels to false on every regulatory updated, which indicates the channel is not in NOL. Which may lead to some issues where the channel is actually in NOL but host treats it as non-NOL channel. Ideally NOL list should be maintained throughout the driver lifetime and across the regulatory changes. To address this issue add a logic to not update the NOL state of the channels whenever the regulatory update is received. CRs-Fixed: 2744916 Change-Id: If96b22ab29a60a2aa752bbf01aaae46fc37362eb --- components/mlme/core/src/wlan_mlme_main.c | 2 ++ components/mlme/dispatcher/inc/cfg_mlme_reg.h | 24 +++++++++++++++++++ .../dispatcher/inc/wlan_mlme_public_struct.h | 2 ++ .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 11 +++++++++ .../mlme/dispatcher/src/wlan_mlme_ucfg_api.c | 16 +++++++++++++ core/hdd/src/wlan_hdd_regulatory.c | 3 +++ 6 files changed, 58 insertions(+) diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 1344fabf13b2..a5127b7fcead 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -2201,6 +2201,8 @@ static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc, reg->ignore_fw_reg_offload_ind = cfg_get( psoc, CFG_IGNORE_FW_REG_OFFLOAD_IND); + reg->retain_nol_across_regdmn_update = + cfg_get(psoc, CFG_RETAIN_NOL_ACROSS_REG_DOMAIN); qdf_uint8_array_parse(cfg_default(CFG_VALID_CHANNEL_LIST), channel_list, diff --git a/components/mlme/dispatcher/inc/cfg_mlme_reg.h b/components/mlme/dispatcher/inc/cfg_mlme_reg.h index 4ff5807c6337..0d962210508a 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_reg.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_reg.h @@ -296,6 +296,29 @@ 0, \ "Enable Pending list req") +/* + * + * retain_nol_across_regdmn - Retain NOL across reg domain + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to set if NOL needs to be retained + * on the reg domain change. + * + * Related: None + * + * Supported Feature: SAP + * + * Usage: External + * + * + */ +#define CFG_RETAIN_NOL_ACROSS_REG_DOMAIN CFG_INI_BOOL( \ + "retain_nol_across_regdmn", \ + 1, \ + "Retain NOL even if the regdomain changes") + #define CFG_REG_ALL \ CFG(CFG_SELF_GEN_FRM_PWR) \ CFG(CFG_ENABLE_PENDING_CHAN_LIST_REQ) \ @@ -307,6 +330,7 @@ CFG(CFG_SCAN_11D_INTERVAL) \ CFG(CFG_VALID_CHANNEL_LIST) \ CFG(CFG_IGNORE_FW_REG_OFFLOAD_IND) \ + CFG(CFG_RETAIN_NOL_ACROSS_REG_DOMAIN) \ CFG_SAP_AVOID_ACS_FREQ_LIST_ALL #endif /* CFG_MLME_REG_H__ */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index b3a0fe46b5ba..0deb030f2591 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -2152,6 +2152,7 @@ struct wlan_mlme_mwc { * @ignore_fw_reg_offload_ind: Ignore fw regulatory offload indication * @enable_pending_chan_list_req: enables/disables scan channel * list command to FW till the current scan is complete. + * @retain_nol_across_regdmn_update: Retain the NOL list across the regdomain. */ struct wlan_mlme_reg { uint32_t self_gen_frm_pwr; @@ -2170,6 +2171,7 @@ struct wlan_mlme_reg { #endif bool ignore_fw_reg_offload_ind; bool enable_pending_chan_list_req; + bool retain_nol_across_regdmn_update; }; /** diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index b2e555888f1e..3b4fc97f2bd3 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -3854,6 +3854,17 @@ QDF_STATUS ucfg_mlme_get_scan_11d_interval(struct wlan_objmgr_psoc *psoc, uint32_t *value); +/** + * ucfg_mlme_get_nol_across_regdmn() - get scan 11d interval + * @psoc: pointer to psoc object + * @value: Pointer to the value which will be filled for the caller + * + * Return: QDF Status + */ + +QDF_STATUS +ucfg_mlme_get_nol_across_regdmn(struct wlan_objmgr_psoc *psoc, bool *value); + /** * ucfg_mlme_get_valid_channel_freq_list() - get valid channel * list diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c index 29f150e1e8c4..cf9e4548e396 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -1609,6 +1609,22 @@ ucfg_mlme_get_scan_11d_interval(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS +ucfg_mlme_get_nol_across_regdmn(struct wlan_objmgr_psoc *psoc, bool *value) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) { + *value = cfg_default(CFG_RETAIN_NOL_ACROSS_REG_DOMAIN); + mlme_legacy_err("Failed to get MLME Obj"); + return QDF_STATUS_E_INVAL; + } + + *value = mlme_obj->cfg.reg.retain_nol_across_regdmn_update; + return QDF_STATUS_SUCCESS; +} + QDF_STATUS ucfg_mlme_get_valid_channel_freq_list(struct wlan_objmgr_psoc *psoc, uint32_t *channel_list, diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index e5af6b35bd9d..0ac2b622fa8a 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -236,6 +236,9 @@ static void reg_program_config_vars(struct hdd_context *hdd_ctx, hdd_err("Invalid 11d_enable flag"); config_vars->enable_11d_support = value; + ucfg_mlme_get_nol_across_regdmn(hdd_ctx->psoc, &value); + config_vars->retain_nol_across_regdmn_update = value; + ucfg_mlme_get_scan_11d_interval(hdd_ctx->psoc, &scan_11d_interval); config_vars->scan_11d_interval = scan_11d_interval;