#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include <stdio.h>
#include <unistd.h>
#include "altixPCI.h"
#include "xf86.h"
#include "Pci.h"
void xf86PreScanAltix(void)
{
}
void xf86PostScanAltix(void)
{
pciConfigPtr *pdev;
int idx, free_idx;
pdev = xf86scanpci(0);
for (idx = 0; pdev[idx] != NULL; idx++)
;
free_idx = idx;
for (idx = 0; idx < free_idx; idx++) {
pciConfigPtr dev, fakedev;
pciBusInfo_t *businfo;
dev = pdev[idx];
businfo = pciBusInfo[dev->busnum];
if (! businfo) {
continue;
}
if (businfo->bridge) {
continue;
}
if (free_idx >= MAX_PCI_DEVICES)
FatalError("SN: No room for fake root bridge device\n");
fakedev = xnfcalloc(1, sizeof(pciDevice));
fakedev->tag = PCI_MAKE_TAG(dev->busnum, 0, 0);;
fakedev->busnum = dev->busnum;
fakedev->devnum = 0;
fakedev->funcnum = 0;
fakedev->fakeDevice = 1;
fakedev->pci_device_vendor = DEVID(VENDOR_GENERIC, CHIP_VGA);
fakedev->pci_base_class = PCI_CLASS_BRIDGE;
businfo->secondary = 0;
businfo->primary_bus = dev->busnum;
businfo->bridge = fakedev;
fakedev->businfo = businfo;
pdev[free_idx++] = fakedev;
}
}