aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/patches-3.3/204-owrt-dm9000-polling.patch
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2012-05-09 12:52:21 +0000
committerJohn Crispin <john@openwrt.org>2012-05-09 12:52:21 +0000
commit75827c538d7ef4b013e50c021e3568a39e33c93b (patch)
tree35790696fa21eee8eef887131e0da1966bf8dea5 /target/linux/lantiq/patches-3.3/204-owrt-dm9000-polling.patch
parent7d638fbb2f7a896df8cbb3cc180db7c3c60d1233 (diff)
downloadupstream-75827c538d7ef4b013e50c021e3568a39e33c93b.tar.gz
upstream-75827c538d7ef4b013e50c021e3568a39e33c93b.tar.bz2
upstream-75827c538d7ef4b013e50c021e3568a39e33c93b.zip
Add missing 3.3 patches
SVN-Revision: 31671
Diffstat (limited to 'target/linux/lantiq/patches-3.3/204-owrt-dm9000-polling.patch')
-rw-r--r--target/linux/lantiq/patches-3.3/204-owrt-dm9000-polling.patch117
1 files changed, 117 insertions, 0 deletions
diff --git a/target/linux/lantiq/patches-3.3/204-owrt-dm9000-polling.patch b/target/linux/lantiq/patches-3.3/204-owrt-dm9000-polling.patch
new file mode 100644
index 0000000000..ff57422d55
--- /dev/null
+++ b/target/linux/lantiq/patches-3.3/204-owrt-dm9000-polling.patch
@@ -0,0 +1,117 @@
+--- a/drivers/net/ethernet/davicom/dm9000.c
++++ b/drivers/net/ethernet/davicom/dm9000.c
+@@ -19,6 +19,7 @@
+ * Sascha Hauer <s.hauer@pengutronix.de>
+ */
+
++#define DEBUG
+ #include <linux/module.h>
+ #include <linux/ioport.h>
+ #include <linux/netdevice.h>
+@@ -132,6 +133,8 @@ typedef struct board_info {
+ struct delayed_work phy_poll;
+ struct net_device *ndev;
+
++ struct delayed_work irq_poll; /* for use in irq polling mode */
++
+ spinlock_t lock;
+
+ struct mii_if_info mii;
+@@ -844,6 +847,8 @@ static void dm9000_timeout(struct net_de
+ netif_stop_queue(dev);
+ dm9000_reset(db);
+ dm9000_init_dm9000(dev);
++ dm9000_reset(db);
++ dm9000_init_dm9000(dev);
+ /* We can accept TX packets again */
+ dev->trans_start = jiffies; /* prevent tx timeout */
+ netif_wake_queue(dev);
+@@ -915,6 +920,12 @@ dm9000_start_xmit(struct sk_buff *skb, s
+ /* free this SKB */
+ dev_kfree_skb(skb);
+
++ /* directly poll afterwards */
++ if (dev->irq == -1) {
++ cancel_delayed_work(&db->irq_poll);
++ schedule_delayed_work(&db->irq_poll, 1);
++ }
++
+ return NETDEV_TX_OK;
+ }
+
+@@ -1156,6 +1167,18 @@ static void dm9000_poll_controller(struc
+ }
+ #endif
+
++static void dm9000_poll_irq(struct work_struct *w)
++{
++ struct delayed_work *dw = to_delayed_work(w);
++ board_info_t *db = container_of(dw, board_info_t, irq_poll);
++ struct net_device *ndev = db->ndev;
++
++ dm9000_interrupt(0, ndev);
++
++ if (netif_running(ndev))
++ schedule_delayed_work(&db->irq_poll, HZ /100);
++}
++
+ /*
+ * Open the interface.
+ * The interface is opened whenever "ifconfig" actives it.
+@@ -1169,14 +1192,15 @@ dm9000_open(struct net_device *dev)
+ if (netif_msg_ifup(db))
+ dev_dbg(db->dev, "enabling %s\n", dev->name);
+
+- /* If there is no IRQ type specified, default to something that
+- * may work, and tell the user that this is a problem */
++ if (dev->irq != -1) {
++ /* If there is no IRQ type specified, default to something that
++ * may work, and tell the user that this is a problem */
+
+- if (irqflags == IRQF_TRIGGER_NONE)
+- dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n");
+-
+- irqflags |= IRQF_SHARED;
++ if (irqflags == IRQF_TRIGGER_NONE)
++ dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n");
+
++ irqflags |= IRQF_SHARED;
++ }
+ /* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */
+ iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */
+ mdelay(1); /* delay needs by DM9000B */
+@@ -1185,8 +1209,14 @@ dm9000_open(struct net_device *dev)
+ dm9000_reset(db);
+ dm9000_init_dm9000(dev);
+
+- if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))
+- return -EAGAIN;
++ /* testing: init a second time */
++ dm9000_reset(db);
++ dm9000_init_dm9000(dev);
++
++ if (dev->irq != -1) {
++ if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))
++ return -EAGAIN;
++ }
+
+ /* Init driver variable */
+ db->dbug_cnt = 0;
+@@ -1194,6 +1224,9 @@ dm9000_open(struct net_device *dev)
+ mii_check_media(&db->mii, netif_msg_link(db), 1);
+ netif_start_queue(dev);
+
++ if (dev->irq == -1)
++ schedule_delayed_work(&db->irq_poll, HZ / 100);
++
+ dm9000_schedule_poll(db);
+
+ return 0;
+@@ -1391,6 +1424,7 @@ dm9000_probe(struct platform_device *pde
+ mutex_init(&db->addr_lock);
+
+ INIT_DELAYED_WORK(&db->phy_poll, dm9000_poll_work);
++ INIT_DELAYED_WORK(&db->irq_poll, dm9000_poll_irq);
+
+ db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);