~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to drivers/net/8139cp.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
758
758
 
759
759
        entry = cp->tx_head;
760
760
        eor = (entry == (CP_TX_RING_SIZE - 1)) ? RingEnd : 0;
761
 
        if (dev->features & NETIF_F_TSO)
762
 
                mss = skb_shinfo(skb)->gso_size;
 
761
        mss = skb_shinfo(skb)->gso_size;
763
762
 
764
763
        if (skb_shinfo(skb)->nr_frags == 0) {
765
764
                struct cp_desc *txd = &cp->tx_ring[entry];
1416
1415
        cp->msg_enable = value;
1417
1416
}
1418
1417
 
1419
 
static u32 cp_get_rx_csum(struct net_device *dev)
1420
 
{
1421
 
        struct cp_private *cp = netdev_priv(dev);
1422
 
        return (cpr16(CpCmd) & RxChkSum) ? 1 : 0;
1423
 
}
1424
 
 
1425
 
static int cp_set_rx_csum(struct net_device *dev, u32 data)
1426
 
{
1427
 
        struct cp_private *cp = netdev_priv(dev);
1428
 
        u16 cmd = cp->cpcmd, newcmd;
1429
 
 
1430
 
        newcmd = cmd;
1431
 
 
1432
 
        if (data)
1433
 
                newcmd |= RxChkSum;
 
1418
static int cp_set_features(struct net_device *dev, u32 features)
 
1419
{
 
1420
        struct cp_private *cp = netdev_priv(dev);
 
1421
        unsigned long flags;
 
1422
 
 
1423
        if (!((dev->features ^ features) & NETIF_F_RXCSUM))
 
1424
                return 0;
 
1425
 
 
1426
        spin_lock_irqsave(&cp->lock, flags);
 
1427
 
 
1428
        if (features & NETIF_F_RXCSUM)
 
1429
                cp->cpcmd |= RxChkSum;
1434
1430
        else
1435
 
                newcmd &= ~RxChkSum;
1436
 
 
1437
 
        if (newcmd != cmd) {
1438
 
                unsigned long flags;
1439
 
 
1440
 
                spin_lock_irqsave(&cp->lock, flags);
1441
 
                cp->cpcmd = newcmd;
1442
 
                cpw16_f(CpCmd, newcmd);
1443
 
                spin_unlock_irqrestore(&cp->lock, flags);
1444
 
        }
 
1431
                cp->cpcmd &= ~RxChkSum;
 
1432
 
 
1433
        cpw16_f(CpCmd, cp->cpcmd);
 
1434
        spin_unlock_irqrestore(&cp->lock, flags);
1445
1435
 
1446
1436
        return 0;
1447
1437
}
1554
1544
        .get_link               = ethtool_op_get_link,
1555
1545
        .get_msglevel           = cp_get_msglevel,
1556
1546
        .set_msglevel           = cp_set_msglevel,
1557
 
        .get_rx_csum            = cp_get_rx_csum,
1558
 
        .set_rx_csum            = cp_set_rx_csum,
1559
 
        .set_tx_csum            = ethtool_op_set_tx_csum, /* local! */
1560
 
        .set_sg                 = ethtool_op_set_sg,
1561
 
        .set_tso                = ethtool_op_set_tso,
1562
1547
        .get_regs               = cp_get_regs,
1563
1548
        .get_wol                = cp_get_wol,
1564
1549
        .set_wol                = cp_set_wol,
1831
1816
        .ndo_do_ioctl           = cp_ioctl,
1832
1817
        .ndo_start_xmit         = cp_start_xmit,
1833
1818
        .ndo_tx_timeout         = cp_tx_timeout,
 
1819
        .ndo_set_features       = cp_set_features,
1834
1820
#if CP_VLAN_TAG_USED
1835
1821
        .ndo_vlan_rx_register   = cp_vlan_rx_register,
1836
1822
#endif
1934
1920
        cp->cpcmd = (pci_using_dac ? PCIDAC : 0) |
1935
1921
                    PCIMulRW | RxChkSum | CpRxOn | CpTxOn;
1936
1922
 
 
1923
        dev->features |= NETIF_F_RXCSUM;
 
1924
        dev->hw_features |= NETIF_F_RXCSUM;
 
1925
 
1937
1926
        regs = ioremap(pciaddr, CP_REGS_SIZE);
1938
1927
        if (!regs) {
1939
1928
                rc = -EIO;
1966
1955
        if (pci_using_dac)
1967
1956
                dev->features |= NETIF_F_HIGHDMA;
1968
1957
 
1969
 
#if 0 /* disabled by default until verified */
1970
 
        dev->features |= NETIF_F_TSO;
1971
 
#endif
 
1958
        /* disabled by default until verified */
 
1959
        dev->hw_features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
1972
1960
 
1973
1961
        dev->irq = pdev->irq;
1974
1962