37#include <sys/stdint.h>
43#include <sys/libkern.h>
44#include <sys/kernel.h>
46#include <sys/malloc.h>
48#include <sys/sysctl.h>
90#define SCSI_DELAY 2000
99#define SCSI_MIN_DELAY 100
104#if (SCSI_DELAY < SCSI_MIN_DELAY && SCSI_DELAY != 0)
105#error "SCSI_DELAY is in milliseconds, not seconds! Please use a larger value"
110static int ascentrycomp(
const void *key,
const void *member);
123#if !defined(SCSI_NO_OP_STRINGS)
125#define D (1 << T_DIRECT)
126#define T (1 << T_SEQUENTIAL)
127#define L (1 << T_PRINTER)
128#define P (1 << T_PROCESSOR)
129#define W (1 << T_WORM)
130#define R (1 << T_CDROM)
131#define O (1 << T_OPTICAL)
132#define M (1 << T_CHANGER)
133#define A (1 << T_STORARRAY)
134#define E (1 << T_ENCLOSURE)
135#define B (1 << T_RBC)
136#define K (1 << T_OCRW)
137#define V (1 << T_ADC)
138#define F (1 << T_OSD)
139#define S (1 << T_SCANNER)
140#define C (1 << T_COMM)
142#define ALL (D | T | L | P | W | R | O | M | A | E | B | K | V | F | S | C)
145 { 0xD8,
R,
"CD-DA READ" }
200 { 0x00,
ALL,
"TEST UNIT READY" },
202 { 0x01,
T,
"REWIND" },
204 { 0x01,
D |
W |
R |
O |
M,
"REZERO UNIT" },
207 { 0x03,
ALL,
"REQUEST SENSE" },
209 { 0x04,
D |
R |
O,
"FORMAT UNIT" },
211 { 0x04,
T,
"FORMAT MEDIUM" },
213 { 0x04,
L,
"FORMAT" },
215 { 0x05,
T,
"READ BLOCK LIMITS" },
218 { 0x07,
D |
W |
O,
"REASSIGN BLOCKS" },
220 { 0x07,
M,
"INITIALIZE ELEMENT STATUS" },
222 { 0x08,
D |
T |
W |
O,
"READ(6)" },
224 { 0x08,
P,
"RECEIVE" },
226 { 0x08,
C,
"GET MESSAGE(6)" },
229 { 0x0A,
D |
T |
W |
O,
"WRITE(6)" },
231 { 0x0A,
P,
"SEND(6)" },
233 { 0x0A,
C,
"SEND MESSAGE(6)" },
235 { 0x0A,
L,
"PRINT" },
237 { 0x0B,
D |
W |
R |
O,
"SEEK(6)" },
239 { 0x0B,
T,
"SET CAPACITY" },
241 { 0x0B,
L,
"SLEW AND PRINT" },
246 { 0x0F,
T,
"READ REVERSE(6)" },
248 { 0x10,
T,
"WRITE FILEMARKS(6)" },
250 { 0x10,
L,
"SYNCHRONIZE BUFFER" },
252 { 0x11,
T,
"SPACE(6)" },
254 { 0x12,
ALL,
"INQUIRY" },
257 { 0x13,
T,
"VERIFY(6)" },
259 { 0x14,
T |
L,
"RECOVER BUFFERED DATA" },
261 { 0x15,
ALL & ~(
P |
R |
B |
F),
"MODE SELECT(6)" },
263 { 0x16,
ALL & ~(
R |
B |
V |
F |
C),
"RESERVE(6)" },
265 { 0x16,
M,
"RESERVE ELEMENT(6)" },
267 { 0x17,
ALL & ~(
R |
B |
V |
F |
C),
"RELEASE(6)" },
269 { 0x17,
M,
"RELEASE ELEMENT(6)" },
271 { 0x18,
D |
T |
L |
P |
W |
R |
O |
K |
S,
"COPY" },
273 { 0x19,
T,
"ERASE(6)" },
275 { 0x1A,
ALL & ~(
P |
R |
B |
F),
"MODE SENSE(6)" },
277 { 0x1B,
D |
W |
R |
O |
A |
B |
K |
F,
"START STOP UNIT" },
279 { 0x1B,
T |
V,
"LOAD UNLOAD" },
283 { 0x1B,
L,
"STOP PRINT" },
285 { 0x1B,
M,
"OPEN/CLOSE IMPORT/EXPORT ELEMENT" },
287 { 0x1C,
ALL & ~(
R |
B),
"RECEIVE DIAGNOSTIC RESULTS" },
289 { 0x1D,
ALL & ~(
R |
B),
"SEND DIAGNOSTIC" },
291 { 0x1E,
D |
T |
W |
R |
O |
M |
K |
F,
"PREVENT ALLOW MEDIUM REMOVAL" },
298 { 0x23,
R,
"READ FORMAT CAPACITIES" },
300 { 0x24,
S,
"SET WINDOW" },
302 { 0x25,
D |
W |
O |
B,
"READ CAPACITY(10)" },
304 { 0x25,
R,
"READ CAPACITY" },
306 { 0x25,
K,
"READ CARD CAPACITY" },
308 { 0x25,
S,
"GET WINDOW" },
312 { 0x28,
D |
W |
R |
O |
B |
K |
S,
"READ(10)" },
314 { 0x28,
C,
"GET MESSAGE(10)" },
316 { 0x29,
O,
"READ GENERATION" },
318 { 0x2A,
D |
W |
R |
O |
B |
K,
"WRITE(10)" },
320 { 0x2A,
S,
"SEND(10)" },
322 { 0x2A,
C,
"SEND MESSAGE(10)" },
324 { 0x2B,
D |
W |
R |
O |
K,
"SEEK(10)" },
326 { 0x2B,
T,
"LOCATE(10)" },
328 { 0x2B,
M,
"POSITION TO ELEMENT" },
330 { 0x2C,
R |
O,
"ERASE(10)" },
332 { 0x2D,
O,
"READ UPDATED BLOCK" },
335 { 0x2E,
D |
W |
R |
O |
B |
K,
"WRITE AND VERIFY(10)" },
337 { 0x2F,
D |
W |
R |
O,
"VERIFY(10)" },
339 { 0x30,
D |
W |
R |
O,
"SEARCH DATA HIGH(10)" },
341 { 0x31,
D |
W |
R |
O,
"SEARCH DATA EQUAL(10)" },
343 { 0x31,
S,
"OBJECT POSITION" },
345 { 0x32,
D |
W |
R |
O,
"SEARCH DATA LOW(10)" },
347 { 0x33,
D |
W |
R |
O,
"SET LIMITS(10)" },
349 { 0x34,
D |
W |
O |
K,
"PRE-FETCH(10)" },
351 { 0x34,
T,
"READ POSITION" },
353 { 0x34,
S,
"GET DATA BUFFER STATUS" },
355 { 0x35,
D |
W |
R |
O |
B |
K,
"SYNCHRONIZE CACHE(10)" },
357 { 0x36,
D |
W |
O |
K,
"LOCK UNLOCK CACHE(10)" },
359 { 0x37,
D |
O,
"READ DEFECT DATA(10)" },
361 { 0x37,
M,
"INITIALIZE ELEMENT STATUS WITH RANGE" },
363 { 0x38,
W |
O |
K,
"MEDIUM SCAN" },
365 { 0x39,
D |
T |
L |
P |
W |
R |
O |
K |
S,
"COMPARE" },
367 { 0x3A,
D |
T |
L |
P |
W |
R |
O |
K |
S,
"COPY AND VERIFY" },
369 { 0x3B,
ALL,
"WRITE BUFFER" },
371 { 0x3C,
ALL & ~(
B),
"READ BUFFER" },
373 { 0x3D,
O,
"UPDATE BLOCK" },
375 { 0x3E,
D |
W |
O,
"READ LONG(10)" },
377 { 0x3F,
D |
W |
O,
"WRITE LONG(10)" },
379 { 0x40,
D |
T |
L |
P |
W |
R |
O |
M |
S |
C,
"CHANGE DEFINITION" },
381 { 0x41,
D,
"WRITE SAME(10)" },
383 { 0x42,
D,
"UNMAP" },
385 { 0x42,
R,
"READ SUB-CHANNEL" },
387 { 0x43,
R,
"READ TOC/PMA/ATIP" },
389 { 0x44,
T |
V,
"REPORT DENSITY SUPPORT" },
392 { 0x45,
R,
"PLAY AUDIO(10)" },
394 { 0x46,
R,
"GET CONFIGURATION" },
396 { 0x47,
R,
"PLAY AUDIO MSF" },
398 { 0x48,
D,
"SANITIZE" },
401 { 0x4A,
R,
"GET EVENT STATUS NOTIFICATION" },
403 { 0x4B,
R,
"PAUSE/RESUME" },
405 { 0x4C,
ALL & ~(
R |
B),
"LOG SELECT" },
407 { 0x4D,
ALL & ~(
R |
B),
"LOG SENSE" },
409 { 0x4E,
R,
"STOP PLAY/SCAN" },
412 { 0x50,
D,
"XDWRITE(10)" },
414 { 0x51,
D,
"XPWRITE(10)" },
416 { 0x51,
R,
"READ DISC INFORMATION" },
418 { 0x52,
D,
"XDREAD(10)" },
420 { 0x52,
R,
"READ TRACK INFORMATION" },
422 { 0x53,
D,
"XDWRITEREAD(10)" },
424 { 0x53,
R,
"RESERVE TRACK" },
426 { 0x54,
R,
"SEND OPC INFORMATION" },
428 { 0x55,
ALL & ~(
P),
"MODE SELECT(10)" },
430 { 0x56,
ALL & ~(
R |
B |
K |
V |
F |
C),
"RESERVE(10)" },
432 { 0x56,
M,
"RESERVE ELEMENT(10)" },
434 { 0x57,
ALL & ~(
R |
B |
K |
V |
F |
C),
"RELEASE(10)" },
436 { 0x57,
M,
"RELEASE ELEMENT(10)" },
438 { 0x58,
R,
"REPAIR TRACK" },
441 { 0x5A,
ALL & ~(
P),
"MODE SENSE(10)" },
443 { 0x5B,
R,
"CLOSE TRACK/SESSION" },
445 { 0x5C,
R,
"READ BUFFER CAPACITY" },
447 { 0x5D,
R,
"SEND CUE SHEET" },
449 { 0x5E,
ALL & ~(
R |
B |
K |
V |
C),
"PERSISTENT RESERVE IN" },
451 { 0x5F,
ALL & ~(
R |
B |
K |
V |
C),
"PERSISTENT RESERVE OUT" },
453 { 0x7E,
D |
T |
R |
M |
A |
E |
B |
V,
"extended CDB" },
455 { 0x7F,
D |
F,
"variable length CDB (more than 16 bytes)" },
457 { 0x80,
D,
"XDWRITE EXTENDED(16)" },
459 { 0x80,
T,
"WRITE FILEMARKS(16)" },
461 { 0x81,
D,
"REBUILD(16)" },
463 { 0x81,
T,
"READ REVERSE(16)" },
465 { 0x82,
D,
"REGENERATE(16)" },
467 { 0x82,
T,
"ALLOW OVERWRITE" },
469 { 0x83,
D |
T |
L |
P |
W |
O |
K |
V,
"EXTENDED COPY" },
471 { 0x84,
D |
T |
L |
P |
W |
O |
K |
V,
"RECEIVE COPY RESULTS" },
473 { 0x85,
D |
R |
B,
"ATA COMMAND PASS THROUGH(16)" },
475 { 0x86,
ALL & ~(
L |
R |
F),
"ACCESS CONTROL IN" },
477 { 0x87,
ALL & ~(
L |
R |
F),
"ACCESS CONTROL OUT" },
479 { 0x88,
D |
T |
W |
O |
B,
"READ(16)" },
481 { 0x89,
D,
"COMPARE AND WRITE" },
483 { 0x8A,
D |
T |
W |
O |
B,
"WRITE(16)" },
485 { 0x8B,
D,
"ORWRITE" },
487 { 0x8C,
D |
T |
W |
O |
M |
B |
V,
"READ ATTRIBUTE" },
489 { 0x8D,
D |
T |
W |
O |
M |
B |
V,
"WRITE ATTRIBUTE" },
491 { 0x8E,
D |
W |
O |
B,
"WRITE AND VERIFY(16)" },
493 { 0x8F,
D |
T |
W |
O |
B,
"VERIFY(16)" },
495 { 0x90,
D |
W |
O |
B,
"PRE-FETCH(16)" },
497 { 0x91,
D |
W |
O |
B,
"SYNCHRONIZE CACHE(16)" },
499 { 0x91,
T,
"SPACE(16)" },
501 { 0x92,
D |
W |
O,
"LOCK UNLOCK CACHE(16)" },
503 { 0x92,
T,
"LOCATE(16)" },
505 { 0x93,
D,
"WRITE SAME(16)" },
507 { 0x93,
T,
"ERASE(16)" },
509 { 0x94,
ALL,
"ZBC OUT" },
511 { 0x95,
ALL,
"ZBC IN" },
517 { 0x9A,
D,
"WRITE STREAM(16)" },
519 { 0x9B,
ALL & ~(
B) ,
"READ BUFFER(16)" },
521 { 0x9C,
D,
"WRITE ATOMIC(16)" },
523 { 0x9D,
ALL,
"SERVICE ACTION BIDIRECTIONAL" },
526 { 0x9E,
ALL,
"SERVICE ACTION IN(16)" },
528 { 0x9F,
ALL,
"SERVICE ACTION OUT(16)" },
530 { 0xA0,
ALL & ~(
R |
B),
"REPORT LUNS" },
532 { 0xA1,
R,
"BLANK" },
534 { 0xA1,
D |
B,
"ATA COMMAND PASS THROUGH(12)" },
536 { 0xA2,
D |
T |
R |
V,
"SECURITY PROTOCOL IN" },
538 { 0xA3,
ALL & ~(
P |
R |
F),
"MAINTENANCE (IN)" },
540 { 0xA3,
R,
"SEND KEY" },
542 { 0xA4,
ALL & ~(
P |
R |
F),
"MAINTENANCE (OUT)" },
544 { 0xA4,
R,
"REPORT KEY" },
546 { 0xA5,
T |
W |
O |
M,
"MOVE MEDIUM" },
548 { 0xA5,
R,
"PLAY AUDIO(12)" },
550 { 0xA6,
M,
"EXCHANGE MEDIUM" },
552 { 0xA6,
R,
"LOAD/UNLOAD C/DVD" },
554 { 0xA7,
D |
T |
W |
O,
"MOVE MEDIUM ATTACHED" },
556 { 0xA7,
R,
"SET READ AHEAD" },
558 { 0xA8,
D |
W |
R |
O,
"READ(12)" },
560 { 0xA8,
C,
"GET MESSAGE(12)" },
562 { 0xA9,
V,
"SERVICE ACTION OUT(12)" },
564 { 0xAA,
D |
W |
R |
O,
"WRITE(12)" },
566 { 0xAA,
C,
"SEND MESSAGE(12)" },
568 { 0xAB,
R |
V,
"SERVICE ACTION IN(12)" },
570 { 0xAC,
O,
"ERASE(12)" },
572 { 0xAC,
R,
"GET PERFORMANCE" },
574 { 0xAD,
R,
"READ DVD STRUCTURE" },
576 { 0xAE,
D |
W |
O,
"WRITE AND VERIFY(12)" },
578 { 0xAF,
D |
W |
R |
O,
"VERIFY(12)" },
580 { 0xB0,
W |
R |
O,
"SEARCH DATA HIGH(12)" },
582 { 0xB1,
W |
R |
O,
"SEARCH DATA EQUAL(12)" },
584 { 0xB2,
W |
R |
O,
"SEARCH DATA LOW(12)" },
586 { 0xB3,
D |
W |
R |
O,
"SET LIMITS(12)" },
588 { 0xB4,
D |
T |
W |
R |
O,
"READ ELEMENT STATUS ATTACHED" },
590 { 0xB5,
D |
T |
R |
V,
"SECURITY PROTOCOL OUT" },
592 { 0xB5,
M,
"REQUEST VOLUME ELEMENT ADDRESS" },
594 { 0xB6,
M,
"SEND VOLUME TAG" },
596 { 0xB6,
R,
"SET STREAMING" },
598 { 0xB7,
D |
O,
"READ DEFECT DATA(12)" },
600 { 0xB8,
T |
W |
R |
O |
M,
"READ ELEMENT STATUS" },
602 { 0xB9,
R,
"READ CD MSF" },
604 { 0xBA,
D |
W |
O |
M |
A |
E,
"REDUNDANCY GROUP (IN)" },
608 { 0xBB,
D |
W |
O |
M |
A |
E,
"REDUNDANCY GROUP (OUT)" },
610 { 0xBB,
R,
"SET CD SPEED" },
612 { 0xBC,
D |
W |
O |
M |
A |
E,
"SPARE (IN)" },
614 { 0xBD,
D |
W |
O |
M |
A |
E,
"SPARE (OUT)" },
616 { 0xBD,
R,
"MECHANISM STATUS" },
618 { 0xBE,
D |
W |
O |
M |
A |
E,
"VOLUME SET (IN)" },
620 { 0xBE,
R,
"READ CD" },
622 { 0xBF,
D |
W |
O |
M |
A |
E,
"VOLUME SET (OUT)" },
624 { 0xBF,
R,
"SEND DVD STRUCTURE" }
643 if (inq_data == NULL) {
667 if ((opcode > 0xBF) || ((opcode > 0x5F) && (opcode < 0x80)))
668 return(
"Vendor Specific Command");
676 if (pd_type ==
T_RBC)
689 opmask = 1 << pd_type;
691 for (j = 0; j < num_tables; j++) {
692 for (i = 0;i <
num_ops[j] && table[j][i].
opcode <= opcode; i++){
693 if ((table[j][i].opcode == opcode)
694 && ((table[j][i].opmask & opmask) != 0))
695 return(table[j][i].desc);
703 return(
"Vendor Specific Command");
717#if !defined(SCSI_NO_SENSE_STRINGS)
718#define SST(asc, ascq, action, desc) \
719 asc, ascq, action, desc
721const char empty_string[] =
"";
723#define SST(asc, ascq, action, desc) \
724 asc, ascq, action, empty_string
749 "Logical unit not ready, initializing cmd. required") }
754 "Logical unit not ready, cause not reportable") }
759 "Vendor Unique - Logical Unit Not Ready") },
761 "Unrecovered Super Certification Log Write Error") },
763 "Unrecovered Super Certification Log Read Error") },
765 "Unrecovered Sector Error") },
767 "Unrecovered Self-Test Hard-Cache Test Fail") },
769 "Unrecovered Self-Test OTF-Cache Fail") },
771 "Unrecovered SAT No Buffer Overflow Error") },
773 "Unrecovered SAT Buffer Overflow Error") },
775 "Unrecovered SAT No Buffer Overflow With ECS Fault") },
777 "Unrecovered SAT Buffer Overflow With ECS Fault") },
781 "Vendor Unique - Internal Target Failure") },
783 "Vendor Unique - Internal Target Failure") },
785 "Vendor Unique - Internal Target Failure") },
787 "Vendor Unique - Internal Target Failure") },
789 "Vendor Unique - Internal Target Failure") },
791 "Extreme Over-Temperature Warning") },
793 "Load/Unload cycle Count Warning") },
795 "Vendor Unique - Internal Logic Error") },
797 "Vendor Unique - Internal Key Seed Error") },
802 "Logical Unit Not Ready, super certify in Progress") },
804 "Write Fault Data Corruption") },
806 "Tracking Failure") },
810 "Pre-SMART Warning") },
812 "5V Voltage Warning") },
814 "12V Voltage Warning") },
816 "Write Error - Too many error recovery revs") },
818 "Unrecovered Read Error - Too many error recovery revs") },
820 "Fewer than 1/2 defect list copies") },
822 "Illegal CDB linked to skip mask cmd") },
824 "Illegal byte in CDB, LBA not matching") },
826 "Illegal byte in CDB, LEN not matching") },
828 "Mask not matching transfer length") },
830 "Drive formatted without plist") },
832 "Invalid Field Parameter - CAP File") },
834 "Invalid Field Parameter - RAP File") },
836 "Invalid Field Parameter - TMS Firmware Tag") },
838 "Invalid Field Parameter - Check Sum") },
840 "Invalid Field Parameter - Firmware Tag") },
842 "Write Log Dump data") },
844 "Write Log Dump data") },
846 "Reserved disk space") },
852 "Format Corrupted World Wide Name (WWN) is Invalid") },
854 "Defect List - Length exceeds Command Allocated Length") },
856 "Flash not ready for access") },
858 "Invalid RAP block") },
860 "RAP/ETF mismatch") },
862 "Invalid CAP block") },
864 "World Wide Name (WWN) Mismatch") },
866 "DRAM Parity Error") },
868 "DRAM Parity Error") },
874 "Compare error during data integrity check") },
876 "Unrecoverable error during data integrity check") },
878 "Fibre Channel Sequence Error") },
880 "Information Unit Too Short") },
882 "General Firmware Error / Command Timeout") },
884 "Command Timeout") },
886 "Command Timeout") },
888 "FC FIFO Error During Read Transfer") },
890 "FC FIFO Error During Write Transfer") },
892 "DISC FIFO Error During Read Transfer") },
894 "DISC FIFO Error During Write Transfer") },
896 "LBA Seeded LRC Error on Read") },
898 "LBA Seeded LRC Error on Write") },
900 "IOEDC Error on Read") },
902 "IOEDC Error on Write") },
904 "Host Parity Check Failed") },
906 "IOEDC error on read detected by formatter") },
908 "Host Parity Errors / Host FIFO Initialization Failed") },
910 "Host Parity Errors") },
912 "Host Parity Errors") },
914 "Host Parity Errors") },
916 "LA Check Failed") },
918 "Internal client detected insufficient buffer") },
920 "Scheduled Diagnostic And Repair") },
1002 "No additional sense information") },
1005 "Filemark detected") },
1008 "End-of-partition/medium detected") },
1011 "Setmark detected") },
1014 "Beginning-of-partition/medium detected") },
1017 "End-of-data detected") },
1020 "I/O process terminated") },
1023 "Programmable early warning detected") },
1026 "Audio play operation in progress") },
1029 "Audio play operation paused") },
1032 "Audio play operation successfully completed") },
1035 "Audio play operation stopped due to error") },
1038 "No current audio status to return") },
1041 "Operation in progress") },
1044 "Cleaning requested") },
1047 "Erase operation in progress") },
1050 "Locate operation in progress") },
1053 "Rewind operation in progress") },
1056 "Set capacity operation in progress") },
1059 "Verify operation in progress") },
1062 "ATA pass through information available") },
1065 "Conflicting SA creation request") },
1068 "Logical unit transitioning to another power condition") },
1071 "Extended copy information available") },
1074 "Atomic command aborted due to ACA") },
1077 "No index/sector signal") },
1080 "No seek complete") },
1083 "Peripheral device write fault") },
1086 "No write current") },
1089 "Excessive write errors") },
1092 "Logical unit not ready, cause not reportable") },
1095 "Logical unit is in process of becoming ready") },
1098 "Logical unit not ready, initializing command required") },
1101 "Logical unit not ready, manual intervention required") },
1104 "Logical unit not ready, format in progress") },
1107 "Logical unit not ready, rebuild in progress") },
1110 "Logical unit not ready, recalculation in progress") },
1113 "Logical unit not ready, operation in progress") },
1116 "Logical unit not ready, long write in progress") },
1119 "Logical unit not ready, self-test in progress") },
1122 "Logical unit not accessible, asymmetric access state transition")},
1125 "Logical unit not accessible, target port in standby state") },
1128 "Logical unit not accessible, target port in unavailable state") },
1131 "Logical unit not ready, structure check required") },
1134 "Logical unit not ready, security session in progress") },
1137 "Logical unit not ready, auxiliary memory not accessible") },
1140 "Logical unit not ready, notify (enable spinup) required") },
1143 "Logical unit not ready, offline") },
1146 "Logical unit not ready, SA creation in progress") },
1149 "Logical unit not ready, space allocation in progress") },
1152 "Logical unit not ready, robotics disabled") },
1155 "Logical unit not ready, configuration required") },
1158 "Logical unit not ready, calibration required") },
1161 "Logical unit not ready, a door is open") },
1164 "Logical unit not ready, operating in sequential mode") },
1167 "Logical unit not ready, START/STOP UNIT command in progress") },
1170 "Logical unit not ready, sanitize in progress") },
1173 "Logical unit not ready, additional power use not yet granted") },
1176 "Logical unit not ready, configuration in progress") },
1179 "Logical unit not ready, microcode activation required") },
1182 "Logical unit not ready, microcode download required") },
1185 "Logical unit not ready, logical unit reset required") },
1188 "Logical unit not ready, hard reset required") },
1191 "Logical unit not ready, power cycle required") },
1194 "Logical unit not ready, affiliation required") },
1197 "Depopulation in progress") },
1200 "Depopulation restoration in progress") },
1203 "Logical unit does not respond to selection") },
1206 "No reference position found") },
1209 "Multiple peripheral devices selected") },
1212 "Logical unit communication failure") },
1215 "Logical unit communication time-out") },
1218 "Logical unit communication parity error") },
1221 "Logical unit communication CRC error (Ultra-DMA/32)") },
1224 "Unreachable copy target") },
1227 "Track following error") },
1230 "Tracking servo failure") },
1233 "Focus servo failure") },
1236 "Spindle servo failure") },
1239 "Head select fault") },
1242 "Vibration induced tracking error") },
1245 "Error log overflow") },
1251 "Warning - specified temperature exceeded") },
1254 "Warning - enclosure degraded") },
1257 "Warning - background self-test failed") },
1260 "Warning - background pre-scan detected medium error") },
1263 "Warning - background medium scan detected medium error") },
1266 "Warning - non-volatile cache now volatile") },
1269 "Warning - degraded power to non-volatile cache") },
1272 "Warning - power loss expected") },
1275 "Warning - device statistics notification available") },
1278 "Warning - High critical temperature limit exceeded") },
1281 "Warning - Low critical temperature limit exceeded") },
1284 "Warning - High operating temperature limit exceeded") },
1287 "Warning - Low operating temperature limit exceeded") },
1290 "Warning - High citical humidity limit exceeded") },
1293 "Warning - Low citical humidity limit exceeded") },
1296 "Warning - High operating humidity limit exceeded") },
1299 "Warning - Low operating humidity limit exceeded") },
1305 "Write error - recovered with auto reallocation") },
1308 "Write error - auto reallocation failed") },
1311 "Write error - recommend reassignment") },
1314 "Compression check miscompare error") },
1317 "Data expansion occurred during compression") },
1320 "Block not compressible") },
1323 "Write error - recovery needed") },
1326 "Write error - recovery failed") },
1329 "Write error - loss of streaming") },
1332 "Write error - padding blocks added") },
1335 "Auxiliary memory write error") },
1338 "Write error - unexpected unsolicited data") },
1341 "Write error - not enough unsolicited data") },
1344 "Multiple write errors") },
1347 "Defects in error window") },
1350 "Incomplete multiple atomic write operations") },
1353 "Write error - recovery scan needed") },
1356 "Write error - insufficient zone resources") },
1359 "Error detected by third party temporary initiator") },
1362 "Third party device failure") },
1365 "Copy target device not reachable") },
1368 "Incorrect copy target device type") },
1371 "Copy target device data underrun") },
1374 "Copy target device data overrun") },
1377 "Invalid information unit") },
1380 "Information unit too short") },
1383 "Information unit too long") },
1386 "Invalid field in command information unit") },
1389 "ID CRC or ECC error") },
1392 "Logical block guard check failed") },
1395 "Logical block application tag check failed") },
1398 "Logical block reference tag check failed") },
1401 "Logical block protection error on recovered buffer data") },
1404 "Logical block protection method error") },
1407 "Unrecovered read error") },
1410 "Read retries exhausted") },
1413 "Error too long to correct") },
1416 "Multiple read errors") },
1419 "Unrecovered read error - auto reallocate failed") },
1422 "L-EC uncorrectable error") },
1425 "CIRC unrecovered error") },
1428 "Data re-synchronization error") },
1431 "Incomplete block read") },
1437 "Miscorrected error") },
1440 "Unrecovered read error - recommend reassignment") },
1443 "Unrecovered read error - recommend rewrite the data") },
1446 "De-compression CRC error") },
1449 "Cannot decompress using declared algorithm") },
1452 "Error reading UPC/EAN number") },
1455 "Error reading ISRC number") },
1458 "Read error - loss of streaming") },
1461 "Auxiliary memory read error") },
1464 "Read error - failed retransmission request") },
1467 "Read error - LBA marked bad by application client") },
1470 "Write after sanitize required") },
1473 "Address mark not found for ID field") },
1476 "Address mark not found for data field") },
1479 "Recorded entity not found") },
1482 "Record not found") },
1485 "Filemark or setmark not found") },
1488 "End-of-data not found") },
1491 "Block sequence error") },
1494 "Record not found - recommend reassignment") },
1497 "Record not found - data auto-reallocated") },
1500 "Locate operation failure") },
1503 "Random positioning error") },
1506 "Mechanical positioning error") },
1509 "Positioning error detected by read of medium") },
1512 "Data synchronization mark error") },
1515 "Data sync error - data rewritten") },
1518 "Data sync error - recommend rewrite") },
1521 "Data sync error - data auto-reallocated") },
1524 "Data sync error - recommend reassignment") },
1527 "Recovered data with no error correction applied") },
1530 "Recovered data with retries") },
1533 "Recovered data with positive head offset") },
1536 "Recovered data with negative head offset") },
1539 "Recovered data with retries and/or CIRC applied") },
1542 "Recovered data using previous sector ID") },
1545 "Recovered data without ECC - data auto-reallocated") },
1548 "Recovered data without ECC - recommend reassignment") },
1551 "Recovered data without ECC - recommend rewrite") },
1554 "Recovered data without ECC - data rewritten") },
1557 "Recovered data with error correction applied") },
1560 "Recovered data with error corr. & retries applied") },
1563 "Recovered data - data auto-reallocated") },
1566 "Recovered data with CIRC") },
1569 "Recovered data with L-EC") },
1572 "Recovered data - recommend reassignment") },
1575 "Recovered data - recommend rewrite") },
1578 "Recovered data with ECC - data rewritten") },
1581 "Recovered data with linking") },
1584 "Defect list error") },
1587 "Defect list not available") },
1590 "Defect list error in primary list") },
1593 "Defect list error in grown list") },
1596 "Parameter list length error") },
1599 "Synchronous data transfer error") },
1602 "Defect list not found") },
1605 "Primary defect list not found") },
1608 "Grown defect list not found") },
1611 "Miscompare during verify operation") },
1614 "Miscomparable verify of unmapped LBA") },
1617 "Recovered ID with ECC correction") },
1620 "Partial defect list transfer") },
1623 "Invalid command operation code") },
1626 "Access denied - initiator pending-enrolled") },
1629 "Access denied - no access rights") },
1632 "Access denied - invalid mgmt ID key") },
1635 "Illegal command while in write capable state") },
1641 "Illegal command while in explicit address mode") },
1644 "Illegal command while in implicit address mode") },
1647 "Access denied - enrollment conflict") },
1650 "Access denied - invalid LU identifier") },
1653 "Access denied - invalid proxy token") },
1656 "Access denied - ACL LUN conflict") },
1659 "Illegal command when not in append-only mode") },
1662 "Logical block address out of range") },
1665 "Invalid element address") },
1668 "Invalid address for write") },
1671 "Invalid write crossing layer jump") },
1674 "Unaligned write command") },
1677 "Write boundary violation") },
1680 "Attempt to read invalid data") },
1683 "Read boundary violation") },
1686 "Illegal function (use 20 00, 24 00, or 26 00)") },
1689 "Invalid token operation, cause not reportable") },
1692 "Invalid token operation, unsupported token type") },
1695 "Invalid token operation, remote token usage not supported") },
1698 "Invalid token operation, remote ROD token creation not supported") },
1701 "Invalid token operation, token unknown") },
1704 "Invalid token operation, token corrupt") },
1707 "Invalid token operation, token revoked") },
1710 "Invalid token operation, token expired") },
1713 "Invalid token operation, token cancelled") },
1716 "Invalid token operation, token deleted") },
1719 "Invalid token operation, invalid token length") },
1722 "Invalid field in CDB") },
1725 "CDB decryption error") },
1734 "Security audit value frozen") },
1737 "Security working key frozen") },
1740 "NONCE not unique") },
1743 "NONCE timestamp out of range") },
1749 "Logical unit not supported") },
1752 "Invalid field in parameter list") },
1755 "Parameter not supported") },
1758 "Parameter value invalid") },
1761 "Threshold parameters not supported") },
1764 "Invalid release of persistent reservation") },
1767 "Data decryption error") },
1770 "Too many target descriptors") },
1773 "Unsupported target descriptor type code") },
1776 "Too many segment descriptors") },
1779 "Unsupported segment descriptor type code") },
1782 "Unexpected inexact segment") },
1785 "Inline data length exceeded") },
1788 "Invalid operation for copy source or destination") },
1791 "Copy segment granularity violation") },
1794 "Invalid parameter while port is enabled") },
1797 "Invalid data-out buffer integrity check value") },
1800 "Data decryption key fail limit reached") },
1803 "Incomplete key-associated data set") },
1806 "Vendor specific key reference not found") },
1809 "Application tag mode page is invalid") },
1812 "Write protected") },
1815 "Hardware write protected") },
1818 "Logical unit software write protected") },
1821 "Associated write protect") },
1824 "Persistent write protect") },
1827 "Permanent write protect") },
1830 "Conditional write protect") },
1833 "Space allocation failed write protect") },
1836 "Zone is read only") },
1839 "Not ready to ready change, medium may have changed") },
1842 "Import or export element accessed") },
1845 "Format-layer may have changed") },
1848 "Import/export element accessed, medium changed") },
1856 "Power on, reset, or bus device reset occurred") },
1859 "Power on occurred") },
1862 "SCSI bus reset occurred") },
1865 "Bus device reset function occurred") },
1868 "Device internal reset") },
1871 "Transceiver mode changed to single-ended") },
1874 "Transceiver mode changed to LVD") },
1877 "I_T nexus loss occurred") },
1880 "Parameters changed") },
1883 "Mode parameters changed") },
1886 "Log parameters changed") },
1889 "Reservations preempted") },
1892 "Reservations released") },
1895 "Registrations preempted") },
1898 "Asymmetric access state changed") },
1901 "Implicit asymmetric access state transition failed") },
1904 "Priority changed") },
1907 "Capacity data has changed") },
1910 "Error history I_T nexus cleared") },
1913 "Error history snapshot released") },
1916 "Error recovery attributes have changed") },
1919 "Data encryption capabilities changed") },
1922 "Timestamp changed") },
1925 "Data encryption parameters changed by another I_T nexus") },
1928 "Data encryption parameters changed by vendor specific event") },
1931 "Data encryption key instance counter has changed") },
1934 "SA creation capabilities data has changed") },
1937 "Medium removal prevention preempted") },
1940 "Copy cannot execute since host cannot disconnect") },
1943 "Command sequence error") },
1946 "Too many windows specified") },
1949 "Invalid combination of windows specified") },
1952 "Current program area is not empty") },
1955 "Current program area is empty") },
1958 "Illegal power condition request") },
1961 "Persistent prevent conflict") },
1964 "Previous busy status") },
1967 "Previous task set full status") },
1970 "Previous reservation conflict status") },
1973 "Partition or collection contains user objects") },
1979 "ORWRITE generation does not match") },
1982 "Reset write pointer not allowed") },
1985 "Zone is offline") },
1988 "Stream not open") },
1991 "Unwritten data in zone") },
1994 "Overwrite error on update in place") },
1997 "Insufficient time for operation") },
2000 "Command timeout before processing") },
2003 "Command timeout during processing") },
2006 "Command timeout during processing due to error recovery") },
2009 "Commands cleared by another initiator") },
2012 "Commands cleared by power loss notification") },
2015 "Commands cleared by device server") },
2018 "Some commands cleared by queuing layer event") },
2021 "Incompatible medium installed") },
2024 "Cannot read medium - unknown format") },
2027 "Cannot read medium - incompatible format") },
2030 "Cleaning cartridge installed") },
2033 "Cannot write medium - unknown format") },
2036 "Cannot write medium - incompatible format") },
2039 "Cannot format medium - incompatible medium") },
2042 "Cleaning failure") },
2045 "Cannot write - application code mismatch") },
2048 "Current session not fixated for append") },
2051 "Cleaning request rejected") },
2054 "WORM medium - overwrite attempted") },
2057 "WORM medium - integrity check") },
2060 "Medium not formatted") },
2063 "Incompatible volume type") },
2066 "Incompatible volume qualifier") },
2069 "Cleaning volume expired") },
2072 "Medium format corrupted") },
2075 "Format command failed") },
2078 "Zoned formatting failed due to spare linking") },
2081 "SANITIZE command failed") },
2084 "Depopulation failed") },
2087 "Depopulation restoration failed") },
2090 "No defect spare location available") },
2093 "Defect list update failure") },
2096 "Tape length error") },
2099 "Enclosure failure") },
2102 "Enclosure services failure") },
2105 "Unsupported enclosure function") },
2108 "Enclosure services unavailable") },
2111 "Enclosure services transfer failure") },
2114 "Enclosure services transfer refused") },
2117 "Enclosure services checksum error") },
2120 "Ribbon, ink, or toner failure") },
2123 "Rounded parameter") },
2126 "Event status notification") },
2129 "ESN - power management class event") },
2132 "ESN - media class event") },
2135 "ESN - device busy class event") },
2138 "Thin provisioning soft threshold reached") },
2141 "Saving parameters not supported") },
2144 "Medium not present") },
2147 "Medium not present - tray closed") },
2150 "Medium not present - tray open") },
2153 "Medium not present - loadable") },
2156 "Medium not present - medium auxiliary memory accessible") },
2159 "Sequential positioning error") },
2162 "Tape position error at beginning-of-medium") },
2165 "Tape position error at end-of-medium") },
2168 "Tape or electronic vertical forms unit not ready") },
2177 "Failed to sense top-of-form") },
2180 "Failed to sense bottom-of-form") },
2183 "Reposition error") },
2186 "Read past end of medium") },
2189 "Read past beginning of medium") },
2192 "Position past end of medium") },
2195 "Position past beginning of medium") },
2198 "Medium destination element full") },
2201 "Medium source element empty") },
2204 "End of medium reached") },
2207 "Medium magazine not accessible") },
2210 "Medium magazine removed") },
2213 "Medium magazine inserted") },
2216 "Medium magazine locked") },
2219 "Medium magazine unlocked") },
2222 "Mechanical positioning or changer error") },
2225 "Read past end of user object") },
2228 "Element disabled") },
2231 "Element enabled") },
2234 "Data transfer device removed") },
2237 "Data transfer device inserted") },
2240 "Too many logical objects on partition to support operation") },
2243 "Invalid bits in IDENTIFY message") },
2246 "Logical unit has not self-configured yet") },
2249 "Logical unit failure") },
2252 "Timeout on logical unit") },
2255 "Logical unit failed self-test") },
2258 "Logical unit unable to update self-test log") },
2261 "Target operating conditions have changed") },
2264 "Microcode has been changed") },
2267 "Changed operating definition") },
2270 "INQUIRY data has changed") },
2273 "Component device attached") },
2276 "Device identifier changed") },
2279 "Redundancy group created or modified") },
2282 "Redundancy group deleted") },
2285 "Spare created or modified") },
2291 "Volume set created or modified") },
2294 "Volume set deleted") },
2297 "Volume set deassigned") },
2300 "Volume set reassigned") },
2303 "Reported LUNs data has changed") },
2306 "Echo buffer overwritten") },
2309 "Medium loadable") },
2312 "Medium auxiliary memory accessible") },
2315 "iSCSI IP address added") },
2318 "iSCSI IP address removed") },
2321 "iSCSI IP address changed") },
2324 "Inspect referrals sense descriptors") },
2327 "Microcode has been changed without reset") },
2330 "Zone transition to full") },
2336 "Diagnostic failure: ASCQ = Component ID") },
2342 "Data path failure") },
2345 "Power-on or self-test failure") },
2352 "Internal target failure") },
2355 "Persistent reservation information lost") },
2358 "ATA device failed set features") },
2361 "Select or reselect failure") },
2364 "Unsuccessful soft reset") },
2367 "SCSI parity error") },
2370 "Data phase CRC error detected") },
2373 "SCSI parity error detected during ST data phase") },
2376 "Information unit iuCRC error detected") },
2379 "Asynchronous information protection error detected") },
2382 "Protocol service CRC error") },
2385 "PHY test function in progress") },
2388 "Some commands cleared by iSCSI protocol event") },
2391 "Initiator detected error message received") },
2394 "Invalid message error") },
2397 "Command phase error") },
2400 "Data phase error") },
2403 "Invalid target port transfer tag received") },
2406 "Too much write data") },
2409 "ACK/NAK timeout") },
2415 "Data offset error") },
2418 "Initiator response timeout") },
2421 "Connection lost") },
2424 "Data-in buffer overflow - data buffer size") },
2427 "Data-in buffer overflow - data buffer descriptor area") },
2430 "Data-in buffer error") },
2433 "Data-out buffer overflow - data buffer size") },
2436 "Data-out buffer overflow - data buffer descriptor area") },
2439 "Data-out buffer error") },
2442 "PCIe fabric error") },
2445 "PCIe completion timeout") },
2448 "PCIe completer abort") },
2451 "PCIe poisoned TLP received") },
2454 "PCIe ECRC check failed") },
2457 "PCIe unsupported request") },
2460 "PCIe ACS violation") },
2463 "PCIe TLP prefix blocket") },
2466 "Logical unit failed self-configuration") },
2469 "Tagged overlapped commands: ASCQ = Queue tag ID") },
2475 "Overlapped commands attempted") },
2478 "Write append error") },
2481 "Write append position error") },
2484 "Position error related to timing") },
2490 "Erase failure - incomplete erase operation detected") },
2493 "Cartridge fault") },
2496 "Media load or eject failed") },
2499 "Unload tape failure") },
2502 "Medium removal prevented") },
2505 "Medium removal prevented by data transfer element") },
2508 "Medium thread or unthread failure") },
2511 "Volume identifier invalid") },
2514 "Volume identifier missing") },
2517 "Duplicate volume identifier") },
2520 "Element status unknown") },
2523 "Data transfer device error - load failed") },
2526 "Data transfer device error - unload failed") },
2529 "Data transfer device error - unload missing") },
2532 "Data transfer device error - eject failed") },
2535 "Data transfer device error - library communication failed") },
2538 "SCSI to host system interface failure") },
2541 "System resource failure") },
2544 "System buffer full") },
2547 "Insufficient reservation resources") },
2550 "Insufficient resources") },
2553 "Insufficient registration resources") },
2556 "Insufficient access control resources") },
2559 "Auxiliary memory out of space") },
2565 "Maximum number of supplemental decryption keys exceeded") },
2568 "Medium auxiliary memory not accessible") },
2571 "Data currently unavailable") },
2574 "Insufficient power for operation") },
2577 "Insufficient resources to create ROD") },
2580 "Insufficient resources to create ROD token") },
2583 "Insufficient zone resources") },
2586 "Insufficient zone resources to complete write") },
2589 "Maximum number of streams open") },
2592 "Unable to recover table-of-contents") },
2595 "Generation does not exist") },
2598 "Updated block read") },
2601 "Operator request or state change input") },
2604 "Operator medium removal request") },
2607 "Operator selected write protect") },
2610 "Operator selected write permit") },
2616 "Threshold condition met") },
2619 "Log counter at maximum") },
2622 "Log list codes exhausted") },
2625 "RPL status change") },
2628 "Spindles synchronized") },
2631 "Spindles not synchronized") },
2634 "Failure prediction threshold exceeded") },
2637 "Media failure prediction threshold exceeded") },
2640 "Logical unit failure prediction threshold exceeded") },
2643 "Spare area exhaustion prediction threshold exceeded") },
2646 "Hardware impending failure general hard drive failure") },
2649 "Hardware impending failure drive error rate too high") },
2652 "Hardware impending failure data error rate too high") },
2655 "Hardware impending failure seek error rate too high") },
2658 "Hardware impending failure too many block reassigns") },
2661 "Hardware impending failure access times too high") },
2664 "Hardware impending failure start unit times too high") },
2667 "Hardware impending failure channel parametrics") },
2670 "Hardware impending failure controller detected") },
2673 "Hardware impending failure throughput performance") },
2676 "Hardware impending failure seek time performance") },
2679 "Hardware impending failure spin-up retry count") },
2682 "Hardware impending failure drive calibration retry count") },
2685 "Hardware impending failure power loss protection circuit") },
2688 "Controller impending failure general hard drive failure") },
2691 "Controller impending failure drive error rate too high") },
2694 "Controller impending failure data error rate too high") },
2697 "Controller impending failure seek error rate too high") },
2700 "Controller impending failure too many block reassigns") },
2703 "Controller impending failure access times too high") },
2706 "Controller impending failure start unit times too high") },
2709 "Controller impending failure channel parametrics") },
2712 "Controller impending failure controller detected") },
2715 "Controller impending failure throughput performance") },
2718 "Controller impending failure seek time performance") },
2721 "Controller impending failure spin-up retry count") },
2724 "Controller impending failure drive calibration retry count") },
2727 "Data channel impending failure general hard drive failure") },
2730 "Data channel impending failure drive error rate too high") },
2733 "Data channel impending failure data error rate too high") },
2736 "Data channel impending failure seek error rate too high") },
2739 "Data channel impending failure too many block reassigns") },
2742 "Data channel impending failure access times too high") },
2745 "Data channel impending failure start unit times too high") },
2748 "Data channel impending failure channel parametrics") },
2751 "Data channel impending failure controller detected") },
2754 "Data channel impending failure throughput performance") },
2757 "Data channel impending failure seek time performance") },
2760 "Data channel impending failure spin-up retry count") },
2763 "Data channel impending failure drive calibration retry count") },
2766 "Servo impending failure general hard drive failure") },
2769 "Servo impending failure drive error rate too high") },
2772 "Servo impending failure data error rate too high") },
2775 "Servo impending failure seek error rate too high") },
2778 "Servo impending failure too many block reassigns") },
2781 "Servo impending failure access times too high") },
2784 "Servo impending failure start unit times too high") },
2787 "Servo impending failure channel parametrics") },
2790 "Servo impending failure controller detected") },
2793 "Servo impending failure throughput performance") },
2796 "Servo impending failure seek time performance") },
2799 "Servo impending failure spin-up retry count") },
2802 "Servo impending failure drive calibration retry count") },
2805 "Spindle impending failure general hard drive failure") },
2808 "Spindle impending failure drive error rate too high") },
2811 "Spindle impending failure data error rate too high") },
2814 "Spindle impending failure seek error rate too high") },
2817 "Spindle impending failure too many block reassigns") },
2820 "Spindle impending failure access times too high") },
2823 "Spindle impending failure start unit times too high") },
2826 "Spindle impending failure channel parametrics") },
2829 "Spindle impending failure controller detected") },
2832 "Spindle impending failure throughput performance") },
2835 "Spindle impending failure seek time performance") },
2838 "Spindle impending failure spin-up retry count") },
2841 "Spindle impending failure drive calibration retry count") },
2844 "Firmware impending failure general hard drive failure") },
2847 "Firmware impending failure drive error rate too high") },
2850 "Firmware impending failure data error rate too high") },
2853 "Firmware impending failure seek error rate too high") },
2856 "Firmware impending failure too many block reassigns") },
2859 "Firmware impending failure access times too high") },
2862 "Firmware impending failure start unit times too high") },
2865 "Firmware impending failure channel parametrics") },
2868 "Firmware impending failure controller detected") },
2871 "Firmware impending failure throughput performance") },
2874 "Firmware impending failure seek time performance") },
2877 "Firmware impending failure spin-up retry count") },
2880 "Firmware impending failure drive calibration retry count") },
2883 "Media impending failure endurance limit met") },
2886 "Failure prediction threshold exceeded (false)") },
2889 "Low power condition on") },
2892 "Idle condition activated by timer") },
2895 "Standby condition activated by timer") },
2898 "Idle condition activated by command") },
2901 "Standby condition activated by command") },
2904 "Idle-B condition activated by timer") },
2907 "Idle-B condition activated by command") },
2910 "Idle-C condition activated by timer") },
2913 "Idle-C condition activated by command") },
2916 "Standby-Y condition activated by timer") },
2919 "Standby-Y condition activated by command") },
2922 "Power state change to active") },
2925 "Power state change to idle") },
2928 "Power state change to standby") },
2931 "Power state change to sleep") },
2934 "Power state change to device control") },
2940 "Video acquisition error") },
2943 "Unable to acquire video") },
2949 "Scan head positioning error") },
2952 "End of user area encountered on this track") },
2955 "Packet does not fit in available space") },
2958 "Illegal mode for this track") },
2961 "Invalid packet size") },
2967 "Automatic document feeder cover up") },
2970 "Automatic document feeder lift up") },
2973 "Document jam in automatic document feeder") },
2976 "Document miss feed automatic in document feeder") },
2979 "Configuration failure") },
2982 "Configuration of incapable logical units failed") },
2985 "Add logical unit failed") },
2988 "Modification of logical unit failed") },
2991 "Exchange of logical unit failed") },
2994 "Remove of logical unit failed") },
2997 "Attachment of logical unit failed") },
3000 "Creation of logical unit failed") },
3003 "Assign failure occurred") },
3006 "Multiply assigned logical unit") },
3009 "Set target port groups command failed") },
3012 "ATA device feature not enabled") },
3015 "Logical unit not configured") },
3018 "Subsidiary logical unit not configured") },
3021 "Data loss on logical unit") },
3024 "Multiple logical unit failures") },
3027 "Parity/data mismatch") },
3030 "Informational, refer to log") },
3033 "State change has occurred") },
3036 "Redundancy level got better") },
3039 "Redundancy level got worse") },
3042 "Rebuild failure occurred") },
3045 "Recalculate failure occurred") },
3048 "Command to logical unit failed") },
3051 "Copy protection key exchange failure - authentication failure") },
3054 "Copy protection key exchange failure - key not present") },
3057 "Copy protection key exchange failure - key not established") },
3060 "Read of scrambled sector without authentication") },
3063 "Media region code is mismatched to logical unit region") },
3066 "Drive region must be permanent/region reset count error") },
3069 "Insufficient block count for binding NONCE recording") },
3072 "Conflict in binding NONCE recording") },
3075 "Decompression exception short: ASCQ = Algorithm ID") },
3081 "Decompression exception long: ASCQ = Algorithm ID") },
3087 "Session fixation error") },
3090 "Session fixation error writing lead-in") },
3093 "Session fixation error writing lead-out") },
3096 "Session fixation error - incomplete track in session") },
3099 "Empty or partially written reserved track") },
3102 "No more track reservations allowed") },
3105 "RMZ extension is not allowed") },
3108 "No more test zone extensions are allowed") },
3111 "CD control error") },
3114 "Power calibration area almost full") },
3117 "Power calibration area is full") },
3120 "Power calibration area error") },
3123 "Program memory area update failure") },
3126 "Program memory area is full") },
3129 "RMA/PMA is almost full") },
3132 "Current power calibration area almost full") },
3135 "Current power calibration area is full") },
3141 "Security error") },
3144 "Unable to decrypt data") },
3147 "Unencrypted data encountered while decrypting") },
3150 "Incorrect data encryption key") },
3153 "Cryptographic integrity validation failed") },
3156 "Error decrypting data") },
3159 "Unknown signature verification key") },
3162 "Encryption parameters not useable") },
3165 "Digital signature validation failure") },
3168 "Encryption mode mismatch on read") },
3171 "Encrypted block not raw read enabled") },
3174 "Incorrect encryption parameters") },
3177 "Unable to decrypt parameter list") },
3180 "Encryption algorithm disabled") },
3183 "SA creation parameter value invalid") },
3186 "SA creation parameter value rejected") },
3189 "Invalid SA usage") },
3192 "Data encryption configuration prevented") },
3195 "SA creation parameter not supported") },
3198 "Authentication failed") },
3201 "External data encryption key manager access error") },
3204 "External data encryption key manager error") },
3207 "External data encryption key not found") },
3210 "External data encryption request not authorized") },
3213 "External data encryption control timeout") },
3216 "External data encryption control error") },
3219 "Logical unit access not authorized") },
3222 "Security conflict in translated device") }
3244 if (
asc >= table_entry->
asc) {
3245 if (
asc > table_entry->
asc)
3248 if (ascq <= table_entry->
ascq) {
3252 &&
ascq >= (table_entry - 1)->
ascq))
3288 size_t asc_tables_size[2];
3289 size_t sense_tables_size[2];
3291 int num_sense_tables;
3295 *sense_entry = NULL;
3298 if (inq_data != NULL)
3305 if (match != NULL) {
3310 asc_tables_size[0] = quirk->
num_ascs;
3318 num_sense_tables = 2;
3325 num_sense_tables = 1;
3329 asc_ascq.
ascq = ascq;
3330 for (i = 0; i < num_asc_tables; i++) {
3333 found_entry = bsearch(&asc_ascq, asc_tables[i],
3335 sizeof(**asc_tables),
3344 for (i = 0; i < num_sense_tables; i++) {
3347 found_entry = bsearch(&sense_key, sense_tables[i],
3348 sense_tables_size[i],
3349 sizeof(**sense_tables),
3363 const char **sense_key_desc,
const char **asc_desc)
3373 if (sense_entry != NULL)
3374 *sense_key_desc = sense_entry->
desc;
3376 *sense_key_desc =
"Invalid Sense Key";
3378 if (asc_entry != NULL)
3379 *asc_desc = asc_entry->
desc;
3380 else if (asc >= 0x80 && asc <= 0xff)
3381 *asc_desc =
"Vendor Specific ASC";
3382 else if (ascq >= 0x80 && ascq <= 0xff)
3383 *asc_desc =
"Vendor Specific ASCQ";
3385 *asc_desc =
"Reserved ASC/ASCQ pair";
3395 u_int32_t sense_flags)
3403 &error_code, &
sense_key, &asc, &ascq)) {
3441 if (asc_entry != NULL
3442 && (asc != 0 || ascq != 0))
3444 else if (sense_entry != NULL)
3496 sbuf_new(&sb, cdb_string, len, SBUF_FIXEDLEN);
3501 error = sbuf_finish(&sb);
3510 return(sbuf_data(&sb));
3519 if (cdb_ptr == NULL)
3536 switch((*cdb_ptr >> 5) & 0x7) {
3558 for (i = 0; i < cdb_len; i++)
3559 sbuf_printf(sb,
"%02hhx ", cdb_ptr[i]);
3571 return(
"Check Condition");
3575 return(
"Intermediate");
3577 return(
"Intermediate-Condition Met");
3579 return(
"Reservation Conflict");
3581 return(
"Command Terminated");
3583 return(
"Queue Full");
3585 return(
"ACA Active");
3587 return(
"Task Aborted");
3589 static char unkstr[64];
3590 snprintf(unkstr,
sizeof(unkstr),
"Unknown %#x",
3641 sbuf_printf(sb,
"%s. CDB: ",
3692 for (cur_pos = 0; cur_pos < desc_len;) {
3708 if (header->
length > (desc_len - cur_pos))
3711 if (iter_func(sense, sense_len, header, arg) != 0)
3714 cur_pos +=
sizeof(*header) + header->
length;
3756 return ((uint8_t *)desc_info.
header);
3765 int sense_key,
int asc,
int ascq, va_list ap)
3770 uint8_t *desc, *data;
3772 memset(sense_data, 0,
sizeof(*sense_data));
3774 if (current_error != 0)
3788 printf(
"%s: invalid sense type %d\n", __func__,
3792 len = va_arg(ap,
int);
3793 data = va_arg(ap, uint8_t *);
3795 switch (elem_type) {
3803 bcopy(data, desc, len);
3812 if (space <
sizeof(*sks)) {
3817 sks->
length =
sizeof(*sks) -
3820 desc +=
sizeof(*sks);
3821 space -=
sizeof(*sks);
3829 if (space <
sizeof(*cmd)) {
3834 cmd->
length =
sizeof(*cmd) -
3838 desc +=
sizeof(*cmd);
3839 space -=
sizeof(*cmd);
3845 if (len >
sizeof(
info->info))
3847 if (space <
sizeof(*
info)) {
3852 info->length =
sizeof(*info) -
3855 bcopy(data, &
info->info[
sizeof(
info->info) - len], len);
3856 desc +=
sizeof(*info);
3857 space -=
sizeof(*info);
3863 if (len >
sizeof(
fru->fru))
3865 if (space <
sizeof(*
fru)) {
3870 fru->length =
sizeof(*fru) -
3873 desc +=
sizeof(*fru);
3874 space -=
sizeof(*fru);
3880 if (len >
sizeof(stream->
byte3))
3882 if (space <
sizeof(*stream)) {
3887 stream->
length =
sizeof(*stream) -
3889 stream->
byte3 = *data;
3890 desc +=
sizeof(*stream);
3891 space -=
sizeof(*stream);
3913 int sense_key,
int asc,
int ascq, va_list ap)
3920 memset(sense_data, 0,
sizeof(*sense_data));
3922 if (current_error != 0)
3928 if (*sense_len >= 13) {
3933 if (*sense_len >= 14) {
3942 printf(
"%s: invalid sense type %d\n", __func__,
3946 len = va_arg(ap,
int);
3947 data = va_arg(ap, uint8_t *);
3949 switch (elem_type) {
3955 if (*sense_len < 18) {
3963 if (*sense_len < 12) {
3978 while (len >
sizeof(sense->
info)) {
3984 bcopy(data, &sense->
info[
sizeof(sense->
info) - len], len);
3987 if (*sense_len < 15) {
3995 sense->
flags |= *data &
4017 int sense_key,
int asc,
int ascq, va_list ap)
4024 sense_format, current_error, sense_key, asc, ascq, ap);
4027 sense_format, current_error, sense_key, asc, ascq, ap);
4033 int sense_key,
int asc,
int ascq, ...)
4040 current_error, sense_key, asc, ascq, ap);
4047 int sense_key,
int asc,
int ascq, ...)
4053 current_error, sense_key, asc, ascq, ap);
4062 uint8_t info_type, uint64_t *
info, int64_t *signed_info)
4071 switch (sense_type) {
4082 switch (info_type) {
4092 if (signed_info != NULL)
4093 *signed_info = *
info;
4102 if (signed_info != NULL)
4103 *signed_info = *info;
4111 if (fru_desc->
fru == 0)
4114 *info = fru_desc->
fru;
4115 if (signed_info != NULL)
4116 *signed_info = (int8_t)fru_desc->
fru;
4130 switch (info_type) {
4143 if (signed_info != NULL)
4144 *signed_info = (int32_t)info_val;
4160 if (signed_info != NULL)
4161 *signed_info = (int32_t)cmd_val;
4169 if (sense->
fru == 0)
4173 if (signed_info != NULL)
4174 *signed_info = (int8_t)sense->
fru;
4202 switch (sense_type) {
4256 if (inq_data != NULL) {
4270 switch (sense_type) {
4282 *block_bits = block->
byte3;
4311 if (inq_data != NULL) {
4323 switch (sense_type) {
4335 *stream_bits = stream->
byte3;
4362 sbuf_printf(sb,
"Info: %#jx",
info);
4369 sbuf_printf(sb,
"Command Specific Info: %#jx", csi);
4375 sbuf_printf(sb,
"Progress: %d%% (%d/%d) complete",
4387 switch (sense_key) {
4405 snprintf(tmpstr,
sizeof(tmpstr),
"bit %d ",
4408 sbuf_printf(sb,
"%s byte %d %sis invalid",
4409 bad_command ?
"Command" :
"Data",
4419 sbuf_printf(sb,
"Unit Attention Condition Queue %s",
4421 "Overflowed" :
"Did Not Overflow??");
4432 sbuf_printf(sb,
"Actual Retry Count: %d",
4458 snprintf(tmpstr,
sizeof(tmpstr),
"bit %d ",
4461 sbuf_printf(sb,
"%s byte %d %sis invalid", (segment->
byte0 &
4467 sbuf_printf(sb,
"Sense Key Specific: %#x,%#x", sks[0],
4478 sbuf_printf(sb,
"Field Replaceable Unit: %d", (
int)fru);
4490 sbuf_printf(sb,
"Stream Command Sense Data: ");
4492 sbuf_printf(sb,
"Filemark");
4497 sbuf_printf(sb,
"%sEOM", (need_comma) ?
"," :
"");
4502 sbuf_printf(sb,
"%sILI", (need_comma) ?
"," :
"");
4509 sbuf_printf(sb,
"Block Command Sense Data: ");
4511 sbuf_printf(sb,
"ILI");
4516 u_int sense_len, uint8_t *cdb,
int cdb_len,
4532 u_int sense_len, uint8_t *cdb,
int cdb_len,
4546 u_int sense_len, uint8_t *cdb,
int cdb_len,
4551 int error_code, sense_key, asc, ascq;
4566 u_int sense_len, uint8_t *cdb,
int cdb_len,
4582 u_int sense_len, uint8_t *cdb,
int cdb_len,
4594 u_int sense_len, uint8_t *cdb,
int cdb_len,
4606 u_int sense_len, uint8_t *cdb,
int cdb_len,
4611 const char *sense_key_desc;
4612 const char *asc_desc;
4623 progress->add_sense_code_qual, inq_data,
4624 &sense_key_desc, &asc_desc);
4632 sbuf_cat(sb, sense_key_desc);
4633 sbuf_printf(sb,
" asc:%x,%x (%s): ",
progress->add_sense_code,
4634 progress->add_sense_code_qual, asc_desc);
4640 u_int sense_len, uint8_t *cdb,
int cdb_len,
4648 sbuf_printf(sb,
"ATA status: %02x (%s%s%s%s%s%s%s%s), ",
4650 (res->
status & 0x80) ?
"BSY " :
"",
4651 (res->
status & 0x40) ?
"DRDY " :
"",
4652 (res->
status & 0x20) ?
"DF " :
"",
4653 (res->
status & 0x10) ?
"SERV " :
"",
4654 (res->
status & 0x08) ?
"DRQ " :
"",
4655 (res->
status & 0x04) ?
"CORR " :
"",
4656 (res->
status & 0x02) ?
"IDX " :
"",
4657 (res->
status & 0x01) ?
"ERR" :
"");
4659 sbuf_printf(sb,
"error: %02x (%s%s%s%s%s%s%s%s), ",
4661 (res->
error & 0x80) ?
"ICRC " :
"",
4662 (res->
error & 0x40) ?
"UNC " :
"",
4663 (res->
error & 0x20) ?
"MC " :
"",
4664 (res->
error & 0x10) ?
"IDNF " :
"",
4665 (res->
error & 0x08) ?
"MCR " :
"",
4666 (res->
error & 0x04) ?
"ABRT " :
"",
4667 (res->
error & 0x02) ?
"NM " :
"",
4668 (res->
error & 0x01) ?
"ILI" :
"");
4672 sbuf_printf(sb,
"count: %02x%02x, ",
4674 sbuf_printf(sb,
"LBA: %02x%02x%02x%02x%02x%02x, ",
4678 sbuf_printf(sb,
"count: %02x, ", res->
count_7_0);
4679 sbuf_printf(sb,
"LBA: %02x%02x%02x, ",
4682 sbuf_printf(sb,
"device: %02x, ", res->
device);
4687 u_int sense_len, uint8_t *cdb,
int cdb_len,
4692 const char *sense_key_desc;
4693 const char *asc_desc;
4694 int error_code, sense_key, asc, ascq;
4698 forwarded->
length - 2, &error_code, &sense_key, &asc, &ascq, 1);
4699 scsi_sense_desc(sense_key, asc, ascq, NULL, &sense_key_desc, &asc_desc);
4701 sbuf_printf(sb,
"Forwarded sense: %s asc:%x,%x (%s): ",
4702 sense_key_desc, asc, ascq, asc_desc);
4711 u_int sense_len, uint8_t *cdb,
int cdb_len,
4718 sbuf_printf(sb,
"Descriptor %#x:", header->
desc_type);
4720 buf_ptr = (uint8_t *)&header[1];
4722 for (i = 0; i < header->
length; i++, buf_ptr++)
4723 sbuf_printf(sb,
" %02x", *buf_ptr);
4741 u_int sense_len, uint8_t *cdb,
int cdb_len,
4758 u_int sense_len, uint8_t *cdb,
int cdb_len,
4779 printer->
print_func(sb, sense, sense_len, cdb, cdb_len,
4840 sbuf_printf(print_info->
sb,
"%s", print_info->
path_str);
4845 sbuf_printf(print_info->
sb,
"\n");
4863 int error_code, sense_key, asc, ascq;
4870 sbuf_printf(
sb,
"SCSI sense: ");
4871 switch (error_code) {
4874 sbuf_printf(
sb,
"Deferred error: ");
4882 const char *sense_key_desc;
4883 const char *asc_desc;
4896 &sense_key_desc, &asc_desc);
4901 sbuf_cat(
sb, sense_key_desc);
4902 sbuf_printf(
sb,
" asc:%x,%x (%s)\n", asc, ascq, asc_desc);
4908 &bits) == 0 && bits != 0) {
4911 sbuf_printf(
sb,
"\n");
4913 &bits) == 0 && bits != 0) {
4916 sbuf_printf(
sb,
"\n");
4926 sbuf_printf(
sb,
"\n");
4936 sbuf_printf(
sb,
"\n");
4946 sbuf_printf(
sb,
"\n");
4955 sbuf_printf(
sb,
"\n");
4970 print_info.
cdb = cdb;
4987 sbuf_printf(sb,
"No sense data present\n");
4990 sbuf_printf(sb,
"Error code 0x%x",
error_code);
5001 sbuf_printf(sb,
" at block no. %d (decimal)",
5005 sbuf_printf(sb,
"\n");
5035 if ((csio == NULL) || (sb == NULL))
5042 flags &= ~SSS_FLAG_PRINT_COMMAND;
5047 cam_path_string(device, path_str,
sizeof(path_str));
5080 sbuf_cat(sb, path_str);
5087 sbuf_printf(sb,
"\n");
5141 char *str,
int str_len)
5146 sbuf_new(&sb, str, str_len, 0);
5156 return(sbuf_data(&sb));
5166 sbuf_new(&sb, str,
sizeof(str), 0);
5183 if ((device == NULL) || (csio == NULL) || (ofile == NULL))
5186 sbuf_new(&sb, str,
sizeof(str), 0);
5192 fprintf(ofile,
"%s", sbuf_data(&sb));
5204 int *sense_key,
int *asc,
int *ascq)
5207 sense_key, asc, ascq, 0);
5215 int *error_code,
int *sense_key,
int *asc,
int *ascq)
5246 int *
error_code,
int *sense_key,
int *asc,
int *ascq,
5252 if (sense_len == 0) {
5253 if (show_errors == 0) {
5284 *asc = (show_errors) ? -1 : 0;
5289 *ascq = (show_errors) ? -1 : 0;
5302 *sense_key = (show_errors) ? -1 : 0;
5308 *asc = (show_errors) ? -1 : 0;
5314 *ascq = (show_errors) ? -1 : 0;
5327 &sense_key, &asc, &ascq, show_errors);
5339 &sense_key, &asc, &ascq, show_errors);
5351 &sense_key, &asc, &ascq, show_errors);
5367 char *dtype, *qtype;
5375 qtype =
" (vendor-unique qualifier)";
5383 qtype =
" (offline)";
5387 qtype =
" (reserved qualifier)";
5391 qtype =
" (LUN not supported)";
5398 dtype =
"Direct Access";
5401 dtype =
"Sequential Access";
5407 dtype =
"Processor";
5425 dtype =
"Communication";
5428 dtype =
"Storage Array";
5431 dtype =
"Enclosure Services";
5434 dtype =
"Simplified Direct Access";
5437 dtype =
"Optical Card Read/Write";
5440 dtype =
"Object-Based Storage";
5443 dtype =
"Automation/Drive Interface";
5446 dtype =
"Host Managed Zoned Block";
5449 dtype =
"Uninstalled";
5458 sbuf_printf(sb,
"%s %s ",
SID_IS_REMOVABLE(inq_data) ?
"Removable" :
"Fixed", dtype);
5461 sbuf_printf(sb,
"SCSI ");
5465 sbuf_printf(sb,
"SPC-%d SCSI ",
SID_ANSI_REV(inq_data) - 2);
5467 sbuf_printf(sb,
"device%s\n", qtype);
5476 sbuf_new(&sb, buffer, 120, SBUF_FIXEDLEN);
5486 sbuf_printf(sb,
"<");
5488 sbuf_printf(sb,
" ");
5490 sbuf_printf(sb,
" ");
5492 sbuf_printf(sb,
"> ");
5501 sbuf_new(&sb, buffer, 84, SBUF_FIXEDLEN);
5530 u_int num_syncrates;
5543 for (i = 0; i < num_syncrates; i++) {
5565 u_int num_syncrates;
5574 for (i = 0; i < num_syncrates; i++) {
5717 uint8_t *desc_buf_end;
5719 desc_buf_end = (uint8_t *)desc + len;
5725 if (ck_fn == NULL || ck_fn((uint8_t *)desc) != 0)
5737 if (page_len <
sizeof(*
id))
5757 sbuf_printf(sb,
"FCP address: 0x%.16jx",(uintmax_t)
n_port_name);
5765 sbuf_printf(sb,
"SPI address: %u,%u",
5783 sbuf_printf(sb,
"SBP address: 0x%.16jx", (uintmax_t)
eui64);
5792 sbuf_printf(sb,
"RDMA address: 0x");
5798 uint32_t add_len, i;
5799 uint8_t *iscsi_name = NULL;
5802 sbuf_printf(sb,
"iSCSI address: ");
5813 add_len = MIN(add_len, valid_len -
5825 add_len = MIN(add_len, valid_len -
5830 sbuf_printf(sb,
"unknown format %x",
5837 sbuf_printf(sb,
"not enough data");
5846 for (i = 0; i < add_len; i++) {
5869 sbuf_printf(sb,
"SAS address: 0x%.16jx", (uintmax_t)sas_addr);
5879 sbuf_printf(sb,
"No known Transport ID format for protocol "
5896 sbuf_printf(sb,
"SOP Routing ID: %u,%u,%u",
5903 sbuf_printf(sb,
"Unknown protocol %#x",
5934 for (i = 0; i < num_table_entries; i++) {
5936 return (table[i].
name);
5953 int i, num_matches = 0;
5955 for (i = 0; i < num_table_entries; i++) {
5956 size_t table_len, name_len;
5958 table_len = strlen(table[i].
name);
5959 name_len = strlen(
name);
5962 && (strncasecmp(table[i].
name,
name, name_len) == 0))
5964 && (strncmp(table[i].
name,
name, name_len) == 0))) {
5973 if (table_len == name_len)
5984 if (num_matches > 1)
5986 else if (num_matches == 1)
5999 unsigned int *alloc_len,
6001 struct malloc_type *type,
int flags,
6003 char *error_str,
int error_str_len)
6012 value = strtouq(id_str, &endptr, 0);
6013 if (*endptr !=
'\0') {
6014 if (error_str != NULL) {
6015 snprintf(error_str, error_str_len,
"%s: error "
6016 "parsing ID %s, 64-bit number required",
6034 if (error_str != NULL) {
6035 snprintf(error_str, error_str_len,
"%s: unsupported "
6036 "protocol %d", __func__, proto_id);
6043 *hdr = malloc(alloc_size, type, flags);
6045 *hdr = malloc(alloc_size);
6048 if (error_str != NULL) {
6049 snprintf(error_str, error_str_len,
"%s: unable to "
6050 "allocate %zu bytes", __func__, alloc_size);
6056 *alloc_len = alloc_size;
6058 bzero(*hdr, alloc_size);
6100 unsigned int *alloc_len,
6102 struct malloc_type *type,
int flags,
6104 char *error_str,
int error_str_len)
6106 unsigned long scsi_addr, target_port;
6108 char *tmpstr, *endptr;
6113 tmpstr = strsep(&id_str,
",");
6114 if (tmpstr == NULL) {
6115 if (error_str != NULL) {
6116 snprintf(error_str, error_str_len,
6117 "%s: no ID found", __func__);
6122 scsi_addr = strtoul(tmpstr, &endptr, 0);
6123 if (*endptr !=
'\0') {
6124 if (error_str != NULL) {
6125 snprintf(error_str, error_str_len,
"%s: error "
6126 "parsing SCSI ID %s, number required",
6133 if (id_str == NULL) {
6134 if (error_str != NULL) {
6135 snprintf(error_str, error_str_len,
"%s: no relative "
6136 "target port found", __func__);
6142 target_port = strtoul(id_str, &endptr, 0);
6143 if (*endptr !=
'\0') {
6144 if (error_str != NULL) {
6145 snprintf(error_str, error_str_len,
"%s: error "
6146 "parsing relative target port %s, number "
6147 "required", __func__, id_str);
6153 spi = malloc(
sizeof(*spi), type, flags);
6155 spi = malloc(
sizeof(*spi));
6158 if (error_str != NULL) {
6159 snprintf(error_str, error_str_len,
"%s: unable to "
6160 "allocate %zu bytes", __func__,
6166 *alloc_len =
sizeof(*spi);
6167 bzero(spi,
sizeof(*spi));
6184 unsigned int *alloc_len,
6186 struct malloc_type *type,
int flags,
6188 char *error_str,
int error_str_len)
6192 size_t id_len, rdma_id_size;
6198 id_len = strlen(id_str);
6204 if ((id_len != (rdma_id_size * 2))
6205 && (id_len != ((rdma_id_size * 2) + 2))) {
6206 if (error_str != NULL) {
6207 snprintf(error_str, error_str_len,
"%s: RDMA ID "
6208 "must be 32 hex digits (0x prefix "
6209 "optional), only %zu seen", __func__, id_len);
6220 if (id_len == ((rdma_id_size * 2) + 2)) {
6221 if ((tmpstr[0] ==
'0')
6222 && ((tmpstr[1] ==
'x') || (tmpstr[1] ==
'X'))) {
6225 if (error_str != NULL) {
6226 snprintf(error_str, error_str_len,
"%s: RDMA "
6227 "ID prefix, if used, must be \"0x\", "
6228 "got %s", __func__, tmpstr);
6234 bzero(rdma_id,
sizeof(rdma_id));
6244 for (i = 0; i < (rdma_id_size * 2); i++) {
6264 else if (isalpha(c))
6265 c -= isupper(c) ?
'A' - 10 :
'a' - 10;
6267 if (error_str != NULL) {
6268 snprintf(error_str, error_str_len,
"%s: "
6269 "RDMA ID must be hex digits, got "
6270 "invalid character %c", __func__,
6284 if (error_str != NULL) {
6285 snprintf(error_str, error_str_len,
"%s: "
6286 "RDMA ID must be hex digits, got "
6287 "invalid character %c", __func__,
6294 rdma_id[j] |= c << cur_shift;
6298 rdma = malloc(
sizeof(*rdma), type, flags);
6300 rdma = malloc(
sizeof(*rdma));
6303 if (error_str != NULL) {
6304 snprintf(error_str, error_str_len,
"%s: unable to "
6305 "allocate %zu bytes", __func__,
6311 *alloc_len =
sizeof(*rdma);
6312 bzero(rdma, *alloc_len);
6335 unsigned int *alloc_len,
6337 struct malloc_type *type,
int flags,
6339 char *error_str,
int error_str_len)
6341 size_t id_len, sep_len, id_size, name_len;
6343 unsigned int i, sep_pos, sep_found;
6344 const char *sep_template =
",i,0x";
6345 const char *iqn_prefix =
"iqn.";
6351 id_len = strlen(id_str);
6352 sep_len = strlen(sep_template);
6361 for (i = 0, sep_pos = 0; i < id_len; i++) {
6363 if (id_str[i] == sep_template[sep_pos])
6368 if (sep_pos < sep_len) {
6369 if (id_str[i] == sep_template[sep_pos]) {
6373 if (error_str != NULL) {
6374 snprintf(error_str, error_str_len,
"%s: "
6375 "invalid separator in iSCSI name "
6391 && (sep_found == 0)) {
6392 if (error_str != NULL) {
6393 snprintf(error_str, error_str_len,
"%s: no digits "
6394 "found after separator in iSCSI name \"%s\"",
6407 id_size =
sizeof(*iscsi) + strlen(iqn_prefix) + id_len + 1;
6410 iscsi = malloc(id_size, type, flags);
6412 iscsi = malloc(id_size);
6414 if (iscsi == NULL) {
6415 if (error_str != NULL) {
6416 snprintf(error_str, error_str_len,
"%s: unable to "
6417 "allocate %zu bytes", __func__, id_size);
6422 *alloc_len = id_size;
6423 bzero(iscsi, id_size);
6430 name_len = id_size -
sizeof(*iscsi);
6432 snprintf(iscsi->
iscsi_name, name_len,
"%s%s", iqn_prefix, id_str);
6446 unsigned int *alloc_len,
6448 struct malloc_type *type,
int flags,
6450 char *error_str,
int error_str_len)
6453 unsigned long bus, device, function;
6454 char *tmpstr, *endptr;
6455 int retval, device_spec;
6461 tmpstr = strsep(&id_str,
",");
6462 if ((tmpstr == NULL)
6463 || (*tmpstr ==
'\0')) {
6464 if (error_str != NULL) {
6465 snprintf(error_str, error_str_len,
"%s: no ID found",
6471 bus = strtoul(tmpstr, &endptr, 0);
6472 if (*endptr !=
'\0') {
6473 if (error_str != NULL) {
6474 snprintf(error_str, error_str_len,
"%s: error "
6475 "parsing PCIe bus %s, number required",
6481 if ((id_str == NULL)
6482 || (*id_str ==
'\0')) {
6483 if (error_str != NULL) {
6484 snprintf(error_str, error_str_len,
"%s: no PCIe "
6485 "device or function found", __func__);
6490 tmpstr = strsep(&id_str,
",");
6491 function = strtoul(tmpstr, &endptr, 0);
6492 if (*endptr !=
'\0') {
6493 if (error_str != NULL) {
6494 snprintf(error_str, error_str_len,
"%s: error "
6495 "parsing PCIe device/function %s, number "
6496 "required", __func__, tmpstr);
6505 if (id_str != NULL) {
6506 if (*id_str ==
'\0') {
6507 if (error_str != NULL) {
6508 snprintf(error_str, error_str_len,
"%s: "
6509 "no PCIe function found", __func__);
6516 function = strtoul(id_str, &endptr, 0);
6517 if (*endptr !=
'\0') {
6518 if (error_str != NULL) {
6519 snprintf(error_str, error_str_len,
"%s: "
6520 "error parsing PCIe function %s, "
6521 "number required", __func__, id_str);
6528 if (error_str != NULL) {
6529 snprintf(error_str, error_str_len,
"%s: bus value "
6530 "%lu greater than maximum %u", __func__,
6537 if ((device_spec != 0)
6539 if (error_str != NULL) {
6540 snprintf(error_str, error_str_len,
"%s: device value "
6541 "%lu greater than maximum %u", __func__,
6548 if (((device_spec != 0)
6550 || ((device_spec == 0)
6552 if (error_str != NULL) {
6553 snprintf(error_str, error_str_len,
"%s: function value "
6554 "%lu greater than maximum %u", __func__,
6555 function, (device_spec == 0) ?
6564 sop = malloc(
sizeof(*sop), type, flags);
6566 sop = malloc(
sizeof(*sop));
6569 if (error_str != NULL) {
6570 snprintf(error_str, error_str_len,
"%s: unable to "
6571 "allocate %zu bytes", __func__,
sizeof(*sop));
6576 *alloc_len =
sizeof(*sop);
6577 bzero(sop,
sizeof(*sop));
6579 if (device_spec != 0) {
6584 bcopy(&rid, sop->
routing_id, MIN(
sizeof(rid),
6591 bcopy(&rid, sop->
routing_id, MIN(
sizeof(rid),
6616 unsigned int *alloc_len,
6618 struct malloc_type *type,
int flags,
6620 char *error_str,
int error_str_len)
6624 u_int num_proto_entries;
6625 int retval, table_entry;
6635 tmpstr = strsep(&transportid_str,
",.");
6636 if (tmpstr == NULL) {
6637 if (error_str != NULL) {
6638 snprintf(error_str, error_str_len,
6639 "%s: transportid_str is NULL", __func__);
6649 if (error_str != NULL) {
6650 snprintf(error_str, error_str_len,
"%s: %s protocol "
6651 "name %s", __func__,
6668 error_str, error_str_len);
6676 error_str, error_str_len);
6684 error_str, error_str_len);
6692 error_str, error_str_len);
6700 error_str, error_str_len);
6714 if (error_str != NULL) {
6715 snprintf(error_str, error_str_len,
"%s: no Transport "
6716 "ID format exists for protocol %s",
6728 "Remaining Capacity in Partition",
6731 "Maximum Capacity in Partition",
6740 "MAM Space Remaining",
6744 "Assigning Organization",
6748 "Format Density Code",
6751 "Initialization Count",
6754 "Volume Identifier",
6758 "Volume Change Reference",
6762 "Device Vendor/Serial at Last Load",
6766 "Device Vendor/Serial at Last Load - 1",
6770 "Device Vendor/Serial at Last Load - 2",
6774 "Device Vendor/Serial at Last Load - 3",
6778 "Total MB Written in Medium Life",
6782 "Total MB Read in Medium Life",
6786 "Total MB Written in Current/Last Load",
6790 "Total MB Read in Current/Last Load",
6794 "Logical Position of First Encrypted Block",
6798 "Logical Position of First Unencrypted Block after First "
6803 "Medium Usage History",
6807 "Partition Usage History",
6811 "Medium Manufacturer",
6815 "Medium Serial Number",
6828 "Assigning Organization",
6832 "Medium Density Code",
6836 "Medium Manufacture Date",
6848 "Medium Type Information",
6852 "Medium Serial Number",
6856 "Application Vendor",
6864 "Application Version",
6868 "User Medium Text Label",
6872 "Date and Time Last Written",
6876 "Text Localization Identifier",
6884 "Owning Host Textual Name",
6892 "Partition User Text Label",
6896 "Load/Unload at Partition",
6900 "Application Format Version",
6904 "Volume Coherency Information",
6908 "Spectra MLM Creation",
6920 "Spectra MLM SDC List",
6924 "Spectra MLM Post Scan",
6928 "Spectra MLM Checksum",
6932 "Spectra MLM Creation",
6944 "Spectra MLM SDC List",
6948 "Spectra MLM Post Scan",
6952 "Spectra MLM Checksum",
6966 uint32_t valid_len, uint32_t
flags,
6967 uint32_t output_flags,
char *error_str,
6971 uint32_t field_size;
6975 int vcr_len, as_len;
6981 avail_len = valid_len -
sizeof(*hdr);
6982 if (field_size > avail_len) {
6983 if (error_str != NULL) {
6984 snprintf(error_str, error_str_len,
"Available "
6985 "length of attribute ID 0x%.4x %zu < field "
6991 }
else if (field_size == 0) {
7003 sbuf_printf(sb,
"\n\tVolume Change Reference Value:");
7007 if (error_str != NULL) {
7008 snprintf(error_str, error_str_len,
"Volume Change "
7009 "Reference value has length of 0");
7030 sbuf_printf(sb,
"\n");
7031 sbuf_hexdump(sb, cur_ptr, vcr_len, NULL, 0);
7035 sbuf_printf(sb,
" 0x%jx\n", (uintmax_t)tmp_val);
7039 sbuf_printf(sb,
"\tVolume Coherency Count: %ju\n", (uintmax_t)tmp_val);
7041 cur_ptr +=
sizeof(tmp_val);
7043 sbuf_printf(sb,
"\tVolume Coherency Set Identifier: 0x%jx\n",
7044 (uintmax_t)tmp_val);
7050 cur_ptr +=
sizeof(tmp_val);
7052 cur_ptr +=
sizeof(uint16_t);
7053 sbuf_printf(sb,
"\tApplication Client Specific Information: ");
7057 sbuf_printf(sb,
"LTFS\n");
7061 sbuf_printf(sb,
"\tLTFS UUID: %s\n", cur_ptr);
7064 sbuf_printf(sb,
"\tLTFS Version: %d\n", *cur_ptr);
7066 sbuf_printf(sb,
"Unknown\n");
7067 sbuf_hexdump(sb, cur_ptr, as_len, NULL, 0);
7076 uint32_t valid_len, uint32_t
flags,
7077 uint32_t output_flags,
char *error_str,
7081 uint32_t field_size;
7087 avail_len = valid_len -
sizeof(*hdr);
7088 if (field_size > avail_len) {
7089 if (error_str != NULL) {
7090 snprintf(error_str, error_str_len,
"Available "
7091 "length of attribute ID 0x%.4x %zu < field "
7097 }
else if (field_size == 0) {
7103 if (error_str != NULL) {
7104 snprintf(error_str, error_str_len,
"The length of "
7105 "attribute ID 0x%.4x is 0",
7136 uint32_t valid_len, uint32_t flags,
7137 uint32_t output_flags,
char *error_str,
7140 uint32_t field_size;
7147 avail_len = valid_len -
sizeof(*hdr);
7148 print_len = MIN(avail_len, field_size);
7151 if (print_len > 0) {
7152 sbuf_printf(sb,
"\n");
7153 sbuf_hexdump(sb, num_ptr, print_len, NULL, 0);
7161 uint32_t valid_len, uint32_t flags,
7162 uint32_t output_flags,
char *error_str,
7165 uint64_t print_number;
7167 uint32_t number_size;
7172 avail_len = valid_len -
sizeof(*hdr);
7173 if (avail_len < number_size) {
7174 if (error_str != NULL) {
7175 snprintf(error_str, error_str_len,
"Available "
7176 "length of attribute ID 0x%.4x %zu < field "
7184 switch (number_size) {
7214 flags, output_flags,
7215 error_str, error_str_len);
7222 long double num_float;
7224 num_float = (
long double)print_number;
7233 (print_number / 10) : print_number);
7236 sbuf_printf(sb,
"0x%jx", (uintmax_t)print_number);
7238 sbuf_printf(sb,
"%ju", (uintmax_t)print_number);
7246 uint32_t valid_len, uint32_t flags,
7247 uint32_t output_flags,
char *error_str,
7251 uint32_t field_size, print_size;
7254 avail_len = valid_len -
sizeof(*hdr);
7256 print_size = MIN(avail_len, field_size);
7258 if (print_size > 0) {
7274 }
else if (avail_len < field_size) {
7286 if (error_str != NULL) {
7287 snprintf(error_str, error_str_len,
"Available "
7288 "length of attribute ID 0x%.4x %zu < field "
7300 uint32_t valid_len, uint32_t flags,
7301 uint32_t output_flags,
char *error_str,
7305 uint32_t field_size, print_size;
7309 avail_len = valid_len -
sizeof(*hdr);
7311 print_size = MIN(avail_len, field_size);
7317 if (print_size > 0) {
7320 for (i = 0; i < print_size; i++) {
7323 else if (((
unsigned char)hdr->
attribute[i] < 0x80)
7327 sbuf_printf(sb,
"%%%02x",
7330 }
else if (avail_len < field_size) {
7335 if (error_str != NULL) {
7336 snprintf(error_str, error_str_len,
"Available "
7337 "length of attribute ID 0x%.4x %zu < field "
7349 size_t num_table_entries, uint32_t
id)
7353 for (i = 0; i < num_table_entries; i++) {
7354 if (table[i].
id ==
id)
7371 char *error_str,
size_t error_str_len)
7396 if (error_str != NULL) {
7397 snprintf(error_str, error_str_len,
"Unknown attribute "
7415 uint32_t valid_len,
const char *
desc)
7425 if (valid_len <
sizeof(*hdr))
7444 && (
desc != NULL)) {
7445 sbuf_printf(sb,
"%s",
desc);
7450 sbuf_printf(sb,
"%s(0x%.4x)", (need_space) ?
" " :
"",
id);
7455 sbuf_printf(sb,
"%s[%d]", (need_space) ?
" " :
"", len);
7459 sbuf_printf(sb,
"%s(%s)", (need_space) ?
" " :
"",
7462 sbuf_printf(sb,
": ");
7468 size_t num_user_entries,
int prefer_user_table,
7469 uint32_t output_flags,
char *error_str,
int error_str_len)
7474 size_t table1_size = 0, table2_size = 0;
7479 if (valid_len <
sizeof(*hdr)) {
7486 if (user_table != NULL) {
7487 if (prefer_user_table != 0) {
7488 table1 = user_table;
7489 table1_size = num_user_entries;
7495 table2 = user_table;
7496 table2_size = num_user_entries;
7504 if (entry != NULL) {
7507 if (entry->
to_str == NULL)
7509 retval = entry->
to_str(sb, hdr, valid_len, entry->
flags,
7510 output_flags, error_str, error_str_len);
7513 if (table2 != NULL) {
7515 if (entry != NULL) {
7516 if (entry->
to_str == NULL)
7520 valid_len, entry->
desc);
7521 retval = entry->
to_str(sb, hdr, valid_len, entry->
flags,
7522 output_flags, error_str,
7532 error_str, error_str_len);
7536 && (entry->
suffix != NULL))
7537 sbuf_printf(sb,
" %s", entry->
suffix);
7540 sbuf_printf(sb,
"\n");
7549 u_int8_t tag_action, u_int8_t sense_len, u_int32_t timeout)
7565 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7572 void *data_ptr, u_int8_t dxfer_len, u_int8_t tag_action,
7573 u_int8_t sense_len, u_int32_t timeout)
7589 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7591 scsi_cmd->
length = dxfer_len;
7597 u_int8_t tag_action, u_int8_t *inq_buf, u_int32_t inq_len,
7598 int evpd, u_int8_t page_code, u_int8_t sense_len,
7615 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7626 void (*cbfcnp)(
struct cam_periph *,
union ccb *), uint8_t tag_action,
7627 int dbd, uint8_t pc, uint8_t page, uint8_t *param_buf, uint32_t param_len,
7628 uint8_t sense_len, uint32_t timeout)
7632 pc, page, 0, param_buf, param_len, 0, sense_len, timeout);
7637 void (*cbfcnp)(
struct cam_periph *,
union ccb *), uint8_t tag_action,
7638 int dbd, uint8_t pc, uint8_t page, uint8_t *param_buf, uint32_t param_len,
7639 int minimum_cmd_size, uint8_t sense_len, uint32_t timeout)
7643 pc, page, 0, param_buf, param_len, minimum_cmd_size,
7644 sense_len, timeout);
7649 void (*cbfcnp)(
struct cam_periph *,
union ccb *), uint8_t tag_action,
7650 int dbd, uint8_t pc, uint8_t page, uint8_t subpage, uint8_t *param_buf,
7651 uint32_t param_len,
int minimum_cmd_size, uint8_t sense_len,
7659 if ((param_len < 256)
7660 && (minimum_cmd_size < 10)) {
7667 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7673 scsi_cmd->
length = param_len;
7674 cdb_len =
sizeof(*scsi_cmd);
7682 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7689 cdb_len =
sizeof(*scsi_cmd);
7706 u_int8_t tag_action,
int scsi_page_fmt,
int save_pages,
7707 u_int8_t *param_buf, u_int32_t param_len, u_int8_t sense_len,
7711 scsi_page_fmt, save_pages, param_buf,
7712 param_len, 0, sense_len, timeout);
7718 u_int8_t tag_action,
int scsi_page_fmt,
int save_pages,
7719 u_int8_t *param_buf, u_int32_t param_len,
7720 int minimum_cmd_size, u_int8_t sense_len,
7728 if ((param_len < 256)
7729 && (minimum_cmd_size < 10)) {
7736 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7738 if (scsi_page_fmt != 0)
7740 if (save_pages != 0)
7742 scsi_cmd->
length = param_len;
7743 cdb_len =
sizeof(*scsi_cmd);
7752 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7754 if (scsi_page_fmt != 0)
7756 if (save_pages != 0)
7759 cdb_len =
sizeof(*scsi_cmd);
7776 u_int8_t tag_action, u_int8_t page_code, u_int8_t page,
7777 int save_pages,
int ppc, u_int32_t paramptr,
7778 u_int8_t *param_buf, u_int32_t param_len, u_int8_t sense_len,
7785 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7788 if (save_pages != 0)
7794 cdb_len =
sizeof(*scsi_cmd);
7811 u_int8_t tag_action, u_int8_t page_code,
int save_pages,
7812 int pc_reset, u_int8_t *param_buf, u_int32_t param_len,
7813 u_int8_t sense_len, u_int32_t timeout)
7819 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7822 if (save_pages != 0)
7827 cdb_len =
sizeof(*scsi_cmd);
7847 u_int8_t tag_action, u_int8_t action,
7848 u_int8_t sense_len, u_int32_t timeout)
7864 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7866 scsi_cmd->
how = action;
7873 u_int8_t tag_action,
7875 u_int8_t sense_len, u_int32_t timeout)
7884 (u_int8_t *)rcap_buf,
7891 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7898 uint8_t tag_action, uint64_t lba,
int reladr,
int pmi,
7899 uint8_t *rcap_buf,
int rcap_buf_len, uint8_t sense_len,
7909 (u_int8_t *)rcap_buf,
7915 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7929 u_int8_t tag_action, u_int8_t select_report,
7931 u_int8_t sense_len, u_int32_t timeout)
7940 (u_int8_t *)rpl_buf,
7946 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7955 u_int8_t tag_action, u_int8_t pdf,
7956 void *buf, u_int32_t alloc_len,
7957 u_int8_t sense_len, u_int32_t timeout)
7972 bzero(scsi_cmd,
sizeof(*scsi_cmd));
7981 u_int8_t tag_action, u_int8_t pdf,
7982 void *buf, u_int32_t alloc_len,
7983 u_int8_t sense_len, u_int32_t timeout)
7998 bzero(scsi_cmd,
sizeof(*scsi_cmd));
8007 u_int8_t tag_action,
void *buf, u_int32_t alloc_len,
8008 u_int8_t sense_len, u_int32_t timeout)
8023 bzero(scsi_cmd,
sizeof(*scsi_cmd));
8040 memcpy(timestamp_6b_buf, &buf[2], 6);
8046 u_int8_t tag_action,
void *buf, u_int32_t alloc_len,
8047 u_int8_t sense_len, u_int32_t timeout)
8062 bzero(scsi_cmd,
sizeof(*scsi_cmd));
8076 u_int8_t tag_action, u_int32_t begin_lba,
8077 u_int16_t lb_count, u_int8_t sense_len,
8094 bzero(scsi_cmd,
sizeof(*scsi_cmd));
8103 u_int8_t tag_action,
int readop, u_int8_t
byte2,
8104 int minimum_cmd_size, u_int64_t lba, u_int32_t block_count,
8105 u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len,
8119 if ((minimum_cmd_size < 10)
8120 && ((lba & 0x1fffff) == lba)
8121 && ((block_count & 0xff) == block_count)
8131 scsi_cmd->
length = block_count & 0xff;
8133 cdb_len =
sizeof(*scsi_cmd);
8136 (
"6byte: %x%x%x:%d:%d\n", scsi_cmd->
addr[0],
8137 scsi_cmd->
addr[1], scsi_cmd->
addr[2],
8138 scsi_cmd->
length, dxfer_len));
8139 }
else if ((minimum_cmd_size < 12)
8140 && ((block_count & 0xffff) == block_count)
8141 && ((lba & 0xffffffff) == lba)) {
8154 cdb_len =
sizeof(*scsi_cmd);
8157 (
"10byte: %x%x%x%x:%x%x: %d\n", scsi_cmd->
addr[0],
8158 scsi_cmd->
addr[1], scsi_cmd->
addr[2],
8160 scsi_cmd->
length[1], dxfer_len));
8161 }
else if ((minimum_cmd_size < 16)
8162 && ((block_count & 0xffffffff) == block_count)
8163 && ((lba & 0xffffffff) == lba)) {
8177 cdb_len =
sizeof(*scsi_cmd);
8180 (
"12byte: %x%x%x%x:%x%x%x%x: %d\n", scsi_cmd->
addr[0],
8181 scsi_cmd->
addr[1], scsi_cmd->
addr[2],
8184 scsi_cmd->
length[3], dxfer_len));
8199 cdb_len =
sizeof(*scsi_cmd);
8217 u_int8_t tag_action, u_int8_t
byte2,
8218 int minimum_cmd_size, u_int64_t lba, u_int32_t block_count,
8219 u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len,
8223 if ((minimum_cmd_size < 16) &&
8224 ((block_count & 0xffff) == block_count) &&
8225 ((lba & 0xffffffff) == lba)) {
8235 scsi_cmd->
group = 0;
8238 cdb_len =
sizeof(*scsi_cmd);
8241 (
"10byte: %x%x%x%x:%x%x: %d\n", scsi_cmd->
addr[0],
8242 scsi_cmd->
addr[1], scsi_cmd->
addr[2],
8244 scsi_cmd->
length[1], dxfer_len));
8257 scsi_cmd->
group = 0;
8259 cdb_len =
sizeof(*scsi_cmd);
8262 (
"16byte: %x%x%x%x%x%x%x%x:%x%x%x%x: %d\n",
8263 scsi_cmd->
addr[0], scsi_cmd->
addr[1],
8264 scsi_cmd->
addr[2], scsi_cmd->
addr[3],
8265 scsi_cmd->
addr[4], scsi_cmd->
addr[5],
8266 scsi_cmd->
addr[6], scsi_cmd->
addr[7],
8286 u_int8_t tag_action, u_int8_t *data_ptr,
8287 u_int16_t dxfer_len, u_int8_t sense_len,
8319 u_int8_t tag_action, u_int16_t block_count,
8320 u_int8_t *data_ptr, u_int16_t dxfer_len, u_int8_t sense_len,
8333 ATA_DATA_SET_MANAGEMENT,
8344 uint8_t tag_action, uint32_t log_address,
8345 uint32_t page_number, uint16_t block_count,
8346 uint8_t protocol, uint8_t *data_ptr, uint32_t dxfer_len,
8347 uint8_t sense_len, uint32_t timeout)
8349 uint8_t command, protocol_out;
8358 count_out = block_count;
8359 command = ATA_READ_LOG_DMA_EXT;
8364 count_out = block_count;
8365 command = ATA_READ_LOG_EXT;
8370 lba = (((uint64_t)page_number & 0xff00) << 32) |
8371 ((page_number & 0x00ff) << 8) |
8372 (log_address & 0xff);
8406 uint8_t tag_action, uint8_t feature,
8407 uint64_t lba, uint32_t count,
8408 uint8_t sense_len, uint32_t timeout)
8446 uint32_t flags, uint8_t tag_action,
8447 uint8_t protocol, uint8_t ata_flags, uint16_t features,
8448 uint16_t sector_count, uint64_t lba, uint8_t command,
8449 uint8_t device, uint8_t icc, uint32_t auxiliary,
8450 uint8_t
control, u_int8_t *data_ptr, uint32_t dxfer_len,
8451 uint8_t *cdb_storage,
size_t cdb_storage_len,
8452 int minimum_cmd_size, u_int8_t sense_len, u_int32_t timeout)
8467 if (minimum_cmd_size <= 12)
8469 else if (minimum_cmd_size > 16)
8479 || (sector_count > 255)
8494 || (auxiliary != 0)) {
8500 && ((cdb_storage == NULL)
8501 || (cdb_storage_len < cmd_size))) {
8514 cdb_ptr = cdb_storage;
8518 if (cmd_size <= 12) {
8522 cdb_len =
sizeof(*cdb);
8523 bzero(cdb, cdb_len);
8527 cdb->
flags = ata_flags;
8531 cdb->
lba_mid = (lba >> 8) & 0xff;
8532 cdb->
lba_high = (lba >> 16) & 0xff;
8533 cdb->
device = ((lba >> 24) & 0xf) | ATA_DEV_LBA;
8536 }
else if (cmd_size <= 16) {
8540 cdb_len =
sizeof(*cdb);
8541 bzero(cdb, cdb_len);
8545 cdb->
flags = ata_flags;
8549 cdb->
lba_mid = (lba >> 8) & 0xff;
8550 cdb->
lba_high = (lba >> 16) & 0xff;
8564 cdb->
device = ((lba >> 24) & 0xf) | ATA_DEV_LBA;
8573 cdb_len =
sizeof(*cdb);
8574 bzero(cdb, cdb_len);
8581 cdb->
flags = ata_flags;
8585 cdb->
device = ((
lba >> 24) & 0xf) | ATA_DEV_LBA;
8587 sector_count &= 0xff;
8592 bcopy(&tmp_lba[2], cdb->
lba,
sizeof(cdb->
lba));
8617 u_int32_t
flags, u_int8_t tag_action,
8619 u_int16_t sector_count, uint64_t
lba, u_int8_t
command,
8620 u_int8_t
control, u_int8_t *data_ptr, u_int16_t dxfer_len,
8621 u_int8_t sense_len, u_int32_t timeout)
8638 ata_cmd->lba_low_ext = lba >> 24;
8639 ata_cmd->lba_mid_ext = lba >> 32;
8640 ata_cmd->lba_high_ext = lba >> 40;
8661 u_int8_t tag_action, u_int8_t byte2,
8662 u_int8_t *data_ptr, u_int16_t dxfer_len, u_int8_t sense_len,
8671 scsi_cmd->
group = 0;
8690 uint8_t tag_action,
int pcv, uint8_t page_code,
8691 uint8_t *data_ptr, uint16_t allocation_length,
8692 uint8_t sense_len, uint32_t timeout)
8697 memset(scsi_cmd, 0,
sizeof(*scsi_cmd));
8720 uint8_t tag_action,
int unit_offline,
int device_offline,
8721 int self_test,
int page_format,
int self_test_code,
8722 uint8_t *data_ptr, uint16_t param_list_length,
8723 uint8_t sense_len, uint32_t timeout)
8728 memset(scsi_cmd, 0,
sizeof(*scsi_cmd));
8743 | (page_format ?
SSD_PF : 0);
8761 uint8_t tag_action, uint8_t *data_ptr,
8762 uint16_t allocation_length, uint8_t report_type,
8763 uint32_t starting_element,
8764 uint8_t sense_len, uint32_t timeout)
8769 memset(scsi_cmd, 0,
sizeof(*scsi_cmd));
8791 uint64_t requested_capacity, uint32_t element_id,
8792 uint8_t sense_len, uint32_t timeout)
8797 memset(scsi_cmd, 0,
sizeof(*scsi_cmd));
8819 uint8_t sense_len, uint32_t timeout)
8824 memset(scsi_cmd, 0,
sizeof(*scsi_cmd));
8843 uint8_t tag_action,
int mode,
8844 uint8_t buffer_id, u_int32_t offset,
8845 uint8_t *data_ptr, uint32_t allocation_length,
8846 uint8_t sense_len, uint32_t timeout)
8851 memset(scsi_cmd, 0,
sizeof(*scsi_cmd));
8853 scsi_cmd->
byte2 = mode;
8873 uint8_t tag_action,
int mode,
8875 uint8_t *data_ptr, uint32_t param_list_length,
8876 uint8_t sense_len, uint32_t timeout)
8881 memset(scsi_cmd, 0,
sizeof(*scsi_cmd));
8883 scsi_cmd->
byte2 = mode;
8903 u_int8_t tag_action,
int start,
int load_eject,
8904 int immediate, u_int8_t sense_len, u_int32_t timeout)
8907 int extra_flags = 0;
8910 bzero(scsi_cmd,
sizeof(*scsi_cmd));
8917 if (load_eject != 0)
8937 u_int8_t tag_action, u_int8_t service_action,
8938 uint32_t element, u_int8_t elem_type,
int logical_volume,
8939 int partition, u_int32_t first_attribute,
int cache,
8940 u_int8_t *data_ptr, u_int32_t length,
int sense_len,
8946 bzero(scsi_cmd,
sizeof(*scsi_cmd));
8975 int partition,
int wtc, u_int8_t *data_ptr,
8976 u_int32_t
length,
int sense_len, u_int32_t timeout)
8981 bzero(scsi_cmd,
sizeof(*scsi_cmd));
9006 uint8_t tag_action,
int service_action,
9007 uint8_t *data_ptr, uint32_t dxfer_len,
int sense_len,
9013 bzero(scsi_cmd,
sizeof(*scsi_cmd));
9016 scsi_cmd->
action = service_action;
9034 uint8_t tag_action,
int service_action,
9035 int scope,
int res_type, uint8_t *data_ptr,
9036 uint32_t dxfer_len,
int sense_len,
int timeout)
9041 bzero(scsi_cmd,
sizeof(*scsi_cmd));
9044 scsi_cmd->
action = service_action;
9063 uint8_t tag_action, uint32_t security_protocol,
9064 uint32_t security_protocol_specific,
int byte4,
9065 uint8_t *data_ptr, uint32_t dxfer_len,
int sense_len,
9071 bzero(scsi_cmd,
sizeof(*scsi_cmd));
9098 uint8_t *data_ptr, uint32_t dxfer_len,
int sense_len,
9104 bzero(scsi_cmd,
sizeof(*scsi_cmd));
9129 uint8_t tag_action,
int options,
int req_opcode,
9130 int req_service_action, uint8_t *data_ptr,
9131 uint32_t dxfer_len,
int sense_len,
int timeout)
9137 bzero(scsi_cmd,
sizeof(*scsi_cmd));
9235 lhs_end = lhs + lhs_len;
9236 rhs_end = rhs + rhs_len;
9250 while (lhs_id <= lhs_last
9255 while (rhs_id <= rhs_last
9287 num_pages =
device->supported_vpds_len -
9289 for (i = 0; i < num_pages; i++) {
9304 TUNABLE_INT_FETCH(
"kern.cam.scsi_delay", &delay);
9307 printf(
"cam: invalid value for tunable kern.cam.scsi_delay\n");
9319 error = sysctl_handle_int(oidp, &delay, 0, req);
9320 if (error != 0 || req->newptr == NULL)
9326 "Delay to allow devices to settle after a SCSI bus reset (ms)");
9336 printf(
"cam: using minimum scsi_delay (%dms)\n",
#define ATA_MAX_28BIT_LBA
caddr_t cam_quirkmatch(caddr_t target, caddr_t quirk_table, int num_entries, int entry_size, cam_quirkmatch_t *comp_func)
int cam_strmatch(const u_int8_t *str, const u_int8_t *pattern, int str_len)
void cam_strvis_sbuf(struct sbuf *sb, const u_int8_t *src, int srclen, uint32_t flags)
@ CAM_STRVIS_FLAG_NONASCII_ESC
@ CAM_STRVIS_FLAG_NONASCII_RAW
@ CAM_STRVIS_FLAG_NONASCII_TRIM
#define CAM_PRIORITY_NORMAL
static __BEGIN_DECLS __inline void cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int32_t flags, u_int8_t tag_action, u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, u_int8_t cdb_len, u_int32_t timeout)
static __inline uint8_t * scsiio_cdb_ptr(struct ccb_scsiio *ccb)
#define CAM_DEBUG(path, flag, printfargs)
int xpt_path_string(struct cam_path *path, char *str, size_t str_len)
void xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority)
void xpt_action(union ccb *start_ccb)
union ccb * xpt_alloc_ccb_nowait(void)
void xpt_free_ccb(union ccb *free_ccb)
const struct sense_key_table_entry sense_key_table[]
uint8_t * scsi_find_desc(struct scsi_sense_data_desc *sense, u_int sense_len, uint8_t desc_type)
int scsi_get_ascq(struct scsi_sense_data *sense_data, u_int sense_len, int show_errors)
int scsi_parse_transportid(char *transportid_str, struct scsi_transportid_header **hdr, unsigned int *alloc_len, struct malloc_type *type, int flags, char *error_str, int error_str_len)
void scsi_mode_sense(struct ccb_scsiio *csio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int dbd, uint8_t pc, uint8_t page, uint8_t *param_buf, uint32_t param_len, uint8_t sense_len, uint32_t timeout)
static void scsi_set_sense_data_desc_va(struct scsi_sense_data *sense_data, u_int *sense_len, scsi_sense_data_type sense_format, int current_error, int sense_key, int asc, int ascq, va_list ap)
SYSCTL_PROC(_kern_cam, OID_AUTO, scsi_delay, CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, 0, 0, sysctl_scsi_delay, "I", "Delay to allow devices to settle after a SCSI bus reset (ms)")
int scsi_devid_is_lun_eui64(uint8_t *bufp)
void scsi_desc_iterate(struct scsi_sense_data_desc *sense, u_int sense_len, int(*iter_func)(struct scsi_sense_data_desc *sense, u_int, struct scsi_sense_desc_header *, void *), void *arg)
int scsi_attrib_vendser_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr, uint32_t valid_len, uint32_t flags, uint32_t output_flags, char *error_str, int error_str_len)
void scsi_report_supported_opcodes(struct ccb_scsiio *csio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int options, int req_opcode, int req_service_action, uint8_t *data_ptr, uint32_t dxfer_len, int sense_len, int timeout)
void scsi_set_timestamp(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, void *buf, u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout)
int scsi_get_sense_key(struct scsi_sense_data *sense_data, u_int sense_len, int show_errors)
void scsi_ata_trim(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int16_t block_count, u_int8_t *data_ptr, u_int16_t dxfer_len, u_int8_t sense_len, u_int32_t timeout)
int scsi_devid_is_lun_name(uint8_t *bufp)
static struct scsi_sense_quirk_entry sense_quirk_table[]
void scsi_request_sense(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), void *data_ptr, u_int8_t dxfer_len, u_int8_t tag_action, u_int8_t sense_len, u_int32_t timeout)
struct scsi_sense_desc_printer scsi_sense_printers[]
void scsi_sense_desc(int sense_key, int asc, int ascq, struct scsi_inquiry_data *inq_data, const char **sense_key_desc, const char **asc_desc)
int scsi_devid_is_sas_target(uint8_t *bufp)
int scsi_devid_is_port_naa(uint8_t *bufp)
void scsi_mode_select_len(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int scsi_page_fmt, int save_pages, u_int8_t *param_buf, u_int32_t param_len, int minimum_cmd_size, u_int8_t sense_len, u_int32_t timeout)
void scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits)
int scsi_ata_setfeatures(struct ccb_scsiio *csio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t feature, uint64_t lba, uint32_t count, uint8_t sense_len, uint32_t timeout)
void scsi_read_buffer(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int mode, uint8_t buffer_id, u_int32_t offset, uint8_t *data_ptr, uint32_t allocation_length, uint8_t sense_len, uint32_t timeout)
void scsi_receive_diagnostic_results(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int pcv, uint8_t page_code, uint8_t *data_ptr, uint16_t allocation_length, uint8_t sense_len, uint32_t timeout)
void scsi_persistent_reserve_in(struct ccb_scsiio *csio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int service_action, uint8_t *data_ptr, uint32_t dxfer_len, int sense_len, int timeout)
SYSINIT(scsi_delay, SI_SUB_TUNABLES, SI_ORDER_ANY, init_scsi_delay, NULL)
static struct op_table_entry plextor_cd_ops[]
int scsi_attrib_text_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr, uint32_t valid_len, uint32_t flags, uint32_t output_flags, char *error_str, int error_str_len)
int scsi_attrib_hexdump_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr, uint32_t valid_len, uint32_t flags, uint32_t output_flags, char *error_str, int error_str_len)
int scsi_parse_transportid_rdma(char *id_str, struct scsi_transportid_header **hdr, unsigned int *alloc_len, struct malloc_type *type, int flags, char *error_str, int error_str_len)
int scsi_devid_is_lun_naa(uint8_t *bufp)
char * scsi_cdb_string(u_int8_t *cdb_ptr, char *cdb_string, size_t len)
int scsi_transportid_sbuf(struct sbuf *sb, struct scsi_transportid_header *hdr, uint32_t valid_len)
void scsi_sense_block_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header)
int scsi_attrib_int_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr, uint32_t valid_len, uint32_t flags, uint32_t output_flags, char *error_str, int error_str_len)
char * scsi_sense_string(struct ccb_scsiio *csio, char *str, int str_len)
void scsi_send_diagnostic(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int unit_offline, int device_offline, int self_test, int page_format, int self_test_code, uint8_t *data_ptr, uint16_t param_list_length, uint8_t sense_len, uint32_t timeout)
void scsi_unmap(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t byte2, u_int8_t *data_ptr, u_int16_t dxfer_len, u_int8_t sense_len, u_int32_t timeout)
static int set_scsi_delay(int delay)
void scsi_security_protocol_out(struct ccb_scsiio *csio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint32_t security_protocol, uint32_t security_protocol_specific, int byte4, uint8_t *data_ptr, uint32_t dxfer_len, int sense_len, int timeout)
void scsi_sense_print(struct ccb_scsiio *csio)
void scsi_mode_select(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int scsi_page_fmt, int save_pages, u_int8_t *param_buf, u_int32_t param_len, u_int8_t sense_len, u_int32_t timeout)
int scsi_devid_is_naa_ieee_reg(uint8_t *bufp)
scsi_sense_data_type scsi_sense_type(struct scsi_sense_data *sense_data)
int scsi_ata_pass(struct ccb_scsiio *csio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint32_t flags, uint8_t tag_action, uint8_t protocol, uint8_t ata_flags, uint16_t features, uint16_t sector_count, uint64_t lba, uint8_t command, uint8_t device, uint8_t icc, uint32_t auxiliary, uint8_t control, u_int8_t *data_ptr, uint32_t dxfer_len, uint8_t *cdb_storage, size_t cdb_storage_len, int minimum_cmd_size, u_int8_t sense_len, u_int32_t timeout)
struct scsi_vpd_id_descriptor * scsi_get_devid_desc(struct scsi_vpd_id_descriptor *desc, uint32_t len, scsi_devid_checkfn_t ck_fn)
void scsi_set_sense_data_va(struct scsi_sense_data *sense_data, u_int *sense_len, scsi_sense_data_type sense_format, int current_error, int sense_key, int asc, int ascq, va_list ap)
int scsi_attrib_ascii_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr, uint32_t valid_len, uint32_t flags, uint32_t output_flags, char *error_str, int error_str_len)
void scsi_prevent(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t action, u_int8_t sense_len, u_int32_t timeout)
void scsi_print_inquiry(struct scsi_inquiry_data *inq_data)
void scsi_write_buffer(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int mode, uint8_t buffer_id, u_int32_t offset, uint8_t *data_ptr, uint32_t param_list_length, uint8_t sense_len, uint32_t timeout)
void scsi_sense_sks_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header)
struct scsi_vpd_id_descriptor * scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t page_len, scsi_devid_checkfn_t ck_fn)
void scsi_set_sense_data_len(struct scsi_sense_data *sense_data, u_int *sense_len, scsi_sense_data_type sense_format, int current_error, int sense_key, int asc, int ascq,...)
int scsi_sks_sbuf(struct sbuf *sb, int sense_key, uint8_t *sks)
void scsi_block_sbuf(struct sbuf *sb, uint8_t block_bits)
struct scsi_attrib_table_entry scsi_mam_attr_table[]
const char * scsi_nv_to_str(struct scsi_nv *table, int num_table_entries, uint64_t value)
void scsi_sense_progress_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header)
int scsi_get_sks(struct scsi_sense_data *sense_data, u_int sense_len, uint8_t *sks)
int scsi_attrib_value_sbuf(struct sbuf *sb, uint32_t valid_len, struct scsi_mam_attribute_header *hdr, uint32_t output_flags, char *error_str, size_t error_str_len)
void scsi_sense_fru_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header)
static int senseentrycomp(const void *key, const void *member)
static void init_scsi_delay(void)
int scsi_inquiry_match(caddr_t inqbuffer, caddr_t table_entry)
const char * scsi_status_string(struct ccb_scsiio *csio)
struct scsi_attrib_table_entry * scsi_find_attrib_entry(struct scsi_attrib_table_entry *table, size_t num_table_entries, uint32_t id)
int scsi_parse_transportid_64bit(int proto_id, char *id_str, struct scsi_transportid_header **hdr, unsigned int *alloc_len, struct malloc_type *type, int flags, char *error_str, int error_str_len)
void scsi_sense_desc_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header)
void scsi_read_capacity(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, struct scsi_read_capacity_data *rcap_buf, u_int8_t sense_len, u_int32_t timeout)
void scsi_write_same(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t byte2, int minimum_cmd_size, u_int64_t lba, u_int32_t block_count, u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout)
void scsi_extract_sense(struct scsi_sense_data *sense_data, int *error_code, int *sense_key, int *asc, int *ascq)
void scsi_cdb_sbuf(u_int8_t *cdb_ptr, struct sbuf *sb)
void scsi_restore_elements_and_rebuild(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t sense_len, uint32_t timeout)
void scsi_remove_element_and_truncate(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint64_t requested_capacity, uint32_t element_id, uint8_t sense_len, uint32_t timeout)
void scsi_read_attribute(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t service_action, uint32_t element, u_int8_t elem_type, int logical_volume, int partition, u_int32_t first_attribute, int cache, u_int8_t *data_ptr, u_int32_t length, int sense_len, u_int32_t timeout)
static int ascentrycomp(const void *key, const void *member)
void scsi_print_inquiry_sbuf(struct sbuf *sb, struct scsi_inquiry_data *inq_data)
void scsi_ata_identify(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t *data_ptr, u_int16_t dxfer_len, u_int8_t sense_len, u_int32_t timeout)
u_int scsi_calc_syncparam(u_int period)
int scsi_extract_sense_ccb(union ccb *ccb, int *error_code, int *sense_key, int *asc, int *ascq)
static void scsi_set_sense_data_fixed_va(struct scsi_sense_data *sense_data, u_int *sense_len, scsi_sense_data_type sense_format, int current_error, int sense_key, int asc, int ascq, va_list ap)
static int scsi_find_desc_func(struct scsi_sense_data_desc *sense, u_int sense_len, struct scsi_sense_desc_header *header, void *arg)
scsi_nv_status scsi_get_nv(struct scsi_nv *table, int num_table_entries, char *name, int *table_entry, scsi_nv_flags flags)
void scsi_progress_sbuf(struct sbuf *sb, uint16_t progress)
void scsi_get_physical_element_status(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t *data_ptr, uint16_t allocation_length, uint8_t report_type, uint32_t starting_element, uint8_t sense_len, uint32_t timeout)
void scsi_report_target_group(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t pdf, void *buf, u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout)
void scsi_command_sbuf(struct sbuf *sb, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, uint64_t csi)
static int scsi_print_desc_func(struct scsi_sense_data_desc *sense, u_int sense_len, struct scsi_sense_desc_header *header, void *arg)
void scsi_set_sense_data(struct scsi_sense_data *sense_data, scsi_sense_data_type sense_format, int current_error, int sense_key, int asc, int ascq,...)
void scsi_security_protocol_in(struct ccb_scsiio *csio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint32_t security_protocol, uint32_t security_protocol_specific, int byte4, uint8_t *data_ptr, uint32_t dxfer_len, int sense_len, int timeout)
void scsi_extract_sense_len(struct scsi_sense_data *sense_data, u_int sense_len, int *error_code, int *sense_key, int *asc, int *ascq, int show_errors)
void scsi_report_luns(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t select_report, struct scsi_report_luns_data *rpl_buf, u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout)
static int sysctl_scsi_delay(SYSCTL_HANDLER_ARGS)
void scsi_inquiry(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t *inq_buf, u_int32_t inq_len, int evpd, u_int8_t page_code, u_int8_t sense_len, u_int32_t timeout)
void scsi_sense_ata_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header)
const char * scsi_op_desc(u_int16_t opcode, struct scsi_inquiry_data *inq_data)
void scsi_mode_sense_len(struct ccb_scsiio *csio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int dbd, uint8_t pc, uint8_t page, uint8_t *param_buf, uint32_t param_len, int minimum_cmd_size, uint8_t sense_len, uint32_t timeout)
void scsi_info_sbuf(struct sbuf *sb, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, uint64_t info)
int scsi_ata_read_log(struct ccb_scsiio *csio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint32_t log_address, uint32_t page_number, uint16_t block_count, uint8_t protocol, uint8_t *data_ptr, uint32_t dxfer_len, uint8_t sense_len, uint32_t timeout)
int scsi_get_sense_info(struct scsi_sense_data *sense_data, u_int sense_len, uint8_t info_type, uint64_t *info, int64_t *signed_info)
static struct @14 scsi_syncrates[]
void scsi_synchronize_cache(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int32_t begin_lba, u_int16_t lb_count, u_int8_t sense_len, u_int32_t timeout)
int scsi_get_block_info(struct scsi_sense_data *sense_data, u_int sense_len, struct scsi_inquiry_data *inq_data, uint8_t *block_bits)
void scsi_write_attribute(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, uint32_t element, int logical_volume, int partition, int wtc, u_int8_t *data_ptr, u_int32_t length, int sense_len, u_int32_t timeout)
int scsi_devid_match(uint8_t *lhs, size_t lhs_len, uint8_t *rhs, size_t rhs_len)
void scsi_sense_generic_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header)
int scsi_attrib_volcoh_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr, uint32_t valid_len, uint32_t flags, uint32_t output_flags, char *error_str, int error_str_len)
static struct asc_table_entry hgst_entries[]
int scsi_sense_sbuf(struct ccb_scsiio *csio, struct sbuf *sb, scsi_sense_string_flags flags)
static struct asc_table_entry quantum_fireball_entries[]
void scsi_create_timestamp(uint8_t *timestamp_6b_buf, uint64_t timestamp)
void scsi_sense_stream_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header)
void scsi_print_inquiry_short_sbuf(struct sbuf *sb, struct scsi_inquiry_data *inq_data)
void scsi_attrib_prefix_sbuf(struct sbuf *sb, uint32_t output_flags, struct scsi_mam_attribute_header *hdr, uint32_t valid_len, const char *desc)
void scsi_persistent_reserve_out(struct ccb_scsiio *csio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int service_action, int scope, int res_type, uint8_t *data_ptr, uint32_t dxfer_len, int sense_len, int timeout)
int scsi_vpd_supported_page(struct cam_periph *periph, uint8_t page_id)
int scsi_attrib_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr, uint32_t valid_len, struct scsi_attrib_table_entry *user_table, size_t num_user_entries, int prefer_user_table, uint32_t output_flags, char *error_str, int error_str_len)
void scsi_sense_forwarded_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header)
void scsi_read_write(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int readop, u_int8_t byte2, int minimum_cmd_size, u_int64_t lba, u_int32_t block_count, u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout)
void scsi_mode_sense_subpage(struct ccb_scsiio *csio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int dbd, uint8_t pc, uint8_t page, uint8_t subpage, uint8_t *param_buf, uint32_t param_len, int minimum_cmd_size, uint8_t sense_len, uint32_t timeout)
void scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, void *buf, u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout)
static struct scsi_op_quirk_entry scsi_op_quirk_table[]
static struct op_table_entry scsi_op_codes[]
struct scsi_nv scsi_proto_map[]
int scsi_devid_is_lun_t10(uint8_t *bufp)
void scsi_test_unit_ready(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t sense_len, u_int32_t timeout)
int scsi_get_stream_info(struct scsi_sense_data *sense_data, u_int sense_len, struct scsi_inquiry_data *inq_data, uint8_t *stream_bits)
int scsi_parse_transportid_sop(char *id_str, struct scsi_transportid_header **hdr, unsigned int *alloc_len, struct malloc_type *type, int flags, char *error_str, int error_str_len)
int scsi_command_string(struct ccb_scsiio *csio, struct sbuf *sb)
static struct asc_table_entry asc_table[]
int scsi_parse_transportid_spi(char *id_str, struct scsi_transportid_header **hdr, unsigned int *alloc_len, struct malloc_type *type, int flags, char *error_str, int error_str_len)
const u_int asc_table_size
void scsi_print_inquiry_short(struct scsi_inquiry_data *inq_data)
static void fetchtableentries(int sense_key, int asc, int ascq, struct scsi_inquiry_data *, const struct sense_key_table_entry **, const struct asc_table_entry **)
#define SST(asc, ascq, action, desc)
u_int scsi_calc_syncsrate(u_int period_factor)
void scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int start, int load_eject, int immediate, u_int8_t sense_len, u_int32_t timeout)
void scsi_log_select(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t page_code, int save_pages, int pc_reset, u_int8_t *param_buf, u_int32_t param_len, u_int8_t sense_len, u_int32_t timeout)
void scsi_log_sense(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t page_code, u_int8_t page, int save_pages, int ppc, u_int32_t paramptr, u_int8_t *param_buf, u_int32_t param_len, u_int8_t sense_len, u_int32_t timeout)
struct scsi_attrib_table_entry * scsi_get_attrib_entry(uint32_t id)
scsi_sense_action scsi_error_action(struct ccb_scsiio *csio, struct scsi_inquiry_data *inq_data, u_int32_t sense_flags)
const u_int sense_quirk_table_size
int scsi_get_asc(struct scsi_sense_data *sense_data, u_int sense_len, int show_errors)
int scsi_devid_is_lun_uuid(uint8_t *bufp)
void scsi_ata_pass_16(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int32_t flags, u_int8_t tag_action, u_int8_t protocol, u_int8_t ata_flags, u_int16_t features, u_int16_t sector_count, uint64_t lba, u_int8_t command, u_int8_t control, u_int8_t *data_ptr, u_int16_t dxfer_len, u_int8_t sense_len, u_int32_t timeout)
void scsi_sense_command_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header)
void scsi_sense_info_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header)
static struct asc_table_entry sony_mo_entries[]
void scsi_fru_sbuf(struct sbuf *sb, uint64_t fru)
void scsi_report_timestamp(struct ccb_scsiio *csio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, u_int8_t pdf, void *buf, u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout)
static struct asc_table_entry seagate_entries[]
int scsi_devid_is_lun_md5(uint8_t *bufp)
void scsi_sense_only_sbuf(struct scsi_sense_data *sense, u_int sense_len, struct sbuf *sb, char *path_str, struct scsi_inquiry_data *inq_data, uint8_t *cdb, int cdb_len)
int scsi_static_inquiry_match(caddr_t inqbuffer, caddr_t table_entry)
void scsi_read_capacity_16(struct ccb_scsiio *csio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint64_t lba, int reladr, int pmi, uint8_t *rcap_buf, int rcap_buf_len, uint8_t sense_len, uint32_t timeout)
int scsi_parse_transportid_iscsi(char *id_str, struct scsi_transportid_header **hdr, unsigned int *alloc_len, struct malloc_type *type, int flags, char *error_str, int error_str_len)
#define REPORT_SUPPORTED_OPERATION_CODES
#define SCSI_TRN_SPI_FORMAT_DEFAULT
#define SMA_ATTR_DEV_ASSIGNING_ORG
#define SSD_KEY_BLANK_CHECK
#define SMA_ATTR_DEV_SERIAL_LAST_LOAD_2
#define SSD_KEY_UNIT_ATTENTION
#define SID_IS_REMOVABLE(inq_data)
#define SSD_SELF_TEST_CODE_SHIFT
#define SET_TARGET_PORT_GROUPS
#define SSD_SKS_OVERFLOW_SET
#define SCSI_TRN_RDMA_PORT_LEN
#define SCSI_LTFS_STR_NAME
#define SVPD_ID_NAA_NAA_SHIFT
#define SMA_ATTR_MED_MANUF
#define SMA_ATTR_TOTAL_MB_WRITTEN_LT
#define SMA_FORMAT_BINARY
#define SSD_KEY_HARDWARE_ERROR
#define SCSI_STATUS_CMD_TERMINATED
#define SMA_ATTR_DEV_SERIAL_LAST_LOAD_3
#define SVPD_ID_TYPE_SCSI_NAME
#define SMA_ATTR_MED_TYPE
#define SSD_DESC_FORWARDED
#define AP_FLAG_BYT_BLOK_BYTES
#define SMA_ATTR_MAX_CAP_PARTITION
#define AP_FLAG_TDIR_FROM_DEV
#define SSD_DESC_CURRENT_ERROR
#define SMA_ATTR_TOTAL_MB_WRITTEN_CUR
#define SSD_KEY_ABORTED_COMMAND
#define SCSI_STATUS_CHECK_COND
#define SCSI_TRN_1394_FORMAT_DEFAULT
#define SCSI_TRN_SOP_FUNC_NORM_MAX
#define SSD_SELF_TEST_CODE_NONE
#define PERSISTENT_RES_OUT
#define PERSISTENT_RES_IN
#define SMA_ATTR_VOLUME_CHANGE_REF
#define SRC16_SERVICE_ACTION
static __inline uint32_t scsi_3btoul(const uint8_t *bytes)
static __inline uint64_t scsi_8btou64(const uint8_t *bytes)
#define SVPD_SUPPORTED_PAGES_HDR_LEN
#define SCSI_STATUS_INTERMED
#define SSD_KEY_MISCOMPARE
#define SVPD_ID_PROTO_SHIFT
static __inline uint32_t scsi_2btoul(const uint8_t *bytes)
#define SSD_SKS_FIELD_CMD
#define SMA_ATTR_APP_VERSION
#define SSD_SKS_SEGMENT_SD
#define SMA_ATTR_MEDIA_POOL
#define SVPD_ID_TYPE_MASK
#define SSD_DESC_STREAM_ILI
#define SIP_MEDIA_REMOVABLE
#define SMA_ATTR_TAPEALERT_FLAGS
#define SVPD_ID_NAA_LOCAL_REG
#define SCSI_TRN_SAS_FORMAT_DEFAULT
#define SMA_ATTR_MAM_SPACE_REMAINING
#define SMA_ATTR_MEDIUM_USAGE_HIST
#define SMA_ATTR_MED_DENSITY_CODE
#define SMA_ATTR_MED_LENGTH
#define SVPD_ID_TYPE_UUID
#define SCSI_TRN_SOP_DEV_MASK
#define SMA_ATTR_PART_USAGE_HIST
#define SMA_ATTR_TEXT_LOCAL_ID
#define SYNCHRONIZE_CACHE
#define SMA_ATTR_MAM_CAPACITY
#define RECEIVE_DIAGNOSTIC
#define SMA_ATTR_USER_MED_TEXT_LABEL
#define SSD_KEY_RECOVERED_ERROR
#define SSD_DESC_STREAM_EOM
#define SSD_FIXED_IS_FILLED(sense, field)
#define SMA_ATTR_MED_ASSIGNING_ORG
static __inline void scsi_ulto2b(u_int32_t val, u_int8_t *bytes)
#define REMOVE_ELEMENT_AND_TRUNCATE
#define SMA_ATTR_APP_VENDOR
#define SSD_DESC_IS_PRESENT(sense, length, field)
#define SMA_ATTR_DEV_SERIAL_LAST_LOAD_1
#define SSD_DEFERRED_ERROR
#define SMA_ATTR_LOAD_UNLOAD_AT_PART
#define SECURITY_PROTOCOL_IN
#define SSD_DESC_STREAM_FM
#define SSD_DESC_DEFERRED_ERROR
#define SSD_SKS_BIT_VALUE
#define SSD_KEY_NOT_READY
#define SCSI_TRN_PROTO_MASK
#define SCSI_TRN_SOP_FORMAT_DEFAULT
#define SCSI_LTFS_VER0_LEN
#define SCSI_TRN_ISCSI_FORMAT_PORT
#define SMA_ATTR_MED_WIDTH
#define SSD_KEY_MEDIUM_ERROR
#define AP_FLAG_BYT_BLOK_BLOCKS
#define SVPD_ID_ASSOC_LUN
static __inline uint32_t scsi_4btoul(const uint8_t *bytes)
#define SMA_ATTR_LOAD_COUNT
#define SSD_KEY_VOLUME_OVERFLOW
#define SID_QUAL_LU_CONNECTED
#define SSD_FIXED_IS_PRESENT(sense, length, field)
#define SVPD_ID_ASSOC_MASK
#define SSD_SKS_SEGMENT_BITPTR
#define SMA_ATTR_REM_CAP_PARTITION
#define SMA_ATTR_PART_USER_LABEL
#define SMA_ATTR_TOTAL_MB_READ_LT
#define SSD_DESC_BLOCK_ILI
#define SVPD_ID_TYPE_MD5_LUN_ID
#define GET_PHYSICAL_ELEMENT_STATUS
#define SMA_ATTR_APP_FORMAT_VERSION
#define SVPD_ID_ASSOC_PORT
static __inline void scsi_ulto4b(u_int32_t val, u_int8_t *bytes)
#define SVPD_ID_TYPE_EUI64
static __inline void scsi_u64to8b(u_int64_t val, u_int8_t *bytes)
#define SCSI_TRN_FCP_FORMAT_DEFAULT
@ SCSI_ATTR_OUTPUT_NONASCII_TRIM
@ SCSI_ATTR_OUTPUT_FIELD_SIZE
@ SCSI_ATTR_OUTPUT_NONASCII_MASK
@ SCSI_ATTR_OUTPUT_FIELD_DESC
@ SCSI_ATTR_OUTPUT_FIELD_NONE
@ SCSI_ATTR_OUTPUT_NONASCII_ESC
@ SCSI_ATTR_OUTPUT_NONASCII_RAW
@ SCSI_ATTR_OUTPUT_FIELD_RW
@ SCSI_ATTR_OUTPUT_TEXT_MASK
@ SCSI_ATTR_OUTPUT_FIELD_NUM
@ SCSI_ATTR_OUTPUT_FIELD_MASK
@ SCSI_ATTR_OUTPUT_TEXT_RAW
#define SCSI_STATUS_TASK_ABORTED
#define SERVICE_ACTION_IN
#define SID_TYPE(inq_data)
#define SMA_ATTR_APP_NAME
#define SCSI_STATUS_RESERV_CONFLICT
#define SMA_ATTR_FIRST_ENC_BLOCK
#define SECURITY_PROTOCOL_OUT
#define SSD_SKS_PROGRESS_DENOM
#define SMA_ATTR_TOTAL_MB_READ_CUR
#define SCSI_TRN_FORMAT_SHIFT
#define SCSI_TRN_SOP_BUS_MAX
#define SSD_KEY_COMPLETED
#define SSD_SKS_SEGMENT_BPV
#define SMA_ATTR_NEXT_UNENC_BLOCK
#define SSD_DESC_PROGRESS
@ SCSI_ATTR_FLAG_FP_1DIGIT
#define SMA_ATTR_MED_SERIAL_NUM
#define SID_QUAL_IS_VENDOR_UNIQUE(inq_data)
#define SID_ANSI_REV(inq_data)
#define SCSI_STATUS_ACA_ACTIVE
#define SCSI_TRN_SOP_DEV_SHIFT
#define SID_QUAL_LU_OFFLINE
#define REPORT_TARGET_PORT_GROUPS
#define SMA_ATTR_HOST_OWNER_NAME
#define SCSI_TRN_FORMAT_MASK
#define SMA_ATTR_VOL_COHERENCY_INFO
#define SID_QUAL(inq_data)
static __inline void scsi_ulto3b(u_int32_t val, u_int8_t *bytes)
#define SSD_KEY_ILLEGAL_REQUEST
#define SCSI_TRN_RDMA_FORMAT_DEFAULT
#define SMA_ATTR_VOLUME_ID
#define SMA_ATTR_DEV_SERIAL_LAST_LOAD
#define SMA_ATTR_INITIALIZATION_COUNT
#define SMA_ATTR_LAST_WRITTEN_TIME
#define SCSI_TRN_SOP_FUNC_ALT_MAX
#define RESTORE_ELEMENTS_AND_REBUILD
#define SSD_KEY_Vendor_Specific
#define SSD_DESC_ATA_FLAG_EXTEND
#define SCSI_TRN_ISCSI_FORMAT_DEVICE
#define SMA_ATTR_MED_MANUF_DATE
#define SSD_KEY_DATA_PROTECT
#define SCSI_TRN_SOP_DEV_MAX
#define SCSI_STATUS_INTERMED_COND_MET
#define SVPD_ID_NAA_IEEE_REG
#define SSD_ERRCODE_VALID
#define SCSI_LTFS_UUID_LEN
#define SMA_ATTR_FORMAT_DENSITY_CODE
#define SSD_KEY_COPY_ABORTED
#define AP_FLAG_TLEN_SECT_CNT
#define SCSI_LTFS_VER1_LEN
#define SCSI_STATUS_QUEUE_FULL
#define SMA_ATTR_MED_SERIAL
#define SCSI_LTFS_STR_LEN
#define SSD_SELF_TEST_CODE_MASK
#define SMA_ATTR_MED_TYPE_INFO
#define SSD_CURRENT_ERROR
int(* scsi_devid_checkfn_t)(uint8_t *)
u_int8_t sector_count_ext
uint8_t service_action[2]
struct scsi_inquiry_data inq_data
struct scsi_sense_data sense_data
int(* to_str)(struct sbuf *sb, struct scsi_mam_attribute_header *hdr, uint32_t valid_len, uint32_t flags, uint32_t output_flags, char *error_str, int error_str_len)
struct scsi_sense_desc_header * header
uint8_t starting_element[4]
uint8_t allocation_length[4]
char vendor[SID_VENDOR_SIZE]
char product[SID_PRODUCT_SIZE]
char revision[SID_REVISION_SIZE]
struct scsi_inquiry_data * inq_data
u_int8_t first_attribute[2]
uint8_t element_identifier[4]
uint8_t requested_capacity[8]
uint8_t requested_service_action[2]
uint8_t security_protocol
uint8_t security_protocol_specific[2]
uint8_t security_protocol_specific[2]
uint8_t security_protocol
uint8_t add_sense_code_qual
u_int8_t add_sense_code_qual
u_int8_t sense_key_spec[3]
u_int8_t cmd_spec_info[4]
void(* print_func)(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header)
struct asc_table_entry * asc_info
struct sense_key_table_entry * sense_key_info
uint8_t actual_retry_count[2]
uint8_t sense_key_spec[3]
char vendor[SID_VENDOR_SIZE+1]
char revision[SID_REVISION_SIZE+1]
char product[SID_PRODUCT_SIZE+1]
uint8_t additional_length[2]
uint8_t additional_length[2]
uint8_t initiator_port_id[SCSI_TRN_RDMA_PORT_LEN]
uint8_t rel_trgt_port_id[2]
u_int8_t cdb_bytes[IOCDBLEN]