isci: Removed sci_base_object from scic_sds_request.

The 'struct sci_base_object' was removed from the struct
scic_sds_request and was replaced by a pointer to
struct isci_request.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
Maciej Patelczyk 2011-04-28 22:06:31 +00:00 committed by Dan Williams
parent af23e85737
commit 890cae9b8a
9 changed files with 48 additions and 62 deletions

View file

@ -72,7 +72,7 @@ void scic_word_copy_with_swap(
void *scic_request_get_virt_addr(struct scic_sds_request *sci_req, dma_addr_t phys_addr)
{
struct isci_request *ireq = sci_object_get_association(sci_req);
struct isci_request *ireq = sci_req->ireq;
dma_addr_t offset;
BUG_ON(phys_addr < ireq->request_daddr);
@ -87,8 +87,7 @@ void *scic_request_get_virt_addr(struct scic_sds_request *sci_req, dma_addr_t ph
dma_addr_t scic_io_request_get_dma_addr(struct scic_sds_request *sds_request,
void *virt_addr)
{
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sds_request);
struct isci_request *isci_request = sds_request->ireq;
char *requested_addr = (char *)virt_addr;
char *base_addr = (char *)isci_request;

View file

@ -253,8 +253,7 @@ static struct scu_sgl_element_pair *scic_sds_request_get_sgl_element_pair(
*/
void scic_sds_request_build_sgl(struct scic_sds_request *sds_request)
{
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sds_request);
struct isci_request *isci_request = sds_request->ireq;
struct isci_host *isci_host = isci_request->isci_host;
struct sas_task *task = isci_request_access_task(isci_request);
struct scatterlist *sg = NULL;
@ -359,8 +358,7 @@ static void scic_sds_io_request_build_ssp_command_iu(
struct sci_ssp_command_iu *command_frame;
u32 cdb_length;
u32 *cdb_buffer;
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sds_request);
struct isci_request *isci_request = sds_request->ireq;
command_frame =
(struct sci_ssp_command_iu *)sds_request->command_buffer;
@ -403,8 +401,7 @@ static void scic_sds_task_request_build_ssp_task_iu(
struct scic_sds_request *sds_request)
{
struct sci_ssp_task_iu *command_frame;
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sds_request);
struct isci_request *isci_request = sds_request->ireq;
command_frame =
(struct sci_ssp_task_iu *)sds_request->command_buffer;
@ -700,8 +697,7 @@ u32 scic_io_request_get_object_size(void)
enum sci_status scic_io_request_construct_basic_ssp(
struct scic_sds_request *sci_req)
{
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sci_req);
struct isci_request *isci_request = sci_req->ireq;
sci_req->protocol = SCIC_SSP_PROTOCOL;
@ -744,8 +740,7 @@ enum sci_status scic_io_request_construct_basic_sata(
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 isci_request *isci_request = sci_req->ireq;
struct sas_task *task = isci_request_access_task(isci_request);
stp_req = container_of(sci_req, typeof(*stp_req), parent);
@ -772,8 +767,7 @@ enum sci_status scic_task_request_construct_sata(
{
enum sci_status status;
u8 sat_protocol;
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(sci_req);
struct isci_request *isci_request = sci_req->ireq;
sat_protocol = isci_sata_get_sat_protocol(isci_request);
@ -1002,8 +996,7 @@ void scic_sds_io_request_copy_response(struct scic_sds_request *sds_request)
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);
struct isci_request *isci_request = sds_request->ireq;
ssp_response =
(struct sci_ssp_response_iu *)sds_request->response_buffer;
@ -1523,7 +1516,7 @@ static const struct scic_sds_io_request_state_handler scic_sds_request_state_han
*/
static void scic_sds_request_initial_state_enter(void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -1542,7 +1535,7 @@ static void scic_sds_request_initial_state_enter(void *object)
*/
static void scic_sds_request_constructed_state_enter(void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -1562,7 +1555,7 @@ static void scic_sds_request_constructed_state_enter(void *object)
*/
static void scic_sds_request_started_state_enter(void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -1589,7 +1582,7 @@ static void scic_sds_request_started_state_enter(void *object)
*/
static void scic_sds_request_started_state_exit(void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
if (sci_req->has_started_substate_machine == true)
sci_base_state_machine_stop(&sci_req->started_substate_machine);
@ -1609,11 +1602,11 @@ static void scic_sds_request_started_state_exit(void *object)
*/
static void scic_sds_request_completed_state_enter(void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
struct scic_sds_controller *scic =
scic_sds_request_get_controller(sci_req);
struct isci_host *ihost = scic->ihost;
struct isci_request *ireq = sci_object_get_association(sci_req);
struct isci_request *ireq = sci_req->ireq;
SET_STATE_HANDLER(sci_req,
scic_sds_request_state_handler_table,
@ -1639,7 +1632,7 @@ static void scic_sds_request_completed_state_enter(void *object)
*/
static void scic_sds_request_aborting_state_enter(void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
/* Setting the abort bit in the Task Context is required by the silicon. */
sci_req->task_context_buffer->abort = 1;
@ -1662,7 +1655,7 @@ static void scic_sds_request_aborting_state_enter(void *object)
*/
static void scic_sds_request_final_state_enter(void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -1699,8 +1692,7 @@ static void scic_sds_general_request_construct(struct scic_sds_controller *scic,
void *user_io_request_object,
struct scic_sds_request *sci_req)
{
sci_req->parent.private = NULL;
sci_base_state_machine_construct(&sci_req->state_machine, &sci_req->parent,
sci_base_state_machine_construct(&sci_req->state_machine, sci_req,
scic_sds_request_state_table, SCI_BASE_REQUEST_STATE_INITIAL);
sci_base_state_machine_start(&sci_req->state_machine);
@ -1790,7 +1782,7 @@ enum sci_status scic_task_request_construct(struct scic_sds_controller *scic,
/* Construct the started sub-state machine. */
sci_base_state_machine_construct(
&sci_req->started_substate_machine,
&sci_req->parent,
sci_req,
scic_sds_io_request_started_task_mgmt_substate_table,
SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_COMPLETION
);

View file

@ -118,6 +118,7 @@ enum scic_sds_smp_request_started_substates {
SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_TC_COMPLETION,
};
struct isci_request;
/**
* struct scic_sds_request - This structure contains or references all of
* the data necessary to process a task management or normal IO request.
@ -126,10 +127,9 @@ enum scic_sds_smp_request_started_substates {
*/
struct scic_sds_request {
/**
* The field specifies that the parent object for the base request is the
* base object itself.
* The field specifies that the peer object for the request object.
*/
struct sci_base_object parent;
struct isci_request *ireq;
/**
* This field contains the information for the base request state machine.

View file

@ -525,7 +525,7 @@ static const struct scic_sds_io_request_state_handler scic_sds_smp_request_start
static void scic_sds_smp_request_started_await_response_substate_enter(
void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -546,7 +546,7 @@ static void scic_sds_smp_request_started_await_response_substate_enter(
static void scic_sds_smp_request_started_await_tc_completion_substate_enter(
void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -590,7 +590,7 @@ enum sci_status scic_io_request_construct_smp(struct scic_sds_request *sci_req)
/* Construct the started sub-state machine. */
sci_base_state_machine_construct(
&sci_req->started_substate_machine,
&sci_req->parent,
sci_req,
scic_sds_smp_request_started_substate_table,
SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_RESPONSE
);

View file

@ -202,7 +202,7 @@ static const struct scic_sds_io_request_state_handler scic_sds_ssp_task_request_
static void scic_sds_io_request_started_task_mgmt_await_tc_completion_substate_enter(
void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -223,7 +223,7 @@ static void scic_sds_io_request_started_task_mgmt_await_tc_completion_substate_e
static void scic_sds_io_request_started_task_mgmt_await_task_response_substate_enter(
void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,

View file

@ -566,7 +566,7 @@ static const struct scic_sds_io_request_state_handler scic_sds_stp_request_start
static void scic_sds_stp_request_started_non_data_await_h2d_completion_enter(
void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -581,7 +581,7 @@ static void scic_sds_stp_request_started_non_data_await_h2d_completion_enter(
static void scic_sds_stp_request_started_non_data_await_d2h_enter(void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -611,7 +611,7 @@ enum sci_status scic_sds_stp_non_data_request_construct(struct scic_sds_request
scu_stp_raw_request_construct_task_context(stp_req, sci_req->task_context_buffer);
sci_base_state_machine_construct(&sci_req->started_substate_machine,
&sci_req->parent,
sci_req,
scic_sds_stp_request_started_non_data_substate_table,
SCIC_SDS_STP_REQUEST_STARTED_NON_DATA_AWAIT_H2D_COMPLETION_SUBSTATE);
@ -1215,7 +1215,7 @@ static const struct scic_sds_io_request_state_handler scic_sds_stp_request_start
static void scic_sds_stp_request_started_pio_await_h2d_completion_enter(
void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -1229,7 +1229,7 @@ static void scic_sds_stp_request_started_pio_await_h2d_completion_enter(
static void scic_sds_stp_request_started_pio_await_frame_enter(void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -1241,7 +1241,7 @@ static void scic_sds_stp_request_started_pio_await_frame_enter(void *object)
static void scic_sds_stp_request_started_pio_data_in_await_data_enter(
void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -1253,7 +1253,7 @@ static void scic_sds_stp_request_started_pio_data_in_await_data_enter(
static void scic_sds_stp_request_started_pio_data_out_transmit_data_enter(
void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -1311,7 +1311,7 @@ enum sci_status scic_sds_stp_pio_request_construct(struct scic_sds_request *sci_
}
sci_base_state_machine_construct(&sci_req->started_substate_machine,
&sci_req->parent,
sci_req,
scic_sds_stp_request_started_pio_substate_table,
SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_H2D_COMPLETION_SUBSTATE);
@ -1485,7 +1485,7 @@ static const struct scic_sds_io_request_state_handler scic_sds_stp_request_start
static void scic_sds_stp_request_started_udma_await_tc_completion_enter(
void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -1504,7 +1504,7 @@ static void scic_sds_stp_request_started_udma_await_tc_completion_enter(
static void scic_sds_stp_request_started_udma_await_d2h_reg_fis_enter(
void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -1535,7 +1535,7 @@ enum sci_status scic_sds_stp_udma_request_construct(struct scic_sds_request *sci
sci_base_state_machine_construct(
&sci_req->started_substate_machine,
&sci_req->parent,
sci_req,
scic_sds_stp_request_started_udma_substate_table,
SCIC_SDS_STP_REQUEST_STARTED_UDMA_AWAIT_TC_COMPLETION_SUBSTATE
);
@ -1732,7 +1732,7 @@ static const struct scic_sds_io_request_state_handler scic_sds_stp_request_start
static void scic_sds_stp_request_started_soft_reset_await_h2d_asserted_completion_enter(
void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -1748,7 +1748,7 @@ static void scic_sds_stp_request_started_soft_reset_await_h2d_asserted_completio
static void scic_sds_stp_request_started_soft_reset_await_h2d_diagnostic_completion_enter(
void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
struct scu_task_context *task_context;
struct sata_fis_reg_h2d *h2d_fis;
enum sci_status status;
@ -1775,7 +1775,7 @@ static void scic_sds_stp_request_started_soft_reset_await_h2d_diagnostic_complet
static void scic_sds_stp_request_started_soft_reset_await_d2h_response_enter(
void *object)
{
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = object;
SET_STATE_HANDLER(
sci_req,
@ -1806,7 +1806,7 @@ enum sci_status scic_sds_stp_soft_reset_request_construct(struct scic_sds_reques
scu_stp_raw_request_construct_task_context(stp_req, sci_req->task_context_buffer);
sci_base_state_machine_construct(&sci_req->started_substate_machine,
&sci_req->parent,
sci_req,
scic_sds_stp_request_started_soft_reset_substate_table,
SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_H2D_ASSERTED_COMPLETION_SUBSTATE);

View file

@ -61,7 +61,7 @@
#include "request.h"
#include "sata.h"
#include "scu_completion_codes.h"
#include "core/scic_sds_request.h"
static enum sci_status isci_request_ssp_request_construct(
struct isci_request *request)
@ -225,7 +225,7 @@ static enum sci_status isci_io_request_build(
return SCI_FAILURE;
}
sci_object_set_association(request->sci_request_handle, request);
request->sci_request_handle->ireq = request;
switch (task->task_proto) {
case SAS_PROTOCOL_SMP:

View file

@ -209,8 +209,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_idle_substate_start_io_h
struct scic_sds_request *request)
{
enum sci_status status;
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(request);
struct isci_request *isci_request = request->ireq;
/* Will the port allow the io request to start? */
@ -280,8 +279,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_start_io_ha
struct scic_sds_request *request)
{
enum sci_status status;
struct isci_request *isci_request =
(struct isci_request *)sci_object_get_association(request);
struct isci_request *isci_request = request->ireq;
if (isci_sata_get_sat_protocol(isci_request) == SAT_PROTOCOL_FPDMA) {
status = sci_dev->owning_port->state_handlers->start_io_handler(

View file

@ -63,7 +63,7 @@
#include "request.h"
#include "sata.h"
#include "task.h"
#include "core/scic_sds_request.h"
/**
* isci_task_refuse() - complete the request to the upper layer driver in
* the case where an I/O needs to be completed back in the submit path.
@ -314,10 +314,7 @@ static enum sci_status isci_task_request_build(
goto errout;
}
sci_object_set_association(
request->sci_request_handle,
request
);
request->sci_request_handle->ireq = request;
/* XXX convert to get this from task->tproto like other drivers */
if (dev->dev_type == SAS_END_DEV) {