public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* searching for pci busses
@ 2006-05-27 23:13 Jiri Slaby
  2006-05-29 21:47 ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Jiri Slaby @ 2006-05-27 23:13 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Jeff Garzik, linux-pci, Greg KH

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@gmail.com   _.-^-._/
B67499670407CE62ACC8 22A032CC55C339D47A7E

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-05-30 17:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-27 23:13 searching for pci busses Jiri Slaby
2006-05-29 21:47 ` Greg KH
2006-05-29 21:59   ` Jeff Garzik
2006-05-30 16:38     ` Greg KH
2006-05-30 16:52       ` Jon Smirl
2006-05-30 16:58         ` Greg KH
2006-05-30 17:00         ` Matthew Wilcox
2006-05-30 17:19           ` Jon Smirl
2006-05-30 17:02         ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox