Skip to content

Commit

Permalink
mac80211: fix issues in HE capabilities
Browse files Browse the repository at this point in the history
Enable HE SU beamformee by default
Fix spatial reuse configuration:
- he_spr_sr_control is not a bool for enabling, it contains multiple bits
  which disable features that should be disabled by default
- one of the features (PSR) can be enabled through he_spr_psr_enabled
- add option to disable bss color / spatial reuse

Signed-off-by: Felix Fietkau <[email protected]>
(cherry picked from commit 590eaaeed59a9eb6637a1480587fc410de182523)
  • Loading branch information
nbd168 authored and 1715173329 committed Oct 13, 2022
1 parent 55fddb6 commit 86c7db3
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ drv_mac80211_init_device_config() {
rx_antenna_pattern \
tx_antenna_pattern \
he_spr_sr_control \
he_spr_psr_enabled \
he_bss_color_enabled \
he_twt_required
config_add_int \
beamformer_antennas \
Expand Down Expand Up @@ -414,12 +416,14 @@ mac80211_hostapd_setup_base() {
if [ "$enable_ax" != "0" ]; then
json_get_vars \
he_su_beamformer:1 \
he_su_beamformee:0 \
he_su_beamformee:1 \
he_mu_beamformer:1 \
he_twt_required:0 \
he_spr_sr_control:0 \
he_spr_non_srg_obss_pd_max_offset:1 \
he_bss_color
he_spr_sr_control:3 \
he_spr_psr_enabled:0 \
he_spr_non_srg_obss_pd_max_offset:0 \
he_bss_color:128 \
he_bss_color_enabled:1

he_phy_cap=$(iw phy "$phy" info | sed -n '/HE Iftypes: AP/,$p' | awk -F "[()]" '/HE PHY Capabilities/ { print $2 }' | head -1)
he_phy_cap=${he_phy_cap:2}
Expand All @@ -432,17 +436,25 @@ mac80211_hostapd_setup_base() {
append base_cfg "he_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N"
}

set_default he_bss_color 128
append base_cfg "he_bss_color=$he_bss_color" "$N"

mac80211_add_he_capabilities \
mac8q0211_add_he_capabilities \
he_su_beamformer:${he_phy_cap:6:2}:0x80:$he_su_beamformer \
he_su_beamformee:${he_phy_cap:8:2}:0x1:$he_su_beamformee \
he_mu_beamformer:${he_phy_cap:8:2}:0x2:$he_mu_beamformer \
he_spr_sr_control:${he_phy_cap:14:2}:0x1:$he_spr_sr_control \
he_spr_psr_enabled:${he_phy_cap:14:2}:0x1:$he_spr_psr_enabled \
he_twt_required:${he_mac_cap:0:2}:0x6:$he_twt_required

[ "$he_spr_sr_control" -gt 0 ] && append base_cfg "he_spr_non_srg_obss_pd_max_offset=$he_spr_non_srg_obss_pd_max_offset" "$N"
if [ "$he_bss_color_enabled" -gt 0 ]; then
append base_cfg "he_bss_color=$he_bss_color" "$N"
[ "$he_spr_non_srg_obss_pd_max_offset" -gt 0 ] && { \
append base_cfg "he_spr_non_srg_obss_pd_max_offset=$he_spr_non_srg_obss_pd_max_offset" "$N"
he_spr_sr_control=$((he_spr_sr_control | (1 << 2)))
}
[ "$he_spr_psr_enabled" -gt 0 ] || he_spr_sr_control=$((he_spr_sr_control | (1 << 0)))
append base_cfg "he_spr_sr_control=$he_spr_sr_control" "$N"
else
append base_cfg "he_bss_color_disabled=1" "$N"
fi


append base_cfg "he_default_pe_duration=4" "$N"
append base_cfg "he_rts_threshold=1023" "$N"
Expand Down

0 comments on commit 86c7db3

Please sign in to comment.