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
This commit is contained in:
Rahul Gusain
2023-03-02 12:06:57 +05:30
committed by Madan Koyyalamudi
parent 41d3710c17
commit b629391f22
2 changed files with 52 additions and 0 deletions

View File

@@ -2186,6 +2186,34 @@ done:
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 *
scm_scan_get_entry_by_bssid(struct wlan_objmgr_pdev *pdev,
struct qdf_mac_addr *bssid)

View File

@@ -358,4 +358,28 @@ scm_scan_get_entry_by_mac_addr(struct wlan_objmgr_pdev *pdev,
struct scan_cache_entry *
scm_scan_get_entry_by_bssid(struct wlan_objmgr_pdev *pdev,
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