From: Jouni Malinen Date: Tue, 9 Dec 2025 14:02:35 +0000 (+0200) Subject: Remove duplicated definition of STA Control field for Basic MLE X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46fc21757675d2453d672444b48b32a94b912f2f;p=thirdparty%2Fhostap.git Remove duplicated definition of STA Control field for Basic MLE These subfields were defined twice. There is no need to maintain two copies of this. Signed-off-by: Jouni Malinen --- diff --git a/src/ap/beacon.c b/src/ap/beacon.c index bc620f760..7035bce9b 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -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)) { diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c index 9eb4e9c3a..7e5850d5d 100644 --- a/src/ap/ieee802_11_eht.c +++ b/src/ap/ieee802_11_eht.c @@ -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; diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index e78e368ae..81be21619 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -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 { diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 333133dee..3a5a015ae 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -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; diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 81d3a678c..cad08242c 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -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); }