diff options
author | Dan Williams <dan.j.williams@intel.com> | 2012-01-28 20:24:40 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-29 16:40:33 -0500 |
commit | 899fcf40f3177697ccfb029d0484cb8ec09a51ca (patch) | |
tree | 2983a14444ca62958e50e2fdbd4dc945d7a38849 /drivers/scsi/libsas/sas_internal.h | |
parent | 9a10b33caf78f897356ac006c455e6060a40af15 (diff) |
[SCSI] libsas: set attached device type and target protocols for local phys
Before:
$ cat /sys/class/sas_phy/phy-6\:3/device_type
none
$ cat /sys/class/sas_phy/phy-6\:3/target_port_protocols
none
After:
$ cat /sys/class/sas_phy/phy-6\:3/device_type
end device
$ cat /sys/class/sas_phy/phy-6\:3/target_port_protocols
sata
Also downgrade the phy_list_lock to _irq instead of _irqsave since
libsas will never call sas_get_port_device with interrupts disbled.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libsas/sas_internal.h')
-rw-r--r-- | drivers/scsi/libsas/sas_internal.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/scsi/libsas/sas_internal.h b/drivers/scsi/libsas/sas_internal.h index d0d9bf10f79c..f05c63879949 100644 --- a/drivers/scsi/libsas/sas_internal.h +++ b/drivers/scsi/libsas/sas_internal.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <scsi/scsi_host.h> | 30 | #include <scsi/scsi_host.h> |
31 | #include <scsi/scsi_transport_sas.h> | 31 | #include <scsi/scsi_transport_sas.h> |
32 | #include <scsi/libsas.h> | 32 | #include <scsi/libsas.h> |
33 | #include <scsi/sas_ata.h> | ||
33 | 34 | ||
34 | #define sas_printk(fmt, ...) printk(KERN_NOTICE "sas: " fmt, ## __VA_ARGS__) | 35 | #define sas_printk(fmt, ...) printk(KERN_NOTICE "sas: " fmt, ## __VA_ARGS__) |
35 | 36 | ||
@@ -147,6 +148,22 @@ static inline void sas_fill_in_rphy(struct domain_device *dev, | |||
147 | } | 148 | } |
148 | } | 149 | } |
149 | 150 | ||
151 | static inline void sas_phy_set_target(struct asd_sas_phy *p, struct domain_device *dev) | ||
152 | { | ||
153 | struct sas_phy *phy = p->phy; | ||
154 | |||
155 | if (dev) { | ||
156 | if (dev_is_sata(dev)) | ||
157 | phy->identify.device_type = SAS_END_DEVICE; | ||
158 | else | ||
159 | phy->identify.device_type = dev->dev_type; | ||
160 | phy->identify.target_port_protocols = dev->tproto; | ||
161 | } else { | ||
162 | phy->identify.device_type = SAS_PHY_UNUSED; | ||
163 | phy->identify.target_port_protocols = 0; | ||
164 | } | ||
165 | } | ||
166 | |||
150 | static inline void sas_add_parent_port(struct domain_device *dev, int phy_id) | 167 | static inline void sas_add_parent_port(struct domain_device *dev, int phy_id) |
151 | { | 168 | { |
152 | struct expander_device *ex = &dev->ex_dev; | 169 | struct expander_device *ex = &dev->ex_dev; |