net: ioc3: convert to hw_features
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Tue, 12 Apr 2011 09:48:17 +0000 (09:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Apr 2011 21:50:45 +0000 (14:50 -0700)
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ioc3-eth.c

index c8ee8d28767b6832167e65c98a00ca859e26d87f..96c95617195f6b18baf79c73f0f33beff21e14fd 100644 (file)
@@ -90,8 +90,6 @@ struct ioc3_private {
        u32 emcr, ehar_h, ehar_l;
        spinlock_t ioc3_lock;
        struct mii_if_info mii;
-       unsigned long flags;
-#define IOC3_FLAG_RX_CHECKSUMS 1
 
        struct pci_dev *pdev;
 
@@ -609,7 +607,7 @@ static inline void ioc3_rx(struct net_device *dev)
                                goto next;
                        }
 
-                       if (likely(ip->flags & IOC3_FLAG_RX_CHECKSUMS))
+                       if (likely(dev->features & NETIF_F_RXCSUM))
                                ioc3_tcpudp_checksum(skb,
                                        w0 & ERXBUF_IPCKSUM_MASK, len);
 
@@ -1328,6 +1326,7 @@ static int __devinit ioc3_probe(struct pci_dev *pdev,
        dev->watchdog_timeo     = 5 * HZ;
        dev->netdev_ops         = &ioc3_netdev_ops;
        dev->ethtool_ops        = &ioc3_ethtool_ops;
+       dev->hw_features        = NETIF_F_IP_CSUM | NETIF_F_RXCSUM;
        dev->features           = NETIF_F_IP_CSUM;
 
        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)
        return rc;
 }
 
-static u32 ioc3_get_rx_csum(struct net_device *dev)
-{
-       struct ioc3_private *ip = netdev_priv(dev);
-
-       return ip->flags & IOC3_FLAG_RX_CHECKSUMS;
-}
-
-static int ioc3_set_rx_csum(struct net_device *dev, u32 data)
-{
-       struct ioc3_private *ip = netdev_priv(dev);
-
-       spin_lock_bh(&ip->ioc3_lock);
-       if (data)
-               ip->flags |= IOC3_FLAG_RX_CHECKSUMS;
-       else
-               ip->flags &= ~IOC3_FLAG_RX_CHECKSUMS;
-       spin_unlock_bh(&ip->ioc3_lock);
-
-       return 0;
-}
-
 static const struct ethtool_ops ioc3_ethtool_ops = {
        .get_drvinfo            = ioc3_get_drvinfo,
        .get_settings           = ioc3_get_settings,
        .set_settings           = ioc3_set_settings,
        .nway_reset             = ioc3_nway_reset,
        .get_link               = ioc3_get_link,
-       .get_rx_csum            = ioc3_get_rx_csum,
-       .set_rx_csum            = ioc3_set_rx_csum,
-       .get_tx_csum            = ethtool_op_get_tx_csum,
-       .set_tx_csum            = ethtool_op_set_tx_csum
 };
 
 static int ioc3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)