Kaynağa Gözat

qcacmn: Reject MLO association on same STA MLD MAC address

This change rejects association if MLD MAC address of Station
is same as AP MLD MAC address.

Change-Id: Ie8cafcf8bf0033dc63efbcd0047ddcabf996942b
CRs-Fixed: 3212459
Srinivas Pitla 3 yıl önce
ebeveyn
işleme
18e9ba976b

+ 12 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_main.h

@@ -660,6 +660,18 @@ QDF_STATUS wlan_mlo_mgr_psoc_disable(struct wlan_objmgr_psoc *psoc);
  */
 QDF_STATUS wlan_mlo_mgr_update_mld_addr(struct qdf_mac_addr *old_mac,
 					struct qdf_mac_addr *new_mac);
+
+/**
+ * wlan_mlo_is_mld_ctx_exist() - check whether MLD exist with MLD MAC address
+ * @mldaddr: MLD MAC address
+ *
+ * API to check whether MLD is present with MLD MAC address.
+ *
+ * Return: true, if it is present
+ *         false, if it is not present
+ */
+bool wlan_mlo_is_mld_ctx_exist(struct qdf_mac_addr *mldaddr);
+
 #ifdef CONFIG_AP_PLATFORM
 /**
  * wlan_mlo_vdev_cmp_same_pdev() - Compare pdev of the given vdevs

+ 11 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_main.c

@@ -249,6 +249,17 @@ static inline struct wlan_mlo_dev_context
 	return NULL;
 }
 
+bool wlan_mlo_is_mld_ctx_exist(struct qdf_mac_addr *mldaddr)
+{
+	struct wlan_mlo_dev_context *mld_ctx = NULL;
+
+	mld_ctx = wlan_mlo_get_mld_ctx_by_mldaddr(mldaddr);
+	if (mld_ctx)
+		return true;
+
+	return false;
+}
+
 static QDF_STATUS mlo_ap_ctx_deinit(struct wlan_mlo_dev_context *ml_dev)
 {
 	wlan_mlo_vdev_aid_mgr_deinit(ml_dev);

+ 7 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_peer.c

@@ -774,6 +774,13 @@ QDF_STATUS wlan_mlo_peer_create(struct wlan_objmgr_vdev *vdev,
 
 	/* Check resources of Partner VDEV */
 	if (wlan_vdev_mlme_get_opmode(vdev) == QDF_SAP_MODE) {
+		if (wlan_mlo_is_mld_ctx_exist(
+		    (struct qdf_mac_addr *)&link_peer->mldaddr[0])) {
+			mlo_err("MLD ID %d ML Peer " QDF_MAC_ADDR_FMT " is matching with one of the MLD address in the system",
+				ml_dev->mld_id,
+				QDF_MAC_ADDR_REF(link_peer->mldaddr));
+			return QDF_STATUS_E_FAILURE;
+		}
 		status = mlo_dev_get_link_vdevs(vdev, ml_dev,
 						ml_info, link_vdevs);
 		if (QDF_IS_STATUS_ERROR(status)) {