Lines Matching refs:areq

976 			    struct aead_request *areq)  in ipsec_esp_unmap()  argument
978 struct crypto_aead *aead = crypto_aead_reqtfm(areq); in ipsec_esp_unmap()
989 talitos_sg_unmap(dev, edesc, areq->src, areq->dst, areq->cryptlen, in ipsec_esp_unmap()
990 areq->assoclen); in ipsec_esp_unmap()
999 sg_pcopy_to_buffer(areq->dst, dst_nents, ctx->iv, ivsize, in ipsec_esp_unmap()
1000 areq->assoclen + areq->cryptlen - ivsize); in ipsec_esp_unmap()
1013 struct aead_request *areq = context; in ipsec_esp_encrypt_done() local
1014 struct crypto_aead *authenc = crypto_aead_reqtfm(areq); in ipsec_esp_encrypt_done()
1023 ipsec_esp_unmap(dev, edesc, areq); in ipsec_esp_encrypt_done()
1028 icvdata = edesc->buf + areq->assoclen + areq->cryptlen; in ipsec_esp_encrypt_done()
1032 sg = sg_last(areq->dst, edesc->dst_nents); in ipsec_esp_encrypt_done()
1041 aead_request_complete(areq, err); in ipsec_esp_encrypt_done()
1198 static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq, in ipsec_esp() argument
1203 struct crypto_aead *aead = crypto_aead_reqtfm(areq); in ipsec_esp()
1208 unsigned int cryptlen = areq->cryptlen; in ipsec_esp()
1225 sg_copy_to_buffer(areq->src, sg_count, edesc->buf, in ipsec_esp()
1226 areq->assoclen + cryptlen); in ipsec_esp()
1228 sg_count = dma_map_sg(dev, areq->src, sg_count, in ipsec_esp()
1229 (areq->src == areq->dst) ? in ipsec_esp()
1233 ret = talitos_sg_map(dev, areq->src, areq->assoclen, edesc, in ipsec_esp()
1257 ret = talitos_sg_map_ext(dev, areq->src, cryptlen, edesc, &desc->ptr[4], in ipsec_esp()
1258 sg_count, areq->assoclen, tbl_off, elen); in ipsec_esp()
1266 if (areq->src != areq->dst) { in ipsec_esp()
1269 dma_map_sg(dev, areq->dst, sg_count, DMA_FROM_DEVICE); in ipsec_esp()
1272 ret = talitos_sg_map(dev, areq->dst, cryptlen, edesc, &desc->ptr[5], in ipsec_esp()
1273 sg_count, areq->assoclen, tbl_off); in ipsec_esp()
1301 addr += areq->assoclen + cryptlen; in ipsec_esp()
1308 ret = talitos_sg_map(dev, areq->dst, authsize, edesc, in ipsec_esp()
1309 &desc->ptr[6], sg_count, areq->assoclen + in ipsec_esp()
1333 ret = talitos_submit(dev, ctx->ch, desc, callback, areq); in ipsec_esp()
1335 ipsec_esp_unmap(dev, edesc, areq); in ipsec_esp()
1454 static struct talitos_edesc *aead_edesc_alloc(struct aead_request *areq, u8 *iv, in aead_edesc_alloc() argument
1457 struct crypto_aead *authenc = crypto_aead_reqtfm(areq); in aead_edesc_alloc()
1462 return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst, in aead_edesc_alloc()
1463 iv, areq->assoclen, areq->cryptlen, in aead_edesc_alloc()
1465 areq->base.flags, encrypt); in aead_edesc_alloc()
1565 struct ablkcipher_request *areq) in common_nonsnoop_unmap() argument
1569 talitos_sg_unmap(dev, edesc, areq->src, areq->dst, areq->nbytes, 0); in common_nonsnoop_unmap()
1581 struct ablkcipher_request *areq = context; in ablkcipher_done() local
1586 common_nonsnoop_unmap(dev, edesc, areq); in ablkcipher_done()
1590 areq->base.complete(&areq->base, err); in ablkcipher_done()
1594 struct ablkcipher_request *areq, in common_nonsnoop() argument
1599 struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq); in common_nonsnoop()
1603 unsigned int cryptlen = areq->nbytes; in common_nonsnoop()
1620 sg_copy_to_buffer(areq->src, sg_count, edesc->buf, in common_nonsnoop()
1623 sg_count = dma_map_sg(dev, areq->src, sg_count, in common_nonsnoop()
1624 (areq->src == areq->dst) ? in common_nonsnoop()
1629 sg_count = talitos_sg_map(dev, areq->src, cryptlen, edesc, in common_nonsnoop()
1635 if (areq->src != areq->dst) { in common_nonsnoop()
1638 dma_map_sg(dev, areq->dst, sg_count, DMA_FROM_DEVICE); in common_nonsnoop()
1641 ret = talitos_sg_map(dev, areq->dst, cryptlen, edesc, &desc->ptr[4], in common_nonsnoop()
1656 ret = talitos_submit(dev, ctx->ch, desc, callback, areq); in common_nonsnoop()
1658 common_nonsnoop_unmap(dev, edesc, areq); in common_nonsnoop()
1665 areq, bool encrypt) in ablkcipher_edesc_alloc()
1667 struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq); in ablkcipher_edesc_alloc()
1671 return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst, in ablkcipher_edesc_alloc()
1672 areq->info, 0, areq->nbytes, 0, ivsize, 0, in ablkcipher_edesc_alloc()
1673 areq->base.flags, encrypt); in ablkcipher_edesc_alloc()
1676 static int ablkcipher_encrypt(struct ablkcipher_request *areq) in ablkcipher_encrypt() argument
1678 struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq); in ablkcipher_encrypt()
1683 edesc = ablkcipher_edesc_alloc(areq, true); in ablkcipher_encrypt()
1690 return common_nonsnoop(edesc, areq, ablkcipher_done); in ablkcipher_encrypt()
1693 static int ablkcipher_decrypt(struct ablkcipher_request *areq) in ablkcipher_decrypt() argument
1695 struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq); in ablkcipher_decrypt()
1700 edesc = ablkcipher_edesc_alloc(areq, false); in ablkcipher_decrypt()
1706 return common_nonsnoop(edesc, areq, ablkcipher_done); in ablkcipher_decrypt()
1711 struct ahash_request *areq) in common_nonsnoop_hash_unmap() argument
1713 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in common_nonsnoop_hash_unmap()
1751 struct ahash_request *areq = context; in ahash_done() local
1754 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_done()
1761 common_nonsnoop_hash_unmap(dev, edesc, areq); in ahash_done()
1765 areq->base.complete(&areq->base, err); in ahash_done()
1790 struct ahash_request *areq, unsigned int length, in common_nonsnoop_hash() argument
1796 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in common_nonsnoop_hash()
1798 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in common_nonsnoop_hash()
1856 areq->result, DMA_FROM_DEVICE); in common_nonsnoop_hash()
1909 ret = talitos_submit(dev, ctx->ch, desc, callback, areq); in common_nonsnoop_hash()
1911 common_nonsnoop_hash_unmap(dev, edesc, areq); in common_nonsnoop_hash()
1917 static struct talitos_edesc *ahash_edesc_alloc(struct ahash_request *areq, in ahash_edesc_alloc() argument
1920 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in ahash_edesc_alloc()
1922 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_edesc_alloc()
1930 nbytes, 0, 0, 0, areq->base.flags, false); in ahash_edesc_alloc()
1933 static int ahash_init(struct ahash_request *areq) in ahash_init() argument
1935 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in ahash_init()
1938 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init()
1963 static int ahash_init_sha224_swinit(struct ahash_request *areq) in ahash_init_sha224_swinit() argument
1965 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init_sha224_swinit()
1980 ahash_init(areq); in ahash_init_sha224_swinit()
1986 static int ahash_process_req(struct ahash_request *areq, unsigned int nbytes) in ahash_process_req() argument
1988 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in ahash_process_req()
1990 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_process_req()
2006 nents = sg_nents_for_len(areq->src, nbytes); in ahash_process_req()
2011 sg_copy_to_buffer(areq->src, nents, in ahash_process_req()
2038 sg_chain(req_ctx->bufsl, 2, areq->src); in ahash_process_req()
2045 nents = sg_nents_for_len(areq->src, offset); in ahash_process_req()
2050 sg_copy_to_buffer(areq->src, nents, in ahash_process_req()
2053 req_ctx->psrc = areq->src; in ahash_process_req()
2055 req_ctx->psrc = areq->src; in ahash_process_req()
2058 nents = sg_nents_for_len(areq->src, nbytes); in ahash_process_req()
2063 sg_pcopy_to_buffer(areq->src, nents, in ahash_process_req()
2071 edesc = ahash_edesc_alloc(areq, nbytes_to_hash); in ahash_process_req()
2093 return common_nonsnoop_hash(edesc, areq, nbytes_to_hash, offset, in ahash_process_req()
2097 static int ahash_update(struct ahash_request *areq) in ahash_update() argument
2099 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_update()
2103 return ahash_process_req(areq, areq->nbytes); in ahash_update()
2106 static int ahash_final(struct ahash_request *areq) in ahash_final() argument
2108 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_final()
2112 return ahash_process_req(areq, 0); in ahash_final()
2115 static int ahash_finup(struct ahash_request *areq) in ahash_finup() argument
2117 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_finup()
2121 return ahash_process_req(areq, areq->nbytes); in ahash_finup()
2124 static int ahash_digest(struct ahash_request *areq) in ahash_digest() argument
2126 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_digest()
2127 struct crypto_ahash *ahash = crypto_ahash_reqtfm(areq); in ahash_digest()
2129 ahash->init(areq); in ahash_digest()
2132 return ahash_process_req(areq, areq->nbytes); in ahash_digest()
2135 static int ahash_export(struct ahash_request *areq, void *out) in ahash_export() argument
2137 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_export()
2139 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in ahash_export()
2160 static int ahash_import(struct ahash_request *areq, const void *in) in ahash_import() argument
2162 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_import()
2163 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in ahash_import()