summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDinh Nguyen <r00091@freescale.com>2009-10-07 13:39:43 -0500
committerDinh Nguyen <r00091@freescale.com>2009-10-07 13:41:40 -0500
commit1ec9dda193c7ff86941b95280e939ba5e95c7d56 (patch)
tree2caa1a6aa346a0fad0b4b9e7762026d8e549bd61
parent8f0b65432965243a8dd29b3679df85bc6d4ff176 (diff)
ENGR00117104 FEC driver does not restart properly
After doing an ifconfig ethX up to bring ethernet driver up, followed by an ifconfig ethX down to bring the ethernet driver down, the ethernet driver does not restart properly by doing ifconfig ethX up. The fix is the restart the fec driver in the fec_enet_open() function. Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
-rw-r--r--drivers/net/fec.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 13ce706e4253..7dc0015f6f89 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -2622,6 +2622,8 @@ fec_enet_open(struct net_device *dev)
fep->sequence_done = 0;
fep->link = 0;
+ fec_restart(dev, 1);
+
if (fep->phy) {
mii_do_cmd(dev, fep->phy->ack_int);
mii_do_cmd(dev, fep->phy->config);
@@ -2638,20 +2640,16 @@ fec_enet_open(struct net_device *dev)
schedule();
mii_do_cmd(dev, fep->phy->startup);
-
- /* Set the initial link state to true. A lot of hardware
- * based on this device does not implement a PHY interrupt,
- * so we are never notified of link change.
- */
- fep->link = 1;
- } else {
- fep->link = 1; /* lets just try it and see */
- /* no phy, go full duplex, it's most likely a hub chip */
- fec_restart(dev, 1);
}
- fep->opened = 1;
+ /* Set the initial link state to true. A lot of hardware
+ * based on this device does not implement a PHY interrupt,
+ * so we are never notified of link change.
+ */
+ fep->link = 1;
+
netif_start_queue(dev);
+ fep->opened = 1;
return 0; /* Success */
}