Skip to content

Commit

Permalink
[TG3]: Add tg3_netif_stop() in vlan functions
Browse files Browse the repository at this point in the history
Add tg3_netif_stop() when changing the vlgrp (vlan group) pointer. It
is necessary to quiesce the device before changing that pointer.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael Chan authored and David S. Miller committed Jun 30, 2006
1 parent 3820c3f commit 29315e8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -8738,6 +8738,9 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
{
struct tg3 *tp = netdev_priv(dev);

if (netif_running(dev))
tg3_netif_stop(tp);

tg3_full_lock(tp, 0);

tp->vlgrp = grp;
Expand All @@ -8746,16 +8749,25 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
__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

Expand Down

0 comments on commit 29315e8

Please sign in to comment.