Lines Matching refs:req_ctx
1699 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in common_nonsnoop_hash_unmap() local
1711 if (req_ctx->last) in common_nonsnoop_hash_unmap()
1712 memcpy(areq->result, req_ctx->hw_context, in common_nonsnoop_hash_unmap()
1715 if (req_ctx->psrc) in common_nonsnoop_hash_unmap()
1716 talitos_sg_unmap(dev, edesc, req_ctx->psrc, NULL, 0, 0); in common_nonsnoop_hash_unmap()
1726 if (is_sec1 && req_ctx->nbuf) in common_nonsnoop_hash_unmap()
1746 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_done() local
1748 if (!req_ctx->last && req_ctx->to_hash_later) { in ahash_done()
1750 req_ctx->buf_idx = (req_ctx->buf_idx + 1) & 1; in ahash_done()
1751 req_ctx->nbuf = req_ctx->to_hash_later; in ahash_done()
1789 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in common_nonsnoop_hash() local
1801 if (!req_ctx->first || req_ctx->swinit) { in common_nonsnoop_hash()
1803 req_ctx->hw_context_size, in common_nonsnoop_hash()
1804 req_ctx->hw_context, in common_nonsnoop_hash()
1806 req_ctx->swinit = 0; in common_nonsnoop_hash()
1809 req_ctx->first = 0; in common_nonsnoop_hash()
1816 if (is_sec1 && req_ctx->nbuf) in common_nonsnoop_hash()
1817 length -= req_ctx->nbuf; in common_nonsnoop_hash()
1821 sg_copy_to_buffer(req_ctx->psrc, sg_count, edesc->buf, length); in common_nonsnoop_hash()
1823 sg_count = dma_map_sg(dev, req_ctx->psrc, sg_count, in common_nonsnoop_hash()
1828 if (is_sec1 && req_ctx->nbuf) { in common_nonsnoop_hash()
1829 map_single_talitos_ptr(dev, &desc->ptr[3], req_ctx->nbuf, in common_nonsnoop_hash()
1830 req_ctx->buf[req_ctx->buf_idx], in common_nonsnoop_hash()
1833 sg_count = talitos_sg_map(dev, req_ctx->psrc, length, edesc, in common_nonsnoop_hash()
1842 if (req_ctx->last) in common_nonsnoop_hash()
1845 req_ctx->hw_context, DMA_FROM_DEVICE); in common_nonsnoop_hash()
1848 req_ctx->hw_context_size, in common_nonsnoop_hash()
1849 req_ctx->hw_context, in common_nonsnoop_hash()
1857 if (is_sec1 && req_ctx->nbuf && length) { in common_nonsnoop_hash()
1875 req_ctx->hw_context_size, in common_nonsnoop_hash()
1876 req_ctx->hw_context, in common_nonsnoop_hash()
1879 sg_count = talitos_sg_map(dev, req_ctx->psrc, length, edesc, in common_nonsnoop_hash()
1884 if (req_ctx->last) in common_nonsnoop_hash()
1886 req_ctx->hw_context_size, in common_nonsnoop_hash()
1887 req_ctx->hw_context, in common_nonsnoop_hash()
1912 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_edesc_alloc() local
1917 nbytes -= req_ctx->nbuf; in ahash_edesc_alloc()
1919 return talitos_edesc_alloc(ctx->dev, req_ctx->psrc, NULL, NULL, 0, in ahash_edesc_alloc()
1928 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init() local
1933 req_ctx->buf_idx = 0; in ahash_init()
1934 req_ctx->nbuf = 0; in ahash_init()
1935 req_ctx->first = 1; /* first indicates h/w must init its context */ in ahash_init()
1936 req_ctx->swinit = 0; /* assume h/w init of context */ in ahash_init()
1940 req_ctx->hw_context_size = size; in ahash_init()
1942 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_init()
1944 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_TO_DEVICE); in ahash_init()
1955 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init_sha224_swinit() local
1957 req_ctx->hw_context[0] = SHA224_H0; in ahash_init_sha224_swinit()
1958 req_ctx->hw_context[1] = SHA224_H1; in ahash_init_sha224_swinit()
1959 req_ctx->hw_context[2] = SHA224_H2; in ahash_init_sha224_swinit()
1960 req_ctx->hw_context[3] = SHA224_H3; in ahash_init_sha224_swinit()
1961 req_ctx->hw_context[4] = SHA224_H4; in ahash_init_sha224_swinit()
1962 req_ctx->hw_context[5] = SHA224_H5; in ahash_init_sha224_swinit()
1963 req_ctx->hw_context[6] = SHA224_H6; in ahash_init_sha224_swinit()
1964 req_ctx->hw_context[7] = SHA224_H7; in ahash_init_sha224_swinit()
1967 req_ctx->hw_context[8] = 0; in ahash_init_sha224_swinit()
1968 req_ctx->hw_context[9] = 0; in ahash_init_sha224_swinit()
1971 req_ctx->swinit = 1;/* prevent h/w initting context with sha256 values*/ in ahash_init_sha224_swinit()
1980 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_process_req() local
1991 u8 *ctx_buf = req_ctx->buf[req_ctx->buf_idx]; in ahash_process_req()
1993 if (!req_ctx->last && (nbytes + req_ctx->nbuf <= blocksize)) { in ahash_process_req()
2001 ctx_buf + req_ctx->nbuf, nbytes); in ahash_process_req()
2002 req_ctx->nbuf += nbytes; in ahash_process_req()
2007 nbytes_to_hash = nbytes + req_ctx->nbuf; in ahash_process_req()
2010 if (req_ctx->last) in ahash_process_req()
2022 if (!is_sec1 && req_ctx->nbuf) { in ahash_process_req()
2023 nsg = (req_ctx->nbuf < nbytes_to_hash) ? 2 : 1; in ahash_process_req()
2024 sg_init_table(req_ctx->bufsl, nsg); in ahash_process_req()
2025 sg_set_buf(req_ctx->bufsl, ctx_buf, req_ctx->nbuf); in ahash_process_req()
2027 sg_chain(req_ctx->bufsl, 2, areq->src); in ahash_process_req()
2028 req_ctx->psrc = req_ctx->bufsl; in ahash_process_req()
2029 } else if (is_sec1 && req_ctx->nbuf && req_ctx->nbuf < blocksize) { in ahash_process_req()
2033 offset = blocksize - req_ctx->nbuf; in ahash_process_req()
2035 offset = nbytes_to_hash - req_ctx->nbuf; in ahash_process_req()
2042 ctx_buf + req_ctx->nbuf, offset); in ahash_process_req()
2043 req_ctx->nbuf += offset; in ahash_process_req()
2044 req_ctx->psrc = scatterwalk_ffwd(req_ctx->bufsl, areq->src, in ahash_process_req()
2047 req_ctx->psrc = areq->src; in ahash_process_req()
2056 req_ctx->buf[(req_ctx->buf_idx + 1) & 1], in ahash_process_req()
2060 req_ctx->to_hash_later = to_hash_later; in ahash_process_req()
2070 if (req_ctx->last) in ahash_process_req()
2076 if (req_ctx->first && !req_ctx->swinit) in ahash_process_req()
2082 if (ctx->keylen && (req_ctx->first || req_ctx->last)) in ahash_process_req()
2090 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_update() local
2092 req_ctx->last = 0; in ahash_update()
2099 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_final() local
2101 req_ctx->last = 1; in ahash_final()
2108 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_finup() local
2110 req_ctx->last = 1; in ahash_finup()
2117 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_digest() local
2121 req_ctx->last = 1; in ahash_digest()
2128 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_export() local
2135 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_export()
2137 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_FROM_DEVICE); in ahash_export()
2139 memcpy(export->hw_context, req_ctx->hw_context, in ahash_export()
2140 req_ctx->hw_context_size); in ahash_export()
2141 memcpy(export->buf, req_ctx->buf[req_ctx->buf_idx], req_ctx->nbuf); in ahash_export()
2142 export->swinit = req_ctx->swinit; in ahash_export()
2143 export->first = req_ctx->first; in ahash_export()
2144 export->last = req_ctx->last; in ahash_export()
2145 export->to_hash_later = req_ctx->to_hash_later; in ahash_export()
2146 export->nbuf = req_ctx->nbuf; in ahash_export()
2153 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_import() local
2161 memset(req_ctx, 0, sizeof(*req_ctx)); in ahash_import()
2165 req_ctx->hw_context_size = size; in ahash_import()
2166 memcpy(req_ctx->hw_context, export->hw_context, size); in ahash_import()
2167 memcpy(req_ctx->buf[0], export->buf, export->nbuf); in ahash_import()
2168 req_ctx->swinit = export->swinit; in ahash_import()
2169 req_ctx->first = export->first; in ahash_import()
2170 req_ctx->last = export->last; in ahash_import()
2171 req_ctx->to_hash_later = export->to_hash_later; in ahash_import()
2172 req_ctx->nbuf = export->nbuf; in ahash_import()
2174 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_import()
2176 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_TO_DEVICE); in ahash_import()