diff options
| author | Scott Long <scottl@FreeBSD.org> | 2001-08-05 07:26:31 +0000 |
|---|---|---|
| committer | Scott Long <scottl@FreeBSD.org> | 2001-08-05 07:26:31 +0000 |
| commit | 3d04a9d7e3349928688abc0e2d6d84fe5d149d2a (patch) | |
| tree | 756fd851980d0f4ace15ed87994ea04d49781cd5 /sys/dev/aac | |
| parent | 0d3576d9bc5adf0dabbe3500ae0a3da6829bb04e (diff) | |
Notes
Diffstat (limited to 'sys/dev/aac')
| -rw-r--r-- | sys/dev/aac/aac.c | 4 | ||||
| -rw-r--r-- | sys/dev/aac/aac_disk.c | 27 |
2 files changed, 14 insertions, 17 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 0ea8336ade22..75f01358841a 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -40,6 +40,7 @@ #include <sys/systm.h> #include <sys/malloc.h> #include <sys/kernel.h> +#include <sys/sysctl.h> #include <dev/aac/aac_compat.h> @@ -183,6 +184,9 @@ static struct cdevsw aac_cdevsw = { 0, /* flags */ }; +/* sysctl node */ +SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters"); + /****************************************************************************** ****************************************************************************** Device Interface diff --git a/sys/dev/aac/aac_disk.c b/sys/dev/aac/aac_disk.c index a08789f893b4..d8331ea592c4 100644 --- a/sys/dev/aac/aac_disk.c +++ b/sys/dev/aac/aac_disk.c @@ -34,6 +34,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/sysctl.h> #include <dev/aac/aac_compat.h> #include <sys/bus.h> @@ -101,6 +102,14 @@ static driver_t aac_disk_driver = { DRIVER_MODULE(aacd, aac, aac_disk_driver, aac_disk_devclass, 0, 0); +/* sysctl tunables */ +static unsigned int aac_iosize_max = 65536; /* due to limits of the card */ +TUNABLE_INT("hw.aac.iosize_max", &aac_iosize_max); + +SYSCTL_DECL(_hw_aac); +SYSCTL_UINT(_hw_aac, OID_AUTO, iosize_max, CTLFLAG_RD, &aac_iosize_max, 0, + "Max I/O size per transfer to an array"); + /****************************************************************************** * Handle open from generic layer. * @@ -215,8 +224,6 @@ static int aac_disk_attach(device_t dev) { struct aac_disk *sc = (struct aac_disk *)device_get_softc(dev); - int sgspace; - int maxsg; debug_called(4); @@ -259,21 +266,7 @@ aac_disk_attach(device_t dev) disks_registered++; #endif - /* - * We can calculate the maximum number of s/g entries based on the size of - * the FIB and the command structures packed within it. - */ - sgspace = (sizeof(struct aac_fib) - sizeof(struct aac_fib_header) - - imax(sizeof(struct aac_blockwrite), - sizeof(struct aac_blockread))); - maxsg = (sgspace - sizeof(struct aac_sg_table)) / - sizeof(struct aac_sg_entry); - - /* - * set the maximum I/O size to the theoretical worst maximum allowed by the - * S/G list size - */ - sc->ad_dev_t->si_iosize_max = (maxsg - 1) * PAGE_SIZE; + sc->ad_dev_t->si_iosize_max = aac_iosize_max; return (0); } |
