Lines Matching +full:non +full:- +full:continuous
1 // SPDX-License-Identifier: GPL-2.0
21 * struct itcw - incremental tcw helper data type
24 * tcw and associated tccb, tsb, data tidaw-list plus an optional interrogate
29 * - reset unused fields to zero
30 * - fill in required pointers
31 * - ensure required alignment for data structures
32 * - prevent data structures to cross 4k-byte boundary where required
33 * - calculate tccb-related length fields
34 * - optionally provide ready-made interrogate tcw and associated structures
37 * - tida only supported for data address, not for tccb
38 * - only contiguous tidaw-lists (no ttic)
39 * - total number of bytes required per itcw may not exceed 4k bytes
40 * - either read or write operation (may not work with r=0 and w=0)
50 * return -ENOMEM;
70 * itcw_get_tcw - return pointer to tcw associated with the itcw
77 return itcw->tcw; in itcw_get_tcw()
82 * itcw_calc_size - return the size of an itcw with the given parameters
83 * @intrg: if non-zero, add an interrogate tcw
94 * 4k-boundary where required.
124 cross_count = 1 + ((max_tidaws * sizeof(struct tidaw) - 1) in itcw_calc_size()
129 cross_count = 1 + ((intrg_max_tidaws * sizeof(struct tidaw) - 1) in itcw_calc_size()
150 return ERR_PTR(-ENOSPC); in fit_chunk()
156 * itcw_init - initialize incremental tcw data structure
161 * @intrg: if non-zero, add and initialize an interrogate tcw
172 * - no tccb tidal
173 * - input/output tidal is contiguous (no ttic)
174 * - total data should not exceed 4k
175 * - tcw specifies either read or write operation
193 return ERR_PTR(-EINVAL); in itcw_init()
203 cross_count = 1 + ((max_tidaws * sizeof(struct tidaw) - 1) in itcw_init()
205 itcw->max_tidaws = max_tidaws + cross_count; in itcw_init()
208 cross_count = 1 + ((intrg_max_tidaws * sizeof(struct tidaw) - 1) in itcw_init()
210 itcw->intrg_max_tidaws = intrg_max_tidaws + cross_count; in itcw_init()
215 itcw->tcw = chunk; in itcw_init()
216 tcw_init(itcw->tcw, (op == ITCW_OP_READ) ? 1 : 0, in itcw_init()
223 itcw->intrg_tcw = chunk; in itcw_init()
224 tcw_init(itcw->intrg_tcw, 1, 0); in itcw_init()
225 tcw_set_intrg(itcw->tcw, itcw->intrg_tcw); in itcw_init()
230 itcw->max_tidaws, 16, 0); in itcw_init()
233 tcw_set_data(itcw->tcw, chunk, 1); in itcw_init()
238 itcw->intrg_max_tidaws, 16, 0); in itcw_init()
241 tcw_set_data(itcw->intrg_tcw, chunk, 1); in itcw_init()
248 tcw_set_tsb(itcw->tcw, chunk); in itcw_init()
255 tcw_set_tsb(itcw->intrg_tcw, chunk); in itcw_init()
262 tcw_set_tccb(itcw->tcw, chunk); in itcw_init()
269 tcw_set_tccb(itcw->intrg_tcw, chunk); in itcw_init()
272 tcw_finalize(itcw->intrg_tcw, 0); in itcw_init()
279 * itcw_add_dcw - add a dcw to the itcw
289 * a pointer to the newly added dcw on success or -%ENOSPC if the new dcw
298 return tccb_add_dcw(tcw_get_tccb(itcw->tcw), TCCB_MAX_SIZE, cmd, in itcw_add_dcw()
304 * itcw_add_tidaw - add a tidaw to the itcw
310 * Add a new tidaw to the input/output data tidaw-list of the specified itcw
311 * (depending on the value of the r-flag and w-flag). Return a pointer to
312 * the new tidaw on success or -%ENOSPC if the new tidaw would exceed the
316 * this interface with the TTIC flag is not supported. The last-tidaw flag
323 if (itcw->num_tidaws >= itcw->max_tidaws) in itcw_add_tidaw()
324 return ERR_PTR(-ENOSPC); in itcw_add_tidaw()
330 following = ((struct tidaw *) tcw_get_data(itcw->tcw)) in itcw_add_tidaw()
331 + itcw->num_tidaws + 1; in itcw_add_tidaw()
332 if (itcw->num_tidaws && !((unsigned long) following & ~PAGE_MASK)) { in itcw_add_tidaw()
333 tcw_add_tidaw(itcw->tcw, itcw->num_tidaws++, in itcw_add_tidaw()
335 if (itcw->num_tidaws >= itcw->max_tidaws) in itcw_add_tidaw()
336 return ERR_PTR(-ENOSPC); in itcw_add_tidaw()
338 return tcw_add_tidaw(itcw->tcw, itcw->num_tidaws++, flags, addr, count); in itcw_add_tidaw()
343 * itcw_set_data - set data address and tida flag of the itcw
347 * non-zero if it specifies a list if tidaws.
350 * r-flag and w-flag). If @use_tidal is non-zero, the corresponding tida flag
355 tcw_set_data(itcw->tcw, addr, use_tidal); in itcw_set_data()
360 * itcw_finalize - calculate length and count fields of the itcw
363 * Calculate tcw input-/output-count and tccbl fields and add a tcat the tccb.
364 * In case input- or output-tida is used, the tidaw-list must be stored in
365 * continuous storage (no ttic). The tcal field in the tccb must be
366 * up-to-date.
370 tcw_finalize(itcw->tcw, itcw->num_tidaws); in itcw_finalize()