sky2: Fix VLAN unregistration
Fix sky2 disabling VLAN completely when the first vid is unregistered. sky2 disables VLAN completely when the first VID is unregistered. It should instead disable VLAN when the group is unregistered by calling sky2_vlan_rx_register with grp = NULL. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> drivers/net/sky2.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Родитель
d2d1acdb6a
Коммит
3d4e66f5cd
|
@ -1049,26 +1049,22 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp
|
|||
u16 port = sky2->port;
|
||||
|
||||
netif_tx_lock_bh(dev);
|
||||
netif_poll_disable(sky2->hw->dev[0]);
|
||||
|
||||
sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_ON);
|
||||
sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_ON);
|
||||
sky2->vlgrp = grp;
|
||||
if (grp) {
|
||||
sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
|
||||
RX_VLAN_STRIP_ON);
|
||||
sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
|
||||
TX_VLAN_TAG_ON);
|
||||
} else {
|
||||
sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
|
||||
RX_VLAN_STRIP_OFF);
|
||||
sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
|
||||
TX_VLAN_TAG_OFF);
|
||||
}
|
||||
|
||||
netif_tx_unlock_bh(dev);
|
||||
}
|
||||
|
||||
static void sky2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
|
||||
{
|
||||
struct sky2_port *sky2 = netdev_priv(dev);
|
||||
struct sky2_hw *hw = sky2->hw;
|
||||
u16 port = sky2->port;
|
||||
|
||||
netif_tx_lock_bh(dev);
|
||||
|
||||
sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_OFF);
|
||||
sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_OFF);
|
||||
vlan_group_set_device(sky2->vlgrp, vid, NULL);
|
||||
|
||||
netif_poll_enable(sky2->hw->dev[0]);
|
||||
netif_tx_unlock_bh(dev);
|
||||
}
|
||||
#endif
|
||||
|
@ -3484,7 +3480,6 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
|
|||
#ifdef SKY2_VLAN_TAG_USED
|
||||
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
|
||||
dev->vlan_rx_register = sky2_vlan_rx_register;
|
||||
dev->vlan_rx_kill_vid = sky2_vlan_rx_kill_vid;
|
||||
#endif
|
||||
|
||||
/* read the mac address */
|
||||
|
|
Загрузка…
Ссылка в новой задаче