]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
RNR: Update Beacon frames for 6 GHz colocation
authorAloka Dixit <alokad@codeaurora.org>
Tue, 27 Jul 2021 23:42:24 +0000 (16:42 -0700)
committerJouni Malinen <j@w1.fi>
Tue, 9 Nov 2021 15:50:02 +0000 (17:50 +0200)
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 <alokad@codeaurora.org>
src/ap/beacon.c

index a314d0cc08c7e778728d0437e8e4d0ecc46dae0b..eeb675aa456f0917ae8984c3adc669b33f84ef1a 100644 (file)
@@ -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;