diff options
author | dfr <dfr@FreeBSD.org> | 1999-09-01 20:53:43 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1999-09-01 20:53:43 +0000 |
commit | f351c4f3dc1d761f44335d85fee57eb133919756 (patch) | |
tree | f5d858916a67aca8a86dac46559341c270c6d087 /sys/dev | |
parent | c93ae1166c126cfb59736d68f475ad5948708da7 (diff) | |
download | FreeBSD-src-f351c4f3dc1d761f44335d85fee57eb133919756.zip FreeBSD-src-f351c4f3dc1d761f44335d85fee57eb133919756.tar.gz |
This represents essentially a complete rewrite of the ISA PnP code. The
new system is integrated with the ISA bus code more cleanly and allows
the future addition of more enumerators such as PnPBIOS and ACPI.
This commit also enables the new pcm driver since it is somewhat tied to
the new PnP code.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ata/ata-all.c | 13 | ||||
-rw-r--r-- | sys/dev/pcm/isa/mss.c | 4 | ||||
-rw-r--r-- | sys/dev/sio/sio.c | 21 | ||||
-rw-r--r-- | sys/dev/sound/isa/mss.c | 4 |
4 files changed, 31 insertions, 11 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index d0ef616..89213c9 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -83,6 +83,13 @@ struct ata_softc *atadevices[MAXATA]; static devclass_t ata_devclass; #if NISA > 0 +static struct isa_pnp_id ata_ids[] = { + {0x0006d041, "Generic ESDI/IDE/ATA controller"}, /* PNP0600 */ + {0x0106d041, "Plus Hardcard II"}, /* PNP0601 */ + {0x0206d041, "Plus Hardcard IIXL/EZ"}, /* PNP0602 */ + {0x0306d041, "Generic ATA"}, /* PNP0603 */ + {0} +}; static int ata_isaprobe(device_t dev) @@ -92,7 +99,11 @@ ata_isaprobe(device_t dev) int32_t ctlr, res; int32_t lun; - /* allocate the port range */ + /* Check isapnp ids */ + if (ISA_PNP_PROBE(device_get_parent(dev), dev, ata_ids) == ENXIO) + return (ENXIO); + + /* Allocate the port range */ rid = 0; port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); if (!port) diff --git a/sys/dev/pcm/isa/mss.c b/sys/dev/pcm/isa/mss.c index cc34ddc..13645d9 100644 --- a/sys/dev/pcm/isa/mss.c +++ b/sys/dev/pcm/isa/mss.c @@ -511,9 +511,11 @@ mss_probe(device_t dev) mss_probe_end: result = mss_detect(dev, mss); no: + mss_release_resources(mss, dev); +#if 0 if (setres) ISA_DELETE_RESOURCE(device_get_parent(dev), dev, SYS_RES_IOPORT, mss->io_rid); /* XXX ? */ - mss_release_resources(mss, dev); +#endif return result; } diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 0cd84ba..503aa3e 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -577,6 +577,15 @@ card_intr(struct pccard_devinfo *devi) #define SET_FLAG(dev, bit) isa_set_flags(dev, isa_get_flags(dev) | (bit)) #define CLR_FLAG(dev, bit) isa_set_flags(dev, isa_get_flags(dev) & ~(bit)) +static struct isa_pnp_id sio_ids[] = { + {0x0005d041, "Standard PC COM port"}, /* PNP0500 */ + {0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */ + {0x0205d041, "Multiport serial device (non-intelligent 16550)"}, /* PNP0502 */ + {0x1005d041, "Generic IRDA-compatible device"}, /* PNP0510 */ + {0x1105d041, "Generic IRDA-compatible device"}, /* PNP0511 */ + {0} +}; + static int sioprobe(dev) device_t dev; @@ -596,10 +605,7 @@ sioprobe(dev) struct resource *port; /* Check isapnp ids */ - if (isa_get_vendorid(dev) - && isa_get_compatid(dev) != PNP_EISAID("PNP0500") - && isa_get_compatid(dev) != PNP_EISAID("PNP0501") - && isa_get_compatid(dev) != PNP_EISAID("PNP0502")) + if (ISA_PNP_PROBE(device_get_parent(dev), dev, sio_ids) == ENXIO) return (ENXIO); rid = 0; @@ -2628,11 +2634,12 @@ static cn_putc_t siocnputc; #ifdef __i386__ CONS_DRIVER(sio, siocnprobe, siocninit, NULL, siocngetc, siocncheckc, siocnputc); +#endif + /* To get the GDB related variables */ #if DDB > 0 #include <ddb/ddb.h> #endif -#endif static void siocntxwait(iobase) @@ -2830,17 +2837,15 @@ siocnprobe(cp) siocniobase = iobase; siocnunit = unit; } - if (COM_DEBUGGER(flags) && !COM_LLCONSOLE(flags)) { + if (COM_DEBUGGER(flags)) { printf("sio%d: gdb debugging port\n", unit); siogdbiobase = iobase; siogdbunit = unit; -#ifdef __i386__ #if DDB > 0 gdbdev = makedev(CDEV_MAJOR, unit); gdb_getc = siocngetc; gdb_putc = siocnputc; #endif -#endif } } } diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c index cc34ddc..13645d9 100644 --- a/sys/dev/sound/isa/mss.c +++ b/sys/dev/sound/isa/mss.c @@ -511,9 +511,11 @@ mss_probe(device_t dev) mss_probe_end: result = mss_detect(dev, mss); no: + mss_release_resources(mss, dev); +#if 0 if (setres) ISA_DELETE_RESOURCE(device_get_parent(dev), dev, SYS_RES_IOPORT, mss->io_rid); /* XXX ? */ - mss_release_resources(mss, dev); +#endif return result; } |