| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [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 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #define CMD_SUCCESS 0x0000 | 
 | 24 | #define CMD_TARGET_STATUS 0x0001 | 
 | 25 | #define CMD_DATA_UNDERRUN 0x0002 | 
 | 26 | #define CMD_DATA_OVERRUN 0x0003 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #define CMD_INVALID 0x0004 | 
 | 28 | #define CMD_PROTOCOL_ERR 0x0005 | 
 | 29 | #define CMD_HARDWARE_ERR 0x0006 | 
 | 30 | #define CMD_CONNECTION_LOST 0x0007 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | #define CMD_ABORTED 0x0008 | 
 | 32 | #define CMD_ABORT_FAILED 0x0009 | 
 | 33 | #define CMD_UNSOLICITED_ABORT 0x000A | 
 | 34 | #define CMD_TIMEOUT 0x000B | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | #define CMD_UNABORTABLE 0x000C | 
 | 36 | #define XFER_NONE 0x00 | 
 | 37 | #define XFER_WRITE 0x01 | 
 | 38 | #define XFER_READ 0x02 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | #define XFER_RSVD 0x03 | 
 | 40 | #define ATTR_UNTAGGED 0x00 | 
 | 41 | #define ATTR_SIMPLE 0x04 | 
 | 42 | #define ATTR_HEADOFQUEUE 0x05 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 43 | #define ATTR_ORDERED 0x06 | 
 | 44 | #define ATTR_ACA 0x07 | 
 | 45 | #define TYPE_CMD 0x00 | 
 | 46 | #define TYPE_MSG 0x01 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 47 | #define BYTE __u8 | 
 | 48 | #define WORD __u16 | 
 | 49 | #define HWORD __u16 | 
 | 50 | #define DWORD __u32 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | #define CISS_MAX_LUN 1024 | 
 | 52 | #define LEVEL2LUN 1 | 
 | 53 | #define LEVEL3LUN 0 | 
 | 54 | #pragma pack(1) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | typedef union _SCSI3Addr_struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 56 |   struct { | 
 | 57 |     BYTE Dev; | 
 | 58 |     BYTE Bus : 6; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 59 |     BYTE Mode : 2; | 
 | 60 |   } PeripDev; | 
 | 61 |   struct { | 
 | 62 |     BYTE DevLSB; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 63 |     BYTE DevMSB : 6; | 
 | 64 |     BYTE Mode : 2; | 
 | 65 |   } LogDev; | 
 | 66 |   struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 67 |     BYTE Dev : 5; | 
 | 68 |     BYTE Bus : 3; | 
 | 69 |     BYTE Targ : 6; | 
 | 70 |     BYTE Mode : 2; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 |   } LogUnit; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 72 | } SCSI3Addr_struct; | 
 | 73 | typedef struct _PhysDevAddr_struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 74 |   DWORD TargetId : 24; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 75 |   DWORD Bus : 6; | 
 | 76 |   DWORD Mode : 2; | 
 | 77 |   SCSI3Addr_struct Target[2]; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 78 | } PhysDevAddr_struct; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 79 | typedef struct _LogDevAddr_struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 80 |   DWORD VolId : 30; | 
 | 81 |   DWORD Mode : 2; | 
 | 82 |   BYTE reserved[4]; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 83 | } LogDevAddr_struct; | 
 | 84 | typedef union _LUNAddr_struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 85 |   BYTE LunAddrBytes[8]; | 
 | 86 |   SCSI3Addr_struct SCSI3Lun[4]; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 87 |   PhysDevAddr_struct PhysDev; | 
 | 88 |   LogDevAddr_struct LogDev; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 89 | } LUNAddr_struct; | 
 | 90 | typedef struct _RequestBlock_struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 91 |   BYTE CDBLen; | 
 | 92 |   struct { | 
 | 93 |     BYTE Type : 3; | 
 | 94 |     BYTE Attribute : 3; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 95 |     BYTE Direction : 2; | 
 | 96 |   } Type; | 
 | 97 |   HWORD Timeout; | 
 | 98 |   BYTE CDB[16]; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 99 | } RequestBlock_struct; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 100 | typedef union _MoreErrInfo_struct { | 
 | 101 |   struct { | 
 | 102 |     BYTE Reserved[3]; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 103 |     BYTE Type; | 
 | 104 |     DWORD ErrorInfo; | 
 | 105 |   } Common_Info; | 
 | 106 |   struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 107 |     BYTE Reserved[2]; | 
 | 108 |     BYTE offense_size; | 
 | 109 |     BYTE offense_num; | 
 | 110 |     DWORD offense_value; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 111 |   } Invalid_Cmd; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 112 | } MoreErrInfo_struct; | 
 | 113 | typedef struct _ErrorInfo_struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 114 |   BYTE ScsiStatus; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 115 |   BYTE SenseLen; | 
 | 116 |   HWORD CommandStatus; | 
 | 117 |   DWORD ResidualCnt; | 
 | 118 |   MoreErrInfo_struct MoreErrInfo; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 119 |   BYTE SenseInfo[SENSEINFOBYTES]; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 120 | } ErrorInfo_struct; | 
 | 121 | #pragma pack() | 
 | 122 | #endif |