From: John Crispin Date: Mon, 21 Mar 2022 11:10:34 +0000 (+0100) Subject: BSS coloring: Handle the collision and CCA events coming from the kernel X-Git-Tag: hostap_2_11~2046 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33c4dd26cd11b5e17a3c8888389c4b3bc014285d;p=thirdparty%2Fhostap.git BSS coloring: Handle the collision and CCA events coming from the kernel This commit activates the functionality of the previous commits by handling the actual events that will trigger the CCA process. Tested-by: Peter Chiu Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: John Crispin Signed-off-by: Ryder Lee --- diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index 54d0d5170..beba2fd06 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -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;