提交 29315e87 编写于 作者: M Michael Chan 提交者: David S. Miller

[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.
Signed-off-by: NMichael Chan <mchan@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3820c3f3
...@@ -8738,6 +8738,9 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) ...@@ -8738,6 +8738,9 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
{ {
struct tg3 *tp = netdev_priv(dev); struct tg3 *tp = netdev_priv(dev);
if (netif_running(dev))
tg3_netif_stop(tp);
tg3_full_lock(tp, 0); tg3_full_lock(tp, 0);
tp->vlgrp = grp; tp->vlgrp = grp;
...@@ -8746,16 +8749,25 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) ...@@ -8746,16 +8749,25 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
__tg3_set_rx_mode(dev); __tg3_set_rx_mode(dev);
tg3_full_unlock(tp); 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) static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
{ {
struct tg3 *tp = netdev_priv(dev); struct tg3 *tp = netdev_priv(dev);
if (netif_running(dev))
tg3_netif_stop(tp);
tg3_full_lock(tp, 0); tg3_full_lock(tp, 0);
if (tp->vlgrp) if (tp->vlgrp)
tp->vlgrp->vlan_devices[vid] = NULL; tp->vlgrp->vlan_devices[vid] = NULL;
tg3_full_unlock(tp); tg3_full_unlock(tp);
if (netif_running(dev))
tg3_netif_start(tp);
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册