Chameleon

Chameleon Svn Source Tree

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

1#include "libsaio.h"
2#include "boot.h"
3#include "bootstruct.h"
4#include "pci.h"
5#include "nvidia.h"
6#include "ati.h"
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
12void setup_pci_devs(pci_dt_t *pci_dt)
13{
14char *devicepath;
15bool do_eth_devprop, do_gfx_devprop, do_enable_hpet;
16pci_dt_t *current = pci_dt;
17
18do_eth_devprop = do_gfx_devprop = do_enable_hpet = false;
19
20getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->bootConfig);
21getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->bootConfig);
22getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->bootConfig);
23
24while (current)
25{
26devicepath = get_pci_dev_path(current);
27
28switch (current->class_id)
29{
30case PCI_CLASS_NETWORK_ETHERNET:
31if (do_eth_devprop)
32set_eth_builtin(current);
33break;
34
35case PCI_CLASS_DISPLAY_VGA:
36if (do_gfx_devprop)
37switch (current->vendor_id)
38{
39case PCI_VENDOR_ID_ATI:
40verbose("ATI VGA Controller [%04x:%04x] :: %s \n",
41current->vendor_id, current->device_id, devicepath);
42setup_ati_devprop(current);
43break;
44
45case PCI_VENDOR_ID_INTEL:
46/* message to be removed once support for these cards is added */
47verbose("Intel VGA Controller [%04x:%04x] :: %s (currently NOT SUPPORTED)\n",
48current->vendor_id, current->device_id, devicepath);
49break;
50
51case PCI_VENDOR_ID_NVIDIA:
52setup_nvidia_devprop(current);
53break;
54}
55break;
56
57case PCI_CLASS_SERIAL_USB:
58notify_usb_dev(current);
59break;
60
61case PCI_CLASS_BRIDGE_ISA:
62if (do_enable_hpet)
63force_enable_hpet(current);
64break;
65}
66
67setup_pci_devs(current->children);
68current = current->next;
69}
70}
71

Archive Download this file

Revision: 215