static void scic_sds_remote_device_initial_state_enter(void *object)
{
- struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object;
+ struct scic_sds_remote_device *sci_dev = object;
- sci_dev = container_of(object, typeof(*sci_dev), parent);
SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
SCI_BASE_REMOTE_DEVICE_STATE_INITIAL);
static void scic_sds_remote_device_stopped_state_enter(void *object)
{
- struct scic_sds_remote_device *sci_dev;
+ struct scic_sds_remote_device *sci_dev = object;
struct scic_sds_controller *scic;
struct isci_remote_device *idev;
struct isci_host *ihost;
u32 prev_state;
- sci_dev = container_of(object, typeof(*sci_dev), parent);
scic = scic_sds_remote_device_get_controller(sci_dev);
ihost = scic->ihost;
- idev = sci_object_get_association(sci_dev);
+ idev = sci_dev_to_idev(sci_dev);
SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
SCI_BASE_REMOTE_DEVICE_STATE_STOPPED);
static void scic_sds_remote_device_starting_state_enter(void *object)
{
- struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
- parent);
+ struct scic_sds_remote_device *sci_dev = object;
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = scic->ihost;
- struct isci_remote_device *idev = sci_object_get_association(sci_dev);
+ struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);
SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
SCI_BASE_REMOTE_DEVICE_STATE_STARTING);
static void scic_sds_remote_device_ready_state_enter(void *object)
{
- struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
- parent);
+ struct scic_sds_remote_device *sci_dev = object;
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = scic->ihost;
- struct isci_remote_device *idev = sci_object_get_association(sci_dev);
+ struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);
SET_STATE_HANDLER(sci_dev,
scic_sds_remote_device_state_handler_table,
static void scic_sds_remote_device_ready_state_exit(void *object)
{
- struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
- parent);
+ struct scic_sds_remote_device *sci_dev = object;
if (sci_dev->has_ready_substate_machine)
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 = scic->ihost;
- struct isci_remote_device *idev = sci_object_get_association(sci_dev);
+ struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);
isci_remote_device_not_ready(ihost, idev,
SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED);
static void scic_sds_remote_device_stopping_state_enter(void *object)
{
- struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object;
+ struct scic_sds_remote_device *sci_dev = object;
SET_STATE_HANDLER(
sci_dev,
static void scic_sds_remote_device_failed_state_enter(void *object)
{
- struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object;
+ struct scic_sds_remote_device *sci_dev = object;
SET_STATE_HANDLER(
sci_dev,
static void scic_sds_remote_device_resetting_state_enter(void *object)
{
- struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object;
+ struct scic_sds_remote_device *sci_dev = object;
SET_STATE_HANDLER(
sci_dev,
static void scic_sds_remote_device_resetting_state_exit(void *object)
{
- struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object;
+ struct scic_sds_remote_device *sci_dev = object;
scic_sds_remote_node_context_resume(&sci_dev->rnc, NULL, NULL);
}
static void scic_sds_remote_device_final_state_enter(void *object)
{
- struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object;
+ struct scic_sds_remote_device *sci_dev = object;
SET_STATE_HANDLER(
sci_dev,
{
sci_dev->owning_port = sci_port;
sci_dev->started_request_count = 0;
- sci_dev->parent.private = NULL;
sci_base_state_machine_construct(
&sci_dev->state_machine,
- &sci_dev->parent,
+ sci_dev,
scic_sds_remote_device_state_table,
SCI_BASE_REMOTE_DEVICE_STATE_INITIAL
);
sci_base_state_machine_construct(
&sci_dev->ready_substate_machine,
- &sci_dev->parent,
+ sci_dev,
scic_sds_stp_remote_device_ready_substate_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE);
} else if (dev_is_expander(dev)) {
/* add the SMP ready substate machine construction here */
sci_base_state_machine_construct(
&sci_dev->ready_substate_machine,
- &sci_dev->parent,
+ sci_dev,
scic_sds_smp_remote_device_ready_substate_table,
SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE);
} else
/* add the SMP ready substate machine construction here */
sci_base_state_machine_construct(
&sci_dev->ready_substate_machine,
- &sci_dev->parent,
+ sci_dev,
scic_sds_smp_remote_device_ready_substate_table,
SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE);
} else if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) {
sci_base_state_machine_construct(
&sci_dev->ready_substate_machine,
- &sci_dev->parent,
+ sci_dev,
scic_sds_stp_remote_device_ready_substate_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE);
}
return status;
}
- /* XXX will be killed with sci_base_object removal */
- sci_object_set_association(&idev->sci, idev);
-
/* start the device. */
status = scic_remote_device_start(&idev->sci, ISCI_REMOTE_DEVICE_START_TIMEOUT);
*/
static void scic_sds_smp_remote_device_ready_idle_substate_enter(void *object)
{
- struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
- parent);
+ struct scic_sds_remote_device *sci_dev = object;
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = scic->ihost;
- struct isci_remote_device *idev = sci_object_get_association(sci_dev);
+ struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);
SET_STATE_HANDLER(sci_dev,
scic_sds_smp_remote_device_ready_substate_handler_table,
*/
static void scic_sds_smp_remote_device_ready_cmd_substate_enter(void *object)
{
- struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
- parent);
+ struct scic_sds_remote_device *sci_dev = object;
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = scic->ihost;
- struct isci_remote_device *idev = sci_object_get_association(sci_dev);
+ struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);
BUG_ON(sci_dev->working_request == NULL);
*/
static void scic_sds_smp_remote_device_ready_cmd_substate_exit(void *object)
{
- struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
- parent);
+ struct scic_sds_remote_device *sci_dev = object;
sci_dev->working_request = NULL;
}
scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(void *user_cookie)
{
struct scic_sds_remote_device *sci_dev = user_cookie;
- struct isci_remote_device *idev = sci_object_get_association(sci_dev);
+ struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = scic->ihost;
*/
static void scic_sds_stp_remote_device_ready_idle_substate_enter(void *device)
{
- struct scic_sds_remote_device *sci_dev;
-
- sci_dev = (struct scic_sds_remote_device *)device;
+ struct scic_sds_remote_device *sci_dev = device;
SET_STATE_HANDLER(
sci_dev,
static void scic_sds_stp_remote_device_ready_cmd_substate_enter(void *object)
{
- struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
- parent);
+ struct scic_sds_remote_device *sci_dev = object;
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = scic->ihost;
- struct isci_remote_device *idev = sci_object_get_association(sci_dev);
+ struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);
BUG_ON(sci_dev->working_request == NULL);
static void scic_sds_stp_remote_device_ready_ncq_substate_enter(void *object)
{
- struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
- parent);
+ struct scic_sds_remote_device *sci_dev = object;
SET_STATE_HANDLER(sci_dev,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ);
static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(
void *object)
{
- struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev),
- parent);
+ struct scic_sds_remote_device *sci_dev = object;
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = scic->ihost;
- struct isci_remote_device *idev = sci_object_get_association(sci_dev);
+ struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);
SET_STATE_HANDLER(sci_dev,
scic_sds_stp_remote_device_ready_substate_handler_table,