aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_device.h
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2008-07-17 19:52:51 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-26 15:14:51 -0400
commit765cbc6dad16b87724803e359d6be792ddf08614 (patch)
tree2cedfbe6b55c9f7a3e4cc3fb4f0d1f4d9d18f625 /include/scsi/scsi_device.h
parent6d49f63b415ca02223e01e187076cb69a5a38eaf (diff)
[SCSI] scsi_dh: Implement common device table handling
Instead of having each and every driver implement its own device table scanning code we should rather implement a common routine and scan the device tables there. This allows us also to implement a general notifier chain callback for all device handler instead for one per handler. [sekharan: Fix rejections caused by conflicting bug fix] Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi/scsi_device.h')
-rw-r--r--include/scsi/scsi_device.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 6467f78b191f..4deb9349eebf 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -167,15 +167,22 @@ struct scsi_device {
167 unsigned long sdev_data[0]; 167 unsigned long sdev_data[0];
168} __attribute__((aligned(sizeof(unsigned long)))); 168} __attribute__((aligned(sizeof(unsigned long))));
169 169
170struct scsi_dh_devlist {
171 char *vendor;
172 char *model;
173};
174
170struct scsi_device_handler { 175struct scsi_device_handler {
171 /* Used by the infrastructure */ 176 /* Used by the infrastructure */
172 struct list_head list; /* list of scsi_device_handlers */ 177 struct list_head list; /* list of scsi_device_handlers */
173 struct notifier_block nb;
174 178
175 /* Filled by the hardware handler */ 179 /* Filled by the hardware handler */
176 struct module *module; 180 struct module *module;
177 const char *name; 181 const char *name;
182 const struct scsi_dh_devlist *devlist;
178 int (*check_sense)(struct scsi_device *, struct scsi_sense_hdr *); 183 int (*check_sense)(struct scsi_device *, struct scsi_sense_hdr *);
184 int (*attach)(struct scsi_device *);
185 void (*detach)(struct scsi_device *);
179 int (*activate)(struct scsi_device *); 186 int (*activate)(struct scsi_device *);
180 int (*prep_fn)(struct scsi_device *, struct request *); 187 int (*prep_fn)(struct scsi_device *, struct request *);
181}; 188};