puc.c (102929) | puc.c (102931) |
---|---|
1/* $NetBSD: puc.c,v 1.7 2000/07/29 17:43:38 jlam Exp $ */ 2 3/*- 4 * Copyright (c) 2002 JF Hay. All rights reserved. 5 * Copyright (c) 2000 M. Warner Losh. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 44 unchanged lines hidden (view full) --- 53 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 54 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 55 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 56 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 57 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 58 */ 59 60#include <sys/cdefs.h> | 1/* $NetBSD: puc.c,v 1.7 2000/07/29 17:43:38 jlam Exp $ */ 2 3/*- 4 * Copyright (c) 2002 JF Hay. All rights reserved. 5 * Copyright (c) 2000 M. Warner Losh. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 44 unchanged lines hidden (view full) --- 53 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 54 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 55 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 56 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 57 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 58 */ 59 60#include <sys/cdefs.h> |
61__FBSDID("$FreeBSD: head/sys/dev/puc/puc.c 102929 2002-09-04 15:29:04Z phk $"); | 61__FBSDID("$FreeBSD: head/sys/dev/puc/puc.c 102931 2002-09-04 18:50:40Z phk $"); |
62 63/* 64 * PCI "universal" communication card device driver, glues com, lpt, 65 * and similar ports to PCI via bridge chip often much larger than 66 * the devices being glued. 67 * 68 * Author: Christopher G. Demetriou, May 14, 1998 (derived from NetBSD 69 * sys/dev/pci/pciide.c, revision 1.6). --- 88 unchanged lines hidden (view full) --- 158 return (ENXIO); 159 160 sc->irqres = res; 161 sc->irqrid = rid; 162#ifdef PUC_FASTINTR 163 irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res, 164 INTR_TYPE_TTY | INTR_FAST, puc_intr, sc, &sc->intr_cookie); 165 if (irq_setup == 0) | 62 63/* 64 * PCI "universal" communication card device driver, glues com, lpt, 65 * and similar ports to PCI via bridge chip often much larger than 66 * the devices being glued. 67 * 68 * Author: Christopher G. Demetriou, May 14, 1998 (derived from NetBSD 69 * sys/dev/pci/pciide.c, revision 1.6). --- 88 unchanged lines hidden (view full) --- 158 return (ENXIO); 159 160 sc->irqres = res; 161 sc->irqrid = rid; 162#ifdef PUC_FASTINTR 163 irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res, 164 INTR_TYPE_TTY | INTR_FAST, puc_intr, sc, &sc->intr_cookie); 165 if (irq_setup == 0) |
166 sc->fastintr = 1; | 166 sc->fastintr = INTR_FAST; |
167 else 168 irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res, 169 INTR_TYPE_TTY, puc_intr, sc, &sc->intr_cookie); 170#else 171 irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res, 172 INTR_TYPE_TTY, puc_intr, sc, &sc->intr_cookie); 173#endif 174 if (irq_setup != 0) --- 281 unchanged lines hidden (view full) --- 456int 457puc_setup_intr(device_t dev, device_t child, struct resource *r, int flags, 458 void (*ihand)(void *), void *arg, void **cookiep) 459{ 460 int i; 461 struct puc_softc *sc; 462 463 sc = (struct puc_softc *)device_get_softc(dev); | 167 else 168 irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res, 169 INTR_TYPE_TTY, puc_intr, sc, &sc->intr_cookie); 170#else 171 irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res, 172 INTR_TYPE_TTY, puc_intr, sc, &sc->intr_cookie); 173#endif 174 if (irq_setup != 0) --- 281 unchanged lines hidden (view full) --- 456int 457puc_setup_intr(device_t dev, device_t child, struct resource *r, int flags, 458 void (*ihand)(void *), void *arg, void **cookiep) 459{ 460 int i; 461 struct puc_softc *sc; 462 463 sc = (struct puc_softc *)device_get_softc(dev); |
464 if ((flags & INTR_FAST) && !sc->fastintr) | 464 if ((flags & INTR_FAST) != sc->fastintr) |
465 return (ENXIO); 466 for (i = 0; PUC_PORT_VALID(sc->sc_desc, i); i++) { 467 if (sc->sc_ports[i].dev == child) { 468 if (sc->sc_ports[i].ihand != 0) 469 return (ENXIO); 470 sc->sc_ports[i].ihand = ihand; 471 sc->sc_ports[i].ihandarg = arg; 472 *cookiep = arg; --- 42 unchanged lines hidden --- | 465 return (ENXIO); 466 for (i = 0; PUC_PORT_VALID(sc->sc_desc, i); i++) { 467 if (sc->sc_ports[i].dev == child) { 468 if (sc->sc_ports[i].ihand != 0) 469 return (ENXIO); 470 sc->sc_ports[i].ihand = ihand; 471 sc->sc_ports[i].ihandarg = arg; 472 *cookiep = arg; --- 42 unchanged lines hidden --- |