Lines Matching refs:txring
510 struct pasemi_mac_txring *txring = tx_ring(mac); in pasemi_mac_free_tx_resources() local
517 start = txring->next_to_clean; in pasemi_mac_free_tx_resources()
518 limit = txring->next_to_fill; in pasemi_mac_free_tx_resources()
525 info = &txring->ring_info[(i+1) & (TX_RING_SIZE-1)]; in pasemi_mac_free_tx_resources()
529 dmas[j] = txring->ring_info[(i+1+j) & in pasemi_mac_free_tx_resources()
538 kfree(txring->ring_info); in pasemi_mac_free_tx_resources()
539 pasemi_dma_free_chan(&txring->chan); in pasemi_mac_free_tx_resources()
814 static int pasemi_mac_clean_tx(struct pasemi_mac_txring *txring) in pasemi_mac_clean_tx() argument
816 struct pasemi_dmachan *chan = &txring->chan; in pasemi_mac_clean_tx()
817 struct pasemi_mac *mac = txring->mac; in pasemi_mac_clean_tx()
831 spin_lock_irqsave(&txring->lock, flags); in pasemi_mac_clean_tx()
833 start = txring->next_to_clean; in pasemi_mac_clean_tx()
834 ring_limit = txring->next_to_fill; in pasemi_mac_clean_tx()
836 prefetch(&TX_DESC_INFO(txring, start+1).skb); in pasemi_mac_clean_tx()
848 u64 mactx = TX_DESC(txring, i); in pasemi_mac_clean_tx()
857 TX_DESC(txring, i) = 0; in pasemi_mac_clean_tx()
858 TX_DESC(txring, i+1) = 0; in pasemi_mac_clean_tx()
863 skb = TX_DESC_INFO(txring, i+1).skb; in pasemi_mac_clean_tx()
864 nr_frags = TX_DESC_INFO(txring, i).dma; in pasemi_mac_clean_tx()
878 dmas[descr_count][j] = TX_DESC_INFO(txring, i+1+j).dma; in pasemi_mac_clean_tx()
883 TX_DESC(txring, i) = 0; in pasemi_mac_clean_tx()
884 TX_DESC(txring, i+1) = 0; in pasemi_mac_clean_tx()
888 txring->next_to_clean = i & (TX_RING_SIZE-1); in pasemi_mac_clean_tx()
890 spin_unlock_irqrestore(&txring->lock, flags); in pasemi_mac_clean_tx()
937 struct pasemi_mac_txring *txring = from_timer(txring, t, clean_timer); in pasemi_mac_tx_timer() local
938 struct pasemi_mac *mac = txring->mac; in pasemi_mac_tx_timer()
940 pasemi_mac_clean_tx(txring); in pasemi_mac_tx_timer()
942 mod_timer(&txring->clean_timer, jiffies + TX_CLEAN_INTERVAL); in pasemi_mac_tx_timer()
949 struct pasemi_mac_txring *txring = data; in pasemi_mac_tx_intr() local
950 const struct pasemi_dmachan *chan = &txring->chan; in pasemi_mac_tx_intr()
951 struct pasemi_mac *mac = txring->mac; in pasemi_mac_tx_intr()
964 mod_timer(&txring->clean_timer, jiffies + (TX_CLEAN_INTERVAL)*2); in pasemi_mac_tx_intr()
1343 struct pasemi_mac_txring *txring, in pasemi_mac_queue_csdesc() argument
1414 fill = txring->next_to_fill; in pasemi_mac_queue_csdesc()
1415 TX_DESC(txring, fill++) = CTRL_CMD_T | CTRL_CMD_META_EVT | CTRL_CMD_O | in pasemi_mac_queue_csdesc()
1417 TX_DESC(txring, fill++) = 0; in pasemi_mac_queue_csdesc()
1418 TX_DESC(txring, fill++) = CTRL_CMD_T | CTRL_CMD_META_EVT | CTRL_CMD_O | in pasemi_mac_queue_csdesc()
1420 TX_DESC(txring, fill++) = 0; in pasemi_mac_queue_csdesc()
1421 txring->next_to_fill = fill; in pasemi_mac_queue_csdesc()
1423 write_dma_reg(PAS_DMA_TXCHAN_INCR(txring->chan.chno), 2); in pasemi_mac_queue_csdesc()
1429 struct pasemi_mac_txring * const txring = tx_ring(mac); in pasemi_mac_start_tx() local
1441 prefetch(&txring->ring_info); in pasemi_mac_start_tx()
1484 spin_lock_irqsave(&txring->lock, flags); in pasemi_mac_start_tx()
1490 if (RING_AVAIL(txring) < nfrags + 14) { in pasemi_mac_start_tx()
1501 pasemi_mac_queue_csdesc(skb, map, map_size, txring, csring); in pasemi_mac_start_tx()
1504 fill = txring->next_to_fill; in pasemi_mac_start_tx()
1505 TX_DESC(txring, fill) = mactx; in pasemi_mac_start_tx()
1506 TX_DESC_INFO(txring, fill).dma = nfrags; in pasemi_mac_start_tx()
1508 TX_DESC_INFO(txring, fill).skb = skb; in pasemi_mac_start_tx()
1510 TX_DESC(txring, fill+i) = in pasemi_mac_start_tx()
1512 TX_DESC_INFO(txring, fill+i).dma = map[i]; in pasemi_mac_start_tx()
1522 txring->next_to_fill = (fill + nfrags + 1) & (TX_RING_SIZE-1); in pasemi_mac_start_tx()
1527 spin_unlock_irqrestore(&txring->lock, flags); in pasemi_mac_start_tx()
1529 write_dma_reg(PAS_DMA_TXCHAN_INCR(txring->chan.chno), (nfrags+2) >> 1); in pasemi_mac_start_tx()
1534 spin_unlock_irqrestore(&txring->lock, flags); in pasemi_mac_start_tx()