Browse Source

qcacld-3.0: Set dp peer flags for single link ML roaming

In case of single link mlo roaming, set both dp peer flags
is_first_link and is_primary_link to 1, then datapath will
create MLD peer.

Change-Id: I935c42b2c3eaa558028d45bdbf502007723f656c
CRs-Fixed: 3271224
Amruta Kulkarni 2 years ago
parent
commit
d7bed8d11c

+ 4 - 0
components/mlme/core/inc/wlan_mlme_main.h

@@ -456,6 +456,7 @@ struct mlme_ap_config {
  * @vdev_traffic_type: to set if vdev is LOW_LATENCY or HIGH_TPUT
  * @country_ie_for_all_band: take all band channel info in country ie
  * @mlme_ap: SAP related vdev private configurations
+ * @is_single_link_mlo_roam: Single link mlo roam flag
  */
 struct mlme_legacy_priv {
 	bool chan_switch_in_progress;
@@ -511,6 +512,9 @@ struct mlme_legacy_priv {
 	uint8_t vdev_traffic_type;
 	bool country_ie_for_all_band;
 	struct mlme_ap_config mlme_ap;
+#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
+	bool is_single_link_mlo_roam;
+#endif
 };
 
 /**

+ 21 - 0
components/mlme/core/inc/wlan_mlme_vdev_mgr_interface.h

@@ -502,6 +502,27 @@ void mlme_vdev_self_peer_delete_resp(struct del_vdev_params *param);
  */
 void mlme_vdev_del_resp(uint8_t vdev_id);
 
+#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
+/**
+ * mlme_set_single_link_mlo_roaming() - to set single link mlo roaming
+ * @vdev: vdev pointer
+ * @val: single link mlo roaming value true/false
+ *
+ * This API will set single link mlo roaming value.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+mlme_set_single_link_mlo_roaming(struct wlan_objmgr_vdev *vdev, bool val);
+
+/**
+ * mlme_get_single_link_mlo_roaming() - get single link mlo roaming
+ * @vdev: vdev pointer
+ *
+ * Return: single link mlo roaming boolean value true/false
+ */
+bool mlme_get_single_link_mlo_roaming(struct wlan_objmgr_vdev *vdev);
+#endif
 /**
  * wlan_sap_disconnect_all_p2p_client() - send SAP disconnect all P2P
  *	client event to the SAP event handler

+ 31 - 0
components/mlme/core/src/wlan_mlme_vdev_mgr_interface.c

@@ -1227,6 +1227,37 @@ int8_t mlme_get_max_reg_power(struct wlan_objmgr_vdev *vdev)
 	return vdev_mlme->mgmt.generic.maxregpower;
 }
 
+#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
+QDF_STATUS
+mlme_set_single_link_mlo_roaming(struct wlan_objmgr_vdev *vdev, bool val)
+{
+	struct mlme_legacy_priv *mlme_priv;
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		mlme_legacy_err("vdev legacy private object is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	mlme_priv->is_single_link_mlo_roam = val;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+bool mlme_get_single_link_mlo_roaming(struct wlan_objmgr_vdev *vdev)
+{
+	struct mlme_legacy_priv *mlme_priv;
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		mlme_legacy_err("vdev legacy private object is NULL");
+		return false;
+	}
+
+	return mlme_priv->is_single_link_mlo_roam;
+}
+#endif
+
 /**
  * mlme_get_vdev_types() - get vdev type and subtype from its operation mode
  * @mode: operation mode of vdev

+ 2 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_fw_sync.c

@@ -869,6 +869,8 @@ cm_fw_roam_sync_propagation(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 
 		mlo_roam_copy_partner_info(connect_rsp, roam_synch_data);
 		mlo_roam_update_connected_links(vdev, connect_rsp);
+		mlo_set_single_link_ml_roaming(psoc, vdev_id,
+					       roam_synch_data, false);
 	}
 	cm_connect_info(vdev, true, &connect_rsp->bssid, &connect_rsp->ssid,
 			connect_rsp->freq);

+ 46 - 0
components/umac/mlme/mlo_mgr/inc/wlan_mlo_mgr_roam.h

@@ -156,6 +156,38 @@ void mlo_roam_copy_partner_info(struct wlan_cm_connect_resp *connect_rsp,
 void mlo_roam_update_connected_links(struct wlan_objmgr_vdev *vdev,
 				     struct wlan_cm_connect_resp *connect_rsp);
 
+/**
+ * mlo_set_single_link_ml_roaming - set single link mlo roaming
+ *
+ * @psoc: psoc pointer
+ * @vdev_id: vdev id
+ * @sync_ind: roam synch indication
+ * @is_single_link_ml_roaming: boolean flag
+ *
+ * This api will be called to set single link mlo roaming flag.
+ *
+ * Return: none
+ */
+void
+mlo_set_single_link_ml_roaming(struct wlan_objmgr_psoc *psoc,
+			       uint8_t vdev_id,
+			       struct roam_offload_synch_ind *sync_ind,
+			       bool is_single_link_ml_roaming);
+
+/**
+ * mlo_get_single_link_ml_roaming - check if single link mlo roaming
+ *
+ * @psoc: psoc pointer
+ * @vdev_id: vdev id
+ *
+ * This api will be called to check if single link mlo roaming is true or false.
+ *
+ * Return: boolean value
+ */
+bool
+mlo_get_single_link_ml_roaming(struct wlan_objmgr_psoc *psoc,
+			       uint8_t vdev_id);
+
 #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
 /**
  * mlo_cm_roam_sync_cb - Callback function from CM to MLO mgr
@@ -259,5 +291,19 @@ wlan_mlo_roam_abort_on_link(struct wlan_objmgr_psoc *psoc,
 {
 	return QDF_STATUS_E_NOSUPPORT;
 }
+
+static inline void
+mlo_set_single_link_ml_roaming(struct wlan_objmgr_psoc *psoc,
+			       uint8_t vdev_id,
+			       struct roam_offload_synch_ind *sync_ind,
+			       bool is_single_link_ml_roaming)
+{}
+
+static inline bool
+mlo_get_single_link_ml_roaming(struct wlan_objmgr_psoc *psoc,
+			       uint8_t vdev_id)
+{
+	return false;
+}
 #endif /* WLAN_FEATURE_11BE_MLO */
 #endif

+ 63 - 3
components/umac/mlme/mlo_mgr/src/wlan_mlo_mgr_roam.c

@@ -27,6 +27,7 @@
 #include "wlan_mlo_mgr_sta.h"
 #include <../../core/src/wlan_cm_roam_i.h>
 #include "wlan_cm_roam_api.h"
+#include "wlan_mlme_vdev_mgr_interface.h"
 
 #ifdef WLAN_FEATURE_11BE_MLO
 static bool
@@ -176,7 +177,9 @@ mlo_update_for_multi_link_roam(struct wlan_objmgr_psoc *psoc,
 
 static inline bool
 mlo_check_connect_req_bmap(struct wlan_objmgr_vdev *vdev)
-{}
+{
+	return false;
+}
 #endif
 QDF_STATUS mlo_fw_roam_sync_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 				void *event, uint32_t event_data_len)
@@ -193,10 +196,14 @@ QDF_STATUS mlo_fw_roam_sync_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 		mlo_update_for_multi_link_roam(psoc, vdev_id,
 					       sync_ind->ml_link[i].vdev_id);
 
-	if (!sync_ind->num_setup_links)
+	if (!sync_ind->num_setup_links) {
 		mlo_debug("MLO_ROAM: Roamed to Legacy");
-	else
+	} else if (sync_ind->num_setup_links == 1) {
+		mlo_debug("MLO_ROAM: Roamed to single link MLO");
+		mlo_set_single_link_ml_roaming(psoc, vdev_id, sync_ind, true);
+	} else {
 		mlo_debug("MLO_ROAM: Roamed to MLO");
+	}
 
 	status = cm_fw_roam_sync_req(psoc, vdev_id, event, event_data_len);
 
@@ -431,3 +438,56 @@ wlan_mlo_roam_abort_on_link(struct wlan_objmgr_psoc *psoc,
 
 	return QDF_STATUS_SUCCESS;
 }
+
+void
+mlo_set_single_link_ml_roaming(struct wlan_objmgr_psoc *psoc,
+			       uint8_t vdev_id,
+			       struct roam_offload_synch_ind *sync_ind,
+			       bool is_single_link_ml_roaming)
+{
+	struct wlan_objmgr_vdev *vdev;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc,
+						    vdev_id,
+						    WLAN_MLME_SB_ID);
+	if (!vdev) {
+		mlo_err("VDEV is null");
+		return;
+	}
+
+	if (!sync_ind) {
+		mlo_err("Roam sync ind is null");
+		goto end;
+	}
+
+	if (sync_ind->num_setup_links == 1 &&
+	    !wlan_vdev_mlme_is_mlo_link_vdev(vdev))
+		mlme_set_single_link_mlo_roaming(vdev,
+						 is_single_link_ml_roaming);
+
+end:
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
+}
+
+bool
+mlo_get_single_link_ml_roaming(struct wlan_objmgr_psoc *psoc,
+			       uint8_t vdev_id)
+{
+	bool is_single_link_ml_roaming = false;
+	struct wlan_objmgr_vdev *vdev;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc,
+						    vdev_id,
+						    WLAN_MLME_SB_ID);
+	if (!vdev) {
+		mlo_err("VDEV is null");
+		return is_single_link_ml_roaming;
+	}
+
+	is_single_link_ml_roaming = mlme_get_single_link_mlo_roaming(vdev);
+	mlo_debug("MLO:is_single_link_ml_roaming %d",
+		  is_single_link_ml_roaming);
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
+
+	return is_single_link_ml_roaming;
+}

+ 8 - 3
core/wma/src/wma_dev_if.c

@@ -109,7 +109,7 @@
 
 #include "son_api.h"
 #include "wlan_vdev_mgr_tgt_if_tx_defs.h"
-
+#include "wlan_mlo_mgr_roam.h"
 /*
  * FW only supports 8 clients in SAP/GO mode for D3 WoW feature
  * and hence host needs to hold a wake lock after 9th client connects
@@ -2001,8 +2001,13 @@ static void wma_cdp_peer_setup(tp_wma_handle wma,
 		peer_info.is_primary_link = 0;
 	} else if (wlan_cm_is_roam_sync_in_progress(wma->psoc, vdev_id) &&
 		   wlan_vdev_mlme_get_is_mlo_vdev(wma->psoc, vdev_id)) {
-		peer_info.is_first_link = 0;
-		peer_info.is_primary_link = 1;
+		if (mlo_get_single_link_ml_roaming(wma->psoc, vdev_id)) {
+			peer_info.is_first_link = 1;
+			peer_info.is_primary_link = 1;
+		} else {
+			peer_info.is_first_link = 0;
+			peer_info.is_primary_link = 1;
+		}
 	} else {
 		peer_info.is_first_link = wlan_peer_mlme_is_assoc_peer(obj_peer);
 		peer_info.is_primary_link = peer_info.is_first_link;