Lines Matching refs:rfd

235 #define EMAC_RFD(RXQ, SIZE, IDX)	((RXQ)->rfd.v_addr + (SIZE * (IDX)))
238 #define GET_RFD_BUFFER(RXQ, IDX) (&((RXQ)->rfd.rfbuff[(IDX)]))
315 writel(upper_32_bits(adpt->rx_q.rfd.dma_addr), in emac_mac_dma_rings_config()
318 writel(lower_32_bits(adpt->rx_q.rfd.dma_addr), in emac_mac_dma_rings_config()
323 writel(adpt->rx_q.rfd.count & RFD_RING_SIZE_BMSK, in emac_mac_dma_rings_config()
629 if (!rx_q->rfd.rfbuff) in emac_rx_q_free_descs()
632 for (i = 0; i < rx_q->rfd.count; i++) { in emac_rx_q_free_descs()
646 size = sizeof(struct emac_buffer) * rx_q->rfd.count; in emac_rx_q_free_descs()
647 memset(rx_q->rfd.rfbuff, 0, size); in emac_rx_q_free_descs()
654 memset(rx_q->rfd.v_addr, 0, rx_q->rfd.size); in emac_rx_q_free_descs()
655 rx_q->rfd.produce_idx = 0; in emac_rx_q_free_descs()
656 rx_q->rfd.consume_idx = 0; in emac_rx_q_free_descs()
703 kfree(rx_q->rfd.rfbuff); in emac_rx_q_bufs_free()
704 rx_q->rfd.rfbuff = NULL; in emac_rx_q_bufs_free()
706 rx_q->rfd.v_addr = NULL; in emac_rx_q_bufs_free()
707 rx_q->rfd.dma_addr = 0; in emac_rx_q_bufs_free()
708 rx_q->rfd.size = 0; in emac_rx_q_bufs_free()
723 size = sizeof(struct emac_buffer) * rx_q->rfd.count; in emac_rx_descs_alloc()
724 rx_q->rfd.rfbuff = kzalloc_node(size, GFP_KERNEL, node); in emac_rx_descs_alloc()
725 if (!rx_q->rfd.rfbuff) in emac_rx_descs_alloc()
729 rx_q->rfd.size = rx_q->rfd.count * (adpt->rfd_size * 4); in emac_rx_descs_alloc()
735 rx_q->rfd.dma_addr = ring_header->dma_addr + ring_header->used; in emac_rx_descs_alloc()
736 rx_q->rfd.v_addr = ring_header->v_addr + ring_header->used; in emac_rx_descs_alloc()
737 ring_header->used += ALIGN(rx_q->rfd.size, 8); in emac_rx_descs_alloc()
742 rx_q->rfd.produce_idx = 0; in emac_rx_descs_alloc()
743 rx_q->rfd.consume_idx = 0; in emac_rx_descs_alloc()
760 adpt->rx_q.rfd.count = adpt->rx_desc_cnt; in emac_mac_rx_tx_rings_alloc_all()
838 adpt->rx_q.rfd.produce_idx = 0; in emac_mac_rx_tx_ring_reset_all()
839 adpt->rx_q.rfd.consume_idx = 0; in emac_mac_rx_tx_ring_reset_all()
840 for (i = 0; i < adpt->rx_q.rfd.count; i++) in emac_mac_rx_tx_ring_reset_all()
841 adpt->rx_q.rfd.rfbuff[i].dma_addr = 0; in emac_mac_rx_tx_ring_reset_all()
849 u32 *hw_rfd = EMAC_RFD(rx_q, adpt->rfd_size, rx_q->rfd.produce_idx); in emac_mac_rx_rfd_create()
854 if (++rx_q->rfd.produce_idx == rx_q->rfd.count) in emac_mac_rx_rfd_create()
855 rx_q->rfd.produce_idx = 0; in emac_mac_rx_rfd_create()
867 next_produce_idx = rx_q->rfd.produce_idx + 1; in emac_mac_rx_descs_refill()
868 if (next_produce_idx == rx_q->rfd.count) in emac_mac_rx_descs_refill()
871 curr_rxbuf = GET_RFD_BUFFER(rx_q, rx_q->rfd.produce_idx); in emac_mac_rx_descs_refill()
897 next_produce_idx = rx_q->rfd.produce_idx + 1; in emac_mac_rx_descs_refill()
898 if (next_produce_idx == rx_q->rfd.count) in emac_mac_rx_descs_refill()
901 curr_rxbuf = GET_RFD_BUFFER(rx_q, rx_q->rfd.produce_idx); in emac_mac_rx_descs_refill()
907 u32 prod_idx = (rx_q->rfd.produce_idx << rx_q->produce_shift) & in emac_mac_rx_descs_refill()
1057 struct emac_buffer *rfbuf = rx_q->rfd.rfbuff; in emac_rx_rfd_clean()
1063 if (++consume_idx == rx_q->rfd.count) in emac_rx_rfd_clean()
1067 rx_q->rfd.consume_idx = consume_idx; in emac_rx_rfd_clean()
1068 rx_q->rfd.process_idx = consume_idx; in emac_rx_rfd_clean()
1159 proc_idx = (rx_q->rfd.process_idx << rx_q->process_shft) & in emac_mac_rx_process()