Lines Matching refs:mc

20 static int get_engine_number(struct meson_dev *mc)  in get_engine_number()  argument
22 return atomic_inc_return(&mc->flow) % MAXFLOW; in get_engine_number()
89 struct meson_dev *mc = op->mc; in meson_cipher() local
106 dev_dbg(mc->dev, "%s %s %u %x IV(%u) key=%u flow=%d\n", __func__, in meson_cipher()
114 mc->chanlist[flow].stat_req++; in meson_cipher()
132 dev_err(mc->dev, "invalid ivsize=%d vs len=%d\n", ivsize, areq->cryptlen); in meson_cipher()
152 phykeyiv = dma_map_single(mc->dev, bkeyiv, keyivlen, in meson_cipher()
154 err = dma_mapping_error(mc->dev, phykeyiv); in meson_cipher()
156 dev_err(mc->dev, "Cannot DMA MAP KEY IV\n"); in meson_cipher()
164 desc = &mc->chanlist[flow].tl[tloffset]; in meson_cipher()
178 nr_sgs = dma_map_sg(mc->dev, areq->src, sg_nents(areq->src), in meson_cipher()
181 dev_err(mc->dev, "Invalid SG count %d\n", nr_sgs); in meson_cipher()
187 nr_sgs = dma_map_sg(mc->dev, areq->src, sg_nents(areq->src), in meson_cipher()
190 dev_err(mc->dev, "Invalid SG count %d\n", nr_sgs); in meson_cipher()
194 nr_sgd = dma_map_sg(mc->dev, areq->dst, sg_nents(areq->dst), in meson_cipher()
197 dev_err(mc->dev, "Invalid SG count %d\n", nr_sgd); in meson_cipher()
207 desc = &mc->chanlist[flow].tl[tloffset]; in meson_cipher()
226 reinit_completion(&mc->chanlist[flow].complete); in meson_cipher()
227 mc->chanlist[flow].status = 0; in meson_cipher()
228 writel(mc->chanlist[flow].t_phy | 2, mc->base + (flow << 2)); in meson_cipher()
229 wait_for_completion_interruptible_timeout(&mc->chanlist[flow].complete, in meson_cipher()
231 if (mc->chanlist[flow].status == 0) { in meson_cipher()
232 dev_err(mc->dev, "DMA timeout for flow %d\n", flow); in meson_cipher()
236 dma_unmap_single(mc->dev, phykeyiv, keyivlen, DMA_TO_DEVICE); in meson_cipher()
239 dma_unmap_sg(mc->dev, areq->src, sg_nents(areq->src), DMA_BIDIRECTIONAL); in meson_cipher()
241 dma_unmap_sg(mc->dev, areq->src, sg_nents(areq->src), DMA_TO_DEVICE); in meson_cipher()
242 dma_unmap_sg(mc->dev, areq->dst, sg_nents(areq->dst), DMA_FROM_DEVICE); in meson_cipher()
286 e = get_engine_number(op->mc); in meson_skdecrypt()
287 engine = op->mc->chanlist[e].engine; in meson_skdecrypt()
304 e = get_engine_number(op->mc); in meson_skencrypt()
305 engine = op->mc->chanlist[e].engine; in meson_skencrypt()
322 op->mc = algt->mc; in meson_cipher_init()
326 dev_err(op->mc->dev, "ERROR: Cannot allocate fallback for %s %ld\n", in meson_cipher_init()
353 struct meson_dev *mc = op->mc; in meson_aes_setkey() local
366 dev_dbg(mc->dev, "ERROR: Invalid keylen %u\n", keylen); in meson_aes_setkey()