~ubuntu-branches/ubuntu/karmic/linux-ports/karmic

« back to all changes in this revision

Viewing changes to drivers/net/atl1e/atl1e_main.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich, Luke Yelavich, Michael Casadevall, Tim Gardner, Upstream Kernel Changes
  • Date: 2009-05-06 18:18:55 UTC
  • Revision ID: james.westby@ubuntu.com-20090506181855-t00baeevpnvd9o7a
Tags: 2.6.30-1.1
[ Luke Yelavich ]
* initial release for karmic
* SAUCE: rebase-ports - adjust for the karmic ports kernel
* SAUCE: rebase-ports - also remove abi dirs/files on rebase
* Update configs after rebase against mainline Jaunty tree
* [Config] Disable CONFIG_BLK_DEV_UB and CONFIG_USB_LIBUSUAL as per
  mainline jaunty
* forward-port patch to drbd for powerpc compilation
* [Config] disable CONFIG_LENOVO_SL_LAPTOP for i386 due to FTBFS
* add .o files found in arch/powerpc/lib to all powerpc kernel header
  packages
* [Config] enable CONFIG_DRM_I915_KMS for i386 as per karmic mainline

[ Michael Casadevall ]

* Disable kgdb on sparc64
* [sparc] [Config] Disable GPIO LEDS
* [ia64] Rename -ia64-generic to -ia64 in line with other architectures
* Correct kernel image path for sparc builds
* [hppa] Fix HPPA config files to build modules for all udebian

Rebase on top of karmic mainline 2.6.30-1.1

[ Tim Gardner ]

* [Config] armel: disable staging drivers, fixes FTBS
* [Config] armel imx51: Disable CONFIG_MTD_NAND_MXC, fixes FTBS

[ Upstream Kernel Changes ]

* mpt2sas: Change reset_type enum to avoid namespace collision.
  Submitted upstream.

* Initial release after rebasing against v2.6.30-rc3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1326
1326
                        AT_WRITE_REG(hw, REG_IMR,
1327
1327
                                     IMR_NORMAL_MASK & ~ISR_RX_EVENT);
1328
1328
                        AT_WRITE_FLUSH(hw);
1329
 
                        if (likely(netif_rx_schedule_prep(netdev,
 
1329
                        if (likely(napi_schedule_prep(
1330
1330
                                   &adapter->napi)))
1331
 
                                __netif_rx_schedule(netdev, &adapter->napi);
 
1331
                                __napi_schedule(&adapter->napi);
1332
1332
                }
1333
1333
        } while (--max_ints > 0);
1334
1334
        /* re-enable Interrupt*/
1460
1460
                                netif_receive_skb(skb);
1461
1461
                        }
1462
1462
 
1463
 
                        netdev->last_rx = jiffies;
1464
1463
skip_pkt:
1465
1464
        /* skip current packet whether it's ok or not. */
1466
1465
                        rx_page->read_offset +=
1502
1501
{
1503
1502
        struct atl1e_adapter *adapter =
1504
1503
                        container_of(napi, struct atl1e_adapter, napi);
1505
 
        struct net_device *netdev  = adapter->netdev;
1506
1504
        struct pci_dev    *pdev    = adapter->pdev;
1507
1505
        u32 imr_data;
1508
1506
        int work_done = 0;
1516
1514
        /* If no Tx and not enough Rx work done, exit the polling mode */
1517
1515
        if (work_done < budget) {
1518
1516
quit_polling:
1519
 
                netif_rx_complete(netdev, napi);
 
1517
                napi_complete(napi);
1520
1518
                imr_data = AT_READ_REG(&adapter->hw, REG_IMR);
1521
1519
                AT_WRITE_REG(&adapter->hw, REG_IMR, imr_data | ISR_RX_EVENT);
1522
1520
                /* test debug */
2254
2252
        atl1e_suspend(pdev, PMSG_SUSPEND);
2255
2253
}
2256
2254
 
 
2255
static const struct net_device_ops atl1e_netdev_ops = {
 
2256
        .ndo_open               = atl1e_open,
 
2257
        .ndo_stop               = atl1e_close,
 
2258
        .ndo_start_xmit         = atl1e_xmit_frame,
 
2259
        .ndo_get_stats          = atl1e_get_stats,
 
2260
        .ndo_set_multicast_list = atl1e_set_multi,
 
2261
        .ndo_validate_addr      = eth_validate_addr,
 
2262
        .ndo_set_mac_address    = atl1e_set_mac_addr,
 
2263
        .ndo_change_mtu         = atl1e_change_mtu,
 
2264
        .ndo_do_ioctl           = atl1e_ioctl,
 
2265
        .ndo_tx_timeout         = atl1e_tx_timeout,
 
2266
        .ndo_vlan_rx_register   = atl1e_vlan_rx_register,
 
2267
#ifdef CONFIG_NET_POLL_CONTROLLER
 
2268
        .ndo_poll_controller    = atl1e_netpoll,
 
2269
#endif
 
2270
 
 
2271
};
 
2272
 
2257
2273
static int atl1e_init_netdev(struct net_device *netdev, struct pci_dev *pdev)
2258
2274
{
2259
2275
        SET_NETDEV_DEV(netdev, &pdev->dev);
2260
2276
        pci_set_drvdata(pdev, netdev);
2261
2277
 
2262
2278
        netdev->irq  = pdev->irq;
2263
 
        netdev->open = &atl1e_open;
2264
 
        netdev->stop = &atl1e_close;
2265
 
        netdev->hard_start_xmit = &atl1e_xmit_frame;
2266
 
        netdev->get_stats = &atl1e_get_stats;
2267
 
        netdev->set_multicast_list = &atl1e_set_multi;
2268
 
        netdev->set_mac_address = &atl1e_set_mac_addr;
2269
 
        netdev->change_mtu = &atl1e_change_mtu;
2270
 
        netdev->do_ioctl = &atl1e_ioctl;
2271
 
        netdev->tx_timeout = &atl1e_tx_timeout;
 
2279
        netdev->netdev_ops = &atl1e_netdev_ops;
 
2280
 
2272
2281
        netdev->watchdog_timeo = AT_TX_WATCHDOG;
2273
 
        netdev->vlan_rx_register = atl1e_vlan_rx_register;
2274
 
#ifdef CONFIG_NET_POLL_CONTROLLER
2275
 
        netdev->poll_controller = atl1e_netpoll;
2276
 
#endif
2277
2282
        atl1e_set_ethtool_ops(netdev);
2278
2283
 
2279
2284
        netdev->features = NETIF_F_SG | NETIF_F_HW_CSUM |
2321
2326
         * various kernel subsystems to support the mechanics required by a
2322
2327
         * fixed-high-32-bit system.
2323
2328
         */
2324
 
        if ((pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) ||
2325
 
            (pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK) != 0)) {
 
2329
        if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0) ||
 
2330
            (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)) != 0)) {
2326
2331
                dev_err(&pdev->dev, "No usable DMA configuration,aborting\n");
2327
2332
                goto err_dma;
2328
2333
        }
2488
2493
atl1e_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
2489
2494
{
2490
2495
        struct net_device *netdev = pci_get_drvdata(pdev);
2491
 
        struct atl1e_adapter *adapter = netdev->priv;
 
2496
        struct atl1e_adapter *adapter = netdev_priv(netdev);
2492
2497
 
2493
2498
        netif_device_detach(netdev);
2494
2499
 
2511
2516
static pci_ers_result_t atl1e_io_slot_reset(struct pci_dev *pdev)
2512
2517
{
2513
2518
        struct net_device *netdev = pci_get_drvdata(pdev);
2514
 
        struct atl1e_adapter *adapter = netdev->priv;
 
2519
        struct atl1e_adapter *adapter = netdev_priv(netdev);
2515
2520
 
2516
2521
        if (pci_enable_device(pdev)) {
2517
2522
                dev_err(&pdev->dev,
2539
2544
static void atl1e_io_resume(struct pci_dev *pdev)
2540
2545
{
2541
2546
        struct net_device *netdev = pci_get_drvdata(pdev);
2542
 
        struct atl1e_adapter *adapter = netdev->priv;
 
2547
        struct atl1e_adapter *adapter = netdev_priv(netdev);
2543
2548
 
2544
2549
        if (netif_running(netdev)) {
2545
2550
                if (atl1e_up(adapter)) {