2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 03:33:59 +08:00

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: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
Dan Williams 2011-06-30 17:38:32 -07:00
parent 78a6f06e0e
commit d9dcb4ba79
16 changed files with 806 additions and 985 deletions

File diff suppressed because it is too large Load Diff

View File

@ -106,7 +106,7 @@ struct scic_power_control {
};
struct scic_sds_port_configuration_agent;
typedef void (*port_config_fn)(struct scic_sds_controller *,
typedef void (*port_config_fn)(struct isci_host *,
struct scic_sds_port_configuration_agent *,
struct isci_port *, struct isci_phy *);
@ -124,171 +124,66 @@ struct scic_sds_port_configuration_agent {
};
/**
* struct scic_sds_controller -
*
* This structure represents the SCU controller object.
* isci_host - primary host/controller object
* @timer: timeout start/stop operations
* @device_table: rni (hw remote node index) to remote device lookup table
* @available_remote_nodes: rni allocator
* @power_control: manage device spin up
* @io_request_sequence: generation number for tci's (task contexts)
* @task_context_table: hw task context table
* @remote_node_context_table: hw remote node context table
* @completion_queue: hw-producer driver-consumer communication ring
* @completion_queue_get: tracks the driver 'head' of the ring to notify hw
* @logical_port_entries: min({driver|silicon}-supported-port-count)
* @remote_node_entries: min({driver|silicon}-supported-node-count)
* @task_context_entries: min({driver|silicon}-supported-task-count)
* @phy_timer: phy startup timer
* @invalid_phy_mask: if an invalid_link_up notification is reported a bit for
* the phy index is set so further notifications are not
* made. Once the phy reports link up and is made part of a
* port then this bit is cleared.
*/
struct scic_sds_controller {
/**
* This field contains the information for the base controller state
* machine.
*/
struct isci_host {
struct sci_base_state_machine sm;
/**
* Timer for controller start/stop operations.
*/
/* XXX can we time this externally */
struct sci_timer timer;
/**
* This field contains the user parameters to be utilized for this
* core controller object.
*/
/* XXX drop reference module params directly */
union scic_user_parameters user_parameters;
/**
* This field contains the OEM parameters to be utilized for this
* core controller object.
*/
/* XXX no need to be a union */
union scic_oem_parameters oem_parameters;
/**
* This field contains the port configuration agent for this controller.
*/
struct scic_sds_port_configuration_agent port_agent;
/**
* This field is the array of device objects that are currently constructed
* for this controller object. This table is used as a fast lookup of device
* objects that need to handle device completion notifications from the
* hardware. The table is RNi based.
*/
struct isci_remote_device *device_table[SCI_MAX_REMOTE_DEVICES];
/**
* This field is the free RNi data structure
*/
struct scic_remote_node_table available_remote_nodes;
/**
* This filed is the struct scic_power_control data used to controll when direct
* attached devices can consume power.
*/
struct scic_power_control power_control;
/* sequence number per tci */
u8 io_request_sequence[SCI_MAX_IO_REQUESTS];
/**
* This field is a pointer to the memory allocated by the driver for the task
* context table. This data is shared between the hardware and software.
*/
struct scu_task_context *task_context_table;
dma_addr_t task_context_dma;
/**
* This field is a pointer to the memory allocated by the driver for the
* remote node context table. This table is shared between the hardware and
* software.
*/
union scu_remote_node_context *remote_node_context_table;
/**
* This field is a pointer to the completion queue. This memory is
* written to by the hardware and read by the software.
*/
u32 *completion_queue;
/**
* This field is the software copy of the completion queue get pointer. The
* controller object writes this value to the hardware after processing the
* completion entries.
*/
u32 completion_queue_get;
/**
* This field is the minimum of the number of hardware supported port entries
* and the software requested port entries.
*/
u32 logical_port_entries;
/**
* This field is the minimum number of devices supported by the hardware and
* the number of devices requested by the software.
*/
u32 remote_node_entries;
/**
* This field is the minimum number of IO requests supported by the hardware
* and the number of IO requests requested by the software.
*/
u32 task_context_entries;
/**
* This object contains all of the unsolicited frame specific
* data utilized by the core controller.
*/
struct scic_sds_unsolicited_frame_control uf_control;
/* Phy Startup Data */
/**
* Timer for controller phy request startup. On controller start the
* controller will start each PHY individually in order of phy index.
*/
/* phy startup */
struct sci_timer phy_timer;
/**
* This field is set when the phy_timer is running and is cleared when
* the phy_timer is stopped.
*/
/* XXX kill */
bool phy_startup_timer_pending;
/**
* This field is the index of the next phy start. It is initialized to 0 and
* increments for each phy index that is started.
*/
u32 next_phy_to_start;
/**
* This field controlls the invalid link up notifications to the SCI_USER. If
* an invalid_link_up notification is reported a bit for the PHY index is set
* so further notifications are not made. Once the PHY object reports link up
* and is made part of a port then this bit for the PHY index is cleared.
*/
u8 invalid_phy_mask;
/*
* This field saves the current interrupt coalescing number of the controller.
*/
/* TODO attempt dynamic interrupt coalescing scheme */
u16 interrupt_coalesce_number;
/*
* This field saves the current interrupt coalescing timeout value in microseconds.
*/
u32 interrupt_coalesce_timeout;
/**
* This field is a pointer to the memory mapped register space for the
* struct smu_registers.
*/
struct smu_registers __iomem *smu_registers;
/**
* This field is a pointer to the memory mapped register space for the
* struct scu_registers.
*/
struct scu_registers __iomem *scu_registers;
};
struct isci_host {
struct scic_sds_controller sci;
u16 tci_head;
u16 tci_tail;
u16 tci_pool[SCI_MAX_IO_REQUESTS];
union scic_oem_parameters oem_parameters;
int id; /* unique within a given pci device */
struct isci_phy phys[SCI_MAX_PHYS];
struct isci_port ports[SCI_MAX_PORTS + 1]; /* includes dummy port */
@ -464,14 +359,6 @@ static inline struct isci_host *dev_to_ihost(struct domain_device *dev)
return dev->port->ha->lldd_ha;
}
static inline struct isci_host *scic_to_ihost(struct scic_sds_controller *scic)
{
/* XXX delete after merging scic_sds_contoller and isci_host */
struct isci_host *ihost = container_of(scic, typeof(*ihost), sci);
return ihost;
}
/**
* scic_sds_controller_get_protocol_engine_group() -
*
@ -518,11 +405,6 @@ static inline int scic_sds_remote_device_node_count(struct isci_remote_device *i
#define scic_sds_controller_clear_invalid_phy(controller, phy) \
((controller)->invalid_phy_mask &= ~(1 << (phy)->phy_index))
static inline struct device *scic_to_dev(struct scic_sds_controller *scic)
{
return &scic_to_ihost(scic)->pdev->dev;
}
static inline struct device *sciphy_to_dev(struct isci_phy *iphy)
{
@ -578,54 +460,54 @@ static inline bool is_c0(void)
return isci_si_rev > ISCI_SI_REVB0;
}
void scic_sds_controller_post_request(struct scic_sds_controller *scic,
void scic_sds_controller_post_request(struct isci_host *ihost,
u32 request);
void scic_sds_controller_release_frame(struct scic_sds_controller *scic,
void scic_sds_controller_release_frame(struct isci_host *ihost,
u32 frame_index);
void scic_sds_controller_copy_sata_response(void *response_buffer,
void *frame_header,
void *frame_buffer);
enum sci_status scic_sds_controller_allocate_remote_node_context(struct scic_sds_controller *scic,
enum sci_status scic_sds_controller_allocate_remote_node_context(struct isci_host *ihost,
struct isci_remote_device *idev,
u16 *node_id);
void scic_sds_controller_free_remote_node_context(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct isci_remote_device *idev,
u16 node_id);
union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffer(
struct scic_sds_controller *scic,
struct isci_host *ihost,
u16 node_id);
struct isci_request *scic_request_by_tag(struct scic_sds_controller *scic,
struct isci_request *scic_request_by_tag(struct isci_host *ihost,
u16 io_tag);
void scic_sds_controller_power_control_queue_insert(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct isci_phy *iphy);
void scic_sds_controller_power_control_queue_remove(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct isci_phy *iphy);
void scic_sds_controller_link_up(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct isci_port *iport,
struct isci_phy *iphy);
void scic_sds_controller_link_down(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct isci_port *iport,
struct isci_phy *iphy);
void scic_sds_controller_remote_device_stopped(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct isci_remote_device *idev);
void scic_sds_controller_copy_task_context(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct isci_request *ireq);
void scic_sds_controller_register_setup(struct scic_sds_controller *scic);
void scic_sds_controller_register_setup(struct isci_host *ihost);
enum sci_status scic_controller_continue_io(struct isci_request *ireq);
int isci_host_scan_finished(struct Scsi_Host *, unsigned long);
@ -655,25 +537,25 @@ void isci_host_remote_device_start_complete(
enum sci_status);
void scic_controller_disable_interrupts(
struct scic_sds_controller *scic);
struct isci_host *ihost);
enum sci_status scic_controller_start_io(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct isci_remote_device *idev,
struct isci_request *ireq);
enum sci_task_status scic_controller_start_task(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct isci_remote_device *idev,
struct isci_request *ireq);
enum sci_status scic_controller_terminate_request(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct isci_remote_device *idev,
struct isci_request *ireq);
enum sci_status scic_controller_complete_io(
struct scic_sds_controller *scic,
struct isci_host *ihost,
struct isci_remote_device *idev,
struct isci_request *ireq);
@ -681,6 +563,6 @@ void scic_sds_port_configuration_agent_construct(
struct scic_sds_port_configuration_agent *port_agent);
enum sci_status scic_sds_port_configuration_agent_initialize(
struct scic_sds_controller *controller,
struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent);
#endif

View File

@ -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);
}
}

View File

@ -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;

View File

@ -365,11 +365,11 @@ static void isci_port_not_ready(struct isci_host *isci_host, struct isci_port *i
"%s: isci_port = %p\n", __func__, isci_port);
}
static void isci_port_stop_complete(struct scic_sds_controller *scic,
static void isci_port_stop_complete(struct isci_host *ihost,
struct isci_port *iport,
enum sci_status completion_status)
{
dev_dbg(&scic_to_ihost(scic)->pdev->dev, "Port stop complete\n");
dev_dbg(&ihost->pdev->dev, "Port stop complete\n");
}
/**
@ -541,8 +541,7 @@ static enum sci_status scic_sds_port_clear_phy(struct isci_port *iport,
/* Make sure that this phy is part of this port */
if (iport->phy_table[iphy->phy_index] == iphy &&
phy_get_non_dummy_port(iphy) == iport) {
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = scic_to_ihost(scic);
struct isci_host *ihost = iport->owning_controller;
/* Yep it is assigned to this port so remove it */
scic_sds_phy_set_port(iphy, &ihost->ports[SCI_MAX_PORTS]);
@ -654,10 +653,10 @@ static void scic_sds_port_construct_dummy_rnc(struct isci_port *iport, u16 rni)
*/
static void scic_sds_port_construct_dummy_task(struct isci_port *iport, u16 tag)
{
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = iport->owning_controller;
struct scu_task_context *task_context;
task_context = &scic->task_context_table[ISCI_TAG_TCI(tag)];
task_context = &ihost->task_context_table[ISCI_TAG_TCI(tag)];
memset(task_context, 0, sizeof(struct scu_task_context));
task_context->initiator_request = 1;
@ -674,13 +673,13 @@ static void scic_sds_port_construct_dummy_task(struct isci_port *iport, u16 tag)
static void scic_sds_port_destroy_dummy_resources(struct isci_port *iport)
{
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = iport->owning_controller;
if (iport->reserved_tag != SCI_CONTROLLER_INVALID_IO_TAG)
isci_free_tag(scic_to_ihost(scic), iport->reserved_tag);
isci_free_tag(ihost, iport->reserved_tag);
if (iport->reserved_rni != SCU_DUMMY_INDEX)
scic_sds_remote_node_table_release_remote_node_index(&scic->available_remote_nodes,
scic_sds_remote_node_table_release_remote_node_index(&ihost->available_remote_nodes,
1, iport->reserved_rni);
iport->reserved_rni = SCU_DUMMY_INDEX;
@ -749,15 +748,14 @@ static void scic_sds_port_activate_phy(struct isci_port *iport,
struct isci_phy *iphy,
bool do_notify_user)
{
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = scic_to_ihost(scic);
struct isci_host *ihost = iport->owning_controller;
if (iphy->protocol != SCIC_SDS_PHY_PROTOCOL_SATA)
scic_sds_phy_resume(iphy);
iport->active_phy_mask |= 1 << iphy->phy_index;
scic_sds_controller_clear_invalid_phy(scic, iphy);
scic_sds_controller_clear_invalid_phy(ihost, iphy);
if (do_notify_user == true)
isci_port_link_up(ihost, iport, iphy);
@ -767,8 +765,7 @@ void scic_sds_port_deactivate_phy(struct isci_port *iport,
struct isci_phy *iphy,
bool do_notify_user)
{
struct scic_sds_controller *scic = scic_sds_port_get_controller(iport);
struct isci_host *ihost = scic_to_ihost(scic);
struct isci_host *ihost = scic_sds_port_get_controller(iport);
iport->active_phy_mask &= ~(1 << iphy->phy_index);
@ -793,16 +790,16 @@ void scic_sds_port_deactivate_phy(struct isci_port *iport,
static void scic_sds_port_invalid_link_up(struct isci_port *iport,
struct isci_phy *iphy)
{
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = iport->owning_controller;
/*
* Check to see if we have alreay reported this link as bad and if
* not go ahead and tell the SCI_USER that we have discovered an
* invalid link.
*/
if ((scic->invalid_phy_mask & (1 << iphy->phy_index)) == 0) {
scic_sds_controller_set_invalid_phy(scic, iphy);
dev_warn(&scic_to_ihost(scic)->pdev->dev, "Invalid link up!\n");
if ((ihost->invalid_phy_mask & (1 << iphy->phy_index)) == 0) {
scic_sds_controller_set_invalid_phy(ihost, iphy);
dev_warn(&ihost->pdev->dev, "Invalid link up!\n");
}
}
@ -931,7 +928,7 @@ static void port_timeout(unsigned long data)
{
struct sci_timer *tmr = (struct sci_timer *)data;
struct isci_port *iport = container_of(tmr, typeof(*iport), timer);
struct isci_host *ihost = scic_to_ihost(iport->owning_controller);
struct isci_host *ihost = iport->owning_controller;
unsigned long flags;
u32 current_state;
@ -1041,19 +1038,19 @@ static void scic_sds_port_suspend_port_task_scheduler(struct isci_port *iport)
*/
static void scic_sds_port_post_dummy_request(struct isci_port *iport)
{
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = iport->owning_controller;
u16 tag = iport->reserved_tag;
struct scu_task_context *tc;
u32 command;
tc = &scic->task_context_table[ISCI_TAG_TCI(tag)];
tc = &ihost->task_context_table[ISCI_TAG_TCI(tag)];
tc->abort = 0;
command = SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC |
iport->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT |
ISCI_TAG_TCI(tag);
scic_sds_controller_post_request(scic, command);
scic_sds_controller_post_request(ihost, command);
}
/**
@ -1065,19 +1062,19 @@ static void scic_sds_port_post_dummy_request(struct isci_port *iport)
*/
static void scic_sds_port_abort_dummy_request(struct isci_port *iport)
{
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = iport->owning_controller;
u16 tag = iport->reserved_tag;
struct scu_task_context *tc;
u32 command;
tc = &scic->task_context_table[ISCI_TAG_TCI(tag)];
tc = &ihost->task_context_table[ISCI_TAG_TCI(tag)];
tc->abort = 1;
command = SCU_CONTEXT_COMMAND_REQUEST_POST_TC_ABORT |
iport->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT |
ISCI_TAG_TCI(tag);
scic_sds_controller_post_request(scic, command);
scic_sds_controller_post_request(ihost, command);
}
/**
@ -1115,8 +1112,7 @@ static void scic_sds_port_ready_substate_operational_enter(struct sci_base_state
{
u32 index;
struct isci_port *iport = container_of(sm, typeof(*iport), sm);
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = scic_to_ihost(scic);
struct isci_host *ihost = iport->owning_controller;
isci_port_ready(ihost, iport);
@ -1141,13 +1137,13 @@ static void scic_sds_port_ready_substate_operational_enter(struct sci_base_state
static void scic_sds_port_invalidate_dummy_remote_node(struct isci_port *iport)
{
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = iport->owning_controller;
u8 phys_index = iport->physical_port_index;
union scu_remote_node_context *rnc;
u16 rni = iport->reserved_rni;
u32 command;
rnc = &scic->remote_node_context_table[rni];
rnc = &ihost->remote_node_context_table[rni];
rnc->ssp.is_valid = false;
@ -1155,13 +1151,13 @@ static void scic_sds_port_invalidate_dummy_remote_node(struct isci_port *iport)
* controller and give it ample time to act before posting the rnc
* invalidate
*/
readl(&scic->smu_registers->interrupt_status); /* flush */
readl(&ihost->smu_registers->interrupt_status); /* flush */
udelay(10);
command = SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE |
phys_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT | rni;
scic_sds_controller_post_request(scic, command);
scic_sds_controller_post_request(ihost, command);
}
/**
@ -1175,8 +1171,7 @@ static void scic_sds_port_invalidate_dummy_remote_node(struct isci_port *iport)
static void scic_sds_port_ready_substate_operational_exit(struct sci_base_state_machine *sm)
{
struct isci_port *iport = container_of(sm, typeof(*iport), sm);
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = scic_to_ihost(scic);
struct isci_host *ihost = iport->owning_controller;
/*
* Kill the dummy task for this port if it has not yet posted
@ -1194,8 +1189,7 @@ static void scic_sds_port_ready_substate_operational_exit(struct sci_base_state_
static void scic_sds_port_ready_substate_configuring_enter(struct sci_base_state_machine *sm)
{
struct isci_port *iport = container_of(sm, typeof(*iport), sm);
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = scic_to_ihost(scic);
struct isci_host *ihost = iport->owning_controller;
if (iport->active_phy_mask == 0) {
isci_port_not_ready(ihost, iport);
@ -1218,7 +1212,7 @@ static void scic_sds_port_ready_substate_configuring_exit(struct sci_base_state_
enum sci_status scic_sds_port_start(struct isci_port *iport)
{
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = iport->owning_controller;
enum sci_status status = SCI_SUCCESS;
enum scic_sds_port_states state;
u32 phy_mask;
@ -1241,7 +1235,7 @@ enum sci_status scic_sds_port_start(struct isci_port *iport)
if (iport->reserved_rni == SCU_DUMMY_INDEX) {
u16 rni = scic_sds_remote_node_table_allocate_remote_node(
&scic->available_remote_nodes, 1);
&ihost->available_remote_nodes, 1);
if (rni != SCU_DUMMY_INDEX)
scic_sds_port_construct_dummy_rnc(iport, rni);
@ -1251,7 +1245,6 @@ enum sci_status scic_sds_port_start(struct isci_port *iport)
}
if (iport->reserved_tag == SCI_CONTROLLER_INVALID_IO_TAG) {
struct isci_host *ihost = scic_to_ihost(scic);
u16 tag;
tag = isci_alloc_tag(ihost);
@ -1634,30 +1627,30 @@ scic_sds_port_disable_port_task_scheduler(struct isci_port *iport)
static void scic_sds_port_post_dummy_remote_node(struct isci_port *iport)
{
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = iport->owning_controller;
u8 phys_index = iport->physical_port_index;
union scu_remote_node_context *rnc;
u16 rni = iport->reserved_rni;
u32 command;
rnc = &scic->remote_node_context_table[rni];
rnc = &ihost->remote_node_context_table[rni];
rnc->ssp.is_valid = true;
command = SCU_CONTEXT_COMMAND_POST_RNC_32 |
phys_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT | rni;
scic_sds_controller_post_request(scic, command);
scic_sds_controller_post_request(ihost, command);
/* ensure hardware has seen the post rnc command and give it
* ample time to act before sending the suspend
*/
readl(&scic->smu_registers->interrupt_status); /* flush */
readl(&ihost->smu_registers->interrupt_status); /* flush */
udelay(10);
command = SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX_RX |
phys_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT | rni;
scic_sds_controller_post_request(scic, command);
scic_sds_controller_post_request(ihost, command);
}
static void scic_sds_port_stopped_state_enter(struct sci_base_state_machine *sm)
@ -1684,8 +1677,7 @@ static void scic_sds_port_stopped_state_exit(struct sci_base_state_machine *sm)
static void scic_sds_port_ready_state_enter(struct sci_base_state_machine *sm)
{
struct isci_port *iport = container_of(sm, typeof(*iport), sm);
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = scic_to_ihost(scic);
struct isci_host *ihost = iport->owning_controller;
u32 prev_state;
prev_state = iport->sm.previous_state_id;
@ -1758,7 +1750,7 @@ static const struct sci_base_state scic_sds_port_state_table[] = {
};
void scic_sds_port_construct(struct isci_port *iport, u8 index,
struct scic_sds_controller *scic)
struct isci_host *ihost)
{
sci_init_sm(&iport->sm, scic_sds_port_state_table, SCI_PORT_STOPPED);
@ -1767,7 +1759,7 @@ void scic_sds_port_construct(struct isci_port *iport, u8 index,
iport->active_phy_mask = 0;
iport->ready_exit = false;
iport->owning_controller = scic;
iport->owning_controller = ihost;
iport->started_request_count = 0;
iport->assigned_device_count = 0;
@ -1810,8 +1802,7 @@ void scic_sds_port_broadcast_change_received(
struct isci_port *iport,
struct isci_phy *iphy)
{
struct scic_sds_controller *scic = iport->owning_controller;
struct isci_host *ihost = scic_to_ihost(scic);
struct isci_host *ihost = iport->owning_controller;
/* notify the user. */
isci_port_bc_change_received(ihost, iport, iphy);

View File

@ -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,

View File

@ -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 @@ done:
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;

View File

@ -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;

View File

@ -62,7 +62,7 @@
#include "task.h"
/**
* isci_remote_device_not_ready() - This function is called by the scic when
* isci_remote_device_not_ready() - This function is called by the ihost when
* the remote device is not ready. We mark the isci device as ready (not
* "ready_for_io") and signal the waiting proccess.
* @isci_host: This parameter specifies the isci host object.
@ -92,7 +92,7 @@ static void isci_remote_device_not_ready(struct isci_host *ihost,
"%s: isci_device = %p request = %p\n",
__func__, idev, ireq);
scic_controller_terminate_request(&ihost->sci,
scic_controller_terminate_request(ihost,
idev,
ireq);
}
@ -104,7 +104,7 @@ static void isci_remote_device_not_ready(struct isci_host *ihost,
}
/**
* isci_remote_device_ready() - This function is called by the scic when the
* isci_remote_device_ready() - This function is called by the ihost when the
* remote device is ready. We mark the isci device as ready and signal the
* waiting proccess.
* @ihost: our valid isci_host
@ -135,8 +135,7 @@ static void rnc_destruct_done(void *_dev)
static enum sci_status scic_sds_remote_device_terminate_requests(struct isci_remote_device *idev)
{
struct scic_sds_controller *scic = idev->owning_port->owning_controller;
struct isci_host *ihost = scic_to_ihost(scic);
struct isci_host *ihost = idev->owning_port->owning_controller;
enum sci_status status = SCI_SUCCESS;
u32 i;
@ -148,7 +147,7 @@ static enum sci_status scic_sds_remote_device_terminate_requests(struct isci_rem
ireq->target_device != idev)
continue;
s = scic_controller_terminate_request(scic, idev, ireq);
s = scic_controller_terminate_request(ihost, idev, ireq);
if (s != SCI_SUCCESS)
status = s;
}
@ -276,7 +275,7 @@ enum sci_status scic_sds_remote_device_frame_handler(struct isci_remote_device *
{
struct sci_base_state_machine *sm = &idev->sm;
enum scic_sds_remote_device_states state = sm->current_state_id;
struct scic_sds_controller *scic = idev->owning_port->owning_controller;
struct isci_host *ihost = idev->owning_port->owning_controller;
enum sci_status status;
switch (state) {
@ -290,7 +289,7 @@ enum sci_status scic_sds_remote_device_frame_handler(struct isci_remote_device *
dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
__func__, state);
/* Return the frame back to the controller */
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
return SCI_FAILURE_INVALID_STATE;
case SCI_DEV_READY:
case SCI_STP_DEV_NCQ_ERROR:
@ -303,7 +302,7 @@ enum sci_status scic_sds_remote_device_frame_handler(struct isci_remote_device *
void *frame_header;
ssize_t word_cnt;
status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
frame_index,
&frame_header);
if (status != SCI_SUCCESS)
@ -312,7 +311,7 @@ enum sci_status scic_sds_remote_device_frame_handler(struct isci_remote_device *
word_cnt = sizeof(hdr) / sizeof(u32);
sci_swab32_cpy(&hdr, frame_header, word_cnt);
ireq = scic_request_by_tag(scic, be16_to_cpu(hdr.tag));
ireq = scic_request_by_tag(ihost, be16_to_cpu(hdr.tag));
if (ireq && ireq->target_device == idev) {
/* The IO request is now in charge of releasing the frame */
status = scic_sds_io_request_frame_handler(ireq, frame_index);
@ -320,14 +319,14 @@ enum sci_status scic_sds_remote_device_frame_handler(struct isci_remote_device *
/* We could not map this tag to a valid IO
* request Just toss the frame and continue
*/
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
}
break;
}
case SCI_STP_DEV_NCQ: {
struct dev_to_host_fis *hdr;
status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
frame_index,
(void **)&hdr);
if (status != SCI_SUCCESS)
@ -350,7 +349,7 @@ enum sci_status scic_sds_remote_device_frame_handler(struct isci_remote_device *
} else
status = SCI_FAILURE;
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
break;
}
case SCI_STP_DEV_CMD:
@ -461,7 +460,7 @@ static void scic_sds_remote_device_start_request(struct isci_remote_device *idev
}
}
enum sci_status scic_sds_remote_device_start_io(struct scic_sds_controller *scic,
enum sci_status scic_sds_remote_device_start_io(struct isci_host *ihost,
struct isci_remote_device *idev,
struct isci_request *ireq)
{
@ -597,7 +596,7 @@ static enum sci_status common_complete_io(struct isci_port *iport,
return status;
}
enum sci_status scic_sds_remote_device_complete_io(struct scic_sds_controller *scic,
enum sci_status scic_sds_remote_device_complete_io(struct isci_host *ihost,
struct isci_remote_device *idev,
struct isci_request *ireq)
{
@ -678,7 +677,7 @@ static void scic_sds_remote_device_continue_request(void *dev)
scic_controller_continue_io(idev->working_request);
}
enum sci_status scic_sds_remote_device_start_task(struct scic_sds_controller *scic,
enum sci_status scic_sds_remote_device_start_task(struct isci_host *ihost,
struct isci_remote_device *idev,
struct isci_request *ireq)
{
@ -802,13 +801,13 @@ static void remote_device_resume_done(void *_dev)
static void scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(void *_dev)
{
struct isci_remote_device *idev = _dev;
struct scic_sds_controller *scic = idev->owning_port->owning_controller;
struct isci_host *ihost = idev->owning_port->owning_controller;
/* For NCQ operation we do not issue a isci_remote_device_not_ready().
* As a result, avoid sending the ready notification.
*/
if (idev->sm.previous_state_id != SCI_STP_DEV_NCQ)
isci_remote_device_ready(scic_to_ihost(scic), idev);
isci_remote_device_ready(ihost, idev);
}
static void scic_sds_remote_device_initial_state_enter(struct sci_base_state_machine *sm)
@ -836,7 +835,7 @@ static enum sci_status scic_remote_device_destruct(struct isci_remote_device *id
{
struct sci_base_state_machine *sm = &idev->sm;
enum scic_sds_remote_device_states state = sm->current_state_id;
struct scic_sds_controller *scic;
struct isci_host *ihost;
if (state != SCI_DEV_STOPPED) {
dev_warn(scirdev_to_dev(idev), "%s: in wrong state: %d\n",
@ -844,8 +843,8 @@ static enum sci_status scic_remote_device_destruct(struct isci_remote_device *id
return SCI_FAILURE_INVALID_STATE;
}
scic = idev->owning_port->owning_controller;
scic_sds_controller_free_remote_node_context(scic, idev,
ihost = idev->owning_port->owning_controller;
scic_sds_controller_free_remote_node_context(ihost, idev,
idev->rnc.remote_node_index);
idev->rnc.remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX;
sci_change_state(sm, SCI_DEV_FINAL);
@ -878,7 +877,7 @@ static void isci_remote_device_deconstruct(struct isci_host *ihost, struct isci_
static void scic_sds_remote_device_stopped_state_enter(struct sci_base_state_machine *sm)
{
struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
struct scic_sds_controller *scic = idev->owning_port->owning_controller;
struct isci_host *ihost = idev->owning_port->owning_controller;
u32 prev_state;
/* If we are entering from the stopping state let the SCI User know that
@ -886,16 +885,15 @@ static void scic_sds_remote_device_stopped_state_enter(struct sci_base_state_mac
*/
prev_state = idev->sm.previous_state_id;
if (prev_state == SCI_DEV_STOPPING)
isci_remote_device_deconstruct(scic_to_ihost(scic), idev);
isci_remote_device_deconstruct(ihost, idev);
scic_sds_controller_remote_device_stopped(scic, idev);
scic_sds_controller_remote_device_stopped(ihost, idev);
}
static void scic_sds_remote_device_starting_state_enter(struct sci_base_state_machine *sm)
{
struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(idev);
struct isci_host *ihost = scic_to_ihost(scic);
struct isci_host *ihost = scic_sds_remote_device_get_controller(idev);
isci_remote_device_not_ready(ihost, idev,
SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED);
@ -904,7 +902,7 @@ static void scic_sds_remote_device_starting_state_enter(struct sci_base_state_ma
static void scic_sds_remote_device_ready_state_enter(struct sci_base_state_machine *sm)
{
struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
struct scic_sds_controller *scic = idev->owning_port->owning_controller;
struct isci_host *ihost = idev->owning_port->owning_controller;
struct domain_device *dev = idev->domain_dev;
if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_SATA)) {
@ -912,7 +910,7 @@ static void scic_sds_remote_device_ready_state_enter(struct sci_base_state_machi
} else if (dev_is_expander(dev)) {
sci_change_state(&idev->sm, SCI_SMP_DEV_IDLE);
} else
isci_remote_device_ready(scic_to_ihost(scic), idev);
isci_remote_device_ready(ihost, idev);
}
static void scic_sds_remote_device_ready_state_exit(struct sci_base_state_machine *sm)
@ -921,9 +919,9 @@ static void scic_sds_remote_device_ready_state_exit(struct sci_base_state_machin
struct domain_device *dev = idev->domain_dev;
if (dev->dev_type == SAS_END_DEV) {
struct scic_sds_controller *scic = idev->owning_port->owning_controller;
struct isci_host *ihost = idev->owning_port->owning_controller;
isci_remote_device_not_ready(scic_to_ihost(scic), idev,
isci_remote_device_not_ready(ihost, idev,
SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED);
}
}
@ -963,40 +961,40 @@ static void scic_sds_stp_remote_device_ready_idle_substate_enter(struct sci_base
static void scic_sds_stp_remote_device_ready_cmd_substate_enter(struct sci_base_state_machine *sm)
{
struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(idev);
struct isci_host *ihost = scic_sds_remote_device_get_controller(idev);
BUG_ON(idev->working_request == NULL);
isci_remote_device_not_ready(scic_to_ihost(scic), idev,
isci_remote_device_not_ready(ihost, idev,
SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED);
}
static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(struct sci_base_state_machine *sm)
{
struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(idev);
struct isci_host *ihost = scic_sds_remote_device_get_controller(idev);
if (idev->not_ready_reason == SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED)
isci_remote_device_not_ready(scic_to_ihost(scic), idev,
isci_remote_device_not_ready(ihost, idev,
idev->not_ready_reason);
}
static void scic_sds_smp_remote_device_ready_idle_substate_enter(struct sci_base_state_machine *sm)
{
struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(idev);
struct isci_host *ihost = scic_sds_remote_device_get_controller(idev);
isci_remote_device_ready(scic_to_ihost(scic), idev);
isci_remote_device_ready(ihost, idev);
}
static void scic_sds_smp_remote_device_ready_cmd_substate_enter(struct sci_base_state_machine *sm)
{
struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(idev);
struct isci_host *ihost = scic_sds_remote_device_get_controller(idev);
BUG_ON(idev->working_request == NULL);
isci_remote_device_not_ready(scic_to_ihost(scic), idev,
isci_remote_device_not_ready(ihost, idev,
SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED);
}
@ -1303,7 +1301,7 @@ void isci_remote_device_release(struct kref *kref)
* @isci_host: This parameter specifies the isci host object.
* @isci_device: This parameter specifies the remote device.
*
* The status of the scic request to stop.
* The status of the ihost request to stop.
*/
enum sci_status isci_remote_device_stop(struct isci_host *ihost, struct isci_remote_device *idev)
{

View File

@ -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);

View File

@ -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;

View File

@ -74,19 +74,19 @@ static struct scu_sgl_element_pair *to_sgl_element_pair(struct isci_request *ire
return &ireq->sg_table[idx - 2];
}
static dma_addr_t to_sgl_element_pair_dma(struct scic_sds_controller *scic,
static dma_addr_t to_sgl_element_pair_dma(struct isci_host *ihost,
struct isci_request *ireq, u32 idx)
{
u32 offset;
if (idx == 0) {
offset = (void *) &ireq->tc->sgl_pair_ab -
(void *) &scic->task_context_table[0];
return scic->task_context_dma + offset;
(void *) &ihost->task_context_table[0];
return ihost->task_context_dma + offset;
} else if (idx == 1) {
offset = (void *) &ireq->tc->sgl_pair_cd -
(void *) &scic->task_context_table[0];
return scic->task_context_dma + offset;
(void *) &ihost->task_context_table[0];
return ihost->task_context_dma + offset;
}
return scic_io_request_get_dma_addr(ireq, &ireq->sg_table[idx - 2]);
@ -102,8 +102,7 @@ static void init_sgl_element(struct scu_sgl_element *e, struct scatterlist *sg)
static void scic_sds_request_build_sgl(struct isci_request *ireq)
{
struct isci_host *isci_host = ireq->isci_host;
struct scic_sds_controller *scic = &isci_host->sci;
struct isci_host *ihost = ireq->isci_host;
struct sas_task *task = isci_request_access_task(ireq);
struct scatterlist *sg = NULL;
dma_addr_t dma_addr;
@ -125,7 +124,7 @@ static void scic_sds_request_build_sgl(struct isci_request *ireq)
memset(&scu_sg->B, 0, sizeof(scu_sg->B));
if (prev_sg) {
dma_addr = to_sgl_element_pair_dma(scic,
dma_addr = to_sgl_element_pair_dma(ihost,
ireq,
sg_idx);
@ -141,7 +140,7 @@ static void scic_sds_request_build_sgl(struct isci_request *ireq)
} else { /* handle when no sg */
scu_sg = to_sgl_element_pair(ireq, sg_idx);
dma_addr = dma_map_single(&isci_host->pdev->dev,
dma_addr = dma_map_single(&ihost->pdev->dev,
task->scatter,
task->total_xfer_len,
task->data_dir);
@ -508,7 +507,7 @@ scic_io_request_construct_sata(struct isci_request *ireq,
scu_stp_raw_request_construct_task_context(ireq);
return SCI_SUCCESS;
} else {
dev_err(scic_to_dev(ireq->owning_controller),
dev_err(&ireq->owning_controller->pdev->dev,
"%s: Request 0x%p received un-handled SAT "
"management protocol 0x%x.\n",
__func__, ireq, tmf->tmf_code);
@ -518,7 +517,7 @@ scic_io_request_construct_sata(struct isci_request *ireq,
}
if (!sas_protocol_ata(task->task_proto)) {
dev_err(scic_to_dev(ireq->owning_controller),
dev_err(&ireq->owning_controller->pdev->dev,
"%s: Non-ATA protocol in SATA path: 0x%x\n",
__func__,
task->task_proto);
@ -616,7 +615,7 @@ enum sci_status scic_task_request_construct_sata(struct isci_request *ireq)
tmf->tmf_code == isci_tmf_sata_srst_low) {
scu_stp_raw_request_construct_task_context(ireq);
} else {
dev_err(scic_to_dev(ireq->owning_controller),
dev_err(&ireq->owning_controller->pdev->dev,
"%s: Request 0x%p received un-handled SAT "
"Protocol 0x%x.\n",
__func__, ireq, tmf->tmf_code);
@ -639,11 +638,11 @@ enum sci_status scic_task_request_construct_sata(struct isci_request *ireq)
#define SCU_TASK_CONTEXT_SRAM 0x200000
static u32 sci_req_tx_bytes(struct isci_request *ireq)
{
struct scic_sds_controller *scic = ireq->owning_controller;
struct isci_host *ihost = ireq->owning_controller;
u32 ret_val = 0;
if (readl(&scic->smu_registers->address_modifier) == 0) {
void __iomem *scu_reg_base = scic->scu_registers;
if (readl(&ihost->smu_registers->address_modifier) == 0) {
void __iomem *scu_reg_base = ihost->scu_registers;
/* get the bytes of data from the Address == BAR1 + 20002Ch + (256*TCi) where
* BAR1 is the scu_registers
@ -663,11 +662,11 @@ enum sci_status scic_sds_request_start(struct isci_request *ireq)
{
enum sci_base_request_states state;
struct scu_task_context *tc = ireq->tc;
struct scic_sds_controller *scic = ireq->owning_controller;
struct isci_host *ihost = ireq->owning_controller;
state = ireq->sm.current_state_id;
if (state != SCI_REQ_CONSTRUCTED) {
dev_warn(scic_to_dev(scic),
dev_warn(&ihost->pdev->dev,
"%s: SCIC IO Request requested to start while in wrong "
"state %d\n", __func__, state);
return SCI_FAILURE_INVALID_STATE;
@ -749,7 +748,7 @@ scic_sds_io_request_terminate(struct isci_request *ireq)
return SCI_SUCCESS;
case SCI_REQ_COMPLETED:
default:
dev_warn(scic_to_dev(ireq->owning_controller),
dev_warn(&ireq->owning_controller->pdev->dev,
"%s: SCIC IO Request requested to abort while in wrong "
"state %d\n",
__func__,
@ -763,7 +762,7 @@ scic_sds_io_request_terminate(struct isci_request *ireq)
enum sci_status scic_sds_request_complete(struct isci_request *ireq)
{
enum sci_base_request_states state;
struct scic_sds_controller *scic = ireq->owning_controller;
struct isci_host *ihost = ireq->owning_controller;
state = ireq->sm.current_state_id;
if (WARN_ONCE(state != SCI_REQ_COMPLETED,
@ -771,7 +770,7 @@ enum sci_status scic_sds_request_complete(struct isci_request *ireq)
return SCI_FAILURE_INVALID_STATE;
if (ireq->saved_rx_frame_index != SCU_INVALID_FRAME_INDEX)
scic_sds_controller_release_frame(scic,
scic_sds_controller_release_frame(ihost,
ireq->saved_rx_frame_index);
/* XXX can we just stop the machine and remove the 'final' state? */
@ -783,12 +782,12 @@ enum sci_status scic_sds_io_request_event_handler(struct isci_request *ireq,
u32 event_code)
{
enum sci_base_request_states state;
struct scic_sds_controller *scic = ireq->owning_controller;
struct isci_host *ihost = ireq->owning_controller;
state = ireq->sm.current_state_id;
if (state != SCI_REQ_STP_PIO_DATA_IN) {
dev_warn(scic_to_dev(scic), "%s: (%x) in wrong state %d\n",
dev_warn(&ihost->pdev->dev, "%s: (%x) in wrong state %d\n",
__func__, event_code, state);
return SCI_FAILURE_INVALID_STATE;
@ -802,7 +801,7 @@ enum sci_status scic_sds_io_request_event_handler(struct isci_request *ireq,
sci_change_state(&ireq->sm, SCI_REQ_STP_PIO_WAIT_FRAME);
return SCI_SUCCESS;
default:
dev_err(scic_to_dev(scic),
dev_err(&ihost->pdev->dev,
"%s: pio request unexpected event %#x\n",
__func__, event_code);
@ -1024,7 +1023,7 @@ static enum sci_status ssp_task_request_await_tc_event(struct isci_request *ireq
* There is a potential for receiving multiple task responses if
* we decide to send the task IU again.
*/
dev_warn(scic_to_dev(ireq->owning_controller),
dev_warn(&ireq->owning_controller->pdev->dev,
"%s: TaskRequest:0x%p CompletionCode:%x - "
"ACK/NAK timeout\n", __func__, ireq,
completion_code);
@ -1073,7 +1072,7 @@ smp_request_await_response_tc_event(struct isci_request *ireq,
* response within 2 ms. This causes our hardware break
* the connection and set TC completion with one of
* these SMP_XXX_XX_ERR status. For these type of error,
* we ask scic user to retry the request.
* we ask ihost user to retry the request.
*/
scic_sds_request_set_status(ireq, SCU_TASK_DONE_SMP_RESP_TO_ERR,
SCI_FAILURE_RETRY_REQUIRED);
@ -1451,18 +1450,18 @@ static void scic_sds_stp_request_udma_complete_request(
static enum sci_status scic_sds_stp_request_udma_general_frame_handler(struct isci_request *ireq,
u32 frame_index)
{
struct scic_sds_controller *scic = ireq->owning_controller;
struct isci_host *ihost = ireq->owning_controller;
struct dev_to_host_fis *frame_header;
enum sci_status status;
u32 *frame_buffer;
status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
frame_index,
(void **)&frame_header);
if ((status == SCI_SUCCESS) &&
(frame_header->fis_type == FIS_REGD2H)) {
scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
frame_index,
(void **)&frame_buffer);
@ -1471,7 +1470,7 @@ static enum sci_status scic_sds_stp_request_udma_general_frame_handler(struct is
frame_buffer);
}
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
return status;
}
@ -1480,7 +1479,7 @@ enum sci_status
scic_sds_io_request_frame_handler(struct isci_request *ireq,
u32 frame_index)
{
struct scic_sds_controller *scic = ireq->owning_controller;
struct isci_host *ihost = ireq->owning_controller;
struct isci_stp_request *stp_req = &ireq->stp.req;
enum sci_base_request_states state;
enum sci_status status;
@ -1492,7 +1491,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
struct ssp_frame_hdr ssp_hdr;
void *frame_header;
scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
frame_index,
&frame_header);
@ -1503,7 +1502,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
struct ssp_response_iu *resp_iu;
ssize_t word_cnt = SSP_RESP_IU_MAX_SIZE / sizeof(u32);
scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
frame_index,
(void **)&resp_iu);
@ -1522,7 +1521,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
SCI_SUCCESS);
} else {
/* not a response frame, why did it get forwarded? */
dev_err(scic_to_dev(scic),
dev_err(&ihost->pdev->dev,
"%s: SCIC IO Request 0x%p received unexpected "
"frame %d type 0x%02x\n", __func__, ireq,
frame_index, ssp_hdr.frame_type);
@ -1532,7 +1531,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
* In any case we are done with this frame buffer return it to
* the controller
*/
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
return SCI_SUCCESS;
}
@ -1540,14 +1539,14 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
case SCI_REQ_TASK_WAIT_TC_RESP:
scic_sds_io_request_copy_response(ireq);
sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);
scic_sds_controller_release_frame(scic,frame_index);
scic_sds_controller_release_frame(ihost,frame_index);
return SCI_SUCCESS;
case SCI_REQ_SMP_WAIT_RESP: {
struct smp_resp *rsp_hdr = &ireq->smp.rsp;
void *frame_header;
scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
frame_index,
&frame_header);
@ -1558,7 +1557,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
if (rsp_hdr->frame_type == SMP_RESPONSE) {
void *smp_resp;
scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
frame_index,
&smp_resp);
@ -1577,7 +1576,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
* This was not a response frame why did it get
* forwarded?
*/
dev_err(scic_to_dev(scic),
dev_err(&ihost->pdev->dev,
"%s: SCIC SMP Request 0x%p received unexpected "
"frame %d type 0x%02x\n",
__func__,
@ -1592,7 +1591,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);
}
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
return SCI_SUCCESS;
}
@ -1619,12 +1618,12 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
struct dev_to_host_fis *frame_header;
u32 *frame_buffer;
status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
frame_index,
(void **)&frame_header);
if (status != SCI_SUCCESS) {
dev_err(scic_to_dev(scic),
dev_err(&ihost->pdev->dev,
"%s: SCIC IO Request 0x%p could not get frame "
"header for frame index %d, status %x\n",
__func__,
@ -1637,7 +1636,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
switch (frame_header->fis_type) {
case FIS_REGD2H:
scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
frame_index,
(void **)&frame_buffer);
@ -1651,7 +1650,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
break;
default:
dev_warn(scic_to_dev(scic),
dev_warn(&ihost->pdev->dev,
"%s: IO Request:0x%p Frame Id:%d protocol "
"violation occurred\n", __func__, stp_req,
frame_index);
@ -1664,7 +1663,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);
/* Frame has been decoded return it to the controller */
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
return status;
}
@ -1674,12 +1673,12 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
struct dev_to_host_fis *frame_header;
u32 *frame_buffer;
status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
frame_index,
(void **)&frame_header);
if (status != SCI_SUCCESS) {
dev_err(scic_to_dev(scic),
dev_err(&ihost->pdev->dev,
"%s: SCIC IO Request 0x%p could not get frame "
"header for frame index %d, status %x\n",
__func__, stp_req, frame_index, status);
@ -1689,7 +1688,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
switch (frame_header->fis_type) {
case FIS_PIO_SETUP:
/* Get from the frame buffer the PIO Setup Data */
scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
frame_index,
(void **)&frame_buffer);
@ -1736,7 +1735,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
* FIS when it is still busy? Do nothing since
* we are still in the right state.
*/
dev_dbg(scic_to_dev(scic),
dev_dbg(&ihost->pdev->dev,
"%s: SCIC PIO Request 0x%p received "
"D2H Register FIS with BSY status "
"0x%x\n",
@ -1746,7 +1745,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
break;
}
scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
frame_index,
(void **)&frame_buffer);
@ -1767,7 +1766,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
}
/* Frame is decoded return it to the controller */
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
return status;
}
@ -1776,12 +1775,12 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
struct dev_to_host_fis *frame_header;
struct sata_fis_data *frame_buffer;
status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
frame_index,
(void **)&frame_header);
if (status != SCI_SUCCESS) {
dev_err(scic_to_dev(scic),
dev_err(&ihost->pdev->dev,
"%s: SCIC IO Request 0x%p could not get frame "
"header for frame index %d, status %x\n",
__func__,
@ -1792,7 +1791,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
}
if (frame_header->fis_type != FIS_DATA) {
dev_err(scic_to_dev(scic),
dev_err(&ihost->pdev->dev,
"%s: SCIC PIO Request 0x%p received frame %d "
"with fis type 0x%02x when expecting a data "
"fis.\n",
@ -1808,7 +1807,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);
/* Frame is decoded return it to the controller */
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
return status;
}
@ -1816,7 +1815,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
ireq->saved_rx_frame_index = frame_index;
stp_req->pio_len = 0;
} else {
scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
frame_index,
(void **)&frame_buffer);
@ -1824,7 +1823,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
(u8 *)frame_buffer);
/* Frame is decoded return it to the controller */
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
}
/* Check for the end of the transfer, are there more
@ -1849,11 +1848,11 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
struct dev_to_host_fis *frame_header;
u32 *frame_buffer;
status = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control,
status = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
frame_index,
(void **)&frame_header);
if (status != SCI_SUCCESS) {
dev_err(scic_to_dev(scic),
dev_err(&ihost->pdev->dev,
"%s: SCIC IO Request 0x%p could not get frame "
"header for frame index %d, status %x\n",
__func__,
@ -1865,7 +1864,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
switch (frame_header->fis_type) {
case FIS_REGD2H:
scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control,
scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
frame_index,
(void **)&frame_buffer);
@ -1880,7 +1879,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
break;
default:
dev_warn(scic_to_dev(scic),
dev_warn(&ihost->pdev->dev,
"%s: IO Request:0x%p Frame Id:%d protocol "
"violation occurred\n",
__func__,
@ -1896,7 +1895,7 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);
/* Frame has been decoded return it to the controller */
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
return status;
}
@ -1905,18 +1904,18 @@ scic_sds_io_request_frame_handler(struct isci_request *ireq,
* TODO: Is it even possible to get an unsolicited frame in the
* aborting state?
*/
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
return SCI_SUCCESS;
default:
dev_warn(scic_to_dev(scic),
dev_warn(&ihost->pdev->dev,
"%s: SCIC IO Request given unexpected frame %x while "
"in state %d\n",
__func__,
frame_index,
state);
scic_sds_controller_release_frame(scic, frame_index);
scic_sds_controller_release_frame(ihost, frame_index);
return SCI_FAILURE_INVALID_STATE;
}
}
@ -2042,7 +2041,7 @@ scic_sds_io_request_tc_completion(struct isci_request *ireq,
u32 completion_code)
{
enum sci_base_request_states state;
struct scic_sds_controller *scic = ireq->owning_controller;
struct isci_host *ihost = ireq->owning_controller;
state = ireq->sm.current_state_id;
@ -2089,7 +2088,7 @@ scic_sds_io_request_tc_completion(struct isci_request *ireq,
completion_code);
default:
dev_warn(scic_to_dev(scic),
dev_warn(&ihost->pdev->dev,
"%s: SCIC IO Request given task completion "
"notification %x while in wrong state %d\n",
__func__,
@ -2480,7 +2479,7 @@ static void isci_task_save_for_upper_layer_completion(
}
}
static void isci_request_io_request_complete(struct isci_host *isci_host,
static void isci_request_io_request_complete(struct isci_host *ihost,
struct isci_request *request,
enum sci_io_status completion_status)
{
@ -2495,7 +2494,7 @@ static void isci_request_io_request_complete(struct isci_host *isci_host,
enum isci_completion_selection complete_to_host
= isci_perform_normal_io_completion;
dev_dbg(&isci_host->pdev->dev,
dev_dbg(&ihost->pdev->dev,
"%s: request = %p, task = %p,\n"
"task->data_dir = %d completion_status = 0x%x\n",
__func__,
@ -2616,7 +2615,7 @@ static void isci_request_io_request_complete(struct isci_host *isci_host,
switch (completion_status) {
case SCI_IO_FAILURE_RESPONSE_VALID:
dev_dbg(&isci_host->pdev->dev,
dev_dbg(&ihost->pdev->dev,
"%s: SCI_IO_FAILURE_RESPONSE_VALID (%p/%p)\n",
__func__,
request,
@ -2631,17 +2630,17 @@ static void isci_request_io_request_complete(struct isci_host *isci_host,
/* crack the iu response buffer. */
resp_iu = &request->ssp.rsp;
isci_request_process_response_iu(task, resp_iu,
&isci_host->pdev->dev);
&ihost->pdev->dev);
} else if (SAS_PROTOCOL_SMP == task->task_proto) {
dev_err(&isci_host->pdev->dev,
dev_err(&ihost->pdev->dev,
"%s: SCI_IO_FAILURE_RESPONSE_VALID: "
"SAS_PROTOCOL_SMP protocol\n",
__func__);
} else
dev_err(&isci_host->pdev->dev,
dev_err(&ihost->pdev->dev,
"%s: unknown protocol\n", __func__);
/* use the task status set in the task struct by the
@ -2662,7 +2661,7 @@ static void isci_request_io_request_complete(struct isci_host *isci_host,
if (task->task_proto == SAS_PROTOCOL_SMP) {
void *rsp = &request->smp.rsp;
dev_dbg(&isci_host->pdev->dev,
dev_dbg(&ihost->pdev->dev,
"%s: SMP protocol completion\n",
__func__);
@ -2687,20 +2686,20 @@ static void isci_request_io_request_complete(struct isci_host *isci_host,
if (task->task_status.residual != 0)
status = SAS_DATA_UNDERRUN;
dev_dbg(&isci_host->pdev->dev,
dev_dbg(&ihost->pdev->dev,
"%s: SCI_IO_SUCCESS_IO_DONE_EARLY %d\n",
__func__,
status);
} else
dev_dbg(&isci_host->pdev->dev,
dev_dbg(&ihost->pdev->dev,
"%s: SCI_IO_SUCCESS\n",
__func__);
break;
case SCI_IO_FAILURE_TERMINATED:
dev_dbg(&isci_host->pdev->dev,
dev_dbg(&ihost->pdev->dev,
"%s: SCI_IO_FAILURE_TERMINATED (%p/%p)\n",
__func__,
request,
@ -2768,7 +2767,7 @@ static void isci_request_io_request_complete(struct isci_host *isci_host,
default:
/* Catch any otherwise unhandled error codes here. */
dev_warn(&isci_host->pdev->dev,
dev_warn(&ihost->pdev->dev,
"%s: invalid completion code: 0x%x - "
"isci_request = %p\n",
__func__, completion_status, request);
@ -2802,11 +2801,11 @@ static void isci_request_io_request_complete(struct isci_host *isci_host,
break;
if (task->num_scatter == 0)
/* 0 indicates a single dma address */
dma_unmap_single(&isci_host->pdev->dev,
dma_unmap_single(&ihost->pdev->dev,
request->zero_scatter_daddr,
task->total_xfer_len, task->data_dir);
else /* unmap the sgl dma addresses */
dma_unmap_sg(&isci_host->pdev->dev, task->scatter,
dma_unmap_sg(&ihost->pdev->dev, task->scatter,
request->num_sg_entries, task->data_dir);
break;
case SAS_PROTOCOL_SMP: {
@ -2814,7 +2813,7 @@ static void isci_request_io_request_complete(struct isci_host *isci_host,
struct smp_req *smp_req;
void *kaddr;
dma_unmap_sg(&isci_host->pdev->dev, sg, 1, DMA_TO_DEVICE);
dma_unmap_sg(&ihost->pdev->dev, sg, 1, DMA_TO_DEVICE);
/* need to swab it back in case the command buffer is re-used */
kaddr = kmap_atomic(sg_page(sg), KM_IRQ0);
@ -2828,14 +2827,12 @@ static void isci_request_io_request_complete(struct isci_host *isci_host,
}
/* Put the completed request on the correct list */
isci_task_save_for_upper_layer_completion(isci_host, request, response,
isci_task_save_for_upper_layer_completion(ihost, request, response,
status, complete_to_host
);
/* complete the io request to the core. */
scic_controller_complete_io(&isci_host->sci,
request->target_device,
request);
scic_controller_complete_io(ihost, request->target_device, request);
isci_put_device(idev);
/* set terminated handle so it cannot be completed or
@ -2885,8 +2882,7 @@ static void scic_sds_request_started_state_enter(struct sci_base_state_machine *
static void scic_sds_request_completed_state_enter(struct sci_base_state_machine *sm)
{
struct isci_request *ireq = container_of(sm, typeof(*ireq), sm);
struct scic_sds_controller *scic = ireq->owning_controller;
struct isci_host *ihost = scic_to_ihost(scic);
struct isci_host *ihost = ireq->owning_controller;
/* Tell the SCI_USER that the IO request is complete */
if (!test_bit(IREQ_TMF, &ireq->flags))
@ -2985,7 +2981,7 @@ static const struct sci_base_state scic_sds_request_state_table[] = {
};
static void
scic_sds_general_request_construct(struct scic_sds_controller *scic,
scic_sds_general_request_construct(struct isci_host *ihost,
struct isci_remote_device *idev,
struct isci_request *ireq)
{
@ -3001,7 +2997,7 @@ scic_sds_general_request_construct(struct scic_sds_controller *scic,
}
static enum sci_status
scic_io_request_construct(struct scic_sds_controller *scic,
scic_io_request_construct(struct isci_host *ihost,
struct isci_remote_device *idev,
struct isci_request *ireq)
{
@ -3009,7 +3005,7 @@ scic_io_request_construct(struct scic_sds_controller *scic,
enum sci_status status = SCI_SUCCESS;
/* Build the common part of the request */
scic_sds_general_request_construct(scic, idev, ireq);
scic_sds_general_request_construct(ihost, idev, ireq);
if (idev->rnc.remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX)
return SCI_FAILURE_INVALID_REMOTE_DEVICE;
@ -3028,7 +3024,7 @@ scic_io_request_construct(struct scic_sds_controller *scic,
return status;
}
enum sci_status scic_task_request_construct(struct scic_sds_controller *scic,
enum sci_status scic_task_request_construct(struct isci_host *ihost,
struct isci_remote_device *idev,
u16 io_tag, struct isci_request *ireq)
{
@ -3036,7 +3032,7 @@ enum sci_status scic_task_request_construct(struct scic_sds_controller *scic,
enum sci_status status = SCI_SUCCESS;
/* Build the common part of the request */
scic_sds_general_request_construct(scic, idev, ireq);
scic_sds_general_request_construct(ihost, idev, ireq);
if (dev->dev_type == SAS_END_DEV ||
dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) {
@ -3156,7 +3152,7 @@ scic_io_request_construct_smp(struct device *dev,
task_context->initiator_request = 1;
task_context->connection_rate = idev->connection_rate;
task_context->protocol_engine_index =
scic_sds_controller_get_protocol_engine_group(scic);
scic_sds_controller_get_protocol_engine_group(ihost);
task_context->logical_port_index = scic_sds_port_get_index(iport);
task_context->protocol_type = SCU_TASK_CONTEXT_PROTOCOL_SMP;
task_context->abort = 0;
@ -3199,7 +3195,7 @@ scic_io_request_construct_smp(struct device *dev,
task_context->task_phase = 0;
ireq->post_context = (SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC |
(scic_sds_controller_get_protocol_engine_group(scic) <<
(scic_sds_controller_get_protocol_engine_group(ihost) <<
SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) |
(scic_sds_port_get_index(iport) <<
SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) |
@ -3245,7 +3241,7 @@ static enum sci_status isci_smp_request_build(struct isci_request *ireq)
/**
* isci_io_request_build() - This function builds the io request object.
* @isci_host: This parameter specifies the ISCI host object
* @ihost: This parameter specifies the ISCI host object
* @request: This parameter points to the isci_request object allocated in the
* request construct function.
* @sci_device: This parameter is the handle for the sci core's remote device
@ -3253,14 +3249,14 @@ static enum sci_status isci_smp_request_build(struct isci_request *ireq)
*
* SCI_SUCCESS on successfull completion, or specific failure code.
*/
static enum sci_status isci_io_request_build(struct isci_host *isci_host,
static enum sci_status isci_io_request_build(struct isci_host *ihost,
struct isci_request *request,
struct isci_remote_device *idev)
{
enum sci_status status = SCI_SUCCESS;
struct sas_task *task = isci_request_access_task(request);
dev_dbg(&isci_host->pdev->dev,
dev_dbg(&ihost->pdev->dev,
"%s: idev = 0x%p; request = %p, "
"num_scatter = %d\n",
__func__,
@ -3277,7 +3273,7 @@ static enum sci_status isci_io_request_build(struct isci_host *isci_host,
!(SAS_PROTOCOL_SMP & task->task_proto)) {
request->num_sg_entries = dma_map_sg(
&isci_host->pdev->dev,
&ihost->pdev->dev,
task->scatter,
task->num_scatter,
task->data_dir
@ -3287,10 +3283,10 @@ static enum sci_status isci_io_request_build(struct isci_host *isci_host,
return SCI_FAILURE_INSUFFICIENT_RESOURCES;
}
status = scic_io_request_construct(&isci_host->sci, idev, request);
status = scic_io_request_construct(ihost, idev, request);
if (status != SCI_SUCCESS) {
dev_warn(&isci_host->pdev->dev,
dev_warn(&ihost->pdev->dev,
"%s: failed request construct\n",
__func__);
return SCI_FAILURE;
@ -3309,7 +3305,7 @@ static enum sci_status isci_io_request_build(struct isci_host *isci_host,
status = isci_request_stp_request_construct(request);
break;
default:
dev_warn(&isci_host->pdev->dev,
dev_warn(&ihost->pdev->dev,
"%s: unknown protocol\n", __func__);
return SCI_FAILURE;
}
@ -3392,7 +3388,7 @@ int isci_request_execute(struct isci_host *ihost, struct isci_remote_device *ide
* request was built that way (ie.
* ireq->is_task_management_request is false).
*/
status = scic_controller_start_task(&ihost->sci,
status = scic_controller_start_task(ihost,
idev,
ireq);
} else {
@ -3400,7 +3396,7 @@ int isci_request_execute(struct isci_host *ihost, struct isci_remote_device *ide
}
} else {
/* send the request, let the core assign the IO TAG. */
status = scic_controller_start_io(&ihost->sci, idev,
status = scic_controller_start_io(ihost, idev,
ireq);
}

View File

@ -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);

View File

@ -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.
*/

View File

@ -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;

View File

@ -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,