diff options
author | Dave Jiang <dave.jiang@intel.com> | 2011-05-04 21:01:22 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:04:46 -0400 |
commit | 2ec53eb4d5b301e5c9c386da5685894d572772a5 (patch) | |
tree | 5ae482456e06c036f61724318019299b3a3ca359 /drivers/scsi/isci/request.c | |
parent | af5ae89350840b9d724fc4fb81d928673bffdd4d (diff) |
isci: Fixup of smp request
The struct smp_request data structure has be fixed up for Linux consumption.
This probably should go to scsi/sas.h eventually.
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/request.c')
-rw-r--r-- | drivers/scsi/isci/request.c | 48 |
1 files changed, 19 insertions, 29 deletions
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c index 501df3ca4280..36adc1589efa 100644 --- a/drivers/scsi/isci/request.c +++ b/drivers/scsi/isci/request.c | |||
@@ -61,7 +61,8 @@ | |||
61 | #include "request.h" | 61 | #include "request.h" |
62 | #include "sata.h" | 62 | #include "sata.h" |
63 | #include "scu_completion_codes.h" | 63 | #include "scu_completion_codes.h" |
64 | #include "core/scic_sds_request.h" | 64 | #include "scic_sds_request.h" |
65 | #include "sas.h" | ||
65 | 66 | ||
66 | static enum sci_status isci_request_ssp_request_construct( | 67 | static enum sci_status isci_request_ssp_request_construct( |
67 | struct isci_request *request) | 68 | struct isci_request *request) |
@@ -113,47 +114,37 @@ static enum sci_status isci_request_stp_request_construct( | |||
113 | return status; | 114 | return status; |
114 | } | 115 | } |
115 | 116 | ||
116 | /** | 117 | /* |
117 | * isci_smp_request_build() - This function builds the smp request object. | 118 | * isci_smp_request_build() - This function builds the smp request. |
118 | * @isci_host: This parameter specifies the ISCI host object | 119 | * @ireq: This parameter points to the isci_request allocated in the |
119 | * @request: This parameter points to the isci_request object allocated in the | ||
120 | * request construct function. | 120 | * request construct function. |
121 | * @sci_device: This parameter is the handle for the sci core's remote device | ||
122 | * object that is the destination for this request. | ||
123 | * | 121 | * |
124 | * SCI_SUCCESS on successfull completion, or specific failure code. | 122 | * SCI_SUCCESS on successfull completion, or specific failure code. |
125 | */ | 123 | */ |
126 | static enum sci_status isci_smp_request_build( | 124 | static enum sci_status isci_smp_request_build(struct isci_request *ireq) |
127 | struct isci_request *request) | ||
128 | { | 125 | { |
129 | enum sci_status status = SCI_FAILURE; | 126 | enum sci_status status = SCI_FAILURE; |
130 | struct sas_task *task = isci_request_access_task(request); | 127 | struct sas_task *task = isci_request_access_task(ireq); |
128 | struct scic_sds_request *sci_req = ireq->sci_request_handle; | ||
129 | void *cmd_iu = sci_req->command_buffer; | ||
131 | 130 | ||
132 | void *command_iu_address = | 131 | dev_dbg(&ireq->isci_host->pdev->dev, |
133 | scic_io_request_get_command_iu_address( | 132 | "%s: request = %p\n", __func__, ireq); |
134 | request->sci_request_handle | ||
135 | ); | ||
136 | 133 | ||
137 | dev_dbg(&request->isci_host->pdev->dev, | 134 | dev_dbg(&ireq->isci_host->pdev->dev, |
138 | "%s: request = %p\n", | ||
139 | __func__, | ||
140 | request); | ||
141 | dev_dbg(&request->isci_host->pdev->dev, | ||
142 | "%s: smp_req len = %d\n", | 135 | "%s: smp_req len = %d\n", |
143 | __func__, | 136 | __func__, |
144 | task->smp_task.smp_req.length); | 137 | task->smp_task.smp_req.length); |
145 | 138 | ||
146 | /* copy the smp_command to the address; */ | 139 | /* copy the smp_command to the address; */ |
147 | sg_copy_to_buffer(&task->smp_task.smp_req, 1, | 140 | sg_copy_to_buffer(&task->smp_task.smp_req, 1, |
148 | (char *)command_iu_address, | 141 | (char *)cmd_iu, |
149 | sizeof(struct smp_request) | 142 | sizeof(struct smp_req)); |
150 | ); | ||
151 | 143 | ||
152 | status = scic_io_request_construct_smp(request->sci_request_handle); | 144 | status = scic_io_request_construct_smp(sci_req); |
153 | if (status != SCI_SUCCESS) | 145 | if (status != SCI_SUCCESS) |
154 | dev_warn(&request->isci_host->pdev->dev, | 146 | dev_warn(&ireq->isci_host->pdev->dev, |
155 | "%s: scic_io_request_construct_smp failed with " | 147 | "%s: failed with status = %d\n", |
156 | "status = %d\n", | ||
157 | __func__, | 148 | __func__, |
158 | status); | 149 | status); |
159 | 150 | ||
@@ -1073,9 +1064,8 @@ void isci_request_io_request_complete( | |||
1073 | sg_copy_from_buffer( | 1064 | sg_copy_from_buffer( |
1074 | &task->smp_task.smp_resp, 1, | 1065 | &task->smp_task.smp_resp, 1, |
1075 | command_iu_address | 1066 | command_iu_address |
1076 | + sizeof(struct smp_request), | 1067 | + sizeof(struct smp_req), |
1077 | sizeof(struct smp_resp) | 1068 | sizeof(struct smp_resp)); |
1078 | ); | ||
1079 | } else if (completion_status | 1069 | } else if (completion_status |
1080 | == SCI_IO_SUCCESS_IO_DONE_EARLY) { | 1070 | == SCI_IO_SUCCESS_IO_DONE_EARLY) { |
1081 | 1071 | ||