diff options
author | David Zeuthen <davidz@redhat.com> | 2010-10-30 11:44:06 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2010-10-30 13:03:00 -0400 |
commit | 6992637e3165d433353c996aad16c8d141b00845 (patch) | |
tree | 737bfe85020d6bf251de935d8c2c4f3c1dd57eb2 /extras/v4l_id/.gitignore | |
parent | d43e5e5b5a2e27fb75a6e19cca457ca40ad160e4 (diff) |
ata_id: Support SG_IO version 4 interface
This makes it possible to use /dev/bsg/* nodes for ata_id:
# /lib/udev/ata_id --export /dev/bsg/0\:0\:0\:0
ID_ATA=1
ID_TYPE=disk
ID_BUS=ata
ID_MODEL=INTEL_SSDSA2MH080G1GC
ID_MODEL_ENC=INTEL\x20SSDSA2MH080G1GC\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
ID_REVISION=045C8802
[...]
This means that our cd-rom detection as per commit
http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=160b069c25690bfb0c785994c7c3710289179107
needs to be reworked since we can't just use the CDROM_GET_CAPABILITY
ioctl on a /dev/bsg node (which is a character device). We do this by
just sending the SCSI INQUIRY command and checking the type (CD-ROM's
are all type 0x05 and disks are type 0x00) before we issue the ATA
IDENTIFY command through the SCSI command ATA PASS_THROUGH (12).
(Yes, it's a bit perverse how we have to tunnel our ATA commands
through a SCSI command but that's how Linux currently work.)
We still support for SG_IO version 3 (we fail back if version 4 fails
with EINVAL) because testing reveals that some drivers (such as
mpt2sas) still only support version 3 on the block nodes.
Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'extras/v4l_id/.gitignore')
0 files changed, 0 insertions, 0 deletions