blob: f147d6837f3745c32b32eb859fa53b53692ed79e [file] [log] [blame]
developerc41fcd32022-09-20 22:09:06 +08001From 17c48cab4058c5183f3fedc1bfbd6877a706e003 Mon Sep 17 00:00:00 2001
developere2cc0fa2022-03-29 17:31:03 +08002From: "howard.hsu" <howard-yh.hsu@mediatek.com>
3Date: Wed, 19 Jan 2022 21:03:38 +0800
developerc41fcd32022-09-20 22:09:06 +08004Subject: [PATCH 99904/99916] Disable interface if BSS Termination TSF is set
developere2cc0fa2022-03-29 17:31:03 +08005
6---
7 src/ap/wnm_ap.c | 17 +++++++++++++++++
8 1 file changed, 17 insertions(+)
9
10diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c
developerc41fcd32022-09-20 22:09:06 +080011index 532d9dbe6..f6761aba3 100644
developere2cc0fa2022-03-29 17:31:03 +080012--- a/src/ap/wnm_ap.c
13+++ b/src/ap/wnm_ap.c
developerc41fcd32022-09-20 22:09:06 +080014@@ -780,6 +780,22 @@ static void set_disassoc_timer(struct hostapd_data *hapd, struct sta_info *sta,
developere2cc0fa2022-03-29 17:31:03 +080015 }
16
17
18+void bss_termination_disable_iface(void *eloop_ctx, void *timeout_ctx)
19+{
20+ struct hostapd_data *hapd = eloop_ctx;
21+ hostapd_disable_iface(hapd->iface);
22+}
23+
24+
25+static void set_disable_iface_timer(struct hostapd_data *hapd, struct sta_info *sta,
26+ int disable_iface_timer)
27+{
28+ wpa_printf(MSG_DEBUG, "Disable interface timer set to %d secs", disable_iface_timer);
29+ eloop_register_timeout(disable_iface_timer, 0,
30+ bss_termination_disable_iface, hapd, NULL);
31+}
32+
33+
34 int wnm_send_ess_disassoc_imminent(struct hostapd_data *hapd,
35 struct sta_info *sta, const char *url,
36 int disassoc_timer)
developerc41fcd32022-09-20 22:09:06 +080037@@ -869,6 +885,7 @@ int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta,
developere2cc0fa2022-03-29 17:31:03 +080038 bss_term_dur) {
39 os_memcpy(pos, bss_term_dur, 12);
40 pos += 12;
41+ set_disable_iface_timer(hapd, sta, hapd->conf->bss_termination_tsf);
42 }
43
44 if (url) {
45--
developerc41fcd32022-09-20 22:09:06 +0800462.25.1
developere2cc0fa2022-03-29 17:31:03 +080047