1 typedef struct scsi_request Scsi_Request
;
3 static Scsi_Request
*dummy_cmdp
; /* only used for sizeof */
5 typedef struct sg_scatter_hold
{ /* holding area for scsi scatter gather info */
6 unsigned short k_use_sg
; /* Count of kernel scatter-gather pieces */
7 unsigned short sglist_len
; /* size of malloc'd scatter-gather list ++ */
8 unsigned bufflen
; /* Size of (aggregate) data buffer */
9 unsigned b_malloc_len
; /* actual len malloc'ed in buffer */
10 void *buffer
; /* Data buffer or scatter list (k_use_sg>0) */
11 char dio_in_use
; /* 0->indirect IO (or mmap), 1->dio */
12 unsigned char cmd_opcode
; /* first byte of command */
15 typedef struct sg_request
{ /* SG_MAX_QUEUE requests outstanding per file */
16 Scsi_Request
*my_cmdp
; /* != 0 when request with lower levels */
17 struct sg_request
*nextrp
; /* NULL -> tail request (slist) */
18 struct sg_fd
*parentfp
; /* NULL -> not in use */
19 Sg_scatter_hold data
; /* hold buffer, perhaps scatter list */
20 sg_io_hdr_t header
; /* scsi command+info, see <scsi/sg.h> */
21 unsigned char sense_b
[sizeof (dummy_cmdp
->sr_sense_buffer
)];
22 char res_used
; /* 1 -> using reserve buffer, 0 -> not ... */
23 char orphan
; /* 1 -> drop on sight, 0 -> normal */
24 char sg_io_owned
; /* 1 -> packet belongs to SG_IO */
25 volatile char done
; /* 0->before bh, 1->before read, 2->read */