提交 827a84d4 编写于 作者: D Dan Williams

isci: move stp request info to scic_sds_request

In preparation for unifying allocation of all request information make stp
data available in all requests.  Incidentally collapse indentation.
Signed-off-by: NDan Williams <dan.j.williams@intel.com>
上级 e531381e
...@@ -710,8 +710,7 @@ enum sci_status scic_io_request_construct_basic_sata( ...@@ -710,8 +710,7 @@ enum sci_status scic_io_request_construct_basic_sata(
struct isci_request *isci_request = sci_req->ireq; struct isci_request *isci_request = sci_req->ireq;
struct sas_task *task = isci_request_access_task(isci_request); 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; sci_req->protocol = SCIC_STP_PROTOCOL;
copy = (task->data_dir == DMA_NONE) ? false : true; copy = (task->data_dir == DMA_NONE) ? false : true;
......
...@@ -56,16 +56,10 @@ ...@@ -56,16 +56,10 @@
#ifndef _SCIC_SDS_IO_REQUEST_H_ #ifndef _SCIC_SDS_IO_REQUEST_H_
#define _SCIC_SDS_IO_REQUEST_H_ #define _SCIC_SDS_IO_REQUEST_H_
/**
* This file contains the structures, constants and prototypes for the
* SCIC_SDS_IO_REQUEST object.
*
*
*/
#include "scic_io_request.h" #include "scic_io_request.h"
#include "sci_base_state_machine.h" #include "sci_base_state_machine.h"
#include "scu_task_context.h" #include "scu_task_context.h"
#include "scic_sds_stp_request.h"
struct scic_sds_controller; struct scic_sds_controller;
struct scic_sds_remote_device; struct scic_sds_remote_device;
...@@ -233,8 +227,19 @@ struct scic_sds_request { ...@@ -233,8 +227,19 @@ struct scic_sds_request {
*/ */
u8 device_sequence; u8 device_sequence;
struct {
struct scic_sds_stp_request req;
} stp;
}; };
static inline struct scic_sds_request *to_sci_req(struct scic_sds_stp_request *stp_req)
{
struct scic_sds_request *sci_req;
sci_req = container_of(stp_req, typeof(*sci_req), stp.req);
return sci_req;
}
/** /**
* enum sci_base_request_states - This enumeration depicts all the states for * enum sci_base_request_states - This enumeration depicts all the states for
* the common request state machine. * the common request state machine.
......
...@@ -58,17 +58,8 @@ ...@@ -58,17 +58,8 @@
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <scsi/sas.h> #include <scsi/sas.h>
#include "scic_sds_request.h"
/**
* This structure represents the additional information that is required to
* handle SATA PIO requests.
*
*
*/
struct scic_sds_stp_request { struct scic_sds_stp_request {
struct scic_sds_request parent;
struct dev_to_host_fis d2h_reg_fis; struct dev_to_host_fis d2h_reg_fis;
union { union {
...@@ -125,7 +116,6 @@ struct scic_sds_stp_request { ...@@ -125,7 +116,6 @@ struct scic_sds_stp_request {
u32 device_preferred_cdb_length; u32 device_preferred_cdb_length;
} packet; } packet;
} type; } type;
}; };
/** /**
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
#include "request.h" #include "request.h"
#include "sata.h" #include "sata.h"
#include "task.h" #include "task.h"
#include "scic_sds_stp_request.h" #include "scic_sds_request.h"
/** /**
* isci_task_refuse() - complete the request to the upper layer driver in * isci_task_refuse() - complete the request to the upper layer driver in
...@@ -1435,8 +1435,7 @@ isci_task_request_complete(struct isci_host *ihost, ...@@ -1435,8 +1435,7 @@ isci_task_request_complete(struct isci_host *ihost,
struct isci_tmf *tmf = isci_request_access_tmf(ireq); struct isci_tmf *tmf = isci_request_access_tmf(ireq);
struct completion *tmf_complete; struct completion *tmf_complete;
struct scic_sds_request *sci_req = ireq->sci_request_handle; struct scic_sds_request *sci_req = ireq->sci_request_handle;
struct scic_sds_stp_request *stp_req = struct scic_sds_stp_request *stp_req = &sci_req->stp.req;
container_of(sci_req, typeof(*stp_req), parent);
dev_dbg(&ihost->pdev->dev, dev_dbg(&ihost->pdev->dev,
"%s: request = %p, status=%d\n", "%s: request = %p, status=%d\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册