1 /*
2  * Copyright (c) 2007-2018 Douglas Gilbert.
3  * All rights reserved.
4  * Use of this source code is governed by a BSD-style
5  * license that can be found in the BSD_LICENSE file.
6  */
7 
8 #include <stdlib.h>
9 
10 #ifdef HAVE_CONFIG_H
11 #include "config.h"
12 #else
13 #define SG_SCSI_STRINGS 1
14 #endif
15 
16 #include "sg_lib.h"
17 #include "sg_lib_data.h"
18 
19 
20 const char * sg_lib_version_str = "2.38 20180122";/* spc5r17, sbc4r15 */
21 
22 
23 /* indexed by pdt; those that map to own index do not decay */
24 int sg_lib_pdt_decay_arr[32] = {
25     PDT_DISK, PDT_TAPE, PDT_TAPE /* printer */, PDT_PROCESSOR,
26     PDT_DISK /* WO */, PDT_MMC, PDT_SCANNER, PDT_DISK /* optical */,
27     PDT_MCHANGER, PDT_COMMS, 0xa, 0xb,
28     PDT_SAC, PDT_SES, PDT_DISK /* rbc */, PDT_OCRW,
29     PDT_BCC, PDT_OSD, PDT_TAPE /* adc */, PDT_SMD,
30     PDT_DISK /* zbc */, 0x15, 0x16, 0x17,
31     0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, PDT_WLUN, PDT_UNKNOWN
32 };
33 
34 #ifdef SG_SCSI_STRINGS
35 struct sg_lib_value_name_t sg_lib_normal_opcodes[] = {
36     {0, 0, "Test Unit Ready"},
37     {0x1, 0, "Rezero Unit"},
38     {0x1, PDT_TAPE, "Rewind"},
39     {0x3, 0, "Request Sense"},
40     {0x4, 0, "Format Unit"},
41     {0x4, PDT_TAPE, "Format medium"},
42     {0x4, PDT_PRINTER, "Format"},
43     {0x5, 0, "Read Block Limits"},
44     {0x7, 0, "Reassign Blocks"},
45     {0x7, PDT_MCHANGER, "Initialize element status"},
46     {0x8, 0, "Read(6)"},        /* obsolete in sbc3r30 */
47     {0x8, PDT_PROCESSOR, "Receive"},
48     {0xa, 0, "Write(6)"},       /* obsolete in sbc3r30 */
49     {0xa, PDT_PRINTER, "Print"},
50     {0xa, PDT_PROCESSOR, "Send"},
51     {0xb, 0, "Seek(6)"},
52     {0xb, PDT_TAPE, "Set capacity"},
53     {0xb, PDT_PRINTER, "Slew and print"},
54     {0xf, 0, "Read reverse(6)"},
55     {0x10, 0, "Write filemarks(6)"},
56     {0x10, PDT_PRINTER, "Synchronize buffer"},
57     {0x11, 0, "Space(6)"},
58     {0x12, 0, "Inquiry"},
59     {0x13, 0, "Verify(6)"},  /* SSC */
60     {0x14, 0, "Recover buffered data"},
61     {0x15, 0, "Mode select(6)"}, /* SBC-3 r31 recommends Mode select(10) */
62     {0x16, 0, "Reserve(6)"},    /* obsolete in SPC-4 r11 */
63     {0x16, PDT_MCHANGER, "Reserve element(6)"},
64     {0x17, 0, "Release(6)"},    /* obsolete in SPC-4 r11 */
65     {0x17, PDT_MCHANGER, "Release element(6)"},
66     {0x18, 0, "Copy"},          /* obsolete in SPC-4 r11 */
67     {0x19, 0, "Erase(6)"},
68     {0x1a, 0, "Mode sense(6)"}, /* SBC-3 r31 recommends Mode sense(10) */
69     {0x1b, 0, "Start stop unit"},
70     {0x1b, PDT_TAPE, "Load unload"},
71     {0x1b, PDT_ADC, "Load unload"},
72     {0x1b, PDT_PRINTER, "Stop print"},
73     {0x1c, 0, "Receive diagnostic results"},
74     {0x1d, 0, "Send diagnostic"},
75     {0x1e, 0, "Prevent allow medium removal"},
76     {0x23, 0, "Read Format capacities"},
77     {0x24, 0, "Set window"},
78     {0x25, 0, "Read capacity(10)"},
79                         /* SBC-3 r31 recommends Read capacity(16) */
80     {0x25, PDT_OCRW, "Read card capacity"},
81     {0x28, 0, "Read(10)"},      /* SBC-3 r31 recommends Read(16) */
82     {0x29, 0, "Read generation"},
83     {0x2a, 0, "Write(10)"},     /* SBC-3 r31 recommends Write(16) */
84     {0x2b, 0, "Seek(10)"},
85     {0x2b, PDT_TAPE, "Locate(10)"},
86     {0x2b, PDT_MCHANGER, "Position to element"},
87     {0x2c, 0, "Erase(10)"},
88     {0x2d, 0, "Read updated block"},
89     {0x2e, 0, "Write and verify(10)"},
90                         /* SBC-3 r31 recommends Write and verify(16) */
91     {0x2f, 0, "Verify(10)"},    /* SBC-3 r31 recommends Verify(16) */
92     {0x30, 0, "Search data high(10)"},
93     {0x31, 0, "Search data equal(10)"},
94     {0x32, 0, "Search data low(10)"},
95     {0x33, 0, "Set limits(10)"},
96     {0x34, 0, "Pre-fetch(10)"}, /* SBC-3 r31 recommends Pre-fetch(16) */
97     {0x34, PDT_TAPE, "Read position"},
98     {0x35, 0, "Synchronize cache(10)"},
99                         /* SBC-3 r31 recommends Synchronize cache(16) */
100     {0x36, 0, "Lock unlock cache(10)"},
101     {0x37, 0, "Read defect data(10)"},
102                         /* SBC-3 r31 recommends Read defect data(12) */
103     {0x37, PDT_MCHANGER, "Initialize element status with range"},
104     {0x38, 0, "Medium scan"},
105     {0x39, 0, "Compare"},               /* obsolete in SPC-4 r11 */
106     {0x3a, 0, "Copy and verify"},       /* obsolete in SPC-4 r11 */
107     {0x3b, 0, "Write buffer"},
108     {0x3c, 0, "Read buffer(10)"},
109     {0x3d, 0, "Update block"},
110     {0x3e, 0, "Read long(10)"},         /* obsolete in SBC-4 r7 */
111     {0x3f, 0, "Write long(10)"}, /* SBC-3 r31 recommends Write long(16) */
112     {0x40, 0, "Change definition"},     /* obsolete in SPC-4 r11 */
113     {0x41, 0, "Write same(10)"}, /* SBC-3 r31 recommends Write same(16) */
114     {0x42, 0, "Unmap"},                 /* added SPC-4 rev 18 */
115     {0x42, PDT_MMC, "Read sub-channel"},
116     {0x43, PDT_MMC, "Read TOC/PMA/ATIP"},
117     {0x44, 0, "Report density support"},
118     {0x45, PDT_MMC, "Play audio(10)"},
119     {0x46, PDT_MMC, "Get configuration"},
120     {0x47, PDT_MMC, "Play audio msf"},
121     {0x48, 0, "Sanitize"},
122     {0x4a, PDT_MMC, "Get event status notification"},
123     {0x4b, PDT_MMC, "Pause/resume"},
124     {0x4c, 0, "Log select"},
125     {0x4d, 0, "Log sense"},
126     {0x4e, 0, "Stop play/scan"},
127     {0x50, 0, "Xdwrite(10)"},           /* obsolete in SBC-3 r31 */
128     {0x51, 0, "Xpwrite(10)"},           /* obsolete in SBC-4 r15 */
129     {0x51, PDT_MMC, "Read disk information"},
130     {0x52, 0, "Xdread(10)"},            /* obsolete in SBC-3 r31 */
131     {0x52, PDT_MMC, "Read track information"},
132     {0x53, 0, "Xdwriteread(10)"},       /* obsolete in SBC-4 r15 */
133     {0x54, 0, "Send OPC information"},
134     {0x55, 0, "Mode select(10)"},
135     {0x56, 0, "Reserve(10)"},           /* obsolete in SPC-4 r11 */
136     {0x56, PDT_MCHANGER, "Reserve element(10)"},
137     {0x57, 0, "Release(10)"},           /* obsolete in SPC-4 r11 */
138     {0x57, PDT_MCHANGER, "Release element(10)"},
139     {0x58, 0, "Repair track"},
140     {0x5a, 0, "Mode sense(10)"},
141     {0x5b, 0, "Close track/session"},
142     {0x5c, 0, "Read buffer capacity"},
143     {0x5d, 0, "Send cue sheet"},
144     {0x5e, 0, "Persistent reserve in"},
145     {0x5f, 0, "Persistent reserve out"},
146     {0x7e, 0, "Extended cdb (XCBD)"},           /* added in SPC-4 r12 */
147     {0x80, 0, "Xdwrite extended(16)"},          /* obsolete in SBC-4 r15 */
148     {0x80, PDT_TAPE, "Write filemarks(16)"},
149     {0x81, 0, "Rebuild(16)"},
150     {0x81, PDT_TAPE, "Read reverse(16)"},
151     {0x82, 0, "Regenerate(16)"},
152     {0x83, 0, "Third party copy out"},  /* Extended copy, before spc4r34 */
153         /* Following was "Receive copy results", before spc4r34 */
154     {0x84, 0, "Third party copy in"},
155     {0x85, 0, "ATA pass-through(16)"},  /* was 0x98 in spc3 rev21c */
156     {0x86, 0, "Access control in"},
157     {0x87, 0, "Access control out"},
158     {0x88, 0, "Read(16)"},
159     {0x89, 0, "Compare and write"},
160     {0x8a, 0, "Write(16)"},
161     {0x8b, 0, "Orwrite(16)"},
162     {0x8c, 0, "Read attribute"},
163     {0x8d, 0, "Write attribute"},
164     {0x8e, 0, "Write and verify(16)"},
165     {0x8f, 0, "Verify(16)"},
166     {0x90, 0, "Pre-fetch(16)"},
167     {0x91, 0, "Synchronize cache(16)"},
168     {0x91, PDT_TAPE, "Space(16)"},
169     {0x92, 0, "Lock unlock cache(16)"},
170     {0x92, PDT_TAPE, "Locate(16)"},
171     {0x93, 0, "Write same(16)"},
172     {0x93, PDT_TAPE, "Erase(16)"},
173     {0x94, PDT_ZBC, "ZBC out"},  /* new sbc4r04, has service actions */
174     {0x95, PDT_ZBC, "ZBC in"},   /* new sbc4r04, has service actions */
175     {0x9a, 0, "Write stream(16)"},      /* added sbc4r07 */
176     {0x9b, 0, "Read buffer(16)"},       /* added spc5r02 */
177     {0x9c, 0, "Write atomic(16)"},
178     {0x9d, 0, "Service action bidirectional"},  /* added spc4r35 */
179     {0x9e, 0, "Service action in(16)"},
180     {0x9f, 0, "Service action out(16)"},
181     {0xa0, 0, "Report luns"},
182     {0xa1, 0, "ATA pass-through(12)"},
183     {0xa1, PDT_MMC, "Blank"},
184     {0xa2, 0, "Security protocol in"},
185     {0xa3, 0, "Maintenance in"},
186     {0xa3, PDT_MMC, "Send key"},
187     {0xa4, 0, "Maintenance out"},
188     {0xa4, PDT_MMC, "Report key"},
189     {0xa5, 0, "Move medium"},
190     {0xa5, PDT_MMC, "Play audio(12)"},
191     {0xa6, 0, "Exchange medium"},
192     {0xa6, PDT_MMC, "Load/unload medium"},
193     {0xa7, 0, "Move medium attached"},
194     {0xa7, PDT_MMC, "Set read ahead"},
195     {0xa8, 0, "Read(12)"},      /* SBC-3 r31 recommends Read(16) */
196     {0xa9, 0, "Service action out(12)"},
197     {0xaa, 0, "Write(12)"},     /* SBC-3 r31 recommends Write(16) */
198     {0xab, 0, "Service action in(12)"},
199     {0xac, 0, "erase(12)"},
200     {0xac, PDT_MMC, "Get performance"},
201     {0xad, PDT_MMC, "Read DVD/BD structure"},
202     {0xae, 0, "Write and verify(12)"},
203                         /* SBC-3 r31 recommends Write and verify(16) */
204     {0xaf, 0, "Verify(12)"},    /* SBC-3 r31 recommends Verify(16) */
205     {0xb0, 0, "Search data high(12)"},
206     {0xb1, 0, "Search data equal(12)"},
207     {0xb1, PDT_MCHANGER, "Open/close import/export element"},
208     {0xb2, 0, "Search data low(12)"},
209     {0xb3, 0, "Set limits(12)"},
210     {0xb4, 0, "Read element status attached"},
211     {0xb5, 0, "Security protocol out"},
212     {0xb5, PDT_MCHANGER, "Request volume element address"},
213     {0xb6, 0, "Send volume tag"},
214     {0xb6, PDT_MMC, "Set streaming"},
215     {0xb7, 0, "Read defect data(12)"},
216     {0xb8, 0, "Read element status"},
217     {0xb9, 0, "Read CD msf"},
218     {0xba, 0, "Redundancy group in"},
219     {0xba, PDT_MMC, "Scan"},
220     {0xbb, 0, "Redundancy group out"},
221     {0xbb, PDT_MMC, "Set CD speed"},
222     {0xbc, 0, "Spare in"},
223     {0xbd, 0, "Spare out"},
224     {0xbd, PDT_MMC, "Mechanism status"},
225     {0xbe, 0, "Volume set in"},
226     {0xbe, PDT_MMC, "Read CD"},
227     {0xbf, 0, "Volume set out"},
228     {0xbf, PDT_MMC, "Send DVD/BD structure"},
229     {0xffff, 0, NULL},
230 };
231 
232 /* Read buffer(10) [0x3c] and Read buffer(16) [0x9b] service actions (sa),
233  * need prefix */
234 struct sg_lib_value_name_t sg_lib_read_buff_arr[] = {
235     {0x0, 0, "combined header and data [or multiple modes]"},
236     {0x2, 0, "data"},
237     {0x3, 0, "descriptor"},
238     {0xa, 0, "read data from echo buffer"},
239     {0xb, 0, "echo buffer descriptor"},
240     {0x1a, 0, "enable expander comms protocol and echo buffer"},
241     {0x1c, 0, "error history"},
242     {0xffff, 0, NULL},
243 };
244 
245 /* Write buffer [0x3b] service actions, need prefix */
246 struct sg_lib_value_name_t sg_lib_write_buff_arr[] = {
247     {0x0, 0, "combined header and data [or multiple modes]"},
248     {0x2, 0, "data"},
249     {0x4, 0, "download microcode and activate"},
250     {0x5, 0, "download microcode, save, and activate"},
251     {0x6, 0, "download microcode with offsets and activate"},
252     {0x7, 0, "download microcode with offsets, save, and activate"},
253     {0xa, 0, "write data to echo buffer"},
254     {0xd, 0, "download microcode with offsets, select activation events, "
255              "save and defer activate"},
256     {0xe, 0, "download microcode with offsets, save and defer activate"},
257     {0xf, 0, "activate deferred microcode"},
258     {0x1a, 0, "enable expander comms protocol and echo buffer"},
259     {0x1b, 0, "disable expander comms protocol"},
260     {0x1c, 0, "download application client error history"},
261     {0xffff, 0, NULL},
262 };
263 
264 /* Read position (SSC) [0x34] service actions, need prefix */
265 struct sg_lib_value_name_t sg_lib_read_pos_arr[] = {
266     {0x0, PDT_TAPE, "short form - block id"},
267     {0x1, PDT_TAPE, "short form - vendor specific"},
268     {0x6, PDT_TAPE, "long form"},
269     {0x8, PDT_TAPE, "extended form"},
270     {0xffff, 0, NULL},
271 };
272 
273 /* Maintenance in [0xa3] service actions */
274 struct sg_lib_value_name_t sg_lib_maint_in_arr[] = {
275     {0x0, PDT_SAC, "Report assigned/unassigned p_extent"},
276     {0x1, PDT_SAC, "Report component device"},
277     {0x2, PDT_SAC, "Report component device attachments"},
278     {0x3, PDT_SAC, "Report peripheral device"},
279     {0x4, PDT_SAC, "Report peripheral device associations"},
280     {0x5, 0, "Report identifying information"},
281                 /* was "Report device identifier" prior to spc4r07 */
282     {0x6, PDT_SAC, "Report states"},
283     {0x7, PDT_SAC, "Report device identification"},
284     {0x8, PDT_SAC, "Report unconfigured capacity"},
285     {0x9, PDT_SAC, "Report supported configuration method"},
286     {0xa, 0, "Report target port groups"},
287     {0xb, 0, "Report aliases"},
288     {0xc, 0, "Report supported operation codes"},
289     {0xd, 0, "Report supported task management functions"},
290     {0xe, 0, "Report priority"},
291     {0xf, 0, "Report timestamp"},
292     {0x10, 0, "Management protocol in"},
293     {0x1d, PDT_DISK, "Report provisioning initialization pattern"},
294         /* added in sbc4r07, shares sa 0x1d with ssc5r01 (tape) */
295     {0x1d, PDT_TAPE, "Receive recommended access order"},
296     {0x1e, PDT_TAPE, "Read dynamic runtime attribute"},
297     {0x1e, PDT_ADC, "Report automation device attributes"},
298     {0x1f, 0, "Maintenance in vendor specific"},
299     {0xffff, 0, NULL},
300 };
301 
302 /* Maintenance out [0xa4] service actions */
303 struct sg_lib_value_name_t sg_lib_maint_out_arr[] = {
304     {0x0, PDT_SAC, "Add peripheral device / component device"},
305     {0x1, PDT_SAC, "Attach to component device"},
306     {0x2, PDT_SAC, "Exchange p_extent"},
307     {0x3, PDT_SAC, "Exchange peripheral device / component device"},
308     {0x4, PDT_SAC, "Instruct component device"},
309     {0x5, PDT_SAC, "Remove peripheral device / component device"},
310     {0x6, 0, "Set identifying information"},
311                 /* was "Set device identifier" prior to spc4r07 */
312     {0x7, PDT_SAC, "Break peripheral device / component device"},
313     {0xa, 0, "Set target port groups"},
314     {0xb, 0, "Change aliases"},
315     {0xc, 0, "Remove I_T nexus"},
316     {0xe, 0, "Set priority"},
317     {0xf, 0, "Set timestamp"},
318     {0x10, 0, "Management protocol out"},
319     {0x1d, PDT_TAPE, "Generate recommended access order"},
320     {0x1e, PDT_TAPE, "write dynamic runtime attribute"},
321     {0x1e, PDT_ADC, "Set automation device attributes"},
322     {0x1f, 0, "Maintenance out vendor specific"},
323     {0xffff, 0, NULL},
324 };
325 
326 /* Sanitize [0x48] service actions, need prefix */
327 struct sg_lib_value_name_t sg_lib_sanitize_sa_arr[] = {
328     {0x1, 0, "overwrite"},
329     {0x2, 0, "block erase"},
330     {0x3, 0, "cryptographic erase"},
331     {0x1f, 0, "exit failure mode"},
332     {0xffff, 0, NULL},
333 };
334 
335 /* Service action in(12) [0xab] service actions */
336 struct sg_lib_value_name_t sg_lib_serv_in12_arr[] = {
337     {0x1, 0, "Read media serial number"},
338     {0xffff, 0, NULL},
339 };
340 
341 /* Service action out(12) [0xa9] service actions */
342 struct sg_lib_value_name_t sg_lib_serv_out12_arr[] = {
343     {0xff, 0, "Impossible command name"},
344     {0xffff, 0, NULL},
345 };
346 
347 /* Service action in(16) [0x9e] service actions */
348 struct sg_lib_value_name_t sg_lib_serv_in16_arr[] = {
349     {0xf, 0, "Receive binding report"}, /* added spc5r11 */
350     {0x10, 0, "Read capacity(16)"},
351     {0x11, 0, "Read long(16)"},         /* obsolete in SBC-4 r7 */
352     {0x12, 0, "Get LBA status(16)"},    /* 32 byte variant added in sbc4r14 */
353     {0x13, 0, "Report referrals"},
354     {0x14, 0, "Stream control"},
355     {0x15, 0, "Background control"},
356     {0x16, 0, "Get stream status"},
357     {0x17, 0, "Get physical element status"},   /* added sbc4r13 */
358     {0x18, 0, "Remove element and truncate"},   /* added sbc4r13 */
359     {0xffff, 0, NULL},
360 };
361 
362 /* Service action out(16) [0x9f] service actions */
363 struct sg_lib_value_name_t sg_lib_serv_out16_arr[] = {
364     {0x0b, 0, "Test bind"},             /* added spc5r13 */
365     {0x0c, 0, "Prepare bind report"},   /* added spc5r11 */
366     {0x0d, 0, "Set affiliation"},
367     {0x0e, 0, "Bind"},
368     {0x0f, 0, "Unbind"},
369     {0x11, 0, "Write long(16)"},
370     {0x12, 0, "Write scattered(16)"},   /* added sbc4r11 */
371     {0x14, PDT_ZBC, "Reset write pointer"},
372     {0x1f, PDT_ADC, "Notify data transfer device(16)"},
373     {0xffff, 0, NULL},
374 };
375 
376 /* Service action bidirectional [0x9d] service actions */
377 struct sg_lib_value_name_t sg_lib_serv_bidi_arr[] = {
378     {0xffff, 0, NULL},
379 };
380 
381 /* Persistent reserve in [0x5e] service actions, need prefix */
382 struct sg_lib_value_name_t sg_lib_pr_in_arr[] = {
383     {0x0, 0, "read keys"},
384     {0x1, 0, "read reservation"},
385     {0x2, 0, "report capabilities"},
386     {0x3, 0, "read full status"},
387     {0xffff, 0, NULL},
388 };
389 
390 /* Persistent reserve out [0x5f] service actions, need prefix */
391 struct sg_lib_value_name_t sg_lib_pr_out_arr[] = {
392     {0x0, 0, "register"},
393     {0x1, 0, "reserve"},
394     {0x2, 0, "release"},
395     {0x3, 0, "clear"},
396     {0x4, 0, "preempt"},
397     {0x5, 0, "preempt and abort"},
398     {0x6, 0, "register and ignore existing key"},
399     {0x7, 0, "register and move"},
400     {0x8, 0, "replace lost reservation"},
401     {0xffff, 0, NULL},
402 };
403 
404 /* Third party copy in [0x83] service actions
405  * Opcode 'Receive copy results' was renamed 'Third party copy in' in spc4r34
406  * LID1 is an abbreviation of List Identifier length of 1 byte */
407 struct sg_lib_value_name_t sg_lib_xcopy_sa_arr[] = {
408     {0x0, 0, "Extended copy(LID1)"},
409     {0x1, 0, "Extended copy(LID4)"},
410     {0x10, 0, "Populate token"},
411     {0x11, 0, "Write using token"},
412     {0x1c, 0, "Copy operation abort"},
413     {0xffff, 0, NULL},
414 };
415 
416 /* Third party copy out [0x84] service actions
417  * Opcode 'Extended copy' was renamed 'Third party copy out' in spc4r34
418  * LID4 is an abbreviation of List Identifier length of 4 bytes */
419 struct sg_lib_value_name_t sg_lib_rec_copy_sa_arr[] = {
420     {0x0, 0, "Receive copy status(LID1)"},
421     {0x1, 0, "Receive copy data(LID1)"},
422     {0x3, 0, "Receive copy operating parameters"},
423     {0x4, 0, "Receive copy failure details(LID1)"},
424     {0x5, 0, "Receive copy status(LID4)"},
425     {0x6, 0, "Receive copy data(LID4)"},
426     {0x7, 0, "Receive ROD token information"},
427     {0x8, 0, "Report all ROD tokens"},
428     {0xffff, 0, NULL},
429 };
430 
431 /* Variable length cdb [0x7f] service actions (more than 16 bytes long) */
432 struct sg_lib_value_name_t sg_lib_variable_length_arr[] = {
433     {0x1, 0, "Rebuild(32)"},
434     {0x2, 0, "Regenerate(32)"},
435     {0x3, 0, "Xdread(32)"},             /* obsolete in SBC-3 r31 */
436     {0x4, 0, "Xdwrite(32)"},            /* obsolete in SBC-3 r31 */
437     {0x5, 0, "Xdwrite extended(32)"},   /* obsolete in SBC-4 r15 */
438     {0x6, 0, "Xpwrite(32)"},            /* obsolete in SBC-4 r15 */
439     {0x7, 0, "Xdwriteread(32)"},        /* obsolete in SBC-4 r15 */
440     {0x8, 0, "Xdwrite extended(64)"},   /* obsolete in SBC-4 r15 */
441     {0x9, 0, "Read(32)"},
442     {0xa, 0, "Verify(32)"},
443     {0xb, 0, "Write(32)"},
444     {0xc, 0, "Write and verify(32)"},
445     {0xd, 0, "Write same(32)"},
446     {0xe, 0, "Orwrite(32)"},            /* added sbc3r25 */
447     {0xf, 0, "Atomic write(32)"},       /* added sbc4r02 */
448     {0x10, 0, "Write stream(32)"},      /* added sbc4r07 */
449     {0x11, 0, "Write scattered(32)"},   /* added sbc4r11 */
450     {0x12, 0, "Get LBA status(32)"},    /* added sbc4r14 */
451     {0x1800, 0, "Receive credential"},
452     {0x1ff0, 0, "ATA pass-through(32)"},/* added sat4r05 */
453     {0x8801, 0, "Format OSD (osd)"},
454     {0x8802, 0, "Create (osd)"},
455     {0x8803, 0, "List (osd)"},
456     {0x8805, 0, "Read (osd)"},
457     {0x8806, 0, "Write (osd)"},
458     {0x8807, 0, "Append (osd)"},
459     {0x8808, 0, "Flush (osd)"},
460     {0x880a, 0, "Remove (osd)"},
461     {0x880b, 0, "Create partition (osd)"},
462     {0x880c, 0, "Remove partition (osd)"},
463     {0x880e, 0, "Get attributes (osd)"},
464     {0x880f, 0, "Set attributes (osd)"},
465     {0x8812, 0, "Create and write (osd)"},
466     {0x8815, 0, "Create collection (osd)"},
467     {0x8816, 0, "Remove collection (osd)"},
468     {0x8817, 0, "List collection (osd)"},
469     {0x8818, 0, "Set key (osd)"},
470     {0x8819, 0, "Set master key (osd)"},
471     {0x881a, 0, "Flush collection (osd)"},
472     {0x881b, 0, "Flush partition (osd)"},
473     {0x881c, 0, "Flush OSD (osd)"},
474     {0x8880, 0, "Object structure check (osd-2)"},
475     {0x8881, 0, "Format OSD (osd-2)"},
476     {0x8882, 0, "Create (osd-2)"},
477     {0x8883, 0, "List (osd-2)"},
478     {0x8884, 0, "Punch (osd-2)"},
479     {0x8885, 0, "Read (osd-2)"},
480     {0x8886, 0, "Write (osd-2)"},
481     {0x8887, 0, "Append (osd-2)"},
482     {0x8888, 0, "Flush (osd-2)"},
483     {0x8889, 0, "Clear (osd-2)"},
484     {0x888a, 0, "Remove (osd-2)"},
485     {0x888b, 0, "Create partition (osd-2)"},
486     {0x888c, 0, "Remove partition (osd-2)"},
487     {0x888e, 0, "Get attributes (osd-2)"},
488     {0x888f, 0, "Set attributes (osd-2)"},
489     {0x8892, 0, "Create and write (osd-2)"},
490     {0x8895, 0, "Create collection (osd-2)"},
491     {0x8896, 0, "Remove collection (osd-2)"},
492     {0x8897, 0, "List collection (osd-2)"},
493     {0x8898, 0, "Set key (osd-2)"},
494     {0x8899, 0, "Set master key (osd-2)"},
495     {0x889a, 0, "Flush collection (osd-2)"},
496     {0x889b, 0, "Flush partition (osd-2)"},
497     {0x889c, 0, "Flush OSD (osd-2)"},
498     {0x88a0, 0, "Query (osd-2)"},
499     {0x88a1, 0, "Remove member objects (osd-2)"},
500     {0x88a2, 0, "Get member attributes (osd-2)"},
501     {0x88a3, 0, "Set member attributes (osd-2)"},
502     {0x88b1, 0, "Read map (osd-2)"},
503     {0x8f7c, 0, "Perform SCSI command (osd-2)"},
504     {0x8f7d, 0, "Perform task management function (osd-2)"},
505     {0x8f7e, 0, "Perform SCSI command (osd)"},
506     {0x8f7f, 0, "Perform task management function (osd)"},
507     {0xffff, 0, NULL},
508 };
509 
510 /* Zoning out [0x94] service actions */
511 struct sg_lib_value_name_t sg_lib_zoning_out_arr[] = {
512     {0x1, PDT_ZBC, "Close zone"},
513     {0x2, PDT_ZBC, "Finish zone"},
514     {0x3, PDT_ZBC, "Open zone"},
515     {0x4, PDT_ZBC, "Reset write pointer"},
516     {0xffff, 0, NULL},
517 };
518 
519 /* Zoning in [0x95] service actions */
520 struct sg_lib_value_name_t sg_lib_zoning_in_arr[] = {
521     {0x0, PDT_ZBC, "Report zones"},
522     {0xffff, 0, NULL},
523 };
524 
525 /* Read attribute [0x8c] service actions */
526 struct sg_lib_value_name_t sg_lib_read_attr_arr[] = {
527     {0x0, 0, "attribute values"},
528     {0x1, 0, "attribute list"},
529     {0x2, 0, "logical volume list"},
530     {0x3, 0, "partition list"},
531     {0x5, 0, "supported attributes"},
532     {0xffff, 0, NULL},
533 };
534 
535 #else   /* SG_SCSI_STRINGS */
536 
537 struct sg_lib_value_name_t sg_lib_normal_opcodes[] = {
538     {0xffff, 0, NULL},
539 };
540 
541 struct sg_lib_value_name_t sg_lib_read_buff_arr[] = {  /* opcode 0x3c */
542     {0xffff, 0, NULL},
543 };
544 
545 struct sg_lib_value_name_t sg_lib_write_buff_arr[] = {  /* opcode 0x3b */
546     {0xffff, 0, NULL},
547 };
548 
549 struct sg_lib_value_name_t sg_lib_read_pos_arr[] = {  /* opcode 0x34 */
550     {0xffff, 0, NULL},
551 };
552 
553 struct sg_lib_value_name_t sg_lib_maint_in_arr[] = {  /* opcode 0xa3 */
554     {0xffff, 0, NULL},
555 };
556 
557 struct sg_lib_value_name_t sg_lib_maint_out_arr[] = {  /* opcode 0xa4 */
558     {0xffff, 0, NULL},
559 };
560 
561 struct sg_lib_value_name_t sg_lib_sanitize_sa_arr[] = {  /* opcode 0x94 */
562     {0xffff, 0, NULL},
563 };
564 
565 struct sg_lib_value_name_t sg_lib_serv_in12_arr[] = { /* opcode 0xab */
566     {0xffff, 0, NULL},
567 };
568 
569 struct sg_lib_value_name_t sg_lib_serv_out12_arr[] = { /* opcode 0xa9 */
570     {0xffff, 0, NULL},
571 };
572 
573 struct sg_lib_value_name_t sg_lib_serv_in16_arr[] = { /* opcode 0x9e */
574     {0xffff, 0, NULL},
575 };
576 
577 struct sg_lib_value_name_t sg_lib_serv_out16_arr[] = { /* opcode 0x9f */
578     {0xffff, 0, NULL},
579 };
580 
581 struct sg_lib_value_name_t sg_lib_serv_bidi_arr[] = { /* opcode 0x9d */
582     {0xffff, 0, NULL},
583 };
584 
585 struct sg_lib_value_name_t sg_lib_pr_in_arr[] = { /* opcode 0x5e */
586     {0xffff, 0, NULL},
587 };
588 
589 struct sg_lib_value_name_t sg_lib_pr_out_arr[] = { /* opcode 0x5f */
590     {0xffff, 0, NULL},
591 };
592 
593 struct sg_lib_value_name_t sg_lib_xcopy_sa_arr[] = { /* opcode 0x83 */
594     {0xffff, 0, NULL},
595 };
596 
597 struct sg_lib_value_name_t sg_lib_rec_copy_sa_arr[] = { /* opcode 0x84 */
598     {0xffff, 0, NULL},
599 };
600 
601 struct sg_lib_value_name_t sg_lib_variable_length_arr[] = {
602     {0xffff, 0, NULL},
603 };
604 
605 struct sg_lib_value_name_t sg_lib_zoning_out_arr[] = {
606     {0xffff, 0, NULL},
607 };
608 
609 struct sg_lib_value_name_t sg_lib_zoning_in_arr[] = {
610     {0xffff, 0, NULL},
611 };
612 
613 struct sg_lib_value_name_t sg_lib_read_attr_arr[] = {
614     {0xffff, 0, NULL},
615 };
616 
617 #endif  /* SG_SCSI_STRINGS */
618 
619 /* A conveniently formatted list of SCSI ASC/ASCQ codes and their
620  * corresponding text can be found at: www.t10.org/lists/asc-num.txt
621  * The following should match asc-num.txt dated 20150423 */
622 
623 #ifdef SG_SCSI_STRINGS
624 struct sg_lib_asc_ascq_range_t sg_lib_asc_ascq_range[] =
625 {
626     {0x40,0x01,0x7f,"Ram failure [0x%x]"},
627     {0x40,0x80,0xff,"Diagnostic failure on component [0x%x]"},
628     {0x41,0x01,0xff,"Data path failure [0x%x]"},
629     {0x42,0x01,0xff,"Power-on or self-test failure [0x%x]"},
630     {0x4d,0x00,0xff,"Tagged overlapped commands [0x%x]"},
631     {0x70,0x00,0xff,"Decompression exception short algorithm id of 0x%x"},
632     {0, 0, 0, NULL}
633 };
634 
635 struct sg_lib_asc_ascq_t sg_lib_asc_ascq[] =
636 {
637     {0x00,0x00,"No additional sense information"},
638     {0x00,0x01,"Filemark detected"},
639     {0x00,0x02,"End-of-partition/medium detected"},
640     {0x00,0x03,"Setmark detected"},
641     {0x00,0x04,"Beginning-of-partition/medium detected"},
642     {0x00,0x05,"End-of-data detected"},
643     {0x00,0x06,"I/O process terminated"},
644     {0x00,0x07,"Programmable early warning detected"},
645     {0x00,0x11,"Audio play operation in progress"},
646     {0x00,0x12,"Audio play operation paused"},
647     {0x00,0x13,"Audio play operation successfully completed"},
648     {0x00,0x14,"Audio play operation stopped due to error"},
649     {0x00,0x15,"No current audio status to return"},
650     {0x00,0x16,"operation in progress"},
651     {0x00,0x17,"Cleaning requested"},
652     {0x00,0x18,"Erase operation in progress"},
653     {0x00,0x19,"Locate operation in progress"},
654     {0x00,0x1a,"Rewind operation in progress"},
655     {0x00,0x1b,"Set capacity operation in progress"},
656     {0x00,0x1c,"Verify operation in progress"},
657     {0x00,0x1d,"ATA pass through information available"},
658     {0x00,0x1e,"Conflicting SA creation request"},
659     {0x00,0x1f,"Logical unit transitioning to another power condition"},
660     {0x00,0x20,"Extended copy information available"},
661     {0x00,0x21,"Atomic command aborted due to ACA"},
662     {0x00,0x22,"Deferred microcode is pending"},
663     {0x01,0x00,"No index/sector signal"},
664     {0x02,0x00,"No seek complete"},
665     {0x03,0x00,"Peripheral device write fault"},
666     {0x03,0x01,"No write current"},
667     {0x03,0x02,"Excessive write errors"},
668     {0x04,0x00,"Logical unit not ready, cause not reportable"},
669     {0x04,0x01,"Logical unit is in process of becoming ready"},
670     {0x04,0x02,"Logical unit not ready, "
671                 "initializing command required"},
672     {0x04,0x03,"Logical unit not ready, "
673                 "manual intervention required"},
674     {0x04,0x04,"Logical unit not ready, format in progress"},
675     {0x04,0x05,"Logical unit not ready, rebuild in progress"},
676     {0x04,0x06,"Logical unit not ready, recalculation in progress"},
677     {0x04,0x07,"Logical unit not ready, operation in progress"},
678     {0x04,0x08,"Logical unit not ready, long write in progress"},
679     {0x04,0x09,"Logical unit not ready, self-test in progress"},
680     {0x04,0x0a,"Logical unit "
681                 "not accessible, asymmetric access state transition"},
682     {0x04,0x0b,"Logical unit "
683                 "not accessible, target port in standby state"},
684     {0x04,0x0c,"Logical unit "
685                 "not accessible, target port in unavailable state"},
686     {0x04,0x0d,"Logical unit not ready, structure check required"},
687     {0x04,0x0e,"Logical unit not ready, security session in progress"},
688     {0x04,0x10,"Logical unit not ready, "
689                 "auxiliary memory not accessible"},
690     {0x04,0x11,"Logical unit not ready, "
691                 "notify (enable spinup) required"},
692     {0x04,0x12,"Logical unit not ready, offline"},
693     {0x04,0x13,"Logical unit not ready, SA creation in progress"},
694     {0x04,0x14,"Logical unit not ready, space allocation in progress"},
695     {0x04,0x15,"Logical unit not ready, robotics disabled"},
696     {0x04,0x16,"Logical unit not ready, configuration required"},
697     {0x04,0x17,"Logical unit not ready, calibration required"},
698     {0x04,0x18,"Logical unit not ready, a door is open"},
699     {0x04,0x19,"Logical unit not ready, operating in sequential mode"},
700     {0x04,0x1a,"Logical unit not ready, start stop unit command in progress"},
701     {0x04,0x1b,"Logical unit not ready, sanitize in progress"},
702     {0x04,0x1c,"Logical unit not ready, additional power use not yet "
703                 "granted"},
704     {0x04,0x1d,"Logical unit not ready, configuration in progress"},
705     {0x04,0x1e,"Logical unit not ready, microcode activation required"},
706     {0x04,0x1f,"Logical unit not ready, microcode download required"},
707     {0x04,0x20,"Logical unit not ready, logical unit reset required"},
708     {0x04,0x21,"Logical unit not ready, hard reset required"},
709     {0x04,0x22,"Logical unit not ready, power cycle required"},
710     {0x04,0x23,"Logical unit not ready, affiliation required"},
711     {0x05,0x00,"Logical unit does not respond to selection"},
712     {0x06,0x00,"No reference position found"},
713     {0x07,0x00,"Multiple peripheral devices selected"},
714     {0x08,0x00,"Logical unit communication failure"},
715     {0x08,0x01,"Logical unit communication time-out"},
716     {0x08,0x02,"Logical unit communication parity error"},
717     {0x08,0x03,"Logical unit communication CRC error (Ultra-DMA/32)"},
718     {0x08,0x04,"Unreachable copy target"},
719     {0x09,0x00,"Track following error"},
720     {0x09,0x01,"Tracking servo failure"},
721     {0x09,0x02,"Focus servo failure"},
722     {0x09,0x03,"Spindle servo failure"},
723     {0x09,0x04,"Head select fault"},
724     {0x09,0x05,"Vibration induced tracking error"},
725     {0x0A,0x00,"Error log overflow"},
726     {0x0B,0x00,"Warning"},
727     {0x0B,0x01,"Warning - specified temperature exceeded"},
728     {0x0B,0x02,"Warning - enclosure degraded"},
729     {0x0B,0x03,"Warning - background self-test failed"},
730     {0x0B,0x04,"Warning - background pre-scan detected medium error"},
731     {0x0B,0x05,"Warning - background medium scan detected medium error"},
732     {0x0B,0x06,"Warning - non-volatile cache now volatile"},
733     {0x0B,0x07,"Warning - degraded power to non-volatile cache"},
734     {0x0B,0x08,"Warning - power loss expected"},
735     {0x0B,0x09,"Warning - device statistics notification active"},
736     {0x0B,0x0A,"Warning - high critical temperature limit exceeded"},
737     {0x0B,0x0B,"Warning - low critical temperature limit exceeded"},
738     {0x0B,0x0C,"Warning - high operating temperature limit exceeded"},
739     {0x0B,0x0D,"Warning - low operating temperature limit exceeded"},
740     {0x0B,0x0E,"Warning - high critical humidity limit exceeded"},
741     {0x0B,0x0F,"Warning - low critical humidity limit exceeded"},
742     {0x0B,0x10,"Warning - high operating humidity limit exceeded"},
743     {0x0B,0x11,"Warning - low operating humidity limit exceeded"},
744     {0x0B,0x12,"Warning - microcode security at risk"},
745     {0x0B,0x13,"Warning - microcode digital signature validation failure"},
746     {0x0C,0x00,"Write error"},
747     {0x0C,0x01,"Write error - recovered with auto reallocation"},
748     {0x0C,0x02,"Write error - auto reallocation failed"},
749     {0x0C,0x03,"Write error - recommend reassignment"},
750     {0x0C,0x04,"Compression check miscompare error"},
751     {0x0C,0x05,"Data expansion occurred during compression"},
752     {0x0C,0x06,"Block not compressible"},
753     {0x0C,0x07,"Write error - recovery needed"},
754     {0x0C,0x08,"Write error - recovery failed"},
755     {0x0C,0x09,"Write error - loss of streaming"},
756     {0x0C,0x0A,"Write error - padding blocks added"},
757     {0x0C,0x0B,"Auxiliary memory write error"},
758     {0x0C,0x0C,"Write error - unexpected unsolicited data"},
759     {0x0C,0x0D,"Write error - not enough unsolicited data"},
760     {0x0C,0x0E,"Multiple write errors"},
761     {0x0C,0x0F,"Defects in error window"},
762     {0x0C,0x10,"Incomplete multiple atomic write operations"},
763     {0x0C,0x11,"Write error - recovery scan needed"},
764     {0x0C,0x12,"Write error - insufficient zone resources"},
765     {0x0D,0x00,"Error detected by third party temporary initiator"},
766     {0x0D,0x01,"Third party device failure"},
767     {0x0D,0x02,"Copy target device not reachable"},
768     {0x0D,0x03,"Incorrect copy target device type"},
769     {0x0D,0x04,"Copy target device data underrun"},
770     {0x0D,0x05,"Copy target device data overrun"},
771     {0x0E,0x00,"Invalid information unit"},
772     {0x0E,0x01,"Information unit too short"},
773     {0x0E,0x02,"Information unit too long"},
774     {0x0E,0x03,"Invalid field in command information unit"},
775     {0x10,0x00,"Id CRC or ECC error"},
776     {0x10,0x01,"Logical block guard check failed"},
777     {0x10,0x02,"Logical block application tag check failed"},
778     {0x10,0x03,"Logical block reference tag check failed"},
779     {0x10,0x04,"Logical block protection error on recover buffered data"},
780     {0x10,0x05,"Logical block protection method error"},
781     {0x11,0x00,"Unrecovered read error"},
782     {0x11,0x01,"Read retries exhausted"},
783     {0x11,0x02,"Error too long to correct"},
784     {0x11,0x03,"Multiple read errors"},
785     {0x11,0x04,"Unrecovered read error - auto reallocate failed"},
786     {0x11,0x05,"L-EC uncorrectable error"},
787     {0x11,0x06,"CIRC unrecovered error"},
788     {0x11,0x07,"Data re-synchronization error"},
789     {0x11,0x08,"Incomplete block read"},
790     {0x11,0x09,"No gap found"},
791     {0x11,0x0A,"Miscorrected error"},
792     {0x11,0x0B,"Unrecovered read error - recommend reassignment"},
793     {0x11,0x0C,"Unrecovered read error - recommend rewrite the data"},
794     {0x11,0x0D,"De-compression CRC error"},
795     {0x11,0x0E,"Cannot decompress using declared algorithm"},
796     {0x11,0x0F,"Error reading UPC/EAN number"},
797     {0x11,0x10,"Error reading ISRC number"},
798     {0x11,0x11,"Read error - loss of streaming"},
799     {0x11,0x12,"Auxiliary memory read error"},
800     {0x11,0x13,"Read error - failed retransmission request"},
801     {0x11,0x14,"Read error - LBA marked bad by application client"},
802     {0x11,0x15,"Write after sanitize required"},
803     {0x12,0x00,"Address mark not found for id field"},
804     {0x13,0x00,"Address mark not found for data field"},
805     {0x14,0x00,"Recorded entity not found"},
806     {0x14,0x01,"Record not found"},
807     {0x14,0x02,"Filemark or setmark not found"},
808     {0x14,0x03,"End-of-data not found"},
809     {0x14,0x04,"Block sequence error"},
810     {0x14,0x05,"Record not found - recommend reassignment"},
811     {0x14,0x06,"Record not found - data auto-reallocated"},
812     {0x14,0x07,"Locate operation failure"},
813     {0x15,0x00,"Random positioning error"},
814     {0x15,0x01,"Mechanical positioning error"},
815     {0x15,0x02,"Positioning error detected by read of medium"},
816     {0x16,0x00,"Data synchronization mark error"},
817     {0x16,0x01,"Data sync error - data rewritten"},
818     {0x16,0x02,"Data sync error - recommend rewrite"},
819     {0x16,0x03,"Data sync error - data auto-reallocated"},
820     {0x16,0x04,"Data sync error - recommend reassignment"},
821     {0x17,0x00,"Recovered data with no error correction applied"},
822     {0x17,0x01,"Recovered data with retries"},
823     {0x17,0x02,"Recovered data with positive head offset"},
824     {0x17,0x03,"Recovered data with negative head offset"},
825     {0x17,0x04,"Recovered data with retries and/or circ applied"},
826     {0x17,0x05,"Recovered data using previous sector id"},
827     {0x17,0x06,"Recovered data without ECC - data auto-reallocated"},
828     {0x17,0x07,"Recovered data without ECC - recommend reassignment"},
829     {0x17,0x08,"Recovered data without ECC - recommend rewrite"},
830     {0x17,0x09,"Recovered data without ECC - data rewritten"},
831     {0x18,0x00,"Recovered data with error correction applied"},
832     {0x18,0x01,"Recovered data with error corr. & retries applied"},
833     {0x18,0x02,"Recovered data - data auto-reallocated"},
834     {0x18,0x03,"Recovered data with CIRC"},
835     {0x18,0x04,"Recovered data with L-EC"},
836     {0x18,0x05,"Recovered data - recommend reassignment"},
837     {0x18,0x06,"Recovered data - recommend rewrite"},
838     {0x18,0x07,"Recovered data with ECC - data rewritten"},
839     {0x18,0x08,"Recovered data with linking"},
840     {0x19,0x00,"Defect list error"},
841     {0x19,0x01,"Defect list not available"},
842     {0x19,0x02,"Defect list error in primary list"},
843     {0x19,0x03,"Defect list error in grown list"},
844     {0x1A,0x00,"Parameter list length error"},
845     {0x1B,0x00,"Synchronous data transfer error"},
846     {0x1C,0x00,"Defect list not found"},
847     {0x1C,0x01,"Primary defect list not found"},
848     {0x1C,0x02,"Grown defect list not found"},
849     {0x1D,0x00,"Miscompare during verify operation"},
850     {0x1D,0x01,"Miscompare verify of unmapped lba"},
851     {0x1E,0x00,"Recovered id with ECC correction"},
852     {0x1F,0x00,"Partial defect list transfer"},
853     {0x20,0x00,"Invalid command operation code"},
854     {0x20,0x01,"Access denied - initiator pending-enrolled"},
855     {0x20,0x02,"Access denied - no access rights"},
856     {0x20,0x03,"Access denied - invalid mgmt id key"},
857     {0x20,0x04,"Illegal command while in write capable state"},
858     {0x20,0x05,"Write type operation while in read capable state (obs)"},
859     {0x20,0x06,"Illegal command while in explicit address mode"},
860     {0x20,0x07,"Illegal command while in implicit address mode"},
861     {0x20,0x08,"Access denied - enrollment conflict"},
862     {0x20,0x09,"Access denied - invalid LU identifier"},
863     {0x20,0x0A,"Access denied - invalid proxy token"},
864     {0x20,0x0B,"Access denied - ACL LUN conflict"},
865     {0x20,0x0C,"Illegal command when not in append-only mode"},
866     {0x20,0x0D,"Not an administrative logical unit"},
867     {0x20,0x0E,"Not a subsidiary logical unit"},
868     {0x20,0x0F,"Not a conglomerate logical unit"},
869     {0x21,0x00,"Logical block address out of range"},
870     {0x21,0x01,"Invalid element address"},
871     {0x21,0x02,"Invalid address for write"},
872     {0x21,0x03,"Invalid write crossing layer jump"},
873     {0x21,0x04,"Unaligned write command"},
874     {0x21,0x05,"Write boundary violation"},
875     {0x21,0x06,"Attempt to read invalid data"},
876     {0x21,0x07,"Read boundary violation"},
877     {0x21,0x08,"Misaligned write command"},
878     {0x22,0x00,"Illegal function (use 20 00, 24 00, or 26 00)"},
879     {0x23,0x00,"Invalid token operation, cause not reportable"},
880     {0x23,0x01,"Invalid token operation, unsupported token type"},
881     {0x23,0x02,"Invalid token operation, remote token usage not supported"},
882     {0x23,0x03,"invalid token operation, remote rod token creation not "
883                "supported"},
884     {0x23,0x04,"Invalid token operation, token unknown"},
885     {0x23,0x05,"Invalid token operation, token corrupt"},
886     {0x23,0x06,"Invalid token operation, token revoked"},
887     {0x23,0x07,"Invalid token operation, token expired"},
888     {0x23,0x08,"Invalid token operation, token cancelled"},
889     {0x23,0x09,"Invalid token operation, token deleted"},
890     {0x23,0x0a,"Invalid token operation, invalid token length"},
891     {0x24,0x00,"Invalid field in cdb"},
892     {0x24,0x01,"CDB decryption error"},
893     {0x24,0x02,"Invalid cdb field while in explicit block model (obs)"},
894     {0x24,0x03,"Invalid cdb field while in implicit block model (obs)"},
895     {0x24,0x04,"Security audit value frozen"},
896     {0x24,0x05,"Security working key frozen"},
897     {0x24,0x06,"Nonce not unique"},
898     {0x24,0x07,"Nonce timestamp out of range"},
899     {0x24,0x08,"Invalid xcdb"},
900     {0x24,0x09,"Invalid fast format"},
901     {0x25,0x00,"Logical unit not supported"},
902     {0x26,0x00,"Invalid field in parameter list"},
903     {0x26,0x01,"Parameter not supported"},
904     {0x26,0x02,"Parameter value invalid"},
905     {0x26,0x03,"Threshold parameters not supported"},
906     {0x26,0x04,"Invalid release of persistent reservation"},
907     {0x26,0x05,"Data decryption error"},
908     {0x26,0x06,"Too many target descriptors"},
909     {0x26,0x07,"Unsupported target descriptor type code"},
910     {0x26,0x08,"Too many segment descriptors"},
911     {0x26,0x09,"Unsupported segment descriptor type code"},
912     {0x26,0x0A,"Unexpected inexact segment"},
913     {0x26,0x0B,"Inline data length exceeded"},
914     {0x26,0x0C,"Invalid operation for copy source or destination"},
915     {0x26,0x0D,"Copy segment granularity violation"},
916     {0x26,0x0E,"Invalid parameter while port is enabled"},
917     {0x26,0x0F,"Invalid data-out buffer integrity check value"},
918     {0x26,0x10,"Data decryption key fail limit reached"},
919     {0x26,0x11,"Incomplete key-associated data set"},
920     {0x26,0x12,"Vendor specific key reference not found"},
921     {0x26,0x13,"Application tag mode page is invalid"},
922     {0x26,0x14,"Tape stream mirroring prevented"},
923     {0x26,0x15,"Copy source or copy destination not authorized"},
924     {0x27,0x00,"Write protected"},
925     {0x27,0x01,"Hardware write protected"},
926     {0x27,0x02,"Logical unit software write protected"},
927     {0x27,0x03,"Associated write protect"},
928     {0x27,0x04,"Persistent write protect"},
929     {0x27,0x05,"Permanent write protect"},
930     {0x27,0x06,"Conditional write protect"},
931     {0x27,0x07,"Space allocation failed write protect"},
932     {0x27,0x08,"Zone is read only"},
933     {0x28,0x00,"Not ready to ready change, medium may have changed"},
934     {0x28,0x01,"Import or export element accessed"},
935     {0x28,0x02,"Format-layer may have changed"},
936     {0x28,0x03,"Import/export element accessed, medium changed"},
937     {0x29,0x00,"Power on, reset, or bus device reset occurred"},
938     {0x29,0x01,"Power on occurred"},
939     {0x29,0x02,"SCSI bus reset occurred"},
940     {0x29,0x03,"Bus device reset function occurred"},
941     {0x29,0x04,"Device internal reset"},
942     {0x29,0x05,"Transceiver mode changed to single-ended"},
943     {0x29,0x06,"Transceiver mode changed to lvd"},
944     {0x29,0x07,"I_T nexus loss occurred"},
945     {0x2A,0x00,"Parameters changed"},
946     {0x2A,0x01,"Mode parameters changed"},
947     {0x2A,0x02,"Log parameters changed"},
948     {0x2A,0x03,"Reservations preempted"},
949     {0x2A,0x04,"Reservations released"},
950     {0x2A,0x05,"Registrations preempted"},
951     {0x2A,0x06,"Asymmetric access state changed"},
952     {0x2A,0x07,"Implicit asymmetric access state transition failed"},
953     {0x2A,0x08,"Priority changed"},
954     {0x2A,0x09,"Capacity data has changed"},
955     {0x2A,0x0c, "Error recovery attributes have changed"},
956     {0x2A,0x0d, "Data encryption capabilities changed"},
957     {0x2A,0x10,"Timestamp changed"},
958     {0x2A,0x11,"Data encryption parameters changed by another i_t nexus"},
959     {0x2A,0x12,"Data encryption parameters changed by vendor specific event"},
960     {0x2A,0x13,"Data encryption key instance counter has changed"},
961     {0x2A,0x0a,"Error history i_t nexus cleared"},
962     {0x2A,0x0b,"Error history snapshot released"},
963     {0x2A,0x14,"SA creation capabilities data has changed"},
964     {0x2A,0x15,"Medium removal prevention preempted"},
965     {0x2A,0x16,"Zone reset write pointer recommended"},
966     {0x2B,0x00,"Copy cannot execute since host cannot disconnect"},
967     {0x2C,0x00,"Command sequence error"},
968     {0x2C,0x01,"Too many windows specified"},
969     {0x2C,0x02,"Invalid combination of windows specified"},
970     {0x2C,0x03,"Current program area is not empty"},
971     {0x2C,0x04,"Current program area is empty"},
972     {0x2C,0x05,"Illegal power condition request"},
973     {0x2C,0x06,"Persistent prevent conflict"},
974     {0x2C,0x07,"Previous busy status"},
975     {0x2C,0x08,"Previous task set full status"},
976     {0x2C,0x09,"Previous reservation conflict status"},
977     {0x2C,0x0A,"Partition or collection contains user objects"},
978     {0x2C,0x0B,"Not reserved"},
979     {0x2C,0x0C,"ORWRITE generation does not match"},
980     {0x2C,0x0D,"Reset write pointer not allowed"},
981     {0x2C,0x0E,"Zone is offline"},
982     {0x2C,0x0F,"Stream not open"},
983     {0x2C,0x10,"Unwritten data in zone"},
984     {0x2C,0x11,"Descriptor format sense data required"},
985     {0x2D,0x00,"Overwrite error on update in place"},
986     {0x2E,0x00,"Insufficient time for operation"},
987     {0x2E,0x01,"Command timeout before processing"},
988     {0x2E,0x02,"Command timeout during processing"},
989     {0x2E,0x03,"Command timeout during processing due to error recovery"},
990     {0x2F,0x00,"Commands cleared by another initiator"},
991     {0x2F,0x01,"Commands cleared by power loss notification"},
992     {0x2F,0x02,"Commands cleared by device server"},
993     {0x2F,0x03,"Some commands cleared by queuing layer event"},
994     {0x30,0x00,"Incompatible medium installed"},
995     {0x30,0x01,"Cannot read medium - unknown format"},
996     {0x30,0x02,"Cannot read medium - incompatible format"},
997     {0x30,0x03,"Cleaning cartridge installed"},
998     {0x30,0x04,"Cannot write medium - unknown format"},
999     {0x30,0x05,"Cannot write medium - incompatible format"},
1000     {0x30,0x06,"Cannot format medium - incompatible medium"},
1001     {0x30,0x07,"Cleaning failure"},
1002     {0x30,0x08,"Cannot write - application code mismatch"},
1003     {0x30,0x09,"Current session not fixated for append"},
1004     {0x30,0x0A,"Cleaning request rejected"},
1005     {0x30,0x0B,"Cleaning tape expired"},
1006     {0x30,0x0C,"WORM medium - overwrite attempted"},
1007     {0x30,0x0D,"WORM medium - integrity check"},
1008     {0x30,0x10,"Medium not formatted"},
1009     {0x30,0x11,"Incompatible volume type"},
1010     {0x30,0x12,"Incompatible volume qualifier"},
1011     {0x30,0x13,"Cleaning volume expired"},
1012     {0x31,0x00,"Medium format corrupted"},
1013     {0x31,0x01,"Format command failed"},
1014     {0x31,0x02,"Zoned formatting failed due to spare linking"},
1015     {0x31,0x03,"Sanitize command failed"},
1016     {0x32,0x00,"No defect spare location available"},
1017     {0x32,0x01,"Defect list update failure"},
1018     {0x33,0x00,"Tape length error"},
1019     {0x34,0x00,"Enclosure failure"},
1020     {0x35,0x00,"Enclosure services failure"},
1021     {0x35,0x01,"Unsupported enclosure function"},
1022     {0x35,0x02,"Enclosure services unavailable"},
1023     {0x35,0x03,"Enclosure services transfer failure"},
1024     {0x35,0x04,"Enclosure services transfer refused"},
1025     {0x35,0x05,"Enclosure services checksum error"},
1026     {0x36,0x00,"Ribbon, ink, or toner failure"},
1027     {0x37,0x00,"Rounded parameter"},
1028     {0x38,0x00,"Event status notification"},
1029     {0x38,0x02,"Esn - power management class event"},
1030     {0x38,0x04,"Esn - media class event"},
1031     {0x38,0x06,"Esn - device busy class event"},
1032     {0x38,0x07,"Thin provisioning soft threshold reached"},
1033     {0x39,0x00,"Saving parameters not supported"},
1034     {0x3A,0x00,"Medium not present"},
1035     {0x3A,0x01,"Medium not present - tray closed"},
1036     {0x3A,0x02,"Medium not present - tray open"},
1037     {0x3A,0x03,"Medium not present - loadable"},
1038     {0x3A,0x04,"Medium not present - medium auxiliary memory accessible"},
1039     {0x3B,0x00,"Sequential positioning error"},
1040     {0x3B,0x01,"Tape position error at beginning-of-medium"},
1041     {0x3B,0x02,"Tape position error at end-of-medium"},
1042     {0x3B,0x03,"Tape or electronic vertical forms unit not ready"},
1043     {0x3B,0x04,"Slew failure"},
1044     {0x3B,0x05,"Paper jam"},
1045     {0x3B,0x06,"Failed to sense top-of-form"},
1046     {0x3B,0x07,"Failed to sense bottom-of-form"},
1047     {0x3B,0x08,"Reposition error"},
1048     {0x3B,0x09,"Read past end of medium"},
1049     {0x3B,0x0A,"Read past beginning of medium"},
1050     {0x3B,0x0B,"Position past end of medium"},
1051     {0x3B,0x0C,"Position past beginning of medium"},
1052     {0x3B,0x0D,"Medium destination element full"},
1053     {0x3B,0x0E,"Medium source element empty"},
1054     {0x3B,0x0F,"End of medium reached"},
1055     {0x3B,0x11,"Medium magazine not accessible"},
1056     {0x3B,0x12,"Medium magazine removed"},
1057     {0x3B,0x13,"Medium magazine inserted"},
1058     {0x3B,0x14,"Medium magazine locked"},
1059     {0x3B,0x15,"Medium magazine unlocked"},
1060     {0x3B,0x16,"Mechanical positioning or changer error"},
1061     {0x3B,0x17,"Read past end of user object"},
1062     {0x3B,0x18,"Element disabled"},
1063     {0x3B,0x19,"Element enabled"},
1064     {0x3B,0x1a,"Data transfer device removed"},
1065     {0x3B,0x1b,"Data transfer device inserted"},
1066     {0x3B,0x1c,"Too many logical objects on partition to support operation"},
1067     {0x3D,0x00,"Invalid bits in identify message"},
1068     {0x3E,0x00,"Logical unit has not self-configured yet"},
1069     {0x3E,0x01,"Logical unit failure"},
1070     {0x3E,0x02,"Timeout on logical unit"},
1071     {0x3E,0x03,"Logical unit failed self-test"},
1072     {0x3E,0x04,"Logical unit unable to update self-test log"},
1073     {0x3F,0x00,"Target operating conditions have changed"},
1074     {0x3F,0x01,"Microcode has been changed"},
1075     {0x3F,0x02,"Changed operating definition"},
1076     {0x3F,0x03,"Inquiry data has changed"},
1077     {0x3F,0x04,"Component device attached"},
1078     {0x3F,0x05,"Device identifier changed"},
1079     {0x3F,0x06,"Redundancy group created or modified"},
1080     {0x3F,0x07,"Redundancy group deleted"},
1081     {0x3F,0x08,"Spare created or modified"},
1082     {0x3F,0x09,"Spare deleted"},
1083     {0x3F,0x0A,"Volume set created or modified"},
1084     {0x3F,0x0B,"Volume set deleted"},
1085     {0x3F,0x0C,"Volume set deassigned"},
1086     {0x3F,0x0D,"Volume set reassigned"},
1087     {0x3F,0x0E,"Reported luns data has changed"},
1088     {0x3F,0x0F,"Echo buffer overwritten"},
1089     {0x3F,0x10,"Medium loadable"},
1090     {0x3F,0x11,"Medium auxiliary memory accessible"},
1091     {0x3F,0x12,"iSCSI IP address added"},
1092     {0x3F,0x13,"iSCSI IP address removed"},
1093     {0x3F,0x14,"iSCSI IP address changed"},
1094     {0x3F,0x15,"Inspect referrals sense descriptors"},
1095     {0x3F,0x16,"Microcode has been changed without reset"},
1096     {0x3F,0x17,"Zone transition to full"},
1097     {0x3F,0x18,"Bind completed"},
1098     {0x3F,0x19,"Bind redirected"},
1099     {0x3F,0x1A,"Subsidiary binding changed"},
1100 
1101     /*
1102      * ASC 0x40, 0x41 and 0x42 overridden by "additional2" array entries
1103      * for ascq > 1. Preferred error message for this group is
1104      * "Diagnostic failure on component nn (80h-ffh)".
1105      */
1106     {0x40,0x00,"Ram failure (should use 40 nn)"},
1107     {0x41,0x00,"Data path failure (should use 40 nn)"},
1108     {0x42,0x00,"Power-on or self-test failure (should use 40 nn)"},
1109 
1110     {0x43,0x00,"Message error"},
1111     {0x44,0x00,"Internal target failure"},
1112     {0x44,0x01,"Persistent reservation information lost"},
1113     {0x44,0x71,"ATA device failed Set Features"},
1114     {0x45,0x00,"Select or reselect failure"},
1115     {0x46,0x00,"Unsuccessful soft reset"},
1116     {0x47,0x00,"SCSI parity error"},
1117     {0x47,0x01,"Data phase CRC error detected"},
1118     {0x47,0x02,"SCSI parity error detected during st data phase"},
1119     {0x47,0x03,"Information unit iuCRC error detected"},
1120     {0x47,0x04,"Asynchronous information protection error detected"},
1121     {0x47,0x05,"Protocol service CRC error"},
1122     {0x47,0x06,"Phy test function in progress"},
1123     {0x47,0x7F,"Some commands cleared by iSCSI protocol event"},
1124     {0x48,0x00,"Initiator detected error message received"},
1125     {0x49,0x00,"Invalid message error"},
1126     {0x4A,0x00,"Command phase error"},
1127     {0x4B,0x00,"Data phase error"},
1128     {0x4B,0x01,"Invalid target port transfer tag received"},
1129     {0x4B,0x02,"Too much write data"},
1130     {0x4B,0x03,"Ack/nak timeout"},
1131     {0x4B,0x04,"Nak received"},
1132     {0x4B,0x05,"Data offset error"},
1133     {0x4B,0x06,"Initiator response timeout"},
1134     {0x4B,0x07,"Connection lost"},
1135     {0x4B,0x08,"Data-in buffer overflow - data buffer size"},
1136     {0x4B,0x09,"Data-in buffer overflow - data buffer descriptor area"},
1137     {0x4B,0x0A,"Data-in buffer error"},
1138     {0x4B,0x0B,"Data-out buffer overflow - data buffer size"},
1139     {0x4B,0x0C,"Data-out buffer overflow - data buffer descriptor area"},
1140     {0x4B,0x0D,"Data-out buffer error"},
1141     {0x4B,0x0E,"PCIe fabric error"},
1142     {0x4B,0x0f,"PCIe completion timeout"},
1143     {0x4B,0x10,"PCIe completer abort"},
1144     {0x4B,0x11,"PCIe poisoned tlp received"},
1145     {0x4B,0x12,"PCIe ecrc check failed"},
1146     {0x4B,0x13,"PCIe unsupported request"},
1147     {0x4B,0x14,"PCIe acs violation"},
1148     {0x4B,0x15,"PCIe tlp prefix blocked"},
1149     {0x4C,0x00,"Logical unit failed self-configuration"},
1150     /*
1151      * ASC 0x4D overridden by an "additional2" array entry
1152      * so there is no need to have them here.
1153      */
1154     /* {0x4D,0x00,"Tagged overlapped commands (nn = queue tag)"}, */
1155 
1156     {0x4E,0x00,"Overlapped commands attempted"},
1157     {0x50,0x00,"Write append error"},
1158     {0x50,0x01,"Write append position error"},
1159     {0x50,0x02,"Position error related to timing"},
1160     {0x51,0x00,"Erase failure"},
1161     {0x51,0x01,"Erase failure - incomplete erase operation detected"},
1162     {0x52,0x00,"Cartridge fault"},
1163     {0x53,0x00,"Media load or eject failed"},
1164     {0x53,0x01,"Unload tape failure"},
1165     {0x53,0x02,"Medium removal prevented"},
1166     {0x53,0x03,"Medium removal prevented by data transfer element"},
1167     {0x53,0x04,"Medium thread or unthread failure"},
1168     {0x53,0x05,"Volume identifier invalid"},
1169     {0x53,0x06,"Volume identifier missing"},
1170     {0x53,0x07,"Duplicate volume identifier"},
1171     {0x53,0x08,"Element status unknown"},
1172     {0x53,0x09,"Data transfer device error - load failed"},
1173     {0x53,0x0A,"Data transfer device error - unload failed"},
1174     {0x53,0x0B,"Data transfer device error - unload missing"},
1175     {0x53,0x0C,"Data transfer device error - eject failed"},
1176     {0x53,0x0D,"Data transfer device error - library communication failed"},
1177     {0x54,0x00,"SCSI to host system interface failure"},
1178     {0x55,0x00,"System resource failure"},
1179     {0x55,0x01,"System buffer full"},
1180     {0x55,0x02,"Insufficient reservation resources"},
1181     {0x55,0x03,"Insufficient resources"},
1182     {0x55,0x04,"Insufficient registration resources"},
1183     {0x55,0x05,"Insufficient access control resources"},
1184     {0x55,0x06,"Auxiliary memory out of space"},
1185     {0x55,0x07,"Quota error"},
1186     {0x55,0x08,"Maximum number of supplemental decryption keys exceeded"},
1187     {0x55,0x09,"Medium auxiliary memory not accessible"},
1188     {0x55,0x0a,"Data currently unavailable"},
1189     {0x55,0x0b,"Insufficient power for operation"},
1190     {0x55,0x0c,"Insufficient resources to create rod"},
1191     {0x55,0x0d,"Insufficient resources to create rod token"},
1192     {0x55,0x0e,"Insufficient zone resources"},
1193     {0x55,0x0f,"Insufficient zone resources to complete write"},
1194     {0x55,0x10,"Maximum number of streams open"},
1195     {0x55,0x11,"Insufficient resources to bind"},
1196     {0x57,0x00,"Unable to recover table-of-contents"},
1197     {0x58,0x00,"Generation does not exist"},
1198     {0x59,0x00,"Updated block read"},
1199     {0x5A,0x00,"Operator request or state change input"},
1200     {0x5A,0x01,"Operator medium removal request"},
1201     {0x5A,0x02,"Operator selected write protect"},
1202     {0x5A,0x03,"Operator selected write permit"},
1203     {0x5B,0x00,"Log exception"},
1204     {0x5B,0x01,"Threshold condition met"},
1205     {0x5B,0x02,"Log counter at maximum"},
1206     {0x5B,0x03,"Log list codes exhausted"},
1207     {0x5C,0x00,"Rpl status change"},
1208     {0x5C,0x01,"Spindles synchronized"},
1209     {0x5C,0x02,"Spindles not synchronized"},
1210     {0x5D,0x00,"Failure prediction threshold exceeded"},
1211     {0x5D,0x01,"Media failure prediction threshold exceeded"},
1212     {0x5D,0x02,"Logical unit failure prediction threshold exceeded"},
1213     {0x5D,0x03,"spare area exhaustion prediction threshold exceeded"},
1214     {0x5D,0x10,"Hardware impending failure general hard drive failure"},
1215     {0x5D,0x11,"Hardware impending failure drive error rate too high" },
1216     {0x5D,0x12,"Hardware impending failure data error rate too high" },
1217     {0x5D,0x13,"Hardware impending failure seek error rate too high" },
1218     {0x5D,0x14,"Hardware impending failure too many block reassigns"},
1219     {0x5D,0x15,"Hardware impending failure access times too high" },
1220     {0x5D,0x16,"Hardware impending failure start unit times too high" },
1221     {0x5D,0x17,"Hardware impending failure channel parametrics"},
1222     {0x5D,0x18,"Hardware impending failure controller detected"},
1223     {0x5D,0x19,"Hardware impending failure throughput performance"},
1224     {0x5D,0x1A,"Hardware impending failure seek time performance"},
1225     {0x5D,0x1B,"Hardware impending failure spin-up retry count"},
1226     {0x5D,0x1C,"Hardware impending failure drive calibration retry count"},
1227     {0x5D,0x1D,"Hardware impending failure power loss protection circuit"},
1228     {0x5D,0x20,"Controller impending failure general hard drive failure"},
1229     {0x5D,0x21,"Controller impending failure drive error rate too high" },
1230     {0x5D,0x22,"Controller impending failure data error rate too high" },
1231     {0x5D,0x23,"Controller impending failure seek error rate too high" },
1232     {0x5D,0x24,"Controller impending failure too many block reassigns"},
1233     {0x5D,0x25,"Controller impending failure access times too high" },
1234     {0x5D,0x26,"Controller impending failure start unit times too high" },
1235     {0x5D,0x27,"Controller impending failure channel parametrics"},
1236     {0x5D,0x28,"Controller impending failure controller detected"},
1237     {0x5D,0x29,"Controller impending failure throughput performance"},
1238     {0x5D,0x2A,"Controller impending failure seek time performance"},
1239     {0x5D,0x2B,"Controller impending failure spin-up retry count"},
1240     {0x5D,0x2C,"Controller impending failure drive calibration retry count"},
1241     {0x5D,0x30,"Data channel impending failure general hard drive failure"},
1242     {0x5D,0x31,"Data channel impending failure drive error rate too high" },
1243     {0x5D,0x32,"Data channel impending failure data error rate too high" },
1244     {0x5D,0x33,"Data channel impending failure seek error rate too high" },
1245     {0x5D,0x34,"Data channel impending failure too many block reassigns"},
1246     {0x5D,0x35,"Data channel impending failure access times too high" },
1247     {0x5D,0x36,"Data channel impending failure start unit times too high" },
1248     {0x5D,0x37,"Data channel impending failure channel parametrics"},
1249     {0x5D,0x38,"Data channel impending failure controller detected"},
1250     {0x5D,0x39,"Data channel impending failure throughput performance"},
1251     {0x5D,0x3A,"Data channel impending failure seek time performance"},
1252     {0x5D,0x3B,"Data channel impending failure spin-up retry count"},
1253     {0x5D,0x3C,"Data channel impending failure drive calibration retry count"},
1254     {0x5D,0x40,"Servo impending failure general hard drive failure"},
1255     {0x5D,0x41,"Servo impending failure drive error rate too high" },
1256     {0x5D,0x42,"Servo impending failure data error rate too high" },
1257     {0x5D,0x43,"Servo impending failure seek error rate too high" },
1258     {0x5D,0x44,"Servo impending failure too many block reassigns"},
1259     {0x5D,0x45,"Servo impending failure access times too high" },
1260     {0x5D,0x46,"Servo impending failure start unit times too high" },
1261     {0x5D,0x47,"Servo impending failure channel parametrics"},
1262     {0x5D,0x48,"Servo impending failure controller detected"},
1263     {0x5D,0x49,"Servo impending failure throughput performance"},
1264     {0x5D,0x4A,"Servo impending failure seek time performance"},
1265     {0x5D,0x4B,"Servo impending failure spin-up retry count"},
1266     {0x5D,0x4C,"Servo impending failure drive calibration retry count"},
1267     {0x5D,0x50,"Spindle impending failure general hard drive failure"},
1268     {0x5D,0x51,"Spindle impending failure drive error rate too high" },
1269     {0x5D,0x52,"Spindle impending failure data error rate too high" },
1270     {0x5D,0x53,"Spindle impending failure seek error rate too high" },
1271     {0x5D,0x54,"Spindle impending failure too many block reassigns"},
1272     {0x5D,0x55,"Spindle impending failure access times too high" },
1273     {0x5D,0x56,"Spindle impending failure start unit times too high" },
1274     {0x5D,0x57,"Spindle impending failure channel parametrics"},
1275     {0x5D,0x58,"Spindle impending failure controller detected"},
1276     {0x5D,0x59,"Spindle impending failure throughput performance"},
1277     {0x5D,0x5A,"Spindle impending failure seek time performance"},
1278     {0x5D,0x5B,"Spindle impending failure spin-up retry count"},
1279     {0x5D,0x5C,"Spindle impending failure drive calibration retry count"},
1280     {0x5D,0x60,"Firmware impending failure general hard drive failure"},
1281     {0x5D,0x61,"Firmware impending failure drive error rate too high" },
1282     {0x5D,0x62,"Firmware impending failure data error rate too high" },
1283     {0x5D,0x63,"Firmware impending failure seek error rate too high" },
1284     {0x5D,0x64,"Firmware impending failure too many block reassigns"},
1285     {0x5D,0x65,"Firmware impending failure access times too high" },
1286     {0x5D,0x66,"Firmware impending failure start unit times too high" },
1287     {0x5D,0x67,"Firmware impending failure channel parametrics"},
1288     {0x5D,0x68,"Firmware impending failure controller detected"},
1289     {0x5D,0x69,"Firmware impending failure throughput performance"},
1290     {0x5D,0x6A,"Firmware impending failure seek time performance"},
1291     {0x5D,0x6B,"Firmware impending failure spin-up retry count"},
1292     {0x5D,0x6C,"Firmware impending failure drive calibration retry count"},
1293     {0x5D,0x73,"Media impending failure endurance limit met"},
1294     {0x5D,0xFF,"Failure prediction threshold exceeded (false)"},
1295     {0x5E,0x00,"Low power condition on"},
1296     {0x5E,0x01,"Idle condition activated by timer"},
1297     {0x5E,0x02,"Standby condition activated by timer"},
1298     {0x5E,0x03,"Idle condition activated by command"},
1299     {0x5E,0x04,"Standby condition activated by command"},
1300     {0x5E,0x05,"Idle_b condition activated by timer"},
1301     {0x5E,0x06,"Idle_b condition activated by command"},
1302     {0x5E,0x07,"Idle_c condition activated by timer"},
1303     {0x5E,0x08,"Idle_c condition activated by command"},
1304     {0x5E,0x09,"Standby_y condition activated by timer"},
1305     {0x5E,0x0a,"Standby_y condition activated by command"},
1306     {0x5E,0x41,"Power state change to active"},
1307     {0x5E,0x42,"Power state change to idle"},
1308     {0x5E,0x43,"Power state change to standby"},
1309     {0x5E,0x45,"Power state change to sleep"},
1310     {0x5E,0x47,"Power state change to device control"},
1311     {0x60,0x00,"Lamp failure"},
1312     {0x61,0x00,"Video acquisition error"},
1313     {0x61,0x01,"Unable to acquire video"},
1314     {0x61,0x02,"Out of focus"},
1315     {0x62,0x00,"Scan head positioning error"},
1316     {0x63,0x00,"End of user area encountered on this track"},
1317     {0x63,0x01,"Packet does not fit in available space"},
1318     {0x64,0x00,"Illegal mode for this track"},
1319     {0x64,0x01,"Invalid packet size"},
1320     {0x65,0x00,"Voltage fault"},
1321     {0x66,0x00,"Automatic document feeder cover up"},
1322     {0x66,0x01,"Automatic document feeder lift up"},
1323     {0x66,0x02,"Document jam in automatic document feeder"},
1324     {0x66,0x03,"Document miss feed automatic in document feeder"},
1325     {0x67,0x00,"Configuration failure"},
1326     {0x67,0x01,"Configuration of incapable logical units failed"},
1327     {0x67,0x02,"Add logical unit failed"},
1328     {0x67,0x03,"Modification of logical unit failed"},
1329     {0x67,0x04,"Exchange of logical unit failed"},
1330     {0x67,0x05,"Remove of logical unit failed"},
1331     {0x67,0x06,"Attachment of logical unit failed"},
1332     {0x67,0x07,"Creation of logical unit failed"},
1333     {0x67,0x08,"Assign failure occurred"},
1334     {0x67,0x09,"Multiply assigned logical unit"},
1335     {0x67,0x0A,"Set target port groups command failed"},
1336     {0x67,0x0B,"ATA device feature not enabled"},
1337     {0x67,0x0C,"Command rejected"},
1338     {0x67,0x0D,"Explicit bind not allowed"},
1339     {0x68,0x00,"Logical unit not configured"},
1340     {0x68,0x01,"Subsidiary logical unit not configured"},
1341     {0x69,0x00,"Data loss on logical unit"},
1342     {0x69,0x01,"Multiple logical unit failures"},
1343     {0x69,0x02,"Parity/data mismatch"},
1344     {0x6A,0x00,"Informational, refer to log"},
1345     {0x6B,0x00,"State change has occurred"},
1346     {0x6B,0x01,"Redundancy level got better"},
1347     {0x6B,0x02,"Redundancy level got worse"},
1348     {0x6C,0x00,"Rebuild failure occurred"},
1349     {0x6D,0x00,"Recalculate failure occurred"},
1350     {0x6E,0x00,"Command to logical unit failed"},
1351     {0x6F,0x00,"Copy protection key exchange failure - authentication "
1352                "failure"},
1353     {0x6F,0x01,"Copy protection key exchange failure - key not present"},
1354     {0x6F,0x02,"Copy protection key exchange failure - key not established"},
1355     {0x6F,0x03,"Read of scrambled sector without authentication"},
1356     {0x6F,0x04,"Media region code is mismatched to logical unit region"},
1357     {0x6F,0x05,"Drive region must be permanent/region reset count error"},
1358     {0x6F,0x06,"Insufficient block count for binding nonce recording"},
1359     {0x6F,0x07,"Conflict in binding nonce recording"},
1360     {0x6F,0x08,"Insufficient permission"},
1361     {0x6F,0x09,"Invalid drive-host pairing server"},
1362     {0x6F,0x0A,"Drive-host pairing suspended"},
1363     /*
1364      * ASC 0x70 overridden by an "additional2" array entry
1365      * so there is no need to have them here.
1366      */
1367     /* {0x70,0x00,"Decompression exception short algorithm id of nn"}, */
1368 
1369     {0x71,0x00,"Decompression exception long algorithm id"},
1370     {0x72,0x00,"Session fixation error"},
1371     {0x72,0x01,"Session fixation error writing lead-in"},
1372     {0x72,0x02,"Session fixation error writing lead-out"},
1373     {0x72,0x03,"Session fixation error - incomplete track in session"},
1374     {0x72,0x04,"Empty or partially written reserved track"},
1375     {0x72,0x05,"No more track reservations allowed"},
1376     {0x72,0x06,"RMZ extension is not allowed"},
1377     {0x72,0x07,"No more test zone extensions are allowed"},
1378     {0x73,0x00,"CD control error"},
1379     {0x73,0x01,"Power calibration area almost full"},
1380     {0x73,0x02,"Power calibration area is full"},
1381     {0x73,0x03,"Power calibration area error"},
1382     {0x73,0x04,"Program memory area update failure"},
1383     {0x73,0x05,"Program memory area is full"},
1384     {0x73,0x06,"RMA/PMA is almost full"},
1385     {0x73,0x10,"Current power calibration area almost full"},
1386     {0x73,0x11,"Current power calibration area is full"},
1387     {0x73,0x17,"RDZ is full"},
1388     {0x74,0x00,"Security error"},
1389     {0x74,0x01,"Unable to decrypt data"},
1390     {0x74,0x02,"Unencrypted data encountered while decrypting"},
1391     {0x74,0x03,"Incorrect data encryption key"},
1392     {0x74,0x04,"Cryptographic integrity validation failed"},
1393     {0x74,0x05,"Error decrypting data"},
1394     {0x74,0x06,"Unknown signature verification key"},
1395     {0x74,0x07,"Encryption parameters not useable"},
1396     {0x74,0x08,"Digital signature validation failure"},
1397     {0x74,0x09,"Encryption mode mismatch on read"},
1398     {0x74,0x0a,"Encrypted block not raw read enabled"},
1399     {0x74,0x0b,"Incorrect Encryption parameters"},
1400     {0x74,0x0c,"Unable to decrypt parameter list"},
1401     {0x74,0x0d,"Encryption algorithm disabled"},
1402     {0x74,0x10,"SA creation parameter value invalid"},
1403     {0x74,0x11,"SA creation parameter value rejected"},
1404     {0x74,0x12,"Invalid SA usage"},
1405     {0x74,0x21,"Data encryption configuration prevented"},
1406     {0x74,0x30,"SA creation parameter not supported"},
1407     {0x74,0x40,"Authentication failed"},
1408     {0x74,0x61,"External data encryption key manager access error"},
1409     {0x74,0x62,"External data encryption key manager error"},
1410     {0x74,0x63,"External data encryption key not found"},
1411     {0x74,0x64,"External data encryption request not authorized"},
1412     {0x74,0x6e,"External data encryption control timeout"},
1413     {0x74,0x6f,"External data encryption control error"},
1414     {0x74,0x71,"Logical unit access not authorized"},
1415     {0x74,0x79,"Security conflict in translated device"},
1416     {0, 0, NULL}
1417 };
1418 
1419 #else   /* SG_SCSI_STRINGS */
1420 
1421 struct sg_lib_asc_ascq_range_t sg_lib_asc_ascq_range[] =
1422 {
1423     {0, 0, 0, NULL}
1424 };
1425 
1426 struct sg_lib_asc_ascq_t sg_lib_asc_ascq[] =
1427 {
1428     {0, 0, NULL}
1429 };
1430 #endif /* SG_SCSI_STRINGS */
1431 
1432 const char * sg_lib_sense_key_desc[] = {
1433     "No Sense",                 /* Filemark, ILI and/or EOM; progress
1434                                    indication (during FORMAT); power
1435                                    condition sensing (REQUEST SENSE) */
1436     "Recovered Error",          /* The last command completed successfully
1437                                    but used error correction */
1438     "Not Ready",                /* The addressed target is not ready */
1439     "Medium Error",             /* Data error detected on the medium */
1440     "Hardware Error",           /* Controller or device failure */
1441     "Illegal Request",
1442     "Unit Attention",           /* Removable medium was changed, or
1443                                    the target has been reset */
1444     "Data Protect",             /* Access to the data is blocked */
1445     "Blank Check",              /* Reached unexpected written or unwritten
1446                                    region of the medium */
1447     "Vendor specific(9)",       /* Vendor specific */
1448     "Copy Aborted",             /* COPY or COMPARE was aborted */
1449     "Aborted Command",          /* The target aborted the command */
1450     "Equal",                    /* SEARCH DATA found data equal (obsolete) */
1451     "Volume Overflow",          /* Medium full with data to be written */
1452     "Miscompare",               /* Source data and data on the medium
1453                                    do not agree */
1454     "Completed"                 /* may occur for successful cmd (spc4r23) */
1455 };
1456 
1457 const char * sg_lib_pdt_strs[32] = {    /* should have 2**5 elements */
1458     /* 0 */ "disk",
1459     "tape",
1460     "printer",                  /* obsolete, spc5r01 */
1461     "processor",        /* often SAF-TE device, copy manager */
1462     "write once optical disk",  /* obsolete, spc5r01 */
1463     /* 5 */ "cd/dvd",
1464     "scanner",                  /* obsolete */
1465     "optical memory device",
1466     "medium changer",
1467     "communications",           /* obsolete */
1468     /* 0xa */ "graphics [0xa]", /* obsolete */
1469     "graphics [0xb]",           /* obsolete */
1470     "storage array controller",
1471     "enclosure services device",
1472     "simplified direct access device",
1473     "optical card reader/writer device",
1474     /* 0x10 */ "bridge controller commands",
1475     "object based storage",
1476     "automation/driver interface",
1477     "security manager device",  /* obsolete, spc5r01 */
1478     "zoned block commands",
1479     "0x15", "0x16", "0x17", "0x18",
1480     "0x19", "0x1a", "0x1b", "0x1c", "0x1d",
1481     "well known logical unit",
1482     "no physical device on this lu",
1483 };
1484 
1485 const char * sg_lib_transport_proto_strs[] =
1486 {
1487     "Fibre Channel Protocol for SCSI (FCP-4)",
1488     "SCSI Parallel Interface (SPI-5)",  /* obsolete in spc5r01 */
1489     "Serial Storage Architecture SCSI-3 Protocol (SSA-S3P)",
1490     "Serial Bus Protocol for IEEE 1394 (SBP-3)",
1491     "SCSI RDMA Protocol (SRP)",
1492     "Internet SCSI (iSCSI)",
1493     "Serial Attached SCSI Protocol (SPL-4)",
1494     "Automation/Drive Interface Transport (ADT-2)",
1495     "AT Attachment Interface (ACS-2)",          /* 0x8 */
1496     "USB Attached SCSI (UAS-2)",
1497     "SCSI over PCI Express (SOP)",
1498     "PCIe",                             /* added in spc5r02 */
1499     "Oxc", "Oxd", "Oxe",
1500     "No specific protocol"
1501 };
1502 
1503 /* SCSI Feature Sets array. code->value, pdt->peri_dev_type (-1 for SPC) */
1504 struct sg_lib_value_name_t sg_lib_scsi_feature_sets[] =
1505 {
1506     {SCSI_FS_SPC_DISCOVERY_2016, -1, "Discovery 2016"},
1507     {SCSI_FS_SBC_BASE_2010, PDT_DISK, "SBC Base 2010"},
1508     {SCSI_FS_SBC_BASE_2016, PDT_DISK, "SBC Base 2016"},
1509     {SCSI_FS_SBC_BASIC_PROV_2016, PDT_DISK, "Basic provisioning 2016"},
1510     {SCSI_FS_SBC_DRIVE_MAINT_2016, PDT_DISK, "Drive maintenance 2016"},
1511     {0x0, 0, NULL},     /* 0x0 is reserved sfs; trailing sentinel */
1512 };
1513 
1514 #if (SG_SCSI_STRINGS && HAVE_NVME && (! IGNORE_NVME))
1515 
1516 /* .value is completion queue's DW3 as follows: ((DW3 >> 17) & 0x3ff)
1517  * .peri_dev_type is an index for the sg_lib_scsi_status_sense_arr[]
1518  * .name is taken from NVMe 1.3a document, section 4.6.1.2.1 with less
1519  *   capitalization.
1520  * NVMe term bits 31:17 of DW3 in the completion field as the "Status
1521  * Field" (SF). Bit 31 is "Do not retry" (DNR) and bit 30 is "More" (M).
1522  * Bits 29:28 are reserved, bit 27:25 are the "Status Code Type" (SCT)
1523  * and bits 24:17 are the Status Code (SC). This table is in ascending
1524  * order of its .value field so a binary search could be done on it.  */
1525 struct sg_lib_value_name_t sg_lib_nvme_cmd_status_arr[] =
1526 {
1527     /* Generic command status values, Status Code Type (SCT): 0h
1528      * Lowest 8 bits are the Status Code (SC), in this case:
1529      *   00h - 7Fh: Applicable to Admin Command Set, or across multiple
1530      *              command sets
1531      *   80h - BFh: I/O Command Set Specific status codes
1532      *   c0h - FFh: I/O Vendor Specific status codes            */
1533     {0x0,   0, "Successful completion"},
1534     {0x1,   1, "Invalid command opcode"},
1535     {0x2,   2, "Invalid field in command"},
1536     {0x3,   2, "Command id conflict"},
1537     {0x4,   3, "Data transfer error"},
1538     {0x5,   4, "Command aborted due to power loss notication"},
1539     {0x6,   5, "Internal error"},
1540     {0x7,   6, "Command abort requested"},
1541     {0x8,   6, "Command aborted due to SQ deletion"},
1542     {0x9,   6, "Command aborted due to failed fused command"},
1543     {0xa,   6, "Command aborted due to missing fused command"},
1544     {0xb,   7, "Invalid namespace or format"},
1545     {0xc,   5, "Command sequence error"},
1546     {0xd,   5, "Invalid SGL segment descriptor"},
1547     {0xe,   5, "Invalid number of SGL descriptors"},
1548     {0xf,   5, "Data SGL length invalid"},
1549     {0x10,  5, "Matadata SGL length invalid"},
1550     {0x11,  5, "SGL descriptor type invalid"},
1551     {0x12,  5, "Invalid use of controller memory buffer"},
1552     {0x13,  5, "PRP offset invalid"},
1553     {0x14,  2, "Atomic write unit exceeded"},
1554     {0x15,  8, "Operation denied"},
1555     {0x16,  5, "SGL offset invalid"},
1556     {0x17,  5, "Reserved [0x17]"},
1557     {0x18,  5, "Host identifier inconsistent format"},
1558     {0x19,  5, "Keep alive timeout expired"},
1559     {0x1a,  5, "Keep alive timeout invalid"},
1560     {0x1b,  6, "Command aborted due to Preempt and Abort"},
1561     {0x1c, 10, "Sanitize failed"},
1562     {0x1d, 11, "Sanitize in progress"},
1563     {0x1e,  5, "SGL data block granularity invalid"},
1564     {0x1f,  5, "Command not supported for queue in CMB"},
1565 
1566     /* Generic command status values, NVM (I/O) Command Set */
1567     {0x80, 12, "LBA out of range"},
1568     {0x81,  3, "Capacity exceeded"},
1569     {0x82, 13, "Namespace not ready"},
1570     {0x83, 14, "Reservation conflict"},
1571     {0x84, 15, "Format in progress"},
1572     /* 0xc0 - 0xff: vendor specific */
1573 
1574     /* Command specific status values, Status Code Type (SCT): 1h */
1575     {0x100, 5, "Completion queue invalid"},
1576     {0x101, 5, "Invalid queue identifier"},
1577     {0x102, 5, "Invalid queue size"},
1578     {0x103, 5, "Abort command limit exceeded"},
1579     {0x104, 5, "Reserved [0x104]"},
1580     {0x105, 5, "Asynchronous event request limit exceeded"},
1581     {0x106, 5, "Invalid firmware slot"},
1582     {0x107, 5, "Invalid firmware image"},
1583     {0x108, 5, "Invalid interrupt vector"},
1584     {0x109, 5, "Invalid log page"},
1585     {0x10a,16, "Invalid format"},
1586     {0x10b, 5, "Firmware activation requires conventional reset"},
1587     {0x10c, 5, "Invalid queue deletion"},
1588     {0x10d, 5, "Feature identifier not saveable"},
1589     {0x10e, 5, "Feature not changeable"},
1590     {0x10f, 5, "Feature not namespace specific"},
1591     {0x110, 5, "Firmware activation requires NVM subsystem reset"},
1592     {0x111, 5, "Firmware activation requires reset"},
1593     {0x112, 5, "Firmware activation requires maximum time violation"},
1594     {0x113, 5, "Firmware activation prohibited"},
1595     {0x114, 5, "Overlapping range"},
1596     {0x115, 5, "Namespace insufficient capacity"},
1597     {0x116, 5, "Namespace identifier unavailable"},
1598     {0x117, 5, "Reserved [0x107]"},
1599     {0x118, 5, "Namespace already attached"},
1600     {0x119, 5, "Namespace is private"},
1601     {0x11a, 5, "Namespace not attached"},
1602     {0x11b, 3, "Thin provisioning not supported"},
1603     {0x11c, 3, "Controller list invalid"},
1604     {0x11d,17, "Device self-test in progress"},
1605     {0x11e,18, "Boot partition write prohibited"},
1606     {0x11f, 5, "Invalid controller identifier"},
1607     {0x120, 5, "Invalid secondary controller state"},
1608     {0x121, 5, "Invalid number of controller resorces"},
1609     {0x122, 5, "Invalid resorce identifier"},
1610 
1611     /* Command specific status values, Status Code Type (SCT): 1h
1612      * for NVM (I/O) Command Set */
1613     {0x180, 2, "Conflicting attributes"},
1614     {0x181,19, "Invalid protection information"},
1615     {0x182,18, "Attempted write to read only range"},
1616     /* 0x1c0 - 0x1ff: vendor specific */
1617 
1618     /* Media and Data Integrity error values, Status Code Type (SCT): 2h */
1619     {0x280,20, "Write fault"},
1620     {0x281,21, "Unrecovered read error"},
1621     {0x282,22, "End-to-end guard check error"},
1622     {0x283,23, "End-to-end application tag check error"},
1623     {0x284,24, "End-to-end reference tag check error"},
1624     {0x285,25, "Compare failure"},
1625     {0x286, 8, "Access denied"},
1626     {0x287,26, "Deallocated or unwritten logical block"},
1627     /* 0x2c0 - 0x2ff: vendor specific */
1628 
1629     /* Leave this Sentinel value at end of this array */
1630     {0x3ff, 0, NULL},
1631 };
1632 
1633 /* The sg_lib_nvme_cmd_status_arr[n].peri_dev_type field is an index
1634  * to this array. It allows an NVMe status (error) value to be mapped
1635  * to this SCSI tuple: status, sense_key, additional sense code (asc) and
1636  * asc qualifier (ascq). For brevity SAM_STAT_CHECK_CONDITION is written
1637  * as 0x2. */
1638 struct sg_lib_4tuple_u8 sg_lib_scsi_status_sense_arr[] =
1639 {
1640     {SAM_STAT_GOOD, SPC_SK_NO_SENSE, 0, 0},     /* it's all good */ /* 0 */
1641     {SAM_STAT_CHECK_CONDITION, SPC_SK_ILLEGAL_REQUEST, 0x20, 0x0},/* opcode */
1642     {0x2, SPC_SK_ILLEGAL_REQUEST, 0x24, 0x0},   /* field in cdb */
1643     {0x2, SPC_SK_MEDIUM_ERROR, 0x0, 0x0},
1644     {SAM_STAT_TASK_ABORTED, SPC_SK_ABORTED_COMMAND, 0xb, 0x8},
1645     {0x2, SPC_SK_HARDWARE_ERROR, 0x44, 0x0},   /* internal error */ /* 5 */
1646     {SAM_STAT_TASK_ABORTED, SPC_SK_ABORTED_COMMAND, 0x0, 0x0},
1647     {0x2, SPC_SK_ILLEGAL_REQUEST, 0x20, 0x9},   /* invalid LU */
1648     {0x2, SPC_SK_ILLEGAL_REQUEST, 0x20, 0x2},   /* access denied */
1649     {0x2, SPC_SK_ILLEGAL_REQUEST, 0x2c, 0x0},   /* cmd sequence error */
1650     {0x2, SPC_SK_MEDIUM_ERROR, 0x31, 0x3},   /* sanitize failed */ /* 10 */
1651     {0x2, SPC_SK_NOT_READY, 0x4, 0x1b}, /* sanitize in progress */
1652     {0x2, SPC_SK_ILLEGAL_REQUEST, 0x21, 0x0},   /* LBA out of range */
1653     {0x2, SPC_SK_NOT_READY, 0x4, 0x0},  /* not reportable; 0x1: becoming */
1654     {SAM_STAT_RESERVATION_CONFLICT, 0x0, 0x0, 0x0},
1655     {0x2, SPC_SK_NOT_READY, 0x4, 0x4},  /* format in progress */  /* 15 */
1656     {0x2, SPC_SK_ILLEGAL_REQUEST, 0x31, 0x1},  /* format failed */
1657     {0x2, SPC_SK_NOT_READY, 0x4, 0x9},  /* self-test in progress */
1658     {0x2, SPC_SK_DATA_PROTECT, 0x27, 0x0},      /* write prohibited */
1659     {0x2, SPC_SK_ILLEGAL_REQUEST, 0x10, 0x5},  /* protection info */
1660     {0x2, SPC_SK_MEDIUM_ERROR, 0x3, 0x0}, /* periph dev w fault */ /* 20 */
1661     {0x2, SPC_SK_MEDIUM_ERROR, 0x11, 0x0},      /* unrecoc rd */
1662     {0x2, SPC_SK_MEDIUM_ERROR, 0x10, 0x1},      /* PI guard */
1663     {0x2, SPC_SK_MEDIUM_ERROR, 0x10, 0x2},      /* PI app tag */
1664     {0x2, SPC_SK_MEDIUM_ERROR, 0x10, 0x2},      /* PI app tag */
1665     {0x2, SPC_SK_MISCOMPARE, 0x1d, 0x0},        /* during verify */ /* 25 */
1666     {0x2, SPC_SK_MEDIUM_ERROR, 0x21, 0x6},      /* read invalid data */
1667 
1668     /* Leave this Sentinel value at end of this array */
1669     {0xff, 0xff, 0xff, 0xff},
1670 };
1671 
1672 
1673 #else           /* (SG_SCSI_STRINGS && HAVE_NVME && (! IGNORE_NVME)) */
1674 struct sg_lib_value_name_t sg_lib_nvme_cmd_status_arr[] =
1675 {
1676 
1677     /* Leave this Sentinel value at end of this array */
1678     {0x3ff, 0, NULL},
1679 };
1680 
1681 struct sg_lib_4tuple_u8 sg_lib_scsi_status_sense_arr[] =
1682 {
1683 
1684     /* Leave this Sentinel value at end of this array */
1685     {0xff, 0xff, 0xff, 0xff},
1686 };
1687 
1688 #endif           /* (SG_SCSI_STRINGS && HAVE_NVME && (! IGNORE_NVME)) */
1689