struct sta_info *sta)
{
#ifdef CONFIG_IEEE80211BE
- if (hapd->conf->mld_ap && sta->mld_info.mld_sta &&
+ if (ap_sta_is_mld(hapd, sta) &&
sta->mld_assoc_link_id != hapd->mld_link_id)
return true;
#endif /* CONFIG_IEEE80211BE */
struct sta_info *sta = ap_get_sta(hapd, addr);
link_id = hapd->mld_link_id;
- if (sta && sta->mld_info.mld_sta)
+ if (ap_sta_is_mld(hapd, sta))
own_addr = hapd->mld_addr;
}
#endif /* CONFIG_IEEE80211BE */
if (hapd->conf->mld_ap) {
struct sta_info *sta = ap_get_sta(hapd, addr);
- if (sta && sta->mld_info.mld_sta)
+ if (ap_sta_is_mld(hapd, sta))
own_addr = hapd->mld_addr;
}
#endif /* CONFIG_IEEE80211BE */
} else if (hapd->conf->mld_ap) {
sta = ap_get_sta(hapd, dst);
- if (sta && sta->mld_info.mld_sta) {
+ if (ap_sta_is_mld(hapd, sta)) {
own_addr = hapd->mld_addr;
bssid = own_addr;
}
return -1;
}
#ifdef CONFIG_IEEE80211BE
- if (sta->mld_info.mld_sta) {
+ if (ap_sta_is_mld(hapd, sta)) {
wpa_printf(MSG_DEBUG,
"MLD: Set ML info in RSN Authenticator");
wpa_auth_set_ml_info(sta->wpa_sm, hapd->mld_addr,
}
#ifdef CONFIG_IEEE80211BE
- if (hapd->conf->mld_ap && sta->mld_info.mld_sta &&
+ if (ap_sta_is_mld(hapd, sta) &&
sta->mld_assoc_link_id != hapd->mld_link_id)
return;
#endif /* CONFIG_IEEE80211BE */
* the MLD MAC address. Thus, use the MLD address instead of translating
* the addresses.
*/
- if (hapd->conf->mld_ap && sta && sta->mld_info.mld_sta) {
+ if (ap_sta_is_mld(hapd, sta)) {
sa = hapd->mld_addr;
ml_resp = hostapd_ml_auth_resp(hapd);
const u8 *own_addr = hapd->own_addr;
#ifdef CONFIG_IEEE80211BE
- if (hapd->conf->mld_ap && sta->mld_info.mld_sta)
+ if (ap_sta_is_mld(hapd, sta))
own_addr = hapd->mld_addr;
#endif /* CONFIG_IEEE80211BE */
params.status = status;
#ifdef CONFIG_IEEE80211BE
- if (sta->mld_info.mld_sta)
+ if (ap_sta_is_mld(hapd, sta))
params.bssid =
sta->mld_info.links[sta->mld_assoc_link_id].peer_addr;
#endif /* CONFIG_IEEE80211BE */
* the MLD MAC address. It is the responsibility of the driver to
* handle the translations.
*/
- if (hapd->conf->mld_ap && sta && sta->mld_info.mld_sta) {
+ if (ap_sta_is_mld(hapd, sta)) {
dst = sta->addr;
bssid = hapd->mld_addr;
}
goto end;
}
#ifdef CONFIG_IEEE80211BE
- if (sta->mld_info.mld_sta)
+ if (ap_sta_is_mld(hapd, sta))
wpa_auth_set_ml_info(sta->wpa_sm, hapd->mld_addr,
sta->mld_assoc_link_id, &sta->mld_info);
#endif /* CONFIG_IEEE80211BE */
}
#ifdef CONFIG_IEEE80211BE
- if (info->mld_sta) {
+ if (ap_sta_is_mld(hapd, sta)) {
wpa_printf(MSG_DEBUG,
"MLD: Set ML info in RSN Authenticator");
wpa_auth_set_ml_info(sta->wpa_sm,
bool mld_link_sta = false;
#ifdef CONFIG_IEEE80211BE
- if (hapd->conf->mld_ap && sta->mld_info.mld_sta) {
+ if (ap_sta_is_mld(hapd, sta)) {
u8 mld_link_id = hapd->mld_link_id;
mld_link_sta = sta->mld_assoc_link_id != mld_link_id;
* Once a non-AP MLD is added to the driver, the addressing should use
* MLD MAC address.
*/
- if (hapd->conf->mld_ap && sta && sta->mld_info.mld_sta &&
- allow_mld_addr_trans)
+ if (ap_sta_is_mld(hapd, sta) && allow_mld_addr_trans)
sa = hapd->mld_addr;
#endif /* CONFIG_IEEE80211BE */
}
#ifdef CONFIG_IEEE80211BE
- if (hapd->conf->mld_ap && sta->mld_info.mld_sta &&
+ if (ap_sta_is_mld(hapd, sta) &&
hapd->mld_link_id != sta->mld_assoc_link_id) {
/* See ieee80211_ml_link_sta_assoc_cb() for the MLD case */
wpa_printf(MSG_DEBUG,
u8 * hostapd_eid_eht_ml_assoc(struct hostapd_data *hapd, struct sta_info *info,
u8 *eid)
{
- if (!info || !info->mld_info.mld_sta)
+ if (!ap_sta_is_mld(hapd, info))
return eid;
eid = hostapd_eid_eht_basic_ml_common(hapd, eid, &info->mld_info,
static int hostapd_mld_validate_assoc_info(struct hostapd_data *hapd,
- struct mld_info *info)
+ struct sta_info *sta)
{
u8 i, link_id;
+ struct mld_info *info = &sta->mld_info;
- if (!info->mld_sta) {
+ if (!ap_sta_is_mld(hapd, sta)) {
wpa_printf(MSG_DEBUG, "MLD: Not a non-AP MLD");
return 0;
}
goto out;
}
- ret = hostapd_mld_validate_assoc_info(hapd, info);
+ ret = hostapd_mld_validate_assoc_info(hapd, sta);
out:
wpabuf_free(mlbuf);
if (ret) {
}
#ifdef CONFIG_IEEE80211BE
- if (hapd->conf->mld_ap && sta && sta->mld_info.mld_sta)
+ if (ap_sta_is_mld(hapd, sta))
own_addr = hapd->mld_addr;
#endif /* CONFIG_IEEE80211BE */
MACSTR, MAC2STR(sa));
#ifdef CONFIG_IEEE80211BE
- if (hapd->conf->mld_ap && sta->mld_info.mld_sta)
+ if (ap_sta_is_mld(hapd, sta))
own_addr = hapd->mld_addr;
#endif /* CONFIG_IEEE80211BE */
struct hostapd_data *other_hapd = NULL;
struct sta_info *tmp_sta;
- if (!sta->mld_info.mld_sta)
+ if (!ap_sta_is_mld(hapd, sta))
return NULL;
*assoc_hapd = hapd;
ieee802_1x_free_station(hapd, sta);
#ifdef CONFIG_IEEE80211BE
- if (!hapd->conf->mld_ap || !sta->mld_info.mld_sta ||
+ if (!ap_sta_is_mld(hapd, sta) ||
hapd->mld_link_id == sta->mld_assoc_link_id)
wpa_auth_sta_deinit(sta->wpa_sm);
#else
int mld_assoc_link_id = -1;
#ifdef CONFIG_IEEE80211BE
- if (hapd->conf->mld_ap && sta->mld_info.mld_sta) {
+ if (ap_sta_is_mld(hapd, sta)) {
if (sta->mld_assoc_link_id == hapd->mld_link_id)
mld_assoc_link_id = sta->mld_assoc_link_id;
else
*/
#ifdef CONFIG_IEEE80211BE
- if (hapd->conf->mld_ap && sta->mld_info.mld_sta) {
+ if (ap_sta_is_mld(hapd, sta)) {
u8 mld_link_id = hapd->mld_link_id;
mld_link_sta = sta->mld_assoc_link_id != mld_link_id;
#include "common/sae.h"
#include "crypto/sha384.h"
#include "pasn/pasn_common.h"
+#include "hostapd.h"
/* STA flags */
#define WLAN_STA_AUTH BIT(0)
void ap_free_sta_pasn(struct hostapd_data *hapd, struct sta_info *sta);
+static inline bool ap_sta_is_mld(struct hostapd_data *hapd,
+ struct sta_info *sta)
+{
+#ifdef CONFIG_IEEE80211BE
+ return hapd->conf->mld_ap && sta && sta->mld_info.mld_sta;
+#else /* CONFIG_IEEE80211BE */
+ return false;
+#endif /* CONFIG_IEEE80211BE */
+}
+
#endif /* STA_INFO_H */
const u8 *own_addr = hapd->own_addr;
#ifdef CONFIG_IEEE80211BE
- if (hapd->conf->mld_ap && (!sta || sta->mld_info.mld_sta))
+ if (hapd->conf->mld_ap && (!sta || ap_sta_is_mld(hapd, sta)))
own_addr = hapd->mld_addr;
#endif /* CONFIG_IEEE80211BE */
if (disassoc_timer) {
#ifdef CONFIG_IEEE80211BE
- if (hapd->conf->mld_ap && sta->mld_info.mld_sta) {
+ if (ap_sta_is_mld(hapd, sta)) {
int i;
unsigned int links = 0;
if (sta) {
flags = hostapd_sta_flags_to_drv(sta->flags);
#ifdef CONFIG_IEEE80211BE
- if (sta->mld_info.mld_sta && (sta->flags & WLAN_STA_AUTHORIZED))
+ if (ap_sta_is_mld(hapd, sta) &&
+ (sta->flags & WLAN_STA_AUTHORIZED))
link_id = -1;
#endif /* CONFIG_IEEE80211BE */
}