Prechádzať zdrojové kódy

qcacmn: Enable filtering link id for partner link connect req

If a duplicate BSS with same BSSID and MLD address exists then it
can potentially override the scan entry in DB and later driver may
use this duplicate entry for connection whose freq and IEEE link id
could be different.

Crypto keys for each link is saved as a hash function of BSSID and
corresponding link's IEEE link id. So picking scan entry with wrong
link id will result in not finding crypto keys.

For link switch cases this error results in triggering disconnect but
the response of link switch goes as success as error is not properly
notified to mlo manager and FW expects valid crypto keys to be plumbed
before sending link switch success.

Add link id and frequency to scan filter for partner link connect and
link switch connect to avoid connection if scan entry is not found.

Change-Id: I0b400dd584e1a4fa4ee717e34308c1434083a6dd
CRs-Fixed: 3831342
Vinod Kumar Pirla 9 mesiacov pred
rodič
commit
bee3aaab0f

+ 4 - 0
umac/mlme/connection_mgr/core/src/wlan_cm_connect.c

@@ -1453,6 +1453,10 @@ static QDF_STATUS cm_update_mlo_filter(struct wlan_objmgr_pdev *pdev,
 		 */
 		filter->match_mld_addr = true;
 		qdf_copy_macaddr(&filter->mld_addr, &cm_req->req.mld_addr);
+
+		/* Add link ID to the scan filter for partner link */
+		filter->match_link_id = true;
+		filter->link_id = cm_req->req.link_id;
 	}
 
 	mlme_debug(CM_PREFIX_FMT "band bitmap: 0x%x",

+ 9 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c

@@ -808,6 +808,8 @@ QDF_STATUS mlo_mgr_link_switch_start_connect(struct wlan_objmgr_vdev *vdev)
 	conn_req.source = CM_MLO_LINK_SWITCH_CONNECT;
 	wlan_vdev_set_link_id(vdev, req->new_ieee_link_id);
 
+	conn_req.chan_freq = req->new_primary_freq;
+	conn_req.link_id = req->new_ieee_link_id;
 	qdf_copy_macaddr(&conn_req.bssid, &mlo_link_info->ap_link_addr);
 	wlan_vdev_mlme_get_ssid(assoc_vdev, conn_req.ssid.ssid,
 				&conn_req.ssid.length);
@@ -1180,6 +1182,13 @@ mlo_mgr_link_switch_validate_request(struct wlan_objmgr_vdev *vdev,
 		return status;
 	}
 
+	if (new_link_info->link_chan_info->ch_freq != req->new_primary_freq) {
+		mlo_err("Host freq(%d) FW req freq(%d)",
+			new_link_info->link_chan_info->ch_freq,
+			req->new_primary_freq);
+		return status;
+	}
+
 	/* Notify callers on the new link switch request before serializing */
 	status = mlo_mgr_link_switch_notify(vdev, req);
 	if (QDF_IS_STATUS_ERROR(status)) {

+ 2 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_sta.c

@@ -883,6 +883,8 @@ mlo_prepare_and_send_connect(struct wlan_objmgr_vdev *vdev,
 
 	req.vdev_id = wlan_vdev_get_id(vdev);
 	req.ssid.length = ssid.length;
+	req.chan_freq = link_info.chan_freq;
+	req.link_id =  link_info.link_id;
 	qdf_mem_copy(&req.ssid.ssid, &ssid.ssid, ssid.length);
 	if (mld_addr)
 		qdf_copy_macaddr(&req.mld_addr, mld_addr);