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

Function ccp_populate_sglist

freebsd/crypto/ccp/ccp.c:94–118  ·  view source on GitHub ↗

* ccp_populate_sglist() generates a scatter/gather list that covers the entire * crypto operation buffer. */

Source from the content-addressed store, hash-verified

92 * crypto operation buffer.
93 */
94static int
95ccp_populate_sglist(struct sglist *sg, struct crypto_buffer *cb)
96{
97 int error;
98
99 sglist_reset(sg);
100 switch (cb->cb_type) {
101 case CRYPTO_BUF_MBUF:
102 error = sglist_append_mbuf(sg, cb->cb_mbuf);
103 break;
104 case CRYPTO_BUF_UIO:
105 error = sglist_append_uio(sg, cb->cb_uio);
106 break;
107 case CRYPTO_BUF_CONTIG:
108 error = sglist_append(sg, cb->cb_buf, cb->cb_buf_len);
109 break;
110 case CRYPTO_BUF_VMPAGE:
111 error = sglist_append_vmpages(sg, cb->cb_vm_page,
112 cb->cb_vm_page_len, cb->cb_vm_page_offset);
113 break;
114 default:
115 error = EINVAL;
116 }
117 return (error);
118}
119
120static int
121ccp_probe(device_t dev)

Callers 1

ccp_processFunction · 0.85

Calls 5

sglist_resetFunction · 0.85
sglist_append_mbufFunction · 0.85
sglist_append_uioFunction · 0.85
sglist_appendFunction · 0.85
sglist_append_vmpagesFunction · 0.85

Tested by

no test coverage detected