Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

isci: retire scic_sds_ and scic_ prefixes

The distinction between scic_sds_ scic_ and sci_ are no longer relevant
so just unify the prefixes on sci_. The distinction between isci_ and
sci_ is historically significant, and useful for comparing the old
'core' to the current Linux driver. 'sci_' represents the former core as
well as the routines that are closer to the hardware and protocol than
their 'isci_' brethren. sci == sas controller interface.

Also unwind the 'sds1' out of the parameter structs.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

+1453 -1947
+281 -461
drivers/scsi/isci/host.c
··· 180 180 handler(sm); 181 181 } 182 182 183 - static bool scic_sds_controller_completion_queue_has_entries( 184 - struct isci_host *ihost) 183 + static bool sci_controller_completion_queue_has_entries(struct isci_host *ihost) 185 184 { 186 185 u32 get_value = ihost->completion_queue_get; 187 186 u32 get_index = get_value & SMU_COMPLETION_QUEUE_GET_POINTER_MASK; ··· 192 193 return false; 193 194 } 194 195 195 - static bool scic_sds_controller_isr(struct isci_host *ihost) 196 + static bool sci_controller_isr(struct isci_host *ihost) 196 197 { 197 - if (scic_sds_controller_completion_queue_has_entries(ihost)) { 198 + if (sci_controller_completion_queue_has_entries(ihost)) { 198 199 return true; 199 200 } else { 200 201 /* ··· 218 219 { 219 220 struct isci_host *ihost = data; 220 221 221 - if (scic_sds_controller_isr(ihost)) 222 + if (sci_controller_isr(ihost)) 222 223 tasklet_schedule(&ihost->completion_tasklet); 223 224 224 225 return IRQ_HANDLED; 225 226 } 226 227 227 - static bool scic_sds_controller_error_isr(struct isci_host *ihost) 228 + static bool sci_controller_error_isr(struct isci_host *ihost) 228 229 { 229 230 u32 interrupt_status; 230 231 ··· 251 252 return false; 252 253 } 253 254 254 - static void scic_sds_controller_task_completion(struct isci_host *ihost, 255 - u32 completion_entry) 255 + static void sci_controller_task_completion(struct isci_host *ihost, u32 ent) 256 256 { 257 - u32 index = SCU_GET_COMPLETION_INDEX(completion_entry); 257 + u32 index = SCU_GET_COMPLETION_INDEX(ent); 258 258 struct isci_request *ireq = ihost->reqs[index]; 259 259 260 260 /* Make sure that we really want to process this IO request */ 261 261 if (test_bit(IREQ_ACTIVE, &ireq->flags) && 262 262 ireq->io_tag != SCI_CONTROLLER_INVALID_IO_TAG && 263 263 ISCI_TAG_SEQ(ireq->io_tag) == ihost->io_request_sequence[index]) 264 - /* Yep this is a valid io request pass it along to the io request handler */ 265 - scic_sds_io_request_tc_completion(ireq, completion_entry); 264 + /* Yep this is a valid io request pass it along to the 265 + * io request handler 266 + */ 267 + sci_io_request_tc_completion(ireq, ent); 266 268 } 267 269 268 - static void scic_sds_controller_sdma_completion(struct isci_host *ihost, 269 - u32 completion_entry) 270 + static void sci_controller_sdma_completion(struct isci_host *ihost, u32 ent) 270 271 { 271 272 u32 index; 272 273 struct isci_request *ireq; 273 274 struct isci_remote_device *idev; 274 275 275 - index = SCU_GET_COMPLETION_INDEX(completion_entry); 276 + index = SCU_GET_COMPLETION_INDEX(ent); 276 277 277 - switch (scu_get_command_request_type(completion_entry)) { 278 + switch (scu_get_command_request_type(ent)) { 278 279 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC: 279 280 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_TC: 280 281 ireq = ihost->reqs[index]; 281 282 dev_warn(&ihost->pdev->dev, "%s: %x for io request %p\n", 282 - __func__, completion_entry, ireq); 283 + __func__, ent, ireq); 283 284 /* @todo For a post TC operation we need to fail the IO 284 285 * request 285 286 */ ··· 289 290 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_RNC: 290 291 idev = ihost->device_table[index]; 291 292 dev_warn(&ihost->pdev->dev, "%s: %x for device %p\n", 292 - __func__, completion_entry, idev); 293 + __func__, ent, idev); 293 294 /* @todo For a port RNC operation we need to fail the 294 295 * device 295 296 */ 296 297 break; 297 298 default: 298 299 dev_warn(&ihost->pdev->dev, "%s: unknown completion type %x\n", 299 - __func__, completion_entry); 300 + __func__, ent); 300 301 break; 301 302 } 302 303 } 303 304 304 - static void scic_sds_controller_unsolicited_frame(struct isci_host *ihost, 305 - u32 completion_entry) 305 + static void sci_controller_unsolicited_frame(struct isci_host *ihost, u32 ent) 306 306 { 307 307 u32 index; 308 308 u32 frame_index; ··· 312 314 313 315 enum sci_status result = SCI_FAILURE; 314 316 315 - frame_index = SCU_GET_FRAME_INDEX(completion_entry); 317 + frame_index = SCU_GET_FRAME_INDEX(ent); 316 318 317 319 frame_header = ihost->uf_control.buffers.array[frame_index].header; 318 320 ihost->uf_control.buffers.array[frame_index].state = UNSOLICITED_FRAME_IN_USE; 319 321 320 - if (SCU_GET_FRAME_ERROR(completion_entry)) { 322 + if (SCU_GET_FRAME_ERROR(ent)) { 321 323 /* 322 324 * / @todo If the IAF frame or SIGNATURE FIS frame has an error will 323 325 * / this cause a problem? We expect the phy initialization will 324 326 * / fail if there is an error in the frame. */ 325 - scic_sds_controller_release_frame(ihost, frame_index); 327 + sci_controller_release_frame(ihost, frame_index); 326 328 return; 327 329 } 328 330 329 331 if (frame_header->is_address_frame) { 330 - index = SCU_GET_PROTOCOL_ENGINE_INDEX(completion_entry); 332 + index = SCU_GET_PROTOCOL_ENGINE_INDEX(ent); 331 333 iphy = &ihost->phys[index]; 332 - result = scic_sds_phy_frame_handler(iphy, frame_index); 334 + result = sci_phy_frame_handler(iphy, frame_index); 333 335 } else { 334 336 335 - index = SCU_GET_COMPLETION_INDEX(completion_entry); 337 + index = SCU_GET_COMPLETION_INDEX(ent); 336 338 337 339 if (index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) { 338 340 /* 339 341 * This is a signature fis or a frame from a direct attached SATA 340 342 * device that has not yet been created. In either case forwared 341 343 * the frame to the PE and let it take care of the frame data. */ 342 - index = SCU_GET_PROTOCOL_ENGINE_INDEX(completion_entry); 344 + index = SCU_GET_PROTOCOL_ENGINE_INDEX(ent); 343 345 iphy = &ihost->phys[index]; 344 - result = scic_sds_phy_frame_handler(iphy, frame_index); 346 + result = sci_phy_frame_handler(iphy, frame_index); 345 347 } else { 346 348 if (index < ihost->remote_node_entries) 347 349 idev = ihost->device_table[index]; ··· 349 351 idev = NULL; 350 352 351 353 if (idev != NULL) 352 - result = scic_sds_remote_device_frame_handler(idev, frame_index); 354 + result = sci_remote_device_frame_handler(idev, frame_index); 353 355 else 354 - scic_sds_controller_release_frame(ihost, frame_index); 356 + sci_controller_release_frame(ihost, frame_index); 355 357 } 356 358 } 357 359 ··· 362 364 } 363 365 } 364 366 365 - static void scic_sds_controller_event_completion(struct isci_host *ihost, 366 - u32 completion_entry) 367 + static void sci_controller_event_completion(struct isci_host *ihost, u32 ent) 367 368 { 368 369 struct isci_remote_device *idev; 369 370 struct isci_request *ireq; 370 371 struct isci_phy *iphy; 371 372 u32 index; 372 373 373 - index = SCU_GET_COMPLETION_INDEX(completion_entry); 374 + index = SCU_GET_COMPLETION_INDEX(ent); 374 375 375 - switch (scu_get_event_type(completion_entry)) { 376 + switch (scu_get_event_type(ent)) { 376 377 case SCU_EVENT_TYPE_SMU_COMMAND_ERROR: 377 378 /* / @todo The driver did something wrong and we need to fix the condtion. */ 378 379 dev_err(&ihost->pdev->dev, ··· 379 382 "0x%x\n", 380 383 __func__, 381 384 ihost, 382 - completion_entry); 385 + ent); 383 386 break; 384 387 385 388 case SCU_EVENT_TYPE_SMU_PCQ_ERROR: ··· 393 396 "event 0x%x\n", 394 397 __func__, 395 398 ihost, 396 - completion_entry); 399 + ent); 397 400 break; 398 401 399 402 case SCU_EVENT_TYPE_TRANSPORT_ERROR: 400 403 ireq = ihost->reqs[index]; 401 - scic_sds_io_request_event_handler(ireq, completion_entry); 404 + sci_io_request_event_handler(ireq, ent); 402 405 break; 403 406 404 407 case SCU_EVENT_TYPE_PTX_SCHEDULE_EVENT: 405 - switch (scu_get_event_specifier(completion_entry)) { 408 + switch (scu_get_event_specifier(ent)) { 406 409 case SCU_EVENT_SPECIFIC_SMP_RESPONSE_NO_PE: 407 410 case SCU_EVENT_SPECIFIC_TASK_TIMEOUT: 408 411 ireq = ihost->reqs[index]; 409 412 if (ireq != NULL) 410 - scic_sds_io_request_event_handler(ireq, completion_entry); 413 + sci_io_request_event_handler(ireq, ent); 411 414 else 412 415 dev_warn(&ihost->pdev->dev, 413 416 "%s: SCIC Controller 0x%p received " ··· 415 418 "that doesnt exist.\n", 416 419 __func__, 417 420 ihost, 418 - completion_entry); 421 + ent); 419 422 420 423 break; 421 424 422 425 case SCU_EVENT_SPECIFIC_IT_NEXUS_TIMEOUT: 423 426 idev = ihost->device_table[index]; 424 427 if (idev != NULL) 425 - scic_sds_remote_device_event_handler(idev, completion_entry); 428 + sci_remote_device_event_handler(idev, ent); 426 429 else 427 430 dev_warn(&ihost->pdev->dev, 428 431 "%s: SCIC Controller 0x%p received " ··· 430 433 "that doesnt exist.\n", 431 434 __func__, 432 435 ihost, 433 - completion_entry); 436 + ent); 434 437 435 438 break; 436 439 } ··· 445 448 * direct error counter event to the phy object since that is where 446 449 * we get the event notification. This is a type 4 event. */ 447 450 case SCU_EVENT_TYPE_OSSP_EVENT: 448 - index = SCU_GET_PROTOCOL_ENGINE_INDEX(completion_entry); 451 + index = SCU_GET_PROTOCOL_ENGINE_INDEX(ent); 449 452 iphy = &ihost->phys[index]; 450 - scic_sds_phy_event_handler(iphy, completion_entry); 453 + sci_phy_event_handler(iphy, ent); 451 454 break; 452 455 453 456 case SCU_EVENT_TYPE_RNC_SUSPEND_TX: ··· 457 460 idev = ihost->device_table[index]; 458 461 459 462 if (idev != NULL) 460 - scic_sds_remote_device_event_handler(idev, completion_entry); 463 + sci_remote_device_event_handler(idev, ent); 461 464 } else 462 465 dev_err(&ihost->pdev->dev, 463 466 "%s: SCIC Controller 0x%p received event 0x%x " ··· 465 468 "exist.\n", 466 469 __func__, 467 470 ihost, 468 - completion_entry, 471 + ent, 469 472 index); 470 473 471 474 break; ··· 474 477 dev_warn(&ihost->pdev->dev, 475 478 "%s: SCIC Controller received unknown event code %x\n", 476 479 __func__, 477 - completion_entry); 480 + ent); 478 481 break; 479 482 } 480 483 } 481 484 482 - static void scic_sds_controller_process_completions(struct isci_host *ihost) 485 + static void sci_controller_process_completions(struct isci_host *ihost) 483 486 { 484 487 u32 completion_count = 0; 485 - u32 completion_entry; 488 + u32 ent; 486 489 u32 get_index; 487 490 u32 get_cycle; 488 491 u32 event_get; ··· 506 509 ) { 507 510 completion_count++; 508 511 509 - completion_entry = ihost->completion_queue[get_index]; 512 + ent = ihost->completion_queue[get_index]; 510 513 511 514 /* increment the get pointer and check for rollover to toggle the cycle bit */ 512 515 get_cycle ^= ((get_index+1) & SCU_MAX_COMPLETION_QUEUE_ENTRIES) << ··· 516 519 dev_dbg(&ihost->pdev->dev, 517 520 "%s: completion queue entry:0x%08x\n", 518 521 __func__, 519 - completion_entry); 522 + ent); 520 523 521 - switch (SCU_GET_COMPLETION_TYPE(completion_entry)) { 524 + switch (SCU_GET_COMPLETION_TYPE(ent)) { 522 525 case SCU_COMPLETION_TYPE_TASK: 523 - scic_sds_controller_task_completion(ihost, completion_entry); 526 + sci_controller_task_completion(ihost, ent); 524 527 break; 525 528 526 529 case SCU_COMPLETION_TYPE_SDMA: 527 - scic_sds_controller_sdma_completion(ihost, completion_entry); 530 + sci_controller_sdma_completion(ihost, ent); 528 531 break; 529 532 530 533 case SCU_COMPLETION_TYPE_UFI: 531 - scic_sds_controller_unsolicited_frame(ihost, completion_entry); 534 + sci_controller_unsolicited_frame(ihost, ent); 532 535 break; 533 536 534 537 case SCU_COMPLETION_TYPE_EVENT: ··· 537 540 (SMU_COMPLETION_QUEUE_GET_EVENT_CYCLE_BIT_SHIFT - SCU_MAX_EVENTS_SHIFT); 538 541 event_get = (event_get+1) & (SCU_MAX_EVENTS-1); 539 542 540 - scic_sds_controller_event_completion(ihost, completion_entry); 543 + sci_controller_event_completion(ihost, ent); 541 544 break; 542 545 } 543 546 default: ··· 545 548 "%s: SCIC Controller received unknown " 546 549 "completion type %x\n", 547 550 __func__, 548 - completion_entry); 551 + ent); 549 552 break; 550 553 } 551 554 } ··· 572 575 573 576 } 574 577 575 - static void scic_sds_controller_error_handler(struct isci_host *ihost) 578 + static void sci_controller_error_handler(struct isci_host *ihost) 576 579 { 577 580 u32 interrupt_status; 578 581 ··· 580 583 readl(&ihost->smu_registers->interrupt_status); 581 584 582 585 if ((interrupt_status & SMU_ISR_QUEUE_SUSPEND) && 583 - scic_sds_controller_completion_queue_has_entries(ihost)) { 586 + sci_controller_completion_queue_has_entries(ihost)) { 584 587 585 - scic_sds_controller_process_completions(ihost); 588 + sci_controller_process_completions(ihost); 586 589 writel(SMU_ISR_QUEUE_SUSPEND, &ihost->smu_registers->interrupt_status); 587 590 } else { 588 591 dev_err(&ihost->pdev->dev, "%s: status: %#x\n", __func__, ··· 604 607 irqreturn_t ret = IRQ_NONE; 605 608 struct isci_host *ihost = data; 606 609 607 - if (scic_sds_controller_isr(ihost)) { 610 + if (sci_controller_isr(ihost)) { 608 611 writel(SMU_ISR_COMPLETION, &ihost->smu_registers->interrupt_status); 609 612 tasklet_schedule(&ihost->completion_tasklet); 610 613 ret = IRQ_HANDLED; 611 - } else if (scic_sds_controller_error_isr(ihost)) { 614 + } else if (sci_controller_error_isr(ihost)) { 612 615 spin_lock(&ihost->scic_lock); 613 - scic_sds_controller_error_handler(ihost); 616 + sci_controller_error_handler(ihost); 614 617 spin_unlock(&ihost->scic_lock); 615 618 ret = IRQ_HANDLED; 616 619 } ··· 622 625 { 623 626 struct isci_host *ihost = data; 624 627 625 - if (scic_sds_controller_error_isr(ihost)) 626 - scic_sds_controller_error_handler(ihost); 628 + if (sci_controller_error_isr(ihost)) 629 + sci_controller_error_handler(ihost); 627 630 628 631 return IRQ_HANDLED; 629 632 } ··· 667 670 } 668 671 669 672 /** 670 - * scic_controller_get_suggested_start_timeout() - This method returns the 671 - * suggested scic_controller_start() timeout amount. The user is free to 673 + * sci_controller_get_suggested_start_timeout() - This method returns the 674 + * suggested sci_controller_start() timeout amount. The user is free to 672 675 * use any timeout value, but this method provides the suggested minimum 673 676 * start timeout value. The returned value is based upon empirical 674 677 * information determined as a result of interoperability testing. ··· 678 681 * This method returns the number of milliseconds for the suggested start 679 682 * operation timeout. 680 683 */ 681 - static u32 scic_controller_get_suggested_start_timeout(struct isci_host *ihost) 684 + static u32 sci_controller_get_suggested_start_timeout(struct isci_host *ihost) 682 685 { 683 686 /* Validate the user supplied parameters. */ 684 687 if (!ihost) ··· 703 706 + ((SCI_MAX_PHYS - 1) * SCIC_SDS_CONTROLLER_POWER_CONTROL_INTERVAL); 704 707 } 705 708 706 - static void scic_controller_enable_interrupts(struct isci_host *ihost) 709 + static void sci_controller_enable_interrupts(struct isci_host *ihost) 707 710 { 708 711 BUG_ON(ihost->smu_registers == NULL); 709 712 writel(0, &ihost->smu_registers->interrupt_mask); 710 713 } 711 714 712 - void scic_controller_disable_interrupts(struct isci_host *ihost) 715 + void sci_controller_disable_interrupts(struct isci_host *ihost) 713 716 { 714 717 BUG_ON(ihost->smu_registers == NULL); 715 718 writel(0xffffffff, &ihost->smu_registers->interrupt_mask); 716 719 } 717 720 718 - static void scic_sds_controller_enable_port_task_scheduler(struct isci_host *ihost) 721 + static void sci_controller_enable_port_task_scheduler(struct isci_host *ihost) 719 722 { 720 723 u32 port_task_scheduler_value; 721 724 ··· 728 731 &ihost->scu_registers->peg0.ptsg.control); 729 732 } 730 733 731 - static void scic_sds_controller_assign_task_entries(struct isci_host *ihost) 734 + static void sci_controller_assign_task_entries(struct isci_host *ihost) 732 735 { 733 736 u32 task_assignment; 734 737 ··· 749 752 750 753 } 751 754 752 - static void scic_sds_controller_initialize_completion_queue(struct isci_host *ihost) 755 + static void sci_controller_initialize_completion_queue(struct isci_host *ihost) 753 756 { 754 757 u32 index; 755 758 u32 completion_queue_control_value; ··· 796 799 } 797 800 } 798 801 799 - static void scic_sds_controller_initialize_unsolicited_frame_queue(struct isci_host *ihost) 802 + static void sci_controller_initialize_unsolicited_frame_queue(struct isci_host *ihost) 800 803 { 801 804 u32 frame_queue_control_value; 802 805 u32 frame_queue_get_value; ··· 823 826 &ihost->scu_registers->sdma.unsolicited_frame_put_pointer); 824 827 } 825 828 826 - /** 827 - * This method will attempt to transition into the ready state for the 828 - * controller and indicate that the controller start operation has completed 829 - * if all criteria are met. 830 - * @scic: This parameter indicates the controller object for which 831 - * to transition to ready. 832 - * @status: This parameter indicates the status value to be pass into the call 833 - * to scic_cb_controller_start_complete(). 834 - * 835 - * none. 836 - */ 837 - static void scic_sds_controller_transition_to_ready( 838 - struct isci_host *ihost, 839 - enum sci_status status) 829 + static void sci_controller_transition_to_ready(struct isci_host *ihost, enum sci_status status) 840 830 { 841 - 842 831 if (ihost->sm.current_state_id == SCIC_STARTING) { 843 832 /* 844 833 * We move into the ready state, because some of the phys/ports ··· 838 855 839 856 static bool is_phy_starting(struct isci_phy *iphy) 840 857 { 841 - enum scic_sds_phy_states state; 858 + enum sci_phy_states state; 842 859 843 860 state = iphy->sm.current_state_id; 844 861 switch (state) { ··· 859 876 } 860 877 861 878 /** 862 - * scic_sds_controller_start_next_phy - start phy 879 + * sci_controller_start_next_phy - start phy 863 880 * @scic: controller 864 881 * 865 882 * If all the phys have been started, then attempt to transition the 866 883 * controller to the READY state and inform the user 867 - * (scic_cb_controller_start_complete()). 884 + * (sci_cb_controller_start_complete()). 868 885 */ 869 - static enum sci_status scic_sds_controller_start_next_phy(struct isci_host *ihost) 886 + static enum sci_status sci_controller_start_next_phy(struct isci_host *ihost) 870 887 { 871 - struct scic_sds_oem_params *oem = &ihost->oem_parameters.sds1; 888 + struct sci_oem_params *oem = &ihost->oem_parameters; 872 889 struct isci_phy *iphy; 873 890 enum sci_status status; 874 891 ··· 907 924 * The controller has successfully finished the start process. 908 925 * Inform the SCI Core user and transition to the READY state. */ 909 926 if (is_controller_start_complete == true) { 910 - scic_sds_controller_transition_to_ready(ihost, SCI_SUCCESS); 927 + sci_controller_transition_to_ready(ihost, SCI_SUCCESS); 911 928 sci_del_timer(&ihost->phy_timer); 912 929 ihost->phy_startup_timer_pending = false; 913 930 } ··· 927 944 * incorrectly for the PORT or it was never 928 945 * assigned to a PORT 929 946 */ 930 - return scic_sds_controller_start_next_phy(ihost); 947 + return sci_controller_start_next_phy(ihost); 931 948 } 932 949 } 933 950 934 - status = scic_sds_phy_start(iphy); 951 + status = sci_phy_start(iphy); 935 952 936 953 if (status == SCI_SUCCESS) { 937 954 sci_mod_timer(&ihost->phy_timer, ··· 968 985 ihost->phy_startup_timer_pending = false; 969 986 970 987 do { 971 - status = scic_sds_controller_start_next_phy(ihost); 988 + status = sci_controller_start_next_phy(ihost); 972 989 } while (status != SCI_SUCCESS); 973 990 974 991 done: ··· 980 997 return CIRC_CNT(ihost->tci_head, ihost->tci_tail, SCI_MAX_IO_REQUESTS); 981 998 } 982 999 983 - static enum sci_status scic_controller_start(struct isci_host *ihost, 1000 + static enum sci_status sci_controller_start(struct isci_host *ihost, 984 1001 u32 timeout) 985 1002 { 986 1003 enum sci_status result; ··· 1001 1018 isci_tci_free(ihost, index); 1002 1019 1003 1020 /* Build the RNi free pool */ 1004 - scic_sds_remote_node_table_initialize( 1005 - &ihost->available_remote_nodes, 1006 - ihost->remote_node_entries); 1021 + sci_remote_node_table_initialize(&ihost->available_remote_nodes, 1022 + ihost->remote_node_entries); 1007 1023 1008 1024 /* 1009 1025 * Before anything else lets make sure we will not be 1010 1026 * interrupted by the hardware. 1011 1027 */ 1012 - scic_controller_disable_interrupts(ihost); 1028 + sci_controller_disable_interrupts(ihost); 1013 1029 1014 1030 /* Enable the port task scheduler */ 1015 - scic_sds_controller_enable_port_task_scheduler(ihost); 1031 + sci_controller_enable_port_task_scheduler(ihost); 1016 1032 1017 1033 /* Assign all the task entries to ihost physical function */ 1018 - scic_sds_controller_assign_task_entries(ihost); 1034 + sci_controller_assign_task_entries(ihost); 1019 1035 1020 1036 /* Now initialize the completion queue */ 1021 - scic_sds_controller_initialize_completion_queue(ihost); 1037 + sci_controller_initialize_completion_queue(ihost); 1022 1038 1023 1039 /* Initialize the unsolicited frame queue for use */ 1024 - scic_sds_controller_initialize_unsolicited_frame_queue(ihost); 1040 + sci_controller_initialize_unsolicited_frame_queue(ihost); 1025 1041 1026 1042 /* Start all of the ports on this controller */ 1027 1043 for (index = 0; index < ihost->logical_port_entries; index++) { 1028 1044 struct isci_port *iport = &ihost->ports[index]; 1029 1045 1030 - result = scic_sds_port_start(iport); 1046 + result = sci_port_start(iport); 1031 1047 if (result) 1032 1048 return result; 1033 1049 } 1034 1050 1035 - scic_sds_controller_start_next_phy(ihost); 1051 + sci_controller_start_next_phy(ihost); 1036 1052 1037 1053 sci_mod_timer(&ihost->timer, timeout); 1038 1054 ··· 1043 1061 void isci_host_scan_start(struct Scsi_Host *shost) 1044 1062 { 1045 1063 struct isci_host *ihost = SHOST_TO_SAS_HA(shost)->lldd_ha; 1046 - unsigned long tmo = scic_controller_get_suggested_start_timeout(ihost); 1064 + unsigned long tmo = sci_controller_get_suggested_start_timeout(ihost); 1047 1065 1048 1066 set_bit(IHOST_START_PENDING, &ihost->flags); 1049 1067 1050 1068 spin_lock_irq(&ihost->scic_lock); 1051 - scic_controller_start(ihost, tmo); 1052 - scic_controller_enable_interrupts(ihost); 1069 + sci_controller_start(ihost, tmo); 1070 + sci_controller_enable_interrupts(ihost); 1053 1071 spin_unlock_irq(&ihost->scic_lock); 1054 1072 } 1055 1073 1056 1074 static void isci_host_stop_complete(struct isci_host *ihost, enum sci_status completion_status) 1057 1075 { 1058 1076 isci_host_change_state(ihost, isci_stopped); 1059 - scic_controller_disable_interrupts(ihost); 1077 + sci_controller_disable_interrupts(ihost); 1060 1078 clear_bit(IHOST_STOP_PENDING, &ihost->flags); 1061 1079 wake_up(&ihost->eventq); 1062 1080 } 1063 1081 1064 - static void scic_sds_controller_completion_handler(struct isci_host *ihost) 1082 + static void sci_controller_completion_handler(struct isci_host *ihost) 1065 1083 { 1066 1084 /* Empty out the completion queue */ 1067 - if (scic_sds_controller_completion_queue_has_entries(ihost)) 1068 - scic_sds_controller_process_completions(ihost); 1085 + if (sci_controller_completion_queue_has_entries(ihost)) 1086 + sci_controller_process_completions(ihost); 1069 1087 1070 1088 /* Clear the interrupt and enable all interrupts again */ 1071 1089 writel(SMU_ISR_COMPLETION, &ihost->smu_registers->interrupt_status); ··· 1098 1116 1099 1117 spin_lock_irq(&ihost->scic_lock); 1100 1118 1101 - scic_sds_controller_completion_handler(ihost); 1119 + sci_controller_completion_handler(ihost); 1102 1120 1103 1121 /* Take the lists of completed I/Os from the host. */ 1104 1122 ··· 1185 1203 } 1186 1204 1187 1205 /** 1188 - * scic_controller_stop() - This method will stop an individual controller 1206 + * sci_controller_stop() - This method will stop an individual controller 1189 1207 * object.This method will invoke the associated user callback upon 1190 1208 * completion. The completion callback is called when the following 1191 1209 * conditions are met: -# the method return status is SCI_SUCCESS. -# the ··· 1202 1220 * controller is already in the STOPPED state. SCI_FAILURE_INVALID_STATE if the 1203 1221 * controller is not either in the STARTED or STOPPED states. 1204 1222 */ 1205 - static enum sci_status scic_controller_stop(struct isci_host *ihost, 1206 - u32 timeout) 1223 + static enum sci_status sci_controller_stop(struct isci_host *ihost, u32 timeout) 1207 1224 { 1208 1225 if (ihost->sm.current_state_id != SCIC_READY) { 1209 1226 dev_warn(&ihost->pdev->dev, ··· 1217 1236 } 1218 1237 1219 1238 /** 1220 - * scic_controller_reset() - This method will reset the supplied core 1239 + * sci_controller_reset() - This method will reset the supplied core 1221 1240 * controller regardless of the state of said controller. This operation is 1222 1241 * considered destructive. In other words, all current operations are wiped 1223 1242 * out. No IO completions for outstanding devices occur. Outstanding IO ··· 1228 1247 * SCI_SUCCESS if the reset operation successfully started. SCI_FATAL_ERROR if 1229 1248 * the controller reset operation is unable to complete. 1230 1249 */ 1231 - static enum sci_status scic_controller_reset(struct isci_host *ihost) 1250 + static enum sci_status sci_controller_reset(struct isci_host *ihost) 1232 1251 { 1233 1252 switch (ihost->sm.current_state_id) { 1234 1253 case SCIC_RESET: ··· 1267 1286 set_bit(IHOST_STOP_PENDING, &ihost->flags); 1268 1287 1269 1288 spin_lock_irq(&ihost->scic_lock); 1270 - scic_controller_stop(ihost, SCIC_CONTROLLER_STOP_TIMEOUT); 1289 + sci_controller_stop(ihost, SCIC_CONTROLLER_STOP_TIMEOUT); 1271 1290 spin_unlock_irq(&ihost->scic_lock); 1272 1291 1273 1292 wait_for_stop(ihost); 1274 - scic_controller_reset(ihost); 1293 + sci_controller_reset(ihost); 1275 1294 1276 1295 /* Cancel any/all outstanding port timers */ 1277 1296 for (i = 0; i < ihost->logical_port_entries; i++) { ··· 1310 1329 return pcim_iomap_table(pdev)[SCI_SMU_BAR * 2] + SCI_SMU_BAR_SIZE * id; 1311 1330 } 1312 1331 1313 - static void isci_user_parameters_get( 1314 - struct isci_host *isci_host, 1315 - union scic_user_parameters *scic_user_params) 1332 + static void isci_user_parameters_get(struct sci_user_parameters *u) 1316 1333 { 1317 - struct scic_sds_user_parameters *u = &scic_user_params->sds1; 1318 1334 int i; 1319 1335 1320 1336 for (i = 0; i < SCI_MAX_PHYS; i++) { ··· 1333 1355 u->max_number_concurrent_device_spin_up = max_concurr_spinup; 1334 1356 } 1335 1357 1336 - static void scic_sds_controller_initial_state_enter(struct sci_base_state_machine *sm) 1358 + static void sci_controller_initial_state_enter(struct sci_base_state_machine *sm) 1337 1359 { 1338 1360 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); 1339 1361 1340 1362 sci_change_state(&ihost->sm, SCIC_RESET); 1341 1363 } 1342 1364 1343 - static inline void scic_sds_controller_starting_state_exit(struct sci_base_state_machine *sm) 1365 + static inline void sci_controller_starting_state_exit(struct sci_base_state_machine *sm) 1344 1366 { 1345 1367 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); 1346 1368 ··· 1355 1377 #define INTERRUPT_COALESCE_TIMEOUT_ENCODE_MAX 28 1356 1378 1357 1379 /** 1358 - * scic_controller_set_interrupt_coalescence() - This method allows the user to 1380 + * sci_controller_set_interrupt_coalescence() - This method allows the user to 1359 1381 * configure the interrupt coalescence. 1360 1382 * @controller: This parameter represents the handle to the controller object 1361 1383 * for which its interrupt coalesce register is overridden. ··· 1372 1394 * SCI_FAILURE_INVALID_PARAMETER_VALUE The user input value is out of range. 1373 1395 */ 1374 1396 static enum sci_status 1375 - scic_controller_set_interrupt_coalescence(struct isci_host *ihost, 1376 - u32 coalesce_number, 1377 - u32 coalesce_timeout) 1397 + sci_controller_set_interrupt_coalescence(struct isci_host *ihost, 1398 + u32 coalesce_number, 1399 + u32 coalesce_timeout) 1378 1400 { 1379 1401 u8 timeout_encode = 0; 1380 1402 u32 min = 0; ··· 1467 1489 } 1468 1490 1469 1491 1470 - static void scic_sds_controller_ready_state_enter(struct sci_base_state_machine *sm) 1492 + static void sci_controller_ready_state_enter(struct sci_base_state_machine *sm) 1471 1493 { 1472 1494 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); 1473 1495 1474 1496 /* set the default interrupt coalescence number and timeout value. */ 1475 - scic_controller_set_interrupt_coalescence(ihost, 0x10, 250); 1497 + sci_controller_set_interrupt_coalescence(ihost, 0x10, 250); 1476 1498 } 1477 1499 1478 - static void scic_sds_controller_ready_state_exit(struct sci_base_state_machine *sm) 1500 + static void sci_controller_ready_state_exit(struct sci_base_state_machine *sm) 1479 1501 { 1480 1502 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); 1481 1503 1482 1504 /* disable interrupt coalescence. */ 1483 - scic_controller_set_interrupt_coalescence(ihost, 0, 0); 1505 + sci_controller_set_interrupt_coalescence(ihost, 0, 0); 1484 1506 } 1485 1507 1486 - static enum sci_status scic_sds_controller_stop_phys(struct isci_host *ihost) 1508 + static enum sci_status sci_controller_stop_phys(struct isci_host *ihost) 1487 1509 { 1488 1510 u32 index; 1489 1511 enum sci_status status; ··· 1492 1514 status = SCI_SUCCESS; 1493 1515 1494 1516 for (index = 0; index < SCI_MAX_PHYS; index++) { 1495 - phy_status = scic_sds_phy_stop(&ihost->phys[index]); 1517 + phy_status = sci_phy_stop(&ihost->phys[index]); 1496 1518 1497 1519 if (phy_status != SCI_SUCCESS && 1498 1520 phy_status != SCI_FAILURE_INVALID_STATE) { ··· 1509 1531 return status; 1510 1532 } 1511 1533 1512 - static enum sci_status scic_sds_controller_stop_ports(struct isci_host *ihost) 1534 + static enum sci_status sci_controller_stop_ports(struct isci_host *ihost) 1513 1535 { 1514 1536 u32 index; 1515 1537 enum sci_status port_status; ··· 1518 1540 for (index = 0; index < ihost->logical_port_entries; index++) { 1519 1541 struct isci_port *iport = &ihost->ports[index]; 1520 1542 1521 - port_status = scic_sds_port_stop(iport); 1543 + port_status = sci_port_stop(iport); 1522 1544 1523 1545 if ((port_status != SCI_SUCCESS) && 1524 1546 (port_status != SCI_FAILURE_INVALID_STATE)) { ··· 1536 1558 return status; 1537 1559 } 1538 1560 1539 - static enum sci_status scic_sds_controller_stop_devices(struct isci_host *ihost) 1561 + static enum sci_status sci_controller_stop_devices(struct isci_host *ihost) 1540 1562 { 1541 1563 u32 index; 1542 1564 enum sci_status status; ··· 1547 1569 for (index = 0; index < ihost->remote_node_entries; index++) { 1548 1570 if (ihost->device_table[index] != NULL) { 1549 1571 /* / @todo What timeout value do we want to provide to this request? */ 1550 - device_status = scic_remote_device_stop(ihost->device_table[index], 0); 1572 + device_status = sci_remote_device_stop(ihost->device_table[index], 0); 1551 1573 1552 1574 if ((device_status != SCI_SUCCESS) && 1553 1575 (device_status != SCI_FAILURE_INVALID_STATE)) { ··· 1564 1586 return status; 1565 1587 } 1566 1588 1567 - static void scic_sds_controller_stopping_state_enter(struct sci_base_state_machine *sm) 1589 + static void sci_controller_stopping_state_enter(struct sci_base_state_machine *sm) 1568 1590 { 1569 1591 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); 1570 1592 1571 1593 /* Stop all of the components for this controller */ 1572 - scic_sds_controller_stop_phys(ihost); 1573 - scic_sds_controller_stop_ports(ihost); 1574 - scic_sds_controller_stop_devices(ihost); 1594 + sci_controller_stop_phys(ihost); 1595 + sci_controller_stop_ports(ihost); 1596 + sci_controller_stop_devices(ihost); 1575 1597 } 1576 1598 1577 - static void scic_sds_controller_stopping_state_exit(struct sci_base_state_machine *sm) 1599 + static void sci_controller_stopping_state_exit(struct sci_base_state_machine *sm) 1578 1600 { 1579 1601 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); 1580 1602 1581 1603 sci_del_timer(&ihost->timer); 1582 1604 } 1583 1605 1584 - 1585 - /** 1586 - * scic_sds_controller_reset_hardware() - 1587 - * 1588 - * This method will reset the controller hardware. 1589 - */ 1590 - static void scic_sds_controller_reset_hardware(struct isci_host *ihost) 1606 + static void sci_controller_reset_hardware(struct isci_host *ihost) 1591 1607 { 1592 1608 /* Disable interrupts so we dont take any spurious interrupts */ 1593 - scic_controller_disable_interrupts(ihost); 1609 + sci_controller_disable_interrupts(ihost); 1594 1610 1595 1611 /* Reset the SCU */ 1596 1612 writel(0xFFFFFFFF, &ihost->smu_registers->soft_reset_control); ··· 1599 1627 writel(0, &ihost->scu_registers->sdma.unsolicited_frame_get_pointer); 1600 1628 } 1601 1629 1602 - static void scic_sds_controller_resetting_state_enter(struct sci_base_state_machine *sm) 1630 + static void sci_controller_resetting_state_enter(struct sci_base_state_machine *sm) 1603 1631 { 1604 1632 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm); 1605 1633 1606 - scic_sds_controller_reset_hardware(ihost); 1634 + sci_controller_reset_hardware(ihost); 1607 1635 sci_change_state(&ihost->sm, SCIC_RESET); 1608 1636 } 1609 1637 1610 - static const struct sci_base_state scic_sds_controller_state_table[] = { 1638 + static const struct sci_base_state sci_controller_state_table[] = { 1611 1639 [SCIC_INITIAL] = { 1612 - .enter_state = scic_sds_controller_initial_state_enter, 1640 + .enter_state = sci_controller_initial_state_enter, 1613 1641 }, 1614 1642 [SCIC_RESET] = {}, 1615 1643 [SCIC_INITIALIZING] = {}, 1616 1644 [SCIC_INITIALIZED] = {}, 1617 1645 [SCIC_STARTING] = { 1618 - .exit_state = scic_sds_controller_starting_state_exit, 1646 + .exit_state = sci_controller_starting_state_exit, 1619 1647 }, 1620 1648 [SCIC_READY] = { 1621 - .enter_state = scic_sds_controller_ready_state_enter, 1622 - .exit_state = scic_sds_controller_ready_state_exit, 1649 + .enter_state = sci_controller_ready_state_enter, 1650 + .exit_state = sci_controller_ready_state_exit, 1623 1651 }, 1624 1652 [SCIC_RESETTING] = { 1625 - .enter_state = scic_sds_controller_resetting_state_enter, 1653 + .enter_state = sci_controller_resetting_state_enter, 1626 1654 }, 1627 1655 [SCIC_STOPPING] = { 1628 - .enter_state = scic_sds_controller_stopping_state_enter, 1629 - .exit_state = scic_sds_controller_stopping_state_exit, 1656 + .enter_state = sci_controller_stopping_state_enter, 1657 + .exit_state = sci_controller_stopping_state_exit, 1630 1658 }, 1631 1659 [SCIC_STOPPED] = {}, 1632 1660 [SCIC_FAILED] = {} 1633 1661 }; 1634 1662 1635 - static void scic_sds_controller_set_default_config_parameters(struct isci_host *ihost) 1663 + static void sci_controller_set_default_config_parameters(struct isci_host *ihost) 1636 1664 { 1637 1665 /* these defaults are overridden by the platform / firmware */ 1638 1666 u16 index; 1639 1667 1640 1668 /* Default to APC mode. */ 1641 - ihost->oem_parameters.sds1.controller.mode_type = SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE; 1669 + ihost->oem_parameters.controller.mode_type = SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE; 1642 1670 1643 1671 /* Default to APC mode. */ 1644 - ihost->oem_parameters.sds1.controller.max_concurrent_dev_spin_up = 1; 1672 + ihost->oem_parameters.controller.max_concurrent_dev_spin_up = 1; 1645 1673 1646 1674 /* Default to no SSC operation. */ 1647 - ihost->oem_parameters.sds1.controller.do_enable_ssc = false; 1675 + ihost->oem_parameters.controller.do_enable_ssc = false; 1648 1676 1649 1677 /* Initialize all of the port parameter information to narrow ports. */ 1650 1678 for (index = 0; index < SCI_MAX_PORTS; index++) { 1651 - ihost->oem_parameters.sds1.ports[index].phy_mask = 0; 1679 + ihost->oem_parameters.ports[index].phy_mask = 0; 1652 1680 } 1653 1681 1654 1682 /* Initialize all of the phy parameter information. */ 1655 1683 for (index = 0; index < SCI_MAX_PHYS; index++) { 1656 1684 /* Default to 6G (i.e. Gen 3) for now. */ 1657 - ihost->user_parameters.sds1.phys[index].max_speed_generation = 3; 1685 + ihost->user_parameters.phys[index].max_speed_generation = 3; 1658 1686 1659 1687 /* the frequencies cannot be 0 */ 1660 - ihost->user_parameters.sds1.phys[index].align_insertion_frequency = 0x7f; 1661 - ihost->user_parameters.sds1.phys[index].in_connection_align_insertion_frequency = 0xff; 1662 - ihost->user_parameters.sds1.phys[index].notify_enable_spin_up_insertion_frequency = 0x33; 1688 + ihost->user_parameters.phys[index].align_insertion_frequency = 0x7f; 1689 + ihost->user_parameters.phys[index].in_connection_align_insertion_frequency = 0xff; 1690 + ihost->user_parameters.phys[index].notify_enable_spin_up_insertion_frequency = 0x33; 1663 1691 1664 1692 /* 1665 1693 * Previous Vitesse based expanders had a arbitration issue that 1666 1694 * is worked around by having the upper 32-bits of SAS address 1667 1695 * with a value greater then the Vitesse company identifier. 1668 1696 * Hence, usage of 0x5FCFFFFF. */ 1669 - ihost->oem_parameters.sds1.phys[index].sas_address.low = 0x1 + ihost->id; 1670 - ihost->oem_parameters.sds1.phys[index].sas_address.high = 0x5FCFFFFF; 1697 + ihost->oem_parameters.phys[index].sas_address.low = 0x1 + ihost->id; 1698 + ihost->oem_parameters.phys[index].sas_address.high = 0x5FCFFFFF; 1671 1699 } 1672 1700 1673 - ihost->user_parameters.sds1.stp_inactivity_timeout = 5; 1674 - ihost->user_parameters.sds1.ssp_inactivity_timeout = 5; 1675 - ihost->user_parameters.sds1.stp_max_occupancy_timeout = 5; 1676 - ihost->user_parameters.sds1.ssp_max_occupancy_timeout = 20; 1677 - ihost->user_parameters.sds1.no_outbound_task_timeout = 20; 1701 + ihost->user_parameters.stp_inactivity_timeout = 5; 1702 + ihost->user_parameters.ssp_inactivity_timeout = 5; 1703 + ihost->user_parameters.stp_max_occupancy_timeout = 5; 1704 + ihost->user_parameters.ssp_max_occupancy_timeout = 20; 1705 + ihost->user_parameters.no_outbound_task_timeout = 20; 1678 1706 } 1679 1707 1680 1708 static void controller_timeout(unsigned long data) ··· 1690 1718 goto done; 1691 1719 1692 1720 if (sm->current_state_id == SCIC_STARTING) 1693 - scic_sds_controller_transition_to_ready(ihost, SCI_FAILURE_TIMEOUT); 1721 + sci_controller_transition_to_ready(ihost, SCI_FAILURE_TIMEOUT); 1694 1722 else if (sm->current_state_id == SCIC_STOPPING) { 1695 1723 sci_change_state(sm, SCIC_FAILED); 1696 1724 isci_host_stop_complete(ihost, SCI_FAILURE_TIMEOUT); ··· 1704 1732 spin_unlock_irqrestore(&ihost->scic_lock, flags); 1705 1733 } 1706 1734 1707 - /** 1708 - * scic_controller_construct() - This method will attempt to construct a 1709 - * controller object utilizing the supplied parameter information. 1710 - * @c: This parameter specifies the controller to be constructed. 1711 - * @scu_base: mapped base address of the scu registers 1712 - * @smu_base: mapped base address of the smu registers 1713 - * 1714 - * Indicate if the controller was successfully constructed or if it failed in 1715 - * some way. SCI_SUCCESS This value is returned if the controller was 1716 - * successfully constructed. SCI_WARNING_TIMER_CONFLICT This value is returned 1717 - * if the interrupt coalescence timer may cause SAS compliance issues for SMP 1718 - * Target mode response processing. SCI_FAILURE_UNSUPPORTED_CONTROLLER_TYPE 1719 - * This value is returned if the controller does not support the supplied type. 1720 - * SCI_FAILURE_UNSUPPORTED_INIT_DATA_VERSION This value is returned if the 1721 - * controller does not support the supplied initialization data version. 1722 - */ 1723 - static enum sci_status scic_controller_construct(struct isci_host *ihost, 1724 - void __iomem *scu_base, 1725 - void __iomem *smu_base) 1735 + static enum sci_status sci_controller_construct(struct isci_host *ihost, 1736 + void __iomem *scu_base, 1737 + void __iomem *smu_base) 1726 1738 { 1727 1739 u8 i; 1728 1740 1729 - sci_init_sm(&ihost->sm, scic_sds_controller_state_table, SCIC_INITIAL); 1741 + sci_init_sm(&ihost->sm, sci_controller_state_table, SCIC_INITIAL); 1730 1742 1731 1743 ihost->scu_registers = scu_base; 1732 1744 ihost->smu_registers = smu_base; 1733 1745 1734 - scic_sds_port_configuration_agent_construct(&ihost->port_agent); 1746 + sci_port_configuration_agent_construct(&ihost->port_agent); 1735 1747 1736 1748 /* Construct the ports for this controller */ 1737 1749 for (i = 0; i < SCI_MAX_PORTS; i++) 1738 - scic_sds_port_construct(&ihost->ports[i], i, ihost); 1739 - scic_sds_port_construct(&ihost->ports[i], SCIC_SDS_DUMMY_PORT, ihost); 1750 + sci_port_construct(&ihost->ports[i], i, ihost); 1751 + sci_port_construct(&ihost->ports[i], SCIC_SDS_DUMMY_PORT, ihost); 1740 1752 1741 1753 /* Construct the phys for this controller */ 1742 1754 for (i = 0; i < SCI_MAX_PHYS; i++) { 1743 1755 /* Add all the PHYs to the dummy port */ 1744 - scic_sds_phy_construct(&ihost->phys[i], 1745 - &ihost->ports[SCI_MAX_PORTS], i); 1756 + sci_phy_construct(&ihost->phys[i], 1757 + &ihost->ports[SCI_MAX_PORTS], i); 1746 1758 } 1747 1759 1748 1760 ihost->invalid_phy_mask = 0; ··· 1734 1778 sci_init_timer(&ihost->timer, controller_timeout); 1735 1779 1736 1780 /* Initialize the User and OEM parameters to default values. */ 1737 - scic_sds_controller_set_default_config_parameters(ihost); 1781 + sci_controller_set_default_config_parameters(ihost); 1738 1782 1739 - return scic_controller_reset(ihost); 1783 + return sci_controller_reset(ihost); 1740 1784 } 1741 1785 1742 - int scic_oem_parameters_validate(struct scic_sds_oem_params *oem) 1786 + int sci_oem_parameters_validate(struct sci_oem_params *oem) 1743 1787 { 1744 1788 int i; 1745 1789 ··· 1773 1817 return 0; 1774 1818 } 1775 1819 1776 - static enum sci_status scic_oem_parameters_set(struct isci_host *ihost, 1777 - union scic_oem_parameters *scic_parms) 1820 + static enum sci_status sci_oem_parameters_set(struct isci_host *ihost) 1778 1821 { 1779 1822 u32 state = ihost->sm.current_state_id; 1780 1823 ··· 1781 1826 state == SCIC_INITIALIZING || 1782 1827 state == SCIC_INITIALIZED) { 1783 1828 1784 - if (scic_oem_parameters_validate(&scic_parms->sds1)) 1829 + if (sci_oem_parameters_validate(&ihost->oem_parameters)) 1785 1830 return SCI_FAILURE_INVALID_PARAMETER_VALUE; 1786 - ihost->oem_parameters.sds1 = scic_parms->sds1; 1787 1831 1788 1832 return SCI_SUCCESS; 1789 1833 } 1790 1834 1791 1835 return SCI_FAILURE_INVALID_STATE; 1792 - } 1793 - 1794 - void scic_oem_parameters_get( 1795 - struct isci_host *ihost, 1796 - union scic_oem_parameters *scic_parms) 1797 - { 1798 - memcpy(scic_parms, (&ihost->oem_parameters), sizeof(*scic_parms)); 1799 1836 } 1800 1837 1801 1838 static void power_control_timeout(unsigned long data) ··· 1820 1873 continue; 1821 1874 1822 1875 if (ihost->power_control.phys_granted_power >= 1823 - ihost->oem_parameters.sds1.controller.max_concurrent_dev_spin_up) 1876 + ihost->oem_parameters.controller.max_concurrent_dev_spin_up) 1824 1877 break; 1825 1878 1826 1879 ihost->power_control.requesters[i] = NULL; 1827 1880 ihost->power_control.phys_waiting--; 1828 1881 ihost->power_control.phys_granted_power++; 1829 - scic_sds_phy_consume_power_handler(iphy); 1882 + sci_phy_consume_power_handler(iphy); 1830 1883 } 1831 1884 1832 1885 /* ··· 1840 1893 spin_unlock_irqrestore(&ihost->scic_lock, flags); 1841 1894 } 1842 1895 1843 - /** 1844 - * This method inserts the phy in the stagger spinup control queue. 1845 - * @scic: 1846 - * 1847 - * 1848 - */ 1849 - void scic_sds_controller_power_control_queue_insert( 1850 - struct isci_host *ihost, 1851 - struct isci_phy *iphy) 1896 + void sci_controller_power_control_queue_insert(struct isci_host *ihost, 1897 + struct isci_phy *iphy) 1852 1898 { 1853 1899 BUG_ON(iphy == NULL); 1854 1900 1855 1901 if (ihost->power_control.phys_granted_power < 1856 - ihost->oem_parameters.sds1.controller.max_concurrent_dev_spin_up) { 1902 + ihost->oem_parameters.controller.max_concurrent_dev_spin_up) { 1857 1903 ihost->power_control.phys_granted_power++; 1858 - scic_sds_phy_consume_power_handler(iphy); 1904 + sci_phy_consume_power_handler(iphy); 1859 1905 1860 1906 /* 1861 1907 * stop and start the power_control timer. When the timer fires, the ··· 1868 1928 } 1869 1929 } 1870 1930 1871 - /** 1872 - * This method removes the phy from the stagger spinup control queue. 1873 - * @scic: 1874 - * 1875 - * 1876 - */ 1877 - void scic_sds_controller_power_control_queue_remove( 1878 - struct isci_host *ihost, 1879 - struct isci_phy *iphy) 1931 + void sci_controller_power_control_queue_remove(struct isci_host *ihost, 1932 + struct isci_phy *iphy) 1880 1933 { 1881 1934 BUG_ON(iphy == NULL); 1882 1935 1883 - if (ihost->power_control.requesters[iphy->phy_index] != NULL) { 1936 + if (ihost->power_control.requesters[iphy->phy_index]) 1884 1937 ihost->power_control.phys_waiting--; 1885 - } 1886 1938 1887 1939 ihost->power_control.requesters[iphy->phy_index] = NULL; 1888 1940 } ··· 1884 1952 /* Initialize the AFE for this phy index. We need to read the AFE setup from 1885 1953 * the OEM parameters 1886 1954 */ 1887 - static void scic_sds_controller_afe_initialization(struct isci_host *ihost) 1955 + static void sci_controller_afe_initialization(struct isci_host *ihost) 1888 1956 { 1889 - const struct scic_sds_oem_params *oem = &ihost->oem_parameters.sds1; 1957 + const struct sci_oem_params *oem = &ihost->oem_parameters; 1890 1958 u32 afe_status; 1891 1959 u32 phy_id; 1892 1960 ··· 2043 2111 udelay(AFE_REGISTER_WRITE_DELAY); 2044 2112 } 2045 2113 2046 - static void scic_sds_controller_initialize_power_control(struct isci_host *ihost) 2114 + static void sci_controller_initialize_power_control(struct isci_host *ihost) 2047 2115 { 2048 2116 sci_init_timer(&ihost->power_control.timer, power_control_timeout); 2049 2117 ··· 2054 2122 ihost->power_control.phys_granted_power = 0; 2055 2123 } 2056 2124 2057 - static enum sci_status scic_controller_initialize(struct isci_host *ihost) 2125 + static enum sci_status sci_controller_initialize(struct isci_host *ihost) 2058 2126 { 2059 2127 struct sci_base_state_machine *sm = &ihost->sm; 2060 2128 enum sci_status result = SCI_FAILURE; ··· 2074 2142 ihost->next_phy_to_start = 0; 2075 2143 ihost->phy_startup_timer_pending = false; 2076 2144 2077 - scic_sds_controller_initialize_power_control(ihost); 2145 + sci_controller_initialize_power_control(ihost); 2078 2146 2079 2147 /* 2080 2148 * There is nothing to do here for B0 since we do not have to 2081 2149 * program the AFE registers. 2082 2150 * / @todo The AFE settings are supposed to be correct for the B0 but 2083 2151 * / presently they seem to be wrong. */ 2084 - scic_sds_controller_afe_initialization(ihost); 2152 + sci_controller_afe_initialization(ihost); 2085 2153 2086 2154 2087 2155 /* Take the hardware out of reset */ ··· 2138 2206 * are accessed during the port initialization. 2139 2207 */ 2140 2208 for (i = 0; i < SCI_MAX_PHYS; i++) { 2141 - result = scic_sds_phy_initialize(&ihost->phys[i], 2142 - &ihost->scu_registers->peg0.pe[i].tl, 2143 - &ihost->scu_registers->peg0.pe[i].ll); 2209 + result = sci_phy_initialize(&ihost->phys[i], 2210 + &ihost->scu_registers->peg0.pe[i].tl, 2211 + &ihost->scu_registers->peg0.pe[i].ll); 2144 2212 if (result != SCI_SUCCESS) 2145 2213 goto out; 2146 2214 } 2147 2215 2148 2216 for (i = 0; i < ihost->logical_port_entries; i++) { 2149 - result = scic_sds_port_initialize(&ihost->ports[i], 2150 - &ihost->scu_registers->peg0.ptsg.port[i], 2151 - &ihost->scu_registers->peg0.ptsg.protocol_engine, 2152 - &ihost->scu_registers->peg0.viit[i]); 2217 + struct isci_port *iport = &ihost->ports[i]; 2153 2218 2154 - if (result != SCI_SUCCESS) 2155 - goto out; 2219 + iport->port_task_scheduler_registers = &ihost->scu_registers->peg0.ptsg.port[i]; 2220 + iport->port_pe_configuration_register = &ihost->scu_registers->peg0.ptsg.protocol_engine[0]; 2221 + iport->viit_registers = &ihost->scu_registers->peg0.viit[i]; 2156 2222 } 2157 2223 2158 - result = scic_sds_port_configuration_agent_initialize(ihost, &ihost->port_agent); 2224 + result = sci_port_configuration_agent_initialize(ihost, &ihost->port_agent); 2159 2225 2160 2226 out: 2161 2227 /* Advance the controller state machine */ ··· 2166 2236 return result; 2167 2237 } 2168 2238 2169 - static enum sci_status scic_user_parameters_set( 2170 - struct isci_host *ihost, 2171 - union scic_user_parameters *scic_parms) 2239 + static enum sci_status sci_user_parameters_set(struct isci_host *ihost, 2240 + struct sci_user_parameters *sci_parms) 2172 2241 { 2173 2242 u32 state = ihost->sm.current_state_id; 2174 2243 ··· 2183 2254 for (index = 0; index < SCI_MAX_PHYS; index++) { 2184 2255 struct sci_phy_user_params *user_phy; 2185 2256 2186 - user_phy = &scic_parms->sds1.phys[index]; 2257 + user_phy = &sci_parms->phys[index]; 2187 2258 2188 2259 if (!((user_phy->max_speed_generation <= 2189 2260 SCIC_SDS_PARM_MAX_SPEED) && ··· 2204 2275 return SCI_FAILURE_INVALID_PARAMETER_VALUE; 2205 2276 } 2206 2277 2207 - if ((scic_parms->sds1.stp_inactivity_timeout == 0) || 2208 - (scic_parms->sds1.ssp_inactivity_timeout == 0) || 2209 - (scic_parms->sds1.stp_max_occupancy_timeout == 0) || 2210 - (scic_parms->sds1.ssp_max_occupancy_timeout == 0) || 2211 - (scic_parms->sds1.no_outbound_task_timeout == 0)) 2278 + if ((sci_parms->stp_inactivity_timeout == 0) || 2279 + (sci_parms->ssp_inactivity_timeout == 0) || 2280 + (sci_parms->stp_max_occupancy_timeout == 0) || 2281 + (sci_parms->ssp_max_occupancy_timeout == 0) || 2282 + (sci_parms->no_outbound_task_timeout == 0)) 2212 2283 return SCI_FAILURE_INVALID_PARAMETER_VALUE; 2213 2284 2214 - memcpy(&ihost->user_parameters, scic_parms, sizeof(*scic_parms)); 2285 + memcpy(&ihost->user_parameters, sci_parms, sizeof(*sci_parms)); 2215 2286 2216 2287 return SCI_SUCCESS; 2217 2288 } ··· 2219 2290 return SCI_FAILURE_INVALID_STATE; 2220 2291 } 2221 2292 2222 - static int scic_controller_mem_init(struct isci_host *ihost) 2293 + static int sci_controller_mem_init(struct isci_host *ihost) 2223 2294 { 2224 2295 struct device *dev = &ihost->pdev->dev; 2225 2296 dma_addr_t dma; ··· 2236 2307 2237 2308 size = ihost->remote_node_entries * sizeof(union scu_remote_node_context); 2238 2309 ihost->remote_node_context_table = dmam_alloc_coherent(dev, size, &dma, 2239 - GFP_KERNEL); 2310 + GFP_KERNEL); 2240 2311 if (!ihost->remote_node_context_table) 2241 2312 return -ENOMEM; 2242 2313 ··· 2252 2323 writel(lower_32_bits(dma), &ihost->smu_registers->host_task_table_lower); 2253 2324 writel(upper_32_bits(dma), &ihost->smu_registers->host_task_table_upper); 2254 2325 2255 - err = scic_sds_unsolicited_frame_control_construct(ihost); 2326 + err = sci_unsolicited_frame_control_construct(ihost); 2256 2327 if (err) 2257 2328 return err; 2258 2329 ··· 2277 2348 { 2278 2349 int err = 0, i; 2279 2350 enum sci_status status; 2280 - union scic_oem_parameters oem; 2281 - union scic_user_parameters scic_user_params; 2351 + struct sci_user_parameters sci_user_params; 2282 2352 struct isci_pci_info *pci_info = to_pci_info(ihost->pdev); 2283 2353 2284 2354 spin_lock_init(&ihost->state_lock); ··· 2286 2358 2287 2359 isci_host_change_state(ihost, isci_starting); 2288 2360 2289 - status = scic_controller_construct(ihost, scu_base(ihost), 2290 - smu_base(ihost)); 2361 + status = sci_controller_construct(ihost, scu_base(ihost), 2362 + smu_base(ihost)); 2291 2363 2292 2364 if (status != SCI_SUCCESS) { 2293 2365 dev_err(&ihost->pdev->dev, 2294 - "%s: scic_controller_construct failed - status = %x\n", 2366 + "%s: sci_controller_construct failed - status = %x\n", 2295 2367 __func__, 2296 2368 status); 2297 2369 return -ENODEV; ··· 2304 2376 * grab initial values stored in the controller object for OEM and USER 2305 2377 * parameters 2306 2378 */ 2307 - isci_user_parameters_get(ihost, &scic_user_params); 2308 - status = scic_user_parameters_set(ihost, 2309 - &scic_user_params); 2379 + isci_user_parameters_get(&sci_user_params); 2380 + status = sci_user_parameters_set(ihost, &sci_user_params); 2310 2381 if (status != SCI_SUCCESS) { 2311 2382 dev_warn(&ihost->pdev->dev, 2312 - "%s: scic_user_parameters_set failed\n", 2383 + "%s: sci_user_parameters_set failed\n", 2313 2384 __func__); 2314 2385 return -ENODEV; 2315 2386 } 2316 2387 2317 - scic_oem_parameters_get(ihost, &oem); 2318 - 2319 2388 /* grab any OEM parameters specified in orom */ 2320 2389 if (pci_info->orom) { 2321 - status = isci_parse_oem_parameters(&oem, 2390 + status = isci_parse_oem_parameters(&ihost->oem_parameters, 2322 2391 pci_info->orom, 2323 2392 ihost->id); 2324 2393 if (status != SCI_SUCCESS) { ··· 2325 2400 } 2326 2401 } 2327 2402 2328 - status = scic_oem_parameters_set(ihost, &oem); 2403 + status = sci_oem_parameters_set(ihost); 2329 2404 if (status != SCI_SUCCESS) { 2330 2405 dev_warn(&ihost->pdev->dev, 2331 - "%s: scic_oem_parameters_set failed\n", 2406 + "%s: sci_oem_parameters_set failed\n", 2332 2407 __func__); 2333 2408 return -ENODEV; 2334 2409 } ··· 2340 2415 INIT_LIST_HEAD(&ihost->requests_to_errorback); 2341 2416 2342 2417 spin_lock_irq(&ihost->scic_lock); 2343 - status = scic_controller_initialize(ihost); 2418 + status = sci_controller_initialize(ihost); 2344 2419 spin_unlock_irq(&ihost->scic_lock); 2345 2420 if (status != SCI_SUCCESS) { 2346 2421 dev_warn(&ihost->pdev->dev, 2347 - "%s: scic_controller_initialize failed -" 2422 + "%s: sci_controller_initialize failed -" 2348 2423 " status = 0x%x\n", 2349 2424 __func__, status); 2350 2425 return -ENODEV; 2351 2426 } 2352 2427 2353 - err = scic_controller_mem_init(ihost); 2428 + err = sci_controller_mem_init(ihost); 2354 2429 if (err) 2355 2430 return err; 2356 2431 ··· 2388 2463 return 0; 2389 2464 } 2390 2465 2391 - void scic_sds_controller_link_up(struct isci_host *ihost, 2392 - struct isci_port *iport, struct isci_phy *iphy) 2466 + void sci_controller_link_up(struct isci_host *ihost, struct isci_port *iport, 2467 + struct isci_phy *iphy) 2393 2468 { 2394 2469 switch (ihost->sm.current_state_id) { 2395 2470 case SCIC_STARTING: 2396 2471 sci_del_timer(&ihost->phy_timer); 2397 2472 ihost->phy_startup_timer_pending = false; 2398 2473 ihost->port_agent.link_up_handler(ihost, &ihost->port_agent, 2399 - iport, iphy); 2400 - scic_sds_controller_start_next_phy(ihost); 2474 + iport, iphy); 2475 + sci_controller_start_next_phy(ihost); 2401 2476 break; 2402 2477 case SCIC_READY: 2403 2478 ihost->port_agent.link_up_handler(ihost, &ihost->port_agent, 2404 - iport, iphy); 2479 + iport, iphy); 2405 2480 break; 2406 2481 default: 2407 2482 dev_dbg(&ihost->pdev->dev, ··· 2411 2486 } 2412 2487 } 2413 2488 2414 - void scic_sds_controller_link_down(struct isci_host *ihost, 2415 - struct isci_port *iport, struct isci_phy *iphy) 2489 + void sci_controller_link_down(struct isci_host *ihost, struct isci_port *iport, 2490 + struct isci_phy *iphy) 2416 2491 { 2417 2492 switch (ihost->sm.current_state_id) { 2418 2493 case SCIC_STARTING: ··· 2430 2505 } 2431 2506 } 2432 2507 2433 - /** 2434 - * This is a helper method to determine if any remote devices on this 2435 - * controller are still in the stopping state. 2436 - * 2437 - */ 2438 - static bool scic_sds_controller_has_remote_devices_stopping(struct isci_host *ihost) 2508 + static bool sci_controller_has_remote_devices_stopping(struct isci_host *ihost) 2439 2509 { 2440 2510 u32 index; 2441 2511 ··· 2443 2523 return false; 2444 2524 } 2445 2525 2446 - /** 2447 - * This method is called by the remote device to inform the controller 2448 - * object that the remote device has stopped. 2449 - */ 2450 - void scic_sds_controller_remote_device_stopped(struct isci_host *ihost, 2451 - struct isci_remote_device *idev) 2526 + void sci_controller_remote_device_stopped(struct isci_host *ihost, 2527 + struct isci_remote_device *idev) 2452 2528 { 2453 2529 if (ihost->sm.current_state_id != SCIC_STOPPING) { 2454 2530 dev_dbg(&ihost->pdev->dev, ··· 2455 2539 return; 2456 2540 } 2457 2541 2458 - if (!scic_sds_controller_has_remote_devices_stopping(ihost)) { 2542 + if (!sci_controller_has_remote_devices_stopping(ihost)) 2459 2543 sci_change_state(&ihost->sm, SCIC_STOPPED); 2460 - } 2461 2544 } 2462 2545 2463 - /** 2464 - * This method will write to the SCU PCP register the request value. The method 2465 - * is used to suspend/resume ports, devices, and phys. 2466 - * @scic: 2467 - * 2468 - * 2469 - */ 2470 - void scic_sds_controller_post_request( 2471 - struct isci_host *ihost, 2472 - u32 request) 2546 + void sci_controller_post_request(struct isci_host *ihost, u32 request) 2473 2547 { 2474 - dev_dbg(&ihost->pdev->dev, 2475 - "%s: SCIC Controller 0x%p post request 0x%08x\n", 2476 - __func__, 2477 - ihost, 2478 - request); 2548 + dev_dbg(&ihost->pdev->dev, "%s[%d]: %#x\n", 2549 + __func__, ihost->id, request); 2479 2550 2480 2551 writel(request, &ihost->smu_registers->post_context_port); 2481 2552 } 2482 2553 2483 - struct isci_request *scic_request_by_tag(struct isci_host *ihost, u16 io_tag) 2554 + struct isci_request *sci_request_by_tag(struct isci_host *ihost, u16 io_tag) 2484 2555 { 2485 2556 u16 task_index; 2486 2557 u16 task_sequence; ··· 2502 2599 * enum sci_status SCI_FAILURE_OUT_OF_RESOURCES if there are no available remote 2503 2600 * node index available. 2504 2601 */ 2505 - enum sci_status scic_sds_controller_allocate_remote_node_context( 2506 - struct isci_host *ihost, 2507 - struct isci_remote_device *idev, 2508 - u16 *node_id) 2602 + enum sci_status sci_controller_allocate_remote_node_context(struct isci_host *ihost, 2603 + struct isci_remote_device *idev, 2604 + u16 *node_id) 2509 2605 { 2510 2606 u16 node_index; 2511 - u32 remote_node_count = scic_sds_remote_device_node_count(idev); 2607 + u32 remote_node_count = sci_remote_device_node_count(idev); 2512 2608 2513 - node_index = scic_sds_remote_node_table_allocate_remote_node( 2609 + node_index = sci_remote_node_table_allocate_remote_node( 2514 2610 &ihost->available_remote_nodes, remote_node_count 2515 2611 ); 2516 2612 ··· 2524 2622 return SCI_FAILURE_INSUFFICIENT_RESOURCES; 2525 2623 } 2526 2624 2527 - /** 2528 - * This method frees the remote node index back to the available pool. Once 2529 - * this is done the remote node context buffer is no longer valid and can 2530 - * not be used. 2531 - * @scic: 2532 - * @sci_dev: 2533 - * @node_id: 2534 - * 2535 - */ 2536 - void scic_sds_controller_free_remote_node_context( 2537 - struct isci_host *ihost, 2538 - struct isci_remote_device *idev, 2539 - u16 node_id) 2625 + void sci_controller_free_remote_node_context(struct isci_host *ihost, 2626 + struct isci_remote_device *idev, 2627 + u16 node_id) 2540 2628 { 2541 - u32 remote_node_count = scic_sds_remote_device_node_count(idev); 2629 + u32 remote_node_count = sci_remote_device_node_count(idev); 2542 2630 2543 2631 if (ihost->device_table[node_id] == idev) { 2544 2632 ihost->device_table[node_id] = NULL; 2545 2633 2546 - scic_sds_remote_node_table_release_remote_node_index( 2634 + sci_remote_node_table_release_remote_node_index( 2547 2635 &ihost->available_remote_nodes, remote_node_count, node_id 2548 2636 ); 2549 2637 } 2550 2638 } 2551 2639 2552 - /** 2553 - * This method returns the union scu_remote_node_context for the specified remote 2554 - * node id. 2555 - * @scic: 2556 - * @node_id: 2557 - * 2558 - * union scu_remote_node_context* 2559 - */ 2560 - union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffer( 2561 - struct isci_host *ihost, 2562 - u16 node_id 2563 - ) { 2564 - if ( 2565 - (node_id < ihost->remote_node_entries) 2566 - && (ihost->device_table[node_id] != NULL) 2567 - ) { 2568 - return &ihost->remote_node_context_table[node_id]; 2569 - } 2570 - 2571 - return NULL; 2572 - } 2573 - 2574 - /** 2575 - * 2576 - * @resposne_buffer: This is the buffer into which the D2H register FIS will be 2577 - * constructed. 2578 - * @frame_header: This is the frame header returned by the hardware. 2579 - * @frame_buffer: This is the frame buffer returned by the hardware. 2580 - * 2581 - * This method will combind the frame header and frame buffer to create a SATA 2582 - * D2H register FIS none 2583 - */ 2584 - void scic_sds_controller_copy_sata_response( 2585 - void *response_buffer, 2586 - void *frame_header, 2587 - void *frame_buffer) 2640 + void sci_controller_copy_sata_response(void *response_buffer, 2641 + void *frame_header, 2642 + void *frame_buffer) 2588 2643 { 2644 + /* XXX type safety? */ 2589 2645 memcpy(response_buffer, frame_header, sizeof(u32)); 2590 2646 2591 2647 memcpy(response_buffer + sizeof(u32), ··· 2551 2691 sizeof(struct dev_to_host_fis) - sizeof(u32)); 2552 2692 } 2553 2693 2554 - /** 2555 - * This method releases the frame once this is done the frame is available for 2556 - * re-use by the hardware. The data contained in the frame header and frame 2557 - * buffer is no longer valid. The UF queue get pointer is only updated if UF 2558 - * control indicates this is appropriate. 2559 - * @scic: 2560 - * @frame_index: 2561 - * 2562 - */ 2563 - void scic_sds_controller_release_frame( 2564 - struct isci_host *ihost, 2565 - u32 frame_index) 2694 + void sci_controller_release_frame(struct isci_host *ihost, u32 frame_index) 2566 2695 { 2567 - if (scic_sds_unsolicited_frame_control_release_frame( 2568 - &ihost->uf_control, frame_index) == true) 2696 + if (sci_unsolicited_frame_control_release_frame(&ihost->uf_control, frame_index)) 2569 2697 writel(ihost->uf_control.get, 2570 2698 &ihost->scu_registers->sdma.unsolicited_frame_get_pointer); 2571 2699 } ··· 2611 2763 return SCI_FAILURE_INVALID_IO_TAG; 2612 2764 } 2613 2765 2614 - /** 2615 - * scic_controller_start_io() - This method is called by the SCI user to 2616 - * send/start an IO request. If the method invocation is successful, then 2617 - * the IO request has been queued to the hardware for processing. 2618 - * @controller: the handle to the controller object for which to start an IO 2619 - * request. 2620 - * @remote_device: the handle to the remote device object for which to start an 2621 - * IO request. 2622 - * @io_request: the handle to the io request object to start. 2623 - * @io_tag: This parameter specifies a previously allocated IO tag that the 2624 - * user desires to be utilized for this request. 2625 - */ 2626 - enum sci_status scic_controller_start_io(struct isci_host *ihost, 2627 - struct isci_remote_device *idev, 2628 - struct isci_request *ireq) 2766 + enum sci_status sci_controller_start_io(struct isci_host *ihost, 2767 + struct isci_remote_device *idev, 2768 + struct isci_request *ireq) 2629 2769 { 2630 2770 enum sci_status status; 2631 2771 ··· 2622 2786 return SCI_FAILURE_INVALID_STATE; 2623 2787 } 2624 2788 2625 - status = scic_sds_remote_device_start_io(ihost, idev, ireq); 2789 + status = sci_remote_device_start_io(ihost, idev, ireq); 2626 2790 if (status != SCI_SUCCESS) 2627 2791 return status; 2628 2792 2629 2793 set_bit(IREQ_ACTIVE, &ireq->flags); 2630 - scic_sds_controller_post_request(ihost, scic_sds_request_get_post_context(ireq)); 2794 + sci_controller_post_request(ihost, sci_request_get_post_context(ireq)); 2631 2795 return SCI_SUCCESS; 2632 2796 } 2633 2797 2634 - /** 2635 - * scic_controller_terminate_request() - This method is called by the SCI Core 2636 - * user to terminate an ongoing (i.e. started) core IO request. This does 2637 - * not abort the IO request at the target, but rather removes the IO request 2638 - * from the host controller. 2639 - * @controller: the handle to the controller object for which to terminate a 2640 - * request. 2641 - * @remote_device: the handle to the remote device object for which to 2642 - * terminate a request. 2643 - * @request: the handle to the io or task management request object to 2644 - * terminate. 2645 - * 2646 - * Indicate if the controller successfully began the terminate process for the 2647 - * IO request. SCI_SUCCESS if the terminate process was successfully started 2648 - * for the request. Determine the failure situations and return values. 2649 - */ 2650 - enum sci_status scic_controller_terminate_request( 2651 - struct isci_host *ihost, 2652 - struct isci_remote_device *idev, 2653 - struct isci_request *ireq) 2798 + enum sci_status sci_controller_terminate_request(struct isci_host *ihost, 2799 + struct isci_remote_device *idev, 2800 + struct isci_request *ireq) 2654 2801 { 2802 + /* terminate an ongoing (i.e. started) core IO request. This does not 2803 + * abort the IO request at the target, but rather removes the IO 2804 + * request from the host controller. 2805 + */ 2655 2806 enum sci_status status; 2656 2807 2657 2808 if (ihost->sm.current_state_id != SCIC_READY) { ··· 2647 2824 return SCI_FAILURE_INVALID_STATE; 2648 2825 } 2649 2826 2650 - status = scic_sds_io_request_terminate(ireq); 2827 + status = sci_io_request_terminate(ireq); 2651 2828 if (status != SCI_SUCCESS) 2652 2829 return status; 2653 2830 ··· 2655 2832 * Utilize the original post context command and or in the POST_TC_ABORT 2656 2833 * request sub-type. 2657 2834 */ 2658 - scic_sds_controller_post_request(ihost, 2659 - scic_sds_request_get_post_context(ireq) | 2660 - SCU_CONTEXT_COMMAND_REQUEST_POST_TC_ABORT); 2835 + sci_controller_post_request(ihost, 2836 + ireq->post_context | SCU_CONTEXT_COMMAND_REQUEST_POST_TC_ABORT); 2661 2837 return SCI_SUCCESS; 2662 2838 } 2663 2839 2664 2840 /** 2665 - * scic_controller_complete_io() - This method will perform core specific 2841 + * sci_controller_complete_io() - This method will perform core specific 2666 2842 * completion operations for an IO request. After this method is invoked, 2667 2843 * the user should consider the IO request as invalid until it is properly 2668 2844 * reused (i.e. re-constructed). 2669 - * @controller: The handle to the controller object for which to complete the 2845 + * @ihost: The handle to the controller object for which to complete the 2670 2846 * IO request. 2671 - * @remote_device: The handle to the remote device object for which to complete 2847 + * @idev: The handle to the remote device object for which to complete 2672 2848 * the IO request. 2673 - * @io_request: the handle to the io request object to complete. 2849 + * @ireq: the handle to the io request object to complete. 2674 2850 */ 2675 - enum sci_status scic_controller_complete_io( 2676 - struct isci_host *ihost, 2677 - struct isci_remote_device *idev, 2678 - struct isci_request *ireq) 2851 + enum sci_status sci_controller_complete_io(struct isci_host *ihost, 2852 + struct isci_remote_device *idev, 2853 + struct isci_request *ireq) 2679 2854 { 2680 2855 enum sci_status status; 2681 2856 u16 index; ··· 2683 2862 /* XXX: Implement this function */ 2684 2863 return SCI_FAILURE; 2685 2864 case SCIC_READY: 2686 - status = scic_sds_remote_device_complete_io(ihost, idev, ireq); 2865 + status = sci_remote_device_complete_io(ihost, idev, ireq); 2687 2866 if (status != SCI_SUCCESS) 2688 2867 return status; 2689 2868 ··· 2697 2876 2698 2877 } 2699 2878 2700 - enum sci_status scic_controller_continue_io(struct isci_request *ireq) 2879 + enum sci_status sci_controller_continue_io(struct isci_request *ireq) 2701 2880 { 2702 2881 struct isci_host *ihost = ireq->owning_controller; 2703 2882 ··· 2707 2886 } 2708 2887 2709 2888 set_bit(IREQ_ACTIVE, &ireq->flags); 2710 - scic_sds_controller_post_request(ihost, scic_sds_request_get_post_context(ireq)); 2889 + sci_controller_post_request(ihost, sci_request_get_post_context(ireq)); 2711 2890 return SCI_SUCCESS; 2712 2891 } 2713 2892 2714 2893 /** 2715 - * scic_controller_start_task() - This method is called by the SCIC user to 2894 + * sci_controller_start_task() - This method is called by the SCIC user to 2716 2895 * send/start a framework task management request. 2717 2896 * @controller: the handle to the controller object for which to start the task 2718 2897 * management request. ··· 2720 2899 * the task management request. 2721 2900 * @task_request: the handle to the task request object to start. 2722 2901 */ 2723 - enum sci_task_status scic_controller_start_task( 2724 - struct isci_host *ihost, 2725 - struct isci_remote_device *idev, 2726 - struct isci_request *ireq) 2902 + enum sci_task_status sci_controller_start_task(struct isci_host *ihost, 2903 + struct isci_remote_device *idev, 2904 + struct isci_request *ireq) 2727 2905 { 2728 2906 enum sci_status status; 2729 2907 ··· 2734 2914 return SCI_TASK_FAILURE_INVALID_STATE; 2735 2915 } 2736 2916 2737 - status = scic_sds_remote_device_start_task(ihost, idev, ireq); 2917 + status = sci_remote_device_start_task(ihost, idev, ireq); 2738 2918 switch (status) { 2739 2919 case SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS: 2740 2920 set_bit(IREQ_ACTIVE, &ireq->flags); ··· 2748 2928 case SCI_SUCCESS: 2749 2929 set_bit(IREQ_ACTIVE, &ireq->flags); 2750 2930 2751 - scic_sds_controller_post_request(ihost, 2752 - scic_sds_request_get_post_context(ireq)); 2931 + sci_controller_post_request(ihost, 2932 + sci_request_get_post_context(ireq)); 2753 2933 break; 2754 2934 default: 2755 2935 break;
+49 -52
drivers/scsi/isci/host.h
··· 69 69 70 70 71 71 /** 72 - * struct scic_power_control - 72 + * struct sci_power_control - 73 73 * 74 74 * This structure defines the fields for managing power control for direct 75 75 * attached disk devices. 76 76 */ 77 - struct scic_power_control { 77 + struct sci_power_control { 78 78 /** 79 79 * This field is set when the power control timer is running and cleared when 80 80 * it is not. ··· 99 99 100 100 /** 101 101 * This field is an array of phys that we are waiting on. The phys are direct 102 - * mapped into requesters via struct scic_sds_phy.phy_index 102 + * mapped into requesters via struct sci_phy.phy_index 103 103 */ 104 104 struct isci_phy *requesters[SCI_MAX_PHYS]; 105 105 106 106 }; 107 107 108 - struct scic_sds_port_configuration_agent; 108 + struct sci_port_configuration_agent; 109 109 typedef void (*port_config_fn)(struct isci_host *, 110 - struct scic_sds_port_configuration_agent *, 110 + struct sci_port_configuration_agent *, 111 111 struct isci_port *, struct isci_phy *); 112 112 113 - struct scic_sds_port_configuration_agent { 113 + struct sci_port_configuration_agent { 114 114 u16 phy_configured_mask; 115 115 u16 phy_ready_mask; 116 116 struct { ··· 149 149 /* XXX can we time this externally */ 150 150 struct sci_timer timer; 151 151 /* XXX drop reference module params directly */ 152 - union scic_user_parameters user_parameters; 152 + struct sci_user_parameters user_parameters; 153 153 /* XXX no need to be a union */ 154 - union scic_oem_parameters oem_parameters; 155 - struct scic_sds_port_configuration_agent port_agent; 154 + struct sci_oem_params oem_parameters; 155 + struct sci_port_configuration_agent port_agent; 156 156 struct isci_remote_device *device_table[SCI_MAX_REMOTE_DEVICES]; 157 - struct scic_remote_node_table available_remote_nodes; 158 - struct scic_power_control power_control; 157 + struct sci_remote_node_table available_remote_nodes; 158 + struct sci_power_control power_control; 159 159 u8 io_request_sequence[SCI_MAX_IO_REQUESTS]; 160 160 struct scu_task_context *task_context_table; 161 161 dma_addr_t task_context_dma; ··· 165 165 u32 logical_port_entries; 166 166 u32 remote_node_entries; 167 167 u32 task_context_entries; 168 - struct scic_sds_unsolicited_frame_control uf_control; 168 + struct sci_unsolicited_frame_control uf_control; 169 169 170 170 /* phy startup */ 171 171 struct sci_timer phy_timer; ··· 206 206 }; 207 207 208 208 /** 209 - * enum scic_sds_controller_states - This enumeration depicts all the states 209 + * enum sci_controller_states - This enumeration depicts all the states 210 210 * for the common controller state machine. 211 211 */ 212 - enum scic_sds_controller_states { 212 + enum sci_controller_states { 213 213 /** 214 214 * Simply the initial state for the base controller state machine. 215 215 */ ··· 360 360 } 361 361 362 362 /** 363 - * scic_sds_controller_get_protocol_engine_group() - 363 + * sci_controller_get_protocol_engine_group() - 364 364 * 365 365 * This macro returns the protocol engine group for this controller object. 366 366 * Presently we only support protocol engine group 0 so just return that 367 367 */ 368 - #define scic_sds_controller_get_protocol_engine_group(controller) 0 368 + #define sci_controller_get_protocol_engine_group(controller) 0 369 369 370 - /* see scic_controller_io_tag_allocate|free for how seq and tci are built */ 370 + /* see sci_controller_io_tag_allocate|free for how seq and tci are built */ 371 371 #define ISCI_TAG(seq, tci) (((u16) (seq)) << 12 | tci) 372 372 373 373 /* these are returned by the hardware, so sanitize them */ ··· 375 375 #define ISCI_TAG_TCI(tag) ((tag) & (SCI_MAX_IO_REQUESTS-1)) 376 376 377 377 /* expander attached sata devices require 3 rnc slots */ 378 - static inline int scic_sds_remote_device_node_count(struct isci_remote_device *idev) 378 + static inline int sci_remote_device_node_count(struct isci_remote_device *idev) 379 379 { 380 380 struct domain_device *dev = idev->domain_dev; 381 381 ··· 386 386 } 387 387 388 388 /** 389 - * scic_sds_controller_set_invalid_phy() - 389 + * sci_controller_set_invalid_phy() - 390 390 * 391 391 * This macro will set the bit in the invalid phy mask for this controller 392 392 * object. This is used to control messages reported for invalid link up 393 393 * notifications. 394 394 */ 395 - #define scic_sds_controller_set_invalid_phy(controller, phy) \ 395 + #define sci_controller_set_invalid_phy(controller, phy) \ 396 396 ((controller)->invalid_phy_mask |= (1 << (phy)->phy_index)) 397 397 398 398 /** 399 - * scic_sds_controller_clear_invalid_phy() - 399 + * sci_controller_clear_invalid_phy() - 400 400 * 401 401 * This macro will clear the bit in the invalid phy mask for this controller 402 402 * object. This is used to control messages reported for invalid link up 403 403 * notifications. 404 404 */ 405 - #define scic_sds_controller_clear_invalid_phy(controller, phy) \ 405 + #define sci_controller_clear_invalid_phy(controller, phy) \ 406 406 ((controller)->invalid_phy_mask &= ~(1 << (phy)->phy_index)) 407 407 408 408 static inline struct device *sciphy_to_dev(struct isci_phy *iphy) ··· 460 460 return isci_si_rev > ISCI_SI_REVB0; 461 461 } 462 462 463 - void scic_sds_controller_post_request(struct isci_host *ihost, 463 + void sci_controller_post_request(struct isci_host *ihost, 464 464 u32 request); 465 - void scic_sds_controller_release_frame(struct isci_host *ihost, 465 + void sci_controller_release_frame(struct isci_host *ihost, 466 466 u32 frame_index); 467 - void scic_sds_controller_copy_sata_response(void *response_buffer, 467 + void sci_controller_copy_sata_response(void *response_buffer, 468 468 void *frame_header, 469 469 void *frame_buffer); 470 - enum sci_status scic_sds_controller_allocate_remote_node_context(struct isci_host *ihost, 470 + enum sci_status sci_controller_allocate_remote_node_context(struct isci_host *ihost, 471 471 struct isci_remote_device *idev, 472 472 u16 *node_id); 473 - void scic_sds_controller_free_remote_node_context( 473 + void sci_controller_free_remote_node_context( 474 474 struct isci_host *ihost, 475 475 struct isci_remote_device *idev, 476 476 u16 node_id); 477 - union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffer( 478 - struct isci_host *ihost, 479 - u16 node_id); 480 477 481 - struct isci_request *scic_request_by_tag(struct isci_host *ihost, 478 + struct isci_request *sci_request_by_tag(struct isci_host *ihost, 482 479 u16 io_tag); 483 480 484 - void scic_sds_controller_power_control_queue_insert( 481 + void sci_controller_power_control_queue_insert( 485 482 struct isci_host *ihost, 486 483 struct isci_phy *iphy); 487 484 488 - void scic_sds_controller_power_control_queue_remove( 485 + void sci_controller_power_control_queue_remove( 489 486 struct isci_host *ihost, 490 487 struct isci_phy *iphy); 491 488 492 - void scic_sds_controller_link_up( 493 - struct isci_host *ihost, 494 - struct isci_port *iport, 495 - struct isci_phy *iphy); 496 - 497 - void scic_sds_controller_link_down( 489 + void sci_controller_link_up( 498 490 struct isci_host *ihost, 499 491 struct isci_port *iport, 500 492 struct isci_phy *iphy); 501 493 502 - void scic_sds_controller_remote_device_stopped( 494 + void sci_controller_link_down( 495 + struct isci_host *ihost, 496 + struct isci_port *iport, 497 + struct isci_phy *iphy); 498 + 499 + void sci_controller_remote_device_stopped( 503 500 struct isci_host *ihost, 504 501 struct isci_remote_device *idev); 505 502 506 - void scic_sds_controller_copy_task_context( 503 + void sci_controller_copy_task_context( 507 504 struct isci_host *ihost, 508 505 struct isci_request *ireq); 509 506 510 - void scic_sds_controller_register_setup(struct isci_host *ihost); 507 + void sci_controller_register_setup(struct isci_host *ihost); 511 508 512 - enum sci_status scic_controller_continue_io(struct isci_request *ireq); 509 + enum sci_status sci_controller_continue_io(struct isci_request *ireq); 513 510 int isci_host_scan_finished(struct Scsi_Host *, unsigned long); 514 511 void isci_host_scan_start(struct Scsi_Host *); 515 512 u16 isci_alloc_tag(struct isci_host *ihost); ··· 533 536 struct isci_remote_device *, 534 537 enum sci_status); 535 538 536 - void scic_controller_disable_interrupts( 539 + void sci_controller_disable_interrupts( 537 540 struct isci_host *ihost); 538 541 539 - enum sci_status scic_controller_start_io( 542 + enum sci_status sci_controller_start_io( 540 543 struct isci_host *ihost, 541 544 struct isci_remote_device *idev, 542 545 struct isci_request *ireq); 543 546 544 - enum sci_task_status scic_controller_start_task( 547 + enum sci_task_status sci_controller_start_task( 545 548 struct isci_host *ihost, 546 549 struct isci_remote_device *idev, 547 550 struct isci_request *ireq); 548 551 549 - enum sci_status scic_controller_terminate_request( 552 + enum sci_status sci_controller_terminate_request( 550 553 struct isci_host *ihost, 551 554 struct isci_remote_device *idev, 552 555 struct isci_request *ireq); 553 556 554 - enum sci_status scic_controller_complete_io( 557 + enum sci_status sci_controller_complete_io( 555 558 struct isci_host *ihost, 556 559 struct isci_remote_device *idev, 557 560 struct isci_request *ireq); 558 561 559 - void scic_sds_port_configuration_agent_construct( 560 - struct scic_sds_port_configuration_agent *port_agent); 562 + void sci_port_configuration_agent_construct( 563 + struct sci_port_configuration_agent *port_agent); 561 564 562 - enum sci_status scic_sds_port_configuration_agent_initialize( 565 + enum sci_status sci_port_configuration_agent_initialize( 563 566 struct isci_host *ihost, 564 - struct scic_sds_port_configuration_agent *port_agent); 567 + struct sci_port_configuration_agent *port_agent); 565 568 #endif
+2 -2
drivers/scsi/isci/init.c
··· 484 484 orom = isci_request_oprom(pdev); 485 485 486 486 for (i = 0; orom && i < ARRAY_SIZE(orom->ctrl); i++) { 487 - if (scic_oem_parameters_validate(&orom->ctrl[i])) { 487 + if (sci_oem_parameters_validate(&orom->ctrl[i])) { 488 488 dev_warn(&pdev->dev, 489 489 "[%d]: invalid oem parameters detected, falling back to firmware\n", i); 490 490 devm_kfree(&pdev->dev, orom); ··· 554 554 for_each_isci_host(i, ihost, pdev) { 555 555 isci_unregister(ihost); 556 556 isci_host_deinit(ihost); 557 - scic_controller_disable_interrupts(ihost); 557 + sci_controller_disable_interrupts(ihost); 558 558 } 559 559 } 560 560
+3 -3
drivers/scsi/isci/isci.h
··· 304 304 * This member indicates that the operation failed, the failure is 305 305 * controller implementation specific, and the response data associated 306 306 * with the request is not valid. You can query for the controller 307 - * specific error information via scic_controller_get_request_status() 307 + * specific error information via sci_controller_get_request_status() 308 308 */ 309 309 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR, 310 310 ··· 395 395 /** 396 396 * This value indicates that an unsupported PCI device ID has been 397 397 * specified. This indicates that attempts to invoke 398 - * scic_library_allocate_controller() will fail. 398 + * sci_library_allocate_controller() will fail. 399 399 */ 400 400 SCI_FAILURE_UNSUPPORTED_PCI_DEVICE_ID 401 401 ··· 493 493 /* 494 494 * Each timer is associated with a cancellation flag that is set when 495 495 * del_timer() is called and checked in the timer callback function. This 496 - * is needed since del_timer_sync() cannot be called with scic_lock held. 496 + * is needed since del_timer_sync() cannot be called with sci_lock held. 497 497 * For deinit however, del_timer_sync() is used without holding the lock. 498 498 */ 499 499 struct sci_timer {
+151 -234
drivers/scsi/isci/phy.c
··· 67 67 return iphy->max_negotiated_speed; 68 68 } 69 69 70 - /* 71 - * ***************************************************************************** 72 - * * SCIC SDS PHY Internal Methods 73 - * ***************************************************************************** */ 74 - 75 - /** 76 - * This method will initialize the phy transport layer registers 77 - * @sci_phy: 78 - * @transport_layer_registers 79 - * 80 - * enum sci_status 81 - */ 82 - static enum sci_status scic_sds_phy_transport_layer_initialization( 83 - struct isci_phy *iphy, 84 - struct scu_transport_layer_registers __iomem *transport_layer_registers) 70 + static enum sci_status 71 + sci_phy_transport_layer_initialization(struct isci_phy *iphy, 72 + struct scu_transport_layer_registers __iomem *reg) 85 73 { 86 74 u32 tl_control; 87 75 88 - iphy->transport_layer_registers = transport_layer_registers; 76 + iphy->transport_layer_registers = reg; 89 77 90 78 writel(SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX, 91 79 &iphy->transport_layer_registers->stp_rni); ··· 89 101 return SCI_SUCCESS; 90 102 } 91 103 92 - /** 93 - * This method will initialize the phy link layer registers 94 - * @sci_phy: 95 - * @link_layer_registers: 96 - * 97 - * enum sci_status 98 - */ 99 104 static enum sci_status 100 - scic_sds_phy_link_layer_initialization(struct isci_phy *iphy, 101 - struct scu_link_layer_registers __iomem *link_layer_registers) 105 + sci_phy_link_layer_initialization(struct isci_phy *iphy, 106 + struct scu_link_layer_registers __iomem *reg) 102 107 { 103 - struct isci_host *ihost = 104 - iphy->owning_port->owning_controller; 108 + struct isci_host *ihost = iphy->owning_port->owning_controller; 105 109 int phy_idx = iphy->phy_index; 106 - struct sci_phy_user_params *phy_user = 107 - &ihost->user_parameters.sds1.phys[phy_idx]; 110 + struct sci_phy_user_params *phy_user = &ihost->user_parameters.phys[phy_idx]; 108 111 struct sci_phy_oem_params *phy_oem = 109 - &ihost->oem_parameters.sds1.phys[phy_idx]; 112 + &ihost->oem_parameters.phys[phy_idx]; 110 113 u32 phy_configuration; 111 - struct scic_phy_cap phy_cap; 114 + struct sci_phy_cap phy_cap; 112 115 u32 parity_check = 0; 113 116 u32 parity_count = 0; 114 117 u32 llctl, link_rate; 115 118 u32 clksm_value = 0; 116 119 117 - iphy->link_layer_registers = link_layer_registers; 120 + iphy->link_layer_registers = reg; 118 121 119 122 /* Set our IDENTIFY frame data */ 120 123 #define SCI_END_DEVICE 0x01 ··· 148 169 phy_cap.gen3_no_ssc = 1; 149 170 phy_cap.gen2_no_ssc = 1; 150 171 phy_cap.gen1_no_ssc = 1; 151 - if (ihost->oem_parameters.sds1.controller.do_enable_ssc == true) { 172 + if (ihost->oem_parameters.controller.do_enable_ssc == true) { 152 173 phy_cap.gen3_ssc = 1; 153 174 phy_cap.gen2_ssc = 1; 154 175 phy_cap.gen1_ssc = 1; ··· 195 216 &iphy->link_layer_registers->afe_lookup_table_control); 196 217 197 218 llctl = SCU_SAS_LLCTL_GEN_VAL(NO_OUTBOUND_TASK_TIMEOUT, 198 - (u8)ihost->user_parameters.sds1.no_outbound_task_timeout); 219 + (u8)ihost->user_parameters.no_outbound_task_timeout); 199 220 200 221 switch(phy_user->max_speed_generation) { 201 222 case SCIC_SDS_PARM_GEN3_SPEED: ··· 268 289 struct isci_port *phy_get_non_dummy_port( 269 290 struct isci_phy *iphy) 270 291 { 271 - if (scic_sds_port_get_index(iphy->owning_port) == SCIC_SDS_DUMMY_PORT) 292 + if (sci_port_get_index(iphy->owning_port) == SCIC_SDS_DUMMY_PORT) 272 293 return NULL; 273 294 274 295 return iphy->owning_port; ··· 281 302 * 282 303 * 283 304 */ 284 - void scic_sds_phy_set_port( 305 + void sci_phy_set_port( 285 306 struct isci_phy *iphy, 286 307 struct isci_port *iport) 287 308 { ··· 289 310 290 311 if (iphy->bcn_received_while_port_unassigned) { 291 312 iphy->bcn_received_while_port_unassigned = false; 292 - scic_sds_port_broadcast_change_received(iphy->owning_port, iphy); 313 + sci_port_broadcast_change_received(iphy->owning_port, iphy); 293 314 } 294 315 } 295 316 296 - /** 297 - * This method will initialize the constructed phy 298 - * @sci_phy: 299 - * @link_layer_registers: 300 - * 301 - * enum sci_status 302 - */ 303 - enum sci_status scic_sds_phy_initialize( 304 - struct isci_phy *iphy, 305 - struct scu_transport_layer_registers __iomem *transport_layer_registers, 306 - struct scu_link_layer_registers __iomem *link_layer_registers) 317 + enum sci_status sci_phy_initialize(struct isci_phy *iphy, 318 + struct scu_transport_layer_registers __iomem *tl, 319 + struct scu_link_layer_registers __iomem *ll) 307 320 { 308 321 /* Perfrom the initialization of the TL hardware */ 309 - scic_sds_phy_transport_layer_initialization( 310 - iphy, 311 - transport_layer_registers); 322 + sci_phy_transport_layer_initialization(iphy, tl); 312 323 313 324 /* Perofrm the initialization of the PE hardware */ 314 - scic_sds_phy_link_layer_initialization(iphy, link_layer_registers); 325 + sci_phy_link_layer_initialization(iphy, ll); 315 326 316 - /* 317 - * There is nothing that needs to be done in this state just 318 - * transition to the stopped state. */ 327 + /* There is nothing that needs to be done in this state just 328 + * transition to the stopped state 329 + */ 319 330 sci_change_state(&iphy->sm, SCI_PHY_STOPPED); 320 331 321 332 return SCI_SUCCESS; ··· 320 351 * This will either be the RNi for the device or an invalid RNi if there 321 352 * is no current device assigned to the phy. 322 353 */ 323 - void scic_sds_phy_setup_transport( 324 - struct isci_phy *iphy, 325 - u32 device_id) 354 + void sci_phy_setup_transport(struct isci_phy *iphy, u32 device_id) 326 355 { 327 356 u32 tl_control; 328 357 ··· 335 368 writel(tl_control, &iphy->transport_layer_registers->control); 336 369 } 337 370 338 - /** 339 - * 340 - * @sci_phy: The phy object to be suspended. 341 - * 342 - * This function will perform the register reads/writes to suspend the SCU 343 - * hardware protocol engine. none 344 - */ 345 - static void scic_sds_phy_suspend( 346 - struct isci_phy *iphy) 371 + static void sci_phy_suspend(struct isci_phy *iphy) 347 372 { 348 373 u32 scu_sas_pcfg_value; 349 374 ··· 345 386 writel(scu_sas_pcfg_value, 346 387 &iphy->link_layer_registers->phy_configuration); 347 388 348 - scic_sds_phy_setup_transport( 349 - iphy, 350 - SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX); 389 + sci_phy_setup_transport(iphy, SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX); 351 390 } 352 391 353 - void scic_sds_phy_resume(struct isci_phy *iphy) 392 + void sci_phy_resume(struct isci_phy *iphy) 354 393 { 355 394 u32 scu_sas_pcfg_value; 356 395 ··· 359 402 &iphy->link_layer_registers->phy_configuration); 360 403 } 361 404 362 - void scic_sds_phy_get_sas_address(struct isci_phy *iphy, 363 - struct sci_sas_address *sas_address) 405 + void sci_phy_get_sas_address(struct isci_phy *iphy, struct sci_sas_address *sas) 364 406 { 365 - sas_address->high = readl(&iphy->link_layer_registers->source_sas_address_high); 366 - sas_address->low = readl(&iphy->link_layer_registers->source_sas_address_low); 407 + sas->high = readl(&iphy->link_layer_registers->source_sas_address_high); 408 + sas->low = readl(&iphy->link_layer_registers->source_sas_address_low); 367 409 } 368 410 369 - void scic_sds_phy_get_attached_sas_address(struct isci_phy *iphy, 370 - struct sci_sas_address *sas_address) 411 + void sci_phy_get_attached_sas_address(struct isci_phy *iphy, struct sci_sas_address *sas) 371 412 { 372 413 struct sas_identify_frame *iaf; 373 414 374 415 iaf = &iphy->frame_rcvd.iaf; 375 - memcpy(sas_address, iaf->sas_addr, SAS_ADDR_SIZE); 416 + memcpy(sas, iaf->sas_addr, SAS_ADDR_SIZE); 376 417 } 377 418 378 - void scic_sds_phy_get_protocols(struct isci_phy *iphy, 379 - struct scic_phy_proto *protocols) 419 + void sci_phy_get_protocols(struct isci_phy *iphy, struct sci_phy_proto *proto) 380 420 { 381 - protocols->all = 382 - (u16)(readl(&iphy-> 383 - link_layer_registers->transmit_identification) & 384 - 0x0000FFFF); 421 + proto->all = readl(&iphy->link_layer_registers->transmit_identification); 385 422 } 386 423 387 - enum sci_status scic_sds_phy_start(struct isci_phy *iphy) 424 + enum sci_status sci_phy_start(struct isci_phy *iphy) 388 425 { 389 - enum scic_sds_phy_states state = iphy->sm.current_state_id; 426 + enum sci_phy_states state = iphy->sm.current_state_id; 390 427 391 428 if (state != SCI_PHY_STOPPED) { 392 429 dev_dbg(sciphy_to_dev(iphy), ··· 392 441 return SCI_SUCCESS; 393 442 } 394 443 395 - enum sci_status scic_sds_phy_stop(struct isci_phy *iphy) 444 + enum sci_status sci_phy_stop(struct isci_phy *iphy) 396 445 { 397 - enum scic_sds_phy_states state = iphy->sm.current_state_id; 446 + enum sci_phy_states state = iphy->sm.current_state_id; 398 447 399 448 switch (state) { 400 449 case SCI_PHY_SUB_INITIAL: ··· 418 467 return SCI_SUCCESS; 419 468 } 420 469 421 - enum sci_status scic_sds_phy_reset(struct isci_phy *iphy) 470 + enum sci_status sci_phy_reset(struct isci_phy *iphy) 422 471 { 423 - enum scic_sds_phy_states state = iphy->sm.current_state_id; 472 + enum sci_phy_states state = iphy->sm.current_state_id; 424 473 425 474 if (state != SCI_PHY_READY) { 426 475 dev_dbg(sciphy_to_dev(iphy), ··· 432 481 return SCI_SUCCESS; 433 482 } 434 483 435 - enum sci_status scic_sds_phy_consume_power_handler(struct isci_phy *iphy) 484 + enum sci_status sci_phy_consume_power_handler(struct isci_phy *iphy) 436 485 { 437 - enum scic_sds_phy_states state = iphy->sm.current_state_id; 486 + enum sci_phy_states state = iphy->sm.current_state_id; 438 487 439 488 switch (state) { 440 489 case SCI_PHY_SUB_AWAIT_SAS_POWER: { ··· 479 528 } 480 529 } 481 530 482 - /* 483 - * ***************************************************************************** 484 - * * SCIC SDS PHY HELPER FUNCTIONS 485 - * ***************************************************************************** */ 486 - 487 - 488 - /** 489 - * 490 - * @sci_phy: The phy object that received SAS PHY DETECTED. 491 - * 492 - * This method continues the link training for the phy as if it were a SAS PHY 493 - * instead of a SATA PHY. This is done because the completion queue had a SAS 494 - * PHY DETECTED event when the state machine was expecting a SATA PHY event. 495 - * none 496 - */ 497 - static void scic_sds_phy_start_sas_link_training( 498 - struct isci_phy *iphy) 531 + static void sci_phy_start_sas_link_training(struct isci_phy *iphy) 499 532 { 533 + /* continue the link training for the phy as if it were a SAS PHY 534 + * instead of a SATA PHY. This is done because the completion queue had a SAS 535 + * PHY DETECTED event when the state machine was expecting a SATA PHY event. 536 + */ 500 537 u32 phy_control; 501 538 502 - phy_control = 503 - readl(&iphy->link_layer_registers->phy_configuration); 539 + phy_control = readl(&iphy->link_layer_registers->phy_configuration); 504 540 phy_control |= SCU_SAS_PCFG_GEN_BIT(SATA_SPINUP_HOLD); 505 541 writel(phy_control, 506 - &iphy->link_layer_registers->phy_configuration); 542 + &iphy->link_layer_registers->phy_configuration); 507 543 508 544 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SAS_SPEED_EN); 509 545 510 546 iphy->protocol = SCIC_SDS_PHY_PROTOCOL_SAS; 511 547 } 512 548 513 - /** 514 - * 515 - * @sci_phy: The phy object that received a SATA SPINUP HOLD event 516 - * 517 - * This method continues the link training for the phy as if it were a SATA PHY 518 - * instead of a SAS PHY. This is done because the completion queue had a SATA 519 - * SPINUP HOLD event when the state machine was expecting a SAS PHY event. none 520 - */ 521 - static void scic_sds_phy_start_sata_link_training( 522 - struct isci_phy *iphy) 549 + static void sci_phy_start_sata_link_training(struct isci_phy *iphy) 523 550 { 551 + /* This method continues the link training for the phy as if it were a SATA PHY 552 + * instead of a SAS PHY. This is done because the completion queue had a SATA 553 + * SPINUP HOLD event when the state machine was expecting a SAS PHY event. none 554 + */ 524 555 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_POWER); 525 556 526 557 iphy->protocol = SCIC_SDS_PHY_PROTOCOL_SATA; 527 558 } 528 559 529 560 /** 530 - * scic_sds_phy_complete_link_training - perform processing common to 561 + * sci_phy_complete_link_training - perform processing common to 531 562 * all protocols upon completion of link training. 532 563 * @sci_phy: This parameter specifies the phy object for which link training 533 564 * has completed. ··· 519 586 * sub-state machine. 520 587 * 521 588 */ 522 - static void scic_sds_phy_complete_link_training( 523 - struct isci_phy *iphy, 524 - enum sas_linkrate max_link_rate, 525 - u32 next_state) 589 + static void sci_phy_complete_link_training(struct isci_phy *iphy, 590 + enum sas_linkrate max_link_rate, 591 + u32 next_state) 526 592 { 527 593 iphy->max_negotiated_speed = max_link_rate; 528 594 529 595 sci_change_state(&iphy->sm, next_state); 530 596 } 531 597 532 - enum sci_status scic_sds_phy_event_handler(struct isci_phy *iphy, 533 - u32 event_code) 598 + enum sci_status sci_phy_event_handler(struct isci_phy *iphy, u32 event_code) 534 599 { 535 - enum scic_sds_phy_states state = iphy->sm.current_state_id; 600 + enum sci_phy_states state = iphy->sm.current_state_id; 536 601 537 602 switch (state) { 538 603 case SCI_PHY_SUB_AWAIT_OSSP_EN: 539 604 switch (scu_get_event_code(event_code)) { 540 605 case SCU_EVENT_SAS_PHY_DETECTED: 541 - scic_sds_phy_start_sas_link_training(iphy); 606 + sci_phy_start_sas_link_training(iphy); 542 607 iphy->is_in_link_training = true; 543 608 break; 544 609 case SCU_EVENT_SATA_SPINUP_HOLD: 545 - scic_sds_phy_start_sata_link_training(iphy); 610 + sci_phy_start_sata_link_training(iphy); 546 611 iphy->is_in_link_training = true; 547 612 break; 548 613 default: ··· 561 630 break; 562 631 case SCU_EVENT_SAS_15: 563 632 case SCU_EVENT_SAS_15_SSC: 564 - scic_sds_phy_complete_link_training( 565 - iphy, 566 - SAS_LINK_RATE_1_5_GBPS, 567 - SCI_PHY_SUB_AWAIT_IAF_UF); 633 + sci_phy_complete_link_training(iphy, SAS_LINK_RATE_1_5_GBPS, 634 + SCI_PHY_SUB_AWAIT_IAF_UF); 568 635 break; 569 636 case SCU_EVENT_SAS_30: 570 637 case SCU_EVENT_SAS_30_SSC: 571 - scic_sds_phy_complete_link_training( 572 - iphy, 573 - SAS_LINK_RATE_3_0_GBPS, 574 - SCI_PHY_SUB_AWAIT_IAF_UF); 638 + sci_phy_complete_link_training(iphy, SAS_LINK_RATE_3_0_GBPS, 639 + SCI_PHY_SUB_AWAIT_IAF_UF); 575 640 break; 576 641 case SCU_EVENT_SAS_60: 577 642 case SCU_EVENT_SAS_60_SSC: 578 - scic_sds_phy_complete_link_training( 579 - iphy, 580 - SAS_LINK_RATE_6_0_GBPS, 581 - SCI_PHY_SUB_AWAIT_IAF_UF); 643 + sci_phy_complete_link_training(iphy, SAS_LINK_RATE_6_0_GBPS, 644 + SCI_PHY_SUB_AWAIT_IAF_UF); 582 645 break; 583 646 case SCU_EVENT_SATA_SPINUP_HOLD: 584 647 /* 585 648 * We were doing SAS PHY link training and received a SATA PHY event 586 649 * continue OOB/SN as if this were a SATA PHY */ 587 - scic_sds_phy_start_sata_link_training(iphy); 650 + sci_phy_start_sata_link_training(iphy); 588 651 break; 589 652 case SCU_EVENT_LINK_FAILURE: 590 653 /* Link failure change state back to the starting state */ ··· 598 673 switch (scu_get_event_code(event_code)) { 599 674 case SCU_EVENT_SAS_PHY_DETECTED: 600 675 /* Backup the state machine */ 601 - scic_sds_phy_start_sas_link_training(iphy); 676 + sci_phy_start_sas_link_training(iphy); 602 677 break; 603 678 case SCU_EVENT_SATA_SPINUP_HOLD: 604 679 /* We were doing SAS PHY link training and received a 605 680 * SATA PHY event continue OOB/SN as if this were a 606 681 * SATA PHY 607 682 */ 608 - scic_sds_phy_start_sata_link_training(iphy); 683 + sci_phy_start_sata_link_training(iphy); 609 684 break; 610 685 case SCU_EVENT_RECEIVED_IDENTIFY_TIMEOUT: 611 686 case SCU_EVENT_LINK_FAILURE: ··· 652 727 /* There has been a change in the phy type before OOB/SN for the 653 728 * SATA finished start down the SAS link traning path. 654 729 */ 655 - scic_sds_phy_start_sas_link_training(iphy); 730 + sci_phy_start_sas_link_training(iphy); 656 731 break; 657 732 658 733 default: ··· 685 760 /* There has been a change in the phy type before OOB/SN for the 686 761 * SATA finished start down the SAS link traning path. 687 762 */ 688 - scic_sds_phy_start_sas_link_training(iphy); 763 + sci_phy_start_sas_link_training(iphy); 689 764 break; 690 765 default: 691 766 dev_warn(sciphy_to_dev(iphy), ··· 706 781 break; 707 782 case SCU_EVENT_SATA_15: 708 783 case SCU_EVENT_SATA_15_SSC: 709 - scic_sds_phy_complete_link_training( 710 - iphy, 711 - SAS_LINK_RATE_1_5_GBPS, 712 - SCI_PHY_SUB_AWAIT_SIG_FIS_UF); 784 + sci_phy_complete_link_training(iphy, SAS_LINK_RATE_1_5_GBPS, 785 + SCI_PHY_SUB_AWAIT_SIG_FIS_UF); 713 786 break; 714 787 case SCU_EVENT_SATA_30: 715 788 case SCU_EVENT_SATA_30_SSC: 716 - scic_sds_phy_complete_link_training( 717 - iphy, 718 - SAS_LINK_RATE_3_0_GBPS, 719 - SCI_PHY_SUB_AWAIT_SIG_FIS_UF); 789 + sci_phy_complete_link_training(iphy, SAS_LINK_RATE_3_0_GBPS, 790 + SCI_PHY_SUB_AWAIT_SIG_FIS_UF); 720 791 break; 721 792 case SCU_EVENT_SATA_60: 722 793 case SCU_EVENT_SATA_60_SSC: 723 - scic_sds_phy_complete_link_training( 724 - iphy, 725 - SAS_LINK_RATE_6_0_GBPS, 726 - SCI_PHY_SUB_AWAIT_SIG_FIS_UF); 794 + sci_phy_complete_link_training(iphy, SAS_LINK_RATE_6_0_GBPS, 795 + SCI_PHY_SUB_AWAIT_SIG_FIS_UF); 727 796 break; 728 797 case SCU_EVENT_LINK_FAILURE: 729 798 /* Link failure change state back to the starting state */ ··· 727 808 /* 728 809 * There has been a change in the phy type before OOB/SN for the 729 810 * SATA finished start down the SAS link traning path. */ 730 - scic_sds_phy_start_sas_link_training(iphy); 811 + sci_phy_start_sas_link_training(iphy); 731 812 break; 732 813 default: 733 814 dev_warn(sciphy_to_dev(iphy), ··· 770 851 case SCU_EVENT_BROADCAST_CHANGE: 771 852 /* Broadcast change received. Notify the port. */ 772 853 if (phy_get_non_dummy_port(iphy) != NULL) 773 - scic_sds_port_broadcast_change_received(iphy->owning_port, iphy); 854 + sci_port_broadcast_change_received(iphy->owning_port, iphy); 774 855 else 775 856 iphy->bcn_received_while_port_unassigned = true; 776 857 break; ··· 805 886 } 806 887 } 807 888 808 - enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy, 809 - u32 frame_index) 889 + enum sci_status sci_phy_frame_handler(struct isci_phy *iphy, u32 frame_index) 810 890 { 811 - enum scic_sds_phy_states state = iphy->sm.current_state_id; 891 + enum sci_phy_states state = iphy->sm.current_state_id; 812 892 struct isci_host *ihost = iphy->owning_port->owning_controller; 813 893 enum sci_status result; 814 894 unsigned long flags; ··· 817 899 u32 *frame_words; 818 900 struct sas_identify_frame iaf; 819 901 820 - result = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control, 821 - frame_index, 822 - (void **)&frame_words); 902 + result = sci_unsolicited_frame_control_get_header(&ihost->uf_control, 903 + frame_index, 904 + (void **)&frame_words); 823 905 824 906 if (result != SCI_SUCCESS) 825 907 return result; ··· 851 933 "unexpected frame id %x\n", 852 934 __func__, frame_index); 853 935 854 - scic_sds_controller_release_frame(ihost, frame_index); 936 + sci_controller_release_frame(ihost, frame_index); 855 937 return result; 856 938 } 857 939 case SCI_PHY_SUB_AWAIT_SIG_FIS_UF: { 858 940 struct dev_to_host_fis *frame_header; 859 941 u32 *fis_frame_data; 860 942 861 - result = scic_sds_unsolicited_frame_control_get_header( 862 - &(scic_sds_phy_get_controller(iphy)->uf_control), 943 + result = sci_unsolicited_frame_control_get_header( 944 + &(sci_phy_get_controller(iphy)->uf_control), 863 945 frame_index, 864 946 (void **)&frame_header); 865 947 ··· 868 950 869 951 if ((frame_header->fis_type == FIS_REGD2H) && 870 952 !(frame_header->status & ATA_BUSY)) { 871 - scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control, 872 - frame_index, 873 - (void **)&fis_frame_data); 953 + sci_unsolicited_frame_control_get_buffer(&ihost->uf_control, 954 + frame_index, 955 + (void **)&fis_frame_data); 874 956 875 957 spin_lock_irqsave(&iphy->sas_phy.frame_rcvd_lock, flags); 876 - scic_sds_controller_copy_sata_response(&iphy->frame_rcvd.fis, 877 - frame_header, 878 - fis_frame_data); 958 + sci_controller_copy_sata_response(&iphy->frame_rcvd.fis, 959 + frame_header, 960 + fis_frame_data); 879 961 spin_unlock_irqrestore(&iphy->sas_phy.frame_rcvd_lock, flags); 880 962 881 963 /* got IAF we can now go to the await spinup semaphore state */ ··· 889 971 __func__, frame_index); 890 972 891 973 /* Regardless of the result we are done with this frame with it */ 892 - scic_sds_controller_release_frame(ihost, frame_index); 974 + sci_controller_release_frame(ihost, frame_index); 893 975 894 976 return result; 895 977 } ··· 901 983 902 984 } 903 985 904 - static void scic_sds_phy_starting_initial_substate_enter(struct sci_base_state_machine *sm) 986 + static void sci_phy_starting_initial_substate_enter(struct sci_base_state_machine *sm) 905 987 { 906 988 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 907 989 ··· 909 991 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_OSSP_EN); 910 992 } 911 993 912 - static void scic_sds_phy_starting_await_sas_power_substate_enter(struct sci_base_state_machine *sm) 994 + static void sci_phy_starting_await_sas_power_substate_enter(struct sci_base_state_machine *sm) 913 995 { 914 996 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 915 997 struct isci_host *ihost = iphy->owning_port->owning_controller; 916 998 917 - scic_sds_controller_power_control_queue_insert(ihost, iphy); 999 + sci_controller_power_control_queue_insert(ihost, iphy); 918 1000 } 919 1001 920 - static void scic_sds_phy_starting_await_sas_power_substate_exit(struct sci_base_state_machine *sm) 1002 + static void sci_phy_starting_await_sas_power_substate_exit(struct sci_base_state_machine *sm) 921 1003 { 922 1004 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 923 1005 struct isci_host *ihost = iphy->owning_port->owning_controller; 924 1006 925 - scic_sds_controller_power_control_queue_remove(ihost, iphy); 1007 + sci_controller_power_control_queue_remove(ihost, iphy); 926 1008 } 927 1009 928 - static void scic_sds_phy_starting_await_sata_power_substate_enter(struct sci_base_state_machine *sm) 1010 + static void sci_phy_starting_await_sata_power_substate_enter(struct sci_base_state_machine *sm) 929 1011 { 930 1012 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 931 1013 struct isci_host *ihost = iphy->owning_port->owning_controller; 932 1014 933 - scic_sds_controller_power_control_queue_insert(ihost, iphy); 1015 + sci_controller_power_control_queue_insert(ihost, iphy); 934 1016 } 935 1017 936 - static void scic_sds_phy_starting_await_sata_power_substate_exit(struct sci_base_state_machine *sm) 1018 + static void sci_phy_starting_await_sata_power_substate_exit(struct sci_base_state_machine *sm) 937 1019 { 938 1020 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 939 1021 struct isci_host *ihost = iphy->owning_port->owning_controller; 940 1022 941 - scic_sds_controller_power_control_queue_remove(ihost, iphy); 1023 + sci_controller_power_control_queue_remove(ihost, iphy); 942 1024 } 943 1025 944 - static void scic_sds_phy_starting_await_sata_phy_substate_enter(struct sci_base_state_machine *sm) 1026 + static void sci_phy_starting_await_sata_phy_substate_enter(struct sci_base_state_machine *sm) 945 1027 { 946 1028 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 947 1029 948 1030 sci_mod_timer(&iphy->sata_timer, SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT); 949 1031 } 950 1032 951 - static void scic_sds_phy_starting_await_sata_phy_substate_exit(struct sci_base_state_machine *sm) 1033 + static void sci_phy_starting_await_sata_phy_substate_exit(struct sci_base_state_machine *sm) 952 1034 { 953 1035 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 954 1036 955 1037 sci_del_timer(&iphy->sata_timer); 956 1038 } 957 1039 958 - static void scic_sds_phy_starting_await_sata_speed_substate_enter(struct sci_base_state_machine *sm) 1040 + static void sci_phy_starting_await_sata_speed_substate_enter(struct sci_base_state_machine *sm) 959 1041 { 960 1042 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 961 1043 962 1044 sci_mod_timer(&iphy->sata_timer, SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT); 963 1045 } 964 1046 965 - static void scic_sds_phy_starting_await_sata_speed_substate_exit(struct sci_base_state_machine *sm) 1047 + static void sci_phy_starting_await_sata_speed_substate_exit(struct sci_base_state_machine *sm) 966 1048 { 967 1049 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 968 1050 969 1051 sci_del_timer(&iphy->sata_timer); 970 1052 } 971 1053 972 - static void scic_sds_phy_starting_await_sig_fis_uf_substate_enter(struct sci_base_state_machine *sm) 1054 + static void sci_phy_starting_await_sig_fis_uf_substate_enter(struct sci_base_state_machine *sm) 973 1055 { 974 1056 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 975 1057 976 - if (scic_sds_port_link_detected(iphy->owning_port, iphy)) { 1058 + if (sci_port_link_detected(iphy->owning_port, iphy)) { 977 1059 978 1060 /* 979 1061 * Clear the PE suspend condition so we can actually ··· 981 1063 * The hardware will not respond to the XRDY until the PE 982 1064 * suspend condition is cleared. 983 1065 */ 984 - scic_sds_phy_resume(iphy); 1066 + sci_phy_resume(iphy); 985 1067 986 1068 sci_mod_timer(&iphy->sata_timer, 987 1069 SCIC_SDS_SIGNATURE_FIS_TIMEOUT); ··· 989 1071 iphy->is_in_link_training = false; 990 1072 } 991 1073 992 - static void scic_sds_phy_starting_await_sig_fis_uf_substate_exit(struct sci_base_state_machine *sm) 1074 + static void sci_phy_starting_await_sig_fis_uf_substate_exit(struct sci_base_state_machine *sm) 993 1075 { 994 1076 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 995 1077 996 1078 sci_del_timer(&iphy->sata_timer); 997 1079 } 998 1080 999 - static void scic_sds_phy_starting_final_substate_enter(struct sci_base_state_machine *sm) 1081 + static void sci_phy_starting_final_substate_enter(struct sci_base_state_machine *sm) 1000 1082 { 1001 1083 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 1002 1084 ··· 1087 1169 &iphy->link_layer_registers->phy_configuration); 1088 1170 } 1089 1171 1090 - static void scic_sds_phy_stopped_state_enter(struct sci_base_state_machine *sm) 1172 + static void sci_phy_stopped_state_enter(struct sci_base_state_machine *sm) 1091 1173 { 1092 1174 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 1093 1175 ··· 1100 1182 scu_link_layer_stop_protocol_engine(iphy); 1101 1183 1102 1184 if (iphy->sm.previous_state_id != SCI_PHY_INITIAL) 1103 - scic_sds_controller_link_down(scic_sds_phy_get_controller(iphy), 1185 + sci_controller_link_down(sci_phy_get_controller(iphy), 1104 1186 phy_get_non_dummy_port(iphy), 1105 1187 iphy); 1106 1188 } 1107 1189 1108 - static void scic_sds_phy_starting_state_enter(struct sci_base_state_machine *sm) 1190 + static void sci_phy_starting_state_enter(struct sci_base_state_machine *sm) 1109 1191 { 1110 1192 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 1111 1193 ··· 1117 1199 iphy->bcn_received_while_port_unassigned = false; 1118 1200 1119 1201 if (iphy->sm.previous_state_id == SCI_PHY_READY) 1120 - scic_sds_controller_link_down(scic_sds_phy_get_controller(iphy), 1202 + sci_controller_link_down(sci_phy_get_controller(iphy), 1121 1203 phy_get_non_dummy_port(iphy), 1122 1204 iphy); 1123 1205 1124 1206 sci_change_state(&iphy->sm, SCI_PHY_SUB_INITIAL); 1125 1207 } 1126 1208 1127 - static void scic_sds_phy_ready_state_enter(struct sci_base_state_machine *sm) 1209 + static void sci_phy_ready_state_enter(struct sci_base_state_machine *sm) 1128 1210 { 1129 1211 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 1130 1212 1131 - scic_sds_controller_link_up(scic_sds_phy_get_controller(iphy), 1213 + sci_controller_link_up(sci_phy_get_controller(iphy), 1132 1214 phy_get_non_dummy_port(iphy), 1133 1215 iphy); 1134 1216 1135 1217 } 1136 1218 1137 - static void scic_sds_phy_ready_state_exit(struct sci_base_state_machine *sm) 1219 + static void sci_phy_ready_state_exit(struct sci_base_state_machine *sm) 1138 1220 { 1139 1221 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 1140 1222 1141 - scic_sds_phy_suspend(iphy); 1223 + sci_phy_suspend(iphy); 1142 1224 } 1143 1225 1144 - static void scic_sds_phy_resetting_state_enter(struct sci_base_state_machine *sm) 1226 + static void sci_phy_resetting_state_enter(struct sci_base_state_machine *sm) 1145 1227 { 1146 1228 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 1147 1229 ··· 1149 1231 * the resetting state we don't notify the user regarding link up and 1150 1232 * link down notifications 1151 1233 */ 1152 - scic_sds_port_deactivate_phy(iphy->owning_port, iphy, false); 1234 + sci_port_deactivate_phy(iphy->owning_port, iphy, false); 1153 1235 1154 1236 if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) { 1155 1237 scu_link_layer_tx_hard_reset(iphy); ··· 1161 1243 } 1162 1244 } 1163 1245 1164 - static const struct sci_base_state scic_sds_phy_state_table[] = { 1246 + static const struct sci_base_state sci_phy_state_table[] = { 1165 1247 [SCI_PHY_INITIAL] = { }, 1166 1248 [SCI_PHY_STOPPED] = { 1167 - .enter_state = scic_sds_phy_stopped_state_enter, 1249 + .enter_state = sci_phy_stopped_state_enter, 1168 1250 }, 1169 1251 [SCI_PHY_STARTING] = { 1170 - .enter_state = scic_sds_phy_starting_state_enter, 1252 + .enter_state = sci_phy_starting_state_enter, 1171 1253 }, 1172 1254 [SCI_PHY_SUB_INITIAL] = { 1173 - .enter_state = scic_sds_phy_starting_initial_substate_enter, 1255 + .enter_state = sci_phy_starting_initial_substate_enter, 1174 1256 }, 1175 1257 [SCI_PHY_SUB_AWAIT_OSSP_EN] = { }, 1176 1258 [SCI_PHY_SUB_AWAIT_SAS_SPEED_EN] = { }, 1177 1259 [SCI_PHY_SUB_AWAIT_IAF_UF] = { }, 1178 1260 [SCI_PHY_SUB_AWAIT_SAS_POWER] = { 1179 - .enter_state = scic_sds_phy_starting_await_sas_power_substate_enter, 1180 - .exit_state = scic_sds_phy_starting_await_sas_power_substate_exit, 1261 + .enter_state = sci_phy_starting_await_sas_power_substate_enter, 1262 + .exit_state = sci_phy_starting_await_sas_power_substate_exit, 1181 1263 }, 1182 1264 [SCI_PHY_SUB_AWAIT_SATA_POWER] = { 1183 - .enter_state = scic_sds_phy_starting_await_sata_power_substate_enter, 1184 - .exit_state = scic_sds_phy_starting_await_sata_power_substate_exit 1265 + .enter_state = sci_phy_starting_await_sata_power_substate_enter, 1266 + .exit_state = sci_phy_starting_await_sata_power_substate_exit 1185 1267 }, 1186 1268 [SCI_PHY_SUB_AWAIT_SATA_PHY_EN] = { 1187 - .enter_state = scic_sds_phy_starting_await_sata_phy_substate_enter, 1188 - .exit_state = scic_sds_phy_starting_await_sata_phy_substate_exit 1269 + .enter_state = sci_phy_starting_await_sata_phy_substate_enter, 1270 + .exit_state = sci_phy_starting_await_sata_phy_substate_exit 1189 1271 }, 1190 1272 [SCI_PHY_SUB_AWAIT_SATA_SPEED_EN] = { 1191 - .enter_state = scic_sds_phy_starting_await_sata_speed_substate_enter, 1192 - .exit_state = scic_sds_phy_starting_await_sata_speed_substate_exit 1273 + .enter_state = sci_phy_starting_await_sata_speed_substate_enter, 1274 + .exit_state = sci_phy_starting_await_sata_speed_substate_exit 1193 1275 }, 1194 1276 [SCI_PHY_SUB_AWAIT_SIG_FIS_UF] = { 1195 - .enter_state = scic_sds_phy_starting_await_sig_fis_uf_substate_enter, 1196 - .exit_state = scic_sds_phy_starting_await_sig_fis_uf_substate_exit 1277 + .enter_state = sci_phy_starting_await_sig_fis_uf_substate_enter, 1278 + .exit_state = sci_phy_starting_await_sig_fis_uf_substate_exit 1197 1279 }, 1198 1280 [SCI_PHY_SUB_FINAL] = { 1199 - .enter_state = scic_sds_phy_starting_final_substate_enter, 1281 + .enter_state = sci_phy_starting_final_substate_enter, 1200 1282 }, 1201 1283 [SCI_PHY_READY] = { 1202 - .enter_state = scic_sds_phy_ready_state_enter, 1203 - .exit_state = scic_sds_phy_ready_state_exit, 1284 + .enter_state = sci_phy_ready_state_enter, 1285 + .exit_state = sci_phy_ready_state_exit, 1204 1286 }, 1205 1287 [SCI_PHY_RESETTING] = { 1206 - .enter_state = scic_sds_phy_resetting_state_enter, 1288 + .enter_state = sci_phy_resetting_state_enter, 1207 1289 }, 1208 1290 [SCI_PHY_FINAL] = { }, 1209 1291 }; 1210 1292 1211 - void scic_sds_phy_construct(struct isci_phy *iphy, 1293 + void sci_phy_construct(struct isci_phy *iphy, 1212 1294 struct isci_port *iport, u8 phy_index) 1213 1295 { 1214 - sci_init_sm(&iphy->sm, scic_sds_phy_state_table, SCI_PHY_INITIAL); 1296 + sci_init_sm(&iphy->sm, sci_phy_state_table, SCI_PHY_INITIAL); 1215 1297 1216 1298 /* Copy the rest of the input data to our locals */ 1217 1299 iphy->owning_port = iport; ··· 1227 1309 1228 1310 void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index) 1229 1311 { 1230 - union scic_oem_parameters oem; 1312 + struct sci_oem_params *oem = &ihost->oem_parameters; 1231 1313 u64 sci_sas_addr; 1232 1314 __be64 sas_addr; 1233 1315 1234 - scic_oem_parameters_get(ihost, &oem); 1235 - sci_sas_addr = oem.sds1.phys[index].sas_address.high; 1316 + sci_sas_addr = oem->phys[index].sas_address.high; 1236 1317 sci_sas_addr <<= 32; 1237 - sci_sas_addr |= oem.sds1.phys[index].sas_address.low; 1318 + sci_sas_addr |= oem->phys[index].sas_address.low; 1238 1319 sas_addr = cpu_to_be64(sci_sas_addr); 1239 1320 memcpy(iphy->sas_addr, &sas_addr, sizeof(sas_addr)); 1240 1321 ··· 1282 1365 switch (func) { 1283 1366 case PHY_FUNC_DISABLE: 1284 1367 spin_lock_irqsave(&ihost->scic_lock, flags); 1285 - scic_sds_phy_stop(iphy); 1368 + sci_phy_stop(iphy); 1286 1369 spin_unlock_irqrestore(&ihost->scic_lock, flags); 1287 1370 break; 1288 1371 1289 1372 case PHY_FUNC_LINK_RESET: 1290 1373 spin_lock_irqsave(&ihost->scic_lock, flags); 1291 - scic_sds_phy_stop(iphy); 1292 - scic_sds_phy_start(iphy); 1374 + sci_phy_stop(iphy); 1375 + sci_phy_start(iphy); 1293 1376 spin_unlock_irqrestore(&ihost->scic_lock, flags); 1294 1377 break; 1295 1378
+35 -35
drivers/scsi/isci/phy.h
··· 76 76 */ 77 77 #define SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT 250 78 78 79 - enum scic_sds_phy_protocol { 79 + enum sci_phy_protocol { 80 80 SCIC_SDS_PHY_PROTOCOL_UNKNOWN, 81 81 SCIC_SDS_PHY_PROTOCOL_SAS, 82 82 SCIC_SDS_PHY_PROTOCOL_SATA, ··· 95 95 struct sci_base_state_machine sm; 96 96 struct isci_port *owning_port; 97 97 enum sas_linkrate max_negotiated_speed; 98 - enum scic_sds_phy_protocol protocol; 98 + enum sci_phy_protocol protocol; 99 99 u8 phy_index; 100 100 bool bcn_received_while_port_unassigned; 101 101 bool is_in_link_training; ··· 118 118 return iphy; 119 119 } 120 120 121 - struct scic_phy_cap { 121 + struct sci_phy_cap { 122 122 union { 123 123 struct { 124 124 /* ··· 147 147 } __packed; 148 148 149 149 /* this data structure reflects the link layer transmit identification reg */ 150 - struct scic_phy_proto { 150 + struct sci_phy_proto { 151 151 union { 152 152 struct { 153 153 u16 _r_a:1; ··· 167 167 168 168 169 169 /** 170 - * struct scic_phy_properties - This structure defines the properties common to 170 + * struct sci_phy_properties - This structure defines the properties common to 171 171 * all phys that can be retrieved. 172 172 * 173 173 * 174 174 */ 175 - struct scic_phy_properties { 175 + struct sci_phy_properties { 176 176 /** 177 177 * This field specifies the port that currently contains the 178 178 * supplied phy. This field may be set to NULL ··· 194 194 }; 195 195 196 196 /** 197 - * struct scic_sas_phy_properties - This structure defines the properties, 197 + * struct sci_sas_phy_properties - This structure defines the properties, 198 198 * specific to a SAS phy, that can be retrieved. 199 199 * 200 200 * 201 201 */ 202 - struct scic_sas_phy_properties { 202 + struct sci_sas_phy_properties { 203 203 /** 204 204 * This field delineates the Identify Address Frame received 205 205 * from the remote end point. ··· 210 210 * This field delineates the Phy capabilities structure received 211 211 * from the remote end point. 212 212 */ 213 - struct scic_phy_cap rcvd_cap; 213 + struct sci_phy_cap rcvd_cap; 214 214 215 215 }; 216 216 217 217 /** 218 - * struct scic_sata_phy_properties - This structure defines the properties, 218 + * struct sci_sata_phy_properties - This structure defines the properties, 219 219 * specific to a SATA phy, that can be retrieved. 220 220 * 221 221 * 222 222 */ 223 - struct scic_sata_phy_properties { 223 + struct sci_sata_phy_properties { 224 224 /** 225 225 * This field delineates the signature FIS received from the 226 226 * attached target. ··· 236 236 }; 237 237 238 238 /** 239 - * enum scic_phy_counter_id - This enumeration depicts the various pieces of 239 + * enum sci_phy_counter_id - This enumeration depicts the various pieces of 240 240 * optional information that can be retrieved for a specific phy. 241 241 * 242 242 * 243 243 */ 244 - enum scic_phy_counter_id { 244 + enum sci_phy_counter_id { 245 245 /** 246 246 * This PHY information field tracks the number of frames received. 247 247 */ ··· 344 344 SCIC_PHY_COUNTER_SN_DWORD_SYNC_ERROR 345 345 }; 346 346 347 - enum scic_sds_phy_states { 347 + enum sci_phy_states { 348 348 /** 349 349 * Simply the initial state for the base domain state machine. 350 350 */ ··· 441 441 }; 442 442 443 443 /** 444 - * scic_sds_phy_get_index() - 444 + * sci_phy_get_index() - 445 445 * 446 446 * This macro returns the phy index for the specified phy 447 447 */ 448 - #define scic_sds_phy_get_index(phy) \ 448 + #define sci_phy_get_index(phy) \ 449 449 ((phy)->phy_index) 450 450 451 451 /** 452 - * scic_sds_phy_get_controller() - This macro returns the controller for this 452 + * sci_phy_get_controller() - This macro returns the controller for this 453 453 * phy 454 454 * 455 455 * 456 456 */ 457 - #define scic_sds_phy_get_controller(phy) \ 458 - (scic_sds_port_get_controller((phy)->owning_port)) 457 + #define sci_phy_get_controller(phy) \ 458 + (sci_port_get_controller((phy)->owning_port)) 459 459 460 - void scic_sds_phy_construct( 460 + void sci_phy_construct( 461 461 struct isci_phy *iphy, 462 462 struct isci_port *iport, 463 463 u8 phy_index); 464 464 465 465 struct isci_port *phy_get_non_dummy_port(struct isci_phy *iphy); 466 466 467 - void scic_sds_phy_set_port( 467 + void sci_phy_set_port( 468 468 struct isci_phy *iphy, 469 469 struct isci_port *iport); 470 470 471 - enum sci_status scic_sds_phy_initialize( 471 + enum sci_status sci_phy_initialize( 472 472 struct isci_phy *iphy, 473 473 struct scu_transport_layer_registers __iomem *transport_layer_registers, 474 474 struct scu_link_layer_registers __iomem *link_layer_registers); 475 475 476 - enum sci_status scic_sds_phy_start( 476 + enum sci_status sci_phy_start( 477 477 struct isci_phy *iphy); 478 478 479 - enum sci_status scic_sds_phy_stop( 479 + enum sci_status sci_phy_stop( 480 480 struct isci_phy *iphy); 481 481 482 - enum sci_status scic_sds_phy_reset( 482 + enum sci_status sci_phy_reset( 483 483 struct isci_phy *iphy); 484 484 485 - void scic_sds_phy_resume( 485 + void sci_phy_resume( 486 486 struct isci_phy *iphy); 487 487 488 - void scic_sds_phy_setup_transport( 488 + void sci_phy_setup_transport( 489 489 struct isci_phy *iphy, 490 490 u32 device_id); 491 491 492 - enum sci_status scic_sds_phy_event_handler( 492 + enum sci_status sci_phy_event_handler( 493 493 struct isci_phy *iphy, 494 494 u32 event_code); 495 495 496 - enum sci_status scic_sds_phy_frame_handler( 496 + enum sci_status sci_phy_frame_handler( 497 497 struct isci_phy *iphy, 498 498 u32 frame_index); 499 499 500 - enum sci_status scic_sds_phy_consume_power_handler( 500 + enum sci_status sci_phy_consume_power_handler( 501 501 struct isci_phy *iphy); 502 502 503 - void scic_sds_phy_get_sas_address( 503 + void sci_phy_get_sas_address( 504 504 struct isci_phy *iphy, 505 505 struct sci_sas_address *sas_address); 506 506 507 - void scic_sds_phy_get_attached_sas_address( 507 + void sci_phy_get_attached_sas_address( 508 508 struct isci_phy *iphy, 509 509 struct sci_sas_address *sas_address); 510 510 511 - struct scic_phy_proto; 512 - void scic_sds_phy_get_protocols( 511 + struct sci_phy_proto; 512 + void sci_phy_get_protocols( 513 513 struct isci_phy *iphy, 514 - struct scic_phy_proto *protocols); 514 + struct sci_phy_proto *protocols); 515 515 enum sas_linkrate sci_phy_linkrate(struct isci_phy *iphy); 516 516 517 517 struct isci_host;
+207 -344
drivers/scsi/isci/port.c
··· 74 74 spin_unlock_irqrestore(&iport->state_lock, flags); 75 75 } 76 76 77 - /* 78 - * This function will indicate which protocols are supported by this port. 79 - * @sci_port: a handle corresponding to the SAS port for which to return the 80 - * supported protocols. 81 - * @protocols: This parameter specifies a pointer to a data structure 82 - * which the core will copy the protocol values for the port from the 83 - * transmit_identification register. 84 - */ 85 - static void 86 - scic_sds_port_get_protocols(struct isci_port *iport, 87 - struct scic_phy_proto *protocols) 77 + static void sci_port_get_protocols(struct isci_port *iport, struct sci_phy_proto *proto) 88 78 { 89 79 u8 index; 90 80 91 - protocols->all = 0; 92 - 81 + proto->all = 0; 93 82 for (index = 0; index < SCI_MAX_PHYS; index++) { 94 - if (iport->phy_table[index] != NULL) { 95 - scic_sds_phy_get_protocols(iport->phy_table[index], 96 - protocols); 97 - } 83 + struct isci_phy *iphy = iport->phy_table[index]; 84 + 85 + if (!iphy) 86 + continue; 87 + sci_phy_get_protocols(iphy, proto); 98 88 } 99 89 } 100 90 101 - /** 102 - * This method requests a list (mask) of the phys contained in the supplied SAS 103 - * port. 104 - * @sci_port: a handle corresponding to the SAS port for which to return the 105 - * phy mask. 106 - * 107 - * Return a bit mask indicating which phys are a part of this port. Each bit 108 - * corresponds to a phy identifier (e.g. bit 0 = phy id 0). 109 - */ 110 - static u32 scic_sds_port_get_phys(struct isci_port *iport) 91 + static u32 sci_port_get_phys(struct isci_port *iport) 111 92 { 112 93 u32 index; 113 94 u32 mask; 114 95 115 96 mask = 0; 116 - 117 - for (index = 0; index < SCI_MAX_PHYS; index++) { 118 - if (iport->phy_table[index] != NULL) { 97 + for (index = 0; index < SCI_MAX_PHYS; index++) 98 + if (iport->phy_table[index]) 119 99 mask |= (1 << index); 120 - } 121 - } 122 100 123 101 return mask; 124 102 } 125 103 126 104 /** 127 - * scic_port_get_properties() - This method simply returns the properties 105 + * sci_port_get_properties() - This method simply returns the properties 128 106 * regarding the port, such as: physical index, protocols, sas address, etc. 129 107 * @port: this parameter specifies the port for which to retrieve the physical 130 108 * index. ··· 114 136 * value is returned if the specified port is not valid. When this value is 115 137 * returned, no data is copied to the properties output parameter. 116 138 */ 117 - static enum sci_status scic_port_get_properties(struct isci_port *iport, 118 - struct scic_port_properties *prop) 139 + static enum sci_status sci_port_get_properties(struct isci_port *iport, 140 + struct sci_port_properties *prop) 119 141 { 120 142 if (!iport || iport->logical_port_index == SCIC_SDS_DUMMY_PORT) 121 143 return SCI_FAILURE_INVALID_PORT; 122 144 123 - prop->index = iport->logical_port_index; 124 - prop->phy_mask = scic_sds_port_get_phys(iport); 125 - scic_sds_port_get_sas_address(iport, &prop->local.sas_address); 126 - scic_sds_port_get_protocols(iport, &prop->local.protocols); 127 - scic_sds_port_get_attached_sas_address(iport, &prop->remote.sas_address); 145 + prop->index = iport->logical_port_index; 146 + prop->phy_mask = sci_port_get_phys(iport); 147 + sci_port_get_sas_address(iport, &prop->local.sas_address); 148 + sci_port_get_protocols(iport, &prop->local.protocols); 149 + sci_port_get_attached_sas_address(iport, &prop->remote.sas_address); 128 150 129 151 return SCI_SUCCESS; 130 152 } 131 153 132 - static void scic_port_bcn_enable(struct isci_port *iport) 154 + static void sci_port_bcn_enable(struct isci_port *iport) 133 155 { 134 156 struct isci_phy *iphy; 135 157 u32 val; ··· 145 167 } 146 168 } 147 169 148 - /* called under scic_lock to stabilize phy:port associations */ 170 + /* called under sci_lock to stabilize phy:port associations */ 149 171 void isci_port_bcn_enable(struct isci_host *ihost, struct isci_port *iport) 150 172 { 151 173 int i; ··· 187 209 ihost->sas_ha.notify_port_event(&iphy->sas_phy, 188 210 PORTE_BROADCAST_RCVD); 189 211 } 190 - scic_port_bcn_enable(iport); 212 + sci_port_bcn_enable(iport); 191 213 } 192 214 193 215 static void isci_port_link_up(struct isci_host *isci_host, ··· 195 217 struct isci_phy *iphy) 196 218 { 197 219 unsigned long flags; 198 - struct scic_port_properties properties; 220 + struct sci_port_properties properties; 199 221 unsigned long success = true; 200 222 201 223 BUG_ON(iphy->isci_port != NULL); ··· 210 232 211 233 isci_port_change_state(iphy->isci_port, isci_starting); 212 234 213 - scic_port_get_properties(iport, &properties); 235 + sci_port_get_properties(iport, &properties); 214 236 215 237 if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SATA) { 216 238 u64 attached_sas_address; ··· 223 245 * automagically assign a SAS address to the end device 224 246 * for the purpose of creating a port. This SAS address 225 247 * will not be the same as assigned to the PHY and needs 226 - * to be obtained from struct scic_port_properties properties. 248 + * to be obtained from struct sci_port_properties properties. 227 249 */ 228 250 attached_sas_address = properties.remote.sas_address.high; 229 251 attached_sas_address <<= 32; ··· 377 399 * doesn't preclude all configurations. It merely ensures that a phy is part 378 400 * of the allowable set of phy identifiers for that port. For example, one 379 401 * could assign phy 3 to port 0 and no other phys. Please refer to 380 - * scic_sds_port_is_phy_mask_valid() for information regarding whether the 402 + * sci_port_is_phy_mask_valid() for information regarding whether the 381 403 * phy_mask for a port can be supported. bool true if this is a valid phy 382 404 * assignment for the port false if this is not a valid phy assignment for the 383 405 * port 384 406 */ 385 - bool scic_sds_port_is_valid_phy_assignment(struct isci_port *iport, 386 - u32 phy_index) 407 + bool sci_port_is_valid_phy_assignment(struct isci_port *iport, u32 phy_index) 387 408 { 409 + struct isci_host *ihost = iport->owning_controller; 410 + struct sci_user_parameters *user = &ihost->user_parameters; 411 + 388 412 /* Initialize to invalid value. */ 389 413 u32 existing_phy_index = SCI_MAX_PHYS; 390 414 u32 index; 391 415 392 - if ((iport->physical_port_index == 1) && (phy_index != 1)) { 416 + if ((iport->physical_port_index == 1) && (phy_index != 1)) 393 417 return false; 394 - } 395 418 396 - if (iport->physical_port_index == 3 && phy_index != 3) { 419 + if (iport->physical_port_index == 3 && phy_index != 3) 397 420 return false; 398 - } 399 421 400 - if ( 401 - (iport->physical_port_index == 2) 402 - && ((phy_index == 0) || (phy_index == 1)) 403 - ) { 422 + if (iport->physical_port_index == 2 && 423 + (phy_index == 0 || phy_index == 1)) 404 424 return false; 405 - } 406 425 407 - for (index = 0; index < SCI_MAX_PHYS; index++) { 408 - if ((iport->phy_table[index] != NULL) 409 - && (index != phy_index)) { 426 + for (index = 0; index < SCI_MAX_PHYS; index++) 427 + if (iport->phy_table[index] && index != phy_index) 410 428 existing_phy_index = index; 411 - } 412 - } 413 429 414 - /* 415 - * Ensure that all of the phys in the port are capable of 416 - * operating at the same maximum link rate. */ 417 - if ( 418 - (existing_phy_index < SCI_MAX_PHYS) 419 - && (iport->owning_controller->user_parameters.sds1.phys[ 420 - phy_index].max_speed_generation != 421 - iport->owning_controller->user_parameters.sds1.phys[ 422 - existing_phy_index].max_speed_generation) 423 - ) 430 + /* Ensure that all of the phys in the port are capable of 431 + * operating at the same maximum link rate. 432 + */ 433 + if (existing_phy_index < SCI_MAX_PHYS && 434 + user->phys[phy_index].max_speed_generation != 435 + user->phys[existing_phy_index].max_speed_generation) 424 436 return false; 425 437 426 438 return true; ··· 428 460 * phy mask can be supported. true if this is a valid phy assignment for the 429 461 * port false if this is not a valid phy assignment for the port 430 462 */ 431 - static bool scic_sds_port_is_phy_mask_valid( 463 + static bool sci_port_is_phy_mask_valid( 432 464 struct isci_port *iport, 433 465 u32 phy_mask) 434 466 { ··· 461 493 * the port. Currently, the lowest order phy that is connected is returned. 462 494 * This method returns a pointer to a SCIS_SDS_PHY object. NULL This value is 463 495 * returned if there are no currently active (i.e. connected to a remote end 464 - * point) phys contained in the port. All other values specify a struct scic_sds_phy 496 + * point) phys contained in the port. All other values specify a struct sci_phy 465 497 * object that is active in the port. 466 498 */ 467 - static struct isci_phy *scic_sds_port_get_a_connected_phy(struct isci_port *iport) 499 + static struct isci_phy *sci_port_get_a_connected_phy(struct isci_port *iport) 468 500 { 469 501 u32 index; 470 502 struct isci_phy *iphy; ··· 474 506 * connected to the remote end-point. 475 507 */ 476 508 iphy = iport->phy_table[index]; 477 - if (iphy && scic_sds_port_active_phy(iport, iphy)) 509 + if (iphy && sci_port_active_phy(iport, iphy)) 478 510 return iphy; 479 511 } 480 512 481 513 return NULL; 482 514 } 483 515 484 - static enum sci_status scic_sds_port_set_phy(struct isci_port *iport, struct isci_phy *iphy) 516 + static enum sci_status sci_port_set_phy(struct isci_port *iport, struct isci_phy *iphy) 485 517 { 486 518 /* Check to see if we can add this phy to a port 487 519 * that means that the phy is not part of a port and that the port does ··· 489 521 */ 490 522 if (!iport->phy_table[iphy->phy_index] && 491 523 !phy_get_non_dummy_port(iphy) && 492 - scic_sds_port_is_valid_phy_assignment(iport, iphy->phy_index)) { 524 + sci_port_is_valid_phy_assignment(iport, iphy->phy_index)) { 493 525 /* Phy is being added in the stopped state so we are in MPC mode 494 526 * make logical port index = physical port index 495 527 */ 496 528 iport->logical_port_index = iport->physical_port_index; 497 529 iport->phy_table[iphy->phy_index] = iphy; 498 - scic_sds_phy_set_port(iphy, iport); 530 + sci_phy_set_port(iphy, iport); 499 531 500 532 return SCI_SUCCESS; 501 533 } ··· 503 535 return SCI_FAILURE; 504 536 } 505 537 506 - static enum sci_status scic_sds_port_clear_phy(struct isci_port *iport, 507 - struct isci_phy *iphy) 538 + static enum sci_status sci_port_clear_phy(struct isci_port *iport, struct isci_phy *iphy) 508 539 { 509 540 /* Make sure that this phy is part of this port */ 510 541 if (iport->phy_table[iphy->phy_index] == iphy && ··· 511 544 struct isci_host *ihost = iport->owning_controller; 512 545 513 546 /* Yep it is assigned to this port so remove it */ 514 - scic_sds_phy_set_port(iphy, &ihost->ports[SCI_MAX_PORTS]); 547 + sci_phy_set_port(iphy, &ihost->ports[SCI_MAX_PORTS]); 515 548 iport->phy_table[iphy->phy_index] = NULL; 516 549 return SCI_SUCCESS; 517 550 } ··· 519 552 return SCI_FAILURE; 520 553 } 521 554 522 - 523 - /** 524 - * This method requests the SAS address for the supplied SAS port from the SCI 525 - * implementation. 526 - * @sci_port: a handle corresponding to the SAS port for which to return the 527 - * SAS address. 528 - * @sas_address: This parameter specifies a pointer to a SAS address structure 529 - * into which the core will copy the SAS address for the port. 530 - * 531 - */ 532 - void scic_sds_port_get_sas_address( 533 - struct isci_port *iport, 534 - struct sci_sas_address *sas_address) 555 + void sci_port_get_sas_address(struct isci_port *iport, struct sci_sas_address *sas) 535 556 { 536 557 u32 index; 537 558 538 - sas_address->high = 0; 539 - sas_address->low = 0; 540 - 541 - for (index = 0; index < SCI_MAX_PHYS; index++) { 542 - if (iport->phy_table[index] != NULL) { 543 - scic_sds_phy_get_sas_address(iport->phy_table[index], sas_address); 544 - } 545 - } 559 + sas->high = 0; 560 + sas->low = 0; 561 + for (index = 0; index < SCI_MAX_PHYS; index++) 562 + if (iport->phy_table[index]) 563 + sci_phy_get_sas_address(iport->phy_table[index], sas); 546 564 } 547 565 548 - /* 549 - * This function requests the SAS address for the device directly attached to 550 - * this SAS port. 551 - * @sci_port: a handle corresponding to the SAS port for which to return the 552 - * SAS address. 553 - * @sas_address: This parameter specifies a pointer to a SAS address structure 554 - * into which the core will copy the SAS address for the device directly 555 - * attached to the port. 556 - * 557 - */ 558 - void scic_sds_port_get_attached_sas_address( 559 - struct isci_port *iport, 560 - struct sci_sas_address *sas_address) 566 + void sci_port_get_attached_sas_address(struct isci_port *iport, struct sci_sas_address *sas) 561 567 { 562 568 struct isci_phy *iphy; 563 569 ··· 538 598 * Ensure that the phy is both part of the port and currently 539 599 * connected to the remote end-point. 540 600 */ 541 - iphy = scic_sds_port_get_a_connected_phy(iport); 601 + iphy = sci_port_get_a_connected_phy(iport); 542 602 if (iphy) { 543 603 if (iphy->protocol != SCIC_SDS_PHY_PROTOCOL_SATA) { 544 - scic_sds_phy_get_attached_sas_address(iphy, 545 - sas_address); 604 + sci_phy_get_attached_sas_address(iphy, sas); 546 605 } else { 547 - scic_sds_phy_get_sas_address(iphy, sas_address); 548 - sas_address->low += iphy->phy_index; 606 + sci_phy_get_sas_address(iphy, sas); 607 + sas->low += iphy->phy_index; 549 608 } 550 609 } else { 551 - sas_address->high = 0; 552 - sas_address->low = 0; 610 + sas->high = 0; 611 + sas->low = 0; 553 612 } 554 613 } 555 614 556 615 /** 557 - * scic_sds_port_construct_dummy_rnc() - create dummy rnc for si workaround 616 + * sci_port_construct_dummy_rnc() - create dummy rnc for si workaround 558 617 * 559 618 * @sci_port: logical port on which we need to create the remote node context 560 619 * @rni: remote node index for this remote node context. ··· 562 623 * This structure will be posted to the hardware to work around a scheduler 563 624 * error in the hardware. 564 625 */ 565 - static void scic_sds_port_construct_dummy_rnc(struct isci_port *iport, u16 rni) 626 + static void sci_port_construct_dummy_rnc(struct isci_port *iport, u16 rni) 566 627 { 567 628 union scu_remote_node_context *rnc; 568 629 ··· 590 651 * structure will be posted to the hardwre to work around a scheduler error 591 652 * in the hardware. 592 653 */ 593 - static void scic_sds_port_construct_dummy_task(struct isci_port *iport, u16 tag) 654 + static void sci_port_construct_dummy_task(struct isci_port *iport, u16 tag) 594 655 { 595 656 struct isci_host *ihost = iport->owning_controller; 596 657 struct scu_task_context *task_context; ··· 610 671 task_context->task_phase = 0x01; 611 672 } 612 673 613 - static void scic_sds_port_destroy_dummy_resources(struct isci_port *iport) 674 + static void sci_port_destroy_dummy_resources(struct isci_port *iport) 614 675 { 615 676 struct isci_host *ihost = iport->owning_controller; 616 677 ··· 618 679 isci_free_tag(ihost, iport->reserved_tag); 619 680 620 681 if (iport->reserved_rni != SCU_DUMMY_INDEX) 621 - scic_sds_remote_node_table_release_remote_node_index(&ihost->available_remote_nodes, 682 + sci_remote_node_table_release_remote_node_index(&ihost->available_remote_nodes, 622 683 1, iport->reserved_rni); 623 684 624 685 iport->reserved_rni = SCU_DUMMY_INDEX; 625 686 iport->reserved_tag = SCI_CONTROLLER_INVALID_IO_TAG; 626 687 } 627 688 628 - /** 629 - * This method performs initialization of the supplied port. Initialization 630 - * includes: - state machine initialization - member variable initialization 631 - * - configuring the phy_mask 632 - * @sci_port: 633 - * @transport_layer_registers: 634 - * @port_task_scheduler_registers: 635 - * @port_configuration_regsiter: 636 - * 637 - * enum sci_status SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION This value is returned 638 - * if the phy being added to the port 639 - */ 640 - enum sci_status scic_sds_port_initialize( 641 - struct isci_port *iport, 642 - void __iomem *port_task_scheduler_registers, 643 - void __iomem *port_configuration_regsiter, 644 - void __iomem *viit_registers) 645 - { 646 - iport->port_task_scheduler_registers = port_task_scheduler_registers; 647 - iport->port_pe_configuration_register = port_configuration_regsiter; 648 - iport->viit_registers = viit_registers; 649 - 650 - return SCI_SUCCESS; 651 - } 652 - 653 - 654 - /** 655 - * This method assigns the direct attached device ID for this port. 656 - * 657 - * @param[in] iport The port for which the direct attached device id is to 658 - * be assigned. 659 - * @param[in] device_id The direct attached device ID to assign to the port. 660 - * This will be the RNi for the device 661 - */ 662 - void scic_sds_port_setup_transports( 663 - struct isci_port *iport, 664 - u32 device_id) 689 + void sci_port_setup_transports(struct isci_port *iport, u32 device_id) 665 690 { 666 691 u8 index; 667 692 668 693 for (index = 0; index < SCI_MAX_PHYS; index++) { 669 694 if (iport->active_phy_mask & (1 << index)) 670 - scic_sds_phy_setup_transport(iport->phy_table[index], device_id); 695 + sci_phy_setup_transport(iport->phy_table[index], device_id); 671 696 } 672 697 } 673 698 674 - /** 675 - * 676 - * @sci_port: This is the port on which the phy should be enabled. 677 - * @sci_phy: This is the specific phy which to enable. 678 - * @do_notify_user: This parameter specifies whether to inform the user (via 679 - * scic_cb_port_link_up()) as to the fact that a new phy as become ready. 680 - * 681 - * This function will activate the phy in the port. 682 - * Activation includes: - adding 683 - * the phy to the port - enabling the Protocol Engine in the silicon. - 684 - * notifying the user that the link is up. none 685 - */ 686 - static void scic_sds_port_activate_phy(struct isci_port *iport, 687 - struct isci_phy *iphy, 688 - bool do_notify_user) 699 + static void sci_port_activate_phy(struct isci_port *iport, struct isci_phy *iphy, 700 + bool do_notify_user) 689 701 { 690 702 struct isci_host *ihost = iport->owning_controller; 691 703 692 704 if (iphy->protocol != SCIC_SDS_PHY_PROTOCOL_SATA) 693 - scic_sds_phy_resume(iphy); 705 + sci_phy_resume(iphy); 694 706 695 707 iport->active_phy_mask |= 1 << iphy->phy_index; 696 708 697 - scic_sds_controller_clear_invalid_phy(ihost, iphy); 709 + sci_controller_clear_invalid_phy(ihost, iphy); 698 710 699 711 if (do_notify_user == true) 700 712 isci_port_link_up(ihost, iport, iphy); 701 713 } 702 714 703 - void scic_sds_port_deactivate_phy(struct isci_port *iport, 704 - struct isci_phy *iphy, 705 - bool do_notify_user) 715 + void sci_port_deactivate_phy(struct isci_port *iport, struct isci_phy *iphy, 716 + bool do_notify_user) 706 717 { 707 - struct isci_host *ihost = scic_sds_port_get_controller(iport); 718 + struct isci_host *ihost = sci_port_get_controller(iport); 708 719 709 720 iport->active_phy_mask &= ~(1 << iphy->phy_index); 710 721 ··· 668 779 isci_port_link_down(ihost, iphy, iport); 669 780 } 670 781 671 - /** 672 - * 673 - * @sci_port: This is the port on which the phy should be disabled. 674 - * @sci_phy: This is the specific phy which to disabled. 675 - * 676 - * This function will disable the phy and report that the phy is not valid for 677 - * this port object. None 678 - */ 679 - static void scic_sds_port_invalid_link_up(struct isci_port *iport, 680 - struct isci_phy *iphy) 782 + static void sci_port_invalid_link_up(struct isci_port *iport, struct isci_phy *iphy) 681 783 { 682 784 struct isci_host *ihost = iport->owning_controller; 683 785 ··· 678 798 * invalid link. 679 799 */ 680 800 if ((ihost->invalid_phy_mask & (1 << iphy->phy_index)) == 0) { 681 - scic_sds_controller_set_invalid_phy(ihost, iphy); 801 + sci_controller_set_invalid_phy(ihost, iphy); 682 802 dev_warn(&ihost->pdev->dev, "Invalid link up!\n"); 683 803 } 684 804 } 685 805 686 - static bool is_port_ready_state(enum scic_sds_port_states state) 806 + static bool is_port_ready_state(enum sci_port_states state) 687 807 { 688 808 switch (state) { 689 809 case SCI_PORT_READY: ··· 698 818 699 819 /* flag dummy rnc hanling when exiting a ready state */ 700 820 static void port_state_machine_change(struct isci_port *iport, 701 - enum scic_sds_port_states state) 821 + enum sci_port_states state) 702 822 { 703 823 struct sci_base_state_machine *sm = &iport->sm; 704 - enum scic_sds_port_states old_state = sm->current_state_id; 824 + enum sci_port_states old_state = sm->current_state_id; 705 825 706 826 if (is_port_ready_state(old_state) && !is_port_ready_state(state)) 707 827 iport->ready_exit = true; ··· 711 831 } 712 832 713 833 /** 714 - * scic_sds_port_general_link_up_handler - phy can be assigned to port? 715 - * @sci_port: scic_sds_port object for which has a phy that has gone link up. 834 + * sci_port_general_link_up_handler - phy can be assigned to port? 835 + * @sci_port: sci_port object for which has a phy that has gone link up. 716 836 * @sci_phy: This is the struct isci_phy object that has gone link up. 717 837 * @do_notify_user: This parameter specifies whether to inform the user (via 718 - * scic_cb_port_link_up()) as to the fact that a new phy as become ready. 838 + * sci_port_link_up()) as to the fact that a new phy as become ready. 719 839 * 720 840 * Determine if this phy can be assigned to this 721 841 * port . If the phy is not a valid PHY for ··· 723 843 * part of a port if it's attached SAS ADDRESS is the same as all other PHYs in 724 844 * the same port. none 725 845 */ 726 - static void scic_sds_port_general_link_up_handler(struct isci_port *iport, 846 + static void sci_port_general_link_up_handler(struct isci_port *iport, 727 847 struct isci_phy *iphy, 728 848 bool do_notify_user) 729 849 { 730 850 struct sci_sas_address port_sas_address; 731 851 struct sci_sas_address phy_sas_address; 732 852 733 - scic_sds_port_get_attached_sas_address(iport, &port_sas_address); 734 - scic_sds_phy_get_attached_sas_address(iphy, &phy_sas_address); 853 + sci_port_get_attached_sas_address(iport, &port_sas_address); 854 + sci_phy_get_attached_sas_address(iphy, &phy_sas_address); 735 855 736 856 /* If the SAS address of the new phy matches the SAS address of 737 857 * other phys in the port OR this is the first phy in the port, ··· 743 863 iport->active_phy_mask == 0) { 744 864 struct sci_base_state_machine *sm = &iport->sm; 745 865 746 - scic_sds_port_activate_phy(iport, iphy, do_notify_user); 866 + sci_port_activate_phy(iport, iphy, do_notify_user); 747 867 if (sm->current_state_id == SCI_PORT_RESETTING) 748 868 port_state_machine_change(iport, SCI_PORT_READY); 749 869 } else 750 - scic_sds_port_invalid_link_up(iport, iphy); 870 + sci_port_invalid_link_up(iport, iphy); 751 871 } 752 872 753 873 ··· 761 881 * bool true Is returned if this is a wide ported port. false Is returned if 762 882 * this is a narrow port. 763 883 */ 764 - static bool scic_sds_port_is_wide(struct isci_port *iport) 884 + static bool sci_port_is_wide(struct isci_port *iport) 765 885 { 766 886 u32 index; 767 887 u32 phy_count = 0; ··· 789 909 * wide ports and direct attached phys. Since there are no wide ported SATA 790 910 * devices this could become an invalid port configuration. 791 911 */ 792 - bool scic_sds_port_link_detected( 912 + bool sci_port_link_detected( 793 913 struct isci_port *iport, 794 914 struct isci_phy *iphy) 795 915 { 796 916 if ((iport->logical_port_index != SCIC_SDS_DUMMY_PORT) && 797 917 (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SATA) && 798 - scic_sds_port_is_wide(iport)) { 799 - scic_sds_port_invalid_link_up(iport, iphy); 918 + sci_port_is_wide(iport)) { 919 + sci_port_invalid_link_up(iport, iphy); 800 920 801 921 return false; 802 922 } ··· 857 977 * 858 978 * 859 979 */ 860 - static void scic_sds_port_update_viit_entry(struct isci_port *iport) 980 + static void sci_port_update_viit_entry(struct isci_port *iport) 861 981 { 862 982 struct sci_sas_address sas_address; 863 983 864 - scic_sds_port_get_sas_address(iport, &sas_address); 984 + sci_port_get_sas_address(iport, &sas_address); 865 985 866 986 writel(sas_address.high, 867 987 &iport->viit_registers->initiator_sas_address_hi); ··· 879 999 &iport->viit_registers->status); 880 1000 } 881 1001 882 - enum sas_linkrate scic_sds_port_get_max_allowed_speed(struct isci_port *iport) 1002 + enum sas_linkrate sci_port_get_max_allowed_speed(struct isci_port *iport) 883 1003 { 884 1004 u16 index; 885 1005 struct isci_phy *iphy; ··· 890 1010 * lowest maximum link rate. */ 891 1011 for (index = 0; index < SCI_MAX_PHYS; index++) { 892 1012 iphy = iport->phy_table[index]; 893 - if (iphy && scic_sds_port_active_phy(iport, iphy) && 1013 + if (iphy && sci_port_active_phy(iport, iphy) && 894 1014 iphy->max_negotiated_speed < max_allowed_speed) 895 1015 max_allowed_speed = iphy->max_negotiated_speed; 896 1016 } ··· 898 1018 return max_allowed_speed; 899 1019 } 900 1020 901 - static void scic_sds_port_suspend_port_task_scheduler(struct isci_port *iport) 1021 + static void sci_port_suspend_port_task_scheduler(struct isci_port *iport) 902 1022 { 903 1023 u32 pts_control_value; 904 1024 ··· 908 1028 } 909 1029 910 1030 /** 911 - * scic_sds_port_post_dummy_request() - post dummy/workaround request 1031 + * sci_port_post_dummy_request() - post dummy/workaround request 912 1032 * @sci_port: port to post task 913 1033 * 914 1034 * Prevent the hardware scheduler from posting new requests to the front ··· 916 1036 * ongoing requests. 917 1037 * 918 1038 */ 919 - static void scic_sds_port_post_dummy_request(struct isci_port *iport) 1039 + static void sci_port_post_dummy_request(struct isci_port *iport) 920 1040 { 921 1041 struct isci_host *ihost = iport->owning_controller; 922 1042 u16 tag = iport->reserved_tag; ··· 930 1050 iport->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT | 931 1051 ISCI_TAG_TCI(tag); 932 1052 933 - scic_sds_controller_post_request(ihost, command); 1053 + sci_controller_post_request(ihost, command); 934 1054 } 935 1055 936 1056 /** ··· 940 1060 * @sci_port: The port on which the task must be aborted. 941 1061 * 942 1062 */ 943 - static void scic_sds_port_abort_dummy_request(struct isci_port *iport) 1063 + static void sci_port_abort_dummy_request(struct isci_port *iport) 944 1064 { 945 1065 struct isci_host *ihost = iport->owning_controller; 946 1066 u16 tag = iport->reserved_tag; ··· 954 1074 iport->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT | 955 1075 ISCI_TAG_TCI(tag); 956 1076 957 - scic_sds_controller_post_request(ihost, command); 1077 + sci_controller_post_request(ihost, command); 958 1078 } 959 1079 960 1080 /** ··· 964 1084 * This method will resume the port task scheduler for this port object. none 965 1085 */ 966 1086 static void 967 - scic_sds_port_resume_port_task_scheduler(struct isci_port *iport) 1087 + sci_port_resume_port_task_scheduler(struct isci_port *iport) 968 1088 { 969 1089 u32 pts_control_value; 970 1090 ··· 973 1093 writel(pts_control_value, &iport->port_task_scheduler_registers->control); 974 1094 } 975 1095 976 - static void scic_sds_port_ready_substate_waiting_enter(struct sci_base_state_machine *sm) 1096 + static void sci_port_ready_substate_waiting_enter(struct sci_base_state_machine *sm) 977 1097 { 978 1098 struct isci_port *iport = container_of(sm, typeof(*iport), sm); 979 1099 980 - scic_sds_port_suspend_port_task_scheduler(iport); 1100 + sci_port_suspend_port_task_scheduler(iport); 981 1101 982 1102 iport->not_ready_reason = SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS; 983 1103 ··· 988 1108 } 989 1109 } 990 1110 991 - static void scic_sds_port_ready_substate_operational_enter(struct sci_base_state_machine *sm) 1111 + static void sci_port_ready_substate_operational_enter(struct sci_base_state_machine *sm) 992 1112 { 993 1113 u32 index; 994 1114 struct isci_port *iport = container_of(sm, typeof(*iport), sm); ··· 1004 1124 } 1005 1125 } 1006 1126 1007 - scic_sds_port_update_viit_entry(iport); 1127 + sci_port_update_viit_entry(iport); 1008 1128 1009 - scic_sds_port_resume_port_task_scheduler(iport); 1129 + sci_port_resume_port_task_scheduler(iport); 1010 1130 1011 1131 /* 1012 1132 * Post the dummy task for the port so the hardware can schedule 1013 1133 * io correctly 1014 1134 */ 1015 - scic_sds_port_post_dummy_request(iport); 1135 + sci_port_post_dummy_request(iport); 1016 1136 } 1017 1137 1018 - static void scic_sds_port_invalidate_dummy_remote_node(struct isci_port *iport) 1138 + static void sci_port_invalidate_dummy_remote_node(struct isci_port *iport) 1019 1139 { 1020 1140 struct isci_host *ihost = iport->owning_controller; 1021 1141 u8 phys_index = iport->physical_port_index; ··· 1037 1157 command = SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE | 1038 1158 phys_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT | rni; 1039 1159 1040 - scic_sds_controller_post_request(ihost, command); 1160 + sci_controller_post_request(ihost, command); 1041 1161 } 1042 1162 1043 1163 /** ··· 1048 1168 * exiting the SCI_PORT_SUB_OPERATIONAL. This function reports 1049 1169 * the port not ready and suspends the port task scheduler. none 1050 1170 */ 1051 - static void scic_sds_port_ready_substate_operational_exit(struct sci_base_state_machine *sm) 1171 + static void sci_port_ready_substate_operational_exit(struct sci_base_state_machine *sm) 1052 1172 { 1053 1173 struct isci_port *iport = container_of(sm, typeof(*iport), sm); 1054 1174 struct isci_host *ihost = iport->owning_controller; ··· 1058 1178 * the hardware will treat this as a NOP and just return abort 1059 1179 * complete. 1060 1180 */ 1061 - scic_sds_port_abort_dummy_request(iport); 1181 + sci_port_abort_dummy_request(iport); 1062 1182 1063 1183 isci_port_not_ready(ihost, iport); 1064 1184 1065 1185 if (iport->ready_exit) 1066 - scic_sds_port_invalidate_dummy_remote_node(iport); 1186 + sci_port_invalidate_dummy_remote_node(iport); 1067 1187 } 1068 1188 1069 - static void scic_sds_port_ready_substate_configuring_enter(struct sci_base_state_machine *sm) 1189 + static void sci_port_ready_substate_configuring_enter(struct sci_base_state_machine *sm) 1070 1190 { 1071 1191 struct isci_port *iport = container_of(sm, typeof(*iport), sm); 1072 1192 struct isci_host *ihost = iport->owning_controller; ··· 1081 1201 SCI_PORT_SUB_OPERATIONAL); 1082 1202 } 1083 1203 1084 - static void scic_sds_port_ready_substate_configuring_exit(struct sci_base_state_machine *sm) 1204 + static void sci_port_ready_substate_configuring_exit(struct sci_base_state_machine *sm) 1085 1205 { 1086 1206 struct isci_port *iport = container_of(sm, typeof(*iport), sm); 1087 1207 1088 - scic_sds_port_suspend_port_task_scheduler(iport); 1208 + sci_port_suspend_port_task_scheduler(iport); 1089 1209 if (iport->ready_exit) 1090 - scic_sds_port_invalidate_dummy_remote_node(iport); 1210 + sci_port_invalidate_dummy_remote_node(iport); 1091 1211 } 1092 1212 1093 - enum sci_status scic_sds_port_start(struct isci_port *iport) 1213 + enum sci_status sci_port_start(struct isci_port *iport) 1094 1214 { 1095 1215 struct isci_host *ihost = iport->owning_controller; 1096 1216 enum sci_status status = SCI_SUCCESS; 1097 - enum scic_sds_port_states state; 1217 + enum sci_port_states state; 1098 1218 u32 phy_mask; 1099 1219 1100 1220 state = iport->sm.current_state_id; ··· 1114 1234 } 1115 1235 1116 1236 if (iport->reserved_rni == SCU_DUMMY_INDEX) { 1117 - u16 rni = scic_sds_remote_node_table_allocate_remote_node( 1237 + u16 rni = sci_remote_node_table_allocate_remote_node( 1118 1238 &ihost->available_remote_nodes, 1); 1119 1239 1120 1240 if (rni != SCU_DUMMY_INDEX) 1121 - scic_sds_port_construct_dummy_rnc(iport, rni); 1241 + sci_port_construct_dummy_rnc(iport, rni); 1122 1242 else 1123 1243 status = SCI_FAILURE_INSUFFICIENT_RESOURCES; 1124 1244 iport->reserved_rni = rni; ··· 1131 1251 if (tag == SCI_CONTROLLER_INVALID_IO_TAG) 1132 1252 status = SCI_FAILURE_INSUFFICIENT_RESOURCES; 1133 1253 else 1134 - scic_sds_port_construct_dummy_task(iport, tag); 1254 + sci_port_construct_dummy_task(iport, tag); 1135 1255 iport->reserved_tag = tag; 1136 1256 } 1137 1257 1138 1258 if (status == SCI_SUCCESS) { 1139 - phy_mask = scic_sds_port_get_phys(iport); 1259 + phy_mask = sci_port_get_phys(iport); 1140 1260 1141 1261 /* 1142 1262 * There are one or more phys assigned to this port. Make sure 1143 1263 * the port's phy mask is in fact legal and supported by the 1144 1264 * silicon. 1145 1265 */ 1146 - if (scic_sds_port_is_phy_mask_valid(iport, phy_mask) == true) { 1266 + if (sci_port_is_phy_mask_valid(iport, phy_mask) == true) { 1147 1267 port_state_machine_change(iport, 1148 1268 SCI_PORT_READY); 1149 1269 ··· 1153 1273 } 1154 1274 1155 1275 if (status != SCI_SUCCESS) 1156 - scic_sds_port_destroy_dummy_resources(iport); 1276 + sci_port_destroy_dummy_resources(iport); 1157 1277 1158 1278 return status; 1159 1279 } 1160 1280 1161 - enum sci_status scic_sds_port_stop(struct isci_port *iport) 1281 + enum sci_status sci_port_stop(struct isci_port *iport) 1162 1282 { 1163 - enum scic_sds_port_states state; 1283 + enum sci_port_states state; 1164 1284 1165 1285 state = iport->sm.current_state_id; 1166 1286 switch (state) { ··· 1180 1300 } 1181 1301 } 1182 1302 1183 - static enum sci_status scic_port_hard_reset(struct isci_port *iport, u32 timeout) 1303 + static enum sci_status sci_port_hard_reset(struct isci_port *iport, u32 timeout) 1184 1304 { 1185 1305 enum sci_status status = SCI_FAILURE_INVALID_PHY; 1186 1306 struct isci_phy *iphy = NULL; 1187 - enum scic_sds_port_states state; 1307 + enum sci_port_states state; 1188 1308 u32 phy_index; 1189 1309 1190 1310 state = iport->sm.current_state_id; ··· 1197 1317 /* Select a phy on which we can send the hard reset request. */ 1198 1318 for (phy_index = 0; phy_index < SCI_MAX_PHYS && !iphy; phy_index++) { 1199 1319 iphy = iport->phy_table[phy_index]; 1200 - if (iphy && !scic_sds_port_active_phy(iport, iphy)) { 1320 + if (iphy && !sci_port_active_phy(iport, iphy)) { 1201 1321 /* 1202 1322 * We found a phy but it is not ready select 1203 1323 * different phy ··· 1209 1329 /* If we have a phy then go ahead and start the reset procedure */ 1210 1330 if (!iphy) 1211 1331 return status; 1212 - status = scic_sds_phy_reset(iphy); 1332 + status = sci_phy_reset(iphy); 1213 1333 1214 1334 if (status != SCI_SUCCESS) 1215 1335 return status; ··· 1222 1342 } 1223 1343 1224 1344 /** 1225 - * scic_sds_port_add_phy() - 1345 + * sci_port_add_phy() - 1226 1346 * @sci_port: This parameter specifies the port in which the phy will be added. 1227 1347 * @sci_phy: This parameter is the phy which is to be added to the port. 1228 1348 * ··· 1230 1350 * enum sci_status. SCI_SUCCESS the phy has been added to the port. Any other 1231 1351 * status is a failure to add the phy to the port. 1232 1352 */ 1233 - enum sci_status scic_sds_port_add_phy(struct isci_port *iport, 1353 + enum sci_status sci_port_add_phy(struct isci_port *iport, 1234 1354 struct isci_phy *iphy) 1235 1355 { 1236 1356 enum sci_status status; 1237 - enum scic_sds_port_states state; 1357 + enum sci_port_states state; 1238 1358 1239 1359 state = iport->sm.current_state_id; 1240 1360 switch (state) { ··· 1242 1362 struct sci_sas_address port_sas_address; 1243 1363 1244 1364 /* Read the port assigned SAS Address if there is one */ 1245 - scic_sds_port_get_sas_address(iport, &port_sas_address); 1365 + sci_port_get_sas_address(iport, &port_sas_address); 1246 1366 1247 1367 if (port_sas_address.high != 0 && port_sas_address.low != 0) { 1248 1368 struct sci_sas_address phy_sas_address; ··· 1250 1370 /* Make sure that the PHY SAS Address matches the SAS Address 1251 1371 * for this port 1252 1372 */ 1253 - scic_sds_phy_get_sas_address(iphy, &phy_sas_address); 1373 + sci_phy_get_sas_address(iphy, &phy_sas_address); 1254 1374 1255 1375 if (port_sas_address.high != phy_sas_address.high || 1256 1376 port_sas_address.low != phy_sas_address.low) 1257 1377 return SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION; 1258 1378 } 1259 - return scic_sds_port_set_phy(iport, iphy); 1379 + return sci_port_set_phy(iport, iphy); 1260 1380 } 1261 1381 case SCI_PORT_SUB_WAITING: 1262 1382 case SCI_PORT_SUB_OPERATIONAL: 1263 - status = scic_sds_port_set_phy(iport, iphy); 1383 + status = sci_port_set_phy(iport, iphy); 1264 1384 1265 1385 if (status != SCI_SUCCESS) 1266 1386 return status; 1267 1387 1268 - scic_sds_port_general_link_up_handler(iport, iphy, true); 1388 + sci_port_general_link_up_handler(iport, iphy, true); 1269 1389 iport->not_ready_reason = SCIC_PORT_NOT_READY_RECONFIGURING; 1270 1390 port_state_machine_change(iport, SCI_PORT_SUB_CONFIGURING); 1271 1391 1272 1392 return status; 1273 1393 case SCI_PORT_SUB_CONFIGURING: 1274 - status = scic_sds_port_set_phy(iport, iphy); 1394 + status = sci_port_set_phy(iport, iphy); 1275 1395 1276 1396 if (status != SCI_SUCCESS) 1277 1397 return status; 1278 - scic_sds_port_general_link_up_handler(iport, iphy, true); 1398 + sci_port_general_link_up_handler(iport, iphy, true); 1279 1399 1280 1400 /* Re-enter the configuring state since this may be the last phy in 1281 1401 * the port. ··· 1291 1411 } 1292 1412 1293 1413 /** 1294 - * scic_sds_port_remove_phy() - 1414 + * sci_port_remove_phy() - 1295 1415 * @sci_port: This parameter specifies the port in which the phy will be added. 1296 1416 * @sci_phy: This parameter is the phy which is to be added to the port. 1297 1417 * ··· 1299 1419 * an enum sci_status. SCI_SUCCESS the phy has been removed from the port. Any 1300 1420 * other status is a failure to add the phy to the port. 1301 1421 */ 1302 - enum sci_status scic_sds_port_remove_phy(struct isci_port *iport, 1422 + enum sci_status sci_port_remove_phy(struct isci_port *iport, 1303 1423 struct isci_phy *iphy) 1304 1424 { 1305 1425 enum sci_status status; 1306 - enum scic_sds_port_states state; 1426 + enum sci_port_states state; 1307 1427 1308 1428 state = iport->sm.current_state_id; 1309 1429 1310 1430 switch (state) { 1311 1431 case SCI_PORT_STOPPED: 1312 - return scic_sds_port_clear_phy(iport, iphy); 1432 + return sci_port_clear_phy(iport, iphy); 1313 1433 case SCI_PORT_SUB_OPERATIONAL: 1314 - status = scic_sds_port_clear_phy(iport, iphy); 1434 + status = sci_port_clear_phy(iport, iphy); 1315 1435 if (status != SCI_SUCCESS) 1316 1436 return status; 1317 1437 1318 - scic_sds_port_deactivate_phy(iport, iphy, true); 1438 + sci_port_deactivate_phy(iport, iphy, true); 1319 1439 iport->not_ready_reason = SCIC_PORT_NOT_READY_RECONFIGURING; 1320 1440 port_state_machine_change(iport, 1321 1441 SCI_PORT_SUB_CONFIGURING); 1322 1442 return SCI_SUCCESS; 1323 1443 case SCI_PORT_SUB_CONFIGURING: 1324 - status = scic_sds_port_clear_phy(iport, iphy); 1444 + status = sci_port_clear_phy(iport, iphy); 1325 1445 1326 1446 if (status != SCI_SUCCESS) 1327 1447 return status; 1328 - scic_sds_port_deactivate_phy(iport, iphy, true); 1448 + sci_port_deactivate_phy(iport, iphy, true); 1329 1449 1330 1450 /* Re-enter the configuring state since this may be the last phy in 1331 1451 * the port ··· 1340 1460 } 1341 1461 } 1342 1462 1343 - enum sci_status scic_sds_port_link_up(struct isci_port *iport, 1463 + enum sci_status sci_port_link_up(struct isci_port *iport, 1344 1464 struct isci_phy *iphy) 1345 1465 { 1346 - enum scic_sds_port_states state; 1466 + enum sci_port_states state; 1347 1467 1348 1468 state = iport->sm.current_state_id; 1349 1469 switch (state) { ··· 1351 1471 /* Since this is the first phy going link up for the port we 1352 1472 * can just enable it and continue 1353 1473 */ 1354 - scic_sds_port_activate_phy(iport, iphy, true); 1474 + sci_port_activate_phy(iport, iphy, true); 1355 1475 1356 1476 port_state_machine_change(iport, 1357 1477 SCI_PORT_SUB_OPERATIONAL); 1358 1478 return SCI_SUCCESS; 1359 1479 case SCI_PORT_SUB_OPERATIONAL: 1360 - scic_sds_port_general_link_up_handler(iport, iphy, true); 1480 + sci_port_general_link_up_handler(iport, iphy, true); 1361 1481 return SCI_SUCCESS; 1362 1482 case SCI_PORT_RESETTING: 1363 1483 /* TODO We should make sure that the phy that has gone ··· 1374 1494 /* In the resetting state we don't notify the user regarding 1375 1495 * link up and link down notifications. 1376 1496 */ 1377 - scic_sds_port_general_link_up_handler(iport, iphy, false); 1497 + sci_port_general_link_up_handler(iport, iphy, false); 1378 1498 return SCI_SUCCESS; 1379 1499 default: 1380 1500 dev_warn(sciport_to_dev(iport), ··· 1383 1503 } 1384 1504 } 1385 1505 1386 - enum sci_status scic_sds_port_link_down(struct isci_port *iport, 1506 + enum sci_status sci_port_link_down(struct isci_port *iport, 1387 1507 struct isci_phy *iphy) 1388 1508 { 1389 - enum scic_sds_port_states state; 1509 + enum sci_port_states state; 1390 1510 1391 1511 state = iport->sm.current_state_id; 1392 1512 switch (state) { 1393 1513 case SCI_PORT_SUB_OPERATIONAL: 1394 - scic_sds_port_deactivate_phy(iport, iphy, true); 1514 + sci_port_deactivate_phy(iport, iphy, true); 1395 1515 1396 1516 /* If there are no active phys left in the port, then 1397 1517 * transition the port to the WAITING state until such time ··· 1404 1524 case SCI_PORT_RESETTING: 1405 1525 /* In the resetting state we don't notify the user regarding 1406 1526 * link up and link down notifications. */ 1407 - scic_sds_port_deactivate_phy(iport, iphy, false); 1527 + sci_port_deactivate_phy(iport, iphy, false); 1408 1528 return SCI_SUCCESS; 1409 1529 default: 1410 1530 dev_warn(sciport_to_dev(iport), ··· 1413 1533 } 1414 1534 } 1415 1535 1416 - enum sci_status scic_sds_port_start_io(struct isci_port *iport, 1417 - struct isci_remote_device *idev, 1418 - struct isci_request *ireq) 1536 + enum sci_status sci_port_start_io(struct isci_port *iport, 1537 + struct isci_remote_device *idev, 1538 + struct isci_request *ireq) 1419 1539 { 1420 - enum scic_sds_port_states state; 1540 + enum sci_port_states state; 1421 1541 1422 1542 state = iport->sm.current_state_id; 1423 1543 switch (state) { ··· 1433 1553 } 1434 1554 } 1435 1555 1436 - enum sci_status scic_sds_port_complete_io(struct isci_port *iport, 1437 - struct isci_remote_device *idev, 1438 - struct isci_request *ireq) 1556 + enum sci_status sci_port_complete_io(struct isci_port *iport, 1557 + struct isci_remote_device *idev, 1558 + struct isci_request *ireq) 1439 1559 { 1440 - enum scic_sds_port_states state; 1560 + enum sci_port_states state; 1441 1561 1442 1562 state = iport->sm.current_state_id; 1443 1563 switch (state) { ··· 1446 1566 "%s: in wrong state: %d\n", __func__, state); 1447 1567 return SCI_FAILURE_INVALID_STATE; 1448 1568 case SCI_PORT_STOPPING: 1449 - scic_sds_port_decrement_request_count(iport); 1569 + sci_port_decrement_request_count(iport); 1450 1570 1451 1571 if (iport->started_request_count == 0) 1452 1572 port_state_machine_change(iport, ··· 1457 1577 case SCI_PORT_FAILED: 1458 1578 case SCI_PORT_SUB_WAITING: 1459 1579 case SCI_PORT_SUB_OPERATIONAL: 1460 - scic_sds_port_decrement_request_count(iport); 1580 + sci_port_decrement_request_count(iport); 1461 1581 break; 1462 1582 case SCI_PORT_SUB_CONFIGURING: 1463 - scic_sds_port_decrement_request_count(iport); 1583 + sci_port_decrement_request_count(iport); 1464 1584 if (iport->started_request_count == 0) { 1465 1585 port_state_machine_change(iport, 1466 1586 SCI_PORT_SUB_OPERATIONAL); ··· 1470 1590 return SCI_SUCCESS; 1471 1591 } 1472 1592 1473 - /** 1474 - * 1475 - * @sci_port: This is the port object which to suspend. 1476 - * 1477 - * This method will enable the SCU Port Task Scheduler for this port object but 1478 - * will leave the port task scheduler in a suspended state. none 1479 - */ 1480 - static void 1481 - scic_sds_port_enable_port_task_scheduler(struct isci_port *iport) 1593 + static void sci_port_enable_port_task_scheduler(struct isci_port *iport) 1482 1594 { 1483 1595 u32 pts_control_value; 1484 1596 1597 + /* enable the port task scheduler in a suspended state */ 1485 1598 pts_control_value = readl(&iport->port_task_scheduler_registers->control); 1486 1599 pts_control_value |= SCU_PTSxCR_GEN_BIT(ENABLE) | SCU_PTSxCR_GEN_BIT(SUSPEND); 1487 1600 writel(pts_control_value, &iport->port_task_scheduler_registers->control); 1488 1601 } 1489 1602 1490 - /** 1491 - * 1492 - * @sci_port: This is the port object which to resume. 1493 - * 1494 - * This method will disable the SCU port task scheduler for this port object. 1495 - * none 1496 - */ 1497 - static void 1498 - scic_sds_port_disable_port_task_scheduler(struct isci_port *iport) 1603 + static void sci_port_disable_port_task_scheduler(struct isci_port *iport) 1499 1604 { 1500 1605 u32 pts_control_value; 1501 1606 ··· 1490 1625 writel(pts_control_value, &iport->port_task_scheduler_registers->control); 1491 1626 } 1492 1627 1493 - static void scic_sds_port_post_dummy_remote_node(struct isci_port *iport) 1628 + static void sci_port_post_dummy_remote_node(struct isci_port *iport) 1494 1629 { 1495 1630 struct isci_host *ihost = iport->owning_controller; 1496 1631 u8 phys_index = iport->physical_port_index; ··· 1504 1639 command = SCU_CONTEXT_COMMAND_POST_RNC_32 | 1505 1640 phys_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT | rni; 1506 1641 1507 - scic_sds_controller_post_request(ihost, command); 1642 + sci_controller_post_request(ihost, command); 1508 1643 1509 1644 /* ensure hardware has seen the post rnc command and give it 1510 1645 * ample time to act before sending the suspend ··· 1515 1650 command = SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX_RX | 1516 1651 phys_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT | rni; 1517 1652 1518 - scic_sds_controller_post_request(ihost, command); 1653 + sci_controller_post_request(ihost, command); 1519 1654 } 1520 1655 1521 - static void scic_sds_port_stopped_state_enter(struct sci_base_state_machine *sm) 1656 + static void sci_port_stopped_state_enter(struct sci_base_state_machine *sm) 1522 1657 { 1523 1658 struct isci_port *iport = container_of(sm, typeof(*iport), sm); 1524 1659 ··· 1527 1662 * If we enter this state becasuse of a request to stop 1528 1663 * the port then we want to disable the hardwares port 1529 1664 * task scheduler. */ 1530 - scic_sds_port_disable_port_task_scheduler(iport); 1665 + sci_port_disable_port_task_scheduler(iport); 1531 1666 } 1532 1667 } 1533 1668 1534 - static void scic_sds_port_stopped_state_exit(struct sci_base_state_machine *sm) 1669 + static void sci_port_stopped_state_exit(struct sci_base_state_machine *sm) 1535 1670 { 1536 1671 struct isci_port *iport = container_of(sm, typeof(*iport), sm); 1537 1672 1538 1673 /* Enable and suspend the port task scheduler */ 1539 - scic_sds_port_enable_port_task_scheduler(iport); 1674 + sci_port_enable_port_task_scheduler(iport); 1540 1675 } 1541 1676 1542 - static void scic_sds_port_ready_state_enter(struct sci_base_state_machine *sm) 1677 + static void sci_port_ready_state_enter(struct sci_base_state_machine *sm) 1543 1678 { 1544 1679 struct isci_port *iport = container_of(sm, typeof(*iport), sm); 1545 1680 struct isci_host *ihost = iport->owning_controller; ··· 1552 1687 isci_port_not_ready(ihost, iport); 1553 1688 1554 1689 /* Post and suspend the dummy remote node context for this port. */ 1555 - scic_sds_port_post_dummy_remote_node(iport); 1690 + sci_port_post_dummy_remote_node(iport); 1556 1691 1557 1692 /* Start the ready substate machine */ 1558 1693 port_state_machine_change(iport, 1559 1694 SCI_PORT_SUB_WAITING); 1560 1695 } 1561 1696 1562 - static void scic_sds_port_resetting_state_exit(struct sci_base_state_machine *sm) 1697 + static void sci_port_resetting_state_exit(struct sci_base_state_machine *sm) 1563 1698 { 1564 1699 struct isci_port *iport = container_of(sm, typeof(*iport), sm); 1565 1700 1566 1701 sci_del_timer(&iport->timer); 1567 1702 } 1568 1703 1569 - static void scic_sds_port_stopping_state_exit(struct sci_base_state_machine *sm) 1704 + static void sci_port_stopping_state_exit(struct sci_base_state_machine *sm) 1570 1705 { 1571 1706 struct isci_port *iport = container_of(sm, typeof(*iport), sm); 1572 1707 1573 1708 sci_del_timer(&iport->timer); 1574 1709 1575 - scic_sds_port_destroy_dummy_resources(iport); 1710 + sci_port_destroy_dummy_resources(iport); 1576 1711 } 1577 1712 1578 - static void scic_sds_port_failed_state_enter(struct sci_base_state_machine *sm) 1713 + static void sci_port_failed_state_enter(struct sci_base_state_machine *sm) 1579 1714 { 1580 1715 struct isci_port *iport = container_of(sm, typeof(*iport), sm); 1581 1716 ··· 1584 1719 1585 1720 /* --------------------------------------------------------------------------- */ 1586 1721 1587 - static const struct sci_base_state scic_sds_port_state_table[] = { 1722 + static const struct sci_base_state sci_port_state_table[] = { 1588 1723 [SCI_PORT_STOPPED] = { 1589 - .enter_state = scic_sds_port_stopped_state_enter, 1590 - .exit_state = scic_sds_port_stopped_state_exit 1724 + .enter_state = sci_port_stopped_state_enter, 1725 + .exit_state = sci_port_stopped_state_exit 1591 1726 }, 1592 1727 [SCI_PORT_STOPPING] = { 1593 - .exit_state = scic_sds_port_stopping_state_exit 1728 + .exit_state = sci_port_stopping_state_exit 1594 1729 }, 1595 1730 [SCI_PORT_READY] = { 1596 - .enter_state = scic_sds_port_ready_state_enter, 1731 + .enter_state = sci_port_ready_state_enter, 1597 1732 }, 1598 1733 [SCI_PORT_SUB_WAITING] = { 1599 - .enter_state = scic_sds_port_ready_substate_waiting_enter, 1734 + .enter_state = sci_port_ready_substate_waiting_enter, 1600 1735 }, 1601 1736 [SCI_PORT_SUB_OPERATIONAL] = { 1602 - .enter_state = scic_sds_port_ready_substate_operational_enter, 1603 - .exit_state = scic_sds_port_ready_substate_operational_exit 1737 + .enter_state = sci_port_ready_substate_operational_enter, 1738 + .exit_state = sci_port_ready_substate_operational_exit 1604 1739 }, 1605 1740 [SCI_PORT_SUB_CONFIGURING] = { 1606 - .enter_state = scic_sds_port_ready_substate_configuring_enter, 1607 - .exit_state = scic_sds_port_ready_substate_configuring_exit 1741 + .enter_state = sci_port_ready_substate_configuring_enter, 1742 + .exit_state = sci_port_ready_substate_configuring_exit 1608 1743 }, 1609 1744 [SCI_PORT_RESETTING] = { 1610 - .exit_state = scic_sds_port_resetting_state_exit 1745 + .exit_state = sci_port_resetting_state_exit 1611 1746 }, 1612 1747 [SCI_PORT_FAILED] = { 1613 - .enter_state = scic_sds_port_failed_state_enter, 1748 + .enter_state = sci_port_failed_state_enter, 1614 1749 } 1615 1750 }; 1616 1751 1617 - void scic_sds_port_construct(struct isci_port *iport, u8 index, 1752 + void sci_port_construct(struct isci_port *iport, u8 index, 1618 1753 struct isci_host *ihost) 1619 1754 { 1620 - sci_init_sm(&iport->sm, scic_sds_port_state_table, SCI_PORT_STOPPED); 1755 + sci_init_sm(&iport->sm, sci_port_state_table, SCI_PORT_STOPPED); 1621 1756 1622 1757 iport->logical_port_index = SCIC_SDS_DUMMY_PORT; 1623 1758 iport->physical_port_index = index; ··· 1663 1798 return isci_port->status; 1664 1799 } 1665 1800 1666 - void scic_sds_port_broadcast_change_received( 1667 - struct isci_port *iport, 1668 - struct isci_phy *iphy) 1801 + void sci_port_broadcast_change_received(struct isci_port *iport, struct isci_phy *iphy) 1669 1802 { 1670 1803 struct isci_host *ihost = iport->owning_controller; 1671 1804 ··· 1686 1823 spin_lock_irqsave(&ihost->scic_lock, flags); 1687 1824 1688 1825 #define ISCI_PORT_RESET_TIMEOUT SCIC_SDS_SIGNATURE_FIS_TIMEOUT 1689 - status = scic_port_hard_reset(iport, ISCI_PORT_RESET_TIMEOUT); 1826 + status = sci_port_hard_reset(iport, ISCI_PORT_RESET_TIMEOUT); 1690 1827 1691 1828 spin_unlock_irqrestore(&ihost->scic_lock, flags); 1692 1829 ··· 1703 1840 ret = TMF_RESP_FUNC_FAILED; 1704 1841 1705 1842 dev_err(&ihost->pdev->dev, 1706 - "%s: iport = %p; scic_port_hard_reset call" 1843 + "%s: iport = %p; sci_port_hard_reset call" 1707 1844 " failed 0x%x\n", 1708 1845 __func__, iport, status); 1709 1846 ··· 1726 1863 1727 1864 if (!iphy) 1728 1865 continue; 1729 - scic_sds_phy_stop(iphy); 1730 - scic_sds_phy_start(iphy); 1866 + sci_phy_stop(iphy); 1867 + sci_phy_start(iphy); 1731 1868 } 1732 1869 spin_unlock_irqrestore(&ihost->scic_lock, flags); 1733 1870 }
+31 -37
drivers/scsi/isci/port.h
··· 123 123 struct scu_viit_entry __iomem *viit_registers; 124 124 }; 125 125 126 - enum scic_port_not_ready_reason_code { 126 + enum sci_port_not_ready_reason_code { 127 127 SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS, 128 128 SCIC_PORT_NOT_READY_HARD_RESET_REQUESTED, 129 129 SCIC_PORT_NOT_READY_INVALID_PORT_CONFIGURATION, ··· 132 132 SCIC_PORT_NOT_READY_REASON_CODE_MAX 133 133 }; 134 134 135 - struct scic_port_end_point_properties { 135 + struct sci_port_end_point_properties { 136 136 struct sci_sas_address sas_address; 137 - struct scic_phy_proto protocols; 137 + struct sci_phy_proto protocols; 138 138 }; 139 139 140 - struct scic_port_properties { 140 + struct sci_port_properties { 141 141 u32 index; 142 - struct scic_port_end_point_properties local; 143 - struct scic_port_end_point_properties remote; 142 + struct sci_port_end_point_properties local; 143 + struct sci_port_end_point_properties remote; 144 144 u32 phy_mask; 145 145 }; 146 146 147 147 /** 148 - * enum scic_sds_port_states - This enumeration depicts all the states for the 148 + * enum sci_port_states - This enumeration depicts all the states for the 149 149 * common port state machine. 150 150 * 151 151 * 152 152 */ 153 - enum scic_sds_port_states { 153 + enum sci_port_states { 154 154 /** 155 155 * This state indicates that the port has successfully been stopped. 156 156 * In this state no new IO operations are permitted. ··· 211 211 }; 212 212 213 213 /** 214 - * scic_sds_port_get_controller() - 214 + * sci_port_get_controller() - 215 215 * 216 216 * Helper macro to get the owning controller of this port 217 217 */ 218 - #define scic_sds_port_get_controller(this_port) \ 218 + #define sci_port_get_controller(this_port) \ 219 219 ((this_port)->owning_controller) 220 220 221 221 /** 222 - * scic_sds_port_get_index() - 222 + * sci_port_get_index() - 223 223 * 224 224 * This macro returns the physical port index for this port object 225 225 */ 226 - #define scic_sds_port_get_index(this_port) \ 226 + #define sci_port_get_index(this_port) \ 227 227 ((this_port)->physical_port_index) 228 228 229 229 230 - static inline void scic_sds_port_decrement_request_count(struct isci_port *iport) 230 + static inline void sci_port_decrement_request_count(struct isci_port *iport) 231 231 { 232 232 if (WARN_ONCE(iport->started_request_count == 0, 233 233 "%s: tried to decrement started_request_count past 0!?", ··· 237 237 iport->started_request_count--; 238 238 } 239 239 240 - #define scic_sds_port_active_phy(port, phy) \ 240 + #define sci_port_active_phy(port, phy) \ 241 241 (((port)->active_phy_mask & (1 << (phy)->phy_index)) != 0) 242 242 243 - void scic_sds_port_construct( 243 + void sci_port_construct( 244 244 struct isci_port *iport, 245 245 u8 port_index, 246 246 struct isci_host *ihost); 247 247 248 - enum sci_status scic_sds_port_initialize( 249 - struct isci_port *iport, 250 - void __iomem *port_task_scheduler_registers, 251 - void __iomem *port_configuration_regsiter, 252 - void __iomem *viit_registers); 248 + enum sci_status sci_port_start(struct isci_port *iport); 249 + enum sci_status sci_port_stop(struct isci_port *iport); 253 250 254 - enum sci_status scic_sds_port_start(struct isci_port *iport); 255 - enum sci_status scic_sds_port_stop(struct isci_port *iport); 256 - 257 - enum sci_status scic_sds_port_add_phy( 251 + enum sci_status sci_port_add_phy( 258 252 struct isci_port *iport, 259 253 struct isci_phy *iphy); 260 254 261 - enum sci_status scic_sds_port_remove_phy( 255 + enum sci_status sci_port_remove_phy( 262 256 struct isci_port *iport, 263 257 struct isci_phy *iphy); 264 258 265 - void scic_sds_port_setup_transports( 259 + void sci_port_setup_transports( 266 260 struct isci_port *iport, 267 261 u32 device_id); 268 262 269 263 void isci_port_bcn_enable(struct isci_host *, struct isci_port *); 270 264 271 - void scic_sds_port_deactivate_phy( 265 + void sci_port_deactivate_phy( 272 266 struct isci_port *iport, 273 267 struct isci_phy *iphy, 274 268 bool do_notify_user); 275 269 276 - bool scic_sds_port_link_detected( 270 + bool sci_port_link_detected( 277 271 struct isci_port *iport, 278 272 struct isci_phy *iphy); 279 273 280 - enum sci_status scic_sds_port_link_up(struct isci_port *iport, 274 + enum sci_status sci_port_link_up(struct isci_port *iport, 281 275 struct isci_phy *iphy); 282 - enum sci_status scic_sds_port_link_down(struct isci_port *iport, 276 + enum sci_status sci_port_link_down(struct isci_port *iport, 283 277 struct isci_phy *iphy); 284 278 285 279 struct isci_request; 286 280 struct isci_remote_device; 287 - enum sci_status scic_sds_port_start_io( 281 + enum sci_status sci_port_start_io( 288 282 struct isci_port *iport, 289 283 struct isci_remote_device *idev, 290 284 struct isci_request *ireq); 291 285 292 - enum sci_status scic_sds_port_complete_io( 286 + enum sci_status sci_port_complete_io( 293 287 struct isci_port *iport, 294 288 struct isci_remote_device *idev, 295 289 struct isci_request *ireq); 296 290 297 - enum sas_linkrate scic_sds_port_get_max_allowed_speed( 291 + enum sas_linkrate sci_port_get_max_allowed_speed( 298 292 struct isci_port *iport); 299 293 300 - void scic_sds_port_broadcast_change_received( 294 + void sci_port_broadcast_change_received( 301 295 struct isci_port *iport, 302 296 struct isci_phy *iphy); 303 297 304 - bool scic_sds_port_is_valid_phy_assignment( 298 + bool sci_port_is_valid_phy_assignment( 305 299 struct isci_port *iport, 306 300 u32 phy_index); 307 301 308 - void scic_sds_port_get_sas_address( 302 + void sci_port_get_sas_address( 309 303 struct isci_port *iport, 310 304 struct sci_sas_address *sas_address); 311 305 312 - void scic_sds_port_get_attached_sas_address( 306 + void sci_port_get_attached_sas_address( 313 307 struct isci_port *iport, 314 308 struct sci_sas_address *sas_address); 315 309
+66 -66
drivers/scsi/isci/port_config.c
··· 112 112 * port. port address if the port can be found to match the phy. 113 113 * NULL if there is no matching port for the phy. 114 114 */ 115 - static struct isci_port *scic_sds_port_configuration_agent_find_port( 115 + static struct isci_port *sci_port_configuration_agent_find_port( 116 116 struct isci_host *ihost, 117 117 struct isci_phy *iphy) 118 118 { ··· 127 127 * more phys match the sent and received SAS address as this phy in which 128 128 * case it should participate in the same port. 129 129 */ 130 - scic_sds_phy_get_sas_address(iphy, &phy_sas_address); 131 - scic_sds_phy_get_attached_sas_address(iphy, &phy_attached_device_address); 130 + sci_phy_get_sas_address(iphy, &phy_sas_address); 131 + sci_phy_get_attached_sas_address(iphy, &phy_attached_device_address); 132 132 133 133 for (i = 0; i < ihost->logical_port_entries; i++) { 134 134 struct isci_port *iport = &ihost->ports[i]; 135 135 136 - scic_sds_port_get_sas_address(iport, &port_sas_address); 137 - scic_sds_port_get_attached_sas_address(iport, &port_attached_device_address); 136 + sci_port_get_sas_address(iport, &port_sas_address); 137 + sci_port_get_attached_sas_address(iport, &port_attached_device_address); 138 138 139 139 if (sci_sas_address_compare(port_sas_address, phy_sas_address) == 0 && 140 140 sci_sas_address_compare(port_attached_device_address, phy_attached_device_address) == 0) ··· 156 156 * this port configuration agent. SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION 157 157 * the port configuration is not valid for this port configuration agent. 158 158 */ 159 - static enum sci_status scic_sds_port_configuration_agent_validate_ports( 159 + static enum sci_status sci_port_configuration_agent_validate_ports( 160 160 struct isci_host *ihost, 161 - struct scic_sds_port_configuration_agent *port_agent) 161 + struct sci_port_configuration_agent *port_agent) 162 162 { 163 163 struct sci_sas_address first_address; 164 164 struct sci_sas_address second_address; ··· 194 194 * PE0 and PE3 can never have the same SAS Address unless they 195 195 * are part of the same x4 wide port and we have already checked 196 196 * for this condition. */ 197 - scic_sds_phy_get_sas_address(&ihost->phys[0], &first_address); 198 - scic_sds_phy_get_sas_address(&ihost->phys[3], &second_address); 197 + sci_phy_get_sas_address(&ihost->phys[0], &first_address); 198 + sci_phy_get_sas_address(&ihost->phys[3], &second_address); 199 199 200 200 if (sci_sas_address_compare(first_address, second_address) == 0) { 201 201 return SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION; ··· 207 207 * part of the same port. */ 208 208 if (port_agent->phy_valid_port_range[0].min_index == 0 && 209 209 port_agent->phy_valid_port_range[1].min_index == 1) { 210 - scic_sds_phy_get_sas_address(&ihost->phys[0], &first_address); 211 - scic_sds_phy_get_sas_address(&ihost->phys[2], &second_address); 210 + sci_phy_get_sas_address(&ihost->phys[0], &first_address); 211 + sci_phy_get_sas_address(&ihost->phys[2], &second_address); 212 212 213 213 if (sci_sas_address_compare(first_address, second_address) == 0) { 214 214 return SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION; ··· 221 221 * part of the same port. */ 222 222 if (port_agent->phy_valid_port_range[2].min_index == 2 && 223 223 port_agent->phy_valid_port_range[3].min_index == 3) { 224 - scic_sds_phy_get_sas_address(&ihost->phys[1], &first_address); 225 - scic_sds_phy_get_sas_address(&ihost->phys[3], &second_address); 224 + sci_phy_get_sas_address(&ihost->phys[1], &first_address); 225 + sci_phy_get_sas_address(&ihost->phys[3], &second_address); 226 226 227 227 if (sci_sas_address_compare(first_address, second_address) == 0) { 228 228 return SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION; ··· 239 239 240 240 /* verify all of the phys in the same port are using the same SAS address */ 241 241 static enum sci_status 242 - scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost, 243 - struct scic_sds_port_configuration_agent *port_agent) 242 + sci_mpc_agent_validate_phy_configuration(struct isci_host *ihost, 243 + struct sci_port_configuration_agent *port_agent) 244 244 { 245 245 u32 phy_mask; 246 246 u32 assigned_phy_mask; ··· 254 254 sas_address.low = 0; 255 255 256 256 for (port_index = 0; port_index < SCI_MAX_PORTS; port_index++) { 257 - phy_mask = ihost->oem_parameters.sds1.ports[port_index].phy_mask; 257 + phy_mask = ihost->oem_parameters.ports[port_index].phy_mask; 258 258 259 259 if (!phy_mask) 260 260 continue; ··· 269 269 for (phy_index = 0; phy_index < SCI_MAX_PHYS; phy_index++) { 270 270 if ((phy_mask & (1 << phy_index)) == 0) 271 271 continue; 272 - scic_sds_phy_get_sas_address(&ihost->phys[phy_index], 272 + sci_phy_get_sas_address(&ihost->phys[phy_index], 273 273 &sas_address); 274 274 275 275 /* ··· 294 294 while (phy_index < SCI_MAX_PHYS) { 295 295 if ((phy_mask & (1 << phy_index)) == 0) 296 296 continue; 297 - scic_sds_phy_get_sas_address(&ihost->phys[phy_index], 297 + sci_phy_get_sas_address(&ihost->phys[phy_index], 298 298 &phy_assigned_address); 299 299 300 300 if (sci_sas_address_compare(sas_address, phy_assigned_address) != 0) { ··· 307 307 port_agent->phy_valid_port_range[phy_index].min_index = port_index; 308 308 port_agent->phy_valid_port_range[phy_index].max_index = phy_index; 309 309 310 - scic_sds_port_add_phy(&ihost->ports[port_index], 310 + sci_port_add_phy(&ihost->ports[port_index], 311 311 &ihost->phys[phy_index]); 312 312 313 313 assigned_phy_mask |= (1 << phy_index); ··· 316 316 phy_index++; 317 317 } 318 318 319 - return scic_sds_port_configuration_agent_validate_ports(ihost, port_agent); 319 + return sci_port_configuration_agent_validate_ports(ihost, port_agent); 320 320 } 321 321 322 322 static void mpc_agent_timeout(unsigned long data) 323 323 { 324 324 u8 index; 325 325 struct sci_timer *tmr = (struct sci_timer *)data; 326 - struct scic_sds_port_configuration_agent *port_agent; 326 + struct sci_port_configuration_agent *port_agent; 327 327 struct isci_host *ihost; 328 328 unsigned long flags; 329 329 u16 configure_phy_mask; ··· 355 355 spin_unlock_irqrestore(&ihost->scic_lock, flags); 356 356 } 357 357 358 - static void scic_sds_mpc_agent_link_up(struct isci_host *ihost, 359 - struct scic_sds_port_configuration_agent *port_agent, 358 + static void sci_mpc_agent_link_up(struct isci_host *ihost, 359 + struct sci_port_configuration_agent *port_agent, 360 360 struct isci_port *iport, 361 361 struct isci_phy *iphy) 362 362 { ··· 367 367 if (!iport) 368 368 return; 369 369 370 - port_agent->phy_ready_mask |= (1 << scic_sds_phy_get_index(iphy)); 371 - scic_sds_port_link_up(iport, iphy); 372 - if ((iport->active_phy_mask & (1 << scic_sds_phy_get_index(iphy)))) 373 - port_agent->phy_configured_mask |= (1 << scic_sds_phy_get_index(iphy)); 370 + port_agent->phy_ready_mask |= (1 << sci_phy_get_index(iphy)); 371 + sci_port_link_up(iport, iphy); 372 + if ((iport->active_phy_mask & (1 << sci_phy_get_index(iphy)))) 373 + port_agent->phy_configured_mask |= (1 << sci_phy_get_index(iphy)); 374 374 } 375 375 376 376 /** ··· 390 390 * not associated with a port there is no action taken. Is it possible to get a 391 391 * link down notification from a phy that has no assocoated port? 392 392 */ 393 - static void scic_sds_mpc_agent_link_down( 393 + static void sci_mpc_agent_link_down( 394 394 struct isci_host *ihost, 395 - struct scic_sds_port_configuration_agent *port_agent, 395 + struct sci_port_configuration_agent *port_agent, 396 396 struct isci_port *iport, 397 397 struct isci_phy *iphy) 398 398 { ··· 405 405 * state. 406 406 */ 407 407 port_agent->phy_ready_mask &= 408 - ~(1 << scic_sds_phy_get_index(iphy)); 408 + ~(1 << sci_phy_get_index(iphy)); 409 409 port_agent->phy_configured_mask &= 410 - ~(1 << scic_sds_phy_get_index(iphy)); 410 + ~(1 << sci_phy_get_index(iphy)); 411 411 412 412 /* 413 413 * Check to see if there are more phys waiting to be ··· 424 424 SCIC_SDS_MPC_RECONFIGURATION_TIMEOUT); 425 425 } 426 426 427 - scic_sds_port_link_down(iport, iphy); 427 + sci_port_link_down(iport, iphy); 428 428 } 429 429 } 430 430 ··· 432 432 * configuration mode. 433 433 */ 434 434 static enum sci_status 435 - scic_sds_apc_agent_validate_phy_configuration(struct isci_host *ihost, 436 - struct scic_sds_port_configuration_agent *port_agent) 435 + sci_apc_agent_validate_phy_configuration(struct isci_host *ihost, 436 + struct sci_port_configuration_agent *port_agent) 437 437 { 438 438 u8 phy_index; 439 439 u8 port_index; ··· 446 446 port_index = phy_index; 447 447 448 448 /* Get the assigned SAS Address for the first PHY on the controller. */ 449 - scic_sds_phy_get_sas_address(&ihost->phys[phy_index], 449 + sci_phy_get_sas_address(&ihost->phys[phy_index], 450 450 &sas_address); 451 451 452 452 while (++phy_index < SCI_MAX_PHYS) { 453 - scic_sds_phy_get_sas_address(&ihost->phys[phy_index], 453 + sci_phy_get_sas_address(&ihost->phys[phy_index], 454 454 &phy_assigned_address); 455 455 456 456 /* Verify each of the SAS address are all the same for every PHY */ ··· 465 465 } 466 466 } 467 467 468 - return scic_sds_port_configuration_agent_validate_ports(ihost, port_agent); 468 + return sci_port_configuration_agent_validate_ports(ihost, port_agent); 469 469 } 470 470 471 - static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost, 472 - struct scic_sds_port_configuration_agent *port_agent, 471 + static void sci_apc_agent_configure_ports(struct isci_host *ihost, 472 + struct sci_port_configuration_agent *port_agent, 473 473 struct isci_phy *iphy, 474 474 bool start_timer) 475 475 { ··· 478 478 struct isci_port *iport; 479 479 enum SCIC_SDS_APC_ACTIVITY apc_activity = SCIC_SDS_APC_SKIP_PHY; 480 480 481 - iport = scic_sds_port_configuration_agent_find_port(ihost, iphy); 481 + iport = sci_port_configuration_agent_find_port(ihost, iphy); 482 482 483 483 if (iport) { 484 - if (scic_sds_port_is_valid_phy_assignment(iport, iphy->phy_index)) 484 + if (sci_port_is_valid_phy_assignment(iport, iphy->phy_index)) 485 485 apc_activity = SCIC_SDS_APC_ADD_PHY; 486 486 else 487 487 apc_activity = SCIC_SDS_APC_SKIP_PHY; ··· 499 499 iport = &ihost->ports[port_index]; 500 500 501 501 /* First we must make sure that this PHY can be added to this Port. */ 502 - if (scic_sds_port_is_valid_phy_assignment(iport, iphy->phy_index)) { 502 + if (sci_port_is_valid_phy_assignment(iport, iphy->phy_index)) { 503 503 /* 504 504 * Port contains a PHY with a greater PHY ID than the current 505 505 * PHY that has gone link up. This phy can not be part of any ··· 559 559 560 560 switch (apc_activity) { 561 561 case SCIC_SDS_APC_ADD_PHY: 562 - status = scic_sds_port_add_phy(iport, iphy); 562 + status = sci_port_add_phy(iport, iphy); 563 563 564 564 if (status == SCI_SUCCESS) { 565 565 port_agent->phy_configured_mask |= (1 << iphy->phy_index); ··· 588 588 } 589 589 590 590 /** 591 - * scic_sds_apc_agent_link_up - handle apc link up events 591 + * sci_apc_agent_link_up - handle apc link up events 592 592 * @scic: This is the controller object that receives the link up 593 593 * notification. 594 594 * @sci_port: This is the port object associated with the phy. If the is no ··· 599 599 * notifications. Is it possible to get a link down notification from a phy 600 600 * that has no assocoated port? 601 601 */ 602 - static void scic_sds_apc_agent_link_up(struct isci_host *ihost, 603 - struct scic_sds_port_configuration_agent *port_agent, 602 + static void sci_apc_agent_link_up(struct isci_host *ihost, 603 + struct sci_port_configuration_agent *port_agent, 604 604 struct isci_port *iport, 605 605 struct isci_phy *iphy) 606 606 { ··· 609 609 if (!iport) { 610 610 /* the phy is not the part of this port */ 611 611 port_agent->phy_ready_mask |= 1 << phy_index; 612 - scic_sds_apc_agent_configure_ports(ihost, port_agent, iphy, true); 612 + sci_apc_agent_configure_ports(ihost, port_agent, iphy, true); 613 613 } else { 614 614 /* the phy is already the part of the port */ 615 615 u32 port_state = iport->sm.current_state_id; ··· 620 620 */ 621 621 BUG_ON(port_state != SCI_PORT_RESETTING); 622 622 port_agent->phy_ready_mask |= 1 << phy_index; 623 - scic_sds_port_link_up(iport, iphy); 623 + sci_port_link_up(iport, iphy); 624 624 } 625 625 } 626 626 ··· 637 637 * possible to get a link down notification from a phy that has no assocoated 638 638 * port? 639 639 */ 640 - static void scic_sds_apc_agent_link_down( 640 + static void sci_apc_agent_link_down( 641 641 struct isci_host *ihost, 642 - struct scic_sds_port_configuration_agent *port_agent, 642 + struct sci_port_configuration_agent *port_agent, 643 643 struct isci_port *iport, 644 644 struct isci_phy *iphy) 645 645 { 646 - port_agent->phy_ready_mask &= ~(1 << scic_sds_phy_get_index(iphy)); 646 + port_agent->phy_ready_mask &= ~(1 << sci_phy_get_index(iphy)); 647 647 648 648 if (!iport) 649 649 return; 650 650 if (port_agent->phy_configured_mask & (1 << iphy->phy_index)) { 651 651 enum sci_status status; 652 652 653 - status = scic_sds_port_remove_phy(iport, iphy); 653 + status = sci_port_remove_phy(iport, iphy); 654 654 655 655 if (status == SCI_SUCCESS) 656 656 port_agent->phy_configured_mask &= ~(1 << iphy->phy_index); ··· 662 662 { 663 663 u32 index; 664 664 struct sci_timer *tmr = (struct sci_timer *)data; 665 - struct scic_sds_port_configuration_agent *port_agent; 665 + struct sci_port_configuration_agent *port_agent; 666 666 struct isci_host *ihost; 667 667 unsigned long flags; 668 668 u16 configure_phy_mask; ··· 686 686 if ((configure_phy_mask & (1 << index)) == 0) 687 687 continue; 688 688 689 - scic_sds_apc_agent_configure_ports(ihost, port_agent, 689 + sci_apc_agent_configure_ports(ihost, port_agent, 690 690 &ihost->phys[index], false); 691 691 } 692 692 ··· 706 706 * call is universal for both manual port configuration and automatic port 707 707 * configuration modes. 708 708 */ 709 - void scic_sds_port_configuration_agent_construct( 710 - struct scic_sds_port_configuration_agent *port_agent) 709 + void sci_port_configuration_agent_construct( 710 + struct sci_port_configuration_agent *port_agent) 711 711 { 712 712 u32 index; 713 713 ··· 725 725 } 726 726 } 727 727 728 - enum sci_status scic_sds_port_configuration_agent_initialize( 728 + enum sci_status sci_port_configuration_agent_initialize( 729 729 struct isci_host *ihost, 730 - struct scic_sds_port_configuration_agent *port_agent) 730 + struct sci_port_configuration_agent *port_agent) 731 731 { 732 732 enum sci_status status; 733 - enum scic_port_configuration_mode mode; 733 + enum sci_port_configuration_mode mode; 734 734 735 - mode = ihost->oem_parameters.sds1.controller.mode_type; 735 + mode = ihost->oem_parameters.controller.mode_type; 736 736 737 737 if (mode == SCIC_PORT_MANUAL_CONFIGURATION_MODE) { 738 - status = scic_sds_mpc_agent_validate_phy_configuration( 738 + status = sci_mpc_agent_validate_phy_configuration( 739 739 ihost, port_agent); 740 740 741 - port_agent->link_up_handler = scic_sds_mpc_agent_link_up; 742 - port_agent->link_down_handler = scic_sds_mpc_agent_link_down; 741 + port_agent->link_up_handler = sci_mpc_agent_link_up; 742 + port_agent->link_down_handler = sci_mpc_agent_link_down; 743 743 744 744 sci_init_timer(&port_agent->timer, mpc_agent_timeout); 745 745 } else { 746 - status = scic_sds_apc_agent_validate_phy_configuration( 746 + status = sci_apc_agent_validate_phy_configuration( 747 747 ihost, port_agent); 748 748 749 - port_agent->link_up_handler = scic_sds_apc_agent_link_up; 750 - port_agent->link_down_handler = scic_sds_apc_agent_link_down; 749 + port_agent->link_up_handler = sci_apc_agent_link_up; 750 + port_agent->link_down_handler = sci_apc_agent_link_down; 751 751 752 752 sci_init_timer(&port_agent->timer, apc_agent_timeout); 753 753 }
+3 -13
drivers/scsi/isci/probe_roms.c
··· 111 111 return rom; 112 112 } 113 113 114 - /** 115 - * isci_parse_oem_parameters() - This method will take OEM parameters 116 - * from the module init parameters and copy them to oem_params. This will 117 - * only copy values that are not set to the module parameter default values 118 - * @oem_parameters: This parameter specifies the controller default OEM 119 - * parameters. It is expected that this has been initialized to the default 120 - * parameters for the controller 121 - * 122 - * 123 - */ 124 - enum sci_status isci_parse_oem_parameters(union scic_oem_parameters *oem_params, 114 + enum sci_status isci_parse_oem_parameters(struct sci_oem_params *oem, 125 115 struct isci_orom *orom, int scu_index) 126 116 { 127 117 /* check for valid inputs */ 128 118 if (scu_index < 0 || scu_index >= SCI_MAX_CONTROLLERS || 129 - scu_index > orom->hdr.num_elements || !oem_params) 119 + scu_index > orom->hdr.num_elements || !oem) 130 120 return -EINVAL; 131 121 132 - oem_params->sds1 = orom->ctrl[scu_index]; 122 + *oem = orom->ctrl[scu_index]; 133 123 return 0; 134 124 } 135 125
+7 -31
drivers/scsi/isci/probe_roms.h
··· 74 74 #define SCIC_SDS_PARM_MAX_SPEED SCIC_SDS_PARM_GEN3_SPEED 75 75 76 76 /* parameters that can be set by module parameters */ 77 - struct scic_sds_user_parameters { 77 + struct sci_user_parameters { 78 78 struct sci_phy_user_params { 79 79 /** 80 80 * This field specifies the NOTIFY (ENABLE SPIN UP) primitive ··· 147 147 148 148 }; 149 149 150 - /* XXX kill this union */ 151 - union scic_user_parameters { 152 - /** 153 - * This field specifies the user parameters specific to the 154 - * Storage Controller Unit (SCU) Driver Standard (SDS) version 155 - * 1. 156 - */ 157 - struct scic_sds_user_parameters sds1; 158 - }; 159 - 160 150 #define SCIC_SDS_PARM_PHY_MASK_MIN 0x0 161 151 #define SCIC_SDS_PARM_PHY_MASK_MAX 0xF 162 152 #define MAX_CONCURRENT_DEVICE_SPIN_UP_COUNT 4 163 153 164 - struct scic_sds_oem_params; 165 - int scic_oem_parameters_validate(struct scic_sds_oem_params *oem); 166 - 167 - union scic_oem_parameters; 168 - void scic_oem_parameters_get(struct isci_host *ihost, 169 - union scic_oem_parameters *oem); 154 + struct sci_oem_params; 155 + int sci_oem_parameters_validate(struct sci_oem_params *oem); 170 156 171 157 struct isci_orom; 172 158 struct isci_orom *isci_request_oprom(struct pci_dev *pdev); 173 - enum sci_status isci_parse_oem_parameters(union scic_oem_parameters *oem, 159 + enum sci_status isci_parse_oem_parameters(struct sci_oem_params *oem, 174 160 struct isci_orom *orom, int scu_index); 175 161 struct isci_orom *isci_request_firmware(struct pci_dev *pdev, const struct firmware *fw); 176 162 struct isci_orom *isci_get_efi_var(struct pci_dev *pdev); ··· 200 214 * A PORT_PHY mask that assigns just a single PHY to a port and no other PHYs 201 215 * being assigned is sufficient to declare manual PORT configuration. 202 216 */ 203 - enum scic_port_configuration_mode { 217 + enum sci_port_configuration_mode { 204 218 SCIC_PORT_MANUAL_CONFIGURATION_MODE = 0, 205 219 SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE = 1 206 220 }; ··· 216 230 uint8_t reserved[8]; 217 231 } __attribute__ ((packed)); 218 232 219 - struct scic_sds_oem_params { 233 + struct sci_oem_params { 220 234 struct { 221 235 uint8_t mode_type; 222 236 uint8_t max_concurrent_dev_spin_up; ··· 241 255 } phys[SCI_MAX_PHYS]; 242 256 } __attribute__ ((packed)); 243 257 244 - /* XXX kill this union */ 245 - union scic_oem_parameters { 246 - /** 247 - * This field specifies the OEM parameters specific to the 248 - * Storage Controller Unit (SCU) Driver Standard (SDS) version 249 - * 1. 250 - */ 251 - struct scic_sds_oem_params sds1; 252 - }; 253 - 254 258 struct isci_orom { 255 259 struct sci_bios_oem_param_block_hdr hdr; 256 - struct scic_sds_oem_params ctrl[SCI_MAX_CONTROLLERS]; 260 + struct sci_oem_params ctrl[SCI_MAX_CONTROLLERS]; 257 261 } __attribute__ ((packed)); 258 262 259 263 #endif
+150 -150
drivers/scsi/isci/remote_device.c
··· 68 68 * @isci_host: This parameter specifies the isci host object. 69 69 * @isci_device: This parameter specifies the remote device 70 70 * 71 - * scic_lock is held on entrance to this function. 71 + * sci_lock is held on entrance to this function. 72 72 */ 73 73 static void isci_remote_device_not_ready(struct isci_host *ihost, 74 74 struct isci_remote_device *idev, u32 reason) ··· 92 92 "%s: isci_device = %p request = %p\n", 93 93 __func__, idev, ireq); 94 94 95 - scic_controller_terminate_request(ihost, 95 + sci_controller_terminate_request(ihost, 96 96 idev, 97 97 ireq); 98 98 } ··· 133 133 sci_change_state(&idev->sm, SCI_DEV_STOPPED); 134 134 } 135 135 136 - static enum sci_status scic_sds_remote_device_terminate_requests(struct isci_remote_device *idev) 136 + static enum sci_status sci_remote_device_terminate_requests(struct isci_remote_device *idev) 137 137 { 138 138 struct isci_host *ihost = idev->owning_port->owning_controller; 139 139 enum sci_status status = SCI_SUCCESS; ··· 147 147 ireq->target_device != idev) 148 148 continue; 149 149 150 - s = scic_controller_terminate_request(ihost, idev, ireq); 150 + s = sci_controller_terminate_request(ihost, idev, ireq); 151 151 if (s != SCI_SUCCESS) 152 152 status = s; 153 153 } ··· 155 155 return status; 156 156 } 157 157 158 - enum sci_status scic_remote_device_stop(struct isci_remote_device *idev, 158 + enum sci_status sci_remote_device_stop(struct isci_remote_device *idev, 159 159 u32 timeout) 160 160 { 161 161 struct sci_base_state_machine *sm = &idev->sm; 162 - enum scic_sds_remote_device_states state = sm->current_state_id; 162 + enum sci_remote_device_states state = sm->current_state_id; 163 163 164 164 switch (state) { 165 165 case SCI_DEV_INITIAL: ··· 174 174 case SCI_DEV_STARTING: 175 175 /* device not started so there had better be no requests */ 176 176 BUG_ON(idev->started_request_count != 0); 177 - scic_sds_remote_node_context_destruct(&idev->rnc, 177 + sci_remote_node_context_destruct(&idev->rnc, 178 178 rnc_destruct_done, idev); 179 179 /* Transition to the stopping state and wait for the 180 180 * remote node to complete being posted and invalidated. ··· 191 191 case SCI_SMP_DEV_CMD: 192 192 sci_change_state(sm, SCI_DEV_STOPPING); 193 193 if (idev->started_request_count == 0) { 194 - scic_sds_remote_node_context_destruct(&idev->rnc, 194 + sci_remote_node_context_destruct(&idev->rnc, 195 195 rnc_destruct_done, idev); 196 196 return SCI_SUCCESS; 197 197 } else 198 - return scic_sds_remote_device_terminate_requests(idev); 198 + return sci_remote_device_terminate_requests(idev); 199 199 break; 200 200 case SCI_DEV_STOPPING: 201 201 /* All requests should have been terminated, but if there is an 202 202 * attempt to stop a device already in the stopping state, then 203 203 * try again to terminate. 204 204 */ 205 - return scic_sds_remote_device_terminate_requests(idev); 205 + return sci_remote_device_terminate_requests(idev); 206 206 case SCI_DEV_RESETTING: 207 207 sci_change_state(sm, SCI_DEV_STOPPING); 208 208 return SCI_SUCCESS; 209 209 } 210 210 } 211 211 212 - enum sci_status scic_remote_device_reset(struct isci_remote_device *idev) 212 + enum sci_status sci_remote_device_reset(struct isci_remote_device *idev) 213 213 { 214 214 struct sci_base_state_machine *sm = &idev->sm; 215 - enum scic_sds_remote_device_states state = sm->current_state_id; 215 + enum sci_remote_device_states state = sm->current_state_id; 216 216 217 217 switch (state) { 218 218 case SCI_DEV_INITIAL: ··· 239 239 } 240 240 } 241 241 242 - enum sci_status scic_remote_device_reset_complete(struct isci_remote_device *idev) 242 + enum sci_status sci_remote_device_reset_complete(struct isci_remote_device *idev) 243 243 { 244 244 struct sci_base_state_machine *sm = &idev->sm; 245 - enum scic_sds_remote_device_states state = sm->current_state_id; 245 + enum sci_remote_device_states state = sm->current_state_id; 246 246 247 247 if (state != SCI_DEV_RESETTING) { 248 248 dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n", ··· 254 254 return SCI_SUCCESS; 255 255 } 256 256 257 - enum sci_status scic_sds_remote_device_suspend(struct isci_remote_device *idev, 257 + enum sci_status sci_remote_device_suspend(struct isci_remote_device *idev, 258 258 u32 suspend_type) 259 259 { 260 260 struct sci_base_state_machine *sm = &idev->sm; 261 - enum scic_sds_remote_device_states state = sm->current_state_id; 261 + enum sci_remote_device_states state = sm->current_state_id; 262 262 263 263 if (state != SCI_STP_DEV_CMD) { 264 264 dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n", ··· 266 266 return SCI_FAILURE_INVALID_STATE; 267 267 } 268 268 269 - return scic_sds_remote_node_context_suspend(&idev->rnc, 269 + return sci_remote_node_context_suspend(&idev->rnc, 270 270 suspend_type, NULL, NULL); 271 271 } 272 272 273 - enum sci_status scic_sds_remote_device_frame_handler(struct isci_remote_device *idev, 273 + enum sci_status sci_remote_device_frame_handler(struct isci_remote_device *idev, 274 274 u32 frame_index) 275 275 { 276 276 struct sci_base_state_machine *sm = &idev->sm; 277 - enum scic_sds_remote_device_states state = sm->current_state_id; 277 + enum sci_remote_device_states state = sm->current_state_id; 278 278 struct isci_host *ihost = idev->owning_port->owning_controller; 279 279 enum sci_status status; 280 280 ··· 289 289 dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n", 290 290 __func__, state); 291 291 /* Return the frame back to the controller */ 292 - scic_sds_controller_release_frame(ihost, frame_index); 292 + sci_controller_release_frame(ihost, frame_index); 293 293 return SCI_FAILURE_INVALID_STATE; 294 294 case SCI_DEV_READY: 295 295 case SCI_STP_DEV_NCQ_ERROR: ··· 302 302 void *frame_header; 303 303 ssize_t word_cnt; 304 304 305 - status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control, 305 + status = sci_unsolicited_frame_control_get_header(&ihost->uf_control, 306 306 frame_index, 307 307 &frame_header); 308 308 if (status != SCI_SUCCESS) ··· 311 311 word_cnt = sizeof(hdr) / sizeof(u32); 312 312 sci_swab32_cpy(&hdr, frame_header, word_cnt); 313 313 314 - ireq = scic_request_by_tag(ihost, be16_to_cpu(hdr.tag)); 314 + ireq = sci_request_by_tag(ihost, be16_to_cpu(hdr.tag)); 315 315 if (ireq && ireq->target_device == idev) { 316 316 /* The IO request is now in charge of releasing the frame */ 317 - status = scic_sds_io_request_frame_handler(ireq, frame_index); 317 + status = sci_io_request_frame_handler(ireq, frame_index); 318 318 } else { 319 319 /* We could not map this tag to a valid IO 320 320 * request Just toss the frame and continue 321 321 */ 322 - scic_sds_controller_release_frame(ihost, frame_index); 322 + sci_controller_release_frame(ihost, frame_index); 323 323 } 324 324 break; 325 325 } 326 326 case SCI_STP_DEV_NCQ: { 327 327 struct dev_to_host_fis *hdr; 328 328 329 - status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control, 329 + status = sci_unsolicited_frame_control_get_header(&ihost->uf_control, 330 330 frame_index, 331 331 (void **)&hdr); 332 332 if (status != SCI_SUCCESS) ··· 349 349 } else 350 350 status = SCI_FAILURE; 351 351 352 - scic_sds_controller_release_frame(ihost, frame_index); 352 + sci_controller_release_frame(ihost, frame_index); 353 353 break; 354 354 } 355 355 case SCI_STP_DEV_CMD: ··· 358 358 * in this state. All unsolicited frames are forwarded to the io request 359 359 * object. 360 360 */ 361 - status = scic_sds_io_request_frame_handler(idev->working_request, frame_index); 361 + status = sci_io_request_frame_handler(idev->working_request, frame_index); 362 362 break; 363 363 } 364 364 ··· 369 369 { 370 370 371 371 struct sci_base_state_machine *sm = &idev->sm; 372 - enum scic_sds_remote_device_states state = sm->current_state_id; 372 + enum sci_remote_device_states state = sm->current_state_id; 373 373 374 374 switch (state) { 375 375 case SCI_DEV_READY: ··· 386 386 } 387 387 } 388 388 389 - enum sci_status scic_sds_remote_device_event_handler(struct isci_remote_device *idev, 389 + enum sci_status sci_remote_device_event_handler(struct isci_remote_device *idev, 390 390 u32 event_code) 391 391 { 392 392 struct sci_base_state_machine *sm = &idev->sm; 393 - enum scic_sds_remote_device_states state = sm->current_state_id; 393 + enum sci_remote_device_states state = sm->current_state_id; 394 394 enum sci_status status; 395 395 396 396 switch (scu_get_event_type(event_code)) { 397 397 case SCU_EVENT_TYPE_RNC_OPS_MISC: 398 398 case SCU_EVENT_TYPE_RNC_SUSPEND_TX: 399 399 case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX: 400 - status = scic_sds_remote_node_context_event_handler(&idev->rnc, event_code); 400 + status = sci_remote_node_context_event_handler(&idev->rnc, event_code); 401 401 break; 402 402 case SCU_EVENT_TYPE_PTX_SCHEDULE_EVENT: 403 403 if (scu_get_event_code(event_code) == SCU_EVENT_IT_NEXUS_TIMEOUT) { 404 404 status = SCI_SUCCESS; 405 405 406 406 /* Suspend the associated RNC */ 407 - scic_sds_remote_node_context_suspend(&idev->rnc, 407 + sci_remote_node_context_suspend(&idev->rnc, 408 408 SCI_SOFTWARE_SUSPENSION, 409 409 NULL, NULL); 410 410 ··· 439 439 */ 440 440 if (scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX || 441 441 scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX) 442 - status = scic_sds_remote_node_context_resume(&idev->rnc, NULL, NULL); 442 + status = sci_remote_node_context_resume(&idev->rnc, NULL, NULL); 443 443 } 444 444 445 445 return status; 446 446 } 447 447 448 - static void scic_sds_remote_device_start_request(struct isci_remote_device *idev, 448 + static void sci_remote_device_start_request(struct isci_remote_device *idev, 449 449 struct isci_request *ireq, 450 450 enum sci_status status) 451 451 { ··· 453 453 454 454 /* cleanup requests that failed after starting on the port */ 455 455 if (status != SCI_SUCCESS) 456 - scic_sds_port_complete_io(iport, idev, ireq); 456 + sci_port_complete_io(iport, idev, ireq); 457 457 else { 458 458 kref_get(&idev->kref); 459 - scic_sds_remote_device_increment_request_count(idev); 459 + sci_remote_device_increment_request_count(idev); 460 460 } 461 461 } 462 462 463 - enum sci_status scic_sds_remote_device_start_io(struct isci_host *ihost, 463 + enum sci_status sci_remote_device_start_io(struct isci_host *ihost, 464 464 struct isci_remote_device *idev, 465 465 struct isci_request *ireq) 466 466 { 467 467 struct sci_base_state_machine *sm = &idev->sm; 468 - enum scic_sds_remote_device_states state = sm->current_state_id; 468 + enum sci_remote_device_states state = sm->current_state_id; 469 469 struct isci_port *iport = idev->owning_port; 470 470 enum sci_status status; 471 471 ··· 488 488 * successful it will start the request for the port object then 489 489 * increment its own request count. 490 490 */ 491 - status = scic_sds_port_start_io(iport, idev, ireq); 491 + status = sci_port_start_io(iport, idev, ireq); 492 492 if (status != SCI_SUCCESS) 493 493 return status; 494 494 495 - status = scic_sds_remote_node_context_start_io(&idev->rnc, ireq); 495 + status = sci_remote_node_context_start_io(&idev->rnc, ireq); 496 496 if (status != SCI_SUCCESS) 497 497 break; 498 498 499 - status = scic_sds_request_start(ireq); 499 + status = sci_request_start(ireq); 500 500 break; 501 501 case SCI_STP_DEV_IDLE: { 502 502 /* handle the start io operation for a sata device that is in ··· 507 507 * If this is a softreset we may want to have a different 508 508 * substate. 509 509 */ 510 - enum scic_sds_remote_device_states new_state; 510 + enum sci_remote_device_states new_state; 511 511 struct sas_task *task = isci_request_access_task(ireq); 512 512 513 - status = scic_sds_port_start_io(iport, idev, ireq); 513 + status = sci_port_start_io(iport, idev, ireq); 514 514 if (status != SCI_SUCCESS) 515 515 return status; 516 516 517 - status = scic_sds_remote_node_context_start_io(&idev->rnc, ireq); 517 + status = sci_remote_node_context_start_io(&idev->rnc, ireq); 518 518 if (status != SCI_SUCCESS) 519 519 break; 520 520 521 - status = scic_sds_request_start(ireq); 521 + status = sci_request_start(ireq); 522 522 if (status != SCI_SUCCESS) 523 523 break; 524 524 ··· 535 535 struct sas_task *task = isci_request_access_task(ireq); 536 536 537 537 if (task->ata_task.use_ncq) { 538 - status = scic_sds_port_start_io(iport, idev, ireq); 538 + status = sci_port_start_io(iport, idev, ireq); 539 539 if (status != SCI_SUCCESS) 540 540 return status; 541 541 542 - status = scic_sds_remote_node_context_start_io(&idev->rnc, ireq); 542 + status = sci_remote_node_context_start_io(&idev->rnc, ireq); 543 543 if (status != SCI_SUCCESS) 544 544 break; 545 545 546 - status = scic_sds_request_start(ireq); 546 + status = sci_request_start(ireq); 547 547 } else 548 548 return SCI_FAILURE_INVALID_STATE; 549 549 break; ··· 551 551 case SCI_STP_DEV_AWAIT_RESET: 552 552 return SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED; 553 553 case SCI_SMP_DEV_IDLE: 554 - status = scic_sds_port_start_io(iport, idev, ireq); 554 + status = sci_port_start_io(iport, idev, ireq); 555 555 if (status != SCI_SUCCESS) 556 556 return status; 557 557 558 - status = scic_sds_remote_node_context_start_io(&idev->rnc, ireq); 558 + status = sci_remote_node_context_start_io(&idev->rnc, ireq); 559 559 if (status != SCI_SUCCESS) 560 560 break; 561 561 562 - status = scic_sds_request_start(ireq); 562 + status = sci_request_start(ireq); 563 563 if (status != SCI_SUCCESS) 564 564 break; 565 565 ··· 574 574 return SCI_FAILURE_INVALID_STATE; 575 575 } 576 576 577 - scic_sds_remote_device_start_request(idev, ireq, status); 577 + sci_remote_device_start_request(idev, ireq, status); 578 578 return status; 579 579 } 580 580 ··· 584 584 { 585 585 enum sci_status status; 586 586 587 - status = scic_sds_request_complete(ireq); 587 + status = sci_request_complete(ireq); 588 588 if (status != SCI_SUCCESS) 589 589 return status; 590 590 591 - status = scic_sds_port_complete_io(iport, idev, ireq); 591 + status = sci_port_complete_io(iport, idev, ireq); 592 592 if (status != SCI_SUCCESS) 593 593 return status; 594 594 595 - scic_sds_remote_device_decrement_request_count(idev); 595 + sci_remote_device_decrement_request_count(idev); 596 596 return status; 597 597 } 598 598 599 - enum sci_status scic_sds_remote_device_complete_io(struct isci_host *ihost, 599 + enum sci_status sci_remote_device_complete_io(struct isci_host *ihost, 600 600 struct isci_remote_device *idev, 601 601 struct isci_request *ireq) 602 602 { 603 603 struct sci_base_state_machine *sm = &idev->sm; 604 - enum scic_sds_remote_device_states state = sm->current_state_id; 604 + enum sci_remote_device_states state = sm->current_state_id; 605 605 struct isci_port *iport = idev->owning_port; 606 606 enum sci_status status; 607 607 ··· 636 636 * status of "DEVICE_RESET_REQUIRED", instead of "INVALID STATE". 637 637 */ 638 638 sci_change_state(sm, SCI_STP_DEV_AWAIT_RESET); 639 - } else if (scic_sds_remote_device_get_request_count(idev) == 0) 639 + } else if (sci_remote_device_get_request_count(idev) == 0) 640 640 sci_change_state(sm, SCI_STP_DEV_IDLE); 641 641 break; 642 642 case SCI_SMP_DEV_CMD: ··· 650 650 if (status != SCI_SUCCESS) 651 651 break; 652 652 653 - if (scic_sds_remote_device_get_request_count(idev) == 0) 654 - scic_sds_remote_node_context_destruct(&idev->rnc, 653 + if (sci_remote_device_get_request_count(idev) == 0) 654 + sci_remote_node_context_destruct(&idev->rnc, 655 655 rnc_destruct_done, 656 656 idev); 657 657 break; ··· 668 668 return status; 669 669 } 670 670 671 - static void scic_sds_remote_device_continue_request(void *dev) 671 + static void sci_remote_device_continue_request(void *dev) 672 672 { 673 673 struct isci_remote_device *idev = dev; 674 674 675 675 /* we need to check if this request is still valid to continue. */ 676 676 if (idev->working_request) 677 - scic_controller_continue_io(idev->working_request); 677 + sci_controller_continue_io(idev->working_request); 678 678 } 679 679 680 - enum sci_status scic_sds_remote_device_start_task(struct isci_host *ihost, 680 + enum sci_status sci_remote_device_start_task(struct isci_host *ihost, 681 681 struct isci_remote_device *idev, 682 682 struct isci_request *ireq) 683 683 { 684 684 struct sci_base_state_machine *sm = &idev->sm; 685 - enum scic_sds_remote_device_states state = sm->current_state_id; 685 + enum sci_remote_device_states state = sm->current_state_id; 686 686 struct isci_port *iport = idev->owning_port; 687 687 enum sci_status status; 688 688 ··· 705 705 case SCI_STP_DEV_NCQ: 706 706 case SCI_STP_DEV_NCQ_ERROR: 707 707 case SCI_STP_DEV_AWAIT_RESET: 708 - status = scic_sds_port_start_io(iport, idev, ireq); 708 + status = sci_port_start_io(iport, idev, ireq); 709 709 if (status != SCI_SUCCESS) 710 710 return status; 711 711 712 - status = scic_sds_remote_node_context_start_task(&idev->rnc, ireq); 712 + status = sci_remote_node_context_start_task(&idev->rnc, ireq); 713 713 if (status != SCI_SUCCESS) 714 714 goto out; 715 715 716 - status = scic_sds_request_start(ireq); 716 + status = sci_request_start(ireq); 717 717 if (status != SCI_SUCCESS) 718 718 goto out; 719 719 ··· 731 731 * the correct action when the remote node context is suspended 732 732 * and later resumed. 733 733 */ 734 - scic_sds_remote_node_context_suspend(&idev->rnc, 734 + sci_remote_node_context_suspend(&idev->rnc, 735 735 SCI_SOFTWARE_SUSPENSION, NULL, NULL); 736 - scic_sds_remote_node_context_resume(&idev->rnc, 737 - scic_sds_remote_device_continue_request, 736 + sci_remote_node_context_resume(&idev->rnc, 737 + sci_remote_device_continue_request, 738 738 idev); 739 739 740 740 out: 741 - scic_sds_remote_device_start_request(idev, ireq, status); 741 + sci_remote_device_start_request(idev, ireq, status); 742 742 /* We need to let the controller start request handler know that 743 743 * it can't post TC yet. We will provide a callback function to 744 744 * post TC when RNC gets resumed. 745 745 */ 746 746 return SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS; 747 747 case SCI_DEV_READY: 748 - status = scic_sds_port_start_io(iport, idev, ireq); 748 + status = sci_port_start_io(iport, idev, ireq); 749 749 if (status != SCI_SUCCESS) 750 750 return status; 751 751 752 - status = scic_sds_remote_node_context_start_task(&idev->rnc, ireq); 752 + status = sci_remote_node_context_start_task(&idev->rnc, ireq); 753 753 if (status != SCI_SUCCESS) 754 754 break; 755 755 756 - status = scic_sds_request_start(ireq); 756 + status = sci_request_start(ireq); 757 757 break; 758 758 } 759 - scic_sds_remote_device_start_request(idev, ireq, status); 759 + sci_remote_device_start_request(idev, ireq, status); 760 760 761 761 return status; 762 762 } ··· 769 769 * This method takes the request and bulids an appropriate SCU context for the 770 770 * request and then requests the controller to post the request. none 771 771 */ 772 - void scic_sds_remote_device_post_request( 772 + void sci_remote_device_post_request( 773 773 struct isci_remote_device *idev, 774 774 u32 request) 775 775 { 776 776 u32 context; 777 777 778 - context = scic_sds_remote_device_build_command_context(idev, request); 778 + context = sci_remote_device_build_command_context(idev, request); 779 779 780 - scic_sds_controller_post_request( 781 - scic_sds_remote_device_get_controller(idev), 780 + sci_controller_post_request( 781 + sci_remote_device_get_controller(idev), 782 782 context 783 783 ); 784 784 } ··· 798 798 sci_change_state(&idev->sm, SCI_DEV_READY); 799 799 } 800 800 801 - static void scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(void *_dev) 801 + static void sci_stp_remote_device_ready_idle_substate_resume_complete_handler(void *_dev) 802 802 { 803 803 struct isci_remote_device *idev = _dev; 804 804 struct isci_host *ihost = idev->owning_port->owning_controller; ··· 810 810 isci_remote_device_ready(ihost, idev); 811 811 } 812 812 813 - static void scic_sds_remote_device_initial_state_enter(struct sci_base_state_machine *sm) 813 + static void sci_remote_device_initial_state_enter(struct sci_base_state_machine *sm) 814 814 { 815 815 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 816 816 ··· 819 819 } 820 820 821 821 /** 822 - * scic_remote_device_destruct() - free remote node context and destruct 822 + * sci_remote_device_destruct() - free remote node context and destruct 823 823 * @remote_device: This parameter specifies the remote device to be destructed. 824 824 * 825 825 * Remote device objects are a limited resource. As such, they must be ··· 831 831 * device isn't valid (e.g. it's already been destoryed, the handle isn't 832 832 * valid, etc.). 833 833 */ 834 - static enum sci_status scic_remote_device_destruct(struct isci_remote_device *idev) 834 + static enum sci_status sci_remote_device_destruct(struct isci_remote_device *idev) 835 835 { 836 836 struct sci_base_state_machine *sm = &idev->sm; 837 - enum scic_sds_remote_device_states state = sm->current_state_id; 837 + enum sci_remote_device_states state = sm->current_state_id; 838 838 struct isci_host *ihost; 839 839 840 840 if (state != SCI_DEV_STOPPED) { ··· 844 844 } 845 845 846 846 ihost = idev->owning_port->owning_controller; 847 - scic_sds_controller_free_remote_node_context(ihost, idev, 847 + sci_controller_free_remote_node_context(ihost, idev, 848 848 idev->rnc.remote_node_index); 849 849 idev->rnc.remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX; 850 850 sci_change_state(sm, SCI_DEV_FINAL); ··· 869 869 * io requests in process */ 870 870 BUG_ON(!list_empty(&idev->reqs_in_process)); 871 871 872 - scic_remote_device_destruct(idev); 872 + sci_remote_device_destruct(idev); 873 873 list_del_init(&idev->node); 874 874 isci_put_device(idev); 875 875 } 876 876 877 - static void scic_sds_remote_device_stopped_state_enter(struct sci_base_state_machine *sm) 877 + static void sci_remote_device_stopped_state_enter(struct sci_base_state_machine *sm) 878 878 { 879 879 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 880 880 struct isci_host *ihost = idev->owning_port->owning_controller; ··· 887 887 if (prev_state == SCI_DEV_STOPPING) 888 888 isci_remote_device_deconstruct(ihost, idev); 889 889 890 - scic_sds_controller_remote_device_stopped(ihost, idev); 890 + sci_controller_remote_device_stopped(ihost, idev); 891 891 } 892 892 893 - static void scic_sds_remote_device_starting_state_enter(struct sci_base_state_machine *sm) 893 + static void sci_remote_device_starting_state_enter(struct sci_base_state_machine *sm) 894 894 { 895 895 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 896 - struct isci_host *ihost = scic_sds_remote_device_get_controller(idev); 896 + struct isci_host *ihost = sci_remote_device_get_controller(idev); 897 897 898 898 isci_remote_device_not_ready(ihost, idev, 899 899 SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED); 900 900 } 901 901 902 - static void scic_sds_remote_device_ready_state_enter(struct sci_base_state_machine *sm) 902 + static void sci_remote_device_ready_state_enter(struct sci_base_state_machine *sm) 903 903 { 904 904 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 905 905 struct isci_host *ihost = idev->owning_port->owning_controller; ··· 913 913 isci_remote_device_ready(ihost, idev); 914 914 } 915 915 916 - static void scic_sds_remote_device_ready_state_exit(struct sci_base_state_machine *sm) 916 + static void sci_remote_device_ready_state_exit(struct sci_base_state_machine *sm) 917 917 { 918 918 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 919 919 struct domain_device *dev = idev->domain_dev; ··· 926 926 } 927 927 } 928 928 929 - static void scic_sds_remote_device_resetting_state_enter(struct sci_base_state_machine *sm) 929 + static void sci_remote_device_resetting_state_enter(struct sci_base_state_machine *sm) 930 930 { 931 931 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 932 932 933 - scic_sds_remote_node_context_suspend( 933 + sci_remote_node_context_suspend( 934 934 &idev->rnc, SCI_SOFTWARE_SUSPENSION, NULL, NULL); 935 935 } 936 936 937 - static void scic_sds_remote_device_resetting_state_exit(struct sci_base_state_machine *sm) 937 + static void sci_remote_device_resetting_state_exit(struct sci_base_state_machine *sm) 938 938 { 939 939 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 940 940 941 - scic_sds_remote_node_context_resume(&idev->rnc, NULL, NULL); 941 + sci_remote_node_context_resume(&idev->rnc, NULL, NULL); 942 942 } 943 943 944 - static void scic_sds_stp_remote_device_ready_idle_substate_enter(struct sci_base_state_machine *sm) 944 + static void sci_stp_remote_device_ready_idle_substate_enter(struct sci_base_state_machine *sm) 945 945 { 946 946 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 947 947 948 948 idev->working_request = NULL; 949 - if (scic_sds_remote_node_context_is_ready(&idev->rnc)) { 949 + if (sci_remote_node_context_is_ready(&idev->rnc)) { 950 950 /* 951 951 * Since the RNC is ready, it's alright to finish completion 952 952 * processing (e.g. signal the remote device is ready). */ 953 - scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(idev); 953 + sci_stp_remote_device_ready_idle_substate_resume_complete_handler(idev); 954 954 } else { 955 - scic_sds_remote_node_context_resume(&idev->rnc, 956 - scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler, 955 + sci_remote_node_context_resume(&idev->rnc, 956 + sci_stp_remote_device_ready_idle_substate_resume_complete_handler, 957 957 idev); 958 958 } 959 959 } 960 960 961 - static void scic_sds_stp_remote_device_ready_cmd_substate_enter(struct sci_base_state_machine *sm) 961 + static void sci_stp_remote_device_ready_cmd_substate_enter(struct sci_base_state_machine *sm) 962 962 { 963 963 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 964 - struct isci_host *ihost = scic_sds_remote_device_get_controller(idev); 964 + struct isci_host *ihost = sci_remote_device_get_controller(idev); 965 965 966 966 BUG_ON(idev->working_request == NULL); 967 967 ··· 969 969 SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED); 970 970 } 971 971 972 - static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(struct sci_base_state_machine *sm) 972 + static void sci_stp_remote_device_ready_ncq_error_substate_enter(struct sci_base_state_machine *sm) 973 973 { 974 974 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 975 - struct isci_host *ihost = scic_sds_remote_device_get_controller(idev); 975 + struct isci_host *ihost = sci_remote_device_get_controller(idev); 976 976 977 977 if (idev->not_ready_reason == SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED) 978 978 isci_remote_device_not_ready(ihost, idev, 979 979 idev->not_ready_reason); 980 980 } 981 981 982 - static void scic_sds_smp_remote_device_ready_idle_substate_enter(struct sci_base_state_machine *sm) 982 + static void sci_smp_remote_device_ready_idle_substate_enter(struct sci_base_state_machine *sm) 983 983 { 984 984 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 985 - struct isci_host *ihost = scic_sds_remote_device_get_controller(idev); 985 + struct isci_host *ihost = sci_remote_device_get_controller(idev); 986 986 987 987 isci_remote_device_ready(ihost, idev); 988 988 } 989 989 990 - static void scic_sds_smp_remote_device_ready_cmd_substate_enter(struct sci_base_state_machine *sm) 990 + static void sci_smp_remote_device_ready_cmd_substate_enter(struct sci_base_state_machine *sm) 991 991 { 992 992 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 993 - struct isci_host *ihost = scic_sds_remote_device_get_controller(idev); 993 + struct isci_host *ihost = sci_remote_device_get_controller(idev); 994 994 995 995 BUG_ON(idev->working_request == NULL); 996 996 ··· 998 998 SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED); 999 999 } 1000 1000 1001 - static void scic_sds_smp_remote_device_ready_cmd_substate_exit(struct sci_base_state_machine *sm) 1001 + static void sci_smp_remote_device_ready_cmd_substate_exit(struct sci_base_state_machine *sm) 1002 1002 { 1003 1003 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 1004 1004 1005 1005 idev->working_request = NULL; 1006 1006 } 1007 1007 1008 - static const struct sci_base_state scic_sds_remote_device_state_table[] = { 1008 + static const struct sci_base_state sci_remote_device_state_table[] = { 1009 1009 [SCI_DEV_INITIAL] = { 1010 - .enter_state = scic_sds_remote_device_initial_state_enter, 1010 + .enter_state = sci_remote_device_initial_state_enter, 1011 1011 }, 1012 1012 [SCI_DEV_STOPPED] = { 1013 - .enter_state = scic_sds_remote_device_stopped_state_enter, 1013 + .enter_state = sci_remote_device_stopped_state_enter, 1014 1014 }, 1015 1015 [SCI_DEV_STARTING] = { 1016 - .enter_state = scic_sds_remote_device_starting_state_enter, 1016 + .enter_state = sci_remote_device_starting_state_enter, 1017 1017 }, 1018 1018 [SCI_DEV_READY] = { 1019 - .enter_state = scic_sds_remote_device_ready_state_enter, 1020 - .exit_state = scic_sds_remote_device_ready_state_exit 1019 + .enter_state = sci_remote_device_ready_state_enter, 1020 + .exit_state = sci_remote_device_ready_state_exit 1021 1021 }, 1022 1022 [SCI_STP_DEV_IDLE] = { 1023 - .enter_state = scic_sds_stp_remote_device_ready_idle_substate_enter, 1023 + .enter_state = sci_stp_remote_device_ready_idle_substate_enter, 1024 1024 }, 1025 1025 [SCI_STP_DEV_CMD] = { 1026 - .enter_state = scic_sds_stp_remote_device_ready_cmd_substate_enter, 1026 + .enter_state = sci_stp_remote_device_ready_cmd_substate_enter, 1027 1027 }, 1028 1028 [SCI_STP_DEV_NCQ] = { }, 1029 1029 [SCI_STP_DEV_NCQ_ERROR] = { 1030 - .enter_state = scic_sds_stp_remote_device_ready_ncq_error_substate_enter, 1030 + .enter_state = sci_stp_remote_device_ready_ncq_error_substate_enter, 1031 1031 }, 1032 1032 [SCI_STP_DEV_AWAIT_RESET] = { }, 1033 1033 [SCI_SMP_DEV_IDLE] = { 1034 - .enter_state = scic_sds_smp_remote_device_ready_idle_substate_enter, 1034 + .enter_state = sci_smp_remote_device_ready_idle_substate_enter, 1035 1035 }, 1036 1036 [SCI_SMP_DEV_CMD] = { 1037 - .enter_state = scic_sds_smp_remote_device_ready_cmd_substate_enter, 1038 - .exit_state = scic_sds_smp_remote_device_ready_cmd_substate_exit, 1037 + .enter_state = sci_smp_remote_device_ready_cmd_substate_enter, 1038 + .exit_state = sci_smp_remote_device_ready_cmd_substate_exit, 1039 1039 }, 1040 1040 [SCI_DEV_STOPPING] = { }, 1041 1041 [SCI_DEV_FAILED] = { }, 1042 1042 [SCI_DEV_RESETTING] = { 1043 - .enter_state = scic_sds_remote_device_resetting_state_enter, 1044 - .exit_state = scic_sds_remote_device_resetting_state_exit 1043 + .enter_state = sci_remote_device_resetting_state_enter, 1044 + .exit_state = sci_remote_device_resetting_state_exit 1045 1045 }, 1046 1046 [SCI_DEV_FINAL] = { }, 1047 1047 }; 1048 1048 1049 1049 /** 1050 - * scic_remote_device_construct() - common construction 1050 + * sci_remote_device_construct() - common construction 1051 1051 * @sci_port: SAS/SATA port through which this device is accessed. 1052 1052 * @sci_dev: remote device to construct 1053 1053 * 1054 1054 * This routine just performs benign initialization and does not 1055 1055 * allocate the remote_node_context which is left to 1056 - * scic_remote_device_[de]a_construct(). scic_remote_device_destruct() 1056 + * sci_remote_device_[de]a_construct(). sci_remote_device_destruct() 1057 1057 * frees the remote_node_context(s) for the device. 1058 1058 */ 1059 - static void scic_remote_device_construct(struct isci_port *iport, 1059 + static void sci_remote_device_construct(struct isci_port *iport, 1060 1060 struct isci_remote_device *idev) 1061 1061 { 1062 1062 idev->owning_port = iport; 1063 1063 idev->started_request_count = 0; 1064 1064 1065 - sci_init_sm(&idev->sm, scic_sds_remote_device_state_table, SCI_DEV_INITIAL); 1065 + sci_init_sm(&idev->sm, sci_remote_device_state_table, SCI_DEV_INITIAL); 1066 1066 1067 - scic_sds_remote_node_context_construct(&idev->rnc, 1067 + sci_remote_node_context_construct(&idev->rnc, 1068 1068 SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX); 1069 1069 } 1070 1070 1071 1071 /** 1072 - * scic_remote_device_da_construct() - construct direct attached device. 1072 + * sci_remote_device_da_construct() - construct direct attached device. 1073 1073 * 1074 1074 * The information (e.g. IAF, Signature FIS, etc.) necessary to build 1075 1075 * the device is known to the SCI Core since it is contained in the 1076 - * scic_phy object. Remote node context(s) is/are a global resource 1077 - * allocated by this routine, freed by scic_remote_device_destruct(). 1076 + * sci_phy object. Remote node context(s) is/are a global resource 1077 + * allocated by this routine, freed by sci_remote_device_destruct(). 1078 1078 * 1079 1079 * Returns: 1080 1080 * SCI_FAILURE_DEVICE_EXISTS - device has already been constructed. ··· 1082 1082 * sata-only controller instance. 1083 1083 * SCI_FAILURE_INSUFFICIENT_RESOURCES - remote node contexts exhausted. 1084 1084 */ 1085 - static enum sci_status scic_remote_device_da_construct(struct isci_port *iport, 1085 + static enum sci_status sci_remote_device_da_construct(struct isci_port *iport, 1086 1086 struct isci_remote_device *idev) 1087 1087 { 1088 1088 enum sci_status status; 1089 1089 struct domain_device *dev = idev->domain_dev; 1090 1090 1091 - scic_remote_device_construct(iport, idev); 1091 + sci_remote_device_construct(iport, idev); 1092 1092 1093 1093 /* 1094 1094 * This information is request to determine how many remote node context 1095 1095 * entries will be needed to store the remote node. 1096 1096 */ 1097 1097 idev->is_direct_attached = true; 1098 - status = scic_sds_controller_allocate_remote_node_context(iport->owning_controller, 1098 + status = sci_controller_allocate_remote_node_context(iport->owning_controller, 1099 1099 idev, 1100 1100 &idev->rnc.remote_node_index); 1101 1101 ··· 1108 1108 else 1109 1109 return SCI_FAILURE_UNSUPPORTED_PROTOCOL; 1110 1110 1111 - idev->connection_rate = scic_sds_port_get_max_allowed_speed(iport); 1111 + idev->connection_rate = sci_port_get_max_allowed_speed(iport); 1112 1112 1113 1113 /* / @todo Should I assign the port width by reading all of the phys on the port? */ 1114 1114 idev->device_port_width = 1; ··· 1117 1117 } 1118 1118 1119 1119 /** 1120 - * scic_remote_device_ea_construct() - construct expander attached device 1120 + * sci_remote_device_ea_construct() - construct expander attached device 1121 1121 * 1122 1122 * Remote node context(s) is/are a global resource allocated by this 1123 - * routine, freed by scic_remote_device_destruct(). 1123 + * routine, freed by sci_remote_device_destruct(). 1124 1124 * 1125 1125 * Returns: 1126 1126 * SCI_FAILURE_DEVICE_EXISTS - device has already been constructed. ··· 1128 1128 * sata-only controller instance. 1129 1129 * SCI_FAILURE_INSUFFICIENT_RESOURCES - remote node contexts exhausted. 1130 1130 */ 1131 - static enum sci_status scic_remote_device_ea_construct(struct isci_port *iport, 1131 + static enum sci_status sci_remote_device_ea_construct(struct isci_port *iport, 1132 1132 struct isci_remote_device *idev) 1133 1133 { 1134 1134 struct domain_device *dev = idev->domain_dev; 1135 1135 enum sci_status status; 1136 1136 1137 - scic_remote_device_construct(iport, idev); 1137 + sci_remote_device_construct(iport, idev); 1138 1138 1139 - status = scic_sds_controller_allocate_remote_node_context(iport->owning_controller, 1139 + status = sci_controller_allocate_remote_node_context(iport->owning_controller, 1140 1140 idev, 1141 1141 &idev->rnc.remote_node_index); 1142 1142 if (status != SCI_SUCCESS) ··· 1155 1155 * connection the logical link rate is that same as the 1156 1156 * physical. Furthermore, the SAS-2 and SAS-1.1 fields overlay 1157 1157 * one another, so this code works for both situations. */ 1158 - idev->connection_rate = min_t(u16, scic_sds_port_get_max_allowed_speed(iport), 1158 + idev->connection_rate = min_t(u16, sci_port_get_max_allowed_speed(iport), 1159 1159 dev->linkrate); 1160 1160 1161 1161 /* / @todo Should I assign the port width by reading all of the phys on the port? */ ··· 1165 1165 } 1166 1166 1167 1167 /** 1168 - * scic_remote_device_start() - This method will start the supplied remote 1168 + * sci_remote_device_start() - This method will start the supplied remote 1169 1169 * device. This method enables normal IO requests to flow through to the 1170 1170 * remote device. 1171 1171 * @remote_device: This parameter specifies the device to be started. ··· 1177 1177 * SCI_FAILURE_INVALID_PHY This value is returned if the user attempts to start 1178 1178 * the device when there have been no phys added to it. 1179 1179 */ 1180 - static enum sci_status scic_remote_device_start(struct isci_remote_device *idev, 1180 + static enum sci_status sci_remote_device_start(struct isci_remote_device *idev, 1181 1181 u32 timeout) 1182 1182 { 1183 1183 struct sci_base_state_machine *sm = &idev->sm; 1184 - enum scic_sds_remote_device_states state = sm->current_state_id; 1184 + enum sci_remote_device_states state = sm->current_state_id; 1185 1185 enum sci_status status; 1186 1186 1187 1187 if (state != SCI_DEV_STOPPED) { ··· 1190 1190 return SCI_FAILURE_INVALID_STATE; 1191 1191 } 1192 1192 1193 - status = scic_sds_remote_node_context_resume(&idev->rnc, 1193 + status = sci_remote_node_context_resume(&idev->rnc, 1194 1194 remote_device_resume_done, 1195 1195 idev); 1196 1196 if (status != SCI_SUCCESS) ··· 1209 1209 enum sci_status status; 1210 1210 1211 1211 if (dev->parent && dev_is_expander(dev->parent)) 1212 - status = scic_remote_device_ea_construct(iport, idev); 1212 + status = sci_remote_device_ea_construct(iport, idev); 1213 1213 else 1214 - status = scic_remote_device_da_construct(iport, idev); 1214 + status = sci_remote_device_da_construct(iport, idev); 1215 1215 1216 1216 if (status != SCI_SUCCESS) { 1217 1217 dev_dbg(&ihost->pdev->dev, "%s: construct failed: %d\n", ··· 1221 1221 } 1222 1222 1223 1223 /* start the device. */ 1224 - status = scic_remote_device_start(idev, ISCI_REMOTE_DEVICE_START_TIMEOUT); 1224 + status = sci_remote_device_start(idev, ISCI_REMOTE_DEVICE_START_TIMEOUT); 1225 1225 1226 1226 if (status != SCI_SUCCESS) 1227 1227 dev_warn(&ihost->pdev->dev, "remote device start failed: %d\n", ··· 1322 1322 set_bit(IDEV_STOP_PENDING, &idev->flags); 1323 1323 1324 1324 spin_lock_irqsave(&ihost->scic_lock, flags); 1325 - status = scic_remote_device_stop(idev, 50); 1325 + status = sci_remote_device_stop(idev, 50); 1326 1326 spin_unlock_irqrestore(&ihost->scic_lock, flags); 1327 1327 1328 1328 /* Wait for the stop complete callback. */
+43 -47
drivers/scsi/isci/remote_device.h
··· 61 61 #include "remote_node_context.h" 62 62 #include "port.h" 63 63 64 - enum scic_remote_device_not_ready_reason_code { 64 + enum sci_remote_device_not_ready_reason_code { 65 65 SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED, 66 66 SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED, 67 67 SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED, ··· 97 97 enum sas_linkrate connection_rate; 98 98 bool is_direct_attached; 99 99 struct isci_port *owning_port; 100 - struct scic_sds_remote_node_context rnc; 100 + struct sci_remote_node_context rnc; 101 101 /* XXX unify with device reference counting and delete */ 102 102 u32 started_request_count; 103 103 struct isci_request *working_request; ··· 106 106 107 107 #define ISCI_REMOTE_DEVICE_START_TIMEOUT 5000 108 108 109 - /* device reference routines must be called under scic_lock */ 109 + /* device reference routines must be called under sci_lock */ 110 110 static inline struct isci_remote_device *isci_lookup_device(struct domain_device *dev) 111 111 { 112 112 struct isci_remote_device *idev = dev->lldd_dev; ··· 137 137 void isci_device_clear_reset_pending(struct isci_host *ihost, 138 138 struct isci_remote_device *idev); 139 139 /** 140 - * scic_remote_device_stop() - This method will stop both transmission and 140 + * sci_remote_device_stop() - This method will stop both transmission and 141 141 * reception of link activity for the supplied remote device. This method 142 142 * disables normal IO requests from flowing through to the remote device. 143 143 * @remote_device: This parameter specifies the device to be stopped. ··· 148 148 * This value is returned if the transmission and reception for the device was 149 149 * successfully stopped. 150 150 */ 151 - enum sci_status scic_remote_device_stop( 151 + enum sci_status sci_remote_device_stop( 152 152 struct isci_remote_device *idev, 153 153 u32 timeout); 154 154 155 155 /** 156 - * scic_remote_device_reset() - This method will reset the device making it 156 + * sci_remote_device_reset() - This method will reset the device making it 157 157 * ready for operation. This method must be called anytime the device is 158 158 * reset either through a SMP phy control or a port hard reset request. 159 159 * @remote_device: This parameter specifies the device to be reset. ··· 164 164 * was accepted. SCI_SUCCESS This value is returned if the device reset is 165 165 * started. 166 166 */ 167 - enum sci_status scic_remote_device_reset( 167 + enum sci_status sci_remote_device_reset( 168 168 struct isci_remote_device *idev); 169 169 170 170 /** 171 - * scic_remote_device_reset_complete() - This method informs the device object 171 + * sci_remote_device_reset_complete() - This method informs the device object 172 172 * that the reset operation is complete and the device can resume operation 173 173 * again. 174 174 * @remote_device: This parameter specifies the device which is to be informed ··· 177 177 * An indication that the device is resuming operation. SCI_SUCCESS the device 178 178 * is resuming operation. 179 179 */ 180 - enum sci_status scic_remote_device_reset_complete( 180 + enum sci_status sci_remote_device_reset_complete( 181 181 struct isci_remote_device *idev); 182 182 183 - #define scic_remote_device_is_atapi(device_handle) false 184 - 185 183 /** 186 - * enum scic_sds_remote_device_states - This enumeration depicts all the states 184 + * enum sci_remote_device_states - This enumeration depicts all the states 187 185 * for the common remote device state machine. 188 186 * 189 187 * 190 188 */ 191 - enum scic_sds_remote_device_states { 189 + enum sci_remote_device_states { 192 190 /** 193 191 * Simply the initial state for the base remote device state machine. 194 192 */ ··· 291 293 SCI_DEV_FINAL, 292 294 }; 293 295 294 - static inline struct isci_remote_device *rnc_to_dev(struct scic_sds_remote_node_context *rnc) 296 + static inline struct isci_remote_device *rnc_to_dev(struct sci_remote_node_context *rnc) 295 297 { 296 298 struct isci_remote_device *idev; 297 299 ··· 306 308 } 307 309 308 310 /** 309 - * scic_sds_remote_device_increment_request_count() - 311 + * sci_remote_device_increment_request_count() - 310 312 * 311 313 * This macro incrments the request count for this device 312 314 */ 313 - #define scic_sds_remote_device_increment_request_count(idev) \ 315 + #define sci_remote_device_increment_request_count(idev) \ 314 316 ((idev)->started_request_count++) 315 317 316 318 /** 317 - * scic_sds_remote_device_decrement_request_count() - 319 + * sci_remote_device_decrement_request_count() - 318 320 * 319 321 * This macro decrements the request count for this device. This count will 320 322 * never decrment past 0. 321 323 */ 322 - #define scic_sds_remote_device_decrement_request_count(idev) \ 324 + #define sci_remote_device_decrement_request_count(idev) \ 323 325 ((idev)->started_request_count > 0 ? \ 324 326 (idev)->started_request_count-- : 0) 325 327 326 328 /** 327 - * scic_sds_remote_device_get_request_count() - 329 + * sci_remote_device_get_request_count() - 328 330 * 329 331 * This is a helper macro to return the current device request count. 330 332 */ 331 - #define scic_sds_remote_device_get_request_count(idev) \ 333 + #define sci_remote_device_get_request_count(idev) \ 332 334 ((idev)->started_request_count) 333 335 334 336 /** 335 - * scic_sds_remote_device_get_controller() - 337 + * sci_remote_device_get_controller() - 336 338 * 337 339 * This macro returns the controller object that contains this device object 338 340 */ 339 - #define scic_sds_remote_device_get_controller(idev) \ 340 - scic_sds_port_get_controller(scic_sds_remote_device_get_port(idev)) 341 + #define sci_remote_device_get_controller(idev) \ 342 + sci_port_get_controller(sci_remote_device_get_port(idev)) 341 343 342 344 /** 343 - * scic_sds_remote_device_get_port() - 345 + * sci_remote_device_get_port() - 344 346 * 345 347 * This macro returns the owning port of this device 346 348 */ 347 - #define scic_sds_remote_device_get_port(idev) \ 349 + #define sci_remote_device_get_port(idev) \ 348 350 ((idev)->owning_port) 349 351 350 352 /** 351 - * scic_sds_remote_device_get_controller_peg() - 353 + * sci_remote_device_get_controller_peg() - 352 354 * 353 355 * This macro returns the controllers protocol engine group 354 356 */ 355 - #define scic_sds_remote_device_get_controller_peg(idev) \ 357 + #define sci_remote_device_get_controller_peg(idev) \ 356 358 (\ 357 - scic_sds_controller_get_protocol_engine_group(\ 358 - scic_sds_port_get_controller(\ 359 - scic_sds_remote_device_get_port(idev) \ 359 + sci_controller_get_protocol_engine_group(\ 360 + sci_port_get_controller(\ 361 + sci_remote_device_get_port(idev) \ 360 362 ) \ 361 363 ) \ 362 364 ) 363 365 364 366 /** 365 - * scic_sds_remote_device_get_index() - 367 + * sci_remote_device_get_index() - 366 368 * 367 369 * This macro returns the remote node index for this device object 368 370 */ 369 - #define scic_sds_remote_device_get_index(idev) \ 371 + #define sci_remote_device_get_index(idev) \ 370 372 ((idev)->rnc.remote_node_index) 371 373 372 374 /** 373 - * scic_sds_remote_device_build_command_context() - 375 + * sci_remote_device_build_command_context() - 374 376 * 375 377 * This macro builds a remote device context for the SCU post request operation 376 378 */ 377 - #define scic_sds_remote_device_build_command_context(device, command) \ 379 + #define sci_remote_device_build_command_context(device, command) \ 378 380 ((command) \ 379 - | (scic_sds_remote_device_get_controller_peg((device)) << SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) \ 381 + | (sci_remote_device_get_controller_peg((device)) << SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) \ 380 382 | ((device)->owning_port->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) \ 381 - | (scic_sds_remote_device_get_index((device))) \ 383 + | (sci_remote_device_get_index((device))) \ 382 384 ) 383 385 384 386 /** 385 - * scic_sds_remote_device_set_working_request() - 387 + * sci_remote_device_set_working_request() - 386 388 * 387 389 * This macro makes the working request assingment for the remote device 388 390 * object. To clear the working request use this macro with a NULL request 389 391 * object. 390 392 */ 391 - #define scic_sds_remote_device_set_working_request(device, request) \ 393 + #define sci_remote_device_set_working_request(device, request) \ 392 394 ((device)->working_request = (request)) 393 395 394 - enum sci_status scic_sds_remote_device_frame_handler( 396 + enum sci_status sci_remote_device_frame_handler( 395 397 struct isci_remote_device *idev, 396 398 u32 frame_index); 397 399 398 - enum sci_status scic_sds_remote_device_event_handler( 400 + enum sci_status sci_remote_device_event_handler( 399 401 struct isci_remote_device *idev, 400 402 u32 event_code); 401 403 402 - enum sci_status scic_sds_remote_device_start_io( 404 + enum sci_status sci_remote_device_start_io( 403 405 struct isci_host *ihost, 404 406 struct isci_remote_device *idev, 405 407 struct isci_request *ireq); 406 408 407 - enum sci_status scic_sds_remote_device_start_task( 409 + enum sci_status sci_remote_device_start_task( 408 410 struct isci_host *ihost, 409 411 struct isci_remote_device *idev, 410 412 struct isci_request *ireq); 411 413 412 - enum sci_status scic_sds_remote_device_complete_io( 414 + enum sci_status sci_remote_device_complete_io( 413 415 struct isci_host *ihost, 414 416 struct isci_remote_device *idev, 415 417 struct isci_request *ireq); 416 418 417 - enum sci_status scic_sds_remote_device_suspend( 419 + enum sci_status sci_remote_device_suspend( 418 420 struct isci_remote_device *idev, 419 421 u32 suspend_type); 420 422 421 - void scic_sds_remote_device_post_request( 423 + void sci_remote_device_post_request( 422 424 struct isci_remote_device *idev, 423 425 u32 request); 424 - 425 - #define scic_sds_remote_device_is_atapi(idev) false 426 426 427 427 #endif /* !defined(_ISCI_REMOTE_DEVICE_H_) */
+90 -108
drivers/scsi/isci/remote_node_context.c
··· 81 81 * otherwise it will return false bool true if the remote node context is in 82 82 * the ready state. false if the remote node context is not in the ready state. 83 83 */ 84 - bool scic_sds_remote_node_context_is_ready( 85 - struct scic_sds_remote_node_context *sci_rnc) 84 + bool sci_remote_node_context_is_ready( 85 + struct sci_remote_node_context *sci_rnc) 86 86 { 87 87 u32 current_state = sci_rnc->sm.current_state_id; 88 88 ··· 93 93 return false; 94 94 } 95 95 96 - /** 97 - * 98 - * @sci_dev: The remote device to use to construct the RNC buffer. 99 - * @rnc: The buffer into which the remote device data will be copied. 100 - * 101 - * This method will construct the RNC buffer for this remote device object. none 102 - */ 103 - static void scic_sds_remote_node_context_construct_buffer( 104 - struct scic_sds_remote_node_context *sci_rnc) 96 + static union scu_remote_node_context *sci_rnc_by_id(struct isci_host *ihost, u16 id) 97 + { 98 + if (id < ihost->remote_node_entries && 99 + ihost->device_table[id]) 100 + return &ihost->remote_node_context_table[id]; 101 + 102 + return NULL; 103 + } 104 + 105 + static void sci_remote_node_context_construct_buffer(struct sci_remote_node_context *sci_rnc) 105 106 { 106 107 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); 107 108 struct domain_device *dev = idev->domain_dev; ··· 111 110 struct isci_host *ihost; 112 111 __le64 sas_addr; 113 112 114 - ihost = scic_sds_remote_device_get_controller(idev); 115 - rnc = scic_sds_controller_get_remote_node_context_buffer(ihost, rni); 113 + ihost = sci_remote_device_get_controller(idev); 114 + rnc = sci_rnc_by_id(ihost, rni); 116 115 117 116 memset(rnc, 0, sizeof(union scu_remote_node_context) 118 - * scic_sds_remote_device_node_count(idev)); 117 + * sci_remote_device_node_count(idev)); 119 118 120 119 rnc->ssp.remote_node_index = rni; 121 120 rnc->ssp.remote_node_port_width = idev->device_port_width; ··· 136 135 137 136 if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) { 138 137 rnc->ssp.connection_occupancy_timeout = 139 - ihost->user_parameters.sds1.stp_max_occupancy_timeout; 138 + ihost->user_parameters.stp_max_occupancy_timeout; 140 139 rnc->ssp.connection_inactivity_timeout = 141 - ihost->user_parameters.sds1.stp_inactivity_timeout; 140 + ihost->user_parameters.stp_inactivity_timeout; 142 141 } else { 143 142 rnc->ssp.connection_occupancy_timeout = 144 - ihost->user_parameters.sds1.ssp_max_occupancy_timeout; 143 + ihost->user_parameters.ssp_max_occupancy_timeout; 145 144 rnc->ssp.connection_inactivity_timeout = 146 - ihost->user_parameters.sds1.ssp_inactivity_timeout; 145 + ihost->user_parameters.ssp_inactivity_timeout; 147 146 } 148 147 149 148 rnc->ssp.initial_arbitration_wait_time = 0; ··· 165 164 * to its ready state. If the remote node context is already setup to 166 165 * transition to its final state then this function does nothing. none 167 166 */ 168 - static void scic_sds_remote_node_context_setup_to_resume( 169 - struct scic_sds_remote_node_context *sci_rnc, 167 + static void sci_remote_node_context_setup_to_resume( 168 + struct sci_remote_node_context *sci_rnc, 170 169 scics_sds_remote_node_context_callback callback, 171 170 void *callback_parameter) 172 171 { ··· 177 176 } 178 177 } 179 178 180 - static void scic_sds_remote_node_context_setup_to_destory( 181 - struct scic_sds_remote_node_context *sci_rnc, 179 + static void sci_remote_node_context_setup_to_destory( 180 + struct sci_remote_node_context *sci_rnc, 182 181 scics_sds_remote_node_context_callback callback, 183 182 void *callback_parameter) 184 183 { ··· 193 192 * This method just calls the user callback function and then resets the 194 193 * callback. 195 194 */ 196 - static void scic_sds_remote_node_context_notify_user( 197 - struct scic_sds_remote_node_context *rnc) 195 + static void sci_remote_node_context_notify_user( 196 + struct sci_remote_node_context *rnc) 198 197 { 199 198 if (rnc->user_callback != NULL) { 200 199 (*rnc->user_callback)(rnc->user_cookie); ··· 204 203 } 205 204 } 206 205 207 - static void scic_sds_remote_node_context_continue_state_transitions(struct scic_sds_remote_node_context *rnc) 206 + static void sci_remote_node_context_continue_state_transitions(struct sci_remote_node_context *rnc) 208 207 { 209 208 if (rnc->destination_state == SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_READY) 210 - scic_sds_remote_node_context_resume(rnc, rnc->user_callback, 209 + sci_remote_node_context_resume(rnc, rnc->user_callback, 211 210 rnc->user_cookie); 212 211 } 213 212 214 - /** 215 - * 216 - * @sci_rnc: The remote node context object that is to be validated. 217 - * 218 - * This method will mark the rnc buffer as being valid and post the request to 219 - * the hardware. none 220 - */ 221 - static void scic_sds_remote_node_context_validate_context_buffer( 222 - struct scic_sds_remote_node_context *sci_rnc) 213 + static void sci_remote_node_context_validate_context_buffer(struct sci_remote_node_context *sci_rnc) 223 214 { 215 + union scu_remote_node_context *rnc_buffer; 224 216 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); 225 217 struct domain_device *dev = idev->domain_dev; 226 - union scu_remote_node_context *rnc_buffer; 218 + struct isci_host *ihost = idev->owning_port->owning_controller; 227 219 228 - rnc_buffer = scic_sds_controller_get_remote_node_context_buffer( 229 - scic_sds_remote_device_get_controller(idev), 230 - sci_rnc->remote_node_index 231 - ); 220 + rnc_buffer = sci_rnc_by_id(ihost, sci_rnc->remote_node_index); 232 221 233 222 rnc_buffer->ssp.is_valid = true; 234 223 235 224 if (!idev->is_direct_attached && 236 225 (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP))) { 237 - scic_sds_remote_device_post_request(idev, 238 - SCU_CONTEXT_COMMAND_POST_RNC_96); 226 + sci_remote_device_post_request(idev, SCU_CONTEXT_COMMAND_POST_RNC_96); 239 227 } else { 240 - scic_sds_remote_device_post_request(idev, SCU_CONTEXT_COMMAND_POST_RNC_32); 228 + sci_remote_device_post_request(idev, SCU_CONTEXT_COMMAND_POST_RNC_32); 241 229 242 - if (idev->is_direct_attached) { 243 - scic_sds_port_setup_transports(idev->owning_port, 244 - sci_rnc->remote_node_index); 245 - } 230 + if (idev->is_direct_attached) 231 + sci_port_setup_transports(idev->owning_port, 232 + sci_rnc->remote_node_index); 246 233 } 247 234 } 248 235 249 - /** 250 - * 251 - * @sci_rnc: The remote node context object that is to be invalidated. 252 - * 253 - * This method will update the RNC buffer and post the invalidate request. none 254 - */ 255 - static void scic_sds_remote_node_context_invalidate_context_buffer( 256 - struct scic_sds_remote_node_context *sci_rnc) 236 + static void sci_remote_node_context_invalidate_context_buffer(struct sci_remote_node_context *sci_rnc) 257 237 { 258 238 union scu_remote_node_context *rnc_buffer; 239 + struct isci_remote_device *idev = rnc_to_dev(sci_rnc); 240 + struct isci_host *ihost = idev->owning_port->owning_controller; 259 241 260 - rnc_buffer = scic_sds_controller_get_remote_node_context_buffer( 261 - scic_sds_remote_device_get_controller(rnc_to_dev(sci_rnc)), 262 - sci_rnc->remote_node_index); 242 + rnc_buffer = sci_rnc_by_id(ihost, sci_rnc->remote_node_index); 263 243 264 244 rnc_buffer->ssp.is_valid = false; 265 245 266 - scic_sds_remote_device_post_request(rnc_to_dev(sci_rnc), 267 - SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE); 246 + sci_remote_device_post_request(rnc_to_dev(sci_rnc), 247 + SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE); 268 248 } 269 249 270 - static void scic_sds_remote_node_context_initial_state_enter(struct sci_base_state_machine *sm) 250 + static void sci_remote_node_context_initial_state_enter(struct sci_base_state_machine *sm) 271 251 { 272 - struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); 252 + struct sci_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); 273 253 274 254 /* Check to see if we have gotten back to the initial state because 275 255 * someone requested to destroy the remote node context object. 276 256 */ 277 257 if (sm->previous_state_id == SCI_RNC_INVALIDATING) { 278 258 rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_UNSPECIFIED; 279 - scic_sds_remote_node_context_notify_user(rnc); 259 + sci_remote_node_context_notify_user(rnc); 280 260 } 281 261 } 282 262 283 - static void scic_sds_remote_node_context_posting_state_enter(struct sci_base_state_machine *sm) 263 + static void sci_remote_node_context_posting_state_enter(struct sci_base_state_machine *sm) 284 264 { 285 - struct scic_sds_remote_node_context *sci_rnc = container_of(sm, typeof(*sci_rnc), sm); 265 + struct sci_remote_node_context *sci_rnc = container_of(sm, typeof(*sci_rnc), sm); 286 266 287 - scic_sds_remote_node_context_validate_context_buffer(sci_rnc); 267 + sci_remote_node_context_validate_context_buffer(sci_rnc); 288 268 } 289 269 290 - static void scic_sds_remote_node_context_invalidating_state_enter(struct sci_base_state_machine *sm) 270 + static void sci_remote_node_context_invalidating_state_enter(struct sci_base_state_machine *sm) 291 271 { 292 - struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); 272 + struct sci_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); 293 273 294 - scic_sds_remote_node_context_invalidate_context_buffer(rnc); 274 + sci_remote_node_context_invalidate_context_buffer(rnc); 295 275 } 296 276 297 - static void scic_sds_remote_node_context_resuming_state_enter(struct sci_base_state_machine *sm) 277 + static void sci_remote_node_context_resuming_state_enter(struct sci_base_state_machine *sm) 298 278 { 299 - struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); 279 + struct sci_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); 300 280 struct isci_remote_device *idev; 301 281 struct domain_device *dev; 302 282 ··· 292 310 */ 293 311 if ((dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) && 294 312 idev->is_direct_attached) 295 - scic_sds_port_setup_transports(idev->owning_port, 313 + sci_port_setup_transports(idev->owning_port, 296 314 rnc->remote_node_index); 297 315 298 - scic_sds_remote_device_post_request(idev, SCU_CONTEXT_COMMAND_POST_RNC_RESUME); 316 + sci_remote_device_post_request(idev, SCU_CONTEXT_COMMAND_POST_RNC_RESUME); 299 317 } 300 318 301 - static void scic_sds_remote_node_context_ready_state_enter(struct sci_base_state_machine *sm) 319 + static void sci_remote_node_context_ready_state_enter(struct sci_base_state_machine *sm) 302 320 { 303 - struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); 321 + struct sci_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); 304 322 305 323 rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_UNSPECIFIED; 306 324 307 325 if (rnc->user_callback) 308 - scic_sds_remote_node_context_notify_user(rnc); 326 + sci_remote_node_context_notify_user(rnc); 309 327 } 310 328 311 - static void scic_sds_remote_node_context_tx_suspended_state_enter(struct sci_base_state_machine *sm) 329 + static void sci_remote_node_context_tx_suspended_state_enter(struct sci_base_state_machine *sm) 312 330 { 313 - struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); 331 + struct sci_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); 314 332 315 - scic_sds_remote_node_context_continue_state_transitions(rnc); 333 + sci_remote_node_context_continue_state_transitions(rnc); 316 334 } 317 335 318 - static void scic_sds_remote_node_context_tx_rx_suspended_state_enter(struct sci_base_state_machine *sm) 336 + static void sci_remote_node_context_tx_rx_suspended_state_enter(struct sci_base_state_machine *sm) 319 337 { 320 - struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); 338 + struct sci_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); 321 339 322 - scic_sds_remote_node_context_continue_state_transitions(rnc); 340 + sci_remote_node_context_continue_state_transitions(rnc); 323 341 } 324 342 325 - static const struct sci_base_state scic_sds_remote_node_context_state_table[] = { 343 + static const struct sci_base_state sci_remote_node_context_state_table[] = { 326 344 [SCI_RNC_INITIAL] = { 327 - .enter_state = scic_sds_remote_node_context_initial_state_enter, 345 + .enter_state = sci_remote_node_context_initial_state_enter, 328 346 }, 329 347 [SCI_RNC_POSTING] = { 330 - .enter_state = scic_sds_remote_node_context_posting_state_enter, 348 + .enter_state = sci_remote_node_context_posting_state_enter, 331 349 }, 332 350 [SCI_RNC_INVALIDATING] = { 333 - .enter_state = scic_sds_remote_node_context_invalidating_state_enter, 351 + .enter_state = sci_remote_node_context_invalidating_state_enter, 334 352 }, 335 353 [SCI_RNC_RESUMING] = { 336 - .enter_state = scic_sds_remote_node_context_resuming_state_enter, 354 + .enter_state = sci_remote_node_context_resuming_state_enter, 337 355 }, 338 356 [SCI_RNC_READY] = { 339 - .enter_state = scic_sds_remote_node_context_ready_state_enter, 357 + .enter_state = sci_remote_node_context_ready_state_enter, 340 358 }, 341 359 [SCI_RNC_TX_SUSPENDED] = { 342 - .enter_state = scic_sds_remote_node_context_tx_suspended_state_enter, 360 + .enter_state = sci_remote_node_context_tx_suspended_state_enter, 343 361 }, 344 362 [SCI_RNC_TX_RX_SUSPENDED] = { 345 - .enter_state = scic_sds_remote_node_context_tx_rx_suspended_state_enter, 363 + .enter_state = sci_remote_node_context_tx_rx_suspended_state_enter, 346 364 }, 347 365 [SCI_RNC_AWAIT_SUSPENSION] = { }, 348 366 }; 349 367 350 - void scic_sds_remote_node_context_construct(struct scic_sds_remote_node_context *rnc, 368 + void sci_remote_node_context_construct(struct sci_remote_node_context *rnc, 351 369 u16 remote_node_index) 352 370 { 353 - memset(rnc, 0, sizeof(struct scic_sds_remote_node_context)); 371 + memset(rnc, 0, sizeof(struct sci_remote_node_context)); 354 372 355 373 rnc->remote_node_index = remote_node_index; 356 374 rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_UNSPECIFIED; 357 375 358 - sci_init_sm(&rnc->sm, scic_sds_remote_node_context_state_table, SCI_RNC_INITIAL); 376 + sci_init_sm(&rnc->sm, sci_remote_node_context_state_table, SCI_RNC_INITIAL); 359 377 } 360 378 361 - enum sci_status scic_sds_remote_node_context_event_handler(struct scic_sds_remote_node_context *sci_rnc, 379 + enum sci_status sci_remote_node_context_event_handler(struct sci_remote_node_context *sci_rnc, 362 380 u32 event_code) 363 381 { 364 382 enum scis_sds_remote_node_context_states state; ··· 458 476 459 477 } 460 478 461 - enum sci_status scic_sds_remote_node_context_destruct(struct scic_sds_remote_node_context *sci_rnc, 479 + enum sci_status sci_remote_node_context_destruct(struct sci_remote_node_context *sci_rnc, 462 480 scics_sds_remote_node_context_callback cb_fn, 463 481 void *cb_p) 464 482 { ··· 467 485 state = sci_rnc->sm.current_state_id; 468 486 switch (state) { 469 487 case SCI_RNC_INVALIDATING: 470 - scic_sds_remote_node_context_setup_to_destory(sci_rnc, cb_fn, cb_p); 488 + sci_remote_node_context_setup_to_destory(sci_rnc, cb_fn, cb_p); 471 489 return SCI_SUCCESS; 472 490 case SCI_RNC_POSTING: 473 491 case SCI_RNC_RESUMING: ··· 475 493 case SCI_RNC_TX_SUSPENDED: 476 494 case SCI_RNC_TX_RX_SUSPENDED: 477 495 case SCI_RNC_AWAIT_SUSPENSION: 478 - scic_sds_remote_node_context_setup_to_destory(sci_rnc, cb_fn, cb_p); 496 + sci_remote_node_context_setup_to_destory(sci_rnc, cb_fn, cb_p); 479 497 sci_change_state(&sci_rnc->sm, SCI_RNC_INVALIDATING); 480 498 return SCI_SUCCESS; 481 499 case SCI_RNC_INITIAL: ··· 493 511 } 494 512 } 495 513 496 - enum sci_status scic_sds_remote_node_context_suspend(struct scic_sds_remote_node_context *sci_rnc, 514 + enum sci_status sci_remote_node_context_suspend(struct sci_remote_node_context *sci_rnc, 497 515 u32 suspend_type, 498 516 scics_sds_remote_node_context_callback cb_fn, 499 517 void *cb_p) ··· 512 530 sci_rnc->suspension_code = suspend_type; 513 531 514 532 if (suspend_type == SCI_SOFTWARE_SUSPENSION) { 515 - scic_sds_remote_device_post_request(rnc_to_dev(sci_rnc), 533 + sci_remote_device_post_request(rnc_to_dev(sci_rnc), 516 534 SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX); 517 535 } 518 536 ··· 520 538 return SCI_SUCCESS; 521 539 } 522 540 523 - enum sci_status scic_sds_remote_node_context_resume(struct scic_sds_remote_node_context *sci_rnc, 541 + enum sci_status sci_remote_node_context_resume(struct sci_remote_node_context *sci_rnc, 524 542 scics_sds_remote_node_context_callback cb_fn, 525 543 void *cb_p) 526 544 { ··· 532 550 if (sci_rnc->remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) 533 551 return SCI_FAILURE_INVALID_STATE; 534 552 535 - scic_sds_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); 536 - scic_sds_remote_node_context_construct_buffer(sci_rnc); 553 + sci_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); 554 + sci_remote_node_context_construct_buffer(sci_rnc); 537 555 sci_change_state(&sci_rnc->sm, SCI_RNC_POSTING); 538 556 return SCI_SUCCESS; 539 557 case SCI_RNC_POSTING: ··· 549 567 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); 550 568 struct domain_device *dev = idev->domain_dev; 551 569 552 - scic_sds_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); 570 + sci_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); 553 571 554 572 /* TODO: consider adding a resume action of NONE, INVALIDATE, WRITE_TLCR */ 555 573 if (dev->dev_type == SAS_END_DEV || dev_is_expander(dev)) ··· 566 584 return SCI_SUCCESS; 567 585 } 568 586 case SCI_RNC_TX_RX_SUSPENDED: 569 - scic_sds_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); 587 + sci_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); 570 588 sci_change_state(&sci_rnc->sm, SCI_RNC_RESUMING); 571 589 return SCI_FAILURE_INVALID_STATE; 572 590 case SCI_RNC_AWAIT_SUSPENSION: 573 - scic_sds_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); 591 + sci_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); 574 592 return SCI_SUCCESS; 575 593 default: 576 594 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), ··· 579 597 } 580 598 } 581 599 582 - enum sci_status scic_sds_remote_node_context_start_io(struct scic_sds_remote_node_context *sci_rnc, 600 + enum sci_status sci_remote_node_context_start_io(struct sci_remote_node_context *sci_rnc, 583 601 struct isci_request *ireq) 584 602 { 585 603 enum scis_sds_remote_node_context_states state; ··· 604 622 return SCI_FAILURE_INVALID_STATE; 605 623 } 606 624 607 - enum sci_status scic_sds_remote_node_context_start_task(struct scic_sds_remote_node_context *sci_rnc, 625 + enum sci_status sci_remote_node_context_start_task(struct sci_remote_node_context *sci_rnc, 608 626 struct isci_request *ireq) 609 627 { 610 628 enum scis_sds_remote_node_context_states state; ··· 617 635 return SCI_SUCCESS; 618 636 case SCI_RNC_TX_SUSPENDED: 619 637 case SCI_RNC_TX_RX_SUSPENDED: 620 - scic_sds_remote_node_context_resume(sci_rnc, NULL, NULL); 638 + sci_remote_node_context_resume(sci_rnc, NULL, NULL); 621 639 return SCI_SUCCESS; 622 640 default: 623 641 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)),
+15 -15
drivers/scsi/isci/remote_node_context.h
··· 80 80 81 81 struct isci_request; 82 82 struct isci_remote_device; 83 - struct scic_sds_remote_node_context; 83 + struct sci_remote_node_context; 84 84 85 85 typedef void (*scics_sds_remote_node_context_callback)(void *); 86 86 ··· 147 147 * This enumeration is used to define the end destination state for the remote 148 148 * node context. 149 149 */ 150 - enum scic_sds_remote_node_context_destination_state { 150 + enum sci_remote_node_context_destination_state { 151 151 SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_UNSPECIFIED, 152 152 SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_READY, 153 153 SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_FINAL 154 154 }; 155 155 156 156 /** 157 - * struct scic_sds_remote_node_context - This structure contains the data 157 + * struct sci_remote_node_context - This structure contains the data 158 158 * associated with the remote node context object. The remote node context 159 159 * (RNC) object models the the remote device information necessary to manage 160 160 * the silicon RNC. 161 161 */ 162 - struct scic_sds_remote_node_context { 162 + struct sci_remote_node_context { 163 163 /** 164 164 * This field indicates the remote node index (RNI) associated with 165 165 * this RNC. ··· 177 177 * state. This can cause an automatic resume on receiving a suspension 178 178 * notification. 179 179 */ 180 - enum scic_sds_remote_node_context_destination_state destination_state; 180 + enum sci_remote_node_context_destination_state destination_state; 181 181 182 182 /** 183 183 * This field contains the callback function that the user requested to be ··· 197 197 struct sci_base_state_machine sm; 198 198 }; 199 199 200 - void scic_sds_remote_node_context_construct(struct scic_sds_remote_node_context *rnc, 200 + void sci_remote_node_context_construct(struct sci_remote_node_context *rnc, 201 201 u16 remote_node_index); 202 202 203 203 204 - bool scic_sds_remote_node_context_is_ready( 205 - struct scic_sds_remote_node_context *sci_rnc); 204 + bool sci_remote_node_context_is_ready( 205 + struct sci_remote_node_context *sci_rnc); 206 206 207 - #define scic_sds_remote_node_context_get_remote_node_index(rcn) \ 207 + #define sci_remote_node_context_get_remote_node_index(rcn) \ 208 208 ((rnc)->remote_node_index) 209 209 210 - enum sci_status scic_sds_remote_node_context_event_handler(struct scic_sds_remote_node_context *sci_rnc, 210 + enum sci_status sci_remote_node_context_event_handler(struct sci_remote_node_context *sci_rnc, 211 211 u32 event_code); 212 - enum sci_status scic_sds_remote_node_context_destruct(struct scic_sds_remote_node_context *sci_rnc, 212 + enum sci_status sci_remote_node_context_destruct(struct sci_remote_node_context *sci_rnc, 213 213 scics_sds_remote_node_context_callback callback, 214 214 void *callback_parameter); 215 - enum sci_status scic_sds_remote_node_context_suspend(struct scic_sds_remote_node_context *sci_rnc, 215 + enum sci_status sci_remote_node_context_suspend(struct sci_remote_node_context *sci_rnc, 216 216 u32 suspend_type, 217 217 scics_sds_remote_node_context_callback cb_fn, 218 218 void *cb_p); 219 - enum sci_status scic_sds_remote_node_context_resume(struct scic_sds_remote_node_context *sci_rnc, 219 + enum sci_status sci_remote_node_context_resume(struct sci_remote_node_context *sci_rnc, 220 220 scics_sds_remote_node_context_callback cb_fn, 221 221 void *cb_p); 222 - enum sci_status scic_sds_remote_node_context_start_task(struct scic_sds_remote_node_context *sci_rnc, 222 + enum sci_status sci_remote_node_context_start_task(struct sci_remote_node_context *sci_rnc, 223 223 struct isci_request *ireq); 224 - enum sci_status scic_sds_remote_node_context_start_io(struct scic_sds_remote_node_context *sci_rnc, 224 + enum sci_status sci_remote_node_context_start_io(struct sci_remote_node_context *sci_rnc, 225 225 struct isci_request *ireq); 226 226 227 227 #endif /* _SCIC_SDS_REMOTE_NODE_CONTEXT_H_ */
+57 -57
drivers/scsi/isci/remote_node_table.c
··· 74 74 * just bit position. u32 This is the absolute bit position for an available 75 75 * group. 76 76 */ 77 - static u32 scic_sds_remote_node_table_get_group_index( 78 - struct scic_remote_node_table *remote_node_table, 77 + static u32 sci_remote_node_table_get_group_index( 78 + struct sci_remote_node_table *remote_node_table, 79 79 u32 group_table_index) 80 80 { 81 81 u32 dword_index; ··· 108 108 * This method will clear the group index entry in the specified group index 109 109 * table. none 110 110 */ 111 - static void scic_sds_remote_node_table_clear_group_index( 112 - struct scic_remote_node_table *remote_node_table, 111 + static void sci_remote_node_table_clear_group_index( 112 + struct sci_remote_node_table *remote_node_table, 113 113 u32 group_table_index, 114 114 u32 group_index) 115 115 { ··· 138 138 * This method will set the group index bit entry in the specified gropu index 139 139 * table. none 140 140 */ 141 - static void scic_sds_remote_node_table_set_group_index( 142 - struct scic_remote_node_table *remote_node_table, 141 + static void sci_remote_node_table_set_group_index( 142 + struct sci_remote_node_table *remote_node_table, 143 143 u32 group_table_index, 144 144 u32 group_index) 145 145 { ··· 167 167 * This method will set the remote to available in the remote node allocation 168 168 * table. none 169 169 */ 170 - static void scic_sds_remote_node_table_set_node_index( 171 - struct scic_remote_node_table *remote_node_table, 170 + static void sci_remote_node_table_set_node_index( 171 + struct sci_remote_node_table *remote_node_table, 172 172 u32 remote_node_index) 173 173 { 174 174 u32 dword_location; ··· 200 200 * This method clears the remote node index from the table of available remote 201 201 * nodes. none 202 202 */ 203 - static void scic_sds_remote_node_table_clear_node_index( 204 - struct scic_remote_node_table *remote_node_table, 203 + static void sci_remote_node_table_clear_node_index( 204 + struct sci_remote_node_table *remote_node_table, 205 205 u32 remote_node_index) 206 206 { 207 207 u32 dword_location; ··· 231 231 * 232 232 * This method clears the entire table slot at the specified slot index. none 233 233 */ 234 - static void scic_sds_remote_node_table_clear_group( 235 - struct scic_remote_node_table *remote_node_table, 234 + static void sci_remote_node_table_clear_group( 235 + struct sci_remote_node_table *remote_node_table, 236 236 u32 group_index) 237 237 { 238 238 u32 dword_location; ··· 258 258 * 259 259 * THis method sets an entire remote node group in the remote node table. 260 260 */ 261 - static void scic_sds_remote_node_table_set_group( 262 - struct scic_remote_node_table *remote_node_table, 261 + static void sci_remote_node_table_set_group( 262 + struct sci_remote_node_table *remote_node_table, 263 263 u32 group_index) 264 264 { 265 265 u32 dword_location; ··· 288 288 * This method will return the group value for the specified group index. The 289 289 * bit values at the specified remote node group index. 290 290 */ 291 - static u8 scic_sds_remote_node_table_get_group_value( 292 - struct scic_remote_node_table *remote_node_table, 291 + static u8 sci_remote_node_table_get_group_value( 292 + struct sci_remote_node_table *remote_node_table, 293 293 u32 group_index) 294 294 { 295 295 u32 dword_location; ··· 313 313 * 314 314 * This method will initialize the remote node table for use. none 315 315 */ 316 - void scic_sds_remote_node_table_initialize( 317 - struct scic_remote_node_table *remote_node_table, 316 + void sci_remote_node_table_initialize( 317 + struct sci_remote_node_table *remote_node_table, 318 318 u32 remote_node_entries) 319 319 { 320 320 u32 index; ··· 342 342 343 343 /* Initialize each full DWORD to a FULL SET of remote nodes */ 344 344 for (index = 0; index < remote_node_entries; index++) { 345 - scic_sds_remote_node_table_set_node_index(remote_node_table, index); 345 + sci_remote_node_table_set_node_index(remote_node_table, index); 346 346 } 347 347 348 348 remote_node_table->group_array_size = (u16) ··· 353 353 /* 354 354 * These are all guaranteed to be full slot values so fill them in the 355 355 * available sets of 3 remote nodes */ 356 - scic_sds_remote_node_table_set_group_index(remote_node_table, 2, index); 356 + sci_remote_node_table_set_group_index(remote_node_table, 2, index); 357 357 } 358 358 359 359 /* Now fill in any remainders that we may find */ 360 360 if ((remote_node_entries % SCU_STP_REMOTE_NODE_COUNT) == 2) { 361 - scic_sds_remote_node_table_set_group_index(remote_node_table, 1, index); 361 + sci_remote_node_table_set_group_index(remote_node_table, 1, index); 362 362 } else if ((remote_node_entries % SCU_STP_REMOTE_NODE_COUNT) == 1) { 363 - scic_sds_remote_node_table_set_group_index(remote_node_table, 0, index); 363 + sci_remote_node_table_set_group_index(remote_node_table, 0, index); 364 364 } 365 365 } 366 366 ··· 379 379 * updated. The RNi value or an invalid remote node context if an RNi can not 380 380 * be found. 381 381 */ 382 - static u16 scic_sds_remote_node_table_allocate_single_remote_node( 383 - struct scic_remote_node_table *remote_node_table, 382 + static u16 sci_remote_node_table_allocate_single_remote_node( 383 + struct sci_remote_node_table *remote_node_table, 384 384 u32 group_table_index) 385 385 { 386 386 u8 index; ··· 388 388 u32 group_index; 389 389 u16 remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX; 390 390 391 - group_index = scic_sds_remote_node_table_get_group_index( 391 + group_index = sci_remote_node_table_get_group_index( 392 392 remote_node_table, group_table_index); 393 393 394 394 /* We could not find an available slot in the table selector 0 */ 395 395 if (group_index != SCIC_SDS_REMOTE_NODE_TABLE_INVALID_INDEX) { 396 - group_value = scic_sds_remote_node_table_get_group_value( 396 + group_value = sci_remote_node_table_get_group_value( 397 397 remote_node_table, group_index); 398 398 399 399 for (index = 0; index < SCU_STP_REMOTE_NODE_COUNT; index++) { ··· 402 402 remote_node_index = (u16)(group_index * SCU_STP_REMOTE_NODE_COUNT 403 403 + index); 404 404 405 - scic_sds_remote_node_table_clear_group_index( 405 + sci_remote_node_table_clear_group_index( 406 406 remote_node_table, group_table_index, group_index 407 407 ); 408 408 409 - scic_sds_remote_node_table_clear_node_index( 409 + sci_remote_node_table_clear_node_index( 410 410 remote_node_table, remote_node_index 411 411 ); 412 412 413 413 if (group_table_index > 0) { 414 - scic_sds_remote_node_table_set_group_index( 414 + sci_remote_node_table_set_group_index( 415 415 remote_node_table, group_table_index - 1, group_index 416 416 ); 417 417 } ··· 436 436 * The remote node index that represents three consecutive remote node entries 437 437 * or an invalid remote node context if none can be found. 438 438 */ 439 - static u16 scic_sds_remote_node_table_allocate_triple_remote_node( 440 - struct scic_remote_node_table *remote_node_table, 439 + static u16 sci_remote_node_table_allocate_triple_remote_node( 440 + struct sci_remote_node_table *remote_node_table, 441 441 u32 group_table_index) 442 442 { 443 443 u32 group_index; 444 444 u16 remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX; 445 445 446 - group_index = scic_sds_remote_node_table_get_group_index( 446 + group_index = sci_remote_node_table_get_group_index( 447 447 remote_node_table, group_table_index); 448 448 449 449 if (group_index != SCIC_SDS_REMOTE_NODE_TABLE_INVALID_INDEX) { 450 450 remote_node_index = (u16)group_index * SCU_STP_REMOTE_NODE_COUNT; 451 451 452 - scic_sds_remote_node_table_clear_group_index( 452 + sci_remote_node_table_clear_group_index( 453 453 remote_node_table, group_table_index, group_index 454 454 ); 455 455 456 - scic_sds_remote_node_table_clear_group( 456 + sci_remote_node_table_clear_group( 457 457 remote_node_table, group_index 458 458 ); 459 459 } ··· 473 473 * SCU_SSP_REMOTE_NODE_COUNT(1) or SCU_STP_REMOTE_NODE_COUNT(3). u16 This is 474 474 * the remote node index that is returned or an invalid remote node context. 475 475 */ 476 - u16 scic_sds_remote_node_table_allocate_remote_node( 477 - struct scic_remote_node_table *remote_node_table, 476 + u16 sci_remote_node_table_allocate_remote_node( 477 + struct sci_remote_node_table *remote_node_table, 478 478 u32 remote_node_count) 479 479 { 480 480 u16 remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX; 481 481 482 482 if (remote_node_count == SCU_SSP_REMOTE_NODE_COUNT) { 483 483 remote_node_index = 484 - scic_sds_remote_node_table_allocate_single_remote_node( 484 + sci_remote_node_table_allocate_single_remote_node( 485 485 remote_node_table, 0); 486 486 487 487 if (remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) { 488 488 remote_node_index = 489 - scic_sds_remote_node_table_allocate_single_remote_node( 489 + sci_remote_node_table_allocate_single_remote_node( 490 490 remote_node_table, 1); 491 491 } 492 492 493 493 if (remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) { 494 494 remote_node_index = 495 - scic_sds_remote_node_table_allocate_single_remote_node( 495 + sci_remote_node_table_allocate_single_remote_node( 496 496 remote_node_table, 2); 497 497 } 498 498 } else if (remote_node_count == SCU_STP_REMOTE_NODE_COUNT) { 499 499 remote_node_index = 500 - scic_sds_remote_node_table_allocate_triple_remote_node( 500 + sci_remote_node_table_allocate_triple_remote_node( 501 501 remote_node_table, 2); 502 502 } 503 503 ··· 511 511 * This method will free a single remote node index back to the remote node 512 512 * table. This routine will update the remote node groups 513 513 */ 514 - static void scic_sds_remote_node_table_release_single_remote_node( 515 - struct scic_remote_node_table *remote_node_table, 514 + static void sci_remote_node_table_release_single_remote_node( 515 + struct sci_remote_node_table *remote_node_table, 516 516 u16 remote_node_index) 517 517 { 518 518 u32 group_index; ··· 520 520 521 521 group_index = remote_node_index / SCU_STP_REMOTE_NODE_COUNT; 522 522 523 - group_value = scic_sds_remote_node_table_get_group_value(remote_node_table, group_index); 523 + group_value = sci_remote_node_table_get_group_value(remote_node_table, group_index); 524 524 525 525 /* 526 526 * Assert that we are not trying to add an entry to a slot that is already ··· 531 531 /* 532 532 * There are no entries in this slot so it must be added to the single 533 533 * slot table. */ 534 - scic_sds_remote_node_table_set_group_index(remote_node_table, 0, group_index); 534 + sci_remote_node_table_set_group_index(remote_node_table, 0, group_index); 535 535 } else if ((group_value & (group_value - 1)) == 0) { 536 536 /* 537 537 * There is only one entry in this slot so it must be moved from the 538 538 * single slot table to the dual slot table */ 539 - scic_sds_remote_node_table_clear_group_index(remote_node_table, 0, group_index); 540 - scic_sds_remote_node_table_set_group_index(remote_node_table, 1, group_index); 539 + sci_remote_node_table_clear_group_index(remote_node_table, 0, group_index); 540 + sci_remote_node_table_set_group_index(remote_node_table, 1, group_index); 541 541 } else { 542 542 /* 543 543 * There are two entries in the slot so it must be moved from the dual 544 544 * slot table to the tripple slot table. */ 545 - scic_sds_remote_node_table_clear_group_index(remote_node_table, 1, group_index); 546 - scic_sds_remote_node_table_set_group_index(remote_node_table, 2, group_index); 545 + sci_remote_node_table_clear_group_index(remote_node_table, 1, group_index); 546 + sci_remote_node_table_set_group_index(remote_node_table, 2, group_index); 547 547 } 548 548 549 - scic_sds_remote_node_table_set_node_index(remote_node_table, remote_node_index); 549 + sci_remote_node_table_set_node_index(remote_node_table, remote_node_index); 550 550 } 551 551 552 552 /** ··· 557 557 * This method will release a group of three consecutive remote nodes back to 558 558 * the free remote nodes. 559 559 */ 560 - static void scic_sds_remote_node_table_release_triple_remote_node( 561 - struct scic_remote_node_table *remote_node_table, 560 + static void sci_remote_node_table_release_triple_remote_node( 561 + struct sci_remote_node_table *remote_node_table, 562 562 u16 remote_node_index) 563 563 { 564 564 u32 group_index; 565 565 566 566 group_index = remote_node_index / SCU_STP_REMOTE_NODE_COUNT; 567 567 568 - scic_sds_remote_node_table_set_group_index( 568 + sci_remote_node_table_set_group_index( 569 569 remote_node_table, 2, group_index 570 570 ); 571 571 572 - scic_sds_remote_node_table_set_group(remote_node_table, group_index); 572 + sci_remote_node_table_set_group(remote_node_table, group_index); 573 573 } 574 574 575 575 /** ··· 582 582 * This method will release the remote node index back into the remote node 583 583 * table free pool. 584 584 */ 585 - void scic_sds_remote_node_table_release_remote_node_index( 586 - struct scic_remote_node_table *remote_node_table, 585 + void sci_remote_node_table_release_remote_node_index( 586 + struct sci_remote_node_table *remote_node_table, 587 587 u32 remote_node_count, 588 588 u16 remote_node_index) 589 589 { 590 590 if (remote_node_count == SCU_SSP_REMOTE_NODE_COUNT) { 591 - scic_sds_remote_node_table_release_single_remote_node( 591 + sci_remote_node_table_release_single_remote_node( 592 592 remote_node_table, remote_node_index); 593 593 } else if (remote_node_count == SCU_STP_REMOTE_NODE_COUNT) { 594 - scic_sds_remote_node_table_release_triple_remote_node( 594 + sci_remote_node_table_release_triple_remote_node( 595 595 remote_node_table, remote_node_index); 596 596 } 597 597 }
+8 -8
drivers/scsi/isci/remote_node_table.h
··· 130 130 #define SCU_SATA_REMOTE_NODE_COUNT 1 131 131 132 132 /** 133 - * struct scic_remote_node_table - 133 + * struct sci_remote_node_table - 134 134 * 135 135 * 136 136 */ 137 - struct scic_remote_node_table { 137 + struct sci_remote_node_table { 138 138 /** 139 139 * This field contains the array size in dwords 140 140 */ ··· 172 172 173 173 /* --------------------------------------------------------------------------- */ 174 174 175 - void scic_sds_remote_node_table_initialize( 176 - struct scic_remote_node_table *remote_node_table, 175 + void sci_remote_node_table_initialize( 176 + struct sci_remote_node_table *remote_node_table, 177 177 u32 remote_node_entries); 178 178 179 - u16 scic_sds_remote_node_table_allocate_remote_node( 180 - struct scic_remote_node_table *remote_node_table, 179 + u16 sci_remote_node_table_allocate_remote_node( 180 + struct sci_remote_node_table *remote_node_table, 181 181 u32 remote_node_count); 182 182 183 - void scic_sds_remote_node_table_release_remote_node_index( 184 - struct scic_remote_node_table *remote_node_table, 183 + void sci_remote_node_table_release_remote_node_index( 184 + struct sci_remote_node_table *remote_node_table, 185 185 u32 remote_node_count, 186 186 u16 remote_node_index); 187 187
+180 -180
drivers/scsi/isci/request.c
··· 89 89 return ihost->task_context_dma + offset; 90 90 } 91 91 92 - return scic_io_request_get_dma_addr(ireq, &ireq->sg_table[idx - 2]); 92 + return sci_io_request_get_dma_addr(ireq, &ireq->sg_table[idx - 2]); 93 93 } 94 94 95 95 static void init_sgl_element(struct scu_sgl_element *e, struct scatterlist *sg) ··· 100 100 e->address_modifier = 0; 101 101 } 102 102 103 - static void scic_sds_request_build_sgl(struct isci_request *ireq) 103 + static void sci_request_build_sgl(struct isci_request *ireq) 104 104 { 105 105 struct isci_host *ihost = ireq->isci_host; 106 106 struct sas_task *task = isci_request_access_task(ireq); ··· 158 158 } 159 159 } 160 160 161 - static void scic_sds_io_request_build_ssp_command_iu(struct isci_request *ireq) 161 + static void sci_io_request_build_ssp_command_iu(struct isci_request *ireq) 162 162 { 163 163 struct ssp_cmd_iu *cmd_iu; 164 164 struct sas_task *task = isci_request_access_task(ireq); ··· 178 178 sizeof(task->ssp_task.cdb) / sizeof(u32)); 179 179 } 180 180 181 - static void scic_sds_task_request_build_ssp_task_iu(struct isci_request *ireq) 181 + static void sci_task_request_build_ssp_task_iu(struct isci_request *ireq) 182 182 { 183 183 struct ssp_task_iu *task_iu; 184 184 struct sas_task *task = isci_request_access_task(ireq); ··· 211 211 struct isci_remote_device *idev; 212 212 struct isci_port *iport; 213 213 214 - idev = scic_sds_request_get_device(ireq); 215 - iport = scic_sds_request_get_port(ireq); 214 + idev = sci_request_get_device(ireq); 215 + iport = sci_request_get_port(ireq); 216 216 217 217 /* Fill in the TC with the its required data */ 218 218 task_context->abort = 0; ··· 220 220 task_context->initiator_request = 1; 221 221 task_context->connection_rate = idev->connection_rate; 222 222 task_context->protocol_engine_index = 223 - scic_sds_controller_get_protocol_engine_group(controller); 224 - task_context->logical_port_index = scic_sds_port_get_index(iport); 223 + sci_controller_get_protocol_engine_group(controller); 224 + task_context->logical_port_index = sci_port_get_index(iport); 225 225 task_context->protocol_type = SCU_TASK_CONTEXT_PROTOCOL_SSP; 226 226 task_context->valid = SCU_TASK_CONTEXT_VALID; 227 227 task_context->context_type = SCU_TASK_CONTEXT_TYPE; 228 228 229 - task_context->remote_node_index = scic_sds_remote_device_get_index(idev); 229 + task_context->remote_node_index = sci_remote_device_get_index(idev); 230 230 task_context->command_code = 0; 231 231 232 232 task_context->link_layer_control = 0; ··· 242 242 task_context->task_phase = 0x01; 243 243 244 244 ireq->post_context = (SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC | 245 - (scic_sds_controller_get_protocol_engine_group(controller) << 245 + (sci_controller_get_protocol_engine_group(controller) << 246 246 SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) | 247 - (scic_sds_port_get_index(iport) << 247 + (sci_port_get_index(iport) << 248 248 SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) | 249 249 ISCI_TAG_TCI(ireq->io_tag)); 250 250 ··· 252 252 * Copy the physical address for the command buffer to the 253 253 * SCU Task Context 254 254 */ 255 - dma_addr = scic_io_request_get_dma_addr(ireq, &ireq->ssp.cmd); 255 + dma_addr = sci_io_request_get_dma_addr(ireq, &ireq->ssp.cmd); 256 256 257 257 task_context->command_iu_upper = upper_32_bits(dma_addr); 258 258 task_context->command_iu_lower = lower_32_bits(dma_addr); ··· 261 261 * Copy the physical address for the response buffer to the 262 262 * SCU Task Context 263 263 */ 264 - dma_addr = scic_io_request_get_dma_addr(ireq, &ireq->ssp.rsp); 264 + dma_addr = sci_io_request_get_dma_addr(ireq, &ireq->ssp.rsp); 265 265 266 266 task_context->response_iu_upper = upper_32_bits(dma_addr); 267 267 task_context->response_iu_lower = lower_32_bits(dma_addr); ··· 298 298 task_context->transfer_length_bytes = len; 299 299 300 300 if (task_context->transfer_length_bytes > 0) 301 - scic_sds_request_build_sgl(ireq); 301 + sci_request_build_sgl(ireq); 302 302 } 303 303 304 304 /** ··· 349 349 struct isci_remote_device *idev; 350 350 struct isci_port *iport; 351 351 352 - idev = scic_sds_request_get_device(ireq); 353 - iport = scic_sds_request_get_port(ireq); 352 + idev = sci_request_get_device(ireq); 353 + iport = sci_request_get_port(ireq); 354 354 355 355 /* Fill in the TC with the its required data */ 356 356 task_context->abort = 0; ··· 358 358 task_context->initiator_request = 1; 359 359 task_context->connection_rate = idev->connection_rate; 360 360 task_context->protocol_engine_index = 361 - scic_sds_controller_get_protocol_engine_group(controller); 361 + sci_controller_get_protocol_engine_group(controller); 362 362 task_context->logical_port_index = 363 - scic_sds_port_get_index(iport); 363 + sci_port_get_index(iport); 364 364 task_context->protocol_type = SCU_TASK_CONTEXT_PROTOCOL_STP; 365 365 task_context->valid = SCU_TASK_CONTEXT_VALID; 366 366 task_context->context_type = SCU_TASK_CONTEXT_TYPE; 367 367 368 - task_context->remote_node_index = scic_sds_remote_device_get_index(idev); 368 + task_context->remote_node_index = sci_remote_device_get_index(idev); 369 369 task_context->command_code = 0; 370 370 371 371 task_context->link_layer_control = 0; ··· 385 385 task_context->type.words[0] = *(u32 *)&ireq->stp.cmd; 386 386 387 387 ireq->post_context = (SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC | 388 - (scic_sds_controller_get_protocol_engine_group(controller) << 388 + (sci_controller_get_protocol_engine_group(controller) << 389 389 SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) | 390 - (scic_sds_port_get_index(iport) << 390 + (sci_port_get_index(iport) << 391 391 SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) | 392 392 ISCI_TAG_TCI(ireq->io_tag)); 393 393 /* ··· 395 395 * Context. We must offset the command buffer by 4 bytes because the 396 396 * first 4 bytes are transfered in the body of the TC. 397 397 */ 398 - dma_addr = scic_io_request_get_dma_addr(ireq, 398 + dma_addr = sci_io_request_get_dma_addr(ireq, 399 399 ((char *) &ireq->stp.cmd) + 400 400 sizeof(u32)); 401 401 ··· 420 420 task_context->transfer_length_bytes = sizeof(struct host_to_dev_fis) - sizeof(u32); 421 421 } 422 422 423 - static enum sci_status scic_sds_stp_pio_request_construct(struct isci_request *ireq, 423 + static enum sci_status sci_stp_pio_request_construct(struct isci_request *ireq, 424 424 bool copy_rx_frame) 425 425 { 426 426 struct isci_stp_request *stp_req = &ireq->stp.req; ··· 432 432 stp_req->sgl.set = SCU_SGL_ELEMENT_PAIR_A; 433 433 434 434 if (copy_rx_frame) { 435 - scic_sds_request_build_sgl(ireq); 435 + sci_request_build_sgl(ireq); 436 436 stp_req->sgl.index = 0; 437 437 } else { 438 438 /* The user does not want the data copied to the SGL buffer location */ ··· 454 454 * requests that are optimized by the silicon (i.e. UDMA, NCQ). This method 455 455 * returns an indication as to whether the construction was successful. 456 456 */ 457 - static void scic_sds_stp_optimized_request_construct(struct isci_request *ireq, 457 + static void sci_stp_optimized_request_construct(struct isci_request *ireq, 458 458 u8 optimized_task_type, 459 459 u32 len, 460 460 enum dma_data_direction dir) ··· 465 465 scu_sata_reqeust_construct_task_context(ireq, task_context); 466 466 467 467 /* Copy over the SGL elements */ 468 - scic_sds_request_build_sgl(ireq); 468 + sci_request_build_sgl(ireq); 469 469 470 470 /* Copy over the number of bytes to be transfered */ 471 471 task_context->transfer_length_bytes = len; ··· 490 490 491 491 492 492 static enum sci_status 493 - scic_io_request_construct_sata(struct isci_request *ireq, 493 + sci_io_request_construct_sata(struct isci_request *ireq, 494 494 u32 len, 495 495 enum dma_data_direction dir, 496 496 bool copy) ··· 533 533 534 534 /* NCQ */ 535 535 if (task->ata_task.use_ncq) { 536 - scic_sds_stp_optimized_request_construct(ireq, 536 + sci_stp_optimized_request_construct(ireq, 537 537 SCU_TASK_TYPE_FPDMAQ_READ, 538 538 len, dir); 539 539 return SCI_SUCCESS; ··· 541 541 542 542 /* DMA */ 543 543 if (task->ata_task.dma_xfer) { 544 - scic_sds_stp_optimized_request_construct(ireq, 544 + sci_stp_optimized_request_construct(ireq, 545 545 SCU_TASK_TYPE_DMA_IN, 546 546 len, dir); 547 547 return SCI_SUCCESS; 548 548 } else /* PIO */ 549 - return scic_sds_stp_pio_request_construct(ireq, copy); 549 + return sci_stp_pio_request_construct(ireq, copy); 550 550 551 551 return status; 552 552 } 553 553 554 - static enum sci_status scic_io_request_construct_basic_ssp(struct isci_request *ireq) 554 + static enum sci_status sci_io_request_construct_basic_ssp(struct isci_request *ireq) 555 555 { 556 556 struct sas_task *task = isci_request_access_task(ireq); 557 557 ··· 561 561 task->data_dir, 562 562 task->total_xfer_len); 563 563 564 - scic_sds_io_request_build_ssp_command_iu(ireq); 564 + sci_io_request_build_ssp_command_iu(ireq); 565 565 566 566 sci_change_state(&ireq->sm, SCI_REQ_CONSTRUCTED); 567 567 568 568 return SCI_SUCCESS; 569 569 } 570 570 571 - enum sci_status scic_task_request_construct_ssp( 571 + enum sci_status sci_task_request_construct_ssp( 572 572 struct isci_request *ireq) 573 573 { 574 574 /* Construct the SSP Task SCU Task Context */ 575 575 scu_ssp_task_request_construct_task_context(ireq); 576 576 577 577 /* Fill in the SSP Task IU */ 578 - scic_sds_task_request_build_ssp_task_iu(ireq); 578 + sci_task_request_build_ssp_task_iu(ireq); 579 579 580 580 sci_change_state(&ireq->sm, SCI_REQ_CONSTRUCTED); 581 581 582 582 return SCI_SUCCESS; 583 583 } 584 584 585 - static enum sci_status scic_io_request_construct_basic_sata(struct isci_request *ireq) 585 + static enum sci_status sci_io_request_construct_basic_sata(struct isci_request *ireq) 586 586 { 587 587 enum sci_status status; 588 588 bool copy = false; ··· 592 592 593 593 copy = (task->data_dir == DMA_NONE) ? false : true; 594 594 595 - status = scic_io_request_construct_sata(ireq, 595 + status = sci_io_request_construct_sata(ireq, 596 596 task->total_xfer_len, 597 597 task->data_dir, 598 598 copy); ··· 603 603 return status; 604 604 } 605 605 606 - enum sci_status scic_task_request_construct_sata(struct isci_request *ireq) 606 + enum sci_status sci_task_request_construct_sata(struct isci_request *ireq) 607 607 { 608 608 enum sci_status status = SCI_SUCCESS; 609 609 ··· 648 648 * BAR1 is the scu_registers 649 649 * 0x20002C = 0x200000 + 0x2c 650 650 * = start of task context SRAM + offset of (type.ssp.data_offset) 651 - * TCi is the io_tag of struct scic_sds_request 651 + * TCi is the io_tag of struct sci_request 652 652 */ 653 653 ret_val = readl(scu_reg_base + 654 654 (SCU_TASK_CONTEXT_SRAM + offsetof(struct scu_task_context, type.ssp.data_offset)) + ··· 658 658 return ret_val; 659 659 } 660 660 661 - enum sci_status scic_sds_request_start(struct isci_request *ireq) 661 + enum sci_status sci_request_start(struct isci_request *ireq) 662 662 { 663 663 enum sci_base_request_states state; 664 664 struct scu_task_context *tc = ireq->tc; ··· 708 708 } 709 709 710 710 enum sci_status 711 - scic_sds_io_request_terminate(struct isci_request *ireq) 711 + sci_io_request_terminate(struct isci_request *ireq) 712 712 { 713 713 enum sci_base_request_states state; 714 714 ··· 716 716 717 717 switch (state) { 718 718 case SCI_REQ_CONSTRUCTED: 719 - scic_sds_request_set_status(ireq, 719 + sci_request_set_status(ireq, 720 720 SCU_TASK_DONE_TASK_ABORT, 721 721 SCI_FAILURE_IO_TERMINATED); 722 722 ··· 759 759 return SCI_FAILURE_INVALID_STATE; 760 760 } 761 761 762 - enum sci_status scic_sds_request_complete(struct isci_request *ireq) 762 + enum sci_status sci_request_complete(struct isci_request *ireq) 763 763 { 764 764 enum sci_base_request_states state; 765 765 struct isci_host *ihost = ireq->owning_controller; ··· 770 770 return SCI_FAILURE_INVALID_STATE; 771 771 772 772 if (ireq->saved_rx_frame_index != SCU_INVALID_FRAME_INDEX) 773 - scic_sds_controller_release_frame(ihost, 773 + sci_controller_release_frame(ihost, 774 774 ireq->saved_rx_frame_index); 775 775 776 776 /* XXX can we just stop the machine and remove the 'final' state? */ ··· 778 778 return SCI_SUCCESS; 779 779 } 780 780 781 - enum sci_status scic_sds_io_request_event_handler(struct isci_request *ireq, 781 + enum sci_status sci_io_request_event_handler(struct isci_request *ireq, 782 782 u32 event_code) 783 783 { 784 784 enum sci_base_request_states state; ··· 818 818 * @sci_req: This parameter specifies the request object for which to copy 819 819 * the response data. 820 820 */ 821 - static void scic_sds_io_request_copy_response(struct isci_request *ireq) 821 + static void sci_io_request_copy_response(struct isci_request *ireq) 822 822 { 823 823 void *resp_buf; 824 824 u32 len; ··· 848 848 */ 849 849 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 850 850 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 851 - scic_sds_request_set_status(ireq, 851 + sci_request_set_status(ireq, 852 852 SCU_TASK_DONE_GOOD, 853 853 SCI_SUCCESS); 854 854 break; ··· 868 868 word_cnt); 869 869 870 870 if (resp->status == 0) { 871 - scic_sds_request_set_status(ireq, 871 + sci_request_set_status(ireq, 872 872 SCU_TASK_DONE_GOOD, 873 873 SCI_SUCCESS_IO_DONE_EARLY); 874 874 } else { 875 - scic_sds_request_set_status(ireq, 875 + sci_request_set_status(ireq, 876 876 SCU_TASK_DONE_CHECK_RESPONSE, 877 877 SCI_FAILURE_IO_RESPONSE_VALID); 878 878 } ··· 885 885 &ireq->ssp.rsp, 886 886 word_cnt); 887 887 888 - scic_sds_request_set_status(ireq, 888 + sci_request_set_status(ireq, 889 889 SCU_TASK_DONE_CHECK_RESPONSE, 890 890 SCI_FAILURE_IO_RESPONSE_VALID); 891 891 break; ··· 900 900 datapres = resp_iu->datapres; 901 901 902 902 if (datapres == 1 || datapres == 2) { 903 - scic_sds_request_set_status(ireq, 903 + sci_request_set_status(ireq, 904 904 SCU_TASK_DONE_CHECK_RESPONSE, 905 905 SCI_FAILURE_IO_RESPONSE_VALID); 906 906 } else 907 - scic_sds_request_set_status(ireq, 907 + sci_request_set_status(ireq, 908 908 SCU_TASK_DONE_GOOD, 909 909 SCI_SUCCESS); 910 910 break; ··· 921 921 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_REG_ERR): 922 922 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_SDB_ERR): 923 923 if (ireq->protocol == SCIC_STP_PROTOCOL) { 924 - scic_sds_request_set_status(ireq, 924 + sci_request_set_status(ireq, 925 925 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> 926 926 SCU_COMPLETION_TL_STATUS_SHIFT, 927 927 SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED); 928 928 } else { 929 - scic_sds_request_set_status(ireq, 929 + sci_request_set_status(ireq, 930 930 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> 931 931 SCU_COMPLETION_TL_STATUS_SHIFT, 932 932 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR); ··· 944 944 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_STP_RESOURCES_BUSY): 945 945 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_PROTOCOL_NOT_SUPPORTED): 946 946 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_CONNECTION_RATE_NOT_SUPPORTED): 947 - scic_sds_request_set_status(ireq, 947 + sci_request_set_status(ireq, 948 948 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> 949 949 SCU_COMPLETION_TL_STATUS_SHIFT, 950 950 SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED); ··· 967 967 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_IIT_ENTRY_NV): 968 968 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_RNCNV_OUTBOUND): 969 969 default: 970 - scic_sds_request_set_status( 970 + sci_request_set_status( 971 971 ireq, 972 972 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> 973 973 SCU_COMPLETION_TL_STATUS_SHIFT, ··· 991 991 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 992 992 case (SCU_TASK_DONE_GOOD << SCU_COMPLETION_TL_STATUS_SHIFT): 993 993 case (SCU_TASK_DONE_TASK_ABORT << SCU_COMPLETION_TL_STATUS_SHIFT): 994 - scic_sds_request_set_status(ireq, SCU_TASK_DONE_TASK_ABORT, 994 + sci_request_set_status(ireq, SCU_TASK_DONE_TASK_ABORT, 995 995 SCI_FAILURE_IO_TERMINATED); 996 996 997 997 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED); ··· 1012 1012 { 1013 1013 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 1014 1014 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 1015 - scic_sds_request_set_status(ireq, SCU_TASK_DONE_GOOD, 1015 + sci_request_set_status(ireq, SCU_TASK_DONE_GOOD, 1016 1016 SCI_SUCCESS); 1017 1017 1018 1018 sci_change_state(&ireq->sm, SCI_REQ_TASK_WAIT_TC_RESP); ··· 1036 1036 * If a NAK was received, then it is up to the user to retry 1037 1037 * the request. 1038 1038 */ 1039 - scic_sds_request_set_status(ireq, 1039 + sci_request_set_status(ireq, 1040 1040 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 1041 1041 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR); 1042 1042 ··· 1057 1057 * unexpected. but if the TC has success status, we 1058 1058 * complete the IO anyway. 1059 1059 */ 1060 - scic_sds_request_set_status(ireq, SCU_TASK_DONE_GOOD, 1060 + sci_request_set_status(ireq, SCU_TASK_DONE_GOOD, 1061 1061 SCI_SUCCESS); 1062 1062 1063 1063 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED); ··· 1074 1074 * these SMP_XXX_XX_ERR status. For these type of error, 1075 1075 * we ask ihost user to retry the request. 1076 1076 */ 1077 - scic_sds_request_set_status(ireq, SCU_TASK_DONE_SMP_RESP_TO_ERR, 1077 + sci_request_set_status(ireq, SCU_TASK_DONE_SMP_RESP_TO_ERR, 1078 1078 SCI_FAILURE_RETRY_REQUIRED); 1079 1079 1080 1080 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED); ··· 1084 1084 /* All other completion status cause the IO to be complete. If a NAK 1085 1085 * was received, then it is up to the user to retry the request 1086 1086 */ 1087 - scic_sds_request_set_status(ireq, 1087 + sci_request_set_status(ireq, 1088 1088 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 1089 1089 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR); 1090 1090 ··· 1101 1101 { 1102 1102 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 1103 1103 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 1104 - scic_sds_request_set_status(ireq, SCU_TASK_DONE_GOOD, 1104 + sci_request_set_status(ireq, SCU_TASK_DONE_GOOD, 1105 1105 SCI_SUCCESS); 1106 1106 1107 1107 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED); ··· 1111 1111 * complete. If a NAK was received, then it is up to 1112 1112 * the user to retry the request. 1113 1113 */ 1114 - scic_sds_request_set_status(ireq, 1114 + sci_request_set_status(ireq, 1115 1115 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 1116 1116 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR); 1117 1117 ··· 1122 1122 return SCI_SUCCESS; 1123 1123 } 1124 1124 1125 - void scic_stp_io_request_set_ncq_tag(struct isci_request *ireq, 1125 + void sci_stp_io_request_set_ncq_tag(struct isci_request *ireq, 1126 1126 u16 ncq_tag) 1127 1127 { 1128 1128 /** ··· 1171 1171 { 1172 1172 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 1173 1173 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 1174 - scic_sds_request_set_status(ireq, SCU_TASK_DONE_GOOD, 1174 + sci_request_set_status(ireq, SCU_TASK_DONE_GOOD, 1175 1175 SCI_SUCCESS); 1176 1176 1177 1177 sci_change_state(&ireq->sm, SCI_REQ_STP_NON_DATA_WAIT_D2H); ··· 1182 1182 * complete. If a NAK was received, then it is up to 1183 1183 * the user to retry the request. 1184 1184 */ 1185 - scic_sds_request_set_status(ireq, 1185 + sci_request_set_status(ireq, 1186 1186 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 1187 1187 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR); 1188 1188 ··· 1198 1198 /* transmit DATA_FIS from (current sgl + offset) for input 1199 1199 * parameter length. current sgl and offset is alreay stored in the IO request 1200 1200 */ 1201 - static enum sci_status scic_sds_stp_request_pio_data_out_trasmit_data_frame( 1201 + static enum sci_status sci_stp_request_pio_data_out_trasmit_data_frame( 1202 1202 struct isci_request *ireq, 1203 1203 u32 length) 1204 1204 { ··· 1223 1223 task_context->type.stp.fis_type = FIS_DATA; 1224 1224 1225 1225 /* send the new TC out. */ 1226 - return scic_controller_continue_io(ireq); 1226 + return sci_controller_continue_io(ireq); 1227 1227 } 1228 1228 1229 - static enum sci_status scic_sds_stp_request_pio_data_out_transmit_data(struct isci_request *ireq) 1229 + static enum sci_status sci_stp_request_pio_data_out_transmit_data(struct isci_request *ireq) 1230 1230 { 1231 1231 struct isci_stp_request *stp_req = &ireq->stp.req; 1232 1232 struct scu_sgl_element_pair *sgl_pair; ··· 1252 1252 return SCI_SUCCESS; 1253 1253 1254 1254 if (stp_req->pio_len >= len) { 1255 - status = scic_sds_stp_request_pio_data_out_trasmit_data_frame(ireq, len); 1255 + status = sci_stp_request_pio_data_out_trasmit_data_frame(ireq, len); 1256 1256 if (status != SCI_SUCCESS) 1257 1257 return status; 1258 1258 stp_req->pio_len -= len; ··· 1261 1261 sgl = pio_sgl_next(stp_req); 1262 1262 offset = 0; 1263 1263 } else if (stp_req->pio_len < len) { 1264 - scic_sds_stp_request_pio_data_out_trasmit_data_frame(ireq, stp_req->pio_len); 1264 + sci_stp_request_pio_data_out_trasmit_data_frame(ireq, stp_req->pio_len); 1265 1265 1266 1266 /* Sgl offset will be adjusted and saved for future */ 1267 1267 offset += stp_req->pio_len; ··· 1284 1284 * specified data region. enum sci_status 1285 1285 */ 1286 1286 static enum sci_status 1287 - scic_sds_stp_request_pio_data_in_copy_data_buffer(struct isci_stp_request *stp_req, 1287 + sci_stp_request_pio_data_in_copy_data_buffer(struct isci_stp_request *stp_req, 1288 1288 u8 *data_buf, u32 len) 1289 1289 { 1290 1290 struct isci_request *ireq; ··· 1328 1328 * 1329 1329 * Copy the data buffer to the io request data region. enum sci_status 1330 1330 */ 1331 - static enum sci_status scic_sds_stp_request_pio_data_in_copy_data( 1331 + static enum sci_status sci_stp_request_pio_data_in_copy_data( 1332 1332 struct isci_stp_request *stp_req, 1333 1333 u8 *data_buffer) 1334 1334 { ··· 1338 1338 * If there is less than 1K remaining in the transfer request 1339 1339 * copy just the data for the transfer */ 1340 1340 if (stp_req->pio_len < SCU_MAX_FRAME_BUFFER_SIZE) { 1341 - status = scic_sds_stp_request_pio_data_in_copy_data_buffer( 1341 + status = sci_stp_request_pio_data_in_copy_data_buffer( 1342 1342 stp_req, data_buffer, stp_req->pio_len); 1343 1343 1344 1344 if (status == SCI_SUCCESS) 1345 1345 stp_req->pio_len = 0; 1346 1346 } else { 1347 1347 /* We are transfering the whole frame so copy */ 1348 - status = scic_sds_stp_request_pio_data_in_copy_data_buffer( 1348 + status = sci_stp_request_pio_data_in_copy_data_buffer( 1349 1349 stp_req, data_buffer, SCU_MAX_FRAME_BUFFER_SIZE); 1350 1350 1351 1351 if (status == SCI_SUCCESS) ··· 1363 1363 1364 1364 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 1365 1365 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 1366 - scic_sds_request_set_status(ireq, 1366 + sci_request_set_status(ireq, 1367 1367 SCU_TASK_DONE_GOOD, 1368 1368 SCI_SUCCESS); 1369 1369 ··· 1375 1375 * complete. If a NAK was received, then it is up to 1376 1376 * the user to retry the request. 1377 1377 */ 1378 - scic_sds_request_set_status(ireq, 1378 + sci_request_set_status(ireq, 1379 1379 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 1380 1380 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR); 1381 1381 ··· 1398 1398 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 1399 1399 /* Transmit data */ 1400 1400 if (stp_req->pio_len != 0) { 1401 - status = scic_sds_stp_request_pio_data_out_transmit_data(ireq); 1401 + status = sci_stp_request_pio_data_out_transmit_data(ireq); 1402 1402 if (status == SCI_SUCCESS) { 1403 1403 if (stp_req->pio_len == 0) 1404 1404 all_frames_transferred = true; ··· 1426 1426 * If a NAK was received, then it is up to the user to retry 1427 1427 * the request. 1428 1428 */ 1429 - scic_sds_request_set_status( 1429 + sci_request_set_status( 1430 1430 ireq, 1431 1431 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 1432 1432 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR); ··· 1438 1438 return status; 1439 1439 } 1440 1440 1441 - static void scic_sds_stp_request_udma_complete_request( 1441 + static void sci_stp_request_udma_complete_request( 1442 1442 struct isci_request *ireq, 1443 1443 u32 scu_status, 1444 1444 enum sci_status sci_status) 1445 1445 { 1446 - scic_sds_request_set_status(ireq, scu_status, sci_status); 1446 + sci_request_set_status(ireq, scu_status, sci_status); 1447 1447 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED); 1448 1448 } 1449 1449 1450 - static enum sci_status scic_sds_stp_request_udma_general_frame_handler(struct isci_request *ireq, 1450 + static enum sci_status sci_stp_request_udma_general_frame_handler(struct isci_request *ireq, 1451 1451 u32 frame_index) 1452 1452 { 1453 1453 struct isci_host *ihost = ireq->owning_controller; ··· 1455 1455 enum sci_status status; 1456 1456 u32 *frame_buffer; 1457 1457 1458 - status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control, 1458 + status = sci_unsolicited_frame_control_get_header(&ihost->uf_control, 1459 1459 frame_index, 1460 1460 (void **)&frame_header); 1461 1461 1462 1462 if ((status == SCI_SUCCESS) && 1463 1463 (frame_header->fis_type == FIS_REGD2H)) { 1464 - scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1464 + sci_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1465 1465 frame_index, 1466 1466 (void **)&frame_buffer); 1467 1467 1468 - scic_sds_controller_copy_sata_response(&ireq->stp.rsp, 1468 + sci_controller_copy_sata_response(&ireq->stp.rsp, 1469 1469 frame_header, 1470 1470 frame_buffer); 1471 1471 } 1472 1472 1473 - scic_sds_controller_release_frame(ihost, frame_index); 1473 + sci_controller_release_frame(ihost, frame_index); 1474 1474 1475 1475 return status; 1476 1476 } 1477 1477 1478 1478 enum sci_status 1479 - scic_sds_io_request_frame_handler(struct isci_request *ireq, 1479 + sci_io_request_frame_handler(struct isci_request *ireq, 1480 1480 u32 frame_index) 1481 1481 { 1482 1482 struct isci_host *ihost = ireq->owning_controller; ··· 1491 1491 struct ssp_frame_hdr ssp_hdr; 1492 1492 void *frame_header; 1493 1493 1494 - scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control, 1494 + sci_unsolicited_frame_control_get_header(&ihost->uf_control, 1495 1495 frame_index, 1496 1496 &frame_header); 1497 1497 ··· 1502 1502 struct ssp_response_iu *resp_iu; 1503 1503 ssize_t word_cnt = SSP_RESP_IU_MAX_SIZE / sizeof(u32); 1504 1504 1505 - scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1505 + sci_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1506 1506 frame_index, 1507 1507 (void **)&resp_iu); 1508 1508 ··· 1512 1512 1513 1513 if (resp_iu->datapres == 0x01 || 1514 1514 resp_iu->datapres == 0x02) { 1515 - scic_sds_request_set_status(ireq, 1515 + sci_request_set_status(ireq, 1516 1516 SCU_TASK_DONE_CHECK_RESPONSE, 1517 1517 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR); 1518 1518 } else 1519 - scic_sds_request_set_status(ireq, 1519 + sci_request_set_status(ireq, 1520 1520 SCU_TASK_DONE_GOOD, 1521 1521 SCI_SUCCESS); 1522 1522 } else { ··· 1531 1531 * In any case we are done with this frame buffer return it to 1532 1532 * the controller 1533 1533 */ 1534 - scic_sds_controller_release_frame(ihost, frame_index); 1534 + sci_controller_release_frame(ihost, frame_index); 1535 1535 1536 1536 return SCI_SUCCESS; 1537 1537 } 1538 1538 1539 1539 case SCI_REQ_TASK_WAIT_TC_RESP: 1540 - scic_sds_io_request_copy_response(ireq); 1540 + sci_io_request_copy_response(ireq); 1541 1541 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED); 1542 - scic_sds_controller_release_frame(ihost,frame_index); 1542 + sci_controller_release_frame(ihost, frame_index); 1543 1543 return SCI_SUCCESS; 1544 1544 1545 1545 case SCI_REQ_SMP_WAIT_RESP: { 1546 1546 struct smp_resp *rsp_hdr = &ireq->smp.rsp; 1547 1547 void *frame_header; 1548 1548 1549 - scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control, 1549 + sci_unsolicited_frame_control_get_header(&ihost->uf_control, 1550 1550 frame_index, 1551 1551 &frame_header); 1552 1552 ··· 1557 1557 if (rsp_hdr->frame_type == SMP_RESPONSE) { 1558 1558 void *smp_resp; 1559 1559 1560 - scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1560 + sci_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1561 1561 frame_index, 1562 1562 &smp_resp); 1563 1563 ··· 1567 1567 sci_swab32_cpy(((u8 *) rsp_hdr) + SMP_RESP_HDR_SZ, 1568 1568 smp_resp, word_cnt); 1569 1569 1570 - scic_sds_request_set_status(ireq, SCU_TASK_DONE_GOOD, 1570 + sci_request_set_status(ireq, SCU_TASK_DONE_GOOD, 1571 1571 SCI_SUCCESS); 1572 1572 1573 1573 sci_change_state(&ireq->sm, SCI_REQ_SMP_WAIT_TC_COMP); ··· 1584 1584 frame_index, 1585 1585 rsp_hdr->frame_type); 1586 1586 1587 - scic_sds_request_set_status(ireq, 1587 + sci_request_set_status(ireq, 1588 1588 SCU_TASK_DONE_SMP_FRM_TYPE_ERR, 1589 1589 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR); 1590 1590 1591 1591 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED); 1592 1592 } 1593 1593 1594 - scic_sds_controller_release_frame(ihost, frame_index); 1594 + sci_controller_release_frame(ihost, frame_index); 1595 1595 1596 1596 return SCI_SUCCESS; 1597 1597 } 1598 1598 1599 1599 case SCI_REQ_STP_UDMA_WAIT_TC_COMP: 1600 - return scic_sds_stp_request_udma_general_frame_handler(ireq, 1600 + return sci_stp_request_udma_general_frame_handler(ireq, 1601 1601 frame_index); 1602 1602 1603 1603 case SCI_REQ_STP_UDMA_WAIT_D2H: 1604 1604 /* Use the general frame handler to copy the resposne data */ 1605 - status = scic_sds_stp_request_udma_general_frame_handler(ireq, 1605 + status = sci_stp_request_udma_general_frame_handler(ireq, 1606 1606 frame_index); 1607 1607 1608 1608 if (status != SCI_SUCCESS) 1609 1609 return status; 1610 1610 1611 - scic_sds_stp_request_udma_complete_request(ireq, 1611 + sci_stp_request_udma_complete_request(ireq, 1612 1612 SCU_TASK_DONE_CHECK_RESPONSE, 1613 1613 SCI_FAILURE_IO_RESPONSE_VALID); 1614 1614 ··· 1618 1618 struct dev_to_host_fis *frame_header; 1619 1619 u32 *frame_buffer; 1620 1620 1621 - status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control, 1621 + status = sci_unsolicited_frame_control_get_header(&ihost->uf_control, 1622 1622 frame_index, 1623 1623 (void **)&frame_header); 1624 1624 ··· 1636 1636 1637 1637 switch (frame_header->fis_type) { 1638 1638 case FIS_REGD2H: 1639 - scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1639 + sci_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1640 1640 frame_index, 1641 1641 (void **)&frame_buffer); 1642 1642 1643 - scic_sds_controller_copy_sata_response(&ireq->stp.rsp, 1643 + sci_controller_copy_sata_response(&ireq->stp.rsp, 1644 1644 frame_header, 1645 1645 frame_buffer); 1646 1646 1647 1647 /* The command has completed with error */ 1648 - scic_sds_request_set_status(ireq, SCU_TASK_DONE_CHECK_RESPONSE, 1648 + sci_request_set_status(ireq, SCU_TASK_DONE_CHECK_RESPONSE, 1649 1649 SCI_FAILURE_IO_RESPONSE_VALID); 1650 1650 break; 1651 1651 ··· 1655 1655 "violation occurred\n", __func__, stp_req, 1656 1656 frame_index); 1657 1657 1658 - scic_sds_request_set_status(ireq, SCU_TASK_DONE_UNEXP_FIS, 1658 + sci_request_set_status(ireq, SCU_TASK_DONE_UNEXP_FIS, 1659 1659 SCI_FAILURE_PROTOCOL_VIOLATION); 1660 1660 break; 1661 1661 } ··· 1663 1663 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED); 1664 1664 1665 1665 /* Frame has been decoded return it to the controller */ 1666 - scic_sds_controller_release_frame(ihost, frame_index); 1666 + sci_controller_release_frame(ihost, frame_index); 1667 1667 1668 1668 return status; 1669 1669 } ··· 1673 1673 struct dev_to_host_fis *frame_header; 1674 1674 u32 *frame_buffer; 1675 1675 1676 - status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control, 1676 + status = sci_unsolicited_frame_control_get_header(&ihost->uf_control, 1677 1677 frame_index, 1678 1678 (void **)&frame_header); 1679 1679 ··· 1688 1688 switch (frame_header->fis_type) { 1689 1689 case FIS_PIO_SETUP: 1690 1690 /* Get from the frame buffer the PIO Setup Data */ 1691 - scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1691 + sci_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1692 1692 frame_index, 1693 1693 (void **)&frame_buffer); 1694 1694 ··· 1704 1704 /* status: 4th byte in the 3rd dword */ 1705 1705 stp_req->status = (frame_buffer[2] >> 24) & 0xff; 1706 1706 1707 - scic_sds_controller_copy_sata_response(&ireq->stp.rsp, 1707 + sci_controller_copy_sata_response(&ireq->stp.rsp, 1708 1708 frame_header, 1709 1709 frame_buffer); 1710 1710 ··· 1717 1717 sci_change_state(&ireq->sm, SCI_REQ_STP_PIO_DATA_IN); 1718 1718 } else if (task->data_dir == DMA_TO_DEVICE) { 1719 1719 /* Transmit data */ 1720 - status = scic_sds_stp_request_pio_data_out_transmit_data(ireq); 1720 + status = sci_stp_request_pio_data_out_transmit_data(ireq); 1721 1721 if (status != SCI_SUCCESS) 1722 1722 break; 1723 1723 sci_change_state(&ireq->sm, SCI_REQ_STP_PIO_DATA_OUT); ··· 1745 1745 break; 1746 1746 } 1747 1747 1748 - scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1748 + sci_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1749 1749 frame_index, 1750 1750 (void **)&frame_buffer); 1751 1751 1752 - scic_sds_controller_copy_sata_response(&ireq->stp.req, 1752 + sci_controller_copy_sata_response(&ireq->stp.req, 1753 1753 frame_header, 1754 1754 frame_buffer); 1755 1755 1756 - scic_sds_request_set_status(ireq, 1756 + sci_request_set_status(ireq, 1757 1757 SCU_TASK_DONE_CHECK_RESPONSE, 1758 1758 SCI_FAILURE_IO_RESPONSE_VALID); 1759 1759 ··· 1766 1766 } 1767 1767 1768 1768 /* Frame is decoded return it to the controller */ 1769 - scic_sds_controller_release_frame(ihost, frame_index); 1769 + sci_controller_release_frame(ihost, frame_index); 1770 1770 1771 1771 return status; 1772 1772 } ··· 1775 1775 struct dev_to_host_fis *frame_header; 1776 1776 struct sata_fis_data *frame_buffer; 1777 1777 1778 - status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control, 1778 + status = sci_unsolicited_frame_control_get_header(&ihost->uf_control, 1779 1779 frame_index, 1780 1780 (void **)&frame_header); 1781 1781 ··· 1800 1800 frame_index, 1801 1801 frame_header->fis_type); 1802 1802 1803 - scic_sds_request_set_status(ireq, 1803 + sci_request_set_status(ireq, 1804 1804 SCU_TASK_DONE_GOOD, 1805 1805 SCI_FAILURE_IO_REQUIRES_SCSI_ABORT); 1806 1806 1807 1807 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED); 1808 1808 1809 1809 /* Frame is decoded return it to the controller */ 1810 - scic_sds_controller_release_frame(ihost, frame_index); 1810 + sci_controller_release_frame(ihost, frame_index); 1811 1811 return status; 1812 1812 } 1813 1813 ··· 1815 1815 ireq->saved_rx_frame_index = frame_index; 1816 1816 stp_req->pio_len = 0; 1817 1817 } else { 1818 - scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1818 + sci_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1819 1819 frame_index, 1820 1820 (void **)&frame_buffer); 1821 1821 1822 - status = scic_sds_stp_request_pio_data_in_copy_data(stp_req, 1822 + status = sci_stp_request_pio_data_in_copy_data(stp_req, 1823 1823 (u8 *)frame_buffer); 1824 1824 1825 1825 /* Frame is decoded return it to the controller */ 1826 - scic_sds_controller_release_frame(ihost, frame_index); 1826 + sci_controller_release_frame(ihost, frame_index); 1827 1827 } 1828 1828 1829 1829 /* Check for the end of the transfer, are there more ··· 1833 1833 return status; 1834 1834 1835 1835 if ((stp_req->status & ATA_BUSY) == 0) { 1836 - scic_sds_request_set_status(ireq, 1836 + sci_request_set_status(ireq, 1837 1837 SCU_TASK_DONE_CHECK_RESPONSE, 1838 1838 SCI_FAILURE_IO_RESPONSE_VALID); 1839 1839 ··· 1848 1848 struct dev_to_host_fis *frame_header; 1849 1849 u32 *frame_buffer; 1850 1850 1851 - status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control, 1851 + status = sci_unsolicited_frame_control_get_header(&ihost->uf_control, 1852 1852 frame_index, 1853 1853 (void **)&frame_header); 1854 1854 if (status != SCI_SUCCESS) { ··· 1864 1864 1865 1865 switch (frame_header->fis_type) { 1866 1866 case FIS_REGD2H: 1867 - scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1867 + sci_unsolicited_frame_control_get_buffer(&ihost->uf_control, 1868 1868 frame_index, 1869 1869 (void **)&frame_buffer); 1870 1870 1871 - scic_sds_controller_copy_sata_response(&ireq->stp.rsp, 1871 + sci_controller_copy_sata_response(&ireq->stp.rsp, 1872 1872 frame_header, 1873 1873 frame_buffer); 1874 1874 1875 1875 /* The command has completed with error */ 1876 - scic_sds_request_set_status(ireq, 1876 + sci_request_set_status(ireq, 1877 1877 SCU_TASK_DONE_CHECK_RESPONSE, 1878 1878 SCI_FAILURE_IO_RESPONSE_VALID); 1879 1879 break; ··· 1886 1886 stp_req, 1887 1887 frame_index); 1888 1888 1889 - scic_sds_request_set_status(ireq, 1889 + sci_request_set_status(ireq, 1890 1890 SCU_TASK_DONE_UNEXP_FIS, 1891 1891 SCI_FAILURE_PROTOCOL_VIOLATION); 1892 1892 break; ··· 1895 1895 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED); 1896 1896 1897 1897 /* Frame has been decoded return it to the controller */ 1898 - scic_sds_controller_release_frame(ihost, frame_index); 1898 + sci_controller_release_frame(ihost, frame_index); 1899 1899 1900 1900 return status; 1901 1901 } ··· 1904 1904 * TODO: Is it even possible to get an unsolicited frame in the 1905 1905 * aborting state? 1906 1906 */ 1907 - scic_sds_controller_release_frame(ihost, frame_index); 1907 + sci_controller_release_frame(ihost, frame_index); 1908 1908 return SCI_SUCCESS; 1909 1909 1910 1910 default: ··· 1915 1915 frame_index, 1916 1916 state); 1917 1917 1918 - scic_sds_controller_release_frame(ihost, frame_index); 1918 + sci_controller_release_frame(ihost, frame_index); 1919 1919 return SCI_FAILURE_INVALID_STATE; 1920 1920 } 1921 1921 } ··· 1927 1927 1928 1928 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 1929 1929 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 1930 - scic_sds_stp_request_udma_complete_request(ireq, 1930 + sci_stp_request_udma_complete_request(ireq, 1931 1931 SCU_TASK_DONE_GOOD, 1932 1932 SCI_SUCCESS); 1933 1933 break; ··· 1938 1938 * completion. 1939 1939 */ 1940 1940 if (ireq->stp.rsp.fis_type == FIS_REGD2H) { 1941 - scic_sds_remote_device_suspend(ireq->target_device, 1941 + sci_remote_device_suspend(ireq->target_device, 1942 1942 SCU_EVENT_SPECIFIC(SCU_NORMALIZE_COMPLETION_STATUS(completion_code))); 1943 1943 1944 - scic_sds_stp_request_udma_complete_request(ireq, 1944 + sci_stp_request_udma_complete_request(ireq, 1945 1945 SCU_TASK_DONE_CHECK_RESPONSE, 1946 1946 SCI_FAILURE_IO_RESPONSE_VALID); 1947 1947 } else { ··· 1965 1965 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_LL_R_ERR): 1966 1966 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_CMD_LL_R_ERR): 1967 1967 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_CRC_ERR): 1968 - scic_sds_remote_device_suspend(ireq->target_device, 1968 + sci_remote_device_suspend(ireq->target_device, 1969 1969 SCU_EVENT_SPECIFIC(SCU_NORMALIZE_COMPLETION_STATUS(completion_code))); 1970 1970 /* Fall through to the default case */ 1971 1971 default: 1972 1972 /* All other completion status cause the IO to be complete. */ 1973 - scic_sds_stp_request_udma_complete_request(ireq, 1973 + sci_stp_request_udma_complete_request(ireq, 1974 1974 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 1975 1975 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR); 1976 1976 break; ··· 1985 1985 { 1986 1986 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 1987 1987 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 1988 - scic_sds_request_set_status(ireq, SCU_TASK_DONE_GOOD, 1988 + sci_request_set_status(ireq, SCU_TASK_DONE_GOOD, 1989 1989 SCI_SUCCESS); 1990 1990 1991 1991 sci_change_state(&ireq->sm, SCI_REQ_STP_SOFT_RESET_WAIT_H2D_DIAG); ··· 1997 1997 * If a NAK was received, then it is up to the user to retry 1998 1998 * the request. 1999 1999 */ 2000 - scic_sds_request_set_status(ireq, 2000 + sci_request_set_status(ireq, 2001 2001 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 2002 2002 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR); 2003 2003 ··· 2014 2014 { 2015 2015 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 2016 2016 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 2017 - scic_sds_request_set_status(ireq, SCU_TASK_DONE_GOOD, 2017 + sci_request_set_status(ireq, SCU_TASK_DONE_GOOD, 2018 2018 SCI_SUCCESS); 2019 2019 2020 2020 sci_change_state(&ireq->sm, SCI_REQ_STP_SOFT_RESET_WAIT_D2H); ··· 2025 2025 * a NAK was received, then it is up to the user to retry the 2026 2026 * request. 2027 2027 */ 2028 - scic_sds_request_set_status(ireq, 2028 + sci_request_set_status(ireq, 2029 2029 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 2030 2030 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR); 2031 2031 ··· 2037 2037 } 2038 2038 2039 2039 enum sci_status 2040 - scic_sds_io_request_tc_completion(struct isci_request *ireq, 2040 + sci_io_request_tc_completion(struct isci_request *ireq, 2041 2041 u32 completion_code) 2042 2042 { 2043 2043 enum sci_base_request_states state; ··· 2832 2832 ); 2833 2833 2834 2834 /* complete the io request to the core. */ 2835 - scic_controller_complete_io(ihost, request->target_device, request); 2835 + sci_controller_complete_io(ihost, request->target_device, request); 2836 2836 isci_put_device(idev); 2837 2837 2838 2838 /* set terminated handle so it cannot be completed or ··· 2842 2842 set_bit(IREQ_TERMINATED, &request->flags); 2843 2843 } 2844 2844 2845 - static void scic_sds_request_started_state_enter(struct sci_base_state_machine *sm) 2845 + static void sci_request_started_state_enter(struct sci_base_state_machine *sm) 2846 2846 { 2847 2847 struct isci_request *ireq = container_of(sm, typeof(*ireq), sm); 2848 2848 struct domain_device *dev = ireq->target_device->domain_dev; ··· 2879 2879 } 2880 2880 } 2881 2881 2882 - static void scic_sds_request_completed_state_enter(struct sci_base_state_machine *sm) 2882 + static void sci_request_completed_state_enter(struct sci_base_state_machine *sm) 2883 2883 { 2884 2884 struct isci_request *ireq = container_of(sm, typeof(*ireq), sm); 2885 2885 struct isci_host *ihost = ireq->owning_controller; ··· 2892 2892 isci_task_request_complete(ihost, ireq, ireq->sci_status); 2893 2893 } 2894 2894 2895 - static void scic_sds_request_aborting_state_enter(struct sci_base_state_machine *sm) 2895 + static void sci_request_aborting_state_enter(struct sci_base_state_machine *sm) 2896 2896 { 2897 2897 struct isci_request *ireq = container_of(sm, typeof(*ireq), sm); 2898 2898 ··· 2900 2900 ireq->tc->abort = 1; 2901 2901 } 2902 2902 2903 - static void scic_sds_stp_request_started_non_data_await_h2d_completion_enter(struct sci_base_state_machine *sm) 2903 + static void sci_stp_request_started_non_data_await_h2d_completion_enter(struct sci_base_state_machine *sm) 2904 2904 { 2905 2905 struct isci_request *ireq = container_of(sm, typeof(*ireq), sm); 2906 2906 2907 - scic_sds_remote_device_set_working_request(ireq->target_device, 2907 + sci_remote_device_set_working_request(ireq->target_device, 2908 2908 ireq); 2909 2909 } 2910 2910 2911 - static void scic_sds_stp_request_started_pio_await_h2d_completion_enter(struct sci_base_state_machine *sm) 2911 + static void sci_stp_request_started_pio_await_h2d_completion_enter(struct sci_base_state_machine *sm) 2912 2912 { 2913 2913 struct isci_request *ireq = container_of(sm, typeof(*ireq), sm); 2914 2914 2915 - scic_sds_remote_device_set_working_request(ireq->target_device, 2915 + sci_remote_device_set_working_request(ireq->target_device, 2916 2916 ireq); 2917 2917 } 2918 2918 2919 - static void scic_sds_stp_request_started_soft_reset_await_h2d_asserted_completion_enter(struct sci_base_state_machine *sm) 2919 + static void sci_stp_request_started_soft_reset_await_h2d_asserted_completion_enter(struct sci_base_state_machine *sm) 2920 2920 { 2921 2921 struct isci_request *ireq = container_of(sm, typeof(*ireq), sm); 2922 2922 2923 - scic_sds_remote_device_set_working_request(ireq->target_device, 2923 + sci_remote_device_set_working_request(ireq->target_device, 2924 2924 ireq); 2925 2925 } 2926 2926 2927 - static void scic_sds_stp_request_started_soft_reset_await_h2d_diagnostic_completion_enter(struct sci_base_state_machine *sm) 2927 + static void sci_stp_request_started_soft_reset_await_h2d_diagnostic_completion_enter(struct sci_base_state_machine *sm) 2928 2928 { 2929 2929 struct isci_request *ireq = container_of(sm, typeof(*ireq), sm); 2930 2930 struct scu_task_context *tc = ireq->tc; ··· 2938 2938 /* Clear the TC control bit */ 2939 2939 tc->control_frame = 0; 2940 2940 2941 - status = scic_controller_continue_io(ireq); 2941 + status = sci_controller_continue_io(ireq); 2942 2942 WARN_ONCE(status != SCI_SUCCESS, "isci: continue io failure\n"); 2943 2943 } 2944 2944 2945 - static const struct sci_base_state scic_sds_request_state_table[] = { 2945 + static const struct sci_base_state sci_request_state_table[] = { 2946 2946 [SCI_REQ_INIT] = { }, 2947 2947 [SCI_REQ_CONSTRUCTED] = { }, 2948 2948 [SCI_REQ_STARTED] = { 2949 - .enter_state = scic_sds_request_started_state_enter, 2949 + .enter_state = sci_request_started_state_enter, 2950 2950 }, 2951 2951 [SCI_REQ_STP_NON_DATA_WAIT_H2D] = { 2952 - .enter_state = scic_sds_stp_request_started_non_data_await_h2d_completion_enter, 2952 + .enter_state = sci_stp_request_started_non_data_await_h2d_completion_enter, 2953 2953 }, 2954 2954 [SCI_REQ_STP_NON_DATA_WAIT_D2H] = { }, 2955 2955 [SCI_REQ_STP_PIO_WAIT_H2D] = { 2956 - .enter_state = scic_sds_stp_request_started_pio_await_h2d_completion_enter, 2956 + .enter_state = sci_stp_request_started_pio_await_h2d_completion_enter, 2957 2957 }, 2958 2958 [SCI_REQ_STP_PIO_WAIT_FRAME] = { }, 2959 2959 [SCI_REQ_STP_PIO_DATA_IN] = { }, ··· 2961 2961 [SCI_REQ_STP_UDMA_WAIT_TC_COMP] = { }, 2962 2962 [SCI_REQ_STP_UDMA_WAIT_D2H] = { }, 2963 2963 [SCI_REQ_STP_SOFT_RESET_WAIT_H2D_ASSERTED] = { 2964 - .enter_state = scic_sds_stp_request_started_soft_reset_await_h2d_asserted_completion_enter, 2964 + .enter_state = sci_stp_request_started_soft_reset_await_h2d_asserted_completion_enter, 2965 2965 }, 2966 2966 [SCI_REQ_STP_SOFT_RESET_WAIT_H2D_DIAG] = { 2967 - .enter_state = scic_sds_stp_request_started_soft_reset_await_h2d_diagnostic_completion_enter, 2967 + .enter_state = sci_stp_request_started_soft_reset_await_h2d_diagnostic_completion_enter, 2968 2968 }, 2969 2969 [SCI_REQ_STP_SOFT_RESET_WAIT_D2H] = { }, 2970 2970 [SCI_REQ_TASK_WAIT_TC_COMP] = { }, ··· 2972 2972 [SCI_REQ_SMP_WAIT_RESP] = { }, 2973 2973 [SCI_REQ_SMP_WAIT_TC_COMP] = { }, 2974 2974 [SCI_REQ_COMPLETED] = { 2975 - .enter_state = scic_sds_request_completed_state_enter, 2975 + .enter_state = sci_request_completed_state_enter, 2976 2976 }, 2977 2977 [SCI_REQ_ABORTING] = { 2978 - .enter_state = scic_sds_request_aborting_state_enter, 2978 + .enter_state = sci_request_aborting_state_enter, 2979 2979 }, 2980 2980 [SCI_REQ_FINAL] = { }, 2981 2981 }; 2982 2982 2983 2983 static void 2984 - scic_sds_general_request_construct(struct isci_host *ihost, 2984 + sci_general_request_construct(struct isci_host *ihost, 2985 2985 struct isci_remote_device *idev, 2986 2986 struct isci_request *ireq) 2987 2987 { 2988 - sci_init_sm(&ireq->sm, scic_sds_request_state_table, SCI_REQ_INIT); 2988 + sci_init_sm(&ireq->sm, sci_request_state_table, SCI_REQ_INIT); 2989 2989 2990 2990 ireq->target_device = idev; 2991 2991 ireq->protocol = SCIC_NO_PROTOCOL; ··· 2997 2997 } 2998 2998 2999 2999 static enum sci_status 3000 - scic_io_request_construct(struct isci_host *ihost, 3000 + sci_io_request_construct(struct isci_host *ihost, 3001 3001 struct isci_remote_device *idev, 3002 3002 struct isci_request *ireq) 3003 3003 { ··· 3005 3005 enum sci_status status = SCI_SUCCESS; 3006 3006 3007 3007 /* Build the common part of the request */ 3008 - scic_sds_general_request_construct(ihost, idev, ireq); 3008 + sci_general_request_construct(ihost, idev, ireq); 3009 3009 3010 3010 if (idev->rnc.remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) 3011 3011 return SCI_FAILURE_INVALID_REMOTE_DEVICE; ··· 3024 3024 return status; 3025 3025 } 3026 3026 3027 - enum sci_status scic_task_request_construct(struct isci_host *ihost, 3027 + enum sci_status sci_task_request_construct(struct isci_host *ihost, 3028 3028 struct isci_remote_device *idev, 3029 3029 u16 io_tag, struct isci_request *ireq) 3030 3030 { ··· 3032 3032 enum sci_status status = SCI_SUCCESS; 3033 3033 3034 3034 /* Build the common part of the request */ 3035 - scic_sds_general_request_construct(ihost, idev, ireq); 3035 + sci_general_request_construct(ihost, idev, ireq); 3036 3036 3037 3037 if (dev->dev_type == SAS_END_DEV || 3038 3038 dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) { ··· 3053 3053 "%s: request = %p\n", 3054 3054 __func__, 3055 3055 request); 3056 - status = scic_io_request_construct_basic_ssp(request); 3056 + status = sci_io_request_construct_basic_ssp(request); 3057 3057 return status; 3058 3058 } 3059 3059 ··· 3074 3074 */ 3075 3075 register_fis = isci_sata_task_to_fis_copy(task); 3076 3076 3077 - status = scic_io_request_construct_basic_sata(request); 3077 + status = sci_io_request_construct_basic_sata(request); 3078 3078 3079 3079 /* Set the ncq tag in the fis, from the queue 3080 3080 * command in the task. ··· 3091 3091 } 3092 3092 3093 3093 static enum sci_status 3094 - scic_io_request_construct_smp(struct device *dev, 3094 + sci_io_request_construct_smp(struct device *dev, 3095 3095 struct isci_request *ireq, 3096 3096 struct sas_task *task) 3097 3097 { ··· 3141 3141 3142 3142 task_context = ireq->tc; 3143 3143 3144 - idev = scic_sds_request_get_device(ireq); 3145 - iport = scic_sds_request_get_port(ireq); 3144 + idev = sci_request_get_device(ireq); 3145 + iport = sci_request_get_port(ireq); 3146 3146 3147 3147 /* 3148 3148 * Fill in the TC with the its required data ··· 3152 3152 task_context->initiator_request = 1; 3153 3153 task_context->connection_rate = idev->connection_rate; 3154 3154 task_context->protocol_engine_index = 3155 - scic_sds_controller_get_protocol_engine_group(ihost); 3156 - task_context->logical_port_index = scic_sds_port_get_index(iport); 3155 + sci_controller_get_protocol_engine_group(ihost); 3156 + task_context->logical_port_index = sci_port_get_index(iport); 3157 3157 task_context->protocol_type = SCU_TASK_CONTEXT_PROTOCOL_SMP; 3158 3158 task_context->abort = 0; 3159 3159 task_context->valid = SCU_TASK_CONTEXT_VALID; ··· 3195 3195 task_context->task_phase = 0; 3196 3196 3197 3197 ireq->post_context = (SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC | 3198 - (scic_sds_controller_get_protocol_engine_group(ihost) << 3198 + (sci_controller_get_protocol_engine_group(ihost) << 3199 3199 SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) | 3200 - (scic_sds_port_get_index(iport) << 3200 + (sci_port_get_index(iport) << 3201 3201 SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) | 3202 3202 ISCI_TAG_TCI(ireq->io_tag)); 3203 3203 /* ··· 3229 3229 struct device *dev = &ireq->isci_host->pdev->dev; 3230 3230 enum sci_status status = SCI_FAILURE; 3231 3231 3232 - status = scic_io_request_construct_smp(dev, ireq, task); 3232 + status = sci_io_request_construct_smp(dev, ireq, task); 3233 3233 if (status != SCI_SUCCESS) 3234 3234 dev_warn(&ireq->isci_host->pdev->dev, 3235 3235 "%s: failed with status = %d\n", ··· 3283 3283 return SCI_FAILURE_INSUFFICIENT_RESOURCES; 3284 3284 } 3285 3285 3286 - status = scic_io_request_construct(ihost, idev, request); 3286 + status = sci_io_request_construct(ihost, idev, request); 3287 3287 3288 3288 if (status != SCI_SUCCESS) { 3289 3289 dev_warn(&ihost->pdev->dev, ··· 3388 3388 * request was built that way (ie. 3389 3389 * ireq->is_task_management_request is false). 3390 3390 */ 3391 - status = scic_controller_start_task(ihost, 3391 + status = sci_controller_start_task(ihost, 3392 3392 idev, 3393 3393 ireq); 3394 3394 } else { ··· 3396 3396 } 3397 3397 } else { 3398 3398 /* send the request, let the core assign the IO TAG. */ 3399 - status = scic_controller_start_io(ihost, idev, 3399 + status = sci_controller_start_io(ihost, idev, 3400 3400 ireq); 3401 3401 } 3402 3402
+26 -26
drivers/scsi/isci/request.h
··· 301 301 }; 302 302 303 303 /** 304 - * scic_sds_request_get_controller() - 304 + * sci_request_get_controller() - 305 305 * 306 306 * This macro will return the controller for this io request object 307 307 */ 308 - #define scic_sds_request_get_controller(ireq) \ 308 + #define sci_request_get_controller(ireq) \ 309 309 ((ireq)->owning_controller) 310 310 311 311 /** 312 - * scic_sds_request_get_device() - 312 + * sci_request_get_device() - 313 313 * 314 314 * This macro will return the device for this io request object 315 315 */ 316 - #define scic_sds_request_get_device(ireq) \ 316 + #define sci_request_get_device(ireq) \ 317 317 ((ireq)->target_device) 318 318 319 319 /** 320 - * scic_sds_request_get_port() - 320 + * sci_request_get_port() - 321 321 * 322 322 * This macro will return the port for this io request object 323 323 */ 324 - #define scic_sds_request_get_port(ireq) \ 325 - scic_sds_remote_device_get_port(scic_sds_request_get_device(ireq)) 324 + #define sci_request_get_port(ireq) \ 325 + sci_remote_device_get_port(sci_request_get_device(ireq)) 326 326 327 327 /** 328 - * scic_sds_request_get_post_context() - 328 + * sci_request_get_post_context() - 329 329 * 330 330 * This macro returns the constructed post context result for the io request. 331 331 */ 332 - #define scic_sds_request_get_post_context(ireq) \ 332 + #define sci_request_get_post_context(ireq) \ 333 333 ((ireq)->post_context) 334 334 335 335 /** 336 - * scic_sds_request_get_task_context() - 336 + * sci_request_get_task_context() - 337 337 * 338 338 * This is a helper macro to return the os handle for this request object. 339 339 */ 340 - #define scic_sds_request_get_task_context(request) \ 340 + #define sci_request_get_task_context(request) \ 341 341 ((request)->task_context_buffer) 342 342 343 343 /** 344 - * scic_sds_request_set_status() - 344 + * sci_request_set_status() - 345 345 * 346 346 * This macro will set the scu hardware status and sci request completion 347 347 * status for an io request. 348 348 */ 349 - #define scic_sds_request_set_status(request, scu_status_code, sci_status_code) \ 349 + #define sci_request_set_status(request, scu_status_code, sci_status_code) \ 350 350 { \ 351 351 (request)->scu_status = (scu_status_code); \ 352 352 (request)->sci_status = (sci_status_code); \ 353 353 } 354 354 355 - enum sci_status scic_sds_request_start(struct isci_request *ireq); 356 - enum sci_status scic_sds_io_request_terminate(struct isci_request *ireq); 355 + enum sci_status sci_request_start(struct isci_request *ireq); 356 + enum sci_status sci_io_request_terminate(struct isci_request *ireq); 357 357 enum sci_status 358 - scic_sds_io_request_event_handler(struct isci_request *ireq, 358 + sci_io_request_event_handler(struct isci_request *ireq, 359 359 u32 event_code); 360 360 enum sci_status 361 - scic_sds_io_request_frame_handler(struct isci_request *ireq, 361 + sci_io_request_frame_handler(struct isci_request *ireq, 362 362 u32 frame_index); 363 363 enum sci_status 364 - scic_sds_task_request_terminate(struct isci_request *ireq); 364 + sci_task_request_terminate(struct isci_request *ireq); 365 365 extern enum sci_status 366 - scic_sds_request_complete(struct isci_request *ireq); 366 + sci_request_complete(struct isci_request *ireq); 367 367 extern enum sci_status 368 - scic_sds_io_request_tc_completion(struct isci_request *ireq, u32 code); 368 + sci_io_request_tc_completion(struct isci_request *ireq, u32 code); 369 369 370 370 /* XXX open code in caller */ 371 371 static inline dma_addr_t 372 - scic_io_request_get_dma_addr(struct isci_request *ireq, void *virt_addr) 372 + sci_io_request_get_dma_addr(struct isci_request *ireq, void *virt_addr) 373 373 { 374 374 375 375 char *requested_addr = (char *)virt_addr; ··· 500 500 void isci_terminate_pending_requests(struct isci_host *ihost, 501 501 struct isci_remote_device *idev); 502 502 enum sci_status 503 - scic_task_request_construct(struct isci_host *ihost, 503 + sci_task_request_construct(struct isci_host *ihost, 504 504 struct isci_remote_device *idev, 505 505 u16 io_tag, 506 506 struct isci_request *ireq); 507 507 enum sci_status 508 - scic_task_request_construct_ssp(struct isci_request *ireq); 508 + sci_task_request_construct_ssp(struct isci_request *ireq); 509 509 enum sci_status 510 - scic_task_request_construct_sata(struct isci_request *ireq); 510 + sci_task_request_construct_sata(struct isci_request *ireq); 511 511 void 512 - scic_stp_io_request_set_ncq_tag(struct isci_request *ireq, u16 ncq_tag); 513 - void scic_sds_smp_request_copy_response(struct isci_request *ireq); 512 + sci_stp_io_request_set_ncq_tag(struct isci_request *ireq, u16 ncq_tag); 513 + void sci_smp_request_copy_response(struct isci_request *ireq); 514 514 515 515 static inline int isci_task_is_ncq_recovery(struct sas_task *task) 516 516 {
+2 -2
drivers/scsi/isci/sata.c
··· 116 116 struct isci_request *request = task->lldd_task; 117 117 118 118 register_fis->sector_count = qc->tag << 3; 119 - scic_stp_io_request_set_ncq_tag(request, qc->tag); 119 + sci_stp_io_request_set_ncq_tag(request, qc->tag); 120 120 } 121 121 122 122 /** ··· 187 187 /* core builds the protocol specific request 188 188 * based on the h2d fis. 189 189 */ 190 - status = scic_task_request_construct_sata(ireq); 190 + status = sci_task_request_construct_sata(ireq); 191 191 192 192 return status; 193 193 }
+12 -12
drivers/scsi/isci/task.c
··· 257 257 return NULL; 258 258 259 259 /* let the core do it's construct. */ 260 - status = scic_task_request_construct(ihost, idev, tag, 260 + status = sci_task_request_construct(ihost, idev, tag, 261 261 ireq); 262 262 263 263 if (status != SCI_SUCCESS) { 264 264 dev_warn(&ihost->pdev->dev, 265 - "%s: scic_task_request_construct failed - " 265 + "%s: sci_task_request_construct failed - " 266 266 "status = 0x%x\n", 267 267 __func__, 268 268 status); ··· 272 272 /* XXX convert to get this from task->tproto like other drivers */ 273 273 if (dev->dev_type == SAS_END_DEV) { 274 274 isci_tmf->proto = SAS_PROTOCOL_SSP; 275 - status = scic_task_request_construct_ssp(ireq); 275 + status = sci_task_request_construct_ssp(ireq); 276 276 if (status != SCI_SUCCESS) 277 277 return NULL; 278 278 } ··· 332 332 spin_lock_irqsave(&ihost->scic_lock, flags); 333 333 334 334 /* start the TMF io. */ 335 - status = scic_controller_start_task(ihost, idev, ireq); 335 + status = sci_controller_start_task(ihost, idev, ireq); 336 336 337 337 if (status != SCI_TASK_SUCCESS) { 338 338 dev_warn(&ihost->pdev->dev, ··· 364 364 if (tmf->cb_state_func != NULL) 365 365 tmf->cb_state_func(isci_tmf_timed_out, tmf, tmf->cb_data); 366 366 367 - scic_controller_terminate_request(ihost, 367 + sci_controller_terminate_request(ihost, 368 368 idev, 369 369 ireq); 370 370 ··· 556 556 if (!test_bit(IREQ_TERMINATED, &isci_request->flags)) { 557 557 was_terminated = true; 558 558 needs_cleanup_handling = true; 559 - status = scic_controller_terminate_request(ihost, 559 + status = sci_controller_terminate_request(ihost, 560 560 idev, 561 561 isci_request); 562 562 } ··· 569 569 */ 570 570 if (status != SCI_SUCCESS) { 571 571 dev_err(&ihost->pdev->dev, 572 - "%s: scic_controller_terminate_request" 572 + "%s: sci_controller_terminate_request" 573 573 " returned = 0x%x\n", 574 574 __func__, status); 575 575 ··· 1251 1251 /* PRINT_TMF( ((struct isci_tmf *)request->task)); */ 1252 1252 tmf_complete = tmf->complete; 1253 1253 1254 - scic_controller_complete_io(ihost, ireq->target_device, ireq); 1254 + sci_controller_complete_io(ihost, ireq->target_device, ireq); 1255 1255 /* set the 'terminated' flag handle to make sure it cannot be terminated 1256 1256 * or completed again. 1257 1257 */ ··· 1514 1514 dev_dbg(&ihost->pdev->dev, "%s: idev %p\n", __func__, idev); 1515 1515 1516 1516 spin_lock_irqsave(&ihost->scic_lock, flags); 1517 - status = scic_remote_device_reset(idev); 1517 + status = sci_remote_device_reset(idev); 1518 1518 if (status != SCI_SUCCESS) { 1519 1519 spin_unlock_irqrestore(&ihost->scic_lock, flags); 1520 1520 1521 1521 dev_warn(&ihost->pdev->dev, 1522 - "%s: scic_remote_device_reset(%p) returned %d!\n", 1522 + "%s: sci_remote_device_reset(%p) returned %d!\n", 1523 1523 __func__, idev, status); 1524 1524 1525 1525 return TMF_RESP_FUNC_FAILED; ··· 1540 1540 1541 1541 /* Since all pending TCs have been cleaned, resume the RNC. */ 1542 1542 spin_lock_irqsave(&ihost->scic_lock, flags); 1543 - status = scic_remote_device_reset_complete(idev); 1543 + status = sci_remote_device_reset_complete(idev); 1544 1544 spin_unlock_irqrestore(&ihost->scic_lock, flags); 1545 1545 1546 1546 /* If this is a device on an expander, bring the phy back up. */ ··· 1560 1560 1561 1561 if (status != SCI_SUCCESS) { 1562 1562 dev_warn(&ihost->pdev->dev, 1563 - "%s: scic_remote_device_reset_complete(%p) " 1563 + "%s: sci_remote_device_reset_complete(%p) " 1564 1564 "returned %d!\n", __func__, idev, status); 1565 1565 } 1566 1566
+14 -43
drivers/scsi/isci/unsolicited_frame_control.c
··· 57 57 #include "unsolicited_frame_control.h" 58 58 #include "registers.h" 59 59 60 - int scic_sds_unsolicited_frame_control_construct(struct isci_host *ihost) 60 + int sci_unsolicited_frame_control_construct(struct isci_host *ihost) 61 61 { 62 - struct scic_sds_unsolicited_frame_control *uf_control = &ihost->uf_control; 63 - struct scic_sds_unsolicited_frame *uf; 62 + struct sci_unsolicited_frame_control *uf_control = &ihost->uf_control; 63 + struct sci_unsolicited_frame *uf; 64 64 u32 buf_len, header_len, i; 65 65 dma_addr_t dma; 66 66 size_t size; ··· 139 139 return 0; 140 140 } 141 141 142 - /** 143 - * This method returns the frame header for the specified frame index. 144 - * @uf_control: 145 - * @frame_index: 146 - * @frame_header: 147 - * 148 - * enum sci_status 149 - */ 150 - enum sci_status scic_sds_unsolicited_frame_control_get_header( 151 - struct scic_sds_unsolicited_frame_control *uf_control, 152 - u32 frame_index, 153 - void **frame_header) 142 + enum sci_status sci_unsolicited_frame_control_get_header(struct sci_unsolicited_frame_control *uf_control, 143 + u32 frame_index, 144 + void **frame_header) 154 145 { 155 146 if (frame_index < SCU_MAX_UNSOLICITED_FRAMES) { 156 - /* 157 - * Skip the first word in the frame since this is a controll word used 158 - * by the hardware. */ 147 + /* Skip the first word in the frame since this is a controll word used 148 + * by the hardware. 149 + */ 159 150 *frame_header = &uf_control->buffers.array[frame_index].header->data; 160 151 161 152 return SCI_SUCCESS; ··· 155 164 return SCI_FAILURE_INVALID_PARAMETER_VALUE; 156 165 } 157 166 158 - /** 159 - * This method returns the frame buffer for the specified frame index. 160 - * @uf_control: 161 - * @frame_index: 162 - * @frame_buffer: 163 - * 164 - * enum sci_status 165 - */ 166 - enum sci_status scic_sds_unsolicited_frame_control_get_buffer( 167 - struct scic_sds_unsolicited_frame_control *uf_control, 168 - u32 frame_index, 169 - void **frame_buffer) 167 + enum sci_status sci_unsolicited_frame_control_get_buffer(struct sci_unsolicited_frame_control *uf_control, 168 + u32 frame_index, 169 + void **frame_buffer) 170 170 { 171 171 if (frame_index < SCU_MAX_UNSOLICITED_FRAMES) { 172 172 *frame_buffer = uf_control->buffers.array[frame_index].buffer; ··· 168 186 return SCI_FAILURE_INVALID_PARAMETER_VALUE; 169 187 } 170 188 171 - /** 172 - * This method releases the frame once this is done the frame is available for 173 - * re-use by the hardware. The data contained in the frame header and frame 174 - * buffer is no longer valid. 175 - * @uf_control: This parameter specifies the UF control object 176 - * @frame_index: This parameter specifies the frame index to attempt to release. 177 - * 178 - * This method returns an indication to the caller as to whether the 179 - * unsolicited frame get pointer should be updated. 180 - */ 181 - bool scic_sds_unsolicited_frame_control_release_frame( 182 - struct scic_sds_unsolicited_frame_control *uf_control, 183 - u32 frame_index) 189 + bool sci_unsolicited_frame_control_release_frame(struct sci_unsolicited_frame_control *uf_control, 190 + u32 frame_index) 184 191 { 185 192 u32 frame_get; 186 193 u32 frame_cycle;
+21 -21
drivers/scsi/isci/unsolicited_frame_control.h
··· 92 92 }; 93 93 94 94 /** 95 - * struct scic_sds_unsolicited_frame - 95 + * struct sci_unsolicited_frame - 96 96 * 97 97 * This is the unsolicited frame data structure it acts as the container for 98 98 * the current frame state, frame header and frame buffer. 99 99 */ 100 - struct scic_sds_unsolicited_frame { 100 + struct sci_unsolicited_frame { 101 101 /** 102 102 * This field contains the current frame state 103 103 */ ··· 116 116 }; 117 117 118 118 /** 119 - * struct scic_sds_uf_header_array - 119 + * struct sci_uf_header_array - 120 120 * 121 121 * This structure contains all of the unsolicited frame header information. 122 122 */ 123 - struct scic_sds_uf_header_array { 123 + struct sci_uf_header_array { 124 124 /** 125 125 * This field is represents a virtual pointer to the start 126 126 * address of the UF address table. The table contains ··· 137 137 }; 138 138 139 139 /** 140 - * struct scic_sds_uf_buffer_array - 140 + * struct sci_uf_buffer_array - 141 141 * 142 142 * This structure contains all of the unsolicited frame buffer (actual payload) 143 143 * information. 144 144 */ 145 - struct scic_sds_uf_buffer_array { 145 + struct sci_uf_buffer_array { 146 146 /** 147 147 * This field is the unsolicited frame data its used to manage 148 148 * the data for the unsolicited frame requests. It also represents 149 149 * the virtual address location that corresponds to the 150 150 * physical_address field. 151 151 */ 152 - struct scic_sds_unsolicited_frame array[SCU_MAX_UNSOLICITED_FRAMES]; 152 + struct sci_unsolicited_frame array[SCU_MAX_UNSOLICITED_FRAMES]; 153 153 154 154 /** 155 155 * This field specifies the physical address location for the UF ··· 159 159 }; 160 160 161 161 /** 162 - * struct scic_sds_uf_address_table_array - 162 + * struct sci_uf_address_table_array - 163 163 * 164 164 * This object maintains all of the unsolicited frame address table specific 165 165 * data. The address table is a collection of 64-bit pointers that point to 166 166 * 1KB buffers into which the silicon will DMA unsolicited frames. 167 167 */ 168 - struct scic_sds_uf_address_table_array { 168 + struct sci_uf_address_table_array { 169 169 /** 170 170 * This field represents a virtual pointer that refers to the 171 171 * starting address of the UF address table. ··· 182 182 }; 183 183 184 184 /** 185 - * struct scic_sds_unsolicited_frame_control - 185 + * struct sci_unsolicited_frame_control - 186 186 * 187 187 * This object contains all of the data necessary to handle unsolicited frames. 188 188 */ 189 - struct scic_sds_unsolicited_frame_control { 189 + struct sci_unsolicited_frame_control { 190 190 /** 191 191 * This field is the software copy of the unsolicited frame queue 192 192 * get pointer. The controller object writes this value to the ··· 198 198 * This field contains all of the unsolicited frame header 199 199 * specific fields. 200 200 */ 201 - struct scic_sds_uf_header_array headers; 201 + struct sci_uf_header_array headers; 202 202 203 203 /** 204 204 * This field contains all of the unsolicited frame buffer 205 205 * specific fields. 206 206 */ 207 - struct scic_sds_uf_buffer_array buffers; 207 + struct sci_uf_buffer_array buffers; 208 208 209 209 /** 210 210 * This field contains all of the unsolicited frame address table 211 211 * specific fields. 212 212 */ 213 - struct scic_sds_uf_address_table_array address_table; 213 + struct sci_uf_address_table_array address_table; 214 214 215 215 }; 216 216 217 217 struct isci_host; 218 218 219 - int scic_sds_unsolicited_frame_control_construct(struct isci_host *ihost); 219 + int sci_unsolicited_frame_control_construct(struct isci_host *ihost); 220 220 221 - enum sci_status scic_sds_unsolicited_frame_control_get_header( 222 - struct scic_sds_unsolicited_frame_control *uf_control, 221 + enum sci_status sci_unsolicited_frame_control_get_header( 222 + struct sci_unsolicited_frame_control *uf_control, 223 223 u32 frame_index, 224 224 void **frame_header); 225 225 226 - enum sci_status scic_sds_unsolicited_frame_control_get_buffer( 227 - struct scic_sds_unsolicited_frame_control *uf_control, 226 + enum sci_status sci_unsolicited_frame_control_get_buffer( 227 + struct sci_unsolicited_frame_control *uf_control, 228 228 u32 frame_index, 229 229 void **frame_buffer); 230 230 231 - bool scic_sds_unsolicited_frame_control_release_frame( 232 - struct scic_sds_unsolicited_frame_control *uf_control, 231 + bool sci_unsolicited_frame_control_release_frame( 232 + struct sci_unsolicited_frame_control *uf_control, 233 233 u32 frame_index); 234 234 235 235 #endif /* _SCIC_SDS_UNSOLICITED_FRAME_CONTROL_H_ */