diff options
Diffstat (limited to 'include/scsi/scsi_device.h')
-rw-r--r-- | include/scsi/scsi_device.h | 22 |
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 | |||
170 | struct 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 | |||
183 | struct 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); |
232 | extern int scsi_add_device(struct Scsi_Host *host, uint channel, | 252 | extern int scsi_add_device(struct Scsi_Host *host, uint channel, |
233 | uint target, uint lun); | 253 | uint target, uint lun); |
254 | extern int scsi_register_device_handler(struct scsi_device_handler *scsi_dh); | ||
234 | extern void scsi_remove_device(struct scsi_device *); | 255 | extern void scsi_remove_device(struct scsi_device *); |
256 | extern int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh); | ||
235 | 257 | ||
236 | extern int scsi_device_get(struct scsi_device *); | 258 | extern int scsi_device_get(struct scsi_device *); |
237 | extern void scsi_device_put(struct scsi_device *); | 259 | extern void scsi_device_put(struct scsi_device *); |