Commit 06144dcf authored by Philippe Reynes's avatar Philippe Reynes Committed by David S. Miller

net: usb: r8152: 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.

As I don't have the hardware, I'd be very pleased if
someone may test this patch.
Signed-off-by: default avatarPhilippe Reynes <tremyfr@gmail.com>
Acked-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent de1e98c6
...@@ -3800,7 +3800,8 @@ static void rtl8152_get_drvinfo(struct net_device *netdev, ...@@ -3800,7 +3800,8 @@ static void rtl8152_get_drvinfo(struct net_device *netdev,
} }
static static
int rtl8152_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd) int rtl8152_get_link_ksettings(struct net_device *netdev,
struct ethtool_link_ksettings *cmd)
{ {
struct r8152 *tp = netdev_priv(netdev); struct r8152 *tp = netdev_priv(netdev);
int ret; int ret;
...@@ -3814,7 +3815,7 @@ int rtl8152_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd) ...@@ -3814,7 +3815,7 @@ int rtl8152_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
mutex_lock(&tp->control); mutex_lock(&tp->control);
ret = mii_ethtool_gset(&tp->mii, cmd); ret = mii_ethtool_get_link_ksettings(&tp->mii, cmd);
mutex_unlock(&tp->control); mutex_unlock(&tp->control);
...@@ -3824,7 +3825,8 @@ int rtl8152_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd) ...@@ -3824,7 +3825,8 @@ int rtl8152_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
return ret; return ret;
} }
static int rtl8152_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) static int rtl8152_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{ {
struct r8152 *tp = netdev_priv(dev); struct r8152 *tp = netdev_priv(dev);
int ret; int ret;
...@@ -3835,11 +3837,12 @@ static int rtl8152_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -3835,11 +3837,12 @@ static int rtl8152_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
mutex_lock(&tp->control); mutex_lock(&tp->control);
ret = rtl8152_set_speed(tp, cmd->autoneg, cmd->speed, cmd->duplex); ret = rtl8152_set_speed(tp, cmd->base.autoneg, cmd->base.speed,
cmd->base.duplex);
if (!ret) { if (!ret) {
tp->autoneg = cmd->autoneg; tp->autoneg = cmd->base.autoneg;
tp->speed = cmd->speed; tp->speed = cmd->base.speed;
tp->duplex = cmd->duplex; tp->duplex = cmd->base.duplex;
} }
mutex_unlock(&tp->control); mutex_unlock(&tp->control);
...@@ -4117,8 +4120,6 @@ static int rtl8152_set_coalesce(struct net_device *netdev, ...@@ -4117,8 +4120,6 @@ static int rtl8152_set_coalesce(struct net_device *netdev,
static const struct ethtool_ops ops = { static const struct ethtool_ops ops = {
.get_drvinfo = rtl8152_get_drvinfo, .get_drvinfo = rtl8152_get_drvinfo,
.get_settings = rtl8152_get_settings,
.set_settings = rtl8152_set_settings,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.nway_reset = rtl8152_nway_reset, .nway_reset = rtl8152_nway_reset,
.get_msglevel = rtl8152_get_msglevel, .get_msglevel = rtl8152_get_msglevel,
...@@ -4132,6 +4133,8 @@ static const struct ethtool_ops ops = { ...@@ -4132,6 +4133,8 @@ static const struct ethtool_ops ops = {
.set_coalesce = rtl8152_set_coalesce, .set_coalesce = rtl8152_set_coalesce,
.get_eee = rtl_ethtool_get_eee, .get_eee = rtl_ethtool_get_eee,
.set_eee = rtl_ethtool_set_eee, .set_eee = rtl_ethtool_set_eee,
.get_link_ksettings = rtl8152_get_link_ksettings,
.set_link_ksettings = rtl8152_set_link_ksettings,
}; };
static int rtl8152_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) static int rtl8152_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment