summaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2015-07-08 10:58:52 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2015-07-24 01:10:39 -0400
commit7708c1656552ddd60b9b9df3a9ee156acd1801ba (patch)
tree732a2e11a99a90fbd601c64b3955f02b6bc8a05f /include/scsi
parentab78fef4d5f79134042ae0e1e2c259e1226aa5bd (diff)
scsi: Move sense handling routines to scsi_common
Sense data handling is also done in the target stack. Hence, move sense handling routines to scsi_common so the target will be able to use them as well. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/scsi_common.h5
-rw-r--r--include/scsi/scsi_eh.h7
2 files changed, 6 insertions, 6 deletions
diff --git a/include/scsi/scsi_common.h b/include/scsi/scsi_common.h
index 676b03b78e57..156d673db900 100644
--- a/include/scsi/scsi_common.h
+++ b/include/scsi/scsi_common.h
@@ -61,4 +61,9 @@ static inline bool scsi_sense_valid(const struct scsi_sense_hdr *sshdr)
61extern bool scsi_normalize_sense(const u8 *sense_buffer, int sb_len, 61extern bool scsi_normalize_sense(const u8 *sense_buffer, int sb_len,
62 struct scsi_sense_hdr *sshdr); 62 struct scsi_sense_hdr *sshdr);
63 63
64extern void scsi_build_sense_buffer(int desc, u8 *buf, u8 key, u8 asc, u8 ascq);
65extern void scsi_set_sense_information(u8 *buf, u64 info);
66extern const u8 * scsi_sense_desc_find(const u8 * sense_buffer, int sb_len,
67 int desc_type);
68
64#endif /* _SCSI_COMMON_H_ */ 69#endif /* _SCSI_COMMON_H_ */
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
index 4942710ef720..dbb8c640e26f 100644
--- a/include/scsi/scsi_eh.h
+++ b/include/scsi/scsi_eh.h
@@ -4,6 +4,7 @@
4#include <linux/scatterlist.h> 4#include <linux/scatterlist.h>
5 5
6#include <scsi/scsi_cmnd.h> 6#include <scsi/scsi_cmnd.h>
7#include <scsi/scsi_common.h>
7struct scsi_device; 8struct scsi_device;
8struct Scsi_Host; 9struct Scsi_Host;
9 10
@@ -21,15 +22,9 @@ static inline bool scsi_sense_is_deferred(const struct scsi_sense_hdr *sshdr)
21 return ((sshdr->response_code >= 0x70) && (sshdr->response_code & 1)); 22 return ((sshdr->response_code >= 0x70) && (sshdr->response_code & 1));
22} 23}
23 24
24extern const u8 * scsi_sense_desc_find(const u8 * sense_buffer, int sb_len,
25 int desc_type);
26
27extern int scsi_get_sense_info_fld(const u8 * sense_buffer, int sb_len, 25extern int scsi_get_sense_info_fld(const u8 * sense_buffer, int sb_len,
28 u64 * info_out); 26 u64 * info_out);
29 27
30extern void scsi_build_sense_buffer(int desc, u8 *buf, u8 key, u8 asc, u8 ascq);
31extern void scsi_set_sense_information(u8 *buf, u64 info);
32
33extern int scsi_ioctl_reset(struct scsi_device *, int __user *); 28extern int scsi_ioctl_reset(struct scsi_device *, int __user *);
34 29
35struct scsi_eh_save { 30struct scsi_eh_save {