summaryrefslogtreecommitdiff
path: root/com32/modules/ethersel.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-08-12 11:30:19 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-08-12 11:30:19 -0700
commit31a021035830d85d3a34ac6de221003478be7ca6 (patch)
tree35856fcb0a12b48c5ed38d5db95104c242e75c9a /com32/modules/ethersel.c
parent6a2119c0fc30aa0ccdfc43e138255f6875f2b714 (diff)
downloadsyslinux-31a021035830d85d3a34ac6de221003478be7ca6.tar.gz
pci: revamp the PCI system to have a hierarchial format
Create the concept of a PCI domain, as a hierarcy of busses, devices and functions. This avoids large static-sized arrays and allows for geographical addressing of devices. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/modules/ethersel.c')
-rw-r--r--com32/modules/ethersel.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/com32/modules/ethersel.c b/com32/modules/ethersel.c
index d200d627..9bd445c0 100644
--- a/com32/modules/ethersel.c
+++ b/com32/modules/ethersel.c
@@ -192,18 +192,19 @@ parse_config(const char *filename)
int main(int argc, char *argv[])
{
struct match *list, *match;
- struct pci_device_list pci_device_list;
- struct pci_bus_list pci_bus_list;
+ struct pci_domain *pci_domain;
openconsole(&dev_null_r, &dev_stdcon_w);
- pci_scan(&pci_bus_list,&pci_device_list);
+ pci_domain = pci_scan();
- list = parse_config(argc < 2 ? NULL : argv[1]);
+ if (pci_domain) {
+ list = parse_config(argc < 2 ? NULL : argv[1]);
- match = find_pci_device(&pci_device_list,list);
+ match = find_pci_device(pci_domain, list);
- if ( match )
- syslinux_run_command(match->filename);
+ if ( match )
+ syslinux_run_command(match->filename);
+ }
/* On error, return to the command line */
fputs("Error: no recognized network card found!\n", stderr);