aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-06-01 12:43:58 -0400
committerJeff Garzik <jeff@garzik.org>2007-06-03 11:44:19 -0400
commit3d4e66f5cd217160da9c3a2e3ec27b22e743bd25 (patch)
treee8b53f1ef8ae367f7b1b40f2a2584af017f6ab5b
parentd2d1acdb6a632486be9a731f40c68980c09f0490 (diff)
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>
-rw-r--r--drivers/net/sky2.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index adfbe81693a6..fe01b961b597 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1049,26 +1049,22 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp
1049 u16 port = sky2->port; 1049 u16 port = sky2->port;
1050 1050
1051 netif_tx_lock_bh(dev); 1051 netif_tx_lock_bh(dev);
1052 netif_poll_disable(sky2->hw->dev[0]);
1052 1053
1053 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_ON);
1054 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_ON);
1055 sky2->vlgrp = grp; 1054 sky2->vlgrp = grp;
1055 if (grp) {
1056 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
1057 RX_VLAN_STRIP_ON);
1058 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
1059 TX_VLAN_TAG_ON);
1060 } else {
1061 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
1062 RX_VLAN_STRIP_OFF);
1063 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
1064 TX_VLAN_TAG_OFF);
1065 }
1056 1066
1057 netif_tx_unlock_bh(dev); 1067 netif_poll_enable(sky2->hw->dev[0]);
1058}
1059
1060static void sky2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
1061{
1062 struct sky2_port *sky2 = netdev_priv(dev);
1063 struct sky2_hw *hw = sky2->hw;
1064 u16 port = sky2->port;
1065
1066 netif_tx_lock_bh(dev);
1067
1068 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_OFF);
1069 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_OFF);
1070 vlan_group_set_device(sky2->vlgrp, vid, NULL);
1071
1072 netif_tx_unlock_bh(dev); 1068 netif_tx_unlock_bh(dev);
1073} 1069}
1074#endif 1070#endif
@@ -3484,7 +3480,6 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
3484#ifdef SKY2_VLAN_TAG_USED 3480#ifdef SKY2_VLAN_TAG_USED
3485 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 3481 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
3486 dev->vlan_rx_register = sky2_vlan_rx_register; 3482 dev->vlan_rx_register = sky2_vlan_rx_register;
3487 dev->vlan_rx_kill_vid = sky2_vlan_rx_kill_vid;
3488#endif 3483#endif
3489 3484
3490 /* read the mac address */ 3485 /* read the mac address */