The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/isapnp/mpu_isapnp.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: mpu_isapnp.c,v 1.8 2002/10/02 16:34:04 thorpej Exp $   */
    2 
    3 #include <sys/cdefs.h>
    4 __KERNEL_RCSID(0, "$NetBSD: mpu_isapnp.c,v 1.8 2002/10/02 16:34:04 thorpej Exp $");
    5 
    6 #include "midi.h"
    7 
    8 #include <sys/param.h>
    9 #include <sys/systm.h>
   10 #include <sys/errno.h>
   11 #include <sys/ioctl.h>
   12 #include <sys/syslog.h>
   13 #include <sys/device.h>
   14 #include <sys/proc.h>
   15 
   16 #include <machine/bus.h>
   17 
   18 #include <sys/audioio.h>
   19 #include <dev/audio_if.h>
   20 #include <dev/midi_if.h>
   21 #include <dev/mulaw.h>
   22 
   23 #include <dev/isa/isavar.h>
   24 #include <dev/isa/isadmavar.h>
   25 
   26 #include <dev/isapnp/isapnpreg.h>
   27 #include <dev/isapnp/isapnpvar.h>
   28 #include <dev/isapnp/isapnpdevs.h>
   29 
   30 #include <dev/ic/mpuvar.h>
   31 
   32 int     mpu_isapnp_match __P((struct device *, struct cfdata *, void *));
   33 void    mpu_isapnp_attach __P((struct device *, struct device *, void *));
   34 
   35 struct mpu_isapnp_softc {
   36         struct device sc_dev;
   37         void *sc_ih;
   38 
   39         struct mpu_softc sc_mpu;
   40 };
   41 
   42 CFATTACH_DECL(mpu_isapnp, sizeof(struct mpu_isapnp_softc),
   43     mpu_isapnp_match, mpu_isapnp_attach, NULL, NULL);
   44 
   45 int
   46 mpu_isapnp_match(parent, match, aux)
   47         struct device *parent;
   48         struct cfdata *match;
   49         void *aux;
   50 {
   51         int pri, variant;
   52 
   53         pri = isapnp_devmatch(aux, &isapnp_mpu_devinfo, &variant);
   54         if (pri && variant > 0)
   55                 pri = 0;
   56         return (pri);
   57 }
   58 
   59 void
   60 mpu_isapnp_attach(parent, self, aux)
   61         struct device *parent, *self;
   62         void *aux;
   63 {
   64         struct mpu_isapnp_softc *sc = (struct mpu_isapnp_softc *)self;
   65         struct isapnp_attach_args *ipa = aux;
   66 
   67         printf("\n");
   68 
   69         if (isapnp_config(ipa->ipa_iot, ipa->ipa_memt, ipa)) {
   70                 printf("%s: error in region allocation\n", 
   71                        sc->sc_dev.dv_xname);
   72                 return;
   73         }
   74 
   75         sc->sc_mpu.iot = ipa->ipa_iot;
   76         sc->sc_mpu.ioh = ipa->ipa_io[0].h;
   77 
   78         if (!mpu_find(&sc->sc_mpu)) {
   79                 printf("%s: find failed\n", sc->sc_dev.dv_xname);
   80                 return;
   81         }
   82 
   83         printf("%s: %s %s\n", sc->sc_dev.dv_xname, ipa->ipa_devident,
   84                ipa->ipa_devclass);
   85 
   86         midi_attach_mi(&mpu_midi_hw_if, &sc->sc_mpu, &sc->sc_dev);
   87 
   88         sc->sc_ih = isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num,
   89             ipa->ipa_irq[0].type, IPL_AUDIO, mpu_intr, &sc->sc_mpu);
   90 }

Cache object: 9d952ad64130575ac59d81793ee59071


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.