sfc: remove phy_op indirection
[linux-2.6-microblaze.git] / drivers / net / ethernet / sfc / ethtool_common.c
index 05ac878..622a72e 100644 (file)
@@ -15,6 +15,7 @@
 #include "selftest.h"
 #include "rx_common.h"
 #include "ethtool_common.h"
+#include "mcdi_port_common.h"
 
 struct efx_sw_stat_desc {
        const char *name;
@@ -221,7 +222,7 @@ int efx_ethtool_set_pauseparam(struct net_device *net_dev,
        efx_link_set_wanted_fc(efx, wanted_fc);
        if (efx->link_advertising[0] != old_adv ||
            (efx->wanted_fc ^ old_fc) & EFX_FC_AUTO) {
-               rc = efx->phy_op->reconfigure(efx);
+               rc = efx_mcdi_port_reconfigure(efx);
                if (rc) {
                        netif_err(efx, drv, efx->net_dev,
                                  "Unable to advertise requested flow "
@@ -372,20 +373,15 @@ int efx_ethtool_fill_self_tests(struct efx_nic *efx,
        efx_fill_test(n++, strings, data, &tests->registers,
                      "core", 0, "registers", NULL);
 
-       if (efx->phy_op->run_tests != NULL) {
-               EFX_WARN_ON_PARANOID(efx->phy_op->test_name == NULL);
+       for (i = 0; true; ++i) {
+               const char *name;
 
-               for (i = 0; true; ++i) {
-                       const char *name;
-
-                       EFX_WARN_ON_PARANOID(i >= EFX_MAX_PHY_TESTS);
-                       name = efx->phy_op->test_name(efx, i);
-                       if (name == NULL)
-                               break;
+               EFX_WARN_ON_PARANOID(i >= EFX_MAX_PHY_TESTS);
+               name = efx_mcdi_phy_test_name(efx, i);
+               if (name == NULL)
+                       break;
 
-                       efx_fill_test(n++, strings, data, &tests->phy_ext[i],
-                                     "phy", 0, name, NULL);
-               }
+               efx_fill_test(n++, strings, data, &tests->phy_ext[i], "phy", 0, name, NULL);
        }
 
        /* Loopback tests */
@@ -571,7 +567,7 @@ int efx_ethtool_get_link_ksettings(struct net_device *net_dev,
        u32 supported;
 
        mutex_lock(&efx->mac_lock);
-       efx->phy_op->get_link_ksettings(efx, cmd);
+       efx_mcdi_phy_get_link_ksettings(efx, cmd);
        mutex_unlock(&efx->mac_lock);
 
        /* Both MACs support pause frames (bidirectional and respond-only) */
@@ -607,7 +603,7 @@ int efx_ethtool_set_link_ksettings(struct net_device *net_dev,
        }
 
        mutex_lock(&efx->mac_lock);
-       rc = efx->phy_op->set_link_ksettings(efx, cmd);
+       rc = efx_mcdi_phy_set_link_ksettings(efx, cmd);
        mutex_unlock(&efx->mac_lock);
        return rc;
 }
@@ -618,10 +614,8 @@ int efx_ethtool_get_fecparam(struct net_device *net_dev,
        struct efx_nic *efx = netdev_priv(net_dev);
        int rc;
 
-       if (!efx->phy_op || !efx->phy_op->get_fecparam)
-               return -EOPNOTSUPP;
        mutex_lock(&efx->mac_lock);
-       rc = efx->phy_op->get_fecparam(efx, fecparam);
+       rc = efx_mcdi_phy_get_fecparam(efx, fecparam);
        mutex_unlock(&efx->mac_lock);
 
        return rc;
@@ -633,10 +627,8 @@ int efx_ethtool_set_fecparam(struct net_device *net_dev,
        struct efx_nic *efx = netdev_priv(net_dev);
        int rc;
 
-       if (!efx->phy_op || !efx->phy_op->get_fecparam)
-               return -EOPNOTSUPP;
        mutex_lock(&efx->mac_lock);
-       rc = efx->phy_op->set_fecparam(efx, fecparam);
+       rc = efx_mcdi_phy_set_fecparam(efx, fecparam);
        mutex_unlock(&efx->mac_lock);
 
        return rc;
@@ -1332,11 +1324,8 @@ int efx_ethtool_get_module_eeprom(struct net_device *net_dev,
        struct efx_nic *efx = netdev_priv(net_dev);
        int ret;
 
-       if (!efx->phy_op || !efx->phy_op->get_module_eeprom)
-               return -EOPNOTSUPP;
-
        mutex_lock(&efx->mac_lock);
-       ret = efx->phy_op->get_module_eeprom(efx, ee, data);
+       ret = efx_mcdi_phy_get_module_eeprom(efx, ee, data);
        mutex_unlock(&efx->mac_lock);
 
        return ret;
@@ -1348,11 +1337,8 @@ int efx_ethtool_get_module_info(struct net_device *net_dev,
        struct efx_nic *efx = netdev_priv(net_dev);
        int ret;
 
-       if (!efx->phy_op || !efx->phy_op->get_module_info)
-               return -EOPNOTSUPP;
-
        mutex_lock(&efx->mac_lock);
-       ret = efx->phy_op->get_module_info(efx, modinfo);
+       ret = efx_mcdi_phy_get_module_info(efx, modinfo);
        mutex_unlock(&efx->mac_lock);
 
        return ret;