]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
BSS coloring: Handle the collision and CCA events coming from the kernel
authorJohn Crispin <john@phrozen.org>
Mon, 21 Mar 2022 11:10:34 +0000 (12:10 +0100)
committerJouni Malinen <j@w1.fi>
Sat, 16 Apr 2022 14:30:30 +0000 (17:30 +0300)
This commit activates the functionality of the previous commits by
handling the actual events that will trigger the CCA process.

Tested-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
src/ap/drv_callbacks.c

index 54d0d517064e9fb72310e4eabece04ed3382f0f2..beba2fd064af61affeebaf0b8c88d3f54314bd0e 100644 (file)
@@ -2078,6 +2078,32 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                        data->wds_sta_interface.ifname,
                        data->wds_sta_interface.sta_addr);
                break;
+#ifdef CONFIG_IEEE80211AX
+       case EVENT_BSS_COLOR_COLLISION:
+               /* The BSS color is shared amongst all BBSs on a specific phy.
+                * Therefore we always start the color change on the primary
+                * BSS. */
+               wpa_printf(MSG_DEBUG, "BSS color collision on %s",
+                          hapd->conf->iface);
+               hostapd_switch_color(hapd->iface->bss[0],
+                                    data->bss_color_collision.bitmap);
+               break;
+       case EVENT_CCA_STARTED_NOTIFY:
+               wpa_printf(MSG_DEBUG, "CCA started on on %s",
+                          hapd->conf->iface);
+               break;
+       case EVENT_CCA_ABORTED_NOTIFY:
+               wpa_printf(MSG_DEBUG, "CCA aborted on on %s",
+                          hapd->conf->iface);
+               hostapd_cleanup_cca_params(hapd);
+               break;
+       case EVENT_CCA_NOTIFY:
+               wpa_printf(MSG_DEBUG, "CCA finished on on %s",
+                          hapd->conf->iface);
+               hapd->iface->conf->he_op.he_bss_color = hapd->cca_color;
+               hostapd_cleanup_cca_params(hapd);
+               break;
+#endif /* CONFIG_IEEE80211AX */
        default:
                wpa_printf(MSG_DEBUG, "Unknown event %d", event);
                break;