Jelajahi Sumber

qcacld-3.0: Add connection manager RSO init/deinit support

Add connection manager changes to send roam scan offload init
deinit. Add new enum roam_offload_init_flags to fill the roam
init/deinit flags, 4-way handshake offload, bmiss skip full scan
flags at connection manager instead of getting the ini and filling
at target if.

Change-Id: I558e868efd341b508d3df76c8d6ab90eac512432
CRs-Fixed: 2745585
Pragaspathi Thilagaraj 4 tahun lalu
induk
melakukan
68d572daa3

+ 6 - 6
components/mlme/core/src/wlan_mlme_main.c

@@ -2631,10 +2631,10 @@ static void
 mlme_print_roaming_state(uint8_t vdev_id, enum roam_offload_state cur_state,
 			 enum roam_offload_state new_state)
 {
-	mlme_legacy_debug("ROAM: vdev%d: [%s(%d)] --> [%s(%d)]",
-			  vdev_id, mlme_roam_state_to_string(cur_state),
-			  cur_state,
-			  mlme_roam_state_to_string(new_state), new_state);
+	mlme_nofl_debug("CM_RSO: vdev%d: [%s(%d)] --> [%s(%d)]",
+			vdev_id, mlme_roam_state_to_string(cur_state),
+			cur_state,
+			mlme_roam_state_to_string(new_state), new_state);
 
 	/* TODO: Try to print the state change requestor also */
 }
@@ -2839,13 +2839,13 @@ void mlme_set_roam_state(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 						    WLAN_MLME_OBJMGR_ID);
 
 	if (!vdev) {
-		mlme_legacy_err("vdev object is NULL");
+		mlme_err("vdev%d: vdev object is NULL", vdev_id);
 		return;
 	}
 
 	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
 	if (!mlme_priv) {
-		mlme_legacy_err("vdev legacy private object is NULL");
+		mlme_err("vdev%d: vdev legacy private object is NULL", vdev_id);
 		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_OBJMGR_ID);
 		return;
 	}

+ 48 - 0
components/target_if/connection_mgr/src/target_if_cm_roam_offload.c

@@ -565,6 +565,53 @@ target_if_cm_roam_scan_filter(wmi_unified_t wmi_handle, uint8_t command,
 	return status;
 }
 
+static uint32_t
+target_if_get_wmi_roam_offload_flag(uint32_t flag)
+{
+	uint32_t roam_offload_flag = 0;
+
+	if (flag & WLAN_ROAM_FW_OFFLOAD_ENABLE)
+		roam_offload_flag |= WMI_ROAM_FW_OFFLOAD_ENABLE_FLAG;
+
+	if (flag & WLAN_ROAM_BMISS_FINAL_SCAN_ENABLE)
+		roam_offload_flag |= WMI_ROAM_BMISS_FINAL_SCAN_ENABLE_FLAG;
+
+	if (flag & WLAN_ROAM_SKIP_EAPOL_4WAY_HANDSHAKE)
+		roam_offload_flag |=
+			WMI_VDEV_PARAM_SKIP_ROAM_EAPOL_4WAY_HANDSHAKE;
+
+	if (flag & WLAN_ROAM_BMISS_FINAL_SCAN_TYPE)
+		roam_offload_flag |= WMI_ROAM_BMISS_FINAL_SCAN_TYPE_FLAG;
+
+	return roam_offload_flag;
+}
+
+/**
+ * target_if_cm_roam_send_roam_init  - Send roam module init/deinit to firmware
+ * @vdev:  Pointer to Objmgr vdev
+ * @params: Roam offload init params
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS
+target_if_cm_roam_send_roam_init(struct wlan_objmgr_vdev *vdev,
+				 struct wlan_roam_offload_init_params *params)
+{
+	QDF_STATUS status;
+	wmi_unified_t wmi_handle;
+	uint32_t flag;
+
+	wmi_handle = target_if_cm_roam_get_wmi_handle_from_vdev(vdev);
+	if (!wmi_handle)
+		return QDF_STATUS_E_FAILURE;
+
+	flag = target_if_get_wmi_roam_offload_flag(params->roam_offload_flag);
+	status = target_if_vdev_set_param(wmi_handle, params->vdev_id,
+					  WMI_VDEV_PARAM_ROAM_FW_OFFLOAD, flag);
+
+	return status;
+}
+
 /**
  * target_if_cm_roam_send_roam_start() - Send roam start related commands
  * to wmi
@@ -647,6 +694,7 @@ end:
 static void
 target_if_cm_roam_register_rso_req_ops(struct wlan_cm_roam_tx_ops *tx_ops)
 {
+	tx_ops->send_roam_offload_init_req = target_if_cm_roam_send_roam_init;
 	tx_ops->send_roam_start_req = target_if_cm_roam_send_roam_start;
 }
 #else

+ 4 - 7
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -122,11 +122,9 @@ wlan_cm_roam_triggers(struct wlan_objmgr_psoc *psoc,
  * Return: QDF_STATUS
  */
 static QDF_STATUS
-cm_roam_init_req(struct wlan_objmgr_psoc *psoc,
-		 uint8_t vdev_id,
-		 bool enable)
+cm_roam_init_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, bool enable)
 {
-	return QDF_STATUS_SUCCESS;
+	return wlan_cm_tgt_send_roam_offload_init(psoc, vdev_id, enable);
 }
 
 /**
@@ -337,7 +335,6 @@ cm_roam_switch_to_deinit(struct wlan_objmgr_pdev *pdev,
 	}
 
 	status = cm_roam_init_req(psoc, vdev_id, false);
-
 	if (QDF_IS_STATUS_ERROR(status))
 		return status;
 
@@ -381,7 +378,7 @@ cm_roam_switch_to_init(struct wlan_objmgr_pdev *pdev,
 	case WLAN_ROAM_DEINIT:
 		roaming_bitmap = mlme_get_roam_trigger_bitmap(psoc, vdev_id);
 		if (!roaming_bitmap) {
-			mlme_info("ROAM: Cannot change to INIT state for vdev[%d]",
+			mlme_info("CM_RSO: Cannot change to INIT state for vdev[%d]",
 				  vdev_id);
 			return QDF_STATUS_E_FAILURE;
 		}
@@ -404,7 +401,7 @@ cm_roam_switch_to_init(struct wlan_objmgr_pdev *pdev,
 			 * supplicant.
 			 */
 			if (reason != REASON_SUPPLICANT_INIT_ROAMING) {
-				mlme_info("ROAM: Roam module already initialized on vdev:[%d]",
+				mlme_info("CM_RSO: Roam module already initialized on vdev:[%d]",
 					  temp_vdev_id);
 				return QDF_STATUS_E_FAILURE;
 			}

+ 35 - 0
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_srtuct.h

@@ -88,6 +88,35 @@
 #define REASON_ROAM_HANDOFF_DONE                    52
 #define REASON_ROAM_ABORT                           53
 
+/**
+ * enum roam_offload_init_flags  - Flags sent in Roam offload initialization.
+ * @WLAN_ROAM_FW_OFFLOAD_ENABLE: Init roaming module at firwmare
+ * @WLAN_ROAM_BMISS_FINAL_SCAN_ENABLE: Enable partial scan after final beacon
+ * miss event at firmware
+ * @WLAN_ROAM_SKIP_EAPOL_4WAY_HANDSHAKE: Disable 4 Way-HS offload to firmware
+ * Setting this flag will make the eapol packets reach to host every time
+ * and can cause frequent APPS wake-ups.
+ * @WLAN_ROAM_BMISS_FINAL_SCAN_TYPE: Set this flag to skip full scan on final
+ * bmiss and use the channel map to do the partial scan alone
+ */
+enum roam_offload_init_flags {
+	WLAN_ROAM_FW_OFFLOAD_ENABLE = BIT(1),
+	WLAN_ROAM_BMISS_FINAL_SCAN_ENABLE = BIT(2),
+	WLAN_ROAM_SKIP_EAPOL_4WAY_HANDSHAKE = BIT(3),
+	WLAN_ROAM_BMISS_FINAL_SCAN_TYPE = BIT(4)
+};
+
+/**
+ * struct wlan_roam_offload_init_params - Firmware roam module initialization
+ * parameters. Used to fill
+ * @vdev_id: vdev for which the roaming has to be enabled/disabled
+ * @roam_offload_flag:  flag to init/deinit roam module
+ */
+struct wlan_roam_offload_init_params {
+	uint8_t vdev_id;
+	uint32_t roam_offload_flag;
+};
+
 /**
  * struct wlan_cm_roam_vendor_btm_params - vendor config roam control param
  * @scan_freq_scheme: scan frequency scheme from enum
@@ -625,6 +654,8 @@ struct set_pcl_req {
  * roaming related commands
  * @send_vdev_set_pcl_cmd: TX ops function pointer to send set vdev PCL
  * command
+ * @send_roam_offload_init_req: TX Ops function pointer to send roam offload
+ * module initialize request
  * @send_roam_start_req: TX ops function pointer to send roam start related
  * commands
  */
@@ -632,6 +663,10 @@ struct wlan_cm_roam_tx_ops {
 	QDF_STATUS (*send_vdev_set_pcl_cmd) (struct wlan_objmgr_vdev *vdev,
 					     struct set_pcl_req *req);
 #ifdef ROAM_OFFLOAD_V1
+	QDF_STATUS (*send_roam_offload_init_req) (
+			struct wlan_objmgr_vdev *vdev,
+			struct wlan_roam_offload_init_params *params);
+
 	QDF_STATUS (*send_roam_start_req)(struct wlan_objmgr_vdev *vdev,
 					  struct wlan_roam_start_config *req);
 #endif

+ 12 - 0
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_tgt_if_tx_api.h

@@ -50,6 +50,18 @@ wlan_cm_roam_send_set_vdev_pcl(struct wlan_objmgr_psoc *psoc,
 
 #ifdef ROAM_OFFLOAD_V1
 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
+/**
+ * wlan_cm_tgt_send_roam_offload_init  - Send WMI_VDEV_PARAM_ROAM_FW_OFFLOAD to
+ * init/deinit roaming module at firmware
+ * @psoc: PSOC pointer
+ * @vdev_id: vdev id
+ * @is_init: true if roam module is to be initialized else false for deinit
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS wlan_cm_tgt_send_roam_offload_init(struct wlan_objmgr_psoc *psoc,
+					      uint8_t vdev_id, bool is_init);
+
 /**
  * wlan_cm_tgt_send_roam_start_req  - Send roam start command to firmware
  * @psoc:    psoc pointer

+ 50 - 2
components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_tgt_if_tx_api.c

@@ -131,6 +131,54 @@ end:
 
 #ifdef ROAM_OFFLOAD_V1
 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
+QDF_STATUS wlan_cm_tgt_send_roam_offload_init(struct wlan_objmgr_psoc *psoc,
+					      uint8_t vdev_id, bool is_init)
+{
+	QDF_STATUS status;
+	struct wlan_cm_roam_tx_ops roam_tx_ops;
+	struct wlan_objmgr_vdev *vdev;
+	struct wlan_roam_offload_init_params init_msg = {0};
+	bool disable_4way_hs_offload, bmiss_skip_full_scan;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_NB_ID);
+	if (!vdev)
+		return QDF_STATUS_E_INVAL;
+
+	roam_tx_ops = GET_CM_ROAM_TX_OPS_FROM_VDEV(vdev);
+	if (!roam_tx_ops.send_roam_offload_init_req) {
+		mlme_err("CM_RSO: vdev%d send_roam_offload_init_req is NULL",
+			 vdev_id);
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	init_msg.vdev_id = vdev_id;
+	if (is_init) {
+		init_msg.roam_offload_flag = WLAN_ROAM_FW_OFFLOAD_ENABLE |
+				 WLAN_ROAM_BMISS_FINAL_SCAN_ENABLE;
+
+		wlan_mlme_get_4way_hs_offload(psoc, &disable_4way_hs_offload);
+		if (disable_4way_hs_offload)
+			init_msg.roam_offload_flag |=
+				WLAN_ROAM_SKIP_EAPOL_4WAY_HANDSHAKE;
+
+		wlan_mlme_get_bmiss_skip_full_scan_value(psoc,
+							 &bmiss_skip_full_scan);
+		if (bmiss_skip_full_scan)
+			init_msg.roam_offload_flag |=
+				WLAN_ROAM_BMISS_FINAL_SCAN_TYPE;
+	}
+
+	status = roam_tx_ops.send_roam_offload_init_req(vdev, &init_msg);
+	if (QDF_IS_STATUS_ERROR(status))
+		mlme_debug("CM_RSO: vdev%d fail to send rso init", vdev_id);
+
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
+
+	return status;
+}
+
 QDF_STATUS wlan_cm_tgt_send_roam_start_req(struct wlan_objmgr_psoc *psoc,
 					   uint8_t vdev_id,
 					   struct wlan_roam_start_config *req)
@@ -146,14 +194,14 @@ QDF_STATUS wlan_cm_tgt_send_roam_start_req(struct wlan_objmgr_psoc *psoc,
 
 	roam_tx_ops = GET_CM_ROAM_TX_OPS_FROM_VDEV(vdev);
 	if (!roam_tx_ops.send_roam_start_req) {
-		mlme_err("send_roam_start_req is NULL");
+		mlme_err("CM_RSO: vdev%d send_roam_start_req is NULL", vdev_id);
 		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
 		return QDF_STATUS_E_INVAL;
 	}
 
 	status = roam_tx_ops.send_roam_start_req(vdev, req);
 	if (QDF_IS_STATUS_ERROR(status))
-		mlme_debug("fail to send roam start");
+		mlme_debug("CM_RSO: vdev%d fail to send roam start", vdev_id);
 
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
 	return status;

+ 2 - 0
core/sme/src/csr/csr_api_roam.c

@@ -22200,6 +22200,7 @@ QDF_STATUS csr_update_owe_info(struct mac_context *mac,
 	return status;
 }
 
+#ifndef ROAM_OFFLOAD_V1
 QDF_STATUS
 csr_send_roam_offload_init_msg(struct mac_context *mac, uint32_t vdev_id,
 			       bool enable)
@@ -22232,6 +22233,7 @@ csr_send_roam_offload_init_msg(struct mac_context *mac, uint32_t vdev_id,
 
 	return status;
 }
+#endif
 
 QDF_STATUS
 csr_roam_update_cfg(struct mac_context *mac, uint8_t vdev_id, uint8_t reason)