aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/jme.c
diff options
context:
space:
mode:
authorGuo-Fu Tseng <cooldavid@cooldavid.org>2010-10-18 10:10:40 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-21 06:52:09 -0400
commitc8a8684d5cfb0f110a962c93586630c0bf91ebc1 (patch)
tree0569ece32522a40053b4366afbcdd3b7002082bc /drivers/net/jme.c
parent7bfc47532301a84c575cfc20b4531f5de5c326bc (diff)
jme: Fix PHY power-off error
Adding phy_on in opposition to phy_off. Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org> Cc: <stable@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/jme.c')
-rw-r--r--drivers/net/jme.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index c04c096bc6a9..e04f180965ae 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -1574,6 +1574,16 @@ jme_free_irq(struct jme_adapter *jme)
1574 } 1574 }
1575} 1575}
1576 1576
1577static inline void
1578jme_phy_on(struct jme_adapter *jme)
1579{
1580 u32 bmcr;
1581
1582 bmcr = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_BMCR);
1583 bmcr &= ~BMCR_PDOWN;
1584 jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_BMCR, bmcr);
1585}
1586
1577static int 1587static int
1578jme_open(struct net_device *netdev) 1588jme_open(struct net_device *netdev)
1579{ 1589{
@@ -1594,10 +1604,12 @@ jme_open(struct net_device *netdev)
1594 1604
1595 jme_start_irq(jme); 1605 jme_start_irq(jme);
1596 1606
1597 if (test_bit(JME_FLAG_SSET, &jme->flags)) 1607 if (test_bit(JME_FLAG_SSET, &jme->flags)) {
1608 jme_phy_on(jme);
1598 jme_set_settings(netdev, &jme->old_ecmd); 1609 jme_set_settings(netdev, &jme->old_ecmd);
1599 else 1610 } else {
1600 jme_reset_phy_processor(jme); 1611 jme_reset_phy_processor(jme);
1612 }
1601 1613
1602 jme_reset_link(jme); 1614 jme_reset_link(jme);
1603 1615
@@ -3005,10 +3017,12 @@ jme_resume(struct pci_dev *pdev)
3005 jme_clear_pm(jme); 3017 jme_clear_pm(jme);
3006 pci_restore_state(pdev); 3018 pci_restore_state(pdev);
3007 3019
3008 if (test_bit(JME_FLAG_SSET, &jme->flags)) 3020 if (test_bit(JME_FLAG_SSET, &jme->flags)) {
3021 jme_phy_on(jme);
3009 jme_set_settings(netdev, &jme->old_ecmd); 3022 jme_set_settings(netdev, &jme->old_ecmd);
3010 else 3023 } else {
3011 jme_reset_phy_processor(jme); 3024 jme_reset_phy_processor(jme);
3025 }
3012 3026
3013 jme_start_irq(jme); 3027 jme_start_irq(jme);
3014 netif_device_attach(netdev); 3028 netif_device_attach(netdev);