summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Matthew <jmatthew@cvs.openbsd.org>2019-08-30 00:38:13 +0000
committerJonathan Matthew <jmatthew@cvs.openbsd.org>2019-08-30 00:38:13 +0000
commit52badb0be0f7d393b23f124c67b158098051a431 (patch)
tree407c70f985e8977fd559a22418a300da4041083e /sys/dev
parentec43aa56765ca32bf630c71989eecaab57b8424a (diff)
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
Diffstat (limited to 'sys/dev')
-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 */