diff options
author | sos <sos@FreeBSD.org> | 2003-04-28 08:10:27 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2003-04-28 08:10:27 +0000 |
commit | e4d0be5799de5eb1f1f39497ae6f59ba0be217f7 (patch) | |
tree | 5898bc19a4e88c6f75e85b4d29759a242d7ce1ff /sys/dev/pst/pst-pci.c | |
parent | 1b6624b99947fc439495bb677aefb00a9b89872f (diff) | |
download | FreeBSD-src-e4d0be5799de5eb1f1f39497ae6f59ba0be217f7.zip FreeBSD-src-e4d0be5799de5eb1f1f39497ae6f59ba0be217f7.tar.gz |
Pull the pst driver out from under GAINT.
Diffstat (limited to 'sys/dev/pst/pst-pci.c')
-rw-r--r-- | sys/dev/pst/pst-pci.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/pst/pst-pci.c b/sys/dev/pst/pst-pci.c index 0955450..47272dc 100644 --- a/sys/dev/pst/pst-pci.c +++ b/sys/dev/pst/pst-pci.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001,2002 Søren Schmidt <sos@FreeBSD.org> + * Copyright (c) 2001,2002,2003 Søren Schmidt <sos@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,6 +35,8 @@ #include <sys/bus.h> #include <sys/bio.h> #include <sys/malloc.h> +#include <sys/lock.h> +#include <sys/mutex.h> #include <vm/vm.h> #include <vm/pmap.h> #include <machine/stdarg.h> @@ -93,16 +95,29 @@ iop_pci_attach(device_t dev) sc->phys_ibase = vtophys(sc->ibase); sc->reg = (struct i2o_registers *)sc->ibase; sc->dev = dev; + mtx_init(&sc->mtx, "pst lock", MTX_DEF, 0); if (!iop_init(sc)) return 0; - return bus_generic_attach(dev); } +static int +iop_pci_detach(device_t dev) +{ + struct iop_softc *sc = device_get_softc(dev); + + bus_teardown_intr(dev, sc->r_irq, sc->handle); + bus_release_resource(dev, SYS_RES_IRQ, 0x00, sc->r_irq); + bus_release_resource(dev, SYS_RES_MEMORY, 0x10, sc->r_mem); + return bus_generic_detach(dev); +} + + static device_method_t pst_pci_methods[] = { DEVMETHOD(device_probe, iop_pci_probe), DEVMETHOD(device_attach, iop_pci_attach), + DEVMETHOD(device_detach, iop_pci_detach), { 0, 0 } }; |