Index: drivers/net/3c59x.c =================================================================== RCS file: /opt/cvs/lk/drivers/net/3c59x.c,v retrieving revision 1.21 diff -u -u -r1.21 3c59x.c --- drivers/net/3c59x.c 2001/01/23 08:25:53 1.21 +++ drivers/net/3c59x.c 2001/01/25 00:23:11 @@ -220,6 +220,8 @@ static char version[] __devinitdata = "3c59x.c:LK1.1.13 14 Jan 2001 Donald Becker and others. http://www.scyld.com/network/vortex.html\n"; +static int whacker = 0; + MODULE_AUTHOR("Donald Becker "); MODULE_DESCRIPTION("3Com 3c59x/3c90x/3c575 series Vortex/Boomerang/Cyclone driver"); MODULE_PARM(debug, "i"); @@ -232,6 +234,7 @@ MODULE_PARM(compaq_irq, "i"); MODULE_PARM(compaq_device_id, "i"); MODULE_PARM(watchdog, "i"); +MODULE_PARM(whacker, "i"); /* Operational parameter that usually are not changed. */ @@ -775,6 +778,41 @@ static int vortex_cards_found; +static volatile int run_thread, thread_running;; + +static int kthread(void *arg) +{ + struct net_device *dev = arg; + + printk("kthread running\n"); + thread_running = 1; + while (run_thread) { + disable_irq(dev->irq); + udelay(5); + schedule(); + enable_irq(dev->irq); + udelay(5); + } + printk("kthread stops\n"); + thread_running = 0; + return 0; +} + +static void start_irq_whacker(struct net_device *dev) +{ + run_thread = 1; + thread_running = 0; + if (whacker) + kernel_thread(kthread, dev, 0); +} + +static void stop_irq_whacker(struct net_device *dev) +{ + run_thread = 0; + while (thread_running) + ; +} + static void vortex_suspend (struct pci_dev *pdev) { struct net_device *dev = pdev->driver_data; @@ -1421,6 +1459,7 @@ if (vp->cb_fn_base) /* The PCMCIA people are idiots. */ writel(0x8000, vp->cb_fn_base + 4); netif_start_queue (dev); + start_irq_whacker(dev); } static int @@ -2298,6 +2337,8 @@ { struct vortex_private *vp = (struct vortex_private *)dev->priv; long ioaddr = dev->base_addr; + + stop_irq_whacker(dev); netif_stop_queue (dev);