Lines Matching refs:txring
572 struct jme_ring *txring = &(jme->txring[0]); in jme_setup_tx_resources() local
574 txring->alloc = dma_alloc_coherent(&(jme->pdev->dev), in jme_setup_tx_resources()
576 &(txring->dmaalloc), in jme_setup_tx_resources()
579 if (!txring->alloc) in jme_setup_tx_resources()
585 txring->desc = (void *)ALIGN((unsigned long)(txring->alloc), in jme_setup_tx_resources()
587 txring->dma = ALIGN(txring->dmaalloc, RING_DESC_ALIGN); in jme_setup_tx_resources()
588 txring->next_to_use = 0; in jme_setup_tx_resources()
589 atomic_set(&txring->next_to_clean, 0); in jme_setup_tx_resources()
590 atomic_set(&txring->nr_free, jme->tx_ring_size); in jme_setup_tx_resources()
592 txring->bufinf = kzalloc(sizeof(struct jme_buffer_info) * in jme_setup_tx_resources()
594 if (unlikely(!(txring->bufinf))) in jme_setup_tx_resources()
600 memset(txring->alloc, 0, TX_RING_ALLOC_SIZE(jme->tx_ring_size)); in jme_setup_tx_resources()
607 txring->alloc, in jme_setup_tx_resources()
608 txring->dmaalloc); in jme_setup_tx_resources()
611 txring->desc = NULL; in jme_setup_tx_resources()
612 txring->dmaalloc = 0; in jme_setup_tx_resources()
613 txring->dma = 0; in jme_setup_tx_resources()
614 txring->bufinf = NULL; in jme_setup_tx_resources()
623 struct jme_ring *txring = &(jme->txring[0]); in jme_free_tx_resources() local
626 if (txring->alloc) { in jme_free_tx_resources()
627 if (txring->bufinf) { in jme_free_tx_resources()
629 txbi = txring->bufinf + i; in jme_free_tx_resources()
639 kfree(txring->bufinf); in jme_free_tx_resources()
644 txring->alloc, in jme_free_tx_resources()
645 txring->dmaalloc); in jme_free_tx_resources()
647 txring->alloc = NULL; in jme_free_tx_resources()
648 txring->desc = NULL; in jme_free_tx_resources()
649 txring->dmaalloc = 0; in jme_free_tx_resources()
650 txring->dma = 0; in jme_free_tx_resources()
651 txring->bufinf = NULL; in jme_free_tx_resources()
653 txring->next_to_use = 0; in jme_free_tx_resources()
654 atomic_set(&txring->next_to_clean, 0); in jme_free_tx_resources()
655 atomic_set(&txring->nr_free, 0); in jme_free_tx_resources()
670 jwrite32(jme, JME_TXDBA_LO, (__u64)jme->txring[0].dma & 0xFFFFFFFFUL); in jme_enable_tx_engine()
671 jwrite32(jme, JME_TXDBA_HI, (__u64)(jme->txring[0].dma) >> 32); in jme_enable_tx_engine()
672 jwrite32(jme, JME_TXNDA, (__u64)jme->txring[0].dma & 0xFFFFFFFFUL); in jme_enable_tx_engine()
1436 struct jme_ring *txring = &(jme->txring[0]); in jme_wake_queue_if_stopped() local
1440 atomic_read(&txring->nr_free) >= (jme->tx_wake_threshold))) { in jme_wake_queue_if_stopped()
1451 struct jme_ring *txring = &(jme->txring[0]); in jme_tx_clean_tasklet() local
1452 struct txdesc *txdesc = txring->desc; in jme_tx_clean_tasklet()
1453 struct jme_buffer_info *txbi = txring->bufinf, *ctxbi, *ttxbi; in jme_tx_clean_tasklet()
1467 max = jme->tx_ring_size - atomic_read(&txring->nr_free); in jme_tx_clean_tasklet()
1470 for (i = atomic_read(&txring->next_to_clean) ; cnt < max ; ) { in jme_tx_clean_tasklet()
1520 atomic_set(&txring->next_to_clean, i); in jme_tx_clean_tasklet()
1521 atomic_add(cnt, &txring->nr_free); in jme_tx_clean_tasklet()
1977 struct jme_ring *txring = &(jme->txring[0]); in jme_alloc_txdesc() local
1980 idx = txring->next_to_use; in jme_alloc_txdesc()
1983 if (unlikely(atomic_read(&txring->nr_free) < nr_alloc)) in jme_alloc_txdesc()
1986 atomic_sub(nr_alloc, &txring->nr_free); in jme_alloc_txdesc()
1988 txring->next_to_use = (txring->next_to_use + nr_alloc) & mask; in jme_alloc_txdesc()
2034 struct jme_ring *txring = &(jme->txring[0]); in jme_drop_tx_map() local
2035 struct jme_buffer_info *txbi = txring->bufinf, *ctxbi; in jme_drop_tx_map()
2055 struct jme_ring *txring = &(jme->txring[0]); in jme_map_tx_skb() local
2056 struct txdesc *txdesc = txring->desc, *ctxdesc; in jme_map_tx_skb()
2057 struct jme_buffer_info *txbi = txring->bufinf, *ctxbi; in jme_map_tx_skb()
2168 struct jme_ring *txring = &(jme->txring[0]); in jme_fill_tx_desc() local
2174 txdesc = (struct txdesc *)txring->desc + idx; in jme_fill_tx_desc()
2175 txbi = txring->bufinf + idx; in jme_fill_tx_desc()
2220 struct jme_ring *txring = &(jme->txring[0]); in jme_stop_queue_if_full() local
2221 struct jme_buffer_info *txbi = txring->bufinf; in jme_stop_queue_if_full()
2222 int idx = atomic_read(&txring->next_to_clean); in jme_stop_queue_if_full()
2227 if (unlikely(atomic_read(&txring->nr_free) < (MAX_SKB_FRAGS+2))) { in jme_stop_queue_if_full()
2231 if (atomic_read(&txring->nr_free) in jme_stop_queue_if_full()