summaryrefslogtreecommitdiffstats
path: root/sys/dev/ed
diff options
context:
space:
mode:
authorjmb <jmb@FreeBSD.org>1999-11-01 01:16:56 +0000
committerjmb <jmb@FreeBSD.org>1999-11-01 01:16:56 +0000
commitae96c3770f4efdd7cd23ae2ec4acfc9a58f09aeb (patch)
tree2959a39d11525f69fc7d63dbbc779ef42e76dcc0 /sys/dev/ed
parent0a038d2ffd4a264d92cc5faeebfad9c2d7e25fb7 (diff)
downloadFreeBSD-src-ae96c3770f4efdd7cd23ae2ec4acfc9a58f09aeb.zip
FreeBSD-src-ae96c3770f4efdd7cd23ae2ec4acfc9a58f09aeb.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/dev/ed')
-rw-r--r--sys/dev/ed/if_ed.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c
index de14e09..66e0873 100644
--- a/sys/dev/ed/if_ed.c
+++ b/sys/dev/ed/if_ed.c
@@ -1011,18 +1011,24 @@ ed_probe_Novell_generic(dev, port_rid, flags)
* probably isn't any memory at 8k - which likely means that the board
* is an NE2000.
*/
+ if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) == 0) {
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 */
+ /* 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);
@@ -1035,17 +1041,15 @@ ed_probe_Novell_generic(dev, port_rid, 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 (ENXIO); /* 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