[PATCH V4 1/6] bss coloring: add support for handling collision events and triggering CCA

Karthikeyan periyasamy periyasa at codeaurora.org
Tue Sep 1 00:52:18 EDT 2020


> +
> +static void
> +hostapd_switch_color_timeout_handler(void *eloop_data, void *user_ctx)
> +{
> +	struct hostapd_data *hapd = (struct hostapd_data *) eloop_data;
> +	struct cca_settings settings;
> +	struct os_time now;
> +	int i, r, b, ret;
> +
> +	if (os_get_time(&now))
> +		return;
> +
> +	/* check if there has been a recent collision */
> +	if (now.sec - hapd->last_color_collision.sec >= 10)
> +		return;
> +
> +	r = os_random() % HE_OPERATION_BSS_COLOR_MAX;
> +	for (i = 0; i < HE_OPERATION_BSS_COLOR_MAX; i++) {
> +		if (r && (hapd->color_collision_bitmap & (1 << r)) == 0)
> +			break;
> +		r = (r + 1) % HE_OPERATION_BSS_COLOR_MAX;
> +	}
> +	if (i == HE_OPERATION_BSS_COLOR_MAX) {
> +		/* there are no free colors so turn bss coloring off */
> +		wpa_printf(MSG_INFO, "no free colors left, turning of BSS 
> coloring");
> +		hapd->iface->conf->he_op.he_bss_color_disabled = 1;
> +		hapd->iface->conf->he_op.he_bss_color = 1;

Why don't we retain the previous color instead of going to the color "1" 
while disabled the bss color ?

Thanks,
Karthikeyan P.



More information about the Hostap mailing list