diff mbox series

[6/6] bss_coloring: allow using a random starting color

Message ID 46fa29623e1fb485e9070ef9d066a57c2111bad0.1631091272.git.ryder.lee@mediatek.com
State Changes Requested
Headers show
Series [1/6] bss coloring: add support for handling collision events and triggering CCA | expand

Commit Message

Ryder Lee Sept. 8, 2021, 9:18 a.m. UTC
From: John Crispin <john@phrozen.org>

Enhance the possible values for he_bss_color. Anything greater than 63 will
make hostapd choose a random color.

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>
---
 hostapd/config_file.c | 7 +++++--
 hostapd/hostapd.conf  | 5 ++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

Comments

Jouni Malinen Nov. 3, 2021, 7:19 p.m. UTC | #1
On Wed, Sep 08, 2021 at 05:18:55PM +0800, Ryder Lee wrote:
> Enhance the possible values for he_bss_color. Anything greater than 63 will
> make hostapd choose a random color.

What's the use case for this? Isn't the initial BSS color supposed to be
selected based on what BSS colors are in use by neighboring OBSSs (see
IEEE Std 802.11ax-2021, 26.17.3.2)?

If that more complete implementation looking at neighboring OBSSs is not
added, would the automatic initialization to a random value be
sufficient for now?
https://w1.fi/cgit/hostap/commit/src?id=41ec97cd09486a6bda21f5f5b89e5242e6ade2a2

> -# he_bss_color: BSS color (1-63)
> +# he_bss_color:
> +# 0 = disable
> +# 1-63 = pre-defined color
> +# 64+ =	random color
>  #he_bss_color=1

Is it really expected to be possible to configure the BSS color to be
hardcoded to be disabled? In addition, that use of multiple different
values to indicate a random color feels quite strange.
Ryder Lee Nov. 4, 2021, 7:06 a.m. UTC | #2
On Wed, 2021-11-03 at 21:19 +0200, Jouni Malinen wrote:
> On Wed, Sep 08, 2021 at 05:18:55PM +0800, Ryder Lee wrote:
> > Enhance the possible values for he_bss_color. Anything greater than
> > 63 will
> > make hostapd choose a random color.
> 
> What's the use case for this? Isn't the initial BSS color supposed to
> be
> selected based on what BSS colors are in use by neighboring OBSSs
> (see
> IEEE Std 802.11ax-2021, 26.17.3.2)?
> 
> If that more complete implementation looking at neighboring OBSSs is
> not
> added, would the automatic initialization to a random value be
> sufficient for now?
> 
https://w1.fi/cgit/hostap/commit/src?id=41ec97cd09486a6bda21f5f5b89e5242e6ade2a2
> 
> > -# he_bss_color: BSS color (1-63)
> > +# he_bss_color:
> > +# 0 = disable
> > +# 1-63 = pre-defined color
> > +# 64+ =	random color
> >  #he_bss_color=1
> 
> Is it really expected to be possible to configure the BSS color to be
> hardcoded to be disabled? In addition, that use of multiple different
> values to indicate a random color feels quite strange.
> 

Agree. I will drop this one.
diff mbox series

Patch

diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 7b03edf36..70d8809c7 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -3503,8 +3503,11 @@  static int hostapd_config_fill(struct hostapd_config *conf,
 	} else if (os_strcmp(buf, "he_mu_beamformer") == 0) {
 		conf->he_phy_capab.he_mu_beamformer = atoi(pos);
 	} else if (os_strcmp(buf, "he_bss_color") == 0) {
-		conf->he_op.he_bss_color = atoi(pos) & 0x3f;
-		conf->he_op.he_bss_color_disabled = 0;
+		conf->he_op.he_bss_color = atoi(pos);
+		if (conf->he_op.he_bss_color > 63)
+			conf->he_op.he_bss_color = (os_random() % 63) + 1;
+		if (conf->he_op.he_bss_color)
+			conf->he_op.he_bss_color_disabled = 0;
 	} else if (os_strcmp(buf, "he_bss_color_partial") == 0) {
 		conf->he_op.he_bss_color_partial = atoi(pos);
 	} else if (os_strcmp(buf, "he_default_pe_duration") == 0) {
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index dbdd3d7fb..88a2b9b83 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -816,7 +816,10 @@  wmm_ac_vo_acm=0
 # 1 = supported
 #he_mu_beamformer=1
 
-# he_bss_color: BSS color (1-63)
+# he_bss_color:
+# 0 = disable
+# 1-63 = pre-defined color
+# 64+ =	random color
 #he_bss_color=1
 
 # he_bss_color_partial: BSS color AID equation