Skip to content

Commit dd01989

Browse files
shimodaydavem330
authored andcommitted
net: sh_eth: fix incorrect RX length error if R8A7740
This patch fixes an issue that the driver increments the "RX length error" on every buffer in sh_eth_rx() if the R8A7740. This patch also adds a description about the Receive Frame Status bits. Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d3b6f61 commit dd01989

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

drivers/net/ethernet/renesas/sh_eth.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,16 +1401,23 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status)
14011401
desc_status = edmac_to_cpu(mdp, rxdesc->status);
14021402
pkt_len = rxdesc->frame_length;
14031403

1404-
#if defined(CONFIG_ARCH_R8A7740)
1405-
desc_status >>= 16;
1406-
#endif
1407-
14081404
if (--boguscnt < 0)
14091405
break;
14101406

14111407
if (!(desc_status & RDFEND))
14121408
ndev->stats.rx_length_errors++;
14131409

1410+
#if defined(CONFIG_ARCH_R8A7740)
1411+
/*
1412+
* In case of almost all GETHER/ETHERs, the Receive Frame State
1413+
* (RFS) bits in the Receive Descriptor 0 are from bit 9 to
1414+
* bit 0. However, in case of the R8A7740's GETHER, the RFS
1415+
* bits are from bit 25 to bit 16. So, the driver needs right
1416+
* shifting by 16.
1417+
*/
1418+
desc_status >>= 16;
1419+
#endif
1420+
14141421
if (desc_status & (RD_RFS1 | RD_RFS2 | RD_RFS3 | RD_RFS4 |
14151422
RD_RFS5 | RD_RFS6 | RD_RFS10)) {
14161423
ndev->stats.rx_errors++;

0 commit comments

Comments
 (0)