int pcibios_find_class(unsigned int class_code, unsigned short index, unsigned char* bus, unsigned char* device_fn);
int pcibios_find_device(unsigned short vendor, unsigned short device_id , unsigned short index, unsigned char* bus, unsigned char* device_fn);
function searches for a certain class of device on the PCI bus. In this
instance, class is used to represent a few different categories of
devices. Some examples are storage, network, display, and memory
classes. The classes are defined by the PCI Specification, and the
is matched with the dword in the configuration space of the device at
function finds a device on the PCI bus that has the matching device
and vendor ids. The vendor ids are assigned to the PCI Sig to vendors,
who in turn assign device ids to the devices they develop. The vendor
and device ids are encoded in dword 0x00 of the configuration space.
include an extra
parameter, which is used to select the specific
device if there are multiple matches. An
of 0 matches the firts located board, 1 the second, and so on.
parameters are PCI specific cookies that are passed to other pcibios
functions to access the configuration space of the located device.
On success, the functions return
Otherwise, one of the following error codes is returned:
There is no device that matches the search criteria,
The vendor id is invalid. (0xffff is not a valid id.)