AP MLD: Support removal of link station from AP

Whenever ap_free_sta() was called, it deleted the whole station entry
from the kernel as well. However, with MLD stations, there is a
requirement to delete only the link station.

Add support to remove the link station alone from an MLD station. If the
link going to be removed is the association link, the whole station
entry will be removed.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
This commit is contained in:
Aditya Kumar Singh 2024-03-06 12:11:03 +05:30 committed by Jouni Malinen
parent 1f88b3daf0
commit a6d92da9aa
3 changed files with 38 additions and 1 deletions

View file

@ -418,6 +418,7 @@ static void hostapd_link_remove_timeout_handler(void *eloop_data,
ieee802_11_set_beacon(hapd); ieee802_11_set_beacon(hapd);
if (!hapd->eht_mld_link_removal_count) { if (!hapd->eht_mld_link_removal_count) {
hostapd_free_link_stas(hapd);
hostapd_disable_iface(hapd->iface); hostapd_disable_iface(hapd->iface);
return; return;
} }

View file

@ -187,6 +187,19 @@ void ap_free_sta_pasn(struct hostapd_data *hapd, struct sta_info *sta)
#endif /* CONFIG_PASN */ #endif /* CONFIG_PASN */
static void __ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
{
#ifdef CONFIG_IEEE80211BE
if (hostapd_sta_is_link_sta(hapd, sta) &&
!hostapd_drv_link_sta_remove(hapd, sta->addr))
return;
#endif /* CONFIG_IEEE80211BE */
hostapd_drv_sta_remove(hapd, sta->addr);
}
void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta) void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
{ {
int set_beacon = 0; int set_beacon = 0;
@ -209,7 +222,7 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
if (!hapd->iface->driver_ap_teardown && if (!hapd->iface->driver_ap_teardown &&
!(sta->flags & WLAN_STA_PREAUTH)) { !(sta->flags & WLAN_STA_PREAUTH)) {
hostapd_drv_sta_remove(hapd, sta->addr); __ap_free_sta(hapd, sta);
sta->added_unassoc = 0; sta->added_unassoc = 0;
} }
@ -454,6 +467,27 @@ void hostapd_free_stas(struct hostapd_data *hapd)
} }
#ifdef CONFIG_IEEE80211BE
void hostapd_free_link_stas(struct hostapd_data *hapd)
{
struct sta_info *sta, *prev;
sta = hapd->sta_list;
while (sta) {
prev = sta;
sta = sta->next;
if (!hostapd_sta_is_link_sta(hapd, prev))
continue;
wpa_printf(MSG_DEBUG, "Removing link station from MLD " MACSTR,
MAC2STR(prev->addr));
ap_free_sta(hapd, prev);
}
}
#endif /* CONFIG_IEEE80211BE */
/** /**
* ap_handle_timer - Per STA timer handler * ap_handle_timer - Per STA timer handler
* @eloop_ctx: struct hostapd_data * * @eloop_ctx: struct hostapd_data *

View file

@ -440,4 +440,6 @@ static inline void ap_sta_set_mld(struct sta_info *sta, bool mld)
void ap_sta_free_sta_profile(struct mld_info *info); void ap_sta_free_sta_profile(struct mld_info *info);
void hostapd_free_link_stas(struct hostapd_data *hapd);
#endif /* STA_INFO_H */ #endif /* STA_INFO_H */