Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=771f7404a9deca902594823d616cd7a84f827982
Commit:     771f7404a9deca902594823d616cd7a84f827982
Parent:     418aea75246d5f83caa3a003fd66fe3b1aa01738
Author:     Olof Johansson <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:47:21 2007 -0500
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue May 8 01:47:53 2007 -0400

    pasemi_mac: Move the IRQ mapping from the PCI layer to the driver
    
    Fixes for ethernet IRQ mapping, to be done in the driver instead of in
    the platform setup code.
    
    Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/pasemi/pci.c   |   13 -------------
 arch/powerpc/platforms/pasemi/setup.c |    1 -
 drivers/net/pasemi_mac.c              |   30 +++++++++++++++++++++---------
 drivers/net/pasemi_mac.h              |    2 ++
 4 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/arch/powerpc/platforms/pasemi/pci.c 
b/arch/powerpc/platforms/pasemi/pci.c
index 056243d..bbc6dfc 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -173,19 +173,6 @@ static void __init pas_fixup_phb_resources(void)
 }
 
 
-void __devinit pas_pci_irq_fixup(struct pci_dev *dev)
-{
-       /* DMA is special, 84 interrupts (128 -> 211), all but 128
-        * need to be mapped by hand here.
-        */
-       if (dev->vendor == 0x1959 && dev->device == 0xa007) {
-               int i;
-               for (i = 129; i < 212; i++)
-                       irq_create_mapping(NULL, i);
-       }
-}
-
-
 void __init pas_pci_init(void)
 {
        struct device_node *np, *root;
diff --git a/arch/powerpc/platforms/pasemi/setup.c 
b/arch/powerpc/platforms/pasemi/setup.c
index f88f0ec..5bdd6ab 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -248,5 +248,4 @@ define_machine(pas) {
        .calibrate_decr         = generic_calibrate_decr,
        .progress               = pas_progress,
        .machine_check_exception = pas_machine_check_handler,
-       .pci_irq_fixup          = pas_pci_irq_fixup,
 };
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index bde8335..c7995d7 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -33,6 +33,8 @@
 #include <linux/tcp.h>
 #include <net/checksum.h>
 
+#include <asm/irq.h>
+
 #include "pasemi_mac.h"
 
 
@@ -531,6 +533,7 @@ static irqreturn_t pasemi_mac_tx_intr(int irq, void *data)
 static int pasemi_mac_open(struct net_device *dev)
 {
        struct pasemi_mac *mac = netdev_priv(dev);
+       int base_irq;
        unsigned int flags;
        int ret;
 
@@ -594,28 +597,37 @@ static int pasemi_mac_open(struct net_device *dev)
        netif_start_queue(dev);
        netif_poll_enable(dev);
 
-       ret = request_irq(mac->dma_pdev->irq + mac->dma_txch,
-                         &pasemi_mac_tx_intr, IRQF_DISABLED,
+       /* Interrupts are a bit different for our DMA controller: While
+        * it's got one a regular PCI device header, the interrupt there
+        * is really the base of the range it's using. Each tx and rx
+        * channel has it's own interrupt source.
+        */
+
+       base_irq = virq_to_hw(mac->dma_pdev->irq);
+
+       mac->tx_irq = irq_create_mapping(NULL, base_irq + mac->dma_txch);
+       mac->rx_irq = irq_create_mapping(NULL, base_irq + 20 + mac->dma_txch);
+
+       ret = request_irq(mac->tx_irq, &pasemi_mac_tx_intr, IRQF_DISABLED,
                          mac->tx->irq_name, dev);
        if (ret) {
                dev_err(&mac->pdev->dev, "request_irq of irq %d failed: %d\n",
-                      mac->dma_pdev->irq + mac->dma_txch, ret);
+                       base_irq + mac->dma_txch, ret);
                goto out_tx_int;
        }
 
-       ret = request_irq(mac->dma_pdev->irq + 20 + mac->dma_rxch,
-                         &pasemi_mac_rx_intr, IRQF_DISABLED,
+       ret = request_irq(mac->rx_irq, &pasemi_mac_rx_intr, IRQF_DISABLED,
                          mac->rx->irq_name, dev);
        if (ret) {
                dev_err(&mac->pdev->dev, "request_irq of irq %d failed: %d\n",
-                      mac->dma_pdev->irq + 20 + mac->dma_rxch, ret);
+                       base_irq + 20 + mac->dma_rxch, ret);
                goto out_rx_int;
        }
 
        return 0;
 
 out_rx_int:
-       free_irq(mac->dma_pdev->irq + mac->dma_txch, dev);
+       free_irq(mac->tx_irq, dev);
 out_tx_int:
        netif_poll_disable(dev);
        netif_stop_queue(dev);
@@ -699,8 +711,8 @@ static int pasemi_mac_close(struct net_device *dev)
        pci_write_config_dword(mac->dma_pdev,
                               PAS_DMA_RXINT_RCMDSTA(mac->dma_if), 0);
 
-       free_irq(mac->dma_pdev->irq + mac->dma_txch, dev);
-       free_irq(mac->dma_pdev->irq + 20 + mac->dma_rxch, dev);
+       free_irq(mac->tx_irq, dev);
+       free_irq(mac->rx_irq, dev);
 
        /* Free resources */
        pasemi_mac_free_rx_resources(dev);
diff --git a/drivers/net/pasemi_mac.h b/drivers/net/pasemi_mac.h
index c3e37e4..703f1b0 100644
--- a/drivers/net/pasemi_mac.h
+++ b/drivers/net/pasemi_mac.h
@@ -73,6 +73,8 @@ struct pasemi_mac {
 
        struct pasemi_mac_txring *tx;
        struct pasemi_mac_rxring *rx;
+       unsigned long   tx_irq;
+       unsigned long   rx_irq;
 };
 
 /* Software status descriptor (desc_info) */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to