0102-net-mediatek-v4.4-backports.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From c1ff5519a7fd849da5d169036d8175383f807962 Mon Sep 17 00:00:00 2001
  2. From: John Crispin <blogic@openwrt.org>
  3. Date: Mon, 11 Apr 2016 06:00:23 +0200
  4. Subject: [PATCH 102/102] net: mediatek: v4.4 backports
  5. ---
  6. drivers/net/ethernet/mediatek/mtk_eth_soc.c | 13 ++++++++-----
  7. 1 file changed, 8 insertions(+), 5 deletions(-)
  8. --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  9. +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  10. @@ -217,7 +217,7 @@ static int mtk_phy_connect_node(struct m
  11. dev_info(eth->dev,
  12. "connected mac %d to PHY at %s [uid=%08x, driver=%s]\n",
  13. - mac->id, phydev_name(phydev), phydev->phy_id,
  14. + mac->id, dev_name(&phydev->dev), phydev->phy_id,
  15. phydev->drv->name);
  16. mac->phy_dev = phydev;
  17. @@ -1396,6 +1396,7 @@ static int mtk_stop(struct net_device *d
  18. struct mtk_mac *mac = netdev_priv(dev);
  19. struct mtk_eth *eth = mac->hw;
  20. + netif_carrier_off(dev);
  21. netif_tx_disable(dev);
  22. phy_stop(mac->phy_dev);
  23. @@ -1595,11 +1596,13 @@ static int mtk_set_settings(struct net_d
  24. {
  25. struct mtk_mac *mac = netdev_priv(dev);
  26. - if (cmd->phy_address != mac->phy_dev->mdio.addr) {
  27. - mac->phy_dev = mdiobus_get_phy(mac->hw->mii_bus,
  28. - cmd->phy_address);
  29. - if (!mac->phy_dev)
  30. + if (cmd->phy_address != mac->phy_dev->addr) {
  31. + if (mac->hw->mii_bus->phy_map[cmd->phy_address]) {
  32. + mac->phy_dev =
  33. + mac->hw->mii_bus->phy_map[cmd->phy_address];
  34. + } else {
  35. return -ENODEV;
  36. + }
  37. }
  38. return phy_ethtool_sset(mac->phy_dev, cmd);