diff options
author | marcel <marcel@FreeBSD.org> | 2006-04-28 21:21:53 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2006-04-28 21:21:53 +0000 |
commit | 193a6144b9612bafde9b4382a221e917496b8601 (patch) | |
tree | 5e43b7350101e478e59289d09768df4e1a830e0d /sys/dev/ppc | |
parent | ca65c8d400f4a855b84394629b8695274cf7bfb4 (diff) | |
download | FreeBSD-src-193a6144b9612bafde9b4382a221e917496b8601.zip FreeBSD-src-193a6144b9612bafde9b4382a221e917496b8601.tar.gz |
Rewrite of puc(4). Significant changes are:
o Properly use rman(9) to manage resources. This eliminates the
need to puc-specific hacks to rman. It also allows devinfo(8)
to be used to find out the specific assignment of resources to
serial/parallel ports.
o Compress the PCI device "database" by optimizing for the common
case and to use a procedural interface to handle the exceptions.
The procedural interface also generalizes the need to setup the
hardware (program chipsets, program clock frequencies).
o Eliminate the need for PUC_FASTINTR. Serdev devices are fast by
default and non-serdev devices are handled by the bus.
o Use the serdev I/F to collect interrupt status and to handle
interrupts across ports in priority order.
o Sync the PCI device configuration to include devices found in
NetBSD and not yet merged to FreeBSD.
o Add support for Quatech 2, 4 and 8 port UARTs.
o Add support for a couple dozen Timedia serial cards as found
in Linux.
Diffstat (limited to 'sys/dev/ppc')
-rw-r--r-- | sys/dev/ppc/ppc_puc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/dev/ppc/ppc_puc.c b/sys/dev/ppc/ppc_puc.c index b99e162..adcc058 100644 --- a/sys/dev/ppc/ppc_puc.c +++ b/sys/dev/ppc/ppc_puc.c @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2006 Marcel Moolenaar * Copyright (c) 1997-2000 Nicolas Souchu * Copyright (c) 2001 Alcove - Nicolas Souchu * All rights reserved. @@ -35,6 +36,8 @@ __FBSDID("$FreeBSD$"); #include <machine/bus.h> +#include <dev/puc/puc_bus.h> + #include <dev/ppbus/ppbconf.h> #include <dev/ppbus/ppb_msq.h> #include <dev/ppc/ppcvar.h> @@ -48,6 +51,7 @@ static device_method_t ppc_puc_methods[] = { /* device interface */ DEVMETHOD(device_probe, ppc_puc_probe), DEVMETHOD(device_attach, ppc_attach), + DEVMETHOD(device_detach, ppc_detach), /* bus interface */ DEVMETHOD(bus_read_ivar, ppc_read_ivar), @@ -76,6 +80,15 @@ static driver_t ppc_puc_driver = { static int ppc_puc_probe(device_t dev) { + device_t parent; + uintptr_t type; + + parent = device_get_parent(dev); + if (BUS_READ_IVAR(parent, dev, PUC_IVAR_TYPE, &type)) + return (ENXIO); + if (type != PUC_TYPE_PARALLEL) + return (ENXIO); + device_set_desc(dev, "Parallel port"); return (ppc_probe(dev, 0)); } |