Commit ba245652 authored by Remi Pommarel's avatar Remi Pommarel Committed by Greg Kroah-Hartman

net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used

[ Upstream commit b723bd93 ]

ACS (auto PAD/FCS stripping) removes FCS off 802.3 packets (LLC) so that
there is no need to manually strip it for such packets. The enhanced DMA
descriptors allow to flag LLC packets so that the receiving callback can
use that to strip FCS manually or not. On the other hand, normal
descriptors do not support that.

Thus in order to not truncate LLC packet ACS should be disabled when
using normal DMA descriptors.

Fixes: 47dd7a54 ("net: add support for STMicroelectronics Ethernet controllers.")
Signed-off-by: default avatarRemi Pommarel <repk@triplefau.lt>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 64fabf9b
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
static void dwmac1000_core_init(struct mac_device_info *hw, static void dwmac1000_core_init(struct mac_device_info *hw,
struct net_device *dev) struct net_device *dev)
{ {
struct stmmac_priv *priv = netdev_priv(dev);
void __iomem *ioaddr = hw->pcsr; void __iomem *ioaddr = hw->pcsr;
u32 value = readl(ioaddr + GMAC_CONTROL); u32 value = readl(ioaddr + GMAC_CONTROL);
int mtu = dev->mtu; int mtu = dev->mtu;
...@@ -45,7 +46,7 @@ static void dwmac1000_core_init(struct mac_device_info *hw, ...@@ -45,7 +46,7 @@ static void dwmac1000_core_init(struct mac_device_info *hw,
* Broadcom tags can look like invalid LLC/SNAP packets and cause the * Broadcom tags can look like invalid LLC/SNAP packets and cause the
* hardware to truncate packets on reception. * hardware to truncate packets on reception.
*/ */
if (netdev_uses_dsa(dev)) if (netdev_uses_dsa(dev) || !priv->plat->enh_desc)
value &= ~GMAC_CONTROL_ACS; value &= ~GMAC_CONTROL_ACS;
if (mtu > 1500) if (mtu > 1500)
......
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