提交 01cd7d57 编写于 作者: M Max Filippov 提交者: David S. Miller

net: ethoc: implement ethtool get/set settings

Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
Reviewed-by: NBen Hutchings <ben@decadent.org.uk>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 fba9110c
......@@ -890,7 +890,31 @@ static netdev_tx_t ethoc_start_xmit(struct sk_buff *skb, struct net_device *dev)
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,
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册