Lines Matching refs:bd_ring

41 				struct rtw89_pci_dma_ring *bd_ring,  in rtw89_pci_dma_recalc()  argument
46 rp = bd_ring->rp; in rtw89_pci_dma_recalc()
47 wp = bd_ring->wp; in rtw89_pci_dma_recalc()
48 len = bd_ring->len; in rtw89_pci_dma_recalc()
56 bd_ring->rp = cur_rp; in rtw89_pci_dma_recalc()
64 struct rtw89_pci_dma_ring *bd_ring = &tx_ring->bd_ring; in rtw89_pci_txbd_recalc() local
65 u32 addr_idx = bd_ring->addr.idx; in rtw89_pci_txbd_recalc()
69 cnt = rtw89_pci_dma_recalc(rtwdev, bd_ring, idx, true); in rtw89_pci_txbd_recalc()
123 struct rtw89_pci_dma_ring *bd_ring = &rx_ring->bd_ring; in rtw89_pci_rxbd_recalc() local
124 u32 addr_idx = bd_ring->addr.idx; in rtw89_pci_rxbd_recalc()
128 cnt = rtw89_pci_dma_recalc(rtwdev, bd_ring, idx, false); in rtw89_pci_rxbd_recalc()
221 struct rtw89_pci_dma_ring *bd_ring = &rx_ring->bd_ring; in rtw89_pci_rxbd_deliver_skbs() local
232 skb = rx_ring->buf[bd_ring->wp]; in rtw89_pci_rxbd_deliver_skbs()
238 bd_ring->wp, ret); in rtw89_pci_rxbd_deliver_skbs()
309 struct rtw89_pci_dma_ring *bd_ring = &rx_ring->bd_ring; in rtw89_pci_rxbd_deliver() local
325 rtw89_write16(rtwdev, bd_ring->addr.idx, bd_ring->wp); in rtw89_pci_rxbd_deliver()
508 struct rtw89_pci_dma_ring *bd_ring = &rx_ring->bd_ring; in rtw89_pci_release_tx_skbs() local
519 skb = rx_ring->buf[bd_ring->wp]; in rtw89_pci_release_tx_skbs()
525 bd_ring->wp, ret); in rtw89_pci_release_tx_skbs()
561 struct rtw89_pci_dma_ring *bd_ring = &rx_ring->bd_ring; in rtw89_pci_release_tx() local
577 rtw89_write16(rtwdev, bd_ring->addr.idx, bd_ring->wp); in rtw89_pci_release_tx()
611 struct rtw89_pci_dma_ring *bd_ring; in rtw89_pci_isr_rxd_unavail() local
618 bd_ring = &rx_ring->bd_ring; in rtw89_pci_isr_rxd_unavail()
620 reg_idx = rtw89_read32(rtwdev, bd_ring->addr.idx); in rtw89_pci_isr_rxd_unavail()
623 hw_idx_next = (hw_idx + 1) % bd_ring->len; in rtw89_pci_isr_rxd_unavail()
630 i, reg_idx, bd_ring->len); in rtw89_pci_isr_rxd_unavail()
916 struct rtw89_pci_dma_ring *bd_ring = &ring->bd_ring; in rtw89_pci_get_avail_txbd_num() local
919 if (bd_ring->rp > bd_ring->wp) in rtw89_pci_get_avail_txbd_num()
920 return bd_ring->rp - bd_ring->wp - 1; in rtw89_pci_get_avail_txbd_num()
922 return bd_ring->len - (bd_ring->wp - bd_ring->rp) - 1; in rtw89_pci_get_avail_txbd_num()
1014 struct rtw89_pci_dma_ring *bd_ring = &tx_ring->bd_ring; in __rtw89_pci_tx_kick_off() local
1019 addr = bd_ring->addr.idx; in __rtw89_pci_tx_kick_off()
1020 host_idx = bd_ring->wp; in __rtw89_pci_tx_kick_off()
1029 struct rtw89_pci_dma_ring *bd_ring = &tx_ring->bd_ring; in rtw89_pci_tx_bd_ring_update() local
1032 len = bd_ring->len; in rtw89_pci_tx_bd_ring_update()
1033 host_idx = bd_ring->wp + n_txbd; in rtw89_pci_tx_bd_ring_update()
1036 bd_ring->wp = host_idx; in rtw89_pci_tx_bd_ring_update()
1071 struct rtw89_pci_dma_ring *bd_ring = &tx_ring->bd_ring; in __pci_flush_txch() local
1081 cur_idx = rtw89_read32(rtwdev, bd_ring->addr.idx); in __pci_flush_txch()
1083 if (cur_rp == bd_ring->wp) in __pci_flush_txch()
1386 struct rtw89_pci_dma_ring *bd_ring; in rtw89_pci_reset_trx_rings() local
1399 bd_ring = &tx_ring->bd_ring; in rtw89_pci_reset_trx_rings()
1401 addr_num = bd_ring->addr.num; in rtw89_pci_reset_trx_rings()
1402 addr_bdram = bd_ring->addr.bdram; in rtw89_pci_reset_trx_rings()
1403 addr_desa_l = bd_ring->addr.desa_l; in rtw89_pci_reset_trx_rings()
1404 bd_ring->wp = 0; in rtw89_pci_reset_trx_rings()
1405 bd_ring->rp = 0; in rtw89_pci_reset_trx_rings()
1411 rtw89_write16(rtwdev, addr_num, bd_ring->len); in rtw89_pci_reset_trx_rings()
1413 rtw89_write32(rtwdev, addr_desa_l, bd_ring->dma); in rtw89_pci_reset_trx_rings()
1418 bd_ring = &rx_ring->bd_ring; in rtw89_pci_reset_trx_rings()
1419 addr_num = bd_ring->addr.num; in rtw89_pci_reset_trx_rings()
1420 addr_desa_l = bd_ring->addr.desa_l; in rtw89_pci_reset_trx_rings()
1421 bd_ring->wp = 0; in rtw89_pci_reset_trx_rings()
1422 bd_ring->rp = 0; in rtw89_pci_reset_trx_rings()
1426 rtw89_write16(rtwdev, addr_num, bd_ring->len); in rtw89_pci_reset_trx_rings()
1427 rtw89_write32(rtwdev, addr_desa_l, bd_ring->dma); in rtw89_pci_reset_trx_rings()
1532 tx_ring->bd_ring.addr.idx = low_power ? in rtw89_pci_switch_bd_idx_addr()
1539 rx_ring->bd_ring.addr.idx = low_power ? in rtw89_pci_switch_bd_idx_addr()
2741 head = tx_ring->bd_ring.head; in rtw89_pci_free_tx_ring()
2742 dma = tx_ring->bd_ring.dma; in rtw89_pci_free_tx_ring()
2743 ring_sz = tx_ring->bd_ring.desc_size * tx_ring->bd_ring.len; in rtw89_pci_free_tx_ring()
2746 tx_ring->bd_ring.head = NULL; in rtw89_pci_free_tx_ring()
2775 int ring_sz = rx_ring->bd_ring.desc_size * rx_ring->bd_ring.len; in rtw89_pci_free_rx_ring()
2779 for (i = 0; i < rx_ring->bd_ring.len; i++) { in rtw89_pci_free_rx_ring()
2791 head = rx_ring->bd_ring.head; in rtw89_pci_free_rx_ring()
2792 dma = rx_ring->bd_ring.dma; in rtw89_pci_free_rx_ring()
2795 rx_ring->bd_ring.head = NULL; in rtw89_pci_free_rx_ring()
2926 tx_ring->bd_ring.head = head; in rtw89_pci_alloc_tx_ring()
2927 tx_ring->bd_ring.dma = dma; in rtw89_pci_alloc_tx_ring()
2928 tx_ring->bd_ring.len = len; in rtw89_pci_alloc_tx_ring()
2929 tx_ring->bd_ring.desc_size = desc_size; in rtw89_pci_alloc_tx_ring()
2930 tx_ring->bd_ring.addr = *txch_addr; in rtw89_pci_alloc_tx_ring()
2931 tx_ring->bd_ring.wp = 0; in rtw89_pci_alloc_tx_ring()
2932 tx_ring->bd_ring.rp = 0; in rtw89_pci_alloc_tx_ring()
3006 rx_ring->bd_ring.head = head; in rtw89_pci_alloc_rx_ring()
3007 rx_ring->bd_ring.dma = dma; in rtw89_pci_alloc_rx_ring()
3008 rx_ring->bd_ring.len = len; in rtw89_pci_alloc_rx_ring()
3009 rx_ring->bd_ring.desc_size = desc_size; in rtw89_pci_alloc_rx_ring()
3010 rx_ring->bd_ring.addr = *rxch_addr; in rtw89_pci_alloc_rx_ring()
3011 rx_ring->bd_ring.wp = 0; in rtw89_pci_alloc_rx_ring()
3012 rx_ring->bd_ring.rp = 0; in rtw89_pci_alloc_rx_ring()
3050 head = rx_ring->bd_ring.head; in rtw89_pci_alloc_rx_ring()
3051 dma = rx_ring->bd_ring.dma; in rtw89_pci_alloc_rx_ring()
3054 rx_ring->bd_ring.head = NULL; in rtw89_pci_alloc_rx_ring()