diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2010-11-30 01:38:00 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-06 15:59:04 -0500 |
commit | 7903264402546f45f9bac8ad2bfdb00d00eb124a (patch) | |
tree | 32076a169b37ce9c98916ed2d702de5cab1aeb6c /drivers/net/stmmac | |
parent | 900d495a189dc3ff5952b98a77d18e3018f8286c (diff) |
net: Fix too optimistic NETIF_F_HW_CSUM features
NETIF_F_HW_CSUM is a superset of NETIF_F_IP_CSUM+NETIF_F_IPV6_CSUM, but
some drivers miss the difference. Fix this and also fix UFO dependency
on checksumming offload as it makes the same mistake in assumptions.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/stmmac')
-rw-r--r-- | drivers/net/stmmac/stmmac_ethtool.c | 12 | ||||
-rw-r--r-- | drivers/net/stmmac/stmmac_main.c | 5 |
2 files changed, 4 insertions, 13 deletions
diff --git a/drivers/net/stmmac/stmmac_ethtool.c b/drivers/net/stmmac/stmmac_ethtool.c index f2695fd180ca..fd719edc7f7c 100644 --- a/drivers/net/stmmac/stmmac_ethtool.c +++ b/drivers/net/stmmac/stmmac_ethtool.c | |||
@@ -197,16 +197,6 @@ static void stmmac_ethtool_gregs(struct net_device *dev, | |||
197 | } | 197 | } |
198 | } | 198 | } |
199 | 199 | ||
200 | static int stmmac_ethtool_set_tx_csum(struct net_device *netdev, u32 data) | ||
201 | { | ||
202 | if (data) | ||
203 | netdev->features |= NETIF_F_HW_CSUM; | ||
204 | else | ||
205 | netdev->features &= ~NETIF_F_HW_CSUM; | ||
206 | |||
207 | return 0; | ||
208 | } | ||
209 | |||
210 | static u32 stmmac_ethtool_get_rx_csum(struct net_device *dev) | 200 | static u32 stmmac_ethtool_get_rx_csum(struct net_device *dev) |
211 | { | 201 | { |
212 | struct stmmac_priv *priv = netdev_priv(dev); | 202 | struct stmmac_priv *priv = netdev_priv(dev); |
@@ -370,7 +360,7 @@ static struct ethtool_ops stmmac_ethtool_ops = { | |||
370 | .get_link = ethtool_op_get_link, | 360 | .get_link = ethtool_op_get_link, |
371 | .get_rx_csum = stmmac_ethtool_get_rx_csum, | 361 | .get_rx_csum = stmmac_ethtool_get_rx_csum, |
372 | .get_tx_csum = ethtool_op_get_tx_csum, | 362 | .get_tx_csum = ethtool_op_get_tx_csum, |
373 | .set_tx_csum = stmmac_ethtool_set_tx_csum, | 363 | .set_tx_csum = ethtool_op_set_tx_ipv6_csum, |
374 | .get_sg = ethtool_op_get_sg, | 364 | .get_sg = ethtool_op_get_sg, |
375 | .set_sg = ethtool_op_set_sg, | 365 | .set_sg = ethtool_op_set_sg, |
376 | .get_pauseparam = stmmac_get_pauseparam, | 366 | .get_pauseparam = stmmac_get_pauseparam, |
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index 730a6fd79ee0..bfc2d1251502 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c | |||
@@ -1494,7 +1494,8 @@ static int stmmac_probe(struct net_device *dev) | |||
1494 | dev->netdev_ops = &stmmac_netdev_ops; | 1494 | dev->netdev_ops = &stmmac_netdev_ops; |
1495 | stmmac_set_ethtool_ops(dev); | 1495 | stmmac_set_ethtool_ops(dev); |
1496 | 1496 | ||
1497 | dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA); | 1497 | dev->features |= NETIF_F_SG | NETIF_F_HIGHDMA | |
1498 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | ||
1498 | dev->watchdog_timeo = msecs_to_jiffies(watchdog); | 1499 | dev->watchdog_timeo = msecs_to_jiffies(watchdog); |
1499 | #ifdef STMMAC_VLAN_TAG_USED | 1500 | #ifdef STMMAC_VLAN_TAG_USED |
1500 | /* Both mac100 and gmac support receive VLAN tag detection */ | 1501 | /* Both mac100 and gmac support receive VLAN tag detection */ |
@@ -1525,7 +1526,7 @@ static int stmmac_probe(struct net_device *dev) | |||
1525 | 1526 | ||
1526 | DBG(probe, DEBUG, "%s: Scatter/Gather: %s - HW checksums: %s\n", | 1527 | DBG(probe, DEBUG, "%s: Scatter/Gather: %s - HW checksums: %s\n", |
1527 | dev->name, (dev->features & NETIF_F_SG) ? "on" : "off", | 1528 | dev->name, (dev->features & NETIF_F_SG) ? "on" : "off", |
1528 | (dev->features & NETIF_F_HW_CSUM) ? "on" : "off"); | 1529 | (dev->features & NETIF_F_IP_CSUM) ? "on" : "off"); |
1529 | 1530 | ||
1530 | spin_lock_init(&priv->lock); | 1531 | spin_lock_init(&priv->lock); |
1531 | 1532 | ||