1 --- a/drivers/net/dm9000.c
2 +++ b/drivers/net/dm9000.c
4 * Sascha Hauer <s.hauer@pengutronix.de>
8 #include <linux/module.h>
9 #include <linux/ioport.h>
10 #include <linux/netdevice.h>
11 @@ -125,6 +126,8 @@ typedef struct board_info {
12 struct delayed_work phy_poll;
13 struct net_device *ndev;
15 + struct delayed_work irq_poll; /* for use in irq polling mode */
19 struct mii_if_info mii;
20 @@ -824,6 +827,8 @@ static void dm9000_timeout(struct net_de
21 netif_stop_queue(dev);
23 dm9000_init_dm9000(dev);
25 + dm9000_init_dm9000(dev);
26 /* We can accept TX packets again */
27 dev->trans_start = jiffies; /* prevent tx timeout */
28 netif_wake_queue(dev);
29 @@ -895,6 +900,12 @@ dm9000_start_xmit(struct sk_buff *skb, s
33 + /* directly poll afterwards */
34 + if (dev->irq == -1) {
35 + cancel_delayed_work(&db->irq_poll);
36 + schedule_delayed_work(&db->irq_poll, 1);
42 @@ -1136,6 +1147,18 @@ static void dm9000_poll_controller(struc
46 +static void dm9000_poll_irq(struct work_struct *w)
48 + struct delayed_work *dw = to_delayed_work(w);
49 + board_info_t *db = container_of(dw, board_info_t, irq_poll);
50 + struct net_device *ndev = db->ndev;
52 + dm9000_interrupt(0, ndev);
54 + if (netif_running(ndev))
55 + schedule_delayed_work(&db->irq_poll, HZ /100);
60 * The interface is opened whenever "ifconfig" actives it.
61 @@ -1149,14 +1172,15 @@ dm9000_open(struct net_device *dev)
62 if (netif_msg_ifup(db))
63 dev_dbg(db->dev, "enabling %s\n", dev->name);
65 - /* If there is no IRQ type specified, default to something that
66 - * may work, and tell the user that this is a problem */
67 + if (dev->irq != -1) {
68 + /* If there is no IRQ type specified, default to something that
69 + * may work, and tell the user that this is a problem */
71 - if (irqflags == IRQF_TRIGGER_NONE)
72 - dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n");
74 - irqflags |= IRQF_SHARED;
75 + if (irqflags == IRQF_TRIGGER_NONE)
76 + dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n");
78 + irqflags |= IRQF_SHARED;
80 /* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */
81 iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */
82 mdelay(1); /* delay needs by DM9000B */
83 @@ -1165,8 +1189,14 @@ dm9000_open(struct net_device *dev)
85 dm9000_init_dm9000(dev);
87 - if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))
89 + /* testing: init a second time */
91 + dm9000_init_dm9000(dev);
93 + if (dev->irq != -1) {
94 + if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))
98 /* Init driver variable */
100 @@ -1174,6 +1204,9 @@ dm9000_open(struct net_device *dev)
101 mii_check_media(&db->mii, netif_msg_link(db), 1);
102 netif_start_queue(dev);
104 + if (dev->irq == -1)
105 + schedule_delayed_work(&db->irq_poll, HZ / 100);
107 dm9000_schedule_poll(db);
110 @@ -1371,6 +1404,7 @@ dm9000_probe(struct platform_device *pde
111 mutex_init(&db->addr_lock);
113 INIT_DELAYED_WORK(&db->phy_poll, dm9000_poll_work);
114 + INIT_DELAYED_WORK(&db->irq_poll, dm9000_poll_irq);
116 db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
117 db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);