Skip to content

Commit aeaa099

Browse files
robimarkohzyitc
authored andcommitted
mac80211: add random BSS color setting
Using BSS coloring is one way of improving performance on 802.11ax radios, currently its only enabled by users adding he_bss_color to their wireless UCI config. This made sense as one could easily get BSS color collision as BSS color range is 1-63. Hostapd now has a way of dealing with BSS color collisions so we can just assign a integer in the 1-63 range randomly if one is not set by users. Signed-off-by: Robert Marko <robimarko@gmail.com>
1 parent 6cb8f86 commit aeaa099

File tree

1 file changed

+10
-1
lines changed
  • package/kernel/mac80211/files/lib/netifd/wireless

1 file changed

+10
-1
lines changed

package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,16 @@ mac80211_hostapd_setup_base() {
420420
he_mac_cap=${he_mac_cap:2}
421421

422422
append base_cfg "ieee80211ax=1" "$N"
423-
[ -n "$he_bss_color" ] && append base_cfg "he_bss_color=$he_bss_color" "$N"
423+
424+
if [ -n "$he_bss_color" ]; then
425+
append base_cfg "he_bss_color=$he_bss_color" "$N"
426+
else
427+
he_bss_color=$(head -1 /dev/urandom | tr -dc '0-9' | head -c2)
428+
he_bss_color=$(($he_bss_color % 63))
429+
he_bss_color=$(($he_bss_color + 1))
430+
append base_cfg "he_bss_color=$he_bss_color" "$N"
431+
fi
432+
424433
[ "$hwmode" = "a" ] && {
425434
append base_cfg "he_oper_chwidth=$vht_oper_chwidth" "$N"
426435
append base_cfg "he_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N"

0 commit comments

Comments
 (0)