Ver Fonte

qcacld-3.0: Use link address and channel to update phymode after roam

After roam sync is recevied the phymode will be updated for bss peer.
For MLO roaming use link address and channel to find the bss peer and
update the phymode.

Change-Id: Ic181fdb73ceeb8dfb980a4121a7569b12d3361dd
CRs-Fixed: 3280059
Amruta Kulkarni há 2 anos atrás
pai
commit
65f19e6dae

+ 2 - 3
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload_event.c

@@ -524,9 +524,8 @@ QDF_STATUS cm_roam_sync_event_handler_cb(struct wlan_objmgr_vdev *vdev,
 	 * processing beacon. Any mismatch of this value with firmware phymode
 	 * results in firmware assert.
 	 */
-	cm_update_phymode_on_roam(sync_ind->roamed_vdev_id,
-				  sync_ind->bssid.bytes,
-				  &sync_ind->chan);
+	cm_update_phymode_on_roam(vdev_id,
+				  sync_ind);
 	cm_fw_roam_sync_propagation(psoc,
 				    vdev_id,
 				    sync_ind);

+ 4 - 4
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h

@@ -1614,15 +1614,15 @@ cm_roam_pe_sync_callback(struct roam_offload_synch_ind *sync_ind,
  * cm_update_phymode_on_roam() - Update new phymode after
  * ROAM SYNCH event is received from firmware
  * @vdev_id: roamed vdev id
- * @bssid: bssid
- * @chan: wmi channel
+ * @sync_ind: Structure with roam synch parameters
  *
  * This api will update the phy mode after roam sync is received.
  *
  * Return: none
  */
-void cm_update_phymode_on_roam(uint8_t vdev_id, uint8_t *bssid,
-			       wmi_channel *chan);
+void
+cm_update_phymode_on_roam(uint8_t vdev_id,
+			  struct roam_offload_synch_ind *sync_ind);
 
 /**
  * wlan_cm_fw_to_host_phymode() - Convert fw phymode to host

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

@@ -190,6 +190,24 @@ bool
 mlo_get_single_link_ml_roaming(struct wlan_objmgr_psoc *psoc,
 			       uint8_t vdev_id);
 
+/**
+ * mlo_roam_get_bssid_chan_for_link - get link mac addr and channel info
+ *
+ * @vdev_id: vdev id
+ * @sync_ind: roam sync ind pointer
+ * @bssid: link mac addr pointer
+ * @chan: link wmi channel pointer
+ *
+ * This api will be called to get link mac addr and channel info.
+ *
+ * Return: qdf status
+ */
+QDF_STATUS
+mlo_roam_get_bssid_chan_for_link(uint8_t vdev_id,
+				 struct roam_offload_synch_ind *sync_ind,
+				 struct qdf_mac_addr *bssid,
+				 wmi_channel *chan);
+
 #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
 /**
  * mlo_cm_roam_sync_cb - Callback function from CM to MLO mgr
@@ -308,5 +326,14 @@ mlo_get_single_link_ml_roaming(struct wlan_objmgr_psoc *psoc,
 {
 	return false;
 }
+
+static inline QDF_STATUS
+mlo_roam_get_bssid_chan_for_link(uint8_t vdev_id,
+				 struct roam_offload_synch_ind *sync_ind,
+				 struct qdf_mac_addr *bssid,
+				 wmi_channel *chan)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
 #endif /* WLAN_FEATURE_11BE_MLO */
 #endif

+ 31 - 0
components/umac/mlme/mlo_mgr/src/wlan_mlo_mgr_roam.c

@@ -513,3 +513,34 @@ mlo_get_single_link_ml_roaming(struct wlan_objmgr_psoc *psoc,
 
 	return is_single_link_ml_roaming;
 }
+
+QDF_STATUS
+mlo_roam_get_bssid_chan_for_link(uint8_t vdev_id,
+				 struct roam_offload_synch_ind *sync_ind,
+				 struct qdf_mac_addr *bssid,
+				 wmi_channel *chan)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	uint8_t i;
+
+	if (!sync_ind || !sync_ind->num_setup_links)
+		return QDF_STATUS_E_FAILURE;
+
+	for (i = 0; i < sync_ind->num_setup_links; i++) {
+		if (vdev_id == sync_ind->ml_link[i].vdev_id) {
+			qdf_mem_copy(chan, &sync_ind->ml_link[i].channel,
+				     sizeof(wmi_channel));
+			qdf_copy_macaddr(bssid,
+					 &sync_ind->ml_link[i].link_addr);
+			return status;
+		}
+	}
+
+	if (i == sync_ind->num_setup_links) {
+		mlo_err("roam sync info not found for vdev id %d", vdev_id);
+		status = QDF_STATUS_E_FAILURE;
+	}
+
+	return status;
+}
+

+ 19 - 5
core/wma/src/wma_scan_roam.c

@@ -634,7 +634,8 @@ wma_roam_update_vdev(tp_wma_handle wma,
 	qdf_mem_free(add_sta_params);
 }
 
-static void wma_update_phymode_on_roam(tp_wma_handle wma, uint8_t *bssid,
+static void wma_update_phymode_on_roam(tp_wma_handle wma,
+				       struct qdf_mac_addr *bssid,
 				       wmi_channel *chan,
 				       struct wma_txrx_node *iface)
 {
@@ -701,7 +702,7 @@ static void wma_update_phymode_on_roam(tp_wma_handle wma, uint8_t *bssid,
 	vdev_mlme->mgmt.generic.phy_mode = wma_host_to_fw_phymode(bss_phymode);
 
 	/* update new phymode to peer */
-	wma_objmgr_set_peer_mlme_phymode(wma, bssid, bss_phymode);
+	wma_objmgr_set_peer_mlme_phymode(wma, bssid->bytes, bss_phymode);
 
 	wma_debug("LFR3: new phymode %d freq %d (bw %d, %d %d)",
 		  bss_phymode, des_chan->ch_freq, des_chan->ch_width,
@@ -3090,15 +3091,28 @@ cm_roam_pe_sync_callback(struct roam_offload_synch_ind *sync_ind,
 	return status;
 }
 
-void cm_update_phymode_on_roam(uint8_t vdev_id, uint8_t *bssid,
-			       wmi_channel *chan)
+void cm_update_phymode_on_roam(uint8_t vdev_id,
+			       struct roam_offload_synch_ind *sync_ind)
 {
 	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
+	struct qdf_mac_addr link_bssid;
+	wmi_channel link_chan;
 
 	if (!wma)
 		return;
 
-	wma_update_phymode_on_roam(wma, bssid, chan, &wma->interfaces[vdev_id]);
+	if (is_multi_link_roam(sync_ind)) {
+		mlo_roam_get_bssid_chan_for_link(vdev_id, sync_ind,
+						 &link_bssid,
+						 &link_chan);
+		wma_update_phymode_on_roam(wma, &link_bssid,
+					   &link_chan,
+					   &wma->interfaces[vdev_id]);
+	} else {
+		wma_update_phymode_on_roam(wma, &sync_ind->bssid,
+					   &sync_ind->chan,
+					   &wma->interfaces[vdev_id]);
+	}
 }
 
 enum wlan_phymode