lkml.org 
[lkml]   [2006]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[RFC PATCH] move e1000 to pci_request_irq
    Hi,

    This proof-of-concept patch converts the e1000 driver to use the
    pci_request_irq() function.

    Please note that I'm not submitting the driver changes, they're there
    only for illustration purposes. I'll CC the appropriate maintainers
    when/if an API is agreed upon.

    Regards,
    Frederik


    diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
    index 778ede3..8b7be73 100644
    Index: 2.6.18-mm3/drivers/net/e1000/e1000_ethtool.c
    ===================================================================
    --- 2.6.18-mm3.orig/drivers/net/e1000/e1000_ethtool.c
    +++ 2.6.18-mm3/drivers/net/e1000/e1000_ethtool.c
    @@ -899,17 +899,16 @@ e1000_intr_test(struct e1000_adapter *ad
    {
    struct net_device *netdev = adapter->netdev;
    uint32_t mask, i=0, shared_int = TRUE;
    - uint32_t irq = adapter->pdev->irq;

    *data = 0;

    /* NOTE: we don't test MSI interrupts here, yet */
    /* Hook up test interrupt handler just for this test */
    - if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED,
    - netdev->name, netdev))
    + if (!pci_request_irq(adapter->pdev, &e1000_test_intr, IRQF_PROBE_SHARED,
    + netdev->name))
    shared_int = FALSE;
    - else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED,
    - netdev->name, netdev)) {
    + else if (pci_request_irq(adapter->pdev, &e1000_test_intr, IRQF_SHARED,
    + netdev->name)) {
    *data = 1;
    return -1;
    }
    @@ -986,7 +985,7 @@ e1000_intr_test(struct e1000_adapter *ad
    msleep(10);

    /* Unhook test interrupt handler */
    - free_irq(irq, netdev);
    + pci_free_irq(adapter->pdev);

    return *data;
    }
    Index: 2.6.18-mm3/drivers/net/e1000/e1000_main.c
    ===================================================================
    --- 2.6.18-mm3.orig/drivers/net/e1000/e1000_main.c
    +++ 2.6.18-mm3/drivers/net/e1000/e1000_main.c
    @@ -296,19 +296,13 @@ static int e1000_request_irq(struct e100
    if (adapter->have_msi)
    flags &= ~IRQF_SHARED;
    #endif
    - if ((err = request_irq(adapter->pdev->irq, &e1000_intr, flags,
    - netdev->name, netdev)))
    - DPRINTK(PROBE, ERR,
    - "Unable to allocate interrupt Error: %d\n", err);
    -
    + err = pci_request_irq(adapter->pdev, &e1000_intr, flags, netdev->name);
    return err;
    }

    static void e1000_free_irq(struct e1000_adapter *adapter)
    {
    - struct net_device *netdev = adapter->netdev;
    -
    - free_irq(adapter->pdev->irq, netdev);
    + pci_free_irq(adapter->pdev);

    #ifdef CONFIG_PCI_MSI
    if (adapter->have_msi)
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2006-10-04 00:27    [W:0.022 / U:60.428 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site