Merge tag 'pm+acpi-4.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[deliverable/linux.git] / drivers / scsi / scsi_transport_sas.c
index 30d26e345dcc797430667ebe2ea0fa1f288fc372..80520e2f0fa2bd748b007b399acb2908358294c2 100644 (file)
@@ -340,6 +340,22 @@ static int do_sas_phy_delete(struct device *dev, void *data)
        return 0;
 }
 
+/**
+ * is_sas_attached - check if device is SAS attached
+ * @sdev: scsi device to check
+ *
+ * returns true if the device is SAS attached
+ */
+int is_sas_attached(struct scsi_device *sdev)
+{
+       struct Scsi_Host *shost = sdev->host;
+
+       return shost->transportt->host_attrs.ac.class ==
+               &sas_host_class.class;
+}
+EXPORT_SYMBOL(is_sas_attached);
+
+
 /**
  * sas_remove_children  -  tear down a devices SAS data structures
  * @dev:       device belonging to the sas object
@@ -366,6 +382,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
This page took 0.043859 seconds and 5 git commands to generate.