Commit d9dcb4ba authored by Dan Williams's avatar Dan Williams

isci: unify isci_host and scic_sds_controller

Remove the distinction between these two implementations and unify on
isci_host (local instances named ihost).  Hmmm, we had two
'oem_parameters' instances, one was unused... nice.
Reported-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 78a6f06e
This diff is collapsed.
This diff is collapsed.
......@@ -548,13 +548,13 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic
static void __devexit isci_pci_remove(struct pci_dev *pdev)
{
struct isci_host *isci_host;
struct isci_host *ihost;
int i;
for_each_isci_host(i, isci_host, pdev) {
isci_unregister(isci_host);
isci_host_deinit(isci_host);
scic_controller_disable_interrupts(&isci_host->sci);
for_each_isci_host(i, ihost, pdev) {
isci_unregister(ihost);
isci_host_deinit(ihost);
scic_controller_disable_interrupts(ihost);
}
}
......
......@@ -112,13 +112,13 @@ static enum sci_status
scic_sds_phy_link_layer_initialization(struct isci_phy *iphy,
struct scu_link_layer_registers __iomem *link_layer_registers)
{
struct scic_sds_controller *scic =
struct isci_host *ihost =
iphy->owning_port->owning_controller;
int phy_idx = iphy->phy_index;
struct sci_phy_user_params *phy_user =
&scic->user_parameters.sds1.phys[phy_idx];
&ihost->user_parameters.sds1.phys[phy_idx];
struct sci_phy_oem_params *phy_oem =
&scic->oem_parameters.sds1.phys[phy_idx];
&ihost->oem_parameters.sds1.phys[phy_idx];
u32 phy_configuration;
struct scic_phy_cap phy_cap;
u32 parity_check = 0;
......@@ -169,7 +169,7 @@ scic_sds_phy_link_layer_initialization(struct isci_phy *iphy,
phy_cap.gen3_no_ssc = 1;
phy_cap.gen2_no_ssc = 1;
phy_cap.gen1_no_ssc = 1;
if (scic->oem_parameters.sds1.controller.do_enable_ssc == true) {
if (ihost->oem_parameters.sds1.controller.do_enable_ssc == true) {
phy_cap.gen3_ssc = 1;
phy_cap.gen2_ssc = 1;
phy_cap.gen1_ssc = 1;
......@@ -216,7 +216,7 @@ scic_sds_phy_link_layer_initialization(struct isci_phy *iphy,
&iphy->link_layer_registers->afe_lookup_table_control);
llctl = SCU_SAS_LLCTL_GEN_VAL(NO_OUTBOUND_TASK_TIMEOUT,
(u8)scic->user_parameters.sds1.no_outbound_task_timeout);
(u8)ihost->user_parameters.sds1.no_outbound_task_timeout);
switch(phy_user->max_speed_generation) {
case SCIC_SDS_PARM_GEN3_SPEED:
......@@ -255,7 +255,7 @@ static void phy_sata_timeout(unsigned long data)
{
struct sci_timer *tmr = (struct sci_timer *)data;
struct isci_phy *iphy = container_of(tmr, typeof(*iphy), sata_timer);
struct isci_host *ihost = scic_to_ihost(iphy->owning_port->owning_controller);
struct isci_host *ihost = iphy->owning_port->owning_controller;
unsigned long flags;
spin_lock_irqsave(&ihost->scic_lock, flags);
......@@ -890,7 +890,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy,
u32 frame_index)
{
enum scic_sds_phy_states state = iphy->sm.current_state_id;
struct scic_sds_controller *scic = iphy->owning_port->owning_controller;
struct isci_host *ihost = iphy->owning_port->owning_controller;
enum sci_status result;
unsigned long flags;
......@@ -899,7 +899,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy,
u32 *frame_words;
struct sas_identify_frame iaf;
result = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
result = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
frame_index,
(void **)&frame_words);
......@@ -933,7 +933,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy,
"unexpected frame id %x\n",
__func__, frame_index);
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
return result;
}
case SCI_PHY_SUB_AWAIT_SIG_FIS_UF: {
......@@ -950,7 +950,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy,
if ((frame_header->fis_type == FIS_REGD2H) &&
!(frame_header->status & ATA_BUSY)) {
scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
frame_index,
(void **)&fis_frame_data);
......@@ -971,7 +971,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy,
__func__, frame_index);
/* Regardless of the result we are done with this frame with it */
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
return result;
}
......@@ -994,33 +994,33 @@ static void scic_sds_phy_starting_initial_substate_enter(struct sci_base_state_m
static void scic_sds_phy_starting_await_sas_power_substate_enter(struct sci_base_state_machine *sm)
{
struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
struct scic_sds_controller *scic = iphy->owning_port->owning_controller;
struct isci_host *ihost = iphy->owning_port->owning_controller;
scic_sds_controller_power_control_queue_insert(scic, iphy);
scic_sds_controller_power_control_queue_insert(ihost, iphy);
}
static void scic_sds_phy_starting_await_sas_power_substate_exit(struct sci_base_state_machine *sm)
{
struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
struct scic_sds_controller *scic = iphy->owning_port->owning_controller;
struct isci_host *ihost = iphy->owning_port->owning_controller;
scic_sds_controller_power_control_queue_remove(scic, iphy);
scic_sds_controller_power_control_queue_remove(ihost, iphy);
}
static void scic_sds_phy_starting_await_sata_power_substate_enter(struct sci_base_state_machine *sm)
{
struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
struct scic_sds_controller *scic = iphy->owning_port->owning_controller;
struct isci_host *ihost = iphy->owning_port->owning_controller;
scic_sds_controller_power_control_queue_insert(scic, iphy);
scic_sds_controller_power_control_queue_insert(ihost, iphy);
}
static void scic_sds_phy_starting_await_sata_power_substate_exit(struct sci_base_state_machine *sm)
{
struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
struct scic_sds_controller *scic = iphy->owning_port->owning_controller;
struct isci_host *ihost = iphy->owning_port->owning_controller;
scic_sds_controller_power_control_queue_remove(scic, iphy);
scic_sds_controller_power_control_queue_remove(ihost, iphy);
}
static void scic_sds_phy_starting_await_sata_phy_substate_enter(struct sci_base_state_machine *sm)
......@@ -1313,7 +1313,7 @@ void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index)
u64 sci_sas_addr;
__be64 sas_addr;
scic_oem_parameters_get(&ihost->sci, &oem);
scic_oem_parameters_get(ihost, &oem);
sci_sas_addr = oem.sds1.phys[index].sas_address.high;
sci_sas_addr <<= 32;
sci_sas_addr |= oem.sds1.phys[index].sas_address.low;
......
This diff is collapsed.
......@@ -115,7 +115,7 @@ struct isci_port {
u32 assigned_device_count;
u32 not_ready_reason;
struct isci_phy *phy_table[SCI_MAX_PHYS];
struct scic_sds_controller *owning_controller;
struct isci_host *owning_controller;
struct sci_timer timer;
struct scu_port_task_scheduler_registers __iomem *port_task_scheduler_registers;
/* XXX rework: only one register, no need to replicate per-port */
......@@ -243,7 +243,7 @@ static inline void scic_sds_port_decrement_request_count(struct isci_port *iport
void scic_sds_port_construct(
struct isci_port *iport,
u8 port_index,
struct scic_sds_controller *scic);
struct isci_host *ihost);
enum sci_status scic_sds_port_initialize(
struct isci_port *iport,
......
......@@ -113,7 +113,7 @@ static s32 sci_sas_address_compare(
* NULL if there is no matching port for the phy.
*/
static struct isci_port *scic_sds_port_configuration_agent_find_port(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct isci_phy *iphy)
{
u8 i;
......@@ -130,8 +130,7 @@ static struct isci_port *scic_sds_port_configuration_agent_find_port(
scic_sds_phy_get_sas_address(iphy, &phy_sas_address);
scic_sds_phy_get_attached_sas_address(iphy, &phy_attached_device_address);
for (i = 0; i < scic->logical_port_entries; i++) {
struct isci_host *ihost = scic_to_ihost(scic);
for (i = 0; i < ihost->logical_port_entries; i++) {
struct isci_port *iport = &ihost->ports[i];
scic_sds_port_get_sas_address(iport, &port_sas_address);
......@@ -158,10 +157,9 @@ static struct isci_port *scic_sds_port_configuration_agent_find_port(
* the port configuration is not valid for this port configuration agent.
*/
static enum sci_status scic_sds_port_configuration_agent_validate_ports(
struct scic_sds_controller *controller,
struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent)
{
struct isci_host *ihost = scic_to_ihost(controller);
struct sci_sas_address first_address;
struct sci_sas_address second_address;
......@@ -239,17 +237,11 @@ static enum sci_status scic_sds_port_configuration_agent_validate_ports(
* Manual port configuration agent routines
* ****************************************************************************** */
/**
*
*
* This routine will verify that all of the phys in the same port are using the
* same SAS address.
*/
static enum sci_status scic_sds_mpc_agent_validate_phy_configuration(
struct scic_sds_controller *controller,
struct scic_sds_port_configuration_agent *port_agent)
/* verify all of the phys in the same port are using the same SAS address */
static enum sci_status
scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent)
{
struct isci_host *ihost = scic_to_ihost(controller);
u32 phy_mask;
u32 assigned_phy_mask;
struct sci_sas_address sas_address;
......@@ -262,7 +254,7 @@ static enum sci_status scic_sds_mpc_agent_validate_phy_configuration(
sas_address.low = 0;
for (port_index = 0; port_index < SCI_MAX_PORTS; port_index++) {
phy_mask = controller->oem_parameters.sds1.ports[port_index].phy_mask;
phy_mask = ihost->oem_parameters.sds1.ports[port_index].phy_mask;
if (!phy_mask)
continue;
......@@ -324,7 +316,7 @@ static enum sci_status scic_sds_mpc_agent_validate_phy_configuration(
phy_index++;
}
return scic_sds_port_configuration_agent_validate_ports(controller, port_agent);
return scic_sds_port_configuration_agent_validate_ports(ihost, port_agent);
}
static void mpc_agent_timeout(unsigned long data)
......@@ -332,14 +324,12 @@ static void mpc_agent_timeout(unsigned long data)
u8 index;
struct sci_timer *tmr = (struct sci_timer *)data;
struct scic_sds_port_configuration_agent *port_agent;
struct scic_sds_controller *scic;
struct isci_host *ihost;
unsigned long flags;
u16 configure_phy_mask;
port_agent = container_of(tmr, typeof(*port_agent), timer);
scic = container_of(port_agent, typeof(*scic), port_agent);
ihost = scic_to_ihost(scic);
ihost = container_of(port_agent, typeof(*ihost), port_agent);
spin_lock_irqsave(&ihost->scic_lock, flags);
......@@ -355,7 +345,7 @@ static void mpc_agent_timeout(unsigned long data)
struct isci_phy *iphy = &ihost->phys[index];
if (configure_phy_mask & (1 << index)) {
port_agent->link_up_handler(scic, port_agent,
port_agent->link_up_handler(ihost, port_agent,
phy_get_non_dummy_port(iphy),
iphy);
}
......@@ -365,7 +355,7 @@ static void mpc_agent_timeout(unsigned long data)
spin_unlock_irqrestore(&ihost->scic_lock, flags);
}
static void scic_sds_mpc_agent_link_up(struct scic_sds_controller *controller,
static void scic_sds_mpc_agent_link_up(struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent,
struct isci_port *iport,
struct isci_phy *iphy)
......@@ -401,7 +391,7 @@ static void scic_sds_mpc_agent_link_up(struct scic_sds_controller *controller,
* link down notification from a phy that has no assocoated port?
*/
static void scic_sds_mpc_agent_link_down(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent,
struct isci_port *iport,
struct isci_phy *iphy)
......@@ -438,26 +428,17 @@ static void scic_sds_mpc_agent_link_down(
}
}
/*
* ******************************************************************************
* Automatic port configuration agent routines
* ****************************************************************************** */
/**
*
*
* This routine will verify that the phys are assigned a valid SAS address for
* automatic port configuration mode.
/* verify phys are assigned a valid SAS address for automatic port
* configuration mode.
*/
static enum sci_status scic_sds_apc_agent_validate_phy_configuration(
struct scic_sds_controller *controller,
struct scic_sds_port_configuration_agent *port_agent)
static enum sci_status
scic_sds_apc_agent_validate_phy_configuration(struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent)
{
u8 phy_index;
u8 port_index;
struct sci_sas_address sas_address;
struct sci_sas_address phy_assigned_address;
struct isci_host *ihost = scic_to_ihost(controller);
phy_index = 0;
......@@ -484,10 +465,10 @@ static enum sci_status scic_sds_apc_agent_validate_phy_configuration(
}
}
return scic_sds_port_configuration_agent_validate_ports(controller, port_agent);
return scic_sds_port_configuration_agent_validate_ports(ihost, port_agent);
}
static void scic_sds_apc_agent_configure_ports(struct scic_sds_controller *controller,
static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent,
struct isci_phy *iphy,
bool start_timer)
......@@ -496,9 +477,8 @@ static void scic_sds_apc_agent_configure_ports(struct scic_sds_controller *contr
enum sci_status status;
struct isci_port *iport;
enum SCIC_SDS_APC_ACTIVITY apc_activity = SCIC_SDS_APC_SKIP_PHY;
struct isci_host *ihost = scic_to_ihost(controller);
iport = scic_sds_port_configuration_agent_find_port(controller, iphy);
iport = scic_sds_port_configuration_agent_find_port(ihost, iphy);
if (iport) {
if (scic_sds_port_is_valid_phy_assignment(iport, iphy->phy_index))
......@@ -619,7 +599,7 @@ static void scic_sds_apc_agent_configure_ports(struct scic_sds_controller *contr
* notifications. Is it possible to get a link down notification from a phy
* that has no assocoated port?
*/
static void scic_sds_apc_agent_link_up(struct scic_sds_controller *scic,
static void scic_sds_apc_agent_link_up(struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent,
struct isci_port *iport,
struct isci_phy *iphy)
......@@ -629,7 +609,7 @@ static void scic_sds_apc_agent_link_up(struct scic_sds_controller *scic,
if (!iport) {
/* the phy is not the part of this port */
port_agent->phy_ready_mask |= 1 << phy_index;
scic_sds_apc_agent_configure_ports(scic, port_agent, iphy, true);
scic_sds_apc_agent_configure_ports(ihost, port_agent, iphy, true);
} else {
/* the phy is already the part of the port */
u32 port_state = iport->sm.current_state_id;
......@@ -658,7 +638,7 @@ static void scic_sds_apc_agent_link_up(struct scic_sds_controller *scic,
* port?
*/
static void scic_sds_apc_agent_link_down(
struct scic_sds_controller *controller,
struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent,
struct isci_port *iport,
struct isci_phy *iphy)
......@@ -683,14 +663,12 @@ static void apc_agent_timeout(unsigned long data)
u32 index;
struct sci_timer *tmr = (struct sci_timer *)data;
struct scic_sds_port_configuration_agent *port_agent;
struct scic_sds_controller *scic;
struct isci_host *ihost;
unsigned long flags;
u16 configure_phy_mask;
port_agent = container_of(tmr, typeof(*port_agent), timer);
scic = container_of(port_agent, typeof(*scic), port_agent);
ihost = scic_to_ihost(scic);
ihost = container_of(port_agent, typeof(*ihost), port_agent);
spin_lock_irqsave(&ihost->scic_lock, flags);
......@@ -708,7 +686,7 @@ static void apc_agent_timeout(unsigned long data)
if ((configure_phy_mask & (1 << index)) == 0)
continue;
scic_sds_apc_agent_configure_ports(scic, port_agent,
scic_sds_apc_agent_configure_ports(ihost, port_agent,
&ihost->phys[index], false);
}
......@@ -748,17 +726,17 @@ void scic_sds_port_configuration_agent_construct(
}
enum sci_status scic_sds_port_configuration_agent_initialize(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent)
{
enum sci_status status;
enum scic_port_configuration_mode mode;
mode = scic->oem_parameters.sds1.controller.mode_type;
mode = ihost->oem_parameters.sds1.controller.mode_type;
if (mode == SCIC_PORT_MANUAL_CONFIGURATION_MODE) {
status = scic_sds_mpc_agent_validate_phy_configuration(
scic, port_agent);
ihost, port_agent);
port_agent->link_up_handler = scic_sds_mpc_agent_link_up;
port_agent->link_down_handler = scic_sds_mpc_agent_link_down;
......@@ -766,7 +744,7 @@ enum sci_status scic_sds_port_configuration_agent_initialize(
sci_init_timer(&port_agent->timer, mpc_agent_timeout);
} else {
status = scic_sds_apc_agent_validate_phy_configuration(
scic, port_agent);
ihost, port_agent);
port_agent->link_up_handler = scic_sds_apc_agent_link_up;
port_agent->link_down_handler = scic_sds_apc_agent_link_down;
......
......@@ -165,7 +165,7 @@ struct scic_sds_oem_params;
int scic_oem_parameters_validate(struct scic_sds_oem_params *oem);
union scic_oem_parameters;
void scic_oem_parameters_get(struct scic_sds_controller *scic,
void scic_oem_parameters_get(struct isci_host *ihost,
union scic_oem_parameters *oem);
struct isci_orom;
......
This diff is collapsed.
......@@ -402,17 +402,17 @@ enum sci_status scic_sds_remote_device_event_handler(
u32 event_code);
enum sci_status scic_sds_remote_device_start_io(
struct scic_sds_controller *controller,
struct isci_host *ihost,
struct isci_remote_device *idev,
struct isci_request *ireq);
enum sci_status scic_sds_remote_device_start_task(
struct scic_sds_controller *controller,
struct isci_host *ihost,
struct isci_remote_device *idev,
struct isci_request *ireq);
enum sci_status scic_sds_remote_device_complete_io(
struct scic_sds_controller *controller,
struct isci_host *ihost,
struct isci_remote_device *idev,
struct isci_request *ireq);
......
......@@ -107,11 +107,11 @@ static void scic_sds_remote_node_context_construct_buffer(
struct domain_device *dev = idev->domain_dev;
int rni = sci_rnc->remote_node_index;
union scu_remote_node_context *rnc;
struct scic_sds_controller *scic;
struct isci_host *ihost;
__le64 sas_addr;
scic = scic_sds_remote_device_get_controller(idev);
rnc = scic_sds_controller_get_remote_node_context_buffer(scic, rni);
ihost = scic_sds_remote_device_get_controller(idev);
rnc = scic_sds_controller_get_remote_node_context_buffer(ihost, rni);
memset(rnc, 0, sizeof(union scu_remote_node_context)
* scic_sds_remote_device_node_count(idev));
......@@ -135,14 +135,14 @@ static void scic_sds_remote_node_context_construct_buffer(
if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) {
rnc->ssp.connection_occupancy_timeout =
scic->user_parameters.sds1.stp_max_occupancy_timeout;
ihost->user_parameters.sds1.stp_max_occupancy_timeout;
rnc->ssp.connection_inactivity_timeout =
scic->user_parameters.sds1.stp_inactivity_timeout;
ihost->user_parameters.sds1.stp_inactivity_timeout;
} else {
rnc->ssp.connection_occupancy_timeout =
scic->user_parameters.sds1.ssp_max_occupancy_timeout;
ihost->user_parameters.sds1.ssp_max_occupancy_timeout;
rnc->ssp.connection_inactivity_timeout =
scic->user_parameters.sds1.ssp_inactivity_timeout;
ihost->user_parameters.sds1.ssp_inactivity_timeout;
}
rnc->ssp.initial_arbitration_wait_time = 0;
......
This diff is collapsed.
......@@ -145,7 +145,7 @@ struct isci_request {
*/
struct completion *io_request_completion;
struct sci_base_state_machine sm;
struct scic_sds_controller *owning_controller;
struct isci_host *owning_controller;
struct isci_remote_device *target_device;
u16 io_tag;
enum sci_request_protocol protocol;
......@@ -500,7 +500,7 @@ int isci_request_execute(struct isci_host *ihost, struct isci_remote_device *ide
void isci_terminate_pending_requests(struct isci_host *ihost,
struct isci_remote_device *idev);
enum sci_status
scic_task_request_construct(struct scic_sds_controller *scic,
scic_task_request_construct(struct isci_host *ihost,
struct isci_remote_device *idev,
u16 io_tag,
struct isci_request *ireq);
......
......@@ -257,7 +257,7 @@ static struct isci_request *isci_task_request_build(struct isci_host *ihost,
return NULL;
/* let the core do it's construct. */
status = scic_task_request_construct(&ihost->sci, idev, tag,
status = scic_task_request_construct(ihost, idev, tag,
ireq);
if (status != SCI_SUCCESS) {
......@@ -332,7 +332,7 @@ int isci_task_execute_tmf(struct isci_host *ihost,
spin_lock_irqsave(&ihost->scic_lock, flags);
/* start the TMF io. */
status = scic_controller_start_task(&ihost->sci, idev, ireq);
status = scic_controller_start_task(ihost, idev, ireq);
if (status != SCI_TASK_SUCCESS) {
dev_warn(&ihost->pdev->dev,
......@@ -364,7 +364,7 @@ int isci_task_execute_tmf(struct isci_host *ihost,
if (tmf->cb_state_func != NULL)
tmf->cb_state_func(isci_tmf_timed_out, tmf, tmf->cb_data);
scic_controller_terminate_request(&ihost->sci,
scic_controller_terminate_request(ihost,
idev,
ireq);
......@@ -514,15 +514,14 @@ static void isci_request_cleanup_completed_loiterer(
* request, and wait for it to complete. This function must only be called
* from a thread that can wait. Note that the request is terminated and
* completed (back to the host, if started there).
* @isci_host: This SCU.
* @ihost: This SCU.
* @idev: The target.
* @isci_request: The I/O request to be terminated.
*
*/
static void isci_terminate_request_core(
struct isci_host *isci_host,
struct isci_remote_device *idev,
struct isci_request *isci_request)
static void isci_terminate_request_core(struct isci_host *ihost,
struct isci_remote_device *idev,
struct isci_request *isci_request)
{
enum sci_status status = SCI_SUCCESS;
bool was_terminated = false;
......@@ -533,11 +532,11 @@ static void isci_terminate_request_core(
struct completion *io_request_completion;
struct sas_task *task;
dev_dbg(&isci_host->pdev->dev,
dev_dbg(&ihost->pdev->dev,
"%s: device = %p; request = %p\n",
__func__, idev, isci_request);
spin_lock_irqsave(&isci_host->scic_lock, flags);
spin_lock_irqsave(&ihost->scic_lock, flags);
io_request_completion = isci_request->io_request_completion;
......@@ -557,12 +556,11 @@ static void isci_terminate_request_core(
if (!test_bit(IREQ_TERMINATED, &isci_request->flags)) {
was_terminated = true;
needs_cleanup_handling = true;
status = scic_controller_terminate_request(
&isci_host->sci,
idev,
isci_request);
status = scic_controller_terminate_request(ihost,
idev,
isci_request);
}
spin_unlock_irqrestore(&isci_host->scic_lock, flags);
spin_unlock_irqrestore(&ihost->scic_lock, flags);
/*
* The only time the request to terminate will
......@@ -570,7 +568,7 @@ static void isci_terminate_request_core(
* being aborted.
*/
if (status != SCI_SUCCESS) {
dev_err(&isci_host->pdev->dev,
dev_err(&ihost->pdev->dev,
"%s: scic_controller_terminate_request"
" returned = 0x%x\n",
__func__, status);
......@@ -579,7 +577,7 @@ static void isci_terminate_request_core(
} else {
if (was_terminated) {
dev_dbg(&isci_host->pdev->dev,
dev_dbg(&ihost->pdev->dev,
"%s: before completion wait (%p/%p)\n",
__func__, isci_request, io_request_completion);
......@@ -593,7 +591,7 @@ static void isci_terminate_request_core(
if (!termination_completed) {
/* The request to terminate has timed out. */
spin_lock_irqsave(&isci_host->scic_lock,
spin_lock_irqsave(&ihost->scic_lock,
flags);
/* Check for state changes. */
......@@ -623,12 +621,12 @@ static void isci_terminate_request_core(
} else
termination_completed = 1;
spin_unlock_irqrestore(&isci_host->scic_lock,
spin_unlock_irqrestore(&ihost->scic_lock,
flags);
if (!termination_completed) {
dev_err(&isci_host->pdev->dev,
dev_err(&ihost->pdev->dev,
"%s: *** Timeout waiting for "
"termination(%p/%p)\n",
__func__, io_request_completion,
......@@ -642,7 +640,7 @@ static void isci_terminate_request_core(
}
}
if (termination_completed)
dev_dbg(&isci_host->pdev->dev,
dev_dbg(&ihost->pdev->dev,
"%s: after completion wait (%p/%p)\n",
__func__, isci_request, io_request_completion);
}
......@@ -678,7 +676,7 @@ static void isci_terminate_request_core(
}
if (needs_cleanup_handling)
isci_request_cleanup_completed_loiterer(
isci_host, idev, isci_request, task);
ihost, idev, isci_request, task);
}
}
......@@ -1253,7 +1251,7 @@ isci_task_request_complete(struct isci_host *ihost,
/* PRINT_TMF( ((struct isci_tmf *)request->task)); */
tmf_complete = tmf->complete;
scic_controller_complete_io(&ihost->sci, ireq->target_device, ireq);
scic_controller_complete_io(ihost, ireq->target_device, ireq);
/* set the 'terminated' flag handle to make sure it cannot be terminated
* or completed again.
*/
......
......@@ -57,9 +57,9 @@
#include "unsolicited_frame_control.h"
#include "registers.h"
int scic_sds_unsolicited_frame_control_construct(struct scic_sds_controller *scic)
int scic_sds_unsolicited_frame_control_construct(struct isci_host *ihost)
{
struct scic_sds_unsolicited_frame_control *uf_control = &scic->uf_control;
struct scic_sds_unsolicited_frame_control *uf_control = &ihost->uf_control;
struct scic_sds_unsolicited_frame *uf;
u32 buf_len, header_len, i;
dma_addr_t dma;
......@@ -79,7 +79,7 @@ int scic_sds_unsolicited_frame_control_construct(struct scic_sds_controller *sci
* memory descriptor entry. The headers and address table will be
* placed after the buffers.
*/
virt = dmam_alloc_coherent(scic_to_dev(scic), size, &dma, GFP_KERNEL);
virt = dmam_alloc_coherent(&ihost->pdev->dev, size, &dma, GFP_KERNEL);
if (!virt)
return -ENOMEM;
......
......@@ -214,9 +214,9 @@ struct scic_sds_unsolicited_frame_control {
};
struct scic_sds_controller;
struct isci_host;
int scic_sds_unsolicited_frame_control_construct(struct scic_sds_controller *scic);
int scic_sds_unsolicited_frame_control_construct(struct isci_host *ihost);
enum sci_status scic_sds_unsolicited_frame_control_get_header(
struct scic_sds_unsolicited_frame_control *uf_control,
......
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