blob: 7e2c70b18164d26ae9238120913eb5a3215ca72e [file] [log] [blame]
developer66e89bc2024-04-23 14:50:01 +08001From 30cfdaf10a5b3bb2a173a096b2c708c4a18d55bc Mon Sep 17 00:00:00 2001
2From: Michael-CY Lee <michael-cy.lee@mediatek.com>
3Date: Mon, 8 Apr 2024 14:34:36 +0800
4Subject: [PATCH 100/104] mtk: hostapd: MLD: find partner links by BSSID and
5 SSID
6
developer66e89bc2024-04-23 14:50:01 +08007Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
8---
9 wpa_supplicant/bss.c | 8 ++++++--
10 wpa_supplicant/sme.c | 14 ++++++++------
11 2 files changed, 14 insertions(+), 8 deletions(-)
12
13diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
14index 289035310..ae0e61bc3 100644
15--- a/wpa_supplicant/bss.c
16+++ b/wpa_supplicant/bss.c
17@@ -1529,8 +1529,12 @@ wpa_bss_parse_ml_rnr_ap_info(struct wpa_supplicant *wpa_s,
18 wpa_printf(MSG_DEBUG,
19 "MLD: Reported link not part of MLD");
20 } else if (!(BIT(link_id) & *seen)) {
21- struct wpa_bss *neigh_bss =
22- wpa_bss_get_bssid(wpa_s, pos + 1);
23+ struct wpa_bss *neigh_bss;
24+
25+ if (ssid)
26+ neigh_bss = wpa_bss_get(wpa_s, pos + 1, ssid->ssid, ssid->ssid_len);
27+ else
28+ neigh_bss = wpa_bss_get_bssid(wpa_s, pos + 1);
29
30 *seen |= BIT(link_id);
31 wpa_printf(MSG_DEBUG, "MLD: mld ID=%u, link ID=%u",
32diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
33index ef258fadc..0b4b8e3ce 100644
34--- a/wpa_supplicant/sme.c
35+++ b/wpa_supplicant/sme.c
36@@ -390,7 +390,8 @@ static void wpas_ml_handle_removed_links(struct wpa_supplicant *wpa_s,
37
38 #ifdef CONFIG_TESTING_OPTIONS
39 static struct wpa_bss * wpas_ml_connect_pref(struct wpa_supplicant *wpa_s,
40- struct wpa_bss *bss)
41+ struct wpa_bss *bss,
42+ struct wpa_ssid *ssid)
43 {
44 unsigned int low, high, i;
45
46@@ -459,7 +460,7 @@ found:
47 MAC2STR(wpa_s->links[i].bssid));
48
49 /* Get the BSS entry and do the switch */
50- bss = wpa_bss_get_bssid(wpa_s, wpa_s->links[i].bssid);
51+ bss = wpa_bss_get(wpa_s, wpa_s->links[i].bssid, ssid->ssid, ssid->ssid_len);
52 wpa_s->mlo_assoc_link_id = i;
53
54 return bss;
55@@ -528,7 +529,7 @@ static bool check_mld_allowed_phy(struct wpa_supplicant *wpa_s, int freq)
56
57
58 static void wpas_sme_set_mlo_links(struct wpa_supplicant *wpa_s,
59- struct wpa_bss *bss)
60+ struct wpa_bss *bss, struct wpa_ssid *ssid)
61 {
62 u8 i;
63
64@@ -551,7 +552,8 @@ static void wpas_sme_set_mlo_links(struct wpa_supplicant *wpa_s,
65 if (bss->mld_link_id == i)
66 wpa_s->links[i].bss = bss;
67 else
68- wpa_s->links[i].bss = wpa_bss_get_bssid(wpa_s, bssid);
69+ wpa_s->links[i].bss = wpa_bss_get(wpa_s, bssid, ssid->ssid,
70+ ssid->ssid_len);
71 }
72 }
73
74@@ -597,10 +599,10 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
75 #endif /* CONFIG_TESTING_OPTIONS */
76 bss->valid_links) {
77 wpa_printf(MSG_DEBUG, "MLD: In authentication");
78- wpas_sme_set_mlo_links(wpa_s, bss);
79+ wpas_sme_set_mlo_links(wpa_s, bss, ssid);
80
81 #ifdef CONFIG_TESTING_OPTIONS
82- bss = wpas_ml_connect_pref(wpa_s, bss);
83+ bss = wpas_ml_connect_pref(wpa_s, bss, ssid);
84
85 if (wpa_s->conf->mld_force_single_link) {
86 wpa_printf(MSG_DEBUG, "MLD: Force single link");
87--
882.39.2
89