Lines Matching refs:nr_sgs
135 int nr_sgs = 0; in sun8i_ce_cipher_prepare() local
215 nr_sgs = dma_map_sg(ce->dev, areq->src, ns, DMA_BIDIRECTIONAL); in sun8i_ce_cipher_prepare()
216 if (nr_sgs <= 0 || nr_sgs > MAX_SG) { in sun8i_ce_cipher_prepare()
217 dev_err(ce->dev, "Invalid sg number %d\n", nr_sgs); in sun8i_ce_cipher_prepare()
221 nr_sgd = nr_sgs; in sun8i_ce_cipher_prepare()
223 nr_sgs = dma_map_sg(ce->dev, areq->src, ns, DMA_TO_DEVICE); in sun8i_ce_cipher_prepare()
224 if (nr_sgs <= 0 || nr_sgs > MAX_SG) { in sun8i_ce_cipher_prepare()
225 dev_err(ce->dev, "Invalid sg number %d\n", nr_sgs); in sun8i_ce_cipher_prepare()
238 for_each_sg(areq->src, sg, nr_sgs, i) { in sun8i_ce_cipher_prepare()
268 rctx->nr_sgs = nr_sgs; in sun8i_ce_cipher_prepare()
276 if (nr_sgs > 0) in sun8i_ce_cipher_prepare()
313 int nr_sgs = rctx->nr_sgs; in sun8i_ce_cipher_unprepare() local
323 dma_unmap_sg(ce->dev, areq->src, nr_sgs, DMA_BIDIRECTIONAL); in sun8i_ce_cipher_unprepare()
325 if (nr_sgs > 0) in sun8i_ce_cipher_unprepare()
326 dma_unmap_sg(ce->dev, areq->src, nr_sgs, DMA_TO_DEVICE); in sun8i_ce_cipher_unprepare()