summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/host.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-06-30 19:14:33 -0700
committerDan Williams <dan.j.williams@intel.com>2011-07-03 04:04:52 -0700
commit89a7301f21fb00e753089671eb9e4132aab8ea08 (patch)
treeafa8bac0a36d0d5626997d8995f6c9194aef3a0f /drivers/scsi/isci/host.c
parentd9dcb4ba791de2a06b19ac47cd61601cf3d4e208 (diff)
isci: retire scic_sds_ and scic_ prefixes
The distinction between scic_sds_ scic_ and sci_ are no longer relevant so just unify the prefixes on sci_. The distinction between isci_ and sci_ is historically significant, and useful for comparing the old 'core' to the current Linux driver. 'sci_' represents the former core as well as the routines that are closer to the hardware and protocol than their 'isci_' brethren. sci == sas controller interface. Also unwind the 'sds1' out of the parameter structs. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/host.c')
-rw-r--r--drivers/scsi/isci/host.c742
1 files changed, 281 insertions, 461 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c
index bb298f8f609a..f31f64e4b713 100644
--- a/drivers/scsi/isci/host.c
+++ b/drivers/scsi/isci/host.c
@@ -180,8 +180,7 @@ void sci_change_state(struct sci_base_state_machine *sm, u32 next_state)
handler(sm);
}
-static bool scic_sds_controller_completion_queue_has_entries(
- struct isci_host *ihost)
+static bool sci_controller_completion_queue_has_entries(struct isci_host *ihost)
{
u32 get_value = ihost->completion_queue_get;
u32 get_index = get_value & SMU_COMPLETION_QUEUE_GET_POINTER_MASK;
@@ -193,9 +192,9 @@ static bool scic_sds_controller_completion_queue_has_entries(
return false;
}
-static bool scic_sds_controller_isr(struct isci_host *ihost)
+static bool sci_controller_isr(struct isci_host *ihost)
{
- if (scic_sds_controller_completion_queue_has_entries(ihost)) {
+ if (sci_controller_completion_queue_has_entries(ihost)) {
return true;
} else {
/*
@@ -219,13 +218,13 @@ irqreturn_t isci_msix_isr(int vec, void *data)
{
struct isci_host *ihost = data;
- if (scic_sds_controller_isr(ihost))
+ if (sci_controller_isr(ihost))
tasklet_schedule(&ihost->completion_tasklet);
return IRQ_HANDLED;
}
-static bool scic_sds_controller_error_isr(struct isci_host *ihost)
+static bool sci_controller_error_isr(struct isci_host *ihost)
{
u32 interrupt_status;
@@ -252,35 +251,35 @@ static bool scic_sds_controller_error_isr(struct isci_host *ihost)
return false;
}
-static void scic_sds_controller_task_completion(struct isci_host *ihost,
- u32 completion_entry)
+static void sci_controller_task_completion(struct isci_host *ihost, u32 ent)
{
- u32 index = SCU_GET_COMPLETION_INDEX(completion_entry);
+ u32 index = SCU_GET_COMPLETION_INDEX(ent);
struct isci_request *ireq = ihost->reqs[index];
/* Make sure that we really want to process this IO request */
if (test_bit(IREQ_ACTIVE, &ireq->flags) &&
ireq->io_tag != SCI_CONTROLLER_INVALID_IO_TAG &&
ISCI_TAG_SEQ(ireq->io_tag) == ihost->io_request_sequence[index])
- /* Yep this is a valid io request pass it along to the io request handler */
- scic_sds_io_request_tc_completion(ireq, completion_entry);
+ /* Yep this is a valid io request pass it along to the
+ * io request handler
+ */
+ sci_io_request_tc_completion(ireq, ent);
}
-static void scic_sds_controller_sdma_completion(struct isci_host *ihost,
- u32 completion_entry)
+static void sci_controller_sdma_completion(struct isci_host *ihost, u32 ent)
{
u32 index;
struct isci_request *ireq;
struct isci_remote_device *idev;
- index = SCU_GET_COMPLETION_INDEX(completion_entry);
+ index = SCU_GET_COMPLETION_INDEX(ent);
- switch (scu_get_command_request_type(completion_entry)) {
+ switch (scu_get_command_request_type(ent)) {
case SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC:
case SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_TC:
ireq = ihost->reqs[index];
dev_warn(&ihost->pdev->dev, "%s: %x for io request %p\n",
- __func__, completion_entry, ireq);
+ __func__, ent, ireq);
/* @todo For a post TC operation we need to fail the IO
* request
*/
@@ -290,20 +289,19 @@ static void scic_sds_controller_sdma_completion(struct isci_host *ihost,
case SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_RNC:
idev = ihost->device_table[index];
dev_warn(&ihost->pdev->dev, "%s: %x for device %p\n",
- __func__, completion_entry, idev);
+ __func__, ent, idev);
/* @todo For a port RNC operation we need to fail the
* device
*/
break;
default:
dev_warn(&ihost->pdev->dev, "%s: unknown completion type %x\n",
- __func__, completion_entry);
+ __func__, ent);
break;
}
}
-static void scic_sds_controller_unsolicited_frame(struct isci_host *ihost,
- u32 completion_entry)
+static void sci_controller_unsolicited_frame(struct isci_host *ihost, u32 ent)
{
u32 index;
u32 frame_index;
@@ -314,36 +312,36 @@ static void scic_sds_controller_unsolicited_frame(struct isci_host *ihost,
enum sci_status result = SCI_FAILURE;
- frame_index = SCU_GET_FRAME_INDEX(completion_entry);
+ frame_index = SCU_GET_FRAME_INDEX(ent);
frame_header = ihost->uf_control.buffers.array[frame_index].header;
ihost->uf_control.buffers.array[frame_index].state = UNSOLICITED_FRAME_IN_USE;
- if (SCU_GET_FRAME_ERROR(completion_entry)) {
+ if (SCU_GET_FRAME_ERROR(ent)) {
/*
* / @todo If the IAF frame or SIGNATURE FIS frame has an error will
* / this cause a problem? We expect the phy initialization will
* / fail if there is an error in the frame. */
- scic_sds_controller_release_frame(ihost, frame_index);
+ sci_controller_release_frame(ihost, frame_index);
return;
}
if (frame_header->is_address_frame) {
- index = SCU_GET_PROTOCOL_ENGINE_INDEX(completion_entry);
+ index = SCU_GET_PROTOCOL_ENGINE_INDEX(ent);
iphy = &ihost->phys[index];
- result = scic_sds_phy_frame_handler(iphy, frame_index);
+ result = sci_phy_frame_handler(iphy, frame_index);
} else {
- index = SCU_GET_COMPLETION_INDEX(completion_entry);
+ index = SCU_GET_COMPLETION_INDEX(ent);
if (index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) {
/*
* This is a signature fis or a frame from a direct attached SATA
* device that has not yet been created. In either case forwared
* the frame to the PE and let it take care of the frame data. */
- index = SCU_GET_PROTOCOL_ENGINE_INDEX(completion_entry);
+ index = SCU_GET_PROTOCOL_ENGINE_INDEX(ent);
iphy = &ihost->phys[index];
- result = scic_sds_phy_frame_handler(iphy, frame_index);
+ result = sci_phy_frame_handler(iphy, frame_index);
} else {
if (index < ihost->remote_node_entries)
idev = ihost->device_table[index];
@@ -351,9 +349,9 @@ static void scic_sds_controller_unsolicited_frame(struct isci_host *ihost,
idev = NULL;
if (idev != NULL)
- result = scic_sds_remote_device_frame_handler(idev, frame_index);
+ result = sci_remote_device_frame_handler(idev, frame_index);
else
- scic_sds_controller_release_frame(ihost, frame_index);
+ sci_controller_release_frame(ihost, frame_index);
}
}
@@ -364,17 +362,16 @@ static void scic_sds_controller_unsolicited_frame(struct isci_host *ihost,
}
}
-static void scic_sds_controller_event_completion(struct isci_host *ihost,
- u32 completion_entry)
+static void sci_controller_event_completion(struct isci_host *ihost, u32 ent)
{
struct isci_remote_device *idev;
struct isci_request *ireq;
struct isci_phy *iphy;
u32 index;
- index = SCU_GET_COMPLETION_INDEX(completion_entry);
+ index = SCU_GET_COMPLETION_INDEX(ent);
- switch (scu_get_event_type(completion_entry)) {
+ switch (scu_get_event_type(ent)) {
case SCU_EVENT_TYPE_SMU_COMMAND_ERROR:
/* / @todo The driver did something wrong and we need to fix the condtion. */
dev_err(&ihost->pdev->dev,
@@ -382,7 +379,7 @@ static void scic_sds_controller_event_completion(struct isci_host *ihost,
"0x%x\n",
__func__,
ihost,
- completion_entry);
+ ent);
break;
case SCU_EVENT_TYPE_SMU_PCQ_ERROR:
@@ -396,21 +393,21 @@ static void scic_sds_controller_event_completion(struct isci_host *ihost,
"event 0x%x\n",
__func__,
ihost,
- completion_entry);
+ ent);
break;
case SCU_EVENT_TYPE_TRANSPORT_ERROR:
ireq = ihost->reqs[index];
- scic_sds_io_request_event_handler(ireq, completion_entry);
+ sci_io_request_event_handler(ireq, ent);
break;
case SCU_EVENT_TYPE_PTX_SCHEDULE_EVENT:
- switch (scu_get_event_specifier(completion_entry)) {
+ switch (scu_get_event_specifier(ent)) {
case SCU_EVENT_SPECIFIC_SMP_RESPONSE_NO_PE:
case SCU_EVENT_SPECIFIC_TASK_TIMEOUT:
ireq = ihost->reqs[index];
if (ireq != NULL)
- scic_sds_io_request_event_handler(ireq, completion_entry);
+ sci_io_request_event_handler(ireq, ent);
else
dev_warn(&ihost->pdev->dev,
"%s: SCIC Controller 0x%p received "
@@ -418,14 +415,14 @@ static void scic_sds_controller_event_completion(struct isci_host *ihost,
"that doesnt exist.\n",
__func__,
ihost,
- completion_entry);
+ ent);
break;
case SCU_EVENT_SPECIFIC_IT_NEXUS_TIMEOUT:
idev = ihost->device_table[index];
if (idev != NULL)
- scic_sds_remote_device_event_handler(idev, completion_entry);
+ sci_remote_device_event_handler(idev, ent);
else
dev_warn(&ihost->pdev->dev,
"%s: SCIC Controller 0x%p received "
@@ -433,7 +430,7 @@ static void scic_sds_controller_event_completion(struct isci_host *ihost,
"that doesnt exist.\n",
__func__,
ihost,
- completion_entry);
+ ent);
break;
}
@@ -448,9 +445,9 @@ static void scic_sds_controller_event_completion(struct isci_host *ihost,
* direct error counter event to the phy object since that is where
* we get the event notification. This is a type 4 event. */
case SCU_EVENT_TYPE_OSSP_EVENT:
- index = SCU_GET_PROTOCOL_ENGINE_INDEX(completion_entry);
+ index = SCU_GET_PROTOCOL_ENGINE_INDEX(ent);
iphy = &ihost->phys[index];
- scic_sds_phy_event_handler(iphy, completion_entry);
+ sci_phy_event_handler(iphy, ent);
break;
case SCU_EVENT_TYPE_RNC_SUSPEND_TX:
@@ -460,7 +457,7 @@ static void scic_sds_controller_event_completion(struct isci_host *ihost,
idev = ihost->device_table[index];
if (idev != NULL)
- scic_sds_remote_device_event_handler(idev, completion_entry);
+ sci_remote_device_event_handler(idev, ent);
} else
dev_err(&ihost->pdev->dev,
"%s: SCIC Controller 0x%p received event 0x%x "
@@ -468,7 +465,7 @@ static void scic_sds_controller_event_completion(struct isci_host *ihost,
"exist.\n",
__func__,
ihost,
- completion_entry,
+ ent,
index);
break;
@@ -477,15 +474,15 @@ static void scic_sds_controller_event_completion(struct isci_host *ihost,
dev_warn(&ihost->pdev->dev,
"%s: SCIC Controller received unknown event code %x\n",
__func__,
- completion_entry);
+ ent);
break;
}
}
-static void scic_sds_controller_process_completions(struct isci_host *ihost)
+static void sci_controller_process_completions(struct isci_host *ihost)
{
u32 completion_count = 0;
- u32 completion_entry;
+ u32 ent;
u32 get_index;
u32 get_cycle;
u32 event_get;
@@ -509,7 +506,7 @@ static void scic_sds_controller_process_completions(struct isci_host *ihost)
) {
completion_count++;
- completion_entry = ihost->completion_queue[get_index];
+ ent = ihost->completion_queue[get_index];
/* increment the get pointer and check for rollover to toggle the cycle bit */
get_cycle ^= ((get_index+1) & SCU_MAX_COMPLETION_QUEUE_ENTRIES) <<
@@ -519,19 +516,19 @@ static void scic_sds_controller_process_completions(struct isci_host *ihost)
dev_dbg(&ihost->pdev->dev,
"%s: completion queue entry:0x%08x\n",
__func__,
- completion_entry);
+ ent);
- switch (SCU_GET_COMPLETION_TYPE(completion_entry)) {
+ switch (SCU_GET_COMPLETION_TYPE(ent)) {
case SCU_COMPLETION_TYPE_TASK:
- scic_sds_controller_task_completion(ihost, completion_entry);
+ sci_controller_task_completion(ihost, ent);
break;
case SCU_COMPLETION_TYPE_SDMA:
- scic_sds_controller_sdma_completion(ihost, completion_entry);
+ sci_controller_sdma_completion(ihost, ent);
break;
case SCU_COMPLETION_TYPE_UFI:
- scic_sds_controller_unsolicited_frame(ihost, completion_entry);
+ sci_controller_unsolicited_frame(ihost, ent);
break;
case SCU_COMPLETION_TYPE_EVENT:
@@ -540,7 +537,7 @@ static void scic_sds_controller_process_completions(struct isci_host *ihost)
(SMU_COMPLETION_QUEUE_GET_EVENT_CYCLE_BIT_SHIFT - SCU_MAX_EVENTS_SHIFT);
event_get = (event_get+1) & (SCU_MAX_EVENTS-1);
- scic_sds_controller_event_completion(ihost, completion_entry);
+ sci_controller_event_completion(ihost, ent);
break;
}
default:
@@ -548,7 +545,7 @@ static void scic_sds_controller_process_completions(struct isci_host *ihost)
"%s: SCIC Controller received unknown "
"completion type %x\n",
__func__,
- completion_entry);
+ ent);
break;
}
}
@@ -575,7 +572,7 @@ static void scic_sds_controller_process_completions(struct isci_host *ihost)
}
-static void scic_sds_controller_error_handler(struct isci_host *ihost)
+static void sci_controller_error_handler(struct isci_host *ihost)
{
u32 interrupt_status;
@@ -583,9 +580,9 @@ static void scic_sds_controller_error_handler(struct isci_host *ihost)
readl(&ihost->smu_registers->interrupt_status);
if ((interrupt_status & SMU_ISR_QUEUE_SUSPEND) &&
- scic_sds_controller_completion_queue_has_entries(ihost)) {
+ sci_controller_completion_queue_has_entries(ihost)) {
- scic_sds_controller_process_completions(ihost);
+ sci_controller_process_completions(ihost);
writel(SMU_ISR_QUEUE_SUSPEND, &ihost->smu_registers->interrupt_status);
} else {
dev_err(&ihost->pdev->dev, "%s: status: %#x\n", __func__,
@@ -607,13 +604,13 @@ irqreturn_t isci_intx_isr(int vec, void *data)
irqreturn_t ret = IRQ_NONE;
struct isci_host *ihost = data;
- if (scic_sds_controller_isr(ihost)) {
+ if (sci_controller_isr(ihost)) {
writel(SMU_ISR_COMPLETION, &ihost->smu_registers->interrupt_status);
tasklet_schedule(&ihost->completion_tasklet);
ret = IRQ_HANDLED;
- } else if (scic_sds_controller_error_isr(ihost)) {
+ } else if (sci_controller_error_isr(ihost)) {
spin_lock(&ihost->scic_lock);
- scic_sds_controller_error_handler(ihost);
+ sci_controller_error_handler(ihost);
spin_unlock(&ihost->scic_lock);
ret = IRQ_HANDLED;
}
@@ -625,8 +622,8 @@ irqreturn_t isci_error_isr(int vec, void *data)
{
struct isci_host *ihost = data;
- if (scic_sds_controller_error_isr(ihost))
- scic_sds_controller_error_handler(ihost);
+ if (sci_controller_error_isr(ihost))
+ sci_controller_error_handler(ihost);
return IRQ_HANDLED;
}
@@ -670,8 +667,8 @@ int isci_host_scan_finished(struct Scsi_Host *shost, unsigned long time)
}
/**
- * scic_controller_get_suggested_start_timeout() - This method returns the
- * suggested scic_controller_start() timeout amount. The user is free to
+ * sci_controller_get_suggested_start_timeout() - This method returns the
+ * suggested sci_controller_start() timeout amount. The user is free to
* use any timeout value, but this method provides the suggested minimum
* start timeout value. The returned value is based upon empirical
* information determined as a result of interoperability testing.
@@ -681,7 +678,7 @@ int isci_host_scan_finished(struct Scsi_Host *shost, unsigned long time)
* This method returns the number of milliseconds for the suggested start
* operation timeout.
*/
-static u32 scic_controller_get_suggested_start_timeout(struct isci_host *ihost)
+static u32 sci_controller_get_suggested_start_timeout(struct isci_host *ihost)
{
/* Validate the user supplied parameters. */
if (!ihost)
@@ -706,19 +703,19 @@ static u32 scic_controller_get_suggested_start_timeout(struct isci_host *ihost)
+ ((SCI_MAX_PHYS - 1) * SCIC_SDS_CONTROLLER_POWER_CONTROL_INTERVAL);
}
-static void scic_controller_enable_interrupts(struct isci_host *ihost)
+static void sci_controller_enable_interrupts(struct isci_host *ihost)
{
BUG_ON(ihost->smu_registers == NULL);
writel(0, &ihost->smu_registers->interrupt_mask);
}
-void scic_controller_disable_interrupts(struct isci_host *ihost)
+void sci_controller_disable_interrupts(struct isci_host *ihost)
{
BUG_ON(ihost->smu_registers == NULL);
writel(0xffffffff, &ihost->smu_registers->interrupt_mask);
}
-static void scic_sds_controller_enable_port_task_scheduler(struct isci_host *ihost)
+static void sci_controller_enable_port_task_scheduler(struct isci_host *ihost)
{
u32 port_task_scheduler_value;
@@ -731,7 +728,7 @@ static void scic_sds_controller_enable_port_task_scheduler(struct isci_host *iho
&ihost->scu_registers->peg0.ptsg.control);
}
-static void scic_sds_controller_assign_task_entries(struct isci_host *ihost)
+static void sci_controller_assign_task_entries(struct isci_host *ihost)
{
u32 task_assignment;
@@ -752,7 +749,7 @@ static void scic_sds_controller_assign_task_entries(struct isci_host *ihost)
}
-static void scic_sds_controller_initialize_completion_queue(struct isci_host *ihost)
+static void sci_controller_initialize_completion_queue(struct isci_host *ihost)
{
u32 index;
u32 completion_queue_control_value;
@@ -799,7 +796,7 @@ static void scic_sds_controller_initialize_completion_queue(struct isci_host *ih
}
}
-static void scic_sds_controller_initialize_unsolicited_frame_queue(struct isci_host *ihost)
+static void sci_controller_initialize_unsolicited_frame_queue(struct isci_host *ihost)
{
u32 frame_queue_control_value;
u32 frame_queue_get_value;
@@ -826,22 +823,8 @@ static void scic_sds_controller_initialize_unsolicited_frame_queue(struct isci_h
&ihost->scu_registers->sdma.unsolicited_frame_put_pointer);
}
-/**
- * This method will attempt to transition into the ready state for the
- * controller and indicate that the controller start operation has completed
- * if all criteria are met.
- * @scic: This parameter indicates the controller object for which
- * to transition to ready.
- * @status: This parameter indicates the status value to be pass into the call
- * to scic_cb_controller_start_complete().
- *
- * none.
- */
-static void scic_sds_controller_transition_to_ready(
- struct isci_host *ihost,
- enum sci_status status)
+static void sci_controller_transition_to_ready(struct isci_host *ihost, enum sci_status status)
{
-
if (ihost->sm.current_state_id == SCIC_STARTING) {
/*
* We move into the ready state, because some of the phys/ports
@@ -855,7 +838,7 @@ static void scic_sds_controller_transition_to_ready(
static bool is_phy_starting(struct isci_phy *iphy)
{
- enum scic_sds_phy_states state;
+ enum sci_phy_states state;
state = iphy->sm.current_state_id;
switch (state) {
@@ -876,16 +859,16 @@ static bool is_phy_starting(struct isci_phy *iphy)
}
/**
- * scic_sds_controller_start_next_phy - start phy
+ * sci_controller_start_next_phy - start phy
* @scic: controller
*
* If all the phys have been started, then attempt to transition the
* controller to the READY state and inform the user
- * (scic_cb_controller_start_complete()).
+ * (sci_cb_controller_start_complete()).
*/
-static enum sci_status scic_sds_controller_start_next_phy(struct isci_host *ihost)
+static enum sci_status sci_controller_start_next_phy(struct isci_host *ihost)
{
- struct scic_sds_oem_params *oem = &ihost->oem_parameters.sds1;
+ struct sci_oem_params *oem = &ihost->oem_parameters;
struct isci_phy *iphy;
enum sci_status status;
@@ -924,7 +907,7 @@ static enum sci_status scic_sds_controller_start_next_phy(struct isci_host *ihos
* The controller has successfully finished the start process.
* Inform the SCI Core user and transition to the READY state. */
if (is_controller_start_complete == true) {
- scic_sds_controller_transition_to_ready(ihost, SCI_SUCCESS);
+ sci_controller_transition_to_ready(ihost, SCI_SUCCESS);
sci_del_timer(&ihost->phy_timer);
ihost->phy_startup_timer_pending = false;
}
@@ -944,11 +927,11 @@ static enum sci_status scic_sds_controller_start_next_phy(struct isci_host *ihos
* incorrectly for the PORT or it was never
* assigned to a PORT
*/
- return scic_sds_controller_start_next_phy(ihost);
+ return sci_controller_start_next_phy(ihost);
}
}
- status = scic_sds_phy_start(iphy);
+ status = sci_phy_start(iphy);
if (status == SCI_SUCCESS) {
sci_mod_timer(&ihost->phy_timer,
@@ -985,7 +968,7 @@ static void phy_startup_timeout(unsigned long data)
ihost->phy_startup_timer_pending = false;
do {
- status = scic_sds_controller_start_next_phy(ihost);
+ status = sci_controller_start_next_phy(ihost);
} while (status != SCI_SUCCESS);
done:
@@ -997,7 +980,7 @@ static u16 isci_tci_active(struct isci_host *ihost)
return CIRC_CNT(ihost->tci_head, ihost->tci_tail, SCI_MAX_IO_REQUESTS);
}
-static enum sci_status scic_controller_start(struct isci_host *ihost,
+static enum sci_status sci_controller_start(struct isci_host *ihost,
u32 timeout)
{
enum sci_status result;
@@ -1018,38 +1001,37 @@ static enum sci_status scic_controller_start(struct isci_host *ihost,
isci_tci_free(ihost, index);
/* Build the RNi free pool */
- scic_sds_remote_node_table_initialize(
- &ihost->available_remote_nodes,
- ihost->remote_node_entries);
+ sci_remote_node_table_initialize(&ihost->available_remote_nodes,
+ ihost->remote_node_entries);
/*
* Before anything else lets make sure we will not be
* interrupted by the hardware.
*/
- scic_controller_disable_interrupts(ihost);
+ sci_controller_disable_interrupts(ihost);
/* Enable the port task scheduler */
- scic_sds_controller_enable_port_task_scheduler(ihost);
+ sci_controller_enable_port_task_scheduler(ihost);
/* Assign all the task entries to ihost physical function */
- scic_sds_controller_assign_task_entries(ihost);
+ sci_controller_assign_task_entries(ihost);
/* Now initialize the completion queue */
- scic_sds_controller_initialize_completion_queue(ihost);
+ sci_controller_initialize_completion_queue(ihost);
/* Initialize the unsolicited frame queue for use */
- scic_sds_controller_initialize_unsolicited_frame_queue(ihost);
+ sci_controller_initialize_unsolicited_frame_queue(ihost);
/* Start all of the ports on this controller */
for (index = 0; index < ihost->logical_port_entries; index++) {
struct isci_port *iport = &ihost->ports[index];
- result = scic_sds_port_start(iport);
+ result = sci_port_start(iport);
if (result)
return result;
}
- scic_sds_controller_start_next_phy(ihost);
+ sci_controller_start_next_phy(ihost);
sci_mod_timer(&ihost->timer, timeout);
@@ -1061,29 +1043,29 @@ static enum sci_status scic_controller_start(struct isci_host *ihost,
void isci_host_scan_start(struct Scsi_Host *shost)
{
struct isci_host *ihost = SHOST_TO_SAS_HA(shost)->lldd_ha;
- unsigned long tmo = scic_controller_get_suggested_start_timeout(ihost);
+ unsigned long tmo = sci_controller_get_suggested_start_timeout(ihost);
set_bit(IHOST_START_PENDING, &ihost->flags);
spin_lock_irq(&ihost->scic_lock);
- scic_controller_start(ihost, tmo);
- scic_controller_enable_interrupts(ihost);
+ sci_controller_start(ihost, tmo);
+ sci_controller_enable_interrupts(ihost);
spin_unlock_irq(&ihost->scic_lock);
}
static void isci_host_stop_complete(struct isci_host *ihost, enum sci_status completion_status)
{
isci_host_change_state(ihost, isci_stopped);
- scic_controller_disable_interrupts(ihost);
+ sci_controller_disable_interrupts(ihost);
clear_bit(IHOST_STOP_PENDING, &ihost->flags);
wake_up(&ihost->eventq);
}
-static void scic_sds_controller_completion_handler(struct isci_host *ihost)
+static void sci_controller_completion_handler(struct isci_host *ihost)
{
/* Empty out the completion queue */
- if (scic_sds_controller_completion_queue_has_entries(ihost))
- scic_sds_controller_process_completions(ihost);
+ if (sci_controller_completion_queue_has_entries(ihost))
+ sci_controller_process_completions(ihost);
/* Clear the interrupt and enable all interrupts again */
writel(SMU_ISR_COMPLETION, &ihost->smu_registers->interrupt_status);
@@ -1116,7 +1098,7 @@ static void isci_host_completion_routine(unsigned long data)
spin_lock_irq(&ihost->scic_lock);
- scic_sds_controller_completion_handler(ihost);
+ sci_controller_completion_handler(ihost);
/* Take the lists of completed I/Os from the host. */
@@ -1203,7 +1185,7 @@ static void isci_host_completion_routine(unsigned long data)
}
/**
- * scic_controller_stop() - This method will stop an individual controller
+ * sci_controller_stop() - This method will stop an individual controller
* object.This method will invoke the associated user callback upon
* completion. The completion callback is called when the following
* conditions are met: -# the method return status is SCI_SUCCESS. -# the
@@ -1220,8 +1202,7 @@ static void isci_host_completion_routine(unsigned long data)
* controller is already in the STOPPED state. SCI_FAILURE_INVALID_STATE if the
* controller is not either in the STARTED or STOPPED states.
*/
-static enum sci_status scic_controller_stop(struct isci_host *ihost,
- u32 timeout)
+static enum sci_status sci_controller_stop(struct isci_host *ihost, u32 timeout)
{
if (ihost->sm.current_state_id != SCIC_READY) {
dev_warn(&ihost->pdev->dev,
@@ -1236,7 +1217,7 @@ static enum sci_status scic_controller_stop(struct isci_host *ihost,
}
/**
- * scic_controller_reset() - This method will reset the supplied core
+ * sci_controller_reset() - This method will reset the supplied core
* controller regardless of the state of said controller. This operation is
* considered destructive. In other words, all current operations are wiped
* out. No IO completions for outstanding devices occur. Outstanding IO
@@ -1247,7 +1228,7 @@ static enum sci_status scic_controller_stop(struct isci_host *ihost,
* SCI_SUCCESS if the reset operation successfully started. SCI_FATAL_ERROR if
* the controller reset operation is unable to complete.
*/
-static enum sci_status scic_controller_reset(struct isci_host *ihost)
+static enum sci_status sci_controller_reset(struct isci_host *ihost)
{
switch (ihost->sm.current_state_id) {
case SCIC_RESET:
@@ -1286,11 +1267,11 @@ void isci_host_deinit(struct isci_host *ihost)
set_bit(IHOST_STOP_PENDING, &ihost->flags);
spin_lock_irq(&ihost->scic_lock);
- scic_controller_stop(ihost, SCIC_CONTROLLER_STOP_TIMEOUT);
+ sci_controller_stop(ihost, SCIC_CONTROLLER_STOP_TIMEOUT);
spin_unlock_irq(&ihost->scic_lock);
wait_for_stop(ihost);
- scic_controller_reset(ihost);
+ sci_controller_reset(ihost);
/* Cancel any/all outstanding port timers */
for (i = 0; i < ihost->logical_port_entries; i++) {
@@ -1329,11 +1310,8 @@ static void __iomem *smu_base(struct isci_host *isci_host)
return pcim_iomap_table(pdev)[SCI_SMU_BAR * 2] + SCI_SMU_BAR_SIZE * id;
}
-static void isci_user_parameters_get(
- struct isci_host *isci_host,
- union scic_user_parameters *scic_user_params)
+static void isci_user_parameters_get(struct sci_user_parameters *u)
{
- struct scic_sds_user_parameters *u = &scic_user_params->sds1;
int i;
for (i = 0; i < SCI_MAX_PHYS; i++) {
@@ -1355,14 +1333,14 @@ static void isci_user_parameters_get(
u->max_number_concurrent_device_spin_up = max_concurr_spinup;
}
-static void scic_sds_controller_initial_state_enter(struct sci_base_state_machine *sm)
+static void sci_controller_initial_state_enter(struct sci_base_state_machine *sm)
{
struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
sci_change_state(&ihost->sm, SCIC_RESET);
}
-static inline void scic_sds_controller_starting_state_exit(struct sci_base_state_machine *sm)
+static inline void sci_controller_starting_state_exit(struct sci_base_state_machine *sm)
{
struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
@@ -1377,7 +1355,7 @@ static inline void scic_sds_controller_starting_state_exit(struct sci_base_state
#define INTERRUPT_COALESCE_TIMEOUT_ENCODE_MAX 28
/**
- * scic_controller_set_interrupt_coalescence() - This method allows the user to
+ * sci_controller_set_interrupt_coalescence() - This method allows the user to
* configure the interrupt coalescence.
* @controller: This parameter represents the handle to the controller object
* for which its interrupt coalesce register is overridden.
@@ -1394,9 +1372,9 @@ static inline void scic_sds_controller_starting_state_exit(struct sci_base_state
* SCI_FAILURE_INVALID_PARAMETER_VALUE The user input value is out of range.
*/
static enum sci_status
-scic_controller_set_interrupt_coalescence(struct isci_host *ihost,
- u32 coalesce_number,
- u32 coalesce_timeout)
+sci_controller_set_interrupt_coalescence(struct isci_host *ihost,
+ u32 coalesce_number,
+ u32 coalesce_timeout)
{
u8 timeout_encode = 0;
u32 min = 0;
@@ -1489,23 +1467,23 @@ scic_controller_set_interrupt_coalescence(struct isci_host *ihost,
}
-static void scic_sds_controller_ready_state_enter(struct sci_base_state_machine *sm)
+static void sci_controller_ready_state_enter(struct sci_base_state_machine *sm)
{
struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
/* set the default interrupt coalescence number and timeout value. */
- scic_controller_set_interrupt_coalescence(ihost, 0x10, 250);
+ sci_controller_set_interrupt_coalescence(ihost, 0x10, 250);
}
-static void scic_sds_controller_ready_state_exit(struct sci_base_state_machine *sm)
+static void sci_controller_ready_state_exit(struct sci_base_state_machine *sm)
{
struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
/* disable interrupt coalescence. */
- scic_controller_set_interrupt_coalescence(ihost, 0, 0);
+ sci_controller_set_interrupt_coalescence(ihost, 0, 0);
}
-static enum sci_status scic_sds_controller_stop_phys(struct isci_host *ihost)
+static enum sci_status sci_controller_stop_phys(struct isci_host *ihost)
{
u32 index;
enum sci_status status;
@@ -1514,7 +1492,7 @@ static enum sci_status scic_sds_controller_stop_phys(struct isci_host *ihost)
status = SCI_SUCCESS;
for (index = 0; index < SCI_MAX_PHYS; index++) {
- phy_status = scic_sds_phy_stop(&ihost->phys[index]);
+ phy_status = sci_phy_stop(&ihost->phys[index]);
if (phy_status != SCI_SUCCESS &&
phy_status != SCI_FAILURE_INVALID_STATE) {
@@ -1531,7 +1509,7 @@ static enum sci_status scic_sds_controller_stop_phys(struct isci_host *ihost)
return status;
}
-static enum sci_status scic_sds_controller_stop_ports(struct isci_host *ihost)
+static enum sci_status sci_controller_stop_ports(struct isci_host *ihost)
{
u32 index;
enum sci_status port_status;
@@ -1540,7 +1518,7 @@ static enum sci_status scic_sds_controller_stop_ports(struct isci_host *ihost)
for (index = 0; index < ihost->logical_port_entries; index++) {
struct isci_port *iport = &ihost->ports[index];
- port_status = scic_sds_port_stop(iport);
+ port_status = sci_port_stop(iport);
if ((port_status != SCI_SUCCESS) &&
(port_status != SCI_FAILURE_INVALID_STATE)) {
@@ -1558,7 +1536,7 @@ static enum sci_status scic_sds_controller_stop_ports(struct isci_host *ihost)
return status;
}
-static enum sci_status scic_sds_controller_stop_devices(struct isci_host *ihost)
+static enum sci_status sci_controller_stop_devices(struct isci_host *ihost)
{
u32 index;
enum sci_status status;
@@ -1569,7 +1547,7 @@ static enum sci_status scic_sds_controller_stop_devices(struct isci_host *ihost)
for (index = 0; index < ihost->remote_node_entries; index++) {
if (ihost->device_table[index] != NULL) {
/* / @todo What timeout value do we want to provide to this request? */
- device_status = scic_remote_device_stop(ihost->device_table[index], 0);
+ device_status = sci_remote_device_stop(ihost->device_table[index], 0);
if ((device_status != SCI_SUCCESS) &&
(device_status != SCI_FAILURE_INVALID_STATE)) {
@@ -1586,33 +1564,27 @@ static enum sci_status scic_sds_controller_stop_devices(struct isci_host *ihost)
return status;
}
-static void scic_sds_controller_stopping_state_enter(struct sci_base_state_machine *sm)
+static void sci_controller_stopping_state_enter(struct sci_base_state_machine *sm)
{
struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
/* Stop all of the components for this controller */
- scic_sds_controller_stop_phys(ihost);
- scic_sds_controller_stop_ports(ihost);
- scic_sds_controller_stop_devices(ihost);
+ sci_controller_stop_phys(ihost);
+ sci_controller_stop_ports(ihost);
+ sci_controller_stop_devices(ihost);
}
-static void scic_sds_controller_stopping_state_exit(struct sci_base_state_machine *sm)
+static void sci_controller_stopping_state_exit(struct sci_base_state_machine *sm)
{
struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
sci_del_timer(&ihost->timer);
}
-
-/**
- * scic_sds_controller_reset_hardware() -
- *
- * This method will reset the controller hardware.
- */
-static void scic_sds_controller_reset_hardware(struct isci_host *ihost)
+static void sci_controller_reset_hardware(struct isci_host *ihost)
{
/* Disable interrupts so we dont take any spurious interrupts */
- scic_controller_disable_interrupts(ihost);
+ sci_controller_disable_interrupts(ihost);
/* Reset the SCU */
writel(0xFFFFFFFF, &ihost->smu_registers->soft_reset_control);
@@ -1627,82 +1599,82 @@ static void scic_sds_controller_reset_hardware(struct isci_host *ihost)
writel(0, &ihost->scu_registers->sdma.unsolicited_frame_get_pointer);
}
-static void scic_sds_controller_resetting_state_enter(struct sci_base_state_machine *sm)
+static void sci_controller_resetting_state_enter(struct sci_base_state_machine *sm)
{
struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);
- scic_sds_controller_reset_hardware(ihost);
+ sci_controller_reset_hardware(ihost);
sci_change_state(&ihost->sm, SCIC_RESET);
}
-static const struct sci_base_state scic_sds_controller_state_table[] = {
+static const struct sci_base_state sci_controller_state_table[] = {
[SCIC_INITIAL] = {
- .enter_state = scic_sds_controller_initial_state_enter,
+ .enter_state = sci_controller_initial_state_enter,
},
[SCIC_RESET] = {},
[SCIC_INITIALIZING] = {},
[SCIC_INITIALIZED] = {},
[SCIC_STARTING] = {
- .exit_state = scic_sds_controller_starting_state_exit,
+ .exit_state = sci_controller_starting_state_exit,
},
[SCIC_READY] = {
- .enter_state = scic_sds_controller_ready_state_enter,
- .exit_state = scic_sds_controller_ready_state_exit,
+ .enter_state = sci_controller_ready_state_enter,
+ .exit_state = sci_controller_ready_state_exit,
},
[SCIC_RESETTING] = {
- .enter_state = scic_sds_controller_resetting_state_enter,
+ .enter_state = sci_controller_resetting_state_enter,
},
[SCIC_STOPPING] = {
- .enter_state = scic_sds_controller_stopping_state_enter,
- .exit_state = scic_sds_controller_stopping_state_exit,
+ .enter_state = sci_controller_stopping_state_enter,
+ .exit_state = sci_controller_stopping_state_exit,
},
[SCIC_STOPPED] = {},
[SCIC_FAILED] = {}
};
-static void scic_sds_controller_set_default_config_parameters(struct isci_host *ihost)
+static void sci_controller_set_default_config_parameters(struct isci_host *ihost)
{
/* these defaults are overridden by the platform / firmware */
u16 index;
/* Default to APC mode. */
- ihost->oem_parameters.sds1.controller.mode_type = SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE;
+ ihost->oem_parameters.controller.mode_type = SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE;
/* Default to APC mode. */
- ihost->oem_parameters.sds1.controller.max_concurrent_dev_spin_up = 1;
+ ihost->oem_parameters.controller.max_concurrent_dev_spin_up = 1;
/* Default to no SSC operation. */
- ihost->oem_parameters.sds1.controller.do_enable_ssc = false;
+ ihost->oem_parameters.controller.do_enable_ssc = false;
/* Initialize all of the port parameter information to narrow ports. */
for (index = 0; index < SCI_MAX_PORTS; index++) {
- ihost->oem_parameters.sds1.ports[index].phy_mask = 0;
+ ihost->oem_parameters.ports[index].phy_mask = 0;
}
/* Initialize all of the phy parameter information. */
for (index = 0; index < SCI_MAX_PHYS; index++) {
/* Default to 6G (i.e. Gen 3) for now. */
- ihost->user_parameters.sds1.phys[index].max_speed_generation = 3;
+ ihost->user_parameters.phys[index].max_speed_generation = 3;
/* the frequencies cannot be 0 */
- ihost->user_parameters.sds1.phys[index].align_insertion_frequency = 0x7f;
- ihost->user_parameters.sds1.phys[index].in_connection_align_insertion_frequency = 0xff;
- ihost->user_parameters.sds1.phys[index].notify_enable_spin_up_insertion_frequency = 0x33;
+ ihost->user_paramete