aboutsummaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2012-04-23 10:47:11 +0100
committerMichael Brown <mcb30@ipxe.org>2012-04-23 10:54:14 +0100
commit5b18489685e8424c42b93e3c2707c2c9ffa2fc31 (patch)
tree54608d9117fba8c2cae7b5ad0f5d812d6bcdcd9c /src/drivers
parent44d5ef9d7d525edf4c9d8c7a5b8b09f6eb4143b9 (diff)
downloadipxe-5b18489685e8424c42b93e3c2707c2c9ffa2fc31.zip
ipxe-5b18489685e8424c42b93e3c2707c2c9ffa2fc31.tar.gz
ipxe-5b18489685e8424c42b93e3c2707c2c9ffa2fc31.tar.bz2
[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')
-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 eb16cb7..5f111a6 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 );