fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / net / tulip / timer.c
index e058a9f..df326fe 100644 (file)
@@ -1,7 +1,7 @@
 /*
        drivers/net/tulip/timer.c
 
-       Maintained by Jeff Garzik <jgarzik@pobox.com>
+       Maintained by Valerie Henson <val_henson@linux.intel.com>
        Copyright 2000,2001  The Linux Kernel Team
        Written/copyright 1994-2001 by Donald Becker.
 
 #include "tulip.h"
 
 
-void tulip_timer(unsigned long data)
+void tulip_media_task(struct work_struct *work)
 {
-       struct net_device *dev = (struct net_device *)data;
-       struct tulip_private *tp = netdev_priv(dev);
+       struct tulip_private *tp =
+               container_of(work, struct tulip_private, media_work);
+       struct net_device *dev = tp->dev;
        void __iomem *ioaddr = tp->base_addr;
        u32 csr12 = ioread32(ioaddr + CSR12);
        int next_tick = 2*HZ;
+       unsigned long flags;
 
        if (tulip_debug > 2) {
                printk(KERN_DEBUG "%s: Media selection tick, %s, status %8.8x mode"
@@ -126,6 +128,15 @@ void tulip_timer(unsigned long data)
        }
        break;
        }
+
+
+       spin_lock_irqsave(&tp->lock, flags);
+       if (tp->timeout_recovery) {
+               tulip_tx_timeout_complete(tp, ioaddr);
+               tp->timeout_recovery = 0;
+       }
+       spin_unlock_irqrestore(&tp->lock, flags);
+
        /* mod_timer synchronizes us with potential add_timer calls
         * from interrupts.
         */