isci: unify request data structures
[pandora-kernel.git] / drivers / scsi / isci / core / scic_sds_request.c
index e9c69d4..50dd19b 100644 (file)
@@ -54,8 +54,6 @@
  */
 
 #include <scsi/sas.h>
-#include "sas.h"
-#include "intel_sas.h"
 #include "scic_controller.h"
 #include "scic_io_request.h"
 #include "scic_sds_controller.h"
 #define SCIC_SDS_IO_REQUEST_MINIMUM_TIMER_COUNT (0)
 #define SCIC_SDS_IO_REQUEST_MAXIMUM_TIMER_COUNT (0)
 
-/*
- * ****************************************************************************
- * * SCIC SDS IO REQUEST MACROS
- * **************************************************************************** */
-
-/**
- * scic_ssp_io_request_get_object_size() -
- *
- * This macro returns the sizeof memory required to store the an SSP IO
- * request.  This does not include the size of the SGL or SCU Task Context
- * memory.
- */
-#define scic_ssp_io_request_get_object_size() \
-       (\
-               sizeof(struct ssp_cmd_iu) \
-               + SSP_RESP_IU_MAX_SIZE  \
-       )
-
-/**
- * scic_sds_ssp_request_get_command_buffer() -
- *
- * This macro returns the address of the ssp command buffer in the io request
- * memory
- */
-#define scic_sds_ssp_request_get_command_buffer(memory)        \
-       ((struct ssp_cmd_iu *)(\
-                ((char *)(memory)) + sizeof(struct scic_sds_request) \
-                ))
-
-/**
- * scic_sds_ssp_request_get_response_buffer() -
- *
- * This macro returns the address of the ssp response buffer in the io request
- * memory
- */
-#define scic_sds_ssp_request_get_response_buffer(memory) \
-       ((struct ssp_response_iu *)(\
-                ((char *)(scic_sds_ssp_request_get_command_buffer(memory))) \
-                + sizeof(struct ssp_cmd_iu)    \
-                ))
-
-/**
- * scic_sds_ssp_request_get_task_context_buffer() -
- *
- * This macro returns the address of the task context buffer in the io request
- * memory
- */
-#define scic_sds_ssp_request_get_task_context_buffer(memory) \
-       ((struct scu_task_context *)(\
-                ((char *)(scic_sds_ssp_request_get_response_buffer(memory))) \
-                + SSP_RESP_IU_MAX_SIZE \
-                ))
-
-/**
- * scic_sds_ssp_request_get_sgl_element_buffer() -
- *
- * This macro returns the address of the sgl elment pairs in the io request
- * memory buffer
- */
-#define scic_sds_ssp_request_get_sgl_element_buffer(memory) \
-       ((struct scu_sgl_element_pair *)(\
-                ((char *)(scic_sds_ssp_request_get_task_context_buffer(memory))) \
-                + sizeof(struct scu_task_context) \
-                ))
-
-
-/**
- * scic_ssp_task_request_get_object_size() -
- *
- * This macro returns the sizeof of memory required to store an SSP Task
- * request.  This does not include the size of the SCU Task Context memory.
- */
-#define scic_ssp_task_request_get_object_size()        \
-       (\
-               sizeof(struct ssp_task_iu) \
-               + SSP_RESP_IU_MAX_SIZE \
-       )
-
-/**
- * scic_sds_ssp_task_request_get_command_buffer() -
- *
- * This macro returns the address of the ssp command buffer in the task request
- * memory.  Yes its the same as the above macro except for the name.
- */
-#define scic_sds_ssp_task_request_get_command_buffer(memory) \
-       ((struct ssp_task_iu *)(\
-                ((char *)(memory)) + sizeof(struct scic_sds_request) \
-                ))
-
-/**
- * scic_sds_ssp_task_request_get_response_buffer() -
- *
- * This macro returns the address of the ssp response buffer in the task
- * request memory.
- */
-#define scic_sds_ssp_task_request_get_response_buffer(memory) \
-       ((struct ssp_response_iu *)(\
-                ((char *)(scic_sds_ssp_task_request_get_command_buffer(memory))) \
-                + sizeof(struct ssp_task_iu) \
-                ))
-
-/**
- * scic_sds_ssp_task_request_get_task_context_buffer() -
- *
- * This macro returs the task context buffer for the SSP task request.
- */
-#define scic_sds_ssp_task_request_get_task_context_buffer(memory) \
-       ((struct scu_task_context *)(\
-                ((char *)(scic_sds_ssp_task_request_get_response_buffer(memory))) \
-                + SSP_RESP_IU_MAX_SIZE \
-                ))
-
-
-
-/*
- * ****************************************************************************
- * * SCIC SDS IO REQUEST PRIVATE METHODS
- * **************************************************************************** */
-
-/**
- *
- *
- * This method returns the size required to store an SSP IO request object. u32
- */
-static u32 scic_sds_ssp_request_get_object_size(void)
-{
-       return sizeof(struct scic_sds_request)
-              + scic_ssp_io_request_get_object_size()
-              + sizeof(struct scu_task_context)
-              + SMP_CACHE_BYTES
-              + sizeof(struct scu_sgl_element_pair) * SCU_MAX_SGL_ELEMENT_PAIRS;
-}
-
 /**
  * This method returns the sgl element pair for the specificed sgl_pair index.
  * @sci_req: This parameter specifies the IO request for which to retrieve
@@ -241,7 +106,7 @@ static struct scu_sgl_element_pair *scic_sds_request_get_sgl_element_pair(
                return &task_context->sgl_pair_cd;
        }
 
-       return &sci_req->sgl_element_pair_buffer[sgl_pair_index - 2];
+       return &sci_req->sg_table[sgl_pair_index - 2];
 }
 
 /**
@@ -252,7 +117,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 = sds_request->ireq;
+       struct isci_request *isci_request = sci_req_to_ireq(sds_request);
        struct isci_host *isci_host = isci_request->isci_host;
        struct sas_task *task = isci_request_access_task(isci_request);
        struct scatterlist *sg = NULL;
@@ -316,42 +181,19 @@ void scic_sds_request_build_sgl(struct scic_sds_request *sds_request)
        }
 }
 
-/**
- * This method build the remainder of the IO request object.
- * @sci_req: This parameter specifies the request object being constructed.
- *
- * The scic_sds_general_request_construct() must be called before this call is
- * valid. none
- */
-static void scic_sds_ssp_io_request_assign_buffers(
-       struct scic_sds_request *sci_req)
+static void scic_sds_ssp_io_request_assign_buffers(struct scic_sds_request *sci_req)
 {
-       sci_req->command_buffer =
-               scic_sds_ssp_request_get_command_buffer(sci_req);
-       sci_req->response_buffer =
-               scic_sds_ssp_request_get_response_buffer(sci_req);
-       sci_req->sgl_element_pair_buffer =
-               scic_sds_ssp_request_get_sgl_element_buffer(sci_req);
-       sci_req->sgl_element_pair_buffer =
-               PTR_ALIGN(sci_req->sgl_element_pair_buffer,
-                         sizeof(struct scu_sgl_element_pair));
-
-       if (sci_req->was_tag_assigned_by_user == false) {
-               sci_req->task_context_buffer =
-                       scic_sds_ssp_request_get_task_context_buffer(sci_req);
-               sci_req->task_context_buffer =
-                       PTR_ALIGN(sci_req->task_context_buffer,
-                                 SMP_CACHE_BYTES);
-       }
+       if (sci_req->was_tag_assigned_by_user == false)
+               sci_req->task_context_buffer = &sci_req->tc;
 }
 
 static void scic_sds_io_request_build_ssp_command_iu(struct scic_sds_request *sci_req)
 {
        struct ssp_cmd_iu *cmd_iu;
-       struct isci_request *ireq = sci_req->ireq;
+       struct isci_request *ireq = sci_req_to_ireq(sci_req);
        struct sas_task *task = isci_request_access_task(ireq);
 
-       cmd_iu = sci_req->command_buffer;
+       cmd_iu = &sci_req->ssp.cmd;
 
        memcpy(cmd_iu->LUN, task->ssp_task.LUN, 8);
        cmd_iu->add_cdb_len = 0;
@@ -369,11 +211,11 @@ static void scic_sds_io_request_build_ssp_command_iu(struct scic_sds_request *sc
 static void scic_sds_task_request_build_ssp_task_iu(struct scic_sds_request *sci_req)
 {
        struct ssp_task_iu *task_iu;
-       struct isci_request *ireq = sci_req->ireq;
+       struct isci_request *ireq = sci_req_to_ireq(sci_req);
        struct sas_task *task = isci_request_access_task(ireq);
        struct isci_tmf *isci_tmf = isci_request_access_tmf(ireq);
 
-       task_iu = sci_req->command_buffer;
+       task_iu = &sci_req->ssp.tmf;
 
        memset(task_iu, 0, sizeof(struct ssp_task_iu));
 
@@ -469,7 +311,7 @@ static void scu_ssp_reqeust_construct_task_context(
         * SCU Task Context
         */
        dma_addr = scic_io_request_get_dma_addr(sds_request,
-                                               sds_request->command_buffer);
+                                               &sds_request->ssp.cmd);
 
        task_context->command_iu_upper = upper_32_bits(dma_addr);
        task_context->command_iu_lower = lower_32_bits(dma_addr);
@@ -479,7 +321,7 @@ static void scu_ssp_reqeust_construct_task_context(
         * SCU Task Context
         */
        dma_addr = scic_io_request_get_dma_addr(sds_request,
-                                               sds_request->response_buffer);
+                                               &sds_request->ssp.rsp);
 
        task_context->response_iu_upper = upper_32_bits(dma_addr);
        task_context->response_iu_lower = lower_32_bits(dma_addr);
@@ -503,7 +345,7 @@ static void scu_ssp_io_request_construct_task_context(
 
        task_context->ssp_command_iu_length =
                sizeof(struct ssp_cmd_iu) / sizeof(u32);
-       task_context->type.ssp.frame_type = SCI_SAS_COMMAND_FRAME;
+       task_context->type.ssp.frame_type = SSP_COMMAND;
 
        switch (dir) {
        case DMA_FROM_DEVICE:
@@ -522,29 +364,10 @@ static void scu_ssp_io_request_construct_task_context(
                scic_sds_request_build_sgl(sci_req);
 }
 
-
-/**
- * This method will fill in the remainder of the io request object for SSP Task
- *    requests.
- * @sci_req:
- *
- */
-static void scic_sds_ssp_task_request_assign_buffers(
-       struct scic_sds_request *sci_req)
+static void scic_sds_ssp_task_request_assign_buffers(struct scic_sds_request *sci_req)
 {
-       /* Assign all of the buffer pointers */
-       sci_req->command_buffer =
-               scic_sds_ssp_task_request_get_command_buffer(sci_req);
-       sci_req->response_buffer =
-               scic_sds_ssp_task_request_get_response_buffer(sci_req);
-       sci_req->sgl_element_pair_buffer = NULL;
-
-       if (sci_req->was_tag_assigned_by_user == false) {
-               sci_req->task_context_buffer =
-                       scic_sds_ssp_task_request_get_task_context_buffer(sci_req);
-               sci_req->task_context_buffer =
-                       PTR_ALIGN(sci_req->task_context_buffer, SMP_CACHE_BYTES);
-       }
+       if (sci_req->was_tag_assigned_by_user == false)
+               sci_req->task_context_buffer = &sci_req->tc;
 }
 
 /**
@@ -573,7 +396,7 @@ static void scu_ssp_task_request_construct_task_context(
        task_context->priority                     = SCU_TASK_PRIORITY_HIGH;
        task_context->task_type                    = SCU_TASK_TYPE_RAW_FRAME;
        task_context->transfer_length_bytes        = 0;
-       task_context->type.ssp.frame_type          = SCI_SAS_TASK_FRAME;
+       task_context->type.ssp.frame_type          = SSP_TASK;
        task_context->ssp_command_iu_length =
                sizeof(struct ssp_task_iu) / sizeof(u32);
 }
@@ -606,7 +429,7 @@ scic_io_request_construct_sata(struct scic_sds_request *sci_req,
                               bool copy)
 {
        enum sci_status status = SCI_SUCCESS;
-       struct isci_request *ireq = sci_req->ireq;
+       struct isci_request *ireq = sci_req_to_ireq(sci_req);
        struct sas_task *task = isci_request_access_task(ireq);
 
        /* check for management protocols */
@@ -652,35 +475,23 @@ scic_io_request_construct_sata(struct scic_sds_request *sci_req,
        return status;
 }
 
-u32 scic_io_request_get_object_size(void)
-{
-       u32 ssp_request_size;
-       u32 stp_request_size;
-       u32 smp_request_size;
-
-       ssp_request_size = scic_sds_ssp_request_get_object_size();
-       stp_request_size = scic_sds_stp_request_get_object_size();
-       smp_request_size = scic_sds_smp_request_get_object_size();
-
-       return max(ssp_request_size, max(stp_request_size, smp_request_size));
-}
-
 enum sci_status scic_io_request_construct_basic_ssp(
        struct scic_sds_request *sci_req)
 {
-       struct isci_request *isci_request = sci_req->ireq;
+       struct isci_request *ireq = sci_req_to_ireq(sci_req);
+       struct sas_task *task = isci_request_access_task(ireq);
 
        sci_req->protocol = SCIC_SSP_PROTOCOL;
 
-       scu_ssp_io_request_construct_task_context(
-               sci_req,
-               isci_request_io_request_get_data_direction(isci_request),
-               isci_request_io_request_get_transfer_length(isci_request));
+       scu_ssp_io_request_construct_task_context(sci_req,
+                                                 task->data_dir,
+                                                 task->total_xfer_len);
 
        scic_sds_io_request_build_ssp_command_iu(sci_req);
 
-       sci_base_state_machine_change_state(&sci_req->state_machine,
-               SCI_BASE_REQUEST_STATE_CONSTRUCTED);
+       sci_base_state_machine_change_state(
+                       &sci_req->state_machine,
+                       SCI_BASE_REQUEST_STATE_CONSTRUCTED);
 
        return SCI_SUCCESS;
 }
@@ -707,21 +518,19 @@ enum sci_status scic_io_request_construct_basic_sata(
 {
        enum sci_status status;
        struct scic_sds_stp_request *stp_req;
-       u32 len;
-       enum dma_data_direction dir;
        bool copy = false;
-       struct isci_request *isci_request = sci_req->ireq;
+       struct isci_request *isci_request = sci_req_to_ireq(sci_req);
        struct sas_task *task = isci_request_access_task(isci_request);
 
-       stp_req = container_of(sci_req, typeof(*stp_req), parent);
-
+       stp_req = &sci_req->stp.req;
        sci_req->protocol = SCIC_STP_PROTOCOL;
 
-       len = isci_request_io_request_get_transfer_length(isci_request);
-       dir = isci_request_io_request_get_data_direction(isci_request);
        copy = (task->data_dir == DMA_NONE) ? false : true;
 
-       status = scic_io_request_construct_sata(sci_req, len, dir, copy);
+       status = scic_io_request_construct_sata(sci_req,
+                                               task->total_xfer_len,
+                                               task->data_dir,
+                                               copy);
 
        if (status == SCI_SUCCESS)
                sci_base_state_machine_change_state(&sci_req->state_machine,
@@ -731,11 +540,10 @@ enum sci_status scic_io_request_construct_basic_sata(
 }
 
 
-enum sci_status scic_task_request_construct_sata(
-       struct scic_sds_request *sci_req)
+enum sci_status scic_task_request_construct_sata(struct scic_sds_request *sci_req)
 {
        enum sci_status status = SCI_SUCCESS;
-       struct isci_request *ireq = sci_req->ireq;
+       struct isci_request *ireq = sci_req_to_ireq(sci_req);
 
        /* check for management protocols */
        if (ireq->ttype == tmf_task) {
@@ -776,21 +584,6 @@ u32 scic_request_get_controller_status(
        return sci_req->scu_status;
 }
 
-
-void *scic_io_request_get_command_iu_address(
-       struct scic_sds_request *sci_req)
-{
-       return sci_req->command_buffer;
-}
-
-
-void *scic_io_request_get_response_iu_address(
-       struct scic_sds_request *sci_req)
-{
-       return sci_req->response_buffer;
-}
-
-
 #define SCU_TASK_CONTEXT_SRAM 0x200000
 u32 scic_io_request_get_number_of_bytes_transferred(
        struct scic_sds_request *scic_sds_request)
@@ -946,10 +739,10 @@ void scic_sds_io_request_copy_response(struct scic_sds_request *sci_req)
        void *resp_buf;
        u32 len;
        struct ssp_response_iu *ssp_response;
-       struct isci_request *ireq = sci_req->ireq;
+       struct isci_request *ireq = sci_req_to_ireq(sci_req);
        struct isci_tmf *isci_tmf = isci_request_access_tmf(ireq);
 
-       ssp_response = sci_req->response_buffer;
+       ssp_response = &sci_req->ssp.rsp;
 
        resp_buf = &isci_tmf->resp.resp_iu;
 
@@ -1117,11 +910,11 @@ scic_sds_request_started_state_tc_completion_handler(
                 * truly a failed request or a good request that just got
                 * completed early.
                 */
-               struct ssp_response_iu *resp = sci_req->response_buffer;
+               struct ssp_response_iu *resp = &sci_req->ssp.rsp;
                ssize_t word_cnt = SSP_RESP_IU_MAX_SIZE / sizeof(u32);
 
-               sci_swab32_cpy(sci_req->response_buffer,
-                              sci_req->response_buffer,
+               sci_swab32_cpy(&sci_req->ssp.rsp,
+                              &sci_req->ssp.rsp,
                               word_cnt);
 
                if (resp->status == 0) {
@@ -1142,8 +935,8 @@ scic_sds_request_started_state_tc_completion_handler(
        {
                ssize_t word_cnt = SSP_RESP_IU_MAX_SIZE / sizeof(u32);
 
-               sci_swab32_cpy(sci_req->response_buffer,
-                              sci_req->response_buffer,
+               sci_swab32_cpy(&sci_req->ssp.rsp,
+                              &sci_req->ssp.rsp,
                               word_cnt);
 
                scic_sds_request_set_status(sci_req,
@@ -1158,7 +951,7 @@ scic_sds_request_started_state_tc_completion_handler(
                 * guaranteed to be received before this completion status is
                 * posted?
                 */
-               resp_iu = sci_req->response_buffer;
+               resp_iu = &sci_req->ssp.rsp;
                datapres = resp_iu->datapres;
 
                if ((datapres == 0x01) || (datapres == 0x02)) {
@@ -1265,14 +1058,19 @@ scic_sds_request_started_state_frame_handler(struct scic_sds_request *sci_req,
                                             u32 frame_index)
 {
        enum sci_status status;
-       struct sci_ssp_frame_header *frame_header;
+       u32 *frame_header;
+       struct ssp_frame_hdr ssp_hdr;
+       ssize_t word_cnt;
 
        status = scic_sds_unsolicited_frame_control_get_header(
                &(scic_sds_request_get_controller(sci_req)->uf_control),
                frame_index,
                (void **)&frame_header);
 
-       if (frame_header->frame_type == SCI_SAS_RESPONSE_FRAME) {
+       word_cnt = sizeof(struct ssp_frame_hdr) / sizeof(u32);
+       sci_swab32_cpy(&ssp_hdr, frame_header, word_cnt);
+
+       if (ssp_hdr.frame_type == SSP_RESPONSE) {
                struct ssp_response_iu *resp_iu;
                ssize_t word_cnt = SSP_RESP_IU_MAX_SIZE / sizeof(u32);
 
@@ -1281,10 +1079,10 @@ scic_sds_request_started_state_frame_handler(struct scic_sds_request *sci_req,
                        frame_index,
                        (void **)&resp_iu);
 
-               sci_swab32_cpy(sci_req->response_buffer,
+               sci_swab32_cpy(&sci_req->ssp.rsp,
                               resp_iu, word_cnt);
 
-               resp_iu = sci_req->response_buffer;
+               resp_iu = &sci_req->ssp.rsp;
 
                if ((resp_iu->datapres == 0x01) ||
                    (resp_iu->datapres == 0x02)) {
@@ -1303,7 +1101,7 @@ scic_sds_request_started_state_frame_handler(struct scic_sds_request *sci_req,
                        __func__,
                        sci_req,
                        frame_index,
-                       frame_header->frame_type);
+                       ssp_hdr.frame_type);
        }
 
        /*
@@ -1542,8 +1340,8 @@ static void scic_sds_request_completed_state_enter(void *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_req->ireq;
+       struct isci_host *ihost = scic_to_ihost(scic);
+       struct isci_request *ireq = sci_req_to_ireq(sci_req);
 
        SET_STATE_HANDLER(sci_req,
                          scic_sds_request_state_handler_table,
@@ -1625,16 +1423,13 @@ static const struct sci_base_state scic_sds_request_state_table[] = {
 
 static void scic_sds_general_request_construct(struct scic_sds_controller *scic,
                                               struct scic_sds_remote_device *sci_dev,
-                                              u16 io_tag,
-                                              void *user_io_request_object,
-                                              struct scic_sds_request *sci_req)
+                                              u16 io_tag, struct scic_sds_request *sci_req)
 {
        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);
 
        sci_req->io_tag = io_tag;
-       sci_req->user_request = user_io_request_object;
        sci_req->owning_controller = scic;
        sci_req->target_device = sci_dev;
        sci_req->has_started_substate_machine = false;
@@ -1662,20 +1457,13 @@ static void scic_sds_general_request_construct(struct scic_sds_controller *scic,
 enum sci_status
 scic_io_request_construct(struct scic_sds_controller *scic,
                          struct scic_sds_remote_device *sci_dev,
-                         u16 io_tag,
-                         void *user_req,
-                         struct scic_sds_request *sci_req,
-                         struct scic_sds_request **new_sci_req)
+                         u16 io_tag, struct scic_sds_request *sci_req)
 {
        struct domain_device *dev = sci_dev_to_domain(sci_dev);
        enum sci_status status = SCI_SUCCESS;
 
        /* Build the common part of the request */
-       scic_sds_general_request_construct(scic,
-                                          sci_dev,
-                                          io_tag,
-                                          user_req,
-                                          sci_req);
+       scic_sds_general_request_construct(scic, sci_dev, io_tag, sci_req);
 
        if (sci_dev->rnc.remote_node_index ==
                        SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX)
@@ -1686,20 +1474,16 @@ scic_io_request_construct(struct scic_sds_controller *scic,
        else if ((dev->dev_type == SATA_DEV) ||
                 (dev->tproto & SAS_PROTOCOL_STP)) {
                scic_sds_stp_request_assign_buffers(sci_req);
-               memset(sci_req->command_buffer,
-                      0,
-                      sizeof(struct host_to_dev_fis));
+               memset(&sci_req->stp.cmd, 0, sizeof(sci_req->stp.cmd));
        } else if (dev_is_expander(dev)) {
                scic_sds_smp_request_assign_buffers(sci_req);
-               memset(sci_req->command_buffer, 0, sizeof(struct smp_req));
+               memset(&sci_req->smp.cmd, 0, sizeof(sci_req->smp.cmd));
        } else
                status = SCI_FAILURE_UNSUPPORTED_PROTOCOL;
 
        if (status == SCI_SUCCESS) {
-               memset(sci_req->task_context_buffer,
-                      0,
-                      SCI_FIELD_OFFSET(struct scu_task_context, sgl_pair_ab));
-               *new_sci_req = sci_req;
+               memset(sci_req->task_context_buffer, 0,
+                      offsetof(struct scu_task_context, sgl_pair_ab));
        }
 
        return status;
@@ -1707,18 +1491,13 @@ scic_io_request_construct(struct scic_sds_controller *scic,
 
 enum sci_status scic_task_request_construct(struct scic_sds_controller *scic,
                                            struct scic_sds_remote_device *sci_dev,
-                                           u16 io_tag,
-                                           void *user_io_request_object,
-                                           struct scic_sds_request *sci_req,
-                                           struct scic_sds_request **new_sci_req)
+                                           u16 io_tag, struct scic_sds_request *sci_req)
 {
        struct domain_device *dev = sci_dev_to_domain(sci_dev);
        enum sci_status status = SCI_SUCCESS;
 
        /* Build the common part of the request */
-       scic_sds_general_request_construct(scic, sci_dev, io_tag,
-                                          user_io_request_object,
-                                          sci_req);
+       scic_sds_general_request_construct(scic, sci_dev, io_tag, sci_req);
 
        if (dev->dev_type == SAS_END_DEV) {
                scic_sds_ssp_task_request_assign_buffers(sci_req);
@@ -1740,7 +1519,6 @@ enum sci_status scic_task_request_construct(struct scic_sds_controller *scic,
        if (status == SCI_SUCCESS) {
                sci_req->is_task_management_request = true;
                memset(sci_req->task_context_buffer, 0, sizeof(struct scu_task_context));
-               *new_sci_req = sci_req;
        }
 
        return status;