Commit 978aded4 authored by Giuseppe CAVALLARO's avatar Giuseppe CAVALLARO Committed by David S. Miller

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: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4c75431a
...@@ -1637,6 +1637,12 @@ static int stmmac_hw_setup(struct net_device *dev) ...@@ -1637,6 +1637,12 @@ static int stmmac_hw_setup(struct net_device *dev)
/* Initialize the MAC Core */ /* Initialize the MAC Core */
priv->hw->mac->core_init(priv->hw, dev->mtu); priv->hw->mac->core_init(priv->hw, dev->mtu);
ret = priv->hw->mac->rx_ipc(priv->hw);
if (!ret) {
pr_warn(" RX IPC Checksum Offload disabled\n");
priv->plat->rx_coe = STMMAC_RX_COE_NONE;
}
/* Enable the MAC Rx/Tx */ /* Enable the MAC Rx/Tx */
stmmac_set_mac(priv->ioaddr, true); stmmac_set_mac(priv->ioaddr, true);
...@@ -2592,7 +2598,6 @@ static const struct net_device_ops stmmac_netdev_ops = { ...@@ -2592,7 +2598,6 @@ static const struct net_device_ops stmmac_netdev_ops = {
*/ */
static int stmmac_hw_init(struct stmmac_priv *priv) static int stmmac_hw_init(struct stmmac_priv *priv)
{ {
int ret;
struct mac_device_info *mac; struct mac_device_info *mac;
/* Identify the MAC HW device */ /* Identify the MAC HW device */
...@@ -2649,12 +2654,6 @@ static int stmmac_hw_init(struct stmmac_priv *priv) ...@@ -2649,12 +2654,6 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
/* To use alternate (extended) or normal descriptor structures */ /* To use alternate (extended) or normal descriptor structures */
stmmac_selec_desc_mode(priv); stmmac_selec_desc_mode(priv);
ret = priv->hw->mac->rx_ipc(priv->hw);
if (!ret) {
pr_warn(" RX IPC Checksum Offload not configured.\n");
priv->plat->rx_coe = STMMAC_RX_COE_NONE;
}
if (priv->plat->rx_coe) if (priv->plat->rx_coe)
pr_info(" RX Checksum Offload Engine supported (type %d)\n", pr_info(" RX Checksum Offload Engine supported (type %d)\n",
priv->plat->rx_coe); priv->plat->rx_coe);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment