summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_iwm.c
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2023-11-06 08:34:42 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2023-11-06 08:34:42 +0000
commit2a70928f73c730f91ffa17255731e5fa41c084fe (patch)
tree3fd8e345f3658fae794a0ab4a4ba6414b02791d5 /sys/dev/pci/if_iwm.c
parent1279494a1d294f3cac7773dd60958874909c9999 (diff)
avoid using MCS9 in iwm(4) Tx rate selection if 40 MHz is disabled
MCS9 is not valid on 20HMz so we must not use it in 20MHz-only mode. Fixes firmware panic 0x00002078, which indicates the driver sets a rate with a bad number of antennas, bad number of Tx streams, or bad bandwidth. Observed by dlg@ with the miktrotik AP for which iwm(4) firmware requires our 20MHz-only workaround to interoperate in 11ac mode. ok dlg@
Diffstat (limited to 'sys/dev/pci/if_iwm.c')
-rw-r--r--sys/dev/pci/if_iwm.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index 2c107ba4b55..fbab94fecb8 100644
--- a/sys/dev/pci/if_iwm.c
+++ b/sys/dev/pci/if_iwm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwm.c,v 1.411 2023/10/21 06:41:26 stsp Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.412 2023/11/06 08:34:41 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -9294,8 +9294,17 @@ iwm_set_rate_table_vht(struct iwm_node *in, struct iwm_lq_cmd *lqcmd)
if (i < 2 && in->in_phyctxt->vht_chan_width >=
IEEE80211_VHTOP0_CHAN_WIDTH_80)
tab |= IWM_RATE_MCS_CHAN_WIDTH_80;
- else
+ else if (in->in_phyctxt->sco ==
+ IEEE80211_HTOP0_SCO_SCA ||
+ in->in_phyctxt->sco ==
+ IEEE80211_HTOP0_SCO_SCB)
tab |= IWM_RATE_MCS_CHAN_WIDTH_40;
+ else {
+ /* no 40 MHz, fall back on MCS 8 */
+ tab &= ~IWM_RATE_VHT_MCS_RATE_CODE_MSK;
+ tab |= 8;
+ }
+
tab |= IWM_RATE_MCS_RTS_REQUIRED_MSK;
if (i < 4) {
if (ieee80211_ra_vht_use_sgi(ni))