diff options
author | Dave Jiang <dave.jiang@intel.com> | 2011-05-04 19:16:44 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:04:46 -0400 |
commit | ed0e24830e7b744d0d0ae5936740f1cdbd0ec5ba (patch) | |
tree | 6f806540f592879e63403ebf2b84a093b7acbe12 /drivers/scsi/isci | |
parent | 1dea554fce698b7e8ad03cab1525f41cd6c28092 (diff) |
isci: renaming sas_capabilities to scic_phy_cap
This seems to be a data structure that represents the phy capabilities
register from the hardware and has nothing to do with SAS data structs.
Moving and fixup
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci')
-rw-r--r-- | drivers/scsi/isci/core/intel_sas.h | 36 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_phy.h | 30 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_phy.c | 39 |
3 files changed, 50 insertions, 55 deletions
diff --git a/drivers/scsi/isci/core/intel_sas.h b/drivers/scsi/isci/core/intel_sas.h index 61a5ececdd52..91c30cfee21d 100644 --- a/drivers/scsi/isci/core/intel_sas.h +++ b/drivers/scsi/isci/core/intel_sas.h | |||
@@ -112,42 +112,6 @@ struct sci_sas_identify_address_frame_protocols { | |||
112 | }; | 112 | }; |
113 | 113 | ||
114 | /** | 114 | /** |
115 | * struct sas_capabilities - This structure depicts the various SAS | ||
116 | * capabilities supported by the directly attached target device. For | ||
117 | * specific information on each of these individual fields please reference | ||
118 | * the SAS specification Phy layer section on speed negotiation windows. | ||
119 | * | ||
120 | * | ||
121 | */ | ||
122 | struct sas_capabilities { | ||
123 | union { | ||
124 | struct { | ||
125 | /** | ||
126 | * The SAS specification indicates the start bit shall always be set to | ||
127 | * 1. This implementation will have the start bit set to 0 if the | ||
128 | * PHY CAPABILITIES were either not received or speed negotiation failed. | ||
129 | */ | ||
130 | u32 start:1; | ||
131 | u32 tx_ssc_type:1; | ||
132 | u32 reserved1:2; | ||
133 | u32 requested_logical_link_rate:4; | ||
134 | |||
135 | u32 gen1_without_ssc_supported:1; | ||
136 | u32 gen1_with_ssc_supported:1; | ||
137 | u32 gen2_without_ssc_supported:1; | ||
138 | u32 gen2_with_ssc_supported:1; | ||
139 | u32 gen3_without_ssc_supported:1; | ||
140 | u32 gen3_with_ssc_supported:1; | ||
141 | u32 reserved2:17; | ||
142 | u32 parity:1; | ||
143 | } bits; | ||
144 | |||
145 | u32 all; | ||
146 | } u; | ||
147 | |||
148 | }; | ||
149 | |||
150 | /** | ||
151 | * enum _SCI_SAS_TASK_ATTRIBUTE - This enumeration depicts the SAM/SAS | 115 | * enum _SCI_SAS_TASK_ATTRIBUTE - This enumeration depicts the SAM/SAS |
152 | * specification defined task attribute values for a command information | 116 | * specification defined task attribute values for a command information |
153 | * unit. | 117 | * unit. |
diff --git a/drivers/scsi/isci/core/scic_phy.h b/drivers/scsi/isci/core/scic_phy.h index 4e4a6b1f9953..8fcd3a4c5744 100644 --- a/drivers/scsi/isci/core/scic_phy.h +++ b/drivers/scsi/isci/core/scic_phy.h | |||
@@ -75,6 +75,34 @@ struct scic_sds_port; | |||
75 | 75 | ||
76 | enum sas_linkrate sci_phy_linkrate(struct scic_sds_phy *sci_phy); | 76 | enum sas_linkrate sci_phy_linkrate(struct scic_sds_phy *sci_phy); |
77 | 77 | ||
78 | struct scic_phy_cap { | ||
79 | union { | ||
80 | struct { | ||
81 | /* | ||
82 | * The SAS specification indicates the start bit shall | ||
83 | * always be set to | ||
84 | * 1. This implementation will have the start bit set | ||
85 | * to 0 if the PHY CAPABILITIES were either not | ||
86 | * received or speed negotiation failed. | ||
87 | */ | ||
88 | u8 start:1; | ||
89 | u8 tx_ssc_type:1; | ||
90 | u8 res1:2; | ||
91 | u8 req_logical_linkrate:4; | ||
92 | |||
93 | u32 gen1_no_ssc:1; | ||
94 | u32 gen1_ssc:1; | ||
95 | u32 gen2_no_ssc:1; | ||
96 | u32 gen2_ssc:1; | ||
97 | u32 gen3_no_ssc:1; | ||
98 | u32 gen3_ssc:1; | ||
99 | u32 res2:17; | ||
100 | u32 parity:1; | ||
101 | }; | ||
102 | u32 all; | ||
103 | }; | ||
104 | } __packed; | ||
105 | |||
78 | /** | 106 | /** |
79 | * struct scic_phy_properties - This structure defines the properties common to | 107 | * struct scic_phy_properties - This structure defines the properties common to |
80 | * all phys that can be retrieved. | 108 | * all phys that can be retrieved. |
@@ -125,7 +153,7 @@ struct scic_sas_phy_properties { | |||
125 | * This field delineates the Phy capabilities structure received | 153 | * This field delineates the Phy capabilities structure received |
126 | * from the remote end point. | 154 | * from the remote end point. |
127 | */ | 155 | */ |
128 | struct sas_capabilities received_capabilities; | 156 | struct scic_phy_cap rcvd_cap; |
129 | 157 | ||
130 | }; | 158 | }; |
131 | 159 | ||
diff --git a/drivers/scsi/isci/core/scic_sds_phy.c b/drivers/scsi/isci/core/scic_sds_phy.c index 0e381cff25a9..bd2b30587703 100644 --- a/drivers/scsi/isci/core/scic_sds_phy.c +++ b/drivers/scsi/isci/core/scic_sds_phy.c | |||
@@ -122,12 +122,15 @@ static enum sci_status | |||
122 | scic_sds_phy_link_layer_initialization(struct scic_sds_phy *sci_phy, | 122 | scic_sds_phy_link_layer_initialization(struct scic_sds_phy *sci_phy, |
123 | struct scu_link_layer_registers __iomem *link_layer_registers) | 123 | struct scu_link_layer_registers __iomem *link_layer_registers) |
124 | { | 124 | { |
125 | struct scic_sds_controller *scic = sci_phy->owning_port->owning_controller; | 125 | struct scic_sds_controller *scic = |
126 | sci_phy->owning_port->owning_controller; | ||
126 | int phy_idx = sci_phy->phy_index; | 127 | int phy_idx = sci_phy->phy_index; |
127 | struct sci_phy_user_params *phy_user = &scic->user_parameters.sds1.phys[phy_idx]; | 128 | struct sci_phy_user_params *phy_user = |
128 | struct sci_phy_oem_params *phy_oem = &scic->oem_parameters.sds1.phys[phy_idx]; | 129 | &scic->user_parameters.sds1.phys[phy_idx]; |
130 | struct sci_phy_oem_params *phy_oem = | ||
131 | &scic->oem_parameters.sds1.phys[phy_idx]; | ||
129 | u32 phy_configuration; | 132 | u32 phy_configuration; |
130 | struct sas_capabilities phy_capabilities; | 133 | struct scic_phy_cap phy_cap; |
131 | u32 parity_check = 0; | 134 | u32 parity_check = 0; |
132 | u32 parity_count = 0; | 135 | u32 parity_count = 0; |
133 | u32 llctl, link_rate; | 136 | u32 llctl, link_rate; |
@@ -146,7 +149,8 @@ scic_sds_phy_link_layer_initialization(struct scic_sds_phy *sci_phy, | |||
146 | &sci_phy->link_layer_registers->transmit_identification); | 149 | &sci_phy->link_layer_registers->transmit_identification); |
147 | 150 | ||
148 | /* Write the device SAS Address */ | 151 | /* Write the device SAS Address */ |
149 | writel(0xFEDCBA98, &sci_phy->link_layer_registers->sas_device_name_high); | 152 | writel(0xFEDCBA98, |
153 | &sci_phy->link_layer_registers->sas_device_name_high); | ||
150 | writel(phy_idx, &sci_phy->link_layer_registers->sas_device_name_low); | 154 | writel(phy_idx, &sci_phy->link_layer_registers->sas_device_name_low); |
151 | 155 | ||
152 | /* Write the source SAS Address */ | 156 | /* Write the source SAS Address */ |
@@ -170,21 +174,21 @@ scic_sds_phy_link_layer_initialization(struct scic_sds_phy *sci_phy, | |||
170 | &sci_phy->link_layer_registers->phy_configuration); | 174 | &sci_phy->link_layer_registers->phy_configuration); |
171 | 175 | ||
172 | /* Configure the SNW capabilities */ | 176 | /* Configure the SNW capabilities */ |
173 | phy_capabilities.u.all = 0; | 177 | phy_cap.all = 0; |
174 | phy_capabilities.u.bits.start = 1; | 178 | phy_cap.start = 1; |
175 | phy_capabilities.u.bits.gen3_without_ssc_supported = 1; | 179 | phy_cap.gen3_no_ssc = 1; |
176 | phy_capabilities.u.bits.gen2_without_ssc_supported = 1; | 180 | phy_cap.gen2_no_ssc = 1; |
177 | phy_capabilities.u.bits.gen1_without_ssc_supported = 1; | 181 | phy_cap.gen1_no_ssc = 1; |
178 | if (scic->oem_parameters.sds1.controller.do_enable_ssc == true) { | 182 | if (scic->oem_parameters.sds1.controller.do_enable_ssc == true) { |
179 | phy_capabilities.u.bits.gen3_with_ssc_supported = 1; | 183 | phy_cap.gen3_ssc = 1; |
180 | phy_capabilities.u.bits.gen2_with_ssc_supported = 1; | 184 | phy_cap.gen2_ssc = 1; |
181 | phy_capabilities.u.bits.gen1_with_ssc_supported = 1; | 185 | phy_cap.gen1_ssc = 1; |
182 | } | 186 | } |
183 | 187 | ||
184 | /* | 188 | /* |
185 | * The SAS specification indicates that the phy_capabilities that | 189 | * The SAS specification indicates that the phy_capabilities that |
186 | * are transmitted shall have an even parity. Calculate the parity. */ | 190 | * are transmitted shall have an even parity. Calculate the parity. */ |
187 | parity_check = phy_capabilities.u.all; | 191 | parity_check = phy_cap.all; |
188 | while (parity_check != 0) { | 192 | while (parity_check != 0) { |
189 | if (parity_check & 0x1) | 193 | if (parity_check & 0x1) |
190 | parity_count++; | 194 | parity_count++; |
@@ -195,10 +199,9 @@ scic_sds_phy_link_layer_initialization(struct scic_sds_phy *sci_phy, | |||
195 | * If parity indicates there are an odd number of bits set, then | 199 | * If parity indicates there are an odd number of bits set, then |
196 | * set the parity bit to 1 in the phy capabilities. */ | 200 | * set the parity bit to 1 in the phy capabilities. */ |
197 | if ((parity_count % 2) != 0) | 201 | if ((parity_count % 2) != 0) |
198 | phy_capabilities.u.bits.parity = 1; | 202 | phy_cap.parity = 1; |
199 | 203 | ||
200 | writel(phy_capabilities.u.all, | 204 | writel(phy_cap.all, &sci_phy->link_layer_registers->phy_capabilities); |
201 | &sci_phy->link_layer_registers->phy_capabilities); | ||
202 | 205 | ||
203 | /* Set the enable spinup period but disable the ability to send | 206 | /* Set the enable spinup period but disable the ability to send |
204 | * notify enable spinup | 207 | * notify enable spinup |
@@ -561,7 +564,7 @@ enum sci_status scic_sas_phy_get_properties( | |||
561 | &sci_phy->phy_type.sas_id_frame, | 564 | &sci_phy->phy_type.sas_id_frame, |
562 | sizeof(struct sas_identify_frame)); | 565 | sizeof(struct sas_identify_frame)); |
563 | 566 | ||
564 | properties->received_capabilities.u.all = | 567 | properties->rcvd_cap.all = |
565 | readl(&sci_phy->link_layer_registers->receive_phycap); | 568 | readl(&sci_phy->link_layer_registers->receive_phycap); |
566 | 569 | ||
567 | return SCI_SUCCESS; | 570 | return SCI_SUCCESS; |