From f17f7ca4e07c5aaf96d4d7c08085c5f36eed9d61 Mon Sep 17 00:00:00 2001 From: Aloka Dixit Date: Tue, 27 Jul 2021 16:42:24 -0700 Subject: [PATCH] RNR: Update Beacon frames for 6 GHz colocation Update 2.4/5 GHz Beacon frames every time Beacon frames for co-located 6 GHz AP(s) are set. This is required for 6 GHz out-of-band discovery so that lower band Beacon frames will include RNR element with 6 GHz AP information irrespective of the AP bring-up order. Similarly, RNR is included in FILS Discovery frames by default in 6 GHz-only mode, updating the Beacon frames will remove it when co-located 2.4/5 GHz interfaces are brought up. This change also ensures that the changes in 6 GHz AP configuration such as new channel and bandwidth get reflected in the lower bands Beacon frames. Signed-off-by: Aloka Dixit --- src/ap/beacon.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index a314d0cc0..eeb675aa4 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -1751,7 +1751,7 @@ void ieee802_11_free_ap_params(struct wpa_driver_ap_params *params) } -int ieee802_11_set_beacon(struct hostapd_data *hapd) +static int __ieee802_11_set_beacon(struct hostapd_data *hapd) { struct wpa_driver_ap_params params; struct hostapd_freq_params freq; @@ -1840,6 +1840,42 @@ fail: } +int ieee802_11_set_beacon(struct hostapd_data *hapd) +{ + struct hostapd_iface *iface = hapd->iface; + int ret; + size_t i, j; + bool is_6g; + + ret = __ieee802_11_set_beacon(hapd); + if (ret != 0) + return ret; + + if (!iface->interfaces || iface->interfaces->count <= 1) + return 0; + + /* Update Beacon frames in case of 6 GHz colocation */ + is_6g = is_6ghz_op_class(iface->conf->op_class); + for (j = 0; j < iface->interfaces->count; j++) { + struct hostapd_iface *colocated; + + colocated = iface->interfaces->iface[j]; + if (colocated == iface || !colocated || !colocated->conf) + continue; + + if (is_6g == is_6ghz_op_class(colocated->conf->op_class)) + continue; + + for (i = 0; i < colocated->num_bss; i++) { + if (colocated->bss[i] && colocated->bss[i]->started) + __ieee802_11_set_beacon(colocated->bss[i]); + } + } + + return 0; +} + + int ieee802_11_set_beacons(struct hostapd_iface *iface) { size_t i;