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 <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>
This commit is contained in:
John Crispin 2022-03-21 12:10:34 +01:00 committed by Jouni Malinen
parent 27b4cc712f
commit 33c4dd26cd

View 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;