diff options
Diffstat (limited to 'sys/dev/pci/if_jme.c')
-rw-r--r-- | sys/dev/pci/if_jme.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/pci/if_jme.c b/sys/dev/pci/if_jme.c index b9805950387..1f0b37569dc 100644 --- a/sys/dev/pci/if_jme.c +++ b/sys/dev/pci/if_jme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_jme.c,v 1.10 2008/10/21 19:39:43 brad Exp $ */ +/* $OpenBSD: if_jme.c,v 1.11 2008/10/21 19:41:13 brad Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org> * All rights reserved. @@ -435,11 +435,8 @@ jme_eeprom_macaddr(struct jme_softc *sc, uint8_t eaddr[]) 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 && @@ -451,6 +448,9 @@ jme_eeprom_macaddr(struct jme_softc *sc, uint8_t eaddr[]) 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); |