diff options
author | Felix Fietkau <nbd@nbd.name> | 2021-11-22 13:04:03 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-11-23 18:30:04 +0100 |
commit | c20f4e24bd12f8bb4a6d35f0199ae1695469859d (patch) | |
tree | 18a919d86b960a7fff751068986b306e26e15932 /package/kernel | |
parent | 91ba22e3a42f9db904e599161c2316f8e8cb5091 (diff) | |
download | upstream-c20f4e24bd12f8bb4a6d35f0199ae1695469859d.tar.gz upstream-c20f4e24bd12f8bb4a6d35f0199ae1695469859d.tar.bz2 upstream-c20f4e24bd12f8bb4a6d35f0199ae1695469859d.zip |
mac80211: set beamformer/beamformee number of antennas in VHT caps
Without this, beamforming is probably not working
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit e2c4998f6dca7d9b74a8b01762040ff2c5e38fd7)
Diffstat (limited to 'package/kernel')
-rw-r--r-- | package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 4828951bab..d69667bf8c 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -53,6 +53,8 @@ drv_mac80211_init_device_config() { he_spr_sr_control \ he_twt_required config_add_int \ + beamformer_antennas \ + beamformee_antennas \ vht_max_a_mpdu_len_exp \ vht_max_mpdu \ vht_link_adapt \ @@ -294,6 +296,8 @@ mac80211_hostapd_setup_base() { mu_beamformee:1 \ vht_txop_ps:1 \ htc_vht:1 \ + beamformee_antennas:4 \ + beamformer_antennas:4 \ rx_antenna_pattern:1 \ tx_antenna_pattern:1 \ vht_max_a_mpdu_len_exp:7 \ @@ -334,6 +338,18 @@ mac80211_hostapd_setup_base() { RX-STBC-123:0x700:0x300:1 \ RX-STBC-1234:0x700:0x400:1 \ + [ "$(($vht_cap & 0x800))" -gt 0 -a "$su_beamformer" -gt 0 ] && { + cap_ant="$(( ( ($vht_cap >> 16) & 3 ) + 1 ))" + [ "$cap_ant" -gt "$beamformer_antennas" ] && cap_ant="$beamformer_antennas" + [ "$cap_ant" -gt 1 ] && vht_capab="$vht_capab[SOUNDING-DIMENSION-$cap_ant]" + } + + [ "$(($vht_cap & 0x1000))" -gt 0 -a "$su_beamformee" -gt 0 ] && { + cap_ant="$(( ( ($vht_cap >> 13) & 3 ) + 1 ))" + [ "$cap_ant" -gt "$beamformee_antennas" ] && cap_ant="$beamformee_antennas" + [ "$cap_ant" -gt 1 ] && vht_capab="$vht_capab[BF-ANTENNA-$cap_ant]" + } + # supported Channel widths vht160_hw=0 [ "$(($vht_cap & 12))" -eq 4 -a 1 -le "$vht160" ] && \ |