Эх сурвалжийг харах

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
Pragaspathi Thilagaraj 6 жил өмнө
parent
commit
7b7c5895dd

+ 2 - 0
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);
 }

+ 26 - 3
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")
 
+/*
+ * <ini>
+ * 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
+ *
+ * </ini>
+ */
+#define CFG_AP_ENABLE_PROTECTION_MODE CFG_INI_BOOL( \
+		"gEnableApProt", \
+		true, \
+		"enable protection on sap")
+
 /*
  * <ini>
  * 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)
 

+ 8 - 0
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

+ 2 - 0
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;
 };

+ 15 - 0
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

+ 11 - 0
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)
 {