Re: How to scan for PCI devices? (fwd)

mlord (mlord@pobox.com)
Mon, 21 Jul 1997 14:57:41 -0400


Iñaky Pérez González wrote:
>
> Hi
>
> I'm having a so-stupid-problem (tm) that I'm ashamed of asking
> about it, but I can't find my way through so ... if you can help
> me, you'll win A BIG NICE smile from me :) (and will be able of
> counting with my eternal gratitude):
>
> So, it's quite silly, as I told. You got this damn USB controller
> on the motherboard, an UHCI one, no problem, PCI class id 0x0c03, bus
> 0, device 0, function 2, and another one, a CMD add-on board, an
> OHCI one, PCI class id 0x0c03, bus 0, device 8, function 0 (0x0c03 is
> the USB class and subclass codes for USB host controllers).
>
> Then I start to scan for pci classes 0x0c03, with the following
> code:
>
> #define USB_CLASS 0x0c03
>
> while ((bioscode = pcibios_find_class (USB_CLASS, index,
> &bus, &function))
> == PCIBIOS_SUCCESSFUL)
> {
> index++;
> usb_hosts++;
> }

The pcibios_find_class() function quite often does NOT WORK!

I tried to use it once within the IDE driver, but had trouble
with buggy BIOSs.

-ml