[realtek] Do not attempt to access EEPROM on RTL8169 chips
authorMichael Brown <mcb30@ipxe.org>
Tue, 21 Apr 2015 16:42:36 +0000 (17:42 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 21 Apr 2015 16:42:36 +0000 (17:42 +0100)
commiteda1c58358d64e339cdfd4b983a9de9ec01e83db
tree548899a1b86b832341e0cb12d2166ef5dfce2966
parent8958f62a1c85ff6b449a685a729b61b9ea69f50a
[realtek] Do not attempt to access EEPROM on RTL8169 chips

On some RTL8169 onboard NICs (observed with a Lenovo ThinkPad 11e),
the EEPROM is not merely not present: any attempt to read from the
non-existent EEPROM will crash and reboot the system.

The equivalent code to read from the EEPROM was removed from the Linux
r8169 driver in 2009 with a comment suggesting that it was similarly
found to be unreliable on some systems.

Fix by accessing the EEPROM only on RTL8139 NICs, and assuming that
the MAC address will always be correctly preset on RTL8169 NICs.

Reported-by: Evan Prohaska <eprohaska@edkey.org>
Tested-by: Evan Prohaska <eprohaska@edkey.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/realtek.c