Lines Matching refs:rrd

234 #define EMAC_RRD(RXQ, SIZE, IDX)	((RXQ)->rrd.v_addr + (SIZE * (IDX)))
320 writel(lower_32_bits(adpt->rx_q.rrd.dma_addr), in emac_mac_dma_rings_config()
325 writel(adpt->rx_q.rrd.count & RRD_RING_SIZE_BMSK, in emac_mac_dma_rings_config()
650 memset(rx_q->rrd.v_addr, 0, rx_q->rrd.size); in emac_rx_q_free_descs()
651 rx_q->rrd.produce_idx = 0; in emac_rx_q_free_descs()
652 rx_q->rrd.consume_idx = 0; in emac_rx_q_free_descs()
710 rx_q->rrd.v_addr = NULL; in emac_rx_q_bufs_free()
711 rx_q->rrd.dma_addr = 0; in emac_rx_q_bufs_free()
712 rx_q->rrd.size = 0; in emac_rx_q_bufs_free()
728 rx_q->rrd.size = rx_q->rrd.count * (adpt->rrd_size * 4); in emac_rx_descs_alloc()
731 rx_q->rrd.dma_addr = ring_header->dma_addr + ring_header->used; in emac_rx_descs_alloc()
732 rx_q->rrd.v_addr = ring_header->v_addr + ring_header->used; in emac_rx_descs_alloc()
733 ring_header->used += ALIGN(rx_q->rrd.size, 8); in emac_rx_descs_alloc()
739 rx_q->rrd.produce_idx = 0; in emac_rx_descs_alloc()
740 rx_q->rrd.consume_idx = 0; in emac_rx_descs_alloc()
759 adpt->rx_q.rrd.count = adpt->rx_desc_cnt; in emac_mac_rx_tx_rings_alloc_all()
836 adpt->rx_q.rrd.produce_idx = 0; in emac_mac_rx_tx_ring_reset_all()
837 adpt->rx_q.rrd.consume_idx = 0; in emac_mac_rx_tx_ring_reset_all()
992 struct emac_rrd *rrd) in emac_rx_process_rrd() argument
994 u32 *hw_rrd = EMAC_RRD(rx_q, adpt->rrd_size, rx_q->rrd.consume_idx); in emac_rx_process_rrd()
996 rrd->word[3] = *(hw_rrd + 3); in emac_rx_process_rrd()
998 if (!RRD_UPDT(rrd)) in emac_rx_process_rrd()
1001 rrd->word[4] = 0; in emac_rx_process_rrd()
1002 rrd->word[5] = 0; in emac_rx_process_rrd()
1004 rrd->word[0] = *(hw_rrd++); in emac_rx_process_rrd()
1005 rrd->word[1] = *(hw_rrd++); in emac_rx_process_rrd()
1006 rrd->word[2] = *(hw_rrd++); in emac_rx_process_rrd()
1008 if (unlikely(RRD_NOR(rrd) != 1)) { in emac_rx_process_rrd()
1011 RRD_NOR(rrd)); in emac_rx_process_rrd()
1015 RRD_UPDT_SET(rrd, 0); in emac_rx_process_rrd()
1016 *hw_rrd = rrd->word[3]; in emac_rx_process_rrd()
1018 if (++rx_q->rrd.consume_idx == rx_q->rrd.count) in emac_rx_process_rrd()
1019 rx_q->rrd.consume_idx = 0; in emac_rx_process_rrd()
1055 static void emac_rx_rfd_clean(struct emac_rx_queue *rx_q, struct emac_rrd *rrd) in emac_rx_rfd_clean() argument
1058 u32 consume_idx = RRD_SI(rrd); in emac_rx_rfd_clean()
1061 for (i = 0; i < RRD_NOR(rrd); i++) { in emac_rx_rfd_clean()
1094 struct emac_rrd rrd; in emac_mac_rx_process() local
1101 num_consume_pkts = (hw_consume_idx >= rx_q->rrd.consume_idx) ? in emac_mac_rx_process()
1102 (hw_consume_idx - rx_q->rrd.consume_idx) : in emac_mac_rx_process()
1103 (hw_consume_idx + rx_q->rrd.count - rx_q->rrd.consume_idx); in emac_mac_rx_process()
1109 if (!emac_rx_process_rrd(adpt, rx_q, &rrd)) in emac_mac_rx_process()
1112 if (likely(RRD_NOR(&rrd) == 1)) { in emac_mac_rx_process()
1114 rfbuf = GET_RFD_BUFFER(rx_q, RRD_SI(&rrd)); in emac_mac_rx_process()
1125 emac_rx_rfd_clean(rx_q, &rrd); in emac_mac_rx_process()
1133 if (rrd.word[EMAC_RRD_STATS_DW_IDX] & EMAC_RRD_ERROR) { in emac_mac_rx_process()
1136 rrd.word[0], rrd.word[1], in emac_mac_rx_process()
1137 rrd.word[2], rrd.word[3]); in emac_mac_rx_process()
1143 skb_put(skb, RRD_PKT_SIZE(&rrd) - ETH_FCS_LEN); in emac_mac_rx_process()
1147 skb->ip_summed = RRD_L4F(&rrd) ? in emac_mac_rx_process()
1152 emac_receive_skb(rx_q, skb, (u16)RRD_CVALN_TAG(&rrd), in emac_mac_rx_process()
1153 (bool)RRD_CVTAG(&rrd)); in emac_mac_rx_process()