* should be initialized and #MAX_NUM_MLD_LINKS elements long
* @missing_links: Result bitmask of links that were not discovered (or %NULL)
* @ssid: Target SSID (or %NULL)
+ * @ap_mld_id: On return would hold the corresponding AP MLD ID (or %NULL)
* Returns: 0 on success or -1 for non-MLD or parsing failures
*
* Parses the Basic Multi-Link element of the BSS into @link_info using the scan
struct wpa_bss *bss,
u8 *ap_mld_addr,
u16 *missing_links,
- struct wpa_ssid *ssid)
+ struct wpa_ssid *ssid,
+ u8 *ap_mld_id)
{
struct ieee802_11_elems elems;
struct wpabuf *mlbuf;
if (missing_links)
*missing_links = missing;
+ if (ap_mld_id)
+ *ap_mld_id = mbssid_idx;
+
ret = 0;
out:
wpabuf_free(mlbuf);
{
u16 removed_links;
- if (wpa_bss_parse_basic_ml_element(wpa_s, bss, NULL, NULL, NULL))
+ if (wpa_bss_parse_basic_ml_element(wpa_s, bss, NULL, NULL, NULL, NULL))
return true;
if (bss->n_mld_links == 0)
{
int *freqs;
u16 missing_links = 0, removed_links;
+ u8 ap_mld_id;
if (!((wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_MLO) &&
(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)))
/* Try to resolve any missing link information */
if (wpa_bss_parse_basic_ml_element(wpa_s, selected, NULL,
- &missing_links, ssid) ||
+ &missing_links, ssid,
+ &ap_mld_id) ||
!missing_links)
return 0;
wpa_s->manual_scan_freqs = freqs;
os_memcpy(wpa_s->ml_probe_bssid, selected->bssid, ETH_ALEN);
- wpa_s->ml_probe_mld_id = -1;
+
+ /*
+ * In case the ML probe request is intended to retrieve information from
+ * the transmitted BSS, the AP MLD ID should be included and should be
+ * set to zero.
+ * In case the ML probe requested is intended to retrieve information
+ * from a non-transmitted BSS, the AP MLD ID should not be included.
+ */
+ if (ap_mld_id)
+ wpa_s->ml_probe_mld_id = -1;
+ else
+ wpa_s->ml_probe_mld_id = 0;
+
wpa_s->ml_probe_links = missing_links;
wpa_s->normal_scans = 0;
if ((wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_MLO) &&
!wpa_bss_parse_basic_ml_element(wpa_s, bss, wpa_s->ap_mld_addr,
- NULL, ssid) &&
+ NULL, ssid, NULL) &&
bss->n_mld_links) {
wpa_printf(MSG_DEBUG, "MLD: In authentication");
wpas_sme_set_mlo_links(wpa_s, bss);