Commit b6e13aea authored by David S. Miller's avatar David S. Miller

Merge branch 'usbnet-ksettings'

Philippe Reynes says:

====================
net: usbnet: move to new api ethtool_{get|set}_link_ksettings

The ethtool api {get|set}_settings is deprecated. On usbnet, it
was often implemented with usbnet_{get|set}_settings.

In this series, I add usbnet_{get|set}_link_ksettings
in the first patch, then I update all the driver to
use this new api, and in the last patch I remove the
old api usbnet_{get|set}_settings.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 37a30b43 bde87ad6
......@@ -136,9 +136,9 @@ static const struct ethtool_ops ax88172_ethtool_ops = {
.get_eeprom_len = asix_get_eeprom_len,
.get_eeprom = asix_get_eeprom,
.set_eeprom = asix_set_eeprom,
.get_settings = usbnet_get_settings,
.set_settings = usbnet_set_settings,
.nway_reset = usbnet_nway_reset,
.get_link_ksettings = usbnet_get_link_ksettings,
.set_link_ksettings = usbnet_set_link_ksettings,
};
static void ax88172_set_multicast(struct net_device *net)
......@@ -301,9 +301,9 @@ static const struct ethtool_ops ax88772_ethtool_ops = {
.get_eeprom_len = asix_get_eeprom_len,
.get_eeprom = asix_get_eeprom,
.set_eeprom = asix_set_eeprom,
.get_settings = usbnet_get_settings,
.set_settings = usbnet_set_settings,
.nway_reset = usbnet_nway_reset,
.get_link_ksettings = usbnet_get_link_ksettings,
.set_link_ksettings = usbnet_set_link_ksettings,
};
static int ax88772_link_reset(struct usbnet *dev)
......@@ -775,9 +775,9 @@ static const struct ethtool_ops ax88178_ethtool_ops = {
.get_eeprom_len = asix_get_eeprom_len,
.get_eeprom = asix_get_eeprom,
.set_eeprom = asix_set_eeprom,
.get_settings = usbnet_get_settings,
.set_settings = usbnet_set_settings,
.nway_reset = usbnet_nway_reset,
.get_link_ksettings = usbnet_get_link_ksettings,
.set_link_ksettings = usbnet_set_link_ksettings,
};
static int marvell_phy_init(struct usbnet *dev)
......
......@@ -131,8 +131,6 @@ static void cdc_ncm_get_strings(struct net_device __always_unused *netdev, u32 s
static void cdc_ncm_update_rxtx_max(struct usbnet *dev, u32 new_rx, u32 new_tx);
static const struct ethtool_ops cdc_ncm_ethtool_ops = {
.get_settings = usbnet_get_settings,
.set_settings = usbnet_set_settings,
.get_link = usbnet_get_link,
.nway_reset = usbnet_nway_reset,
.get_drvinfo = usbnet_get_drvinfo,
......@@ -142,6 +140,8 @@ static const struct ethtool_ops cdc_ncm_ethtool_ops = {
.get_sset_count = cdc_ncm_get_sset_count,
.get_strings = cdc_ncm_get_strings,
.get_ethtool_stats = cdc_ncm_get_ethtool_stats,
.get_link_ksettings = usbnet_get_link_ksettings,
.set_link_ksettings = usbnet_set_link_ksettings,
};
static u32 cdc_ncm_check_rx_max(struct usbnet *dev, u32 new_rx)
......
......@@ -281,9 +281,9 @@ static const struct ethtool_ops dm9601_ethtool_ops = {
.set_msglevel = usbnet_set_msglevel,
.get_eeprom_len = dm9601_get_eeprom_len,
.get_eeprom = dm9601_get_eeprom,
.get_settings = usbnet_get_settings,
.set_settings = usbnet_set_settings,
.nway_reset = usbnet_nway_reset,
.get_link_ksettings = usbnet_get_link_ksettings,
.set_link_ksettings = usbnet_set_link_ksettings,
};
static void dm9601_set_multicast(struct net_device *net)
......
......@@ -464,9 +464,9 @@ static const struct ethtool_ops mcs7830_ethtool_ops = {
.get_link = usbnet_get_link,
.get_msglevel = usbnet_get_msglevel,
.set_msglevel = usbnet_set_msglevel,
.get_settings = usbnet_get_settings,
.set_settings = usbnet_set_settings,
.nway_reset = usbnet_nway_reset,
.get_link_ksettings = usbnet_get_link_ksettings,
.set_link_ksettings = usbnet_set_link_ksettings,
};
static const struct net_device_ops mcs7830_netdev_ops = {
......
......@@ -648,9 +648,9 @@ static const struct ethtool_ops sierra_net_ethtool_ops = {
.get_link = sierra_net_get_link,
.get_msglevel = usbnet_get_msglevel,
.set_msglevel = usbnet_set_msglevel,
.get_settings = usbnet_get_settings,
.set_settings = usbnet_set_settings,
.nway_reset = usbnet_nway_reset,
.get_link_ksettings = usbnet_get_link_ksettings,
.set_link_ksettings = usbnet_set_link_ksettings,
};
static int sierra_net_get_fw_attr(struct usbnet *dev, u16 *datap)
......
......@@ -743,13 +743,13 @@ static const struct ethtool_ops smsc75xx_ethtool_ops = {
.get_drvinfo = usbnet_get_drvinfo,
.get_msglevel = usbnet_get_msglevel,
.set_msglevel = usbnet_set_msglevel,
.get_settings = usbnet_get_settings,
.set_settings = usbnet_set_settings,
.get_eeprom_len = smsc75xx_ethtool_get_eeprom_len,
.get_eeprom = smsc75xx_ethtool_get_eeprom,
.set_eeprom = smsc75xx_ethtool_set_eeprom,
.get_wol = smsc75xx_ethtool_get_wol,
.set_wol = smsc75xx_ethtool_set_wol,
.get_link_ksettings = usbnet_get_link_ksettings,
.set_link_ksettings = usbnet_set_link_ksettings,
};
static int smsc75xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
......
......@@ -853,32 +853,32 @@ static void set_mdix_status(struct net_device *net, __u8 mdix_ctrl)
pdata->mdix_ctrl = mdix_ctrl;
}
static int smsc95xx_get_settings(struct net_device *net,
struct ethtool_cmd *cmd)
static int smsc95xx_get_link_ksettings(struct net_device *net,
struct ethtool_link_ksettings *cmd)
{
struct usbnet *dev = netdev_priv(net);
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
int retval;
retval = usbnet_get_settings(net, cmd);
retval = usbnet_get_link_ksettings(net, cmd);
cmd->eth_tp_mdix = pdata->mdix_ctrl;
cmd->eth_tp_mdix_ctrl = pdata->mdix_ctrl;
cmd->base.eth_tp_mdix = pdata->mdix_ctrl;
cmd->base.eth_tp_mdix_ctrl = pdata->mdix_ctrl;
return retval;
}
static int smsc95xx_set_settings(struct net_device *net,
struct ethtool_cmd *cmd)
static int smsc95xx_set_link_ksettings(struct net_device *net,
const struct ethtool_link_ksettings *cmd)
{
struct usbnet *dev = netdev_priv(net);
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
int retval;
if (pdata->mdix_ctrl != cmd->eth_tp_mdix_ctrl)
set_mdix_status(net, cmd->eth_tp_mdix_ctrl);
if (pdata->mdix_ctrl != cmd->base.eth_tp_mdix_ctrl)
set_mdix_status(net, cmd->base.eth_tp_mdix_ctrl);
retval = usbnet_set_settings(net, cmd);
retval = usbnet_set_link_ksettings(net, cmd);
return retval;
}
......@@ -889,8 +889,6 @@ static const struct ethtool_ops smsc95xx_ethtool_ops = {
.get_drvinfo = usbnet_get_drvinfo,
.get_msglevel = usbnet_get_msglevel,
.set_msglevel = usbnet_set_msglevel,
.get_settings = smsc95xx_get_settings,
.set_settings = smsc95xx_set_settings,
.get_eeprom_len = smsc95xx_ethtool_get_eeprom_len,
.get_eeprom = smsc95xx_ethtool_get_eeprom,
.set_eeprom = smsc95xx_ethtool_set_eeprom,
......@@ -898,6 +896,8 @@ static const struct ethtool_ops smsc95xx_ethtool_ops = {
.get_regs = smsc95xx_ethtool_getregs,
.get_wol = smsc95xx_ethtool_get_wol,
.set_wol = smsc95xx_ethtool_set_wol,
.get_link_ksettings = smsc95xx_get_link_ksettings,
.set_link_ksettings = smsc95xx_set_link_ksettings,
};
static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
......
......@@ -249,9 +249,9 @@ static const struct ethtool_ops sr9700_ethtool_ops = {
.set_msglevel = usbnet_set_msglevel,
.get_eeprom_len = sr9700_get_eeprom_len,
.get_eeprom = sr9700_get_eeprom,
.get_settings = usbnet_get_settings,
.set_settings = usbnet_set_settings,
.nway_reset = usbnet_nway_reset,
.get_link_ksettings = usbnet_get_link_ksettings,
.set_link_ksettings = usbnet_set_link_ksettings,
};
static void sr9700_set_multicast(struct net_device *netdev)
......
......@@ -524,9 +524,9 @@ static const struct ethtool_ops sr9800_ethtool_ops = {
.set_wol = sr_set_wol,
.get_eeprom_len = sr_get_eeprom_len,
.get_eeprom = sr_get_eeprom,
.get_settings = usbnet_get_settings,
.set_settings = usbnet_set_settings,
.nway_reset = usbnet_nway_reset,
.get_link_ksettings = usbnet_get_link_ksettings,
.set_link_ksettings = usbnet_set_link_ksettings,
};
static int sr9800_link_reset(struct usbnet *dev)
......
......@@ -947,18 +947,20 @@ EXPORT_SYMBOL_GPL(usbnet_open);
* they'll probably want to use this base set.
*/
int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd)
int usbnet_get_link_ksettings(struct net_device *net,
struct ethtool_link_ksettings *cmd)
{
struct usbnet *dev = netdev_priv(net);
if (!dev->mii.mdio_read)
return -EOPNOTSUPP;
return mii_ethtool_gset(&dev->mii, cmd);
return mii_ethtool_get_link_ksettings(&dev->mii, cmd);
}
EXPORT_SYMBOL_GPL(usbnet_get_settings);
EXPORT_SYMBOL_GPL(usbnet_get_link_ksettings);
int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd)
int usbnet_set_link_ksettings(struct net_device *net,
const struct ethtool_link_ksettings *cmd)
{
struct usbnet *dev = netdev_priv(net);
int retval;
......@@ -966,7 +968,7 @@ int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd)
if (!dev->mii.mdio_write)
return -EOPNOTSUPP;
retval = mii_ethtool_sset(&dev->mii, cmd);
retval = mii_ethtool_set_link_ksettings(&dev->mii, cmd);
/* link speed/duplex might have changed */
if (dev->driver_info->link_reset)
......@@ -976,9 +978,8 @@ int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd)
usbnet_update_max_qlen(dev);
return retval;
}
EXPORT_SYMBOL_GPL(usbnet_set_settings);
EXPORT_SYMBOL_GPL(usbnet_set_link_ksettings);
u32 usbnet_get_link (struct net_device *net)
{
......@@ -1038,14 +1039,14 @@ EXPORT_SYMBOL_GPL(usbnet_set_msglevel);
/* drivers may override default ethtool_ops in their bind() routine */
static const struct ethtool_ops usbnet_ethtool_ops = {
.get_settings = usbnet_get_settings,
.set_settings = usbnet_set_settings,
.get_link = usbnet_get_link,
.nway_reset = usbnet_nway_reset,
.get_drvinfo = usbnet_get_drvinfo,
.get_msglevel = usbnet_get_msglevel,
.set_msglevel = usbnet_set_msglevel,
.get_ts_info = ethtool_op_get_ts_info,
.get_link_ksettings = usbnet_get_link_ksettings,
.set_link_ksettings = usbnet_set_link_ksettings,
};
/*-------------------------------------------------------------------------*/
......
......@@ -261,10 +261,10 @@ extern void usbnet_pause_rx(struct usbnet *);
extern void usbnet_resume_rx(struct usbnet *);
extern void usbnet_purge_paused_rxq(struct usbnet *);
extern int usbnet_get_settings(struct net_device *net,
struct ethtool_cmd *cmd);
extern int usbnet_set_settings(struct net_device *net,
struct ethtool_cmd *cmd);
extern int usbnet_get_link_ksettings(struct net_device *net,
struct ethtool_link_ksettings *cmd);
extern int usbnet_set_link_ksettings(struct net_device *net,
const struct ethtool_link_ksettings *cmd);
extern u32 usbnet_get_link(struct net_device *net);
extern u32 usbnet_get_msglevel(struct net_device *);
extern void usbnet_set_msglevel(struct net_device *, u32);
......
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