| From 6297062e6c302d2de6888580c2f396da47c95908 Mon Sep 17 00:00:00 2001 |
| From: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| Date: Tue, 4 Jun 2024 08:24:32 +0800 |
| Subject: [PATCH 103/126] mtk: hostapd: ensure only a scan callback is called |
| on each scan result event |
| |
| Every scan callback is assigned along with a scan request to driver. |
| Therefore on each scan result event, there should be only one scan |
| callback to be handled. |
| |
| Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| --- |
| src/ap/drv_callbacks.c | 10 +++++++--- |
| 1 file changed, 7 insertions(+), 3 deletions(-) |
| |
| diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c |
| index 705acfb67..1b91232f2 100644 |
| --- a/src/ap/drv_callbacks.c |
| +++ b/src/ap/drv_callbacks.c |
| @@ -2493,10 +2493,12 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event, |
| hapd = switch_link_scan(hapd, |
| data->scan_info.scan_cookie); |
| #endif /* NEED_AP_MLME */ |
| - if (hapd->iface->scan_cb) |
| + if (hapd->iface->scan_cb) { |
| hapd->iface->scan_cb(hapd->iface); |
| + break; |
| + } |
| #ifdef CONFIG_IEEE80211BE |
| - if (!hapd->iface->scan_cb && hapd->conf->mld_ap) { |
| + if (hapd->conf->mld_ap) { |
| /* Other links may be waiting for HT scan result */ |
| unsigned int i; |
| |
| @@ -2506,8 +2508,10 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event, |
| struct hostapd_data *h_hapd = h->bss[0]; |
| |
| if (hostapd_is_ml_partner(hapd, h_hapd) && |
| - h_hapd->iface->scan_cb) |
| + h_hapd->iface->scan_cb) { |
| h_hapd->iface->scan_cb(h_hapd->iface); |
| + break; |
| + } |
| } |
| } |
| #endif /* CONFIG_IEEE80211BE */ |
| -- |
| 2.18.0 |
| |