aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>2013-06-12 21:15:45 -0400
committerDavid S. Miller <davem@davemloft.net>2013-06-13 06:02:32 -0400
commitdd019897358b815f7828dab90b51d51df4d3658d (patch)
tree57a29570fe3e6f47f845a396564b3bc7553e4387 /drivers/net/ethernet
parentd3b6f6141831b6e2d414edea6cc7af5b9bc6fac2 (diff)
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 <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index b4479b5aaee4..5e3982fc5398 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1401,16 +1401,23 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status)
1401 desc_status = edmac_to_cpu(mdp, rxdesc->status); 1401 desc_status = edmac_to_cpu(mdp, rxdesc->status);
1402 pkt_len = rxdesc->frame_length; 1402 pkt_len = rxdesc->frame_length;
1403 1403
1404#if defined(CONFIG_ARCH_R8A7740)
1405 desc_status >>= 16;
1406#endif
1407
1408 if (--boguscnt < 0) 1404 if (--boguscnt < 0)
1409 break; 1405 break;
1410 1406
1411 if (!(desc_status & RDFEND)) 1407 if (!(desc_status & RDFEND))
1412 ndev->stats.rx_length_errors++; 1408 ndev->stats.rx_length_errors++;
1413 1409
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
1414 if (desc_status & (RD_RFS1 | RD_RFS2 | RD_RFS3 | RD_RFS4 | 1421 if (desc_status & (RD_RFS1 | RD_RFS2 | RD_RFS3 | RD_RFS4 |
1415 RD_RFS5 | RD_RFS6 | RD_RFS10)) { 1422 RD_RFS5 | RD_RFS6 | RD_RFS10)) {
1416 ndev->stats.rx_errors++; 1423 ndev->stats.rx_errors++;