blob: 1695996fd3f9fa5b171a9c81b762f55f35dc2f6c [file] [log] [blame]
developerb92dd482023-10-12 17:25:48 +08001From 53dbf487d72a05ae692d98930852c3b98cc6dad6 Mon Sep 17 00:00:00 2001
developerc8288192023-10-04 15:37:49 +08002From: Michael-CY Lee <michael-cy.lee@mediatek.com>
3Date: Wed, 4 Oct 2023 11:12:52 +0800
developerb92dd482023-10-12 17:25:48 +08004Subject: [PATCH] hostapd: mtk: avoid unnecessary beacon update for 6 GHz
5 co-location
developerc8288192023-10-04 15:37:49 +08006
developerb92dd482023-10-12 17:25:48 +08007There are two reasons to update beacon for 6 GHz co-location:
developerc8288192023-10-04 15:37:49 +080081. 6 GHz out-of-band discovery
92. MLD operational parameters update
10
developerb92dd482023-10-12 17:25:48 +080011BSS load update is unrelated with the above two reasons, and therefore is
12not a case to update beacon for 6 GHz co-location.
developerc8288192023-10-04 15:37:49 +080013Moreover, updating beacon for 6 GHz co-location when BSS load update
14makes hostapd set beacon too frequently in a multiple BSSes case.
15
developerb92dd482023-10-12 17:25:48 +080016Besides, 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,
developerc8288192023-10-04 15:37:49 +080020and uses the function duriong BSS load update.
developerb92dd482023-10-12 17:25:48 +080021Also it changes the condition check to make beacon update only for 6 GHz
22co-location.
developerc8288192023-10-04 15:37:49 +080023
24Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com>
developerb92dd482023-10-12 17:25:48 +080025Signed-off-by: Money Wang <money.wang@mediatek.com>
developerc8288192023-10-04 15:37:49 +080026---
developerb92dd482023-10-12 17:25:48 +080027 src/ap/beacon.c | 8 +++++++-
developerc8288192023-10-04 15:37:49 +080028 src/ap/beacon.h | 1 +
29 src/ap/bss_load.c | 2 +-
developerb92dd482023-10-12 17:25:48 +080030 3 files changed, 9 insertions(+), 2 deletions(-)
developerc8288192023-10-04 15:37:49 +080031
32diff --git a/src/ap/beacon.c b/src/ap/beacon.c
developerb92dd482023-10-12 17:25:48 +080033index d160675..684bdc0 100644
developerc8288192023-10-04 15:37:49 +080034--- a/src/ap/beacon.c
35+++ b/src/ap/beacon.c
36@@ -2216,6 +2216,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;
developerb92dd482023-10-12 17:25:48 +080049@@ -2246,7 +2252,7 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
50 mld_ap = true;
51 #endif /* CONFIG_IEEE80211BE */
52
53- if (is_6g == is_6ghz_op_class(other->conf->op_class) &&
54+ if ((!is_6g || is_6ghz_op_class(other->conf->op_class)) &&
55 !mld_ap)
56 continue;
57
developerc8288192023-10-04 15:37:49 +080058diff --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 725d3cd..e9baafc 100644
72--- a/src/ap/bss_load.c
73+++ b/src/ap/bss_load.c
74@@ -55,7 +55,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 (get_bss_load_update_timeout(hapd, &sec, &usec) < 0)
82 return;
83--
842.25.1
85