summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/realtek.c
diff options
context:
space:
mode:
authorMichael Brown2012-04-23 11:47:11 +0200
committerMichael Brown2012-04-23 11:54:14 +0200
commit5b18489685e8424c42b93e3c2707c2c9ffa2fc31 (patch)
tree54608d9117fba8c2cae7b5ad0f5d812d6bcdcd9c /src/drivers/net/realtek.c
parent[netdevice] Allow network device to update link state before checking (diff)
downloadipxe-5b18489685e8424c42b93e3c2707c2c9ffa2fc31.tar.gz
ipxe-5b18489685e8424c42b93e3c2707c2c9ffa2fc31.tar.xz
ipxe-5b18489685e8424c42b93e3c2707c2c9ffa2fc31.zip
[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 <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/realtek.c')
-rw-r--r--src/drivers/net/realtek.c3
1 files changed, 3 insertions, 0 deletions
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 );