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: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
Maciej Patelczyk 2011-04-28 22:06:16 +00:00 committed by Dan Williams
parent e1e72a00dd
commit 115bd1f9e8
4 changed files with 29 additions and 44 deletions

View File

@ -678,7 +678,7 @@ void scic_sds_port_deactivate_phy(struct scic_sds_port *sci_port,
bool do_notify_user)
{
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_phy *iphy = sci_phy->iphy;
@ -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)
{
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(
sci_port, SCIC_SDS_PORT_READY_SUBSTATE_WAITING
@ -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)
{
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 =
scic_sds_port_get_controller(sci_port);
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(
sci_port,
@ -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)
{
struct scic_sds_port *sci_port = (struct scic_sds_port *)object;
struct scic_sds_port *sci_port = object;
struct scic_sds_controller *scic =
scic_sds_port_get_controller(sci_port);
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
@ -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)
{
struct scic_sds_port *sci_port = (struct scic_sds_port *)object;
struct scic_sds_port *sci_port = object;
struct scic_sds_controller *scic =
scic_sds_port_get_controller(sci_port);
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(
sci_port,
@ -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)
{
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);
}
@ -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)
{
struct scic_sds_port *sci_port;
sci_port = (struct scic_sds_port *)object;
struct scic_sds_port *sci_port = object;
scic_sds_port_set_base_state_handlers(
sci_port, SCI_BASE_PORT_STATE_STOPPED
@ -2285,9 +2283,7 @@ static void scic_sds_port_stopped_state_enter(void *object)
*/
static void scic_sds_port_stopped_state_exit(void *object)
{
struct scic_sds_port *sci_port;
sci_port = (struct scic_sds_port *)object;
struct scic_sds_port *sci_port = object;
/* Enable and suspend the port task scheduler */
scic_sds_port_enable_port_task_scheduler(sci_port);
@ -2305,15 +2301,14 @@ static void scic_sds_port_stopped_state_exit(void *object)
static void scic_sds_port_ready_state_enter(void *object)
{
struct scic_sds_controller *scic;
struct scic_sds_port *sci_port;
struct scic_sds_port *sci_port = object;
struct isci_port *iport;
struct isci_host *ihost;
u32 prev_state;
sci_port = container_of(object, typeof(*sci_port), parent);
scic = scic_sds_port_get_controller(sci_port);
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 */
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)
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);
scic_sds_port_invalidate_dummy_remote_node(sci_port);
}
@ -2350,9 +2344,7 @@ static void scic_sds_port_ready_state_exit(void *object)
*/
static void scic_sds_port_resetting_state_enter(void *object)
{
struct scic_sds_port *sci_port;
sci_port = (struct scic_sds_port *)object;
struct scic_sds_port *sci_port = object;
scic_sds_port_set_base_state_handlers(
sci_port, SCI_BASE_PORT_STATE_RESETTING
@ -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)
{
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);
}
@ -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)
{
struct scic_sds_port *sci_port;
sci_port = (struct scic_sds_port *)object;
struct scic_sds_port *sci_port = object;
scic_sds_port_set_base_state_handlers(
sci_port, SCI_BASE_PORT_STATE_STOPPING
@ -2405,7 +2395,7 @@ static void scic_sds_port_stopping_state_enter(void *object)
static inline void
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);
@ -2423,8 +2413,8 @@ scic_sds_port_stopping_state_exit(void *object)
*/
static void scic_sds_port_failed_state_enter(void *object)
{
struct scic_sds_port *sci_port = (struct scic_sds_port *)object;
struct isci_port *iport = sci_object_get_association(sci_port);
struct scic_sds_port *sci_port = object;
struct isci_port *iport = sci_port->iport;
scic_sds_port_set_base_state_handlers(sci_port,
SCI_BASE_PORT_STATE_FAILED);
@ -2461,16 +2451,15 @@ void scic_sds_port_construct(struct scic_sds_port *sci_port, u8 port_index,
{
u32 index;
sci_port->parent.private = NULL;
sci_base_state_machine_construct(&sci_port->state_machine,
&sci_port->parent,
sci_port,
scic_sds_port_state_table,
SCI_BASE_PORT_STATE_STOPPED);
sci_base_state_machine_start(&sci_port->state_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_WAITING);

View File

@ -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.
*/
struct scic_sds_port {
/**
* The field specifies that the parent object for the base controller
* is the base object itself.
* The field specifies the peer object for the port.
*/
struct sci_base_object parent;
struct isci_port *iport;
/**
* This field contains the information for the base port state machine.

View File

@ -100,8 +100,8 @@ void isci_port_init(
isci_port_change_state(isci_port, isci_freed);
(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;
scic_port->iport = isci_port;
}
@ -169,9 +169,8 @@ void isci_port_link_up(
{
unsigned long flags;
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_port *isci_port = port->iport;
enum sci_status call_status;
unsigned long success = true;

View File

@ -59,9 +59,6 @@
#include "isci.h"
#include "core/scic_sds_controller.h"
struct scic_sds_controller;
struct scic_sds_phy;
struct scic_sds_port;
struct scic_sds_remote_device;
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)
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)
return NULL;