summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2004-06-12 22:22:26 +0000
committerkrw <krw@openbsd.org>2004-06-12 22:22:26 +0000
commit7f0bff625de74470cd192bb5593c0955af8f2d9d (patch)
tree9f5fbacb1e1e12367257a0bdcaf261bd16d7358a
parentRevert 1.10 - there are still bad interactions between block_move_no_loop() (diff)
downloadwireguard-openbsd-7f0bff625de74470cd192bb5593c0955af8f2d9d.tar.xz
wireguard-openbsd-7f0bff625de74470cd192bb5593c0955af8f2d9d.zip
Add check for bp->b_bcount in siop_minphys() as other drivers have.
ok mickey@
-rw-r--r--sys/dev/ic/siop_common.c5
-rw-r--r--sys/dev/ic/siopvar_common.h3
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/ic/siop_common.c b/sys/dev/ic/siop_common.c
index df53eaab69a..8e565358e18 100644
--- a/sys/dev/ic/siop_common.c
+++ b/sys/dev/ic/siop_common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: siop_common.c,v 1.19 2004/01/15 17:51:42 miod Exp $ */
+/* $OpenBSD: siop_common.c,v 1.20 2004/06/12 22:22:26 krw Exp $ */
/* $NetBSD: siop_common.c,v 1.31 2002/09/27 15:37:18 provos Exp $ */
/*
@@ -706,6 +706,9 @@ void
siop_minphys(bp)
struct buf *bp;
{
+ if (bp->b_bcount > SIOP_MAXFER)
+ bp->b_bcount = SIOP_MAXFER;
+
minphys(bp);
}
diff --git a/sys/dev/ic/siopvar_common.h b/sys/dev/ic/siopvar_common.h
index 751a4ee6e3e..3db7515c18c 100644
--- a/sys/dev/ic/siopvar_common.h
+++ b/sys/dev/ic/siopvar_common.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: siopvar_common.h,v 1.18 2003/11/16 20:30:06 avsm Exp $ */
+/* $OpenBSD: siopvar_common.h,v 1.19 2004/06/12 22:22:26 krw Exp $ */
/* $NetBSD: siopvar_common.h,v 1.22 2002/10/23 02:32:36 christos Exp $ */
/*
@@ -46,6 +46,7 @@ typedef struct scr_table {
/* Number of scatter/gather entries */
/* XXX Ensure alignment of siop_xfer's. */
#define SIOP_NSG 17 /* XXX (MAXPHYS/NBPG + 1) */
+#define SIOP_MAXFER ((SIOP_NSG - 1) * PAGE_SIZE)
/*
* This structure interfaces the SCRIPT with the driver; it describes a full