Bool xf86IsPrimaryPci(struct pci_device *pPci) { if (primaryBus.type == BUS_PCI) return pPci == primaryBus.id.pci; #ifdef XSERVER_PLATFORM_BUS if (primaryBus.type == BUS_PLATFORM) if (primaryBus.id.plat->pdev) if (MATCH_PCI_DEVICES(primaryBus.id.plat->pdev, pPci)) return TRUE; #endif return FALSE; }
static Bool xf86_check_platform_slot(const struct xf86_platform_device *pd) { int i; for (i = 0; i < xf86NumEntities; i++) { const EntityPtr u = xf86Entities[i]; if (pd->pdev && u->bus.type == BUS_PCI) return !MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci); if ((u->bus.type == BUS_PLATFORM) && (pd == u->bus.id.plat)) { return FALSE; } } return TRUE; }
Bool xf86CheckPciSlot(const struct pci_device *d) { int i; for (i = 0; i < xf86NumEntities; i++) { const EntityPtr p = xf86Entities[i]; if ((p->bus.type == BUS_PCI) && (p->bus.id.pci == d)) { return FALSE; } #ifdef XSERVER_PLATFORM_BUS if ((p->bus.type == BUS_PLATFORM) && (p->bus.id.plat->pdev)) { struct pci_device *ud = p->bus.id.plat->pdev; if (MATCH_PCI_DEVICES(ud, d)) return FALSE; } #endif } return TRUE; }
Bool xf86IsEntityPrimary(int entityIndex) { EntityPtr pEnt = xf86Entities[entityIndex]; #ifdef XSERVER_LIBPCIACCESS if (primaryBus.type == BUS_PLATFORM && pEnt->bus.type == BUS_PCI) return MATCH_PCI_DEVICES(pEnt->bus.id.pci, primaryBus.id.plat->pdev); #endif if (primaryBus.type != pEnt->bus.type) return FALSE; switch (pEnt->bus.type) { case BUS_PCI: return pEnt->bus.id.pci == primaryBus.id.pci; case BUS_SBUS: return pEnt->bus.id.sbus.fbNum == primaryBus.id.sbus.fbNum; case BUS_PLATFORM: return pEnt->bus.id.plat == primaryBus.id.plat; default: return FALSE; } }