blob: 277f5faa2b13ae70b348ec74fbc57a5e5b3e93b6 [file] [log] [blame]
developere35b8e42023-10-16 11:04:00 +08001From 401cb8a661c5e7d796a17bb289209663a6c42741 Mon Sep 17 00:00:00 2001
2From: Michael-CY Lee <michael-cy.lee@mediatek.com>
3Date: Wed, 4 Oct 2023 11:12:52 +0800
4Subject: [PATCH] hostapd: mtk: avoid unnecessary beacon update for 6 GHz
5 co-location
6
7There are two reasons to update beacon for 6 GHz co-location:
81. 6 GHz out-of-band discovery
92. MLD operational parameters update
10
11BSS load update is unrelated with the above two reasons, and therefore is
12not a case to update beacon for 6 GHz co-location.
13Moreover, updating beacon for 6 GHz co-location when BSS load update
14makes hostapd set beacon too frequently in a multiple BSSes case.
15
16Besides, it is also not necessary to update beacon for 6 GHz BSS when
17setting 2/5 GHz beacon. (i.e., no need for 2/5 GHz co-location)
18
19This patch adds an new function to update beacon only for current BSS,
20and uses the function duriong BSS load update.
21Also it changes the condition check to make beacon update only for 6 GHz
22co-location.
23
24Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com>
25Signed-off-by: Money Wang <money.wang@mediatek.com>
26---
27 src/ap/beacon.c | 8 +++++++-
28 src/ap/beacon.h | 1 +
29 src/ap/bss_load.c | 2 +-
30 3 files changed, 9 insertions(+), 2 deletions(-)
31
32diff --git a/src/ap/beacon.c b/src/ap/beacon.c
33index c67d08b..02f4f87 100644
34--- a/src/ap/beacon.c
35+++ b/src/ap/beacon.c
36@@ -2098,6 +2098,12 @@ fail:
37 }
38
39
40+void ieee802_11_set_beacon_per_bss_only(struct hostapd_data *hapd)
41+{
42+ __ieee802_11_set_beacon(hapd);
43+}
44+
45+
46 int ieee802_11_set_beacon(struct hostapd_data *hapd)
47 {
48 struct hostapd_iface *iface = hapd->iface;
49@@ -2121,7 +2127,7 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
50 if (colocated == iface || !colocated || !colocated->conf)
51 continue;
52
53- if (is_6g == is_6ghz_op_class(colocated->conf->op_class))
54+ if (!is_6g || is_6ghz_op_class(colocated->conf->op_class))
55 continue;
56
57 for (i = 0; i < colocated->num_bss; i++) {
58diff --git a/src/ap/beacon.h b/src/ap/beacon.h
59index c320825..b32b2a7 100644
60--- a/src/ap/beacon.h
61+++ b/src/ap/beacon.h
62@@ -15,6 +15,7 @@ struct ieee80211_mgmt;
63 void handle_probe_req(struct hostapd_data *hapd,
64 const struct ieee80211_mgmt *mgmt, size_t len,
65 int ssi_signal);
66+void ieee802_11_set_beacon_per_bss_only(struct hostapd_data *hapd);
67 int ieee802_11_set_beacon(struct hostapd_data *hapd);
68 int ieee802_11_set_beacons(struct hostapd_iface *iface);
69 int ieee802_11_update_beacons(struct hostapd_iface *iface);
70diff --git a/src/ap/bss_load.c b/src/ap/bss_load.c
71index 78fd9d8..9e247da 100644
72--- a/src/ap/bss_load.c
73+++ b/src/ap/bss_load.c
74@@ -58,7 +58,7 @@ static void update_channel_utilization(void *eloop_data, void *user_data)
75 return;
76 }
77
78- ieee802_11_set_beacon(hapd);
79+ ieee802_11_set_beacon_per_bss_only(hapd);
80
81 if (hapd->conf->chan_util_avg_period) {
82 iface->chan_util_samples_sum += iface->channel_utilization;
83--
842.25.1
85