|
|||||||||||
|
Re: Hardware compression in Exabyte 8505XL drives
From: Joseph Bender <jcbender(at)benderhome.net>
Date: Wed Feb 26 2003 - 11:44:04 EST
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 /*
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.netReceived on Wed Feb 26 11:45:55 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:51 EDT |
||||||||||
|
|||||||||||