diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-04-19 21:35:58 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:00:37 -0400 |
commit | 9614395ea2eed076fa8341df422582b0017d330c (patch) | |
tree | f5787d4f2fc3f208874bba6765da287f491dbf9d | |
parent | 7ab92c9ed22b49a50d9a10bbfdf4ee8ffe62c324 (diff) |
isci: remove rnc->device back pointer
Now that they are one in the same object remove the back pointer reference
in favor of container_of.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_remote_device.c | 7 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_remote_device.h | 9 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_remote_node_context.c | 124 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_remote_node_context.h | 15 |
4 files changed, 65 insertions, 90 deletions
diff --git a/drivers/scsi/isci/core/scic_sds_remote_device.c b/drivers/scsi/isci/core/scic_sds_remote_device.c index 04295274b71a..22788bfcf9c3 100644 --- a/drivers/scsi/isci/core/scic_sds_remote_device.c +++ b/drivers/scsi/isci/core/scic_sds_remote_device.c | |||
@@ -1672,11 +1672,8 @@ void scic_remote_device_construct(struct scic_sds_port *sci_port, | |||
1672 | &sci_dev->state_machine | 1672 | &sci_dev->state_machine |
1673 | ); | 1673 | ); |
1674 | 1674 | ||
1675 | scic_sds_remote_node_context_construct( | 1675 | scic_sds_remote_node_context_construct(&sci_dev->rnc, |
1676 | sci_dev, | 1676 | SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX); |
1677 | &sci_dev->rnc, | ||
1678 | SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX | ||
1679 | ); | ||
1680 | 1677 | ||
1681 | sci_object_set_association(&sci_dev->rnc, sci_dev); | 1678 | sci_object_set_association(&sci_dev->rnc, sci_dev); |
1682 | } | 1679 | } |
diff --git a/drivers/scsi/isci/core/scic_sds_remote_device.h b/drivers/scsi/isci/core/scic_sds_remote_device.h index 7f43f3003e81..bff44b8b83ab 100644 --- a/drivers/scsi/isci/core/scic_sds_remote_device.h +++ b/drivers/scsi/isci/core/scic_sds_remote_device.h | |||
@@ -339,6 +339,15 @@ struct scic_sds_remote_device { | |||
339 | const struct scic_sds_remote_device_state_handler *state_handlers; | 339 | const struct scic_sds_remote_device_state_handler *state_handlers; |
340 | }; | 340 | }; |
341 | 341 | ||
342 | static inline struct scic_sds_remote_device *rnc_to_dev(struct scic_sds_remote_node_context *rnc) | ||
343 | { | ||
344 | struct scic_sds_remote_device *sci_dev; | ||
345 | |||
346 | sci_dev = container_of(rnc, typeof(*sci_dev), rnc); | ||
347 | |||
348 | return sci_dev; | ||
349 | } | ||
350 | |||
342 | typedef enum sci_status (*scic_sds_remote_device_request_handler_t)( | 351 | typedef enum sci_status (*scic_sds_remote_device_request_handler_t)( |
343 | struct scic_sds_remote_device *device, | 352 | struct scic_sds_remote_device *device, |
344 | struct scic_sds_request *request); | 353 | struct scic_sds_request *request); |
diff --git a/drivers/scsi/isci/core/scic_sds_remote_node_context.c b/drivers/scsi/isci/core/scic_sds_remote_node_context.c index e329296fa386..e1d58f8854f7 100644 --- a/drivers/scsi/isci/core/scic_sds_remote_node_context.c +++ b/drivers/scsi/isci/core/scic_sds_remote_node_context.c | |||
@@ -108,27 +108,24 @@ static void scic_sds_remote_node_context_construct_buffer( | |||
108 | struct scic_sds_remote_node_context *sci_rnc) | 108 | struct scic_sds_remote_node_context *sci_rnc) |
109 | { | 109 | { |
110 | union scu_remote_node_context *rnc; | 110 | union scu_remote_node_context *rnc; |
111 | struct scic_sds_remote_device *sci_dev = rnc_to_dev(sci_rnc); | ||
111 | struct scic_sds_controller *scic; | 112 | struct scic_sds_controller *scic; |
112 | 113 | ||
113 | scic = scic_sds_remote_device_get_controller(sci_rnc->device); | 114 | scic = scic_sds_remote_device_get_controller(sci_dev); |
114 | 115 | ||
115 | rnc = scic_sds_controller_get_remote_node_context_buffer( | 116 | rnc = scic_sds_controller_get_remote_node_context_buffer( |
116 | scic, sci_rnc->remote_node_index); | 117 | scic, sci_rnc->remote_node_index); |
117 | 118 | ||
118 | memset( | 119 | memset(rnc, 0, sizeof(union scu_remote_node_context) |
119 | rnc, | 120 | * scic_sds_remote_device_node_count(sci_dev)); |
120 | 0x00, | ||
121 | sizeof(union scu_remote_node_context) | ||
122 | * scic_sds_remote_device_node_count(sci_rnc->device) | ||
123 | ); | ||
124 | 121 | ||
125 | rnc->ssp.remote_node_index = sci_rnc->remote_node_index; | 122 | rnc->ssp.remote_node_index = sci_rnc->remote_node_index; |
126 | rnc->ssp.remote_node_port_width = sci_rnc->device->device_port_width; | 123 | rnc->ssp.remote_node_port_width = sci_dev->device_port_width; |
127 | rnc->ssp.logical_port_index = | 124 | rnc->ssp.logical_port_index = |
128 | scic_sds_remote_device_get_port_index(sci_rnc->device); | 125 | scic_sds_remote_device_get_port_index(sci_dev); |
129 | 126 | ||
130 | rnc->ssp.remote_sas_address_hi = SCIC_SWAP_DWORD(sci_rnc->device->device_address.high); | 127 | rnc->ssp.remote_sas_address_hi = SCIC_SWAP_DWORD(sci_dev->device_address.high); |
131 | rnc->ssp.remote_sas_address_lo = SCIC_SWAP_DWORD(sci_rnc->device->device_address.low); | 128 | rnc->ssp.remote_sas_address_lo = SCIC_SWAP_DWORD(sci_dev->device_address.low); |
132 | 129 | ||
133 | rnc->ssp.nexus_loss_timer_enable = true; | 130 | rnc->ssp.nexus_loss_timer_enable = true; |
134 | rnc->ssp.check_bit = false; | 131 | rnc->ssp.check_bit = false; |
@@ -140,8 +137,8 @@ static void scic_sds_remote_node_context_construct_buffer( | |||
140 | 137 | ||
141 | 138 | ||
142 | if ( | 139 | if ( |
143 | sci_rnc->device->target_protocols.u.bits.attached_sata_device | 140 | sci_dev->target_protocols.u.bits.attached_sata_device |
144 | || sci_rnc->device->target_protocols.u.bits.attached_stp_target | 141 | || sci_dev->target_protocols.u.bits.attached_stp_target |
145 | ) { | 142 | ) { |
146 | rnc->ssp.connection_occupancy_timeout = | 143 | rnc->ssp.connection_occupancy_timeout = |
147 | scic->user_parameters.sds1.stp_max_occupancy_timeout; | 144 | scic->user_parameters.sds1.stp_max_occupancy_timeout; |
@@ -157,7 +154,7 @@ static void scic_sds_remote_node_context_construct_buffer( | |||
157 | rnc->ssp.initial_arbitration_wait_time = 0; | 154 | rnc->ssp.initial_arbitration_wait_time = 0; |
158 | 155 | ||
159 | /* Open Address Frame Parameters */ | 156 | /* Open Address Frame Parameters */ |
160 | rnc->ssp.oaf_connection_rate = sci_rnc->device->connection_rate; | 157 | rnc->ssp.oaf_connection_rate = sci_dev->connection_rate; |
161 | rnc->ssp.oaf_features = 0; | 158 | rnc->ssp.oaf_features = 0; |
162 | rnc->ssp.oaf_source_zone_group = 0; | 159 | rnc->ssp.oaf_source_zone_group = 0; |
163 | rnc->ssp.oaf_more_compatibility_features = 0; | 160 | rnc->ssp.oaf_more_compatibility_features = 0; |
@@ -234,7 +231,7 @@ static enum sci_status scic_sds_remote_node_context_default_destruct_handler( | |||
234 | scics_sds_remote_node_context_callback callback, | 231 | scics_sds_remote_node_context_callback callback, |
235 | void *callback_parameter) | 232 | void *callback_parameter) |
236 | { | 233 | { |
237 | dev_warn(scirdev_to_dev(sci_rnc->device), | 234 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
238 | "%s: SCIC Remote Node Context 0x%p requested to stop while " | 235 | "%s: SCIC Remote Node Context 0x%p requested to stop while " |
239 | "in unexpected state %d\n", | 236 | "in unexpected state %d\n", |
240 | __func__, | 237 | __func__, |
@@ -253,7 +250,7 @@ static enum sci_status scic_sds_remote_node_context_default_suspend_handler( | |||
253 | scics_sds_remote_node_context_callback callback, | 250 | scics_sds_remote_node_context_callback callback, |
254 | void *callback_parameter) | 251 | void *callback_parameter) |
255 | { | 252 | { |
256 | dev_warn(scirdev_to_dev(sci_rnc->device), | 253 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
257 | "%s: SCIC Remote Node Context 0x%p requested to suspend " | 254 | "%s: SCIC Remote Node Context 0x%p requested to suspend " |
258 | "while in wrong state %d\n", | 255 | "while in wrong state %d\n", |
259 | __func__, | 256 | __func__, |
@@ -268,7 +265,7 @@ static enum sci_status scic_sds_remote_node_context_default_resume_handler( | |||
268 | scics_sds_remote_node_context_callback callback, | 265 | scics_sds_remote_node_context_callback callback, |
269 | void *callback_parameter) | 266 | void *callback_parameter) |
270 | { | 267 | { |
271 | dev_warn(scirdev_to_dev(sci_rnc->device), | 268 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
272 | "%s: SCIC Remote Node Context 0x%p requested to resume " | 269 | "%s: SCIC Remote Node Context 0x%p requested to resume " |
273 | "while in wrong state %d\n", | 270 | "while in wrong state %d\n", |
274 | __func__, | 271 | __func__, |
@@ -282,7 +279,7 @@ static enum sci_status scic_sds_remote_node_context_default_start_io_handler( | |||
282 | struct scic_sds_remote_node_context *sci_rnc, | 279 | struct scic_sds_remote_node_context *sci_rnc, |
283 | struct scic_sds_request *sci_req) | 280 | struct scic_sds_request *sci_req) |
284 | { | 281 | { |
285 | dev_warn(scirdev_to_dev(sci_rnc->device), | 282 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
286 | "%s: SCIC Remote Node Context 0x%p requested to start io " | 283 | "%s: SCIC Remote Node Context 0x%p requested to start io " |
287 | "0x%p while in wrong state %d\n", | 284 | "0x%p while in wrong state %d\n", |
288 | __func__, | 285 | __func__, |
@@ -297,7 +294,7 @@ static enum sci_status scic_sds_remote_node_context_default_start_task_handler( | |||
297 | struct scic_sds_remote_node_context *sci_rnc, | 294 | struct scic_sds_remote_node_context *sci_rnc, |
298 | struct scic_sds_request *sci_req) | 295 | struct scic_sds_request *sci_req) |
299 | { | 296 | { |
300 | dev_warn(scirdev_to_dev(sci_rnc->device), | 297 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
301 | "%s: SCIC Remote Node Context 0x%p requested to start " | 298 | "%s: SCIC Remote Node Context 0x%p requested to start " |
302 | "task 0x%p while in wrong state %d\n", | 299 | "task 0x%p while in wrong state %d\n", |
303 | __func__, | 300 | __func__, |
@@ -312,7 +309,7 @@ static enum sci_status scic_sds_remote_node_context_default_event_handler( | |||
312 | struct scic_sds_remote_node_context *sci_rnc, | 309 | struct scic_sds_remote_node_context *sci_rnc, |
313 | u32 event_code) | 310 | u32 event_code) |
314 | { | 311 | { |
315 | dev_warn(scirdev_to_dev(sci_rnc->device), | 312 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
316 | "%s: SCIC Remote Node Context 0x%p requested to process " | 313 | "%s: SCIC Remote Node Context 0x%p requested to process " |
317 | "event 0x%x while in wrong state %d\n", | 314 | "event 0x%x while in wrong state %d\n", |
318 | __func__, | 315 | __func__, |
@@ -412,7 +409,7 @@ static enum sci_status scic_sds_remote_node_context_posting_state_event_handler( | |||
412 | 409 | ||
413 | default: | 410 | default: |
414 | status = SCI_FAILURE; | 411 | status = SCI_FAILURE; |
415 | dev_warn(scirdev_to_dev(sci_rnc->device), | 412 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
416 | "%s: SCIC Remote Node Context 0x%p requested to " | 413 | "%s: SCIC Remote Node Context 0x%p requested to " |
417 | "process unexpected event 0x%x while in posting " | 414 | "process unexpected event 0x%x while in posting " |
418 | "state\n", | 415 | "state\n", |
@@ -466,7 +463,7 @@ static enum sci_status scic_sds_remote_node_context_invalidating_state_event_han | |||
466 | /* | 463 | /* |
467 | * We really dont care if the hardware is going to suspend | 464 | * We really dont care if the hardware is going to suspend |
468 | * the device since it's being invalidated anyway */ | 465 | * the device since it's being invalidated anyway */ |
469 | dev_dbg(scirdev_to_dev(sci_rnc->device), | 466 | dev_dbg(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
470 | "%s: SCIC Remote Node Context 0x%p was " | 467 | "%s: SCIC Remote Node Context 0x%p was " |
471 | "suspeneded by hardware while being " | 468 | "suspeneded by hardware while being " |
472 | "invalidated.\n", | 469 | "invalidated.\n", |
@@ -476,7 +473,7 @@ static enum sci_status scic_sds_remote_node_context_invalidating_state_event_han | |||
476 | break; | 473 | break; |
477 | 474 | ||
478 | default: | 475 | default: |
479 | dev_warn(scirdev_to_dev(sci_rnc->device), | 476 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
480 | "%s: SCIC Remote Node Context 0x%p " | 477 | "%s: SCIC Remote Node Context 0x%p " |
481 | "requested to process event 0x%x while " | 478 | "requested to process event 0x%x while " |
482 | "in state %d.\n", | 479 | "in state %d.\n", |
@@ -516,7 +513,7 @@ static enum sci_status scic_sds_remote_node_context_resuming_state_event_handler | |||
516 | /* | 513 | /* |
517 | * We really dont care if the hardware is going to suspend | 514 | * We really dont care if the hardware is going to suspend |
518 | * the device since it's being resumed anyway */ | 515 | * the device since it's being resumed anyway */ |
519 | dev_dbg(scirdev_to_dev(sci_rnc->device), | 516 | dev_dbg(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
520 | "%s: SCIC Remote Node Context 0x%p was " | 517 | "%s: SCIC Remote Node Context 0x%p was " |
521 | "suspeneded by hardware while being resumed.\n", | 518 | "suspeneded by hardware while being resumed.\n", |
522 | __func__, | 519 | __func__, |
@@ -525,7 +522,7 @@ static enum sci_status scic_sds_remote_node_context_resuming_state_event_handler | |||
525 | break; | 522 | break; |
526 | 523 | ||
527 | default: | 524 | default: |
528 | dev_warn(scirdev_to_dev(sci_rnc->device), | 525 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
529 | "%s: SCIC Remote Node Context 0x%p requested " | 526 | "%s: SCIC Remote Node Context 0x%p requested " |
530 | "to process event 0x%x while in state %d.\n", | 527 | "to process event 0x%x while in state %d.\n", |
531 | __func__, | 528 | __func__, |
@@ -563,10 +560,8 @@ static enum sci_status scic_sds_remote_node_context_ready_state_suspend_handler( | |||
563 | sci_rnc->suspension_code = suspend_type; | 560 | sci_rnc->suspension_code = suspend_type; |
564 | 561 | ||
565 | if (suspend_type == SCI_SOFTWARE_SUSPENSION) { | 562 | if (suspend_type == SCI_SOFTWARE_SUSPENSION) { |
566 | scic_sds_remote_device_post_request( | 563 | scic_sds_remote_device_post_request(rnc_to_dev(sci_rnc), |
567 | sci_rnc->device, | 564 | SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX); |
568 | SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX | ||
569 | ); | ||
570 | } | 565 | } |
571 | 566 | ||
572 | sci_base_state_machine_change_state( | 567 | sci_base_state_machine_change_state( |
@@ -622,7 +617,7 @@ static enum sci_status scic_sds_remote_node_context_ready_state_event_handler( | |||
622 | break; | 617 | break; |
623 | 618 | ||
624 | default: | 619 | default: |
625 | dev_warn(scirdev_to_dev(sci_rnc->device), | 620 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
626 | "%s: SCIC Remote Node Context 0x%p requested to " | 621 | "%s: SCIC Remote Node Context 0x%p requested to " |
627 | "process event 0x%x while in state %d.\n", | 622 | "process event 0x%x while in state %d.\n", |
628 | __func__, | 623 | __func__, |
@@ -654,7 +649,7 @@ static enum sci_status scic_sds_remote_node_context_tx_suspended_state_resume_ha | |||
654 | 649 | ||
655 | /* TODO: consider adding a resume action of NONE, INVALIDATE, WRITE_TLCR */ | 650 | /* TODO: consider adding a resume action of NONE, INVALIDATE, WRITE_TLCR */ |
656 | 651 | ||
657 | scic_remote_device_get_protocols(sci_rnc->device, &protocols); | 652 | scic_remote_device_get_protocols(rnc_to_dev(sci_rnc), &protocols); |
658 | 653 | ||
659 | if ( | 654 | if ( |
660 | (protocols.u.bits.attached_ssp_target == 1) | 655 | (protocols.u.bits.attached_ssp_target == 1) |
@@ -667,7 +662,7 @@ static enum sci_status scic_sds_remote_node_context_tx_suspended_state_resume_ha | |||
667 | 662 | ||
668 | status = SCI_SUCCESS; | 663 | status = SCI_SUCCESS; |
669 | } else if (protocols.u.bits.attached_stp_target == 1) { | 664 | } else if (protocols.u.bits.attached_stp_target == 1) { |
670 | if (sci_rnc->device->is_direct_attached) { | 665 | if (rnc_to_dev(sci_rnc)->is_direct_attached) { |
671 | /* @todo Fix this since I am being silly in writing to the STPTLDARNI register. */ | 666 | /* @todo Fix this since I am being silly in writing to the STPTLDARNI register. */ |
672 | sci_base_state_machine_change_state( | 667 | sci_base_state_machine_change_state( |
673 | &sci_rnc->state_machine, | 668 | &sci_rnc->state_machine, |
@@ -792,7 +787,7 @@ static enum sci_status scic_sds_remote_node_context_await_suspension_state_event | |||
792 | break; | 787 | break; |
793 | 788 | ||
794 | default: | 789 | default: |
795 | dev_warn(scirdev_to_dev(sci_rnc->device), | 790 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
796 | "%s: SCIC Remote Node Context 0x%p requested to " | 791 | "%s: SCIC Remote Node Context 0x%p requested to " |
797 | "process event 0x%x while in state %d.\n", | 792 | "process event 0x%x while in state %d.\n", |
798 | __func__, | 793 | __func__, |
@@ -937,34 +932,26 @@ static void scic_sds_remote_node_context_continue_state_transitions( | |||
937 | static void scic_sds_remote_node_context_validate_context_buffer( | 932 | static void scic_sds_remote_node_context_validate_context_buffer( |
938 | struct scic_sds_remote_node_context *sci_rnc) | 933 | struct scic_sds_remote_node_context *sci_rnc) |
939 | { | 934 | { |
935 | struct scic_sds_remote_device *sci_dev = rnc_to_dev(sci_rnc); | ||
940 | union scu_remote_node_context *rnc_buffer; | 936 | union scu_remote_node_context *rnc_buffer; |
941 | 937 | ||
942 | rnc_buffer = scic_sds_controller_get_remote_node_context_buffer( | 938 | rnc_buffer = scic_sds_controller_get_remote_node_context_buffer( |
943 | scic_sds_remote_device_get_controller(sci_rnc->device), | 939 | scic_sds_remote_device_get_controller(sci_dev), |
944 | sci_rnc->remote_node_index | 940 | sci_rnc->remote_node_index |
945 | ); | 941 | ); |
946 | 942 | ||
947 | rnc_buffer->ssp.is_valid = true; | 943 | rnc_buffer->ssp.is_valid = true; |
948 | 944 | ||
949 | if ( | 945 | if (!sci_dev->is_direct_attached && |
950 | !sci_rnc->device->is_direct_attached | 946 | sci_dev->target_protocols.u.bits.attached_stp_target) { |
951 | && sci_rnc->device->target_protocols.u.bits.attached_stp_target | 947 | scic_sds_remote_device_post_request(sci_dev, |
952 | ) { | 948 | SCU_CONTEXT_COMMAND_POST_RNC_96); |
953 | scic_sds_remote_device_post_request( | ||
954 | sci_rnc->device, | ||
955 | SCU_CONTEXT_COMMAND_POST_RNC_96 | ||
956 | ); | ||
957 | } else { | 949 | } else { |
958 | scic_sds_remote_device_post_request( | 950 | scic_sds_remote_device_post_request(sci_dev, SCU_CONTEXT_COMMAND_POST_RNC_32); |
959 | sci_rnc->device, | ||
960 | SCU_CONTEXT_COMMAND_POST_RNC_32 | ||
961 | ); | ||
962 | 951 | ||
963 | if (sci_rnc->device->is_direct_attached) { | 952 | if (sci_dev->is_direct_attached) { |
964 | scic_sds_port_setup_transports( | 953 | scic_sds_port_setup_transports(sci_dev->owning_port, |
965 | sci_rnc->device->owning_port, | 954 | sci_rnc->remote_node_index); |
966 | sci_rnc->remote_node_index | ||
967 | ); | ||
968 | } | 955 | } |
969 | } | 956 | } |
970 | } | 957 | } |
@@ -981,16 +968,13 @@ static void scic_sds_remote_node_context_invalidate_context_buffer( | |||
981 | union scu_remote_node_context *rnc_buffer; | 968 | union scu_remote_node_context *rnc_buffer; |
982 | 969 | ||
983 | rnc_buffer = scic_sds_controller_get_remote_node_context_buffer( | 970 | rnc_buffer = scic_sds_controller_get_remote_node_context_buffer( |
984 | scic_sds_remote_device_get_controller(sci_rnc->device), | 971 | scic_sds_remote_device_get_controller(rnc_to_dev(sci_rnc)), |
985 | sci_rnc->remote_node_index | 972 | sci_rnc->remote_node_index); |
986 | ); | ||
987 | 973 | ||
988 | rnc_buffer->ssp.is_valid = false; | 974 | rnc_buffer->ssp.is_valid = false; |
989 | 975 | ||
990 | scic_sds_remote_device_post_request( | 976 | scic_sds_remote_device_post_request(rnc_to_dev(sci_rnc), |
991 | sci_rnc->device, | 977 | SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE); |
992 | SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE | ||
993 | ); | ||
994 | } | 978 | } |
995 | 979 | ||
996 | /* | 980 | /* |
@@ -1081,8 +1065,10 @@ static void scic_sds_remote_node_context_resuming_state_enter( | |||
1081 | { | 1065 | { |
1082 | struct scic_sds_remote_node_context *rnc; | 1066 | struct scic_sds_remote_node_context *rnc; |
1083 | struct smp_discover_response_protocols protocols; | 1067 | struct smp_discover_response_protocols protocols; |
1068 | struct scic_sds_remote_device *sci_dev; | ||
1084 | 1069 | ||
1085 | rnc = (struct scic_sds_remote_node_context *)object; | 1070 | rnc = (struct scic_sds_remote_node_context *)object; |
1071 | sci_dev = rnc_to_dev(rnc); | ||
1086 | 1072 | ||
1087 | SET_STATE_HANDLER( | 1073 | SET_STATE_HANDLER( |
1088 | rnc, | 1074 | rnc, |
@@ -1096,18 +1082,15 @@ static void scic_sds_remote_node_context_resuming_state_enter( | |||
1096 | * resume because of a target reset we also need to update | 1082 | * resume because of a target reset we also need to update |
1097 | * the STPTLDARNI register with the RNi of the device | 1083 | * the STPTLDARNI register with the RNi of the device |
1098 | */ | 1084 | */ |
1099 | scic_remote_device_get_protocols(rnc->device, &protocols); | 1085 | scic_remote_device_get_protocols(sci_dev, &protocols); |
1100 | 1086 | ||
1101 | if ((protocols.u.bits.attached_stp_target == 1) && | 1087 | if (protocols.u.bits.attached_stp_target == 1 && |
1102 | (rnc->device->is_direct_attached)) { | 1088 | sci_dev->is_direct_attached) { |
1103 | scic_sds_port_setup_transports( | 1089 | scic_sds_port_setup_transports(sci_dev->owning_port, |
1104 | rnc->device->owning_port, rnc->remote_node_index); | 1090 | rnc->remote_node_index); |
1105 | } | 1091 | } |
1106 | 1092 | ||
1107 | scic_sds_remote_device_post_request( | 1093 | scic_sds_remote_device_post_request(sci_dev, SCU_CONTEXT_COMMAND_POST_RNC_RESUME); |
1108 | rnc->device, | ||
1109 | SCU_CONTEXT_COMMAND_POST_RNC_RESUME | ||
1110 | ); | ||
1111 | } | 1094 | } |
1112 | 1095 | ||
1113 | /** | 1096 | /** |
@@ -1225,15 +1208,12 @@ static const struct sci_base_state scic_sds_remote_node_context_state_table[] = | |||
1225 | }, | 1208 | }, |
1226 | }; | 1209 | }; |
1227 | 1210 | ||
1228 | void scic_sds_remote_node_context_construct( | 1211 | void scic_sds_remote_node_context_construct(struct scic_sds_remote_node_context *rnc, |
1229 | struct scic_sds_remote_device *device, | 1212 | u16 remote_node_index) |
1230 | struct scic_sds_remote_node_context *rnc, | ||
1231 | u16 remote_node_index) | ||
1232 | { | 1213 | { |
1233 | memset(rnc, 0, sizeof(struct scic_sds_remote_node_context)); | 1214 | memset(rnc, 0, sizeof(struct scic_sds_remote_node_context)); |
1234 | 1215 | ||
1235 | rnc->remote_node_index = remote_node_index; | 1216 | rnc->remote_node_index = remote_node_index; |
1236 | rnc->device = device; | ||
1237 | rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_UNSPECIFIED; | 1217 | rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_UNSPECIFIED; |
1238 | 1218 | ||
1239 | sci_base_state_machine_construct( | 1219 | sci_base_state_machine_construct( |
diff --git a/drivers/scsi/isci/core/scic_sds_remote_node_context.h b/drivers/scsi/isci/core/scic_sds_remote_node_context.h index a103f155bcc4..b3f2546090dd 100644 --- a/drivers/scsi/isci/core/scic_sds_remote_node_context.h +++ b/drivers/scsi/isci/core/scic_sds_remote_node_context.h | |||
@@ -232,15 +232,6 @@ struct scic_sds_remote_node_context { | |||
232 | struct sci_base_object parent; | 232 | struct sci_base_object parent; |
233 | 233 | ||
234 | /** | 234 | /** |
235 | * This pointer simply points to the remote device object containing | ||
236 | * this RNC. | ||
237 | * | ||
238 | * @todo Consider making the device pointer the associated object of the | ||
239 | * the parent object. | ||
240 | */ | ||
241 | struct scic_sds_remote_device *device; | ||
242 | |||
243 | /** | ||
244 | * This field indicates the remote node index (RNI) associated with | 235 | * This field indicates the remote node index (RNI) associated with |
245 | * this RNC. | 236 | * this RNC. |
246 | */ | 237 | */ |
@@ -279,10 +270,8 @@ struct scic_sds_remote_node_context { | |||
279 | struct scic_sds_remote_node_context_handlers *state_handlers; | 270 | struct scic_sds_remote_node_context_handlers *state_handlers; |
280 | }; | 271 | }; |
281 | 272 | ||
282 | void scic_sds_remote_node_context_construct( | 273 | void scic_sds_remote_node_context_construct(struct scic_sds_remote_node_context *rnc, |
283 | struct scic_sds_remote_device *device, | 274 | u16 remote_node_index); |
284 | struct scic_sds_remote_node_context *rnc, | ||
285 | u16 remote_node_index); | ||
286 | 275 | ||
287 | 276 | ||
288 | bool scic_sds_remote_node_context_is_ready( | 277 | bool scic_sds_remote_node_context_is_ready( |