> Hi,
>
> Is it possible to raise the limit for maximum density code
> for the tape drives in sys/scsi/st.c from 0x45 to 0x90 ?
> Otherwise, doing 'mt density 140' fails.
<SNIP rest of post and diff>
(Mailed Theo for submission consideration, as I'm not sure bugs@ is the
place to be posting this).
Actually, here's one better for you. I forgot to resubmit this after
massively botching the first one.
The following diff takes care of the density issue, but also brings it it
line with the docs I have on the SCSI-3 specs. The specs permit for 0-FF,
as the density field in a MODE SELECT command is 8 bits.
Also, as the variable "number" is currently defined as an "int" (need to
see what it's used for everywhere as I'm not sure it CAN be a u_int, I
also added a lower limit to the bounds check.
The funny part is, after I got done doing this, I checked the NetBSD
source and found that they had done much the same thing.
Tested on i386 and sparc with a Quantum (Benchmark) DLT-1.
Anyway, here it is:
Index: st.c
===================================================================
RCS file: /cvs/src/sys/scsi/st.c,v
retrieving revision 1.33
diff -u -r1.33 st.c
--- st.c 30 Dec 2002 21:50:29 -0000 1.33
+++ st.c 27 Feb 2003 10:30:39 -0000
@@ -86,9 +86,9 @@
#define ST_SPC_TIME (4 * 60 * 60 * 1000) /* 4 hours */
/*
- * Maximum density code known.
+ * Maximum density code possible.
*/
-#define SCSI_2_MAX_DENSITY_CODE 0x45
+#define MAX_DENSITY_CODE 0xFF
/*
* Define various devices that we know mis-behave in some way,
@@ -1252,7 +1252,7 @@
goto try_new_value;
case MTSETDNSTY: /* Set density for device and mode */
- if (number > SCSI_2_MAX_DENSITY_CODE) {
+ if (number < 0 || number > MAX_DENSITY_CODE) {
error = EINVAL;
break;
} else
--
Signing off,
Joseph C. Bender
jcbender (at) benderhome.net