net: ethoc: implement ethtool get/set settings
authorMax Filippov <jcmvbkbc@gmail.com>
Fri, 31 Jan 2014 05:41:05 +0000 (09:41 +0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 2 Feb 2014 00:56:48 +0000 (16:56 -0800)
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ethoc.c

index 0623c20131bb8d6eba4f48a4ddfc9557d9650449..779d3c386ea727df456d011ab4d1d3b4f1c09302 100644 (file)
@@ -890,7 +890,31 @@ out:
        return NETDEV_TX_OK;
 }
 
+static int ethoc_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+       struct ethoc *priv = netdev_priv(dev);
+       struct phy_device *phydev = priv->phy;
+
+       if (!phydev)
+               return -EOPNOTSUPP;
+
+       return phy_ethtool_gset(phydev, cmd);
+}
+
+static int ethoc_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+       struct ethoc *priv = netdev_priv(dev);
+       struct phy_device *phydev = priv->phy;
+
+       if (!phydev)
+               return -EOPNOTSUPP;
+
+       return phy_ethtool_sset(phydev, cmd);
+}
+
 const struct ethtool_ops ethoc_ethtool_ops = {
+       .get_settings = ethoc_get_settings,
+       .set_settings = ethoc_set_settings,
        .get_link = ethtool_op_get_link,
        .get_ts_info = ethtool_op_get_ts_info,
 };