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);
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;
*/
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;
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;
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;
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;
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);
{
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);
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;
*/
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,
*/
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,
*/
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,
*/
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);
*/
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,
*/
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;
*/
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,
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);
/* 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
);
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.
*/
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.
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,
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,
/* 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
);
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,
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,
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,
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,
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);
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,
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,
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,
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,
}
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);
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,
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,
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
);
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,
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;
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,
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);
#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)
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:
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? */
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(
#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.
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) {