]> err.no Git - linux-2.6/blobdiff - drivers/net/b44.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[linux-2.6] / drivers / net / b44.c
index ecc2e32c38c1f55c92c0c2b7ff2159461f66d8ad..c53848f787ebb600632d4f8b05964de4b7b919dd 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/init.h>
-#include <linux/version.h>
 #include <linux/dma-mapping.h>
 
 #include <asm/uaccess.h>
@@ -29,8 +28,8 @@
 
 #define DRV_MODULE_NAME                "b44"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "0.95"
-#define DRV_MODULE_RELDATE     "Aug 3, 2004"
+#define DRV_MODULE_VERSION     "0.96"
+#define DRV_MODULE_RELDATE     "Nov 8, 2005"
 
 #define B44_DEF_MSG_ENABLE       \
        (NETIF_MSG_DRV          | \
@@ -909,6 +908,12 @@ static irqreturn_t b44_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        istat &= imask;
        if (istat) {
                handled = 1;
+
+               if (unlikely(!netif_running(dev))) {
+                       printk(KERN_INFO "%s: late interrupt.\n", dev->name);
+                       goto irq_ack;
+               }
+
                if (netif_rx_schedule_prep(dev)) {
                        /* NOTE: These writes are posted by the readback of
                         *       the ISTAT register below.
@@ -921,6 +926,7 @@ static irqreturn_t b44_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                               dev->name);
                }
 
+irq_ack:
                bw32(bp, B44_ISTAT, istat);
                br32(bp, B44_ISTAT);
        }
@@ -1392,7 +1398,6 @@ static int b44_open(struct net_device *dev)
 
        b44_init_rings(bp);
        b44_init_hw(bp);
-       bp->flags |= B44_FLAG_INIT_COMPLETE;
 
        netif_carrier_off(dev);
        b44_check_phy(bp);
@@ -1447,6 +1452,8 @@ static int b44_close(struct net_device *dev)
 
        netif_stop_queue(dev);
 
+       netif_poll_disable(dev);
+
        del_timer_sync(&bp->timer);
 
        spin_lock_irq(&bp->lock);
@@ -1456,13 +1463,14 @@ static int b44_close(struct net_device *dev)
 #endif
        b44_halt(bp);
        b44_free_rings(bp);
-       bp->flags &= ~B44_FLAG_INIT_COMPLETE;
        netif_carrier_off(bp->dev);
 
        spin_unlock_irq(&bp->lock);
 
        free_irq(dev->irq, dev);
 
+       netif_poll_enable(dev);
+
        b44_free_consistent(bp);
 
        return 0;
@@ -1608,7 +1616,7 @@ static int b44_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
        struct b44 *bp = netdev_priv(dev);
 
-       if (!(bp->flags & B44_FLAG_INIT_COMPLETE))
+       if (!netif_running(dev))
                return -EAGAIN;
        cmd->supported = (SUPPORTED_Autoneg);
        cmd->supported |= (SUPPORTED_100baseT_Half |
@@ -1646,7 +1654,7 @@ static int b44_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
        struct b44 *bp = netdev_priv(dev);
 
-       if (!(bp->flags & B44_FLAG_INIT_COMPLETE))
+       if (!netif_running(dev))
                return -EAGAIN;
 
        /* We do not support gigabit. */