aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/constants.c235
1 files changed, 187 insertions, 48 deletions
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index 76e4c039f0d5..d35a5d6c8d7c 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -1,10 +1,10 @@
1/* 1/*
2 * ASCII values for a number of symbolic constants, printing functions, 2 * ASCII values for a number of symbolic constants, printing functions,
3 * etc. 3 * etc.
4 * Additions for SCSI 2 and Linux 2.2.x by D. Gilbert (990422) 4 * Additions for SCSI 2 and Linux 2.2.x by D. Gilbert (990422)
5 * Additions for SCSI 3+ (SPC-3 T10/1416-D Rev 07 3 May 2002) 5 * Additions for SCSI 3+ (SPC-3 T10/1416-D Rev 07 3 May 2002)
6 * by D. Gilbert and aeb (20020609) 6 * by D. Gilbert and aeb (20020609)
7 * Update to SPC-4 T10/1713-D Rev 20, 22 May 2009, D. Gilbert 20090624 7 * Updated to SPC-4 T10/1713-D Rev 36g, D. Gilbert 20130701
8 */ 8 */
9 9
10#include <linux/blkdev.h> 10#include <linux/blkdev.h>
@@ -21,12 +21,13 @@
21 21
22 22
23/* Commands with service actions that change the command name */ 23/* Commands with service actions that change the command name */
24#define MAINTENANCE_IN 0xa3
25#define MAINTENANCE_OUT 0xa4
26#define SERVICE_ACTION_IN_12 0xab 24#define SERVICE_ACTION_IN_12 0xab
27#define SERVICE_ACTION_OUT_12 0xa9 25#define SERVICE_ACTION_OUT_12 0xa9
26#define SERVICE_ACTION_BIDIRECTIONAL 0x9d
28#define SERVICE_ACTION_IN_16 0x9e 27#define SERVICE_ACTION_IN_16 0x9e
29#define SERVICE_ACTION_OUT_16 0x9f 28#define SERVICE_ACTION_OUT_16 0x9f
29#define THIRD_PARTY_COPY_OUT 0x83
30#define THIRD_PARTY_COPY_IN 0x84
30 31
31 32
32 33
@@ -36,11 +37,11 @@ static const char * cdb_byte0_names[] = {
36/* 04-07 */ "Format Unit/Medium", "Read Block Limits", NULL, 37/* 04-07 */ "Format Unit/Medium", "Read Block Limits", NULL,
37 "Reassign Blocks", 38 "Reassign Blocks",
38/* 08-0d */ "Read(6)", NULL, "Write(6)", "Seek(6)", NULL, NULL, 39/* 08-0d */ "Read(6)", NULL, "Write(6)", "Seek(6)", NULL, NULL,
39/* 0e-12 */ NULL, "Read Reverse", "Write Filemarks", "Space", "Inquiry", 40/* 0e-12 */ NULL, "Read Reverse", "Write Filemarks", "Space", "Inquiry",
40/* 13-16 */ "Verify(6)", "Recover Buffered Data", "Mode Select(6)", 41/* 13-16 */ "Verify(6)", "Recover Buffered Data", "Mode Select(6)",
41 "Reserve(6)", 42 "Reserve(6)",
42/* 17-1a */ "Release(6)", "Copy", "Erase", "Mode Sense(6)", 43/* 17-1a */ "Release(6)", "Copy", "Erase", "Mode Sense(6)",
43/* 1b-1d */ "Start/Stop Unit", "Receive Diagnostic", "Send Diagnostic", 44/* 1b-1d */ "Start/Stop Unit", "Receive Diagnostic", "Send Diagnostic",
44/* 1e-1f */ "Prevent/Allow Medium Removal", NULL, 45/* 1e-1f */ "Prevent/Allow Medium Removal", NULL,
45/* 20-22 */ NULL, NULL, NULL, 46/* 20-22 */ NULL, NULL, NULL,
46/* 23-28 */ "Read Format Capacities", "Set Window", 47/* 23-28 */ "Read Format Capacities", "Set Window",
@@ -48,16 +49,16 @@ static const char * cdb_byte0_names[] = {
48/* 29-2d */ "Read Generation", "Write(10)", "Seek(10)", "Erase(10)", 49/* 29-2d */ "Read Generation", "Write(10)", "Seek(10)", "Erase(10)",
49 "Read updated block", 50 "Read updated block",
50/* 2e-31 */ "Write Verify(10)", "Verify(10)", "Search High", "Search Equal", 51/* 2e-31 */ "Write Verify(10)", "Verify(10)", "Search High", "Search Equal",
51/* 32-34 */ "Search Low", "Set Limits", "Prefetch/Read Position", 52/* 32-34 */ "Search Low", "Set Limits", "Prefetch/Read Position",
52/* 35-37 */ "Synchronize Cache(10)", "Lock/Unlock Cache(10)", 53/* 35-37 */ "Synchronize Cache(10)", "Lock/Unlock Cache(10)",
53 "Read Defect Data(10)", 54 "Read Defect Data(10)",
54/* 38-3c */ "Medium Scan", "Compare", "Copy Verify", "Write Buffer", 55/* 38-3c */ "Medium Scan", "Compare", "Copy Verify", "Write Buffer",
55 "Read Buffer", 56 "Read Buffer",
56/* 3d-3f */ "Update Block", "Read Long(10)", "Write Long(10)", 57/* 3d-3f */ "Update Block", "Read Long(10)", "Write Long(10)",
57/* 40-41 */ "Change Definition", "Write Same(10)", 58/* 40-41 */ "Change Definition", "Write Same(10)",
58/* 42-48 */ "Unmap/Read sub-channel", "Read TOC/PMA/ATIP", 59/* 42-48 */ "Unmap/Read sub-channel", "Read TOC/PMA/ATIP",
59 "Read density support", "Play audio(10)", "Get configuration", 60 "Read density support", "Play audio(10)", "Get configuration",
60 "Play audio msf", "Play audio track/index", 61 "Play audio msf", "Sanitize/Play audio track/index",
61/* 49-4f */ "Play track relative(10)", "Get event status notification", 62/* 49-4f */ "Play track relative(10)", "Get event status notification",
62 "Pause/resume", "Log Select", "Log Sense", "Stop play/scan", 63 "Pause/resume", "Log Select", "Log Sense", "Stop play/scan",
63 NULL, 64 NULL,
@@ -72,17 +73,17 @@ static const char * cdb_byte0_names[] = {
72/* 70-77 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 73/* 70-77 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
73/* 78-7f */ NULL, NULL, NULL, NULL, NULL, NULL, "Extended CDB", 74/* 78-7f */ NULL, NULL, NULL, NULL, NULL, NULL, "Extended CDB",
74 "Variable length", 75 "Variable length",
75/* 80-84 */ "Xdwrite(16)", "Rebuild(16)", "Regenerate(16)", "Extended copy", 76/* 80-84 */ "Xdwrite(16)", "Rebuild(16)", "Regenerate(16)",
76 "Receive copy results", 77 "Third party copy out", "Third party copy in",
77/* 85-89 */ "ATA command pass through(16)", "Access control in", 78/* 85-89 */ "ATA command pass through(16)", "Access control in",
78 "Access control out", "Read(16)", "Memory Export Out(16)", 79 "Access control out", "Read(16)", "Compare and Write",
79/* 8a-8f */ "Write(16)", "ORWrite", "Read attributes", "Write attributes", 80/* 8a-8f */ "Write(16)", "ORWrite", "Read attributes", "Write attributes",
80 "Write and verify(16)", "Verify(16)", 81 "Write and verify(16)", "Verify(16)",
81/* 90-94 */ "Pre-fetch(16)", "Synchronize cache(16)", 82/* 90-94 */ "Pre-fetch(16)", "Synchronize cache(16)",
82 "Lock/unlock cache(16)", "Write same(16)", NULL, 83 "Lock/unlock cache(16)", "Write same(16)", NULL,
83/* 95-99 */ NULL, NULL, NULL, NULL, NULL, 84/* 95-99 */ NULL, NULL, NULL, NULL, NULL,
84/* 9a-9f */ NULL, NULL, NULL, NULL, "Service action in(16)", 85/* 9a-9f */ NULL, NULL, NULL, "Service action bidirectional",
85 "Service action out(16)", 86 "Service action in(16)", "Service action out(16)",
86/* a0-a5 */ "Report luns", "ATA command pass through(12)/Blank", 87/* a0-a5 */ "Report luns", "ATA command pass through(12)/Blank",
87 "Security protocol in", "Maintenance in", "Maintenance out", 88 "Security protocol in", "Maintenance in", "Maintenance out",
88 "Move medium/play audio(12)", 89 "Move medium/play audio(12)",
@@ -122,6 +123,7 @@ static const struct value_name_pair maint_out_arr[] = {
122 {0x6, "Set identifying information"}, 123 {0x6, "Set identifying information"},
123 {0xa, "Set target port groups"}, 124 {0xa, "Set target port groups"},
124 {0xb, "Change aliases"}, 125 {0xb, "Change aliases"},
126 {0xc, "Remove I_T nexus"},
125 {0xe, "Set priority"}, 127 {0xe, "Set priority"},
126 {0xf, "Set timestamp"}, 128 {0xf, "Set timestamp"},
127 {0x10, "Management protocol out"}, 129 {0x10, "Management protocol out"},
@@ -138,10 +140,16 @@ static const struct value_name_pair serv_out12_arr[] = {
138}; 140};
139#define SERV_OUT12_SZ ARRAY_SIZE(serv_out12_arr) 141#define SERV_OUT12_SZ ARRAY_SIZE(serv_out12_arr)
140 142
143static const struct value_name_pair serv_bidi_arr[] = {
144 {-1, "dummy entry"},
145};
146#define SERV_BIDI_SZ ARRAY_SIZE(serv_bidi_arr)
147
141static const struct value_name_pair serv_in16_arr[] = { 148static const struct value_name_pair serv_in16_arr[] = {
142 {0x10, "Read capacity(16)"}, 149 {0x10, "Read capacity(16)"},
143 {0x11, "Read long(16)"}, 150 {0x11, "Read long(16)"},
144 {0x12, "Get LBA status"}, 151 {0x12, "Get LBA status"},
152 {0x13, "Report referrals"},
145}; 153};
146#define SERV_IN16_SZ ARRAY_SIZE(serv_in16_arr) 154#define SERV_IN16_SZ ARRAY_SIZE(serv_in16_arr)
147 155
@@ -151,6 +159,51 @@ static const struct value_name_pair serv_out16_arr[] = {
151}; 159};
152#define SERV_OUT16_SZ ARRAY_SIZE(serv_out16_arr) 160#define SERV_OUT16_SZ ARRAY_SIZE(serv_out16_arr)
153 161
162static const struct value_name_pair pr_in_arr[] = {
163 {0x0, "Persistent reserve in, read keys"},
164 {0x1, "Persistent reserve in, read reservation"},
165 {0x2, "Persistent reserve in, report capabilities"},
166 {0x3, "Persistent reserve in, read full status"},
167};
168#define PR_IN_SZ ARRAY_SIZE(pr_in_arr)
169
170static const struct value_name_pair pr_out_arr[] = {
171 {0x0, "Persistent reserve out, register"},
172 {0x1, "Persistent reserve out, reserve"},
173 {0x2, "Persistent reserve out, release"},
174 {0x3, "Persistent reserve out, clear"},
175 {0x4, "Persistent reserve out, preempt"},
176 {0x5, "Persistent reserve out, preempt and abort"},
177 {0x6, "Persistent reserve out, register and ignore existing key"},
178 {0x7, "Persistent reserve out, register and move"},
179};
180#define PR_OUT_SZ ARRAY_SIZE(pr_out_arr)
181
182/* SPC-4 rev 34 renamed the Extended Copy opcode to Third Party Copy Out.
183 LID1 (List Identifier length: 1 byte) is the Extended Copy found in SPC-2
184 and SPC-3 */
185static const struct value_name_pair tpc_out_arr[] = {
186 {0x0, "Extended copy(LID1)"},
187 {0x1, "Extended copy(LID4)"},
188 {0x10, "Populate token"},
189 {0x11, "Write using token"},
190 {0x1c, "Copy operation abort"},
191};
192#define TPC_OUT_SZ ARRAY_SIZE(tpc_out_arr)
193
194static const struct value_name_pair tpc_in_arr[] = {
195 {0x0, "Receive copy status(LID1)"},
196 {0x1, "Receive copy data(LID1)"},
197 {0x3, "Receive copy operating parameters"},
198 {0x4, "Receive copy failure details(LID1)"},
199 {0x5, "Receive copy status(LID4)"},
200 {0x6, "Receive copy data(LID4)"},
201 {0x7, "Receive ROD token information"},
202 {0x8, "Report all ROD tokens"},
203};
204#define TPC_IN_SZ ARRAY_SIZE(tpc_in_arr)
205
206
154static const struct value_name_pair variable_length_arr[] = { 207static const struct value_name_pair variable_length_arr[] = {
155 {0x1, "Rebuild(32)"}, 208 {0x1, "Rebuild(32)"},
156 {0x2, "Regenerate(32)"}, 209 {0x2, "Regenerate(32)"},
@@ -207,6 +260,7 @@ static const char * get_sa_name(const struct value_name_pair * arr,
207static void print_opcode_name(unsigned char * cdbp, int cdb_len) 260static void print_opcode_name(unsigned char * cdbp, int cdb_len)
208{ 261{
209 int sa, len, cdb0; 262 int sa, len, cdb0;
263 int fin_name = 0;
210 const char * name; 264 const char * name;
211 265
212 cdb0 = cdbp[0]; 266 cdb0 = cdbp[0];
@@ -219,7 +273,8 @@ static void print_opcode_name(unsigned char * cdbp, int cdb_len)
219 break; 273 break;
220 } 274 }
221 sa = (cdbp[8] << 8) + cdbp[9]; 275 sa = (cdbp[8] << 8) + cdbp[9];
222 name = get_sa_name(variable_length_arr, VARIABLE_LENGTH_SZ, sa); 276 name = get_sa_name(variable_length_arr, VARIABLE_LENGTH_SZ,
277 sa);
223 if (name) 278 if (name)
224 printk("%s", name); 279 printk("%s", name);
225 else 280 else
@@ -232,50 +287,57 @@ static void print_opcode_name(unsigned char * cdbp, int cdb_len)
232 case MAINTENANCE_IN: 287 case MAINTENANCE_IN:
233 sa = cdbp[1] & 0x1f; 288 sa = cdbp[1] & 0x1f;
234 name = get_sa_name(maint_in_arr, MAINT_IN_SZ, sa); 289 name = get_sa_name(maint_in_arr, MAINT_IN_SZ, sa);
235 if (name) 290 fin_name = 1;
236 printk("%s", name);
237 else
238 printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa);
239 break; 291 break;
240 case MAINTENANCE_OUT: 292 case MAINTENANCE_OUT:
241 sa = cdbp[1] & 0x1f; 293 sa = cdbp[1] & 0x1f;
242 name = get_sa_name(maint_out_arr, MAINT_OUT_SZ, sa); 294 name = get_sa_name(maint_out_arr, MAINT_OUT_SZ, sa);
243 if (name) 295 fin_name = 1;
244 printk("%s", name); 296 break;
245 else 297 case PERSISTENT_RESERVE_IN:
246 printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); 298 sa = cdbp[1] & 0x1f;
299 name = get_sa_name(pr_in_arr, PR_IN_SZ, sa);
300 fin_name = 1;
301 break;
302 case PERSISTENT_RESERVE_OUT:
303 sa = cdbp[1] & 0x1f;
304 name = get_sa_name(pr_out_arr, PR_OUT_SZ, sa);
305 fin_name = 1;
247 break; 306 break;
248 case SERVICE_ACTION_IN_12: 307 case SERVICE_ACTION_IN_12:
249 sa = cdbp[1] & 0x1f; 308 sa = cdbp[1] & 0x1f;
250 name = get_sa_name(serv_in12_arr, SERV_IN12_SZ, sa); 309 name = get_sa_name(serv_in12_arr, SERV_IN12_SZ, sa);
251 if (name) 310 fin_name = 1;
252 printk("%s", name);
253 else
254 printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa);
255 break; 311 break;
256 case SERVICE_ACTION_OUT_12: 312 case SERVICE_ACTION_OUT_12:
257 sa = cdbp[1] & 0x1f; 313 sa = cdbp[1] & 0x1f;
258 name = get_sa_name(serv_out12_arr, SERV_OUT12_SZ, sa); 314 name = get_sa_name(serv_out12_arr, SERV_OUT12_SZ, sa);
259 if (name) 315 fin_name = 1;
260 printk("%s", name); 316 break;
261 else 317 case SERVICE_ACTION_BIDIRECTIONAL:
262 printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); 318 sa = cdbp[1] & 0x1f;
319 name = get_sa_name(serv_bidi_arr, SERV_BIDI_SZ, sa);
320 fin_name = 1;
263 break; 321 break;
264 case SERVICE_ACTION_IN_16: 322 case SERVICE_ACTION_IN_16:
265 sa = cdbp[1] & 0x1f; 323 sa = cdbp[1] & 0x1f;
266 name = get_sa_name(serv_in16_arr, SERV_IN16_SZ, sa); 324 name = get_sa_name(serv_in16_arr, SERV_IN16_SZ, sa);
267 if (name) 325 fin_name = 1;
268 printk("%s", name);
269 else
270 printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa);
271 break; 326 break;
272 case SERVICE_ACTION_OUT_16: 327 case SERVICE_ACTION_OUT_16:
273 sa = cdbp[1] & 0x1f; 328 sa = cdbp[1] & 0x1f;
274 name = get_sa_name(serv_out16_arr, SERV_OUT16_SZ, sa); 329 name = get_sa_name(serv_out16_arr, SERV_OUT16_SZ, sa);
275 if (name) 330 fin_name = 1;
276 printk("%s", name); 331 break;
277 else 332 case THIRD_PARTY_COPY_IN:
278 printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); 333 sa = cdbp[1] & 0x1f;
334 name = get_sa_name(tpc_in_arr, TPC_IN_SZ, sa);
335 fin_name = 1;
336 break;
337 case THIRD_PARTY_COPY_OUT:
338 sa = cdbp[1] & 0x1f;
339 name = get_sa_name(tpc_out_arr, TPC_OUT_SZ, sa);
340 fin_name = 1;
279 break; 341 break;
280 default: 342 default:
281 if (cdb0 < 0xc0) { 343 if (cdb0 < 0xc0) {
@@ -288,6 +350,12 @@ static void print_opcode_name(unsigned char * cdbp, int cdb_len)
288 printk("cdb[0]=0x%x (vendor)", cdb0); 350 printk("cdb[0]=0x%x (vendor)", cdb0);
289 break; 351 break;
290 } 352 }
353 if (fin_name) {
354 if (name)
355 printk("%s", name);
356 else
357 printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa);
358 }
291} 359}
292 360
293#else /* ifndef CONFIG_SCSI_CONSTANTS */ 361#else /* ifndef CONFIG_SCSI_CONSTANTS */
@@ -312,10 +380,15 @@ static void print_opcode_name(unsigned char * cdbp, int cdb_len)
312 break; 380 break;
313 case MAINTENANCE_IN: 381 case MAINTENANCE_IN:
314 case MAINTENANCE_OUT: 382 case MAINTENANCE_OUT:
383 case PERSISTENT_RESERVE_IN:
384 case PERSISTENT_RESERVE_OUT:
315 case SERVICE_ACTION_IN_12: 385 case SERVICE_ACTION_IN_12:
316 case SERVICE_ACTION_OUT_12: 386 case SERVICE_ACTION_OUT_12:
387 case SERVICE_ACTION_BIDIRECTIONAL:
317 case SERVICE_ACTION_IN_16: 388 case SERVICE_ACTION_IN_16:
318 case SERVICE_ACTION_OUT_16: 389 case SERVICE_ACTION_OUT_16:
390 case THIRD_PARTY_COPY_IN:
391 case THIRD_PARTY_COPY_OUT:
319 sa = cdbp[1] & 0x1f; 392 sa = cdbp[1] & 0x1f;
320 printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); 393 printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa);
321 break; 394 break;
@@ -327,7 +400,7 @@ static void print_opcode_name(unsigned char * cdbp, int cdb_len)
327 break; 400 break;
328 } 401 }
329} 402}
330#endif 403#endif
331 404
332void __scsi_print_command(unsigned char *cdb) 405void __scsi_print_command(unsigned char *cdb)
333{ 406{
@@ -336,7 +409,7 @@ void __scsi_print_command(unsigned char *cdb)
336 print_opcode_name(cdb, 0); 409 print_opcode_name(cdb, 0);
337 len = scsi_command_size(cdb); 410 len = scsi_command_size(cdb);
338 /* print out all bytes in cdb */ 411 /* print out all bytes in cdb */
339 for (k = 0; k < len; ++k) 412 for (k = 0; k < len; ++k)
340 printk(" %02x", cdb[k]); 413 printk(" %02x", cdb[k]);
341 printk("\n"); 414 printk("\n");
342} 415}
@@ -404,8 +477,9 @@ struct error_info {
404 477
405/* 478/*
406 * The canonical list of T10 Additional Sense Codes is available at: 479 * The canonical list of T10 Additional Sense Codes is available at:
407 * http://www.t10.org/lists/asc-num.txt 480 * http://www.t10.org/lists/asc-num.txt [most recent: 20130605]
408 */ 481 */
482
409static const struct error_info additional[] = 483static const struct error_info additional[] =
410{ 484{
411 {0x0000, "No additional sense information"}, 485 {0x0000, "No additional sense information"},
@@ -430,6 +504,8 @@ static const struct error_info additional[] =
430 {0x001C, "Verify operation in progress"}, 504 {0x001C, "Verify operation in progress"},
431 {0x001D, "ATA pass through information available"}, 505 {0x001D, "ATA pass through information available"},
432 {0x001E, "Conflicting SA creation request"}, 506 {0x001E, "Conflicting SA creation request"},
507 {0x001F, "Logical unit transitioning to another power condition"},
508 {0x0020, "Extended copy information available"},
433 509
434 {0x0100, "No index/sector signal"}, 510 {0x0100, "No index/sector signal"},
435 511
@@ -460,6 +536,17 @@ static const struct error_info additional[] =
460 {0x0412, "Logical unit not ready, offline"}, 536 {0x0412, "Logical unit not ready, offline"},
461 {0x0413, "Logical unit not ready, SA creation in progress"}, 537 {0x0413, "Logical unit not ready, SA creation in progress"},
462 {0x0414, "Logical unit not ready, space allocation in progress"}, 538 {0x0414, "Logical unit not ready, space allocation in progress"},
539 {0x0415, "Logical unit not ready, robotics disabled"},
540 {0x0416, "Logical unit not ready, configuration required"},
541 {0x0417, "Logical unit not ready, calibration required"},
542 {0x0418, "Logical unit not ready, a door is open"},
543 {0x0419, "Logical unit not ready, operating in sequential mode"},
544 {0x041A, "Logical unit not ready, start stop unit command in "
545 "progress"},
546 {0x041B, "Logical unit not ready, sanitize in progress"},
547 {0x041C, "Logical unit not ready, additional power use not yet "
548 "granted"},
549 {0x041D, "Logical unit not ready, configuration in progress"},
463 550
464 {0x0500, "Logical unit does not respond to selection"}, 551 {0x0500, "Logical unit does not respond to selection"},
465 552
@@ -490,6 +577,7 @@ static const struct error_info additional[] =
490 {0x0B06, "Warning - non-volatile cache now volatile"}, 577 {0x0B06, "Warning - non-volatile cache now volatile"},
491 {0x0B07, "Warning - degraded power to non-volatile cache"}, 578 {0x0B07, "Warning - degraded power to non-volatile cache"},
492 {0x0B08, "Warning - power loss expected"}, 579 {0x0B08, "Warning - power loss expected"},
580 {0x0B09, "Warning - device statistics notification active"},
493 581
494 {0x0C00, "Write error"}, 582 {0x0C00, "Write error"},
495 {0x0C01, "Write error - recovered with auto reallocation"}, 583 {0x0C01, "Write error - recovered with auto reallocation"},
@@ -505,6 +593,7 @@ static const struct error_info additional[] =
505 {0x0C0B, "Auxiliary memory write error"}, 593 {0x0C0B, "Auxiliary memory write error"},
506 {0x0C0C, "Write error - unexpected unsolicited data"}, 594 {0x0C0C, "Write error - unexpected unsolicited data"},
507 {0x0C0D, "Write error - not enough unsolicited data"}, 595 {0x0C0D, "Write error - not enough unsolicited data"},
596 {0x0C0E, "Multiple write errors"},
508 {0x0C0F, "Defects in error window"}, 597 {0x0C0F, "Defects in error window"},
509 598
510 {0x0D00, "Error detected by third party temporary initiator"}, 599 {0x0D00, "Error detected by third party temporary initiator"},
@@ -523,6 +612,8 @@ static const struct error_info additional[] =
523 {0x1001, "Logical block guard check failed"}, 612 {0x1001, "Logical block guard check failed"},
524 {0x1002, "Logical block application tag check failed"}, 613 {0x1002, "Logical block application tag check failed"},
525 {0x1003, "Logical block reference tag check failed"}, 614 {0x1003, "Logical block reference tag check failed"},
615 {0x1004, "Logical block protection error on recover buffered data"},
616 {0x1005, "Logical block protection method error"},
526 617
527 {0x1100, "Unrecovered read error"}, 618 {0x1100, "Unrecovered read error"},
528 {0x1101, "Read retries exhausted"}, 619 {0x1101, "Read retries exhausted"},
@@ -545,6 +636,7 @@ static const struct error_info additional[] =
545 {0x1112, "Auxiliary memory read error"}, 636 {0x1112, "Auxiliary memory read error"},
546 {0x1113, "Read error - failed retransmission request"}, 637 {0x1113, "Read error - failed retransmission request"},
547 {0x1114, "Read error - lba marked bad by application client"}, 638 {0x1114, "Read error - lba marked bad by application client"},
639 {0x1115, "Write after sanitize required"},
548 640
549 {0x1200, "Address mark not found for id field"}, 641 {0x1200, "Address mark not found for id field"},
550 642
@@ -622,6 +714,7 @@ static const struct error_info additional[] =
622 {0x2009, "Access denied - invalid LU identifier"}, 714 {0x2009, "Access denied - invalid LU identifier"},
623 {0x200A, "Access denied - invalid proxy token"}, 715 {0x200A, "Access denied - invalid proxy token"},
624 {0x200B, "Access denied - ACL LUN conflict"}, 716 {0x200B, "Access denied - ACL LUN conflict"},
717 {0x200C, "Illegal command when not in append-only mode"},
625 718
626 {0x2100, "Logical block address out of range"}, 719 {0x2100, "Logical block address out of range"},
627 {0x2101, "Invalid element address"}, 720 {0x2101, "Invalid element address"},
@@ -630,6 +723,19 @@ static const struct error_info additional[] =
630 723
631 {0x2200, "Illegal function (use 20 00, 24 00, or 26 00)"}, 724 {0x2200, "Illegal function (use 20 00, 24 00, or 26 00)"},
632 725
726 {0x2300, "Invalid token operation, cause not reportable"},
727 {0x2301, "Invalid token operation, unsupported token type"},
728 {0x2302, "Invalid token operation, remote token usage not supported"},
729 {0x2303, "Invalid token operation, remote rod token creation not "
730 "supported"},
731 {0x2304, "Invalid token operation, token unknown"},
732 {0x2305, "Invalid token operation, token corrupt"},
733 {0x2306, "Invalid token operation, token revoked"},
734 {0x2307, "Invalid token operation, token expired"},
735 {0x2308, "Invalid token operation, token cancelled"},
736 {0x2309, "Invalid token operation, token deleted"},
737 {0x230A, "Invalid token operation, invalid token length"},
738
633 {0x2400, "Invalid field in cdb"}, 739 {0x2400, "Invalid field in cdb"},
634 {0x2401, "CDB decryption error"}, 740 {0x2401, "CDB decryption error"},
635 {0x2402, "Obsolete"}, 741 {0x2402, "Obsolete"},
@@ -705,6 +811,7 @@ static const struct error_info additional[] =
705 "event"}, 811 "event"},
706 {0x2A13, "Data encryption key instance counter has changed"}, 812 {0x2A13, "Data encryption key instance counter has changed"},
707 {0x2A14, "SA creation capabilities data has changed"}, 813 {0x2A14, "SA creation capabilities data has changed"},
814 {0x2A15, "Medium removal prevention preempted"},
708 815
709 {0x2B00, "Copy cannot execute since host cannot disconnect"}, 816 {0x2B00, "Copy cannot execute since host cannot disconnect"},
710 817
@@ -720,6 +827,7 @@ static const struct error_info additional[] =
720 {0x2C09, "Previous reservation conflict status"}, 827 {0x2C09, "Previous reservation conflict status"},
721 {0x2C0A, "Partition or collection contains user objects"}, 828 {0x2C0A, "Partition or collection contains user objects"},
722 {0x2C0B, "Not reserved"}, 829 {0x2C0B, "Not reserved"},
830 {0x2C0C, "Orwrite generation does not match"},
723 831
724 {0x2D00, "Overwrite error on update in place"}, 832 {0x2D00, "Overwrite error on update in place"},
725 833
@@ -728,6 +836,7 @@ static const struct error_info additional[] =
728 {0x2F00, "Commands cleared by another initiator"}, 836 {0x2F00, "Commands cleared by another initiator"},
729 {0x2F01, "Commands cleared by power loss notification"}, 837 {0x2F01, "Commands cleared by power loss notification"},
730 {0x2F02, "Commands cleared by device server"}, 838 {0x2F02, "Commands cleared by device server"},
839 {0x2F03, "Some commands cleared by queuing layer event"},
731 840
732 {0x3000, "Incompatible medium installed"}, 841 {0x3000, "Incompatible medium installed"},
733 {0x3001, "Cannot read medium - unknown format"}, 842 {0x3001, "Cannot read medium - unknown format"},
@@ -745,10 +854,12 @@ static const struct error_info additional[] =
745 {0x3010, "Medium not formatted"}, 854 {0x3010, "Medium not formatted"},
746 {0x3011, "Incompatible volume type"}, 855 {0x3011, "Incompatible volume type"},
747 {0x3012, "Incompatible volume qualifier"}, 856 {0x3012, "Incompatible volume qualifier"},
857 {0x3013, "Cleaning volume expired"},
748 858
749 {0x3100, "Medium format corrupted"}, 859 {0x3100, "Medium format corrupted"},
750 {0x3101, "Format command failed"}, 860 {0x3101, "Format command failed"},
751 {0x3102, "Zoned formatting failed due to spare linking"}, 861 {0x3102, "Zoned formatting failed due to spare linking"},
862 {0x3103, "Sanitize command failed"},
752 863
753 {0x3200, "No defect spare location available"}, 864 {0x3200, "No defect spare location available"},
754 {0x3201, "Defect list update failure"}, 865 {0x3201, "Defect list update failure"},
@@ -809,6 +920,8 @@ static const struct error_info additional[] =
809 {0x3B19, "Element enabled"}, 920 {0x3B19, "Element enabled"},
810 {0x3B1A, "Data transfer device removed"}, 921 {0x3B1A, "Data transfer device removed"},
811 {0x3B1B, "Data transfer device inserted"}, 922 {0x3B1B, "Data transfer device inserted"},
923 {0x3B1C, "Too many logical objects on partition to support "
924 "operation"},
812 925
813 {0x3D00, "Invalid bits in identify message"}, 926 {0x3D00, "Invalid bits in identify message"},
814 927
@@ -839,6 +952,7 @@ static const struct error_info additional[] =
839 {0x3F12, "iSCSI IP address added"}, 952 {0x3F12, "iSCSI IP address added"},
840 {0x3F13, "iSCSI IP address removed"}, 953 {0x3F13, "iSCSI IP address removed"},
841 {0x3F14, "iSCSI IP address changed"}, 954 {0x3F14, "iSCSI IP address changed"},
955 {0x3F15, "Inspect referrals sense descriptors"},
842/* 956/*
843 * {0x40NN, "Ram failure"}, 957 * {0x40NN, "Ram failure"},
844 * {0x40NN, "Diagnostic failure on component nn"}, 958 * {0x40NN, "Diagnostic failure on component nn"},
@@ -848,6 +962,7 @@ static const struct error_info additional[] =
848 {0x4300, "Message error"}, 962 {0x4300, "Message error"},
849 963
850 {0x4400, "Internal target failure"}, 964 {0x4400, "Internal target failure"},
965 {0x4401, "Persistent reservation information lost"},
851 {0x4471, "ATA device failed set features"}, 966 {0x4471, "ATA device failed set features"},
852 967
853 {0x4500, "Select or reselect failure"}, 968 {0x4500, "Select or reselect failure"},
@@ -876,6 +991,21 @@ static const struct error_info additional[] =
876 {0x4B04, "Nak received"}, 991 {0x4B04, "Nak received"},
877 {0x4B05, "Data offset error"}, 992 {0x4B05, "Data offset error"},
878 {0x4B06, "Initiator response timeout"}, 993 {0x4B06, "Initiator response timeout"},
994 {0x4B07, "Connection lost"},
995 {0x4B08, "Data-in buffer overflow - data buffer size"},
996 {0x4B09, "Data-in buffer overflow - data buffer descriptor area"},
997 {0x4B0A, "Data-in buffer error"},
998 {0x4B0B, "Data-out buffer overflow - data buffer size"},
999 {0x4B0C, "Data-out buffer overflow - data buffer descriptor area"},
1000 {0x4B0D, "Data-out buffer error"},
1001 {0x4B0E, "PCIe fabric error"},
1002 {0x4B0F, "PCIe completion timeout"},
1003 {0x4B10, "PCIe completer abort"},
1004 {0x4B11, "PCIe poisoned tlp received"},
1005 {0x4B12, "PCIe eCRC check failed"},
1006 {0x4B13, "PCIe unsupported request"},
1007 {0x4B14, "PCIe acs violation"},
1008 {0x4B15, "PCIe tlp prefix blocked"},
879 1009
880 {0x4C00, "Logical unit failed self-configuration"}, 1010 {0x4C00, "Logical unit failed self-configuration"},
881/* 1011/*
@@ -897,6 +1027,10 @@ static const struct error_info additional[] =
897 {0x5302, "Medium removal prevented"}, 1027 {0x5302, "Medium removal prevented"},
898 {0x5303, "Medium removal prevented by data transfer element"}, 1028 {0x5303, "Medium removal prevented by data transfer element"},
899 {0x5304, "Medium thread or unthread failure"}, 1029 {0x5304, "Medium thread or unthread failure"},
1030 {0x5305, "Volume identifier invalid"},
1031 {0x5306, "Volume identifier missing"},
1032 {0x5307, "Duplicate volume identifier"},
1033 {0x5308, "Element status unknown"},
900 1034
901 {0x5400, "Scsi to host system interface failure"}, 1035 {0x5400, "Scsi to host system interface failure"},
902 1036
@@ -911,6 +1045,9 @@ static const struct error_info additional[] =
911 {0x5508, "Maximum number of supplemental decryption keys exceeded"}, 1045 {0x5508, "Maximum number of supplemental decryption keys exceeded"},
912 {0x5509, "Medium auxiliary memory not accessible"}, 1046 {0x5509, "Medium auxiliary memory not accessible"},
913 {0x550A, "Data currently unavailable"}, 1047 {0x550A, "Data currently unavailable"},
1048 {0x550B, "Insufficient power for operation"},
1049 {0x550C, "Insufficient resources to create rod"},
1050 {0x550D, "Insufficient resources to create rod token"},
914 1051
915 {0x5700, "Unable to recover table-of-contents"}, 1052 {0x5700, "Unable to recover table-of-contents"},
916 1053
@@ -1069,6 +1206,7 @@ static const struct error_info additional[] =
1069 {0x670B, "ATA device feature not enabled"}, 1206 {0x670B, "ATA device feature not enabled"},
1070 1207
1071 {0x6800, "Logical unit not configured"}, 1208 {0x6800, "Logical unit not configured"},
1209 {0x6801, "Subsidiary logical unit not configured"},
1072 1210
1073 {0x6900, "Data loss on logical unit"}, 1211 {0x6900, "Data loss on logical unit"},
1074 {0x6901, "Multiple logical unit failures"}, 1212 {0x6901, "Multiple logical unit failures"},
@@ -1185,10 +1323,13 @@ static const char * const snstext[] = {
1185 "Vendor Specific(9)", 1323 "Vendor Specific(9)",
1186 "Copy Aborted", /* A: COPY or COMPARE was aborted */ 1324 "Copy Aborted", /* A: COPY or COMPARE was aborted */
1187 "Aborted Command", /* B: The target aborted the command */ 1325 "Aborted Command", /* B: The target aborted the command */
1188 "Equal", /* C: A SEARCH DATA command found data equal */ 1326 "Equal", /* C: A SEARCH DATA command found data equal,
1327 reserved in SPC-4 rev 36 */
1189 "Volume Overflow", /* D: Medium full with still data to be written */ 1328 "Volume Overflow", /* D: Medium full with still data to be written */
1190 "Miscompare", /* E: Source data and data on the medium 1329 "Miscompare", /* E: Source data and data on the medium
1191 do not agree */ 1330 do not agree */
1331 "Completed", /* F: command completed sense data reported,
1332 may occur for successful command */
1192}; 1333};
1193#endif 1334#endif
1194 1335
@@ -1306,7 +1447,7 @@ scsi_decode_sense_buffer(const unsigned char *sense_buffer, int sense_len,
1306 struct scsi_sense_hdr *sshdr) 1447 struct scsi_sense_hdr *sshdr)
1307{ 1448{
1308 int k, num, res; 1449 int k, num, res;
1309 1450
1310 res = scsi_normalize_sense(sense_buffer, sense_len, sshdr); 1451 res = scsi_normalize_sense(sense_buffer, sense_len, sshdr);
1311 if (0 == res) { 1452 if (0 == res) {
1312 /* this may be SCSI-1 sense data */ 1453 /* this may be SCSI-1 sense data */
@@ -1459,5 +1600,3 @@ void scsi_print_result(struct scsi_cmnd *cmd)
1459 scsi_show_result(cmd->result); 1600 scsi_show_result(cmd->result);
1460} 1601}
1461EXPORT_SYMBOL(scsi_print_result); 1602EXPORT_SYMBOL(scsi_print_result);
1462
1463