Prechádzať zdrojové kódy

qcacmn: Add new scan type SCAN_FOR_CONNECT for conn_manager infra

Add new scan type SCAN_FOR_CONNECT to support connection manager
infrastructure.

CRs-Fixed: 2713772
Change-Id: I631f3f0324e82ef6cd8b2befbed020649c80bc4c
Ashish Kumar Dhanotiya 5 rokov pred
rodič
commit
737eb69429

+ 4 - 1
umac/cmn_services/serialization/inc/wlan_serialization_api.h

@@ -80,6 +80,7 @@ enum wlan_serialization_cb_reason {
  * @is_cac_in_progress: boolean to check the cac status
  * @is_tdls_in_progress: boolean to check the tdls status
  * @is_mlme_op_in_progress: boolean to check the mlme op status
+ * @is_scan_for_connect: boolean to check if scan for connect
  *
  * This information is needed for scan command from other components
  * to apply the rules and check whether the cmd is allowed or not
@@ -88,6 +89,7 @@ struct wlan_serialization_scan_info {
 	bool is_cac_in_progress;
 	bool is_tdls_in_progress;
 	bool is_mlme_op_in_progress;
+	bool is_scan_for_connect;
 };
 
 /**
@@ -129,7 +131,8 @@ typedef QDF_STATUS
  * Return: None
  */
 typedef void (*wlan_serialization_comp_info_cb)(struct wlan_objmgr_vdev *vdev,
-		union wlan_serialization_rules_info *comp_info);
+		union wlan_serialization_rules_info *comp_info,
+		struct wlan_serialization_command *cmd);
 
 /**
  * wlan_serialization_apply_rules_cb() - callback per command to apply rules

+ 1 - 1
umac/cmn_services/serialization/src/wlan_serialization_api.c

@@ -411,7 +411,7 @@ wlan_serialization_request(struct wlan_serialization_command *cmd)
 		if (!ser_soc_obj->comp_info_cb[cmd->cmd_type][comp_id])
 			continue;
 		ser_soc_obj->comp_info_cb[cmd->cmd_type][comp_id](cmd->vdev,
-			&info);
+			&info, cmd);
 		if (!ser_soc_obj->apply_rules_cb[cmd->cmd_type])
 			continue;
 		if (!ser_soc_obj->apply_rules_cb[cmd->cmd_type](&info, comp_id))

+ 2 - 1
umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c

@@ -468,7 +468,8 @@ QDF_STATUS wlan_dfs_pdev_obj_destroy_notification(struct wlan_objmgr_pdev *pdev,
 
 static void dfs_scan_serialization_comp_info_cb(
 		struct wlan_objmgr_vdev *vdev,
-		union wlan_serialization_rules_info *comp_info)
+		union wlan_serialization_rules_info *comp_info,
+		struct wlan_serialization_command *cmd)
 {
 	struct wlan_dfs *dfs = NULL;
 	struct wlan_objmgr_pdev *pdev;

+ 15 - 1
umac/mlme/mlme_objmgr/dispatcher/src/wlan_vdev_mlme_main.c

@@ -173,9 +173,11 @@ static QDF_STATUS mlme_vdev_obj_destroy_handler(struct wlan_objmgr_vdev *vdev,
 
 static void mlme_scan_serialization_comp_info_cb(
 		struct wlan_objmgr_vdev *vdev,
-		union wlan_serialization_rules_info *comp_info)
+		union wlan_serialization_rules_info *comp_info,
+		struct wlan_serialization_command *cmd)
 {
 	struct wlan_objmgr_pdev *pdev;
+	struct scan_start_request *scan_start_req = cmd->umac_cmd;
 	QDF_STATUS status;
 
 	if (!comp_info || !vdev) {
@@ -189,6 +191,18 @@ static void mlme_scan_serialization_comp_info_cb(
 		return;
 	}
 
+	if (!scan_start_req) {
+		mlme_err("scan start request is null");
+		return;
+	}
+
+	comp_info->scan_info.is_scan_for_connect = false;
+
+	if (cmd->cmd_type == WLAN_SER_CMD_SCAN &&
+	    scan_start_req->scan_req.scan_type == SCAN_TYPE_SCAN_FOR_CONNECT) {
+		comp_info->scan_info.is_scan_for_connect = true;
+	}
+
 	comp_info->scan_info.is_mlme_op_in_progress = false;
 
 	status = wlan_util_is_pdev_scan_allowed(pdev, WLAN_MLME_SER_IF_ID);

+ 3 - 1
umac/scan/dispatcher/inc/wlan_scan_public_structs.h

@@ -697,12 +697,14 @@ struct hint_bssid {
  * @SCAN_TYPE_P2P_SEARCH: P2P Search
  * @SCAN_TYPE_P2P_LISTEN: P2P listed
  * @SCAN_TYPE_RRM: RRM scan request
+ * @SCAN_TYPE_SCAN_FOR_CONNECT : Scan for connect
  */
 enum scan_request_type {
 	SCAN_TYPE_DEFAULT = 0,
 	SCAN_TYPE_P2P_SEARCH = 1,
 	SCAN_TYPE_P2P_LISTEN = 2,
-	SCAN_TYPE_RRM = 3
+	SCAN_TYPE_RRM = 3,
+	SCAN_TYPE_SCAN_FOR_CONNECT = 4
 };
 
 /**

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

@@ -1656,6 +1656,11 @@ static bool scm_serialization_scan_rules_cb(
 		}
 		break;
 	case WLAN_UMAC_COMP_MLME:
+		if (comp_info->scan_info.is_scan_for_connect) {
+			scm_debug("Allow scan request from connect");
+			return true;
+		}
+
 		if (comp_info->scan_info.is_mlme_op_in_progress) {
 			scm_debug("Cancel scan. MLME operation in progress");
 			return false;