Lines Matching defs:itcw
17 #include <asm/itcw.h>
20 * struct itcw - incremental tcw helper data type
27 * The itcw construction functions take care of overall data integrity:
38 * - total number of bytes required per itcw may not exceed 4k bytes
42 * struct itcw *itcw;
50 * itcw = itcw_init(buffer, size, ITCW_OP_READ, 1, 2, 0);
51 * if (IS_ERR(itcw))
52 * return PTR_ER(itcw);
53 * itcw_add_dcw(itcw, 0x2, 0, NULL, 0, 72);
54 * itcw_add_tidaw(itcw, 0, 0x30000, 20);
55 * itcw_add_tidaw(itcw, 0, 0x40000, 52);
56 * itcw_finalize(itcw);
59 struct itcw {
69 * itcw_get_tcw - return pointer to tcw associated with the itcw
70 * @itcw: address of the itcw
72 * Return pointer to the tcw associated with the itcw.
74 struct tcw *itcw_get_tcw(struct itcw *itcw)
76 return itcw->tcw;
81 * itcw_calc_size - return the size of an itcw with the given parameters
88 * Calculate and return the number of bytes required to hold an itcw with the
101 len = sizeof(struct itcw);
179 struct itcw *itcw_init(void *buffer, size_t size, int op, int intrg,
182 struct itcw *itcw;
195 chunk = fit_chunk(&start, end, sizeof(struct itcw), 1, 0);
198 itcw = chunk;
204 itcw->max_tidaws = max_tidaws + cross_count;
209 itcw->intrg_max_tidaws = intrg_max_tidaws + cross_count;
214 itcw->tcw = chunk;
215 tcw_init(itcw->tcw, (op == ITCW_OP_READ) ? 1 : 0,
222 itcw->intrg_tcw = chunk;
223 tcw_init(itcw->intrg_tcw, 1, 0);
224 tcw_set_intrg(itcw->tcw, itcw->intrg_tcw);
229 itcw->max_tidaws, 16, 0);
232 tcw_set_data(itcw->tcw, chunk, 1);
237 itcw->intrg_max_tidaws, 16, 0);
240 tcw_set_data(itcw->intrg_tcw, chunk, 1);
247 tcw_set_tsb(itcw->tcw, chunk);
254 tcw_set_tsb(itcw->intrg_tcw, chunk);
261 tcw_set_tccb(itcw->tcw, chunk);
268 tcw_set_tccb(itcw->intrg_tcw, chunk);
271 tcw_finalize(itcw->intrg_tcw, 0);
273 return itcw;
278 * itcw_add_dcw - add a dcw to the itcw
279 * @itcw: address of the itcw
286 * Add a new dcw to the specified itcw by writing the dcw information specified
294 struct dcw *itcw_add_dcw(struct itcw *itcw, u8 cmd, u8 flags, void *cd,
297 return tccb_add_dcw(tcw_get_tccb(itcw->tcw), TCCB_MAX_SIZE, cmd,
303 * itcw_add_tidaw - add a tidaw to the itcw
304 * @itcw: address of the itcw
309 * Add a new tidaw to the input/output data tidaw-list of the specified itcw
318 struct tidaw *itcw_add_tidaw(struct itcw *itcw, u8 flags, void *addr, u32 count)
322 if (itcw->num_tidaws >= itcw->max_tidaws)
329 following = ((struct tidaw *) tcw_get_data(itcw->tcw))
330 + itcw->num_tidaws + 1;
331 if (itcw->num_tidaws && !((unsigned long) following & ~PAGE_MASK)) {
332 tcw_add_tidaw(itcw->tcw, itcw->num_tidaws++,
334 if (itcw->num_tidaws >= itcw->max_tidaws)
337 return tcw_add_tidaw(itcw->tcw, itcw->num_tidaws++, flags, addr, count);
342 * itcw_set_data - set data address and tida flag of the itcw
343 * @itcw: address of the itcw
348 * Set the input/output data address of the itcw (depending on the value of the
352 void itcw_set_data(struct itcw *itcw, void *addr, int use_tidal)
354 tcw_set_data(itcw->tcw, addr, use_tidal);
359 * itcw_finalize - calculate length and count fields of the itcw
360 * @itcw: address of the itcw
367 void itcw_finalize(struct itcw *itcw)
369 tcw_finalize(itcw->tcw, itcw->num_tidaws);