searching for pci busses

From: Jiri Slaby
Date: Sat May 27 2006 - 19:12:08 EST


Hello,

I want to ask, if there is any function to call (as we debated with Jeff), which
does something like this:
1) I have some vendor/device ids in table
2) I want to traverse raws of the table and compare to system devices, and if
found, stop and return pci_dev struct (or raw in the table).
I have this code for the time being:

static struct pci_device_id ids[] = {
{ PCI_DEVICE(0x1234, 0x4321) },
/* ... whatever ... */
{ 0 }
};

for (id = ids; id->vendor; id++) {
d = pci_get_device(id->vendor, id->device, NULL);
if (d != NULL) {
/* get some info */
pci_dev_put(d);
break;
}
}

I'm searching for a bus or something, which is only one in the system, but would
be made by more vendors.
Simply, something like pci_dev_present(), but with a result of pci_dev or index
of the raw in the ids table corresponding to the found device (instead of
returning 0/1).

thanks,
--
Jiri Slaby www.fi.muni.cz/~xslaby
\_.-^-._ jirislaby@xxxxxxxxx _.-^-._/
B67499670407CE62ACC8 22A032CC55C339D47A7E
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/