DTRT with level and edge interrupts:

- add a type field to the isapnp_pin struct and set to IST_EDGE or
      IST_LEVEL depending on the card configuration data.
    - use the irq type field in all the drivers instead of hardcoding it.
This commit is contained in:
christos 1997-10-28 21:27:55 +00:00
parent 38d61d7805
commit c12bf4cc9f
6 changed files with 18 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: com_isapnp.c,v 1.7 1997/10/23 06:14:11 mikel Exp $ */
/* $NetBSD: com_isapnp.c,v 1.8 1997/10/28 21:27:55 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -113,5 +113,5 @@ com_isapnp_attach(parent, self, aux)
com_attach_subr(sc);
isc->sc_ih = isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num,
IST_EDGE, IPL_SERIAL, comintr, sc);
ipa->ipa_irq[0].type, IPL_SERIAL, comintr, sc);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ep_isapnp.c,v 1.9 1997/10/14 21:34:30 thorpej Exp $ */
/* $NetBSD: if_ep_isapnp.c,v 1.10 1997/10/28 21:27:59 christos Exp $ */
/*
* Copyright (c) 1997 Jonathan Stone <jonathan@NetBSD.org>
@ -132,7 +132,7 @@ ep_isapnp_attach(parent, self, aux)
ipa->ipa_devclass);
sc->sc_ih = isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num,
IST_EDGE, IPL_NET, epintr, sc);
ipa->ipa_irq[0].type, IPL_NET, epintr, sc);
sc->enable = NULL;
sc->disable = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_le_isapnp.c,v 1.5 1997/06/06 23:46:39 thorpej Exp $ */
/* $NetBSD: if_le_isapnp.c,v 1.6 1997/10/28 21:28:03 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -278,7 +278,7 @@ le_isapnp_attach(parent, self, aux)
isa_dmacascade(parent->dv_parent, ipa->ipa_drq[0].num);
lesc->sc_ih = isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num,
IST_EDGE, IPL_NET, le_isapnp_intredge, sc);
ipa->ipa_irq[0].type, IPL_NET, le_isapnp_intredge, sc);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ne_isapnp.c,v 1.1 1997/10/16 17:18:29 matt Exp $ */
/* $NetBSD: if_ne_isapnp.c,v 1.2 1997/10/28 21:28:06 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -209,7 +209,7 @@ ne_isapnp_attach(
/* Establish the interrupt handler. */
isc->sc_ih = isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num,
IST_EDGE, IPL_NET, dp8390_intr, dsc);
ipa->ipa_irq[0].type, IPL_NET, dp8390_intr, dsc);
if (isc->sc_ih == NULL)
printf("%s: couldn't establish interrupt handler\n",
dsc->sc_dev.dv_xname);

View File

@ -1,4 +1,4 @@
/* $NetBSD: isapnp.c,v 1.11 1997/10/27 23:42:30 thorpej Exp $ */
/* $NetBSD: isapnp.c,v 1.12 1997/10/28 21:28:10 christos Exp $ */
/*
* Copyright (c) 1996 Christos Zoulas. All rights reserved.
@ -228,18 +228,15 @@ isapnp_alloc_irq(ic, i)
struct isapnp_pin *i;
{
int irq;
#define LEVEL_IRQ (ISAPNP_IRQTYPE_LEVEL_PLUS|ISAPNP_IRQTYPE_LEVEL_MINUS)
i->type = (i->flags & LEVEL_IRQ) ? IST_LEVEL : IST_EDGE;
if (i->bits == 0) {
i->num = 0;
return 0;
}
/*
* XXX Are there any PnP cards with level triggered interrupts?
* XXX If so, we'll have to change the interface that configures
* XXX the cards to convey that information.
*/
if (isa_intr_alloc(ic, i->bits, IST_EDGE, &irq) == 0) {
if (isa_intr_alloc(ic, i->bits, i->type, &irq) == 0) {
i->num = irq;
return 0;
}
@ -842,13 +839,10 @@ isapnp_attach(parent, self, aux)
}
#endif
#ifdef DEBUG
/* XXX do we even really need this? --thorpej */
printf("%s: configuring <%s, %s, %s, %s>\n",
DPRINTF(("%s: configuring <%s, %s, %s, %s>\n",
sc->sc_dev.dv_xname,
lpa->ipa_devident, lpa->ipa_devlogic,
lpa->ipa_devcompat, lpa->ipa_devclass);
#endif
lpa->ipa_devcompat, lpa->ipa_devclass));
if (lpa->ipa_pref == ISAPNP_DEP_CONFLICTING) {
printf("%s: <%s, %s, %s, %s> ignored; %s\n",
sc->sc_dev.dv_xname,

View File

@ -1,4 +1,4 @@
/* $NetBSD: isapnpvar.h,v 1.6 1997/10/27 22:16:52 thorpej Exp $ */
/* $NetBSD: isapnpvar.h,v 1.7 1997/10/28 21:28:15 christos Exp $ */
/*
* Copyright (c) 1996 Christos Zoulas. All rights reserved.
@ -113,10 +113,10 @@ struct isapnp_region {
};
struct isapnp_pin {
u_int8_t num;
u_int8_t num;
u_int8_t flags:4;
u_int8_t type:4;
u_int16_t bits;
u_int8_t flags;
};
struct isapnp_attach_args {