Procházet zdrojové kódy

qcacld-3.0: Update self mac address from roam sync indication

After roaming to 3 link AP, update the MLO manager with the
self link address received from the roam synch indication.

Change-Id: I6258abe7bb9e140307c30fee8701ef12a618d9f1
CRs-Fixed: 3591487
Pragaspathi Thilagaraj před 1 rokem
rodič
revize
6da3613393

+ 7 - 3
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_fw_sync.c

@@ -441,13 +441,17 @@ cm_roam_update_mlo_mgr_info(struct wlan_objmgr_vdev *vdev,
 	for (i = 0; i < roam_synch_data->num_setup_links; i++) {
 		ml_link = &roam_synch_data->ml_link[i];
 
+		qdf_mem_zero(&channel, sizeof(channel));
+
 		channel.ch_freq = ml_link->channel.mhz;
 		channel.ch_cfreq1 = ml_link->channel.band_center_freq1;
 		channel.ch_cfreq1 = ml_link->channel.band_center_freq2;
 
-		mlo_mgr_roam_update_ap_link_info(vdev, ml_link->link_id,
-						 ml_link->link_addr.bytes,
-						 channel);
+		/*
+		 * Update Link switch context for each vdev with roamed AP link
+		 * address and self link address for each vdev
+		 */
+		mlo_mgr_roam_update_ap_link_info(vdev, ml_link, &channel);
 	}
 }
 

+ 3 - 1
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h

@@ -2775,7 +2775,8 @@ struct cm_hw_mode_trans_ind {
  * @link_id: link id of the link
  * @channel: wmi channel
  * @flags: link flags
- * @link_addr: link mac addr
+ * @link_addr: link mac address
+ * @self_link_addr: VDEV link mac address
  */
 struct ml_setup_link_param {
 	uint32_t vdev_id;
@@ -2783,6 +2784,7 @@ struct ml_setup_link_param {
 	wmi_channel channel;
 	uint32_t flags;
 	struct qdf_mac_addr link_addr;
+	struct qdf_mac_addr self_link_addr;
 };
 
 /**

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

@@ -337,6 +337,20 @@ void mlo_roam_connect_complete(struct wlan_objmgr_vdev *vdev);
 void mlo_roam_free_copied_reassoc_rsp(struct wlan_objmgr_vdev *vdev);
 
 #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
+/**
+ * mlo_mgr_roam_update_ap_link_info() - Update AP links information
+ * @vdev: Object Manager vdev
+ * @src_link_info: Source link setup information
+ * @channel: Channel information
+ *
+ * Update AP link information for each link of AP MLD
+ *
+ * Return: None
+ */
+void mlo_mgr_roam_update_ap_link_info(struct wlan_objmgr_vdev *vdev,
+				      struct ml_setup_link_param *src_link_info,
+				      struct wlan_channel *channel);
+
 /**
  * mlo_cm_roam_sync_cb - Callback function from CM to MLO mgr
  *
@@ -480,6 +494,13 @@ mlo_roam_get_link_id(uint8_t vdev_id,
 }
 
 #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
+/**
+ * mlo_cm_roam_sync_cb() - MLO callback to handle roam synch event
+ * for MLO vdev
+ * @vdev: Pointer to objmgr vdev
+ * @event: Pointer to event
+ * @event_data_len: event data length
+ */
 QDF_STATUS mlo_cm_roam_sync_cb(struct wlan_objmgr_vdev *vdev,
 			       void *event, uint32_t event_data_len);
 #else
@@ -608,6 +629,12 @@ mlo_get_link_mac_addr_from_reassoc_rsp(struct wlan_objmgr_vdev *vdev,
 	return QDF_STATUS_E_NOSUPPORT;
 }
 
+static inline
+void mlo_mgr_roam_update_ap_link_info(struct wlan_objmgr_vdev *vdev,
+				      struct ml_setup_link_param *src_info,
+				      struct wlan_channel *channel)
+{}
+
 static inline uint32_t
 mlo_roam_get_link_freq_from_mac_addr(struct roam_offload_synch_ind *sync_ind,
 				     uint8_t *link_mac_addr)

+ 65 - 1
components/umac/mlme/mlo_mgr/src/wlan_mlo_mgr_roam.c

@@ -212,6 +212,7 @@ mlo_roam_abort_req(struct wlan_objmgr_psoc *psoc,
 #endif
 
 static void mlo_roam_update_vdev_macaddr(struct wlan_objmgr_psoc *psoc,
+					 struct roam_offload_synch_ind *sync_ind,
 					 uint8_t vdev_id,
 					 bool is_non_ml_connection)
 {
@@ -231,8 +232,25 @@ static void mlo_roam_update_vdev_macaddr(struct wlan_objmgr_psoc *psoc,
 		if (!qdf_is_macaddr_zero(mld_mac))
 			wlan_vdev_mlme_set_macaddr(vdev, mld_mac->bytes);
 	} else {
+		struct qdf_mac_addr *vdev_link_addr;
+		uint8_t i;
+
 		wlan_vdev_mlme_set_macaddr(vdev,
 					   wlan_vdev_mlme_get_linkaddr(vdev));
+		/* Update the link address received from fw to assoc vdev */
+		for (i = 0; i < sync_ind->num_setup_links; i++) {
+			if (vdev_id != sync_ind->ml_link[i].vdev_id)
+				continue;
+
+			vdev_link_addr = &sync_ind->ml_link[i].self_link_addr;
+			if (qdf_is_macaddr_zero(vdev_link_addr) ||
+			    qdf_is_macaddr_broadcast(vdev_link_addr))
+				continue;
+
+			wlan_vdev_mlme_set_macaddr(vdev, vdev_link_addr->bytes);
+			wlan_vdev_mlme_set_linkaddr(vdev,
+						    vdev_link_addr->bytes);
+		}
 	}
 
 	mlme_debug("vdev_id %d self mac " QDF_MAC_ADDR_FMT,
@@ -271,7 +289,7 @@ QDF_STATUS mlo_fw_roam_sync_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 		mlo_set_single_link_ml_roaming(psoc, vdev_id, false);
 	}
 
-	mlo_roam_update_vdev_macaddr(psoc, vdev_id, is_non_mlo_ap);
+	mlo_roam_update_vdev_macaddr(psoc, sync_ind, vdev_id, is_non_mlo_ap);
 	ml_nlink_conn_change_notify(
 		psoc, vdev_id, ml_nlink_roam_sync_start_evt, NULL);
 
@@ -284,6 +302,41 @@ QDF_STATUS mlo_fw_roam_sync_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 }
 
 #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
+void mlo_mgr_roam_update_ap_link_info(struct wlan_objmgr_vdev *vdev,
+				      struct ml_setup_link_param *src_link_info,
+				      struct wlan_channel *channel)
+{
+	struct mlo_link_info *link_info;
+	uint8_t iter, link_id;
+
+	if (!vdev || !vdev->mlo_dev_ctx || !vdev->mlo_dev_ctx->link_ctx ||
+	    !src_link_info)
+		return;
+
+	link_id = src_link_info->link_id;
+	for (iter = 0; iter < WLAN_MAX_ML_BSS_LINKS; iter++) {
+		link_info = &vdev->mlo_dev_ctx->link_ctx->links_info[iter];
+		if (link_id == link_info->link_id)
+			break;
+	}
+
+	if (iter == WLAN_MAX_ML_BSS_LINKS)
+		return;
+
+	qdf_mem_copy(&link_info->ap_link_addr,
+		     src_link_info->link_addr.bytes,
+		     QDF_MAC_ADDR_SIZE);
+	qdf_mem_copy(&link_info->link_addr, src_link_info->self_link_addr.bytes,
+		     QDF_MAC_ADDR_SIZE);
+	qdf_mem_copy(link_info->link_chan_info, channel, sizeof(*channel));
+
+	mlo_debug("link_id: %d, vdev_id:%d freq:%d ap_link_addr:" QDF_MAC_ADDR_FMT " self_link_addr:" QDF_MAC_ADDR_FMT,
+		  link_info->link_id, link_info->vdev_id,
+		  link_info->link_chan_info->ch_freq,
+		  QDF_MAC_ADDR_REF(link_info->ap_link_addr.bytes),
+		  QDF_MAC_ADDR_REF(link_info->link_addr.bytes));
+}
+
 QDF_STATUS mlo_cm_roam_sync_cb(struct wlan_objmgr_vdev *vdev,
 			       void *event, uint32_t event_data_len)
 {
@@ -335,8 +388,19 @@ QDF_STATUS mlo_cm_roam_sync_cb(struct wlan_objmgr_vdev *vdev,
 		}
 
 		if (mlo_check_connect_req_bmap(link_vdev)) {
+			struct qdf_mac_addr *vdev_link_addr;
+
 			mlo_update_connect_req_links(link_vdev, false);
 
+			vdev_link_addr = &sync_ind->ml_link[i].self_link_addr;
+			if (!qdf_is_macaddr_zero(vdev_link_addr) &&
+			    !qdf_is_macaddr_broadcast(vdev_link_addr)) {
+				wlan_vdev_mlme_set_macaddr(link_vdev,
+							   vdev_link_addr->bytes);
+				wlan_vdev_mlme_set_linkaddr(link_vdev,
+							    vdev_link_addr->bytes);
+			}
+
 			status = cm_fw_roam_sync_req(psoc,
 						     sync_ind->ml_link[i].vdev_id,
 						     event, event_data_len);

+ 5 - 2
components/wmi/src/wmi_unified_roam_tlv.c

@@ -2270,10 +2270,13 @@ wmi_fill_roam_mlo_info(wmi_unified_t wmi_handle,
 
 			WMI_MAC_ADDR_TO_CHAR_ARRAY(&setup_links->link_addr,
 						   link->link_addr.bytes);
-			wmi_debug("link_id: %u vdev_id: %u flags: 0x%x addr:" QDF_MAC_ADDR_FMT,
+			WMI_MAC_ADDR_TO_CHAR_ARRAY(&setup_links->self_link_addr,
+						   link->self_link_addr.bytes);
+			wmi_debug("link_id: %u vdev_id: %u flags: 0x%x addr:" QDF_MAC_ADDR_FMT "self_addr:" QDF_MAC_ADDR_FMT,
 				  link->link_id, link->vdev_id,
 				  link->flags,
-				  QDF_MAC_ADDR_REF(link->link_addr.bytes));
+				  QDF_MAC_ADDR_REF(link->link_addr.bytes),
+				  QDF_MAC_ADDR_REF(link->self_link_addr.bytes));
 			wmi_debug("channel: %u mhz center_freq1: %u center_freq2: %u",
 				  link->channel.mhz,
 				  link->channel.band_center_freq1,