summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2020-06-22 07:25:49 +0000
committerstsp <stsp@openbsd.org>2020-06-22 07:25:49 +0000
commitade8f01da37c6471ea5d3c8d971f7913eebf22ea (patch)
tree8e3eb87e7d7cb773ef4238447b29d7b3201ed8bf
parentFix length specification for 2GHz band IE data in iwx(4) probe request (diff)
downloadwireguard-openbsd-ade8f01da37c6471ea5d3c8d971f7913eebf22ea.tar.xz
wireguard-openbsd-ade8f01da37c6471ea5d3c8d971f7913eebf22ea.zip
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.c5
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);