Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 996