the new ksetting methods in subnet's subdrivers
Subsystems (9)
Oliver Neukum
maintainerThe API for ethtool has been changed. Rather than implement the change sparately in each subdriver, usbnet should be changed and the subdrivers should expand upon the generic method usbnet provides.
This set implements the new methods, introduces them into the subdrivers and rips out the old stuff, lest it be used in new drivers.
Oliver Neukum
maintainerPATCH 1/9 net: usb: usbnet: add ksettings method
This patch adds support for the new ksettings API of the ethtool methods to usbnet.
--- drivers/net/usb/usbnet.c | 35 +++++++++++++++++++++++++++++++++++ include/linux/usb/usbnet.h | 4 ++++ 2 files changed, 39 insertions(+)
drivers/net/usb/usbnet.c +35 -0
@@ -947,6 +947,41 @@ EXPORT_SYMBOL_GPL(usbnet_open);* they'll probably want to use this base set. */ +int usbnet_get_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_get_link_ksettings (&dev->mii, cmd); +} +EXPORT_SYMBOL_GPL (usbnet_get_ksettings); + +int usbnet_set_ksettings (struct net_device *net, +const struct ethtool_link_ksettings *cmd) +{ +struct usbnet *dev =netdev_priv (net); +int retval; + +if (!dev->mii.mdio_write) +return -EOPNOTSUPP ; + + retval =mii_ethtool_set_link_ksettings (&dev->mii, cmd); + +/* link speed/duplex might have changed */ +if (dev->driver_info->link_reset) + dev->driver_info->link_reset (dev); + +/* hard_mtu or rx_urb_size may change in link_reset() */ +usbnet_update_max_qlen (dev); + +return retval; + +} +EXPORT_SYMBOL_GPL (usbnet_set_ksettings); +int usbnet_get_settings (struct net_device *net,struct ethtool_cmd *cmd) {struct usbnet *dev =netdev_priv (net);
include/linux/usb/usbnet.h +4 -0
@@ -261,6 +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_ksettings (struct net_device *net, +struct ethtool_link_ksettings *cmd); +extern int usbnet_set_ksettings (struct net_device *net, +const struct ethtool_link_ksettings *cmd);extern int usbnet_get_settings (struct net_device *net,struct ethtool_cmd *cmd); extern int usbnet_set_settings(struct net_device *net,
Signature · 1 line
2.10.2
Oliver Neukum
maintainerPATCH 2/9 net: usb: cdc-ncm: use ksettings API
In reply to Oliver NeukumThis changes CDC-NCM to use the new ksettings API of usbnet and export the new methods to the network layer.
--- drivers/net/usb/cdc_ncm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/usb/cdc_ncm.c +2 -2
@@ -131,8 +131,6 @@ static void cdc_ncm_get_strings(struct net_device __always_unused *netdev, u32 sstatic 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_ksettings, + .set_link_ksettings = usbnet_set_ksettings };static u32 cdc_ncm_check_rx_max (struct usbnet *dev,u32 new_rx)
Signature · 1 line
2.10.2
Oliver Neukum
maintainerPATCH 3/9 net: usb: sierra-net: use ksettings API
In reply to Oliver NeukumThis changes sierra-net to use the new ksettings API of usbnet and export the new methods to the network layer.
--- drivers/net/usb/sierra_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/usb/sierra_net.c +2 -2
@@ -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_ksettings, + .set_link_ksettings = usbnet_set_ksettings };static int sierra_net_get_fw_attr (struct usbnet *dev,u16 *datap)
Signature · 1 line
2.10.2
Oliver Neukum
maintainerPATCH 4/9 net: usb: dm9601: use ksettings API
In reply to Oliver NeukumThis changes dm9601 to use the new ksettings API of usbnet and export the new methods to the network layer.
--- drivers/net/usb/dm9601.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/usb/dm9601.c +2 -2
@@ -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, + .set_link_ksettings = usbnet_set_ksettings, + .get_link_ksettings = usbnet_get_ksettings };static void dm9601_set_multicast (struct net_device *net)
Signature · 1 line
2.10.2
Oliver Neukum
maintainerPATCH 5/9 net: usb: mcs7830: use ksettings API
In reply to Oliver NeukumThis changes mcs7830 to use the new ksettings API of usbnet and export the new methods to the network layer.
--- drivers/net/usb/mcs7830.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/usb/mcs7830.c +2 -2
@@ -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_ksettings, + .set_link_ksettings = usbnet_set_ksettings };static const struct net_device_ops mcs7830_netdev_ops = {
Signature · 1 line
2.10.2
Oliver Neukum
maintainerPATCH 6/9 net: usb: smsc75xx: use ksettings API
In reply to Oliver NeukumThis changes smsc75xx to use the new ksettings API of usbnet and export the new methods to the network layer.
--- drivers/net/usb/smsc75xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/usb/smsc75xx.c +2 -2
@@ -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_ksettings, + .set_link_ksettings = usbnet_set_ksettings };static int smsc75xx_ioctl (struct net_device *netdev,struct ifreq *rq,int cmd)
Signature · 1 line
2.10.2
Oliver Neukum
maintainerPATCH 7/9 net: usb: smsc95xx: use ksettings API
In reply to Oliver NeukumThis provides an implementation of the new ksettings API. The methods provided by usbnet are extended.
--- drivers/net/usb/smsc95xx.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/net/usb/smsc95xx.c +12 -12
@@ -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_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_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_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_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_ksettings, + .set_link_ksettings = smsc95xx_set_ksettings };static int smsc95xx_ioctl (struct net_device *netdev,struct ifreq *rq,int cmd)
Signature · 1 line
2.10.2
Oliver Neukum
maintainerPATCH 8/9 net: usb: asix: use ksettings API
In reply to Oliver NeukumThis changes asix to use the new ksettings API of usbnet and export the new methods to the network layer.
--- drivers/net/usb/asix_devices.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/net/usb/asix_devices.c +7 -6
@@ -20,6 +20,7 @@*/ #include "asix.h" +#include "linux/usb/usbnet.h" #define PHY_MODE_MARVELL 0x0000#define MII_MARVELL_LED_CTRL 0x0018
@@ -136,9 +137,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_ksettings, + .set_link_ksettings = usbnet_set_ksettings };static void ax88172_set_multicast (struct net_device *net)
@@ -301,9 +302,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_ksettings, + .set_link_ksettings = usbnet_set_ksettings };static int ax88772_link_reset (struct usbnet *dev)
@@ -775,9 +776,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_ksettings, + .set_link_ksettings = usbnet_set_ksettings };static int marvell_phy_init (struct usbnet *dev)
Signature · 1 line
2.10.2