Colin Cross | 07a5832 | 2022-02-08 19:45:27 -0800 | [diff] [blame^] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef CCISS_DEFS_H |
| 20 | #define CCISS_DEFS_H |
| 21 | #include <linux/types.h> |
| 22 | #define SENSEINFOBYTES 32 |
| 23 | #define CMD_SUCCESS 0x0000 |
| 24 | #define CMD_TARGET_STATUS 0x0001 |
| 25 | #define CMD_DATA_UNDERRUN 0x0002 |
| 26 | #define CMD_DATA_OVERRUN 0x0003 |
| 27 | #define CMD_INVALID 0x0004 |
| 28 | #define CMD_PROTOCOL_ERR 0x0005 |
| 29 | #define CMD_HARDWARE_ERR 0x0006 |
| 30 | #define CMD_CONNECTION_LOST 0x0007 |
| 31 | #define CMD_ABORTED 0x0008 |
| 32 | #define CMD_ABORT_FAILED 0x0009 |
| 33 | #define CMD_UNSOLICITED_ABORT 0x000A |
| 34 | #define CMD_TIMEOUT 0x000B |
| 35 | #define CMD_UNABORTABLE 0x000C |
| 36 | #define XFER_NONE 0x00 |
| 37 | #define XFER_WRITE 0x01 |
| 38 | #define XFER_READ 0x02 |
| 39 | #define XFER_RSVD 0x03 |
| 40 | #define ATTR_UNTAGGED 0x00 |
| 41 | #define ATTR_SIMPLE 0x04 |
| 42 | #define ATTR_HEADOFQUEUE 0x05 |
| 43 | #define ATTR_ORDERED 0x06 |
| 44 | #define ATTR_ACA 0x07 |
| 45 | #define TYPE_CMD 0x00 |
| 46 | #define TYPE_MSG 0x01 |
| 47 | #define BYTE __u8 |
| 48 | #define WORD __u16 |
| 49 | #define HWORD __u16 |
| 50 | #define DWORD __u32 |
| 51 | #define CISS_MAX_LUN 1024 |
| 52 | #define LEVEL2LUN 1 |
| 53 | #define LEVEL3LUN 0 |
| 54 | #pragma pack(1) |
| 55 | typedef union _SCSI3Addr_struct { |
| 56 | struct { |
| 57 | BYTE Dev; |
| 58 | BYTE Bus : 6; |
| 59 | BYTE Mode : 2; |
| 60 | } PeripDev; |
| 61 | struct { |
| 62 | BYTE DevLSB; |
| 63 | BYTE DevMSB : 6; |
| 64 | BYTE Mode : 2; |
| 65 | } LogDev; |
| 66 | struct { |
| 67 | BYTE Dev : 5; |
| 68 | BYTE Bus : 3; |
| 69 | BYTE Targ : 6; |
| 70 | BYTE Mode : 2; |
| 71 | } LogUnit; |
| 72 | } SCSI3Addr_struct; |
| 73 | typedef struct _PhysDevAddr_struct { |
| 74 | DWORD TargetId : 24; |
| 75 | DWORD Bus : 6; |
| 76 | DWORD Mode : 2; |
| 77 | SCSI3Addr_struct Target[2]; |
| 78 | } PhysDevAddr_struct; |
| 79 | typedef struct _LogDevAddr_struct { |
| 80 | DWORD VolId : 30; |
| 81 | DWORD Mode : 2; |
| 82 | BYTE reserved[4]; |
| 83 | } LogDevAddr_struct; |
| 84 | typedef union _LUNAddr_struct { |
| 85 | BYTE LunAddrBytes[8]; |
| 86 | SCSI3Addr_struct SCSI3Lun[4]; |
| 87 | PhysDevAddr_struct PhysDev; |
| 88 | LogDevAddr_struct LogDev; |
| 89 | } LUNAddr_struct; |
| 90 | typedef struct _RequestBlock_struct { |
| 91 | BYTE CDBLen; |
| 92 | struct { |
| 93 | BYTE Type : 3; |
| 94 | BYTE Attribute : 3; |
| 95 | BYTE Direction : 2; |
| 96 | } Type; |
| 97 | HWORD Timeout; |
| 98 | BYTE CDB[16]; |
| 99 | } RequestBlock_struct; |
| 100 | typedef union _MoreErrInfo_struct { |
| 101 | struct { |
| 102 | BYTE Reserved[3]; |
| 103 | BYTE Type; |
| 104 | DWORD ErrorInfo; |
| 105 | } Common_Info; |
| 106 | struct { |
| 107 | BYTE Reserved[2]; |
| 108 | BYTE offense_size; |
| 109 | BYTE offense_num; |
| 110 | DWORD offense_value; |
| 111 | } Invalid_Cmd; |
| 112 | } MoreErrInfo_struct; |
| 113 | typedef struct _ErrorInfo_struct { |
| 114 | BYTE ScsiStatus; |
| 115 | BYTE SenseLen; |
| 116 | HWORD CommandStatus; |
| 117 | DWORD ResidualCnt; |
| 118 | MoreErrInfo_struct MoreErrInfo; |
| 119 | BYTE SenseInfo[SENSEINFOBYTES]; |
| 120 | } ErrorInfo_struct; |
| 121 | #pragma pack() |
| 122 | #endif |