Skip to content

Commit

Permalink
isci: Removing deprecated functions
Browse files Browse the repository at this point in the history
Removed all callbacks in the deprecated.c. Core will call the appropriate
functions directly.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Dave Jiang authored and Dan Williams committed Jul 3, 2011
1 parent a191405 commit 7392d27
Show file tree
Hide file tree
Showing 16 changed files with 130 additions and 1,030 deletions.
2 changes: 1 addition & 1 deletion drivers/scsi/isci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
43 changes: 21 additions & 22 deletions drivers/scsi/isci/core/scic_sds_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -594,51 +593,51 @@ 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())
scu_afe_register_write(scic, afe_bias_control, 0x00005500);
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())
scu_afe_register_write(scic, afe_pll_control0, 0x80040A08);
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);
}

/*
Expand All @@ -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())
Expand All @@ -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);
}

/*
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/isci/core/scic_sds_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/isci/core/scic_sds_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/isci/core/scic_sds_remote_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
93 changes: 50 additions & 43 deletions drivers/scsi/isci/core/scic_sds_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand All @@ -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);
}


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


Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -941,23 +939,27 @@ 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;
u8 proto;
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);

Expand All @@ -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:
Expand Down Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/isci/core/scic_sds_smp_remote_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit 7392d27

Please sign in to comment.