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

qcacmn: Trim scan channel list

As requirement, concurrent mode, station 5G/2G scan need stop when AP
connected by peer station.

Condition:
STA + AP 5G (connected) + AP 2.4G	skip 5G scan
STA + AP 5G (connected)			skip 5G scan
STA + AP 2.4G (connected && 2.4G only)	skip 2.4G scan
Others concurrency			skip none

Add ini ch_list_trim_conc to enable/disable the feature. Default is
disabled.

Before send WMI_SCAN_CMD to firmware, call API
policy_mgr_scan_trim_chnls_for_connected_ap() to check if need
trim scan channel list. Which channel list need be trimmed

Change-Id: If4d1cf7347f757fb013ffcb4016e8e6f16859f42
CRs-Fixed: 3075068
Yu Ouyang 3 жил өмнө
parent
commit
b6a3f2fd44

+ 2 - 0
umac/scan/core/src/wlan_scan_main.h

@@ -322,6 +322,7 @@ struct extscan_def_config {
  * @conc_max_rest_time: default concurrent max rest time
  * @conc_min_rest_time: default concurrent min rest time
  * @conc_idle_time: default concurrent idle time
+ * @conc_chlist_trim: enable to trim concurrent scan channel list
  * @repeat_probe_time: default repeat probe time
  * @probe_spacing_time: default probe spacing time
  * @probe_delay: default probe delay
@@ -412,6 +413,7 @@ struct scan_default_params {
 	uint32_t conc_max_rest_time;
 	uint32_t conc_min_rest_time;
 	uint32_t conc_idle_time;
+	bool conc_chlist_trim;
 	uint32_t repeat_probe_time;
 	uint32_t probe_spacing_time;
 	uint32_t probe_delay;

+ 63 - 17
umac/scan/core/src/wlan_scan_manager.c

@@ -802,6 +802,46 @@ static void scm_req_update_concurrency_params(struct wlan_objmgr_vdev *vdev,
 	}
 }
 
+static inline void scm_update_5g_chlist(struct scan_start_request *req)
+{
+	uint32_t i;
+	uint32_t num_scan_channels;
+
+	num_scan_channels = 0;
+	for (i = 0; i < req->scan_req.chan_list.num_chan; i++) {
+		if (WLAN_REG_IS_5GHZ_CH_FREQ(
+			req->scan_req.chan_list.chan[i].freq))
+			continue;
+
+		req->scan_req.chan_list.chan[num_scan_channels++] =
+			req->scan_req.chan_list.chan[i];
+	}
+	if (num_scan_channels < req->scan_req.chan_list.num_chan)
+		scm_debug("5g chan skipped (%d, %d)",
+			  req->scan_req.chan_list.num_chan, num_scan_channels);
+	req->scan_req.chan_list.num_chan = num_scan_channels;
+}
+
+static inline void scm_update_24g_chlist(struct scan_start_request *req)
+{
+	uint32_t i;
+	uint32_t num_scan_channels;
+
+	num_scan_channels = 0;
+	for (i = 0; i < req->scan_req.chan_list.num_chan; i++) {
+		if (WLAN_REG_IS_24GHZ_CH_FREQ(
+			req->scan_req.chan_list.chan[i].freq))
+			continue;
+
+		req->scan_req.chan_list.chan[num_scan_channels++] =
+			req->scan_req.chan_list.chan[i];
+	}
+	if (num_scan_channels < req->scan_req.chan_list.num_chan)
+		scm_debug("2g chan skipped (%d, %d)",
+			  req->scan_req.chan_list.num_chan, num_scan_channels);
+	req->scan_req.chan_list.num_chan = num_scan_channels;
+}
+
 /**
  * scm_scan_chlist_concurrency_modify() - modify chan list to skip 5G if
  *    required
@@ -816,31 +856,37 @@ static inline void scm_scan_chlist_concurrency_modify(
 	struct wlan_objmgr_vdev *vdev, struct scan_start_request *req)
 {
 	struct wlan_objmgr_psoc *psoc;
-	uint32_t i;
-	uint32_t num_scan_channels;
+	struct wlan_objmgr_pdev *pdev;
+	struct wlan_scan_obj *scan_obj;
+	uint16_t trim;
 
-	psoc = wlan_vdev_get_psoc(vdev);
+	pdev = wlan_vdev_get_pdev(vdev);
+	if (!pdev)
+		return;
+
+	psoc = wlan_pdev_get_psoc(pdev);
 	if (!psoc)
 		return;
+
+	scan_obj = wlan_vdev_get_scan_obj(req->vdev);
+	if (!scan_obj)
+		return;
+
 	/* do this only for STA and P2P-CLI mode */
 	if (!(wlan_vdev_mlme_get_opmode(req->vdev) == QDF_STA_MODE) &&
 	    !(wlan_vdev_mlme_get_opmode(req->vdev) == QDF_P2P_CLIENT_MODE))
 		return;
-	if (!policy_mgr_scan_trim_5g_chnls_for_dfs_ap(psoc))
-		return;
-	num_scan_channels = 0;
-	for (i = 0; i < req->scan_req.chan_list.num_chan; i++) {
-		if (WLAN_REG_IS_5GHZ_CH_FREQ(
-			req->scan_req.chan_list.chan[i].freq)) {
-			continue;
-		}
-		req->scan_req.chan_list.chan[num_scan_channels++] =
-			req->scan_req.chan_list.chan[i];
+
+	if (policy_mgr_scan_trim_5g_chnls_for_dfs_ap(psoc))
+		scm_update_5g_chlist(req);
+
+	if (scan_obj->scan_def.conc_chlist_trim) {
+		trim = policy_mgr_scan_trim_chnls_for_connected_ap(pdev);
+		if (trim & TRIM_CHANNEL_LIST_5G)
+			scm_update_5g_chlist(req);
+		if (trim & TRIM_CHANNEL_LIST_24G)
+			scm_update_24g_chlist(req);
 	}
-	if (num_scan_channels < req->scan_req.chan_list.num_chan)
-		scm_debug("5g chan skipped (%d, %d)",
-			  req->scan_req.chan_list.num_chan, num_scan_channels);
-	req->scan_req.chan_list.num_chan = num_scan_channels;
 }
 #else
 static inline

+ 24 - 0
umac/scan/dispatcher/inc/cfg_scan.h

@@ -1066,6 +1066,29 @@ enum scan_mode_6ghz {
 				CFG_VALUE_OR_DEFAULT, \
 				"data inactivity time on bss channel")
 
+/*
+ * <ini>
+ * gChlistTrimConc - Enable scan list modification on concurrent mode.
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used to enable/disable scan list modification
+ * on concurrent mode.
+ *
+ * Related: None.
+ *
+ * Supported Feature: Concurrency, Scan
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_CHAN_LIST_TRIM_CONC CFG_INI_BOOL(\
+				"ch_list_trim_conc",\
+				false, \
+				"Enable scan list trim")
+
 /*
  * <ini>
  * gEnableMacAddrSpoof - Enable mac address randomization feature.
@@ -1438,6 +1461,7 @@ enum scan_mode_6ghz {
 	CFG(CFG_MAX_REST_TIME_CONC) \
 	CFG(CFG_MIN_REST_TIME_CONC) \
 	CFG(CFG_IDLE_TIME_CONC) \
+	CFG(CFG_CHAN_LIST_TRIM_CONC) \
 	CFG(CFG_ENABLE_MAC_ADDR_SPOOFING) \
 	CFG(CFG_SCAN_AGING_TIME) \
 	CFG(CFG_ADAPTIVE_EXTSCAN_DWELL_MODE) \

+ 12 - 0
umac/scan/dispatcher/inc/wlan_scan_public_structs.h

@@ -1606,4 +1606,16 @@ struct rnr_chan_weight {
 	enum scan_phy_mode phymode;
 	enum scan_flags flags;
 };
+
+/**
+ * trim_channel_list - which channel list need trim
+ * @TRIM_CHANNEL_LIST_NONE: no channel need trim
+ * @TRIM_CHANNEL_LIST_5G: 5G channel need trim
+ * @TRIM_CHANNEL_LIST_24G: 2.4G channel need trim
+ */
+enum trim_channel_list {
+	TRIM_CHANNEL_LIST_NONE,
+	TRIM_CHANNEL_LIST_5G,
+	TRIM_CHANNEL_LIST_24G,
+};
 #endif

+ 2 - 0
umac/scan/dispatcher/src/wlan_scan_ucfg_api.c

@@ -734,6 +734,8 @@ wlan_scan_global_init(struct wlan_objmgr_psoc *psoc,
 			cfg_get(psoc, CFG_MIN_REST_TIME_CONC);
 	scan_obj->scan_def.conc_idle_time =
 			cfg_get(psoc, CFG_IDLE_TIME_CONC);
+	scan_obj->scan_def.conc_chlist_trim =
+			cfg_get(psoc, CFG_CHAN_LIST_TRIM_CONC);
 	scan_obj->scan_def.repeat_probe_time =
 			cfg_get(psoc, CFG_SCAN_PROBE_REPEAT_TIME);
 	scan_obj->scan_def.probe_spacing_time = SCAN_PROBE_SPACING_TIME;