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.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 6467f78b191..291d56a1916 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -140,7 +140,8 @@ struct scsi_device {
140 unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */ 140 unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */
141 unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */ 141 unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */
142 unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ 142 unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */
143 unsigned last_sector_bug:1; /* Always read last sector in a 1 sector read */ 143 unsigned last_sector_bug:1; /* do not use multisector accesses on
144 SD_LAST_BUGGY_SECTORS */
144 145
145 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ 146 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
146 struct list_head event_list; /* asserted events */ 147 struct list_head event_list; /* asserted events */
@@ -167,15 +168,22 @@ struct scsi_device {
167 unsigned long sdev_data[0]; 168 unsigned long sdev_data[0];
168} __attribute__((aligned(sizeof(unsigned long)))); 169} __attribute__((aligned(sizeof(unsigned long))));
169 170
171struct scsi_dh_devlist {
172 char *vendor;
173 char *model;
174};
175
170struct scsi_device_handler { 176struct scsi_device_handler {
171 /* Used by the infrastructure */ 177 /* Used by the infrastructure */
172 struct list_head list; /* list of scsi_device_handlers */ 178 struct list_head list; /* list of scsi_device_handlers */
173 struct notifier_block nb;
174 179
175 /* Filled by the hardware handler */ 180 /* Filled by the hardware handler */
176 struct module *module; 181 struct module *module;
177 const char *name; 182 const char *name;
183 const struct scsi_dh_devlist *devlist;
178 int (*check_sense)(struct scsi_device *, struct scsi_sense_hdr *); 184 int (*check_sense)(struct scsi_device *, struct scsi_sense_hdr *);
185 int (*attach)(struct scsi_device *);
186 void (*detach)(struct scsi_device *);
179 int (*activate)(struct scsi_device *); 187 int (*activate)(struct scsi_device *);
180 int (*prep_fn)(struct scsi_device *, struct request *); 188 int (*prep_fn)(struct scsi_device *, struct request *);
181}; 189};
@@ -416,6 +424,11 @@ static inline int scsi_device_enclosure(struct scsi_device *sdev)
416 return sdev->inquiry[6] & (1<<6); 424 return sdev->inquiry[6] & (1<<6);
417} 425}
418 426
427static inline int scsi_device_protection(struct scsi_device *sdev)
428{
429 return sdev->inquiry[5] & (1<<0);
430}
431
419#define MODULE_ALIAS_SCSI_DEVICE(type) \ 432#define MODULE_ALIAS_SCSI_DEVICE(type) \
420 MODULE_ALIAS("scsi:t-" __stringify(type) "*") 433 MODULE_ALIAS("scsi:t-" __stringify(type) "*")
421#define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x" 434#define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x"