aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/unsolicited_frame_control.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/isci/unsolicited_frame_control.c')
-rw-r--r--drivers/scsi/isci/unsolicited_frame_control.c57
1 files changed, 14 insertions, 43 deletions
diff --git a/drivers/scsi/isci/unsolicited_frame_control.c b/drivers/scsi/isci/unsolicited_frame_control.c
index a0e6f89fc6a1..e9e1e2abacb9 100644
--- a/drivers/scsi/isci/unsolicited_frame_control.c
+++ b/drivers/scsi/isci/unsolicited_frame_control.c
@@ -57,10 +57,10 @@
57#include "unsolicited_frame_control.h" 57#include "unsolicited_frame_control.h"
58#include "registers.h" 58#include "registers.h"
59 59
60int scic_sds_unsolicited_frame_control_construct(struct isci_host *ihost) 60int sci_unsolicited_frame_control_construct(struct isci_host *ihost)
61{ 61{
62 struct scic_sds_unsolicited_frame_control *uf_control = &ihost->uf_control; 62 struct sci_unsolicited_frame_control *uf_control = &ihost->uf_control;
63 struct scic_sds_unsolicited_frame *uf; 63 struct sci_unsolicited_frame *uf;
64 u32 buf_len, header_len, i; 64 u32 buf_len, header_len, i;
65 dma_addr_t dma; 65 dma_addr_t dma;
66 size_t size; 66 size_t size;
@@ -139,23 +139,14 @@ int scic_sds_unsolicited_frame_control_construct(struct isci_host *ihost)
139 return 0; 139 return 0;
140} 140}
141 141
142/** 142enum sci_status sci_unsolicited_frame_control_get_header(struct sci_unsolicited_frame_control *uf_control,
143 * This method returns the frame header for the specified frame index. 143 u32 frame_index,
144 * @uf_control: 144 void **frame_header)
145 * @frame_index:
146 * @frame_header:
147 *
148 * enum sci_status
149 */
150enum sci_status scic_sds_unsolicited_frame_control_get_header(
151 struct scic_sds_unsolicited_frame_control *uf_control,
152 u32 frame_index,
153 void **frame_header)
154{ 145{
155 if (frame_index < SCU_MAX_UNSOLICITED_FRAMES) { 146 if (frame_index < SCU_MAX_UNSOLICITED_FRAMES) {
156 /* 147 /* Skip the first word in the frame since this is a controll word used
157 * Skip the first word in the frame since this is a controll word used 148 * by the hardware.
158 * by the hardware. */ 149 */
159 *frame_header = &uf_control->buffers.array[frame_index].header->data; 150 *frame_header = &uf_control->buffers.array[frame_index].header->data;
160 151
161 return SCI_SUCCESS; 152 return SCI_SUCCESS;
@@ -164,18 +155,9 @@ enum sci_status scic_sds_unsolicited_frame_control_get_header(
164 return SCI_FAILURE_INVALID_PARAMETER_VALUE; 155 return SCI_FAILURE_INVALID_PARAMETER_VALUE;
165} 156}
166 157
167/** 158enum sci_status sci_unsolicited_frame_control_get_buffer(struct sci_unsolicited_frame_control *uf_control,
168 * This method returns the frame buffer for the specified frame index. 159 u32 frame_index,
169 * @uf_control: 160 void **frame_buffer)
170 * @frame_index:
171 * @frame_buffer:
172 *
173 * enum sci_status
174 */
175enum sci_status scic_sds_unsolicited_frame_control_get_buffer(
176 struct scic_sds_unsolicited_frame_control *uf_control,
177 u32 frame_index,
178 void **frame_buffer)
179{ 161{
180 if (frame_index < SCU_MAX_UNSOLICITED_FRAMES) { 162 if (frame_index < SCU_MAX_UNSOLICITED_FRAMES) {
181 *frame_buffer = uf_control->buffers.array[frame_index].buffer; 163 *frame_buffer = uf_control->buffers.array[frame_index].buffer;
@@ -186,19 +168,8 @@ enum sci_status scic_sds_unsolicited_frame_control_get_buffer(
186 return SCI_FAILURE_INVALID_PARAMETER_VALUE; 168 return SCI_FAILURE_INVALID_PARAMETER_VALUE;
187} 169}
188 170
189/** 171bool sci_unsolicited_frame_control_release_frame(struct sci_unsolicited_frame_control *uf_control,
190 * This method releases the frame once this is done the frame is available for 172 u32 frame_index)
191 * re-use by the hardware. The data contained in the frame header and frame
192 * buffer is no longer valid.
193 * @uf_control: This parameter specifies the UF control object
194 * @frame_index: This parameter specifies the frame index to attempt to release.
195 *
196 * This method returns an indication to the caller as to whether the
197 * unsolicited frame get pointer should be updated.
198 */
199bool scic_sds_unsolicited_frame_control_release_frame(
200 struct scic_sds_unsolicited_frame_control *uf_control,
201 u32 frame_index)
202{ 173{
203 u32 frame_get; 174 u32 frame_get;
204 u32 frame_cycle; 175 u32 frame_cycle;