aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r--drivers/net/sky2.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index f226bcac7d17..c8a5ef2d75f4 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -118,6 +118,7 @@ static const struct pci_device_id sky2_id_table[] = {
118 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4352) }, /* 88E8038 */ 118 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4352) }, /* 88E8038 */
119 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */ 119 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */
120 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */ 120 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */
121 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4355) }, /* 88E8040T */
121 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */ 122 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */
122 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4357) }, /* 88E8042 */ 123 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4357) }, /* 88E8042 */
123 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */ 124 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */
@@ -1159,17 +1160,9 @@ static int sky2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1159} 1160}
1160 1161
1161#ifdef SKY2_VLAN_TAG_USED 1162#ifdef SKY2_VLAN_TAG_USED
1162static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) 1163static void sky2_set_vlan_mode(struct sky2_hw *hw, u16 port, bool onoff)
1163{ 1164{
1164 struct sky2_port *sky2 = netdev_priv(dev); 1165 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), 1166 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
1174 RX_VLAN_STRIP_ON); 1167 RX_VLAN_STRIP_ON);
1175 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), 1168 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
@@ -1180,6 +1173,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), 1173 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
1181 TX_VLAN_TAG_OFF); 1174 TX_VLAN_TAG_OFF);
1182 } 1175 }
1176}
1177
1178static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
1179{
1180 struct sky2_port *sky2 = netdev_priv(dev);
1181 struct sky2_hw *hw = sky2->hw;
1182 u16 port = sky2->port;
1183
1184 netif_tx_lock_bh(dev);
1185 napi_disable(&hw->napi);
1186
1187 sky2->vlgrp = grp;
1188 sky2_set_vlan_mode(hw, port, grp != NULL);
1183 1189
1184 sky2_read32(hw, B0_Y2_SP_LISR); 1190 sky2_read32(hw, B0_Y2_SP_LISR);
1185 napi_enable(&hw->napi); 1191 napi_enable(&hw->napi);
@@ -1418,6 +1424,10 @@ static int sky2_up(struct net_device *dev)
1418 sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map, 1424 sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map,
1419 TX_RING_SIZE - 1); 1425 TX_RING_SIZE - 1);
1420 1426
1427#ifdef SKY2_VLAN_TAG_USED
1428 sky2_set_vlan_mode(hw, port, sky2->vlgrp != NULL);
1429#endif
1430
1421 err = sky2_rx_start(sky2); 1431 err = sky2_rx_start(sky2);
1422 if (err) 1432 if (err)
1423 goto err_out; 1433 goto err_out;
@@ -4395,7 +4405,9 @@ static int sky2_resume(struct pci_dev *pdev)
4395 if (err) { 4405 if (err) {
4396 printk(KERN_ERR PFX "%s: could not up: %d\n", 4406 printk(KERN_ERR PFX "%s: could not up: %d\n",
4397 dev->name, err); 4407 dev->name, err);
4408 rtnl_lock();
4398 dev_close(dev); 4409 dev_close(dev);
4410 rtnl_unlock();
4399 goto out; 4411 goto out;
4400 } 4412 }
4401 } 4413 }