4 #define SG_DXFER_NONE -1
5 #define SG_DXFER_TO_DEV -2
6 #define SG_DXFER_FROM_DEV -3
7 #define SG_DXFER_TO_FROM_DEV -4
8 #define SG_FLAG_DIRECT_IO 1
9 #define SG_FLAG_LUN_INHIBIT 2
10 #define SG_FLAG_NO_DXFER 0x10000
11 #define SG_INFO_OK_MASK 0x1
12 #define SG_INFO_OK 0x0
13 #define SG_INFO_CHECK 0x1
14 #define SG_INFO_DIRECT_IO_MASK 0x6
15 #define SG_INFO_INDIRECT_IO 0x0
16 #define SG_INFO_DIRECT_IO 0x2
17 #define SG_INFO_MIXED_IO 0x4
18 #define SG_EMULATED_HOST 0x2203
19 #define SG_SET_TRANSFORM 0x2204
20 #define SG_GET_TRANSFORM 0x2205
21 #define SG_SET_RESERVED_SIZE 0x2275
22 #define SG_GET_RESERVED_SIZE 0x2272
23 #define SG_GET_SCSI_ID 0x2276
24 #define SG_SET_FORCE_LOW_DMA 0x2279
25 #define SG_GET_LOW_DMA 0x227a
26 #define SG_SET_FORCE_PACK_ID 0x227b
27 #define SG_GET_PACK_ID 0x227c
28 #define SG_GET_NUM_WAITING 0x227d
29 #define SG_GET_SG_TABLESIZE 0x227F
30 #define SG_GET_VERSION_NUM 0x2282
31 #define SG_SCSI_RESET 0x2284
32 #define SG_SCSI_RESET_NOTHING 0
33 #define SG_SCSI_RESET_DEVICE 1
34 #define SG_SCSI_RESET_BUS 2
35 #define SG_SCSI_RESET_HOST 3
37 #define SG_GET_REQUEST_TABLE 0x2286
38 #define SG_SET_KEEP_ORPHAN 0x2287
39 #define SG_GET_KEEP_ORPHAN 0x2288
40 #define SG_SCATTER_SZ (8 * 4096)
41 #define SG_DEFAULT_RETRIES 1
42 #define SG_DEF_FORCE_LOW_DMA 0
43 #define SG_DEF_FORCE_PACK_ID 0
44 #define SG_DEF_KEEP_ORPHAN 0
45 #define SG_DEF_RESERVED_SIZE SG_SCATTER_SZ
46 #define SG_MAX_QUEUE 16
47 #define SG_BIG_BUFF SG_DEF_RESERVED_SIZE
48 #define SG_MAX_SENSE 16
49 #define SG_SET_TIMEOUT 0x2201
50 #define SG_GET_TIMEOUT 0x2202
51 #define SG_GET_COMMAND_Q 0x2270
52 #define SG_SET_COMMAND_Q 0x2271
53 #define SG_SET_DEBUG 0x227e
54 #define SG_NEXT_CMD_LEN 0x2283
55 #define SG_DEFAULT_TIMEOUT (60*100) /* 60*HZ */
56 #define SG_DEF_COMMAND_Q 0
57 #define SG_DEF_UNDERRUN_FLAG 0
59 typedef struct sg_iovec
{
61 unsigned long iov_len
;
64 typedef struct sg_io_hdr
{
67 unsigned char cmd_len
;
68 unsigned char mx_sb_len
;
69 unsigned short iovec_count
;
79 unsigned char masked_status
;
80 unsigned char msg_status
;
81 unsigned char sb_len_wr
;
82 unsigned short host_status
;
83 unsigned short driver_status
;
85 unsigned int duration
;
100 typedef struct sg_req_info
{
111 typedef struct sg_io_hdr Sg_io_hdr
;
112 typedef struct sg_io_vec Sg_io_vec
;
113 typedef struct sg_scsi_id Sg_scsi_id
;
114 typedef struct sg_req_info Sg_req_info
;
121 unsigned twelve_byte
:1;
122 unsigned target_status
:5;
123 unsigned host_status
:8;
124 unsigned driver_status
:8;
125 unsigned other_flags
:10;
126 unsigned char sense_buffer
[SG_MAX_SENSE
];