summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmatthew <jmatthew@openbsd.org>2019-08-30 00:38:12 +0000
committerjmatthew <jmatthew@openbsd.org>2019-08-30 00:38:12 +0000
commit6bda4fcd64d8fce23994c75954619270d8825c22 (patch)
tree9de554e9545ebeef9f99e6666958f65227b8cd16
parentsync (diff)
downloadwireguard-openbsd-6bda4fcd64d8fce23994c75954619270d8825c22.tar.xz
wireguard-openbsd-6bda4fcd64d8fce23994c75954619270d8825c22.zip
On SAS3 and newer controllers (using the IEEE sgl layout), the chain offset
field is in units of 16 bytes, not 4, fixing some but not all problems reported by Kor son of Rynar. ok dlg@, who points out this is exactly the same fix as r1.10 of mfii
-rw-r--r--sys/dev/pci/mpii.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c
index 7d358f2bc1d..b15e8fbb3d4 100644
--- a/sys/dev/pci/mpii.c
+++ b/sys/dev/pci/mpii.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpii.c,v 1.119 2019/08/20 23:55:41 krw Exp $ */
+/* $OpenBSD: mpii.c,v 1.120 2019/08/30 00:38:12 jmatthew Exp $ */
/*
* Copyright (c) 2010, 2012 Mike Belopuhov
* Copyright (c) 2009 James Giannoules
@@ -781,7 +781,8 @@ mpii_load_xs_sas3(struct mpii_ccb *ccb)
if (nsge == csge) {
nsge++;
/* offset to the chain sge from the beginning */
- io->chain_offset = ((caddr_t)csge - (caddr_t)io) / 4;
+ io->chain_offset = ((caddr_t)csge - (caddr_t)io) /
+ sizeof(*sge);
csge->sg_flags = MPII_IEEE_SGE_CHAIN_ELEMENT |
MPII_IEEE_SGE_ADDR_SYSTEM;
/* address of the next sge */