Lines Matching refs:req_ctx
1704 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in common_nonsnoop_hash_unmap() local
1716 if (req_ctx->last) in common_nonsnoop_hash_unmap()
1717 memcpy(areq->result, req_ctx->hw_context, in common_nonsnoop_hash_unmap()
1720 if (req_ctx->psrc) in common_nonsnoop_hash_unmap()
1721 talitos_sg_unmap(dev, edesc, req_ctx->psrc, NULL, 0, 0); in common_nonsnoop_hash_unmap()
1731 if (is_sec1 && req_ctx->nbuf) in common_nonsnoop_hash_unmap()
1751 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_done() local
1753 if (!req_ctx->last && req_ctx->to_hash_later) { in ahash_done()
1755 req_ctx->buf_idx = (req_ctx->buf_idx + 1) & 1; in ahash_done()
1756 req_ctx->nbuf = req_ctx->to_hash_later; in ahash_done()
1794 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in common_nonsnoop_hash() local
1806 if (!req_ctx->first || req_ctx->swinit) { in common_nonsnoop_hash()
1808 req_ctx->hw_context_size, in common_nonsnoop_hash()
1809 req_ctx->hw_context, in common_nonsnoop_hash()
1811 req_ctx->swinit = 0; in common_nonsnoop_hash()
1814 req_ctx->first = 0; in common_nonsnoop_hash()
1821 if (is_sec1 && req_ctx->nbuf) in common_nonsnoop_hash()
1822 length -= req_ctx->nbuf; in common_nonsnoop_hash()
1826 sg_copy_to_buffer(req_ctx->psrc, sg_count, edesc->buf, length); in common_nonsnoop_hash()
1828 sg_count = dma_map_sg(dev, req_ctx->psrc, sg_count, in common_nonsnoop_hash()
1833 if (is_sec1 && req_ctx->nbuf) { in common_nonsnoop_hash()
1834 map_single_talitos_ptr(dev, &desc->ptr[3], req_ctx->nbuf, in common_nonsnoop_hash()
1835 req_ctx->buf[req_ctx->buf_idx], in common_nonsnoop_hash()
1838 sg_count = talitos_sg_map(dev, req_ctx->psrc, length, edesc, in common_nonsnoop_hash()
1847 if (req_ctx->last) in common_nonsnoop_hash()
1850 req_ctx->hw_context, DMA_FROM_DEVICE); in common_nonsnoop_hash()
1853 req_ctx->hw_context_size, in common_nonsnoop_hash()
1854 req_ctx->hw_context, in common_nonsnoop_hash()
1862 if (is_sec1 && req_ctx->nbuf && length) { in common_nonsnoop_hash()
1880 req_ctx->hw_context_size, in common_nonsnoop_hash()
1881 req_ctx->hw_context, in common_nonsnoop_hash()
1884 sg_count = talitos_sg_map(dev, req_ctx->psrc, length, edesc, in common_nonsnoop_hash()
1889 if (req_ctx->last) in common_nonsnoop_hash()
1891 req_ctx->hw_context_size, in common_nonsnoop_hash()
1892 req_ctx->hw_context, in common_nonsnoop_hash()
1917 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_edesc_alloc() local
1922 nbytes -= req_ctx->nbuf; in ahash_edesc_alloc()
1924 return talitos_edesc_alloc(ctx->dev, req_ctx->psrc, NULL, NULL, 0, in ahash_edesc_alloc()
1933 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init() local
1938 req_ctx->buf_idx = 0; in ahash_init()
1939 req_ctx->nbuf = 0; in ahash_init()
1940 req_ctx->first = 1; /* first indicates h/w must init its context */ in ahash_init()
1941 req_ctx->swinit = 0; /* assume h/w init of context */ in ahash_init()
1945 req_ctx->hw_context_size = size; in ahash_init()
1947 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_init()
1949 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_TO_DEVICE); in ahash_init()
1960 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init_sha224_swinit() local
1962 req_ctx->hw_context[0] = SHA224_H0; in ahash_init_sha224_swinit()
1963 req_ctx->hw_context[1] = SHA224_H1; in ahash_init_sha224_swinit()
1964 req_ctx->hw_context[2] = SHA224_H2; in ahash_init_sha224_swinit()
1965 req_ctx->hw_context[3] = SHA224_H3; in ahash_init_sha224_swinit()
1966 req_ctx->hw_context[4] = SHA224_H4; in ahash_init_sha224_swinit()
1967 req_ctx->hw_context[5] = SHA224_H5; in ahash_init_sha224_swinit()
1968 req_ctx->hw_context[6] = SHA224_H6; in ahash_init_sha224_swinit()
1969 req_ctx->hw_context[7] = SHA224_H7; in ahash_init_sha224_swinit()
1972 req_ctx->hw_context[8] = 0; in ahash_init_sha224_swinit()
1973 req_ctx->hw_context[9] = 0; in ahash_init_sha224_swinit()
1976 req_ctx->swinit = 1;/* prevent h/w initting context with sha256 values*/ in ahash_init_sha224_swinit()
1985 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_process_req() local
1996 u8 *ctx_buf = req_ctx->buf[req_ctx->buf_idx]; in ahash_process_req()
1998 if (!req_ctx->last && (nbytes + req_ctx->nbuf <= blocksize)) { in ahash_process_req()
2006 ctx_buf + req_ctx->nbuf, nbytes); in ahash_process_req()
2007 req_ctx->nbuf += nbytes; in ahash_process_req()
2012 nbytes_to_hash = nbytes + req_ctx->nbuf; in ahash_process_req()
2015 if (req_ctx->last) in ahash_process_req()
2027 if (!is_sec1 && req_ctx->nbuf) { in ahash_process_req()
2028 nsg = (req_ctx->nbuf < nbytes_to_hash) ? 2 : 1; in ahash_process_req()
2029 sg_init_table(req_ctx->bufsl, nsg); in ahash_process_req()
2030 sg_set_buf(req_ctx->bufsl, ctx_buf, req_ctx->nbuf); in ahash_process_req()
2032 sg_chain(req_ctx->bufsl, 2, areq->src); in ahash_process_req()
2033 req_ctx->psrc = req_ctx->bufsl; in ahash_process_req()
2034 } else if (is_sec1 && req_ctx->nbuf && req_ctx->nbuf < blocksize) { in ahash_process_req()
2038 offset = blocksize - req_ctx->nbuf; in ahash_process_req()
2040 offset = nbytes_to_hash - req_ctx->nbuf; in ahash_process_req()
2047 ctx_buf + req_ctx->nbuf, offset); in ahash_process_req()
2048 req_ctx->nbuf += offset; in ahash_process_req()
2049 req_ctx->psrc = scatterwalk_ffwd(req_ctx->bufsl, areq->src, in ahash_process_req()
2052 req_ctx->psrc = areq->src; in ahash_process_req()
2061 req_ctx->buf[(req_ctx->buf_idx + 1) & 1], in ahash_process_req()
2065 req_ctx->to_hash_later = to_hash_later; in ahash_process_req()
2075 if (req_ctx->last) in ahash_process_req()
2081 if (req_ctx->first && !req_ctx->swinit) in ahash_process_req()
2087 if (ctx->keylen && (req_ctx->first || req_ctx->last)) in ahash_process_req()
2095 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_update() local
2097 req_ctx->last = 0; in ahash_update()
2104 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_final() local
2106 req_ctx->last = 1; in ahash_final()
2113 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_finup() local
2115 req_ctx->last = 1; in ahash_finup()
2122 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_digest() local
2126 req_ctx->last = 1; in ahash_digest()
2133 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_export() local
2140 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_export()
2142 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_FROM_DEVICE); in ahash_export()
2144 memcpy(export->hw_context, req_ctx->hw_context, in ahash_export()
2145 req_ctx->hw_context_size); in ahash_export()
2146 memcpy(export->buf, req_ctx->buf[req_ctx->buf_idx], req_ctx->nbuf); in ahash_export()
2147 export->swinit = req_ctx->swinit; in ahash_export()
2148 export->first = req_ctx->first; in ahash_export()
2149 export->last = req_ctx->last; in ahash_export()
2150 export->to_hash_later = req_ctx->to_hash_later; in ahash_export()
2151 export->nbuf = req_ctx->nbuf; in ahash_export()
2158 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_import() local
2166 memset(req_ctx, 0, sizeof(*req_ctx)); in ahash_import()
2170 req_ctx->hw_context_size = size; in ahash_import()
2171 memcpy(req_ctx->hw_context, export->hw_context, size); in ahash_import()
2172 memcpy(req_ctx->buf[0], export->buf, export->nbuf); in ahash_import()
2173 req_ctx->swinit = export->swinit; in ahash_import()
2174 req_ctx->first = export->first; in ahash_import()
2175 req_ctx->last = export->last; in ahash_import()
2176 req_ctx->to_hash_later = export->to_hash_later; in ahash_import()
2177 req_ctx->nbuf = export->nbuf; in ahash_import()
2179 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_import()
2181 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_TO_DEVICE); in ahash_import()