patch-pre2.0.6 linux/drivers/scsi/constants.c
Next file: linux/drivers/scsi/hosts.c
Previous file: linux/drivers/scsi/atari_scsi.h
Back to the patch index
Back to the overall index
- Lines: 89
- Date:
Sat May 18 22:18:56 1996
- Orig file:
pre2.0.5/linux/drivers/scsi/constants.c
- Orig date:
Thu Dec 14 06:44:58 1995
diff -u --recursive --new-file pre2.0.5/linux/drivers/scsi/constants.c linux/drivers/scsi/constants.c
@@ -365,13 +365,29 @@
#if (CONSTANTS & CONST_SENSE)
static const char *snstext[] = {
- "None","Recovered Error","Not Ready","Medium Error","Hardware Error",
- "Illegal Request","Unit Attention","Data Protect","Blank Check",
- "Key=9","Copy Aborted","Aborted Command","End-Of-Medium",
- "Volume Overflow", "Miscompare", "Key=15"};
+ "None", /* There is no sense information */
+ "Recovered Error", /* The last command completed successfully
+ but used error correction */
+ "Not Ready", /* The addressed target is not ready */
+ "Medium Error", /* Data error detected on the medium */
+ "Hardware Error", /* Controller or device failure */
+ "Illegal Request",
+ "Unit Attention", /* Removable medium was changed, or
+ the target has been reset */
+ "Data Protect", /* Access to the data is blocked */
+ "Blank Check", /* Reached unexpected written or unwritten
+ region of the medium */
+ "Key=9", /* Vendor specific */
+ "Copy Aborted", /* COPY or COMPARE was aborted */
+ "Aborted Command", /* The target aborted the command */
+ "Equal", /* A SEARCH DATA command found data equal */
+ "Volume Overflow", /* Medium full with still data to be written */
+ "Miscompare", /* Source data and data on the medium
+ do not agree */
+ "Key=15" /* Reserved */
+};
#endif
-
/* Print sense information */
void print_sense(const char * devclass, Scsi_Cmnd * SCpnt)
{
@@ -384,23 +400,29 @@
code = sense_buffer[0] & 0xf;
valid = sense_buffer[0] & 0x80;
- if (sense_class == 7) {
+ if (sense_class == 7) { /* extended sense data */
s = sense_buffer[7] + 8;
- if(s > sizeof(SCpnt->sense_buffer)) s = sizeof(SCpnt->sense_buffer);
+ if(s > sizeof(SCpnt->sense_buffer))
+ s = sizeof(SCpnt->sense_buffer);
if (!valid)
printk("extra data not valid ");
- if (sense_buffer[2] & 0x80) printk( "FMK ");
- if (sense_buffer[2] & 0x40) printk( "EOM ");
- if (sense_buffer[2] & 0x20) printk( "ILI ");
+ if (sense_buffer[2] & 0x80)
+ printk( "FMK "); /* current command has read a filemark */
+ if (sense_buffer[2] & 0x40)
+ printk( "EOM "); /* end-of-medium condition exists */
+ if (sense_buffer[2] & 0x20)
+ printk( "ILI "); /* incorrect block length requested */
switch (code) {
case 0x0:
- error = "Current";
+ error = "Current"; /* error concerns current command */
break;
case 0x1:
- error = "Deferred";
+ error = "Deferred"; /* error concerns some earlier command */
+ /* e.g., an earlier write to disk cache succeeded, but
+ now the disk discovers that it cannot write the data */
break;
default:
error = "Invalid";
@@ -437,7 +459,15 @@
#else
printk("ASC=%2x ASCQ=%2x\n", sense_buffer[12], sense_buffer[13]);
#endif
- } else {
+ } else { /* non-extended sense data */
+
+ /*
+ * Standard says:
+ * sense_buffer[0] & 0200 : address valid
+ * sense_buffer[0] & 0177 : vendor-specific error code
+ * sense_buffer[1] & 0340 : vendor-specific
+ * sense_buffer[1..3] : 21-bit logical block address
+ */
#if (CONSTANTS & CONST_SENSE)
if (sense_buffer[0] < 15)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this