diff options
-rw-r--r-- | drivers/net/sky2.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index f226bcac7d17..3bb60530d4d7 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1159,17 +1159,9 @@ static int sky2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1159 | } | 1159 | } |
1160 | 1160 | ||
1161 | #ifdef SKY2_VLAN_TAG_USED | 1161 | #ifdef SKY2_VLAN_TAG_USED |
1162 | static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) | 1162 | static void sky2_set_vlan_mode(struct sky2_hw *hw, u16 port, bool onoff) |
1163 | { | 1163 | { |
1164 | struct sky2_port *sky2 = netdev_priv(dev); | 1164 | if (onoff) { |
1165 | struct sky2_hw *hw = sky2->hw; | ||
1166 | u16 port = sky2->port; | ||
1167 | |||
1168 | netif_tx_lock_bh(dev); | ||
1169 | napi_disable(&hw->napi); | ||
1170 | |||
1171 | sky2->vlgrp = grp; | ||
1172 | if (grp) { | ||
1173 | sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), | 1165 | sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), |
1174 | RX_VLAN_STRIP_ON); | 1166 | RX_VLAN_STRIP_ON); |
1175 | sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), | 1167 | sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), |
@@ -1180,6 +1172,19 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp | |||
1180 | sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), | 1172 | sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), |
1181 | TX_VLAN_TAG_OFF); | 1173 | TX_VLAN_TAG_OFF); |
1182 | } | 1174 | } |
1175 | } | ||
1176 | |||
1177 | static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) | ||
1178 | { | ||
1179 | struct sky2_port *sky2 = netdev_priv(dev); | ||
1180 | struct sky2_hw *hw = sky2->hw; | ||
1181 | u16 port = sky2->port; | ||
1182 | |||
1183 | netif_tx_lock_bh(dev); | ||
1184 | napi_disable(&hw->napi); | ||
1185 | |||
1186 | sky2->vlgrp = grp; | ||
1187 | sky2_set_vlan_mode(hw, port, grp != NULL); | ||
1183 | 1188 | ||
1184 | sky2_read32(hw, B0_Y2_SP_LISR); | 1189 | sky2_read32(hw, B0_Y2_SP_LISR); |
1185 | napi_enable(&hw->napi); | 1190 | napi_enable(&hw->napi); |
@@ -1418,6 +1423,10 @@ static int sky2_up(struct net_device *dev) | |||
1418 | sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map, | 1423 | sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map, |
1419 | TX_RING_SIZE - 1); | 1424 | TX_RING_SIZE - 1); |
1420 | 1425 | ||
1426 | #ifdef SKY2_VLAN_TAG_USED | ||
1427 | sky2_set_vlan_mode(hw, port, sky2->vlgrp != NULL); | ||
1428 | #endif | ||
1429 | |||
1421 | err = sky2_rx_start(sky2); | 1430 | err = sky2_rx_start(sky2); |
1422 | if (err) | 1431 | if (err) |
1423 | goto err_out; | 1432 | goto err_out; |