diff options
Diffstat (limited to 'drivers/net/mv643xx_eth.c')
-rw-r--r-- | drivers/net/mv643xx_eth.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 9ba21e0f27c5..8015a7c5b0c9 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -787,6 +787,12 @@ static int mv643xx_eth_open(struct net_device *dev) | |||
787 | unsigned int size; | 787 | unsigned int size; |
788 | int err; | 788 | int err; |
789 | 789 | ||
790 | /* Clear any pending ethernet port interrupts */ | ||
791 | mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0); | ||
792 | mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0); | ||
793 | /* wait for previous write to complete */ | ||
794 | mv_read (MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num)); | ||
795 | |||
790 | err = request_irq(dev->irq, mv643xx_eth_int_handler, | 796 | err = request_irq(dev->irq, mv643xx_eth_int_handler, |
791 | IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev); | 797 | IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev); |
792 | if (err) { | 798 | if (err) { |
@@ -875,10 +881,6 @@ static int mv643xx_eth_open(struct net_device *dev) | |||
875 | 881 | ||
876 | mv643xx_eth_rx_refill_descs(dev); /* Fill RX ring with skb's */ | 882 | mv643xx_eth_rx_refill_descs(dev); /* Fill RX ring with skb's */ |
877 | 883 | ||
878 | /* Clear any pending ethernet port interrupts */ | ||
879 | mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0); | ||
880 | mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0); | ||
881 | |||
882 | eth_port_start(dev); | 884 | eth_port_start(dev); |
883 | 885 | ||
884 | /* Interrupt Coalescing */ | 886 | /* Interrupt Coalescing */ |
@@ -1377,7 +1379,7 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
1377 | 1379 | ||
1378 | spin_lock_init(&mp->lock); | 1380 | spin_lock_init(&mp->lock); |
1379 | 1381 | ||
1380 | port_num = pd->port_number; | 1382 | port_num = mp->port_num = pd->port_number; |
1381 | 1383 | ||
1382 | /* set default config values */ | 1384 | /* set default config values */ |
1383 | eth_port_uc_addr_get(dev, dev->dev_addr); | 1385 | eth_port_uc_addr_get(dev, dev->dev_addr); |
@@ -1409,8 +1411,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
1409 | duplex = pd->duplex; | 1411 | duplex = pd->duplex; |
1410 | speed = pd->speed; | 1412 | speed = pd->speed; |
1411 | 1413 | ||
1412 | mp->port_num = port_num; | ||
1413 | |||
1414 | /* Hook up MII support for ethtool */ | 1414 | /* Hook up MII support for ethtool */ |
1415 | mp->mii.dev = dev; | 1415 | mp->mii.dev = dev; |
1416 | mp->mii.mdio_read = mv643xx_mdio_read; | 1416 | mp->mii.mdio_read = mv643xx_mdio_read; |
@@ -1514,9 +1514,23 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev) | |||
1514 | return 0; | 1514 | return 0; |
1515 | } | 1515 | } |
1516 | 1516 | ||
1517 | static void mv643xx_eth_shutdown(struct platform_device *pdev) | ||
1518 | { | ||
1519 | struct net_device *dev = platform_get_drvdata(pdev); | ||
1520 | struct mv643xx_private *mp = netdev_priv(dev); | ||
1521 | unsigned int port_num = mp->port_num; | ||
1522 | |||
1523 | /* Mask all interrupts on ethernet port */ | ||
1524 | mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num), 0); | ||
1525 | mv_read (MV643XX_ETH_INTERRUPT_MASK_REG(port_num)); | ||
1526 | |||
1527 | eth_port_reset(port_num); | ||
1528 | } | ||
1529 | |||
1517 | static struct platform_driver mv643xx_eth_driver = { | 1530 | static struct platform_driver mv643xx_eth_driver = { |
1518 | .probe = mv643xx_eth_probe, | 1531 | .probe = mv643xx_eth_probe, |
1519 | .remove = mv643xx_eth_remove, | 1532 | .remove = mv643xx_eth_remove, |
1533 | .shutdown = mv643xx_eth_shutdown, | ||
1520 | .driver = { | 1534 | .driver = { |
1521 | .name = MV643XX_ETH_NAME, | 1535 | .name = MV643XX_ETH_NAME, |
1522 | }, | 1536 | }, |