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