Commit 7392d275 authored by Dave Jiang's avatar Dave Jiang Committed by Dan Williams

isci: Removing deprecated functions

Removed all callbacks in the deprecated.c. Core will call the appropriate
functions directly.
Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent a1914059
......@@ -8,7 +8,7 @@ EXTRA_CFLAGS += -DDISABLE_ATAPI
EXTRA_CFLAGS += -Idrivers/scsi/isci/core/ -Idrivers/scsi/isci/
obj-$(CONFIG_SCSI_ISCI) += isci.o
isci-objs := init.o phy.o request.o sata.o \
remote_device.o port.o timers.o deprecated.o \
remote_device.o port.o timers.o \
host.o task.o events.o \
core/scic_sds_controller.o \
core/scic_sds_remote_device.o \
......
......@@ -66,7 +66,6 @@
#include "scic_sds_port.h"
#include "scic_sds_remote_device.h"
#include "scic_sds_request.h"
#include "scic_user_callback.h"
#include "sci_environment.h"
#include "sci_util.h"
#include "scu_completion_codes.h"
......@@ -594,7 +593,7 @@ void scic_sds_controller_afe_initialization(struct scic_sds_controller *scic)
/* Clear DFX Status registers */
scu_afe_register_write(scic, afe_dfx_master_control0, 0x0081000f);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
/* Configure bias currents to normal */
if (is_a0())
......@@ -602,7 +601,7 @@ void scic_sds_controller_afe_initialization(struct scic_sds_controller *scic)
else
scu_afe_register_write(scic, afe_bias_control, 0x00005A00);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
/* Enable PLL */
if (is_b0())
......@@ -610,35 +609,35 @@ void scic_sds_controller_afe_initialization(struct scic_sds_controller *scic)
else
scu_afe_register_write(scic, afe_pll_control0, 0x80040908);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
/* Wait for the PLL to lock */
do {
afe_status = scu_afe_register_read(
scic, afe_common_block_status);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
} while ((afe_status & 0x00001000) == 0);
if (is_b0()) {
/* Shorten SAS SNW lock time (RxLock timer value from 76 us to 50 us) */
scu_afe_register_write(scic, afe_pmsn_master_control0, 0x7bcc96ad);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
}
for (phy_id = 0; phy_id < SCI_MAX_PHYS; phy_id++) {
if (is_b0()) {
/* Configure transmitter SSC parameters */
scu_afe_txreg_write(scic, phy_id, afe_tx_ssc_control, 0x00030000);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
} else {
/*
* All defaults, except the Receive Word Alignament/Comma Detect
* Enable....(0xe800) */
scu_afe_txreg_write(scic, phy_id, afe_xcvr_control0, 0x00004512);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
scu_afe_txreg_write(scic, phy_id, afe_xcvr_control1, 0x0050100F);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
}
/*
......@@ -651,26 +650,26 @@ void scic_sds_controller_afe_initialization(struct scic_sds_controller *scic)
else {
/* Power down TX and RX (PWRDNTX and PWRDNRX) */
scu_afe_txreg_write(scic, phy_id, afe_channel_control, 0x000003d7);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
/*
* Power up TX and RX out from power down (PWRDNTX and PWRDNRX)
* & increase TX int & ext bias 20%....(0xe85c) */
scu_afe_txreg_write(scic, phy_id, afe_channel_control, 0x000003d4);
}
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
if (is_a0() || is_a2()) {
/* Enable TX equalization (0xe824) */
scu_afe_txreg_write(scic, phy_id, afe_tx_control, 0x00040000);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
}
/*
* RDPI=0x0(RX Power On), RXOOBDETPDNC=0x0, TPD=0x0(TX Power On),
* RDD=0x0(RX Detect Enabled) ....(0xe800) */
scu_afe_txreg_write(scic, phy_id, afe_xcvr_control0, 0x00004100);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
/* Leave DFE/FFE on */
if (is_a0())
......@@ -679,28 +678,28 @@ void scic_sds_controller_afe_initialization(struct scic_sds_controller *scic)
scu_afe_txreg_write(scic, phy_id, afe_rx_ssc_control0, 0x3F11103F);
else {
scu_afe_txreg_write(scic, phy_id, afe_rx_ssc_control0, 0x3F11103F);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
/* Enable TX equalization (0xe824) */
scu_afe_txreg_write(scic, phy_id, afe_tx_control, 0x00040000);
}
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
scu_afe_txreg_write(scic, phy_id, afe_tx_amp_control0, 0x000E7C03);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
scu_afe_txreg_write(scic, phy_id, afe_tx_amp_control1, 0x000E7C03);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
scu_afe_txreg_write(scic, phy_id, afe_tx_amp_control2, 0x000E7C03);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
scu_afe_txreg_write(scic, phy_id, afe_tx_amp_control3, 0x000E7C03);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
}
/* Transfer control to the PEs */
scu_afe_register_write(scic, afe_dfx_master_control0, 0x00010f00);
scic_cb_stall_execution(AFE_REGISTER_WRITE_DELAY);
udelay(AFE_REGISTER_WRITE_DELAY);
}
/*
......@@ -2446,7 +2445,7 @@ void scic_sds_controller_reset_hardware(
SMU_SMUSRCR_WRITE(scic, 0xFFFFFFFF);
/* Delay for 1ms to before clearing the CQP and UFQPR. */
scic_cb_stall_execution(1000);
udelay(1000);
/* The write to the CQGR clears the CQP */
SMU_CQGR_WRITE(scic, 0x00000000);
......@@ -2840,7 +2839,7 @@ static enum sci_status scic_sds_controller_reset_state_initialize_handler(
while (terminate_loop-- && (result != SCI_SUCCESS)) {
/* Loop until the hardware reports success */
scic_cb_stall_execution(SCU_CONTEXT_RAM_INIT_STALL_TIME);
udelay(SCU_CONTEXT_RAM_INIT_STALL_TIME);
status = SMU_SMUCSR_READ(this_controller);
if ((status & SCU_RAM_INIT_COMPLETED) == SCU_RAM_INIT_COMPLETED) {
......
......@@ -63,7 +63,6 @@
#include "scic_sds_phy_registers.h"
#include "scic_sds_port.h"
#include "scic_sds_remote_node_context.h"
#include "scic_user_callback.h"
#include "sci_environment.h"
#include "sci_util.h"
#include "scu_event_codes.h"
......
......@@ -66,7 +66,6 @@
#include "scic_sds_remote_device.h"
#include "scic_sds_remote_node_context.h"
#include "scic_sds_request.h"
#include "scic_user_callback.h"
#include "sci_environment.h"
......
......@@ -64,7 +64,6 @@
#include "scic_sds_remote_device.h"
#include "scic_sds_remote_node_context.h"
#include "scic_sds_request.h"
#include "scic_user_callback.h"
#include "sci_environment.h"
#include "sci_util.h"
#include "scu_event_codes.h"
......
......@@ -70,7 +70,6 @@
#include "scic_sds_smp_request.h"
#include "scic_sds_stp_request.h"
#include "scic_sds_unsolicited_frame_control.h"
#include "scic_user_callback.h"
#include "sci_environment.h"
#include "sci_util.h"
#include "scu_completion_codes.h"
......@@ -413,25 +412,26 @@ static void scic_sds_ssp_io_request_assign_buffers(
*
*/
static void scic_sds_io_request_build_ssp_command_iu(
struct scic_sds_request *this_request)
struct scic_sds_request *sds_request)
{
struct sci_ssp_command_iu *command_frame;
void *os_handle;
u32 cdb_length;
u32 *cdb_buffer;
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sds_request);
command_frame =
(struct sci_ssp_command_iu *)this_request->command_buffer;
os_handle = scic_sds_request_get_user_request(this_request);
(struct sci_ssp_command_iu *)sds_request->command_buffer;
command_frame->lun_upper = 0;
command_frame->lun_lower = scic_cb_ssp_io_request_get_lun(os_handle);
command_frame->lun_lower =
isci_request_ssp_io_request_get_lun(isci_request);
((u32 *)command_frame)[2] = 0;
cdb_length = scic_cb_ssp_io_request_get_cdb_length(os_handle);
cdb_buffer = (u32 *)scic_cb_ssp_io_request_get_cdb_address(os_handle);
cdb_length = isci_request_ssp_io_request_get_cdb_length(isci_request);
cdb_buffer = (u32 *)isci_request_ssp_io_request_get_cdb_address(
isci_request);
if (cdb_length > 16) {
command_frame->additional_cdb_length = cdb_length - 16;
......@@ -446,9 +446,9 @@ static void scic_sds_io_request_build_ssp_command_iu(
command_frame->enable_first_burst = 0;
command_frame->task_priority =
scic_cb_ssp_io_request_get_command_priority(os_handle);
isci_request_ssp_io_request_get_command_priority(isci_request);
command_frame->task_attribute =
scic_cb_ssp_io_request_get_task_attribute(os_handle);
isci_request_ssp_io_request_get_task_attribute(isci_request);
}
......@@ -458,25 +458,26 @@ static void scic_sds_io_request_build_ssp_command_iu(
*
*/
static void scic_sds_task_request_build_ssp_task_iu(
struct scic_sds_request *this_request)
struct scic_sds_request *sds_request)
{
struct sci_ssp_task_iu *command_frame;
void *os_handle;
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sds_request);
command_frame =
(struct sci_ssp_task_iu *)this_request->command_buffer;
os_handle = scic_sds_request_get_user_request(this_request);
(struct sci_ssp_task_iu *)sds_request->command_buffer;
command_frame->lun_upper = 0;
command_frame->lun_lower = scic_cb_ssp_task_request_get_lun(os_handle);
command_frame->lun_lower = isci_request_ssp_io_request_get_lun(
isci_request);
((u32 *)command_frame)[2] = 0;
command_frame->task_function =
scic_cb_ssp_task_request_get_function(os_handle);
isci_task_ssp_request_get_function(isci_request);
command_frame->task_tag =
scic_cb_ssp_task_request_get_io_tag_to_manage(os_handle);
isci_task_ssp_request_get_io_tag_to_manage(
isci_request);
}
......@@ -899,18 +900,15 @@ enum sci_status scic_task_request_construct(
enum sci_status scic_io_request_construct_basic_ssp(
struct scic_sds_request *sci_req)
{
void *os_handle;
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sci_req);
sci_req->protocol = SCIC_SSP_PROTOCOL;
os_handle = scic_sds_request_get_user_request(sci_req);
scu_ssp_io_request_construct_task_context(
sci_req,
scic_cb_io_request_get_data_direction(os_handle),
scic_cb_io_request_get_transfer_length(os_handle)
);
isci_request_io_request_get_data_direction(isci_request),
isci_request_io_request_get_transfer_length(isci_request));
scic_sds_io_request_build_ssp_command_iu(sci_req);
......@@ -941,7 +939,8 @@ enum sci_status scic_task_request_construct_ssp(
}
enum sci_status scic_io_request_construct_basic_sata(struct scic_sds_request *sci_req)
enum sci_status scic_io_request_construct_basic_sata(
struct scic_sds_request *sci_req)
{
enum sci_status status;
struct scic_sds_stp_request *stp_req;
......@@ -949,15 +948,18 @@ enum sci_status scic_io_request_construct_basic_sata(struct scic_sds_request *sc
u32 len;
enum dma_data_direction dir;
bool copy = false;
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sci_req);
struct sas_task *task = isci_request_access_task(isci_request);
stp_req = container_of(sci_req, typeof(*stp_req), parent);
sci_req->protocol = SCIC_STP_PROTOCOL;
len = scic_cb_io_request_get_transfer_length(sci_req->user_request);
dir = scic_cb_io_request_get_data_direction(sci_req->user_request);
proto = scic_cb_request_get_sat_protocol(sci_req->user_request);
copy = scic_cb_io_request_do_copy_rx_frames(stp_req->parent.user_request);
len = isci_request_io_request_get_transfer_length(isci_request);
dir = isci_request_io_request_get_data_direction(isci_request);
proto = isci_sata_get_sat_protocol(isci_request);
copy = (task->data_dir == DMA_NONE) ? false : true;
status = scic_io_request_construct_sata(sci_req, proto, len, dir, copy);
......@@ -975,7 +977,11 @@ enum sci_status scic_task_request_construct_sata(
struct scic_sds_request *sci_req)
{
enum sci_status status;
u8 sat_protocol = scic_cb_request_get_sat_protocol(sci_req->user_request);
u8 sat_protocol;
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sci_req);
sat_protocol = isci_sata_get_sat_protocol(isci_request);
switch (sat_protocol) {
case SAT_PROTOCOL_ATA_HARD_RESET:
......@@ -1172,27 +1178,28 @@ enum sci_status scic_sds_io_request_frame_handler(
* the response data.
*
*/
void scic_sds_io_request_copy_response(
struct scic_sds_request *this_request)
void scic_sds_io_request_copy_response(struct scic_sds_request *sds_request)
{
void *response_buffer;
u32 user_response_length;
u32 core_response_length;
struct sci_ssp_response_iu *ssp_response;
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sds_request);
ssp_response = (struct sci_ssp_response_iu *)this_request->response_buffer;
ssp_response =
(struct sci_ssp_response_iu *)sds_request->response_buffer;
response_buffer = scic_cb_ssp_task_request_get_response_data_address(
this_request->user_request
);
response_buffer =
isci_task_ssp_request_get_response_data_address(
isci_request);
user_response_length = scic_cb_ssp_task_request_get_response_data_length(
this_request->user_request
);
user_response_length =
isci_task_ssp_request_get_response_data_length(
isci_request);
core_response_length = sci_ssp_get_response_data_length(
ssp_response->response_data_length
);
ssp_response->response_data_length);
user_response_length = min(user_response_length, core_response_length);
......
......@@ -58,7 +58,6 @@
#include "scic_sds_port.h"
#include "scic_sds_remote_device.h"
#include "scic_sds_request.h"
#include "scic_user_callback.h"
#include "sci_environment.h"
#include "sci_util.h"
#include "scu_event_codes.h"
......
......@@ -62,7 +62,6 @@
#include "scic_sds_port.h"
#include "scic_sds_remote_device.h"
#include "scic_sds_request.h"
#include "scic_user_callback.h"
#include "sci_environment.h"
#include "sci_util.h"
#include "scu_event_codes.h"
......@@ -217,52 +216,56 @@ static enum sci_status scic_sds_stp_remote_device_ready_substate_start_request_h
* @device:
* @request:
*
* If this is a softreset we may want to have a different substate. enum sci_status
* If this is a softreset we may want to have a different substate.
* enum sci_status
*/
static enum sci_status scic_sds_stp_remote_device_ready_idle_substate_start_io_handler(
struct sci_base_remote_device *device,
struct sci_base_request *request)
struct sci_base_remote_device *base_device,
struct sci_base_request *base_request)
{
enum sci_status status;
struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
struct scic_sds_request *io_request = (struct scic_sds_request *)request;
struct scic_sds_remote_device *device =
(struct scic_sds_remote_device *)&base_device->parent;
struct scic_sds_request *sds_request =
(struct scic_sds_request *)&base_request->parent;
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sds_request);
/* Will the port allow the io request to start? */
status = this_device->owning_port->state_handlers->start_io_handler(
this_device->owning_port,
this_device,
io_request
);
status = device->owning_port->state_handlers->start_io_handler(
device->owning_port,
device,
sds_request);
if (status == SCI_SUCCESS) {
status =
scic_sds_remote_node_context_start_io(this_device->rnc, io_request);
scic_sds_remote_node_context_start_io(device->rnc,
sds_request);
if (status == SCI_SUCCESS) {
status = io_request->state_handlers->parent.start_handler(request);
}
if (status == SCI_SUCCESS)
status =
sds_request->state_handlers->
parent.start_handler(base_request);
if (status == SCI_SUCCESS) {
if (
scic_cb_request_get_sat_protocol(io_request->user_request)
== SAT_PROTOCOL_FPDMA
) {
if (isci_sata_get_sat_protocol(isci_request) ==
SAT_PROTOCOL_FPDMA)
sci_base_state_machine_change_state(
&this_device->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ
);
} else {
this_device->working_request = io_request;
&device->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ);
else {
device->working_request = sds_request;
sci_base_state_machine_change_state(
&this_device->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD
);
&device->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD);
}
}
scic_sds_remote_device_start_request(this_device, io_request, status);
scic_sds_remote_device_start_request(device,
sds_request,
status);
}
return status;
......@@ -304,35 +307,38 @@ static enum sci_status scic_sds_stp_remote_device_ready_idle_substate_event_hand
* ***************************************************************************** */
static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_start_io_handler(
struct sci_base_remote_device *device,
struct sci_base_request *request)
struct sci_base_remote_device *base_device,
struct sci_base_request *base_request)
{
enum sci_status status;
struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
struct scic_sds_request *io_request = (struct scic_sds_request *)request;
if (
scic_cb_request_get_sat_protocol(io_request->user_request)
== SAT_PROTOCOL_FPDMA
) {
status = this_device->owning_port->state_handlers->start_io_handler(
this_device->owning_port,
this_device,
io_request
);
struct scic_sds_remote_device *device =
(struct scic_sds_remote_device *)&base_device->parent;
struct scic_sds_request *sds_request =
(struct scic_sds_request *)&base_request->parent;
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sds_request);
if (isci_sata_get_sat_protocol(isci_request) == SAT_PROTOCOL_FPDMA) {
status = device->owning_port->state_handlers->start_io_handler(
device->owning_port,
device,
sds_request);
if (status == SCI_SUCCESS) {
status = scic_sds_remote_node_context_start_io(this_device->rnc, io_request);
status = scic_sds_remote_node_context_start_io(
device->rnc,
sds_request);
if (status == SCI_SUCCESS) {
status = io_request->state_handlers->parent.start_handler(request);
}
if (status == SCI_SUCCESS)
status = sds_request->state_handlers->
parent.start_handler(base_request);
scic_sds_remote_device_start_request(this_device, io_request, status);
scic_sds_remote_device_start_request(device,
sds_request,
status);
}
} else {
} else
status = SCI_FAILURE_INVALID_STATE;
}
return status;
}
......
......@@ -67,7 +67,6 @@
#include "scic_sds_stp_pio_request.h"
#include "scic_sds_stp_request.h"
#include "scic_sds_unsolicited_frame_control.h"
#include "scic_user_callback.h"
#include "sci_environment.h"
#include "sci_util.h"
#include "scu_completion_codes.h"
......
......@@ -64,7 +64,6 @@
#include "scic_sds_unsolicited_frame_control.h"
#include "scu_registers.h"
#include "scic_sds_controller.h"
#include "scic_user_callback.h"
#include "sci_util.h"
#include "sci_environment.h"
......
This diff is collapsed.
This diff is collapsed.
......@@ -61,7 +61,6 @@
/*#include "task.h"*/
#include "timers.h"
#include "remote_device.h"
#include "scic_user_callback.h"
#define DRV_NAME "isci"
#define SCI_PCI_BAR_COUNT 2
......
......@@ -86,6 +86,8 @@
#include "sci_status.h"
#include "request.h"
#include "events.h"
#include "task.h"
#include "sata.h"
extern struct kmem_cache *isci_kmem_cache;
extern struct isci_firmware *isci_firmware;
......
......@@ -55,7 +55,6 @@
#if !defined(_ISCI_REMOTE_DEVICE_H_)
#define _ISCI_REMOTE_DEVICE_H_
#include "scic_user_callback.h"
struct isci_host;
struct scic_sds_remote_device;
......
......@@ -324,7 +324,7 @@ int isci_task_send_lu_reset_sata(
/* Leave SRST high for a bit. */
#define ISCI_SRST_ASSERT_DELAY 100 /* usecs */
scic_cb_stall_execution(ISCI_SRST_ASSERT_DELAY);
udelay(ISCI_SRST_ASSERT_DELAY);
/* Deassert SRST. */
isci_task_build_tmf(&tmf, isci_device, isci_tmf_sata_srst_low,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment