Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/i386/libsaio/pci_setup.c

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
7extern void set_eth_builtin(pci_dt_t *eth_dev);
8extern void notify_usb_dev(pci_dt_t *pci_dev);
9extern void force_enable_hpet(pci_dt_t *lpc_dev);
10
11
12void setup_pci_devs(pci_dt_t *pci_dt)
13{
14bool do_eth_devprop, do_enable_hpet;
15pci_dt_t *current = pci_dt;
16
17do_eth_devprop = do_enable_hpet = false;
18
19getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->bootConfig);
20getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->bootConfig);
21
22while (current)
23{
24execute_hook("PCIDevice", current, NULL, NULL, NULL);
25
26switch (current->class_id) {
27case PCI_CLASS_NETWORK_ETHERNET:
28if (do_eth_devprop)
29set_eth_builtin(current);
30break;
31
32case PCI_CLASS_SERIAL_USB:
33notify_usb_dev(current);
34break;
35
36case PCI_CLASS_BRIDGE_ISA:
37if (do_enable_hpet)
38force_enable_hpet(current);
39break;
40}
41
42setup_pci_devs(current->children);
43current = current->next;
44}
45}
46

Archive Download this file

Revision: 521