Commit ec384fb9 authored by James Bottomley's avatar James Bottomley Committed by Thadeu Lima de Souza Cascardo

scsi_transport_sas: add function to get SAS endpoint address

BugLink: http://bugs.launchpad.net/bugs/1693369

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: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
(cherry picked from commit bcf508c1)
Signed-off-by: default avatarJoseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent 6a03f9be
......@@ -366,6 +366,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
......
......@@ -180,6 +180,7 @@ extern int sas_phy_add(struct sas_phy *);
extern void sas_phy_delete(struct sas_phy *);
extern int scsi_is_sas_phy(const struct device *);
u64 sas_get_address(struct scsi_device *);
unsigned int sas_tlr_supported(struct scsi_device *);
unsigned int sas_is_tlr_enabled(struct scsi_device *);
void sas_disable_tlr(struct scsi_device *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment