blob: 7b12f2108dce5f9b5d39a061e1d59a34cc48a940 [file] [log] [blame]
developer05f3b2b2024-08-19 19:17:34 +08001From 6297062e6c302d2de6888580c2f396da47c95908 Mon Sep 17 00:00:00 2001
2From: Michael-CY Lee <michael-cy.lee@mediatek.com>
3Date: Tue, 4 Jun 2024 08:24:32 +0800
4Subject: [PATCH 103/126] mtk: hostapd: ensure only a scan callback is called
5 on each scan result event
6
7Every scan callback is assigned along with a scan request to driver.
8Therefore on each scan result event, there should be only one scan
9callback to be handled.
10
11Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
12---
13 src/ap/drv_callbacks.c | 10 +++++++---
14 1 file changed, 7 insertions(+), 3 deletions(-)
15
16diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
17index 705acfb67..1b91232f2 100644
18--- a/src/ap/drv_callbacks.c
19+++ b/src/ap/drv_callbacks.c
20@@ -2493,10 +2493,12 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
21 hapd = switch_link_scan(hapd,
22 data->scan_info.scan_cookie);
23 #endif /* NEED_AP_MLME */
24- if (hapd->iface->scan_cb)
25+ if (hapd->iface->scan_cb) {
26 hapd->iface->scan_cb(hapd->iface);
27+ break;
28+ }
29 #ifdef CONFIG_IEEE80211BE
30- if (!hapd->iface->scan_cb && hapd->conf->mld_ap) {
31+ if (hapd->conf->mld_ap) {
32 /* Other links may be waiting for HT scan result */
33 unsigned int i;
34
35@@ -2506,8 +2508,10 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
36 struct hostapd_data *h_hapd = h->bss[0];
37
38 if (hostapd_is_ml_partner(hapd, h_hapd) &&
39- h_hapd->iface->scan_cb)
40+ h_hapd->iface->scan_cb) {
41 h_hapd->iface->scan_cb(h_hapd->iface);
42+ break;
43+ }
44 }
45 }
46 #endif /* CONFIG_IEEE80211BE */
47--
482.18.0
49