[PATCH 12/12] fec: call fec_restart() in fec_open()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Sascha Hauer
Date: Wednesday, April 15, 2009 - 4:32 am

We called fec_stop() in fec_enet_close(), thus we have to call
fec_restart() in fec_enet_open().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/fec.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 0e1d268..28db691 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1490,6 +1490,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);
@@ -1506,18 +1508,14 @@ 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);
 	}
 
+	/* 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;
-- 
1.6.2.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] FEC driver: patches for -next, Sascha Hauer, (Wed Apr 15, 4:32 am)
[PATCH 01/12] fec: remove unused ifdef, Sascha Hauer, (Wed Apr 15, 4:32 am)
[PATCH 02/12] fec: switch to writel/readl, Sascha Hauer, (Wed Apr 15, 4:32 am)
[PATCH 03/12] fec: do not typedef struct types, Sascha Hauer, (Wed Apr 15, 4:32 am)
[PATCH 04/12] fec: remove unnecessary cast, Sascha Hauer, (Wed Apr 15, 4:32 am)
[PATCH 05/12] fec: Codingstyle cleanups, Sascha Hauer, (Wed Apr 15, 4:32 am)
[PATCH 07/12] fec: refactor init function, Sascha Hauer, (Wed Apr 15, 4:32 am)
[PATCH 08/12] fec: align receive packets, Sascha Hauer, (Wed Apr 15, 4:32 am)
[PATCH 09/12] fec: remove debugging printks, Sascha Hauer, (Wed Apr 15, 4:32 am)
[PATCH 10/12] fec: switch to net_device_ops, Sascha Hauer, (Wed Apr 15, 4:32 am)
[PATCH 11/12] FEC Buffer rework, Sascha Hauer, (Wed Apr 15, 4:32 am)
[PATCH 12/12] fec: call fec_restart() in fec_open(), Sascha Hauer, (Wed Apr 15, 4:32 am)
Re: [PATCH] FEC driver: patches for -next, Greg Ungerer, (Wed Apr 15, 5:12 am)
Re: [PATCH] FEC driver: patches for -next, Sascha Hauer, (Wed Apr 15, 5:55 am)
Re: [PATCH 02/12] fec: switch to writel/readl, Sascha Hauer, (Wed Apr 15, 6:11 am)
Re: [PATCH 02/12] fec: switch to writel/readl, David Miller, (Thu Apr 16, 2:36 am)
Re: [PATCH 03/12] fec: do not typedef struct types, David Miller, (Thu Apr 16, 2:36 am)
Re: [PATCH 04/12] fec: remove unnecessary cast, David Miller, (Thu Apr 16, 2:36 am)
Re: [PATCH 05/12] fec: Codingstyle cleanups, David Miller, (Thu Apr 16, 2:36 am)
Re: [PATCH 07/12] fec: refactor init function, David Miller, (Thu Apr 16, 2:37 am)
Re: [PATCH 08/12] fec: align receive packets, David Miller, (Thu Apr 16, 2:37 am)
Re: [PATCH 09/12] fec: remove debugging printks, David Miller, (Thu Apr 16, 2:37 am)
Re: [PATCH 10/12] fec: switch to net_device_ops, David Miller, (Thu Apr 16, 2:37 am)
Re: [PATCH 11/12] FEC Buffer rework, David Miller, (Thu Apr 16, 2:38 am)
Re: [PATCH 12/12] fec: call fec_restart() in fec_open(), David Miller, (Thu Apr 16, 2:38 am)
Re: [PATCH 11/12] FEC Buffer rework, Greg Ungerer, (Fri Apr 17, 3:07 am)
Re: [PATCH 11/12] FEC Buffer rework, Sascha Hauer, (Fri Apr 17, 3:12 am)