MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ccp_passthrough_sgl

Function ccp_passthrough_sgl

freebsd/crypto/ccp/ccp_hardware.c:886–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884}
885
886static int __must_check
887ccp_passthrough_sgl(struct ccp_queue *qp, bus_addr_t lsb_addr, bool tolsb,
888 struct sglist *sgl, bus_size_t len, bool interrupt,
889 const struct ccp_completion_ctx *cctx)
890{
891 struct sglist_seg *seg;
892 size_t i, remain, nb;
893 int error;
894
895 remain = len;
896 for (i = 0; i < sgl->sg_nseg && remain != 0; i++) {
897 seg = &sgl->sg_segs[i];
898 /* crp lengths are int, so 32-bit min() is ok. */
899 nb = min(remain, seg->ss_len);
900
901 if (tolsb)
902 error = ccp_passthrough(qp, lsb_addr, CCP_MEMTYPE_SB,
903 seg->ss_paddr, CCP_MEMTYPE_SYSTEM, nb,
904 CCP_PASSTHRU_BYTESWAP_NOOP,
905 CCP_PASSTHRU_BITWISE_NOOP,
906 (nb == remain) && interrupt, cctx);
907 else
908 error = ccp_passthrough(qp, seg->ss_paddr,
909 CCP_MEMTYPE_SYSTEM, lsb_addr, CCP_MEMTYPE_SB, nb,
910 CCP_PASSTHRU_BYTESWAP_NOOP,
911 CCP_PASSTHRU_BITWISE_NOOP,
912 (nb == remain) && interrupt, cctx);
913 if (error != 0)
914 return (error);
915
916 remain -= nb;
917 }
918 return (0);
919}
920
921/*
922 * Note that these vectors are in reverse of the usual order.

Callers 2

ccp_do_pst_to_lsbFunction · 0.85
ccp_gcmFunction · 0.85

Calls 2

minFunction · 0.85
ccp_passthroughFunction · 0.85

Tested by

no test coverage detected