From: Jiri Slaby <jirislaby@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Jeff Garzik <jgarzik@pobox.com>,
linux-pci@atrey.karlin.mff.cuni.cz, Greg KH <gregkh@suse.de>
Subject: searching for pci busses
Date: Sun, 28 May 2006 01:12:26 +0159 [thread overview]
Message-ID: <4478DCF1.8080608@gmail.com> (raw)
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
next reply other threads:[~2006-05-27 23:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-27 23:13 Jiri Slaby [this message]
2006-05-29 21:47 ` searching for pci busses 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4478DCF1.8080608@gmail.com \
--to=jirislaby@gmail.com \
--cc=gregkh@suse.de \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.