Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/Cleancut/i386/libsaio/pci_setup.c

1#include "libsaio.h"
2#include "boot.h"
3#include "bootstruct.h"
4#include "pci.h"
5#include "modules.h"
6#include "modules.h"
7
8
9extern void set_eth_builtin(pci_dt_t *eth_dev);
10extern void notify_usb_dev(pci_dt_t *pci_dev);
11extern void force_enable_hpet(pci_dt_t *lpc_dev);
12
13extern pci_dt_t *dram_controller_dev;
14
15void setup_pci_devs(pci_dt_t *pci_dt)
16{
17bool do_eth_devprop, do_enable_hpet;
18pci_dt_t *current = pci_dt;
19
20do_eth_devprop = do_enable_hpet = false;
21
22getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->bootConfig);
23getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->bootConfig);
24
25while (current)
26{
27execute_hook("PCIDevice", current, NULL, NULL, NULL);
28
29switch (current->class_id)
30{
31case PCI_CLASS_BRIDGE_HOST:
32if (current->dev.addr == PCIADDR(0, 0, 0))
33dram_controller_dev = current;
34break;
35
36case PCI_CLASS_NETWORK_ETHERNET:
37if (do_eth_devprop)
38set_eth_builtin(current);
39break;
40
41case PCI_CLASS_SERIAL_USB:
42notify_usb_dev(current);
43break;
44
45case PCI_CLASS_BRIDGE_ISA:
46if (do_enable_hpet)
47force_enable_hpet(current);
48break;
49}
50
51execute_hook("PCIDevice", current, NULL, NULL, NULL);
52
53setup_pci_devs(current->children);
54current = current->next;
55}
56}
57

Archive Download this file

Revision: 885