aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_device.h
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2014-03-15 04:51:49 -0400
committerJames Bottomley <JBottomley@Parallels.com>2014-03-27 11:25:33 -0400
commitb3ae8780b42918111387240762f470d5c1e269d6 (patch)
treef3791a3002248327f6f72a9335a275b123e06dab /include/scsi/scsi_device.h
parentbc8945df3c27e8edaa6a6de47cb20df7d12b80c8 (diff)
[SCSI] Add EVPD page 0x83 and 0x80 to sysfs
EVPD page 0x83 is used to uniquely identify the device. So instead of having each and every program issue a separate SG_IO call to retrieve this information it does make far more sense to display it in sysfs. Some older devices (most notably tapes) will only report reliable information in page 0x80 (Unit Serial Number). So export this in the sysfs attribute 'vpd_pg80'. [jejb: checkpatch fix] [hare: attach after transport configure] [fengguang.wu@intel.com: spotted problems with the original now fixed] Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'include/scsi/scsi_device.h')
-rw-r--r--include/scsi/scsi_device.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index ccabdc1c27ca..4e845b80efd3 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -113,6 +113,12 @@ struct scsi_device {
113 const char * vendor; /* [back_compat] point into 'inquiry' ... */ 113 const char * vendor; /* [back_compat] point into 'inquiry' ... */
114 const char * model; /* ... after scan; point to static string */ 114 const char * model; /* ... after scan; point to static string */
115 const char * rev; /* ... "nullnullnullnull" before scan */ 115 const char * rev; /* ... "nullnullnullnull" before scan */
116
117#define SCSI_VPD_PG_LEN 255
118 int vpd_pg83_len;
119 unsigned char *vpd_pg83;
120 int vpd_pg80_len;
121 unsigned char *vpd_pg80;
116 unsigned char current_tag; /* current tag */ 122 unsigned char current_tag; /* current tag */
117 struct scsi_target *sdev_target; /* used only for single_lun */ 123 struct scsi_target *sdev_target; /* used only for single_lun */
118 124
@@ -320,6 +326,7 @@ extern int scsi_add_device(struct Scsi_Host *host, uint channel,
320extern int scsi_register_device_handler(struct scsi_device_handler *scsi_dh); 326extern int scsi_register_device_handler(struct scsi_device_handler *scsi_dh);
321extern void scsi_remove_device(struct scsi_device *); 327extern void scsi_remove_device(struct scsi_device *);
322extern int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh); 328extern int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh);
329void scsi_attach_vpd(struct scsi_device *sdev);
323 330
324extern int scsi_device_get(struct scsi_device *); 331extern int scsi_device_get(struct scsi_device *);
325extern void scsi_device_put(struct scsi_device *); 332extern void scsi_device_put(struct scsi_device *);