mirror of
https://github.com/opnsense/src.git
synced 2026-06-19 21:49:14 -04:00
Make sure to read the last byte of EEPROM descriptor. Previously
the last byte of the ethernet address was not read which in turn resulted in getting 5 out of the 6 bytes of ethernet address and always returned ENOENT. I did not notice the bug on FPGA version because of additional configuration data in EEPROM. Pointed out by: bouyer at NetBSD
This commit is contained in:
parent
1b0fa6fa40
commit
08c23fcaae
1 changed files with 5 additions and 5 deletions
|
|
@ -415,11 +415,8 @@ jme_eeprom_macaddr(struct jme_softc *sc)
|
|||
do {
|
||||
if (jme_eeprom_read_byte(sc, offset, &fup) != 0)
|
||||
break;
|
||||
/* Check for the end of EEPROM descriptor. */
|
||||
if ((fup & JME_EEPROM_DESC_END) == JME_EEPROM_DESC_END)
|
||||
break;
|
||||
if ((uint8_t)JME_EEPROM_MKDESC(JME_EEPROM_FUNC0,
|
||||
JME_EEPROM_PAGE_BAR1) == fup) {
|
||||
if (JME_EEPROM_MKDESC(JME_EEPROM_FUNC0, JME_EEPROM_PAGE_BAR1) ==
|
||||
(fup & (JME_EEPROM_FUNC_MASK | JME_EEPROM_PAGE_MASK))) {
|
||||
if (jme_eeprom_read_byte(sc, offset + 1, ®) != 0)
|
||||
break;
|
||||
if (reg >= JME_PAR0 &&
|
||||
|
|
@ -431,6 +428,9 @@ jme_eeprom_macaddr(struct jme_softc *sc)
|
|||
match++;
|
||||
}
|
||||
}
|
||||
/* Check for the end of EEPROM descriptor. */
|
||||
if ((fup & JME_EEPROM_DESC_END) == JME_EEPROM_DESC_END)
|
||||
break;
|
||||
/* Try next eeprom descriptor. */
|
||||
offset += JME_EEPROM_DESC_BYTES;
|
||||
} while (match != ETHER_ADDR_LEN && offset < JME_EEPROM_END);
|
||||
|
|
|
|||
Loading…
Reference in a new issue