Lines Matching refs:req_ctx
1703 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in common_nonsnoop_hash_unmap() local
1715 if (req_ctx->last) in common_nonsnoop_hash_unmap()
1716 memcpy(areq->result, req_ctx->hw_context, in common_nonsnoop_hash_unmap()
1719 if (req_ctx->psrc) in common_nonsnoop_hash_unmap()
1720 talitos_sg_unmap(dev, edesc, req_ctx->psrc, NULL, 0, 0); in common_nonsnoop_hash_unmap()
1730 if (is_sec1 && req_ctx->nbuf) in common_nonsnoop_hash_unmap()
1750 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_done() local
1752 if (!req_ctx->last && req_ctx->to_hash_later) { in ahash_done()
1754 req_ctx->buf_idx = (req_ctx->buf_idx + 1) & 1; in ahash_done()
1755 req_ctx->nbuf = req_ctx->to_hash_later; in ahash_done()
1793 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in common_nonsnoop_hash() local
1805 if (!req_ctx->first || req_ctx->swinit) { in common_nonsnoop_hash()
1807 req_ctx->hw_context_size, in common_nonsnoop_hash()
1808 req_ctx->hw_context, in common_nonsnoop_hash()
1810 req_ctx->swinit = 0; in common_nonsnoop_hash()
1813 req_ctx->first = 0; in common_nonsnoop_hash()
1820 if (is_sec1 && req_ctx->nbuf) in common_nonsnoop_hash()
1821 length -= req_ctx->nbuf; in common_nonsnoop_hash()
1825 sg_copy_to_buffer(req_ctx->psrc, sg_count, edesc->buf, length); in common_nonsnoop_hash()
1827 sg_count = dma_map_sg(dev, req_ctx->psrc, sg_count, in common_nonsnoop_hash()
1832 if (is_sec1 && req_ctx->nbuf) { in common_nonsnoop_hash()
1833 map_single_talitos_ptr(dev, &desc->ptr[3], req_ctx->nbuf, in common_nonsnoop_hash()
1834 req_ctx->buf[req_ctx->buf_idx], in common_nonsnoop_hash()
1837 sg_count = talitos_sg_map(dev, req_ctx->psrc, length, edesc, in common_nonsnoop_hash()
1846 if (req_ctx->last) in common_nonsnoop_hash()
1849 req_ctx->hw_context, DMA_FROM_DEVICE); in common_nonsnoop_hash()
1852 req_ctx->hw_context_size, in common_nonsnoop_hash()
1853 req_ctx->hw_context, in common_nonsnoop_hash()
1861 if (is_sec1 && req_ctx->nbuf && length) { in common_nonsnoop_hash()
1879 req_ctx->hw_context_size, in common_nonsnoop_hash()
1880 req_ctx->hw_context, in common_nonsnoop_hash()
1883 sg_count = talitos_sg_map(dev, req_ctx->psrc, length, edesc, in common_nonsnoop_hash()
1888 if (req_ctx->last) in common_nonsnoop_hash()
1890 req_ctx->hw_context_size, in common_nonsnoop_hash()
1891 req_ctx->hw_context, in common_nonsnoop_hash()
1916 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_edesc_alloc() local
1921 nbytes -= req_ctx->nbuf; in ahash_edesc_alloc()
1923 return talitos_edesc_alloc(ctx->dev, req_ctx->psrc, NULL, NULL, 0, in ahash_edesc_alloc()
1932 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init() local
1937 req_ctx->buf_idx = 0; in ahash_init()
1938 req_ctx->nbuf = 0; in ahash_init()
1939 req_ctx->first = 1; /* first indicates h/w must init its context */ in ahash_init()
1940 req_ctx->swinit = 0; /* assume h/w init of context */ in ahash_init()
1944 req_ctx->hw_context_size = size; in ahash_init()
1946 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_init()
1948 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_TO_DEVICE); in ahash_init()
1959 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init_sha224_swinit() local
1961 req_ctx->hw_context[0] = SHA224_H0; in ahash_init_sha224_swinit()
1962 req_ctx->hw_context[1] = SHA224_H1; in ahash_init_sha224_swinit()
1963 req_ctx->hw_context[2] = SHA224_H2; in ahash_init_sha224_swinit()
1964 req_ctx->hw_context[3] = SHA224_H3; in ahash_init_sha224_swinit()
1965 req_ctx->hw_context[4] = SHA224_H4; in ahash_init_sha224_swinit()
1966 req_ctx->hw_context[5] = SHA224_H5; in ahash_init_sha224_swinit()
1967 req_ctx->hw_context[6] = SHA224_H6; in ahash_init_sha224_swinit()
1968 req_ctx->hw_context[7] = SHA224_H7; in ahash_init_sha224_swinit()
1971 req_ctx->hw_context[8] = 0; in ahash_init_sha224_swinit()
1972 req_ctx->hw_context[9] = 0; in ahash_init_sha224_swinit()
1975 req_ctx->swinit = 1;/* prevent h/w initting context with sha256 values*/ in ahash_init_sha224_swinit()
1984 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_process_req() local
1995 u8 *ctx_buf = req_ctx->buf[req_ctx->buf_idx]; in ahash_process_req()
1997 if (!req_ctx->last && (nbytes + req_ctx->nbuf <= blocksize)) { in ahash_process_req()
2005 ctx_buf + req_ctx->nbuf, nbytes); in ahash_process_req()
2006 req_ctx->nbuf += nbytes; in ahash_process_req()
2011 nbytes_to_hash = nbytes + req_ctx->nbuf; in ahash_process_req()
2014 if (req_ctx->last) in ahash_process_req()
2026 if (!is_sec1 && req_ctx->nbuf) { in ahash_process_req()
2027 nsg = (req_ctx->nbuf < nbytes_to_hash) ? 2 : 1; in ahash_process_req()
2028 sg_init_table(req_ctx->bufsl, nsg); in ahash_process_req()
2029 sg_set_buf(req_ctx->bufsl, ctx_buf, req_ctx->nbuf); in ahash_process_req()
2031 sg_chain(req_ctx->bufsl, 2, areq->src); in ahash_process_req()
2032 req_ctx->psrc = req_ctx->bufsl; in ahash_process_req()
2033 } else if (is_sec1 && req_ctx->nbuf && req_ctx->nbuf < blocksize) { in ahash_process_req()
2037 offset = blocksize - req_ctx->nbuf; in ahash_process_req()
2039 offset = nbytes_to_hash - req_ctx->nbuf; in ahash_process_req()
2046 ctx_buf + req_ctx->nbuf, offset); in ahash_process_req()
2047 req_ctx->nbuf += offset; in ahash_process_req()
2048 req_ctx->psrc = scatterwalk_ffwd(req_ctx->bufsl, areq->src, in ahash_process_req()
2051 req_ctx->psrc = areq->src; in ahash_process_req()
2060 req_ctx->buf[(req_ctx->buf_idx + 1) & 1], in ahash_process_req()
2064 req_ctx->to_hash_later = to_hash_later; in ahash_process_req()
2074 if (req_ctx->last) in ahash_process_req()
2080 if (req_ctx->first && !req_ctx->swinit) in ahash_process_req()
2086 if (ctx->keylen && (req_ctx->first || req_ctx->last)) in ahash_process_req()
2094 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_update() local
2096 req_ctx->last = 0; in ahash_update()
2103 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_final() local
2105 req_ctx->last = 1; in ahash_final()
2112 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_finup() local
2114 req_ctx->last = 1; in ahash_finup()
2121 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_digest() local
2125 req_ctx->last = 1; in ahash_digest()
2132 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_export() local
2139 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_export()
2141 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_FROM_DEVICE); in ahash_export()
2143 memcpy(export->hw_context, req_ctx->hw_context, in ahash_export()
2144 req_ctx->hw_context_size); in ahash_export()
2145 memcpy(export->buf, req_ctx->buf[req_ctx->buf_idx], req_ctx->nbuf); in ahash_export()
2146 export->swinit = req_ctx->swinit; in ahash_export()
2147 export->first = req_ctx->first; in ahash_export()
2148 export->last = req_ctx->last; in ahash_export()
2149 export->to_hash_later = req_ctx->to_hash_later; in ahash_export()
2150 export->nbuf = req_ctx->nbuf; in ahash_export()
2157 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_import() local
2165 memset(req_ctx, 0, sizeof(*req_ctx)); in ahash_import()
2169 req_ctx->hw_context_size = size; in ahash_import()
2170 memcpy(req_ctx->hw_context, export->hw_context, size); in ahash_import()
2171 memcpy(req_ctx->buf[0], export->buf, export->nbuf); in ahash_import()
2172 req_ctx->swinit = export->swinit; in ahash_import()
2173 req_ctx->first = export->first; in ahash_import()
2174 req_ctx->last = export->last; in ahash_import()
2175 req_ctx->to_hash_later = export->to_hash_later; in ahash_import()
2176 req_ctx->nbuf = export->nbuf; in ahash_import()
2178 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_import()
2180 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_TO_DEVICE); in ahash_import()