~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal-proposed

« back to all changes in this revision

Viewing changes to drivers/net/ethernet/marvell/pxa168_eth.c

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft, Andy Whitcroft
  • Date: 2012-06-21 09:16:38 UTC
  • Revision ID: package-import@ubuntu.com-20120621091638-gubhv4nox8xez1ct
Tags: 3.5.0-1.1
[ Andy Whitcroft]

* Rebuild lowlatency against Ubuntu-3.5.0-1.1
* All new configuration system to allow configuration deltas to be
  exposed via debian.lowlatency/config-delta

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#include <linux/interrupt.h>
44
44
#include <linux/types.h>
45
45
#include <asm/pgtable.h>
46
 
#include <asm/system.h>
47
46
#include <asm/cacheflush.h>
48
47
#include <linux/pxa168_eth.h>
49
48
 
220
219
        u8 work_todo;
221
220
        int skb_size;
222
221
 
223
 
        struct net_device_stats stats;
224
222
        /* Size of Tx Ring per queue */
225
223
        int tx_ring_size;
226
224
        /* Number of tx descriptors in use */
350
348
        while (pep->rx_desc_count < pep->rx_ring_size) {
351
349
                int size;
352
350
 
353
 
                skb = dev_alloc_skb(pep->skb_size);
 
351
                skb = netdev_alloc_skb(dev, pep->skb_size);
354
352
                if (!skb)
355
353
                        break;
356
354
                if (SKB_DMA_REALIGN)
627
625
        unsigned char oldMac[ETH_ALEN];
628
626
 
629
627
        if (!is_valid_ether_addr(sa->sa_data))
630
 
                return -EINVAL;
 
628
                return -EADDRNOTAVAIL;
631
629
        memcpy(oldMac, dev->dev_addr, ETH_ALEN);
 
630
        dev->addr_assign_type &= ~NET_ADDR_RANDOM;
632
631
        memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN);
633
632
        netif_addr_lock_bh(dev);
634
633
        update_hash_table_mac_address(pep, oldMac, dev->dev_addr);
1017
1016
        /* Allocate RX skb rings */
1018
1017
        pep->rx_skb = kmalloc(sizeof(*pep->rx_skb) * pep->rx_ring_size,
1019
1018
                             GFP_KERNEL);
1020
 
        if (!pep->rx_skb) {
1021
 
                printk(KERN_ERR "%s: Cannot alloc RX skb ring\n", dev->name);
 
1019
        if (!pep->rx_skb)
1022
1020
                return -ENOMEM;
1023
 
        }
 
1021
 
1024
1022
        /* Allocate RX ring */
1025
1023
        pep->rx_desc_count = 0;
1026
1024
        size = pep->rx_ring_size * sizeof(struct rx_desc);
1081
1079
 
1082
1080
        pep->tx_skb = kmalloc(sizeof(*pep->tx_skb) * pep->tx_ring_size,
1083
1081
                             GFP_KERNEL);
1084
 
        if (!pep->tx_skb) {
1085
 
                printk(KERN_ERR "%s: Cannot alloc TX skb ring\n", dev->name);
 
1082
        if (!pep->tx_skb)
1086
1083
                return -ENOMEM;
1087
 
        }
 
1084
 
1088
1085
        /* Allocate TX ring */
1089
1086
        pep->tx_desc_count = 0;
1090
1087
        size = pep->tx_ring_size * sizeof(struct tx_desc);
1459
1456
        .set_settings = pxa168_set_settings,
1460
1457
        .get_drvinfo = pxa168_get_drvinfo,
1461
1458
        .get_link = ethtool_op_get_link,
 
1459
        .get_ts_info = ethtool_op_get_ts_info,
1462
1460
};
1463
1461
 
1464
1462
static const struct net_device_ops pxa168_eth_netdev_ops = {
1522
1520
        INIT_WORK(&pep->tx_timeout_task, pxa168_eth_tx_timeout_task);
1523
1521
 
1524
1522
        printk(KERN_INFO "%s:Using random mac address\n", DRIVER_NAME);
1525
 
        random_ether_addr(dev->dev_addr);
 
1523
        eth_hw_addr_random(dev);
1526
1524
 
1527
1525
        pep->pd = pdev->dev.platform_data;
1528
1526
        pep->rx_ring_size = NUM_RX_DESCS;
1552
1550
        pep->smi_bus->name = "pxa168_eth smi";
1553
1551
        pep->smi_bus->read = pxa168_smi_read;
1554
1552
        pep->smi_bus->write = pxa168_smi_write;
1555
 
        snprintf(pep->smi_bus->id, MII_BUS_ID_SIZE, "%d", pdev->id);
 
1553
        snprintf(pep->smi_bus->id, MII_BUS_ID_SIZE, "%s-%d",
 
1554
                pdev->name, pdev->id);
1556
1555
        pep->smi_bus->parent = &pdev->dev;
1557
1556
        pep->smi_bus->phy_mask = 0xffffffff;
1558
1557
        err = mdiobus_register(pep->smi_bus);
1645
1644
                   },
1646
1645
};
1647
1646
 
1648
 
static int __init pxa168_init_module(void)
1649
 
{
1650
 
        return platform_driver_register(&pxa168_eth_driver);
1651
 
}
1652
 
 
1653
 
static void __exit pxa168_cleanup_module(void)
1654
 
{
1655
 
        platform_driver_unregister(&pxa168_eth_driver);
1656
 
}
1657
 
 
1658
 
module_init(pxa168_init_module);
1659
 
module_exit(pxa168_cleanup_module);
 
1647
module_platform_driver(pxa168_eth_driver);
1660
1648
 
1661
1649
MODULE_LICENSE("GPL");
1662
1650
MODULE_DESCRIPTION("Ethernet driver for Marvell PXA168");