Commit ec823471 authored by Paul Barker's avatar Paul Barker Committed by Paolo Abeni

net: ravb: Fix R-Car RX frame size limit

The RX frame size limit should not be based on the current MTU setting.
Instead it should be based on the hardware capabilities.

While we're here, improve the description of the receive frame length
setting as suggested by Niklas.

Fixes: c156633f ("Renesas Ethernet AVB driver proper")
Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: default avatarPaul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 1d638642
...@@ -555,8 +555,16 @@ static void ravb_emac_init_gbeth(struct net_device *ndev) ...@@ -555,8 +555,16 @@ static void ravb_emac_init_gbeth(struct net_device *ndev)
static void ravb_emac_init_rcar(struct net_device *ndev) static void ravb_emac_init_rcar(struct net_device *ndev)
{ {
/* Receive frame limit set register */ struct ravb_private *priv = netdev_priv(ndev);
ravb_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, 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.
*/
ravb_write(ndev, priv->info->rx_max_frame_size + ETH_FCS_LEN, RFLR);
/* EMAC Mode: PAUSE prohibition; Duplex; RX Checksum; TX; RX */ /* EMAC Mode: PAUSE prohibition; Duplex; RX Checksum; TX; RX */
ravb_write(ndev, ECMR_ZPF | ECMR_DM | ravb_write(ndev, ECMR_ZPF | ECMR_DM |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment