Skip to content

Commit

Permalink
isci: move stp request info to scic_sds_request
Browse files Browse the repository at this point in the history
In preparation for unifying allocation of all request information make stp
data available in all requests.  Incidentally collapse indentation.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Dan Williams committed Jul 3, 2011
1 parent e531381 commit 827a84d
Show file tree
Hide file tree
Showing 5 changed files with 313 additions and 435 deletions.
3 changes: 1 addition & 2 deletions drivers/scsi/isci/core/scic_sds_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,7 @@ enum sci_status scic_io_request_construct_basic_sata(
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);

stp_req = &sci_req->stp.req;
sci_req->protocol = SCIC_STP_PROTOCOL;

copy = (task->data_dir == DMA_NONE) ? false : true;
Expand Down
19 changes: 12 additions & 7 deletions drivers/scsi/isci/core/scic_sds_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,10 @@
#ifndef _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 "sci_base_state_machine.h"
#include "scu_task_context.h"
#include "scic_sds_stp_request.h"

struct scic_sds_controller;
struct scic_sds_remote_device;
Expand Down Expand Up @@ -233,8 +227,19 @@ struct scic_sds_request {
*/
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
* the common request state machine.
Expand Down
Loading

0 comments on commit 827a84d

Please sign in to comment.