drivers: net: xgene: Enable MDIO driver
authorIyappan Subramanian <isubramanian@apm.com>
Tue, 26 Jul 2016 00:12:42 +0000 (17:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Jul 2016 04:51:43 +0000 (21:51 -0700)
This patch enables MDIO driver by,

- Selecting MDIO_XGENE
- Changed open and close to use phy_start and phy_stop
- Changed to use mac_ops->tx(rx)_enable and tx(rx)_disable

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Tested-by: Fushen Chen <fchen@apm.com>
Tested-by: Toan Le <toanle@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/apm/xgene/Kconfig
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
drivers/net/ethernet/apm/xgene/xgene_enet_main.c

index 19e38afbc5ee3f5a015fd55ecba813c26a9bca1a..300e3b5c54e0c4ed140e7098b27846a41dc85d91 100644 (file)
@@ -3,6 +3,7 @@ config NET_XGENE
        depends on HAS_DMA
        depends on ARCH_XGENE || COMPILE_TEST
        select PHYLIB
+       select MDIO_XGENE
        help
          This is the Ethernet driver for the on-chip ethernet interface on the
          APM X-Gene SoC.
index b8b643f2736168951c665ff63f05b828799d348c..27a7a1c960e03c0dae1efb3b4354f8cb2c7bfdbf 100644 (file)
@@ -794,13 +794,13 @@ static void xgene_enet_adjust_link(struct net_device *ndev)
                if (pdata->phy_speed != phydev->speed) {
                        pdata->phy_speed = phydev->speed;
                        mac_ops->set_speed(pdata);
-                       xgene_gmac_rx_enable(pdata);
-                       xgene_gmac_tx_enable(pdata);
+                       mac_ops->rx_enable(pdata);
+                       mac_ops->tx_enable(pdata);
                        phy_print_status(phydev);
                }
        } else {
-               xgene_gmac_rx_disable(pdata);
-               xgene_gmac_tx_disable(pdata);
+               mac_ops->rx_disable(pdata);
+               mac_ops->tx_disable(pdata);
                pdata->phy_speed = SPEED_UNKNOWN;
                phy_print_status(phydev);
        }
index 639833729d0a0028bc2480f2af7e46cdb4b23cfc..d1d6b5eeb613e6b3737b0792fd44bc645b348f6a 100644 (file)
@@ -739,9 +739,9 @@ static int xgene_enet_open(struct net_device *ndev)
        if (ret)
                return ret;
 
-       if (pdata->phy_mode == PHY_INTERFACE_MODE_RGMII)
+       if (pdata->phy_dev) {
                phy_start(pdata->phy_dev);
-       else {
+       else {
                schedule_delayed_work(&pdata->link_work, PHY_POLL_LINK_OFF);
                netif_carrier_off(ndev);
        }