blob: 8cf4e0a960189fe957b8e9dd625836f730d3ecec [file] [log] [blame]
developer05f3b2b2024-08-19 19:17:34 +08001From 2b760a3738dbc5d0c9fa71a1f73bba2265453f46 Mon Sep 17 00:00:00 2001
2From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
3Date: Fri, 10 May 2024 17:52:41 +0800
4Subject: [PATCH 088/126] mtk: hostapd: add mlo probe client support
5
6Add mld-level probe client support
7Only register one eloop ap_handle_timeout per mld
8
9Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
10---
11 hostapd/ctrl_iface.c | 12 ++++++++++++
12 src/ap/sta_info.c | 18 +++++++++++++++++-
13 2 files changed, 29 insertions(+), 1 deletion(-)
14
15diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
16index d9775e13e..2038a3712 100644
17--- a/hostapd/ctrl_iface.c
18+++ b/hostapd/ctrl_iface.c
19@@ -1469,6 +1469,18 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd)
20 hapd->conf->transition_disable);
21 }
22
23+#ifdef CONFIG_IEEE80211BE
24+ /* workaround before hostapd cli support per link configuration */
25+ if (hapd->conf->mld_ap) {
26+ struct hostapd_data *h;
27+
28+ for_each_mld_link(h, hapd) {
29+ if (os_strcasecmp(cmd, "ap_max_inactivity") == 0)
30+ h->conf->ap_max_inactivity = hapd->conf->ap_max_inactivity;
31+ }
32+ }
33+#endif /* CONFIG_IEEE80211BE */
34+
35 #ifdef CONFIG_TESTING_OPTIONS
36 if (os_strcmp(cmd, "ft_rsnxe_used") == 0)
37 wpa_auth_set_ft_rsnxe_used(hapd->wpa_auth,
38diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
39index 58e66f555..bc729137d 100644
40--- a/src/ap/sta_info.c
41+++ b/src/ap/sta_info.c
42@@ -819,6 +819,7 @@ struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr)
43 struct sta_info *sta;
44 int i;
45 int max_inactivity = hapd->conf->ap_max_inactivity;
46+ bool registered = false;
47
48 sta = ap_get_sta(hapd, addr);
49 if (sta)
50@@ -855,7 +856,22 @@ struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr)
51 if (sta->max_idle_period)
52 max_inactivity = (sta->max_idle_period * 1024 + 999) / 1000;
53
54- if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_INACTIVITY_TIMER)) {
55+#ifdef CONFIG_IEEE80211BE
56+ if (hapd->conf->mld_ap) {
57+ struct hostapd_data *h;
58+ struct sta_info *s;
59+
60+ for_each_mld_link(h, hapd) {
61+ s = ap_get_sta(h, addr);
62+ if (s && eloop_is_timeout_registered(ap_handle_timer, h, s)) {
63+ registered = true;
64+ break;
65+ }
66+ }
67+ }
68+#endif /* CONFIG_IEEE80211BE */
69+
70+ if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_INACTIVITY_TIMER) && !registered) {
71 wpa_printf(MSG_DEBUG, "%s: register ap_handle_timer timeout "
72 "for " MACSTR " (%d seconds - ap_max_inactivity)",
73 __func__, MAC2STR(addr),
74--
752.18.0
76