| 844 | } |
| 845 | |
| 846 | static int __must_check |
| 847 | ccp_passthrough(struct ccp_queue *qp, bus_addr_t dst, |
| 848 | enum ccp_memtype dst_type, bus_addr_t src, enum ccp_memtype src_type, |
| 849 | bus_size_t len, enum ccp_passthru_byteswap swapmode, |
| 850 | enum ccp_passthru_bitwise bitmode, bool interrupt, |
| 851 | const struct ccp_completion_ctx *cctx) |
| 852 | { |
| 853 | struct ccp_desc *desc; |
| 854 | |
| 855 | if (ccp_queue_get_ring_space(qp) == 0) |
| 856 | return (EAGAIN); |
| 857 | |
| 858 | desc = &qp->desc_ring[qp->cq_tail]; |
| 859 | |
| 860 | memset(desc, 0, sizeof(*desc)); |
| 861 | desc->engine = CCP_ENGINE_PASSTHRU; |
| 862 | |
| 863 | desc->pt.ioc = interrupt; |
| 864 | desc->pt.byteswap = swapmode; |
| 865 | desc->pt.bitwise = bitmode; |
| 866 | desc->length = len; |
| 867 | |
| 868 | desc->src_lo = (uint32_t)src; |
| 869 | desc->src_hi = src >> 32; |
| 870 | desc->src_mem = src_type; |
| 871 | |
| 872 | desc->dst_lo = (uint32_t)dst; |
| 873 | desc->dst_hi = dst >> 32; |
| 874 | desc->dst_mem = dst_type; |
| 875 | |
| 876 | if (bitmode != CCP_PASSTHRU_BITWISE_NOOP) |
| 877 | desc->lsb_ctx_id = ccp_queue_lsb_entry(qp, LSB_ENTRY_KEY); |
| 878 | |
| 879 | if (cctx != NULL) |
| 880 | memcpy(&qp->completions_ring[qp->cq_tail], cctx, sizeof(*cctx)); |
| 881 | |
| 882 | qp->cq_tail = (qp->cq_tail + 1) % (1 << qp->cq_softc->ring_size_order); |
| 883 | return (0); |
| 884 | } |
| 885 | |
| 886 | static int __must_check |
| 887 | ccp_passthrough_sgl(struct ccp_queue *qp, bus_addr_t lsb_addr, bool tolsb, |
no test coverage detected