Commit 6d95ff974a4b51121777973ffba7547c648da974

Authored by Michał Mirosław
Committed by David S. Miller
1 parent 66371c4413

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>

Showing 1 changed file with 2 additions and 28 deletions Side-by-side Diff

drivers/net/ioc3-eth.c
... ... @@ -90,8 +90,6 @@
90 90 u32 emcr, ehar_h, ehar_l;
91 91 spinlock_t ioc3_lock;
92 92 struct mii_if_info mii;
93   - unsigned long flags;
94   -#define IOC3_FLAG_RX_CHECKSUMS 1
95 93  
96 94 struct pci_dev *pdev;
97 95  
... ... @@ -609,7 +607,7 @@
609 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 611 ioc3_tcpudp_checksum(skb,
614 612 w0 & ERXBUF_IPCKSUM_MASK, len);
615 613  
... ... @@ -1328,6 +1326,7 @@
1328 1326 dev->watchdog_timeo = 5 * HZ;
1329 1327 dev->netdev_ops = &ioc3_netdev_ops;
1330 1328 dev->ethtool_ops = &ioc3_ethtool_ops;
  1329 + dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM;
1331 1330 dev->features = NETIF_F_IP_CSUM;
1332 1331  
1333 1332 sw_physid1 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID1);
1334 1333  
... ... @@ -1618,37 +1617,12 @@
1618 1617 return rc;
1619 1618 }
1620 1619  
1621   -static 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   -
1628   -static 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   -
1642 1620 static const struct ethtool_ops ioc3_ethtool_ops = {
1643 1621 .get_drvinfo = ioc3_get_drvinfo,
1644 1622 .get_settings = ioc3_get_settings,
1645 1623 .set_settings = ioc3_set_settings,
1646 1624 .nway_reset = ioc3_nway_reset,
1647 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  
1654 1628 static int ioc3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)