[PATCH] starfire fix for 2.4.2ac

Ion Badulescu (ionut@cs.columbia.edu)
Thu, 22 Feb 2001 14:57:05 -0800 (PST)


Hi Alan,

This patch fixes a problem doing ifconfig up, down and then up again, and
getting ENODEV. That broke pump, among other things.

Please apply.

Thanks,
Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.
--------------------------------------
--- /mnt/3/linux-2.4-ac/drivers/net/starfire.c	Mon Feb 19 14:35:01 2001
+++ linux-2.4/drivers/net/starfire.c	Thu Feb 22 14:19:33 2001
@@ -52,6 +52,9 @@
 	LK1.2.5 (Ion Badulescu)
 	- Several fixes from Manfred Spraul
 
+	LK1.2.6 (Ion Badulescu)
+	- Fixed ifup/ifdown/ifup problem in 2.4.x
+
 TODO:
 	- implement tx_timeout() properly
 	- support ethtool
@@ -64,7 +67,7 @@
 " Updates and info at http://www.scyld.com/network/starfire.html\n";
 
 static const char version3[] =
-" (unofficial 2.4.x kernel port, version 1.2.5, February 15, 2001)\n";
+" (unofficial 2.4.x kernel port, version 1.2.6, February 22, 2001)\n";
 
 /* The user-configurable values.
    These may be modified when a driver module is loaded.*/
@@ -486,6 +489,9 @@
 			func(dev); \
 	}
 
+#define netif_start_if(dev)	dev->start = 1
+#define netif_stop_if(dev)	dev->start = 0
+
 #else  /* LINUX_VERSION_CODE > 0x20300 */
 
 #define COMPAT_MOD_INC_USE_COUNT
@@ -496,6 +502,8 @@
 	dev->watchdog_timeo = timeout;
 #define kick_tx_timer(dev, func, timeout)
 
+#define netif_start_if(dev)
+#define netif_stop_if(dev)
 
 #endif /* LINUX_VERSION_CODE > 0x20300 */
 /* end of compatibility code */
@@ -1041,6 +1049,7 @@
 	if (dev->if_port == 0)
 		dev->if_port = np->default_port;
 
+	netif_start_if(dev);
 	netif_start_queue(dev);
 
 	if (debug > 1)
@@ -1712,7 +1721,8 @@
 	struct netdev_private *np = dev->priv;
 	int i;
 
-	netif_device_detach(dev);
+	netif_stop_queue(dev);
+	netif_start_if(dev);
 
 	del_timer_sync(&np->timer);
 

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/