Commit bc5787c6 authored by Michał Mirosław's avatar Michał Mirosław Committed by David S. Miller

net: remove legacy ethtool ops

As all drivers are converted, we may now remove discrete offload setting
callback handling.
Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 33a5ba14
...@@ -724,9 +724,6 @@ enum ethtool_sfeatures_retval_bits { ...@@ -724,9 +724,6 @@ enum ethtool_sfeatures_retval_bits {
#include <linux/rculist.h> #include <linux/rculist.h>
/* needed by dev_disable_lro() */
extern int __ethtool_set_flags(struct net_device *dev, u32 flags);
extern int __ethtool_get_settings(struct net_device *dev, extern int __ethtool_get_settings(struct net_device *dev,
struct ethtool_cmd *cmd); struct ethtool_cmd *cmd);
...@@ -750,19 +747,6 @@ struct net_device; ...@@ -750,19 +747,6 @@ struct net_device;
/* Some generic methods drivers may use in their ethtool_ops */ /* Some generic methods drivers may use in their ethtool_ops */
u32 ethtool_op_get_link(struct net_device *dev); u32 ethtool_op_get_link(struct net_device *dev);
u32 ethtool_op_get_tx_csum(struct net_device *dev);
int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data);
int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data);
u32 ethtool_op_get_sg(struct net_device *dev);
int ethtool_op_set_sg(struct net_device *dev, u32 data);
u32 ethtool_op_get_tso(struct net_device *dev);
int ethtool_op_set_tso(struct net_device *dev, u32 data);
u32 ethtool_op_get_ufo(struct net_device *dev);
int ethtool_op_set_ufo(struct net_device *dev, u32 data);
u32 ethtool_op_get_flags(struct net_device *dev);
int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported);
bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
/** /**
* struct ethtool_ops - optional netdev operations * struct ethtool_ops - optional netdev operations
...@@ -807,22 +791,6 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported); ...@@ -807,22 +791,6 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
* @get_pauseparam: Report pause parameters * @get_pauseparam: Report pause parameters
* @set_pauseparam: Set pause parameters. Returns a negative error code * @set_pauseparam: Set pause parameters. Returns a negative error code
* or zero. * or zero.
* @get_rx_csum: Deprecated in favour of the netdev feature %NETIF_F_RXCSUM.
* Report whether receive checksums are turned on or off.
* @set_rx_csum: Deprecated in favour of generic netdev features. Turn
* receive checksum on or off. Returns a negative error code or zero.
* @get_tx_csum: Deprecated as redundant. Report whether transmit checksums
* are turned on or off.
* @set_tx_csum: Deprecated in favour of generic netdev features. Turn
* transmit checksums on or off. Returns a negative error code or zero.
* @get_sg: Deprecated as redundant. Report whether scatter-gather is
* enabled.
* @set_sg: Deprecated in favour of generic netdev features. Turn
* scatter-gather on or off. Returns a negative error code or zero.
* @get_tso: Deprecated as redundant. Report whether TCP segmentation
* offload is enabled.
* @set_tso: Deprecated in favour of generic netdev features. Turn TCP
* segmentation offload on or off. Returns a negative error code or zero.
* @self_test: Run specified self-tests * @self_test: Run specified self-tests
* @get_strings: Return a set of strings that describe the requested objects * @get_strings: Return a set of strings that describe the requested objects
* @set_phys_id: Identify the physical devices, e.g. by flashing an LED * @set_phys_id: Identify the physical devices, e.g. by flashing an LED
...@@ -844,15 +812,6 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported); ...@@ -844,15 +812,6 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
* negative error code or zero. * negative error code or zero.
* @complete: Function to be called after any other operation except * @complete: Function to be called after any other operation except
* @begin. Will be called even if the other operation failed. * @begin. Will be called even if the other operation failed.
* @get_ufo: Deprecated as redundant. Report whether UDP fragmentation
* offload is enabled.
* @set_ufo: Deprecated in favour of generic netdev features. Turn UDP
* fragmentation offload on or off. Returns a negative error code or zero.
* @get_flags: Deprecated as redundant. Report features included in
* &enum ethtool_flags that are enabled.
* @set_flags: Deprecated in favour of generic netdev features. Turn
* features included in &enum ethtool_flags on or off. Returns a
* negative error code or zero.
* @get_priv_flags: Report driver-specific feature flags. * @get_priv_flags: Report driver-specific feature flags.
* @set_priv_flags: Set driver-specific feature flags. Returns a negative * @set_priv_flags: Set driver-specific feature flags. Returns a negative
* error code or zero. * error code or zero.
...@@ -917,14 +876,6 @@ struct ethtool_ops { ...@@ -917,14 +876,6 @@ struct ethtool_ops {
struct ethtool_pauseparam*); struct ethtool_pauseparam*);
int (*set_pauseparam)(struct net_device *, int (*set_pauseparam)(struct net_device *,
struct ethtool_pauseparam*); struct ethtool_pauseparam*);
u32 (*get_rx_csum)(struct net_device *);
int (*set_rx_csum)(struct net_device *, u32);
u32 (*get_tx_csum)(struct net_device *);
int (*set_tx_csum)(struct net_device *, u32);
u32 (*get_sg)(struct net_device *);
int (*set_sg)(struct net_device *, u32);
u32 (*get_tso)(struct net_device *);
int (*set_tso)(struct net_device *, u32);
void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); void (*self_test)(struct net_device *, struct ethtool_test *, u64 *);
void (*get_strings)(struct net_device *, u32 stringset, u8 *); void (*get_strings)(struct net_device *, u32 stringset, u8 *);
int (*set_phys_id)(struct net_device *, enum ethtool_phys_id_state); int (*set_phys_id)(struct net_device *, enum ethtool_phys_id_state);
...@@ -932,10 +883,6 @@ struct ethtool_ops { ...@@ -932,10 +883,6 @@ struct ethtool_ops {
struct ethtool_stats *, u64 *); struct ethtool_stats *, u64 *);
int (*begin)(struct net_device *); int (*begin)(struct net_device *);
void (*complete)(struct net_device *); void (*complete)(struct net_device *);
u32 (*get_ufo)(struct net_device *);
int (*set_ufo)(struct net_device *, u32);
u32 (*get_flags)(struct net_device *);
int (*set_flags)(struct net_device *, u32);
u32 (*get_priv_flags)(struct net_device *); u32 (*get_priv_flags)(struct net_device *);
int (*set_priv_flags)(struct net_device *, u32); int (*set_priv_flags)(struct net_device *, u32);
int (*get_sset_count)(struct net_device *, int); int (*get_sset_count)(struct net_device *, int);
......
...@@ -2592,22 +2592,6 @@ static inline int netif_is_bond_slave(struct net_device *dev) ...@@ -2592,22 +2592,6 @@ static inline int netif_is_bond_slave(struct net_device *dev)
extern struct pernet_operations __net_initdata loopback_net_ops; extern struct pernet_operations __net_initdata loopback_net_ops;
static inline u32 dev_ethtool_get_rx_csum(struct net_device *dev)
{
if (dev->features & NETIF_F_RXCSUM)
return 1;
if (!dev->ethtool_ops || !dev->ethtool_ops->get_rx_csum)
return 0;
return dev->ethtool_ops->get_rx_csum(dev);
}
static inline u32 dev_ethtool_get_flags(struct net_device *dev)
{
if (!dev->ethtool_ops || !dev->ethtool_ops->get_flags)
return 0;
return dev->ethtool_ops->get_flags(dev);
}
/* Logging, debugging and troubleshooting/diagnostic helpers. */ /* Logging, debugging and troubleshooting/diagnostic helpers. */
/* netdev_printk helpers, similar to dev_printk */ /* netdev_printk helpers, similar to dev_printk */
......
...@@ -596,13 +596,11 @@ static u32 vlan_dev_fix_features(struct net_device *dev, u32 features) ...@@ -596,13 +596,11 @@ static u32 vlan_dev_fix_features(struct net_device *dev, u32 features)
struct net_device *real_dev = vlan_dev_info(dev)->real_dev; struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
u32 old_features = features; u32 old_features = features;
features &= real_dev->features;
features &= real_dev->vlan_features; features &= real_dev->vlan_features;
features |= NETIF_F_RXCSUM;
features &= real_dev->features;
features |= old_features & NETIF_F_SOFT_FEATURES; features |= old_features & NETIF_F_SOFT_FEATURES;
if (dev_ethtool_get_rx_csum(real_dev))
features |= NETIF_F_RXCSUM;
features |= NETIF_F_LLTX; features |= NETIF_F_LLTX;
return features; return features;
......
...@@ -1321,8 +1321,6 @@ EXPORT_SYMBOL(dev_close); ...@@ -1321,8 +1321,6 @@ EXPORT_SYMBOL(dev_close);
*/ */
void dev_disable_lro(struct net_device *dev) void dev_disable_lro(struct net_device *dev)
{ {
u32 flags;
/* /*
* If we're trying to disable lro on a vlan device * If we're trying to disable lro on a vlan device
* use the underlying physical device instead * use the underlying physical device instead
...@@ -1330,15 +1328,9 @@ void dev_disable_lro(struct net_device *dev) ...@@ -1330,15 +1328,9 @@ void dev_disable_lro(struct net_device *dev)
if (is_vlan_dev(dev)) if (is_vlan_dev(dev))
dev = vlan_dev_real_dev(dev); dev = vlan_dev_real_dev(dev);
if (dev->ethtool_ops && dev->ethtool_ops->get_flags) dev->wanted_features &= ~NETIF_F_LRO;
flags = dev->ethtool_ops->get_flags(dev); netdev_update_features(dev);
else
flags = ethtool_op_get_flags(dev);
if (!(flags & ETH_FLAG_LRO))
return;
__ethtool_set_flags(dev, flags & ~ETH_FLAG_LRO);
if (unlikely(dev->features & NETIF_F_LRO)) if (unlikely(dev->features & NETIF_F_LRO))
netdev_WARN(dev, "failed to disable LRO!\n"); netdev_WARN(dev, "failed to disable LRO!\n");
} }
......
This diff is collapsed.
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