~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/net/ioc3-eth.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
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
 
917
915
 
918
916
                        skb = ioc3_alloc_skb(RX_BUF_ALLOC_SIZE, GFP_ATOMIC);
919
917
                        if (!skb) {
920
 
                                show_free_areas();
 
918
                                show_free_areas(0);
921
919
                                continue;
922
920
                        }
923
921
 
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);
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)