14 static const char unknown[] =
"UNKNOWN";
16 static const char * group_0_commands[] = {
17 "Test Unit Ready",
"Rezero Unit",
unknown,
"Request Sense",
18 "Format Unit",
"Read Block Limits",
unknown,
"Reassign Blocks",
20 unknown,
"Read Reverse",
"Write Filemarks",
"Space",
"Inquiry",
21 unknown,
"Recover Buffered Data",
"Mode Select",
"Reserve",
22 "Release",
"Copy",
"Erase",
"Mode Sense",
"Start/Stop Unit",
23 "Receive Diagnostic",
"Send Diagnostic",
24 "Prevent/Allow Medium Removal",
unknown,
28 static const char *group_1_commands[] = {
32 "Write Verify",
"Verify",
"Search High",
"Search Equal",
33 "Search Low",
"Set Limits",
"Prefetch or Read Position",
34 "Synchronize Cache",
"Lock/Unlock Cache",
"Read Defect Data",
35 "Medium Scan",
"Compare",
"Copy Verify",
"Write Buffer",
"Read Buffer",
36 "Update Block",
"Read Long",
"Write Long",
40 static const char *group_2_commands[] = {
41 "Change Definition",
"Write Same",
42 "Read Sub-Ch(cd)",
"Read TOC",
"Read Header(cd)",
"Play Audio(cd)",
unknown,
"Play Audio MSF(cd)",
"Play Audio Track/Index(cd)",
43 "Play Track Relative(10)(cd)",
unknown,
"Pause/Resume(cd)",
"Log Select",
"Log Sense",
unknown,
unknown,
49 #define group(opcode) (((opcode) >> 5) & 7)
51 #define RESERVED_GROUP 0
52 #define VENDOR_GROUP 1
53 #define NOTEXT_GROUP 2
56 group_0_commands, group_1_commands, group_2_commands,
59 (
const char **) VENDOR_GROUP
62 static const char reserved[] =
"RESERVED";
63 static const char vendor[] =
"VENDOR SPECIFIC";
65 static void print_opcodek(
unsigned char opcode)
69 switch ((
unsigned long) table) {
71 printk(
"%s[%02x] ", reserved, opcode);
77 printk(
"%s[%02x] ", vendor, opcode);
80 if (table[opcode & 0x1f] !=
unknown)
81 printk(
"%s[%02x] ", table[opcode & 0x1f], opcode);
88 static void print_commandk (
unsigned char *
command)
92 print_opcodek(command[0]);
94 if ((command[0] >> 5) == 6 ||
95 (command[0] >> 5) == 7 ) {
100 for ( i = 1; i <
s; ++
i) {
101 printk(
"%02x ", command[i]);
107 (((
unsigned int)command[1] & 0x0f) << 16) |
108 ( (
unsigned int)command[2] << 8) |
109 ( (
unsigned int)command[3] ),
110 (
unsigned int)command[4]
115 ((
unsigned int)command[2] << 24) |
116 ((
unsigned int)command[3] << 16) |
117 ((
unsigned int)command[4] << 8) |
118 ((
unsigned int)command[5] ),
119 ((
unsigned int)command[7] << 8) |
120 ((
unsigned int)command[8] )
125 ((
unsigned int)command[2] << 24) |
126 ((
unsigned int)command[3] << 16) |
127 ((
unsigned int)command[4] << 8) |
128 ((
unsigned int)command[5] ),
129 ((
unsigned int)command[6] << 24) |
130 ((
unsigned int)command[7] << 16) |
131 ((
unsigned int)command[8] << 8) |
132 ((
unsigned int)command[9] )
143 print_commandk(SCpnt->
cmnd);
148 int i = SCpnt->
SCp.phase;
209 for(i=0; i < data->
MsgLen; i++) {