Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: sys/iwx: avoid unconditional RX antenna pattern
To:
tech@openbsd.org
Date:
Thu, 2 Apr 2026 09:14:46 +0200

Download raw body.

Thread
On Thu, Apr 02, 2026 at 12:39:32AM +0200, Kirill A. Korinsky wrote:
> tech@,
> 
> Here the next small bit of my iwx rework.
> 
> I follow iwlwifi and advertise RX antenna pattern only when RX is
> effectively 1x1: there is one usable RX antenna, or MIMO is disabled.
> 
> OK?

By itself, I believe this change won't have any effect. As far as
I understand the antenna pattern is related to beamforming.

Is this change prepraring us for beamforming support on the Rx side,
i.e. the AP will be able to use beamforming when sending us data?

What else will be needed for this?
 
> Index: sys/dev/pci/if_iwx.c
> ===================================================================
> RCS file: /home/cvs/src/sys/dev/pci/if_iwx.c,v
> diff -u -p -r1.227 if_iwx.c
> --- sys/dev/pci/if_iwx.c	1 Apr 2026 02:29:37 -0000	1.227
> +++ sys/dev/pci/if_iwx.c	1 Apr 2026 21:55:11 -0000
> @@ -3265,6 +3265,15 @@ iwx_setup_vht_rates(struct iwx_softc *sc
>  	struct ieee80211com *ic = &sc->sc_ic;
>  	uint8_t rx_ant = iwx_fw_valid_rx_ant(sc);
>  	int n;
> +	int num_rx_ant;
> +
> +	num_rx_ant = !!(rx_ant & IWX_ANT_A) + !!(rx_ant & IWX_ANT_B) +
> +	    !!(rx_ant & IWX_ANT_C);
> +
> +	ic->ic_vhtcaps &= ~IEEE80211_VHTCAP_RX_ANT_PATTERN;
> +
> +	if (sc->sc_nvm.sku_cap_mimo_disable || num_rx_ant == 1)
> +		ic->ic_vhtcaps |= IEEE80211_VHTCAP_RX_ANT_PATTERN;
>  
>  	ic->ic_vht_rxmcs = (IEEE80211_VHT_MCS_0_9 <<
>  	    IEEE80211_VHT_MCS_FOR_SS_SHIFT(1));
> @@ -12475,7 +12484,7 @@ iwx_attach(struct device *parent, struct
>  	    (IEEE80211_VHTCAP_CHAN_WIDTH_160 <<
>  		IEEE80211_VHTCAP_CHAN_WIDTH_SHIFT) |
>  	    IEEE80211_VHTCAP_SGI80 | IEEE80211_VHTCAP_SGI160 |
> -	    IEEE80211_VHTCAP_RX_ANT_PATTERN | IEEE80211_VHTCAP_TX_ANT_PATTERN;
> +	    IEEE80211_VHTCAP_TX_ANT_PATTERN;
>  
>  	ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a;
>  	ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b;
> 
>