Преглед изворни кода

[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>
tags/v1.20.1
Michael Brown пре 13 година
родитељ
комит
5b18489685
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3
    0
      src/drivers/net/realtek.c

+ 3
- 0
src/drivers/net/realtek.c Прегледај датотеку

426
 	/* Enable transmitter and receiver */
426
 	/* Enable transmitter and receiver */
427
 	writeb ( ( RTL_CR_TE | RTL_CR_RE ), rtl->regs + RTL_CR );
427
 	writeb ( ( RTL_CR_TE | RTL_CR_RE ), rtl->regs + RTL_CR );
428
 
428
 
429
+	/* Update link state */
430
+	realtek_check_link ( netdev );
431
+
429
 	return 0;
432
 	return 0;
430
 
433
 
431
 	realtek_destroy_ring ( rtl, &rtl->rx );
434
 	realtek_destroy_ring ( rtl, &rtl->rx );

Loading…
Откажи
Сачувај