Lines Matching defs:itcw
16 #include <asm/itcw.h>
19 * struct itcw - incremental tcw helper data type
26 * The itcw construction functions take care of overall data integrity:
37 * - total number of bytes required per itcw may not exceed 4k bytes
41 * struct itcw *itcw;
49 * itcw = itcw_init(buffer, size, ITCW_OP_READ, 1, 2, 0);
50 * if (IS_ERR(itcw))
51 * return PTR_ER(itcw);
52 * itcw_add_dcw(itcw, 0x2, 0, NULL, 0, 72);
53 * itcw_add_tidaw(itcw, 0, 0x30000, 20);
54 * itcw_add_tidaw(itcw, 0, 0x40000, 52);
55 * itcw_finalize(itcw);
58 struct itcw {
68 * itcw_get_tcw - return pointer to tcw associated with the itcw
69 * @itcw: address of the itcw
71 * Return pointer to the tcw associated with the itcw.
73 struct tcw *itcw_get_tcw(struct itcw *itcw)
75 return itcw->tcw;
80 * itcw_calc_size - return the size of an itcw with the given parameters
87 * Calculate and return the number of bytes required to hold an itcw with the
100 len = sizeof(struct itcw);
178 struct itcw *itcw_init(void *buffer, size_t size, int op, int intrg,
181 struct itcw *itcw;
194 chunk = fit_chunk(&start, end, sizeof(struct itcw), 1, 0);
197 itcw = chunk;
203 itcw->max_tidaws = max_tidaws + cross_count;
208 itcw->intrg_max_tidaws = intrg_max_tidaws + cross_count;
213 itcw->tcw = chunk;
214 tcw_init(itcw->tcw, (op == ITCW_OP_READ) ? 1 : 0,
221 itcw->intrg_tcw = chunk;
222 tcw_init(itcw->intrg_tcw, 1, 0);
223 tcw_set_intrg(itcw->tcw, itcw->intrg_tcw);
228 itcw->max_tidaws, 16, 0);
231 tcw_set_data(itcw->tcw, chunk, 1);
236 itcw->intrg_max_tidaws, 16, 0);
239 tcw_set_data(itcw->intrg_tcw, chunk, 1);
246 tcw_set_tsb(itcw->tcw, chunk);
253 tcw_set_tsb(itcw->intrg_tcw, chunk);
260 tcw_set_tccb(itcw->tcw, chunk);
267 tcw_set_tccb(itcw->intrg_tcw, chunk);
270 tcw_finalize(itcw->intrg_tcw, 0);
272 return itcw;
277 * itcw_add_dcw - add a dcw to the itcw
278 * @itcw: address of the itcw
285 * Add a new dcw to the specified itcw by writing the dcw information specified
293 struct dcw *itcw_add_dcw(struct itcw *itcw, u8 cmd, u8 flags, void *cd,
296 return tccb_add_dcw(tcw_get_tccb(itcw->tcw), TCCB_MAX_SIZE, cmd,
302 * itcw_add_tidaw - add a tidaw to the itcw
303 * @itcw: address of the itcw
308 * Add a new tidaw to the input/output data tidaw-list of the specified itcw
317 struct tidaw *itcw_add_tidaw(struct itcw *itcw, u8 flags, void *addr, u32 count)
321 if (itcw->num_tidaws >= itcw->max_tidaws)
328 following = ((struct tidaw *) tcw_get_data(itcw->tcw))
329 + itcw->num_tidaws + 1;
330 if (itcw->num_tidaws && !((unsigned long) following & ~PAGE_MASK)) {
331 tcw_add_tidaw(itcw->tcw, itcw->num_tidaws++,
333 if (itcw->num_tidaws >= itcw->max_tidaws)
336 return tcw_add_tidaw(itcw->tcw, itcw->num_tidaws++, flags, addr, count);
341 * itcw_set_data - set data address and tida flag of the itcw
342 * @itcw: address of the itcw
347 * Set the input/output data address of the itcw (depending on the value of the
351 void itcw_set_data(struct itcw *itcw, void *addr, int use_tidal)
353 tcw_set_data(itcw->tcw, addr, use_tidal);
358 * itcw_finalize - calculate length and count fields of the itcw
359 * @itcw: address of the itcw
366 void itcw_finalize(struct itcw *itcw)
368 tcw_finalize(itcw->tcw, itcw->num_tidaws);