patch-2.3.10 linux/drivers/scsi/constants.c
Next file: linux/drivers/scsi/i60uscsi.c
Previous file: linux/drivers/scsi/atp870u.c
Back to the patch index
Back to the overall index
- Lines: 149
- Date:
Mon Jul 5 19:56:46 1999
- Orig file:
v2.3.9/linux/drivers/scsi/constants.c
- Orig date:
Sun Dec 21 17:04:48 1997
diff -u --recursive --new-file v2.3.9/linux/drivers/scsi/constants.c linux/drivers/scsi/constants.c
@@ -1,6 +1,8 @@
/*
* ASCII values for a number of symbolic constants, printing functions,
* etc.
+ * Additions for SCSI 2 and Linux 2.2.x by D. Gilbert (990422)
+ *
*/
#define __NO_VERSION__
@@ -37,7 +39,7 @@
/* 04-07 */ "Format Unit", "Read Block Limits", unknown, "Reasssign Blocks",
/* 08-0d */ "Read (6)", unknown, "Write (6)", "Seek (6)", unknown, unknown,
/* 0e-12 */ unknown, "Read Reverse", "Write Filemarks", "Space", "Inquiry",
-/* 13-16 */ unknown, "Recover Buffered Data", "Mode Select", "Reserve",
+/* 13-16 */ "Verify", "Recover Buffered Data", "Mode Select", "Reserve",
/* 17-1b */ "Release", "Copy", "Erase", "Mode Sense", "Start/Stop Unit",
/* 1c-1d */ "Receive Diagnostic", "Send Diagnostic",
/* 1e-1f */ "Prevent/Allow Medium Removal", unknown,
@@ -46,37 +48,57 @@
static const char *group_1_commands[] = {
/* 20-22 */ unknown, unknown, unknown,
-/* 23-28 */ unknown, unknown, "Read Capacity", unknown, unknown, "Read (10)",
-/* 29-2d */ unknown, "Write (10)", "Seek (10)", unknown, unknown,
+/* 23-28 */ unknown, "Define window parameters", "Read Capacity",
+ unknown, unknown, "Read (10)",
+/* 29-2d */ "Read Generation", "Write (10)", "Seek (10)", "Erase",
+ "Read updated block",
/* 2e-31 */ "Write Verify","Verify", "Search High", "Search Equal",
/* 32-34 */ "Search Low", "Set Limits", "Prefetch or Read Position",
/* 35-37 */ "Synchronize Cache","Lock/Unlock Cache", "Read Defect Data",
-/* 38-3c */ "Medium Scan", "Compare","Copy Verify", "Write Buffer", "Read Buffer",
+/* 38-3c */ "Medium Scan", "Compare", "Copy Verify", "Write Buffer",
+ "Read Buffer",
/* 3d-3f */ "Update Block", "Read Long", "Write Long",
};
static const char *group_2_commands[] = {
/* 40-41 */ "Change Definition", "Write Same",
-/* 42-48 */ unknown, "Read TOC", unknown, unknown, unknown, unknown, unknown,
-/* 49-4f */ unknown, unknown, unknown, "Log Select", "Log Sense", unknown, unknown,
+/* 42-48 */ "Read sub-channel", "Read TOC", "Read header",
+ "Play audio (10)", unknown, "Play audio msf",
+ "Play audio track/index",
+/* 49-4f */ "Play track relative (10)", unknown, "Pause/resume",
+ "Log Select", "Log Sense", unknown, unknown,
/* 50-55 */ unknown, unknown, unknown, unknown, unknown, "Mode Select (10)",
/* 56-5b */ unknown, unknown, unknown, unknown, "Mode Sense (10)", unknown,
/* 5c-5f */ unknown, unknown, unknown,
};
+/* The following are 12 byte commands in group 5 */
+static const char *group_5_commands[] = {
+/* a0-a5 */ unknown, unknown, unknown, unknown, unknown,
+ "Move medium/play audio(12)",
+/* a6-a9 */ "Exchange medium", unknown, "Read(12)", "Play track relative(12)",
+/* aa-ae */ "Write(12)", unknown, "Erase(12)", unknown,
+ "Write and verify(12)",
+/* af-b1 */ "Verify(12)", "Search data high(12)", "Search data equal(12)",
+/* b2-b4 */ "Search data low(12)", "Set limits(12)", unknown,
+/* b5-b6 */ "Request volume element address", "Send volume tag",
+/* b7-b9 */ "Read defect data(12)", "Read element status", unknown,
+/* ba-bf */ unknown, unknown, unknown, unknown, unknown, unknown,
+};
+
+
#define group(opcode) (((opcode) >> 5) & 7)
#define RESERVED_GROUP 0
#define VENDOR_GROUP 1
-#define NOTEXT_GROUP 2
static const char **commands[] = {
group_0_commands, group_1_commands, group_2_commands,
(const char **) RESERVED_GROUP, (const char **) RESERVED_GROUP,
- (const char **) NOTEXT_GROUP, (const char **) VENDOR_GROUP,
+ group_5_commands, (const char **) VENDOR_GROUP,
(const char **) VENDOR_GROUP
};
@@ -89,9 +111,6 @@
case RESERVED_GROUP:
printk("%s(0x%02x) ", reserved, opcode);
break;
- case NOTEXT_GROUP:
- printk("%s(0x%02x) ", unknown, opcode);
- break;
case VENDOR_GROUP:
printk("%s(0x%02x) ", vendor, opcode);
break;
@@ -119,15 +138,18 @@
#if (CONSTANTS & CONST_STATUS)
static const char * statuses[] = {
-/* 0-4 */ "Good", "Check Condition", "Condition Good", unknown, "Busy",
-/* 5-9 */ unknown, unknown, unknown, "Intermediate Good", unknown,
-/* a-d */ "Intermediate Good", unknown, "Reservation Conflict", unknown,
-/* e-f */ unknown, unknown,
+/* 0-4 */ "Good", "Check Condition", "Condition Met", unknown, "Busy",
+/* 5-9 */ unknown, unknown, unknown, "Intermediate", unknown,
+/* a-c */ "Intermediate-Condition Met", unknown, "Reservation Conflict",
+/* d-10 */ unknown, unknown, unknown, unknown,
+/* 11-14 */ "Command Terminated", unknown, unknown, "Queue Full",
+/* 15-1a */ unknown, unknown, unknown, unknown, unknown, unknown,
+/* 1b-1f */ unknown, unknown, unknown, unknown, unknown,
};
#endif
void print_status (int status) {
- status = (status >> 1) & 0xf;
+ status = (status >> 1) & 0x1f;
#if (CONSTANTS & CONST_STATUS)
printk("%s ",statuses[status]);
#else
@@ -405,8 +427,10 @@
s = sizeof(SCpnt->sense_buffer);
if (!valid)
- printk("extra data not valid ");
-
+ printk("[valid=0] ");
+ printk("Info fld=0x%x, ", (int)((sense_buffer[3] << 24) |
+ (sense_buffer[4] << 16) | (sense_buffer[5] << 8) |
+ sense_buffer[6]));
if (sense_buffer[2] & 0x80)
printk( "FMK "); /* current command has read a filemark */
if (sense_buffer[2] & 0x40)
@@ -427,7 +451,7 @@
error = "Invalid";
}
- printk("%s error ", error);
+ printk("%s ", error);
#if (CONSTANTS & CONST_SENSE)
printk( "%s%s: sense key %s\n", devclass,
@@ -603,7 +627,8 @@
#if (CONSTANTS & CONST_HOST)
static const char * hostbyte_table[]={
"DID_OK", "DID_NO_CONNECT", "DID_BUS_BUSY", "DID_TIME_OUT", "DID_BAD_TARGET",
-"DID_ABORT", "DID_PARITY", "DID_ERROR", "DID_RESET", "DID_BAD_INTR",NULL};
+"DID_ABORT", "DID_PARITY", "DID_ERROR", "DID_RESET", "DID_BAD_INTR",
+"DID_PASSTHROUGH", "DID_SOFT_ERROR", NULL};
void print_hostbyte(int scsiresult)
{ static int maxcode=0;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)