Commit 115bd1f9 authored by Maciej Patelczyk's avatar Maciej Patelczyk Committed by Dan Williams

isci: Removed sci_base_object from scic_sds_port.

The 'struct sci_base_object' was removed from the struct
scic_sds_port and was replaced by a pointer to
struct isci_port.
Signed-off-by: default avatarMaciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent e1e72a00
...@@ -678,7 +678,7 @@ void scic_sds_port_deactivate_phy(struct scic_sds_port *sci_port, ...@@ -678,7 +678,7 @@ void scic_sds_port_deactivate_phy(struct scic_sds_port *sci_port,
bool do_notify_user) bool do_notify_user)
{ {
struct scic_sds_controller *scic = scic_sds_port_get_controller(sci_port); struct scic_sds_controller *scic = scic_sds_port_get_controller(sci_port);
struct isci_port *iport = sci_object_get_association(sci_port); struct isci_port *iport = sci_port->iport;
struct isci_host *ihost = scic->ihost; struct isci_host *ihost = scic->ihost;
struct isci_phy *iphy = sci_phy->iphy; struct isci_phy *iphy = sci_phy->iphy;
...@@ -1632,7 +1632,7 @@ scic_sds_port_resume_port_task_scheduler(struct scic_sds_port *port) ...@@ -1632,7 +1632,7 @@ scic_sds_port_resume_port_task_scheduler(struct scic_sds_port *port)
*/ */
static void scic_sds_port_ready_substate_waiting_enter(void *object) static void scic_sds_port_ready_substate_waiting_enter(void *object)
{ {
struct scic_sds_port *sci_port = (struct scic_sds_port *)object; struct scic_sds_port *sci_port = object;
scic_sds_port_set_ready_state_handlers( scic_sds_port_set_ready_state_handlers(
sci_port, SCIC_SDS_PORT_READY_SUBSTATE_WAITING sci_port, SCIC_SDS_PORT_READY_SUBSTATE_WAITING
...@@ -1663,11 +1663,11 @@ static void scic_sds_port_ready_substate_waiting_enter(void *object) ...@@ -1663,11 +1663,11 @@ static void scic_sds_port_ready_substate_waiting_enter(void *object)
static void scic_sds_port_ready_substate_operational_enter(void *object) static void scic_sds_port_ready_substate_operational_enter(void *object)
{ {
u32 index; u32 index;
struct scic_sds_port *sci_port = (struct scic_sds_port *)object; struct scic_sds_port *sci_port = object;
struct scic_sds_controller *scic = struct scic_sds_controller *scic =
scic_sds_port_get_controller(sci_port); scic_sds_port_get_controller(sci_port);
struct isci_host *ihost = scic->ihost; struct isci_host *ihost = scic->ihost;
struct isci_port *iport = sci_object_get_association(sci_port); struct isci_port *iport = sci_port->iport;
scic_sds_port_set_ready_state_handlers( scic_sds_port_set_ready_state_handlers(
sci_port, sci_port,
...@@ -1704,11 +1704,11 @@ static void scic_sds_port_ready_substate_operational_enter(void *object) ...@@ -1704,11 +1704,11 @@ static void scic_sds_port_ready_substate_operational_enter(void *object)
*/ */
static void scic_sds_port_ready_substate_operational_exit(void *object) static void scic_sds_port_ready_substate_operational_exit(void *object)
{ {
struct scic_sds_port *sci_port = (struct scic_sds_port *)object; struct scic_sds_port *sci_port = object;
struct scic_sds_controller *scic = struct scic_sds_controller *scic =
scic_sds_port_get_controller(sci_port); scic_sds_port_get_controller(sci_port);
struct isci_host *ihost = scic->ihost; struct isci_host *ihost = scic->ihost;
struct isci_port *iport = sci_object_get_association(sci_port); struct isci_port *iport = sci_port->iport;
/* /*
* Kill the dummy task for this port if it has not yet posted * Kill the dummy task for this port if it has not yet posted
...@@ -1735,11 +1735,11 @@ static void scic_sds_port_ready_substate_operational_exit(void *object) ...@@ -1735,11 +1735,11 @@ static void scic_sds_port_ready_substate_operational_exit(void *object)
*/ */
static void scic_sds_port_ready_substate_configuring_enter(void *object) static void scic_sds_port_ready_substate_configuring_enter(void *object)
{ {
struct scic_sds_port *sci_port = (struct scic_sds_port *)object; struct scic_sds_port *sci_port = object;
struct scic_sds_controller *scic = struct scic_sds_controller *scic =
scic_sds_port_get_controller(sci_port); scic_sds_port_get_controller(sci_port);
struct isci_host *ihost = scic->ihost; struct isci_host *ihost = scic->ihost;
struct isci_port *iport = sci_object_get_association(sci_port); struct isci_port *iport = sci_port->iport;
scic_sds_port_set_ready_state_handlers( scic_sds_port_set_ready_state_handlers(
sci_port, sci_port,
...@@ -1759,7 +1759,7 @@ static void scic_sds_port_ready_substate_configuring_enter(void *object) ...@@ -1759,7 +1759,7 @@ static void scic_sds_port_ready_substate_configuring_enter(void *object)
static void scic_sds_port_ready_substate_configuring_exit(void *object) static void scic_sds_port_ready_substate_configuring_exit(void *object)
{ {
struct scic_sds_port *sci_port = (struct scic_sds_port *)object; struct scic_sds_port *sci_port = object;
scic_sds_port_suspend_port_task_scheduler(sci_port); scic_sds_port_suspend_port_task_scheduler(sci_port);
} }
...@@ -2255,9 +2255,7 @@ static void scic_sds_port_invalidate_dummy_remote_node(struct scic_sds_port *sci ...@@ -2255,9 +2255,7 @@ static void scic_sds_port_invalidate_dummy_remote_node(struct scic_sds_port *sci
*/ */
static void scic_sds_port_stopped_state_enter(void *object) static void scic_sds_port_stopped_state_enter(void *object)
{ {
struct scic_sds_port *sci_port; struct scic_sds_port *sci_port = object;
sci_port = (struct scic_sds_port *)object;
scic_sds_port_set_base_state_handlers( scic_sds_port_set_base_state_handlers(
sci_port, SCI_BASE_PORT_STATE_STOPPED sci_port, SCI_BASE_PORT_STATE_STOPPED
...@@ -2285,9 +2283,7 @@ static void scic_sds_port_stopped_state_enter(void *object) ...@@ -2285,9 +2283,7 @@ static void scic_sds_port_stopped_state_enter(void *object)
*/ */
static void scic_sds_port_stopped_state_exit(void *object) static void scic_sds_port_stopped_state_exit(void *object)
{ {
struct scic_sds_port *sci_port; struct scic_sds_port *sci_port = object;
sci_port = (struct scic_sds_port *)object;
/* Enable and suspend the port task scheduler */ /* Enable and suspend the port task scheduler */
scic_sds_port_enable_port_task_scheduler(sci_port); scic_sds_port_enable_port_task_scheduler(sci_port);
...@@ -2305,15 +2301,14 @@ static void scic_sds_port_stopped_state_exit(void *object) ...@@ -2305,15 +2301,14 @@ static void scic_sds_port_stopped_state_exit(void *object)
static void scic_sds_port_ready_state_enter(void *object) static void scic_sds_port_ready_state_enter(void *object)
{ {
struct scic_sds_controller *scic; struct scic_sds_controller *scic;
struct scic_sds_port *sci_port; struct scic_sds_port *sci_port = object;
struct isci_port *iport; struct isci_port *iport;
struct isci_host *ihost; struct isci_host *ihost;
u32 prev_state; u32 prev_state;
sci_port = container_of(object, typeof(*sci_port), parent);
scic = scic_sds_port_get_controller(sci_port); scic = scic_sds_port_get_controller(sci_port);
ihost = scic->ihost; ihost = scic->ihost;
iport = sci_object_get_association(sci_port); iport = sci_port->iport;
/* Put the ready state handlers in place though they will not be there long */ /* Put the ready state handlers in place though they will not be there long */
scic_sds_port_set_base_state_handlers(sci_port, SCI_BASE_PORT_STATE_READY); scic_sds_port_set_base_state_handlers(sci_port, SCI_BASE_PORT_STATE_READY);
...@@ -2333,9 +2328,8 @@ static void scic_sds_port_ready_state_enter(void *object) ...@@ -2333,9 +2328,8 @@ static void scic_sds_port_ready_state_enter(void *object)
static void scic_sds_port_ready_state_exit(void *object) static void scic_sds_port_ready_state_exit(void *object)
{ {
struct scic_sds_port *sci_port; struct scic_sds_port *sci_port = object;
sci_port = container_of(object, typeof(*sci_port), parent);
sci_base_state_machine_stop(&sci_port->ready_substate_machine); sci_base_state_machine_stop(&sci_port->ready_substate_machine);
scic_sds_port_invalidate_dummy_remote_node(sci_port); scic_sds_port_invalidate_dummy_remote_node(sci_port);
} }
...@@ -2350,9 +2344,7 @@ static void scic_sds_port_ready_state_exit(void *object) ...@@ -2350,9 +2344,7 @@ static void scic_sds_port_ready_state_exit(void *object)
*/ */
static void scic_sds_port_resetting_state_enter(void *object) static void scic_sds_port_resetting_state_enter(void *object)
{ {
struct scic_sds_port *sci_port; struct scic_sds_port *sci_port = object;
sci_port = (struct scic_sds_port *)object;
scic_sds_port_set_base_state_handlers( scic_sds_port_set_base_state_handlers(
sci_port, SCI_BASE_PORT_STATE_RESETTING sci_port, SCI_BASE_PORT_STATE_RESETTING
...@@ -2369,7 +2361,7 @@ static void scic_sds_port_resetting_state_enter(void *object) ...@@ -2369,7 +2361,7 @@ static void scic_sds_port_resetting_state_enter(void *object)
*/ */
static inline void scic_sds_port_resetting_state_exit(void *object) static inline void scic_sds_port_resetting_state_exit(void *object)
{ {
struct scic_sds_port *sci_port = (struct scic_sds_port *)object; struct scic_sds_port *sci_port = object;
isci_timer_stop(sci_port->timer_handle); isci_timer_stop(sci_port->timer_handle);
} }
...@@ -2385,9 +2377,7 @@ static inline void scic_sds_port_resetting_state_exit(void *object) ...@@ -2385,9 +2377,7 @@ static inline void scic_sds_port_resetting_state_exit(void *object)
*/ */
static void scic_sds_port_stopping_state_enter(void *object) static void scic_sds_port_stopping_state_enter(void *object)
{ {
struct scic_sds_port *sci_port; struct scic_sds_port *sci_port = object;
sci_port = (struct scic_sds_port *)object;
scic_sds_port_set_base_state_handlers( scic_sds_port_set_base_state_handlers(
sci_port, SCI_BASE_PORT_STATE_STOPPING sci_port, SCI_BASE_PORT_STATE_STOPPING
...@@ -2405,7 +2395,7 @@ static void scic_sds_port_stopping_state_enter(void *object) ...@@ -2405,7 +2395,7 @@ static void scic_sds_port_stopping_state_enter(void *object)
static inline void static inline void
scic_sds_port_stopping_state_exit(void *object) scic_sds_port_stopping_state_exit(void *object)
{ {
struct scic_sds_port *sci_port = (struct scic_sds_port *)object; struct scic_sds_port *sci_port = object;
isci_timer_stop(sci_port->timer_handle); isci_timer_stop(sci_port->timer_handle);
...@@ -2423,8 +2413,8 @@ scic_sds_port_stopping_state_exit(void *object) ...@@ -2423,8 +2413,8 @@ scic_sds_port_stopping_state_exit(void *object)
*/ */
static void scic_sds_port_failed_state_enter(void *object) static void scic_sds_port_failed_state_enter(void *object)
{ {
struct scic_sds_port *sci_port = (struct scic_sds_port *)object; struct scic_sds_port *sci_port = object;
struct isci_port *iport = sci_object_get_association(sci_port); struct isci_port *iport = sci_port->iport;
scic_sds_port_set_base_state_handlers(sci_port, scic_sds_port_set_base_state_handlers(sci_port,
SCI_BASE_PORT_STATE_FAILED); SCI_BASE_PORT_STATE_FAILED);
...@@ -2461,16 +2451,15 @@ void scic_sds_port_construct(struct scic_sds_port *sci_port, u8 port_index, ...@@ -2461,16 +2451,15 @@ void scic_sds_port_construct(struct scic_sds_port *sci_port, u8 port_index,
{ {
u32 index; u32 index;
sci_port->parent.private = NULL;
sci_base_state_machine_construct(&sci_port->state_machine, sci_base_state_machine_construct(&sci_port->state_machine,
&sci_port->parent, sci_port,
scic_sds_port_state_table, scic_sds_port_state_table,
SCI_BASE_PORT_STATE_STOPPED); SCI_BASE_PORT_STATE_STOPPED);
sci_base_state_machine_start(&sci_port->state_machine); sci_base_state_machine_start(&sci_port->state_machine);
sci_base_state_machine_construct(&sci_port->ready_substate_machine, sci_base_state_machine_construct(&sci_port->ready_substate_machine,
&sci_port->parent, sci_port,
scic_sds_port_ready_substate_table, scic_sds_port_ready_substate_table,
SCIC_SDS_PORT_READY_SUBSTATE_WAITING); SCIC_SDS_PORT_READY_SUBSTATE_WAITING);
......
...@@ -151,17 +151,17 @@ enum scic_sds_port_states { ...@@ -151,17 +151,17 @@ enum scic_sds_port_states {
}; };
struct isci_port;
/** /**
* struct scic_sds_port - * struct scic_sds_port
* *
* The core port object provides the the abstraction for an SCU port. * The core port object provides the the abstraction for an SCU port.
*/ */
struct scic_sds_port { struct scic_sds_port {
/** /**
* The field specifies that the parent object for the base controller * The field specifies the peer object for the port.
* is the base object itself.
*/ */
struct sci_base_object parent; struct isci_port *iport;
/** /**
* This field contains the information for the base port state machine. * This field contains the information for the base port state machine.
......
...@@ -100,8 +100,8 @@ void isci_port_init( ...@@ -100,8 +100,8 @@ void isci_port_init(
isci_port_change_state(isci_port, isci_freed); isci_port_change_state(isci_port, isci_freed);
(void)scic_controller_get_port_handle(controller, index, &scic_port); (void)scic_controller_get_port_handle(controller, index, &scic_port);
sci_object_set_association(scic_port, isci_port);
isci_port->sci_port_handle = scic_port; isci_port->sci_port_handle = scic_port;
scic_port->iport = isci_port;
} }
...@@ -169,9 +169,8 @@ void isci_port_link_up( ...@@ -169,9 +169,8 @@ void isci_port_link_up(
{ {
unsigned long flags; unsigned long flags;
struct scic_port_properties properties; struct scic_port_properties properties;
struct isci_port *isci_port
= (struct isci_port *)sci_object_get_association(port);
struct isci_phy *isci_phy = phy->iphy; struct isci_phy *isci_phy = phy->iphy;
struct isci_port *isci_port = port->iport;
enum sci_status call_status; enum sci_status call_status;
unsigned long success = true; unsigned long success = true;
......
...@@ -59,9 +59,6 @@ ...@@ -59,9 +59,6 @@
#include "isci.h" #include "isci.h"
#include "core/scic_sds_controller.h" #include "core/scic_sds_controller.h"
struct scic_sds_controller;
struct scic_sds_phy;
struct scic_sds_port;
struct scic_sds_remote_device; struct scic_sds_remote_device;
static inline struct device *scic_to_dev(struct scic_sds_controller *scic) static inline struct device *scic_to_dev(struct scic_sds_controller *scic)
...@@ -83,7 +80,7 @@ static inline struct device *sciphy_to_dev(struct scic_sds_phy *sci_phy) ...@@ -83,7 +80,7 @@ static inline struct device *sciphy_to_dev(struct scic_sds_phy *sci_phy)
static inline struct device *sciport_to_dev(struct scic_sds_port *sci_port) static inline struct device *sciport_to_dev(struct scic_sds_port *sci_port)
{ {
struct isci_port *iport = sci_object_get_association(sci_port); struct isci_port *iport = sci_port->iport;
if (!iport || !iport->isci_host) if (!iport || !iport->isci_host)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment