diff options
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/scsi_device.h | 13 | ||||
-rw-r--r-- | include/scsi/scsi_eh.h | 8 | ||||
-rw-r--r-- | include/scsi/scsi_request.h | 4 |
3 files changed, 21 insertions, 4 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 9181068883ce..5ad08b70763c 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -256,6 +256,19 @@ extern void int_to_scsilun(unsigned int, struct scsi_lun *); | |||
256 | extern const char *scsi_device_state_name(enum scsi_device_state); | 256 | extern const char *scsi_device_state_name(enum scsi_device_state); |
257 | extern int scsi_is_sdev_device(const struct device *); | 257 | extern int scsi_is_sdev_device(const struct device *); |
258 | extern int scsi_is_target_device(const struct device *); | 258 | extern int scsi_is_target_device(const struct device *); |
259 | extern int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, | ||
260 | int data_direction, void *buffer, unsigned bufflen, | ||
261 | unsigned char *sense, int timeout, int retries, | ||
262 | int flag); | ||
263 | |||
264 | static inline int | ||
265 | scsi_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 | } | ||
259 | static inline int scsi_device_online(struct scsi_device *sdev) | 272 | static inline int scsi_device_online(struct scsi_device *sdev) |
260 | { | 273 | { |
261 | return sdev->sdev_state != SDEV_OFFLINE; | 274 | return sdev->sdev_state != SDEV_OFFLINE; |
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h index 80557f879e3e..b24d224281bd 100644 --- a/include/scsi/scsi_eh.h +++ b/include/scsi/scsi_eh.h | |||
@@ -26,6 +26,14 @@ struct scsi_sense_hdr { /* See SPC-3 section 4.5 */ | |||
26 | u8 additional_length; /* always 0 for fixed sense format */ | 26 | u8 additional_length; /* always 0 for fixed sense format */ |
27 | }; | 27 | }; |
28 | 28 | ||
29 | static inline int scsi_sense_valid(struct scsi_sense_hdr *sshdr) | ||
30 | { | ||
31 | if (!sshdr) | ||
32 | return 0; | ||
33 | |||
34 | return (sshdr->response_code & 0x70) == 0x70; | ||
35 | } | ||
36 | |||
29 | 37 | ||
30 | extern void scsi_add_timer(struct scsi_cmnd *, int, | 38 | extern void scsi_add_timer(struct scsi_cmnd *, int, |
31 | void (*)(struct scsi_cmnd *)); | 39 | void (*)(struct scsi_cmnd *)); |
diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h index f5dfdfec9fea..6a140020d7cb 100644 --- a/include/scsi/scsi_request.h +++ b/include/scsi/scsi_request.h | |||
@@ -54,8 +54,4 @@ extern void scsi_do_req(struct scsi_request *, const void *cmnd, | |||
54 | void *buffer, unsigned bufflen, | 54 | void *buffer, unsigned bufflen, |
55 | void (*done) (struct scsi_cmnd *), | 55 | void (*done) (struct scsi_cmnd *), |
56 | int timeout, int retries); | 56 | int timeout, int retries); |
57 | extern int scsi_execute_req(struct scsi_device *sdev, unsigned char *cmd, | ||
58 | int data_direction, void *buffer, unsigned bufflen, | ||
59 | unsigned char *sense, int timeout, int retries); | ||
60 | |||
61 | #endif /* _SCSI_SCSI_REQUEST_H */ | 57 | #endif /* _SCSI_SCSI_REQUEST_H */ |