diff options
Diffstat (limited to 'drivers/scsi/isci/remote_node_context.c')
-rw-r--r-- | drivers/scsi/isci/remote_node_context.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/scsi/isci/remote_node_context.c b/drivers/scsi/isci/remote_node_context.c index 1b51fe55314d..e485744e1263 100644 --- a/drivers/scsi/isci/remote_node_context.c +++ b/drivers/scsi/isci/remote_node_context.c | |||
@@ -103,22 +103,22 @@ bool scic_sds_remote_node_context_is_ready( | |||
103 | static void scic_sds_remote_node_context_construct_buffer( | 103 | static void scic_sds_remote_node_context_construct_buffer( |
104 | struct scic_sds_remote_node_context *sci_rnc) | 104 | struct scic_sds_remote_node_context *sci_rnc) |
105 | { | 105 | { |
106 | struct scic_sds_remote_device *sci_dev = rnc_to_dev(sci_rnc); | 106 | struct isci_remote_device *idev = rnc_to_dev(sci_rnc); |
107 | struct domain_device *dev = sci_dev_to_domain(sci_dev); | 107 | struct domain_device *dev = idev->domain_dev; |
108 | int rni = sci_rnc->remote_node_index; | 108 | int rni = sci_rnc->remote_node_index; |
109 | union scu_remote_node_context *rnc; | 109 | union scu_remote_node_context *rnc; |
110 | struct scic_sds_controller *scic; | 110 | struct scic_sds_controller *scic; |
111 | __le64 sas_addr; | 111 | __le64 sas_addr; |
112 | 112 | ||
113 | scic = scic_sds_remote_device_get_controller(sci_dev); | 113 | scic = scic_sds_remote_device_get_controller(idev); |
114 | rnc = scic_sds_controller_get_remote_node_context_buffer(scic, rni); | 114 | rnc = scic_sds_controller_get_remote_node_context_buffer(scic, rni); |
115 | 115 | ||
116 | memset(rnc, 0, sizeof(union scu_remote_node_context) | 116 | memset(rnc, 0, sizeof(union scu_remote_node_context) |
117 | * scic_sds_remote_device_node_count(sci_dev)); | 117 | * scic_sds_remote_device_node_count(idev)); |
118 | 118 | ||
119 | rnc->ssp.remote_node_index = rni; | 119 | rnc->ssp.remote_node_index = rni; |
120 | rnc->ssp.remote_node_port_width = sci_dev->device_port_width; | 120 | rnc->ssp.remote_node_port_width = idev->device_port_width; |
121 | rnc->ssp.logical_port_index = sci_dev->owning_port->physical_port_index; | 121 | rnc->ssp.logical_port_index = idev->owning_port->physical_port_index; |
122 | 122 | ||
123 | /* sas address is __be64, context ram format is __le64 */ | 123 | /* sas address is __be64, context ram format is __le64 */ |
124 | sas_addr = cpu_to_le64(SAS_ADDR(dev->sas_addr)); | 124 | sas_addr = cpu_to_le64(SAS_ADDR(dev->sas_addr)); |
@@ -148,7 +148,7 @@ static void scic_sds_remote_node_context_construct_buffer( | |||
148 | rnc->ssp.initial_arbitration_wait_time = 0; | 148 | rnc->ssp.initial_arbitration_wait_time = 0; |
149 | 149 | ||
150 | /* Open Address Frame Parameters */ | 150 | /* Open Address Frame Parameters */ |
151 | rnc->ssp.oaf_connection_rate = sci_dev->connection_rate; | 151 | rnc->ssp.oaf_connection_rate = idev->connection_rate; |
152 | rnc->ssp.oaf_features = 0; | 152 | rnc->ssp.oaf_features = 0; |
153 | rnc->ssp.oaf_source_zone_group = 0; | 153 | rnc->ssp.oaf_source_zone_group = 0; |
154 | rnc->ssp.oaf_more_compatibility_features = 0; | 154 | rnc->ssp.oaf_more_compatibility_features = 0; |
@@ -220,26 +220,26 @@ static void scic_sds_remote_node_context_continue_state_transitions(struct scic_ | |||
220 | static void scic_sds_remote_node_context_validate_context_buffer( | 220 | static void scic_sds_remote_node_context_validate_context_buffer( |
221 | struct scic_sds_remote_node_context *sci_rnc) | 221 | struct scic_sds_remote_node_context *sci_rnc) |
222 | { | 222 | { |
223 | struct scic_sds_remote_device *sci_dev = rnc_to_dev(sci_rnc); | 223 | struct isci_remote_device *idev = rnc_to_dev(sci_rnc); |
224 | struct domain_device *dev = sci_dev_to_domain(sci_dev); | 224 | struct domain_device *dev = idev->domain_dev; |
225 | union scu_remote_node_context *rnc_buffer; | 225 | union scu_remote_node_context *rnc_buffer; |
226 | 226 | ||
227 | rnc_buffer = scic_sds_controller_get_remote_node_context_buffer( | 227 | rnc_buffer = scic_sds_controller_get_remote_node_context_buffer( |
228 | scic_sds_remote_device_get_controller(sci_dev), | 228 | scic_sds_remote_device_get_controller(idev), |
229 | sci_rnc->remote_node_index | 229 | sci_rnc->remote_node_index |
230 | ); | 230 | ); |
231 | 231 | ||
232 | rnc_buffer->ssp.is_valid = true; | 232 | rnc_buffer->ssp.is_valid = true; |
233 | 233 | ||
234 | if (!sci_dev->is_direct_attached && | 234 | if (!idev->is_direct_attached && |
235 | (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP))) { | 235 | (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP))) { |
236 | scic_sds_remote_device_post_request(sci_dev, | 236 | scic_sds_remote_device_post_request(idev, |
237 | SCU_CONTEXT_COMMAND_POST_RNC_96); | 237 | SCU_CONTEXT_COMMAND_POST_RNC_96); |
238 | } else { | 238 | } else { |
239 | scic_sds_remote_device_post_request(sci_dev, SCU_CONTEXT_COMMAND_POST_RNC_32); | 239 | scic_sds_remote_device_post_request(idev, SCU_CONTEXT_COMMAND_POST_RNC_32); |
240 | 240 | ||
241 | if (sci_dev->is_direct_attached) { | 241 | if (idev->is_direct_attached) { |
242 | scic_sds_port_setup_transports(sci_dev->owning_port, | 242 | scic_sds_port_setup_transports(idev->owning_port, |
243 | sci_rnc->remote_node_index); | 243 | sci_rnc->remote_node_index); |
244 | } | 244 | } |
245 | } | 245 | } |
@@ -296,11 +296,11 @@ static void scic_sds_remote_node_context_invalidating_state_enter(struct sci_bas | |||
296 | static void scic_sds_remote_node_context_resuming_state_enter(struct sci_base_state_machine *sm) | 296 | static void scic_sds_remote_node_context_resuming_state_enter(struct sci_base_state_machine *sm) |
297 | { | 297 | { |
298 | struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); | 298 | struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); |
299 | struct scic_sds_remote_device *sci_dev; | 299 | struct isci_remote_device *idev; |
300 | struct domain_device *dev; | 300 | struct domain_device *dev; |
301 | 301 | ||
302 | sci_dev = rnc_to_dev(rnc); | 302 | idev = rnc_to_dev(rnc); |
303 | dev = sci_dev_to_domain(sci_dev); | 303 | dev = idev->domain_dev; |
304 | 304 | ||
305 | /* | 305 | /* |
306 | * For direct attached SATA devices we need to clear the TLCR | 306 | * For direct attached SATA devices we need to clear the TLCR |
@@ -309,11 +309,11 @@ static void scic_sds_remote_node_context_resuming_state_enter(struct sci_base_st | |||
309 | * the STPTLDARNI register with the RNi of the device | 309 | * the STPTLDARNI register with the RNi of the device |
310 | */ | 310 | */ |
311 | if ((dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) && | 311 | if ((dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) && |
312 | sci_dev->is_direct_attached) | 312 | idev->is_direct_attached) |
313 | scic_sds_port_setup_transports(sci_dev->owning_port, | 313 | scic_sds_port_setup_transports(idev->owning_port, |
314 | rnc->remote_node_index); | 314 | rnc->remote_node_index); |
315 | 315 | ||
316 | scic_sds_remote_device_post_request(sci_dev, SCU_CONTEXT_COMMAND_POST_RNC_RESUME); | 316 | scic_sds_remote_device_post_request(idev, SCU_CONTEXT_COMMAND_POST_RNC_RESUME); |
317 | } | 317 | } |
318 | 318 | ||
319 | static void scic_sds_remote_node_context_ready_state_enter(struct sci_base_state_machine *sm) | 319 | static void scic_sds_remote_node_context_ready_state_enter(struct sci_base_state_machine *sm) |
@@ -564,8 +564,8 @@ enum sci_status scic_sds_remote_node_context_resume(struct scic_sds_remote_node_ | |||
564 | sci_rnc->user_cookie = cb_p; | 564 | sci_rnc->user_cookie = cb_p; |
565 | return SCI_SUCCESS; | 565 | return SCI_SUCCESS; |
566 | case SCI_RNC_TX_SUSPENDED: { | 566 | case SCI_RNC_TX_SUSPENDED: { |
567 | struct scic_sds_remote_device *sci_dev = rnc_to_dev(sci_rnc); | 567 | struct isci_remote_device *idev = rnc_to_dev(sci_rnc); |
568 | struct domain_device *dev = sci_dev_to_domain(sci_dev); | 568 | struct domain_device *dev = idev->domain_dev; |
569 | 569 | ||
570 | scic_sds_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); | 570 | scic_sds_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); |
571 | 571 | ||
@@ -573,7 +573,7 @@ enum sci_status scic_sds_remote_node_context_resume(struct scic_sds_remote_node_ | |||
573 | if (dev->dev_type == SAS_END_DEV || dev_is_expander(dev)) | 573 | if (dev->dev_type == SAS_END_DEV || dev_is_expander(dev)) |
574 | sci_change_state(&sci_rnc->sm, SCI_RNC_RESUMING); | 574 | sci_change_state(&sci_rnc->sm, SCI_RNC_RESUMING); |
575 | else if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) { | 575 | else if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) { |
576 | if (sci_dev->is_direct_attached) { | 576 | if (idev->is_direct_attached) { |
577 | /* @todo Fix this since I am being silly in writing to the STPTLDARNI register. */ | 577 | /* @todo Fix this since I am being silly in writing to the STPTLDARNI register. */ |
578 | sci_change_state(&sci_rnc->sm, SCI_RNC_RESUMING); | 578 | sci_change_state(&sci_rnc->sm, SCI_RNC_RESUMING); |
579 | } else { | 579 | } else { |