Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: sys/iwx: add VHT beamformer and beamformee advertisement
To:
tech@openbsd.org
Date:
Sat, 20 Jun 2026 19:12:55 +0200

Download raw body.

Thread
On Sat, Jun 20, 2026 at 04:57:02PM +0200, Kirill A. Korinsky wrote:
> tech@,
> 
> This is one of two fogotten hunk from my 160MHZ large diff for iwx0.
> 
> I run it on my laptop for... quite a few months, against different networks.
> Works fine.
> 
> The idea is following iwlwifi and add VHT beamforming capability
> advertisement. Advertise VHT SU beamformer when firmware reports beamformer
> support and the LQ SS_PARAMS API. Advertise VHT SU and MU beamformee
> capabilities, using the same with Linux hardcoded beamformee STS value of 3.
> 
> Ok?

This diff doesn't entirely make sense to me. It is difficult to tell
whether this diff really has any effect on firmware behaviour. I would
not feel comfortable committing this without any evidence that it really
has the intended effect.

As far as I know, we do not have any indication of beamforming being
used when recording frames with tcpdump. Can we gather such information
from Tx interrupt status reports? Or are there any wifi monitoring tools,
perhaps specific to Linux, which provide information about this?

Something which makes your diff seem half-baked is that iwlwifi only
uses the TLV_API_LQ_SS_PARAMS flag on devices which do not have Tx
rate control support in firmware:

$ grep -lR LQ_SS_BFER_ALLOWED
iwlwifi/fw/api/rs.h
iwlwifi/mvm/rs.c
$

All AX200 and later devices do Tx rate control in firmware (see
iwlwifi/mvm/rs-fw.c), where this flag is never used.
So I see how checking this flag would make sense in iwm (pre-AX200).
But is there any reason for checking this flag in iwx?

Given this, do you know how firmware for AX200 and later knows whether
beamforming should be enabled? Is it maybe always enabled by default
when VHT is used and the peer supports it? Or would we need to pass
related instructions to firmware in iwx_rs_init()?

It might be worth asking in the #linux-wireless channel on Libera to
see if anybody there knows how AX200 firmware behaves internally with
respect to beamforming.

> 
> Index: sys/dev/pci/if_iwx.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/if_iwx.c,v
> diff -u -p -r1.228 if_iwx.c
> --- sys/dev/pci/if_iwx.c	2 Apr 2026 11:19:45 -0000	1.228
> +++ sys/dev/pci/if_iwx.c	2 Apr 2026 16:09:18 -0000
> @@ -3291,8 +3291,20 @@ iwx_setup_vht_rates(struct iwx_softc *sc
>  	ic->ic_vhtcaps &= ~(IEEE80211_VHTCAP_RX_ANT_PATTERN |
>  	    IEEE80211_VHTCAP_TX_ANT_PATTERN |
>  	    IEEE80211_VHTCAP_TX_STBC |
> -	    IEEE80211_VHTCAP_RX_STBC_SS_MASK);
> -	ic->ic_vhtcaps |= (1 << IEEE80211_VHTCAP_RX_STBC_SS_SHIFT);
> +	    IEEE80211_VHTCAP_RX_STBC_SS_MASK |
> +	    IEEE80211_VHTCAP_SU_BEAMFORMER |
> +	    IEEE80211_VHTCAP_SU_BEAMFORMEE |
> +	    IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK |
> +	    IEEE80211_VHTCAP_MU_BEAMFORMEE);
> +
> +	ic->ic_vhtcaps |= (1 << IEEE80211_VHTCAP_RX_STBC_SS_SHIFT) |
> +	    IEEE80211_VHTCAP_SU_BEAMFORMEE |
> +	    (3 << IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT) |
> +	    IEEE80211_VHTCAP_MU_BEAMFORMEE;
> +
> +	if (isset(sc->sc_enabled_capa, IWX_UCODE_TLV_CAPA_BEAMFORMER) &&
> +	    isset(sc->sc_ucode_api, IWX_UCODE_TLV_API_LQ_SS_PARAMS))
> +		ic->ic_vhtcaps |= IEEE80211_VHTCAP_SU_BEAMFORMER;
>  
>  	if (num_rx_ant == 1)
>  		ic->ic_vhtcaps |= IEEE80211_VHTCAP_RX_ANT_PATTERN;
> 
> -- 
> wbr, Kirill
> 
>