aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2011-02-23 18:57:30 -0500
committerDan Williams <dan.j.williams@intel.com>2011-07-03 06:55:28 -0400
commita1914059f1434b0cdf113ebf16df627fd85689d0 (patch)
tree681f93cc1759c194b30c053168e017bba9a541cf
parent6389a77596f36cf04ad8b1c7d43ec1d6cdfe89cb (diff)
isci: Change event notify calls from scic_cb_* to isci_event_*
Renaming the callbacks to apparopriate event notify calls for the LLDD. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r--drivers/scsi/isci/core/scic_sds_controller.c24
-rw-r--r--drivers/scsi/isci/core/scic_sds_phy.c14
-rw-r--r--drivers/scsi/isci/core/scic_sds_port.c37
-rw-r--r--drivers/scsi/isci/core/scic_sds_port_configuration_agent.c10
-rw-r--r--drivers/scsi/isci/core/scic_sds_remote_device.c10
-rw-r--r--drivers/scsi/isci/core/scic_sds_request.c4
-rw-r--r--drivers/scsi/isci/core/scic_sds_smp_remote_device.c4
-rw-r--r--drivers/scsi/isci/core/scic_sds_stp_remote_device.c6
-rw-r--r--drivers/scsi/isci/core/scic_user_callback.h315
-rw-r--r--drivers/scsi/isci/events.c90
-rw-r--r--drivers/scsi/isci/events.h370
-rw-r--r--drivers/scsi/isci/isci.h1
12 files changed, 476 insertions, 409 deletions
diff --git a/drivers/scsi/isci/core/scic_sds_controller.c b/drivers/scsi/isci/core/scic_sds_controller.c
index e8d09fd935ec..b0f9221d1454 100644
--- a/drivers/scsi/isci/core/scic_sds_controller.c
+++ b/drivers/scsi/isci/core/scic_sds_controller.c
@@ -256,7 +256,7 @@ static void scic_sds_controller_phy_startup_timeout_handler(
256void scic_sds_controller_initialize_phy_startup( 256void scic_sds_controller_initialize_phy_startup(
257 struct scic_sds_controller *this_controller) 257 struct scic_sds_controller *this_controller)
258{ 258{
259 this_controller->phy_startup_timer = scic_cb_timer_create( 259 this_controller->phy_startup_timer = isci_event_timer_create(
260 this_controller, 260 this_controller,
261 scic_sds_controller_phy_startup_timeout_handler, 261 scic_sds_controller_phy_startup_timeout_handler,
262 this_controller 262 this_controller
@@ -275,7 +275,7 @@ void scic_sds_controller_initialize_phy_startup(
275void scic_sds_controller_initialize_power_control( 275void scic_sds_controller_initialize_power_control(
276 struct scic_sds_controller *this_controller) 276 struct scic_sds_controller *this_controller)
277{ 277{
278 this_controller->power_control.timer = scic_cb_timer_create( 278 this_controller->power_control.timer = isci_event_timer_create(
279 this_controller, 279 this_controller,
280 scic_sds_controller_power_control_timer_handler, 280 scic_sds_controller_power_control_timer_handler,
281 this_controller 281 this_controller
@@ -734,7 +734,7 @@ static void scic_sds_controller_transition_to_ready(
734 SCI_BASE_CONTROLLER_STATE_READY 734 SCI_BASE_CONTROLLER_STATE_READY
735 ); 735 );
736 736
737 scic_cb_controller_start_complete(this_controller, status); 737 isci_event_controller_start_complete(this_controller, status);
738 } 738 }
739} 739}
740 740
@@ -757,7 +757,7 @@ void scic_sds_controller_timeout_handler(
757 sci_base_state_machine_change_state( 757 sci_base_state_machine_change_state(
758 scic_sds_controller_get_base_state_machine(scic), 758 scic_sds_controller_get_base_state_machine(scic),
759 SCI_BASE_CONTROLLER_STATE_FAILED); 759 SCI_BASE_CONTROLLER_STATE_FAILED);
760 scic_cb_controller_stop_complete(scic, SCI_FAILURE_TIMEOUT); 760 isci_event_controller_stop_complete(scic, SCI_FAILURE_TIMEOUT);
761 } else /* / @todo Now what do we want to do in this case? */ 761 } else /* / @todo Now what do we want to do in this case? */
762 dev_err(scic_to_dev(scic), 762 dev_err(scic_to_dev(scic),
763 "%s: Controller timer fired when controller was not " 763 "%s: Controller timer fired when controller was not "
@@ -823,7 +823,7 @@ enum sci_status scic_sds_controller_stop_ports(struct scic_sds_controller *scic)
823static void scic_sds_controller_phy_timer_start( 823static void scic_sds_controller_phy_timer_start(
824 struct scic_sds_controller *this_controller) 824 struct scic_sds_controller *this_controller)
825{ 825{
826 scic_cb_timer_start( 826 isci_event_timer_start(
827 this_controller, 827 this_controller,
828 this_controller->phy_startup_timer, 828 this_controller->phy_startup_timer,
829 SCIC_SDS_CONTROLLER_PHY_START_TIMEOUT 829 SCIC_SDS_CONTROLLER_PHY_START_TIMEOUT
@@ -840,7 +840,7 @@ static void scic_sds_controller_phy_timer_start(
840void scic_sds_controller_phy_timer_stop( 840void scic_sds_controller_phy_timer_stop(
841 struct scic_sds_controller *this_controller) 841 struct scic_sds_controller *this_controller)
842{ 842{
843 scic_cb_timer_stop( 843 isci_event_timer_stop(
844 this_controller, 844 this_controller,
845 this_controller->phy_startup_timer 845 this_controller->phy_startup_timer
846 ); 846 );
@@ -1041,7 +1041,7 @@ enum sci_status scic_sds_controller_stop_devices(
1041static void scic_sds_controller_power_control_timer_start( 1041static void scic_sds_controller_power_control_timer_start(
1042 struct scic_sds_controller *this_controller) 1042 struct scic_sds_controller *this_controller)
1043{ 1043{
1044 scic_cb_timer_start( 1044 isci_event_timer_start(
1045 this_controller, this_controller->power_control.timer, 1045 this_controller, this_controller->power_control.timer,
1046 SCIC_SDS_CONTROLLER_POWER_CONTROL_INTERVAL 1046 SCIC_SDS_CONTROLLER_POWER_CONTROL_INTERVAL
1047 ); 1047 );
@@ -2809,7 +2809,7 @@ static enum sci_status scic_sds_controller_reset_state_initialize_handler(
2809 SCI_BASE_CONTROLLER_STATE_INITIALIZING 2809 SCI_BASE_CONTROLLER_STATE_INITIALIZING
2810 ); 2810 );
2811 2811
2812 this_controller->timeout_timer = scic_cb_timer_create( 2812 this_controller->timeout_timer = isci_event_timer_create(
2813 this_controller, 2813 this_controller,
2814 (void (*)(void *))scic_sds_controller_timeout_handler, 2814 (void (*)(void *))scic_sds_controller_timeout_handler,
2815 (void (*)(void *))controller); 2815 (void (*)(void *))controller);
@@ -3040,7 +3040,7 @@ static enum sci_status scic_sds_controller_initialized_state_start_handler(
3040 if (SCI_SUCCESS == result) { 3040 if (SCI_SUCCESS == result) {
3041 scic_sds_controller_start_next_phy(this_controller); 3041 scic_sds_controller_start_next_phy(this_controller);
3042 3042
3043 scic_cb_timer_start(this_controller, 3043 isci_event_timer_start(this_controller,
3044 this_controller->timeout_timer, 3044 this_controller->timeout_timer,
3045 timeout); 3045 timeout);
3046 3046
@@ -3130,7 +3130,7 @@ static enum sci_status scic_sds_controller_ready_state_stop_handler(
3130 3130
3131 this_controller = (struct scic_sds_controller *)controller; 3131 this_controller = (struct scic_sds_controller *)controller;
3132 3132
3133 scic_cb_timer_start(this_controller, 3133 isci_event_timer_start(this_controller,
3134 this_controller->timeout_timer, 3134 this_controller->timeout_timer,
3135 timeout); 3135 timeout);
3136 3136
@@ -3578,7 +3578,7 @@ static void scic_sds_controller_starting_state_exit(
3578{ 3578{
3579 struct scic_sds_controller *scic = (struct scic_sds_controller *)object; 3579 struct scic_sds_controller *scic = (struct scic_sds_controller *)object;
3580 3580
3581 scic_cb_timer_stop(scic, scic->timeout_timer); 3581 isci_event_timer_stop(scic, scic->timeout_timer);
3582} 3582}
3583 3583
3584/** 3584/**
@@ -3660,7 +3660,7 @@ static void scic_sds_controller_stopping_state_exit(
3660 3660
3661 this_controller = (struct scic_sds_controller *)object; 3661 this_controller = (struct scic_sds_controller *)object;
3662 3662
3663 scic_cb_timer_stop(this_controller, this_controller->timeout_timer); 3663 isci_event_timer_stop(this_controller, this_controller->timeout_timer);
3664} 3664}
3665 3665
3666/** 3666/**
diff --git a/drivers/scsi/isci/core/scic_sds_phy.c b/drivers/scsi/isci/core/scic_sds_phy.c
index e8d5be73cd0b..92a5d294809d 100644
--- a/drivers/scsi/isci/core/scic_sds_phy.c
+++ b/drivers/scsi/isci/core/scic_sds_phy.c
@@ -370,7 +370,7 @@ enum sci_status scic_sds_phy_initialize(
370 struct scu_link_layer_registers __iomem *link_layer_registers) 370 struct scu_link_layer_registers __iomem *link_layer_registers)
371{ 371{
372 /* Create the SIGNATURE FIS Timeout timer for this phy */ 372 /* Create the SIGNATURE FIS Timeout timer for this phy */
373 sci_phy->sata_timeout_timer = scic_cb_timer_create( 373 sci_phy->sata_timeout_timer = isci_event_timer_create(
374 scic_sds_phy_get_controller(sci_phy), 374 scic_sds_phy_get_controller(sci_phy),
375 scic_sds_phy_sata_timeout, 375 scic_sds_phy_sata_timeout,
376 sci_phy 376 sci_phy
@@ -1746,7 +1746,7 @@ static void scic_sds_phy_starting_await_sata_phy_substate_enter(
1746 this_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_PHY_EN 1746 this_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_PHY_EN
1747 ); 1747 );
1748 1748
1749 scic_cb_timer_start( 1749 isci_event_timer_start(
1750 scic_sds_phy_get_controller(this_phy), 1750 scic_sds_phy_get_controller(this_phy),
1751 this_phy->sata_timeout_timer, 1751 this_phy->sata_timeout_timer,
1752 SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT 1752 SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT
@@ -1768,7 +1768,7 @@ static void scic_sds_phy_starting_await_sata_phy_substate_exit(
1768 1768
1769 this_phy = (struct scic_sds_phy *)object; 1769 this_phy = (struct scic_sds_phy *)object;
1770 1770
1771 scic_cb_timer_stop( 1771 isci_event_timer_stop(
1772 scic_sds_phy_get_controller(this_phy), 1772 scic_sds_phy_get_controller(this_phy),
1773 this_phy->sata_timeout_timer 1773 this_phy->sata_timeout_timer
1774 ); 1774 );
@@ -1793,7 +1793,7 @@ static void scic_sds_phy_starting_await_sata_speed_substate_enter(
1793 this_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_SPEED_EN 1793 this_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_SPEED_EN
1794 ); 1794 );
1795 1795
1796 scic_cb_timer_start( 1796 isci_event_timer_start(
1797 scic_sds_phy_get_controller(this_phy), 1797 scic_sds_phy_get_controller(this_phy),
1798 this_phy->sata_timeout_timer, 1798 this_phy->sata_timeout_timer,
1799 SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT 1799 SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT
@@ -1815,7 +1815,7 @@ static void scic_sds_phy_starting_await_sata_speed_substate_exit(
1815 1815
1816 this_phy = (struct scic_sds_phy *)object; 1816 this_phy = (struct scic_sds_phy *)object;
1817 1817
1818 scic_cb_timer_stop( 1818 isci_event_timer_stop(
1819 scic_sds_phy_get_controller(this_phy), 1819 scic_sds_phy_get_controller(this_phy),
1820 this_phy->sata_timeout_timer 1820 this_phy->sata_timeout_timer
1821 ); 1821 );
@@ -1854,7 +1854,7 @@ static void scic_sds_phy_starting_await_sig_fis_uf_substate_enter(
1854 * condition is cleared. */ 1854 * condition is cleared. */
1855 scic_sds_phy_resume(this_phy); 1855 scic_sds_phy_resume(this_phy);
1856 1856
1857 scic_cb_timer_start( 1857 isci_event_timer_start(
1858 scic_sds_phy_get_controller(this_phy), 1858 scic_sds_phy_get_controller(this_phy),
1859 this_phy->sata_timeout_timer, 1859 this_phy->sata_timeout_timer,
1860 SCIC_SDS_SIGNATURE_FIS_TIMEOUT 1860 SCIC_SDS_SIGNATURE_FIS_TIMEOUT
@@ -1879,7 +1879,7 @@ static void scic_sds_phy_starting_await_sig_fis_uf_substate_exit(
1879 1879
1880 this_phy = (struct scic_sds_phy *)object; 1880 this_phy = (struct scic_sds_phy *)object;
1881 1881
1882 scic_cb_timer_stop( 1882 isci_event_timer_stop(
1883 scic_sds_phy_get_controller(this_phy), 1883 scic_sds_phy_get_controller(this_phy),
1884 this_phy->sata_timeout_timer 1884 this_phy->sata_timeout_timer
1885 ); 1885 );
diff --git a/drivers/scsi/isci/core/scic_sds_port.c b/drivers/scsi/isci/core/scic_sds_port.c
index b8acc234a63d..f31e6dc42524 100644
--- a/drivers/scsi/isci/core/scic_sds_port.c
+++ b/drivers/scsi/isci/core/scic_sds_port.c
@@ -565,7 +565,7 @@ enum sci_status scic_sds_port_initialize(
565 * the timer and start the state machine */ 565 * the timer and start the state machine */
566 if (this_port->physical_port_index != SCI_MAX_PORTS) { 566 if (this_port->physical_port_index != SCI_MAX_PORTS) {
567 /* / @todo should we create the timer at create time? */ 567 /* / @todo should we create the timer at create time? */
568 this_port->timer_handle = scic_cb_timer_create( 568 this_port->timer_handle = isci_event_timer_create(
569 scic_sds_port_get_controller(this_port), 569 scic_sds_port_get_controller(this_port),
570 scic_sds_port_timeout_handler, 570 scic_sds_port_timeout_handler,
571 this_port 571 this_port
@@ -727,7 +727,9 @@ void scic_sds_port_activate_phy(
727 scic_sds_controller_clear_invalid_phy(controller, the_phy); 727 scic_sds_controller_clear_invalid_phy(controller, the_phy);
728 728
729 if (do_notify_user == true) 729 if (do_notify_user == true)
730 scic_cb_port_link_up(this_port->owning_controller, this_port, the_phy); 730 isci_event_port_link_up(this_port->owning_controller,
731 this_port,
732 the_phy);
731} 733}
732 734
733/** 735/**
@@ -735,7 +737,8 @@ void scic_sds_port_activate_phy(
735 * @this_port: This is the port on which the phy should be deactivated. 737 * @this_port: This is the port on which the phy should be deactivated.
736 * @the_phy: This is the specific phy that is no longer active in the port. 738 * @the_phy: This is the specific phy that is no longer active in the port.
737 * @do_notify_user: This parameter specifies whether to inform the user (via 739 * @do_notify_user: This parameter specifies whether to inform the user (via
738 * scic_cb_port_link_down()) as to the fact that a new phy as become ready. 740 * isci_event_port_link_down()) as to the fact that a new phy as become
741 * ready.
739 * 742 *
740 * This method will deactivate the supplied phy in the port. none 743 * This method will deactivate the supplied phy in the port. none
741 */ 744 */
@@ -752,7 +755,9 @@ void scic_sds_port_deactivate_phy(
752 SCU_PCSPExCR_WRITE(this_port, the_phy->phy_index, the_phy->phy_index); 755 SCU_PCSPExCR_WRITE(this_port, the_phy->phy_index, the_phy->phy_index);
753 756
754 if (do_notify_user == true) 757 if (do_notify_user == true)
755 scic_cb_port_link_down(this_port->owning_controller, this_port, the_phy); 758 isci_event_port_link_down(this_port->owning_controller,
759 this_port,
760 the_phy);
756} 761}
757 762
758/** 763/**
@@ -775,7 +780,7 @@ static void scic_sds_port_invalid_link_up(
775 if ((controller->invalid_phy_mask & (1 << the_phy->phy_index)) == 0) { 780 if ((controller->invalid_phy_mask & (1 << the_phy->phy_index)) == 0) {
776 scic_sds_controller_set_invalid_phy(controller, the_phy); 781 scic_sds_controller_set_invalid_phy(controller, the_phy);
777 782
778 scic_cb_port_invalid_link_up(controller, this_port, the_phy); 783 isci_event_port_invalid_link_up(controller, this_port, the_phy);
779 } 784 }
780} 785}
781 786
@@ -933,7 +938,7 @@ static void scic_sds_port_timeout_handler(void *port)
933 this_port); 938 this_port);
934 } else if (current_state == SCI_BASE_PORT_STATE_STOPPING) { 939 } else if (current_state == SCI_BASE_PORT_STATE_STOPPING) {
935 /* if the port is still stopping then the stop has not completed */ 940 /* if the port is still stopping then the stop has not completed */
936 scic_cb_port_stop_complete( 941 isci_event_port_stop_complete(
937 scic_sds_port_get_controller(this_port), 942 scic_sds_port_get_controller(this_port),
938 port, 943 port,
939 SCI_FAILURE_TIMEOUT 944 SCI_FAILURE_TIMEOUT
@@ -1030,7 +1035,7 @@ void scic_sds_port_broadcast_change_received(
1030 struct scic_sds_phy *this_phy) 1035 struct scic_sds_phy *this_phy)
1031{ 1036{
1032 /* notify the user. */ 1037 /* notify the user. */
1033 scic_cb_port_bc_change_primitive_received( 1038 isci_event_port_bc_change_primitive_received(
1034 this_port->owning_controller, this_port, this_phy 1039 this_port->owning_controller, this_port, this_phy
1035 ); 1040 );
1036} 1041}
@@ -1259,7 +1264,7 @@ static enum sci_status scic_sds_port_ready_operational_substate_reset_handler(
1259 status = scic_sds_phy_reset(selected_phy); 1264 status = scic_sds_phy_reset(selected_phy);
1260 1265
1261 if (status == SCI_SUCCESS) { 1266 if (status == SCI_SUCCESS) {
1262 scic_cb_timer_start( 1267 isci_event_timer_start(
1263 scic_sds_port_get_controller(this_port), 1268 scic_sds_port_get_controller(this_port),
1264 this_port->timer_handle, 1269 this_port->timer_handle,
1265 timeout 1270 timeout
@@ -1610,7 +1615,7 @@ static void scic_sds_port_ready_substate_operational_enter(
1610 this_port, SCIC_SDS_PORT_READY_SUBSTATE_OPERATIONAL 1615 this_port, SCIC_SDS_PORT_READY_SUBSTATE_OPERATIONAL
1611 ); 1616 );
1612 1617
1613 scic_cb_port_ready( 1618 isci_event_port_ready(
1614 scic_sds_port_get_controller(this_port), this_port 1619 scic_sds_port_get_controller(this_port), this_port
1615 ); 1620 );
1616 1621
@@ -1640,7 +1645,7 @@ static void scic_sds_port_ready_substate_operational_exit(
1640{ 1645{
1641 struct scic_sds_port *this_port = (struct scic_sds_port *)object; 1646 struct scic_sds_port *this_port = (struct scic_sds_port *)object;
1642 1647
1643 scic_cb_port_not_ready( 1648 isci_event_port_not_ready(
1644 scic_sds_port_get_controller(this_port), 1649 scic_sds_port_get_controller(this_port),
1645 this_port, 1650 this_port,
1646 this_port->not_ready_reason 1651 this_port->not_ready_reason
@@ -1670,7 +1675,7 @@ static void scic_sds_port_ready_substate_configuring_enter(
1670 ); 1675 );
1671 1676
1672 if (this_port->active_phy_mask == 0) { 1677 if (this_port->active_phy_mask == 0) {
1673 scic_cb_port_not_ready( 1678 isci_event_port_not_ready(
1674 scic_sds_port_get_controller(this_port), 1679 scic_sds_port_get_controller(this_port),
1675 this_port, 1680 this_port,
1676 SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS 1681 SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS
@@ -2544,14 +2549,14 @@ static void scic_sds_port_ready_state_enter(
2544 SCI_BASE_PORT_STATE_RESETTING 2549 SCI_BASE_PORT_STATE_RESETTING
2545 == this_port->parent.state_machine.previous_state_id 2550 == this_port->parent.state_machine.previous_state_id
2546 ) { 2551 ) {
2547 scic_cb_port_hard_reset_complete( 2552 isci_event_port_hard_reset_complete(
2548 scic_sds_port_get_controller(this_port), 2553 scic_sds_port_get_controller(this_port),
2549 this_port, 2554 this_port,
2550 SCI_SUCCESS 2555 SCI_SUCCESS
2551 ); 2556 );
2552 } else { 2557 } else {
2553 /* Notify the caller that the port is not yet ready */ 2558 /* Notify the caller that the port is not yet ready */
2554 scic_cb_port_not_ready( 2559 isci_event_port_not_ready(
2555 scic_sds_port_get_controller(this_port), 2560 scic_sds_port_get_controller(this_port),
2556 this_port, 2561 this_port,
2557 SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS 2562 SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS
@@ -2615,7 +2620,7 @@ static void scic_sds_port_resetting_state_exit(
2615 2620
2616 this_port = (struct scic_sds_port *)object; 2621 this_port = (struct scic_sds_port *)object;
2617 2622
2618 scic_cb_timer_stop( 2623 isci_event_timer_stop(
2619 scic_sds_port_get_controller(this_port), 2624 scic_sds_port_get_controller(this_port),
2620 this_port->timer_handle 2625 this_port->timer_handle
2621 ); 2626 );
@@ -2655,7 +2660,7 @@ static void scic_sds_port_stopping_state_exit(
2655 2660
2656 this_port = (struct scic_sds_port *)object; 2661 this_port = (struct scic_sds_port *)object;
2657 2662
2658 scic_cb_timer_stop( 2663 isci_event_timer_stop(
2659 scic_sds_port_get_controller(this_port), 2664 scic_sds_port_get_controller(this_port),
2660 this_port->timer_handle 2665 this_port->timer_handle
2661 ); 2666 );
@@ -2681,7 +2686,7 @@ static void scic_sds_port_failed_state_enter(
2681 SCI_BASE_PORT_STATE_FAILED 2686 SCI_BASE_PORT_STATE_FAILED
2682 ); 2687 );
2683 2688
2684 scic_cb_port_hard_reset_complete( 2689 isci_event_port_hard_reset_complete(
2685 scic_sds_port_get_controller(this_port), 2690 scic_sds_port_get_controller(this_port),
2686 this_port, 2691 this_port,
2687 SCI_FAILURE_TIMEOUT 2692 SCI_FAILURE_TIMEOUT
diff --git a/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c b/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c
index 001472e75b8c..e26a4e69b3ac 100644
--- a/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c
+++ b/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c
@@ -463,7 +463,7 @@ static void scic_sds_mpc_agent_link_down(
463 ) { 463 ) {
464 port_agent->timer_pending = true; 464 port_agent->timer_pending = true;
465 465
466 scic_cb_timer_start( 466 isci_event_timer_start(
467 controller, 467 controller,
468 port_agent->timer, 468 port_agent->timer,
469 SCIC_SDS_MPC_RECONFIGURATION_TIMEOUT 469 SCIC_SDS_MPC_RECONFIGURATION_TIMEOUT
@@ -542,12 +542,12 @@ static void scic_sds_apc_agent_start_timer(
542 u32 timeout) 542 u32 timeout)
543{ 543{
544 if (port_agent->timer_pending) { 544 if (port_agent->timer_pending) {
545 scic_cb_timer_stop(controller, port_agent->timer); 545 isci_event_timer_stop(controller, port_agent->timer);
546 } 546 }
547 547
548 port_agent->timer_pending = true; 548 port_agent->timer_pending = true;
549 549
550 scic_cb_timer_start(controller, port_agent->timer, timeout); 550 isci_event_timer_start(controller, port_agent->timer, timeout);
551} 551}
552 552
553/** 553/**
@@ -830,7 +830,7 @@ enum sci_status scic_sds_port_configuration_agent_initialize(
830 port_agent->link_up_handler = scic_sds_mpc_agent_link_up; 830 port_agent->link_up_handler = scic_sds_mpc_agent_link_up;
831 port_agent->link_down_handler = scic_sds_mpc_agent_link_down; 831 port_agent->link_down_handler = scic_sds_mpc_agent_link_down;
832 832
833 port_agent->timer = scic_cb_timer_create( 833 port_agent->timer = isci_event_timer_create(
834 controller, 834 controller,
835 scic_sds_mpc_agent_timeout_handler, 835 scic_sds_mpc_agent_timeout_handler,
836 controller 836 controller
@@ -841,7 +841,7 @@ enum sci_status scic_sds_port_configuration_agent_initialize(
841 port_agent->link_up_handler = scic_sds_apc_agent_link_up; 841 port_agent->link_up_handler = scic_sds_apc_agent_link_up;
842 port_agent->link_down_handler = scic_sds_apc_agent_link_down; 842 port_agent->link_down_handler = scic_sds_apc_agent_link_down;
843 843
844 port_agent->timer = scic_cb_timer_create( 844 port_agent->timer = isci_event_timer_create(
845 controller, 845 controller,
846 scic_sds_apc_agent_timeout_handler, 846 scic_sds_apc_agent_timeout_handler,
847 controller 847 controller
diff --git a/drivers/scsi/isci/core/scic_sds_remote_device.c b/drivers/scsi/isci/core/scic_sds_remote_device.c
index cb1cf397b96f..3a8d56364750 100644
--- a/drivers/scsi/isci/core/scic_sds_remote_device.c
+++ b/drivers/scsi/isci/core/scic_sds_remote_device.c
@@ -1817,7 +1817,7 @@ static void scic_sds_remote_device_stopped_state_enter(
1817 * the stop operation has completed. */ 1817 * the stop operation has completed. */
1818 if (this_device->parent.state_machine.previous_state_id 1818 if (this_device->parent.state_machine.previous_state_id
1819 == SCI_BASE_REMOTE_DEVICE_STATE_STOPPING) { 1819 == SCI_BASE_REMOTE_DEVICE_STATE_STOPPING) {
1820 scic_cb_remote_device_stop_complete( 1820 isci_event_remote_device_stop_complete(
1821 scic_sds_remote_device_get_controller(this_device), 1821 scic_sds_remote_device_get_controller(this_device),
1822 this_device, 1822 this_device,
1823 SCI_SUCCESS 1823 SCI_SUCCESS
@@ -1848,7 +1848,7 @@ static void scic_sds_remote_device_starting_state_enter(
1848 SCI_BASE_REMOTE_DEVICE_STATE_STARTING 1848 SCI_BASE_REMOTE_DEVICE_STATE_STARTING
1849 ); 1849 );
1850 1850
1851 scic_cb_remote_device_not_ready( 1851 isci_event_remote_device_not_ready(
1852 the_controller, 1852 the_controller,
1853 this_device, 1853 this_device,
1854 SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED 1854 SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED
@@ -1871,7 +1871,7 @@ static void scic_sds_remote_device_starting_state_exit(
1871 /* 1871 /*
1872 * / @todo Check the device object for the proper return code for this 1872 * / @todo Check the device object for the proper return code for this
1873 * / callback */ 1873 * / callback */
1874 scic_cb_remote_device_start_complete( 1874 isci_event_remote_device_start_complete(
1875 scic_sds_remote_device_get_controller(this_device), 1875 scic_sds_remote_device_get_controller(this_device),
1876 this_device, 1876 this_device,
1877 SCI_SUCCESS 1877 SCI_SUCCESS
@@ -1905,7 +1905,7 @@ static void scic_sds_remote_device_ready_state_enter(
1905 if (this_device->has_ready_substate_machine) { 1905 if (this_device->has_ready_substate_machine) {
1906 sci_base_state_machine_start(&this_device->ready_substate_machine); 1906 sci_base_state_machine_start(&this_device->ready_substate_machine);
1907 } else { 1907 } else {
1908 scic_cb_remote_device_ready(the_controller, this_device); 1908 isci_event_remote_device_ready(the_controller, this_device);
1909 } 1909 }
1910} 1910}
1911 1911
@@ -1928,7 +1928,7 @@ static void scic_sds_remote_device_ready_state_exit(
1928 if (this_device->has_ready_substate_machine) { 1928 if (this_device->has_ready_substate_machine) {
1929 sci_base_state_machine_stop(&this_device->ready_substate_machine); 1929 sci_base_state_machine_stop(&this_device->ready_substate_machine);
1930 } else { 1930 } else {
1931 scic_cb_remote_device_not_ready( 1931 isci_event_remote_device_not_ready(
1932 the_controller, 1932 the_controller,
1933 this_device, 1933 this_device,
1934 SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED 1934 SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED
diff --git a/drivers/scsi/isci/core/scic_sds_request.c b/drivers/scsi/isci/core/scic_sds_request.c
index 3bad0bcdf840..909361f680f8 100644
--- a/drivers/scsi/isci/core/scic_sds_request.c
+++ b/drivers/scsi/isci/core/scic_sds_request.c
@@ -2078,14 +2078,14 @@ static void scic_sds_request_completed_state_enter(
2078 2078
2079 /* Tell the SCI_USER that the IO request is complete */ 2079 /* Tell the SCI_USER that the IO request is complete */
2080 if (this_request->is_task_management_request == false) { 2080 if (this_request->is_task_management_request == false) {
2081 scic_cb_io_request_complete( 2081 isci_event_io_request_complete(
2082 scic_sds_request_get_controller(this_request), 2082 scic_sds_request_get_controller(this_request),
2083 scic_sds_request_get_device(this_request), 2083 scic_sds_request_get_device(this_request),
2084 this_request, 2084 this_request,
2085 this_request->sci_status 2085 this_request->sci_status
2086 ); 2086 );
2087 } else { 2087 } else {
2088 scic_cb_task_request_complete( 2088 isci_event_task_request_complete(
2089 scic_sds_request_get_controller(this_request), 2089 scic_sds_request_get_controller(this_request),
2090 scic_sds_request_get_device(this_request), 2090 scic_sds_request_get_device(this_request),
2091 this_request, 2091 this_request,
diff --git a/drivers/scsi/isci/core/scic_sds_smp_remote_device.c b/drivers/scsi/isci/core/scic_sds_smp_remote_device.c
index ea608c1ad8cb..e90d46edd064 100644
--- a/drivers/scsi/isci/core/scic_sds_smp_remote_device.c
+++ b/drivers/scsi/isci/core/scic_sds_smp_remote_device.c
@@ -265,7 +265,7 @@ static void scic_sds_smp_remote_device_ready_idle_substate_enter(
265 SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE 265 SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE
266 ); 266 );
267 267
268 scic_cb_remote_device_ready( 268 isci_event_remote_device_ready(
269 scic_sds_remote_device_get_controller(this_device), this_device); 269 scic_sds_remote_device_get_controller(this_device), this_device);
270} 270}
271 271
@@ -291,7 +291,7 @@ static void scic_sds_smp_remote_device_ready_cmd_substate_enter(
291 SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD 291 SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD
292 ); 292 );
293 293
294 scic_cb_remote_device_not_ready( 294 isci_event_remote_device_not_ready(
295 scic_sds_remote_device_get_controller(this_device), 295 scic_sds_remote_device_get_controller(this_device),
296 this_device, 296 this_device,
297 SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED 297 SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED
diff --git a/drivers/scsi/isci/core/scic_sds_stp_remote_device.c b/drivers/scsi/isci/core/scic_sds_stp_remote_device.c
index 880e0e5932c0..ce2cb7b4c7cf 100644
--- a/drivers/scsi/isci/core/scic_sds_stp_remote_device.c
+++ b/drivers/scsi/isci/core/scic_sds_stp_remote_device.c
@@ -667,7 +667,7 @@ static void scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handl
667 * the ready notification. */ 667 * the ready notification. */
668 if (this_device->ready_substate_machine.previous_state_id 668 if (this_device->ready_substate_machine.previous_state_id
669 != SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ) { 669 != SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ) {
670 scic_cb_remote_device_ready( 670 isci_event_remote_device_ready(
671 scic_sds_remote_device_get_controller(this_device), this_device 671 scic_sds_remote_device_get_controller(this_device), this_device
672 ); 672 );
673 } 673 }
@@ -741,7 +741,7 @@ static void scic_sds_stp_remote_device_ready_cmd_substate_enter(
741 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD 741 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD
742 ); 742 );
743 743
744 scic_cb_remote_device_not_ready( 744 isci_event_remote_device_not_ready(
745 scic_sds_remote_device_get_controller(this_device), 745 scic_sds_remote_device_get_controller(this_device),
746 this_device, 746 this_device,
747 SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED 747 SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED
@@ -799,7 +799,7 @@ static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(
799 799
800 if (this_device->not_ready_reason == 800 if (this_device->not_ready_reason ==
801 SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED) { 801 SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED) {
802 scic_cb_remote_device_not_ready( 802 isci_event_remote_device_not_ready(
803 scic_sds_remote_device_get_controller(this_device), 803 scic_sds_remote_device_get_controller(this_device),
804 this_device, 804 this_device,
805 this_device->not_ready_reason 805 this_device->not_ready_reason
diff --git a/drivers/scsi/isci/core/scic_user_callback.h b/drivers/scsi/isci/core/scic_user_callback.h
index d1a3cb885bc7..c097711c5f2c 100644
--- a/drivers/scsi/isci/core/scic_user_callback.h
+++ b/drivers/scsi/isci/core/scic_user_callback.h
@@ -74,62 +74,6 @@ struct scic_sds_remote_device;
74struct scic_sds_controller; 74struct scic_sds_controller;
75 75
76/** 76/**
77 * scic_cb_timer_create() - This callback method asks the user to create a
78 * timer and provide a handle for this timer for use in further timer
79 * interactions.
80 * @controller: This parameter specifies the controller with which this timer
81 * is to be associated.
82 * @timer_callback: This parameter specifies the callback method to be invoked
83 * whenever the timer expires.
84 * @cookie: This parameter specifies a piece of information that the user must
85 * retain. This cookie is to be supplied by the user anytime a timeout
86 * occurs for the created timer.
87 *
88 * The "timer_callback" method should be executed in a mutually exlusive manner
89 * from the controller completion handler handler. This method returns a handle
90 * to a timer object created by the user. The handle will be utilized for all
91 * further interactions relating to this timer.
92 */
93void *scic_cb_timer_create(
94 struct scic_sds_controller *controller,
95 void (*timer_callback)(void *),
96 void *cookie);
97
98
99/**
100 * scic_cb_timer_start() - This callback method asks the user to start the
101 * supplied timer.
102 * @controller: This parameter specifies the controller with which this timer
103 * is to associated.
104 * @timer: This parameter specifies the timer to be started.
105 * @milliseconds: This parameter specifies the number of milliseconds for which
106 * to stall. The operating system driver is allowed to round this value up
107 * where necessary.
108 *
109 * All timers in the system started by the SCI Core are one shot timers.
110 * Therefore, the SCI user should make sure that it removes the timer from it's
111 * list when a timer actually fires. Additionally, SCI Core user's should be
112 * able to handle calls from the SCI Core to stop a timer that may already be
113 * stopped. none
114 */
115void scic_cb_timer_start(
116 struct scic_sds_controller *controller,
117 void *timer,
118 u32 milliseconds);
119
120/**
121 * scic_cb_timer_stop() - This callback method asks the user to stop the
122 * supplied timer.
123 * @controller: This parameter specifies the controller with which this timer
124 * is to associated.
125 * @timer: This parameter specifies the timer to be stopped.
126 *
127 */
128void scic_cb_timer_stop(
129 struct scic_sds_controller *controller,
130 void *timer);
131
132/**
133 * scic_cb_stall_execution() - This method is called when the core requires the 77 * scic_cb_stall_execution() - This method is called when the core requires the
134 * OS driver to stall execution. This method is utilized during 78 * OS driver to stall execution. This method is utilized during
135 * initialization or non-performance paths only. 79 * initialization or non-performance paths only.
@@ -142,67 +86,6 @@ void scic_cb_timer_stop(
142void scic_cb_stall_execution( 86void scic_cb_stall_execution(
143 u32 microseconds); 87 u32 microseconds);
144 88
145/**
146 * scic_cb_controller_start_complete() - This user callback will inform the
147 * user that the controller has finished the start process.
148 * @controller: This parameter specifies the controller that was started.
149 * @completion_status: This parameter specifies the results of the start
150 * operation. SCI_SUCCESS indicates successful completion.
151 *
152 */
153void scic_cb_controller_start_complete(
154 struct scic_sds_controller *controller,
155 enum sci_status completion_status);
156
157/**
158 * scic_cb_controller_stop_complete() - This user callback will inform the user
159 * that the controller has finished the stop process.
160 * @controller: This parameter specifies the controller that was stopped.
161 * @completion_status: This parameter specifies the results of the stop
162 * operation. SCI_SUCCESS indicates successful completion.
163 *
164 */
165void scic_cb_controller_stop_complete(
166 struct scic_sds_controller *controller,
167 enum sci_status completion_status);
168
169/**
170 * scic_cb_io_request_complete() - This user callback will inform the user that
171 * an IO request has completed.
172 * @controller: This parameter specifies the controller on which the IO is
173 * completing.
174 * @remote_device: This parameter specifies the remote device on which this IO
175 * request is completing.
176 * @io_request: This parameter specifies the IO request that has completed.
177 * @completion_status: This parameter specifies the results of the IO request
178 * operation. SCI_SUCCESS indicates successful completion.
179 *
180 */
181void scic_cb_io_request_complete(
182 struct scic_sds_controller *controller,
183 struct scic_sds_remote_device *remote_device,
184 struct scic_sds_request *io_request,
185 enum sci_io_status completion_status);
186
187/**
188 * scic_cb_task_request_complete() - This user callback will inform the user
189 * that a task management request completed.
190 * @controller: This parameter specifies the controller on which the task
191 * management request is completing.
192 * @remote_device: This parameter specifies the remote device on which this
193 * task management request is completing.
194 * @task_request: This parameter specifies the task management request that has
195 * completed.
196 * @completion_status: This parameter specifies the results of the IO request
197 * operation. SCI_SUCCESS indicates successful completion.
198 *
199 */
200void scic_cb_task_request_complete(
201 struct scic_sds_controller *controller,
202 struct scic_sds_remote_device *remote_device,
203 struct scic_sds_request *task_request,
204 enum sci_task_status completion_status);
205
206#ifndef SCI_GET_PHYSICAL_ADDRESS_OPTIMIZATION_ENABLED 89#ifndef SCI_GET_PHYSICAL_ADDRESS_OPTIMIZATION_ENABLED
207/** 90/**
208 * scic_cb_io_request_get_physical_address() - This callback method asks the 91 * scic_cb_io_request_get_physical_address() - This callback method asks the
@@ -508,204 +391,6 @@ void *scic_cb_get_virtual_address(
508 struct scic_sds_controller *controller, 391 struct scic_sds_controller *controller,
509 dma_addr_t physical_address); 392 dma_addr_t physical_address);
510 393
511/**
512 * scic_cb_port_stop_complete() - This method informs the user when a stop
513 * operation on the port has completed.
514 * @controller: This parameter represents the controller which contains the
515 * port.
516 * @port: This parameter specifies the SCI port object for which the callback
517 * is being invoked.
518 * @completion_status: This parameter specifies the status for the operation
519 * being completed.
520 *
521 */
522void scic_cb_port_stop_complete(
523 struct scic_sds_controller *controller,
524 struct scic_sds_port *port,
525 enum sci_status completion_status);
526
527/**
528 * scic_cb_port_hard_reset_complete() - This method informs the user when a
529 * hard reset on the port has completed. This hard reset could have been
530 * initiated by the user or by the remote port.
531 * @controller: This parameter represents the controller which contains the
532 * port.
533 * @port: This parameter specifies the SCI port object for which the callback
534 * is being invoked.
535 * @completion_status: This parameter specifies the status for the operation
536 * being completed.
537 *
538 */
539void scic_cb_port_hard_reset_complete(
540 struct scic_sds_controller *controller,
541 struct scic_sds_port *port,
542 enum sci_status completion_status);
543
544/**
545 * scic_cb_port_ready() - This method informs the user that the port is now in
546 * a ready state and can be utilized to issue IOs.
547 * @controller: This parameter represents the controller which contains the
548 * port.
549 * @port: This parameter specifies the SCI port object for which the callback
550 * is being invoked.
551 *
552 */
553void scic_cb_port_ready(
554 struct scic_sds_controller *controller,
555 struct scic_sds_port *port);
556
557/**
558 * scic_cb_port_not_ready() - This method informs the user that the port is now
559 * not in a ready (i.e. busy) state and can't be utilized to issue IOs.
560 * @controller: This parameter represents the controller which contains the
561 * port.
562 * @port: This parameter specifies the SCI port object for which the callback
563 * is being invoked.
564 * @reason_code: This parameter specifies the reason for the port not ready
565 * callback.
566 *
567 */
568void scic_cb_port_not_ready(
569 struct scic_sds_controller *controller,
570 struct scic_sds_port *port,
571 u32 reason_code);
572
573/**
574 * scic_cb_port_invalid_link_up() - This method informs the SCI Core user that
575 * a phy/link became ready, but the phy is not allowed in the port. In some
576 * situations the underlying hardware only allows for certain phy to port
577 * mappings. If these mappings are violated, then this API is invoked.
578 * @controller: This parameter represents the controller which contains the
579 * port.
580 * @port: This parameter specifies the SCI port object for which the callback
581 * is being invoked.
582 * @phy: This parameter specifies the phy that came ready, but the phy can't be
583 * a valid member of the port.
584 *
585 */
586void scic_cb_port_invalid_link_up(
587 struct scic_sds_controller *controller,
588 struct scic_sds_port *port,
589 struct scic_sds_phy *phy);
590
591/**
592 * scic_cb_port_bc_change_primitive_received() - This callback method informs
593 * the user that a broadcast change primitive was received.
594 * @controller: This parameter represents the controller which contains the
595 * port.
596 * @port: This parameter specifies the SCI port object for which the callback
597 * is being invoked. For instances where the phy on which the primitive was
598 * received is not part of a port, this parameter will be
599 * NULL.
600 * @phy: This parameter specifies the phy on which the primitive was received.
601 *
602 */
603void scic_cb_port_bc_change_primitive_received(
604 struct scic_sds_controller *controller,
605 struct scic_sds_port *port,
606 struct scic_sds_phy *phy);
607
608
609
610
611/**
612 * scic_cb_port_link_up() - This callback method informs the user that a phy
613 * has become operational and is capable of communicating with the remote
614 * end point.
615 * @controller: This parameter represents the controller associated with the
616 * phy.
617 * @port: This parameter specifies the port object for which the user callback
618 * is being invoked. There may be conditions where this parameter can be
619 * NULL
620 * @phy: This parameter specifies the phy object for which the user callback is
621 * being invoked.
622 *
623 */
624void scic_cb_port_link_up(
625 struct scic_sds_controller *controller,
626 struct scic_sds_port *port,
627 struct scic_sds_phy *phy);
628
629/**
630 * scic_cb_port_link_down() - This callback method informs the user that a phy
631 * is no longer operational and is not capable of communicating with the
632 * remote end point.
633 * @controller: This parameter represents the controller associated with the
634 * phy.
635 * @port: This parameter specifies the port object for which the user callback
636 * is being invoked. There may be conditions where this parameter can be
637 * NULL
638 * @phy: This parameter specifies the phy object for which the user callback is
639 * being invoked.
640 *
641 */
642void scic_cb_port_link_down(
643 struct scic_sds_controller *controller,
644 struct scic_sds_port *port,
645 struct scic_sds_phy *phy);
646
647/**
648 * scic_cb_remote_device_start_complete() - This user callback method will
649 * inform the user that a start operation has completed.
650 * @controller: This parameter specifies the core controller associated with
651 * the completion callback.
652 * @remote_device: This parameter specifies the remote device associated with
653 * the completion callback.
654 * @completion_status: This parameter specifies the completion status for the
655 * operation.
656 *
657 */
658void scic_cb_remote_device_start_complete(
659 struct scic_sds_controller *controller,
660 struct scic_sds_remote_device *remote_device,
661 enum sci_status completion_status);
662
663/**
664 * scic_cb_remote_device_stop_complete() - This user callback method will
665 * inform the user that a stop operation has completed.
666 * @controller: This parameter specifies the core controller associated with
667 * the completion callback.
668 * @remote_device: This parameter specifies the remote device associated with
669 * the completion callback.
670 * @completion_status: This parameter specifies the completion status for the
671 * operation.
672 *
673 */
674void scic_cb_remote_device_stop_complete(
675 struct scic_sds_controller *controller,
676 struct scic_sds_remote_device *remote_device,
677 enum sci_status completion_status);
678
679/**
680 * scic_cb_remote_device_ready() - This user callback method will inform the
681 * user that a remote device is now capable of handling IO requests.
682 * @controller: This parameter specifies the core controller associated with
683 * the completion callback.
684 * @remote_device: This parameter specifies the remote device associated with
685 * the callback.
686 *
687 */
688void scic_cb_remote_device_ready(
689 struct scic_sds_controller *controller,
690 struct scic_sds_remote_device *remote_device);
691
692/**
693 * scic_cb_remote_device_not_ready() - This user callback method will inform
694 * the user that a remote device is no longer capable of handling IO
695 * requests (until a ready callback is invoked).
696 * @controller: This parameter specifies the core controller associated with
697 * the completion callback.
698 * @remote_device: This parameter specifies the remote device associated with
699 * the callback.
700 * @reason_code: This paramete specifies the reason the remote device is not
701 * ready.
702 *
703 */
704void scic_cb_remote_device_not_ready(
705 struct scic_sds_controller *controller,
706 struct scic_sds_remote_device *remote_device,
707 u32 reason_code);
708
709#if !defined(DISABLE_ATAPI) 394#if !defined(DISABLE_ATAPI)
710/** 395/**
711 * scic_cb_stp_packet_io_request_get_cdb_address() - This user callback gets 396 * scic_cb_stp_packet_io_request_get_cdb_address() - This user callback gets
diff --git a/drivers/scsi/isci/events.c b/drivers/scsi/isci/events.c
index 6911ea5d1937..8872f4ca6aaa 100644
--- a/drivers/scsi/isci/events.c
+++ b/drivers/scsi/isci/events.c
@@ -64,9 +64,10 @@
64#include "request.h" 64#include "request.h"
65#include "sata.h" 65#include "sata.h"
66#include "task.h" 66#include "task.h"
67#include "events.h"
67 68
68/** 69/**
69 * scic_cb_timer_create() - This callback method asks the user to create a 70 * isci_event_timer_create() - This callback method asks the user to create a
70 * timer and provide a handle for this timer for use in further timer 71 * timer and provide a handle for this timer for use in further timer
71 * interactions. The appropriate isci timer object function is called to 72 * interactions. The appropriate isci timer object function is called to
72 * create a timer object. 73 * create a timer object.
@@ -81,7 +82,7 @@
81 * This method returns a handle to a timer object created by the user. The 82 * This method returns a handle to a timer object created by the user. The
82 * handle will be utilized for all further interactions relating to this timer. 83 * handle will be utilized for all further interactions relating to this timer.
83 */ 84 */
84void *scic_cb_timer_create( 85void *isci_event_timer_create(
85 struct scic_sds_controller *controller, 86 struct scic_sds_controller *controller,
86 void (*timer_callback)(void *), 87 void (*timer_callback)(void *),
87 void *cookie) 88 void *cookie)
@@ -107,7 +108,7 @@ void *scic_cb_timer_create(
107 108
108 109
109/** 110/**
110 * scic_cb_timer_start() - This callback method asks the user to start the 111 * isci_event_timer_start() - This callback method asks the user to start the
111 * supplied timer. The appropriate isci timer object function is called to 112 * supplied timer. The appropriate isci timer object function is called to
112 * start the timer. 113 * start the timer.
113 * @controller: This parameter specifies the controller with which this timer 114 * @controller: This parameter specifies the controller with which this timer
@@ -118,7 +119,7 @@ void *scic_cb_timer_create(
118 * where necessary. 119 * where necessary.
119 * 120 *
120 */ 121 */
121void scic_cb_timer_start( 122void isci_event_timer_start(
122 struct scic_sds_controller *controller, 123 struct scic_sds_controller *controller,
123 void *timer, 124 void *timer,
124 u32 milliseconds) 125 u32 milliseconds)
@@ -137,7 +138,7 @@ void scic_cb_timer_start(
137} 138}
138 139
139/** 140/**
140 * scic_cb_timer_stop() - This callback method asks the user to stop the 141 * isci_event_timer_stop() - This callback method asks the user to stop the
141 * supplied timer. The appropriate isci timer object function is called to 142 * supplied timer. The appropriate isci timer object function is called to
142 * stop the timer. 143 * stop the timer.
143 * @controller: This parameter specifies the controller with which this timer 144 * @controller: This parameter specifies the controller with which this timer
@@ -145,7 +146,7 @@ void scic_cb_timer_start(
145 * @timer: This parameter specifies the timer to be stopped. 146 * @timer: This parameter specifies the timer to be stopped.
146 * 147 *
147 */ 148 */
148void scic_cb_timer_stop( 149void isci_event_timer_stop(
149 struct scic_sds_controller *controller, 150 struct scic_sds_controller *controller,
150 void *timer) 151 void *timer)
151{ 152{
@@ -162,7 +163,7 @@ void scic_cb_timer_stop(
162} 163}
163 164
164/** 165/**
165 * scic_cb_controller_start_complete() - This user callback will inform the 166 * isci_event_controller_start_complete() - This user callback will inform the
166 * user that the controller has finished the start process. The associated 167 * user that the controller has finished the start process. The associated
167 * isci host adapter's start_complete function is called. 168 * isci host adapter's start_complete function is called.
168 * @controller: This parameter specifies the controller that was started. 169 * @controller: This parameter specifies the controller that was started.
@@ -170,7 +171,7 @@ void scic_cb_timer_stop(
170 * operation. SCI_SUCCESS indicates successful completion. 171 * operation. SCI_SUCCESS indicates successful completion.
171 * 172 *
172 */ 173 */
173void scic_cb_controller_start_complete( 174void isci_event_controller_start_complete(
174 struct scic_sds_controller *controller, 175 struct scic_sds_controller *controller,
175 enum sci_status completion_status) 176 enum sci_status completion_status)
176{ 177{
@@ -184,7 +185,7 @@ void scic_cb_controller_start_complete(
184} 185}
185 186
186/** 187/**
187 * scic_cb_controller_stop_complete() - This user callback will inform the user 188 * isci_event_controller_stop_complete() - This user callback will inform the user
188 * that the controller has finished the stop process. The associated isci 189 * that the controller has finished the stop process. The associated isci
189 * host adapter's start_complete function is called. 190 * host adapter's start_complete function is called.
190 * @controller: This parameter specifies the controller that was stopped. 191 * @controller: This parameter specifies the controller that was stopped.
@@ -192,7 +193,7 @@ void scic_cb_controller_start_complete(
192 * operation. SCI_SUCCESS indicates successful completion. 193 * operation. SCI_SUCCESS indicates successful completion.
193 * 194 *
194 */ 195 */
195void scic_cb_controller_stop_complete( 196void isci_event_controller_stop_complete(
196 struct scic_sds_controller *controller, 197 struct scic_sds_controller *controller,
197 enum sci_status completion_status) 198 enum sci_status completion_status)
198{ 199{
@@ -205,7 +206,7 @@ void scic_cb_controller_stop_complete(
205} 206}
206 207
207/** 208/**
208 * scic_cb_io_request_complete() - This user callback will inform the user that 209 * isci_event_io_request_complete() - This user callback will inform the user that
209 * an IO request has completed. 210 * an IO request has completed.
210 * @controller: This parameter specifies the controller on which the IO is 211 * @controller: This parameter specifies the controller on which the IO is
211 * completing. 212 * completing.
@@ -216,7 +217,7 @@ void scic_cb_controller_stop_complete(
216 * operation. SCI_SUCCESS indicates successful completion. 217 * operation. SCI_SUCCESS indicates successful completion.
217 * 218 *
218 */ 219 */
219void scic_cb_io_request_complete( 220void isci_event_io_request_complete(
220 struct scic_sds_controller *controller, 221 struct scic_sds_controller *controller,
221 struct scic_sds_remote_device *remote_device, 222 struct scic_sds_remote_device *remote_device,
222 struct scic_sds_request *scic_io_request, 223 struct scic_sds_request *scic_io_request,
@@ -239,7 +240,7 @@ void scic_cb_io_request_complete(
239} 240}
240 241
241/** 242/**
242 * scic_cb_task_request_complete() - This user callback will inform the user 243 * isci_event_task_request_complete() - This user callback will inform the user
243 * that a task management request completed. 244 * that a task management request completed.
244 * @controller: This parameter specifies the controller on which the task 245 * @controller: This parameter specifies the controller on which the task
245 * management request is completing. 246 * management request is completing.
@@ -251,7 +252,7 @@ void scic_cb_io_request_complete(
251 * operation. SCI_SUCCESS indicates successful completion. 252 * operation. SCI_SUCCESS indicates successful completion.
252 * 253 *
253 */ 254 */
254void scic_cb_task_request_complete( 255void isci_event_task_request_complete(
255 struct scic_sds_controller *controller, 256 struct scic_sds_controller *controller,
256 struct scic_sds_remote_device *remote_device, 257 struct scic_sds_remote_device *remote_device,
257 struct scic_sds_request *scic_task_request, 258 struct scic_sds_request *scic_task_request,
@@ -271,7 +272,7 @@ void scic_cb_task_request_complete(
271} 272}
272 273
273/** 274/**
274 * scic_cb_port_stop_complete() - This method informs the user when a stop 275 * isci_event_port_stop_complete() - This method informs the user when a stop
275 * operation on the port has completed. 276 * operation on the port has completed.
276 * @controller: This parameter represents the controller which contains the 277 * @controller: This parameter represents the controller which contains the
277 * port. 278 * port.
@@ -281,17 +282,20 @@ void scic_cb_task_request_complete(
281 * being completed. 282 * being completed.
282 * 283 *
283 */ 284 */
284void scic_cb_port_stop_complete( 285void isci_event_port_stop_complete(
285 struct scic_sds_controller *controller, 286 struct scic_sds_controller *controller,
286 struct scic_sds_port *port, 287 struct scic_sds_port *port,
287 enum sci_status completion_status) 288 enum sci_status completion_status)
288{ 289{
289 pr_warn("%s:************************************************\n", 290 struct isci_host *isci_host;
290 __func__); 291
292 isci_host = (struct isci_host *)sci_object_get_association(controller);
293
294 dev_notice(&isci_host->pdev->dev, "Port stop complete\n");
291} 295}
292 296
293/** 297/**
294 * scic_cb_port_hard_reset_complete() - This method informs the user when a 298 * isci_event_port_hard_reset_complete() - This method informs the user when a
295 * hard reset on the port has completed. This hard reset could have been 299 * hard reset on the port has completed. This hard reset could have been
296 * initiated by the user or by the remote port. 300 * initiated by the user or by the remote port.
297 * @controller: This parameter represents the controller which contains the 301 * @controller: This parameter represents the controller which contains the
@@ -302,7 +306,7 @@ void scic_cb_port_stop_complete(
302 * being completed. 306 * being completed.
303 * 307 *
304 */ 308 */
305void scic_cb_port_hard_reset_complete( 309void isci_event_port_hard_reset_complete(
306 struct scic_sds_controller *controller, 310 struct scic_sds_controller *controller,
307 struct scic_sds_port *port, 311 struct scic_sds_port *port,
308 enum sci_status completion_status) 312 enum sci_status completion_status)
@@ -314,7 +318,7 @@ void scic_cb_port_hard_reset_complete(
314} 318}
315 319
316/** 320/**
317 * scic_cb_port_ready() - This method informs the user that the port is now in 321 * isci_event_port_ready() - This method informs the user that the port is now in
318 * a ready state and can be utilized to issue IOs. 322 * a ready state and can be utilized to issue IOs.
319 * @controller: This parameter represents the controller which contains the 323 * @controller: This parameter represents the controller which contains the
320 * port. 324 * port.
@@ -322,7 +326,7 @@ void scic_cb_port_hard_reset_complete(
322 * is being invoked. 326 * is being invoked.
323 * 327 *
324 */ 328 */
325void scic_cb_port_ready( 329void isci_event_port_ready(
326 struct scic_sds_controller *controller, 330 struct scic_sds_controller *controller,
327 struct scic_sds_port *port) 331 struct scic_sds_port *port)
328{ 332{
@@ -342,7 +346,7 @@ void scic_cb_port_ready(
342} 346}
343 347
344/** 348/**
345 * scic_cb_port_not_ready() - This method informs the user that the port is now 349 * isci_event_port_not_ready() - This method informs the user that the port is now
346 * not in a ready (i.e. busy) state and can't be utilized to issue IOs. 350 * not in a ready (i.e. busy) state and can't be utilized to issue IOs.
347 * @controller: This parameter represents the controller which contains the 351 * @controller: This parameter represents the controller which contains the
348 * port. 352 * port.
@@ -350,7 +354,7 @@ void scic_cb_port_ready(
350 * is being invoked. 354 * is being invoked.
351 * 355 *
352 */ 356 */
353void scic_cb_port_not_ready( 357void isci_event_port_not_ready(
354 struct scic_sds_controller *controller, 358 struct scic_sds_controller *controller,
355 struct scic_sds_port *port, 359 struct scic_sds_port *port,
356 u32 reason_code) 360 u32 reason_code)
@@ -371,7 +375,7 @@ void scic_cb_port_not_ready(
371} 375}
372 376
373/** 377/**
374 * scic_cb_port_invalid_link_up() - This method informs the SCI Core user that 378 * isci_event_port_invalid_link_up() - This method informs the SCI Core user that
375 * a phy/link became ready, but the phy is not allowed in the port. In some 379 * a phy/link became ready, but the phy is not allowed in the port. In some
376 * situations the underlying hardware only allows for certain phy to port 380 * situations the underlying hardware only allows for certain phy to port
377 * mappings. If these mappings are violated, then this API is invoked. 381 * mappings. If these mappings are violated, then this API is invoked.
@@ -383,17 +387,19 @@ void scic_cb_port_not_ready(
383 * a valid member of the port. 387 * a valid member of the port.
384 * 388 *
385 */ 389 */
386void scic_cb_port_invalid_link_up( 390void isci_event_port_invalid_link_up(
387 struct scic_sds_controller *controller, 391 struct scic_sds_controller *controller,
388 struct scic_sds_port *port, 392 struct scic_sds_port *port,
389 struct scic_sds_phy *phy) 393 struct scic_sds_phy *phy)
390{ 394{
391 pr_warn("%s:************************************************\n", 395 struct isci_host *isci_host;
392 __func__); 396
397 isci_host = (struct isci_host *)sci_object_get_association(controller);
398 dev_warn(&isci_host->pdev->dev, "Invalid link up!\n");
393} 399}
394 400
395/** 401/**
396 * scic_cb_port_bc_change_primitive_received() - This callback method informs 402 * isci_event_port_bc_change_primitive_received() - This callback method informs
397 * the user that a broadcast change primitive was received. 403 * the user that a broadcast change primitive was received.
398 * @controller: This parameter represents the controller which contains the 404 * @controller: This parameter represents the controller which contains the
399 * port. 405 * port.
@@ -403,7 +409,7 @@ void scic_cb_port_invalid_link_up(
403 * @phy: This parameter specifies the phy on which the primitive was received. 409 * @phy: This parameter specifies the phy on which the primitive was received.
404 * 410 *
405 */ 411 */
406void scic_cb_port_bc_change_primitive_received( 412void isci_event_port_bc_change_primitive_received(
407 struct scic_sds_controller *controller, 413 struct scic_sds_controller *controller,
408 struct scic_sds_port *port, 414 struct scic_sds_port *port,
409 struct scic_sds_phy *phy) 415 struct scic_sds_phy *phy)
@@ -422,7 +428,7 @@ void scic_cb_port_bc_change_primitive_received(
422 428
423 429
424/** 430/**
425 * scic_cb_port_link_up() - This callback method informs the user that a phy 431 * isci_event_port_link_up() - This callback method informs the user that a phy
426 * has become operational and is capable of communicating with the remote 432 * has become operational and is capable of communicating with the remote
427 * end point. 433 * end point.
428 * @controller: This parameter represents the controller associated with the 434 * @controller: This parameter represents the controller associated with the
@@ -435,7 +441,7 @@ void scic_cb_port_bc_change_primitive_received(
435 * 441 *
436 * none. 442 * none.
437 */ 443 */
438void scic_cb_port_link_up( 444void isci_event_port_link_up(
439 struct scic_sds_controller *controller, 445 struct scic_sds_controller *controller,
440 struct scic_sds_port *port, 446 struct scic_sds_port *port,
441 struct scic_sds_phy *phy) 447 struct scic_sds_phy *phy)
@@ -452,7 +458,7 @@ void scic_cb_port_link_up(
452} 458}
453 459
454/** 460/**
455 * scic_cb_port_link_down() - This callback method informs the user that a phy 461 * isci_event_port_link_down() - This callback method informs the user that a phy
456 * is no longer operational and is not capable of communicating with the 462 * is no longer operational and is not capable of communicating with the
457 * remote end point. 463 * remote end point.
458 * @controller: This parameter represents the controller associated with the 464 * @controller: This parameter represents the controller associated with the
@@ -465,7 +471,7 @@ void scic_cb_port_link_up(
465 * 471 *
466 * none. 472 * none.
467 */ 473 */
468void scic_cb_port_link_down( 474void isci_event_port_link_down(
469 struct scic_sds_controller *controller, 475 struct scic_sds_controller *controller,
470 struct scic_sds_port *port, 476 struct scic_sds_port *port,
471 struct scic_sds_phy *phy) 477 struct scic_sds_phy *phy)
@@ -490,7 +496,7 @@ void scic_cb_port_link_down(
490} 496}
491 497
492/** 498/**
493 * scic_cb_remote_device_start_complete() - This user callback method will 499 * isci_event_remote_device_start_complete() - This user callback method will
494 * inform the user that a start operation has completed. 500 * inform the user that a start operation has completed.
495 * @controller: This parameter specifies the core controller associated with 501 * @controller: This parameter specifies the core controller associated with
496 * the completion callback. 502 * the completion callback.
@@ -500,7 +506,7 @@ void scic_cb_port_link_down(
500 * operation. 506 * operation.
501 * 507 *
502 */ 508 */
503void scic_cb_remote_device_start_complete( 509void isci_event_remote_device_start_complete(
504 struct scic_sds_controller *controller, 510 struct scic_sds_controller *controller,
505 struct scic_sds_remote_device *remote_device, 511 struct scic_sds_remote_device *remote_device,
506 enum sci_status completion_status) 512 enum sci_status completion_status)
@@ -525,7 +531,7 @@ void scic_cb_remote_device_start_complete(
525} 531}
526 532
527/** 533/**
528 * scic_cb_remote_device_stop_complete() - This user callback method will 534 * isci_event_remote_device_stop_complete() - This user callback method will
529 * inform the user that a stop operation has completed. 535 * inform the user that a stop operation has completed.
530 * @controller: This parameter specifies the core controller associated with 536 * @controller: This parameter specifies the core controller associated with
531 * the completion callback. 537 * the completion callback.
@@ -535,7 +541,7 @@ void scic_cb_remote_device_start_complete(
535 * operation. 541 * operation.
536 * 542 *
537 */ 543 */
538void scic_cb_remote_device_stop_complete( 544void isci_event_remote_device_stop_complete(
539 struct scic_sds_controller *controller, 545 struct scic_sds_controller *controller,
540 struct scic_sds_remote_device *remote_device, 546 struct scic_sds_remote_device *remote_device,
541 enum sci_status completion_status) 547 enum sci_status completion_status)
@@ -560,7 +566,7 @@ void scic_cb_remote_device_stop_complete(
560} 566}
561 567
562/** 568/**
563 * scic_cb_remote_device_ready() - This user callback method will inform the 569 * isci_event_remote_device_ready() - This user callback method will inform the
564 * user that a remote device is now capable of handling IO requests. 570 * user that a remote device is now capable of handling IO requests.
565 * @controller: This parameter specifies the core controller associated with 571 * @controller: This parameter specifies the core controller associated with
566 * the completion callback. 572 * the completion callback.
@@ -568,7 +574,7 @@ void scic_cb_remote_device_stop_complete(
568 * the callback. 574 * the callback.
569 * 575 *
570 */ 576 */
571void scic_cb_remote_device_ready( 577void isci_event_remote_device_ready(
572 struct scic_sds_controller *controller, 578 struct scic_sds_controller *controller,
573 struct scic_sds_remote_device *remote_device) 579 struct scic_sds_remote_device *remote_device)
574{ 580{
@@ -583,7 +589,7 @@ void scic_cb_remote_device_ready(
583} 589}
584 590
585/** 591/**
586 * scic_cb_remote_device_not_ready() - This user callback method will inform 592 * isci_event_remote_device_not_ready() - This user callback method will inform
587 * the user that a remote device is no longer capable of handling IO 593 * the user that a remote device is no longer capable of handling IO
588 * requests (until a ready callback is invoked). 594 * requests (until a ready callback is invoked).
589 * @controller: This parameter specifies the core controller associated with 595 * @controller: This parameter specifies the core controller associated with
@@ -594,7 +600,7 @@ void scic_cb_remote_device_ready(
594 * going to a not ready state. 600 * going to a not ready state.
595 * 601 *
596 */ 602 */
597void scic_cb_remote_device_not_ready( 603void isci_event_remote_device_not_ready(
598 struct scic_sds_controller *controller, 604 struct scic_sds_controller *controller,
599 struct scic_sds_remote_device *remote_device, 605 struct scic_sds_remote_device *remote_device,
600 u32 reason_code) 606 u32 reason_code)
diff --git a/drivers/scsi/isci/events.h b/drivers/scsi/isci/events.h
new file mode 100644
index 000000000000..98526e9fb14a
--- /dev/null
+++ b/drivers/scsi/isci/events.h
@@ -0,0 +1,370 @@
1/*
2 * This file is provided under a dual BSD/GPLv2 license. When using or
3 * redistributing this file, you may do so under either license.
4 *
5 * GPL LICENSE SUMMARY
6 *
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
23 *
24 * BSD LICENSE
25 *
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
28 *
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
31 * are met:
32 *
33 * * Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * * Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in
37 * the documentation and/or other materials provided with the
38 * distribution.
39 * * Neither the name of Intel Corporation nor the names of its
40 * contributors may be used to endorse or promote products derived
41 * from this software without specific prior written permission.
42 *
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
46 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
47 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
51 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 */
55
56#ifndef _ISCI_EVENT_H_
57#define _ISCI_EVENT_H_
58
59/**
60 * isci_event_timer_create() - This callback method asks the user to create a
61 * timer and provide a handle for this timer for use in further timer
62 * interactions.
63 * @controller: This parameter specifies the controller with which this timer
64 * is to be associated.
65 * @timer_callback: This parameter specifies the callback method to be invoked
66 * whenever the timer expires.
67 * @cookie: This parameter specifies a piece of information that the user must
68 * retain. This cookie is to be supplied by the user anytime a timeout
69 * occurs for the created timer.
70 *
71 * The "timer_callback" method should be executed in a mutually exlusive manner
72 * from the controller completion handler handler. This method returns a handle
73 * to a timer object created by the user. The handle will be utilized for all
74 * further interactions relating to this timer.
75 */
76void *isci_event_timer_create(
77 struct scic_sds_controller *controller,
78 void (*timer_callback)(void *),
79 void *cookie);
80
81/**
82 * isci_event_timer_start() - This callback method asks the user to start the
83 * supplied timer.
84 * @controller: This parameter specifies the controller with which this timer
85 * is to associated.
86 * @timer: This parameter specifies the timer to be started.
87 * @milliseconds: This parameter specifies the number of milliseconds for which
88 * to stall. The operating system driver is allowed to round this value up
89 * where necessary.
90 *
91 * All timers in the system started by the SCI Core are one shot timers.
92 * Therefore, the SCI user should make sure that it removes the timer from it's
93 * list when a timer actually fires. Additionally, SCI Core user's should be
94 * able to handle calls from the SCI Core to stop a timer that may already be
95 * stopped. none
96 */
97void isci_event_timer_start(
98 struct scic_sds_controller *controller,
99 void *timer,
100 u32 milliseconds);
101
102/**
103 * isci_event_timer_stop() - This callback method asks the user to stop the
104 * supplied timer.
105 * @controller: This parameter specifies the controller with which this timer
106 * is to associated.
107 * @timer: This parameter specifies the timer to be stopped.
108 *
109 */
110void isci_event_timer_stop(
111 struct scic_sds_controller *controller,
112 void *timer);
113
114/**
115 * isci_event_controller_start_complete() - This user callback will inform the
116 * user that the controller has finished the start process.
117 * @controller: This parameter specifies the controller that was started.
118 * @completion_status: This parameter specifies the results of the start
119 * operation. SCI_SUCCESS indicates successful completion.
120 *
121 */
122void isci_event_controller_start_complete(
123 struct scic_sds_controller *controller,
124 enum sci_status completion_status);
125
126/**
127 * isci_event_controller_stop_complete() - This user callback will inform the
128 * user that the controller has finished the stop process.
129 * @controller: This parameter specifies the controller that was stopped.
130 * @completion_status: This parameter specifies the results of the stop
131 * operation. SCI_SUCCESS indicates successful completion.
132 *
133 */
134void isci_event_controller_stop_complete(
135 struct scic_sds_controller *controller,
136 enum sci_status completion_status);
137
138/**
139 * isci_event_io_request_complete() - This user callback will inform the user
140 * that an IO request has completed.
141 * @controller: This parameter specifies the controller on which the IO is
142 * completing.
143 * @remote_device: This parameter specifies the remote device on which this IO
144 * request is completing.
145 * @io_request: This parameter specifies the IO request that has completed.
146 * @completion_status: This parameter specifies the results of the IO request
147 * operation. SCI_SUCCESS indicates successful completion.
148 *
149 */
150void isci_event_io_request_complete(
151 struct scic_sds_controller *controller,
152 struct scic_sds_remote_device *remote_device,
153 struct scic_sds_request *scic_io_request,
154 enum sci_io_status completion_status);
155
156/**
157 * isci_event_task_request_complete() - This user callback will inform the user
158 * that a task management request completed.
159 * @controller: This parameter specifies the controller on which the task
160 * management request is completing.
161 * @remote_device: This parameter specifies the remote device on which this
162 * task management request is completing.
163 * @task_request: This parameter specifies the task management request that has
164 * completed.
165 * @completion_status: This parameter specifies the results of the IO request
166 * operation. SCI_SUCCESS indicates successful completion.
167 *
168 */
169void isci_event_task_request_complete(
170 struct scic_sds_controller *controller,
171 struct scic_sds_remote_device *remote_device,
172 struct scic_sds_request *scic_task_request,
173 enum sci_task_status completion_status);
174
175/**
176 * isci_event_port_stop_complete() - This method informs the user when a stop
177 * operation on the port has completed.
178 * @controller: This parameter represents the controller which contains the
179 * port.
180 * @port: This parameter specifies the SCI port object for which the callback
181 * is being invoked.
182 * @completion_status: This parameter specifies the status for the operation
183 * being completed.
184 *
185 */
186void isci_event_port_stop_complete(
187 struct scic_sds_controller *controller,
188 struct scic_sds_port *port,
189 enum sci_status completion_status);
190
191/**
192 * isci_event_port_hard_reset_complete() - This method informs the user when a
193 * hard reset on the port has completed. This hard reset could have been
194 * initiated by the user or by the remote port.
195 * @controller: This parameter represents the controller which contains the
196 * port.
197 * @port: This parameter specifies the SCI port object for which the callback
198 * is being invoked.
199 * @completion_status: This parameter specifies the status for the operation
200 * being completed.
201 *
202 */
203void isci_event_port_hard_reset_complete(
204 struct scic_sds_controller *controller,
205 struct scic_sds_port *port,
206 enum sci_status completion_status);
207
208/**
209 * isci_event_port_ready() - This method informs the user that the port is now
210 * in a ready state and can be utilized to issue IOs.
211 * @controller: This parameter represents the controller which contains the
212 * port.
213 * @port: This parameter specifies the SCI port object for which the callback
214 * is being invoked.
215 *
216 */
217void isci_event_port_ready(
218 struct scic_sds_controller *controller,
219 struct scic_sds_port *port);
220
221/**
222 * isci_event_port_not_ready() - This method informs the user that the port is
223 * now not in a ready (i.e. busy) state and can't be utilized to issue IOs.
224 * @controller: This parameter represents the controller which contains the
225 * port.
226 * @port: This parameter specifies the SCI port object for which the callback
227 * is being invoked.
228 * @reason_code: This parameter specifies the reason for the port not ready
229 * callback.
230 *
231 */
232void isci_event_port_not_ready(
233 struct scic_sds_controller *controller,
234 struct scic_sds_port *port,
235 u32 reason_code);
236
237/**
238 * isci_event_port_invalid_link_up() - This method informs the SCI Core user
239 * that a phy/link became ready, but the phy is not allowed in the port. In
240 * some situations the underlying hardware only allows for certain phy to port
241 * mappings. If these mappings are violated, then this API is invoked.
242 * @controller: This parameter represents the controller which contains the
243 * port.
244 * @port: This parameter specifies the SCI port object for which the callback
245 * is being invoked.
246 * @phy: This parameter specifies the phy that came ready, but the phy can't be
247 * a valid member of the port.
248 *
249 */
250void isci_event_port_invalid_link_up(
251 struct scic_sds_controller *controller,
252 struct scic_sds_port *port,
253 struct scic_sds_phy *phy);
254
255/**
256 * isci_event_port_bc_change_primitive_received() - This callback method informs
257 * the user that a broadcast change primitive was received.
258 * @controller: This parameter represents the controller which contains the
259 * port.
260 * @port: This parameter specifies the SCI port object for which the callback
261 * is being invoked. For instances where the phy on which the primitive was
262 * received is not part of a port, this parameter will be
263 * NULL.
264 * @phy: This parameter specifies the phy on which the primitive was received.
265 *
266 */
267void isci_event_port_bc_change_primitive_received(
268 struct scic_sds_controller *controller,
269 struct scic_sds_port *port,
270 struct scic_sds_phy *phy);
271
272/**
273 * isci_event_port_link_up() - This callback method informs the user that a phy
274 * has become operational and is capable of communicating with the remote
275 * end point.
276 * @controller: This parameter represents the controller associated with the
277 * phy.
278 * @port: This parameter specifies the port object for which the user callback
279 * is being invoked. There may be conditions where this parameter can be
280 * NULL
281 * @phy: This parameter specifies the phy object for which the user callback is
282 * being invoked.
283 *
284 */
285void isci_event_port_link_up(
286 struct scic_sds_controller *controller,
287 struct scic_sds_port *port,
288 struct scic_sds_phy *phy);
289
290/**
291 * isci_event_port_link_down() - This callback method informs the user that a
292 * phy is no longer operational and is not capable of communicating with the
293 * remote end point.
294 * @controller: This parameter represents the controller associated with the
295 * phy.
296 * @port: This parameter specifies the port object for which the user callback
297 * is being invoked. There may be conditions where this parameter can be
298 * NULL
299 * @phy: This parameter specifies the phy object for which the user callback is
300 * being invoked.
301 *
302 */
303void isci_event_port_link_down(
304 struct scic_sds_controller *controller,
305 struct scic_sds_port *port,
306 struct scic_sds_phy *phy);
307
308/**
309 * isci_event_remote_device_start_complete() - This user callback method will
310 * inform the user that a start operation has completed.
311 * @controller: This parameter specifies the core controller associated with
312 * the completion callback.
313 * @remote_device: This parameter specifies the remote device associated with
314 * the completion callback.
315 * @completion_status: This parameter specifies the completion status for the
316 * operation.
317 *
318 */
319void isci_event_remote_device_start_complete(
320 struct scic_sds_controller *controller,
321 struct scic_sds_remote_device *remote_device,
322 enum sci_status completion_status);
323
324/**
325 * isci_event_remote_device_stop_complete() - This user callback method will
326 * inform the user that a stop operation has completed.
327 * @controller: This parameter specifies the core controller associated with
328 * the completion callback.
329 * @remote_device: This parameter specifies the remote device associated with
330 * the completion callback.
331 * @completion_status: This parameter specifies the completion status for the
332 * operation.
333 *
334 */
335void isci_event_remote_device_stop_complete(
336 struct scic_sds_controller *controller,
337 struct scic_sds_remote_device *remote_device,
338 enum sci_status completion_status);
339
340/**
341 * isci_event_remote_device_ready() - This user callback method will inform the
342 * user that a remote device is now capable of handling IO requests.
343 * @controller: This parameter specifies the core controller associated with
344 * the completion callback.
345 * @remote_device: This parameter specifies the remote device associated with
346 * the callback.
347 *
348 */
349void isci_event_remote_device_ready(
350 struct scic_sds_controller *controller,
351 struct scic_sds_remote_device *remote_device);
352
353/**
354 * isci_event_remote_device_not_ready() - This user callback method will inform
355 * the user that a remote device is no longer capable of handling IO
356 * requests (until a ready callback is invoked).
357 * @controller: This parameter specifies the core controller associated with
358 * the completion callback.
359 * @remote_device: This parameter specifies the remote device associated with
360 * the callback.
361 * @reason_code: This paramete specifies the reason the remote device is not
362 * ready.
363 *
364 */
365void isci_event_remote_device_not_ready(
366 struct scic_sds_controller *controller,
367 struct scic_sds_remote_device *remote_device,
368 u32 reason_code);
369
370#endif
diff --git a/drivers/scsi/isci/isci.h b/drivers/scsi/isci/isci.h
index 225764f9d935..9ec91f8e5fda 100644
--- a/drivers/scsi/isci/isci.h
+++ b/drivers/scsi/isci/isci.h
@@ -85,6 +85,7 @@
85#include "timers.h" 85#include "timers.h"
86#include "sci_status.h" 86#include "sci_status.h"
87#include "request.h" 87#include "request.h"
88#include "events.h"
88 89
89extern struct kmem_cache *isci_kmem_cache; 90extern struct kmem_cache *isci_kmem_cache;
90extern struct isci_firmware *isci_firmware; 91extern struct isci_firmware *isci_firmware;