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

« back to all changes in this revision

Viewing changes to drivers/net/tehuti.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:
645
645
        if (cmd != SIOCDEVPRIVATE) {
646
646
                error = copy_from_user(data, ifr->ifr_data, sizeof(data));
647
647
                if (error) {
648
 
                        pr_err("cant copy from user\n");
 
648
                        pr_err("can't copy from user\n");
649
649
                        RET(-EFAULT);
650
650
                }
651
651
                DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]);
999
999
 *
1000
1000
 * RxD fifo is smaller than RxF fifo by design. Upon high load, RxD will be
1001
1001
 * filled and packets will be dropped by nic without getting into host or
1002
 
 * cousing interrupt. Anyway, in that condition, host has no chance to proccess
 
1002
 * cousing interrupt. Anyway, in that condition, host has no chance to process
1003
1003
 * all packets, but dropping in nic is cheaper, since it takes 0 cpu cycles
1004
1004
 */
1005
1005
 
1200
1200
        RET();
1201
1201
}
1202
1202
 
1203
 
/* bdx_rx_receive - recieves full packets from RXD fifo and pass them to OS
1204
 
 * NOTE: a special treatment is given to non-continous descriptors
 
1203
/* bdx_rx_receive - receives full packets from RXD fifo and pass them to OS
 
1204
 * NOTE: a special treatment is given to non-continuous descriptors
1205
1205
 * that start near the end, wraps around and continue at the beginning. a second
1206
1206
 * part is copied right after the first, and then descriptor is interpreted as
1207
1207
 * normal. fifo has an extra space to allow such operations
1584
1584
}
1585
1585
 
1586
1586
/*
1587
 
 * bdx_tx_space - calculates avalable space in TX fifo
 
1587
 * bdx_tx_space - calculates available space in TX fifo
1588
1588
 * @priv - NIC private structure
1589
 
 * Returns avaliable space in TX fifo in bytes
 
1589
 * Returns available space in TX fifo in bytes
1590
1590
 */
1591
1591
static inline int bdx_tx_space(struct bdx_priv *priv)
1592
1592
{
2017
2017
                ndev->irq = pdev->irq;
2018
2018
                ndev->features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO
2019
2019
                    | NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX |
2020
 
                    NETIF_F_HW_VLAN_FILTER
 
2020
                    NETIF_F_HW_VLAN_FILTER | NETIF_F_RXCSUM
2021
2021
                    /*| NETIF_F_FRAGLIST */
2022
2022
                    ;
 
2023
                ndev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG |
 
2024
                        NETIF_F_TSO | NETIF_F_HW_VLAN_TX;
2023
2025
 
2024
2026
                if (pci_using_dac)
2025
2027
                        ndev->features |= NETIF_F_HIGHDMA;
2149
2151
 
2150
2152
        ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
2151
2153
        ecmd->advertising = (ADVERTISED_10000baseT_Full | ADVERTISED_FIBRE);
2152
 
        ecmd->speed = SPEED_10000;
 
2154
        ethtool_cmd_speed_set(ecmd, SPEED_10000);
2153
2155
        ecmd->duplex = DUPLEX_FULL;
2154
2156
        ecmd->port = PORT_FIBRE;
2155
2157
        ecmd->transceiver = XCVR_EXTERNAL;      /* what does it mean? */
2188
2190
}
2189
2191
 
2190
2192
/*
2191
 
 * bdx_get_rx_csum - report whether receive checksums are turned on or off
2192
 
 * @netdev
2193
 
 */
2194
 
static u32 bdx_get_rx_csum(struct net_device *netdev)
2195
 
{
2196
 
        return 1;               /* always on */
2197
 
}
2198
 
 
2199
 
/*
2200
 
 * bdx_get_tx_csum - report whether transmit checksums are turned on or off
2201
 
 * @netdev
2202
 
 */
2203
 
static u32 bdx_get_tx_csum(struct net_device *netdev)
2204
 
{
2205
 
        return (netdev->features & NETIF_F_IP_CSUM) != 0;
2206
 
}
2207
 
 
2208
 
/*
2209
2193
 * bdx_get_coalesce - get interrupt coalescing parameters
2210
2194
 * @netdev
2211
2195
 * @ecoal
2424
2408
                .set_coalesce = bdx_set_coalesce,
2425
2409
                .get_ringparam = bdx_get_ringparam,
2426
2410
                .set_ringparam = bdx_set_ringparam,
2427
 
                .get_rx_csum = bdx_get_rx_csum,
2428
 
                .get_tx_csum = bdx_get_tx_csum,
2429
 
                .get_sg = ethtool_op_get_sg,
2430
 
                .get_tso = ethtool_op_get_tso,
2431
2411
                .get_strings = bdx_get_strings,
2432
2412
                .get_sset_count = bdx_get_sset_count,
2433
2413
                .get_ethtool_stats = bdx_get_ethtool_stats,