| From 2b760a3738dbc5d0c9fa71a1f73bba2265453f46 Mon Sep 17 00:00:00 2001 |
| From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| Date: Fri, 10 May 2024 17:52:41 +0800 |
| Subject: [PATCH 088/126] mtk: hostapd: add mlo probe client support |
| |
| Add mld-level probe client support |
| Only register one eloop ap_handle_timeout per mld |
| |
| Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| --- |
| hostapd/ctrl_iface.c | 12 ++++++++++++ |
| src/ap/sta_info.c | 18 +++++++++++++++++- |
| 2 files changed, 29 insertions(+), 1 deletion(-) |
| |
| diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c |
| index d9775e13e..2038a3712 100644 |
| --- a/hostapd/ctrl_iface.c |
| +++ b/hostapd/ctrl_iface.c |
| @@ -1469,6 +1469,18 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd) |
| hapd->conf->transition_disable); |
| } |
| |
| +#ifdef CONFIG_IEEE80211BE |
| + /* workaround before hostapd cli support per link configuration */ |
| + if (hapd->conf->mld_ap) { |
| + struct hostapd_data *h; |
| + |
| + for_each_mld_link(h, hapd) { |
| + if (os_strcasecmp(cmd, "ap_max_inactivity") == 0) |
| + h->conf->ap_max_inactivity = hapd->conf->ap_max_inactivity; |
| + } |
| + } |
| +#endif /* CONFIG_IEEE80211BE */ |
| + |
| #ifdef CONFIG_TESTING_OPTIONS |
| if (os_strcmp(cmd, "ft_rsnxe_used") == 0) |
| wpa_auth_set_ft_rsnxe_used(hapd->wpa_auth, |
| diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c |
| index 58e66f555..bc729137d 100644 |
| --- a/src/ap/sta_info.c |
| +++ b/src/ap/sta_info.c |
| @@ -819,6 +819,7 @@ struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr) |
| struct sta_info *sta; |
| int i; |
| int max_inactivity = hapd->conf->ap_max_inactivity; |
| + bool registered = false; |
| |
| sta = ap_get_sta(hapd, addr); |
| if (sta) |
| @@ -855,7 +856,22 @@ struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr) |
| if (sta->max_idle_period) |
| max_inactivity = (sta->max_idle_period * 1024 + 999) / 1000; |
| |
| - if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_INACTIVITY_TIMER)) { |
| +#ifdef CONFIG_IEEE80211BE |
| + if (hapd->conf->mld_ap) { |
| + struct hostapd_data *h; |
| + struct sta_info *s; |
| + |
| + for_each_mld_link(h, hapd) { |
| + s = ap_get_sta(h, addr); |
| + if (s && eloop_is_timeout_registered(ap_handle_timer, h, s)) { |
| + registered = true; |
| + break; |
| + } |
| + } |
| + } |
| +#endif /* CONFIG_IEEE80211BE */ |
| + |
| + if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_INACTIVITY_TIMER) && !registered) { |
| wpa_printf(MSG_DEBUG, "%s: register ap_handle_timer timeout " |
| "for " MACSTR " (%d seconds - ap_max_inactivity)", |
| __func__, MAC2STR(addr), |
| -- |
| 2.18.0 |
| |