aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/iscsi_proto.h6
-rw-r--r--include/scsi/libsas.h2
-rw-r--r--include/scsi/sas_ata.h4
-rw-r--r--include/scsi/scsi_cmnd.h17
-rw-r--r--include/scsi/scsi_eh.h5
-rw-r--r--include/scsi/scsi_host.h1
6 files changed, 30 insertions, 5 deletions
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index 5ffec8ad6964..e0593bfae622 100644
--- a/include/scsi/iscsi_proto.h
+++ b/include/scsi/iscsi_proto.h
@@ -112,6 +112,7 @@ struct iscsi_ahs_hdr {
112 112
113#define ISCSI_AHSTYPE_CDB 1 113#define ISCSI_AHSTYPE_CDB 1
114#define ISCSI_AHSTYPE_RLENGTH 2 114#define ISCSI_AHSTYPE_RLENGTH 2
115#define ISCSI_CDB_SIZE 16
115 116
116/* iSCSI PDU Header */ 117/* iSCSI PDU Header */
117struct iscsi_cmd { 118struct iscsi_cmd {
@@ -125,7 +126,7 @@ struct iscsi_cmd {
125 __be32 data_length; 126 __be32 data_length;
126 __be32 cmdsn; 127 __be32 cmdsn;
127 __be32 exp_statsn; 128 __be32 exp_statsn;
128 uint8_t cdb[16]; /* SCSI Command Block */ 129 uint8_t cdb[ISCSI_CDB_SIZE]; /* SCSI Command Block */
129 /* Additional Data (Command Dependent) */ 130 /* Additional Data (Command Dependent) */
130}; 131};
131 132
@@ -154,7 +155,8 @@ struct iscsi_ecdb_ahdr {
154 __be16 ahslength; /* CDB length - 15, including reserved byte */ 155 __be16 ahslength; /* CDB length - 15, including reserved byte */
155 uint8_t ahstype; 156 uint8_t ahstype;
156 uint8_t reserved; 157 uint8_t reserved;
157 uint8_t ecdb[260 - 16]; /* 4-byte aligned extended CDB spillover */ 158 /* 4-byte aligned extended CDB spillover */
159 uint8_t ecdb[260 - ISCSI_CDB_SIZE];
158}; 160};
159 161
160/* SCSI Response Header */ 162/* SCSI Response Header */
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 39e1cac24bb7..98724ba65a79 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -677,4 +677,6 @@ extern void sas_ssp_task_response(struct device *dev, struct sas_task *task,
677 struct ssp_response_iu *iu); 677 struct ssp_response_iu *iu);
678struct sas_phy *sas_find_local_phy(struct domain_device *dev); 678struct sas_phy *sas_find_local_phy(struct domain_device *dev);
679 679
680int sas_request_addr(struct Scsi_Host *shost, u8 *addr);
681
680#endif /* _SASLIB_H_ */ 682#endif /* _SASLIB_H_ */
diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h
index dd5edc915417..c583193ae929 100644
--- a/include/scsi/sas_ata.h
+++ b/include/scsi/sas_ata.h
@@ -47,12 +47,12 @@ static inline int dev_is_sata(struct domain_device *dev)
47{ 47{
48 return 0; 48 return 0;
49} 49}
50int sas_ata_init_host_and_port(struct domain_device *found_dev, 50static inline int sas_ata_init_host_and_port(struct domain_device *found_dev,
51 struct scsi_target *starget) 51 struct scsi_target *starget)
52{ 52{
53 return 0; 53 return 0;
54} 54}
55void sas_ata_task_abort(struct sas_task *task) 55static inline void sas_ata_task_abort(struct sas_task *task)
56{ 56{
57} 57}
58#endif 58#endif
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index de28aab820b0..8d20e60a94b7 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -130,6 +130,9 @@ extern void scsi_release_buffers(struct scsi_cmnd *cmd);
130extern int scsi_dma_map(struct scsi_cmnd *cmd); 130extern int scsi_dma_map(struct scsi_cmnd *cmd);
131extern void scsi_dma_unmap(struct scsi_cmnd *cmd); 131extern void scsi_dma_unmap(struct scsi_cmnd *cmd);
132 132
133struct scsi_cmnd *scsi_allocate_command(gfp_t gfp_mask);
134void scsi_free_command(gfp_t gfp_mask, struct scsi_cmnd *cmd);
135
133static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd) 136static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd)
134{ 137{
135 return cmd->sdb.table.nents; 138 return cmd->sdb.table.nents;
@@ -175,4 +178,18 @@ static inline struct scsi_data_buffer *scsi_out(struct scsi_cmnd *cmd)
175 return &cmd->sdb; 178 return &cmd->sdb;
176} 179}
177 180
181static inline int scsi_sg_copy_from_buffer(struct scsi_cmnd *cmd,
182 void *buf, int buflen)
183{
184 return sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd),
185 buf, buflen);
186}
187
188static inline int scsi_sg_copy_to_buffer(struct scsi_cmnd *cmd,
189 void *buf, int buflen)
190{
191 return sg_copy_to_buffer(scsi_sglist(cmd), scsi_sg_count(cmd),
192 buf, buflen);
193}
194
178#endif /* _SCSI_SCSI_CMND_H */ 195#endif /* _SCSI_SCSI_CMND_H */
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
index 25071d5d9bf8..d3a133b4a072 100644
--- a/include/scsi/scsi_eh.h
+++ b/include/scsi/scsi_eh.h
@@ -57,13 +57,16 @@ extern const u8 * scsi_sense_desc_find(const u8 * sense_buffer, int sb_len,
57 57
58extern int scsi_get_sense_info_fld(const u8 * sense_buffer, int sb_len, 58extern int scsi_get_sense_info_fld(const u8 * sense_buffer, int sb_len,
59 u64 * info_out); 59 u64 * info_out);
60 60
61extern void scsi_build_sense_buffer(int desc, u8 *buf, u8 key, u8 asc, u8 ascq);
62
61/* 63/*
62 * Reset request from external source 64 * Reset request from external source
63 */ 65 */
64#define SCSI_TRY_RESET_DEVICE 1 66#define SCSI_TRY_RESET_DEVICE 1
65#define SCSI_TRY_RESET_BUS 2 67#define SCSI_TRY_RESET_BUS 2
66#define SCSI_TRY_RESET_HOST 3 68#define SCSI_TRY_RESET_HOST 3
69#define SCSI_TRY_RESET_TARGET 4
67 70
68extern int scsi_reset_provider(struct scsi_device *, int); 71extern int scsi_reset_provider(struct scsi_device *, int);
69 72
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 530ff4c553f8..49132862bfaa 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -172,6 +172,7 @@ struct scsi_host_template {
172 */ 172 */
173 int (* eh_abort_handler)(struct scsi_cmnd *); 173 int (* eh_abort_handler)(struct scsi_cmnd *);
174 int (* eh_device_reset_handler)(struct scsi_cmnd *); 174 int (* eh_device_reset_handler)(struct scsi_cmnd *);
175 int (* eh_target_reset_handler)(struct scsi_cmnd *);
175 int (* eh_bus_reset_handler)(struct scsi_cmnd *); 176 int (* eh_bus_reset_handler)(struct scsi_cmnd *);
176 int (* eh_host_reset_handler)(struct scsi_cmnd *); 177 int (* eh_host_reset_handler)(struct scsi_cmnd *);
177 178