diff options
author | Sridhar Samudrala <sri@us.ibm.com> | 2009-07-22 09:38:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-26 22:25:45 -0400 |
commit | 1896e61ff7cc1c9dd0d8b1cf4a9426a0f7217a20 (patch) | |
tree | ddbcdba63f537681d047a302ef27f2df8b362770 /net/core/ethtool.c | |
parent | 7d073c68a49b23b5ba2bc23c3bb5b3bcaa0b4f20 (diff) |
ethtool: device independent rx_csum and get_flags routines
This helps avoid error messages with ethtool -k on devices that
don't provide device specific routines.
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
------------------------------------------------------------------
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/ethtool.c')
-rw-r--r-- | net/core/ethtool.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index d9d5160610d5..cf36ff44ebb2 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -30,6 +30,11 @@ u32 ethtool_op_get_link(struct net_device *dev) | |||
30 | return netif_carrier_ok(dev) ? 1 : 0; | 30 | return netif_carrier_ok(dev) ? 1 : 0; |
31 | } | 31 | } |
32 | 32 | ||
33 | u32 ethtool_op_get_rx_csum(struct net_device *dev) | ||
34 | { | ||
35 | return (dev->features & NETIF_F_ALL_CSUM) != 0; | ||
36 | } | ||
37 | |||
33 | u32 ethtool_op_get_tx_csum(struct net_device *dev) | 38 | u32 ethtool_op_get_tx_csum(struct net_device *dev) |
34 | { | 39 | { |
35 | return (dev->features & NETIF_F_ALL_CSUM) != 0; | 40 | return (dev->features & NETIF_F_ALL_CSUM) != 0; |
@@ -1004,7 +1009,9 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) | |||
1004 | break; | 1009 | break; |
1005 | case ETHTOOL_GRXCSUM: | 1010 | case ETHTOOL_GRXCSUM: |
1006 | rc = ethtool_get_value(dev, useraddr, ethcmd, | 1011 | rc = ethtool_get_value(dev, useraddr, ethcmd, |
1007 | dev->ethtool_ops->get_rx_csum); | 1012 | (dev->ethtool_ops->get_rx_csum ? |
1013 | dev->ethtool_ops->get_rx_csum : | ||
1014 | ethtool_op_get_rx_csum)); | ||
1008 | break; | 1015 | break; |
1009 | case ETHTOOL_SRXCSUM: | 1016 | case ETHTOOL_SRXCSUM: |
1010 | rc = ethtool_set_rx_csum(dev, useraddr); | 1017 | rc = ethtool_set_rx_csum(dev, useraddr); |
@@ -1068,7 +1075,9 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) | |||
1068 | break; | 1075 | break; |
1069 | case ETHTOOL_GFLAGS: | 1076 | case ETHTOOL_GFLAGS: |
1070 | rc = ethtool_get_value(dev, useraddr, ethcmd, | 1077 | rc = ethtool_get_value(dev, useraddr, ethcmd, |
1071 | dev->ethtool_ops->get_flags); | 1078 | (dev->ethtool_ops->get_flags ? |
1079 | dev->ethtool_ops->get_flags : | ||
1080 | ethtool_op_get_flags)); | ||
1072 | break; | 1081 | break; |
1073 | case ETHTOOL_SFLAGS: | 1082 | case ETHTOOL_SFLAGS: |
1074 | rc = ethtool_set_value(dev, useraddr, | 1083 | rc = ethtool_set_value(dev, useraddr, |