浏览代码

qcacld-3.0: Enable P2P cfg based on new cfg component

Enable p2p cfg based on new cfg component and remove legacy codes.

Change-Id: I99b0a53a4904f56fda2aaa2e237455433c3363d2
CRs-Fixed: 2277566
Wu Gao 6 年之前
父节点
当前提交
e568979eb5
共有 6 个文件被更改,包括 44 次插入151 次删除
  1. 1 0
      Kbuild
  2. 8 1
      components/cfg/cfg_all.h
  3. 0 93
      core/hdd/inc/wlan_hdd_cfg.h
  4. 22 53
      core/hdd/src/wlan_hdd_cfg.c
  5. 9 3
      core/hdd/src/wlan_hdd_main.c
  6. 4 1
      core/hdd/src/wlan_hdd_p2p.c

+ 1 - 0
Kbuild

@@ -784,6 +784,7 @@ UMAC_P2P_INC := -I$(WLAN_COMMON_INC)/$(P2P_DISPATCHER_INC_DIR) \
 		-I$(WLAN_COMMON_INC)/umac/scan/dispatcher/inc
 UMAC_P2P_OBJS := $(P2P_DISPATCHER_OBJ_DIR)/wlan_p2p_ucfg_api.o \
                  $(P2P_DISPATCHER_OBJ_DIR)/wlan_p2p_tgt_api.o \
+                 $(P2P_DISPATCHER_OBJ_DIR)/wlan_p2p_cfg.o \
                  $(P2P_CORE_OBJ_DIR)/wlan_p2p_main.o \
                  $(P2P_CORE_OBJ_DIR)/wlan_p2p_roc.o \
                  $(P2P_CORE_OBJ_DIR)/wlan_p2p_off_chan_tx.o

+ 8 - 1
components/cfg/cfg_all.h

@@ -19,5 +19,12 @@
 #include "cfg_define.h"
 #include "cfg_converged.h"
 
+#ifdef CONVERGED_P2P_ENABLE
+#include "wlan_p2p_cfg.h"
+#else
+#define CFG_P2P_ALL
+#endif
+
 #define CFG_ALL \
-	CFG_CONVERGED_ALL
+	CFG_CONVERGED_ALL \
+	CFG_P2P_ALL

+ 0 - 93
core/hdd/inc/wlan_hdd_cfg.h

@@ -3109,19 +3109,6 @@ enum hdd_dot11_mode {
 #define CFG_ENABLE_LTE_COEX_MAX               (1)
 #define CFG_ENABLE_LTE_COEX_DEFAULT           (0)
 
-#define CFG_GO_KEEP_ALIVE_PERIOD_NAME          "gGoKeepAlivePeriod"
-#define CFG_GO_KEEP_ALIVE_PERIOD_MIN           WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_STAMIN
-#define CFG_GO_KEEP_ALIVE_PERIOD_MAX           WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_STAMAX
-#define CFG_GO_KEEP_ALIVE_PERIOD_DEFAULT       WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_STADEF
-
-/* gGoLinkMonitorPeriod is period where link is idle and where
- * we send NULL frame
- */
-#define CFG_GO_LINK_MONITOR_PERIOD_NAME          "gGoLinkMonitorPeriod"
-#define CFG_GO_LINK_MONITOR_PERIOD_MIN           (3)
-#define CFG_GO_LINK_MONITOR_PERIOD_MAX           (50)
-#define CFG_GO_LINK_MONITOR_PERIOD_DEFAULT       (10)
-
 #define CFG_VCC_RSSI_TRIGGER_NAME             "gVccRssiTrigger"
 #define CFG_VCC_RSSI_TRIGGER_MIN              (0)
 #define CFG_VCC_RSSI_TRIGGER_MAX              (80)
@@ -5406,29 +5393,6 @@ enum hdd_link_speed_rpt_type {
 #define CFG_LINK_SPEED_RSSI_LOW_MAX                (0)
 #define CFG_LINK_SPEED_RSSI_LOW_DEFAULT            (-80)
 
-/*
- * <ini>
- * isP2pDeviceAddrAdministrated - Enables to derive the P2P MAC address from
- * the primary MAC address
- * @Min: 0
- * @Max: 1
- * @Default: 1
- *
- * This ini is used to enable/disable to derive the P2P MAC address from the
- * primary MAC address.
- *
- * Supported Feature: P2P
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-
-#define CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_NAME                "isP2pDeviceAddrAdministrated"
-#define CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_MIN                 (0)
-#define CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_MAX                 (1)
-#define CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_DEFAULT             (1)
-
 /*
  * <ini>
  * gEnableSSR - Enable/Disable SSR
@@ -5788,58 +5752,6 @@ enum hdd_link_speed_rpt_type {
 #define CFG_ENABLE_SAP_MANDATORY_CHAN_LIST_MAX   (1)
 #define CFG_ENABLE_SAP_MANDATORY_CHAN_LIST_DEFAULT (0)
 
-/*
- * Skip DFS Channel in case of P2P Search
- * Options
- * 0 - Don't Skip DFS Channel in case of P2P Search
- * 1 - Skip DFS Channel in case of P2P Search
- */
-/*
- * <ini>
- * gSkipDfsChannelInP2pSearch - Skip DFS Channel in case of P2P Search
- * @Min: 0
- * @Max: 1
- * @Default: 1
- *
- * This ini is used to to disable(skip) dfs channel in p2p search.
- * Related: NA.
- *
- * Supported Feature: DFS P2P
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-#define CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_NAME       "gSkipDfsChannelInP2pSearch"
-#define CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_MIN        (0)
-#define CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_MAX        (1)
-#define CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_DEFAULT    (1)
-/*
- * <ini>
- * gIgnoreDynamicDtimInP2pMode - Ignore Dynamic Dtim in case of P2P
- * Options.
- * @Min: 0
- * @Max: 1
- * @Default: 0
- *
- * This ini is used to decide if Dynamic Dtim needs to be consider or
- * not in case of P2P.
- * 0 - Consider Dynamic Dtim incase of P2P
- * 1 - Ignore Dynamic Dtim incase of P2P
- *
- * Supported Feature: P2P
- *
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-
-#define CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_NAME       "gIgnoreDynamicDtimInP2pMode"
-#define CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_MIN        (0)
-#define CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_MAX        (1)
-#define CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_DEFAULT    (0)
-
 /*
  * <ini>
  * gShortGI40Mhz - It will check gShortGI20Mhz and
@@ -14374,10 +14286,8 @@ struct hdd_config {
 	bool apDisableIntraBssFwd;
 	uint8_t enableLTECoex;
 	uint32_t apKeepAlivePeriod;
-	uint32_t goKeepAlivePeriod;
 	enum station_keepalive_method sta_keepalive_method;
 	uint32_t apLinkMonitorPeriod;
-	uint32_t goLinkMonitorPeriod;
 	uint32_t nBeaconInterval;
 	uint8_t nTxPowerCap;    /* In dBm */
 	bool allow_tpc_from_ap;
@@ -14576,7 +14486,6 @@ struct hdd_config {
 	uint16_t nRoamScanHomeAwayTime;
 	uint8_t enableMCC;
 	uint8_t allowMCCGODiffBI;
-	bool isP2pDeviceAddrAdministrated;
 	uint8_t thermalMitigationEnable;
 	uint32_t throttlePeriod;
 	uint32_t throttle_dutycycle_level0;
@@ -14637,8 +14546,6 @@ struct hdd_config {
 	uint8_t enableModulatedDTIM;
 	uint32_t fEnableMCAddrList;
 	bool enableFirstScan2GOnly;
-	bool skipDfsChnlInP2pSearch;
-	bool ignoreDynamicDtimInP2pMode;
 	bool enableRxSTBC;
 	bool enableTxSTBC;
 	uint8_t enable_tx_ldpc;

+ 22 - 53
core/hdd/src/wlan_hdd_cfg.c

@@ -42,6 +42,7 @@
 #include "wlan_hdd_green_ap.h"
 #include "wlan_hdd_green_ap_cfg.h"
 #include "wlan_hdd_twt.h"
+#include "wlan_p2p_cfg_api.h"
 
 static void
 cb_notify_set_roam_prefer5_g_hz(struct hdd_context *hdd_ctx,
@@ -644,13 +645,6 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_AP_KEEP_ALIVE_PERIOD_MIN,
 		     CFG_AP_KEEP_ALIVE_PERIOD_MAX),
 
-	REG_VARIABLE(CFG_GO_KEEP_ALIVE_PERIOD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, goKeepAlivePeriod,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_GO_KEEP_ALIVE_PERIOD_DEFAULT,
-		     CFG_GO_KEEP_ALIVE_PERIOD_MIN,
-		     CFG_GO_KEEP_ALIVE_PERIOD_MAX),
-
 	REG_VARIABLE(CFG_AP_LINK_MONITOR_PERIOD_NAME, WLAN_PARAM_Integer,
 		     struct hdd_config, apLinkMonitorPeriod,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -658,13 +652,6 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_AP_LINK_MONITOR_PERIOD_MIN,
 		     CFG_AP_LINK_MONITOR_PERIOD_MAX),
 
-	REG_VARIABLE(CFG_GO_LINK_MONITOR_PERIOD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, goLinkMonitorPeriod,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_GO_LINK_MONITOR_PERIOD_DEFAULT,
-		     CFG_GO_LINK_MONITOR_PERIOD_MIN,
-		     CFG_GO_LINK_MONITOR_PERIOD_MAX),
-
 	REG_VARIABLE(CFG_DISABLE_PACKET_FILTER, WLAN_PARAM_Integer,
 		     struct hdd_config, disablePacketFilter,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -1854,14 +1841,6 @@ struct reg_table_entry g_registry_table[] = {
 			     CFG_ROAM_SCAN_HOME_AWAY_TIME_MAX,
 			     cb_notify_set_roam_scan_home_away_time, 0),
 
-	REG_VARIABLE(CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, isP2pDeviceAddrAdministrated,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_DEFAULT,
-		     CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_MIN,
-		     CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_MAX),
-
 	REG_VARIABLE(CFG_ENABLE_MCC_ENABLED_NAME, WLAN_PARAM_Integer,
 		     struct hdd_config, enableMCC,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -2153,21 +2132,6 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_ENABLE_FIRST_SCAN_2G_ONLY_MIN,
 		     CFG_ENABLE_FIRST_SCAN_2G_ONLY_MAX),
 
-	REG_VARIABLE(CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, skipDfsChnlInP2pSearch,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_DEFAULT,
-		     CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_MIN,
-		     CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_MAX),
-
-	REG_VARIABLE(CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, ignoreDynamicDtimInP2pMode,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_DEFAULT,
-		     CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_MIN,
-		     CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_MAX),
-
 	REG_VARIABLE(CFG_ENABLE_RX_STBC, WLAN_PARAM_Integer,
 		     struct hdd_config, enableRxSTBC,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -6711,10 +6675,6 @@ void hdd_cfg_print(struct hdd_context *hdd_ctx)
 		  hdd_ctx->config->vhtChannelWidth);
 	hdd_debug("Name = [enableFirstScan2GOnly] Value = [%u] ",
 		  hdd_ctx->config->enableFirstScan2GOnly);
-	hdd_debug("Name = [skipDfsChnlInP2pSearch] Value = [%u] ",
-		  hdd_ctx->config->skipDfsChnlInP2pSearch);
-	hdd_debug("Name = [ignoreDynamicDtimInP2pMode] Value = [%u] ",
-		  hdd_ctx->config->ignoreDynamicDtimInP2pMode);
 	hdd_debug("Name = [enableRxSTBC] Value = [%u] ",
 		  hdd_ctx->config->enableRxSTBC);
 	hdd_debug("Name = [gEnableSSR] Value = [%u] ",
@@ -6723,12 +6683,8 @@ void hdd_cfg_print(struct hdd_context *hdd_ctx)
 		  hdd_ctx->config->enable_data_stall_det);
 	hdd_debug("Name = [gEnableVhtFor24GHzBand] Value = [%u] ",
 		  hdd_ctx->config->enableVhtFor24GHzBand);
-	hdd_debug("Name = [gGoLinkMonitorPeriod] Value = [%u]",
-		  hdd_ctx->config->goLinkMonitorPeriod);
 	hdd_debug("Name = [gApLinkMonitorPeriod] Value = [%u]",
 		  hdd_ctx->config->apLinkMonitorPeriod);
-	hdd_debug("Name = [gGoKeepAlivePeriod] Value = [%u]",
-		  hdd_ctx->config->goKeepAlivePeriod);
 	hdd_debug("Name = [gApKeepAlivePeriod]Value = [%u]",
 		  hdd_ctx->config->apKeepAlivePeriod);
 	hdd_debug("Name = [max_amsdu_num] Value = [%u] ",
@@ -8107,6 +8063,8 @@ bool hdd_update_config_cfg(struct hdd_context *hdd_ctx)
 	bool status = true;
 	struct hdd_config *config = hdd_ctx->config;
 	mac_handle_t mac_handle;
+	uint32_t ivalue;
+	QDF_STATUS ret;
 
 	/*
 	 * During the initialization both 2G and 5G capabilities should be same.
@@ -8194,10 +8152,16 @@ bool hdd_update_config_cfg(struct hdd_context *hdd_ctx)
 		hdd_err("Couldn't pass on WNI_CFG_AP_KEEP_ALIVE_TIMEOUT to CFG");
 	}
 
-	if (sme_cfg_set_int(mac_handle, WNI_CFG_GO_KEEP_ALIVE_TIMEOUT,
-		    config->goKeepAlivePeriod) == QDF_STATUS_E_FAILURE) {
-		status = false;
-		hdd_err("Couldn't pass on WNI_CFG_GO_KEEP_ALIVE_TIMEOUT to CFG");
+	ret = cfg_p2p_get_go_keepalive_period(hdd_ctx->hdd_psoc, &ivalue);
+	if (ret == QDF_STATUS_SUCCESS) {
+		ret = sme_cfg_set_int(mac_handle,
+				      WNI_CFG_GO_KEEP_ALIVE_TIMEOUT,
+				      ivalue);
+
+		if (ret == QDF_STATUS_E_FAILURE) {
+			status = false;
+			hdd_err("Couldn't pass on WNI_CFG_GO_KEEP_ALIVE_TIMEOUT to CFG");
+		}
 	}
 
 	if (sme_cfg_set_int(mac_handle, WNI_CFG_AP_LINK_MONITOR_TIMEOUT,
@@ -8206,10 +8170,15 @@ bool hdd_update_config_cfg(struct hdd_context *hdd_ctx)
 		hdd_err("Couldn't pass on WNI_CFG_AP_LINK_MONITOR_TIMEOUT to CFG");
 	}
 
-	if (sme_cfg_set_int(mac_handle, WNI_CFG_GO_LINK_MONITOR_TIMEOUT,
-		    config->goLinkMonitorPeriod) == QDF_STATUS_E_FAILURE) {
-		status = false;
-		hdd_err("Couldn't pass on WNI_CFG_GO_LINK_MONITOR_TIMEOUT to CFG");
+	ret = cfg_p2p_get_go_link_monitor_period(hdd_ctx->hdd_psoc, &ivalue);
+	if (ret == QDF_STATUS_SUCCESS) {
+		ret = sme_cfg_set_int(mac_handle,
+				      WNI_CFG_GO_LINK_MONITOR_TIMEOUT,
+				      ivalue);
+		if (ret == QDF_STATUS_E_FAILURE) {
+			status = false;
+			hdd_err("Couldn't pass on WNI_CFG_GO_LINK_MONITOR_TIMEOUT to CFG");
+		}
 	}
 
 	if (sme_cfg_set_int(mac_handle, WNI_CFG_SINGLE_TID_RC,

+ 9 - 3
core/hdd/src/wlan_hdd_main.c

@@ -135,6 +135,8 @@
 #include "wlan_hdd_twt.h"
 #include "qc_sap_ioctl.h"
 #include "wlan_mlme_main.h"
+#include "wlan_p2p_cfg_api.h"
+
 #ifdef CNSS_GENL
 #include <net/cnss_nl.h>
 #endif
@@ -9029,8 +9031,10 @@ static int hdd_open_p2p_interface(struct hdd_context *hdd_ctx, bool rtnl_held)
 {
 	struct hdd_adapter *adapter;
 	uint8_t *p2p_dev_addr;
+	bool p2p_dev_addr_admin = false;
 
-	if (hdd_ctx->config->isP2pDeviceAddrAdministrated &&
+	cfg_p2p_get_device_addr_admin(hdd_ctx->hdd_psoc, &p2p_dev_addr_admin);
+	if (p2p_dev_addr_admin &&
 	    !(hdd_ctx->config->intfMacAddr[0].bytes[0] & 0x02)) {
 		qdf_mem_copy(hdd_ctx->p2p_device_address.bytes,
 			     hdd_ctx->config->intfMacAddr[0].bytes,
@@ -9479,6 +9483,7 @@ exit:
 static int hdd_update_user_config(struct hdd_context *hdd_ctx)
 {
 	struct wlan_objmgr_psoc_user_config *user_config;
+	bool skip_dfs_in_p2p_search = false;
 
 	user_config = qdf_mem_malloc(sizeof(*user_config));
 	if (user_config == NULL) {
@@ -9497,8 +9502,9 @@ static int hdd_update_user_config(struct hdd_context *hdd_ctx)
 		hdd_ctx->config->Is11hSupportEnabled;
 	user_config->optimize_chan_avoid_event =
 		hdd_ctx->config->goptimize_chan_avoid_event;
-	user_config->skip_dfs_chnl_in_p2p_search =
-		hdd_ctx->config->skipDfsChnlInP2pSearch;
+	cfg_p2p_get_skip_dfs_channel_p2p_search(hdd_ctx->hdd_psoc,
+						&skip_dfs_in_p2p_search);
+	user_config->skip_dfs_chnl_in_p2p_search = skip_dfs_in_p2p_search;
 	user_config->band_capability = hdd_ctx->config->nBandCapability;
 	wlan_objmgr_psoc_set_user_config(hdd_ctx->hdd_psoc, user_config);
 

+ 4 - 1
core/hdd/src/wlan_hdd_p2p.c

@@ -47,6 +47,7 @@
 #include "wlan_p2p_public_struct.h"
 #include "wlan_p2p_ucfg_api.h"
 #include "wlan_cfg80211_p2p.h"
+#include "wlan_p2p_cfg_api.h"
 
 /* Ms to Time Unit Micro Sec */
 #define MS_TO_TU_MUS(x)   ((x) * 1024)
@@ -629,6 +630,7 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
 	struct hdd_adapter *adapter = NULL;
 	int ret;
 	uint8_t session_type;
+	bool p2p_dev_addr_admin = false;
 
 	hdd_enter();
 
@@ -683,7 +685,8 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
 	}
 
 	adapter = NULL;
-	if (hdd_ctx->config->isP2pDeviceAddrAdministrated &&
+	cfg_p2p_get_device_addr_admin(hdd_ctx->hdd_psoc, &p2p_dev_addr_admin);
+	if (p2p_dev_addr_admin &&
 	    ((NL80211_IFTYPE_P2P_GO == type) ||
 	     (NL80211_IFTYPE_P2P_CLIENT == type))) {
 		/*