Skip to contentSkip to conversation

tg3: Add tg3_netif_stop() in vlan functions

PATCH Applied Michael Chan 2 participants 2 messages Jun 30, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 tg3: Add tg3_netif_stop() in vlan functions

Add tg3_netif_stop() when changing the vlgrp (vlan group) pointer. It is necessary to quiesce the device before changing that pointer.

drivers/net/tg3.c +12 -0
index 35f9316..2447fa3 100644
@@ -8738,6 +8738,9 @@ static void tg3_vlan_rx_register(struct 
 {
 	struct tg3 *tp = netdev_priv(dev);
 
+	if (netif_running(dev))
+		tg3_netif_stop(tp);
+
 	tg3_full_lock(tp, 0);
 
 	tp->vlgrp = grp;
@@ -8746,16 +8749,25 @@ static void tg3_vlan_rx_register(struct 
 	__tg3_set_rx_mode(dev);
 
 	tg3_full_unlock(tp);
+
+	if (netif_running(dev))
+		tg3_netif_start(tp);
 }
 
 static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
 {
 	struct tg3 *tp = netdev_priv(dev);
 
+	if (netif_running(dev))
+		tg3_netif_stop(tp);
+
 	tg3_full_lock(tp, 0);
 	if (tp->vlgrp)
 		tp->vlgrp->vlan_devices[vid] = NULL;
 	tg3_full_unlock(tp);
+
+	if (netif_running(dev))
+		tg3_netif_start(tp);
 }
 #endif
 
maintainer Applied
#1 lore raw

From: "Michael Chan" <[email protected]>
Date: Thu, 29 Jun 2006 18:29:06 -0700

Quoted 4 lines

Add tg3_netif_stop() when changing the vlgrp (vlan group) pointer. It is necessary to quiesce the device before changing that pointer.

Good catch.

Applied, thanks a lot Michael.