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 @@ -855,6 +858,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 @@ -926,6 +931,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 @@ -1167,6 +1178,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 @@ -1180,17 +1203,18 @@ 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");
73 + if (irqflags == IRQF_TRIGGER_NONE)
74 + dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n");
76 - irqflags |= IRQF_SHARED;
78 - if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))
80 + irqflags |= IRQF_SHARED;
82 + if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))
85 /* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */
86 iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */
87 mdelay(1); /* delay needs by DM9000B */
88 @@ -1198,13 +1222,19 @@ dm9000_open(struct net_device *dev)
89 /* Initialize DM9000 board */
91 dm9000_init_dm9000(dev);
92 + /* testing: init a second time */
94 + dm9000_init_dm9000(dev);
96 /* Init driver variable */
99 mii_check_media(&db->mii, netif_msg_link(db), 1);
100 netif_start_queue(dev);
103 + if (dev->irq == -1)
104 + schedule_delayed_work(&db->irq_poll, HZ / 100);
106 dm9000_schedule_poll(db);
109 @@ -1401,6 +1431,7 @@ dm9000_probe(struct platform_device *pde
110 mutex_init(&db->addr_lock);
112 INIT_DELAYED_WORK(&db->phy_poll, dm9000_poll_work);
113 + INIT_DELAYED_WORK(&db->irq_poll, dm9000_poll_irq);
115 db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
116 db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);