diff options
author | imp <imp@FreeBSD.org> | 2008-07-09 16:47:55 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2008-07-09 16:47:55 +0000 |
commit | aa86225b8a5f1cd900542bb0fc6d05aa01a7f15e (patch) | |
tree | 0175cd8979711e34ad6e5815b3d3860a705e58f0 /sys/dev/cs/if_cs.c | |
parent | a51aa927fad5ab9ebbb294340935d462f68ee19b (diff) | |
download | FreeBSD-src-aa86225b8a5f1cd900542bb0fc6d05aa01a7f15e.zip FreeBSD-src-aa86225b8a5f1cd900542bb0fc6d05aa01a7f15e.tar.gz |
Improve the EEPROM parsing, based on finding a datasheet that describes
it in detail.
When setting media, don't error out when a specific media is selected.
# Note: There may be some issues still here since the EtherJet PC Card doesn't
# conform to the datasheet. Many different kinds of dongles can be plugged in
# and it is unknown how to ask which one it is.
Also, add a /* bad! */ comment to a 1/2 second delay after we set the
DC/DC parameters. This should be a *sleep of some sort for !cold.
Fortunately it is the only one and is only used when setting media, so
the benefit from removing it is small. Unfortunately, it likely
serves as an exemplar of good programming techniques, which it isn't.
Diffstat (limited to 'sys/dev/cs/if_cs.c')
-rw-r--r-- | sys/dev/cs/if_cs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c index 0784b20..f3fed0a 100644 --- a/sys/dev/cs/if_cs.c +++ b/sys/dev/cs/if_cs.c @@ -202,7 +202,7 @@ control_dc_dc(struct cs_softc *sc, int on_not_off) else self_control &= ~HCB1; cs_writereg(sc, PP_SelfCTL, self_control); - DELAY(500000); + DELAY(500000); /* Bad! */ } @@ -332,9 +332,9 @@ cs_cs89x0_probe(device_t dev) } else if (get_eeprom_cksum(START_EEPROM_DATA,CHKSUM_LEN, eeprom_buff)<0) { device_printf(dev, "EEPROM cheksum bad, assuming defaults.\n"); } else { - sc->auto_neg_cnf = eeprom_buff[AUTO_NEG_CNF_OFFSET/2]; - sc->adapter_cnf = eeprom_buff[ADAPTER_CNF_OFFSET/2]; - sc->isa_config = eeprom_buff[ISA_CNF_OFFSET/2]; + sc->auto_neg_cnf = eeprom_buff[AUTO_NEG_CNF_OFFSET]; + sc->adapter_cnf = eeprom_buff[ADAPTER_CNF_OFFSET]; + sc->isa_config = eeprom_buff[ISA_CNF_OFFSET]; for (i=0; i<ETHER_ADDR_LEN/2; i++) { sc->enaddr[i*2] = eeprom_buff[i]; sc->enaddr[i*2+1] = eeprom_buff[i] >> 8; @@ -1226,10 +1226,10 @@ cs_mediaset(struct cs_softc *sc, int media) error = cs_duplex_auto(sc); break; case IFM_10_2: - error = enable_bnc(sc); + enable_bnc(sc); break; case IFM_10_5: - error = enable_aui(sc); + enable_aui(sc); break; } |