aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2015-12-09 11:13:35 -0800
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2015-12-18 19:29:50 -0800
commitbcf508c13385e74972f5cc06d8471d5c100395b0 (patch)
tree28d306e2a10f68596e725941866b4871c2cb2954 /drivers
parentscsi_transport_sas: add is_sas_attached() function (diff)
downloadlinux-dev-bcf508c13385e74972f5cc06d8471d5c100395b0.tar.xz
linux-dev-bcf508c13385e74972f5cc06d8471d5c100395b0.zip
scsi_transport_sas: add function to get SAS endpoint address
For a device known to be SAS connected, this will return the endpoint address. This is useful for getting the SAS address of SATA devices. Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/scsi_transport_sas.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index b17f763a73b2..80520e2f0fa2 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -383,6 +383,20 @@ void sas_remove_host(struct Scsi_Host *shost)
EXPORT_SYMBOL(sas_remove_host);
/**
+ * sas_get_address - return the SAS address of the device
+ * @sdev: scsi device
+ *
+ * Returns the SAS address of the scsi device
+ */
+u64 sas_get_address(struct scsi_device *sdev)
+{
+ struct sas_end_device *rdev = sas_sdev_to_rdev(sdev);
+
+ return rdev->rphy.identify.sas_address;
+}
+EXPORT_SYMBOL(sas_get_address);
+
+/**
* sas_tlr_supported - checking TLR bit in vpd 0x90
* @sdev: scsi device struct
*