[PATCH 06/13] wpa_supplicant: Add more fields to MLO links information

Andrei Otcheretianski andrei.otcheretianski at intel.com
Thu Nov 24 04:45:26 PST 2022


This new info will be needed for auth and assoc flows.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 src/common/defs.h                 | 15 +++++++++++++++
 wpa_supplicant/events.c           |  9 ++++-----
 wpa_supplicant/wpa_supplicant_i.h | 10 +++-------
 3 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/src/common/defs.h b/src/common/defs.h
index 3e658cbcf4..d2dbeaf32b 100644
--- a/src/common/defs.h
+++ b/src/common/defs.h
@@ -520,4 +520,19 @@ enum frame_encryption {
 
 #define MAX_NUM_MLD_LINKS 15
 
+#define EHT_ML_MAX_STA_PROF_LEN 1024
+
+struct ml_sta_link_info {
+	u8 addr[ETH_ALEN];
+	u8 bssid[ETH_ALEN];
+	unsigned int freq;
+
+	/* pointer to the corresponding BSS */
+	struct wpa_bss *bss;
+
+	/* The status of the link. See WLAN_STATUS_* */
+	u16 status;
+	size_t sta_profile_len;
+	u8 sta_profile[EHT_ML_MAX_STA_PROF_LEN];
+};
 #endif /* DEFS_H */
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 35f3694a0b..91c0e7eb2d 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -310,17 +310,16 @@ void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx)
 
 static void wpas_reset_mlo_info(struct wpa_supplicant *wpa_s)
 {
-	int i;
-
 	if (!wpa_s->valid_links)
 		return;
 
+	wpa_s->mld = 0;
 	wpa_s->valid_links = 0;
-	for (i = 0; i < MAX_NUM_MLD_LINKS; i++)
-		wpa_s->links[i].bss = NULL;
+	wpa_s->mlo_assoc_link_id = 0;
+	os_memset(wpa_s->ap_mld_addr, 0, ETH_ALEN);
+	os_memset(wpa_s->links, 0, sizeof(wpa_s->links));
 }
 
-
 void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s)
 {
 	int bssid_changed;
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index add24f07df..9e1ee269c8 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -685,15 +685,11 @@ struct wpa_supplicant {
 	struct wpa_bss *current_bss;
 	int ap_ies_from_associnfo;
 	unsigned int assoc_freq;
+	u8 mld;
 	u8 ap_mld_addr[ETH_ALEN];
 	u8 mlo_assoc_link_id;
-	u8 valid_links; /* bitmap of valid MLO link IDs */
-	struct {
-		u8 addr[ETH_ALEN];
-		u8 bssid[ETH_ALEN];
-		unsigned int freq;
-		struct wpa_bss *bss;
-	} links[MAX_NUM_MLD_LINKS];
+	u16 valid_links; /* bitmap of valid MLO link IDs */
+	struct ml_sta_link_info links[MAX_NUM_MLD_LINKS];
 	u8 *last_con_fail_realm;
 	size_t last_con_fail_realm_len;
 
-- 
2.25.1




More information about the Hostap mailing list