aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2011-04-12 05:48:17 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-12 17:50:45 -0400
commit6d95ff974a4b51121777973ffba7547c648da974 (patch)
tree497e51efc5871e2098457dad70e8bd2f8c8779c6
parent66371c44136b566f39f70c72cb4d117558bee3fa (diff)
net: ioc3: convert to hw_features
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ioc3-eth.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index c8ee8d28767b..96c95617195f 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -90,8 +90,6 @@ struct ioc3_private {
90 u32 emcr, ehar_h, ehar_l; 90 u32 emcr, ehar_h, ehar_l;
91 spinlock_t ioc3_lock; 91 spinlock_t ioc3_lock;
92 struct mii_if_info mii; 92 struct mii_if_info mii;
93 unsigned long flags;
94#define IOC3_FLAG_RX_CHECKSUMS 1
95 93
96 struct pci_dev *pdev; 94 struct pci_dev *pdev;
97 95
@@ -609,7 +607,7 @@ static inline void ioc3_rx(struct net_device *dev)
609 goto next; 607 goto next;
610 } 608 }
611 609
612 if (likely(ip->flags & IOC3_FLAG_RX_CHECKSUMS)) 610 if (likely(dev->features & NETIF_F_RXCSUM))
613 ioc3_tcpudp_checksum(skb, 611 ioc3_tcpudp_checksum(skb,
614 w0 & ERXBUF_IPCKSUM_MASK, len); 612 w0 & ERXBUF_IPCKSUM_MASK, len);
615 613
@@ -1328,6 +1326,7 @@ static int __devinit ioc3_probe(struct pci_dev *pdev,
1328 dev->watchdog_timeo = 5 * HZ; 1326 dev->watchdog_timeo = 5 * HZ;
1329 dev->netdev_ops = &ioc3_netdev_ops; 1327 dev->netdev_ops = &ioc3_netdev_ops;
1330 dev->ethtool_ops = &ioc3_ethtool_ops; 1328 dev->ethtool_ops = &ioc3_ethtool_ops;
1329 dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM;
1331 dev->features = NETIF_F_IP_CSUM; 1330 dev->features = NETIF_F_IP_CSUM;
1332 1331
1333 sw_physid1 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID1); 1332 sw_physid1 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID1);
@@ -1618,37 +1617,12 @@ static u32 ioc3_get_link(struct net_device *dev)
1618 return rc; 1617 return rc;
1619} 1618}
1620 1619
1621static u32 ioc3_get_rx_csum(struct net_device *dev)
1622{
1623 struct ioc3_private *ip = netdev_priv(dev);
1624
1625 return ip->flags & IOC3_FLAG_RX_CHECKSUMS;
1626}
1627
1628static int ioc3_set_rx_csum(struct net_device *dev, u32 data)
1629{
1630 struct ioc3_private *ip = netdev_priv(dev);
1631
1632 spin_lock_bh(&ip->ioc3_lock);
1633 if (data)
1634 ip->flags |= IOC3_FLAG_RX_CHECKSUMS;
1635 else
1636 ip->flags &= ~IOC3_FLAG_RX_CHECKSUMS;
1637 spin_unlock_bh(&ip->ioc3_lock);
1638
1639 return 0;
1640}
1641
1642static const struct ethtool_ops ioc3_ethtool_ops = { 1620static const struct ethtool_ops ioc3_ethtool_ops = {
1643 .get_drvinfo = ioc3_get_drvinfo, 1621 .get_drvinfo = ioc3_get_drvinfo,
1644 .get_settings = ioc3_get_settings, 1622 .get_settings = ioc3_get_settings,
1645 .set_settings = ioc3_set_settings, 1623 .set_settings = ioc3_set_settings,
1646 .nway_reset = ioc3_nway_reset, 1624 .nway_reset = ioc3_nway_reset,
1647 .get_link = ioc3_get_link, 1625 .get_link = ioc3_get_link,
1648 .get_rx_csum = ioc3_get_rx_csum,
1649 .set_rx_csum = ioc3_set_rx_csum,
1650 .get_tx_csum = ethtool_op_get_tx_csum,
1651 .set_tx_csum = ethtool_op_set_tx_csum
1652}; 1626};
1653 1627
1654static int ioc3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1628static int ioc3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)