From 121b2ec38b47d3636cf3b6fa74dac278902d7b7b Mon Sep 17 00:00:00 2001 From: stsp Date: Thu, 12 May 2022 21:33:31 +0000 Subject: [PATCH] Fix setting of HT/VHT bits in rate flags of the iwx(4) Tx command. Firmware can panic if rate flags ask for HT frames in VHT mode. Version -67 seems to be ignoring what we set here and works either way. But -66 and below were unhappy on my AX210 device. Found while investing a bug report by Guilherme M. Schroeder Fix tested on AX210 and AX200. --- sys/dev/pci/if_iwx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c index 31cfac05701..451df3cbf2b 100644 --- a/sys/dev/pci/if_iwx.c +++ b/sys/dev/pci/if_iwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwx.c,v 1.145 2022/05/12 11:37:57 stsp Exp $ */ +/* $OpenBSD: if_iwx.c,v 1.146 2022/05/12 21:33:31 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -5883,7 +5883,10 @@ iwx_tx_fill_cmd(struct iwx_softc *sc, struct iwx_node *in, else if (IEEE80211_CHAN_40MHZ_ALLOWED(ni->ni_chan) && ieee80211_node_supports_ht_chan40(ni)) sco = (ni->ni_htop0 & IEEE80211_HTOP0_SCO_MASK); - rate_flags |= IWX_RATE_MCS_HT_MSK; + if (ni->ni_flags & IEEE80211_NODE_VHT) + rate_flags |= IWX_RATE_MCS_VHT_MSK; + else + rate_flags |= IWX_RATE_MCS_HT_MSK; if (vht_chan_width == IEEE80211_VHTOP0_CHAN_WIDTH_80 && in->in_phyctxt != NULL && in->in_phyctxt->vht_chan_width == vht_chan_width) { -- 2.20.1