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.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index f6a9fe0ef09c..6467f78b191f 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -134,6 +134,7 @@ struct scsi_device {
134 unsigned no_start_on_add:1; /* do not issue start on add */ 134 unsigned no_start_on_add:1; /* do not issue start on add */
135 unsigned allow_restart:1; /* issue START_UNIT in error handler */ 135 unsigned allow_restart:1; /* issue START_UNIT in error handler */
136 unsigned manage_start_stop:1; /* Let HLD (sd) manage start/stop */ 136 unsigned manage_start_stop:1; /* Let HLD (sd) manage start/stop */
137 unsigned start_stop_pwr_cond:1; /* Set power cond. in START_STOP_UNIT */
137 unsigned no_uld_attach:1; /* disable connecting to upper level drivers */ 138 unsigned no_uld_attach:1; /* disable connecting to upper level drivers */
138 unsigned select_no_atn:1; 139 unsigned select_no_atn:1;
139 unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */ 140 unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */
@@ -161,9 +162,29 @@ struct scsi_device {
161 162
162 struct execute_work ew; /* used to get process context on put */ 163 struct execute_work ew; /* used to get process context on put */
163 164
165 struct scsi_dh_data *scsi_dh_data;
164 enum scsi_device_state sdev_state; 166 enum scsi_device_state sdev_state;
165 unsigned long sdev_data[0]; 167 unsigned long sdev_data[0];
166} __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
167#define to_scsi_device(d) \ 188#define to_scsi_device(d) \
168 container_of(d, struct scsi_device, sdev_gendev) 189 container_of(d, struct scsi_device, sdev_gendev)
169#define class_to_sdev(d) \ 190#define class_to_sdev(d) \
@@ -230,7 +251,9 @@ extern struct scsi_device *__scsi_add_device(struct Scsi_Host *,
230 uint, uint, uint, void *hostdata); 251 uint, uint, uint, void *hostdata);
231extern int scsi_add_device(struct Scsi_Host *host, uint channel, 252extern int scsi_add_device(struct Scsi_Host *host, uint channel,
232 uint target, uint lun); 253 uint target, uint lun);
254extern int scsi_register_device_handler(struct scsi_device_handler *scsi_dh);
233extern 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);
234 257
235extern int scsi_device_get(struct scsi_device *); 258extern int scsi_device_get(struct scsi_device *);
236extern void scsi_device_put(struct scsi_device *); 259extern void scsi_device_put(struct scsi_device *);