Subject: Re: PCI probe
To: None <openbsd@softhome.net>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: port-i386
Date: 03/21/2004 14:35:52
openbsd@softhome.net wrote:
[ Charset ISO-8859-1 unsupported, converting... ]
> Hi all,
>
> I am trying to get the kernel to avoid probbing PCI 0:0:1 and 0:0:2. Also,
> everything above 1:0:0 (not included) needs to be avoided. I made this
> patch for /sys/dev/pci/pciconf.c, can anyone tell me if it might work?
You should return -1, not -EINVAL there. Also, && (device || function)
is more readable IMHO, even tho functionally equivalent.
Other than that, I guess it might work fine.
Jaromir
> Thanks,
> Nicolas.
>
>
>
> --- ./sys/dev/pci/pciconf.c Thu Mar 18 09:07:24 2004
> +++ ./sys/dev/pci/pciconf.c.orig Thu Mar 18 06:05:10 2004
> @@ -256,15 +256,6 @@
> bhlcr = pci_conf_read(pb->pc, tag, PCI_BHLC_REG);
> nfunction = PCI_HDRTYPE_MULTIFN(bhlcr) ? 8 : 1;
> for (function = 0 ; function < nfunction ; function++) {
> -#ifdef XBOX
> - if ((pb->busno) > 1)
> - return -EINVAL;
> - if (((pb->busno) == 1)) && (device | function)
> - return -EINVAL;
> - if (((pb->busno) == 0 && device == 0) &&
> - ((function == 1) || (function == 2)
> - return -EINVAL;
> -#endif
> tag = pci_make_tag(pb->pc, pb->busno, device,
> function);
> id = pci_conf_read(pb->pc, tag, PCI_ID_REG);
> if (PCI_VENDOR(id) == PCI_VENDOR_INVALID)
>
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow. Do not let this distract you.'' -=-