ravb: Use the max frame size from hardware info for RZ/G2L
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Mon, 4 Mar 2024 11:08:56 +0000 (12:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Mar 2024 11:23:21 +0000 (11:23 +0000)
Remove the define describing the RZ/G2L maximum frame size and only use
the information in the hardware information struct. This will make it
easier to merge the R-Car and RZ/G2L code paths.

There is no functional change as both the define and the maximum frame
length in the hardware information is set to 8K.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/ravb.h
drivers/net/ethernet/renesas/ravb_main.c

index 751bb29cd48885a8d63a2331a1e1255640d066f5..7fa60fccb6ea9be73a6db53c94959cbc70ccad6c 100644 (file)
@@ -1017,7 +1017,6 @@ enum CSR2_BIT {
 
 #define RX_BUF_SZ      (2048 - ETH_FCS_LEN + sizeof(__sum16))
 
-#define GBETH_RX_BUFF_MAX 8192
 #define GBETH_RX_DESC_DATA_SIZE 4080
 
 struct ravb_tstamp_skb {
index e6b0250588472e4b98e433a8fc2c52c316336145..45383635e8e296f336552c4f2410af42167a31e7 100644 (file)
@@ -568,7 +568,7 @@ static void ravb_emac_init_gbeth(struct net_device *ndev)
        }
 
        /* Receive frame limit set register */
-       ravb_write(ndev, GBETH_RX_BUFF_MAX + ETH_FCS_LEN, RFLR);
+       ravb_write(ndev, priv->info->rx_max_frame_size + ETH_FCS_LEN, RFLR);
 
        /* EMAC Mode: PAUSE prohibition; Duplex; TX; RX; CRC Pass Through */
        ravb_write(ndev, ECMR_ZPF | ((priv->duplex > 0) ? ECMR_DM : 0) |
@@ -629,6 +629,7 @@ static void ravb_emac_init(struct net_device *ndev)
 
 static int ravb_dmac_init_gbeth(struct net_device *ndev)
 {
+       struct ravb_private *priv = netdev_priv(ndev);
        int error;
 
        error = ravb_ring_init(ndev, RAVB_BE);
@@ -642,7 +643,7 @@ static int ravb_dmac_init_gbeth(struct net_device *ndev)
        ravb_write(ndev, 0x60000000, RCR);
 
        /* Set Max Frame Length (RTC) */
-       ravb_write(ndev, 0x7ffc0000 | GBETH_RX_BUFF_MAX, RTC);
+       ravb_write(ndev, 0x7ffc0000 | priv->info->rx_max_frame_size, RTC);
 
        /* Set FIFO size */
        ravb_write(ndev, 0x00222200, TGC);