Lines Matching defs:ccw
258 static inline int ccw_does_data_transfer(struct ccw1 *ccw)
261 if (ccw->count == 0)
265 if (ccw_is_noop(ccw))
269 if (!ccw_is_skip(ccw))
277 if (ccw_is_read(ccw) || ccw_is_read_backward(ccw))
280 if (ccw_is_sense(ccw))
306 static inline int is_tic_within_range(struct ccw1 *ccw, u32 head, int len)
308 if (!ccw_is_tic(ccw))
311 return is_cpa_within_range(ccw->cda, head, len);
320 /* Make ccw address aligned to 8. */
347 /* Free resource for a ccw that allocated memory for its cda. */
350 struct ccw1 *ccw = chain->ch_ccw + idx;
352 if (ccw_is_tic(ccw))
355 kfree((void *)(u64)ccw->cda);
359 * ccwchain_calc_length - calculate the length of the ccw chain.
360 * @iova: guest physical address of the target ccw chain
369 * Returns: the length of the ccw chain or -errno.
373 struct ccw1 *ccw = cp->guest_cp;
384 if ((!cp->orb.cmd.c64 || cp->orb.cmd.i2k) && ccw_is_idal(ccw))
395 if (!ccw_is_chain(ccw) && !is_tic_within_range(ccw, iova, cnt))
398 ccw++;
491 struct ccw1 *ccw = chain->ch_ccw + idx;
497 if (is_cpa_within_range(ccw->cda, ccw_head, iter->ch_len)) {
498 ccw->cda = (__u32) (addr_t) (((char *)iter->ch_ccw) +
499 (ccw->cda - ccw_head));
511 struct ccw1 *ccw;
520 ccw = chain->ch_ccw + idx;
522 if (ccw->count)
523 bytes = ccw->count;
526 if (ccw_is_idal(ccw)) {
529 ret = copy_from_iova(cp->mdev, &iova, ccw->cda, sizeof(iova));
533 iova = ccw->cda;
556 if (ccw_is_idal(ccw)) {
558 ret = copy_from_iova(cp->mdev, idaws, ccw->cda, idal_len);
572 * with the contents of ccw->cda.
576 if (ccw_does_data_transfer(ccw)) {
584 ccw->cda = (__u32) virt_to_phys(idaws);
585 ccw->flags |= CCW_FLAG_IDA;
597 ccw->cda = 0;
602 * Fetch one ccw.
611 struct ccw1 *ccw = chain->ch_ccw + idx;
613 if (ccw_is_tic(ccw))
629 * 1. Supports idal(c64) ccw chaining.
716 * as helpers to do ccw chain translation inside the kernel. Basically
733 * We support direct ccw chaining by translating them to idal ccws.
840 * physical ccw to its chain head.
841 * Adding this value to the guest physical ccw chain
853 * cp_iova_pinned() - check if an iova is pinned for a ccw chain.
857 * If the @iova is currently pinned for the ccw chain, return true;