Commit 5ecde9ac authored by David S. Miller's avatar David S. Miller

[ETHTOOL]: Add ethtool_op_{set,get}_tso helpers.

parent c709c6e3
...@@ -257,6 +257,8 @@ u32 ethtool_op_get_link(struct net_device *dev); ...@@ -257,6 +257,8 @@ u32 ethtool_op_get_link(struct net_device *dev);
u32 ethtool_op_get_tx_csum(struct net_device *dev); u32 ethtool_op_get_tx_csum(struct net_device *dev);
u32 ethtool_op_get_sg(struct net_device *dev); u32 ethtool_op_get_sg(struct net_device *dev);
int ethtool_op_set_sg(struct net_device *dev, u32 data); 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);
/** /**
* &ethtool_ops - Alter and report network device settings * &ethtool_ops - Alter and report network device settings
......
...@@ -45,6 +45,21 @@ int ethtool_op_set_sg(struct net_device *dev, u32 data) ...@@ -45,6 +45,21 @@ int ethtool_op_set_sg(struct net_device *dev, u32 data)
return 0; return 0;
} }
u32 ethtool_op_get_tso(struct net_device *dev)
{
return (dev->features & NETIF_F_TSO) != 0;
}
int ethtool_op_set_tso(struct net_device *dev, u32 data)
{
if (data)
dev->features |= NETIF_F_TSO;
else
dev->features &= ~NETIF_F_TSO;
return 0;
}
/* Handlers for each ethtool command */ /* Handlers for each ethtool command */
static int ethtool_get_settings(struct net_device *dev, void *useraddr) static int ethtool_get_settings(struct net_device *dev, void *useraddr)
......
...@@ -633,5 +633,7 @@ EXPORT_SYMBOL(ethtool_op_get_link); ...@@ -633,5 +633,7 @@ EXPORT_SYMBOL(ethtool_op_get_link);
EXPORT_SYMBOL(ethtool_op_get_tx_csum); EXPORT_SYMBOL(ethtool_op_get_tx_csum);
EXPORT_SYMBOL(ethtool_op_get_sg); EXPORT_SYMBOL(ethtool_op_get_sg);
EXPORT_SYMBOL(ethtool_op_set_sg); EXPORT_SYMBOL(ethtool_op_set_sg);
EXPORT_SYMBOL(ethtool_op_get_tso);
EXPORT_SYMBOL(ethtool_op_set_tso);
#endif /* CONFIG_NET */ #endif /* CONFIG_NET */
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