Lines Matching defs:tcw
20 * tcw_get_intrg - return pointer to associated interrogate tcw
21 * @tcw: pointer to the original tcw
23 * Return a pointer to the interrogate tcw associated with the specified tcw
24 * or %NULL if there is no associated interrogate tcw.
26 struct tcw *tcw_get_intrg(struct tcw *tcw)
28 return phys_to_virt(tcw->intrg);
33 * tcw_get_data - return pointer to input/output data associated with tcw
34 * @tcw: pointer to the tcw
36 * Return the input or output data address specified in the tcw depending
40 void *tcw_get_data(struct tcw *tcw)
42 if (tcw->r)
43 return phys_to_virt(tcw->input);
44 if (tcw->w)
45 return phys_to_virt(tcw->output);
51 * tcw_get_tccb - return pointer to tccb associated with tcw
52 * @tcw: pointer to the tcw
54 * Return pointer to the tccb associated with this tcw.
56 struct tccb *tcw_get_tccb(struct tcw *tcw)
58 return phys_to_virt(tcw->tccb);
63 * tcw_get_tsb - return pointer to tsb associated with tcw
64 * @tcw: pointer to the tcw
66 * Return pointer to the tsb associated with this tcw.
68 struct tsb *tcw_get_tsb(struct tcw *tcw)
70 return phys_to_virt(tcw->tsb);
75 * tcw_init - initialize tcw data structure
76 * @tcw: pointer to the tcw to be initialized
80 * Initialize all fields of the specified tcw data structure with zero and
83 void tcw_init(struct tcw *tcw, int r, int w)
85 memset(tcw, 0, sizeof(struct tcw));
86 tcw->format = TCW_FORMAT_DEFAULT;
87 tcw->flags = TCW_FLAGS_TIDAW_FORMAT(TCW_TIDAW_FORMAT_DEFAULT);
89 tcw->r = 1;
91 tcw->w = 1;
142 * tcw_finalize - finalize tcw length fields and tidaw list
143 * @tcw: pointer to the tcw
147 * Calculate the input-/output-count and tccbl field in the tcw, add a
154 void tcw_finalize(struct tcw *tcw, int num_tidaws)
162 tidaw = tcw_get_data(tcw);
166 tccb = tcw_get_tccb(tcw);
169 /* Calculate tcw input/output count and tcat transport count. */
171 if (tcw->w && (tcw->flags & TCW_FLAGS_OUTPUT_TIDA))
173 if (tcw->r)
174 tcw->input_count = count;
175 else if (tcw->w)
176 tcw->output_count = count;
179 tcw->tccbl = (sizeof(struct tccb) + tca_size(tccb) +
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.
191 void tcw_set_intrg(struct tcw *tcw, struct tcw *intrg_tcw)
193 tcw->intrg = (u32)virt_to_phys(intrg_tcw);
198 * tcw_set_data - set data address and tida flag of a tcw
199 * @tcw: the tcw address
204 * Set the input/output data address of a tcw (depending on the value of the
208 void tcw_set_data(struct tcw *tcw, void *data, int use_tidal)
210 if (tcw->r) {
211 tcw->input = virt_to_phys(data);
213 tcw->flags |= TCW_FLAGS_INPUT_TIDA;
214 } else if (tcw->w) {
215 tcw->output = virt_to_phys(data);
217 tcw->flags |= TCW_FLAGS_OUTPUT_TIDA;
223 * tcw_set_tccb - set tccb address of a tcw
224 * @tcw: the tcw address
227 * Set the address of the tccb in the specified tcw.
229 void tcw_set_tccb(struct tcw *tcw, struct tccb *tccb)
231 tcw->tccb = virt_to_phys(tccb);
236 * tcw_set_tsb - set tsb address of a tcw
237 * @tcw: the tcw address
240 * Set the address of the tsb in the specified tcw.
242 void tcw_set_tsb(struct tcw *tcw, struct tsb *tsb)
244 tcw->tsb = virt_to_phys(tsb);
324 * tcw_add_tidaw - add a tidaw to a tcw
325 * @tcw: the tcw address
331 * Add a new tidaw to the input/output data tidaw-list of the specified tcw
339 struct tidaw *tcw_add_tidaw(struct tcw *tcw, int num_tidaws, u8 flags,
345 tidaw = ((struct tidaw *) tcw_get_data(tcw)) + num_tidaws;