]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[realtek] Update link state when device is opened
authorMichael Brown <mcb30@ipxe.org>
Mon, 23 Apr 2012 09:47:11 +0000 (10:47 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 23 Apr 2012 09:54:14 +0000 (10:54 +0100)
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>
src/drivers/net/realtek.c

index eb16cb71b822656d9881ea2d809482ba49d7d9b8..5f111a683539a1bb2280da9398fbc04732d8a0ed 100644 (file)
@@ -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 );