aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorMaciej Patelczyk <maciej.patelczyk@intel.com>2011-04-28 18:06:06 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:00:38 -0400
commitd3757c3aeb75259e0b86a872e98841a2ea4cb5e8 (patch)
treee2484fe1e6601fd343b950280c388586a4217a4c /drivers/scsi
parent9a0fff7bf0ffd4f57fc71d8075a92008b606eb61 (diff)
isci: Removed sci_base_object from scic_sds_controller.
The 'struct sci_base_object' was removed from the struct scic_sds_controller and was replaced by a pointer to struct isci_host. Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/isci/core/scic_sds_controller.c44
-rw-r--r--drivers/scsi/isci/core/scic_sds_controller.h8
-rw-r--r--drivers/scsi/isci/core/scic_sds_phy.c6
-rw-r--r--drivers/scsi/isci/core/scic_sds_port.c16
-rw-r--r--drivers/scsi/isci/core/scic_sds_port_configuration_agent.c2
-rw-r--r--drivers/scsi/isci/core/scic_sds_request.c2
-rw-r--r--drivers/scsi/isci/host.c2
-rw-r--r--drivers/scsi/isci/port.c5
-rw-r--r--drivers/scsi/isci/remote_device.c8
-rw-r--r--drivers/scsi/isci/sci_environment.h3
-rw-r--r--drivers/scsi/isci/smp_remote_device.c4
-rw-r--r--drivers/scsi/isci/stp_remote_device.c6
12 files changed, 49 insertions, 57 deletions
diff --git a/drivers/scsi/isci/core/scic_sds_controller.c b/drivers/scsi/isci/core/scic_sds_controller.c
index 135aa3e5e132..d7c37dc64ac4 100644
--- a/drivers/scsi/isci/core/scic_sds_controller.c
+++ b/drivers/scsi/isci/core/scic_sds_controller.c
@@ -213,7 +213,7 @@ static void scic_sds_controller_power_control_timer_handler(
213 213
214static void scic_sds_controller_initialize_power_control(struct scic_sds_controller *scic) 214static void scic_sds_controller_initialize_power_control(struct scic_sds_controller *scic)
215{ 215{
216 struct isci_host *ihost = sci_object_get_association(scic); 216 struct isci_host *ihost = scic->ihost;
217 scic->power_control.timer = isci_timer_create(ihost, 217 scic->power_control.timer = isci_timer_create(ihost,
218 scic, 218 scic,
219 scic_sds_controller_power_control_timer_handler); 219 scic_sds_controller_power_control_timer_handler);
@@ -584,7 +584,7 @@ static void scic_sds_controller_transition_to_ready(
584 struct scic_sds_controller *scic, 584 struct scic_sds_controller *scic,
585 enum sci_status status) 585 enum sci_status status)
586{ 586{
587 struct isci_host *ihost = sci_object_get_association(scic); 587 struct isci_host *ihost = scic->ihost;
588 588
589 if (scic->state_machine.current_state_id == 589 if (scic->state_machine.current_state_id ==
590 SCI_BASE_CONTROLLER_STATE_STARTING) { 590 SCI_BASE_CONTROLLER_STATE_STARTING) {
@@ -602,7 +602,7 @@ static void scic_sds_controller_transition_to_ready(
602static void scic_sds_controller_timeout_handler(void *_scic) 602static void scic_sds_controller_timeout_handler(void *_scic)
603{ 603{
604 struct scic_sds_controller *scic = _scic; 604 struct scic_sds_controller *scic = _scic;
605 struct isci_host *ihost = sci_object_get_association(scic); 605 struct isci_host *ihost = scic->ihost;
606 struct sci_base_state_machine *sm = &scic->state_machine; 606 struct sci_base_state_machine *sm = &scic->state_machine;
607 607
608 if (sm->current_state_id == SCI_BASE_CONTROLLER_STATE_STARTING) 608 if (sm->current_state_id == SCI_BASE_CONTROLLER_STATE_STARTING)
@@ -770,7 +770,7 @@ static void scic_sds_controller_phy_startup_timeout_handler(void *_scic)
770 770
771static enum sci_status scic_sds_controller_initialize_phy_startup(struct scic_sds_controller *scic) 771static enum sci_status scic_sds_controller_initialize_phy_startup(struct scic_sds_controller *scic)
772{ 772{
773 struct isci_host *ihost = sci_object_get_association(scic); 773 struct isci_host *ihost = scic->ihost;
774 774
775 scic->phy_startup_timer = isci_timer_create(ihost, 775 scic->phy_startup_timer = isci_timer_create(ihost,
776 scic, 776 scic,
@@ -1796,7 +1796,7 @@ void scic_sds_controller_release_frame(
1796 */ 1796 */
1797static void scic_sds_controller_set_default_config_parameters(struct scic_sds_controller *scic) 1797static void scic_sds_controller_set_default_config_parameters(struct scic_sds_controller *scic)
1798{ 1798{
1799 struct isci_host *ihost = sci_object_get_association(scic); 1799 struct isci_host *ihost = scic->ihost;
1800 u16 index; 1800 u16 index;
1801 1801
1802 /* Default to APC mode. */ 1802 /* Default to APC mode. */
@@ -2662,7 +2662,7 @@ enum sci_status scic_controller_initialize(
2662 } 2662 }
2663 2663
2664 2664
2665 ihost = sci_object_get_association(scic); 2665 ihost = scic->ihost;
2666 2666
2667 sci_base_state_machine_change_state(sm, SCI_BASE_CONTROLLER_STATE_INITIALIZING); 2667 sci_base_state_machine_change_state(sm, SCI_BASE_CONTROLLER_STATE_INITIALIZING);
2668 2668
@@ -2854,7 +2854,7 @@ enum sci_status scic_controller_start(struct scic_sds_controller *scic,
2854 /* Assign all the task entries to scic physical function */ 2854 /* Assign all the task entries to scic physical function */
2855 scic_sds_controller_assign_task_entries(scic); 2855 scic_sds_controller_assign_task_entries(scic);
2856 2856
2857 /* Now initialze the completion queue */ 2857 /* Now initialize the completion queue */
2858 scic_sds_controller_initialize_completion_queue(scic); 2858 scic_sds_controller_initialize_completion_queue(scic);
2859 2859
2860 /* Initialize the unsolicited frame queue for use */ 2860 /* Initialize the unsolicited frame queue for use */
@@ -2887,14 +2887,12 @@ enum sci_status scic_controller_start(struct scic_sds_controller *scic,
2887 * 2887 *
2888 * This method implements the actions taken by the struct scic_sds_controller on entry 2888 * This method implements the actions taken by the struct scic_sds_controller on entry
2889 * to the SCI_BASE_CONTROLLER_STATE_INITIAL. - Set the state handlers to the 2889 * to the SCI_BASE_CONTROLLER_STATE_INITIAL. - Set the state handlers to the
2890 * controllers initial state. none This function should initialze the 2890 * controllers initial state. none This function should initialize the
2891 * controller object. 2891 * controller object.
2892 */ 2892 */
2893static void scic_sds_controller_initial_state_enter(void *object) 2893static void scic_sds_controller_initial_state_enter(void *object)
2894{ 2894{
2895 struct scic_sds_controller *scic; 2895 struct scic_sds_controller *scic = object;
2896
2897 scic = (struct scic_sds_controller *)object;
2898 2896
2899 sci_base_state_machine_change_state(&scic->state_machine, 2897 sci_base_state_machine_change_state(&scic->state_machine,
2900 SCI_BASE_CONTROLLER_STATE_RESET); 2898 SCI_BASE_CONTROLLER_STATE_RESET);
@@ -2911,7 +2909,7 @@ static void scic_sds_controller_initial_state_enter(void *object)
2911 */ 2909 */
2912static inline void scic_sds_controller_starting_state_exit(void *object) 2910static inline void scic_sds_controller_starting_state_exit(void *object)
2913{ 2911{
2914 struct scic_sds_controller *scic = (struct scic_sds_controller *)object; 2912 struct scic_sds_controller *scic = object;
2915 2913
2916 isci_timer_stop(scic->timeout_timer); 2914 isci_timer_stop(scic->timeout_timer);
2917} 2915}
@@ -2927,9 +2925,7 @@ static inline void scic_sds_controller_starting_state_exit(void *object)
2927 */ 2925 */
2928static void scic_sds_controller_ready_state_enter(void *object) 2926static void scic_sds_controller_ready_state_enter(void *object)
2929{ 2927{
2930 struct scic_sds_controller *scic; 2928 struct scic_sds_controller *scic = object;
2931
2932 scic = (struct scic_sds_controller *)object;
2933 2929
2934 /* set the default interrupt coalescence number and timeout value. */ 2930 /* set the default interrupt coalescence number and timeout value. */
2935 scic_controller_set_interrupt_coalescence( 2931 scic_controller_set_interrupt_coalescence(
@@ -2946,9 +2942,7 @@ static void scic_sds_controller_ready_state_enter(void *object)
2946 */ 2942 */
2947static void scic_sds_controller_ready_state_exit(void *object) 2943static void scic_sds_controller_ready_state_exit(void *object)
2948{ 2944{
2949 struct scic_sds_controller *scic; 2945 struct scic_sds_controller *scic = object;
2950
2951 scic = (struct scic_sds_controller *)object;
2952 2946
2953 /* disable interrupt coalescence. */ 2947 /* disable interrupt coalescence. */
2954 scic_controller_set_interrupt_coalescence(scic, 0, 0); 2948 scic_controller_set_interrupt_coalescence(scic, 0, 0);
@@ -2966,9 +2960,7 @@ static void scic_sds_controller_ready_state_exit(void *object)
2966 */ 2960 */
2967static void scic_sds_controller_stopping_state_enter(void *object) 2961static void scic_sds_controller_stopping_state_enter(void *object)
2968{ 2962{
2969 struct scic_sds_controller *scic; 2963 struct scic_sds_controller *scic = object;
2970
2971 scic = (struct scic_sds_controller *)object;
2972 2964
2973 /* Stop all of the components for this controller */ 2965 /* Stop all of the components for this controller */
2974 scic_sds_controller_stop_phys(scic); 2966 scic_sds_controller_stop_phys(scic);
@@ -2981,23 +2973,21 @@ static void scic_sds_controller_stopping_state_enter(void *object)
2981 * @object: This is the object which is cast to a struct 2973 * @object: This is the object which is cast to a struct
2982 * scic_sds_controller object. 2974 * scic_sds_controller object.
2983 * 2975 *
2984 * This funciton implements the actions taken by the struct scic_sds_controller 2976 * This function implements the actions taken by the struct scic_sds_controller
2985 * on exit from the SCI_BASE_CONTROLLER_STATE_STOPPING. - 2977 * on exit from the SCI_BASE_CONTROLLER_STATE_STOPPING. -
2986 * This function stops the controller stopping timeout timer. 2978 * This function stops the controller stopping timeout timer.
2987 */ 2979 */
2988static inline void scic_sds_controller_stopping_state_exit(void *object) 2980static inline void scic_sds_controller_stopping_state_exit(void *object)
2989{ 2981{
2990 struct scic_sds_controller *scic = 2982 struct scic_sds_controller *scic = object;
2991 (struct scic_sds_controller *)object;
2992 2983
2993 isci_timer_stop(scic->timeout_timer); 2984 isci_timer_stop(scic->timeout_timer);
2994} 2985}
2995 2986
2996static void scic_sds_controller_resetting_state_enter(void *object) 2987static void scic_sds_controller_resetting_state_enter(void *object)
2997{ 2988{
2998 struct scic_sds_controller *scic; 2989 struct scic_sds_controller *scic = object;
2999 2990
3000 scic = container_of(object, typeof(*scic), parent);
3001 scic_sds_controller_reset_hardware(scic); 2991 scic_sds_controller_reset_hardware(scic);
3002 sci_base_state_machine_change_state(&scic->state_machine, 2992 sci_base_state_machine_change_state(&scic->state_machine,
3003 SCI_BASE_CONTROLLER_STATE_RESET); 2993 SCI_BASE_CONTROLLER_STATE_RESET);
@@ -3051,7 +3041,7 @@ enum sci_status scic_controller_construct(struct scic_sds_controller *scic,
3051 u8 i; 3041 u8 i;
3052 3042
3053 sci_base_state_machine_construct(&scic->state_machine, 3043 sci_base_state_machine_construct(&scic->state_machine,
3054 &scic->parent, scic_sds_controller_state_table, 3044 scic, scic_sds_controller_state_table,
3055 SCI_BASE_CONTROLLER_STATE_INITIAL); 3045 SCI_BASE_CONTROLLER_STATE_INITIAL);
3056 3046
3057 sci_base_state_machine_start(&scic->state_machine); 3047 sci_base_state_machine_start(&scic->state_machine);
diff --git a/drivers/scsi/isci/core/scic_sds_controller.h b/drivers/scsi/isci/core/scic_sds_controller.h
index ce81286e52fd..8e3240de3d92 100644
--- a/drivers/scsi/isci/core/scic_sds_controller.h
+++ b/drivers/scsi/isci/core/scic_sds_controller.h
@@ -125,17 +125,17 @@ struct scic_power_control {
125 125
126}; 126};
127 127
128struct isci_host;
128/** 129/**
129 * struct scic_sds_controller - 130 * struct scic_sds_controller -
130 * 131 *
131 * This structure represents the SCU contoller object. 132 * This structure represents the SCU controller object.
132 */ 133 */
133struct scic_sds_controller { 134struct scic_sds_controller {
134 /** 135 /**
135 * The field specifies that the parent object for the base controller 136 * The field specifies that the peer object for the controller.
136 * is the base object itself.
137 */ 137 */
138 struct sci_base_object parent; 138 struct isci_host *ihost;
139 139
140 /** 140 /**
141 * This field contains the information for the base controller state 141 * This field contains the information for the base controller state
diff --git a/drivers/scsi/isci/core/scic_sds_phy.c b/drivers/scsi/isci/core/scic_sds_phy.c
index 972b977a7c11..3b53968abb0a 100644
--- a/drivers/scsi/isci/core/scic_sds_phy.c
+++ b/drivers/scsi/isci/core/scic_sds_phy.c
@@ -336,7 +336,7 @@ enum sci_status scic_sds_phy_initialize(
336 struct scu_link_layer_registers __iomem *link_layer_registers) 336 struct scu_link_layer_registers __iomem *link_layer_registers)
337{ 337{
338 struct scic_sds_controller *scic = scic_sds_phy_get_controller(sci_phy); 338 struct scic_sds_controller *scic = scic_sds_phy_get_controller(sci_phy);
339 struct isci_host *ihost = sci_object_get_association(scic); 339 struct isci_host *ihost = scic->ihost;
340 340
341 /* Create the SIGNATURE FIS Timeout timer for this phy */ 341 /* Create the SIGNATURE FIS Timeout timer for this phy */
342 sci_phy->sata_timeout_timer = 342 sci_phy->sata_timeout_timer =
@@ -1932,7 +1932,7 @@ scic_sds_phy_stopped_state_start_handler(struct scic_sds_phy *sci_phy)
1932 struct scic_sds_controller *scic; 1932 struct scic_sds_controller *scic;
1933 1933
1934 scic = scic_sds_phy_get_controller(sci_phy), 1934 scic = scic_sds_phy_get_controller(sci_phy),
1935 ihost = sci_object_get_association(scic); 1935 ihost = scic->ihost;
1936 1936
1937 /* Create the SIGNATURE FIS Timeout timer for this phy */ 1937 /* Create the SIGNATURE FIS Timeout timer for this phy */
1938 sci_phy->sata_timeout_timer = isci_timer_create(ihost, sci_phy, 1938 sci_phy->sata_timeout_timer = isci_timer_create(ihost, sci_phy,
@@ -2220,7 +2220,7 @@ static void scic_sds_phy_stopped_state_enter(void *object)
2220{ 2220{
2221 struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object; 2221 struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
2222 struct scic_sds_controller *scic = scic_sds_phy_get_controller(sci_phy); 2222 struct scic_sds_controller *scic = scic_sds_phy_get_controller(sci_phy);
2223 struct isci_host *ihost = sci_object_get_association(scic); 2223 struct isci_host *ihost = scic->ihost;
2224 2224
2225 sci_phy = (struct scic_sds_phy *)object; 2225 sci_phy = (struct scic_sds_phy *)object;
2226 2226
diff --git a/drivers/scsi/isci/core/scic_sds_port.c b/drivers/scsi/isci/core/scic_sds_port.c
index 1cbf1d6b2f9a..857482b27ffc 100644
--- a/drivers/scsi/isci/core/scic_sds_port.c
+++ b/drivers/scsi/isci/core/scic_sds_port.c
@@ -657,7 +657,7 @@ static void scic_sds_port_activate_phy(struct scic_sds_port *sci_port,
657{ 657{
658 struct scic_sds_controller *scic = scic_sds_port_get_controller(sci_port); 658 struct scic_sds_controller *scic = scic_sds_port_get_controller(sci_port);
659 struct sci_sas_identify_address_frame_protocols protocols; 659 struct sci_sas_identify_address_frame_protocols protocols;
660 struct isci_host *ihost = sci_object_get_association(scic); 660 struct isci_host *ihost = scic->ihost;
661 661
662 scic_sds_phy_get_attached_phy_protocols(sci_phy, &protocols); 662 scic_sds_phy_get_attached_phy_protocols(sci_phy, &protocols);
663 663
@@ -679,7 +679,7 @@ void scic_sds_port_deactivate_phy(struct scic_sds_port *sci_port,
679{ 679{
680 struct scic_sds_controller *scic = scic_sds_port_get_controller(sci_port); 680 struct scic_sds_controller *scic = scic_sds_port_get_controller(sci_port);
681 struct isci_port *iport = sci_object_get_association(sci_port); 681 struct isci_port *iport = sci_object_get_association(sci_port);
682 struct isci_host *ihost = sci_object_get_association(scic); 682 struct isci_host *ihost = scic->ihost;
683 struct isci_phy *iphy = sci_object_get_association(sci_phy); 683 struct isci_phy *iphy = sci_object_get_association(sci_phy);
684 684
685 sci_port->active_phy_mask &= ~(1 << sci_phy->phy_index); 685 sci_port->active_phy_mask &= ~(1 << sci_phy->phy_index);
@@ -1012,7 +1012,7 @@ void scic_sds_port_broadcast_change_received(
1012 struct scic_sds_phy *sci_phy) 1012 struct scic_sds_phy *sci_phy)
1013{ 1013{
1014 struct scic_sds_controller *scic = sci_port->owning_controller; 1014 struct scic_sds_controller *scic = sci_port->owning_controller;
1015 struct isci_host *ihost = sci_object_get_association(scic); 1015 struct isci_host *ihost = scic->ihost;
1016 1016
1017 /* notify the user. */ 1017 /* notify the user. */
1018 isci_port_bc_change_received(ihost, sci_port, sci_phy); 1018 isci_port_bc_change_received(ihost, sci_port, sci_phy);
@@ -1666,7 +1666,7 @@ static void scic_sds_port_ready_substate_operational_enter(void *object)
1666 struct scic_sds_port *sci_port = (struct scic_sds_port *)object; 1666 struct scic_sds_port *sci_port = (struct scic_sds_port *)object;
1667 struct scic_sds_controller *scic = 1667 struct scic_sds_controller *scic =
1668 scic_sds_port_get_controller(sci_port); 1668 scic_sds_port_get_controller(sci_port);
1669 struct isci_host *ihost = sci_object_get_association(scic); 1669 struct isci_host *ihost = scic->ihost;
1670 struct isci_port *iport = sci_object_get_association(sci_port); 1670 struct isci_port *iport = sci_object_get_association(sci_port);
1671 1671
1672 scic_sds_port_set_ready_state_handlers( 1672 scic_sds_port_set_ready_state_handlers(
@@ -1707,7 +1707,7 @@ static void scic_sds_port_ready_substate_operational_exit(void *object)
1707 struct scic_sds_port *sci_port = (struct scic_sds_port *)object; 1707 struct scic_sds_port *sci_port = (struct scic_sds_port *)object;
1708 struct scic_sds_controller *scic = 1708 struct scic_sds_controller *scic =
1709 scic_sds_port_get_controller(sci_port); 1709 scic_sds_port_get_controller(sci_port);
1710 struct isci_host *ihost = sci_object_get_association(scic); 1710 struct isci_host *ihost = scic->ihost;
1711 struct isci_port *iport = sci_object_get_association(sci_port); 1711 struct isci_port *iport = sci_object_get_association(sci_port);
1712 1712
1713 /* 1713 /*
@@ -1738,7 +1738,7 @@ static void scic_sds_port_ready_substate_configuring_enter(void *object)
1738 struct scic_sds_port *sci_port = (struct scic_sds_port *)object; 1738 struct scic_sds_port *sci_port = (struct scic_sds_port *)object;
1739 struct scic_sds_controller *scic = 1739 struct scic_sds_controller *scic =
1740 scic_sds_port_get_controller(sci_port); 1740 scic_sds_port_get_controller(sci_port);
1741 struct isci_host *ihost = sci_object_get_association(scic); 1741 struct isci_host *ihost = scic->ihost;
1742 struct isci_port *iport = sci_object_get_association(sci_port); 1742 struct isci_port *iport = sci_object_get_association(sci_port);
1743 1743
1744 scic_sds_port_set_ready_state_handlers( 1744 scic_sds_port_set_ready_state_handlers(
@@ -1825,7 +1825,7 @@ static enum sci_status
1825scic_sds_port_stopped_state_start_handler(struct scic_sds_port *sci_port) 1825scic_sds_port_stopped_state_start_handler(struct scic_sds_port *sci_port)
1826{ 1826{
1827 struct scic_sds_controller *scic = sci_port->owning_controller; 1827 struct scic_sds_controller *scic = sci_port->owning_controller;
1828 struct isci_host *ihost = sci_object_get_association(scic); 1828 struct isci_host *ihost = scic->ihost;
1829 enum sci_status status = SCI_SUCCESS; 1829 enum sci_status status = SCI_SUCCESS;
1830 u32 phy_mask; 1830 u32 phy_mask;
1831 1831
@@ -2312,7 +2312,7 @@ static void scic_sds_port_ready_state_enter(void *object)
2312 2312
2313 sci_port = container_of(object, typeof(*sci_port), parent); 2313 sci_port = container_of(object, typeof(*sci_port), parent);
2314 scic = scic_sds_port_get_controller(sci_port); 2314 scic = scic_sds_port_get_controller(sci_port);
2315 ihost = sci_object_get_association(scic); 2315 ihost = scic->ihost;
2316 iport = sci_object_get_association(sci_port); 2316 iport = sci_object_get_association(sci_port);
2317 2317
2318 /* Put the ready state handlers in place though they will not be there long */ 2318 /* Put the ready state handlers in place though they will not be there long */
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 a7e3833b1d56..df257ffa0f84 100644
--- a/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c
+++ b/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c
@@ -821,7 +821,7 @@ enum sci_status scic_sds_port_configuration_agent_initialize(
821{ 821{
822 enum sci_status status = SCI_SUCCESS; 822 enum sci_status status = SCI_SUCCESS;
823 enum scic_port_configuration_mode mode; 823 enum scic_port_configuration_mode mode;
824 struct isci_host *ihost = sci_object_get_association(scic); 824 struct isci_host *ihost = scic->ihost;
825 825
826 mode = scic->oem_parameters.sds1.controller.mode_type; 826 mode = scic->oem_parameters.sds1.controller.mode_type;
827 827
diff --git a/drivers/scsi/isci/core/scic_sds_request.c b/drivers/scsi/isci/core/scic_sds_request.c
index 3ebfb7f8b702..a438ea22315a 100644
--- a/drivers/scsi/isci/core/scic_sds_request.c
+++ b/drivers/scsi/isci/core/scic_sds_request.c
@@ -1612,7 +1612,7 @@ static void scic_sds_request_completed_state_enter(void *object)
1612 struct scic_sds_request *sci_req = (struct scic_sds_request *)object; 1612 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1613 struct scic_sds_controller *scic = 1613 struct scic_sds_controller *scic =
1614 scic_sds_request_get_controller(sci_req); 1614 scic_sds_request_get_controller(sci_req);
1615 struct isci_host *ihost = sci_object_get_association(scic); 1615 struct isci_host *ihost = scic->ihost;
1616 struct isci_request *ireq = sci_object_get_association(sci_req); 1616 struct isci_request *ireq = sci_object_get_association(sci_req);
1617 1617
1618 SET_STATE_HANDLER(sci_req, 1618 SET_STATE_HANDLER(sci_req,
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c
index 676bcdbfc316..55bfa3dbfb8f 100644
--- a/drivers/scsi/isci/host.c
+++ b/drivers/scsi/isci/host.c
@@ -365,7 +365,7 @@ int isci_host_init(struct isci_host *isci_host)
365 } 365 }
366 366
367 isci_host->core_controller = controller; 367 isci_host->core_controller = controller;
368 sci_object_set_association(isci_host->core_controller, isci_host); 368 controller->ihost = isci_host;
369 spin_lock_init(&isci_host->state_lock); 369 spin_lock_init(&isci_host->state_lock);
370 spin_lock_init(&isci_host->scic_lock); 370 spin_lock_init(&isci_host->scic_lock);
371 spin_lock_init(&isci_host->queue_lock); 371 spin_lock_init(&isci_host->queue_lock);
diff --git a/drivers/scsi/isci/port.c b/drivers/scsi/isci/port.c
index 430b29ed6c7e..c0916b199b70 100644
--- a/drivers/scsi/isci/port.c
+++ b/drivers/scsi/isci/port.c
@@ -68,6 +68,7 @@
68#include "scic_port.h" 68#include "scic_port.h"
69#include "port.h" 69#include "port.h"
70#include "request.h" 70#include "request.h"
71#include "core/scic_sds_controller.h"
71 72
72static void isci_port_change_state( 73static void isci_port_change_state(
73 struct isci_port *isci_port, 74 struct isci_port *isci_port,
@@ -472,7 +473,7 @@ void isci_port_invalid_link_up(struct scic_sds_controller *scic,
472 struct scic_sds_port *sci_port, 473 struct scic_sds_port *sci_port,
473 struct scic_sds_phy *phy) 474 struct scic_sds_phy *phy)
474{ 475{
475 struct isci_host *ihost = sci_object_get_association(scic); 476 struct isci_host *ihost = scic->ihost;
476 477
477 dev_warn(&ihost->pdev->dev, "Invalid link up!\n"); 478 dev_warn(&ihost->pdev->dev, "Invalid link up!\n");
478} 479}
@@ -481,7 +482,7 @@ void isci_port_stop_complete(struct scic_sds_controller *scic,
481 struct scic_sds_port *sci_port, 482 struct scic_sds_port *sci_port,
482 enum sci_status completion_status) 483 enum sci_status completion_status)
483{ 484{
484 struct isci_host *ihost = sci_object_get_association(scic); 485 struct isci_host *ihost = scic->ihost;
485 486
486 dev_dbg(&ihost->pdev->dev, "Port stop complete\n"); 487 dev_dbg(&ihost->pdev->dev, "Port stop complete\n");
487} 488}
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c
index b23f9a5a085d..bb696cf11f2c 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -1211,7 +1211,7 @@ static void scic_sds_remote_device_stopped_state_enter(void *object)
1211 1211
1212 sci_dev = container_of(object, typeof(*sci_dev), parent); 1212 sci_dev = container_of(object, typeof(*sci_dev), parent);
1213 scic = scic_sds_remote_device_get_controller(sci_dev); 1213 scic = scic_sds_remote_device_get_controller(sci_dev);
1214 ihost = sci_object_get_association(scic); 1214 ihost = scic->ihost;
1215 idev = sci_object_get_association(sci_dev); 1215 idev = sci_object_get_association(sci_dev);
1216 1216
1217 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table, 1217 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
@@ -1232,7 +1232,7 @@ static void scic_sds_remote_device_starting_state_enter(void *object)
1232 struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), 1232 struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
1233 parent); 1233 parent);
1234 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); 1234 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
1235 struct isci_host *ihost = sci_object_get_association(scic); 1235 struct isci_host *ihost = scic->ihost;
1236 struct isci_remote_device *idev = sci_object_get_association(sci_dev); 1236 struct isci_remote_device *idev = sci_object_get_association(sci_dev);
1237 1237
1238 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table, 1238 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
@@ -1247,7 +1247,7 @@ static void scic_sds_remote_device_ready_state_enter(void *object)
1247 struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), 1247 struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
1248 parent); 1248 parent);
1249 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); 1249 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
1250 struct isci_host *ihost = sci_object_get_association(scic); 1250 struct isci_host *ihost = scic->ihost;
1251 struct isci_remote_device *idev = sci_object_get_association(sci_dev); 1251 struct isci_remote_device *idev = sci_object_get_association(sci_dev);
1252 1252
1253 SET_STATE_HANDLER(sci_dev, 1253 SET_STATE_HANDLER(sci_dev,
@@ -1270,7 +1270,7 @@ static void scic_sds_remote_device_ready_state_exit(void *object)
1270 sci_base_state_machine_stop(&sci_dev->ready_substate_machine); 1270 sci_base_state_machine_stop(&sci_dev->ready_substate_machine);
1271 else { 1271 else {
1272 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); 1272 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
1273 struct isci_host *ihost = sci_object_get_association(scic); 1273 struct isci_host *ihost = scic->ihost;
1274 struct isci_remote_device *idev = sci_object_get_association(sci_dev); 1274 struct isci_remote_device *idev = sci_object_get_association(sci_dev);
1275 1275
1276 isci_remote_device_not_ready(ihost, idev, 1276 isci_remote_device_not_ready(ihost, idev,
diff --git a/drivers/scsi/isci/sci_environment.h b/drivers/scsi/isci/sci_environment.h
index 8d57f9552e28..6be9274975d0 100644
--- a/drivers/scsi/isci/sci_environment.h
+++ b/drivers/scsi/isci/sci_environment.h
@@ -57,6 +57,7 @@
57#define _SCI_ENVIRONMENT_H_ 57#define _SCI_ENVIRONMENT_H_
58 58
59#include "isci.h" 59#include "isci.h"
60#include "core/scic_sds_controller.h"
60 61
61struct scic_sds_controller; 62struct scic_sds_controller;
62struct scic_sds_phy; 63struct scic_sds_phy;
@@ -65,7 +66,7 @@ struct scic_sds_remote_device;
65 66
66static inline struct device *scic_to_dev(struct scic_sds_controller *scic) 67static inline struct device *scic_to_dev(struct scic_sds_controller *scic)
67{ 68{
68 struct isci_host *isci_host = sci_object_get_association(scic); 69 struct isci_host *isci_host = scic->ihost;
69 70
70 return &isci_host->pdev->dev; 71 return &isci_host->pdev->dev;
71} 72}
diff --git a/drivers/scsi/isci/smp_remote_device.c b/drivers/scsi/isci/smp_remote_device.c
index a38dc90da943..aae5c80c1341 100644
--- a/drivers/scsi/isci/smp_remote_device.c
+++ b/drivers/scsi/isci/smp_remote_device.c
@@ -249,7 +249,7 @@ static void scic_sds_smp_remote_device_ready_idle_substate_enter(void *object)
249 struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), 249 struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
250 parent); 250 parent);
251 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); 251 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
252 struct isci_host *ihost = sci_object_get_association(scic); 252 struct isci_host *ihost = scic->ihost;
253 struct isci_remote_device *idev = sci_object_get_association(sci_dev); 253 struct isci_remote_device *idev = sci_object_get_association(sci_dev);
254 254
255 SET_STATE_HANDLER(sci_dev, 255 SET_STATE_HANDLER(sci_dev,
@@ -273,7 +273,7 @@ static void scic_sds_smp_remote_device_ready_cmd_substate_enter(void *object)
273 struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), 273 struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
274 parent); 274 parent);
275 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); 275 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
276 struct isci_host *ihost = sci_object_get_association(scic); 276 struct isci_host *ihost = scic->ihost;
277 struct isci_remote_device *idev = sci_object_get_association(sci_dev); 277 struct isci_remote_device *idev = sci_object_get_association(sci_dev);
278 278
279 BUG_ON(sci_dev->working_request == NULL); 279 BUG_ON(sci_dev->working_request == NULL);
diff --git a/drivers/scsi/isci/stp_remote_device.c b/drivers/scsi/isci/stp_remote_device.c
index 1e6f77331af1..c1c2f9b87cac 100644
--- a/drivers/scsi/isci/stp_remote_device.c
+++ b/drivers/scsi/isci/stp_remote_device.c
@@ -582,7 +582,7 @@ scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(void *use
582 struct scic_sds_remote_device *sci_dev = user_cookie; 582 struct scic_sds_remote_device *sci_dev = user_cookie;
583 struct isci_remote_device *idev = sci_object_get_association(sci_dev); 583 struct isci_remote_device *idev = sci_object_get_association(sci_dev);
584 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); 584 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
585 struct isci_host *ihost = sci_object_get_association(scic); 585 struct isci_host *ihost = scic->ihost;
586 586
587 /* 587 /*
588 * For NCQ operation we do not issue a 588 * For NCQ operation we do not issue a
@@ -639,7 +639,7 @@ static void scic_sds_stp_remote_device_ready_cmd_substate_enter(void *object)
639 struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), 639 struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
640 parent); 640 parent);
641 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); 641 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
642 struct isci_host *ihost = sci_object_get_association(scic); 642 struct isci_host *ihost = scic->ihost;
643 struct isci_remote_device *idev = sci_object_get_association(sci_dev); 643 struct isci_remote_device *idev = sci_object_get_association(sci_dev);
644 644
645 BUG_ON(sci_dev->working_request == NULL); 645 BUG_ON(sci_dev->working_request == NULL);
@@ -667,7 +667,7 @@ static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(
667 struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), 667 struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
668 parent); 668 parent);
669 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); 669 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
670 struct isci_host *ihost = sci_object_get_association(scic); 670 struct isci_host *ihost = scic->ihost;
671 struct isci_remote_device *idev = sci_object_get_association(sci_dev); 671 struct isci_remote_device *idev = sci_object_get_association(sci_dev);
672 672
673 SET_STATE_HANDLER(sci_dev, 673 SET_STATE_HANDLER(sci_dev,