]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove duplicated definition of STA Control field for Basic MLE
authorJouni Malinen <jouni.malinen@oss.qualcomm.com>
Tue, 9 Dec 2025 14:02:35 +0000 (16:02 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 9 Dec 2025 14:04:21 +0000 (16:04 +0200)
These subfields were defined twice. There is no need to maintain two
copies of this.

Signed-off-by: Jouni Malinen <jouni.malinen@oss.qualcomm.com>
src/ap/beacon.c
src/ap/ieee802_11_eht.c
src/common/ieee802_11_defs.h
wpa_supplicant/events.c
wpa_supplicant/scan.c

index bc620f7609b20a772e308a052cedf1c4369e94ef..7035bce9b58611abfca71a75df2188eff0e03425 100644 (file)
@@ -1422,7 +1422,7 @@ static bool parse_ml_probe_req(const struct ieee80211_eht_ml *ml, size_t ml_len,
                 * partial profile was requested.
                 */
                sta_control = le_to_host16(sta->sta_control);
-               *links |= BIT(sta_control & EHT_PER_STA_CTRL_LINK_ID_MSK);
+               *links |= BIT(sta_control & BASIC_MLE_STA_CTRL_LINK_ID_MASK);
        }
 
        if (!for_each_element_completed(sub, pos, len)) {
index 9eb4e9c3a13a5852e97142150a104a181fd42f1b..7e5850d5dfc37d873fb718b7b2463eebd270a7ce 100644 (file)
@@ -560,14 +560,14 @@ u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd,
 
                /* STA Control */
                control = (link_id & 0xf) |
-                       EHT_PER_STA_CTRL_MAC_ADDR_PRESENT_MSK |
-                       EHT_PER_STA_CTRL_COMPLETE_PROFILE_MSK |
-                       EHT_PER_STA_CTRL_TSF_OFFSET_PRESENT_MSK |
-                       EHT_PER_STA_CTRL_BEACON_INTERVAL_PRESENT_MSK |
-                       EHT_PER_STA_CTRL_DTIM_INFO_PRESENT_MSK;
+                       BASIC_MLE_STA_CTRL_PRES_STA_MAC |
+                       BASIC_MLE_STA_CTRL_COMPLETE_PROFILE |
+                       BASIC_MLE_STA_CTRL_PRES_TSF_OFFSET |
+                       BASIC_MLE_STA_CTRL_PRES_BEACON_INT |
+                       BASIC_MLE_STA_CTRL_PRES_DTIM_INFO;
 
                if (include_bpcc)
-                       control |= EHT_PER_STA_CTRL_BSS_PARAM_CNT_PRESENT_MSK;
+                       control |= BASIC_MLE_STA_CTRL_PRES_BSS_PARAM_COUNT;
 
                wpabuf_put_le16(buf, control);
 
@@ -1408,23 +1408,23 @@ u16 hostapd_process_ml_assoc_req(struct hostapd_data *hapd,
                }
                control = WPA_GET_LE16(pos);
                link_info = &info->links[control &
-                                        EHT_PER_STA_CTRL_LINK_ID_MSK];
+                                        BASIC_MLE_STA_CTRL_LINK_ID_MASK];
                pos += 2;
 
-               if (!(control & EHT_PER_STA_CTRL_COMPLETE_PROFILE_MSK)) {
+               if (!(control & BASIC_MLE_STA_CTRL_COMPLETE_PROFILE)) {
                        wpa_printf(MSG_DEBUG,
                                   "MLD: Per-STA complete profile expected");
                        goto out;
                }
 
-               if (!(control & EHT_PER_STA_CTRL_MAC_ADDR_PRESENT_MSK)) {
+               if (!(control & BASIC_MLE_STA_CTRL_PRES_STA_MAC)) {
                        wpa_printf(MSG_DEBUG,
                                   "MLD: Per-STA MAC address not present");
                        goto out;
                }
 
-               if ((control & (EHT_PER_STA_CTRL_BEACON_INTERVAL_PRESENT_MSK |
-                               EHT_PER_STA_CTRL_DTIM_INFO_PRESENT_MSK))) {
+               if ((control & (BASIC_MLE_STA_CTRL_PRES_BEACON_INT |
+                               BASIC_MLE_STA_CTRL_PRES_DTIM_INFO))) {
                        wpa_printf(MSG_DEBUG,
                                   "MLD: Beacon/DTIM interval not expected");
                        goto out;
@@ -1433,8 +1433,8 @@ u16 hostapd_process_ml_assoc_req(struct hostapd_data *hapd,
                /* The length octet and the MAC address must be present */
                sta_info_len = 1 + ETH_ALEN;
 
-               if (control & EHT_PER_STA_CTRL_NSTR_LINK_PAIR_PRESENT_MSK) {
-                       if (control & EHT_PER_STA_CTRL_NSTR_BM_SIZE_MSK)
+               if (control & BASIC_MLE_STA_CTRL_PRES_NSTR_LINK_PAIR) {
+                       if (control & BASIC_MLE_STA_CTRL_NSTR_BITMAP)
                                link_info->nstr_bitmap_len = 2;
                        else
                                link_info->nstr_bitmap_len = 1;
@@ -1460,7 +1460,7 @@ u16 hostapd_process_ml_assoc_req(struct hostapd_data *hapd,
                os_memcpy(link_info->peer_addr, pos, ETH_ALEN);
                wpa_printf(MSG_DEBUG,
                           "MLD: assoc: link id=%u, addr=" MACSTR,
-                          control & EHT_PER_STA_CTRL_LINK_ID_MSK,
+                          control & BASIC_MLE_STA_CTRL_LINK_ID_MASK,
                           MAC2STR(link_info->peer_addr));
 
                pos += ETH_ALEN;
index e78e368ae6dc5782abbb4e1e01e6ce36bb44925d..81be21619930b2e08e4ed09a01873191ea115293 100644 (file)
@@ -2926,16 +2926,6 @@ struct eht_ml_basic_common_info {
 #define EHT_ML_EXT_MLD_CAPA_EMLSR_ENA_ONE_LINK        0x0040
 #define EHT_ML_EXT_MLD_CAPA_BTM_MLD_RECO_MULTI_AP     0x0080
 
-#define EHT_PER_STA_CTRL_LINK_ID_MSK                  0x000f
-#define EHT_PER_STA_CTRL_COMPLETE_PROFILE_MSK         0x0010
-#define EHT_PER_STA_CTRL_MAC_ADDR_PRESENT_MSK         0x0020
-#define EHT_PER_STA_CTRL_BEACON_INTERVAL_PRESENT_MSK  0x0040
-#define EHT_PER_STA_CTRL_TSF_OFFSET_PRESENT_MSK       0x0080
-#define EHT_PER_STA_CTRL_DTIM_INFO_PRESENT_MSK        0x0100
-#define EHT_PER_STA_CTRL_NSTR_LINK_PAIR_PRESENT_MSK   0x0200
-#define EHT_PER_STA_CTRL_NSTR_BM_SIZE_MSK             0x0400
-#define EHT_PER_STA_CTRL_BSS_PARAM_CNT_PRESENT_MSK    0x0800
-
 /* IEEE Std 802.11be-2024, Figure 9-1074u - Per-STA Profile subelement format
  * of the Basic Multi-Link element*/
 struct ieee80211_eht_per_sta_profile {
index 333133dee0b3cee85cefa8a3bbcf768d70ff78e3..3a5a015ae7e98582584a6c8950169dae9cce16f2 100644 (file)
@@ -4122,44 +4122,44 @@ static unsigned int wpas_ml_parse_assoc(struct wpa_supplicant *wpa_s,
                pos += 2;
                ml_len -= 2;
 
-               if (!(ctrl & EHT_PER_STA_CTRL_COMPLETE_PROFILE_MSK)) {
+               if (!(ctrl & BASIC_MLE_STA_CTRL_COMPLETE_PROFILE)) {
                        wpa_printf(MSG_DEBUG,
                                   "MLD: Per STA complete profile expected");
                        goto out;
                }
 
-               if (!(ctrl & EHT_PER_STA_CTRL_MAC_ADDR_PRESENT_MSK)) {
+               if (!(ctrl & BASIC_MLE_STA_CTRL_PRES_STA_MAC)) {
                        wpa_printf(MSG_DEBUG,
                                   "MLD: Per STA MAC address not present");
                        goto out;
                }
 
-               if (!(ctrl & EHT_PER_STA_CTRL_TSF_OFFSET_PRESENT_MSK)) {
+               if (!(ctrl & BASIC_MLE_STA_CTRL_PRES_TSF_OFFSET)) {
                        wpa_printf(MSG_DEBUG,
                                   "MLD: Per STA TSF offset not present");
                        goto out;
                }
 
-               if (!(ctrl & EHT_PER_STA_CTRL_BEACON_INTERVAL_PRESENT_MSK)) {
+               if (!(ctrl & BASIC_MLE_STA_CTRL_PRES_BEACON_INT)) {
                        wpa_printf(MSG_DEBUG,
                                   "MLD: Beacon interval not present");
                        goto out;
                }
 
-               if (!(ctrl & EHT_PER_STA_CTRL_DTIM_INFO_PRESENT_MSK)) {
+               if (!(ctrl & BASIC_MLE_STA_CTRL_PRES_DTIM_INFO)) {
                        wpa_printf(MSG_DEBUG,
                                   "MLD:  DTIM information not present");
                        goto out;
                }
 
-               if (ctrl & EHT_PER_STA_CTRL_NSTR_LINK_PAIR_PRESENT_MSK) {
-                       if (ctrl & EHT_PER_STA_CTRL_NSTR_BM_SIZE_MSK)
+               if (ctrl & BASIC_MLE_STA_CTRL_PRES_NSTR_LINK_PAIR) {
+                       if (ctrl & BASIC_MLE_STA_CTRL_NSTR_BITMAP)
                                nstr_bitmap_len = 2;
                        else
                                nstr_bitmap_len = 1;
                }
 
-               if (!(ctrl & EHT_PER_STA_CTRL_BSS_PARAM_CNT_PRESENT_MSK)) {
+               if (!(ctrl & BASIC_MLE_STA_CTRL_PRES_BSS_PARAM_COUNT)) {
                        wpa_printf(MSG_DEBUG,
                                   "MLD:  BSS params change count not present");
                        goto out;
@@ -4190,7 +4190,7 @@ static unsigned int wpas_ml_parse_assoc(struct wpa_supplicant *wpa_s,
                           "MLD: link addr: " MACSTR " nstr BM len=%u",
                           MAC2STR(pos + 1), nstr_bitmap_len);
 
-               ml_info[i].link_id = ctrl & EHT_PER_STA_CTRL_LINK_ID_MSK;
+               ml_info[i].link_id = ctrl & BASIC_MLE_STA_CTRL_LINK_ID_MASK;
                os_memcpy(ml_info[i].bssid, pos + 1, ETH_ALEN);
 
                pos += sta_info_len;
index 81d3a678c672c5d5fcba05171e304e9ef6026964..cad08242caedb4306d650c361af70903f38d6c17 100644 (file)
@@ -710,7 +710,7 @@ static struct wpabuf * wpa_supplicant_ml_probe_ie(int mld_id, u16 links)
                /* Subelement length includes only the control */
                wpabuf_put_u8(extra_ie, 2);
 
-               control = link_id | EHT_PER_STA_CTRL_COMPLETE_PROFILE_MSK;
+               control = link_id | BASIC_MLE_STA_CTRL_COMPLETE_PROFILE;
 
                wpabuf_put_le16(extra_ie, control);
        }