Lines Matching defs:tcw
19 * tcw_get_intrg - return pointer to associated interrogate tcw
20 * @tcw: pointer to the original tcw
22 * Return a pointer to the interrogate tcw associated with the specified tcw
23 * or %NULL if there is no associated interrogate tcw.
25 struct tcw *tcw_get_intrg(struct tcw *tcw)
27 return (struct tcw *) ((addr_t) tcw->intrg);
32 * tcw_get_data - return pointer to input/output data associated with tcw
33 * @tcw: pointer to the tcw
35 * Return the input or output data address specified in the tcw depending
39 void *tcw_get_data(struct tcw *tcw)
41 if (tcw->r)
42 return (void *) ((addr_t) tcw->input);
43 if (tcw->w)
44 return (void *) ((addr_t) tcw->output);
50 * tcw_get_tccb - return pointer to tccb associated with tcw
51 * @tcw: pointer to the tcw
53 * Return pointer to the tccb associated with this tcw.
55 struct tccb *tcw_get_tccb(struct tcw *tcw)
57 return (struct tccb *) ((addr_t) tcw->tccb);
62 * tcw_get_tsb - return pointer to tsb associated with tcw
63 * @tcw: pointer to the tcw
65 * Return pointer to the tsb associated with this tcw.
67 struct tsb *tcw_get_tsb(struct tcw *tcw)
69 return (struct tsb *) ((addr_t) tcw->tsb);
74 * tcw_init - initialize tcw data structure
75 * @tcw: pointer to the tcw to be initialized
79 * Initialize all fields of the specified tcw data structure with zero and
82 void tcw_init(struct tcw *tcw, int r, int w)
84 memset(tcw, 0, sizeof(struct tcw));
85 tcw->format = TCW_FORMAT_DEFAULT;
86 tcw->flags = TCW_FLAGS_TIDAW_FORMAT(TCW_TIDAW_FORMAT_DEFAULT);
88 tcw->r = 1;
90 tcw->w = 1;
141 * tcw_finalize - finalize tcw length fields and tidaw list
142 * @tcw: pointer to the tcw
146 * Calculate the input-/output-count and tccbl field in the tcw, add a
153 void tcw_finalize(struct tcw *tcw, int num_tidaws)
161 tidaw = tcw_get_data(tcw);
165 tccb = tcw_get_tccb(tcw);
168 /* Calculate tcw input/output count and tcat transport count. */
170 if (tcw->w && (tcw->flags & TCW_FLAGS_OUTPUT_TIDA))
172 if (tcw->r)
173 tcw->input_count = count;
174 else if (tcw->w)
175 tcw->output_count = count;
178 tcw->tccbl = (sizeof(struct tccb) + tca_size(tccb) +
184 * tcw_set_intrg - set the interrogate tcw address of a tcw
185 * @tcw: the tcw address
186 * @intrg_tcw: the address of the interrogate tcw
188 * Set the address of the interrogate tcw in the specified tcw.
190 void tcw_set_intrg(struct tcw *tcw, struct tcw *intrg_tcw)
192 tcw->intrg = (u32) ((addr_t) intrg_tcw);
197 * tcw_set_data - set data address and tida flag of a tcw
198 * @tcw: the tcw address
203 * Set the input/output data address of a tcw (depending on the value of the
207 void tcw_set_data(struct tcw *tcw, void *data, int use_tidal)
209 if (tcw->r) {
210 tcw->input = (u64) ((addr_t) data);
212 tcw->flags |= TCW_FLAGS_INPUT_TIDA;
213 } else if (tcw->w) {
214 tcw->output = (u64) ((addr_t) data);
216 tcw->flags |= TCW_FLAGS_OUTPUT_TIDA;
222 * tcw_set_tccb - set tccb address of a tcw
223 * @tcw: the tcw address
226 * Set the address of the tccb in the specified tcw.
228 void tcw_set_tccb(struct tcw *tcw, struct tccb *tccb)
230 tcw->tccb = (u64) ((addr_t) tccb);
235 * tcw_set_tsb - set tsb address of a tcw
236 * @tcw: the tcw address
239 * Set the address of the tsb in the specified tcw.
241 void tcw_set_tsb(struct tcw *tcw, struct tsb *tsb)
243 tcw->tsb = (u64) ((addr_t) tsb);
323 * tcw_add_tidaw - add a tidaw to a tcw
324 * @tcw: the tcw address
330 * Add a new tidaw to the input/output data tidaw-list of the specified tcw
338 struct tidaw *tcw_add_tidaw(struct tcw *tcw, int num_tidaws, u8 flags,
344 tidaw = ((struct tidaw *) tcw_get_data(tcw)) + num_tidaws;