Commit graph

23 commits

Author SHA1 Message Date
Hannes Reinecke db11b20e41 scsi_id: export target port group
For ALUA support it's useful to have the target port group number
of a device.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2010-09-07 08:22:05 +02:00
Kay Sievers 8b5651bb00 switch a few left-over from GPLv2 to GPLv2 or later 2010-06-25 11:39:21 +02:00
Kay Sievers e0f83fbe86 remove a few comments in file headers 2010-06-21 16:56:17 +02:00
David Zeuthen 7f4954d040 Export ID_WWN_VENDOR_EXTENSION and ID_WWN_WITH_EXTENSION
Some SCSI devices use the same WWN and have a WWN extension that we
need to take into account when creating the /dev/disk/by-id/wwn
symlinks. Thus, introduce ID_WWN_WITH_EXTENSION. This property will
contain either the WWN (if no extension is present) or the WWN with
the vendor extension appended.

Example:

 # /lib/udev/ata_id/ata_id --export /dev/sda |grep WWN
 ID_WWN=0x5001517387d61905
 ID_WWN_WITH_EXTENSION=0x5001517387d61905

 # /lib/udev/scsi_id --whitelisted --export -d /dev/sdb |grep WWN
 ID_WWN=0x600508b400105df7
 ID_WWN_VENDOR_EXTENSION=0x0000e00000d80000
 ID_WWN_WITH_EXTENSION=0x600508b400105df70000e00000d80000

 # /lib/udev/scsi_id --whitelisted --export -d /dev/sdc |grep WWN
 ID_WWN=0x600508b400105df7
 ID_WWN_VENDOR_EXTENSION=0x0000e00000db0000
 ID_WWN_WITH_EXTENSION=0x600508b400105df70000e00000db0000

Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-12-04 11:40:00 -05:00
David Zeuthen 4e9fdfccbd scsi_id: Export WWN and Unit Serial Number
Since the Unit Serial Number and the WWN are useful bits of
information export them as properties in the udev database. These
bits of information are often printed on the physical disk, see

http://people.freedesktop.org/~david/FUJITSU-MAY2036RC-sas-disk-picture.jpg

and displaying them separately in the UI (or in /dev/disk) might help
users identify the physical disk. This patch exports these bits of
information as ID_WWN and ID_SCSI_SERIAL.

Note that ata_id also use the ID_WWN property since commit
66094a4a7f (2009-11-04).

Also print out ID_SCSI=1 so users of the udev database knows the disk
speaks SCSI.

Here's the scsi_id output from one of my SAS disks with these changes:

 ID_SCSI=1
 ID_VENDOR=FUJITSU
 ID_VENDOR_ENC=FUJITSU\x20
 ID_MODEL=MAY2036RC
 ID_MODEL_ENC=MAY2036RC\x20\x20\x20\x20\x20\x20\x20
 ID_REVISION=0103
 ID_TYPE=disk
 ID_SERIAL=3500000e01b83f520
 ID_SERIAL_SHORT=500000e01b83f520
 ID_WWN=0x500000e01b83f520
 ID_SCSI_SERIAL=B3G1P8500RWT

Unfortunately we can't overload ID_SERIAL for two reasons

 1. ID_SERIAL (and ID_SERIAL_SHORT) exported by scsi_id isn't really
    the unit serial number (as defined by SCSI) - it is sometimes the
    WWN (since it is more unique than the Unit Serial Number) and
    complex rules (to make the serial unique) govern what value to
    use.

 2. It would break existing setups if the value of ID_SERIAL changed

Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-11-23 21:38:21 +01:00
Kay Sievers caf4c97a2c scsi_id: do not fail if no serial is found like for optical drives 2008-12-02 19:23:38 +01:00
Kay Sievers 7d563a17f3 use libudev code, unify logging, pass udev context around everywhere 2008-09-06 15:45:31 +02:00
Hannes Reinecke 78d9ecfd4f scsi_id: add SGv4 support
Fall back to SGv3, if SGv3 returns a failure/is not available.
2008-05-14 13:55:49 +02:00
Hannes Reinecke 753417db2b scsi_id: remove all sysfs dependencies 2008-05-14 13:42:41 +02:00
Hannes Reinecke 87cf9f5aac cciss device support 2007-05-25 14:48:08 +02:00
Kay Sievers 11678eff6a scsi_id: export ID_SERIAL_SHORT without vendor/product 2006-10-10 16:56:09 +02:00
Kay Sievers 3d94fb8742 scsi_id: remove dead files
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-28 16:42:49 +01:00
Kay Sievers 6ecd4d1e36 scsi_id, usb_id: request device parent by subsystem
Request specific parents identified by subsystem and don't rely on
a predefined sequence.
Also let the devpath be longer than 72 chars, tsss ...

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-18 04:24:48 +01:00
Kay Sievers 1aa1e24848 replace libsysfs
We never used any of the libsysfs convenience features. Here we replace
it completely with 300 lines of code, which are much simpler and a bit
faster cause udev(d) does not open any syfs file for a simple event which
does not need any parent device information.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-09 21:18:00 +01:00
Edward Goggin 50be140174 scsi_id: derive a UID for a SCSI-2 not compliant with the page 83
This patch is to enable the use of scsi_id to derive a UID for a SCSI-2
device which is not compliant with the page 83 inquiry reply format for
either SPC-2 or SPC-3.  In this case, the page 83 reply does not
contain a list of  Identification descriptors but a single binary encoded
hexa-decimal Vendor Specified Identifier.

The update is being driven by the need for scsi_id to support older
model EMC Symmetrix hardware, that is, models 4, 5, and 6.
2005-09-14 20:23:48 +02:00
patmans@us.ibm.com 4e05e4238b [PATCH] update scsi_id to work with libsysfs changes
Update scsi_id to work with the libsysfs changes in udev: use
sysfs_get_classdev_attr and sysfs_get_device_attr in place of
sysfs_read_attribute_value.
2005-04-26 23:39:48 -07:00
patmans@us.ibm.com 01f950e2eb [PATCH] update udev to include scsi_id 0.6
Here's a patch updating udev's copy of scsi_id to version 0.6.
2005-04-26 21:37:02 -07:00
patmans@us.ibm.com 062db23d5e [PATCH] update udev scsi_id to scsi_id 0.5
This patch syncs the scsi_id in the udev tree to version 0.5.
2005-04-26 21:36:21 -07:00
patmans@us.ibm.com b484e43622 [PATCH] update udev scsi_id to scsi_id 0.4
This patch syncs the scsi_id in the udev tree to version 0.4.
2005-04-26 21:34:28 -07:00
patmans@us.ibm.com e996d97835 [PATCH] update udev scsi_id to scsi_id 0.3 2005-04-26 21:13:17 -07:00
dsteklof@us.ibm.com ff3633bf9d [PATCH] fix scsi_id segfault with udev-009
Scsi_id hasn't been changed to use the latest libsysfs changes. The
"directory" in the sysfs_class_device is now considered "private" and only
should be accessed using functions. Treating the structures as handles lets
us only load information when it's needed, reducing caching or stale
information and also helping performance.

Here's the problem.

static inline char *sysfs_get_attr(struct sysfs_class_device *dev,
                                    const char *attr)
{
        return sysfs_get_value_from_attributes(dev->directory->attributes,
                                               attr);
}

Please try this quick fix:
2005-04-26 21:13:09 -07:00
patmans@us.ibm.com 1bed1db499 [PATCH] update udev extras/scsi_id to version 0.2
This patch updates scsi_id under udev from version 0.1 to version 0.2.
2005-04-26 21:13:06 -07:00
greg@kroah.com c521693b54 [PATCH] add scsi_id "extra" program from Patrick Mansfield <patmans@us.ibm.com> 2005-04-26 21:06:24 -07:00