Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254485
b: refs/heads/master
c: 2629826
h: refs/heads/master
i:
  254483: f16aa02
v: v3
  • Loading branch information
Dan Williams committed Jul 3, 2011
1 parent 487c21b commit d451903
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 114 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0d84366fbef557f92ef82ac9a224c57ffb3318bc
refs/heads/master: 26298264a5de6d46d6e872dfd4c5d14c3011666f
64 changes: 5 additions & 59 deletions trunk/drivers/scsi/isci/core/scic_sds_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,31 +124,6 @@
+ 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() -
*
Expand Down Expand Up @@ -184,24 +159,6 @@
+ 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
* **************************************************************************** */

/**
*
*
Expand All @@ -210,9 +167,7 @@
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;
+ scic_ssp_io_request_get_object_size();
}

/**
Expand Down Expand Up @@ -328,13 +283,8 @@ static void scic_sds_ssp_io_request_assign_buffers(
sci_req->response_buffer =
scic_sds_ssp_request_get_response_buffer(sci_req);

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)
Expand Down Expand Up @@ -530,12 +480,8 @@ static void scic_sds_ssp_task_request_assign_buffers(
sci_req->response_buffer =
scic_sds_ssp_task_request_get_response_buffer(sci_req);

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;
}

/**
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/scsi/isci/core/scic_sds_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ struct scic_sds_request {
void *command_buffer;
void *response_buffer;
struct scu_task_context *task_context_buffer;
struct scu_task_context tc ____cacheline_aligned;

/* could be larger with sg chaining */
#define SCU_SGL_SIZE ((SCU_IO_REQUEST_SGE_COUNT + 1) / 2)
Expand Down
37 changes: 4 additions & 33 deletions trunk/drivers/scsi/isci/core/scic_sds_smp_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ u32 scic_sds_smp_request_get_object_size(void)
{
return sizeof(struct scic_sds_request)
+ sizeof(struct smp_req)
+ sizeof(struct smp_resp)
+ sizeof(struct scu_task_context)
+ SMP_CACHE_BYTES;
+ sizeof(struct smp_resp);
}

/**
Expand All @@ -102,43 +100,16 @@ u32 scic_sds_smp_request_get_object_size(void)
(((char *)(scic_sds_smp_request_get_command_buffer(memory))) \
+ sizeof(struct smp_req))

/**
* scic_sds_smp_request_get_task_context_buffer() -
*
* This macro returs the task context buffer for the SMP request.
*/
#define scic_sds_smp_request_get_task_context_buffer(memory) \
((struct scu_task_context *)(\
((char *)(scic_sds_smp_request_get_response_buffer(memory))) \
+ sizeof(struct smp_resp) \
))



/**
* 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
*/

void scic_sds_smp_request_assign_buffers(
struct scic_sds_request *sci_req)
void scic_sds_smp_request_assign_buffers(struct scic_sds_request *sci_req)
{
/* Assign all of the buffer pointers */
sci_req->command_buffer =
scic_sds_smp_request_get_command_buffer(sci_req);
sci_req->response_buffer =
scic_sds_smp_request_get_response_buffer(sci_req);

if (sci_req->was_tag_assigned_by_user == false) {
sci_req->task_context_buffer =
scic_sds_smp_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;
}

/*
Expand Down
24 changes: 3 additions & 21 deletions trunk/drivers/scsi/isci/core/scic_sds_stp_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,6 @@
+ sizeof(struct host_to_dev_fis) \
))

/**
* scic_sds_stp_request_get_task_context_buffer() -
*
* This macro returns the address of the task context buffer in the io request
* memory
*/
#define scic_sds_stp_request_get_task_context_buffer(memory) \
((struct scu_task_context *)(\
((char *)(scic_sds_stp_request_get_response_buffer(memory))) \
+ SSP_RESP_IU_MAX_SIZE \
))

/**
*
*
Expand All @@ -114,9 +102,7 @@ u32 scic_sds_stp_request_get_object_size(void)
{
return sizeof(struct scic_sds_stp_request)
+ sizeof(struct host_to_dev_fis)
+ sizeof(struct dev_to_host_fis)
+ sizeof(struct scu_task_context)
+ SMP_CACHE_BYTES;
+ sizeof(struct dev_to_host_fis);
}

void scic_sds_stp_request_assign_buffers(struct scic_sds_request *sci_req)
Expand All @@ -126,12 +112,8 @@ void scic_sds_stp_request_assign_buffers(struct scic_sds_request *sci_req)
sci_req->command_buffer = scic_sds_stp_request_get_h2d_reg_buffer(stp_req);
sci_req->response_buffer = scic_sds_stp_request_get_response_buffer(stp_req);

if (sci_req->was_tag_assigned_by_user == false) {
sci_req->task_context_buffer =
scic_sds_stp_request_get_task_context_buffer(stp_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;
}

/**
Expand Down

0 comments on commit d451903

Please sign in to comment.