Lines Matching refs:ch_priv

132 	struct bcm6348_chan_priv **ch_priv;  member
192 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_disable() local
203 ch_priv->running = false; in bcm6348_iudma_disable()
204 ch_priv->desc_id = 0; in bcm6348_iudma_disable()
206 ch_priv->desc_cnt = 0; in bcm6348_iudma_disable()
208 ch_priv->desc_cnt = ch_priv->dma_ring_size; in bcm6348_iudma_disable()
216 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_enable() local
217 struct bcm6348_dma_desc *dma_desc = ch_priv->dma_ring; in bcm6348_iudma_enable()
221 for (i = 0; i < ch_priv->desc_cnt; i++) { in bcm6348_iudma_enable()
223 ch_priv->busy_desc[i] = false; in bcm6348_iudma_enable()
231 if (i == ch_priv->desc_cnt - 1) in bcm6348_iudma_enable()
238 ch_priv->desc_id = 0; in bcm6348_iudma_enable()
241 bcm6348_iudma_fdc(ch_priv->dma_ring, in bcm6348_iudma_enable()
242 sizeof(*dma_desc) * ch_priv->desc_cnt); in bcm6348_iudma_enable()
250 writel_be(virt_to_phys(ch_priv->dma_ring), in bcm6348_iudma_enable()
260 val = ch_priv->desc_cnt / 3; in bcm6348_iudma_enable()
263 val = (ch_priv->desc_cnt * 2) / 3; in bcm6348_iudma_enable()
270 writel_be(ch_priv->desc_cnt, in bcm6348_iudma_enable()
279 ch_priv->running = true; in bcm6348_iudma_enable()
287 struct bcm6348_chan_priv *ch_priv; in bcm6348_iudma_request() local
294 priv->ch_priv[dma->id] = calloc(1, sizeof(struct bcm6348_chan_priv)); in bcm6348_iudma_request()
295 if (!priv->ch_priv[dma->id]) in bcm6348_iudma_request()
297 ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_request()
301 ch_priv->dma_ring_size = DMA_RX_DESC; in bcm6348_iudma_request()
303 ch_priv->dma_ring_size = DMA_TX_DESC; in bcm6348_iudma_request()
305 ch_priv->dma_ring = in bcm6348_iudma_request()
307 ch_priv->dma_ring_size); in bcm6348_iudma_request()
308 if (!ch_priv->dma_ring) in bcm6348_iudma_request()
312 ch_priv->running = false; in bcm6348_iudma_request()
313 ch_priv->desc_id = 0; in bcm6348_iudma_request()
315 ch_priv->desc_cnt = 0; in bcm6348_iudma_request()
316 ch_priv->busy_desc = NULL; in bcm6348_iudma_request()
318 ch_priv->desc_cnt = ch_priv->dma_ring_size; in bcm6348_iudma_request()
319 ch_priv->busy_desc = calloc(ch_priv->desc_cnt, sizeof(bool)); in bcm6348_iudma_request()
329 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_receive() local
330 struct bcm6348_dma_desc *dma_desc = dma_desc = ch_priv->dma_ring; in bcm6348_iudma_receive()
333 if (!ch_priv->running) in bcm6348_iudma_receive()
337 dma_desc += ch_priv->desc_id; in bcm6348_iudma_receive()
351 dma->id, ch_priv->desc_id, dma_desc->status); in bcm6348_iudma_receive()
365 ch_priv->busy_desc[ch_priv->desc_id] = true; in bcm6348_iudma_receive()
368 ch_priv->desc_id = (ch_priv->desc_id + 1) % ch_priv->desc_cnt; in bcm6348_iudma_receive()
377 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_send() local
381 if (!ch_priv->running) in bcm6348_iudma_send()
388 dma_desc = ch_priv->dma_ring; in bcm6348_iudma_send()
389 dma_desc += ch_priv->desc_id; in bcm6348_iudma_send()
396 if (ch_priv->desc_id == ch_priv->desc_cnt - 1) in bcm6348_iudma_send()
420 ch_priv->desc_id = (ch_priv->desc_id + 1) % ch_priv->desc_cnt; in bcm6348_iudma_send()
428 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_free_rcv_buf() local
429 struct bcm6348_dma_desc *dma_desc = ch_priv->dma_ring; in bcm6348_iudma_free_rcv_buf()
435 for (i = 0; i < ch_priv->desc_cnt; i++) { in bcm6348_iudma_free_rcv_buf()
443 if (i == ch_priv->desc_cnt) { in bcm6348_iudma_free_rcv_buf()
449 bcm6348_iudma_idc(ch_priv->dma_ring, in bcm6348_iudma_free_rcv_buf()
450 sizeof(*dma_desc) * ch_priv->desc_cnt); in bcm6348_iudma_free_rcv_buf()
453 ch_priv->busy_desc[i] = false; in bcm6348_iudma_free_rcv_buf()
456 if (i == ch_priv->desc_cnt - 1) in bcm6348_iudma_free_rcv_buf()
466 bcm6348_iudma_fdc(ch_priv->dma_ring, in bcm6348_iudma_free_rcv_buf()
467 sizeof(*dma_desc) * ch_priv->desc_cnt); in bcm6348_iudma_free_rcv_buf()
481 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_add_rcv_buf() local
482 struct bcm6348_dma_desc *dma_desc = ch_priv->dma_ring; in bcm6348_iudma_add_rcv_buf()
485 if (ch_priv->desc_cnt == ch_priv->dma_ring_size) { in bcm6348_iudma_add_rcv_buf()
491 dma_desc += ch_priv->desc_cnt; in bcm6348_iudma_add_rcv_buf()
502 ch_priv->desc_cnt++; in bcm6348_iudma_add_rcv_buf()
511 struct bcm6348_chan_priv *ch_priv = priv->ch_priv[dma->id]; in bcm6348_iudma_prepare_rcv_buf() local
514 if (ch_priv->running) in bcm6348_iudma_prepare_rcv_buf()
632 priv->ch_priv = calloc(priv->n_channels, in bcm6348_iudma_probe()
634 if (!priv->ch_priv) in bcm6348_iudma_probe()