From 7b7c5895dd7e064077f6ad38017b442aaa98f483 Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Fri, 11 Jan 2019 00:25:43 +0530 Subject: [PATCH] qcacld-3.0: Remove legacy scan and ap protection related ini items Remove the following scan and ap protection related ini items: CFG_AP_ENABLE_PROTECTION_MODE_NAME CFG_ENABLE_MAC_ADDR_SPOOFING CFG_SCAN_AGING_PARAM_NAME Replace the corresponding hdd_config variables and replace these variable callers with ucfg api from corresponding module. Change-Id: I99a2659e2151ad285e9451b9e9cc036a199581a3 CRs-Fixed: 2378991 --- mlme/core/src/wlan_mlme_main.c | 2 ++ mlme/dispatcher/inc/cfg_sap_protection.h | 29 +++++++++++++++++-- mlme/dispatcher/inc/wlan_mlme_api.h | 8 +++++ mlme/dispatcher/inc/wlan_mlme_public_struct.h | 2 ++ mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 15 ++++++++++ mlme/dispatcher/src/wlan_mlme_api.c | 11 +++++++ 6 files changed, 64 insertions(+), 3 deletions(-) diff --git a/mlme/core/src/wlan_mlme_main.c b/mlme/core/src/wlan_mlme_main.c index 763467dba8..86899dab79 100644 --- a/mlme/core/src/wlan_mlme_main.c +++ b/mlme/core/src/wlan_mlme_main.c @@ -926,6 +926,8 @@ static void mlme_init_sap_protection_cfg(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_IGNORE_PEER_HT_MODE); sap_protection_params->enable_ap_obss_protection = cfg_get(psoc, CFG_AP_OBSS_PROTECTION_ENABLE); + sap_protection_params->is_ap_prot_enabled = + cfg_get(psoc, CFG_AP_ENABLE_PROTECTION_MODE); sap_protection_params->ap_protection_mode = cfg_get(psoc, CFG_AP_PROTECTION_MODE); } diff --git a/mlme/dispatcher/inc/cfg_sap_protection.h b/mlme/dispatcher/inc/cfg_sap_protection.h index 2a271db1a6..4454392303 100644 --- a/mlme/dispatcher/inc/cfg_sap_protection.h +++ b/mlme/dispatcher/inc/cfg_sap_protection.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2019 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 @@ -58,9 +58,31 @@ */ #define CFG_IGNORE_PEER_HT_MODE CFG_INI_BOOL( \ "gignore_peer_ht_opmode", \ - 0, \ + false, \ "ignore the peer ht mode") +/* + * + * gEnableApProt - Enable/Disable AP protection + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to enable/disable AP protection + * + * Related: None. + * + * Supported Feature: SAP + * + * Usage: Internal/External + * + * + */ +#define CFG_AP_ENABLE_PROTECTION_MODE CFG_INI_BOOL( \ + "gEnableApProt", \ + true, \ + "enable protection on sap") + /* * * gApProtection - Set AP protection parameter @@ -113,13 +135,14 @@ */ #define CFG_AP_OBSS_PROTECTION_ENABLE CFG_INI_BOOL( \ "gEnableApOBSSProt", \ - 0, \ + false, \ "Enable/Disable AP OBSS protection") #define CFG_SAP_PROTECTION_ALL \ CFG(CFG_PROTECTION_ENABLED) \ CFG(CFG_FORCE_POLICY_PROTECTION) \ CFG(CFG_IGNORE_PEER_HT_MODE) \ + CFG(CFG_AP_ENABLE_PROTECTION_MODE) \ CFG(CFG_AP_PROTECTION_MODE) \ CFG(CFG_AP_OBSS_PROTECTION_ENABLE) diff --git a/mlme/dispatcher/inc/wlan_mlme_api.h b/mlme/dispatcher/inc/wlan_mlme_api.h index 91a51789b4..a9173f15cd 100644 --- a/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/mlme/dispatcher/inc/wlan_mlme_api.h @@ -762,6 +762,14 @@ QDF_STATUS mlme_update_tgt_he_caps_in_cfg(struct wlan_objmgr_psoc *psoc, struct wma_tgt_cfg *cfg); #endif +/** + * wlan_mlme_is_ap_prot_enabled() - check if sap protection is enabled + * @psoc: pointer to psoc object + * + * Return: is_ap_prot_enabled flag + */ +bool wlan_mlme_is_ap_prot_enabled(struct wlan_objmgr_psoc *psoc); + /** * wlan_mlme_get_ap_protection_mode() - Get ap_protection_mode value * @psoc: pointer to psoc object diff --git a/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/mlme/dispatcher/inc/wlan_mlme_public_struct.h index e3eae5ba95..f9e1bb040c 100644 --- a/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -924,6 +924,7 @@ struct wlan_mlme_feature_flag { * @ignore_peer_ht_opmode: Ignore the ht opmode of the peer. Dynamic via INI * @enable_ap_obss_protection: enable/disable AP OBSS protection * @protection_force_policy: Protection force policy. Static via cfg + * @is_ap_prot_enabled: Enable/disable SAP protection * @ap_protection_mode: AP protection bitmap * @protection_enabled: Force enable protection. static via cfg */ @@ -931,6 +932,7 @@ struct wlan_mlme_sap_protection { bool ignore_peer_ht_opmode; bool enable_ap_obss_protection; uint8_t protection_force_policy; + bool is_ap_prot_enabled; uint16_t ap_protection_mode; uint32_t protection_enabled; }; diff --git a/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 95283bad3e..20c92471be 100644 --- a/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -1648,6 +1648,21 @@ QDF_STATUS ucfg_mlme_get_oce_sap_enabled_info(struct wlan_objmgr_psoc *psoc, return wlan_mlme_get_oce_sap_enabled_info(psoc, value); } +/** + * ucfg_mlme_is_ap_prot_enabled() - Check if sap is enabled + * @psoc: pointer to psoc object + * + * Inline UCFG API to be used by HDD/OSIF callers to get the + * sap protection enabled/disabled + * + * Return: QDF_STATUS_SUCCESS or QDF_STATUS_FAILURE + */ +static inline +bool ucfg_mlme_is_ap_prot_enabled(struct wlan_objmgr_psoc *psoc) +{ + return wlan_mlme_is_ap_prot_enabled(psoc); +} + /** * ucfg_mlme_get_ap_protection_mode() - Get ap protection mode info * @psoc: pointer to psoc object diff --git a/mlme/dispatcher/src/wlan_mlme_api.c b/mlme/dispatcher/src/wlan_mlme_api.c index 8153e9aa2c..2dc0483cba 100644 --- a/mlme/dispatcher/src/wlan_mlme_api.c +++ b/mlme/dispatcher/src/wlan_mlme_api.c @@ -1793,6 +1793,17 @@ QDF_STATUS wlan_mlme_get_oce_sap_enabled_info(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +bool wlan_mlme_is_ap_prot_enabled(struct wlan_objmgr_psoc *psoc) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) + return false; + + return mlme_obj->cfg.sap_protection_cfg.is_ap_prot_enabled; +} + QDF_STATUS wlan_mlme_get_ap_protection_mode(struct wlan_objmgr_psoc *psoc, uint16_t *value) {