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