Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199209
b: refs/heads/master
c: 418bd0d
h: refs/heads/master
i:
  199207: a9c093b
v: v3
  • Loading branch information
Bryan Wu authored and David S. Miller committed May 28, 2010
1 parent afa13b7 commit 03bfd16
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b58ffb41fc09d1ffaca97e5ae801233575be2a7f
refs/heads/master: 418bd0d4dfbff25ffe4365ddd3e7cba8c70ccba8
28 changes: 16 additions & 12 deletions trunk/drivers/net/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,8 @@ static int fec_enet_mii_probe(struct net_device *dev)
struct phy_device *phy_dev = NULL;
int phy_addr;

fep->phy_dev = NULL;

/* find the first phy */
for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
if (fep->mii_bus->phy_map[phy_addr]) {
Expand Down Expand Up @@ -711,6 +713,11 @@ static int fec_enet_mii_probe(struct net_device *dev)
fep->link = 0;
fep->full_duplex = 0;

printk(KERN_INFO "%s: Freescale FEC PHY driver [%s] "
"(mii_bus:phy_addr=%s, irq=%d)\n", dev->name,
fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev),
fep->phy_dev->irq);

return 0;
}

Expand Down Expand Up @@ -756,13 +763,8 @@ static int fec_enet_mii_init(struct platform_device *pdev)
if (mdiobus_register(fep->mii_bus))
goto err_out_free_mdio_irq;

if (fec_enet_mii_probe(dev) != 0)
goto err_out_unregister_bus;

return 0;

err_out_unregister_bus:
mdiobus_unregister(fep->mii_bus);
err_out_free_mdio_irq:
kfree(fep->mii_bus->irq);
err_out_free_mdiobus:
Expand Down Expand Up @@ -915,7 +917,12 @@ fec_enet_open(struct net_device *dev)
if (ret)
return ret;

/* schedule a link state check */
/* Probe and connect to PHY when open the interface */
ret = fec_enet_mii_probe(dev);
if (ret) {
fec_enet_free_buffers(dev);
return ret;
}
phy_start(fep->phy_dev);
netif_start_queue(dev);
fep->opened = 1;
Expand All @@ -929,10 +936,12 @@ fec_enet_close(struct net_device *dev)

/* Don't know what to do yet. */
fep->opened = 0;
phy_stop(fep->phy_dev);
netif_stop_queue(dev);
fec_stop(dev);

if (fep->phy_dev)
phy_disconnect(fep->phy_dev);

fec_enet_free_buffers(dev);

return 0;
Expand Down Expand Up @@ -1316,11 +1325,6 @@ fec_probe(struct platform_device *pdev)
if (ret)
goto failed_register;

printk(KERN_INFO "%s: Freescale FEC PHY driver [%s] "
"(mii_bus:phy_addr=%s, irq=%d)\n", ndev->name,
fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev),
fep->phy_dev->irq);

return 0;

failed_register:
Expand Down

0 comments on commit 03bfd16

Please sign in to comment.