1 /* 2 * This file is auto-generated. Modifications will be lost. 3 * 4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ 5 * for more information. 6 */ 7 #ifndef CCISS_DEFS_H 8 #define CCISS_DEFS_H 9 #include <linux/types.h> 10 #define SENSEINFOBYTES 32 11 #define CMD_SUCCESS 0x0000 12 #define CMD_TARGET_STATUS 0x0001 13 #define CMD_DATA_UNDERRUN 0x0002 14 #define CMD_DATA_OVERRUN 0x0003 15 #define CMD_INVALID 0x0004 16 #define CMD_PROTOCOL_ERR 0x0005 17 #define CMD_HARDWARE_ERR 0x0006 18 #define CMD_CONNECTION_LOST 0x0007 19 #define CMD_ABORTED 0x0008 20 #define CMD_ABORT_FAILED 0x0009 21 #define CMD_UNSOLICITED_ABORT 0x000A 22 #define CMD_TIMEOUT 0x000B 23 #define CMD_UNABORTABLE 0x000C 24 #define XFER_NONE 0x00 25 #define XFER_WRITE 0x01 26 #define XFER_READ 0x02 27 #define XFER_RSVD 0x03 28 #define ATTR_UNTAGGED 0x00 29 #define ATTR_SIMPLE 0x04 30 #define ATTR_HEADOFQUEUE 0x05 31 #define ATTR_ORDERED 0x06 32 #define ATTR_ACA 0x07 33 #define TYPE_CMD 0x00 34 #define TYPE_MSG 0x01 35 #define BYTE __u8 36 #define WORD __u16 37 #define HWORD __u16 38 #define DWORD __u32 39 #define CISS_MAX_LUN 1024 40 #define LEVEL2LUN 1 41 #define LEVEL3LUN 0 42 #pragma pack(1) 43 typedef union _SCSI3Addr_struct { 44 struct { 45 BYTE Dev; 46 BYTE Bus : 6; 47 BYTE Mode : 2; 48 } PeripDev; 49 struct { 50 BYTE DevLSB; 51 BYTE DevMSB : 6; 52 BYTE Mode : 2; 53 } LogDev; 54 struct { 55 BYTE Dev : 5; 56 BYTE Bus : 3; 57 BYTE Targ : 6; 58 BYTE Mode : 2; 59 } LogUnit; 60 } SCSI3Addr_struct; 61 typedef struct _PhysDevAddr_struct { 62 DWORD TargetId : 24; 63 DWORD Bus : 6; 64 DWORD Mode : 2; 65 SCSI3Addr_struct Target[2]; 66 } PhysDevAddr_struct; 67 typedef struct _LogDevAddr_struct { 68 DWORD VolId : 30; 69 DWORD Mode : 2; 70 BYTE reserved[4]; 71 } LogDevAddr_struct; 72 typedef union _LUNAddr_struct { 73 BYTE LunAddrBytes[8]; 74 SCSI3Addr_struct SCSI3Lun[4]; 75 PhysDevAddr_struct PhysDev; 76 LogDevAddr_struct LogDev; 77 } LUNAddr_struct; 78 typedef struct _RequestBlock_struct { 79 BYTE CDBLen; 80 struct { 81 BYTE Type : 3; 82 BYTE Attribute : 3; 83 BYTE Direction : 2; 84 } Type; 85 HWORD Timeout; 86 BYTE CDB[16]; 87 } RequestBlock_struct; 88 typedef union _MoreErrInfo_struct { 89 struct { 90 BYTE Reserved[3]; 91 BYTE Type; 92 DWORD ErrorInfo; 93 } Common_Info; 94 struct { 95 BYTE Reserved[2]; 96 BYTE offense_size; 97 BYTE offense_num; 98 DWORD offense_value; 99 } Invalid_Cmd; 100 } MoreErrInfo_struct; 101 typedef struct _ErrorInfo_struct { 102 BYTE ScsiStatus; 103 BYTE SenseLen; 104 HWORD CommandStatus; 105 DWORD ResidualCnt; 106 MoreErrInfo_struct MoreErrInfo; 107 BYTE SenseInfo[SENSEINFOBYTES]; 108 } ErrorInfo_struct; 109 #pragma pack() 110 #endif 111