Lines Matching refs:desc
135 struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc]; in xrx200_flush_dma() local
137 if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) != LTQ_DMA_C) in xrx200_flush_dma()
140 desc->ctl = LTQ_DMA_OWN | LTQ_DMA_RX_OFFSET(NET_IP_ALIGN) | in xrx200_flush_dma()
142 ch->dma.desc++; in xrx200_flush_dma()
143 ch->dma.desc %= LTQ_DESC_NUM; in xrx200_flush_dma()
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() local
224 void *buf = ch->rx_buff[ch->dma.desc]; in xrx200_hw_receive()
225 u32 ctl = desc->ctl; 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() local
293 if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) == LTQ_DMA_C) { in xrx200_poll_rx()
323 struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->tx_free]; in xrx200_tx_housekeeping() local
325 if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) == LTQ_DMA_C) { in xrx200_tx_housekeeping()
362 struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc]; in xrx200_start_xmit() local
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()
390 desc->addr = mapping - byte_offset; in xrx200_start_xmit()
393 desc->ctl = LTQ_DMA_OWN | LTQ_DMA_SOP | LTQ_DMA_EOP | 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()
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()
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()