-
Notifications
You must be signed in to change notification settings - Fork 39
/
scsi.h
82 lines (72 loc) · 1.9 KB
/
scsi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
scsi.h
*/
#ifndef SCSI_H
#define SCSI_H
#define SENSEKEY_NO_SENSE 0x0
#define SENSEKEY_SOFT_ERROR 0x1
#define SENSEKEY_NOT_READY 0x2
#define SENSEKEY_MEDIUM_ERROR 0x3
#define SENSEKEY_HARDWARE_ERROR 0x4
#define SENSEKEY_ILLEGAL_REQUEST 0x5
#define SENSEKEY_UNIT_ATTENTION 0x6
#define SENSEKEY_ABORTED_COMMAND 0xB
typedef struct {
uint8_t DeviceType : 5;
uint8_t DeviceTypeQualifier : 3;
uint8_t DeviceTypeModifier : 7;
uint8_t RemovableMedia : 1;
uint8_t Versions;
uint8_t ResponseDataFormat : 4;
uint8_t HiSupport : 1;
uint8_t NormACA : 1;
uint8_t ReservedBit : 1;
uint8_t AERC : 1;
uint8_t AdditionalLength;
uint8_t Reserved[2];
uint8_t SoftReset : 1;
uint8_t CommandQueue : 1;
uint8_t Reserved2 : 1;
uint8_t LinkedCommands : 1;
uint8_t Synchronous : 1;
uint8_t Wide16Bit : 1;
uint8_t Wide32Bit : 1;
uint8_t RelativeAddressing : 1;
uint8_t VendorId[8];
uint8_t ProductId[16];
uint8_t ProductRevisionLevel[4];
uint8_t VendorSpecific[20];
uint8_t Reserved3[2];
uint8_t VersionDescriptors[8];
uint8_t Reserved4[30];
} __attribute__ ((packed)) INQUIRYDATA_t;
typedef struct {
uint8_t ErrorCode :7;
uint8_t Valid :1;
uint8_t SegmentNumber;
uint8_t SenseKey :4;
uint8_t Reserved :1;
uint8_t IncorrectLength :1;
uint8_t EndOfMedia :1;
uint8_t FileMark :1;
uint8_t Information[4];
uint8_t AdditionalSenseLength;
uint8_t CommandSpecificInformation[4];
uint8_t AdditionalSenseCode;
uint8_t AdditionalSenseCodeQualifier;
uint8_t FieldReplaceableUnitCode;
uint8_t SenseKeySpecific[3];
} __attribute__ ((packed)) SENSEDATA_t;
typedef struct {
uint32_t LBA;
uint32_t blocklen;
} __attribute__ ((packed)) CAPACITYDATA_t;
typedef struct {
uint8_t Reserved[3];
uint8_t Length;
uint32_t Blocks;
uint8_t DescriptorType :1;
uint8_t Reserved2 : 7;
uint8_t Blocklen[3];
} __attribute__ ((packed)) FORMATCAPACITYDATA_t;
#endif