From: Tomas Hruby Date: Thu, 7 Jul 2011 17:24:26 +0000 (+0000) Subject: E1000 - reading EEPROM X-Git-Tag: v3.2.0~477 X-Git-Url: http://zhaoyanbai.com/repos/%22/xml/v3/mem/static/tz-link.htm?a=commitdiff_plain;h=123cf7fe37fd1c230d20b7f1e429204dab041434;p=minix.git E1000 - reading EEPROM - once the DONE bit is set, we already have the data --- diff --git a/drivers/e1000/e1000.c b/drivers/e1000/e1000.c index 302a91cf3..90235f0ff 100644 --- a/drivers/e1000/e1000.c +++ b/drivers/e1000/e1000.c @@ -941,20 +941,16 @@ void *v; int reg; { e1000_t *e = (e1000_t *) v; - u16_t data; + u32_t data; /* Request EEPROM read. */ e1000_reg_write(e, E1000_REG_EERD, (reg << e->eeprom_addr_off) | (E1000_REG_EERD_START)); /* Wait until ready. */ - while (!(e1000_reg_read(e, E1000_REG_EERD) & - e->eeprom_done_bit)); + while (!(data = (e1000_reg_read(e, E1000_REG_EERD)) & e->eeprom_done_bit)); - /* Fetch data. */ - data = (e1000_reg_read(e, E1000_REG_EERD) & - E1000_REG_EERD_DATA) >> 16; - return data; + return data >> 16; } /*===========================================================================*