Lines Matching +full:address +full:- +full:address +full:- +full:data

1 // SPDX-License-Identifier: GPL-2.0
20 * tcw_get_intrg - return pointer to associated interrogate tcw
28 return dma32_to_virt(tcw->intrg); in tcw_get_intrg()
33 * tcw_get_data - return pointer to input/output data associated with tcw
36 * Return the input or output data address specified in the tcw depending
37 * on whether the r-bit or the w-bit is set. If neither bit is set, return
42 if (tcw->r) in tcw_get_data()
43 return dma64_to_virt(tcw->input); in tcw_get_data()
44 if (tcw->w) in tcw_get_data()
45 return dma64_to_virt(tcw->output); in tcw_get_data()
51 * tcw_get_tccb - return pointer to tccb associated with tcw
58 return dma64_to_virt(tcw->tccb); in tcw_get_tccb()
63 * tcw_get_tsb - return pointer to tsb associated with tcw
70 return dma64_to_virt(tcw->tsb); in tcw_get_tsb()
75 * tcw_init - initialize tcw data structure
77 * @r: initial value of the r-bit
78 * @w: initial value of the w-bit
80 * Initialize all fields of the specified tcw data structure with zero and
86 tcw->format = TCW_FORMAT_DEFAULT; in tcw_init()
87 tcw->flags = TCW_FLAGS_TIDAW_FORMAT(TCW_TIDAW_FORMAT_DEFAULT); in tcw_init()
89 tcw->r = 1; in tcw_init()
91 tcw->w = 1; in tcw_init()
97 return tccb->tcah.tcal - 12; in tca_size()
109 dcw = (struct dcw *) &tccb->tca[offset]; in calc_dcw_count()
110 count += dcw->count; in calc_dcw_count()
111 if (!(dcw->flags & DCW_FLAGS_CC)) in calc_dcw_count()
113 offset += sizeof(struct dcw) + ALIGN((int) dcw->cd_count, 4); in calc_dcw_count()
128 /* TODO: find out if padding applies to total of data in calc_cbc_size()
129 * transferred or data transferred by this tidaw. Assumption: in calc_cbc_size()
133 cbc_data = 4 + ALIGN(data_count, 4) - data_count; in calc_cbc_size()
142 * tcw_finalize - finalize tcw length fields and tidaw list
144 * @num_tidaws: the number of tidaws used to address input/output data or zero
147 * Calculate the input-/output-count and tccbl field in the tcw, add a
148 * tcat the tccb and terminate the data tidaw list if used.
150 * Note: in case input- or output-tida is used, the tidaw-list must be stored
152 * up-to-date.
164 tidaw[num_tidaws - 1].flags |= TIDAW_FLAGS_LAST; in tcw_finalize()
167 tcat = (struct tccb_tcat *) &tccb->tca[tca_size(tccb)]; in tcw_finalize()
171 if (tcw->w && (tcw->flags & TCW_FLAGS_OUTPUT_TIDA)) in tcw_finalize()
173 if (tcw->r) in tcw_finalize()
174 tcw->input_count = count; in tcw_finalize()
175 else if (tcw->w) in tcw_finalize()
176 tcw->output_count = count; in tcw_finalize()
177 tcat->count = ALIGN(count, 4) + 4; in tcw_finalize()
179 tcw->tccbl = (sizeof(struct tccb) + tca_size(tccb) + in tcw_finalize()
180 sizeof(struct tccb_tcat) - 20) >> 2; in tcw_finalize()
185 * tcw_set_intrg - set the interrogate tcw address of a tcw
186 * @tcw: the tcw address
187 * @intrg_tcw: the address of the interrogate tcw
189 * Set the address of the interrogate tcw in the specified tcw.
193 tcw->intrg = virt_to_dma32(intrg_tcw); in tcw_set_intrg()
198 * tcw_set_data - set data address and tida flag of a tcw
199 * @tcw: the tcw address
200 * @data: the data address
201 * @use_tidal: zero of the data address specifies a contiguous block of data,
202 * non-zero if it specifies a list if tidaws.
204 * Set the input/output data address of a tcw (depending on the value of the
205 * r-flag and w-flag). If @use_tidal is non-zero, the corresponding tida flag
208 void tcw_set_data(struct tcw *tcw, void *data, int use_tidal) in tcw_set_data() argument
210 if (tcw->r) { in tcw_set_data()
211 tcw->input = virt_to_dma64(data); in tcw_set_data()
213 tcw->flags |= TCW_FLAGS_INPUT_TIDA; in tcw_set_data()
214 } else if (tcw->w) { in tcw_set_data()
215 tcw->output = virt_to_dma64(data); in tcw_set_data()
217 tcw->flags |= TCW_FLAGS_OUTPUT_TIDA; in tcw_set_data()
223 * tcw_set_tccb - set tccb address of a tcw
224 * @tcw: the tcw address
225 * @tccb: the tccb address
227 * Set the address of the tccb in the specified tcw.
231 tcw->tccb = virt_to_dma64(tccb); in tcw_set_tccb()
236 * tcw_set_tsb - set tsb address of a tcw
237 * @tcw: the tcw address
238 * @tsb: the tsb address
240 * Set the address of the tsb in the specified tcw.
244 tcw->tsb = virt_to_dma64(tsb); in tcw_set_tsb()
249 * tccb_init - initialize tccb
250 * @tccb: the tccb address
252 * @sac: the service-action-code to be user
260 tccb->tcah.format = TCCB_FORMAT_DEFAULT; in tccb_init()
261 tccb->tcah.sac = sac; in tccb_init()
262 tccb->tcah.tcal = 12; in tccb_init()
267 * tsb_init - initialize tsb
268 * @tsb: the tsb address
279 * tccb_add_dcw - add a dcw to the tccb
280 * @tccb: the tccb address
284 * @cd: pointer to control data for this dcw or NULL if none is required
285 * @cd_count: number of control data bytes for this dcw
286 * @count: number of data bytes for this dcw
290 * a pointer to the newly added dcw on success or -%ENOSPC if the new dcw
308 return ERR_PTR(-ENOSPC); in tccb_add_dcw()
310 dcw = (struct dcw *) &tccb->tca[tca_offset]; in tccb_add_dcw()
312 dcw->cmd = cmd; in tccb_add_dcw()
313 dcw->flags = flags; in tccb_add_dcw()
314 dcw->count = count; in tccb_add_dcw()
315 dcw->cd_count = cd_count; in tccb_add_dcw()
317 memcpy(&dcw->cd[0], cd, cd_count); in tccb_add_dcw()
318 tccb->tcah.tcal += size; in tccb_add_dcw()
324 * tcw_add_tidaw - add a tidaw to a tcw
325 * @tcw: the tcw address
328 * @addr: address value for the new tidaw
331 * Add a new tidaw to the input/output data tidaw-list of the specified tcw
332 * (depending on the value of the r-flag and w-flag) and return a pointer to
335 * Note: the tidaw-list is assumed to be contiguous with no ttics. The caller
336 * must ensure that there is enough space for the new tidaw. The last-tidaw
344 /* Add tidaw to tidaw-list. */ in tcw_add_tidaw()
347 tidaw->flags = flags; in tcw_add_tidaw()
348 tidaw->count = count; in tcw_add_tidaw()
349 tidaw->addr = virt_to_dma64(addr); in tcw_add_tidaw()