1 | ␊ |
2 | //#include "libsaio.h"␊ |
3 | //#include "bootstruct.h"␊ |
4 | #include "boot.h"␊ |
5 | #include "pci.h"␊ |
6 | #include "modules.h"␊ |
7 | ␊ |
8 | ␊ |
9 | extern void set_eth_builtin(pci_dt_t *eth_dev);␊ |
10 | extern void notify_usb_dev(pci_dt_t *pci_dev);␊ |
11 | ␊ |
12 | ␊ |
13 | void setup_pci_devs(pci_dt_t *pci_dt)␊ |
14 | {␊ |
15 | ␉bool do_eth_devprop;␊ |
16 | ␉pci_dt_t *current = pci_dt;␊ |
17 | ␊ |
18 | ␉do_eth_devprop = false;␊ |
19 | ␊ |
20 | ␉getBoolForKey(kEthernetBuiltInKey, &do_eth_devprop, &bootInfo->bootConfig);␊ |
21 | ␊ |
22 | ␉while (current)␊ |
23 | ␉{␊ |
24 | ␉␉execute_hook("PCIDevice", current, NULL, NULL, NULL);␊ |
25 | ␉␉␊ |
26 | ␉␉switch (current->class_id)␊ |
27 | ␉␉{␊ |
28 | ␉␉␉case PCI_CLASS_NETWORK_ETHERNET: ␊ |
29 | ␉␉␉␉if (do_eth_devprop)␊ |
30 | ␉␉␉␉␉set_eth_builtin(current);␊ |
31 | ␉␉␉␉break;␊ |
32 | ␊ |
33 | ␉␉␉case PCI_CLASS_SERIAL_USB:␊ |
34 | ␉␉␉␉notify_usb_dev(current);␊ |
35 | ␉␉␉␉break;␊ |
36 | ␉␉}␊ |
37 | ␉␉␊ |
38 | ␉␉setup_pci_devs(current->children);␊ |
39 | ␉␉current = current->next;␊ |
40 | ␉}␊ |
41 | }␊ |
42 | |