Lines Matching refs:req_ctx
1706 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in common_nonsnoop_hash_unmap() local
1718 if (req_ctx->psrc) in common_nonsnoop_hash_unmap()
1719 talitos_sg_unmap(dev, edesc, req_ctx->psrc, NULL, 0, 0); in common_nonsnoop_hash_unmap()
1729 if (is_sec1 && req_ctx->nbuf) in common_nonsnoop_hash_unmap()
1749 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_done() local
1751 if (!req_ctx->last && req_ctx->to_hash_later) { in ahash_done()
1753 req_ctx->buf_idx = (req_ctx->buf_idx + 1) & 1; in ahash_done()
1754 req_ctx->nbuf = req_ctx->to_hash_later; in ahash_done()
1792 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in common_nonsnoop_hash() local
1804 if (!req_ctx->first || req_ctx->swinit) { in common_nonsnoop_hash()
1806 req_ctx->hw_context_size, in common_nonsnoop_hash()
1807 req_ctx->hw_context, in common_nonsnoop_hash()
1809 req_ctx->swinit = 0; in common_nonsnoop_hash()
1812 req_ctx->first = 0; in common_nonsnoop_hash()
1819 if (is_sec1 && req_ctx->nbuf) in common_nonsnoop_hash()
1820 length -= req_ctx->nbuf; in common_nonsnoop_hash()
1824 sg_copy_to_buffer(req_ctx->psrc, sg_count, edesc->buf, length); in common_nonsnoop_hash()
1826 sg_count = dma_map_sg(dev, req_ctx->psrc, sg_count, in common_nonsnoop_hash()
1831 if (is_sec1 && req_ctx->nbuf) { in common_nonsnoop_hash()
1832 map_single_talitos_ptr(dev, &desc->ptr[3], req_ctx->nbuf, in common_nonsnoop_hash()
1833 req_ctx->buf[req_ctx->buf_idx], in common_nonsnoop_hash()
1836 sg_count = talitos_sg_map(dev, req_ctx->psrc, length, edesc, in common_nonsnoop_hash()
1845 if (req_ctx->last) in common_nonsnoop_hash()
1851 req_ctx->hw_context_size, in common_nonsnoop_hash()
1852 req_ctx->hw_context, in common_nonsnoop_hash()
1860 if (is_sec1 && req_ctx->nbuf && length) { in common_nonsnoop_hash()
1878 req_ctx->hw_context_size, in common_nonsnoop_hash()
1879 req_ctx->hw_context, in common_nonsnoop_hash()
1882 sg_count = talitos_sg_map(dev, req_ctx->psrc, length, edesc, in common_nonsnoop_hash()
1887 if (req_ctx->last) in common_nonsnoop_hash()
1889 req_ctx->hw_context_size, in common_nonsnoop_hash()
1890 req_ctx->hw_context, in common_nonsnoop_hash()
1915 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_edesc_alloc() local
1920 nbytes -= req_ctx->nbuf; in ahash_edesc_alloc()
1922 return talitos_edesc_alloc(ctx->dev, req_ctx->psrc, NULL, NULL, 0, in ahash_edesc_alloc()
1931 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init() local
1936 req_ctx->buf_idx = 0; in ahash_init()
1937 req_ctx->nbuf = 0; in ahash_init()
1938 req_ctx->first = 1; /* first indicates h/w must init its context */ in ahash_init()
1939 req_ctx->swinit = 0; /* assume h/w init of context */ in ahash_init()
1943 req_ctx->hw_context_size = size; in ahash_init()
1945 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_init()
1947 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_TO_DEVICE); in ahash_init()
1958 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_init_sha224_swinit() local
1960 req_ctx->hw_context[0] = SHA224_H0; in ahash_init_sha224_swinit()
1961 req_ctx->hw_context[1] = SHA224_H1; in ahash_init_sha224_swinit()
1962 req_ctx->hw_context[2] = SHA224_H2; in ahash_init_sha224_swinit()
1963 req_ctx->hw_context[3] = SHA224_H3; in ahash_init_sha224_swinit()
1964 req_ctx->hw_context[4] = SHA224_H4; in ahash_init_sha224_swinit()
1965 req_ctx->hw_context[5] = SHA224_H5; in ahash_init_sha224_swinit()
1966 req_ctx->hw_context[6] = SHA224_H6; in ahash_init_sha224_swinit()
1967 req_ctx->hw_context[7] = SHA224_H7; in ahash_init_sha224_swinit()
1970 req_ctx->hw_context[8] = 0; in ahash_init_sha224_swinit()
1971 req_ctx->hw_context[9] = 0; in ahash_init_sha224_swinit()
1974 req_ctx->swinit = 1;/* prevent h/w initting context with sha256 values*/ in ahash_init_sha224_swinit()
1983 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_process_req() local
1994 u8 *ctx_buf = req_ctx->buf[req_ctx->buf_idx]; in ahash_process_req()
1996 if (!req_ctx->last && (nbytes + req_ctx->nbuf <= blocksize)) { in ahash_process_req()
2004 ctx_buf + req_ctx->nbuf, nbytes); in ahash_process_req()
2005 req_ctx->nbuf += nbytes; in ahash_process_req()
2010 nbytes_to_hash = nbytes + req_ctx->nbuf; in ahash_process_req()
2013 if (req_ctx->last) in ahash_process_req()
2025 if (!is_sec1 && req_ctx->nbuf) { in ahash_process_req()
2026 nsg = (req_ctx->nbuf < nbytes_to_hash) ? 2 : 1; in ahash_process_req()
2027 sg_init_table(req_ctx->bufsl, nsg); in ahash_process_req()
2028 sg_set_buf(req_ctx->bufsl, ctx_buf, req_ctx->nbuf); in ahash_process_req()
2030 sg_chain(req_ctx->bufsl, 2, areq->src); in ahash_process_req()
2031 req_ctx->psrc = req_ctx->bufsl; in ahash_process_req()
2032 } else if (is_sec1 && req_ctx->nbuf && req_ctx->nbuf < blocksize) { in ahash_process_req()
2036 offset = blocksize - req_ctx->nbuf; in ahash_process_req()
2038 offset = nbytes_to_hash - req_ctx->nbuf; in ahash_process_req()
2045 ctx_buf + req_ctx->nbuf, offset); in ahash_process_req()
2046 req_ctx->nbuf += offset; in ahash_process_req()
2047 req_ctx->psrc = scatterwalk_ffwd(req_ctx->bufsl, areq->src, in ahash_process_req()
2050 req_ctx->psrc = areq->src; in ahash_process_req()
2059 req_ctx->buf[(req_ctx->buf_idx + 1) & 1], in ahash_process_req()
2063 req_ctx->to_hash_later = to_hash_later; in ahash_process_req()
2073 if (req_ctx->last) in ahash_process_req()
2079 if (req_ctx->first && !req_ctx->swinit) in ahash_process_req()
2085 if (ctx->keylen && (req_ctx->first || req_ctx->last)) in ahash_process_req()
2093 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_update() local
2095 req_ctx->last = 0; in ahash_update()
2102 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_final() local
2104 req_ctx->last = 1; in ahash_final()
2111 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_finup() local
2113 req_ctx->last = 1; in ahash_finup()
2120 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_digest() local
2124 req_ctx->last = 1; in ahash_digest()
2131 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_export() local
2138 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_export()
2140 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_FROM_DEVICE); in ahash_export()
2142 memcpy(export->hw_context, req_ctx->hw_context, in ahash_export()
2143 req_ctx->hw_context_size); in ahash_export()
2144 memcpy(export->buf, req_ctx->buf[req_ctx->buf_idx], req_ctx->nbuf); in ahash_export()
2145 export->swinit = req_ctx->swinit; in ahash_export()
2146 export->first = req_ctx->first; in ahash_export()
2147 export->last = req_ctx->last; in ahash_export()
2148 export->to_hash_later = req_ctx->to_hash_later; in ahash_export()
2149 export->nbuf = req_ctx->nbuf; in ahash_export()
2156 struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); in ahash_import() local
2164 memset(req_ctx, 0, sizeof(*req_ctx)); in ahash_import()
2168 req_ctx->hw_context_size = size; in ahash_import()
2169 memcpy(req_ctx->hw_context, export->hw_context, size); in ahash_import()
2170 memcpy(req_ctx->buf[0], export->buf, export->nbuf); in ahash_import()
2171 req_ctx->swinit = export->swinit; in ahash_import()
2172 req_ctx->first = export->first; in ahash_import()
2173 req_ctx->last = export->last; in ahash_import()
2174 req_ctx->to_hash_later = export->to_hash_later; in ahash_import()
2175 req_ctx->nbuf = export->nbuf; in ahash_import()
2177 dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, in ahash_import()
2179 dma_unmap_single(dev, dma, req_ctx->hw_context_size, DMA_TO_DEVICE); in ahash_import()