Lines Matching +full:ch0 +full:- +full:2

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (C) 2008-2009 Semihalf, Piotr Ziecik
12 * 2. Redistributions in binary form must reproduce the above copyright
158 if (dma_mem->dma_vaddr != NULL) in sec_sync_dma_mem()
159 bus_dmamap_sync(dma_mem->dma_tag, dma_mem->dma_map, op); in sec_sync_dma_mem()
166 return (desc->sd_ptr_dmem[n].dma_vaddr); in sec_get_pointer_data()
183 sc->sc_rrid = 0; in sec_probe()
184 sc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rrid, in sec_probe()
187 if (sc->sc_rres == NULL) in sec_probe()
190 sc->sc_bas.bsh = rman_get_bushandle(sc->sc_rres); in sec_probe()
191 sc->sc_bas.bst = rman_get_bustag(sc->sc_rres); in sec_probe()
195 bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rrid, sc->sc_rres); in sec_probe()
200 sc->sc_version = 2; in sec_probe()
204 sc->sc_version = 3; in sec_probe()
208 sc->sc_version = 3; in sec_probe()
227 sc->sc_dev = dev; in sec_attach()
228 sc->sc_blocked = 0; in sec_attach()
229 sc->sc_shutdown = 0; in sec_attach()
231 sc->sc_cid = crypto_get_driverid(dev, sizeof(struct sec_session), in sec_attach()
233 if (sc->sc_cid < 0) { in sec_attach()
239 mtx_init(&sc->sc_controller_lock, device_get_nameunit(dev), in sec_attach()
241 mtx_init(&sc->sc_descriptors_lock, device_get_nameunit(dev), in sec_attach()
245 sc->sc_rrid = 0; in sec_attach()
246 sc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rrid, in sec_attach()
249 if (sc->sc_rres == NULL) { in sec_attach()
254 sc->sc_bas.bsh = rman_get_bushandle(sc->sc_rres); in sec_attach()
255 sc->sc_bas.bst = rman_get_bustag(sc->sc_rres); in sec_attach()
258 sc->sc_pri_irid = 0; in sec_attach()
259 error = sec_setup_intr(sc, &sc->sc_pri_ires, &sc->sc_pri_ihand, in sec_attach()
260 &sc->sc_pri_irid, sec_primary_intr, "primary"); in sec_attach()
265 if (sc->sc_version == 3) { in sec_attach()
266 sc->sc_sec_irid = 1; in sec_attach()
267 error = sec_setup_intr(sc, &sc->sc_sec_ires, &sc->sc_sec_ihand, in sec_attach()
268 &sc->sc_sec_irid, sec_secondary_intr, "secondary"); in sec_attach()
275 error = sec_alloc_dma_mem(sc, &(sc->sc_desc_dmem), in sec_attach()
281 error = sec_alloc_dma_mem(sc, &(sc->sc_lt_dmem), in sec_attach()
289 sc->sc_desc[i].sd_desc = in sec_attach()
290 (struct sec_hw_desc*)(sc->sc_desc_dmem.dma_vaddr) + i; in sec_attach()
291 sc->sc_desc[i].sd_desc_paddr = sc->sc_desc_dmem.dma_paddr + in sec_attach()
296 sc->sc_lt[i].sl_lt = in sec_attach()
297 (struct sec_hw_lt*)(sc->sc_lt_dmem.dma_vaddr) + i; in sec_attach()
298 sc->sc_lt[i].sl_lt_paddr = sc->sc_lt_dmem.dma_paddr + in sec_attach()
303 lt = sc->sc_lt[SEC_LT_ENTRIES].sl_lt; in sec_attach()
304 lt->shl_length = 0; in sec_attach()
305 lt->shl_r = 0; in sec_attach()
306 lt->shl_n = 1; in sec_attach()
307 lt->shl_ptr = sc->sc_lt[0].sl_lt_paddr; in sec_attach()
320 sc->sc_int_error_mask = 0; in sec_attach()
322 sc->sc_int_error_mask |= (~0ULL & SEC_INT_CH_ERR(i)); in sec_attach()
324 switch (sc->sc_version) { in sec_attach()
325 case 2: in sec_attach()
326 sc->sc_channel_idle_mask = in sec_attach()
333 sc->sc_channel_idle_mask = in sec_attach()
350 sec_free_dma_mem(&(sc->sc_lt_dmem)); in sec_attach()
352 sec_free_dma_mem(&(sc->sc_desc_dmem)); in sec_attach()
354 sec_release_intr(sc, sc->sc_sec_ires, sc->sc_sec_ihand, in sec_attach()
355 sc->sc_sec_irid, "secondary"); in sec_attach()
357 sec_release_intr(sc, sc->sc_pri_ires, sc->sc_pri_ihand, in sec_attach()
358 sc->sc_pri_irid, "primary"); in sec_attach()
360 bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rrid, sc->sc_rres); in sec_attach()
362 mtx_destroy(&sc->sc_controller_lock); in sec_attach()
363 mtx_destroy(&sc->sc_descriptors_lock); in sec_attach()
376 sc->sc_shutdown = 1; in sec_detach()
391 /* DMA can be still active - stop it */ in sec_detach()
398 timeout -= 1000; in sec_detach()
406 crypto_unregister_all(sc->sc_cid); in sec_detach()
410 SEC_DESC_FREE_POINTERS(&(sc->sc_desc[i])); in sec_detach()
412 sec_free_dma_mem(&(sc->sc_lt_dmem)); in sec_detach()
413 sec_free_dma_mem(&(sc->sc_desc_dmem)); in sec_detach()
416 sec_release_intr(sc, sc->sc_pri_ires, sc->sc_pri_ihand, in sec_detach()
417 sc->sc_pri_irid, "primary"); in sec_detach()
418 sec_release_intr(sc, sc->sc_sec_ires, sc->sc_sec_ihand, in sec_detach()
419 sc->sc_sec_irid, "secondary"); in sec_detach()
422 if (sc->sc_rres) { in sec_detach()
423 error = bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rrid, in sec_detach()
424 sc->sc_rres); in sec_detach()
429 sc->sc_rres = NULL; in sec_detach()
432 mtx_destroy(&sc->sc_controller_lock); in sec_detach()
433 mtx_destroy(&sc->sc_descriptors_lock); in sec_detach()
465 (*ires) = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, irid, in sec_setup_intr()
469 device_printf(sc->sc_dev, "could not allocate %s IRQ\n", iname); in sec_setup_intr()
473 error = bus_setup_intr(sc->sc_dev, *ires, INTR_MPSAFE | INTR_TYPE_NET, in sec_setup_intr()
477 device_printf(sc->sc_dev, "failed to set up %s IRQ\n", iname); in sec_setup_intr()
478 if (bus_release_resource(sc->sc_dev, SYS_RES_IRQ, *irid, *ires)) in sec_setup_intr()
479 device_printf(sc->sc_dev, "could not release %s IRQ\n", in sec_setup_intr()
498 error = bus_teardown_intr(sc->sc_dev, ires, ihand); in sec_release_intr()
500 device_printf(sc->sc_dev, "bus_teardown_intr() failed for %s" in sec_release_intr()
503 error = bus_release_resource(sc->sc_dev, SYS_RES_IRQ, irid, ires); in sec_release_intr()
505 device_printf(sc->sc_dev, "bus_release_resource() failed for %s" in sec_release_intr()
524 if (isr & sc->sc_int_error_mask) { in sec_primary_intr()
530 device_printf(sc->sc_dev, in sec_primary_intr()
538 desc->sd_error = EIO; in sec_primary_intr()
557 if (desc->sd_desc->shd_done != 0xFF && desc->sd_error == 0) { in sec_primary_intr()
565 crp = desc->sd_crp; in sec_primary_intr()
566 crp->crp_etype = desc->sd_error; in sec_primary_intr()
567 if (crp->crp_etype == 0) { in sec_primary_intr()
568 ses = crypto_get_driver_session(crp->crp_session); in sec_primary_intr()
569 if (ses->ss_mlen != 0) { in sec_primary_intr()
570 if (crp->crp_op & CRYPTO_OP_VERIFY_DIGEST) { in sec_primary_intr()
572 crp->crp_digest_start, in sec_primary_intr()
573 ses->ss_mlen, hash); in sec_primary_intr()
575 desc->sd_desc->shd_digest, in sec_primary_intr()
576 hash, ses->ss_mlen) != 0) in sec_primary_intr()
577 crp->crp_etype = EBADMSG; in sec_primary_intr()
580 crp->crp_digest_start, in sec_primary_intr()
581 ses->ss_mlen, in sec_primary_intr()
582 desc->sd_desc->shd_digest); in sec_primary_intr()
585 crypto_done(desc->sd_crp); in sec_primary_intr()
594 if (!sc->sc_shutdown) { in sec_primary_intr()
595 wakeup = sc->sc_blocked; in sec_primary_intr()
596 sc->sc_blocked = 0; in sec_primary_intr()
605 crypto_unblock(sc->sc_cid, wakeup); in sec_primary_intr()
613 device_printf(sc->sc_dev, "spurious secondary interrupt!\n"); in sec_secondary_intr()
627 timeout -= 1000; in sec_controller_reset()
630 device_printf(sc->sc_dev, "timeout while waiting for " in sec_controller_reset()
652 timeout -= 1000; in sec_channel_reset()
655 device_printf(sc->sc_dev, "timeout while waiting for " in sec_channel_reset()
664 switch(sc->sc_version) { in sec_channel_reset()
665 case 2: in sec_channel_reset()
720 dma_mem->dma_paddr = segs->ds_addr; in sec_alloc_dma_mem_cb()
728 struct sec_softc *sc = sdmi->sdmi_sc; in sec_dma_map_desc_cb()
744 if (sdmi->sdmi_offset >= size) { in sec_dma_map_desc_cb()
745 sdmi->sdmi_offset -= size; in sec_dma_map_desc_cb()
749 addr += sdmi->sdmi_offset; in sec_dma_map_desc_cb()
750 size -= sdmi->sdmi_offset; in sec_dma_map_desc_cb()
751 sdmi->sdmi_offset = 0; in sec_dma_map_desc_cb()
754 if (sdmi->sdmi_size < size) in sec_dma_map_desc_cb()
755 size = sdmi->sdmi_size; in sec_dma_map_desc_cb()
758 lt->sl_lt->shl_length = size; in sec_dma_map_desc_cb()
759 lt->sl_lt->shl_r = 0; in sec_dma_map_desc_cb()
760 lt->sl_lt->shl_n = 0; in sec_dma_map_desc_cb()
761 lt->sl_lt->shl_ptr = addr; in sec_dma_map_desc_cb()
763 if (sdmi->sdmi_lt_first == NULL) in sec_dma_map_desc_cb()
764 sdmi->sdmi_lt_first = lt; in sec_dma_map_desc_cb()
766 sdmi->sdmi_lt_used += 1; in sec_dma_map_desc_cb()
768 if ((sdmi->sdmi_size -= size) == 0) in sec_dma_map_desc_cb()
772 sdmi->sdmi_lt_last = lt; in sec_dma_map_desc_cb()
781 if (dma_mem->dma_vaddr != NULL) in sec_alloc_dma_mem()
792 &(dma_mem->dma_tag)); /* dmat */ in sec_alloc_dma_mem()
795 device_printf(sc->sc_dev, "failed to allocate busdma tag, error" in sec_alloc_dma_mem()
800 error = bus_dmamem_alloc(dma_mem->dma_tag, &(dma_mem->dma_vaddr), in sec_alloc_dma_mem()
801 BUS_DMA_NOWAIT | BUS_DMA_ZERO, &(dma_mem->dma_map)); in sec_alloc_dma_mem()
804 device_printf(sc->sc_dev, "failed to allocate DMA safe" in sec_alloc_dma_mem()
809 error = bus_dmamap_load(dma_mem->dma_tag, dma_mem->dma_map, in sec_alloc_dma_mem()
810 dma_mem->dma_vaddr, size, sec_alloc_dma_mem_cb, dma_mem, in sec_alloc_dma_mem()
814 device_printf(sc->sc_dev, "cannot get address of the DMA" in sec_alloc_dma_mem()
819 dma_mem->dma_is_map = 0; in sec_alloc_dma_mem()
823 bus_dmamem_free(dma_mem->dma_tag, dma_mem->dma_vaddr, dma_mem->dma_map); in sec_alloc_dma_mem()
825 bus_dma_tag_destroy(dma_mem->dma_tag); in sec_alloc_dma_mem()
827 dma_mem->dma_vaddr = NULL; in sec_alloc_dma_mem()
837 if (dma_mem->dma_vaddr != NULL) in sec_desc_map_dma()
840 switch (crp->crp_buf.cb_type) { in sec_desc_map_dma()
847 size = m_length(crp->crp_buf.cb_mbuf, NULL); in sec_desc_map_dma()
850 size = crp->crp_buf.cb_mbuf->m_len; in sec_desc_map_dma()
853 size = PAGE_SIZE - crp->crp_buf.cb_vm_page_offset; in sec_desc_map_dma()
868 &(dma_mem->dma_tag)); /* dmat */ in sec_desc_map_dma()
871 device_printf(sc->sc_dev, "failed to allocate busdma tag, error" in sec_desc_map_dma()
873 dma_mem->dma_vaddr = NULL; in sec_desc_map_dma()
877 error = bus_dmamap_create(dma_mem->dma_tag, 0, &(dma_mem->dma_map)); in sec_desc_map_dma()
880 device_printf(sc->sc_dev, "failed to create DMA map, error %i!" in sec_desc_map_dma()
882 bus_dma_tag_destroy(dma_mem->dma_tag); in sec_desc_map_dma()
886 error = bus_dmamap_load_crp(dma_mem->dma_tag, dma_mem->dma_map, crp, in sec_desc_map_dma()
890 device_printf(sc->sc_dev, "cannot get address of the DMA" in sec_desc_map_dma()
892 bus_dmamap_destroy(dma_mem->dma_tag, dma_mem->dma_map); in sec_desc_map_dma()
893 bus_dma_tag_destroy(dma_mem->dma_tag); in sec_desc_map_dma()
897 dma_mem->dma_is_map = 1; in sec_desc_map_dma()
898 dma_mem->dma_vaddr = crp; in sec_desc_map_dma()
908 if (dma_mem->dma_vaddr == NULL) in sec_free_dma_mem()
911 bus_dmamap_unload(dma_mem->dma_tag, dma_mem->dma_map); in sec_free_dma_mem()
913 if (dma_mem->dma_is_map) in sec_free_dma_mem()
914 bus_dmamap_destroy(dma_mem->dma_tag, dma_mem->dma_map); in sec_free_dma_mem()
916 bus_dmamem_free(dma_mem->dma_tag, dma_mem->dma_vaddr, in sec_free_dma_mem()
917 dma_mem->dma_map); in sec_free_dma_mem()
919 bus_dma_tag_destroy(dma_mem->dma_tag); in sec_free_dma_mem()
920 dma_mem->dma_vaddr = NULL; in sec_free_dma_mem()
961 return (channel - 1); in sec_eu_channel()
978 if ((reg & sc->sc_channel_idle_mask) == 0) { in sec_enqueue_desc()
987 return (-1); in sec_enqueue_desc()
992 switch(sc->sc_version) { in sec_enqueue_desc()
993 case 2: in sec_enqueue_desc()
1002 return (-1); in sec_enqueue_desc()
1005 SEC_WRITE(sc, SEC_CHAN_FF(channel), desc->sd_desc_paddr); in sec_enqueue_desc()
1014 int ch0, ch1; in sec_enqueue() local
1022 ch0 = sec_eu_channel(sc, desc->sd_desc->shd_eu_sel0); in sec_enqueue()
1023 ch1 = sec_eu_channel(sc, desc->sd_desc->shd_eu_sel1); in sec_enqueue()
1029 if (ch0 >= 0 && ch0 == ch1) { in sec_enqueue()
1030 if (sec_enqueue_desc(sc, desc, ch0) >= 0) { in sec_enqueue()
1040 if ((ch0 >= 0 && ch1 < 0) || (ch1 >= 0 && ch0 < 0)) { in sec_enqueue()
1041 if (sec_enqueue_desc(sc, desc, (ch0 >= 0) ? ch0 : ch1) in sec_enqueue()
1052 if (ch0 < 0 && ch1 < 0) { in sec_enqueue()
1053 if (sec_enqueue_desc(sc, desc, -1) >= 0) { in sec_enqueue()
1077 if (sc->sc_desc[i].sd_desc_paddr == paddr) { in sec_find_desc()
1078 desc = &(sc->sc_desc[i]); in sec_find_desc()
1094 ptr = &(desc->sd_desc->shd_pointer[n]); in sec_make_pointer_direct()
1095 ptr->shdp_length = dsize; in sec_make_pointer_direct()
1096 ptr->shdp_extent = 0; in sec_make_pointer_direct()
1097 ptr->shdp_j = 0; in sec_make_pointer_direct()
1098 ptr->shdp_ptr = data; in sec_make_pointer_direct()
1113 error = sec_desc_map_dma(sc, &(desc->sd_ptr_dmem[n]), crp, dsize, in sec_make_pointer()
1119 sdmi.sdmi_lt_last->sl_lt->shl_r = 1; in sec_make_pointer()
1120 desc->sd_lt_used += sdmi.sdmi_lt_used; in sec_make_pointer()
1122 ptr = &(desc->sd_desc->shd_pointer[n]); in sec_make_pointer()
1123 ptr->shdp_length = dsize; in sec_make_pointer()
1124 ptr->shdp_extent = 0; in sec_make_pointer()
1125 ptr->shdp_j = 1; in sec_make_pointer()
1126 ptr->shdp_ptr = sdmi.sdmi_lt_first->sl_lt_paddr; in sec_make_pointer()
1135 switch (csp->csp_cipher_alg) { in sec_cipher_supported()
1138 if (csp->csp_ivlen != AES_BLOCK_LEN) in sec_cipher_supported()
1145 if (csp->csp_cipher_klen == 0 || csp->csp_cipher_klen > SEC_MAX_KEY_LEN) in sec_cipher_supported()
1156 switch (csp->csp_auth_alg) { in sec_auth_supported()
1159 if (sc->sc_version < 3) in sec_auth_supported()
1164 if (csp->csp_auth_klen > SEC_MAX_KEY_LEN) in sec_auth_supported()
1180 if (csp->csp_flags != 0) in sec_probesession()
1182 switch (csp->csp_mode) { in sec_probesession()
1211 while (eu->sem_make_desc != NULL) { in sec_newsession()
1212 if (eu->sem_newsession(csp)) in sec_newsession()
1216 KASSERT(eu->sem_make_desc != NULL, ("failed to find eu for session")); in sec_newsession()
1219 if (csp->csp_cipher_key != NULL) in sec_newsession()
1220 memcpy(ses->ss_key, csp->csp_cipher_key, csp->csp_cipher_klen); in sec_newsession()
1223 if (csp->csp_auth_key != NULL) in sec_newsession()
1224 memcpy(ses->ss_mkey, csp->csp_auth_key, csp->csp_auth_klen); in sec_newsession()
1226 if (csp->csp_auth_alg != 0) { in sec_newsession()
1227 if (csp->csp_auth_mlen == 0) in sec_newsession()
1228 ses->ss_mlen = crypto_auth_hash(csp)->hashsize; in sec_newsession()
1230 ses->ss_mlen = csp->csp_auth_mlen; in sec_newsession()
1245 ses = crypto_get_driver_session(crp->crp_session); in sec_process()
1246 csp = crypto_get_params(crp->crp_session); in sec_process()
1249 if (crypto_buffer_len(&crp->crp_buf) > SEC_MAX_DMA_BLOCK_SIZE) { in sec_process()
1250 crp->crp_etype = E2BIG; in sec_process()
1259 if (SEC_FREE_DESC_CNT(sc) == 0 || sc->sc_shutdown) { in sec_process()
1260 sc->sc_blocked |= CRYPTO_SYMQ; in sec_process()
1267 desc->sd_lt_used = 0; in sec_process()
1268 desc->sd_error = 0; in sec_process()
1269 desc->sd_crp = crp; in sec_process()
1271 if (csp->csp_cipher_alg != 0) in sec_process()
1272 crypto_read_iv(crp, desc->sd_desc->shd_iv); in sec_process()
1274 if (crp->crp_cipher_key != NULL) in sec_process()
1275 memcpy(ses->ss_key, crp->crp_cipher_key, csp->csp_cipher_klen); in sec_process()
1277 if (crp->crp_auth_key != NULL) in sec_process()
1278 memcpy(ses->ss_mkey, crp->crp_auth_key, csp->csp_auth_klen); in sec_process()
1280 memcpy(desc->sd_desc->shd_key, ses->ss_key, csp->csp_cipher_klen); in sec_process()
1281 memcpy(desc->sd_desc->shd_mkey, ses->ss_mkey, csp->csp_auth_klen); in sec_process()
1283 error = ses->ss_eu->sem_make_desc(sc, csp, desc, crp); in sec_process()
1290 crp->crp_etype = error; in sec_process()
1297 * if we are running on SEC 3.X. On SEC 2.X we have to enable DONE in sec_process()
1300 if ((hint & CRYPTO_HINT_MORE) && sc->sc_version == 3) in sec_process()
1301 desc->sd_desc->shd_dn = 0; in sec_process()
1303 desc->sd_desc->shd_dn = 1; in sec_process()
1321 struct sec_hw_desc *hd = desc->sd_desc; in sec_build_common_ns_desc()
1324 hd->shd_desc_type = SEC_DT_COMMON_NONSNOOP; in sec_build_common_ns_desc()
1325 hd->shd_eu_sel1 = SEC_EU_NONE; in sec_build_common_ns_desc()
1326 hd->shd_mode1 = 0; in sec_build_common_ns_desc()
1334 error = sec_make_pointer_direct(sc, desc, 1, desc->sd_desc_paddr + in sec_build_common_ns_desc()
1335 offsetof(struct sec_hw_desc, shd_iv), csp->csp_ivlen); in sec_build_common_ns_desc()
1339 /* Pointer 2: Cipher Key */ in sec_build_common_ns_desc()
1340 error = sec_make_pointer_direct(sc, desc, 2, desc->sd_desc_paddr + in sec_build_common_ns_desc()
1341 offsetof(struct sec_hw_desc, shd_key), csp->csp_cipher_klen); in sec_build_common_ns_desc()
1346 error = sec_make_pointer(sc, desc, 3, crp, crp->crp_payload_start, in sec_build_common_ns_desc()
1347 crp->crp_payload_length); in sec_build_common_ns_desc()
1352 error = sec_make_pointer(sc, desc, 4, crp, crp->crp_payload_start, in sec_build_common_ns_desc()
1353 crp->crp_payload_length); in sec_build_common_ns_desc()
1372 struct sec_hw_desc *hd = desc->sd_desc; in sec_build_common_s_desc()
1380 hd->shd_desc_type = SEC_DT_HMAC_SNOOP; in sec_build_common_s_desc()
1381 hd->shd_eu_sel1 = eu; in sec_build_common_s_desc()
1382 hd->shd_mode1 = mode; in sec_build_common_s_desc()
1385 error = sec_make_pointer_direct(sc, desc, 0, desc->sd_desc_paddr + in sec_build_common_s_desc()
1386 offsetof(struct sec_hw_desc, shd_mkey), csp->csp_auth_klen); in sec_build_common_s_desc()
1390 /* Pointer 1: HMAC-Only Data IN */ in sec_build_common_s_desc()
1391 error = sec_make_pointer(sc, desc, 1, crp, crp->crp_aad_start, in sec_build_common_s_desc()
1392 crp->crp_aad_length); in sec_build_common_s_desc()
1396 /* Pointer 2: Cipher Key */ in sec_build_common_s_desc()
1397 error = sec_make_pointer_direct(sc, desc, 2, desc->sd_desc_paddr + in sec_build_common_s_desc()
1398 offsetof(struct sec_hw_desc, shd_key), csp->csp_cipher_klen); in sec_build_common_s_desc()
1403 error = sec_make_pointer_direct(sc, desc, 3, desc->sd_desc_paddr + in sec_build_common_s_desc()
1404 offsetof(struct sec_hw_desc, shd_iv), csp->csp_ivlen); in sec_build_common_s_desc()
1409 error = sec_make_pointer(sc, desc, 4, crp, crp->crp_payload_start, in sec_build_common_s_desc()
1410 crp->crp_payload_length); in sec_build_common_s_desc()
1415 error = sec_make_pointer(sc, desc, 5, crp, crp->crp_payload_start, in sec_build_common_s_desc()
1416 crp->crp_payload_length); in sec_build_common_s_desc()
1421 error = sec_make_pointer_direct(sc, desc, 6, desc->sd_desc_paddr + in sec_build_common_s_desc()
1433 return (csp->csp_cipher_alg == CRYPTO_AES_CBC); in sec_aesu_newsession()
1441 struct sec_hw_desc *hd = desc->sd_desc; in sec_aesu_make_desc()
1444 hd->shd_eu_sel0 = SEC_EU_AESU; in sec_aesu_make_desc()
1445 hd->shd_mode0 = SEC_AESU_MODE_CBC; in sec_aesu_make_desc()
1447 if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { in sec_aesu_make_desc()
1448 hd->shd_mode0 |= SEC_AESU_MODE_ED; in sec_aesu_make_desc()
1449 hd->shd_dir = 0; in sec_aesu_make_desc()
1451 hd->shd_dir = 1; in sec_aesu_make_desc()
1453 if (csp->csp_mode == CSP_MODE_ETA) in sec_aesu_make_desc()
1486 switch (csp->csp_auth_alg) { in sec_mdeu_config()
1521 return (sec_mdeu_can_handle(csp->csp_auth_alg)); in sec_mdeu_newsession()
1529 struct sec_hw_desc *hd = desc->sd_desc; in sec_mdeu_make_desc()
1537 hd->shd_desc_type = SEC_DT_COMMON_NONSNOOP; in sec_mdeu_make_desc()
1538 hd->shd_eu_sel0 = eu; in sec_mdeu_make_desc()
1539 hd->shd_mode0 = mode; in sec_mdeu_make_desc()
1540 hd->shd_eu_sel1 = SEC_EU_NONE; in sec_mdeu_make_desc()
1541 hd->shd_mode1 = 0; in sec_mdeu_make_desc()
1553 /* Pointer 2: HMAC Key (or NULL, depending on digest type) */ in sec_mdeu_make_desc()
1554 if (hd->shd_mode0 & SEC_MDEU_MODE_HMAC) in sec_mdeu_make_desc()
1555 error = sec_make_pointer_direct(sc, desc, 2, in sec_mdeu_make_desc()
1556 desc->sd_desc_paddr + offsetof(struct sec_hw_desc, in sec_mdeu_make_desc()
1557 shd_mkey), csp->csp_auth_klen); in sec_mdeu_make_desc()
1559 error = sec_make_pointer_direct(sc, desc, 2, 0, 0); in sec_mdeu_make_desc()
1565 error = sec_make_pointer(sc, desc, 3, crp, crp->crp_payload_start, in sec_mdeu_make_desc()
1566 crp->crp_payload_length); in sec_mdeu_make_desc()
1576 error = sec_make_pointer_direct(sc, desc, 5, desc->sd_desc_paddr + in sec_mdeu_make_desc()