aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_device.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi/scsi_device.h')
-rw-r--r--include/scsi/scsi_device.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 00b78763a1bf..6467f78b191f 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -162,9 +162,29 @@ struct scsi_device {
162 162
163 struct execute_work ew; /* used to get process context on put */ 163 struct execute_work ew; /* used to get process context on put */
164 164
165 struct scsi_dh_data *scsi_dh_data;
165 enum scsi_device_state sdev_state; 166 enum scsi_device_state sdev_state;
166 unsigned long sdev_data[0]; 167 unsigned long sdev_data[0];
167} __attribute__((aligned(sizeof(unsigned long)))); 168} __attribute__((aligned(sizeof(unsigned long))));
169
170struct scsi_device_handler {
171 /* Used by the infrastructure */
172 struct list_head list; /* list of scsi_device_handlers */
173 struct notifier_block nb;
174
175 /* Filled by the hardware handler */
176 struct module *module;
177 const char *name;
178 int (*check_sense)(struct scsi_device *, struct scsi_sense_hdr *);
179 int (*activate)(struct scsi_device *);
180 int (*prep_fn)(struct scsi_device *, struct request *);
181};
182
183struct scsi_dh_data {
184 struct scsi_device_handler *scsi_dh;
185 char buf[0];
186};
187
168#define to_scsi_device(d) \ 188#define to_scsi_device(d) \
169 container_of(d, struct scsi_device, sdev_gendev) 189 container_of(d, struct scsi_device, sdev_gendev)
170#define class_to_sdev(d) \ 190#define class_to_sdev(d) \
@@ -231,7 +251,9 @@ extern struct scsi_device *__scsi_add_device(struct Scsi_Host *,
231 uint, uint, uint, void *hostdata); 251 uint, uint, uint, void *hostdata);
232extern int scsi_add_device(struct Scsi_Host *host, uint channel, 252extern int scsi_add_device(struct Scsi_Host *host, uint channel,
233 uint target, uint lun); 253 uint target, uint lun);
254extern int scsi_register_device_handler(struct scsi_device_handler *scsi_dh);
234extern void scsi_remove_device(struct scsi_device *); 255extern void scsi_remove_device(struct scsi_device *);
256extern int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh);
235 257
236extern int scsi_device_get(struct scsi_device *); 258extern int scsi_device_get(struct scsi_device *);
237extern void scsi_device_put(struct scsi_device *); 259extern void scsi_device_put(struct scsi_device *);