diff options
Diffstat (limited to 'drivers/net/ethernet/renesas/sh_eth.c')
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 42e9dd05c936..5e3982fc5398 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -897,8 +897,8 @@ static int sh_eth_check_reset(struct net_device *ndev) | |||
897 | mdelay(1); | 897 | mdelay(1); |
898 | cnt--; | 898 | cnt--; |
899 | } | 899 | } |
900 | if (cnt < 0) { | 900 | if (cnt <= 0) { |
901 | pr_err("Device reset fail\n"); | 901 | pr_err("Device reset failed\n"); |
902 | ret = -ETIMEDOUT; | 902 | ret = -ETIMEDOUT; |
903 | } | 903 | } |
904 | return ret; | 904 | return ret; |
@@ -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++; |