Lines Matching +full:npe +full:- +full:handle

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Intel IXP4xx NPE-C crypto driver
9 #include <linux/dma-mapping.h>
31 #include <linux/soc/ixp4xx/npe.h>
34 /* Intermittent includes, delete this after v5.14-rc1 */
36 #include <mach/ixp4xx-regs.h>
137 u32 crypto_ctx; /* NPE Crypto Param structure address */
224 static struct npe *npe_c;
240 return crypt_phys + (virt - crypt_virt) * sizeof(struct crypt_ctl); in crypt_virt2phys()
245 return crypt_virt + (phys - crypt_phys) / sizeof(struct crypt_ctl); in crypt_phys2virt()
250 return container_of(tfm->__crt_alg, struct ixp_alg, crypto.base)->cfg_enc; in cipher_cfg_enc()
255 return container_of(tfm->__crt_alg, struct ixp_alg, crypto.base)->cfg_dec; in cipher_cfg_dec()
260 return container_of(tfm->__crt_alg, struct ixp_alg, crypto.base)->hash; in ix_hash()
265 struct device *dev = &pdev->dev; in setup_crypt_desc()
272 return -ENOMEM; in setup_crypt_desc()
339 buf1 = buf->next; in free_buf_chain()
340 phys1 = buf->phys_next; in free_buf_chain()
341 dma_unmap_single(dev, buf->phys_addr, buf->buf_len, buf->dir); in free_buf_chain()
352 struct aead_request *req = crypt->data.aead_req; in finish_scattered_hmac()
356 int decryptlen = req->assoclen + req->cryptlen - authsize; in finish_scattered_hmac()
358 if (req_ctx->encrypt) { in finish_scattered_hmac()
359 scatterwalk_map_and_copy(req_ctx->hmac_virt, req->dst, in finish_scattered_hmac()
362 dma_pool_free(buffer_pool, req_ctx->hmac_virt, crypt->icv_rev_aes); in finish_scattered_hmac()
367 struct device *dev = &pdev->dev; in one_packet()
372 failed = phys & 0x1 ? -EBADMSG : 0; in one_packet()
376 switch (crypt->ctl_flags & CTL_FLAG_MASK) { in one_packet()
378 struct aead_request *req = crypt->data.aead_req; in one_packet()
381 free_buf_chain(dev, req_ctx->src, crypt->src_buf); in one_packet()
382 free_buf_chain(dev, req_ctx->dst, crypt->dst_buf); in one_packet()
383 if (req_ctx->hmac_virt) in one_packet()
386 req->base.complete(&req->base, failed); in one_packet()
390 struct skcipher_request *req = crypt->data.ablk_req; in one_packet()
397 offset = req->cryptlen - ivsize; in one_packet()
398 if (req_ctx->encrypt) { in one_packet()
399 scatterwalk_map_and_copy(req->iv, req->dst, in one_packet()
402 memcpy(req->iv, req_ctx->iv, ivsize); in one_packet()
403 memzero_explicit(req_ctx->iv, ivsize); in one_packet()
407 if (req_ctx->dst) in one_packet()
408 free_buf_chain(dev, req_ctx->dst, crypt->dst_buf); in one_packet()
410 free_buf_chain(dev, req_ctx->src, crypt->src_buf); in one_packet()
411 req->base.complete(&req->base, failed); in one_packet()
415 ctx = crypto_tfm_ctx(crypt->data.tfm); in one_packet()
416 dma_pool_free(ctx_pool, crypt->regist_ptr, in one_packet()
417 crypt->regist_buf->phys_addr); in one_packet()
418 dma_pool_free(buffer_pool, crypt->regist_buf, crypt->src_buf); in one_packet()
419 if (atomic_dec_and_test(&ctx->configuring)) in one_packet()
420 complete(&ctx->completion); in one_packet()
423 ctx = crypto_tfm_ctx(crypt->data.tfm); in one_packet()
424 *(u32 *)ctx->decrypt.npe_ctx &= cpu_to_be32(~CIPH_ENCR); in one_packet()
425 if (atomic_dec_and_test(&ctx->configuring)) in one_packet()
426 complete(&ctx->completion); in one_packet()
431 crypt->ctl_flags = CTL_FLAG_UNUSED; in one_packet()
454 struct device_node *np = dev->of_node; in init_ixp_crypto()
456 int ret = -ENODEV; in init_ixp_crypto()
461 /* Locate the NPE and queue manager to use from device tree */ in init_ixp_crypto()
466 ret = of_parse_phandle_with_fixed_args(np, "intel,npe-handle", in init_ixp_crypto()
469 dev_err(dev, "no NPE engine specified\n"); in init_ixp_crypto()
470 return -ENODEV; in init_ixp_crypto()
474 ret = of_parse_phandle_with_fixed_args(np, "queue-rx", 1, 0, in init_ixp_crypto()
478 return -ENODEV; in init_ixp_crypto()
482 ret = of_parse_phandle_with_fixed_args(np, "queue-txready", 1, 0, in init_ixp_crypto()
486 return -ENODEV; in init_ixp_crypto()
528 ret = -ENODEV; in init_ixp_crypto()
537 ret = -ENOMEM; in init_ixp_crypto()
563 ret = -EIO; in init_ixp_crypto()
592 memset(dir->npe_ctx, 0, NPE_CTX_LEN); in reset_sa_dir()
593 dir->npe_ctx_idx = 0; in reset_sa_dir()
594 dir->npe_mode = 0; in reset_sa_dir()
599 dir->npe_ctx = dma_pool_alloc(ctx_pool, GFP_KERNEL, &dir->npe_ctx_phys); in init_sa_dir()
600 if (!dir->npe_ctx) in init_sa_dir()
601 return -ENOMEM; in init_sa_dir()
609 memset(dir->npe_ctx, 0, NPE_CTX_LEN); in free_sa_dir()
610 dma_pool_free(ctx_pool, dir->npe_ctx, dir->npe_ctx_phys); in free_sa_dir()
618 atomic_set(&ctx->configuring, 0); in init_tfm()
619 ret = init_sa_dir(&ctx->encrypt); in init_tfm()
622 ret = init_sa_dir(&ctx->decrypt); in init_tfm()
624 free_sa_dir(&ctx->encrypt); in init_tfm()
635 ctx->fallback_tfm = crypto_alloc_skcipher(name, 0, CRYPTO_ALG_NEED_FALLBACK); in init_tfm_ablk()
636 if (IS_ERR(ctx->fallback_tfm)) { in init_tfm_ablk()
638 name, PTR_ERR(ctx->fallback_tfm)); in init_tfm_ablk()
639 return PTR_ERR(ctx->fallback_tfm); in init_tfm_ablk()
643 crypto_tfm_alg_driver_name(&tfm->base), in init_tfm_ablk()
644 crypto_tfm_alg_driver_name(crypto_skcipher_tfm(ctx->fallback_tfm)) in init_tfm_ablk()
647 …crypto_skcipher_set_reqsize(tfm, sizeof(struct ablk_ctx) + crypto_skcipher_reqsize(ctx->fallback_t… in init_tfm_ablk()
661 free_sa_dir(&ctx->encrypt); in exit_tfm()
662 free_sa_dir(&ctx->decrypt); in exit_tfm()
670 crypto_free_skcipher(ctx->fallback_tfm); in exit_tfm_ablk()
693 return -ENOMEM; in register_chain_var()
697 return -ENOMEM; in register_chain_var()
703 return -EAGAIN; in register_chain_var()
707 memset(pad + key_len, 0, HMAC_PAD_BLOCKLEN - key_len); in register_chain_var()
711 crypt->data.tfm = tfm; in register_chain_var()
712 crypt->regist_ptr = pad; in register_chain_var()
713 crypt->regist_buf = buf; in register_chain_var()
715 crypt->auth_offs = 0; in register_chain_var()
716 crypt->auth_len = HMAC_PAD_BLOCKLEN; in register_chain_var()
717 crypt->crypto_ctx = ctx_addr; in register_chain_var()
718 crypt->src_buf = buf_phys; in register_chain_var()
719 crypt->icv_rev_aes = target; in register_chain_var()
720 crypt->mode = NPE_OP_HASH_GEN_ICV; in register_chain_var()
721 crypt->init_len = init_len; in register_chain_var()
722 crypt->ctl_flags |= CTL_FLAG_GEN_ICV; in register_chain_var()
724 buf->next = 0; in register_chain_var()
725 buf->buf_len = HMAC_PAD_BLOCKLEN; in register_chain_var()
726 buf->pkt_len = 0; in register_chain_var()
727 buf->phys_addr = pad_phys; in register_chain_var()
729 atomic_inc(&ctx->configuring); in register_chain_var()
746 dir = encrypt ? &ctx->encrypt : &ctx->decrypt; in setup_auth()
747 cinfo = dir->npe_ctx + dir->npe_ctx_idx; in setup_auth()
751 cfgword = algo->cfgword | (authsize << 6); /* (authsize/4) << 8 */ in setup_auth()
759 memcpy(cinfo, algo->icv, digest_len); in setup_auth()
762 itarget = dir->npe_ctx_phys + dir->npe_ctx_idx in setup_auth()
763 + sizeof(algo->cfgword); in setup_auth()
765 init_len = cinfo - (dir->npe_ctx + dir->npe_ctx_idx); in setup_auth()
766 npe_ctx_addr = dir->npe_ctx_phys + dir->npe_ctx_idx; in setup_auth()
768 dir->npe_ctx_idx += init_len; in setup_auth()
769 dir->npe_mode |= NPE_OP_HASH_ENABLE; in setup_auth()
772 dir->npe_mode |= NPE_OP_HASH_VERIFY; in setup_auth()
786 struct ix_sa_dir *dir = &ctx->decrypt; in gen_rev_aes_key()
790 return -EAGAIN; in gen_rev_aes_key()
792 *(u32 *)dir->npe_ctx |= cpu_to_be32(CIPH_ENCR); in gen_rev_aes_key()
794 crypt->data.tfm = tfm; in gen_rev_aes_key()
795 crypt->crypt_offs = 0; in gen_rev_aes_key()
796 crypt->crypt_len = AES_BLOCK128; in gen_rev_aes_key()
797 crypt->src_buf = 0; in gen_rev_aes_key()
798 crypt->crypto_ctx = dir->npe_ctx_phys; in gen_rev_aes_key()
799 crypt->icv_rev_aes = dir->npe_ctx_phys + sizeof(u32); in gen_rev_aes_key()
800 crypt->mode = NPE_OP_ENC_GEN_KEY; in gen_rev_aes_key()
801 crypt->init_len = dir->npe_ctx_idx; in gen_rev_aes_key()
802 crypt->ctl_flags |= CTL_FLAG_GEN_REVAES; in gen_rev_aes_key()
804 atomic_inc(&ctx->configuring); in gen_rev_aes_key()
820 dir = encrypt ? &ctx->encrypt : &ctx->decrypt; in setup_cipher()
821 cinfo = dir->npe_ctx; in setup_cipher()
825 dir->npe_mode |= NPE_OP_CRYPT_ENCRYPT; in setup_cipher()
841 return -EINVAL; in setup_cipher()
855 /* NPE wants keylen set to DES3_EDE_KEY_SIZE even for single DES */ in setup_cipher()
857 memset(cinfo + key_len, 0, DES3_EDE_KEY_SIZE - key_len); in setup_cipher()
860 dir->npe_ctx_idx = sizeof(cipher_cfg) + key_len; in setup_cipher()
861 dir->npe_mode |= NPE_OP_CRYPT_ENABLE; in setup_cipher()
874 unsigned int len = min(nbytes, sg->length); in chainup_buffers()
879 nbytes -= len; in chainup_buffers()
887 buf->next = next_buf; in chainup_buffers()
888 buf->phys_next = next_buf_phys; in chainup_buffers()
891 buf->phys_addr = sg_dma_address(sg); in chainup_buffers()
892 buf->buf_len = len; in chainup_buffers()
893 buf->dir = dir; in chainup_buffers()
895 buf->next = NULL; in chainup_buffers()
896 buf->phys_next = 0; in chainup_buffers()
906 init_completion(&ctx->completion); in ablk_setkey()
907 atomic_inc(&ctx->configuring); in ablk_setkey()
909 reset_sa_dir(&ctx->encrypt); in ablk_setkey()
910 reset_sa_dir(&ctx->decrypt); in ablk_setkey()
912 ctx->encrypt.npe_mode = NPE_OP_HMAC_DISABLE; in ablk_setkey()
913 ctx->decrypt.npe_mode = NPE_OP_HMAC_DISABLE; in ablk_setkey()
915 ret = setup_cipher(&tfm->base, 0, key, key_len); in ablk_setkey()
918 ret = setup_cipher(&tfm->base, 1, key, key_len); in ablk_setkey()
920 if (!atomic_dec_and_test(&ctx->configuring)) in ablk_setkey()
921 wait_for_completion(&ctx->completion); in ablk_setkey()
924 crypto_skcipher_clear_flags(ctx->fallback_tfm, CRYPTO_TFM_REQ_MASK); in ablk_setkey()
925 crypto_skcipher_set_flags(ctx->fallback_tfm, tfm->base.crt_flags & CRYPTO_TFM_REQ_MASK); in ablk_setkey()
927 return crypto_skcipher_setkey(ctx->fallback_tfm, key, key_len); in ablk_setkey()
944 return -EINVAL; in ablk_rfc3686_setkey()
946 memcpy(ctx->nonce, key + (key_len - CTR_RFC3686_NONCE_SIZE), in ablk_rfc3686_setkey()
949 key_len -= CTR_RFC3686_NONCE_SIZE; in ablk_rfc3686_setkey()
960 skcipher_request_set_tfm(&rctx->fallback_req, op->fallback_tfm); in ixp4xx_cipher_fallback()
961 skcipher_request_set_callback(&rctx->fallback_req, areq->base.flags, in ixp4xx_cipher_fallback()
962 areq->base.complete, areq->base.data); in ixp4xx_cipher_fallback()
963 skcipher_request_set_crypt(&rctx->fallback_req, areq->src, areq->dst, in ixp4xx_cipher_fallback()
964 areq->cryptlen, areq->iv); in ixp4xx_cipher_fallback()
966 err = crypto_skcipher_encrypt(&rctx->fallback_req); in ixp4xx_cipher_fallback()
968 err = crypto_skcipher_decrypt(&rctx->fallback_req); in ixp4xx_cipher_fallback()
979 unsigned int nbytes = req->cryptlen; in ablk_perform()
983 struct device *dev = &pdev->dev; in ablk_perform()
985 gfp_t flags = req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ? in ablk_perform()
988 if (sg_nents(req->src) > 1 || sg_nents(req->dst) > 1) in ablk_perform()
992 return -EAGAIN; in ablk_perform()
993 if (atomic_read(&ctx->configuring)) in ablk_perform()
994 return -EAGAIN; in ablk_perform()
996 dir = encrypt ? &ctx->encrypt : &ctx->decrypt; in ablk_perform()
997 req_ctx->encrypt = encrypt; in ablk_perform()
1001 return -ENOMEM; in ablk_perform()
1003 crypt->data.ablk_req = req; in ablk_perform()
1004 crypt->crypto_ctx = dir->npe_ctx_phys; in ablk_perform()
1005 crypt->mode = dir->npe_mode; in ablk_perform()
1006 crypt->init_len = dir->npe_ctx_idx; in ablk_perform()
1008 crypt->crypt_offs = 0; in ablk_perform()
1009 crypt->crypt_len = nbytes; in ablk_perform()
1011 BUG_ON(ivsize && !req->iv); in ablk_perform()
1012 memcpy(crypt->iv, req->iv, ivsize); in ablk_perform()
1014 offset = req->cryptlen - ivsize; in ablk_perform()
1015 scatterwalk_map_and_copy(req_ctx->iv, req->src, offset, ivsize, 0); in ablk_perform()
1017 if (req->src != req->dst) { in ablk_perform()
1020 crypt->mode |= NPE_OP_NOT_IN_PLACE; in ablk_perform()
1023 req_ctx->dst = NULL; in ablk_perform()
1024 if (!chainup_buffers(dev, req->dst, nbytes, &dst_hook, in ablk_perform()
1028 req_ctx->dst = dst_hook.next; in ablk_perform()
1029 crypt->dst_buf = dst_hook.phys_next; in ablk_perform()
1031 req_ctx->dst = NULL; in ablk_perform()
1033 req_ctx->src = NULL; in ablk_perform()
1034 if (!chainup_buffers(dev, req->src, nbytes, &src_hook, flags, in ablk_perform()
1038 req_ctx->src = src_hook.next; in ablk_perform()
1039 crypt->src_buf = src_hook.phys_next; in ablk_perform()
1040 crypt->ctl_flags |= CTL_FLAG_PERFORM_ABLK; in ablk_perform()
1043 return -EINPROGRESS; in ablk_perform()
1046 free_buf_chain(dev, req_ctx->src, crypt->src_buf); in ablk_perform()
1048 if (req->src != req->dst) in ablk_perform()
1049 free_buf_chain(dev, req_ctx->dst, crypt->dst_buf); in ablk_perform()
1051 crypt->ctl_flags = CTL_FLAG_UNUSED; in ablk_perform()
1052 return -ENOMEM; in ablk_perform()
1070 u8 *info = req->iv; in ablk_rfc3686_crypt()
1074 memcpy(iv, ctx->nonce, CTR_RFC3686_NONCE_SIZE); in ablk_rfc3686_crypt()
1081 req->iv = iv; in ablk_rfc3686_crypt()
1083 req->iv = info; in ablk_rfc3686_crypt()
1099 struct device *dev = &pdev->dev; in aead_perform()
1100 gfp_t flags = req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ? in aead_perform()
1106 return -EAGAIN; in aead_perform()
1107 if (atomic_read(&ctx->configuring)) in aead_perform()
1108 return -EAGAIN; in aead_perform()
1111 dir = &ctx->encrypt; in aead_perform()
1112 cryptlen = req->cryptlen; in aead_perform()
1114 dir = &ctx->decrypt; in aead_perform()
1115 /* req->cryptlen includes the authsize when decrypting */ in aead_perform()
1116 cryptlen = req->cryptlen - authsize; in aead_perform()
1117 eff_cryptlen -= authsize; in aead_perform()
1121 return -ENOMEM; in aead_perform()
1123 crypt->data.aead_req = req; in aead_perform()
1124 crypt->crypto_ctx = dir->npe_ctx_phys; in aead_perform()
1125 crypt->mode = dir->npe_mode; in aead_perform()
1126 crypt->init_len = dir->npe_ctx_idx; in aead_perform()
1128 crypt->crypt_offs = cryptoffset; in aead_perform()
1129 crypt->crypt_len = eff_cryptlen; in aead_perform()
1131 crypt->auth_offs = 0; in aead_perform()
1132 crypt->auth_len = req->assoclen + cryptlen; in aead_perform()
1133 BUG_ON(ivsize && !req->iv); in aead_perform()
1134 memcpy(crypt->iv, req->iv, ivsize); in aead_perform()
1136 buf = chainup_buffers(dev, req->src, crypt->auth_len, in aead_perform()
1138 req_ctx->src = src_hook.next; in aead_perform()
1139 crypt->src_buf = src_hook.phys_next; in aead_perform()
1143 lastlen = buf->buf_len; in aead_perform()
1145 crypt->icv_rev_aes = buf->phys_addr + in aead_perform()
1146 buf->buf_len - authsize; in aead_perform()
1148 req_ctx->dst = NULL; in aead_perform()
1150 if (req->src != req->dst) { in aead_perform()
1153 crypt->mode |= NPE_OP_NOT_IN_PLACE; in aead_perform()
1156 buf = chainup_buffers(dev, req->dst, crypt->auth_len, in aead_perform()
1158 req_ctx->dst = dst_hook.next; in aead_perform()
1159 crypt->dst_buf = dst_hook.phys_next; in aead_perform()
1165 lastlen = buf->buf_len; in aead_perform()
1167 crypt->icv_rev_aes = buf->phys_addr + in aead_perform()
1168 buf->buf_len - authsize; in aead_perform()
1175 req_ctx->hmac_virt = dma_pool_alloc(buffer_pool, flags, in aead_perform()
1176 &crypt->icv_rev_aes); in aead_perform()
1177 if (unlikely(!req_ctx->hmac_virt)) in aead_perform()
1180 scatterwalk_map_and_copy(req_ctx->hmac_virt, in aead_perform()
1181 req->src, cryptlen, authsize, 0); in aead_perform()
1183 req_ctx->encrypt = encrypt; in aead_perform()
1185 req_ctx->hmac_virt = NULL; in aead_perform()
1188 crypt->ctl_flags |= CTL_FLAG_PERFORM_AEAD; in aead_perform()
1191 return -EINPROGRESS; in aead_perform()
1194 free_buf_chain(dev, req_ctx->dst, crypt->dst_buf); in aead_perform()
1196 free_buf_chain(dev, req_ctx->src, crypt->src_buf); in aead_perform()
1197 crypt->ctl_flags = CTL_FLAG_UNUSED; in aead_perform()
1198 return -ENOMEM; in aead_perform()
1207 if (!ctx->enckey_len && !ctx->authkey_len) in aead_setup()
1209 init_completion(&ctx->completion); in aead_setup()
1210 atomic_inc(&ctx->configuring); in aead_setup()
1212 reset_sa_dir(&ctx->encrypt); in aead_setup()
1213 reset_sa_dir(&ctx->decrypt); in aead_setup()
1215 ret = setup_cipher(&tfm->base, 0, ctx->enckey, ctx->enckey_len); in aead_setup()
1218 ret = setup_cipher(&tfm->base, 1, ctx->enckey, ctx->enckey_len); in aead_setup()
1221 ret = setup_auth(&tfm->base, 0, authsize, ctx->authkey, in aead_setup()
1222 ctx->authkey_len, digest_len); in aead_setup()
1225 ret = setup_auth(&tfm->base, 1, authsize, ctx->authkey, in aead_setup()
1226 ctx->authkey_len, digest_len); in aead_setup()
1228 if (!atomic_dec_and_test(&ctx->configuring)) in aead_setup()
1229 wait_for_completion(&ctx->completion); in aead_setup()
1238 return -EINVAL; in aead_setauthsize()
1251 if (keys.authkeylen > sizeof(ctx->authkey)) in aead_setkey()
1254 if (keys.enckeylen > sizeof(ctx->enckey)) in aead_setkey()
1257 memcpy(ctx->authkey, keys.authkey, keys.authkeylen); in aead_setkey()
1258 memcpy(ctx->enckey, keys.enckey, keys.enckeylen); in aead_setkey()
1259 ctx->authkey_len = keys.authkeylen; in aead_setkey()
1260 ctx->enckey_len = keys.enckeylen; in aead_setkey()
1266 return -EINVAL; in aead_setkey()
1280 err = -EINVAL; in des3_aead_setkey()
1281 if (keys.authkeylen > sizeof(ctx->authkey)) in des3_aead_setkey()
1288 memcpy(ctx->authkey, keys.authkey, keys.authkeylen); in des3_aead_setkey()
1289 memcpy(ctx->enckey, keys.enckey, keys.enckeylen); in des3_aead_setkey()
1290 ctx->authkey_len = keys.authkeylen; in des3_aead_setkey()
1291 ctx->enckey_len = keys.enckeylen; in des3_aead_setkey()
1302 return aead_perform(req, 1, req->assoclen, req->cryptlen, req->iv); in aead_encrypt()
1307 return aead_perform(req, 0, req->assoclen, req->cryptlen, req->iv); in aead_decrypt()
1480 #define IXP_POSTFIX "-ixp4xx"
1484 struct device *dev = &_pdev->dev; in ixp_crypto_probe()
1497 if (snprintf(cra->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in ixp_crypto_probe()
1498 "%s"IXP_POSTFIX, cra->base.cra_name) >= in ixp_crypto_probe()
1505 cra->base.cra_flags = CRYPTO_ALG_KERN_DRIVER_ONLY | in ixp_crypto_probe()
1509 if (!cra->setkey) in ixp_crypto_probe()
1510 cra->setkey = ablk_setkey; in ixp_crypto_probe()
1511 if (!cra->encrypt) in ixp_crypto_probe()
1512 cra->encrypt = ablk_encrypt; in ixp_crypto_probe()
1513 if (!cra->decrypt) in ixp_crypto_probe()
1514 cra->decrypt = ablk_decrypt; in ixp_crypto_probe()
1515 cra->init = init_tfm_ablk; in ixp_crypto_probe()
1516 cra->exit = exit_tfm_ablk; in ixp_crypto_probe()
1518 cra->base.cra_ctxsize = sizeof(struct ixp_ctx); in ixp_crypto_probe()
1519 cra->base.cra_module = THIS_MODULE; in ixp_crypto_probe()
1520 cra->base.cra_alignmask = 3; in ixp_crypto_probe()
1521 cra->base.cra_priority = 300; in ixp_crypto_probe()
1523 dev_err(&pdev->dev, "Failed to register '%s'\n", in ixp_crypto_probe()
1524 cra->base.cra_name); in ixp_crypto_probe()
1532 if (snprintf(cra->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in ixp_crypto_probe()
1533 "%s"IXP_POSTFIX, cra->base.cra_name) >= in ixp_crypto_probe()
1540 cra->base.cra_flags = CRYPTO_ALG_KERN_DRIVER_ONLY | in ixp_crypto_probe()
1543 cra->setkey = cra->setkey ?: aead_setkey; in ixp_crypto_probe()
1544 cra->setauthsize = aead_setauthsize; in ixp_crypto_probe()
1545 cra->encrypt = aead_encrypt; in ixp_crypto_probe()
1546 cra->decrypt = aead_decrypt; in ixp_crypto_probe()
1547 cra->init = init_tfm_aead; in ixp_crypto_probe()
1548 cra->exit = exit_tfm_aead; in ixp_crypto_probe()
1550 cra->base.cra_ctxsize = sizeof(struct ixp_ctx); in ixp_crypto_probe()
1551 cra->base.cra_module = THIS_MODULE; in ixp_crypto_probe()
1552 cra->base.cra_alignmask = 3; in ixp_crypto_probe()
1553 cra->base.cra_priority = 300; in ixp_crypto_probe()
1556 dev_err(&pdev->dev, "Failed to register '%s'\n", in ixp_crypto_probe()
1557 cra->base.cra_driver_name); in ixp_crypto_probe()
1578 release_ixp_crypto(&pdev->dev); in ixp_crypto_remove()
1584 .compatible = "intel,ixp4xx-crypto",