This adds support to SCSI for enclosure services devices. It also makes
use of the enclosure services added in an earlier patch to display the
enclosure topology in sysfs.
At the moment, the enclosures are SAS specific, but if anyone actually
has a non-SAS enclosure that follows the SES-2 standard, we can add that
as well.
On my Vitesse based system, the enclosures show up like this:
You can flash the various blinky lights by echoing to the fault and locate files.
>From the device's point of view, you can see it has an enclosure like this:
sparkweed:~# ls /sys/class/scsi_disk/0\:0\:0\:0/device/
block:sda generic queue_depth state
bsg:0:0:0:0 iocounterbits queue_type subsystem
bus iodone_cnt rescan timeout
delete ioerr_cnt rev type
device_blocked iorequest_cnt scsi_device:0:0:0:0 uevent
driver modalias scsi_disk:0:0:0:0 vendor
enclosure_component:SLOT 001 model scsi_generic:sg0
evt_media_change power scsi_level
Note the enclosure_component:SLOT 001 which shows where in the enclosure
this device fits.
The astute will notice that I'm using SCSI VPD Inquiries to identify the
devices. This, unfortunately, won't work for SATA devices unless we do
some really nasty hacking about on the SAT because the only think that
knows the SAS addresses for SATA devices is libsas, not libata where the
SAT resides.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>