lantiq: fix xrx200 switch carrier state
[openwrt/staging/chunkeey.git] / target / linux / lantiq / patches-4.9 / 0025-NET-MIPS-lantiq-adds-xrx200-net.patch
index 871176449cdcc3b07dab72df0894931971be697d..5224e7a00bd3f709977064e9a875f9b25de37d22 100644 (file)
@@ -209,7 +209,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +};
 --- /dev/null
 +++ b/drivers/net/ethernet/lantiq_xrx200.c
-@@ -0,0 +1,1852 @@
+@@ -0,0 +1,1851 @@
 +/*
 + *   This program is free software; you can redistribute it and/or modify it
 + *   under the terms of the GNU General Public License version 2 as published
@@ -1460,7 +1460,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +static void xrx200_mdio_link(struct net_device *dev)
 +{
 +      struct xrx200_priv *priv = netdev_priv(dev);
-+      bool changed = false, link = false;
++      bool link = false;
 +      int i;
 +
 +      for (i = 0; i < priv->num_port; i++) {
@@ -1471,7 +1471,6 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +                      link = true;
 +
 +              if (priv->port[i].link != priv->port[i].phydev->link) {
-+                      changed = true;
 +                      xrx200_gmac_update(&priv->port[i]);
 +                      priv->port[i].link = priv->port[i].phydev->link;
 +                      netdev_info(dev, "port %d %s link\n",
@@ -1479,7 +1478,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +                              (priv->port[i].link)?("got"):("lost"));
 +              }
 +      }
-+      if (changed && !link)
++      if (netif_carrier_ok(dev) && !link)
 +              netif_carrier_off(dev);
 +}
 +