pcbb: edge and pulse interrupts

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

pcbb: edge and pulse interrupts

Alexey Dobriyan-2
sys/dev/pci/pccbb.c:
  2868 void *
  2869 pccbb_pcmcia_intr_establish(pch, pf, ipl, func, arg, xname)

  2876 {
  2877 struct pcic_handle *ph = (struct pcic_handle *)pch;
  2878 struct pccbb_softc *sc = (struct pccbb_softc *)ph->ph_parent;
  2879
  2880 ===> if (!(pf->cfe->flags & PCMCIA_CFE_IRQLEVEL)) { <===
  2881 /* what should I do? */
  2882 ===> if (pf->cfe->flags & PCMCIA_CFE_IRQLEVEL) { <===
  2883 DPRINTF(
  2884    ("%s does not provide edge nor pulse interrupt\n",
  2885    sc->sc_dev.dv_xname));
  2886 return NULL;
  2887 }
  2888 /*
  2889 * XXX Noooooo!  The interrupt flag must set properly!!
  2890 * dumb pcmcia driver!!
  2891 */
  2892 }
  2893
  2894 return pccbb_intr_establish(sc, IST_LEVEL, ipl, func, arg);
  2895 }

Judging by debug text and PCMCIA_CFE_* defines, second check should be

        if (!(pf->cfe->flags & PCMCIA_CFE_IRQPULSE))

Judging by expected logic here, checks should be consolidated via

        if (!(flags & LEVEL) && !(flags && PULSE)) {
                DPRINTF
                return NULL;
        }

Can someone confirm or deny?

Reply | Threaded
Open this post in threaded view
|

Re: pcbb: edge and pulse interrupts

Michael Shalayeff-2
On Wed, Mar 15, 2006 at 02:19:38PM +0300, Alexey Dobriyan wrote:

> sys/dev/pci/pccbb.c:
>   2868 void *
>   2869 pccbb_pcmcia_intr_establish(pch, pf, ipl, func, arg, xname)
>
>   2876 {
>   2877 struct pcic_handle *ph = (struct pcic_handle *)pch;
>   2878 struct pccbb_softc *sc = (struct pccbb_softc *)ph->ph_parent;
>   2879
>   2880 ===> if (!(pf->cfe->flags & PCMCIA_CFE_IRQLEVEL)) { <===
>   2881 /* what should I do? */
>   2882 ===> if (pf->cfe->flags & PCMCIA_CFE_IRQLEVEL) { <===
>   2883 DPRINTF(
>   2884    ("%s does not provide edge nor pulse interrupt\n",
>   2885    sc->sc_dev.dv_xname));
>   2886 return NULL;
>   2887 }
>   2888 /*
>   2889 * XXX Noooooo!  The interrupt flag must set properly!!
>   2890 * dumb pcmcia driver!!
>   2891 */
>   2892 }
>   2893
>   2894 return pccbb_intr_establish(sc, IST_LEVEL, ipl, func, arg);
>   2895 }
>
> Judging by debug text and PCMCIA_CFE_* defines, second check should be
>
> if (!(pf->cfe->flags & PCMCIA_CFE_IRQPULSE))
>
> Judging by expected logic here, checks should be consolidated via
>
> if (!(flags & LEVEL) && !(flags && PULSE)) {
> DPRINTF
> return NULL;
> }
>
> Can someone confirm or deny?

suppose
        if (!(pf->cfe->flags & (PCMCIA_CFE_IRQLEVEL|PCMCIA_CFE_IRQPULSE))) {
                ...
        }

looks better indeed
--
    paranoic mickey       (my employers have changed but, the name has remained)