diff options
author | 1999-04-23 08:21:04 +0000 | |
---|---|---|
committer | 1999-04-23 08:21:04 +0000 | |
commit | f724e6e4165dcc49ba304c647cd2a3caebb74198 (patch) | |
tree | 441ae323faa1de4b2a1aaa621db9280ba9bebe7a | |
parent | mac68k uses libkvm now (diff) | |
download | wireguard-openbsd-f724e6e4165dcc49ba304c647cd2a3caebb74198.tar.xz wireguard-openbsd-f724e6e4165dcc49ba304c647cd2a3caebb74198.zip |
in case PNP OS BIOS option is broken, skip isapnp ep cards
-rw-r--r-- | sys/dev/ic/elink3reg.h | 3 | ||||
-rw-r--r-- | sys/dev/isa/if_ep_isa.c | 25 |
2 files changed, 10 insertions, 18 deletions
diff --git a/sys/dev/ic/elink3reg.h b/sys/dev/ic/elink3reg.h index d0bbdaa0a36..690f89dbe1a 100644 --- a/sys/dev/ic/elink3reg.h +++ b/sys/dev/ic/elink3reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: elink3reg.h,v 1.7 1997/07/30 11:12:23 niklas Exp $ */ +/* $OpenBSD: elink3reg.h,v 1.8 1999/04/23 08:21:04 deraadt Exp $ */ /* $NetBSD: elink3reg.h,v 1.13 1997/04/27 09:42:34 veego Exp $ */ /* @@ -46,6 +46,7 @@ #define EEPROM_MFG_ID 0x7 /* 0x6d50 */ #define EEPROM_ADDR_CFG 0x8 /* Base addr */ #define EEPROM_RESOURCE_CFG 0x9 /* IRQ. Bits 12-15 */ +#define EEPROM_PNP 0x19 /* PNP mode and such? */ /* * These are the registers for the 3Com 3c509 and their bit patterns when diff --git a/sys/dev/isa/if_ep_isa.c b/sys/dev/isa/if_ep_isa.c index b944d5435b8..50f32dd19d6 100644 --- a/sys/dev/isa/if_ep_isa.c +++ b/sys/dev/isa/if_ep_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ep_isa.c,v 1.17 1998/09/19 10:08:05 maja Exp $ */ +/* $OpenBSD: if_ep_isa.c,v 1.18 1999/04/23 08:21:05 deraadt Exp $ */ /* $NetBSD: if_ep_isa.c,v 1.5 1996/05/12 23:52:36 mycroft Exp $ */ /* @@ -143,8 +143,8 @@ ep_isa_probe(parent, match, aux) { struct isa_attach_args *ia = aux; bus_space_tag_t iot = ia->ia_iot; - bus_space_handle_t ioh, ioh2; - int slot, iobase, irq, i; + bus_space_handle_t ioh; + int slot, iobase, irq, i, pnp; u_int16_t vendor, model; struct ep_isa_done_probe *er; int bus = parent->dv_unit; @@ -208,9 +208,14 @@ ep_isa_probe(parent, match, aux) irq = epreadeeprom(iot, ioh, EEPROM_RESOURCE_CFG); irq >>= 12; + pnp = epreadeeprom(iot, ioh, EEPROM_PNP) & 8; + /* so card will not respond to contention again */ bus_space_write_1(iot, ioh, 0, TAG_ADAPTER + 1); + if ((model & 0xfff0) == PROD_ID_3C509 && pnp != 0) + continue; + /* * XXX: this should probably not be done here * because it enables the drq/irq lines from @@ -218,20 +223,6 @@ ep_isa_probe(parent, match, aux) * we have checked for irq/drq collisions? */ bus_space_write_1(iot, ioh, 0, ACTIVATE_ADAPTER_TO_CONFIG); - /* - * Don't attach a 3c509 in PnP mode. - */ - if ((model & 0xfff0) == PROD_ID_3C509) { - if (bus_space_map(iot, iobase, 1, 0, &ioh2)) { - printf("ep_isa_probe: can't map Etherlink iobase\n"); - return 0; - } - if (bus_space_read_2(iot, ioh2, - EP_W0_EEPROM_COMMAND) & EEPROM_TST_MODE) { - continue; - } - bus_space_unmap(iot, ioh2, 1); - } epaddcard(bus, iobase, irq, model); } /* XXX should we sort by ethernet address? */ |