Lines Matching refs:tpd_ring
788 adapter->tpd_ring[0].count = 1024; in atl1c_sw_init()
869 struct atl1c_tpd_ring *tpd_ring = &adapter->tpd_ring[type]; in atl1c_clean_tx_ring() local
874 ring_count = tpd_ring->count; in atl1c_clean_tx_ring()
876 buffer_info = &tpd_ring->buffer_info[index]; in atl1c_clean_tx_ring()
883 memset(tpd_ring->desc, 0, sizeof(struct atl1c_tpd_desc) * in atl1c_clean_tx_ring()
885 atomic_set(&tpd_ring->next_to_clean, 0); in atl1c_clean_tx_ring()
886 tpd_ring->next_to_use = 0; in atl1c_clean_tx_ring()
918 struct atl1c_tpd_ring *tpd_ring = adapter->tpd_ring; in atl1c_init_ring_ptrs() local
925 tpd_ring[i].next_to_use = 0; in atl1c_init_ring_ptrs()
926 atomic_set(&tpd_ring[i].next_to_clean, 0); in atl1c_init_ring_ptrs()
927 buffer_info = tpd_ring[i].buffer_info; in atl1c_init_ring_ptrs()
928 for (j = 0; j < tpd_ring->count; j++) in atl1c_init_ring_ptrs()
959 if (adapter->tpd_ring[0].buffer_info) { in atl1c_free_ring_resources()
960 kfree(adapter->tpd_ring[0].buffer_info); in atl1c_free_ring_resources()
961 adapter->tpd_ring[0].buffer_info = NULL; in atl1c_free_ring_resources()
978 struct atl1c_tpd_ring *tpd_ring = adapter->tpd_ring; in atl1c_setup_ring_resources() local
990 tpd_ring[i].count = tpd_ring[0].count; in atl1c_setup_ring_resources()
994 size = sizeof(struct atl1c_buffer) * (tpd_ring->count * 2 + in atl1c_setup_ring_resources()
996 tpd_ring->buffer_info = kzalloc(size, GFP_KERNEL); in atl1c_setup_ring_resources()
997 if (unlikely(!tpd_ring->buffer_info)) in atl1c_setup_ring_resources()
1001 tpd_ring[i].buffer_info = in atl1c_setup_ring_resources()
1002 (tpd_ring->buffer_info + count); in atl1c_setup_ring_resources()
1003 count += tpd_ring[i].count; in atl1c_setup_ring_resources()
1007 (tpd_ring->buffer_info + count); in atl1c_setup_ring_resources()
1017 sizeof(struct atl1c_tpd_desc) * tpd_ring->count * 2 + in atl1c_setup_ring_resources()
1030 tpd_ring[0].dma = roundup(ring_header->dma, 8); in atl1c_setup_ring_resources()
1031 offset = tpd_ring[0].dma - ring_header->dma; in atl1c_setup_ring_resources()
1033 tpd_ring[i].dma = ring_header->dma + offset; in atl1c_setup_ring_resources()
1034 tpd_ring[i].desc = (u8 *) ring_header->desc + offset; in atl1c_setup_ring_resources()
1035 tpd_ring[i].size = in atl1c_setup_ring_resources()
1036 sizeof(struct atl1c_tpd_desc) * tpd_ring[i].count; in atl1c_setup_ring_resources()
1037 offset += roundup(tpd_ring[i].size, 8); in atl1c_setup_ring_resources()
1055 kfree(tpd_ring->buffer_info); in atl1c_setup_ring_resources()
1064 struct atl1c_tpd_ring *tpd_ring = (struct atl1c_tpd_ring *) in atl1c_configure_des_ring() local
1065 adapter->tpd_ring; in atl1c_configure_des_ring()
1069 (u32)((tpd_ring[atl1c_trans_normal].dma & in atl1c_configure_des_ring()
1073 (u32)(tpd_ring[atl1c_trans_normal].dma & in atl1c_configure_des_ring()
1076 (u32)(tpd_ring[atl1c_trans_high].dma & in atl1c_configure_des_ring()
1079 (u32)(tpd_ring[0].count & TPD_RING_SIZE_MASK)); in atl1c_configure_des_ring()
1552 struct atl1c_tpd_ring *tpd_ring = &adapter->tpd_ring[type]; in atl1c_clean_tx_irq() local
1555 u16 next_to_clean = atomic_read(&tpd_ring->next_to_clean); in atl1c_clean_tx_irq()
1565 buffer_info = &tpd_ring->buffer_info[next_to_clean]; in atl1c_clean_tx_irq()
1571 if (++next_to_clean == tpd_ring->count) in atl1c_clean_tx_irq()
1573 atomic_set(&tpd_ring->next_to_clean, next_to_clean); in atl1c_clean_tx_irq()
1923 struct atl1c_tpd_ring *tpd_ring = &adapter->tpd_ring[type]; in atl1c_tpd_avail() local
1927 next_to_clean = atomic_read(&tpd_ring->next_to_clean); in atl1c_tpd_avail()
1928 next_to_use = tpd_ring->next_to_use; in atl1c_tpd_avail()
1932 (tpd_ring->count + next_to_clean - next_to_use - 1); in atl1c_tpd_avail()
1943 struct atl1c_tpd_ring *tpd_ring = &adapter->tpd_ring[type]; in atl1c_get_tpd() local
1947 next_to_use = tpd_ring->next_to_use; in atl1c_get_tpd()
1948 if (++tpd_ring->next_to_use == tpd_ring->count) in atl1c_get_tpd()
1949 tpd_ring->next_to_use = 0; in atl1c_get_tpd()
1950 tpd_desc = ATL1C_TPD_DESC(tpd_ring, next_to_use); in atl1c_get_tpd()
1958 struct atl1c_tpd_ring *tpd_ring = adapter->tpd_ring; in atl1c_get_tx_buffer() local
1960 return &tpd_ring->buffer_info[tpd - in atl1c_get_tx_buffer()
1961 (struct atl1c_tpd_desc *)tpd_ring->desc]; in atl1c_get_tx_buffer()
2086 struct atl1c_tpd_ring *tpd_ring = &adpt->tpd_ring[type]; in atl1c_tx_rollback() local
2091 first_index = first_tpd - (struct atl1c_tpd_desc *)tpd_ring->desc; in atl1c_tx_rollback()
2093 while (index != tpd_ring->next_to_use) { in atl1c_tx_rollback()
2094 tpd = ATL1C_TPD_DESC(tpd_ring, index); in atl1c_tx_rollback()
2095 buffer_info = &tpd_ring->buffer_info[index]; in atl1c_tx_rollback()
2098 if (++index == tpd_ring->count) in atl1c_tx_rollback()
2101 tpd_ring->next_to_use = first_index; in atl1c_tx_rollback()
2206 struct atl1c_tpd_ring *tpd_ring = &adapter->tpd_ring[type]; in atl1c_tx_queue() local
2210 AT_WRITE_REGW(&adapter->hw, reg, tpd_ring->next_to_use); in atl1c_tx_queue()