summaryrefslogtreecommitdiff
path: root/drivers/net/ravb.c
diff options
context:
space:
mode:
authorPaul Barker <paul.barker.ct@bp.renesas.com>2025-03-04 20:07:08 +0000
committerMarek Vasut <marek.vasut+renesas@mailbox.org>2025-03-11 23:06:18 +0100
commit4226433858318be5914688963436ad41cbe2298d (patch)
tree8b3ab8769abbc9c1df2aed22ec3666be405161c8 /drivers/net/ravb.c
parent78e15e2dd9ca79a2dd8c821197ddd8239f09e753 (diff)
net: ravb: Fix RX frame size limit
The value written to the RFLR register includes the length of the CRC data at the end of each Ethernet frame. So we need to increase the value written to this register to ensure that we can receive full size frames. While we're here we can also copy the improved comment from the Linux kernel. Fixes: 8ae51b6f324e ("net: ravb: Add Renesas Ethernet RAVB driver") Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # Fix comment Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Diffstat (limited to 'drivers/net/ravb.c')
-rw-r--r--drivers/net/ravb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
index 6129929568a..c39bef17b79 100644
--- a/drivers/net/ravb.c
+++ b/drivers/net/ravb.c
@@ -354,8 +354,15 @@ static int ravb_mac_init(struct ravb_priv *eth)
/* Disable MAC Interrupt */
writel(0, eth->iobase + RAVB_REG_ECSIPR);
- /* Recv frame limit set register */
- writel(RFLR_RFL_MIN, eth->iobase + RAVB_REG_RFLR);
+ /*
+ * Set receive frame length
+ *
+ * The length set here describes the frame from the destination address
+ * up to and including the CRC data. However only the frame data,
+ * excluding the CRC, are transferred to memory. To allow for the
+ * largest frames add the CRC length to the maximum Rx descriptor size.
+ */
+ writel(RFLR_RFL_MIN + ETH_FCS_LEN, eth->iobase + RAVB_REG_RFLR);
return 0;
}