summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86pciBus.c
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2010-09-10 19:16:30 +0300
committerTiago Vignatti <tiago.vignatti@nokia.com>2010-09-14 18:51:59 +0300
commitfc3ab84de7b5692f0db2b282ab0ed8e5a61d1fce (patch)
treebeec8a076d2dcc702faefe16adb2fa8692725c48 /hw/xfree86/common/xf86pciBus.c
parent49b817501f97d55480063c0b62544b3af75b4b7c (diff)
xfree86: configure: move buses references to their own location
This patch makes xf86Configure.c free of PCI and SBUS code, moving to a more meaningful location. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Diffstat (limited to 'hw/xfree86/common/xf86pciBus.c')
-rw-r--r--hw/xfree86/common/xf86pciBus.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 46aa23a1d..7f8823a36 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1327,3 +1327,38 @@ xf86PciMatchDriver(char* matches[], int nmatches) {
return i;
}
+
+Bool
+xf86PciConfigure(void *busData, struct pci_device *pDev)
+{
+ struct pci_device * pVideo = NULL;
+
+ pVideo = (struct pci_device *) busData;
+ if (pDev &&
+ (pDev->domain == pVideo->domain) &&
+ (pDev->bus == pVideo->bus) &&
+ (pDev->dev == pVideo->dev) &&
+ (pDev->func == pVideo->func))
+ return 0;
+
+ return 1;
+}
+
+void
+xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo,
+ GDevRec *GDev, int *chipset)
+{
+ char busnum[8];
+
+ pVideo = (struct pci_device *) busData;
+
+ GDev->busID = xnfalloc(16);
+ xf86FormatPciBusNumber(pVideo->bus, busnum);
+ sprintf(GDev->busID, "PCI:%s:%d:%d", busnum, pVideo->dev, pVideo->func);
+
+ GDev->chipID = pVideo->device_id;
+ GDev->chipRev = pVideo->revision;
+
+ if (*chipset < 0)
+ *chipset = (pVideo->vendor_id << 16) | pVideo->device_id;
+}