aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJames Bottomley <jejb@titanic.(none)>2005-08-28 12:33:52 -0400
committerJames Bottomley <jejb@titanic.(none)>2005-08-28 12:33:52 -0400
commitea73a9f23906c374b697cd5b0d64f6dceced63de (patch)
treec000be3180caccc6d484aad0f82f58d733358622 /include
parent33aa687db90dd8541bd5e9a762eebf880eaee767 (diff)
[SCSI] convert sd to scsi_execute_req (and update the scsi_execute_req API)
This one removes struct scsi_request entirely from sd. In the process, I noticed we have no callers of scsi_wait_req who don't immediately normalise the sense, so I updated the API to make it take a struct scsi_sense_hdr instead of simply a big sense buffer. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include')
-rw-r--r--include/scsi/scsi_dbg.h2
-rw-r--r--include/scsi/scsi_device.h14
2 files changed, 7 insertions, 9 deletions
diff --git a/include/scsi/scsi_dbg.h b/include/scsi/scsi_dbg.h
index 12e90934a7a8..b090a11d7e1c 100644
--- a/include/scsi/scsi_dbg.h
+++ b/include/scsi/scsi_dbg.h
@@ -3,8 +3,10 @@
3 3
4struct scsi_cmnd; 4struct scsi_cmnd;
5struct scsi_request; 5struct scsi_request;
6struct scsi_sense_hdr;
6 7
7extern void scsi_print_command(struct scsi_cmnd *); 8extern void scsi_print_command(struct scsi_cmnd *);
9extern void scsi_print_sense_hdr(const char *, struct scsi_sense_hdr *);
8extern void __scsi_print_command(unsigned char *); 10extern void __scsi_print_command(unsigned char *);
9extern void scsi_print_sense(const char *, struct scsi_cmnd *); 11extern void scsi_print_sense(const char *, struct scsi_cmnd *);
10extern void scsi_print_req_sense(const char *, struct scsi_request *); 12extern void scsi_print_req_sense(const char *, struct scsi_request *);
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 5ad08b70763c..da63722c0123 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -9,6 +9,7 @@
9struct request_queue; 9struct request_queue;
10struct scsi_cmnd; 10struct scsi_cmnd;
11struct scsi_lun; 11struct scsi_lun;
12struct scsi_sense_hdr;
12 13
13struct scsi_mode_data { 14struct scsi_mode_data {
14 __u32 length; 15 __u32 length;
@@ -237,7 +238,7 @@ extern int scsi_set_medium_removal(struct scsi_device *, char);
237extern int scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, 238extern int scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
238 unsigned char *buffer, int len, int timeout, 239 unsigned char *buffer, int len, int timeout,
239 int retries, struct scsi_mode_data *data, 240 int retries, struct scsi_mode_data *data,
240 char *sense); 241 struct scsi_sense_hdr *);
241extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, 242extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout,
242 int retries); 243 int retries);
243extern int scsi_device_set_state(struct scsi_device *sdev, 244extern int scsi_device_set_state(struct scsi_device *sdev,
@@ -260,15 +261,10 @@ extern int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
260 int data_direction, void *buffer, unsigned bufflen, 261 int data_direction, void *buffer, unsigned bufflen,
261 unsigned char *sense, int timeout, int retries, 262 unsigned char *sense, int timeout, int retries,
262 int flag); 263 int flag);
264extern int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd,
265 int data_direction, void *buffer, unsigned bufflen,
266 struct scsi_sense_hdr *, int timeout, int retries);
263 267
264static inline int
265scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd,
266 int data_direction, void *buffer, unsigned bufflen,
267 unsigned char *sense, int timeout, int retries)
268{
269 return scsi_execute(sdev, cmd, data_direction, buffer, bufflen, sense,
270 timeout, retries, 0);
271}
272static inline int scsi_device_online(struct scsi_device *sdev) 268static inline int scsi_device_online(struct scsi_device *sdev)
273{ 269{
274 return sdev->sdev_state != SDEV_OFFLINE; 270 return sdev->sdev_state != SDEV_OFFLINE;