Lines Matching refs:tx_ring
636 hw->tpd_thresh = adapter->tx_ring.count / 2; in atl1e_sw_init()
663 struct atl1e_tx_ring *tx_ring = &adapter->tx_ring; in atl1e_clean_tx_ring() local
668 if (tx_ring->desc == NULL || tx_ring->tx_buffer == NULL) in atl1e_clean_tx_ring()
671 ring_count = tx_ring->count; in atl1e_clean_tx_ring()
674 tx_buffer = &tx_ring->tx_buffer[index]; in atl1e_clean_tx_ring()
687 tx_buffer = &tx_ring->tx_buffer[index]; in atl1e_clean_tx_ring()
694 memset(tx_ring->desc, 0, sizeof(struct atl1e_tpd_desc) * in atl1e_clean_tx_ring()
696 memset(tx_ring->tx_buffer, 0, sizeof(struct atl1e_tx_buffer) * in atl1e_clean_tx_ring()
727 *ring_size = ((u32)(adapter->tx_ring.count * in atl1e_cal_ring_size()
753 rwlock_init(&adapter->tx_ring.tx_lock); in atl1e_init_ring_resources()
761 struct atl1e_tx_ring *tx_ring = NULL; in atl1e_init_ring_ptrs() local
766 tx_ring = &adapter->tx_ring; in atl1e_init_ring_ptrs()
770 tx_ring->next_to_use = 0; in atl1e_init_ring_ptrs()
771 atomic_set(&tx_ring->next_to_clean, 0); in atl1e_init_ring_ptrs()
802 if (adapter->tx_ring.tx_buffer) { in atl1e_free_ring_resources()
803 kfree(adapter->tx_ring.tx_buffer); in atl1e_free_ring_resources()
804 adapter->tx_ring.tx_buffer = NULL; in atl1e_free_ring_resources()
817 struct atl1e_tx_ring *tx_ring; in atl1e_setup_ring_resources() local
827 tx_ring = &adapter->tx_ring; in atl1e_setup_ring_resources()
844 tx_ring->dma = roundup(adapter->ring_dma, 8); in atl1e_setup_ring_resources()
845 offset = tx_ring->dma - adapter->ring_dma; in atl1e_setup_ring_resources()
846 tx_ring->desc = adapter->ring_vir_addr + offset; in atl1e_setup_ring_resources()
847 size = sizeof(struct atl1e_tx_buffer) * (tx_ring->count); in atl1e_setup_ring_resources()
848 tx_ring->tx_buffer = kzalloc(size, GFP_KERNEL); in atl1e_setup_ring_resources()
849 if (tx_ring->tx_buffer == NULL) { in atl1e_setup_ring_resources()
855 offset += (sizeof(struct atl1e_tpd_desc) * tx_ring->count); in atl1e_setup_ring_resources()
869 tx_ring->cmb_dma = adapter->ring_dma + offset; in atl1e_setup_ring_resources()
870 tx_ring->cmb = adapter->ring_vir_addr + offset; in atl1e_setup_ring_resources()
905 struct atl1e_tx_ring *tx_ring = &adapter->tx_ring; in atl1e_configure_des_ring() local
912 (u32)((tx_ring->dma) & AT_DMA_LO_ADDR_MASK)); in atl1e_configure_des_ring()
913 AT_WRITE_REG(hw, REG_TPD_RING_SIZE, (u16)(tx_ring->count)); in atl1e_configure_des_ring()
915 (u32)((tx_ring->cmb_dma) & AT_DMA_LO_ADDR_MASK)); in atl1e_configure_des_ring()
1247 struct atl1e_tx_ring *tx_ring = &adapter->tx_ring; in atl1e_clean_tx_irq() local
1250 u16 next_to_clean = atomic_read(&tx_ring->next_to_clean); in atl1e_clean_tx_irq()
1253 tx_buffer = &tx_ring->tx_buffer[next_to_clean]; in atl1e_clean_tx_irq()
1269 if (++next_to_clean == tx_ring->count) in atl1e_clean_tx_irq()
1273 atomic_set(&tx_ring->next_to_clean, next_to_clean); in atl1e_clean_tx_irq()
1570 struct atl1e_tx_ring *tx_ring = &adapter->tx_ring; in atl1e_tpd_avail() local
1574 next_to_clean = atomic_read(&tx_ring->next_to_clean); in atl1e_tpd_avail()
1575 next_to_use = tx_ring->next_to_use; in atl1e_tpd_avail()
1579 (tx_ring->count + next_to_clean - next_to_use - 1); in atl1e_tpd_avail()
1589 struct atl1e_tx_ring *tx_ring = &adapter->tx_ring; in atl1e_get_tpd() local
1592 next_to_use = tx_ring->next_to_use; in atl1e_get_tpd()
1593 if (++tx_ring->next_to_use == tx_ring->count) in atl1e_get_tpd()
1594 tx_ring->next_to_use = 0; in atl1e_get_tpd()
1596 memset(&tx_ring->desc[next_to_use], 0, sizeof(struct atl1e_tpd_desc)); in atl1e_get_tpd()
1597 return &tx_ring->desc[next_to_use]; in atl1e_get_tpd()
1603 struct atl1e_tx_ring *tx_ring = &adapter->tx_ring; in atl1e_get_tx_buffer() local
1605 return &tx_ring->tx_buffer[tpd - tx_ring->desc]; in atl1e_get_tx_buffer()
1721 int ring_start = adapter->tx_ring.next_to_use; in atl1e_tx_map()
1767 ring_end = adapter->tx_ring.next_to_use; in atl1e_tx_map()
1768 adapter->tx_ring.next_to_use = ring_start; in atl1e_tx_map()
1769 while (adapter->tx_ring.next_to_use != ring_end) { in atl1e_tx_map()
1776 adapter->tx_ring.next_to_use = ring_start; in atl1e_tx_map()
1818 ring_end = adapter->tx_ring.next_to_use; in atl1e_tx_map()
1819 adapter->tx_ring.next_to_use = ring_start; in atl1e_tx_map()
1820 while (adapter->tx_ring.next_to_use != ring_end) { in atl1e_tx_map()
1828 adapter->tx_ring.next_to_use = ring_start; in atl1e_tx_map()
1855 struct atl1e_tx_ring *tx_ring = &adapter->tx_ring; in atl1e_tx_queue() local
1861 AT_WRITE_REG(&adapter->hw, REG_MB_TPD_PROD_IDX, tx_ring->next_to_use); in atl1e_tx_queue()