1#ifndef _SCSI_SCSI_REQUEST_H
2#define _SCSI_SCSI_REQUEST_H
3
4#include <scsi/scsi_cmnd.h>
5
6struct request;
7struct scsi_cmnd;
8struct scsi_device;
9struct Scsi_Host;
10
11
12
13
14
15
16
17
18
19struct scsi_request {
20 int sr_magic;
21 int sr_result;
22 unsigned char sr_sense_buffer[SCSI_SENSE_BUFFERSIZE];
23
24
25
26
27 struct Scsi_Host *sr_host;
28 struct scsi_device *sr_device;
29 struct scsi_cmnd *sr_command;
30 struct request *sr_request;
31
32 unsigned sr_bufflen;
33 void *sr_buffer;
34 int sr_allowed;
35 enum dma_data_direction sr_data_direction;
36 unsigned char sr_cmd_len;
37 unsigned char sr_cmnd[MAX_COMMAND_SIZE];
38 void (*sr_done) (struct scsi_cmnd *);
39 int sr_timeout_per_command;
40 unsigned short sr_use_sg;
41 unsigned short sr_sglist_len;
42 unsigned sr_underflow;
43
44 void *upper_private_data;
45
46};
47
48extern struct scsi_request *scsi_allocate_request(struct scsi_device *, int);
49extern void scsi_release_request(struct scsi_request *);
50extern void scsi_wait_req(struct scsi_request *, const void *cmnd,
51 void *buffer, unsigned bufflen,
52 int timeout, int retries);
53extern void scsi_do_req(struct scsi_request *, const void *cmnd,
54 void *buffer, unsigned bufflen,
55 void (*done) (struct scsi_cmnd *),
56 int timeout, int retries);
57
58struct scsi_mode_data {
59 __u32 length;
60 __u16 block_descriptor_length;
61 __u8 medium_type;
62 __u8 device_specific;
63 __u8 header_length;
64 __u8 longlba:1;
65};
66
67extern int __scsi_mode_sense(struct scsi_request *SRpnt, int dbd,
68 int modepage, unsigned char *buffer, int len,
69 int timeout, int retries,
70 struct scsi_mode_data *data);
71
72
73#endif
74