summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/if_ed.c
diff options
context:
space:
mode:
authorjmb <jmb@FreeBSD.org>1999-11-01 00:53:12 +0000
committerjmb <jmb@FreeBSD.org>1999-11-01 00:53:12 +0000
commit0a038d2ffd4a264d92cc5faeebfad9c2d7e25fb7 (patch)
tree7aab14fc86d97ad913105369726c9b8e2ccae1c7 /sys/i386/isa/if_ed.c
parentab5e99c98f6692377931f3a4a89470ec50034dcf (diff)
downloadFreeBSD-src-0a038d2ffd4a264d92cc5faeebfad9c2d7e25fb7.zip
FreeBSD-src-0a038d2ffd4a264d92cc5faeebfad9c2d7e25fb7.tar.gz
rearrange order of tests for NE1000, NE2000, and Linksys
cards. previous order caused computers with NE2000 cards to hang during boot.
Diffstat (limited to 'sys/i386/isa/if_ed.c')
-rw-r--r--sys/i386/isa/if_ed.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/sys/i386/isa/if_ed.c b/sys/i386/isa/if_ed.c
index df3a739..017444d 100644
--- a/sys/i386/isa/if_ed.c
+++ b/sys/i386/isa/if_ed.c
@@ -1011,6 +1011,7 @@ ed_probe_3Com(isa_dev)
sc->isa16bit = isa16bit;
/*
+ if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) == 0) {
* Initialize GA page start/stop registers. Probably only needed if
* doing DMA, but what the hell.
*/
@@ -1155,15 +1156,21 @@ ed_probe_Novell_generic(sc, port, unit, flags)
ed_pio_writemem(sc, test_pattern, 8192, sizeof(test_pattern));
ed_pio_readmem(sc, 8192, test_buffer, sizeof(test_pattern));
- linksys = ed_get_Linksys(sc);
- if (linksys) {
- outb(sc->nic_addr + ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS);
- sc->isa16bit = 1;
- sc->type = ED_TYPE_NE2000;
- sc->type_str = "Linksys";
- } else if (bcmp(test_pattern, test_buffer, sizeof(test_pattern))) {
- /* not an NE1000 - try NE2000 */
+ if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) == 0) {
+ /* could be either an NE1000 or a Linksys ethernet controller */
+ linksys = ed_get_Linksys(sc);
+ if (linksys) {
+ outb(sc->nic_addr + ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS);
+ sc->isa16bit = 1;
+ sc->type = ED_TYPE_NE2000;
+ sc->type_str = "Linksys";
+ } else {
+ sc->type = ED_TYPE_NE1000;
+ sc->type_str = "NE1000";
+ }
+ } else {
+ /* neither an NE1000 nor a Linksys - try NE2000 */
outb(sc->nic_addr + ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS);
outb(sc->nic_addr + ED_P0_PSTART, 16384 / ED_PAGE_SIZE);
outb(sc->nic_addr + ED_P0_PSTOP, 32768 / ED_PAGE_SIZE);
@@ -1177,16 +1184,15 @@ ed_probe_Novell_generic(sc, port, unit, flags)
ed_pio_writemem(sc, test_pattern, 16384, sizeof(test_pattern));
ed_pio_readmem(sc, 16384, test_buffer, sizeof(test_pattern));
- if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)))
- return (0); /* not an NE2000 either */
-
- sc->type = ED_TYPE_NE2000;
- sc->type_str = "NE2000";
- } else {
- sc->type = ED_TYPE_NE1000;
- sc->type_str = "NE1000";
+ if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) == 0) {
+ sc->type = ED_TYPE_NE2000;
+ sc->type_str = "NE2000";
+ } else {
+ return (ENXIO);
+ }
}
+
/* 8k of memory plus an additional 8k if 16bit */
memsize = 8192 + sc->isa16bit * 8192;
OpenPOWER on IntegriCloud