Subject: Re: explanation of PCI cardbus bridge code...
To: Garrett D'Amore <garrett_damore@tadpole.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 02/20/2006 22:53:14
On Mon, Feb 20, 2006 at 07:54:50AM -0800, Garrett D'Amore wrote:
> Can anyone explain the following code:
> 
> #if NIOAPIC > 0
>     printf("%s: using ioapic for interrupt\n", sc->sc_dev.dv_xname);
> #else
>     if ((0 == pa->pa_intrline) || (255 == pa->pa_intrline)) {
>             printf("%s: NOT USED because of unconfigured interrupt\n",
>             sc->sc_dev.dv_xname);
>         return;
>     }
> #endif
> 
> This breaks pccb on sparc, and as far as I can tell, pa->pa_intrline is
> not actually used anywhere in the code.  (The IRQ register in PCI
> configuration space is "machine dependent", and on SPARC isn't used at all.)
> 
> I think the above code is pretty PC-specific.  Can it be removed, or
> #ifdef i386'd?

I don't think it can be removed. It's there probably to avoid using
a device which has not been fully configured. Hum, maybe this can be
moved to some MD code ? I see there is a
#ifdef __HAVE_PCCBB_ATTACH_HOOK
        pccbb_attach_hook(parent, self, pa);
#endif

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--