aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/host.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-06-30 19:31:37 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:04:52 -0400
commit78a6f06e0e82125787d7aa308fe28c2c8381540c (patch)
tree55ab54546aab6dbaccda4ff6d196d8995f453c83 /drivers/scsi/isci/host.c
parentffe191c92ff195d73f9130b1490045ca2dd4c5e0 (diff)
isci: unify isci_remote_device and scic_sds_remote_device
Remove the distinction between these two implementations and unify on isci_remote_device (local instances named idev). Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/host.c')
-rw-r--r--drivers/scsi/isci/host.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c
index 4e11f9e6d76..45d7f71c609 100644
--- a/drivers/scsi/isci/host.c
+++ b/drivers/scsi/isci/host.c
@@ -272,7 +272,7 @@ static void scic_sds_controller_sdma_completion(struct scic_sds_controller *scic
272{ 272{
273 u32 index; 273 u32 index;
274 struct isci_request *ireq; 274 struct isci_request *ireq;
275 struct scic_sds_remote_device *device; 275 struct isci_remote_device *idev;
276 276
277 index = SCU_GET_COMPLETION_INDEX(completion_entry); 277 index = SCU_GET_COMPLETION_INDEX(completion_entry);
278 278
@@ -289,9 +289,9 @@ static void scic_sds_controller_sdma_completion(struct scic_sds_controller *scic
289 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_RNC: 289 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_RNC:
290 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_OTHER_RNC: 290 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_OTHER_RNC:
291 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_RNC: 291 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_RNC:
292 device = scic->device_table[index]; 292 idev = scic->device_table[index];
293 dev_warn(scic_to_dev(scic), "%s: %x for device %p\n", 293 dev_warn(scic_to_dev(scic), "%s: %x for device %p\n",
294 __func__, completion_entry, device); 294 __func__, completion_entry, idev);
295 /* @todo For a port RNC operation we need to fail the 295 /* @todo For a port RNC operation we need to fail the
296 * device 296 * device
297 */ 297 */
@@ -312,7 +312,7 @@ static void scic_sds_controller_unsolicited_frame(struct scic_sds_controller *sc
312 struct isci_host *ihost = scic_to_ihost(scic); 312 struct isci_host *ihost = scic_to_ihost(scic);
313 struct scu_unsolicited_frame_header *frame_header; 313 struct scu_unsolicited_frame_header *frame_header;
314 struct isci_phy *iphy; 314 struct isci_phy *iphy;
315 struct scic_sds_remote_device *device; 315 struct isci_remote_device *idev;
316 316
317 enum sci_status result = SCI_FAILURE; 317 enum sci_status result = SCI_FAILURE;
318 318
@@ -348,12 +348,12 @@ static void scic_sds_controller_unsolicited_frame(struct scic_sds_controller *sc
348 result = scic_sds_phy_frame_handler(iphy, frame_index); 348 result = scic_sds_phy_frame_handler(iphy, frame_index);
349 } else { 349 } else {
350 if (index < scic->remote_node_entries) 350 if (index < scic->remote_node_entries)
351 device = scic->device_table[index]; 351 idev = scic->device_table[index];
352 else 352 else
353 device = NULL; 353 idev = NULL;
354 354
355 if (device != NULL) 355 if (idev != NULL)
356 result = scic_sds_remote_device_frame_handler(device, frame_index); 356 result = scic_sds_remote_device_frame_handler(idev, frame_index);
357 else 357 else
358 scic_sds_controller_release_frame(scic, frame_index); 358 scic_sds_controller_release_frame(scic, frame_index);
359 } 359 }
@@ -370,7 +370,7 @@ static void scic_sds_controller_event_completion(struct scic_sds_controller *sci
370 u32 completion_entry) 370 u32 completion_entry)
371{ 371{
372 struct isci_host *ihost = scic_to_ihost(scic); 372 struct isci_host *ihost = scic_to_ihost(scic);
373 struct scic_sds_remote_device *device; 373 struct isci_remote_device *idev;
374 struct isci_request *ireq; 374 struct isci_request *ireq;
375 struct isci_phy *iphy; 375 struct isci_phy *iphy;
376 u32 index; 376 u32 index;
@@ -426,9 +426,9 @@ static void scic_sds_controller_event_completion(struct scic_sds_controller *sci
426 break; 426 break;
427 427
428 case SCU_EVENT_SPECIFIC_IT_NEXUS_TIMEOUT: 428 case SCU_EVENT_SPECIFIC_IT_NEXUS_TIMEOUT:
429 device = scic->device_table[index]; 429 idev = scic->device_table[index];
430 if (device != NULL) 430 if (idev != NULL)
431 scic_sds_remote_device_event_handler(device, completion_entry); 431 scic_sds_remote_device_event_handler(idev, completion_entry);
432 else 432 else
433 dev_warn(scic_to_dev(scic), 433 dev_warn(scic_to_dev(scic),
434 "%s: SCIC Controller 0x%p received " 434 "%s: SCIC Controller 0x%p received "
@@ -460,10 +460,10 @@ static void scic_sds_controller_event_completion(struct scic_sds_controller *sci
460 case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX: 460 case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX:
461 case SCU_EVENT_TYPE_RNC_OPS_MISC: 461 case SCU_EVENT_TYPE_RNC_OPS_MISC:
462 if (index < scic->remote_node_entries) { 462 if (index < scic->remote_node_entries) {
463 device = scic->device_table[index]; 463 idev = scic->device_table[index];
464 464
465 if (device != NULL) 465 if (idev != NULL)
466 scic_sds_remote_device_event_handler(device, completion_entry); 466 scic_sds_remote_device_event_handler(idev, completion_entry);
467 } else 467 } else
468 dev_err(scic_to_dev(scic), 468 dev_err(scic_to_dev(scic),
469 "%s: SCIC Controller 0x%p received event 0x%x " 469 "%s: SCIC Controller 0x%p received event 0x%x "
@@ -2549,13 +2549,13 @@ static bool scic_sds_controller_has_remote_devices_stopping(
2549 * object that the remote device has stopped. 2549 * object that the remote device has stopped.
2550 */ 2550 */
2551void scic_sds_controller_remote_device_stopped(struct scic_sds_controller *scic, 2551void scic_sds_controller_remote_device_stopped(struct scic_sds_controller *scic,
2552 struct scic_sds_remote_device *sci_dev) 2552 struct isci_remote_device *idev)
2553{ 2553{
2554 if (scic->sm.current_state_id != SCIC_STOPPING) { 2554 if (scic->sm.current_state_id != SCIC_STOPPING) {
2555 dev_dbg(scic_to_dev(scic), 2555 dev_dbg(scic_to_dev(scic),
2556 "SCIC Controller 0x%p remote device stopped event " 2556 "SCIC Controller 0x%p remote device stopped event "
2557 "from device 0x%p in unexpected state %d\n", 2557 "from device 0x%p in unexpected state %d\n",
2558 scic, sci_dev, 2558 scic, idev,
2559 scic->sm.current_state_id); 2559 scic->sm.current_state_id);
2560 return; 2560 return;
2561 } 2561 }
@@ -2622,18 +2622,18 @@ struct isci_request *scic_request_by_tag(struct scic_sds_controller *scic, u16 i
2622 */ 2622 */
2623enum sci_status scic_sds_controller_allocate_remote_node_context( 2623enum sci_status scic_sds_controller_allocate_remote_node_context(
2624 struct scic_sds_controller *scic, 2624 struct scic_sds_controller *scic,
2625 struct scic_sds_remote_device *sci_dev, 2625 struct isci_remote_device *idev,
2626 u16 *node_id) 2626 u16 *node_id)
2627{ 2627{
2628 u16 node_index; 2628 u16 node_index;
2629 u32 remote_node_count = scic_sds_remote_device_node_count(sci_dev); 2629 u32 remote_node_count = scic_sds_remote_device_node_count(idev);
2630 2630
2631 node_index = scic_sds_remote_node_table_allocate_remote_node( 2631 node_index = scic_sds_remote_node_table_allocate_remote_node(
2632 &scic->available_remote_nodes, remote_node_count 2632 &scic->available_remote_nodes, remote_node_count
2633 ); 2633 );
2634 2634
2635 if (node_index != SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) { 2635 if (node_index != SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) {
2636 scic->device_table[node_index] = sci_dev; 2636 scic->device_table[node_index] = idev;
2637 2637
2638 *node_id = node_index; 2638 *node_id = node_index;
2639 2639
@@ -2654,12 +2654,12 @@ enum sci_status scic_sds_controller_allocate_remote_node_context(
2654 */ 2654 */
2655void scic_sds_controller_free_remote_node_context( 2655void scic_sds_controller_free_remote_node_context(
2656 struct scic_sds_controller *scic, 2656 struct scic_sds_controller *scic,
2657 struct scic_sds_remote_device *sci_dev, 2657 struct isci_remote_device *idev,
2658 u16 node_id) 2658 u16 node_id)
2659{ 2659{
2660 u32 remote_node_count = scic_sds_remote_device_node_count(sci_dev); 2660 u32 remote_node_count = scic_sds_remote_device_node_count(idev);
2661 2661
2662 if (scic->device_table[node_id] == sci_dev) { 2662 if (scic->device_table[node_id] == idev) {
2663 scic->device_table[node_id] = NULL; 2663 scic->device_table[node_id] = NULL;
2664 2664
2665 scic_sds_remote_node_table_release_remote_node_index( 2665 scic_sds_remote_node_table_release_remote_node_index(
@@ -2798,7 +2798,7 @@ enum sci_status isci_free_tag(struct isci_host *ihost, u16 io_tag)
2798 * user desires to be utilized for this request. 2798 * user desires to be utilized for this request.
2799 */ 2799 */
2800enum sci_status scic_controller_start_io(struct scic_sds_controller *scic, 2800enum sci_status scic_controller_start_io(struct scic_sds_controller *scic,
2801 struct scic_sds_remote_device *rdev, 2801 struct isci_remote_device *idev,
2802 struct isci_request *ireq) 2802 struct isci_request *ireq)
2803{ 2803{
2804 enum sci_status status; 2804 enum sci_status status;
@@ -2808,7 +2808,7 @@ enum sci_status scic_controller_start_io(struct scic_sds_controller *scic,
2808 return SCI_FAILURE_INVALID_STATE; 2808 return SCI_FAILURE_INVALID_STATE;
2809 } 2809 }
2810 2810
2811 status = scic_sds_remote_device_start_io(scic, rdev, ireq); 2811 status = scic_sds_remote_device_start_io(scic, idev, ireq);
2812 if (status != SCI_SUCCESS) 2812 if (status != SCI_SUCCESS)
2813 return status; 2813 return status;
2814 2814
@@ -2835,7 +2835,7 @@ enum sci_status scic_controller_start_io(struct scic_sds_controller *scic,
2835 */ 2835 */
2836enum sci_status scic_controller_terminate_request( 2836enum sci_status scic_controller_terminate_request(
2837 struct scic_sds_controller *scic, 2837 struct scic_sds_controller *scic,
2838 struct scic_sds_remote_device *rdev, 2838 struct isci_remote_device *idev,
2839 struct isci_request *ireq) 2839 struct isci_request *ireq)
2840{ 2840{
2841 enum sci_status status; 2841 enum sci_status status;
@@ -2873,7 +2873,7 @@ enum sci_status scic_controller_terminate_request(
2873 */ 2873 */
2874enum sci_status scic_controller_complete_io( 2874enum sci_status scic_controller_complete_io(
2875 struct scic_sds_controller *scic, 2875 struct scic_sds_controller *scic,
2876 struct scic_sds_remote_device *rdev, 2876 struct isci_remote_device *idev,
2877 struct isci_request *ireq) 2877 struct isci_request *ireq)
2878{ 2878{
2879 enum sci_status status; 2879 enum sci_status status;
@@ -2884,7 +2884,7 @@ enum sci_status scic_controller_complete_io(
2884 /* XXX: Implement this function */ 2884 /* XXX: Implement this function */
2885 return SCI_FAILURE; 2885 return SCI_FAILURE;
2886 case SCIC_READY: 2886 case SCIC_READY:
2887 status = scic_sds_remote_device_complete_io(scic, rdev, ireq); 2887 status = scic_sds_remote_device_complete_io(scic, idev, ireq);
2888 if (status != SCI_SUCCESS) 2888 if (status != SCI_SUCCESS)
2889 return status; 2889 return status;
2890 2890
@@ -2923,7 +2923,7 @@ enum sci_status scic_controller_continue_io(struct isci_request *ireq)
2923 */ 2923 */
2924enum sci_task_status scic_controller_start_task( 2924enum sci_task_status scic_controller_start_task(
2925 struct scic_sds_controller *scic, 2925 struct scic_sds_controller *scic,
2926 struct scic_sds_remote_device *rdev, 2926 struct isci_remote_device *idev,
2927 struct isci_request *ireq) 2927 struct isci_request *ireq)
2928{ 2928{
2929 enum sci_status status; 2929 enum sci_status status;
@@ -2936,7 +2936,7 @@ enum sci_task_status scic_controller_start_task(
2936 return SCI_TASK_FAILURE_INVALID_STATE; 2936 return SCI_TASK_FAILURE_INVALID_STATE;
2937 } 2937 }
2938 2938
2939 status = scic_sds_remote_device_start_task(scic, rdev, ireq); 2939 status = scic_sds_remote_device_start_task(scic, idev, ireq);
2940 switch (status) { 2940 switch (status) {
2941 case SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS: 2941 case SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS:
2942 set_bit(IREQ_ACTIVE, &ireq->flags); 2942 set_bit(IREQ_ACTIVE, &ireq->flags);