diff options
author | Ladi Prosek <lprosek@redhat.com> | 2016-04-11 11:26:56 +0200 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2016-04-15 17:27:35 +0100 |
commit | 237949491860bf1ca6f704e586bf723b7d8001e7 (patch) | |
tree | da2727dc1b3d8b559190053112584bc2a949c297 /src/include/ipxe/pci.h | |
parent | 5e5450c2d04e6f976ea4cef5db50e136d4a06282 (diff) | |
download | ipxe-237949491860bf1ca6f704e586bf723b7d8001e7.tar.gz |
[pci] Add pci_find_next_capability()
PCI devices may support more capabilities of the same type (for
example PCI_CAP_ID_VNDR) and there was no way to discover all of them.
This commit adds a new API pci_find_next_capability which provides
this functionality. It would typically be used like so:
for (pos = pci_find_capability(pci, PCI_CAP_ID_VNDR);
pos > 0;
pos = pci_find_next_capability(pci, pos, PCI_CAP_ID_VNDR)) {
...
}
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/pci.h')
-rw-r--r-- | src/include/ipxe/pci.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/ipxe/pci.h b/src/include/ipxe/pci.h index 89d9d8040..0c6bc7ed6 100644 --- a/src/include/ipxe/pci.h +++ b/src/include/ipxe/pci.h @@ -286,6 +286,8 @@ extern int pci_find_driver ( struct pci_device *pci ); extern int pci_probe ( struct pci_device *pci ); extern void pci_remove ( struct pci_device *pci ); extern int pci_find_capability ( struct pci_device *pci, int capability ); +extern int pci_find_next_capability ( struct pci_device *pci, + int pos, int capability ); extern unsigned long pci_bar_size ( struct pci_device *pci, unsigned int reg ); /** |