diff --git a/src/drivers/driver.h b/src/drivers/driver.h index dd2f62bed..31bf1407c 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -5179,6 +5179,26 @@ enum wpa_event_type { * non-zero wait time and that has not been explicitly cancelled. */ EVENT_TX_WAIT_EXPIRE, + + /** + * EVENT_BSS_COLOR_COLLISION - Notification of a BSS color collision + */ + EVENT_BSS_COLOR_COLLISION, + + /** + * EVENT_CCA_STARTED_NOTIFY - Notification that CCA has started + */ + EVENT_CCA_STARTED_NOTIFY, + + /** + * EVENT_CCA_ABORTED_NOTIFY - Notification that CCA has aborted + */ + EVENT_CCA_ABORTED_NOTIFY, + + /** + * EVENT_CCA_NOTIFY - Notification that CCA has completed + */ + EVENT_CCA_NOTIFY, }; @@ -6071,6 +6091,13 @@ union wpa_event_data { struct unprot_beacon { const u8 *sa; } unprot_beacon; + + /** + * struct bss_color_collision - Data for EVENT_BSS_COLOR_COLLISION + */ + struct bss_color_collision { + u64 bitmap; + } bss_color_collision; }; /** diff --git a/src/drivers/driver_common.c b/src/drivers/driver_common.c index 741521c67..8db786168 100644 --- a/src/drivers/driver_common.c +++ b/src/drivers/driver_common.c @@ -91,6 +91,10 @@ const char * event_to_string(enum wpa_event_type event) E2S(UPDATE_DH); E2S(UNPROT_BEACON); E2S(TX_WAIT_EXPIRE); + E2S(BSS_COLOR_COLLISION); + E2S(CCA_STARTED_NOTIFY); + E2S(CCA_ABORTED_NOTIFY); + E2S(CCA_NOTIFY); } return "UNKNOWN"; diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c index 085acb85a..22fb4f1e4 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c @@ -2911,6 +2911,58 @@ static void nl80211_assoc_comeback(struct wpa_driver_nl80211_data *drv, } +#ifdef CONFIG_IEEE80211AX + +static void nl80211_obss_color_collision(struct wpa_driver_nl80211_data *drv, + struct nlattr *tb[]) +{ + union wpa_event_data data; + + if (!tb[NL80211_ATTR_OBSS_COLOR_BITMAP]) + return; + + os_memset(&data, 0, sizeof(data)); + data.bss_color_collision.bitmap = + nla_get_u64(tb[NL80211_ATTR_OBSS_COLOR_BITMAP]); + + wpa_printf(MSG_DEBUG, "nl80211: BSS color collision - bitmap %08lx", + data.bss_color_collision.bitmap); + wpa_supplicant_event(drv->ctx, EVENT_BSS_COLOR_COLLISION, &data); +} + + +static void +nl80211_color_change_announcement_started(struct wpa_driver_nl80211_data *drv) +{ + union wpa_event_data data = {}; + + wpa_printf(MSG_DEBUG, "nl80211: CCA started"); + wpa_supplicant_event(drv->ctx, EVENT_CCA_STARTED_NOTIFY, &data); +} + + +static void +nl80211_color_change_announcement_aborted(struct wpa_driver_nl80211_data *drv) +{ + union wpa_event_data data = {}; + + wpa_printf(MSG_DEBUG, "nl80211: CCA aborted"); + wpa_supplicant_event(drv->ctx, EVENT_CCA_ABORTED_NOTIFY, &data); +} + + +static void +nl80211_color_change_announcement_completed(struct wpa_driver_nl80211_data *drv) +{ + union wpa_event_data data = {}; + + wpa_printf(MSG_DEBUG, "nl80211: CCA completed"); + wpa_supplicant_event(drv->ctx, EVENT_CCA_NOTIFY, &data); +} + +#endif /* CONFIG_IEEE80211AX */ + + static void do_process_drv_event(struct i802_bss *bss, int cmd, struct nlattr **tb) { @@ -3164,6 +3216,20 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, nl80211_assoc_comeback(drv, tb[NL80211_ATTR_MAC], tb[NL80211_ATTR_TIMEOUT]); break; +#ifdef CONFIG_IEEE80211AX + case NL80211_CMD_OBSS_COLOR_COLLISION: + nl80211_obss_color_collision(drv, tb); + break; + case NL80211_CMD_COLOR_CHANGE_STARTED: + nl80211_color_change_announcement_started(drv); + break; + case NL80211_CMD_COLOR_CHANGE_ABORTED: + nl80211_color_change_announcement_aborted(drv); + break; + case NL80211_CMD_COLOR_CHANGE_COMPLETED: + nl80211_color_change_announcement_completed(drv); + break; +#endif /* CONFIG_IEEE80211AX */ default: wpa_dbg(drv->ctx, MSG_DEBUG, "nl80211: Ignored unknown event " "(cmd=%d)", cmd);