aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/aac
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2001-03-21 21:53:09 +0000
committerScott Long <scottl@FreeBSD.org>2001-03-21 21:53:09 +0000
commitd5fd2abf4f0d7dabb3dc2d3027dbece55279d157 (patch)
tree4d9ca16a7b3b71c64fd3f3f0a1a396dcd4cd1bef /sys/dev/aac
parent9575fb2f650c594111a3b289c8b5e6aa04021c7e (diff)
Notes
Diffstat (limited to 'sys/dev/aac')
-rw-r--r--sys/dev/aac/aac_disk.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/aac/aac_disk.c b/sys/dev/aac/aac_disk.c
index e5fcb341c6c3..631902761e1f 100644
--- a/sys/dev/aac/aac_disk.c
+++ b/sys/dev/aac/aac_disk.c
@@ -219,6 +219,8 @@ 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);
@@ -256,11 +258,16 @@ aac_disk_attach(device_t dev)
disks_registered++;
#endif
- /*
- * The adapters seem to have a 64K size limit on the max I/O size. Set
- * our size on accordance.
+ /*
+ * We can calculate the maximum number of s/g entries based on the size of the
+ * FIB and the command structures packed within it.
*/
- sc->ad_dev_t->si_iosize_max = 65536;
+ 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;
return (0);
}