static void scic_sds_controller_initialize_power_control(struct scic_sds_controller *scic)
{
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
scic->power_control.timer = isci_timer_create(ihost,
scic,
scic_sds_controller_power_control_timer_handler);
struct scic_sds_controller *scic,
enum sci_status status)
{
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
if (scic->state_machine.current_state_id ==
SCI_BASE_CONTROLLER_STATE_STARTING) {
static void scic_sds_controller_timeout_handler(void *_scic)
{
struct scic_sds_controller *scic = _scic;
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
struct sci_base_state_machine *sm = &scic->state_machine;
if (sm->current_state_id == SCI_BASE_CONTROLLER_STATE_STARTING)
static enum sci_status scic_sds_controller_initialize_phy_startup(struct scic_sds_controller *scic)
{
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
scic->phy_startup_timer = isci_timer_create(ihost,
scic,
*/
static void scic_sds_controller_set_default_config_parameters(struct scic_sds_controller *scic)
{
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
u16 index;
/* Default to APC mode. */
}
- ihost = sci_object_get_association(scic);
+ ihost = scic->ihost;
sci_base_state_machine_change_state(sm, SCI_BASE_CONTROLLER_STATE_INITIALIZING);
/* Assign all the task entries to scic physical function */
scic_sds_controller_assign_task_entries(scic);
- /* Now initialze the completion queue */
+ /* Now initialize the completion queue */
scic_sds_controller_initialize_completion_queue(scic);
/* Initialize the unsolicited frame queue for use */
*
* This method implements the actions taken by the struct scic_sds_controller on entry
* to the SCI_BASE_CONTROLLER_STATE_INITIAL. - Set the state handlers to the
- * controllers initial state. none This function should initialze the
+ * controllers initial state. none This function should initialize the
* controller object.
*/
static void scic_sds_controller_initial_state_enter(void *object)
{
- struct scic_sds_controller *scic;
-
- scic = (struct scic_sds_controller *)object;
+ struct scic_sds_controller *scic = object;
sci_base_state_machine_change_state(&scic->state_machine,
SCI_BASE_CONTROLLER_STATE_RESET);
*/
static inline void scic_sds_controller_starting_state_exit(void *object)
{
- struct scic_sds_controller *scic = (struct scic_sds_controller *)object;
+ struct scic_sds_controller *scic = object;
isci_timer_stop(scic->timeout_timer);
}
*/
static void scic_sds_controller_ready_state_enter(void *object)
{
- struct scic_sds_controller *scic;
-
- scic = (struct scic_sds_controller *)object;
+ struct scic_sds_controller *scic = object;
/* set the default interrupt coalescence number and timeout value. */
scic_controller_set_interrupt_coalescence(
*/
static void scic_sds_controller_ready_state_exit(void *object)
{
- struct scic_sds_controller *scic;
-
- scic = (struct scic_sds_controller *)object;
+ struct scic_sds_controller *scic = object;
/* disable interrupt coalescence. */
scic_controller_set_interrupt_coalescence(scic, 0, 0);
*/
static void scic_sds_controller_stopping_state_enter(void *object)
{
- struct scic_sds_controller *scic;
-
- scic = (struct scic_sds_controller *)object;
+ struct scic_sds_controller *scic = object;
/* Stop all of the components for this controller */
scic_sds_controller_stop_phys(scic);
* @object: This is the object which is cast to a struct
* scic_sds_controller object.
*
- * This funciton implements the actions taken by the struct scic_sds_controller
+ * This function implements the actions taken by the struct scic_sds_controller
* on exit from the SCI_BASE_CONTROLLER_STATE_STOPPING. -
* This function stops the controller stopping timeout timer.
*/
static inline void scic_sds_controller_stopping_state_exit(void *object)
{
- struct scic_sds_controller *scic =
- (struct scic_sds_controller *)object;
+ struct scic_sds_controller *scic = object;
isci_timer_stop(scic->timeout_timer);
}
static void scic_sds_controller_resetting_state_enter(void *object)
{
- struct scic_sds_controller *scic;
+ struct scic_sds_controller *scic = object;
- scic = container_of(object, typeof(*scic), parent);
scic_sds_controller_reset_hardware(scic);
sci_base_state_machine_change_state(&scic->state_machine,
SCI_BASE_CONTROLLER_STATE_RESET);
u8 i;
sci_base_state_machine_construct(&scic->state_machine,
- &scic->parent, scic_sds_controller_state_table,
+ scic, scic_sds_controller_state_table,
SCI_BASE_CONTROLLER_STATE_INITIAL);
sci_base_state_machine_start(&scic->state_machine);
};
+struct isci_host;
/**
* struct scic_sds_controller -
*
- * This structure represents the SCU contoller object.
+ * This structure represents the SCU controller object.
*/
struct scic_sds_controller {
/**
- * The field specifies that the parent object for the base controller
- * is the base object itself.
+ * The field specifies that the peer object for the controller.
*/
- struct sci_base_object parent;
+ struct isci_host *ihost;
/**
* This field contains the information for the base controller state
struct scu_link_layer_registers __iomem *link_layer_registers)
{
struct scic_sds_controller *scic = scic_sds_phy_get_controller(sci_phy);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
/* Create the SIGNATURE FIS Timeout timer for this phy */
sci_phy->sata_timeout_timer =
struct scic_sds_controller *scic;
scic = scic_sds_phy_get_controller(sci_phy),
- ihost = sci_object_get_association(scic);
+ ihost = scic->ihost;
/* Create the SIGNATURE FIS Timeout timer for this phy */
sci_phy->sata_timeout_timer = isci_timer_create(ihost, sci_phy,
{
struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_controller *scic = scic_sds_phy_get_controller(sci_phy);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
sci_phy = (struct scic_sds_phy *)object;
{
struct scic_sds_controller *scic = scic_sds_port_get_controller(sci_port);
struct sci_sas_identify_address_frame_protocols protocols;
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
scic_sds_phy_get_attached_phy_protocols(sci_phy, &protocols);
{
struct scic_sds_controller *scic = scic_sds_port_get_controller(sci_port);
struct isci_port *iport = sci_object_get_association(sci_port);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
struct isci_phy *iphy = sci_object_get_association(sci_phy);
sci_port->active_phy_mask &= ~(1 << sci_phy->phy_index);
struct scic_sds_phy *sci_phy)
{
struct scic_sds_controller *scic = sci_port->owning_controller;
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
/* notify the user. */
isci_port_bc_change_received(ihost, sci_port, sci_phy);
struct scic_sds_port *sci_port = (struct scic_sds_port *)object;
struct scic_sds_controller *scic =
scic_sds_port_get_controller(sci_port);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
struct isci_port *iport = sci_object_get_association(sci_port);
scic_sds_port_set_ready_state_handlers(
struct scic_sds_port *sci_port = (struct scic_sds_port *)object;
struct scic_sds_controller *scic =
scic_sds_port_get_controller(sci_port);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
struct isci_port *iport = sci_object_get_association(sci_port);
/*
struct scic_sds_port *sci_port = (struct scic_sds_port *)object;
struct scic_sds_controller *scic =
scic_sds_port_get_controller(sci_port);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
struct isci_port *iport = sci_object_get_association(sci_port);
scic_sds_port_set_ready_state_handlers(
scic_sds_port_stopped_state_start_handler(struct scic_sds_port *sci_port)
{
struct scic_sds_controller *scic = sci_port->owning_controller;
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
enum sci_status status = SCI_SUCCESS;
u32 phy_mask;
sci_port = container_of(object, typeof(*sci_port), parent);
scic = scic_sds_port_get_controller(sci_port);
- ihost = sci_object_get_association(scic);
+ ihost = scic->ihost;
iport = sci_object_get_association(sci_port);
/* Put the ready state handlers in place though they will not be there long */
{
enum sci_status status = SCI_SUCCESS;
enum scic_port_configuration_mode mode;
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
mode = scic->oem_parameters.sds1.controller.mode_type;
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_controller *scic =
scic_sds_request_get_controller(sci_req);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
struct isci_request *ireq = sci_object_get_association(sci_req);
SET_STATE_HANDLER(sci_req,
}
isci_host->core_controller = controller;
- sci_object_set_association(isci_host->core_controller, isci_host);
+ controller->ihost = isci_host;
spin_lock_init(&isci_host->state_lock);
spin_lock_init(&isci_host->scic_lock);
spin_lock_init(&isci_host->queue_lock);
#include "scic_port.h"
#include "port.h"
#include "request.h"
+#include "core/scic_sds_controller.h"
static void isci_port_change_state(
struct isci_port *isci_port,
struct scic_sds_port *sci_port,
struct scic_sds_phy *phy)
{
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
dev_warn(&ihost->pdev->dev, "Invalid link up!\n");
}
struct scic_sds_port *sci_port,
enum sci_status completion_status)
{
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
dev_dbg(&ihost->pdev->dev, "Port stop complete\n");
}
sci_dev = container_of(object, typeof(*sci_dev), parent);
scic = scic_sds_remote_device_get_controller(sci_dev);
- ihost = sci_object_get_association(scic);
+ ihost = scic->ihost;
idev = sci_object_get_association(sci_dev);
SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
SET_STATE_HANDLER(sci_dev,
sci_base_state_machine_stop(&sci_dev->ready_substate_machine);
else {
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
isci_remote_device_not_ready(ihost, idev,
#define _SCI_ENVIRONMENT_H_
#include "isci.h"
+#include "core/scic_sds_controller.h"
struct scic_sds_controller;
struct scic_sds_phy;
static inline struct device *scic_to_dev(struct scic_sds_controller *scic)
{
- struct isci_host *isci_host = sci_object_get_association(scic);
+ struct isci_host *isci_host = scic->ihost;
return &isci_host->pdev->dev;
}
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
SET_STATE_HANDLER(sci_dev,
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
BUG_ON(sci_dev->working_request == NULL);
struct scic_sds_remote_device *sci_dev = user_cookie;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
/*
* For NCQ operation we do not issue a
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
BUG_ON(sci_dev->working_request == NULL);
struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
parent);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
- struct isci_host *ihost = sci_object_get_association(scic);
+ struct isci_host *ihost = scic->ihost;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
SET_STATE_HANDLER(sci_dev,