Lines Matching refs:req_ctx

1713 	struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq);  in common_nonsnoop_hash_unmap()  local
1724 talitos_sg_unmap(dev, edesc, req_ctx->psrc, NULL, 0, 0); in common_nonsnoop_hash_unmap()
1734 if (is_sec1 && req_ctx->nbuf) in common_nonsnoop_hash_unmap()
1754 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_done() local
1756 if (!req_ctx->last && req_ctx->to_hash_later) { in ahash_done()
1758 req_ctx->buf_idx = (req_ctx->buf_idx + 1) & 1; in ahash_done()
1759 req_ctx->nbuf = req_ctx->to_hash_later; in ahash_done()
1798 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in common_nonsnoop_hash() local
1810 if (!req_ctx->first || req_ctx->swinit) { in common_nonsnoop_hash()
1812 req_ctx->hw_context_size, in common_nonsnoop_hash()
1813 req_ctx->hw_context, in common_nonsnoop_hash()
1815 req_ctx->swinit = 0; in common_nonsnoop_hash()
1818 req_ctx->first = 0; in common_nonsnoop_hash()
1825 if (is_sec1 && req_ctx->nbuf) in common_nonsnoop_hash()
1826 length -= req_ctx->nbuf; in common_nonsnoop_hash()
1830 sg_pcopy_to_buffer(req_ctx->psrc, sg_count, in common_nonsnoop_hash()
1832 length, req_ctx->nbuf); in common_nonsnoop_hash()
1834 sg_count = dma_map_sg(dev, req_ctx->psrc, sg_count, in common_nonsnoop_hash()
1839 if (is_sec1 && req_ctx->nbuf) { in common_nonsnoop_hash()
1840 map_single_talitos_ptr(dev, &desc->ptr[3], req_ctx->nbuf, in common_nonsnoop_hash()
1841 req_ctx->buf[req_ctx->buf_idx], in common_nonsnoop_hash()
1844 sg_count = talitos_sg_map(dev, req_ctx->psrc, length, edesc, in common_nonsnoop_hash()
1853 if (req_ctx->last) in common_nonsnoop_hash()
1859 req_ctx->hw_context_size, in common_nonsnoop_hash()
1860 req_ctx->hw_context, in common_nonsnoop_hash()
1868 if (is_sec1 && req_ctx->nbuf && length) { in common_nonsnoop_hash()
1885 req_ctx->hw_context_size, in common_nonsnoop_hash()
1886 req_ctx->hw_context, in common_nonsnoop_hash()
1889 sg_count = talitos_sg_map(dev, req_ctx->psrc, length, edesc, in common_nonsnoop_hash()
1894 if (req_ctx->last) in common_nonsnoop_hash()
1896 req_ctx->hw_context_size, in common_nonsnoop_hash()
1897 req_ctx->hw_context, in common_nonsnoop_hash()
1922 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_edesc_alloc() local
1927 nbytes -= req_ctx->nbuf; in ahash_edesc_alloc()
1929 return talitos_edesc_alloc(ctx->dev, req_ctx->psrc, NULL, NULL, 0, in ahash_edesc_alloc()
1938 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init() local
1943 req_ctx->buf_idx = 0; in ahash_init()
1944 req_ctx->nbuf = 0; in ahash_init()
1945 req_ctx->first = 1; /* first indicates h/w must init its context */ in ahash_init()
1946 req_ctx->swinit = 0; /* assume h/w init of context */ in ahash_init()
1950 req_ctx->hw_context_size = size; in ahash_init()
1952 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_init()
1954 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_TO_DEVICE); in ahash_init()
1965 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init_sha224_swinit() local
1967 req_ctx->hw_context[0] = SHA224_H0; in ahash_init_sha224_swinit()
1968 req_ctx->hw_context[1] = SHA224_H1; in ahash_init_sha224_swinit()
1969 req_ctx->hw_context[2] = SHA224_H2; in ahash_init_sha224_swinit()
1970 req_ctx->hw_context[3] = SHA224_H3; in ahash_init_sha224_swinit()
1971 req_ctx->hw_context[4] = SHA224_H4; in ahash_init_sha224_swinit()
1972 req_ctx->hw_context[5] = SHA224_H5; in ahash_init_sha224_swinit()
1973 req_ctx->hw_context[6] = SHA224_H6; in ahash_init_sha224_swinit()
1974 req_ctx->hw_context[7] = SHA224_H7; in ahash_init_sha224_swinit()
1977 req_ctx->hw_context[8] = 0; in ahash_init_sha224_swinit()
1978 req_ctx->hw_context[9] = 0; in ahash_init_sha224_swinit()
1981 req_ctx->swinit = 1;/* prevent h/w initting context with sha256 values*/ in ahash_init_sha224_swinit()
1990 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_process_req() local
2002 u8 *ctx_buf = req_ctx->buf[req_ctx->buf_idx]; in ahash_process_req()
2004 if (!req_ctx->last && (nbytes + req_ctx->nbuf <= blocksize)) { in ahash_process_req()
2012 ctx_buf + req_ctx->nbuf, nbytes); in ahash_process_req()
2013 req_ctx->nbuf += nbytes; in ahash_process_req()
2018 nbytes_to_hash = nbytes + req_ctx->nbuf; in ahash_process_req()
2021 if (req_ctx->last) in ahash_process_req()
2033 if (!is_sec1 && req_ctx->nbuf) { in ahash_process_req()
2034 nsg = (req_ctx->nbuf < nbytes_to_hash) ? 2 : 1; in ahash_process_req()
2035 sg_init_table(req_ctx->bufsl, nsg); in ahash_process_req()
2036 sg_set_buf(req_ctx->bufsl, ctx_buf, req_ctx->nbuf); in ahash_process_req()
2038 sg_chain(req_ctx->bufsl, 2, areq->src); in ahash_process_req()
2039 req_ctx->psrc = req_ctx->bufsl; in ahash_process_req()
2040 } else if (is_sec1 && req_ctx->nbuf && req_ctx->nbuf < blocksize) { in ahash_process_req()
2042 offset = blocksize - req_ctx->nbuf; in ahash_process_req()
2044 offset = nbytes_to_hash - req_ctx->nbuf; in ahash_process_req()
2051 ctx_buf + req_ctx->nbuf, offset); in ahash_process_req()
2052 req_ctx->nbuf += offset; in ahash_process_req()
2053 req_ctx->psrc = areq->src; in ahash_process_req()
2055 req_ctx->psrc = areq->src; in ahash_process_req()
2064 req_ctx->buf[(req_ctx->buf_idx + 1) & 1], in ahash_process_req()
2068 req_ctx->to_hash_later = to_hash_later; in ahash_process_req()
2078 if (req_ctx->last) in ahash_process_req()
2084 if (req_ctx->first && !req_ctx->swinit) in ahash_process_req()
2090 if (ctx->keylen && (req_ctx->first || req_ctx->last)) in ahash_process_req()
2099 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_update() local
2101 req_ctx->last = 0; in ahash_update()
2108 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_final() local
2110 req_ctx->last = 1; in ahash_final()
2117 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_finup() local
2119 req_ctx->last = 1; in ahash_finup()
2126 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_digest() local
2130 req_ctx->last = 1; in ahash_digest()
2137 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_export() local
2144 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_export()
2146 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_FROM_DEVICE); in ahash_export()
2148 memcpy(export->hw_context, req_ctx->hw_context, in ahash_export()
2149 req_ctx->hw_context_size); in ahash_export()
2150 memcpy(export->buf, req_ctx->buf[req_ctx->buf_idx], req_ctx->nbuf); in ahash_export()
2151 export->swinit = req_ctx->swinit; in ahash_export()
2152 export->first = req_ctx->first; in ahash_export()
2153 export->last = req_ctx->last; in ahash_export()
2154 export->to_hash_later = req_ctx->to_hash_later; in ahash_export()
2155 export->nbuf = req_ctx->nbuf; in ahash_export()
2162 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_import() local
2170 memset(req_ctx, 0, sizeof(*req_ctx)); in ahash_import()
2174 req_ctx->hw_context_size = size; in ahash_import()
2175 memcpy(req_ctx->hw_context, export->hw_context, size); in ahash_import()
2176 memcpy(req_ctx->buf[0], export->buf, export->nbuf); in ahash_import()
2177 req_ctx->swinit = export->swinit; in ahash_import()
2178 req_ctx->first = export->first; in ahash_import()
2179 req_ctx->last = export->last; in ahash_import()
2180 req_ctx->to_hash_later = export->to_hash_later; in ahash_import()
2181 req_ctx->nbuf = export->nbuf; in ahash_import()
2183 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_import()
2185 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_TO_DEVICE); in ahash_import()