Lines Matching full:task

269 SDT_PROBE_DEFINE1(sdt, sun8i_crypto, task, ctor__success,
270 "struct sun8i_crypto_task *"/*task*/);
271 SDT_PROBE_DEFINE1(sdt, sun8i_crypto, task, ctor__failure,
273 SDT_PROBE_DEFINE1(sdt, sun8i_crypto, task, dtor,
274 "struct sun8i_crypto_task *"/*task*/);
275 SDT_PROBE_DEFINE1(sdt, sun8i_crypto, task, get,
276 "struct sun8i_crypto_task *"/*task*/);
277 SDT_PROBE_DEFINE1(sdt, sun8i_crypto, task, put,
278 "struct sun8i_crypto_task *"/*task*/);
280 SDT_PROBE_DEFINE6(sdt, sun8i_crypto, task, load,
281 "struct sun8i_crypto_task *"/*task*/,
287 SDT_PROBE_DEFINE3(sdt, sun8i_crypto, task, misaligned,
288 "struct sun8i_crypto_task *"/*task*/,
291 SDT_PROBE_DEFINE2(sdt, sun8i_crypto, task, done,
292 "struct sun8i_crypto_task *"/*task*/,
297 "struct sun8i_crypto_task *"/*task*/,
301 "struct sun8i_crypto_task *"/*task*/,
324 "struct sun8i_crypto_task *"/*task*/);
408 * busy with a task as we prepare another task for when it's in sun8i_crypto_attach()
510 struct sun8i_crypto_task *task = vtask; in sun8i_crypto_task_ctor() local
514 /* Create a DMA buffer for the task descriptor. */ in sun8i_crypto_task_ctor()
515 error = sun8i_crypto_allocbuf(sc, sizeof(*task->ct_desc), in sun8i_crypto_task_ctor()
516 &task->ct_descbuf, dmaflags); in sun8i_crypto_task_ctor()
519 task->ct_desc = task->ct_descbuf.cb_kva; in sun8i_crypto_task_ctor()
523 &task->ct_ivbuf, dmaflags); in sun8i_crypto_task_ctor()
526 task->ct_iv = task->ct_ivbuf.cb_kva; in sun8i_crypto_task_ctor()
528 &task->ct_ctrbuf, dmaflags); in sun8i_crypto_task_ctor()
531 task->ct_ctr = task->ct_ctrbuf.cb_kva; in sun8i_crypto_task_ctor()
533 /* Create a DMA map for the task descriptor and preload it. */ in sun8i_crypto_task_ctor()
534 error = bus_dmamap_create(sc->sc_dmat, sizeof(*task->ct_desc), 1, in sun8i_crypto_task_ctor()
535 sizeof(*task->ct_desc), 0, dmaflags, &task->ct_descmap); in sun8i_crypto_task_ctor()
538 error = bus_dmamap_load(sc->sc_dmat, task->ct_descmap, task->ct_desc, in sun8i_crypto_task_ctor()
539 sizeof(*task->ct_desc), NULL, BUS_DMA_WAITOK); in sun8i_crypto_task_ctor()
545 SUN8I_CRYPTO_MAXKEYBYTES, 0, dmaflags, &task->ct_keymap); in sun8i_crypto_task_ctor()
549 SUN8I_CRYPTO_MAXIVBYTES, 0, dmaflags, &task->ct_ivmap); in sun8i_crypto_task_ctor()
553 SUN8I_CRYPTO_MAXCTRBYTES, 0, dmaflags, &task->ct_ctrmap); in sun8i_crypto_task_ctor()
560 &task->ct_srcmap); in sun8i_crypto_task_ctor()
565 &task->ct_dstmap); in sun8i_crypto_task_ctor()
570 SDT_PROBE1(sdt, sun8i_crypto, task, ctor__success, task); in sun8i_crypto_task_ctor()
574 bus_dmamap_destroy(sc->sc_dmat, task->ct_dstmap); in sun8i_crypto_task_ctor()
575 fail9: bus_dmamap_destroy(sc->sc_dmat, task->ct_srcmap); in sun8i_crypto_task_ctor()
576 fail8: bus_dmamap_destroy(sc->sc_dmat, task->ct_ctrmap); in sun8i_crypto_task_ctor()
577 fail7: bus_dmamap_destroy(sc->sc_dmat, task->ct_ivmap); in sun8i_crypto_task_ctor()
578 fail6: bus_dmamap_destroy(sc->sc_dmat, task->ct_keymap); in sun8i_crypto_task_ctor()
579 fail5: bus_dmamap_unload(sc->sc_dmat, task->ct_descmap); in sun8i_crypto_task_ctor()
580 fail4: bus_dmamap_destroy(sc->sc_dmat, task->ct_descmap); in sun8i_crypto_task_ctor()
581 fail3: sun8i_crypto_freebuf(sc, SUN8I_CRYPTO_MAXIVBYTES, &task->ct_ivbuf); in sun8i_crypto_task_ctor()
582 fail2: sun8i_crypto_freebuf(sc, SUN8I_CRYPTO_MAXCTRBYTES, &task->ct_ctrbuf); in sun8i_crypto_task_ctor()
583 fail1: sun8i_crypto_freebuf(sc, sizeof(*task->ct_desc), &task->ct_descbuf); in sun8i_crypto_task_ctor()
584 fail0: SDT_PROBE1(sdt, sun8i_crypto, task, ctor__failure, error); in sun8i_crypto_task_ctor()
592 struct sun8i_crypto_task *task = vtask; in sun8i_crypto_task_dtor() local
594 SDT_PROBE1(sdt, sun8i_crypto, task, dtor, task); in sun8i_crypto_task_dtor()
598 bus_dmamap_destroy(sc->sc_dmat, task->ct_dstmap); in sun8i_crypto_task_dtor()
599 bus_dmamap_destroy(sc->sc_dmat, task->ct_srcmap); in sun8i_crypto_task_dtor()
600 bus_dmamap_destroy(sc->sc_dmat, task->ct_ctrmap); in sun8i_crypto_task_dtor()
601 bus_dmamap_destroy(sc->sc_dmat, task->ct_ivmap); in sun8i_crypto_task_dtor()
602 bus_dmamap_destroy(sc->sc_dmat, task->ct_keymap); in sun8i_crypto_task_dtor()
603 bus_dmamap_unload(sc->sc_dmat, task->ct_descmap); in sun8i_crypto_task_dtor()
604 bus_dmamap_destroy(sc->sc_dmat, task->ct_descmap); in sun8i_crypto_task_dtor()
605 sun8i_crypto_freebuf(sc, SUN8I_CRYPTO_MAXIVBYTES, &task->ct_ivbuf); in sun8i_crypto_task_dtor()
606 sun8i_crypto_freebuf(sc, SUN8I_CRYPTO_MAXCTRBYTES, &task->ct_ctrbuf); in sun8i_crypto_task_dtor()
607 sun8i_crypto_freebuf(sc, sizeof(*task->ct_desc), &task->ct_descbuf); in sun8i_crypto_task_dtor()
613 * Allocate a task that will call callback(sc, task, cookie,
616 * needed to submit the task if this succeeds (although task
625 struct sun8i_crypto_task *task; in sun8i_crypto_task_get() local
627 /* Allocate a task, or fail if we can't. */ in sun8i_crypto_task_get()
628 task = pool_cache_get(sc->sc_taskpool, pflags); in sun8i_crypto_task_get()
629 if (task == NULL) in sun8i_crypto_task_get()
633 task->ct_flags = 0; in sun8i_crypto_task_get()
634 task->ct_callback = callback; in sun8i_crypto_task_get()
635 task->ct_cookie = cookie; in sun8i_crypto_task_get()
637 out: SDT_PROBE1(sdt, sun8i_crypto, task, get, task); in sun8i_crypto_task_get()
638 return task; in sun8i_crypto_task_get()
642 * sun8i_crypto_task_invalid(sc, task, cookie, error)
644 * Callback for a task not currently in use, to detect errors.
648 struct sun8i_crypto_task *task, void *cookie, int error) in sun8i_crypto_task_invalid() argument
653 panic("task for callback %p used after free", callback); in sun8i_crypto_task_invalid()
657 * sun8i_crypto_task_put(sc, task)
659 * Free a task obtained with sun8i_crypto_task_get.
663 struct sun8i_crypto_task *task) in sun8i_crypto_task_put() argument
666 SDT_PROBE1(sdt, sun8i_crypto, task, put, task); in sun8i_crypto_task_put()
668 task->ct_cookie = task->ct_callback; in sun8i_crypto_task_put()
669 task->ct_callback = &sun8i_crypto_task_invalid; in sun8i_crypto_task_put()
670 pool_cache_put(sc->sc_taskpool, task); in sun8i_crypto_task_put()
674 * sun8i_crypto_task_load(sc, task, nbytes, tdqc, tdqs, tdqa)
676 * Set up the task descriptor after the relevant DMA maps have
681 * XXX Teach this to support task chains.
685 struct sun8i_crypto_task *task, uint32_t nbytes, in sun8i_crypto_task_load() argument
688 struct sun8i_crypto_taskdesc *desc = task->ct_desc; in sun8i_crypto_task_load()
696 /* Always enable interrupt for the task. */ in sun8i_crypto_task_load()
703 if (task->ct_flags & TASK_KEY) { in sun8i_crypto_task_load()
704 bus_dmamap_t keymap = task->ct_keymap; in sun8i_crypto_task_load()
710 if (task->ct_flags & TASK_IV) { in sun8i_crypto_task_load()
711 bus_dmamap_t ivmap = task->ct_ivmap; in sun8i_crypto_task_load()
717 if (task->ct_flags & TASK_CTR) { in sun8i_crypto_task_load()
718 bus_dmamap_t ctrmap = task->ct_ctrmap; in sun8i_crypto_task_load()
725 if (task->ct_flags & TASK_BYTES) in sun8i_crypto_task_load()
730 if (task->ct_flags & TASK_SRC) { in sun8i_crypto_task_load()
731 bus_dmamap_t srcmap = task->ct_srcmap; in sun8i_crypto_task_load()
732 KASSERT(srcmap->dm_mapsize == task->ct_dstmap->dm_mapsize); in sun8i_crypto_task_load()
733 error = sun8i_crypto_task_scatter(task, desc->td_src, srcmap, in sun8i_crypto_task_load()
741 error = sun8i_crypto_task_scatter(task, desc->td_dst, task->ct_dstmap, in sun8i_crypto_task_load()
745 bus_dmamap_sync(sc->sc_dmat, task->ct_dstmap, 0, nbytes, in sun8i_crypto_task_load()
748 task->ct_nbytes = nbytes; in sun8i_crypto_task_load()
753 out: SDT_PROBE6(sdt, sun8i_crypto, task, load, in sun8i_crypto_task_load()
754 task, tdqc, tdqs, tdqa, desc, error); in sun8i_crypto_task_load()
759 * sun8i_crypto_task_scatter(task, adrlen, map, nbytes)
761 * Set up a task's scatter/gather vector -- src or dst -- with the
766 sun8i_crypto_task_scatter(struct sun8i_crypto_task *task, in sun8i_crypto_task_scatter() argument
781 SDT_PROBE3(sdt, sun8i_crypto, task, misaligned, in sun8i_crypto_task_scatter()
782 task, in sun8i_crypto_task_scatter()
808 * sun8i_crypto_task_load_trng(task, nbytes)
810 * Set up the task descriptor for a transfer of nbytes from the
815 struct sun8i_crypto_task *task, uint32_t nbytes) in sun8i_crypto_task_load_trng() argument
820 KASSERT((task->ct_flags & TASK_KEY) == 0); in sun8i_crypto_task_load_trng()
821 KASSERT((task->ct_flags & TASK_IV) == 0); in sun8i_crypto_task_load_trng()
822 KASSERT((task->ct_flags & TASK_CTR) == 0); in sun8i_crypto_task_load_trng()
823 KASSERT((task->ct_flags & TASK_SRC) == 0); in sun8i_crypto_task_load_trng()
825 /* Set up the task descriptor queue control words. */ in sun8i_crypto_task_load_trng()
830 return sun8i_crypto_task_load(sc, task, nbytes, tdqc, 0, 0); in sun8i_crypto_task_load_trng()
835 struct sun8i_crypto_task *task, in sun8i_crypto_task_load_aesecb() argument
841 KASSERT(task->ct_flags & TASK_KEY); in sun8i_crypto_task_load_aesecb()
842 KASSERT((task->ct_flags & TASK_IV) == 0); in sun8i_crypto_task_load_aesecb()
843 KASSERT((task->ct_flags & TASK_CTR) == 0); in sun8i_crypto_task_load_aesecb()
844 KASSERT(task->ct_flags & TASK_SRC); in sun8i_crypto_task_load_aesecb()
846 /* Set up the task descriptor queue control word. */ in sun8i_crypto_task_load_aesecb()
854 KASSERT(task->ct_keymap->dm_segs[0].ds_len == 16); in sun8i_crypto_task_load_aesecb()
857 KASSERT(task->ct_keymap->dm_segs[0].ds_len == 24); in sun8i_crypto_task_load_aesecb()
860 KASSERT(task->ct_keymap->dm_segs[0].ds_len == 32); in sun8i_crypto_task_load_aesecb()
873 return sun8i_crypto_task_load(sc, task, nbytes, tdqc, tdqs, 0); in sun8i_crypto_task_load_aesecb()
877 * sun8i_crypto_submit(sc, task)
879 * Submit a task to the crypto engine after it has been loaded
881 * eventually call the task's callback.
885 struct sun8i_crypto_task *task) in sun8i_crypto_submit() argument
909 task->ct_desc->td_cid = htole32(i); in sun8i_crypto_submit()
915 bus_dmamap_sync(sc->sc_dmat, task->ct_descmap, 0, in sun8i_crypto_submit()
916 sizeof(*task->ct_desc), BUS_DMASYNC_PREWRITE); in sun8i_crypto_submit()
936 /* Set the task descriptor queue address. */ in sun8i_crypto_submit()
938 task->ct_descmap->dm_segs[0].ds_addr); in sun8i_crypto_submit()
964 sc->sc_chan[i].cc_task = task; in sun8i_crypto_submit()
972 sc, task, error); in sun8i_crypto_submit()
975 sc, task, i); in sun8i_crypto_submit()
1026 * Ensure that crypto engine thread context work to invoke task
1045 * Thread-context worker: Invoke all task callbacks for which the
1072 * operations (which we do) use the same task channels, so we in sun8i_crypto_worker()
1117 * Invoke all task callbacks for the channels in done or esr, or
1136 /* Nope. Do we have a task to time out? */ in sun8i_crypto_done()
1170 * Notify the task of completion. May release the lock in sun8i_crypto_done()
1192 * Notify the callback for the task on channel i, if there is one,
1198 struct sun8i_crypto_task *task; in sun8i_crypto_chan_done() local
1206 /* Claim the task if there is one; bail if not. */ in sun8i_crypto_chan_done()
1207 if ((task = sc->sc_chan[i].cc_task) == NULL) { in sun8i_crypto_chan_done()
1208 device_printf(sc->sc_dev, "channel %u: no task but error=%d\n", in sun8i_crypto_chan_done()
1225 bus_dmamap_sync(sc->sc_dmat, task->ct_descmap, 0, in sun8i_crypto_chan_done()
1226 sizeof(*task->ct_desc), BUS_DMASYNC_POSTWRITE); in sun8i_crypto_chan_done()
1232 nbytes = task->ct_nbytes; in sun8i_crypto_chan_done()
1233 bus_dmamap_sync(sc->sc_dmat, task->ct_dstmap, 0, nbytes, in sun8i_crypto_chan_done()
1235 if (task->ct_flags & TASK_SRC) in sun8i_crypto_chan_done()
1236 bus_dmamap_sync(sc->sc_dmat, task->ct_srcmap, 0, nbytes, in sun8i_crypto_chan_done()
1238 if (task->ct_flags & TASK_CTR) in sun8i_crypto_chan_done()
1239 bus_dmamap_sync(sc->sc_dmat, task->ct_ctrmap, 0, in sun8i_crypto_chan_done()
1240 task->ct_ctrmap->dm_segs[0].ds_len, BUS_DMASYNC_POSTREAD); in sun8i_crypto_chan_done()
1241 if (task->ct_flags & TASK_IV) in sun8i_crypto_chan_done()
1242 bus_dmamap_sync(sc->sc_dmat, task->ct_ivmap, 0, in sun8i_crypto_chan_done()
1243 task->ct_ivmap->dm_segs[0].ds_len, BUS_DMASYNC_POSTWRITE); in sun8i_crypto_chan_done()
1244 if (task->ct_flags & TASK_KEY) in sun8i_crypto_chan_done()
1246 bus_dmamap_sync(sc->sc_dmat, task->ct_keymap, 0, in sun8i_crypto_chan_done()
1247 task->ct_keymap->dm_segs[0].ds_len, BUS_DMASYNC_POSTWRITE); in sun8i_crypto_chan_done()
1251 SDT_PROBE2(sdt, sun8i_crypto, task, done, task, error); in sun8i_crypto_chan_done()
1252 (*task->ct_callback)(sc, task, task->ct_cookie, error); in sun8i_crypto_chan_done()
1316 struct sun8i_crypto_task *task; in sun8i_crypto_rng_attach() local
1330 /* Create a task to reuse. */ in sun8i_crypto_rng_attach()
1331 task = rng->cr_task = sun8i_crypto_task_get(sc, sun8i_crypto_rng_done, in sun8i_crypto_rng_attach()
1334 aprint_error_dev(self, "failed to allocate RNG task\n"); in sun8i_crypto_rng_attach()
1340 error = bus_dmamap_load(sc->sc_dmat, task->ct_dstmap, in sun8i_crypto_rng_attach()
1374 bus_dmamap_unload(sc->sc_dmat, task->ct_dstmap); in sun8i_crypto_rng_attach()
1375 fail2: sun8i_crypto_task_put(sc, task); in sun8i_crypto_rng_attach()
1391 struct sun8i_crypto_task *task = rng->cr_task; in sun8i_crypto_rng_get() local
1406 /* Load the task descriptor. */ in sun8i_crypto_rng_get()
1407 error = sun8i_crypto_task_load_trng(sc, task, SUN8I_CRYPTO_RNGBYTES); in sun8i_crypto_rng_get()
1412 error = sun8i_crypto_submit(sc, task); in sun8i_crypto_rng_get()
1426 struct sun8i_crypto_task *task, void *cookie, int error) in sun8i_crypto_rng_done() argument
1484 struct sun8i_crypto_task *task; in sun8i_crypto_selftest() local
1511 /* Allocate a task descriptor. */ in sun8i_crypto_selftest()
1512 task = selftest->cs_task = sun8i_crypto_task_get(sc, in sun8i_crypto_selftest()
1524 error = bus_dmamap_load(sc->sc_dmat, task->ct_keymap, in sun8i_crypto_selftest()
1528 task->ct_flags |= TASK_KEY; in sun8i_crypto_selftest()
1530 error = bus_dmamap_load(sc->sc_dmat, task->ct_srcmap, in sun8i_crypto_selftest()
1534 task->ct_flags |= TASK_SRC; in sun8i_crypto_selftest()
1536 error = bus_dmamap_load(sc->sc_dmat, task->ct_dstmap, in sun8i_crypto_selftest()
1541 /* Set up the task descriptor. */ in sun8i_crypto_selftest()
1542 error = sun8i_crypto_task_load_aesecb(sc, task, nbytes, in sun8i_crypto_selftest()
1548 error = sun8i_crypto_submit(sc, task); in sun8i_crypto_selftest()
1569 fail7: bus_dmamap_unload(sc->sc_dmat, task->ct_dstmap); in sun8i_crypto_selftest()
1570 fail6: bus_dmamap_unload(sc->sc_dmat, task->ct_srcmap); in sun8i_crypto_selftest()
1571 fail5: bus_dmamap_unload(sc->sc_dmat, task->ct_keymap); in sun8i_crypto_selftest()
1572 fail4: sun8i_crypto_task_put(sc, task); in sun8i_crypto_selftest()
1607 struct sun8i_crypto_task *task, void *cookie, int error) in sun8i_crypto_selftest_done() argument
1637 out: bus_dmamap_unload(sc->sc_dmat, task->ct_dstmap); in sun8i_crypto_selftest_done()
1638 bus_dmamap_unload(sc->sc_dmat, task->ct_srcmap); in sun8i_crypto_selftest_done()
1639 bus_dmamap_unload(sc->sc_dmat, task->ct_keymap); in sun8i_crypto_selftest_done()
1640 sun8i_crypto_task_put(sc, task); in sun8i_crypto_selftest_done()
1700 struct sun8i_crypto_task *task; in sun8i_crypto_sysctl_rng() local
1733 /* Allocate a task. */ in sun8i_crypto_sysctl_rng()
1734 task = req->cu_task = sun8i_crypto_task_get(sc, in sun8i_crypto_sysctl_rng()
1736 if (task == NULL) { in sun8i_crypto_sysctl_rng()
1741 /* Set the task up for TRNG to our buffer. */ in sun8i_crypto_sysctl_rng()
1742 error = bus_dmamap_load(sc->sc_dmat, task->ct_dstmap, in sun8i_crypto_sysctl_rng()
1746 error = sun8i_crypto_task_load_trng(sc, task, SUN8I_CRYPTO_RNGBYTES); in sun8i_crypto_sysctl_rng()
1751 error = sun8i_crypto_submit(sc, task); in sun8i_crypto_sysctl_rng()
1800 out3: bus_dmamap_unload(sc->sc_dmat, task->ct_dstmap); in sun8i_crypto_sysctl_rng()
1801 out2: sun8i_crypto_task_put(sc, task); in sun8i_crypto_sysctl_rng()
1811 struct sun8i_crypto_task *task, void *cookie, int error) in sun8i_crypto_sysctl_rng_done() argument
1835 bus_dmamap_unload(sc->sc_dmat, task->ct_dstmap); in sun8i_crypto_sysctl_rng_done()
1836 sun8i_crypto_task_put(sc, task); in sun8i_crypto_sysctl_rng_done()
2113 struct sun8i_crypto_task *task; in sun8i_crypto_process() local
2185 /* Get a task, or fail with ERESTART if we can't. */ in sun8i_crypto_process()
2186 task = sun8i_crypto_task_get(sc, &sun8i_crypto_callback, crp, in sun8i_crypto_process()
2188 if (task == NULL) { in sun8i_crypto_process()
2204 error = bus_dmamap_load(sc->sc_dmat, task->ct_keymap, in sun8i_crypto_process()
2208 task->ct_flags |= TASK_KEY; in sun8i_crypto_process()
2223 cprng_fast(task->ct_iv, ivlen); in sun8i_crypto_process()
2224 iv = task->ct_iv; in sun8i_crypto_process()
2266 memcpy(task->ct_iv, block, 16); in sun8i_crypto_process()
2267 iv = task->ct_iv; in sun8i_crypto_process()
2272 error = bus_dmamap_load(sc->sc_dmat, task->ct_ivmap, iv, ivlen, in sun8i_crypto_process()
2276 task->ct_flags |= TASK_IV; in sun8i_crypto_process()
2285 error = bus_dmamap_load_mbuf(sc->sc_dmat, task->ct_srcmap, m, in sun8i_crypto_process()
2289 task->ct_flags |= TASK_SRC; in sun8i_crypto_process()
2293 error = bus_dmamap_load_mbuf(sc->sc_dmat, task->ct_dstmap, m, in sun8i_crypto_process()
2302 error = bus_dmamap_load_uio(sc->sc_dmat, task->ct_srcmap, uio, in sun8i_crypto_process()
2306 task->ct_flags |= TASK_SRC; in sun8i_crypto_process()
2310 error = bus_dmamap_load_uio(sc->sc_dmat, task->ct_dstmap, uio, in sun8i_crypto_process()
2485 /* Set up the task descriptor. */ in sun8i_crypto_process()
2486 error = sun8i_crypto_task_load(sc, task, crd->crd_len, in sun8i_crypto_process()
2492 error = sun8i_crypto_submit(sc, task); in sun8i_crypto_process()
2497 SDT_PROBE4(sdt, sun8i_crypto, process, queued, sc, crp, hint, task); in sun8i_crypto_process()
2500 fail2: bus_dmamap_unload(sc->sc_dmat, task->ct_dstmap); in sun8i_crypto_process()
2501 fail1: if (task->ct_flags & TASK_SRC) in sun8i_crypto_process()
2502 bus_dmamap_unload(sc->sc_dmat, task->ct_srcmap); in sun8i_crypto_process()
2503 if (task->ct_flags & TASK_CTR) in sun8i_crypto_process()
2504 bus_dmamap_unload(sc->sc_dmat, task->ct_ctrmap); in sun8i_crypto_process()
2505 if (task->ct_flags & TASK_IV) in sun8i_crypto_process()
2506 bus_dmamap_unload(sc->sc_dmat, task->ct_ivmap); in sun8i_crypto_process()
2507 if (task->ct_flags & TASK_KEY) in sun8i_crypto_process()
2508 bus_dmamap_unload(sc->sc_dmat, task->ct_keymap); in sun8i_crypto_process()
2509 sun8i_crypto_task_put(sc, task); in sun8i_crypto_process()
2519 * sun8i_crypto_callback(sc, task, cookie, error)
2521 * Completion callback for a task submitted via opencrypto.
2522 * Release the task and pass the error on to opencrypto with
2527 struct sun8i_crypto_task *task, void *cookie, int error) in sun8i_crypto_callback() argument
2539 bus_dmamap_unload(sc->sc_dmat, task->ct_dstmap); in sun8i_crypto_callback()
2540 bus_dmamap_unload(sc->sc_dmat, task->ct_srcmap); in sun8i_crypto_callback()
2541 if (task->ct_flags & TASK_CTR) in sun8i_crypto_callback()
2542 bus_dmamap_unload(sc->sc_dmat, task->ct_ctrmap); in sun8i_crypto_callback()
2543 if (task->ct_flags & TASK_IV) in sun8i_crypto_callback()
2544 bus_dmamap_unload(sc->sc_dmat, task->ct_ivmap); in sun8i_crypto_callback()
2545 if (task->ct_flags & TASK_KEY) in sun8i_crypto_callback()
2546 bus_dmamap_unload(sc->sc_dmat, task->ct_keymap); in sun8i_crypto_callback()
2547 sun8i_crypto_task_put(sc, task); in sun8i_crypto_callback()