Bladeren bron

qcacmn: Extract MLD addr for BSSID

In some scenarios, there can be need to get the peer MLD address.
For this, add new API to extract the MLD address from the scan entry
by the BSSID.

Change-Id: I3b78501cb5320b3e834313a048b6fa0a84eab03b
CRs-Fixed: 3441498
Rahul Gusain 2 jaren geleden
bovenliggende
commit
b629391f22
2 gewijzigde bestanden met toevoegingen van 52 en 0 verwijderingen
  1. 28 0
      umac/scan/core/src/wlan_scan_cache_db.c
  2. 24 0
      umac/scan/core/src/wlan_scan_cache_db.h

+ 28 - 0
umac/scan/core/src/wlan_scan_cache_db.c

@@ -2186,6 +2186,34 @@ done:
 	return status;
 	return status;
 }
 }
 
 
+#ifdef WLAN_FEATURE_11BE_MLO
+QDF_STATUS scm_get_mld_addr_by_link_addr(struct wlan_objmgr_pdev *pdev,
+					 struct qdf_mac_addr *link_addr,
+					 struct qdf_mac_addr *mld_mac_addr)
+{
+	struct scan_cache_entry *entry = NULL;
+
+	/* For ML connection, BSSID is link address */
+	entry = scm_scan_get_entry_by_bssid(pdev, link_addr);
+	if (!entry) {
+		scm_err("scan entry not found for link addr: " QDF_MAC_ADDR_FMT,
+			QDF_MAC_ADDR_REF(link_addr));
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (qdf_is_macaddr_zero(&entry->ml_info.mld_mac_addr)) {
+		util_scan_free_cache_entry(entry);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	qdf_mem_copy(mld_mac_addr, &entry->ml_info.mld_mac_addr,
+		     QDF_MAC_ADDR_SIZE);
+	util_scan_free_cache_entry(entry);
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+
 struct scan_cache_entry *
 struct scan_cache_entry *
 scm_scan_get_entry_by_bssid(struct wlan_objmgr_pdev *pdev,
 scm_scan_get_entry_by_bssid(struct wlan_objmgr_pdev *pdev,
 			    struct qdf_mac_addr *bssid)
 			    struct qdf_mac_addr *bssid)

+ 24 - 0
umac/scan/core/src/wlan_scan_cache_db.h

@@ -358,4 +358,28 @@ scm_scan_get_entry_by_mac_addr(struct wlan_objmgr_pdev *pdev,
 struct scan_cache_entry *
 struct scan_cache_entry *
 scm_scan_get_entry_by_bssid(struct wlan_objmgr_pdev *pdev,
 scm_scan_get_entry_by_bssid(struct wlan_objmgr_pdev *pdev,
 			    struct qdf_mac_addr *bssid);
 			    struct qdf_mac_addr *bssid);
+
+#ifdef WLAN_FEATURE_11BE_MLO
+/**
+ * scm_get_mld_addr_by_link_addr() - function to fetch the peer mld address from
+ * the scan entry for the given link address.
+ * @pdev: pdev object
+ * @link_addr: link address
+ * @mld_mac_addr: pointer to mld_mac_address
+ *
+ * Return : scan entry if found, else NULL
+ */
+QDF_STATUS
+scm_get_mld_addr_by_link_addr(struct wlan_objmgr_pdev *pdev,
+			      struct qdf_mac_addr *link_addr,
+			      struct qdf_mac_addr *mld_mac_addr);
+#else
+static inline QDF_STATUS
+scm_get_mld_addr_by_link_addr(struct wlan_objmgr_pdev *pdev,
+			      struct qdf_mac_addr *link_addr,
+			      struct qdf_mac_addr *mld_mac_addr)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+#endif
 #endif
 #endif