瀏覽代碼

qcacld-3.0: Refactor legacy ini items

Refactor the below two ini items to new converged cfg/ini
infrastructure:
"gEnableChangeChannelBandWidth"
"extscan_adaptive_dwell_mode"

"extscan_adaptive_dwell_mode" - move this to scm module
"gEnableChangeChannelBandWidth" - move this to mlme

Change-Id: I1ca6657a95c2cd47057f11ccf23c47347f3fc33b
CRs-Fixed: 2394240
Pragaspathi Thilagaraj 6 年之前
父節點
當前提交
a889375029

+ 2 - 0
components/mlme/core/src/wlan_mlme_main.c

@@ -359,6 +359,8 @@ static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc,
 		cfg_get(psoc, CFG_ENABLE_BEACON_RECEPTION_STATS);
 	gen->enable_remove_time_stamp_sync_cmd =
 		cfg_get(psoc, CFG_REMOVE_TIME_STAMP_SYNC_CMD);
+	gen->enable_change_channel_bandwidth =
+		cfg_get(psoc, CFG_CHANGE_CHANNEL_BANDWIDTH);
 }
 
 static void mlme_init_edca_ani_cfg(struct wlan_mlme_edca_params *edca_params)

+ 32 - 1
components/mlme/dispatcher/inc/cfg_mlme_generic.h

@@ -595,6 +595,36 @@
 	0, \
 	"Enable to remove time stamp sync cmd")
 
+/*
+ * <ini>
+ * gEnableChangeChannelBandWidth  Enable/Disable change
+ * channel&bandwidth in the mission mode
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * 0  not allow change channel&bandwidth by setMonChan
+ * 1  allow change channel&bandwidth by setMonChan
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#ifdef FEATURE_MONITOR_MODE_SUPPORT
+#define CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT true
+#else
+#define CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT false
+#endif
+
+#define CFG_CHANGE_CHANNEL_BANDWIDTH CFG_INI_BOOL( \
+		"gEnableChangeChannelBandWidth", \
+		CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT, \
+		"enable change channel bw")
+
 #define CFG_GENERIC_ALL \
 	CFG(CFG_ENABLE_DEBUG_PACKET_LOG) \
 	CFG(CFG_PMF_SA_QUERY_MAX_RETRIES) \
@@ -620,6 +650,7 @@
 	CFG(CFG_DROPPED_PKT_DISCONNECT_THRESHOLD) \
 	CFG(CFG_ITO_REPEAT_COUNT) \
 	CFG(CFG_ENABLE_BEACON_RECEPTION_STATS) \
-	CFG(CFG_REMOVE_TIME_STAMP_SYNC_CMD)
+	CFG(CFG_REMOVE_TIME_STAMP_SYNC_CMD) \
+	CFG(CFG_CHANGE_CHANNEL_BANDWIDTH)
 
 #endif /* __CFG_MLME_GENERIC_H */

+ 10 - 0
components/mlme/dispatcher/inc/wlan_mlme_api.h

@@ -1975,6 +1975,16 @@ QDF_STATUS wlan_mlme_ibss_power_save_setup(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS
 wlan_mlme_set_11d_enabled(struct wlan_objmgr_psoc *psoc, bool value);
 
+/**
+ * wlan_mlme_is_change_channel_bandwidth_enabled() - get the
+ * enable_change_channel_bandwidth flag
+ * @psoc: psoc context
+ *
+ * Return: true if enabled
+ */
+bool
+wlan_mlme_is_change_channel_bandwidth_enabled(struct wlan_objmgr_psoc *psoc);
+
 /**
  * wlan_mlme_get_sta_miracast_mcc_rest_time() - Get STA/MIRACAST MCC rest time
  *

+ 3 - 0
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -996,6 +996,8 @@ struct wlan_mlme_chainmask {
  * @enabled_11d: enable 11d flag
  * @enable_beacon_reception_stats: enable beacon reception stats
  * @enable_remove_time_stamp_sync_cmd: Enable remove time stamp sync cmd
+ * @enable_change_channel_bandwidth: enable/disable change channel bw in mission
+ * mode
  */
 struct wlan_mlme_generic {
 	enum band_info band_capability;
@@ -1024,6 +1026,7 @@ struct wlan_mlme_generic {
 	bool enable_deauth_to_disassoc_map;
 	bool enable_beacon_reception_stats;
 	bool enable_remove_time_stamp_sync_cmd;
+	bool enable_change_channel_bandwidth;
 };
 
 /*

+ 13 - 0
components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -2521,6 +2521,19 @@ ucfg_mlme_set_11d_enabled(struct wlan_objmgr_psoc *psoc, bool value)
 	return wlan_mlme_set_11d_enabled(psoc, value);
 }
 
+/**
+ * ucfg_mlme_is_change_channel_bandwidth_enabled() - ucfg api to get the
+ * enable_change_channel_bandwidth flag
+ * @psoc: psoc context
+ *
+ * Return: true if enabled
+ */
+static inline bool
+ucfg_mlme_is_change_channel_bandwidth_enabled(struct wlan_objmgr_psoc *psoc)
+{
+	return wlan_mlme_is_change_channel_bandwidth_enabled(psoc);
+}
+
 /**
  * ucfg_mlme_get_opr_rate_set() - Get operational rate set
  * @psoc: pointer to psoc object

+ 13 - 0
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -2387,6 +2387,19 @@ wlan_mlme_set_11d_enabled(struct wlan_objmgr_psoc *psoc, bool value)
 
 	return QDF_STATUS_SUCCESS;
 }
+
+bool
+wlan_mlme_is_change_channel_bandwidth_enabled(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj)
+		return cfg_default(CFG_CHANGE_CHANNEL_BANDWIDTH);
+
+	return mlme_obj->cfg.gen.enable_change_channel_bandwidth;
+}
+
 QDF_STATUS
 wlan_mlme_cfg_set_vht_chan_width(struct wlan_objmgr_psoc *psoc, uint8_t value)
 {

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

@@ -96,36 +96,6 @@ enum hdd_dot11_mode {
 	eHDD_DOT11_MODE_11ax,
 };
 
-/*
- * <ini>
- * extscan_adaptive_dwell_mode - Enable adaptive dwell mode
- * during ext scan
- * @Min: 0
- * @Max: 4
- * @Default: 1
- *
- * This ini will set the algo used in dwell time optimization
- * during ext scan. see enum scan_dwelltime_adaptive_mode.
- * Acceptable values for this:
- * 0: Default (Use firmware default mode)
- * 1: Conservative optimization
- * 2: Moderate optimization
- * 3: Aggressive optimization
- * 4: Static
- *
- * Related: None
- *
- * Supported Feature: Scan
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_NAME     "extscan_adaptive_dwell_mode"
-#define CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_MIN      (0)
-#define CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_MAX      (4)
-#define CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_DEFAULT  (1)
-
 /*
  * <ini>
  * gDot11Mode - SAP phy mode
@@ -223,34 +193,6 @@ enum hdd_dot11_mode {
 
 #endif
 
-/*
- * <ini>
- * gEnableChangeChannelBandWidth - Enable/Disable change
- * channel&bandwidth in the mission mode
- * @Min: 0
- * @Max: 1
- * @Default: 0
- *
- * 0 - not allow change channel&bandwidth by setMonChan
- * 1 - allow change channel&bandwidth by setMonChan
- *
- * Related: None
- *
- * Supported Feature: STA
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_CHANGE_CHANNEL_BANDWIDTH_NAME    "gEnableChangeChannelBandWidth"
-#define CFG_CHANGE_CHANNEL_BANDWIDTH_MIN     (0)
-#define CFG_CHANGE_CHANNEL_BANDWIDTH_MAX     (1)
-#ifdef FEATURE_MONITOR_MODE_SUPPORT
-#define CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT (1)
-#else
-#define CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT (0)
-#endif
-
 /*
  * Type declarations
  */
@@ -277,7 +219,6 @@ struct hdd_config {
 	uint8_t dhcpServerIP[IPADDR_STRING_LENGTH];
 #endif /* DHCP_SERVER_OFFLOAD */
 	bool apf_enabled;
-	enum scan_dwelltime_adaptive_mode extscan_adaptive_dwell_mode;
 	uint16_t sap_tx_leakage_threshold;
 	bool sap_internal_restart;
 	bool tx_orphan_enable;
@@ -285,7 +226,6 @@ struct hdd_config {
 	bool action_oui_enable;
 	uint8_t action_oui_str[ACTION_OUI_MAXIMUM_ID][ACTION_OUI_MAX_STR_LEN];
 	bool is_unit_test_framework_enabled;
-	bool enable_change_channel_bandwidth;
 
 	/* HDD converged ini items are listed below this*/
 	bool bug_on_reinit_failure;

+ 0 - 14
core/hdd/src/wlan_hdd_cfg.c

@@ -77,20 +77,6 @@ struct reg_table_entry g_registry_table[] = {
 			    (void *)CFG_DHCP_SERVER_IP_DEFAULT),
 #endif /* DHCP_SERVER_OFFLOAD */
 
-	REG_VARIABLE(CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_NAME, WLAN_PARAM_Integer,
-		struct hdd_config, extscan_adaptive_dwell_mode,
-		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_DEFAULT,
-		CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_MIN,
-		CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_MAX),
-
-	REG_VARIABLE(CFG_CHANGE_CHANNEL_BANDWIDTH_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, enable_change_channel_bandwidth,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT,
-		     CFG_CHANGE_CHANNEL_BANDWIDTH_MIN,
-		     CFG_CHANGE_CHANNEL_BANDWIDTH_MAX),
 };
 
 

+ 1 - 1
core/hdd/src/wlan_hdd_cfg80211.c

@@ -15434,7 +15434,7 @@ void hdd_select_cbmode(struct hdd_adapter *adapter, uint8_t operationChannel,
 				    sec_ch, ch_params);
 
 	if (adapter->device_mode == QDF_STA_MODE &&
-	    hdd_ctx->config->enable_change_channel_bandwidth) {
+	    ucfg_mlme_is_change_channel_bandwidth_enabled(hdd_ctx->psoc)) {
 		connstate = station_ctx->conn_info.connState;
 		if (!(eConnectionState_Associated == connstate ||
 		      eConnectionState_Connecting == connstate)) {

+ 1 - 1
core/hdd/src/wlan_hdd_ext_scan.c

@@ -3150,7 +3150,7 @@ __wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy,
 				nla_get_u32(tb[id]));
 
 	params->extscan_adaptive_dwell_mode =
-		hdd_ctx->config->extscan_adaptive_dwell_mode;
+		ucfg_scan_get_extscan_adaptive_dwell_mode(hdd_ctx->psoc);
 
 	hdd_debug("Configuration flags: %u",
 		  params->configuration_flags);

+ 2 - 2
core/hdd/src/wlan_hdd_main.c

@@ -6432,7 +6432,7 @@ int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan,
 		return -EINVAL;
 	}
 	if (adapter->device_mode == QDF_STA_MODE &&
-	    hdd_ctx->config->enable_change_channel_bandwidth) {
+	    ucfg_mlme_is_change_channel_bandwidth_enabled(hdd_ctx->psoc)) {
 		connstate = sta_ctx->conn_info.connState;
 		if (eConnectionState_Associated == connstate ||
 		    eConnectionState_Connecting == connstate) {
@@ -6473,7 +6473,7 @@ int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan,
 	roam_profile.phyMode = ch_info->phy_mode;
 	roam_profile.ch_params.ch_width = bandwidth;
 	hdd_select_cbmode(adapter, chan, &roam_profile.ch_params);
-	if (hdd_ctx->config->enable_change_channel_bandwidth &&
+	if (ucfg_mlme_is_change_channel_bandwidth_enabled(hdd_ctx->psoc) &&
 	    (!sme_find_session_by_bssid(mac_handle, adapter->mac_addr.bytes))) {
 		status = sme_create_mon_session(mac_handle,
 						adapter->mac_addr.bytes,