diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-02-19 07:57:30 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-02-19 07:57:30 +0100 |
commit | 00ba1aac9ed4df13a9880ad63a4291a953d53752 (patch) | |
tree | 19a7077bc527db1c68ce709fc9d8d7398593d3fa /sys/src/9/pc/etheriwl.c | |
parent | e68130f082c608ff0be39a11b459057791689486 (diff) |
etheriwl: fix rominit
we used use the *last* block in otp block list instead of
the block *before* the last block resulting in wrong eeprom
data (1000er series only)
Diffstat (limited to 'sys/src/9/pc/etheriwl.c')
-rw-r--r-- | sys/src/9/pc/etheriwl.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/src/9/pc/etheriwl.c b/sys/src/9/pc/etheriwl.c index 9aebd8bf0..cb266fc73 100644 --- a/sys/src/9/pc/etheriwl.c +++ b/sys/src/9/pc/etheriwl.c @@ -744,9 +744,9 @@ poweroff(Ctlr *ctlr) static char* rominit(Ctlr *ctlr) { + uint prev, last; uchar buf[2]; char *err; - uint off; int i; ctlr->eeprom.otp = 0; @@ -785,18 +785,19 @@ rominit(Ctlr *ctlr) * Find the block before last block (contains the EEPROM image) * for HW without OTP shadow RAM. */ - off = 0; + prev = last = 0; for(i=0; i<3; i++){ - if((err = eepromread(ctlr, buf, 2, off)) != nil) + if((err = eepromread(ctlr, buf, 2, last)) != nil) return err; if(get16(buf) == 0) break; - off = get16(buf); + prev = last; + last = get16(buf); } if(i == 0 || i >= 3) return "rominit: missing eeprom image"; - ctlr->eeprom.off = off+1; + ctlr->eeprom.off = prev+1; return nil; } |