]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[realtek] Use ID word to detect EEPROM presence
authorMichael Brown <mcb30@ipxe.org>
Sun, 28 Apr 2013 17:50:10 +0000 (18:50 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sun, 28 Apr 2013 17:59:09 +0000 (18:59 +0100)
commitd90fc3156c57ba90156ceb4e33fda4a6a19ca382
treed6bf81fe4ebbe22e7db8cae60ce79ab9ea2f0565
parent1aca99f3cf46fc8551895b30d974ade52a2ba489
[realtek] Use ID word to detect EEPROM presence

Some onboard RTL8169 NICs seem to leave the EEPROM pins disconnected.
The existing is_valid_ether_addr() test will not necessarily catch
this, since it expects a missing EEPROM to show up as a MAC address of
00:00:00:00:00:00 or ff:ff:ff:ff:ff:ff.  When the EEPROM pins are
floating the MAC address may read as e.g. 00:00:00:00:0f:00, which
will not be detected as invalid.

Check the ID word in the first two bytes of the EEPROM (which should
have the value 0x8129 for all RTL8139 and RTL8169 chips), and use this
to determine whether or not an EEPROM is present.

Reported-by: Carl Karsten <carl@nextdayvideo.com>
Tested-by: Carl Karsten <carl@nextdayvideo.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/realtek.c
src/drivers/net/realtek.h