diff options
author | Giuseppe CAVALLARO <peppe.cavallaro@st.com> | 2014-08-25 08:56:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-25 18:33:10 -0400 |
commit | 978aded4b39de7f441bb9bfb18cf830de6a968d3 (patch) | |
tree | 6929ae570f39992f0fcb96c6a65fbf22f057aef2 /drivers/net/ethernet/stmicro | |
parent | 4c75431ac3520631f1d9e74aa88407e6374dbbc4 (diff) |
stmmac: fix rx checksum programming
This patch is to fix the IPC bit into the GMAC control register
that must be done after the core initialization otherwise it will
not have any effect.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 08addd653728..51a89d4bb125 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -1637,6 +1637,12 @@ static int stmmac_hw_setup(struct net_device *dev) | |||
1637 | /* Initialize the MAC Core */ | 1637 | /* Initialize the MAC Core */ |
1638 | priv->hw->mac->core_init(priv->hw, dev->mtu); | 1638 | priv->hw->mac->core_init(priv->hw, dev->mtu); |
1639 | 1639 | ||
1640 | ret = priv->hw->mac->rx_ipc(priv->hw); | ||
1641 | if (!ret) { | ||
1642 | pr_warn(" RX IPC Checksum Offload disabled\n"); | ||
1643 | priv->plat->rx_coe = STMMAC_RX_COE_NONE; | ||
1644 | } | ||
1645 | |||
1640 | /* Enable the MAC Rx/Tx */ | 1646 | /* Enable the MAC Rx/Tx */ |
1641 | stmmac_set_mac(priv->ioaddr, true); | 1647 | stmmac_set_mac(priv->ioaddr, true); |
1642 | 1648 | ||
@@ -2592,7 +2598,6 @@ static const struct net_device_ops stmmac_netdev_ops = { | |||
2592 | */ | 2598 | */ |
2593 | static int stmmac_hw_init(struct stmmac_priv *priv) | 2599 | static int stmmac_hw_init(struct stmmac_priv *priv) |
2594 | { | 2600 | { |
2595 | int ret; | ||
2596 | struct mac_device_info *mac; | 2601 | struct mac_device_info *mac; |
2597 | 2602 | ||
2598 | /* Identify the MAC HW device */ | 2603 | /* Identify the MAC HW device */ |
@@ -2649,12 +2654,6 @@ static int stmmac_hw_init(struct stmmac_priv *priv) | |||
2649 | /* To use alternate (extended) or normal descriptor structures */ | 2654 | /* To use alternate (extended) or normal descriptor structures */ |
2650 | stmmac_selec_desc_mode(priv); | 2655 | stmmac_selec_desc_mode(priv); |
2651 | 2656 | ||
2652 | ret = priv->hw->mac->rx_ipc(priv->hw); | ||
2653 | if (!ret) { | ||
2654 | pr_warn(" RX IPC Checksum Offload not configured.\n"); | ||
2655 | priv->plat->rx_coe = STMMAC_RX_COE_NONE; | ||
2656 | } | ||
2657 | |||
2658 | if (priv->plat->rx_coe) | 2657 | if (priv->plat->rx_coe) |
2659 | pr_info(" RX Checksum Offload Engine supported (type %d)\n", | 2658 | pr_info(" RX Checksum Offload Engine supported (type %d)\n", |
2660 | priv->plat->rx_coe); | 2659 | priv->plat->rx_coe); |