Lines Matching refs:dma

65 	struct ltq_dma_channel dma;  member
135 struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc]; in xrx200_flush_dma()
142 ch->dma.desc++; in xrx200_flush_dma()
143 ch->dma.desc %= LTQ_DESC_NUM; in xrx200_flush_dma()
152 ltq_dma_open(&priv->chan_tx.dma); in xrx200_open()
153 ltq_dma_enable_irq(&priv->chan_tx.dma); in xrx200_open()
156 ltq_dma_open(&priv->chan_rx.dma); in xrx200_open()
165 ltq_dma_enable_irq(&priv->chan_rx.dma); in xrx200_open()
179 ltq_dma_close(&priv->chan_rx.dma); in xrx200_close()
182 ltq_dma_close(&priv->chan_tx.dma); in xrx200_close()
189 void *buf = ch->rx_buff[ch->dma.desc]; in xrx200_alloc_buf()
194 ch->rx_buff[ch->dma.desc] = alloc(priv->rx_skb_size); in xrx200_alloc_buf()
195 if (!ch->rx_buff[ch->dma.desc]) { in xrx200_alloc_buf()
196 ch->rx_buff[ch->dma.desc] = buf; in xrx200_alloc_buf()
201 mapping = dma_map_single(priv->dev, ch->rx_buff[ch->dma.desc], in xrx200_alloc_buf()
204 skb_free_frag(ch->rx_buff[ch->dma.desc]); in xrx200_alloc_buf()
205 ch->rx_buff[ch->dma.desc] = buf; in xrx200_alloc_buf()
210 ch->dma.desc_base[ch->dma.desc].addr = mapping + NET_SKB_PAD + NET_IP_ALIGN; in xrx200_alloc_buf()
214 ch->dma.desc_base[ch->dma.desc].ctl = in xrx200_alloc_buf()
223 struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc]; in xrx200_hw_receive()
224 void *buf = ch->rx_buff[ch->dma.desc]; in xrx200_hw_receive()
233 ch->dma.desc++; in xrx200_hw_receive()
234 ch->dma.desc %= LTQ_DESC_NUM; in xrx200_hw_receive()
291 struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc]; in xrx200_poll_rx()
307 ltq_dma_enable_irq(&ch->dma); in xrx200_poll_rx()
323 struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->tx_free]; in xrx200_tx_housekeeping()
332 memset(&ch->dma.desc_base[ch->tx_free], 0, in xrx200_tx_housekeeping()
351 ltq_dma_enable_irq(&ch->dma); in xrx200_tx_housekeeping()
362 struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc]; in xrx200_start_xmit()
375 if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) || ch->skb[ch->dma.desc]) { in xrx200_start_xmit()
381 ch->skb[ch->dma.desc] = skb; in xrx200_start_xmit()
395 ch->dma.desc++; in xrx200_start_xmit()
396 ch->dma.desc %= LTQ_DESC_NUM; in xrx200_start_xmit()
397 if (ch->dma.desc == ch->tx_free) in xrx200_start_xmit()
432 ltq_dma_close(&ch_rx->dma); in xrx200_change_mtu()
436 curr_desc = ch_rx->dma.desc; in xrx200_change_mtu()
438 for (ch_rx->dma.desc = 0; ch_rx->dma.desc < LTQ_DESC_NUM; in xrx200_change_mtu()
439 ch_rx->dma.desc++) { in xrx200_change_mtu()
440 buff = ch_rx->rx_buff[ch_rx->dma.desc]; in xrx200_change_mtu()
451 ch_rx->dma.desc = curr_desc; in xrx200_change_mtu()
454 ltq_dma_open(&ch_rx->dma); in xrx200_change_mtu()
455 ltq_dma_enable_irq(&ch_rx->dma); in xrx200_change_mtu()
475 ltq_dma_disable_irq(&ch->dma); in xrx200_dma_irq()
479 ltq_dma_ack_irq(&ch->dma); in xrx200_dma_irq()
494 ch_rx->dma.nr = XRX200_DMA_RX; in xrx200_dma_init()
495 ch_rx->dma.dev = priv->dev; in xrx200_dma_init()
498 ltq_dma_alloc_rx(&ch_rx->dma); in xrx200_dma_init()
499 for (ch_rx->dma.desc = 0; ch_rx->dma.desc < LTQ_DESC_NUM; in xrx200_dma_init()
500 ch_rx->dma.desc++) { in xrx200_dma_init()
505 ch_rx->dma.desc = 0; in xrx200_dma_init()
506 ret = devm_request_irq(priv->dev, ch_rx->dma.irq, xrx200_dma_irq, 0, in xrx200_dma_init()
510 ch_rx->dma.irq); in xrx200_dma_init()
514 ch_tx->dma.nr = XRX200_DMA_TX; in xrx200_dma_init()
515 ch_tx->dma.dev = priv->dev; in xrx200_dma_init()
518 ltq_dma_alloc_tx(&ch_tx->dma); in xrx200_dma_init()
519 ret = devm_request_irq(priv->dev, ch_tx->dma.irq, xrx200_dma_irq, 0, in xrx200_dma_init()
523 ch_tx->dma.irq); in xrx200_dma_init()
530 ltq_dma_free(&ch_tx->dma); in xrx200_dma_init()
540 ltq_dma_free(&ch_rx->dma); in xrx200_dma_init()
548 ltq_dma_free(&priv->chan_tx.dma); in xrx200_hw_cleanup()
549 ltq_dma_free(&priv->chan_rx.dma); in xrx200_hw_cleanup()
585 priv->chan_rx.dma.irq = platform_get_irq_byname(pdev, "rx"); in xrx200_probe()
586 if (priv->chan_rx.dma.irq < 0) in xrx200_probe()
588 priv->chan_tx.dma.irq = platform_get_irq_byname(pdev, "tx"); in xrx200_probe()
589 if (priv->chan_tx.dma.irq < 0) in xrx200_probe()