summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorcsapuntz <csapuntz@openbsd.org>1999-10-29 22:00:31 +0000
committercsapuntz <csapuntz@openbsd.org>1999-10-29 22:00:31 +0000
commit9b25e7c1bcc46dc4c0371a603031493fa76dbff7 (patch)
treee9a7b819b91c8d32a0edb0322f05e1b51c08d94f /sys
parentAdded diagnostic: "length 0 transfer in data phase" (diff)
downloadwireguard-openbsd-9b25e7c1bcc46dc4c0371a603031493fa76dbff7.tar.xz
wireguard-openbsd-9b25e7c1bcc46dc4c0371a603031493fa76dbff7.zip
NetBSD take note:
Use xfer->c_bcount and not sc_xfer->datalen when passing our buffer limit to the device. In the case of SENSE, we were sending 0 as our buffer limit, potentially confusing some devices. Cap the bytes/interrupt at 65534, which prevents odd size transfers. Odd size transfers, while not inherently evil, are kind of weird through a 16-bit wide interface.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/atapiscsi/atapiscsi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c
index 74370f81976..73813d6595c 100644
--- a/sys/dev/atapiscsi/atapiscsi.c
+++ b/sys/dev/atapiscsi/atapiscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapiscsi.c,v 1.16 1999/10/29 17:12:23 csapuntz Exp $ */
+/* $OpenBSD: atapiscsi.c,v 1.17 1999/10/29 22:00:31 csapuntz Exp $ */
/*
* This code is derived from code with the copyright below.
@@ -563,7 +563,7 @@ wdc_atapi_start(chp, xfer)
*/
wdccommand(chp, xfer->drive, ATAPI_PKT_CMD,
- sc_xfer->datalen <= 0xffff ? sc_xfer->datalen : 0xffff,
+ xfer->c_bcount <= 0xfffe ? xfer->c_bcount : 0xfffe,
0, 0, 0,
(xfer->c_flags & C_DMA) ? ATAPI_PKT_CMD_FTRE_DMA : 0);