Browse Source

qcacld-3.0: Add support for new ini param RoamScan_FirstTimer

Add support for new ini param RoamScan_FirstTimer. This param
is similar to the existing gEmptyScanRefreshPeriod but units
change

Change-Id: If250ba41d71ef20c7365af2c90550b3b575d285c
CRs-Fixed: 3016232
Jyoti Kumari 3 years ago
parent
commit
078acbe78e

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

@@ -1880,6 +1880,7 @@ static void mlme_init_lfr_cfg(struct wlan_objmgr_psoc *psoc,
 			      struct wlan_mlme_lfr_cfg *lfr)
 {
 	qdf_size_t neighbor_scan_chan_list_num = 0;
+	bool val = false;
 
 	lfr->mawc_roam_enabled =
 		cfg_get(psoc, CFG_LFR_MAWC_ROAM_ENABLED);
@@ -1992,8 +1993,14 @@ static void mlme_init_lfr_cfg(struct wlan_objmgr_psoc *psoc,
 		cfg_get(psoc, CFG_LFR_NEIGHBOR_SCAN_MAX_CHAN_TIME);
 	lfr->neighbor_scan_results_refresh_period =
 		cfg_get(psoc, CFG_LFR_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD);
-	lfr->empty_scan_refresh_period =
-		cfg_get(psoc, CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD);
+
+	ucfg_mlme_get_connection_roaming_ini_present(psoc, &val);
+	if (val)
+		lfr->empty_scan_refresh_period =
+			cfg_get(psoc, CFG_ROAM_SCAN_FIRST_TIMER) * 1000;
+	else
+		lfr->empty_scan_refresh_period =
+			cfg_get(psoc, CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD);
 	lfr->roam_bmiss_first_bcnt =
 		cfg_get(psoc, CFG_LFR_ROAM_BMISS_FIRST_BCNT);
 	lfr->roam_bmiss_final_bcnt =

+ 27 - 0
components/mlme/dispatcher/inc/cfg_mlme_lfr.h

@@ -1621,6 +1621,32 @@
 	CFG_VALUE_OR_DEFAULT, \
 	"Empty scan refresh period")
 
+ /*
+  * <ini>
+  * RoamScan_FirstTimer - Set empty scan refresh period
+  * @Min: 0
+  * @Max: 20
+  * @Default: 10
+  *
+  * This ini is used by firmware to set scan period in secs
+  * following empty scan results.
+  *
+  * Related: None
+  *
+  * Supported Feature: LFR Scan
+  *
+  * Usage: External
+  *
+  * </ini>
+  */
+#define CFG_ROAM_SCAN_FIRST_TIMER CFG_INI_UINT( \
+	"RoamScan_FirstTimer", \
+	0, \
+	20, \
+	10, \
+	CFG_VALUE_OR_DEFAULT, \
+	"Empty scan refresh period")
+
 /*
  * <ini>
  * gRoamBmissFirstBcnt - Beacon miss count to trigger 1st bmiss event
@@ -2950,6 +2976,7 @@
 	CFG(CFG_LFR_NEIGHBOR_SCAN_MAX_CHAN_TIME) \
 	CFG(CFG_LFR_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD) \
 	CFG(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD) \
+	CFG(CFG_ROAM_SCAN_FIRST_TIMER) \
 	CFG(CFG_LFR_ROAM_BMISS_FIRST_BCNT) \
 	CFG(CFG_LFR_ROAM_BMISS_FINAL_BCNT) \
 	CFG(CFG_LFR_ROAMING_DFS_CHANNEL) \

+ 4 - 2
components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -4307,11 +4307,13 @@ bool ucfg_mlme_validate_full_roam_scan_period(uint32_t full_roam_scan_period);
 
 /**
  * ucfg_mlme_validate_scan_period() - Validate if scan period is in valid range
- * @value: Scan period in msec
+ * @psoc: Pointer to soc
+ * @roam_scan_period: Scan period in msec
  *
  * Return: True if roam_scan_period is in expected range, false otherwise.
  */
-bool ucfg_mlme_validate_scan_period(uint32_t roam_scan_period);
+bool ucfg_mlme_validate_scan_period(struct wlan_objmgr_psoc *psoc,
+				    uint32_t roam_scan_period);
 /**
  * ucfg_mlme_get_ignore_fw_reg_offload_ind() - Get the
  * ignore_fw_reg_offload_ind ini

+ 14 - 6
components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c

@@ -1782,16 +1782,24 @@ bool ucfg_mlme_validate_full_roam_scan_period(uint32_t full_roam_scan_period)
 	return is_valid;
 }
 
-bool ucfg_mlme_validate_scan_period(uint32_t roam_scan_period)
+bool ucfg_mlme_validate_scan_period(struct wlan_objmgr_psoc *psoc,
+				    uint32_t roam_scan_period)
 {
-	bool is_valid = true;
+	bool is_valid = true, val = false;
 
 	if (!cfg_in_range(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD,
 			  roam_scan_period)) {
-		mlme_legacy_err("Roam scan period value %d msec is out of range (Min: %d msec Max: %d msec)",
-				roam_scan_period,
-				cfg_min(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD),
-				cfg_max(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD));
+		ucfg_mlme_get_connection_roaming_ini_present(psoc, &val);
+		if (val)
+			mlme_legacy_err("Roam scan period value %d msec is out of range (Min: %d msec Max: %d msec)",
+					roam_scan_period,
+					cfg_min(CFG_ROAM_SCAN_FIRST_TIMER) * 1000,
+					cfg_max(CFG_ROAM_SCAN_FIRST_TIMER) * 1000);
+		else
+			mlme_legacy_err("Roam scan period value %d msec is out of range (Min: %d msec Max: %d msec)",
+					roam_scan_period,
+					cfg_min(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD),
+					cfg_max(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD));
 		is_valid = false;
 	}
 

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

@@ -5308,7 +5308,8 @@ hdd_send_roam_scan_period_to_sme(struct hdd_context *hdd_ctx,
 	QDF_STATUS status;
 	uint16_t roam_scan_period_current, roam_scan_period_global;
 
-	if (!ucfg_mlme_validate_scan_period(roam_scan_period * 1000))
+	if (!ucfg_mlme_validate_scan_period(hdd_ctx->psoc,
+					    roam_scan_period * 1000))
 		return QDF_STATUS_E_INVAL;
 
 	hdd_debug("Received Command to Set roam scan period (Empty Scan refresh period) = %d",

+ 22 - 6
core/hdd/src/wlan_hdd_ioctl.c

@@ -2801,8 +2801,18 @@ static int drv_cmd_set_roam_scan_period(struct hdd_adapter *adapter,
 	int ret = 0;
 	uint8_t *value = command;
 	uint8_t roam_scan_period = 0;
-	uint16_t empty_scan_refresh_period =
-		cfg_default(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD);
+	uint16_t empty_scan_refresh_period;
+	bool flag = false, val = false;
+
+	ucfg_mlme_get_connection_roaming_ini_present(hdd_ctx->psoc, &val);
+	if (val) {
+		flag = true;
+		empty_scan_refresh_period =
+			cfg_default(CFG_ROAM_SCAN_FIRST_TIMER) * 1000;
+	} else {
+		empty_scan_refresh_period =
+			cfg_default(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD);
+	}
 
 	/* input refresh period is in terms of seconds */
 
@@ -2816,14 +2826,20 @@ static int drv_cmd_set_roam_scan_period(struct hdd_adapter *adapter,
 		 * If the input value is greater than max value of datatype,
 		 * then also kstrtou8 fails
 		 */
-		hdd_err("kstrtou8 failed Input value may be out of range[%d - %d]",
-			(cfg_min(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD) / 1000),
-			(cfg_max(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD) / 1000));
+		if (flag)
+			hdd_err("kstrtou8 failed Input value may be out of range[%d - %d]",
+				cfg_min(CFG_ROAM_SCAN_FIRST_TIMER),
+				cfg_max(CFG_ROAM_SCAN_FIRST_TIMER));
+		else
+			hdd_err("kstrtou8 failed Input value may be out of range[%d - %d]",
+				(cfg_min(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD) / 1000),
+				(cfg_max(CFG_LFR_EMPTY_SCAN_REFRESH_PERIOD) / 1000));
 		ret = -EINVAL;
 		goto exit;
 	}
 
-	if (!ucfg_mlme_validate_scan_period(roam_scan_period * 1000)) {
+	if (!ucfg_mlme_validate_scan_period(hdd_ctx->psoc,
+					    roam_scan_period * 1000)) {
 		ret = -EINVAL;
 		goto exit;
 	}