[503] in linux-scsi channel archive
SG driver: patch to allow sensing buffer size limit
daemon@ATHENA.MIT.EDU (Heiko Eissfeldt)
Mon Aug 14 15:11:52 1995
From: heiko@colossus.escape.de (Heiko Eissfeldt)
To: linux-scsi@vger.rutgers.edu
Date: Mon, 14 Aug 1995 10:52:00 +0200 (MET DST)
Cc: Eric@aib.com
Hi,
Apps using the generic SCSI driver have currently no way to determine the
maximal usable buffer size other than by trial and error. I added a new
ioctl to request the buffer size limit from the kernel.
Comments?
This is against 1.3.17:
--- sg.c~ Sun Aug 13 21:58:20 1995
+++ sg.c Sun Aug 13 22:10:19 1995
@@ -84,6 +84,12 @@
return 0;
case SG_GET_TIMEOUT:
return scsi_generics[dev].timeout;
+ case SG_GET_BUFF_LIMIT:
+#if defined(SG_BIG_BUFF)
+ return SG_BIG_BUFF;
+#else
+ return 4096;
+#endif
default:
return scsi_ioctl(scsi_generics[dev].device, cmd_in, (void *) arg);
}
--- sg.h~ Sun Jul 2 15:43:39 1995
+++ sg.h Sun Aug 13 22:10:17 1995
@@ -26,6 +26,7 @@
/* ioctl's */
#define SG_SET_TIMEOUT 0x2201 /* set timeout *(int *)arg==timeout */
#define SG_GET_TIMEOUT 0x2202 /* get timeout return timeout */
+#define SG_GET_BUFF_LIMIT 0x2204 /* return buffersize limit */
#define SG_DEFAULT_TIMEOUT (60*HZ) /* 1 minute timeout */
#define SG_DEFAULT_RETRIES 1
--
Heiko Eissfeldt (heiko@colossus.escape.de) No (french) nuclear tests!