summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2004-06-12 22:22:27 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2004-06-12 22:22:27 +0000
commitcbc7a67ab6def6348886a4bf10cbab4586d25454 (patch)
treeaa20a257034df5239b154a67206407fe2b33d97f /sys/dev
parent8b98d7d21cb635eec8eb4c1598ad6f2dab8f39ad (diff)
Add check for bp->b_bcount in siop_minphys() as other drivers have.
ok mickey@
Diffstat (limited to 'sys/dev')
-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