提交 29ccc49d 编写于 作者: P Philippe Reynes 提交者: David S. Miller

net: tun: use new api ethtool_{get|set}_link_ksettings

The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.
Signed-off-by: NPhilippe Reynes <tremyfr@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a062d19e
...@@ -2430,18 +2430,16 @@ static struct miscdevice tun_miscdev = { ...@@ -2430,18 +2430,16 @@ static struct miscdevice tun_miscdev = {
/* ethtool interface */ /* ethtool interface */
static int tun_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) static int tun_get_link_ksettings(struct net_device *dev,
{ struct ethtool_link_ksettings *cmd)
cmd->supported = 0; {
cmd->advertising = 0; ethtool_link_ksettings_zero_link_mode(cmd, supported);
ethtool_cmd_speed_set(cmd, SPEED_10); ethtool_link_ksettings_zero_link_mode(cmd, advertising);
cmd->duplex = DUPLEX_FULL; cmd->base.speed = SPEED_10;
cmd->port = PORT_TP; cmd->base.duplex = DUPLEX_FULL;
cmd->phy_address = 0; cmd->base.port = PORT_TP;
cmd->transceiver = XCVR_INTERNAL; cmd->base.phy_address = 0;
cmd->autoneg = AUTONEG_DISABLE; cmd->base.autoneg = AUTONEG_DISABLE;
cmd->maxtxpkt = 0;
cmd->maxrxpkt = 0;
return 0; return 0;
} }
...@@ -2504,7 +2502,6 @@ static int tun_set_coalesce(struct net_device *dev, ...@@ -2504,7 +2502,6 @@ static int tun_set_coalesce(struct net_device *dev,
} }
static const struct ethtool_ops tun_ethtool_ops = { static const struct ethtool_ops tun_ethtool_ops = {
.get_settings = tun_get_settings,
.get_drvinfo = tun_get_drvinfo, .get_drvinfo = tun_get_drvinfo,
.get_msglevel = tun_get_msglevel, .get_msglevel = tun_get_msglevel,
.set_msglevel = tun_set_msglevel, .set_msglevel = tun_set_msglevel,
...@@ -2512,6 +2509,7 @@ static const struct ethtool_ops tun_ethtool_ops = { ...@@ -2512,6 +2509,7 @@ static const struct ethtool_ops tun_ethtool_ops = {
.get_ts_info = ethtool_op_get_ts_info, .get_ts_info = ethtool_op_get_ts_info,
.get_coalesce = tun_get_coalesce, .get_coalesce = tun_get_coalesce,
.set_coalesce = tun_set_coalesce, .set_coalesce = tun_set_coalesce,
.get_link_ksettings = tun_get_link_ksettings,
}; };
static int tun_queue_resize(struct tun_struct *tun) static int tun_queue_resize(struct tun_struct *tun)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册