2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-23 01:51:58 +00:00

[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>
This commit is contained in:
Michael Brown 2012-04-23 10:47:11 +01:00
parent 44d5ef9d7d
commit 5b18489685

View 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 );