BSS coloring: Handling of collision events and triggering CCA

Add the core code for handling BSS color collision events and triggering
CCA inside the kernel. The caller of hostapd_switch_color() will be
added in the following commits.

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:30 +01:00 committed by Jouni Malinen
parent 2f336ca580
commit 654d2395dd
5 changed files with 205 additions and 0 deletions

View file

@ -295,6 +295,17 @@ struct hostapd_data {
unsigned int cs_c_off_ecsa_beacon;
unsigned int cs_c_off_ecsa_proberesp;
#ifdef CONFIG_IEEE80211AX
bool cca_in_progress;
u8 cca_count;
u8 cca_color;
unsigned int cca_c_off_beacon;
unsigned int cca_c_off_proberesp;
struct os_reltime first_color_collision;
struct os_reltime last_color_collision;
u64 color_collision_bitmap;
#endif /* CONFIG_IEEE80211AX */
#ifdef CONFIG_P2P
struct p2p_data *p2p;
struct p2p_group *p2p_group;
@ -664,6 +675,9 @@ void hostapd_periodic_iface(struct hostapd_iface *iface);
int hostapd_owe_trans_get_info(struct hostapd_data *hapd);
void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx);
void hostapd_switch_color(struct hostapd_data *hapd, u64 bitmap);
void hostapd_cleanup_cca_params(struct hostapd_data *hapd);
/* utils.c */
int hostapd_register_probereq_cb(struct hostapd_data *hapd,
int (*cb)(void *ctx, const u8 *sa,