aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-3.6/420-BCM63XX-allow-enetsw-without-tx-irq.patch
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2012-10-25 21:16:51 +0000
committerFlorian Fainelli <florian@openwrt.org>2012-10-25 21:16:51 +0000
commit8d69af7c9fff947e2e53ba955cf6c84df3f1391e (patch)
tree192a79439e8d6b82dd39af6ac6f019c472cdc1c3 /target/linux/brcm63xx/patches-3.6/420-BCM63XX-allow-enetsw-without-tx-irq.patch
parent6a699a8ae80b5b6ff6559bad1297242c8daf8934 (diff)
downloadupstream-8d69af7c9fff947e2e53ba955cf6c84df3f1391e.tar.gz
upstream-8d69af7c9fff947e2e53ba955cf6c84df3f1391e.tar.bz2
upstream-8d69af7c9fff947e2e53ba955cf6c84df3f1391e.zip
add preliminary support for 3.6 kernel
SVN-Revision: 33936
Diffstat (limited to 'target/linux/brcm63xx/patches-3.6/420-BCM63XX-allow-enetsw-without-tx-irq.patch')
-rw-r--r--target/linux/brcm63xx/patches-3.6/420-BCM63XX-allow-enetsw-without-tx-irq.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-3.6/420-BCM63XX-allow-enetsw-without-tx-irq.patch b/target/linux/brcm63xx/patches-3.6/420-BCM63XX-allow-enetsw-without-tx-irq.patch
new file mode 100644
index 0000000000..6396b626df
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.6/420-BCM63XX-allow-enetsw-without-tx-irq.patch
@@ -0,0 +1,69 @@
+From 625894c377ba266c0044675b53f05d65db6355b6 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jonas.gorski@gmail.com>
+Date: Sun, 8 Jul 2012 13:07:52 +0200
+Subject: [PATCH 38/84] BCM63XX: allow enetsw without tx irq
+
+---
+ arch/mips/bcm63xx/dev-enet.c | 2 ++
+ drivers/net/ethernet/broadcom/bcm63xx_enet.c | 18 +++++++++++-------
+ 2 files changed, 13 insertions(+), 7 deletions(-)
+
+--- a/arch/mips/bcm63xx/dev-enet.c
++++ b/arch/mips/bcm63xx/dev-enet.c
+@@ -236,6 +236,8 @@ bcm63xx_enetsw_register(const struct bcm
+ enetsw_res[0].end += RSET_ENETSW_SIZE - 1;
+ enetsw_res[1].start = bcm63xx_get_irq_number(IRQ_ENETSW_RXDMA0);
+ enetsw_res[2].start = bcm63xx_get_irq_number(IRQ_ENETSW_TXDMA0);
++ if (!enetsw_res[2].start)
++ enetsw_res[2].start = -1;
+
+ memcpy(bcm63xx_enetsw_device.dev.platform_data, pd, sizeof (*pd));
+
+--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+@@ -2151,10 +2151,12 @@ static int bcm_enetsw_open(struct net_de
+ if (ret)
+ goto out_freeirq;
+
+- ret = request_irq(priv->irq_tx, bcm_enet_isr_dma,
+- IRQF_DISABLED, dev->name, dev);
+- if (ret)
+- goto out_freeirq_rx;
++ if (priv->irq_tx != -1) {
++ ret = request_irq(priv->irq_tx, bcm_enet_isr_dma,
++ IRQF_DISABLED, dev->name, dev);
++ if (ret)
++ goto out_freeirq_rx;
++ }
+
+ /* allocate rx dma ring */
+ size = priv->rx_ring_size * sizeof(struct bcm_enet_desc);
+@@ -2376,7 +2378,8 @@ out_free_rx_ring:
+ priv->rx_desc_cpu, priv->rx_desc_dma);
+
+ out_freeirq_tx:
+- free_irq(priv->irq_tx, dev);
++ if (priv->irq_tx != -1)
++ free_irq(priv->irq_tx, dev);
+
+ out_freeirq_rx:
+ free_irq(priv->irq_rx, dev);
+@@ -2433,7 +2436,8 @@ static int bcm_enetsw_stop(struct net_de
+ priv->rx_desc_cpu, priv->rx_desc_dma);
+ dma_free_coherent(kdev, priv->tx_desc_alloc_size,
+ priv->tx_desc_cpu, priv->tx_desc_dma);
+- free_irq(priv->irq_tx, dev);
++ if (priv->irq_tx != -1)
++ free_irq(priv->irq_tx, dev);
+ free_irq(priv->irq_rx, dev);
+
+ return 0;
+@@ -2716,7 +2720,7 @@ static int __devinit bcm_enetsw_probe(st
+ res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ irq_rx = platform_get_irq(pdev, 0);
+ irq_tx = platform_get_irq(pdev, 1);
+- if (!res_mem || irq_rx < 0 || irq_tx < 0)
++ if (!res_mem || irq_rx < 0)
+ return -ENODEV;
+
+ ret = 0;