diff options
Diffstat (limited to 'include/scsi/scsi_transport_sas.h')
-rw-r--r-- | include/scsi/scsi_transport_sas.h | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h index 6cc2314098cf..53024377f3b8 100644 --- a/include/scsi/scsi_transport_sas.h +++ b/include/scsi/scsi_transport_sas.h | |||
@@ -24,15 +24,23 @@ enum sas_protocol { | |||
24 | }; | 24 | }; |
25 | 25 | ||
26 | enum sas_linkrate { | 26 | enum sas_linkrate { |
27 | SAS_LINK_RATE_UNKNOWN, | 27 | /* These Values are defined in the SAS standard */ |
28 | SAS_PHY_DISABLED, | 28 | SAS_LINK_RATE_UNKNOWN = 0, |
29 | SAS_LINK_RATE_FAILED, | 29 | SAS_PHY_DISABLED = 1, |
30 | SAS_SATA_SPINUP_HOLD, | 30 | SAS_PHY_RESET_PROBLEM = 2, |
31 | SAS_SATA_PORT_SELECTOR, | 31 | SAS_SATA_SPINUP_HOLD = 3, |
32 | SAS_LINK_RATE_1_5_GBPS, | 32 | SAS_SATA_PORT_SELECTOR = 4, |
33 | SAS_LINK_RATE_3_0_GBPS, | 33 | SAS_PHY_RESET_IN_PROGRESS = 5, |
34 | SAS_LINK_RATE_6_0_GBPS, | 34 | SAS_LINK_RATE_1_5_GBPS = 8, |
35 | SAS_LINK_VIRTUAL, | 35 | SAS_LINK_RATE_G1 = SAS_LINK_RATE_1_5_GBPS, |
36 | SAS_LINK_RATE_3_0_GBPS = 9, | ||
37 | SAS_LINK_RATE_G2 = SAS_LINK_RATE_3_0_GBPS, | ||
38 | SAS_LINK_RATE_6_0_GBPS = 10, | ||
39 | /* These are virtual to the transport class and may never | ||
40 | * be signalled normally since the standard defined field | ||
41 | * is only 4 bits */ | ||
42 | SAS_LINK_RATE_FAILED = 0x10, | ||
43 | SAS_PHY_VIRTUAL = 0x11, | ||
36 | }; | 44 | }; |
37 | 45 | ||
38 | struct sas_identify { | 46 | struct sas_identify { |
@@ -57,9 +65,6 @@ struct sas_phy { | |||
57 | enum sas_linkrate maximum_linkrate_hw; | 65 | enum sas_linkrate maximum_linkrate_hw; |
58 | enum sas_linkrate maximum_linkrate; | 66 | enum sas_linkrate maximum_linkrate; |
59 | 67 | ||
60 | /* internal state */ | ||
61 | unsigned int local_attached : 1; | ||
62 | |||
63 | /* link error statistics */ | 68 | /* link error statistics */ |
64 | u32 invalid_dword_count; | 69 | u32 invalid_dword_count; |
65 | u32 running_disparity_error_count; | 70 | u32 running_disparity_error_count; |
@@ -145,12 +150,18 @@ struct sas_port { | |||
145 | #define transport_class_to_sas_port(cdev) \ | 150 | #define transport_class_to_sas_port(cdev) \ |
146 | dev_to_sas_port((cdev)->dev) | 151 | dev_to_sas_port((cdev)->dev) |
147 | 152 | ||
153 | struct sas_phy_linkrates { | ||
154 | enum sas_linkrate maximum_linkrate; | ||
155 | enum sas_linkrate minimum_linkrate; | ||
156 | }; | ||
157 | |||
148 | /* The functions by which the transport class and the driver communicate */ | 158 | /* The functions by which the transport class and the driver communicate */ |
149 | struct sas_function_template { | 159 | struct sas_function_template { |
150 | int (*get_linkerrors)(struct sas_phy *); | 160 | int (*get_linkerrors)(struct sas_phy *); |
151 | int (*get_enclosure_identifier)(struct sas_rphy *, u64 *); | 161 | int (*get_enclosure_identifier)(struct sas_rphy *, u64 *); |
152 | int (*get_bay_identifier)(struct sas_rphy *); | 162 | int (*get_bay_identifier)(struct sas_rphy *); |
153 | int (*phy_reset)(struct sas_phy *, int); | 163 | int (*phy_reset)(struct sas_phy *, int); |
164 | int (*set_phy_speed)(struct sas_phy *, struct sas_phy_linkrates *); | ||
154 | }; | 165 | }; |
155 | 166 | ||
156 | 167 | ||
@@ -196,4 +207,6 @@ scsi_is_sas_expander_device(struct device *dev) | |||
196 | rphy->identify.device_type == SAS_EDGE_EXPANDER_DEVICE; | 207 | rphy->identify.device_type == SAS_EDGE_EXPANDER_DEVICE; |
197 | } | 208 | } |
198 | 209 | ||
210 | #define scsi_is_sas_phy_local(phy) scsi_is_host_device((phy)->dev.parent) | ||
211 | |||
199 | #endif /* SCSI_TRANSPORT_SAS_H */ | 212 | #endif /* SCSI_TRANSPORT_SAS_H */ |