Module Name:    src
Committed By:   tls
Date:           Sun Dec  2 05:46:04 UTC 2012

Modified Files:
        src/sys/dev/pci [tls-maxphys]: arcmsr.c arcmsrvar.h

Log Message:
Areca controller maximum-transfer size limits -- looked up in FreeBSD
driver.

Actually exporting the per-volume transfer size for this driver will
be quite hard; the controller firmware shows the host the configured
volumes when the host probes the controller's "scsibus", and we can't
really associate them with particular RAID volumes until later.  I think
we will have to intercept the SCSI inquiry commands -- yuck.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.12.1 src/sys/dev/pci/arcmsr.c
cvs rdiff -u -r1.14 -r1.14.12.1 src/sys/dev/pci/arcmsrvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/arcmsr.c
diff -u src/sys/dev/pci/arcmsr.c:1.30 src/sys/dev/pci/arcmsr.c:1.30.12.1
--- src/sys/dev/pci/arcmsr.c:1.30	Mon Jun 20 22:03:16 2011
+++ src/sys/dev/pci/arcmsr.c	Sun Dec  2 05:46:03 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: arcmsr.c,v 1.30 2011/06/20 22:03:16 pgoyette Exp $ */
+/*	$NetBSD: arcmsr.c,v 1.30.12.1 2012/12/02 05:46:03 tls Exp $ */
 /*	$OpenBSD: arc.c,v 1.68 2007/10/27 03:28:27 dlg Exp $ */
 
 /*
@@ -21,7 +21,7 @@
 #include "bio.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arcmsr.c,v 1.30 2011/06/20 22:03:16 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arcmsr.c,v 1.30.12.1 2012/12/02 05:46:03 tls Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -259,8 +259,8 @@ arc_shutdown(device_t self, int how)
 static void
 arc_minphys(struct buf *bp)
 {
-	if (bp->b_bcount > MAXPHYS)
-		bp->b_bcount = MAXPHYS;
+	if (bp->b_bcount > ARC_MAX_XFER)
+		bp->b_bcount = ARC_MAX_XFER;
 	minphys(bp);
 }
 
@@ -2091,8 +2091,9 @@ arc_alloc_ccbs(device_t self)
 	for (i = 0; i < sc->sc_req_count; i++) {
 		ccb = &sc->sc_ccbs[i];
 
-		if (bus_dmamap_create(sc->sc_dmat, MAXPHYS, ARC_SGL_MAXLEN,
-		    MAXPHYS, 0, 0, &ccb->ccb_dmamap) != 0) {
+		if (bus_dmamap_create(sc->sc_dmat, ARC_MAX_XFER,
+				      ARC_SGL_MAXLEN, ARC_MAX_XFER,
+				      0, 0, &ccb->ccb_dmamap) != 0) {
 			aprint_error_dev(self,
 			    "unable to create dmamap for ccb %d\n", i);
 			goto free_maps;

Index: src/sys/dev/pci/arcmsrvar.h
diff -u src/sys/dev/pci/arcmsrvar.h:1.14 src/sys/dev/pci/arcmsrvar.h:1.14.12.1
--- src/sys/dev/pci/arcmsrvar.h:1.14	Mon Jun 20 13:26:58 2011
+++ src/sys/dev/pci/arcmsrvar.h	Sun Dec  2 05:46:03 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: arcmsrvar.h,v 1.14 2011/06/20 13:26:58 pgoyette Exp $ */
+/*	$NetBSD: arcmsrvar.h,v 1.14.12.1 2012/12/02 05:46:03 tls Exp $ */
 /*	Derived from $OpenBSD: arc.c,v 1.68 2007/10/27 03:28:27 dlg Exp $ */
 
 /*
@@ -127,7 +127,10 @@ struct arc_sge {
 #define ARC_MAX_TARGET		16
 #define ARC_MAX_LUN		8
 #define ARC_MAX_IOCMDLEN	512
+#define ARC_MAX_XFER_BLOCKS	4096
 #define ARC_BLOCKSIZE		512
+#define ARC_MAX_XFER		(MIN(MACHINE_MAXPHYS, \
+				 ARC_MAX_XFER_BLOCKS * ARC_BLOCKSIZE))
 
 /* 
  * the firmware deals with up to 256 or 512 byte command frames.

Reply via email to