From 5b18489685e8424c42b93e3c2707c2c9ffa2fc31 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 23 Apr 2012 10:47:11 +0100 Subject: [PATCH] [realtek] Update link state when device is opened The link state is currently set at probe time, and updated only when the device is polled. This results in the user seeing a misleading stale "Link: down" message, if autonegotiation did not complete within the short timespan of the probe routine. Fix by updating the link state when the device is opened, so that the message that ends up being displayed to the user reflects the real link state at device open time. Signed-off-by: Michael Brown --- src/drivers/net/realtek.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drivers/net/realtek.c b/src/drivers/net/realtek.c index eb16cb71..5f111a68 100644 --- a/src/drivers/net/realtek.c +++ b/src/drivers/net/realtek.c @@ -426,6 +426,9 @@ static int realtek_open ( struct net_device *netdev ) { /* Enable transmitter and receiver */ writeb ( ( RTL_CR_TE | RTL_CR_RE ), rtl->regs + RTL_CR ); + /* Update link state */ + realtek_check_link ( netdev ); + return 0; realtek_destroy_ring ( rtl, &rtl->rx );