diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2020-06-22 07:25:50 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2020-06-22 07:25:50 +0000 |
commit | fed9c138ff16fbe9efc2d7780d734b29147eabb1 (patch) | |
tree | b43880cea0c61ae57da71576557f1b43ac728d2e | |
parent | 4700792ffbb3e5ec0bf645103c8b7258b6da35ff (diff) |
Fix unconditional write to v1.scan_priority in iwx(4) scan command.
The data structure for the scan command contains a union which represents
various versions of the scan command. The driver wrote to the scan_priority
field in version 1 data regardless of the scan command version actually
expected by firmware.
Perform that write only for scan command version 1, as intended.
Testing suggests that this prevents occasional firmware errors during scans.
-rw-r--r-- | sys/dev/pci/if_iwx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c index d138d9c79b3..961a2bf7428 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.30 2020/06/22 07:15:28 stsp Exp $ */ +/* $OpenBSD: if_iwx.c,v 1.31 2020/06/22 07:25:49 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh <info@genua.de> @@ -5266,6 +5266,8 @@ iwx_umac_scan(struct iwx_softc *sc, int bgscan) req->v1.passive_dwell = 110; req->v1.fragmented_dwell = 44; req->v1.extended_dwell = 90; + + req->v1.scan_priority = htole32(IWX_SCAN_PRIORITY_HIGH); } if (bgscan) { @@ -5284,7 +5286,6 @@ iwx_umac_scan(struct iwx_softc *sc, int bgscan) } } - req->v1.scan_priority = htole32(IWX_SCAN_PRIORITY_HIGH); req->ooc_priority = htole32(IWX_SCAN_PRIORITY_HIGH); cmd_data = iwx_get_scan_req_umac_data(sc, req); |