Index: GL/dri/dri.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/GL/dri/dri.c,v retrieving revision 1.14 diff -u -r1.14 dri.c --- GL/dri/dri.c 15 Jul 2005 23:08:30 -0000 1.14 +++ GL/dri/dri.c 7 Aug 2005 04:20:27 -0000 @@ -2193,15 +2193,13 @@ { char *busID; int domain; - PCITAG tag; busID = xalloc(20); if (busID == NULL) return NULL; - tag = pciTag(PciInfo->bus, PciInfo->device, PciInfo->func); - domain = xf86GetPciDomain(tag); - snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", domain, PciInfo->bus, - PciInfo->device, PciInfo->func); + domain = xf86GetPciDomain(&PciInfo->pciid); + snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", domain, PciInfo->pciid.bus, + PciInfo->pciid.device, PciInfo->pciid.func); return busID; } Index: hw/xfree86/common/xf86.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86.h,v retrieving revision 1.6 diff -u -r1.6 xf86.h --- hw/xfree86/common/xf86.h 7 Jul 2005 19:07:28 -0000 1.6 +++ hw/xfree86/common/xf86.h 7 Aug 2005 04:20:31 -0000 @@ -99,12 +99,11 @@ /* xf86Bus.c */ -Bool xf86CheckPciSlot(int bus, int device, int func); -int xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp, +Bool xf86CheckPciSlot(PciBusId *bus_id); +int xf86ClaimPciSlot(PciBusId *bus_id, DriverPtr drvp, int chipset, GDevPtr dev, Bool active); -Bool xf86ParsePciBusString(const char *busID, int *bus, int *device, - int *func); -Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func); +Bool xf86ParsePciBusString(const char *busID, PciBusId *bus_id); +Bool xf86ComparePciBusString(const char *busID, PciBusId *bus_id); void xf86FormatPciBusNumber(int busnum, char *buffer); pciVideoPtr *xf86GetPciVideoInfo(void); pciConfigPtr *xf86GetPciConfigInfo(void); @@ -159,7 +158,7 @@ memType decode_mask, memType address_mask, resPtr avoid); memType xf86ChkConflict(resRange *rgp, int entityIndex); -Bool xf86IsPciDevPresent(int bus, int dev, int func); +Bool xf86IsPciDevPresent(PciBusId *bus_id); ScrnInfoPtr xf86FindScreenForEntity(int entityIndex); Bool xf86NoSharedResources(int screenIndex, resType res); resPtr xf86FindIntersectOfLists(resPtr l1, resPtr l2); Index: hw/xfree86/common/xf86AutoConfig.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86AutoConfig.c,v retrieving revision 1.3 diff -u -r1.3 xf86AutoConfig.c --- hw/xfree86/common/xf86AutoConfig.c 3 Jul 2005 07:01:24 -0000 1.3 +++ hw/xfree86/common/xf86AutoConfig.c 7 Aug 2005 04:20:31 -0000 @@ -258,7 +258,7 @@ strcat(searchPath, GETCONFIG_DIR); ErrorF("xf86AutoConfig: Primary PCI is %d:%d:%d\n", - info->bus, info->device, info->func); + info->pciid.bus, info->pciid.device, info->pciid.func); snprintf(buf, sizeof(buf), "%s" #ifdef DEBUG Index: hw/xfree86/common/xf86Bus.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v retrieving revision 1.10 diff -u -r1.10 xf86Bus.c --- hw/xfree86/common/xf86Bus.c 3 Jul 2005 08:53:42 -0000 1.10 +++ hw/xfree86/common/xf86Bus.c 7 Aug 2005 04:20:34 -0000 @@ -1902,9 +1902,7 @@ case BUS_PCI: ppaccp = xf86PciAccInfo; while (*ppaccp) { - if ((*ppaccp)->busnum == pEnt->pciBusId.bus - && (*ppaccp)->devnum == pEnt->pciBusId.device - && (*ppaccp)->funcnum == pEnt->pciBusId.func) { + if (PCI_COMPARE_IDS((*ppaccp)->pciid, pEnt->pciBusId)) { *acc_io = &(*ppaccp)->ioAccess; *acc_mem = &(*ppaccp)->memAccess; *acc_mem_io = &(*ppaccp)->io_memAccess; Index: hw/xfree86/common/xf86Bus.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Bus.h,v retrieving revision 1.2 diff -u -r1.2 xf86Bus.h --- hw/xfree86/common/xf86Bus.h 3 Jul 2005 07:01:24 -0000 1.2 +++ hw/xfree86/common/xf86Bus.h 7 Aug 2005 04:20:34 -0000 @@ -124,7 +124,7 @@ struct { int bus; int primary_bus; - PCITAG acc; + PciBusId acc; pciBridgesSave save; } pci; } busdep; Index: hw/xfree86/common/xf86Configure.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v retrieving revision 1.12 diff -u -r1.12 xf86Configure.c --- hw/xfree86/common/xf86Configure.c 3 Jul 2005 08:53:42 -0000 1.12 +++ hw/xfree86/common/xf86Configure.c 7 Aug 2005 04:20:34 -0000 @@ -112,10 +112,7 @@ case BUS_PCI: pVideo = (pciVideoPtr) busData; for (i = 0; i < nDevToConfig; i++) - if (DevToConfig[i].pVideo && - (DevToConfig[i].pVideo->bus == pVideo->bus) && - (DevToConfig[i].pVideo->device == pVideo->device) && - (DevToConfig[i].pVideo->func == pVideo->func)) + if (DevToConfig[i].pVideo && PCI_COMPARE_IDS(DevToConfig[i].pVideo->pciid, pVideo->pciid)) return NULL; isPrimary = xf86IsPrimaryPci(pVideo); break; @@ -195,9 +192,9 @@ NewDevice.GDev.board = (char *)CardName; NewDevice.GDev.busID = xnfalloc(16); - xf86FormatPciBusNumber(pVideo->bus, busnum); + xf86FormatPciBusNumber(pVideo->pciid.bus, busnum); sprintf(NewDevice.GDev.busID, "PCI:%s:%d:%d", - busnum, pVideo->device, pVideo->func); + busnum, pVideo->pciid.device, pVideo->pciid.func); NewDevice.GDev.chipID = pVideo->chipType; NewDevice.GDev.chipRev = pVideo->chipRev; Index: hw/xfree86/common/xf86Helper.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v retrieving revision 1.9 diff -u -r1.9 xf86Helper.c --- hw/xfree86/common/xf86Helper.c 3 Jul 2005 08:53:42 -0000 1.9 +++ hw/xfree86/common/xf86Helper.c 7 Aug 2005 04:20:37 -0000 @@ -1714,7 +1714,7 @@ for (i = 0; i < allocatedInstances; i++) { pPci = instances[i].pci; if (instances[i].foundHW) { - if (!xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func)) + if (!xf86CheckPciSlot(&pPci->pciid)) continue; actualcards++; pGDev = xf86AddDeviceToConfigure(drvp->driverName, @@ -1749,9 +1749,7 @@ && *devList[j]->busID) { for (i = 0; i < allocatedInstances; i++) { pPci = instances[i].pci; - if (xf86ComparePciBusString(devList[j]->busID, pPci->bus, - pPci->device, - pPci->func)) { + if (xf86ComparePciBusString(devList[j]->busID, &pPci->pciid)) { allocatedInstances++; instances = xnfrealloc(instances, allocatedInstances * @@ -1772,9 +1770,7 @@ dev = NULL; for (j = 0; j < numDevs; j++) { if (devList[j]->busID && *devList[j]->busID) { - if (xf86ComparePciBusString(devList[j]->busID, pPci->bus, - pPci->device, - pPci->func) && + if (xf86ComparePciBusString(devList[j]->busID, &pPci->pciid) && devList[j]->screen == instances[i].screen) { if (devBus) @@ -1805,10 +1801,10 @@ } if (devBus) dev = devBus; /* busID preferred */ if (!dev) { - if (xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func)) { + if (xf86CheckPciSlot(&pPci->pciid)) { xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section " "for instance (BusID PCI:%i:%i:%i) found\n", - driverName, pPci->bus, pPci->device, pPci->func); + driverName, pPci->pciid.bus, pPci->pciid.device, pPci->pciid.func); } } else { numClaimedInstances++; @@ -1919,20 +1915,20 @@ * the same screen > 0 instance. */ if (instances[i].screen == 0 && - !xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func)) + !xf86CheckPciSlot(&pPci->pciid)) continue; #ifdef DEBUG ErrorF("%s: card at %d:%d:%d is claimed by a Device section\n", - driverName, pPci->bus, pPci->device, pPci->func); + driverName, pPci->pciid.bus, pPci->pciid.device, pPci->pciid.func); #endif /* Allocate an entry in the lists to be returned */ numFound++; retEntities = xnfrealloc(retEntities, numFound * sizeof(int)); retEntities[numFound - 1] - = xf86ClaimPciSlot(pPci->bus, pPci->device, - pPci->func,drvp, instances[i].chip, + = xf86ClaimPciSlot(&pPci->pciid, + drvp, instances[i].chip, instances[i].dev,instances[i].dev->active ? TRUE : FALSE); if (retEntities[numFound - 1] == -1 && instances[i].screen > 0) { @@ -1940,9 +1936,7 @@ EntityPtr pEnt = xf86Entities[j]; if (pEnt->busType != BUS_PCI) continue; - if (pEnt->pciBusId.bus == pPci->bus && - pEnt->pciBusId.device == pPci->device && - pEnt->pciBusId.func == pPci->func) { + if (PCI_COMPARE_IDS(pEnt->pciBusId, pPci->pciid)) { retEntities[numFound - 1] = j; xf86AddDevToEntity(j, instances[i].dev); break; Index: hw/xfree86/common/xf86Priv.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v retrieving revision 1.5 diff -u -r1.5 xf86Priv.h --- hw/xfree86/common/xf86Priv.h 4 Jul 2005 18:41:02 -0000 1.5 +++ hw/xfree86/common/xf86Priv.h 7 Aug 2005 04:20:37 -0000 @@ -157,8 +157,9 @@ void xf86AddDevToEntity(int entityIndex, GDevPtr dev); extern void xf86PostPreInit(void); extern void xf86PostScreenInit(void); -extern memType getValidBIOSBase(PCITAG tag, int num); -extern int pciTestMultiDeviceCard(int bus, int dev, int func, PCITAG** pTag); +extern memType getValidBIOSBase(PciBusId * tag, int num); +extern int pciTestMultiDeviceCard(PciBusId *bus_id, PciBusId** pTag); +extern void pciFreeTestMultiDeviceCardIds(PciBusId* pTag); /* xf86Config.c */ Index: hw/xfree86/common/xf86pciBus.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v retrieving revision 1.15 diff -u -r1.15 xf86pciBus.c --- hw/xfree86/common/xf86pciBus.c 4 Jul 2005 18:41:02 -0000 1.15 +++ hw/xfree86/common/xf86pciBus.c 7 Aug 2005 04:20:40 -0000 @@ -116,7 +116,7 @@ #define I2B(tag,base) pciHostAddrToBusAddr(tag,PCI_IO,base) #define H2B(tag,base,type) (((type & ResPhysMask) == ResMem) ? \ M2B(tag, base) : I2B(tag, base)) -#define TAG(pvp) (pciTag(pvp->bus,pvp->device,pvp->func)) +#define TAG(pvp) (&pvp->pciid) #define SIZE(size) ((1 << size) - 1) #define PCI_SIZE(type,tag,size) (((type & ResPhysMask) == ResMem) \ ? pciBusAddrToHostAddr(tag,PCI_MEM_SIZE,size) \ @@ -149,7 +149,7 @@ P_I_RANGE(range,TAG(pvp),pvp->ioBase[i],pvp->size[i],type) static void getPciClassFlags(pciConfigPtr *pcrpp); -static void pciConvertListToHost(int bus, int dev, int func, resPtr list); +static void pciConvertListToHost(PciBusId *bus_id, resPtr list); static PciBusPtr xf86GetPciBridgeInfo(void); void @@ -220,10 +220,7 @@ } if (PCIINFOCLASSES(baseclass, subclass) && - (DoIsolateDeviceCheck ? - (xf86IsolateDevice.bus == pcrp->busnum && - xf86IsolateDevice.device == pcrp->devnum && - xf86IsolateDevice.func == pcrp->funcnum) : 1)) { + (DoIsolateDeviceCheck ? PCI_COMPARE_IDS(xf86IsolateDevice, pcrp->pciid) : 1)) { num++; xf86PciVideoInfo = xnfrealloc(xf86PciVideoInfo, sizeof(pciVideoPtr) * (num + 1)); @@ -235,14 +232,12 @@ info->chipRev = pcrp->pci_rev_id; info->subsysVendor = pcrp->pci_subsys_vendor; info->subsysCard = pcrp->pci_subsys_card; - info->bus = pcrp->busnum; - info->device = pcrp->devnum; - info->func = pcrp->funcnum; + info->pciid = pcrp->pciid; info->class = baseclass; info->subclass = pcrp->pci_sub_class; info->interface = pcrp->pci_prog_if; info->biosBase = PCIGETROM(pcrp->pci_baserom); - info->biosSize = pciGetBaseSize(pcrp->tag, 6, TRUE, NULL); + info->biosSize = pciGetBaseSize(&pcrp->pciid, 6, TRUE, NULL); info->thisCard = pcrp; info->validate = FALSE; #ifdef INCLUDE_XF86_NO_DOMAIN @@ -255,7 +250,7 @@ * adapter on entry. This needs to be fixed when we finally * grok host bridges (and multiple bus trees). */ - j = info->bus; + j = info->pciid.bus; while (TRUE) { PciBusPtr pBus = xf86PciBus; while (pBus && j != pBus->secondary) @@ -266,9 +261,8 @@ if (primaryBus.type == BUS_NONE) { /* assumption: primary adapter is always VGA */ primaryBus.type = BUS_PCI; - primaryBus.id.pci.bus = pcrp->busnum; - primaryBus.id.pci.device = pcrp->devnum; - primaryBus.id.pci.func = pcrp->funcnum; + /* copy over the PCI id structure */ + primaryBus.id.pci = pcrp->pciid; } else if (primaryBus.type < BUS_last) { xf86Msg(X_NOTICE, "More than one primary device found\n"); @@ -286,7 +280,7 @@ info->ioBase[j] = 0; if (PCINONSYSTEMCLASSES(baseclass, subclass)) { info->size[j] = - pciGetBaseSize(pcrp->tag, j, TRUE, &info->validSize); + pciGetBaseSize(&pcrp->pciid, j, TRUE, &info->validSize); pcrp->minBasesize = info->validSize; } else { info->size[j] = pcrp->basesize[j]; @@ -306,15 +300,15 @@ for (j = 0; j < 6; j++) { if (!PCI_MAP_IS64BITMEM(base[j])) { if (info->size[j] && IsBaseUnassigned(base[j])) - base[j] = pciCheckForBrokenBase(pcrp->tag, j); + base[j] = pciCheckForBrokenBase(&pcrp->pciid, j); } else { if (j == 5) /* bail out */ break; if (info->size[j] && IsBaseUnassigned64(base[j],base[j+1])) { - base[j] = pciCheckForBrokenBase(pcrp->tag, j); + base[j] = pciCheckForBrokenBase(&pcrp->pciid, j); j++; - base[j] = pciCheckForBrokenBase(pcrp->tag, j); + base[j] = pciCheckForBrokenBase(&pcrp->pciid, j); } } } @@ -374,9 +368,7 @@ (info->subclass == PCI_SUBCLASS_DISPLAY_VGA)))) { if (primaryBus.type == BUS_NONE) { primaryBus.type = BUS_PCI; - primaryBus.id.pci.bus = pcrp->busnum; - primaryBus.id.pci.device = pcrp->devnum; - primaryBus.id.pci.func = pcrp->funcnum; + primaryBus.id.pci = pcrp->pciid; } else { xf86Msg(X_NOTICE, "More than one possible primary device found\n"); @@ -395,7 +387,7 @@ i = 0; info = xf86PciVideoInfo[k]; - xf86FormatPciBusNumber(info->bus, busnum); + xf86FormatPciBusNumber(info->pciid.bus, busnum); xf86FindPciNamesByDevice(info->vendor, info->chipType, NOVENDOR, NOSUBSYS, &vendorname, &chipname, NULL, NULL); @@ -405,8 +397,8 @@ if (xf86IsPrimaryPci(info)) prim = "*"; - xf86Msg(X_PROBED, "PCI:%s(%s:%d:%d) ", prim, busnum, info->device, - info->func); + xf86Msg(X_PROBED, "PCI:%s(%s:%d:%d) ", prim, busnum, info->pciid.device, + info->pciid.func); if (vendorname) xf86ErrorF("%s ", vendorname); else @@ -468,22 +460,19 @@ { pciVideoPtr pvp; resPtr pAcc; - PCITAG tag; int j; if (! (pvp = xf86GetPciInfoForEntity(entityIndex))) return; if (pvp->validSize) return; - tag = pciTag(pvp->bus,pvp->device,pvp->func); - for (j = 0; j < 6; j++) { pAcc = Acc; if (pvp->memBase[j]) while (pAcc) { if (((pAcc->res_type & (ResPhysMask | ResBlock)) == (ResMem | ResBlock)) - && (pAcc->block_begin == B2M(TAG(pvp),pvp->memBase[j])) - && (pAcc->block_end == B2M(TAG(pvp),pvp->memBase[j] + && (pAcc->block_begin == B2M(&pvp->pciid,pvp->memBase[j])) + && (pAcc->block_end == B2M(&pvp->pciid,pvp->memBase[j] + SIZE(pvp->size[j])))) break; pAcc = pAcc->next; } @@ -491,17 +480,17 @@ while (pAcc) { if (((pAcc->res_type & (ResPhysMask | ResBlock)) == (ResIo | ResBlock)) - && (pAcc->block_begin == B2I(TAG(pvp),pvp->ioBase[j])) - && (pAcc->block_end == B2I(TAG(pvp),pvp->ioBase[j] + && (pAcc->block_begin == B2I(&pvp->pciid,pvp->ioBase[j])) + && (pAcc->block_end == B2I(&pvp->pciid,pvp->ioBase[j] + SIZE(pvp->size[j])))) break; pAcc = pAcc->next; } else continue; - pvp->size[j] = pciGetBaseSize(tag, j, TRUE, &pvp->validSize); + pvp->size[j] = pciGetBaseSize(&pvp->pciid, j, TRUE, &pvp->validSize); if (pAcc) { pAcc->block_end = pvp->memBase[j] ? - B2M(TAG(pvp),pvp->memBase[j] + SIZE(pvp->size[j])) - : B2I(TAG(pvp),pvp->ioBase[j] + SIZE(pvp->size[j])); + B2M(&pvp->pciid,pvp->memBase[j] + SIZE(pvp->size[j])) + : B2I(&pvp->pciid,pvp->ioBase[j] + SIZE(pvp->size[j])); pAcc->res_type &= ~ResEstimated; pAcc->res_type |= ResBios; } @@ -511,14 +500,14 @@ while (pAcc) { if (((pAcc->res_type & (ResPhysMask | ResBlock)) == (ResMem | ResBlock)) - && (pAcc->block_begin == B2M(TAG(pvp),pvp->biosBase)) - && (pAcc->block_end == B2M(TAG(pvp),pvp->biosBase + && (pAcc->block_begin == B2M(&pvp->pciid,pvp->biosBase)) + && (pAcc->block_end == B2M(&pvp->pciid,pvp->biosBase + SIZE(pvp->biosSize)))) break; pAcc = pAcc->next; } - pvp->biosSize = pciGetBaseSize(tag, 6, TRUE, &pvp->validSize); + pvp->biosSize = pciGetBaseSize(&pvp->pciid, 6, TRUE, &pvp->validSize); if (pAcc) { - pAcc->block_end = B2M(TAG(pvp),pvp->biosBase+SIZE(pvp->biosSize)); + pAcc->block_end = B2M(&pvp->pciid,pvp->biosBase+SIZE(pvp->biosSize)); pAcc->res_type &= ~ResEstimated; pAcc->res_type |= ResBios; } @@ -537,7 +526,7 @@ ErrorF("pciIoAccessEnable: 0x%05lx\n", *(PCITAG *)arg); #endif pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE; - pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); + pciWriteLong(&pArg->pciid, PCI_CMD_STAT_REG, pArg->ctrl); } static void @@ -547,7 +536,7 @@ ErrorF("pciIoAccessDisable: 0x%05lx\n", *(PCITAG *)arg); #endif pArg->ctrl &= ~SETBITS; - pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); + pciWriteLong(&pArg->pciid, PCI_CMD_STAT_REG, pArg->ctrl); } #undef SETBITS @@ -559,7 +548,7 @@ ErrorF("pciIo_MemAccessEnable: 0x%05lx\n", *(PCITAG *)arg); #endif pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE; - pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); + pciWriteLong(&pArg->pciid, PCI_CMD_STAT_REG, pArg->ctrl); } static void @@ -569,7 +558,7 @@ ErrorF("pciIo_MemAccessDisable: 0x%05lx\n", *(PCITAG *)arg); #endif pArg->ctrl &= ~SETBITS; - pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); + pciWriteLong(&pArg->pciid, PCI_CMD_STAT_REG, pArg->ctrl); } #undef SETBITS @@ -581,7 +570,7 @@ ErrorF("pciMemAccessEnable: 0x%05lx\n", *(PCITAG *)arg); #endif pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE; - pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); + pciWriteLong(&pArg->pciid, PCI_CMD_STAT_REG, pArg->ctrl); } static void @@ -591,7 +580,7 @@ ErrorF("pciMemAccessDisable: 0x%05lx\n", *(PCITAG *)arg); #endif pArg->ctrl &= ~SETBITS; - pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); + pciWriteLong(&pArg->pciid, PCI_CMD_STAT_REG, pArg->ctrl); } #undef SETBITS #undef pArg @@ -602,17 +591,16 @@ static void pciBusAccessEnable(BusAccPtr ptr) { - PCITAG tag = ptr->busdep.pci.acc; CARD16 ctrl; #ifdef DEBUG ErrorF("pciBusAccessEnable: bus=%d\n", ptr->busdep.pci.bus); #endif - ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG); + ctrl = pciReadWord(&ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG); if ((ctrl & MASKBITS) != PCI_PCI_BRIDGE_VGA_EN) { ctrl = (ctrl | PCI_PCI_BRIDGE_VGA_EN) & ~(PCI_PCI_BRIDGE_MASTER_ABORT_EN | PCI_PCI_BRIDGE_SECONDARY_RESET); - pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl); + pciWriteWord(&ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG, ctrl); } } @@ -620,16 +608,15 @@ static void pciBusAccessDisable(BusAccPtr ptr) { - PCITAG tag = ptr->busdep.pci.acc; CARD16 ctrl; #ifdef DEBUG ErrorF("pciBusAccessDisable: bus=%d\n", ptr->busdep.pci.bus); #endif - ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG); + ctrl = pciReadWord(&ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG); if (ctrl & MASKBITS) { ctrl &= ~(MASKBITS | PCI_PCI_BRIDGE_SECONDARY_RESET); - pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl); + pciWriteWord(&ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG, ctrl); } } #undef MASKBITS @@ -691,43 +678,41 @@ /* move to OS layer */ static void -savePciState(PCITAG tag, pciSavePtr ptr) +savePciState(PciBusId *busid, pciSavePtr ptr) { int i; - ptr->command = pciReadLong(tag, PCI_CMD_STAT_REG); + ptr->command = pciReadLong(busid, PCI_CMD_STAT_REG); for (i=0; i < 6; i++) - ptr->base[i] = pciReadLong(tag, PCI_CMD_BASE_REG + i*4); - ptr->biosBase = pciReadLong(tag, PCI_CMD_BIOS_REG); + ptr->base[i] = pciReadLong(busid, PCI_CMD_BASE_REG + i*4); + ptr->biosBase = pciReadLong(busid, PCI_CMD_BIOS_REG); } /* move to OS layer */ static void -restorePciState(PCITAG tag, pciSavePtr ptr) +restorePciState(PciBusId *busid, pciSavePtr ptr) { int i; /* disable card before setting anything */ - pciSetBitsLong(tag, PCI_CMD_STAT_REG, + pciSetBitsLong(busid, PCI_CMD_STAT_REG, PCI_CMD_MEM_ENABLE | PCI_CMD_IO_ENABLE , 0); - pciWriteLong(tag,PCI_CMD_BIOS_REG, ptr->biosBase); + pciWriteLong(busid,PCI_CMD_BIOS_REG, ptr->biosBase); for (i=0; i<6; i++) - pciWriteLong(tag, PCI_CMD_BASE_REG + i*4, ptr->base[i]); - pciWriteLong(tag, PCI_CMD_STAT_REG, ptr->command); + pciWriteLong(busid, PCI_CMD_BASE_REG + i*4, ptr->base[i]); + pciWriteLong(busid, PCI_CMD_STAT_REG, ptr->command); } /* move to OS layer */ static void savePciBusState(BusAccPtr ptr) { - PCITAG tag = ptr->busdep.pci.acc; - ptr->busdep.pci.save.control = - pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG) & + pciReadWord(&ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG) & ~PCI_PCI_BRIDGE_SECONDARY_RESET; /* Allow master aborts to complete normally on non-root buses */ if (ptr->busdep.pci.save.control & PCI_PCI_BRIDGE_MASTER_ABORT_EN) - pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, + pciWriteWord(&ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG, ptr->busdep.pci.save.control & ~PCI_PCI_BRIDGE_MASTER_ABORT_EN); } @@ -736,15 +721,14 @@ static void restorePciBusState(BusAccPtr ptr) { - PCITAG tag = ptr->busdep.pci.acc; CARD16 ctrl; /* Only restore the bits we've changed (and don't cause resets) */ - ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG); + ctrl = pciReadWord(&ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG); if ((ctrl ^ ptr->busdep.pci.save.control) & MASKBITS) { ctrl &= ~(MASKBITS | PCI_PCI_BRIDGE_SECONDARY_RESET); ctrl |= ptr->busdep.pci.save.control & MASKBITS; - pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl); + pciWriteWord(&ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG, ctrl); } } #undef MASKBITS @@ -775,9 +759,9 @@ static void -disablePciBios(PCITAG tag) +disablePciBios(PciBusId *busid) { - pciSetBitsLong(tag, PCI_CMD_BIOS_REG, PCI_CMD_BIOS_ENABLE, 0); + pciSetBitsLong(busid, PCI_CMD_BIOS_REG, PCI_CMD_BIOS_ENABLE, 0); } /* ????? */ @@ -811,18 +795,18 @@ if (basep[i] && (pcrp->basesize[i] == old_bits)) { if ((((type & ResPhysMask) == ResIo) && PCI_MAP_IS_IO(basep[i]) && - B2I(pcrp->tag,PCIGETIO(basep[i]) == base)) || + B2I(&pcrp->pciid,PCIGETIO(basep[i]) == base)) || (((type & ResPhysMask) == ResMem) && PCI_MAP_IS_MEM(basep[i]) && (((!PCI_MAP_IS64BITMEM(basep[i])) && - (B2M(pcrp->tag,PCIGETMEMORY(basep[i])) == base)) + (B2M(&pcrp->pciid,PCIGETMEMORY(basep[i])) == base)) #if defined(LONG64) || defined(WORD64) || - (B2M(pcrp->tag,PCIGETMEMORY64(basep[i])) == base) + (B2M(&pcrp->pciid,PCIGETMEMORY64(basep[i])) == base) #else || (!basep[i+1] - && (B2M(pcrp->tag,PCIGETMEMORY(basep[i])) == base)) + && (B2M(&pcrp->pciid,PCIGETMEMORY(basep[i])) == base)) #endif ))) { pcrp->basesize[i] = new_bits; @@ -839,9 +823,9 @@ for (i = 0; i < 6; i++) { if (pvp->size[i] == old_bits) { if ((((type & ResPhysMask) == ResIo) && pvp->ioBase[i] - && (B2I(TAG(pvp),pvp->ioBase[i]) == base)) || + && (B2I(&pvp->pciid,pvp->ioBase[i]) == base)) || (((type & ResPhysMask) == ResMem) && pvp->memBase[i] - && (B2M(TAG(pvp),pvp->memBase[i]) == base))) { + && (B2M(&pvp->pciid,pvp->memBase[i]) == base))) { pvp->size[i] = new_bits; break; /* to next device */ } @@ -934,13 +918,13 @@ (pvp->ioBase[i] < (memType)(-1 << pvp->size[i]))) { PV_I_RANGE(range,pvp,i,ResExcIoBlock | resMisc); tmp = xf86AddResToList(NULL, &range, -1); - removeOverlapsWithBridges(pvp->bus,tmp); + removeOverlapsWithBridges(pvp->pciid.bus,tmp); *res = xf86JoinResLists(tmp,*res); } else if (pvp->memBase[i] && (pvp->memBase[i] < (memType)(-1 << pvp->size[i]))) { PV_M_RANGE(range, pvp,i, ResExcMemBlock | resMisc); tmp = xf86AddResToList(NULL, &range, -1); - removeOverlapsWithBridges(pvp->bus,tmp); + removeOverlapsWithBridges(pvp->pciid.bus,tmp); *res = xf86JoinResLists(tmp,*res); } } @@ -951,7 +935,7 @@ (pvp->biosBase < (memType)(-1 << pvp->biosSize))) { PV_B_RANGE(range, pvp, ResExcMemBlock | resMisc); tmp = xf86AddResToList(NULL, &range, -1); - removeOverlapsWithBridges(pvp->bus,tmp); + removeOverlapsWithBridges(pvp->pciid.bus,tmp); *res = xf86JoinResLists(tmp,*res); } } @@ -997,24 +981,24 @@ res = activeRes; else res = inactiveRes; - P_I_RANGE(range, pcrp->tag, PCIGETIO(basep[i]), + P_I_RANGE(range, &pcrp->pciid, PCIGETIO(basep[i]), pcrp->basesize[i], ResExcIoBlock | resMisc) } else if (!PCI_MAP_IS64BITMEM(basep[i])) { if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) res = activeRes; else res = inactiveRes; - P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i]), + P_M_RANGE(range, &pcrp->pciid, PCIGETMEMORY(basep[i]), pcrp->basesize[i], ResExcMemBlock | resMisc) } else { i++; #if defined(LONG64) || defined(WORD64) - P_M_RANGE(range,pcrp->tag,PCIGETMEMORY64(basep[i - 1]), + P_M_RANGE(range,&pcrp->pciid,PCIGETMEMORY64(basep[i - 1]), pcrp->basesize[i - 1], ResExcMemBlock | resMisc) #else if (basep[i]) continue; - P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i - 1]), + P_M_RANGE(range, &pcrp->pciid, PCIGETMEMORY(basep[i - 1]), pcrp->basesize[i - 1], ResExcMemBlock | resMisc) #endif if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) @@ -1024,7 +1008,7 @@ } if (range.rBegin) { /* catch cases where PCI base is unset */ tmp = xf86AddResToList(NULL, &range, -1); - removeOverlapsWithBridges(pcrp->busnum,tmp); + removeOverlapsWithBridges(pcrp->pciid.bus,tmp); *res = xf86JoinResLists(tmp,*res); } } @@ -1033,11 +1017,11 @@ /* Ignore disabled non-video ROMs */ if ((pcrp->pci_command & PCI_CMD_MEM_ENABLE) && (pcrp->pci_baserom & PCI_MAP_ROM_DECODE_ENABLE)) { - P_M_RANGE(range,pcrp->tag,PCIGETROM(pcrp->pci_baserom), + P_M_RANGE(range,&pcrp->pciid,PCIGETROM(pcrp->pci_baserom), pcrp->basesize[6], ResExcMemBlock | resMisc); if (range.rBegin) { tmp = xf86AddResToList(NULL, &range, -1); - removeOverlapsWithBridges(pcrp->busnum, tmp); + removeOverlapsWithBridges(pcrp->pciid.bus, tmp); *activeRes = xf86JoinResLists(tmp, *activeRes); } } @@ -1169,13 +1153,11 @@ resRange range; resPtr resSize = NULL; resPtr w_tmp, w = NULL, w_2nd = NULL; - PCITAG tag; PciBusPtr pbp = xf86PciBus; pciConfigPtr pcp; resPtr tmp; if (!pvp) return FALSE; - tag = pciTag(pvp->bus,pvp->device,pvp->func); pcp = pvp->thisCard; type &= ResAccMask; @@ -1188,7 +1170,7 @@ p_size = &(pvp->size[res_n]); p_type = pvp->type[res_n]; if (!PCI_MAP_IS64BITMEM(pvp->type[res_n])) { - PCI_M_RANGE(range,tag,0,0xffffffff,ResExcMemBlock); + PCI_M_RANGE(range,&pvp->pciid,0,0xffffffff,ResExcMemBlock); resSize = xf86AddResToList(resSize,&range,-1); } } else if (pvp->ioBase[prt]){ @@ -1197,7 +1179,7 @@ p_base = &(pvp->ioBase[res_n]); p_size = &(pvp->size[res_n]); p_type = pvp->type[res_n]; - PCI_I_RANGE(range, tag, 0, 0xffffffff, ResExcIoBlock); + PCI_I_RANGE(range, &pvp->pciid, 0, 0xffffffff, ResExcIoBlock); resSize = xf86AddResToList(resSize, &range, -1); } else return FALSE; } else if (prt == 6) { @@ -1207,7 +1189,7 @@ p_size = &(pvp->biosSize); /* XXX This should also include the PCI_MAP_MEMORY_TYPE_MASK part */ p_type = 0; - PCI_M_RANGE(range,tag,0,0xffffffff,ResExcMemBlock); + PCI_M_RANGE(range,&pvp->pciid,0,0xffffffff,ResExcMemBlock); resSize = xf86AddResToList(resSize,&range,-1); } else return FALSE; @@ -1219,7 +1201,7 @@ avoid = xf86DupResList(pciAvoidRes); while (pbp) { - if (pbp->secondary == pvp->bus) { + if (pbp->secondary == pvp->pciid.bus) { if ((type & ResPhysMask) == ResMem) { if (((p_type & PCI_MAP_MEMORY_CACHABLE) #if 0 /*EE*/ @@ -1251,7 +1233,7 @@ if (pbp->io) w = xf86FindIntersectOfLists(pbp->io,ResRange); } - } else if (pbp->primary == pvp->bus) { + } else if (pbp->primary == pvp->pciid.bus) { if ((type & ResPhysMask) == ResMem) { tmp = xf86DupResList(pbp->preferred_pmem); avoid = xf86JoinResLists(avoid, tmp); @@ -1266,7 +1248,7 @@ } /* convert bus based entries in avoid list to host base */ - pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid); + pciConvertListToHost(&pvp->pciid, avoid); if (!w) w = xf86DupResList(ResRange); @@ -1298,8 +1280,8 @@ while ((*pAcc)) { if ((((*pAcc)->res_type & (type & ~ResAccMask)) == (type & ~ResAccMask)) - && ((*pAcc)->block_begin == (B2H(tag,(*p_base),type))) - && ((*pAcc)->block_end == (B2H(tag, + && ((*pAcc)->block_begin == (B2H(&pvp->pciid,(*p_base),type))) + && ((*pAcc)->block_end == (B2H(&pvp->pciid, (*p_base)+SIZE(*p_size),type)))) { resPtr acc_tmp = (*pAcc)->next; xfree((*pAcc)); @@ -1309,10 +1291,10 @@ pAcc = &((*pAcc)->next); } /* check if we really need to fix anything */ - P_X_RANGE(range,tag,(*p_base),(*p_base) + SIZE((*p_size)),type); + P_X_RANGE(range,&pvp->pciid,(*p_base),(*p_base) + SIZE((*p_size)),type); if (!ChkConflict(&range,avoid,SETUP) && !ChkConflict(&range,AccTmp,SETUP) - && ((B2H(tag,(*p_base),type) & PCI_SIZE(type,tag,alignment) + && ((B2H(&pvp->pciid,(*p_base),type) & PCI_SIZE(type,&pvp->pciid,alignment) == range->block_begin) && ((xf86IsSubsetOf(range,w) || (w_2nd && xf86IsSubsetOf(range,w_2n))))) { @@ -1336,8 +1318,8 @@ while (*pAcc) { if ((((*pAcc)->res_type & (ResTypeMask|ResExtMask)) == (type & ~ResAccMask)) - && ((*pAcc)->block_begin == B2H(tag,(*p_base),type)) - && ((*pAcc)->block_end == B2H(tag,(*p_base) + SIZE(*p_size), + && ((*pAcc)->block_begin == B2H(&pvp->pciid,(*p_base),type)) + && ((*pAcc)->block_end == B2H(&pvp->pciid,(*p_base) + SIZE(*p_size), type))) { #ifdef DEBUG ErrorF("removing old resource\n"); @@ -1354,7 +1336,7 @@ #ifdef DEBUG ErrorF("base: 0x%lx alignment: 0x%lx host alignment: 0x%lx size[bit]: 0x%x\n", - (*p_base),alignment,PCI_SIZE(type,tag,alignment),(*p_size)); + (*p_base),alignment,PCI_SIZE(type,&pvp->pciid,alignment),(*p_size)); xf86MsgVerb(X_INFO, 3, "window:\n"); xf86PrintResList(3, w); if (w_2nd) @@ -1370,9 +1352,9 @@ ErrorF("block_begin: 0x%lx block_end: 0x%lx\n",w->block_begin, w->block_end); #endif - range = xf86GetBlock(type,PCI_SIZE(type,tag,alignment + 1), + range = xf86GetBlock(type,PCI_SIZE(type,&pvp->pciid,alignment + 1), w->block_begin, w->block_end, - PCI_SIZE(type,tag,alignment),avoid); + PCI_SIZE(type,&pvp->pciid,alignment),avoid); if (range.type != ResEnd) break; } @@ -1388,9 +1370,9 @@ ErrorF("block_begin: 0x%lx block_end: 0x%lx\n",w_2nd->block_begin, w_2nd->block_end); #endif - range = xf86GetBlock(type,PCI_SIZE(type,tag,alignment + 1), + range = xf86GetBlock(type,PCI_SIZE(type,&pvp->pciid,alignment + 1), w_2nd->block_begin, w_2nd->block_end, - PCI_SIZE(type,tag,alignment),avoid); + PCI_SIZE(type,&pvp->pciid,alignment),avoid); if (range.type != ResEnd) break; } @@ -1414,7 +1396,7 @@ (*p_size) = 0; while (alignment >> (*p_size)) (*p_size)++; - (*p_base) = H2B(tag,range.rBegin,type); + (*p_base) = H2B(&pvp->pciid,range.rBegin,type); #ifdef DEBUG ErrorF("New PCI res %i base: 0x%lx, size: 0x%lx, type %s\n", res_n,(*p_base),(1 << (*p_size)), @@ -1427,25 +1409,25 @@ pvp->ioBase[prt] = range.rBegin; ((CARD32 *)(&(pcp->pci_base0)))[res_n] = (CARD32)(*p_base) | (CARD32)(p_type); - pciWriteLong(tag, PCI_CMD_BASE_REG + res_n * sizeof(CARD32), + pciWriteLong(&pvp->pciid, PCI_CMD_BASE_REG + res_n * sizeof(CARD32), ((CARD32 *)(&(pcp->pci_base0)))[res_n]); if (PCI_MAP_IS64BITMEM(p_type)) { #if defined(LONG64) || defined(WORD64) ((CARD32 *)(&(pcp->pci_base0)))[res_n + 1] = (CARD32)(*p_base >> 32); - pciWriteLong(tag, PCI_CMD_BASE_REG + (res_n + 1) * sizeof(CARD32), + pciWriteLong(&pvp->pciid, PCI_CMD_BASE_REG + (res_n + 1) * sizeof(CARD32), ((CARD32 *)(&(pcp->pci_base0)))[res_n + 1]); #else ((CARD32 *)(&(pcp->pci_base0)))[res_n + 1] = 0; - pciWriteLong(tag, PCI_CMD_BASE_REG + (res_n + 1) * sizeof(CARD32), + pciWriteLong(&pvp->pciid, PCI_CMD_BASE_REG + (res_n + 1) * sizeof(CARD32), 0); #endif } } else { pvp->biosBase = range.rBegin; - pcp->pci_baserom = (pciReadLong(tag,PCI_CMD_BIOS_REG) & 0x01) | + pcp->pci_baserom = (pciReadLong(&pvp->pciid,PCI_CMD_BIOS_REG) & 0x01) | (CARD32)(*p_base); - pciWriteLong(tag, PCI_CMD_BIOS_REG, pcp->pci_baserom); + pciWriteLong(&pvp->pciid, PCI_CMD_BIOS_REG, pcp->pci_baserom); } /* @@@ fake BIOS allocated resource */ range.type |= ResBios; @@ -1476,13 +1458,13 @@ while (pRes) { switch (pRes->res_type & ResPhysMask) { case ResMem: - if (pRes->block_begin == B2M(TAG(pvp),pvp->biosBase) && - pRes->block_end == B2M(TAG(pvp),pvp->biosBase + if (pRes->block_begin == B2M(&pvp->pciid,pvp->biosBase) && + pRes->block_end == B2M(&pvp->pciid,pvp->biosBase + SIZE(pvp->biosSize))) prt = 6; else for (i = 0 ; i < 6; i++) - if ((pRes->block_begin == B2M(TAG(pvp),pvp->memBase[i])) - && (pRes->block_end == B2M(TAG(pvp),pvp->memBase[i] + if ((pRes->block_begin == B2M(&pvp->pciid,pvp->memBase[i])) + && (pRes->block_end == B2M(&pvp->pciid,pvp->memBase[i] + SIZE(pvp->size[i])))) { prt = i; break; @@ -1490,8 +1472,8 @@ break; case ResIo: for (i = 0 ; i < 6; i++) - if (pRes->block_begin == B2I(TAG(pvp),pvp->ioBase[i]) - && pRes->block_end == B2I(TAG(pvp),pvp->ioBase[i] + if (pRes->block_begin == B2I(&pvp->pciid,pvp->ioBase[i]) + && pRes->block_end == B2I(&pvp->pciid,pvp->ioBase[i] + SIZE(pvp->size[i]))) { prt = i; break; @@ -1517,7 +1499,7 @@ * BIOS releated */ memType -getValidBIOSBase(PCITAG tag, int num) +getValidBIOSBase(PciBusId *busid, int num) { pciVideoPtr pvp = NULL; PciBusPtr pbp; @@ -1532,7 +1514,7 @@ if (!xf86PciVideoInfo) return 0; while ((pvp = xf86PciVideoInfo[n++])) { - if (pciTag(pvp->bus,pvp->device,pvp->func) == tag) + if (PCI_COMPARE_IDS(pvp->pciid, *busid)) break; } if (!pvp) return 0; @@ -1553,11 +1535,11 @@ for (i = 0; i < 6; i++) { if (!pvp->memBase[i]) continue; - P_M_RANGE(range,TAG(pvp),pvp->memBase[i],pvp->size[i], + P_M_RANGE(range,&pvp->pciid,pvp->memBase[i],pvp->size[i], ResExcMemBlock); mem = xf86AddResToList(mem,&range,-1); } - P_M_RANGE(range, TAG(pvp),pvp->biosBase,biosSize,ResExcMemBlock); + P_M_RANGE(range, &pvp->pciid,pvp->biosBase,biosSize,ResExcMemBlock); ret = pvp->biosBase; break; case ROM_BASE_MEM0: @@ -1568,7 +1550,7 @@ case ROM_BASE_MEM5: if (!pvp->memBase[num] || (pvp->size[num] < biosSize)) return 0; - P_M_RANGE(range, TAG(pvp),pvp->memBase[num],biosSize, + P_M_RANGE(range, &pvp->pciid,pvp->memBase[num],biosSize, ResExcMemBlock); ret = pvp->memBase[num]; break; @@ -1583,7 +1565,7 @@ avoid = xf86DupResList(pciAvoidRes); pbp = xf86PciBus; while (pbp) { - if (pbp->secondary == pvp->bus) { + if (pbp->secondary == pvp->pciid.bus) { if (pbp->preferred_pmem) tmp = xf86DupResList(pbp->preferred_pmem); else @@ -1599,7 +1581,7 @@ tmp->block_end = min(tmp->block_end,PCI_MEM32_LENGTH_MAX); tmp = tmp->next; } - } else if ((pbp->primary == pvp->bus) && + } else if ((pbp->primary == pvp->pciid.bus) && (pbp->secondary >= 0) && (pbp->primary != pbp->secondary)) { tmp = xf86DupResList(pbp->preferred_pmem); @@ -1613,20 +1595,20 @@ } pbp = pbp->next; } - pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid); + pciConvertListToHost(&pvp->pciid, avoid); if (mem) - pciConvertListToHost(pvp->bus,pvp->device,pvp->func, mem); + pciConvertListToHost(&pvp->pciid, mem); if (!ret) { /* Return a possible window */ while (m) { - range = xf86GetBlock(RANGE_TYPE(ResExcMemBlock, xf86GetPciDomain(tag)), - PCI_SIZE(ResMem, TAG(pvp), 1 << biosSize), + range = xf86GetBlock(RANGE_TYPE(ResExcMemBlock, xf86GetPciDomain(busid)), + PCI_SIZE(ResMem, &pvp->pciid, 1 << biosSize), m->block_begin, m->block_end, - PCI_SIZE(ResMem, TAG(pvp), alignment), + PCI_SIZE(ResMem, &pvp->pciid, alignment), avoid); if (range.type != ResEnd) { - ret = M2B(TAG(pvp), range.rBase); + ret = M2B(&pvp->pciid, range.rBase); break; } m = m->next; @@ -1691,11 +1673,11 @@ xf86FormatPciBusNumber(PciBus->primary, primary); xf86FormatPciBusNumber(PciBus->secondary, secondary); xf86FormatPciBusNumber(PciBus->subordinate, subordinate); - xf86FormatPciBusNumber(PciBus->brbus, brbus); + xf86FormatPciBusNumber(PciBus->busid.bus, brbus); xf86MsgVerb(X_INFO, 3, "Bus %s: bridge is at (%s:%d:%d), (%s,%s,%s)," " BCTRL: 0x%04x (VGA_EN is %s)\n", - secondary, brbus, PciBus->brdev, PciBus->brfunc, + secondary, brbus, PciBus->busid.device, PciBus->busid.func, primary, secondary, subordinate, PciBus->brcontrol, (PciBus->brcontrol & PCI_PCI_BRIDGE_VGA_EN) ? "set" : "cleared"); @@ -1737,14 +1719,14 @@ /* Add each bridge */ for (pcrpp = xf86PciInfo, pcrp = *pcrpp; pcrp; pcrp = *(++pcrpp)) { - if (pcrp->busnum > MaxBus) - MaxBus = pcrp->busnum; + if (pcrp->pciid.bus > MaxBus) + MaxBus = pcrp->pciid.bus; if ((pcrp->pci_base_class == PCI_CLASS_BRIDGE) || (((pcrp->listed_class >> 8) & 0xff) == PCI_CLASS_BRIDGE)) { int sub_class; sub_class = (pcrp->listed_class & 0xffff) ? (pcrp->listed_class & 0xff) : pcrp->pci_sub_class; - domain = xf86GetPciDomain(pcrp->tag); + domain = xf86GetPciDomain(&pcrp->pciid); switch (sub_class) { case PCI_SUBCLASS_BRIDGE_PCI: @@ -1752,13 +1734,13 @@ if ((pcrp->pci_header_type & 0x7f) != 0x01) { xf86MsgVerb(X_WARNING, 3, "PCI-PCI bridge at %x:%x:%x has" " unexpected header: 0x%x", - pcrp->busnum, pcrp->devnum, - pcrp->funcnum, pcrp->pci_header_type); + pcrp->pciid.bus, pcrp->pciid.device, + pcrp->pciid.func, pcrp->pci_header_type); break; } - domain = pcrp->busnum & 0x0000FF00; - primary = pcrp->busnum; + domain = pcrp->pciid.bus & 0x0000FF00; + primary = pcrp->pciid.bus; secondary = domain | pcrp->pci_secondary_bus_number; subordinate = domain | pcrp->pci_subordinate_bus_number; @@ -1767,10 +1749,10 @@ if (pBusInfo && (pcrp != pBusInfo->bridge)) { xf86MsgVerb(X_WARNING, 3, "PCI bridge mismatch for bus %x:" " %x:%x:%x and %x:%x:%x\n", secondary, - pcrp->busnum, pcrp->devnum, pcrp->funcnum, - pBusInfo->bridge->busnum, - pBusInfo->bridge->devnum, - pBusInfo->bridge->funcnum); + pcrp->pciid.bus, pcrp->pciid.device, pcrp->pciid.func, + pBusInfo->bridge->pciid.bus, + pBusInfo->bridge->pciid.device, + pBusInfo->bridge->pciid.func); break; } @@ -1783,7 +1765,7 @@ if (!pcrp->fakeDevice && (primary >= secondary)) { xf86MsgVerb(X_WARNING, 3, "Misconfigured PCI bridge" " %x:%x:%x (%x,%x)\n", - pcrp->busnum, pcrp->devnum, pcrp->funcnum, + pcrp->pciid.bus, pcrp->pciid.device, pcrp->pciid.func, primary, secondary); break; } @@ -1795,9 +1777,7 @@ PciBus->secondary = secondary; PciBus->subordinate = subordinate; - PciBus->brbus = pcrp->busnum; - PciBus->brdev = pcrp->devnum; - PciBus->brfunc = pcrp->funcnum; + PciBus->busid = pcrp->pciid; PciBus->subclass = sub_class; PciBus->interface = pcrp->pci_prog_if; @@ -1829,7 +1809,7 @@ */ if (pcrp->pci_bridge_control & PCI_PCI_BRIDGE_ISA_EN) { while ((base <= (CARD16)(-1)) && (base <= limit)) { - PCI_I_RANGE(range, pcrp->tag, + PCI_I_RANGE(range, &pcrp->pciid, base, base + (CARD8)(-1), ResIo | ResBlock | ResExclusive); PciBus->preferred_io = @@ -1839,7 +1819,7 @@ } } if (base <= limit) { - PCI_I_RANGE(range, pcrp->tag, base, limit, + PCI_I_RANGE(range, &pcrp->pciid, base, limit, ResIo | ResBlock | ResExclusive); PciBus->preferred_io = xf86AddResToList(PciBus->preferred_io, &range, -1); @@ -1856,7 +1836,7 @@ base = pcrp->pci_mem_base & 0xfff0u; limit = pcrp->pci_mem_limit & 0xfff0u; if (base <= limit) { - PCI_M_RANGE(range, pcrp->tag, + PCI_M_RANGE(range, &pcrp->pciid, base << 16, (limit << 16) | 0x0fffff, ResMem | ResBlock | ResExclusive); PciBus->preferred_mem = @@ -1875,7 +1855,7 @@ limit |= (memType)pcrp->pci_prefetch_upper_mem_limit << 16; #endif if (base <= limit) { - PCI_M_RANGE(range, pcrp->tag, + PCI_M_RANGE(range, &pcrp->pciid, base << 16, (limit << 16) | 0xfffff, ResMem | ResBlock | ResExclusive); PciBus->preferred_pmem = @@ -1891,13 +1871,13 @@ if ((pcrp->pci_header_type & 0x7f) != 0x02) { xf86MsgVerb(X_WARNING, 3, "PCI-CardBus bridge at %x:%x:%x" " has unexpected header: 0x%x", - pcrp->busnum, pcrp->devnum, - pcrp->funcnum, pcrp->pci_header_type); + pcrp->pciid.bus, pcrp->pciid.device, + pcrp->pciid.func, pcrp->pci_header_type); break; } - domain = pcrp->busnum & 0x0000FF00; - primary = pcrp->busnum; + domain = pcrp->pciid.bus & 0x0000FF00; + primary = pcrp->pciid.bus; secondary = domain | pcrp->pci_cb_cardbus_bus_number; subordinate = domain | pcrp->pci_subordinate_bus_number; @@ -1906,10 +1886,10 @@ if (pBusInfo && (pcrp != pBusInfo->bridge)) { xf86MsgVerb(X_WARNING, 3, "CardBus bridge mismatch for bus" " %x: %x:%x:%x and %x:%x:%x\n", secondary, - pcrp->busnum, pcrp->devnum, pcrp->funcnum, - pBusInfo->bridge->busnum, - pBusInfo->bridge->devnum, - pBusInfo->bridge->funcnum); + pcrp->pciid.bus, pcrp->pciid.device, pcrp->pciid.func, + pBusInfo->bridge->pciid.bus, + pBusInfo->bridge->pciid.device, + pBusInfo->bridge->pciid.func); break; } @@ -1923,7 +1903,7 @@ if (pcrp->pci_cb_cardbus_bus_number != 0) xf86MsgVerb(X_WARNING, 3, "Misconfigured CardBus" " bridge %x:%x:%x (%x,%x)\n", - pcrp->busnum, pcrp->devnum, pcrp->funcnum, + pcrp->pciid.bus, pcrp->pciid.device, pcrp->pciid.func, primary, secondary); break; } @@ -1935,9 +1915,7 @@ PciBus->secondary = secondary; PciBus->subordinate = subordinate; - PciBus->brbus = pcrp->busnum; - PciBus->brdev = pcrp->devnum; - PciBus->brfunc = pcrp->funcnum; + PciBus->busid = pcrp->pciid; PciBus->subclass = sub_class; PciBus->interface = pcrp->pci_prog_if; @@ -1968,7 +1946,7 @@ if (pcrp->pci_bridge_control & PCI_PCI_BRIDGE_ISA_EN) { while ((base <= (CARD16)(-1)) && (base <= limit)) { - PCI_I_RANGE(range, pcrp->tag, + PCI_I_RANGE(range, &pcrp->pciid, base, base + (CARD8)(-1), ResIo | ResBlock | ResExclusive); PciBus->preferred_io = @@ -1979,7 +1957,7 @@ } if (base <= limit) { - PCI_I_RANGE(range, pcrp->tag, base, limit, + PCI_I_RANGE(range, &pcrp->pciid, base, limit, ResIo | ResBlock | ResExclusive); PciBus->preferred_io = xf86AddResToList(PciBus->preferred_io, @@ -1998,7 +1976,7 @@ if (pcrp->pci_bridge_control & PCI_PCI_BRIDGE_ISA_EN) { while ((base <= (CARD16)(-1)) && (base <= limit)) { - PCI_I_RANGE(range, pcrp->tag, + PCI_I_RANGE(range, &pcrp->pciid, base, base + (CARD8)(-1), ResIo | ResBlock | ResExclusive); PciBus->preferred_io = @@ -2009,7 +1987,7 @@ } if (base <= limit) { - PCI_I_RANGE(range, pcrp->tag, base, limit, + PCI_I_RANGE(range, &pcrp->pciid, base, limit, ResIo | ResBlock | ResExclusive); PciBus->preferred_io = xf86AddResToList(PciBus->preferred_io, @@ -2021,7 +1999,7 @@ if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) { if ((pcrp->pci_cb_membase0) && (pcrp->pci_cb_membase0 <= pcrp->pci_cb_memlimit0)) { - PCI_M_RANGE(range, pcrp->tag, + PCI_M_RANGE(range, &pcrp->pciid, pcrp->pci_cb_membase0 & ~0x0fff, pcrp->pci_cb_memlimit0 | 0x0fff, ResMem | ResBlock | ResExclusive); @@ -2037,7 +2015,7 @@ } if ((pcrp->pci_cb_membase1) && (pcrp->pci_cb_membase1 <= pcrp->pci_cb_memlimit1)) { - PCI_M_RANGE(range, pcrp->tag, + PCI_M_RANGE(range, &pcrp->pciid, pcrp->pci_cb_membase1 & ~0x0fff, pcrp->pci_cb_memlimit1 | 0x0fff, ResMem | ResBlock | ResExclusive); @@ -2060,11 +2038,9 @@ case PCI_SUBCLASS_BRIDGE_MC: *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec)); pnPciBus = &PciBus->next; - PciBus->primary = pcrp->busnum; + PciBus->primary = pcrp->pciid.bus; PciBus->secondary = PciBus->subordinate = -1; - PciBus->brbus = pcrp->busnum; - PciBus->brdev = pcrp->devnum; - PciBus->brfunc = pcrp->funcnum; + PciBus->busid = pcrp->pciid; PciBus->subclass = sub_class; PciBus->brcontrol = PCI_PCI_BRIDGE_VGA_EN; break; @@ -2084,10 +2060,10 @@ xf86MsgVerb(X_WARNING, 3, "Host bridge mismatch for" " bus %x: %x:%x:%x and %x:%x:%x\n", pBusInfo->primary_bus, - pcrp->busnum, pcrp->devnum, pcrp->funcnum, - pBusInfo->bridge->busnum, - pBusInfo->bridge->devnum, - pBusInfo->bridge->funcnum); + pcrp->pciid.bus, pcrp->pciid.device, pcrp->pciid.func, + pBusInfo->bridge->pciid.bus, + pBusInfo->bridge->pciid.device, + pBusInfo->bridge->pciid.func); pBusInfo = NULL; } @@ -2105,9 +2081,7 @@ &PciBus->secondary, &PciBus->subordinate); - PciBus->brbus = pcrp->busnum; - PciBus->brdev = pcrp->devnum; - PciBus->brfunc = pcrp->funcnum; + PciBus->busid = pcrp->pciid; PciBus->subclass = sub_class; @@ -2154,22 +2128,26 @@ */ PCITAG minTag = 0xFFFFFFFF, tag; PciBusPtr PciBusFound = NULL; - for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next) + PciBusId bus_id; + + for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next) { + bus_id = PciBus->busid; if ((PciBus->subclass == PCI_SUBCLASS_BRIDGE_HOST) && (PciBus->secondary == -1) && - ((tag = pciTag(PciBus->brbus,PciBus->brdev,PciBus->brfunc)) + ((tag = pciTag(&bus_id)) < minTag) ) { minTag = tag; PciBusFound = PciBus; } + } if (PciBusFound) PciBusFound->secondary = i; else { /* if nothing found it may not be visible: create new */ /* Find a device on this bus */ domain = 0; for (pcrpp = xf86PciInfo; (pcrp = *pcrpp); pcrpp++) { - if (pcrp->busnum == i) { - domain = xf86GetPciDomain(pcrp->tag); + if (pcrp->pciid.bus == i) { + domain = xf86GetPciDomain(&pcrp->pciid); break; } } @@ -2318,9 +2296,7 @@ EntityPtr p = xf86Entities[i]; if (p->busType != BUS_PCI) continue; - if (p->pciBusId.bus == pvp->bus - && p->pciBusId.device == pvp->device - && p->pciBusId.func == pvp->func) + if (PCI_COMPARE_IDS(p->pciBusId, pvp->pciid)) break; } if (i != xf86NumEntities) /* found an Entity for this one */ @@ -2352,24 +2328,24 @@ if (PCI_MAP_IS_IO(basep[i])) { if (!(pcrp->pci_command & PCI_CMD_IO_ENABLE)) continue; - P_I_RANGE(range, pcrp->tag, PCIGETIO(basep[i]), + P_I_RANGE(range, &pcrp->pciid, PCIGETIO(basep[i]), pcrp->basesize[i], ResExcIoBlock) } else if (!PCI_MAP_IS64BITMEM(basep[i])) { if (!(pcrp->pci_command & PCI_CMD_MEM_ENABLE)) continue; - P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i]), + P_M_RANGE(range, &pcrp->pciid, PCIGETMEMORY(basep[i]), pcrp->basesize[i], ResExcMemBlock) } else { i++; if (!(pcrp->pci_command & PCI_CMD_MEM_ENABLE)) continue; #if defined(LONG64) || defined(WORD64) - P_M_RANGE(range, pcrp->tag, PCIGETMEMORY64(basep[i-1]), + P_M_RANGE(range, &pcrp->pciid, PCIGETMEMORY64(basep[i-1]), pcrp->basesize[i-1], ResExcMemBlock) #else if (basep[i]) continue; - P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i-1]), + P_M_RANGE(range, &pcrp->pciid, PCIGETMEMORY(basep[i-1]), pcrp->basesize[i-1], ResExcMemBlock) #endif } @@ -2379,7 +2355,7 @@ if ((pcrp->pci_baserom) && (pcrp->pci_command & PCI_CMD_MEM_ENABLE) && (pcrp->pci_baserom & PCI_MAP_ROM_DECODE_ENABLE)) { - P_M_RANGE(range,pcrp->tag,PCIGETROM(pcrp->pci_baserom), + P_M_RANGE(range,&pcrp->pciid,PCIGETROM(pcrp->pci_baserom), pcrp->basesize[6],ResExcMemBlock); Sys = xf86AddResToList(Sys, &range, -1); } @@ -2423,7 +2399,7 @@ #endif pbp = xf86PciBus; while (pbp) { - if (pbp->secondary == pvp->bus) { + if (pbp->secondary == pvp->pciid.bus) { if (pbp->preferred_pmem) { /* keep prefetchable separate */ res_mp = @@ -2447,7 +2423,7 @@ res_m_io = xf86JoinResLists(res_m_io, xf86FindIntersectOfLists(pbp->preferred_io, ResRange)); } - } else if ((pbp->primary == pvp->bus) && + } else if ((pbp->primary == pvp->pciid.bus) && (pbp->secondary >= 0) && (pbp->primary != pbp->secondary)) { tmp = xf86DupResList(pbp->preferred_pmem); @@ -2462,7 +2438,7 @@ if (res_m_io == NULL) res_m_io = xf86DupResList(ResRange); - pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid); + pciConvertListToHost(&pvp->pciid, avoid); #ifdef DEBUG xf86MsgVerb(X_INFO, 3,"avoid:\n"); @@ -2605,10 +2581,8 @@ sizeof(pciAccPtr) * (j + 1)); xf86PciAccInfo[j] = NULL; pcaccp = xf86PciAccInfo[j - 1] = xnfalloc(sizeof(pciAccRec)); - pcaccp->busnum = pvp->bus; - pcaccp->devnum = pvp->device; - pcaccp->funcnum = pvp->func; - pcaccp->arg.tag = pciTag(pvp->bus, pvp->device, pvp->func); + pcaccp->pciid = pvp->pciid; + pcaccp->arg.pciid = pvp->pciid; pcaccp->ioAccess.AccessDisable = pciIoAccessDisable; pcaccp->ioAccess.AccessEnable = pciIoAccessEnable; pcaccp->ioAccess.arg = &pcaccp->arg; @@ -2622,7 +2596,7 @@ pcaccp->ctrl = TRUE; else pcaccp->ctrl = FALSE; - savePciState(pcaccp->arg.tag, &pcaccp->save); + savePciState(&pcaccp->arg.pciid, &pcaccp->save); pcaccp->arg.ctrl = pcaccp->save.command; } } @@ -2653,13 +2627,14 @@ BusAccPtr pbap, pbap_tmp; PciBusPtr pbp = xf86PciBus; pciBusInfo_t *pBusInfo; + PciBusId special_id = { 0x0, 0xff, 0xff, 0xff }; while (pbp) { pbap = xnfcalloc(1,sizeof(BusAccRec)); pbap->busdep.pci.bus = pbp->secondary; pbap->busdep.pci.primary_bus = pbp->primary; pbap->busdep_type = BUS_PCI; - pbap->busdep.pci.acc = PCITAG_SPECIAL; + pbap->busdep.pci.acc = special_id; if ((pbp->secondary >= 0) && (pbp->secondary < pciNumBuses) && (pBusInfo = pciBusInfo[pbp->secondary]) && @@ -2684,7 +2659,7 @@ pbap->set_f = pciSetBusAccess; pbap->enable_f = pciBusAccessEnable; pbap->disable_f = pciBusAccessDisable; - pbap->busdep.pci.acc = pciTag(pbp->brbus,pbp->brdev,pbp->brfunc); + pbap->busdep.pci.acc = pbp->busid; savePciBusState(pbap); break; case PCI_SUBCLASS_BRIDGE_ISA: @@ -2735,8 +2710,8 @@ i++; if (!paccp->ctrl) continue; - savePciState(paccp->arg.tag, &paccp->save); - restorePciState(paccp->arg.tag, &paccp->restore); + savePciState(&paccp->arg.pciid, &paccp->save); + restorePciState(&paccp->arg.pciid, &paccp->restore); paccp->arg.ctrl = paccp->restore.command; } } @@ -2766,8 +2741,8 @@ i++; if (!paccp->ctrl) continue; - savePciState(paccp->arg.tag, &paccp->restore); - restorePciState(paccp->arg.tag, &paccp->save); + savePciState(&paccp->arg.pciid, &paccp->restore); + restorePciState(&paccp->arg.pciid, &paccp->save); } } @@ -2818,15 +2793,13 @@ */ Bool -xf86IsPciDevPresent(int bus, int dev, int func) +xf86IsPciDevPresent(PciBusId *bus_id) { int i = 0; pciConfigPtr pcp; while ((pcp = xf86PciInfo[i]) != NULL) { - if ((pcp->busnum == bus) - && (pcp->devnum == dev) - && (pcp->funcnum == func)) + if (PCI_COMPARE_IDS((pcp->pciid), (*bus_id))) return TRUE; i++; } @@ -2839,24 +2812,22 @@ */ int -xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp, +xf86ClaimPciSlot(PciBusId *bus_id, DriverPtr drvp, int chipset, GDevPtr dev, Bool active) { EntityPtr p = NULL; pciAccPtr *ppaccp = xf86PciAccInfo; BusAccPtr pbap = xf86BusAccInfo; - + int num; - if (xf86CheckPciSlot(bus, device, func)) { + if (xf86CheckPciSlot(bus_id)) { num = xf86AllocateEntity(); p = xf86Entities[num]; p->driver = drvp; p->chipset = chipset; p->busType = BUS_PCI; - p->pciBusId.bus = bus; - p->pciBusId.device = device; - p->pciBusId.func = func; + p->pciBusId = *bus_id; p->active = active; p->inUse = FALSE; if (dev) @@ -2864,9 +2835,7 @@ /* Here we initialize the access structure */ p->access = xnfcalloc(1,sizeof(EntityAccessRec)); while (ppaccp && *ppaccp) { - if ((*ppaccp)->busnum == bus - && (*ppaccp)->devnum == device - && (*ppaccp)->funcnum == func) { + if (PCI_COMPARE_IDS((*ppaccp)->pciid, *bus_id)) { p->access->fallback = &(*ppaccp)->io_memAccess; p->access->pAccess = &(*ppaccp)->io_memAccess; (*ppaccp)->ctrl = TRUE; /* mark control if not already */ @@ -2881,20 +2850,20 @@ p->busAcc = NULL; while (pbap) { - if (pbap->type == BUS_PCI && pbap->busdep.pci.bus == bus) + if (pbap->type == BUS_PCI && pbap->busdep.pci.bus == bus_id->bus) p->busAcc = pbap; pbap = pbap->next; } fixPciSizeInfo(num); /* in case bios is enabled disable it */ - disablePciBios(pciTag(bus,device,func)); + disablePciBios(bus_id); pciSlotClaimed = TRUE; if (active) { /* Map in this domain's I/O space */ p->domainIO = xf86MapDomainIO(-1, VIDMEM_MMIO, - pciTag(bus, device, func), 0, 1); + bus_id, 0, 1); } return num; @@ -2983,16 +2952,14 @@ return; /* Ignore request for claimed adapters */ - if (!xf86CheckPciSlot(pvp->bus, pvp->device, pvp->func)) + if (!xf86CheckPciSlot(&pvp->pciid)) return; /* Find pciAccRec structure */ for (i = 0; ; i++) { if (!(pcaccp = xf86PciAccInfo[i])) return; - if ((pvp->bus == pcaccp->busnum) && - (pvp->device == pcaccp->devnum) && - (pvp->func == pcaccp->funcnum)) + if (PCI_COMPARE_IDS(pvp->pciid, pcaccp->pciid)) break; } @@ -3007,7 +2974,7 @@ for (pbap = xf86BusAccInfo; ; pbap = pbap->next) { if (!pbap) return; - if (pvp->bus == pbap->busdep.pci.bus) + if (pvp->pciid.bus == pbap->busdep.pci.bus) break; } @@ -3040,7 +3007,7 @@ */ Bool -xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func) +xf86ParsePciBusString(const char *busID, PciBusId *bus_id) { /* * The format is assumed to be "bus[@domain]:device[:func]", where domain, @@ -3077,9 +3044,9 @@ return FALSE; } } - *bus = atoi(p); + bus_id->bus = atoi(p); if (d != NULL && *d != 0) - *bus += atoi(d) << 8; + bus_id->bus += atoi(d) << 8; p = strtok(NULL, ":"); if (p == NULL || *p == 0) { xfree(s); @@ -3091,8 +3058,8 @@ return FALSE; } } - *device = atoi(p); - *func = 0; + bus_id->device = atoi(p); + bus_id->func = 0; p = strtok(NULL, ":"); if (p == NULL || *p == 0) { xfree(s); @@ -3104,7 +3071,7 @@ return FALSE; } } - *func = atoi(p); + bus_id->func = atoi(p); xfree(s); return TRUE; } @@ -3114,12 +3081,11 @@ */ Bool -xf86ComparePciBusString(const char *busID, int bus, int device, int func) +xf86ComparePciBusString(const char *busID, PciBusId *bus_id) { - int ibus, idevice, ifunc; - - if (xf86ParsePciBusString(busID, &ibus, &idevice, &ifunc)) { - return bus == ibus && device == idevice && func == ifunc; + PciBusId ibus_id; + if (xf86ParsePciBusString(busID, &ibus_id)) { + return PCI_COMPARE_IDS(ibus_id, *bus_id); } else { return FALSE; } @@ -3134,9 +3100,7 @@ xf86IsPrimaryPci(pciVideoPtr pPci) { if (primaryBus.type != BUS_PCI) return FALSE; - return (pPci->bus == primaryBus.id.pci.bus && - pPci->device == primaryBus.id.pci.device && - pPci->func == primaryBus.id.pci.func); + return (PCI_COMPARE_IDS(pPci->pciid, primaryBus.id.pci)); } /* @@ -3149,8 +3113,7 @@ pciConfigPtr pcp; while ((pcp = xf86PciInfo[i]) != NULL) { - if (pPci->bus == pcp->busnum && pPci->device == pcp->devnum - && pPci->func == pcp->funcnum) { + if (PCI_COMPARE_IDS(pPci->pciid, pcp->pciid)) { if (pcp->pci_base_class == PCI_CLASS_PREHISTORIC && pcp->pci_sub_class == PCI_SUBCLASS_PREHISTORIC_VGA) return PCI_CHIP_VGA ; @@ -3185,9 +3148,7 @@ return NULL; for (ppPci = xf86PciVideoInfo; *ppPci != NULL; ppPci++) { - if (p->pciBusId.bus == (*ppPci)->bus && - p->pciBusId.device == (*ppPci)->device && - p->pciBusId.func == (*ppPci)->func) + if (PCI_COMPARE_IDS(p->pciBusId, (*ppPci)->pciid)) return (*ppPci); } return NULL; @@ -3230,7 +3191,7 @@ */ Bool -xf86CheckPciSlot(int bus, int device, int func) +xf86CheckPciSlot(PciBusId *bus_id) { int i; EntityPtr p; @@ -3238,8 +3199,7 @@ for (i = 0; i < xf86NumEntities; i++) { p = xf86Entities[i]; /* Check if this PCI slot is taken */ - if (p->busType == BUS_PCI && p->pciBusId.bus == bus && - p->pciBusId.device == device && p->pciBusId.func == func) + if (p->busType == BUS_PCI && PCI_COMPARE_IDS(p->pciBusId, *bus_id)) return FALSE; } @@ -3330,7 +3290,7 @@ * we wait until an attempt to read the BIOS fails. */ int -pciTestMultiDeviceCard(int bus, int dev, int func, PCITAG** pTag) +pciTestMultiDeviceCard(PciBusId *pci_id, PciBusId** pTag) { pciConfigPtr *ppcrp = xf86PciInfo; pciConfigPtr pcrp = NULL; @@ -3339,7 +3299,7 @@ Bool multifunc = FALSE; char str[256]; char *str1; - + str1 = str; if (!pTag) return 0; @@ -3349,8 +3309,8 @@ for (i=0; i < 8; i++) { j = 0; - while (ppcrp[j]) { - if (ppcrp[j]->busnum == bus && ppcrp[j]->funcnum == i) { + while (ppcrp[j]) + if (ppcrp[j]->pciid.bus == pci_id->bus && ppcrp[j]->pciid.func == i) { pcrp = ppcrp[j]; break; } @@ -3370,8 +3330,8 @@ j = 0; while (ppcrp[j]) { - if (ppcrp[j]->busnum == bus && ppcrp[j]->funcnum == i - && ppcrp[j]->devnum != pcrp->devnum) { + if (ppcrp[j]->pciid.bus == pci_id->bus && ppcrp[j]->pciid.func == i + && ppcrp[j]->pciid.device != pcrp->pciid.device) { /* don't test subsys ID here. It might be set by POST - however some cards might not have been POSTed */ if (ppcrp[j]->pci_device_vendor != pcrp->pci_device_vendor @@ -3392,12 +3352,11 @@ j = 0; i = 0; while (ppcrp[i]) { - if (ppcrp[i]->busnum == bus && ppcrp[i]->funcnum == func) { - str1 += sprintf(str1,"[%x:%x:%x]",ppcrp[i]->busnum, - ppcrp[i]->devnum,ppcrp[i]->funcnum); - *pTag = xnfrealloc(*pTag,sizeof(PCITAG) * (j + 1)); - (*pTag)[j++] = pciTag(ppcrp[i]->busnum, - ppcrp[i]->devnum,ppcrp[i]->funcnum); + if (ppcrp[i]->pciid.bus == pci_id->bus && ppcrp[i]->pciid.func == pci_id->func) { + str1 += sprintf(str1,"[%x:%x:%x]",ppcrp[i]->pciid.bus, + ppcrp[i]->pciid.device,ppcrp[i]->pciid.func); + *pTag = xnfrealloc(*pTag,sizeof(PciBusId) * (j + 1)); + (*pTag)[j++] = pciTag(&ppcrp[i]); } i++; } @@ -3405,8 +3364,15 @@ return j; } +void +pciFreeTestMultiDeviceCardIds(PciBusId* pTag) +{ + Xfree(pTag); + pTag=NULL; +} + static void -pciTagConvertRange2Host(PCITAG tag, resRange *pRange) +pciBusIdConvertRange2Host(PciBusId *bus_id, resRange *pRange) { if (!(pRange->type & ResBus)) return; @@ -3415,13 +3381,13 @@ case ResMem: switch(pRange->type & ResExtMask) { case ResBlock: - pRange->rBegin = pciBusAddrToHostAddr(tag,PCI_MEM, pRange->rBegin); - pRange->rEnd = pciBusAddrToHostAddr(tag,PCI_MEM, pRange->rEnd); + pRange->rBegin = pciBusAddrToHostAddr(bus_id,PCI_MEM, pRange->rBegin); + pRange->rEnd = pciBusAddrToHostAddr(bus_id,PCI_MEM, pRange->rEnd); break; case ResSparse: - pRange->rBase = pciBusAddrToHostAddr(tag,PCI_MEM_SPARSE_BASE, + pRange->rBase = pciBusAddrToHostAddr(bus_id,PCI_MEM_SPARSE_BASE, pRange->rBegin); - pRange->rMask = pciBusAddrToHostAddr(tag,PCI_MEM_SPARSE_MASK, + pRange->rMask = pciBusAddrToHostAddr(bus_id,PCI_MEM_SPARSE_MASK, pRange->rEnd); break; } @@ -3429,13 +3395,13 @@ case ResIo: switch(pRange->type & ResExtMask) { case ResBlock: - pRange->rBegin = pciBusAddrToHostAddr(tag,PCI_IO, pRange->rBegin); - pRange->rEnd = pciBusAddrToHostAddr(tag,PCI_IO, pRange->rEnd); + pRange->rBegin = pciBusAddrToHostAddr(bus_id,PCI_IO, pRange->rBegin); + pRange->rEnd = pciBusAddrToHostAddr(bus_id,PCI_IO, pRange->rEnd); break; case ResSparse: - pRange->rBase = pciBusAddrToHostAddr(tag,PCI_IO_SPARSE_BASE + pRange->rBase = pciBusAddrToHostAddr(bus_id,PCI_IO_SPARSE_BASE , pRange->rBegin); - pRange->rMask = pciBusAddrToHostAddr(tag,PCI_IO_SPARSE_MASK + pRange->rMask = pciBusAddrToHostAddr(bus_id,PCI_IO_SPARSE_MASK , pRange->rEnd); break; } @@ -3444,21 +3410,20 @@ /* Set domain number */ pRange->type &= ~(ResDomain | ResBus); - pRange->type |= xf86GetPciDomain(tag) << 24; + pRange->type |= xf86GetPciDomain(bus_id) << 24; } static void -pciConvertListToHost(int bus, int dev, int func, resPtr list) +pciConvertListToHost(PciBusId *bus_id, resPtr list) { - PCITAG tag = pciTag(bus,dev,func); while (list) { - pciTagConvertRange2Host(tag, &list->val); + pciBusIdConvertRange2Host(bus_id, &list->val); list = list->next; } } static void -updateAccessInfoStatusControlInfo(PCITAG tag, CARD32 ctrl) +updateAccessInfoStatusControlInfo(PciBusId *busid, CARD32 ctrl) { int i; @@ -3466,7 +3431,7 @@ return; for (i = 0; xf86PciAccInfo[i] != NULL; i++) { - if (xf86PciAccInfo[i]->arg.tag == tag) + if (PCI_COMPARE_IDS(xf86PciAccInfo[i]->arg.pciid, *busid)) xf86PciAccInfo[i]->arg.ctrl = ctrl; } } @@ -3474,13 +3439,11 @@ void pciConvertRange2Host(int entityIndex, resRange *pRange) { - PCITAG tag; pciVideoPtr pvp; pvp = xf86GetPciInfoForEntity(entityIndex); if (!pvp) return; - tag = TAG(pvp); - pciTagConvertRange2Host(tag, pRange); + pciBusIdConvertRange2Host(&pvp->pciid, pRange); } @@ -3489,18 +3452,16 @@ xf86EnablePciBusMaster(pciVideoPtr pPci, Bool enable) { CARD32 temp; - PCITAG tag; if (!pPci) return; - tag = pciTag(pPci->bus, pPci->device, pPci->func); - temp = pciReadLong(tag, PCI_CMD_STAT_REG); + temp = pciReadLong(&pPci->pciid, PCI_CMD_STAT_REG); if (enable) { - updateAccessInfoStatusControlInfo(tag, temp | PCI_CMD_MASTER_ENABLE); - pciWriteLong(tag, PCI_CMD_STAT_REG, temp | PCI_CMD_MASTER_ENABLE); + updateAccessInfoStatusControlInfo(&pPci->pciid, temp | PCI_CMD_MASTER_ENABLE); + pciWriteLong(&pPci->pciid, PCI_CMD_STAT_REG, temp | PCI_CMD_MASTER_ENABLE); } else { - updateAccessInfoStatusControlInfo(tag, temp & ~PCI_CMD_MASTER_ENABLE); - pciWriteLong(tag, PCI_CMD_STAT_REG, temp & ~PCI_CMD_MASTER_ENABLE); + updateAccessInfoStatusControlInfo(&pPci->pciid, temp & ~PCI_CMD_MASTER_ENABLE); + pciWriteLong(&pPci->pciid, PCI_CMD_STAT_REG, temp & ~PCI_CMD_MASTER_ENABLE); } } #endif /* INCLUDE_DEPRECATED */ Index: hw/xfree86/common/xf86pciBus.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h,v retrieving revision 1.2 diff -u -r1.2 xf86pciBus.h --- hw/xfree86/common/xf86pciBus.h 3 Jul 2005 07:01:24 -0000 1.2 +++ hw/xfree86/common/xf86pciBus.h 7 Aug 2005 04:20:40 -0000 @@ -34,8 +34,6 @@ #ifndef _XF86_PCI_BUS_H #define _XF86_PCI_BUS_H -#define PCITAG_SPECIAL pciTag(0xFF,0xFF,0xFF) - typedef struct { CARD32 command; CARD32 base[6]; @@ -43,14 +41,12 @@ } pciSave, *pciSavePtr; typedef struct { - PCITAG tag; + PciBusId pciid; CARD32 ctrl; } pciArg; typedef struct { - int busnum; - int devnum; - int funcnum; + PciBusId pciid; pciArg arg; xf86AccessRec ioAccess; xf86AccessRec io_memAccess; @@ -65,7 +61,7 @@ } pciBridgesSave, *pciBridgesSavePtr; typedef struct pciBusRec { - int brbus, brdev, brfunc; /* ID of the bridge to this bus */ + PciBusId busid; int primary, secondary, subordinate; int subclass; /* bridge type */ int interface; Index: hw/xfree86/common/xf86str.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86str.h,v retrieving revision 1.8 diff -u -r1.8 xf86str.h --- hw/xfree86/common/xf86str.h 3 Jul 2005 08:53:42 -0000 1.8 +++ hw/xfree86/common/xf86str.h 7 Aug 2005 04:20:41 -0000 @@ -350,12 +350,6 @@ } BusType; typedef struct { - int bus; - int device; - int func; -} PciBusId; - -typedef struct { unsigned int dummy; } IsaBusId; @@ -424,9 +418,7 @@ int chipRev; int subsysVendor; int subsysCard; - int bus; - int device; - int func; + PciBusId pciid; int class; int subclass; int interface; Index: hw/xfree86/drivers/apm/apm.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h,v retrieving revision 1.3 diff -u -r1.3 apm.h --- hw/xfree86/drivers/apm/apm.h 20 Apr 2005 12:25:22 -0000 1.3 +++ hw/xfree86/drivers/apm/apm.h 7 Aug 2005 04:20:42 -0000 @@ -104,7 +104,6 @@ typedef struct { pciVideoPtr PciInfo; - PCITAG PciTag; int scrnIndex; int Chipset; int ChipRev; Index: hw/xfree86/drivers/apm/apm_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c,v retrieving revision 1.6 diff -u -r1.6 apm_driver.c --- hw/xfree86/drivers/apm/apm_driver.c 11 Jul 2005 02:29:44 -0000 1.6 +++ hw/xfree86/drivers/apm/apm_driver.c 7 Aug 2005 04:20:45 -0000 @@ -550,12 +550,9 @@ pEnt = pApm->pEnt = xf86GetEntityInfo(pScrn->entityList[0]); if (pEnt->location.type == BUS_PCI) { pApm->PciInfo = xf86GetPciInfoForEntity(pEnt->index); - pApm->PciTag = pciTag(pApm->PciInfo->bus, pApm->PciInfo->device, - pApm->PciInfo->func); } else { pApm->PciInfo = NULL; - pApm->PciTag = 0; } if (flags & PROBE_DETECT) { @@ -884,10 +881,10 @@ volatile unsigned char *LinMap; LinMap = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - pApm->PciTag, pApm->LinAddress, + &pApm->PciInfo->pciid, pApm->LinAddress, pApm->LinMapSize); - /*save = pciReadLong(pApm->PciTag, PCI_CMD_STAT_REG); - pciWriteLong(pApm->PciTag, PCI_CMD_STAT_REG, save | PCI_CMD_MEM_ENABLE);*/ + /*save = pciReadLong(&pApm->PciInfo->pciid, PCI_CMD_STAT_REG); + pciWriteLong(&pApm->PciInfo->pciid, PCI_CMD_STAT_REG, save | PCI_CMD_MEM_ENABLE);*/ d9 = LinMap[0xFFECD9]; db = LinMap[0xFFECDB]; LinMap[0xFFECDB] = (db & 0xF4) | 0x0A; @@ -907,15 +904,15 @@ LinMap[0xFFF3C5] = uc; LinMap[0xFFECDB] = db; LinMap[0xFFECD9] = d9; - /*pciWriteLong(pApm->PciTag, PCI_CMD_STAT_REG, save);*/ + /*pciWriteLong(&pApm->PciInfo->pciid, PCI_CMD_STAT_REG, save);*/ xf86UnMapVidMem(pScrn->scrnIndex, (pointer)LinMap, pApm->LinMapSize); from = X_PROBED; } else { /*unsigned long save; - save = pciReadLong(pApm->PciTag, PCI_CMD_STAT_REG); - pciWriteLong(pApm->PciTag, PCI_CMD_STAT_REG, save | PCI_CMD_IO_ENABLE);*/ + save = pciReadLong(&pApm->PciInfo->pciid, PCI_CMD_STAT_REG); + pciWriteLong(&pApm->PciInfo->pciid, PCI_CMD_STAT_REG, save | PCI_CMD_IO_ENABLE);*/ pApm->savedSR10 = rdinx(pApm->xport, 0x10); wrinx(pApm->xport, 0x10, 0x12); pScrn->videoRam = rdinx(pApm->xport, 0x20) * 64; @@ -923,7 +920,7 @@ pApm->xbase |= rdinx(pApm->xport, 0x1E); pApm->xbase += pApm->iobase; wrinx(pApm->xport, 0x10, pApm->savedSR10 ? 0 : 0x12); - /*pciWriteLong(pApm->PciTag, PCI_CMD_STAT_REG, save);*/ + /*pciWriteLong(&pApm->PciInfo->pciid, PCI_CMD_STAT_REG, save);*/ from = X_PROBED; } if (pApm->Chipset < AT3D && pScrn->videoRam >= 4096) @@ -1212,7 +1209,7 @@ vgaHWPtr hwp = VGAHWPTR(pScrn); pApm->LinMap = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pApm->PciTag, + &pApm->PciInfo->pciid, (unsigned long)pApm->LinAddress, pApm->LinMapSize); if (pApm->LinMap == NULL) @@ -1877,10 +1874,10 @@ /* Map the chip memory and MMIO areas */ if (pApm->noLinear) { - pApm->saveCmd = pciReadLong(pApm->PciTag, PCI_CMD_STAT_REG); - pciWriteLong(pApm->PciTag, PCI_CMD_STAT_REG, pApm->saveCmd | (PCI_CMD_IO_ENABLE|PCI_CMD_MEM_ENABLE)); + pApm->saveCmd = pciReadLong(&pApm->PciInfo->pciid, PCI_CMD_STAT_REG); + pciWriteLong(&pApm->PciInfo->pciid, PCI_CMD_STAT_REG, pApm->saveCmd | (PCI_CMD_IO_ENABLE|PCI_CMD_MEM_ENABLE)); pApm->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pApm->PciTag, 0xA0000, 0x10000); + &pApm->PciInfo->pciid, 0xA0000, 0x10000); } else if (!ApmMapMem(pScrn)) Index: hw/xfree86/drivers/ark/ark.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ark/ark.h,v retrieving revision 1.2 diff -u -r1.2 ark.h --- hw/xfree86/drivers/ark/ark.h 23 Apr 2004 19:25:33 -0000 1.2 +++ hw/xfree86/drivers/ark/ark.h 7 Aug 2005 04:20:45 -0000 @@ -29,7 +29,6 @@ typedef struct _ARKRec { pciVideoPtr PciInfo; - PCITAG PciTag; EntityInfoPtr pEnt; CARD32 IOAddress; CARD32 FBAddress; Index: hw/xfree86/drivers/ark/ark_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c,v retrieving revision 1.5 diff -u -r1.5 ark_driver.c --- hw/xfree86/drivers/ark/ark_driver.c 11 Jul 2005 02:29:44 -0000 1.5 +++ hw/xfree86/drivers/ark/ark_driver.c 7 Aug 2005 04:20:45 -0000 @@ -382,9 +382,6 @@ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chipset: \"%s\"\n", pScrn->chipset); - pARK->PciTag = pciTag(pARK->PciInfo->bus, pARK->PciInfo->device, - pARK->PciInfo->func); - /* unlock CRTC[0-7] */ outb(hwp->PIOOffset + hwp->IOBase + 4, 0x11); tmp = inb(hwp->PIOOffset + hwp->IOBase + 5); @@ -1052,10 +1049,10 @@ hwp->MapSize = 0x20000; pARK->MMIOBase = xf86MapDomainMemory(pScrn->scrnIndex, VIDMEM_MMIO, - pARK->PciTag, 0xb8000, 0x8000); + &pARK->PciInfo->pciid, 0xb8000, 0x8000); pARK->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pARK->PciTag, pARK->FBAddress, + &pARK->PciInfo->pciid, pARK->FBAddress, pScrn->videoRam * 1024); if (!pARK->FBBase) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, Index: hw/xfree86/drivers/ati/atibus.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c,v retrieving revision 1.3 diff -u -r1.3 atibus.c --- hw/xfree86/drivers/ati/atibus.c 11 Jul 2005 02:29:44 -0000 1.3 +++ hw/xfree86/drivers/ati/atibus.c 7 Aug 2005 04:20:45 -0000 @@ -175,7 +175,7 @@ if (pVideo) pATI->iEntity = - xf86ClaimPciSlot(pVideo->bus, pVideo->device, pVideo->func, + xf86ClaimPciSlot(&pVideo->pciid, pDriver, Chipset, pGDev, Active); else pATI->iEntity = xf86ClaimIsaSlot(pDriver, Chipset, pGDev, Active); Index: hw/xfree86/drivers/ati/atiprint.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c,v retrieving revision 1.3 diff -u -r1.3 atiprint.c --- hw/xfree86/drivers/ati/atiprint.c 11 Jul 2005 02:29:45 -0000 1.3 +++ hw/xfree86/drivers/ati/atiprint.c 7 Aug 2005 04:20:49 -0000 @@ -690,7 +690,7 @@ if (!(Index & 15)) xf86ErrorFVerb(4, "\n 0x%02X: ", Index); xf86ErrorFVerb(4, " 0x%08lX", - (unsigned long)pciReadLong(pPCI->tag, Index)); + (unsigned long)pciReadLong(&pPCI->pciid, Index)); } } Index: hw/xfree86/drivers/ati/atiprobe.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v retrieving revision 1.6 diff -u -r1.6 atiprobe.c --- hw/xfree86/drivers/ati/atiprobe.c 11 Jul 2005 02:29:45 -0000 1.6 +++ hw/xfree86/drivers/ati/atiprobe.c 7 Aug 2005 04:20:50 -0000 @@ -1148,7 +1148,7 @@ ATIScanPCIBases(&PCIPorts, &nPCIPort, &pPCI->pci_base0, pVideo->size, - (pciReadLong(pPCI->tag, PCI_CMD_STAT_REG) & + (pciReadLong(&pPCI->pciid, PCI_CMD_STAT_REG) & PCI_CMD_IO_ENABLE) ? 0 : Allowed); } } @@ -1166,7 +1166,7 @@ ATIScanPCIBases(&PCIPorts, &nPCIPort, &pPCI->pci_base0, pPCI->basesize, - (pciReadLong(pPCI->tag, PCI_CMD_STAT_REG) & + (pciReadLong(&pPCI->pciid, PCI_CMD_STAT_REG) & PCI_CMD_IO_ENABLE) ? 0 : Allowed); } } @@ -1389,9 +1389,9 @@ /* * Possibly fix block I/O indicator in PCI configuration space. */ - PciReg = pciReadLong(pPCI->tag, PCI_REG_USERCONFIG); + PciReg = pciReadLong(&pPCI->pciid, PCI_REG_USERCONFIG); if (!(PciReg & 0x00000004U)) - pciWriteLong(pPCI->tag, PCI_REG_USERCONFIG, + pciWriteLong(&pPCI->pciid, PCI_REG_USERCONFIG, PciReg | 0x00000004U); pATI = @@ -1400,7 +1400,7 @@ continue; sprintf(Identifier, "Unshared PCI/AGP Mach64 in slot %d:%d:%d", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func); xf86MsgVerb(X_INFO, 3, ATI_NAME ": %s detected.\n", Identifier); AddAdapter(pATI); @@ -1437,9 +1437,7 @@ !xf86IsPrimaryPci(pVideo)) continue; - if (!xf86CheckPciSlot(pVideo->bus, - pVideo->device, - pVideo->func)) + if (!xf86CheckPciSlot(&pVideo->pciid)) continue; xf86SetPciVideo(pVideo, MEM_IO); @@ -1451,13 +1449,13 @@ xf86Msg(X_WARNING, ATI_NAME ": PCI/AGP VGA compatible in slot" " %d:%d:%d could not be detected!\n", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func); } else { sprintf(Identifier, "Shared non-ATI VGA in PCI/AGP slot %d:%d:%d", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func); xf86MsgVerb(X_INFO, 3, ATI_NAME ": %s detected.\n", Identifier); AddAdapter(pATI); @@ -1485,7 +1483,7 @@ ATI_NAME ": PCI Mach32 in slot %d:%d:%d will not" " be enabled\n because it conflicts with a" " non-video PCI/AGP device.\n", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func); break; #ifndef AVOID_NON_PCI @@ -1498,7 +1496,7 @@ ATI_NAME ": PCI Mach32 in slot %d:%d:%d will" " not be enabled\n because it conflicts with" " another %s %s.\n", - pVideo->bus, pVideo->device, pVideo->func, + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func, ATIBusNames[p8514->BusType], ATIAdapterNames[p8514->Adapter]); break; @@ -1508,15 +1506,13 @@ ATI_NAME ": PCI Mach32 in slot %d:%d:%d will not" " be enabled\n because it conflicts with a Mach64" " at I/O base 0x02EC.\n", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func); break; #endif /* AVOID_NON_PCI */ default: /* Must be DoProbe */ - if (!xf86CheckPciSlot(pVideo->bus, - pVideo->device, - pVideo->func)) + if (!xf86CheckPciSlot(&pVideo->pciid)) continue; xf86SetPciVideo(pVideo, MEM_IO); @@ -1526,20 +1522,20 @@ xf86Msg(X_WARNING, ATI_NAME ": PCI Mach32 in slot %d:%d:%d could" " not be detected!\n", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func); } else { sprintf(Identifier, "Shared 8514/A in PCI slot %d:%d:%d", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func); xf86MsgVerb(X_INFO, 3, ATI_NAME ": %s detected.\n", Identifier); if (pATI->Adapter != ATI_ADAPTER_MACH32) xf86Msg(X_WARNING, ATI_NAME ": PCI Mach32 in slot %d:%d:%d" " could only be detected as an %s!\n", - pVideo->bus, pVideo->device, pVideo->func, + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func, ATIAdapterNames[pATI->Adapter]); AddAdapter(pATI); @@ -1567,7 +1563,7 @@ if (pPCI == NULL) continue; - PciReg = pciReadLong(pPCI->tag, PCI_REG_USERCONFIG); + PciReg = pciReadLong(&pPCI->pciid, PCI_REG_USERCONFIG); j = PciReg & 0x03U; if (j == 0x03U) { @@ -1575,7 +1571,7 @@ ATI_NAME ": PCI Mach64 in slot %d:%d:%d cannot be" " enabled\n because it has neither a block, nor a" " sparse, I/O base.\n", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func); } else switch(ATICheckSparseIOBases(pVideo, ProbeFlags, Mach64SparseIOBases[j], 4, TRUE)) @@ -1585,7 +1581,7 @@ ATI_NAME ": PCI Mach64 in slot %d:%d:%d will not" " be enabled\n because it conflicts with another" " non-video PCI device.\n", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func); break; #ifndef AVOID_NON_PCI @@ -1594,7 +1590,7 @@ xf86Msg(X_WARNING, ATI_NAME ": PCI Mach64 in slot %d:%d:%d will not" " be enabled\n because it conflicts with an %s.\n", - pVideo->bus, pVideo->device, pVideo->func, + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func, ATIAdapterNames[p8514->Adapter]); break; @@ -1608,7 +1604,7 @@ " not be enabled\n because it conflicts with" " another %s Mach64 at sparse I/O base" " 0x%04lX.\n", - pVideo->bus, pVideo->device, pVideo->func, + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func, ATIBusNames[pATI->BusType], Mach64SparseIOBases[j]); break; @@ -1616,14 +1612,12 @@ #endif /* AVOID_NON_PCI */ default: /* Must be DoProbe */ - if (!xf86CheckPciSlot(pVideo->bus, - pVideo->device, - pVideo->func)) + if (!xf86CheckPciSlot(&pVideo->pciid)) continue; /* Possibly fix block I/O indicator */ if (PciReg & 0x00000004U) - pciWriteLong(pPCI->tag, PCI_REG_USERCONFIG, + pciWriteLong(&pPCI->pciid, PCI_REG_USERCONFIG, PciReg & ~0x00000004U); xf86SetPciVideo(pVideo, MEM_IO); @@ -1636,13 +1630,13 @@ xf86Msg(X_WARNING, ATI_NAME ": PCI Mach64 in slot %d:%d:%d could" " not be detected!\n", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func); } else { sprintf(Identifier, "Shared PCI Mach64 in slot %d:%d:%d", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func); xf86MsgVerb(X_INFO, 3, ATI_NAME ": %s with sparse PIO base 0x%04lX" " detected.\n", Identifier, @@ -1678,9 +1672,7 @@ goto SkipThisSlot; } - if (!xf86CheckPciSlot(pVideo->bus, - pVideo->device, - pVideo->func)) + if (!xf86CheckPciSlot(&pVideo->bus)) continue; xf86SetPciVideo(pVideo, MEM_IO); @@ -1748,7 +1740,7 @@ goto SetPCIInfo; } - if (!xf86CheckPciSlot(pVideo->bus, pVideo->device, pVideo->func)) + if (!xf86CheckPciSlot(&pVideo->pciid)) continue; /* Probe for it */ @@ -1758,7 +1750,7 @@ if (pATI) { sprintf(Identifier, "Shared PCI/AGP Mach64 in slot %d:%d:%d", - pVideo->bus, pVideo->device, pVideo->func); + pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func); xf86MsgVerb(X_INFO, 3, ATI_NAME ": %s detected.\n", Identifier); AddAdapter(pATI); @@ -1779,7 +1771,7 @@ { xf86Msg(X_WARNING, ATI_NAME ": PCI/AGP Mach64 in slot %d:%d:%d could not be" - " detected!\n", pVideo->bus, pVideo->device, pVideo->func); + " detected!\n", pVideo->pciid.bus, pVideo->pciid.device, pVideo->pciid.func); continue; } @@ -2180,7 +2172,7 @@ #endif /* AVOID_CPIO */ if (!xf86ComparePciBusString(pGDev->busID, - pVideo->bus, pVideo->device, pVideo->func)) + &pVideo->pciid)) continue; } Index: hw/xfree86/drivers/ati/atividmem.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c,v retrieving revision 1.3 diff -u -r1.3 atividmem.c --- hw/xfree86/drivers/ati/atividmem.c 11 Jul 2005 02:29:45 -0000 1.3 +++ hw/xfree86/drivers/ati/atividmem.c 7 Aug 2005 04:20:50 -0000 @@ -180,9 +180,9 @@ ATIPtr pATI ) { - pciVideoPtr pVideo; - PCITAG Tag; + pciVideoPtr pVideo; unsigned long PageSize; + PciBusId *pciid; if (pATI->Mapped) return TRUE; @@ -201,9 +201,9 @@ PageSize = getpagesize(); if ((pVideo = pATI->PCIInfo)) - Tag = ((pciConfigPtr)(pVideo->thisCard))->tag; + pciid = &((pciConfigPtr)(pVideo->thisCard))->pciid; else - Tag = 0; + pciid = NULL; #ifndef AVOID_CPIO @@ -216,7 +216,7 @@ */ if (pVideo) pATI->pBank = xf86MapPciMem(iScreen, VIDMEM_MMIO, - Tag, 0x000A0000U, 0x00010000U); + pciid, 0x000A0000U, 0x00010000U); else pATI->pBank = xf86MapVidMem(iScreen, VIDMEM_MMIO, 0x000A0000U, 0x00010000U); @@ -238,7 +238,7 @@ { if (pVideo) pATI->pMemory = xf86MapPciMem(iScreen, VIDMEM_FRAMEBUFFER, - Tag, pATI->LinearBase, pATI->LinearSize); + pciid, pATI->LinearBase, pATI->LinearSize); else pATI->pMemory = xf86MapVidMem(iScreen, VIDMEM_FRAMEBUFFER, pATI->LinearBase, pATI->LinearSize); @@ -274,7 +274,7 @@ */ if (pVideo) { - pATI->pMemoryLE = xf86MapPciMem(iScreen, VIDMEM_MMIO, Tag, + pATI->pMemoryLE = xf86MapPciMem(iScreen, VIDMEM_MMIO, pciid, pATI->LinearBase - 0x00800000U, pATI->LinearSize); if (!pATI->pMemoryLE) @@ -303,7 +303,7 @@ if (pVideo) pATI->pMMIO = xf86MapPciMem(iScreen, VIDMEM_MMIO, - Tag, MMIOBase, PageSize); + pciid, MMIOBase, PageSize); else pATI->pMMIO = xf86MapVidMem(iScreen, VIDMEM_MMIO, MMIOBase, PageSize); @@ -358,7 +358,7 @@ if (pVideo) pATI->pCursorPage = xf86MapPciMem(iScreen, VIDMEM_FRAMEBUFFER, - Tag, CursorBase, PageSize); + pciid, CursorBase, PageSize); else pATI->pCursorPage = xf86MapVidMem(iScreen, VIDMEM_FRAMEBUFFER, CursorBase, PageSize); Index: hw/xfree86/drivers/ati/r128.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h,v retrieving revision 1.5 diff -u -r1.5 r128.h --- hw/xfree86/drivers/ati/r128.h 19 Dec 2004 19:49:33 -0000 1.5 +++ hw/xfree86/drivers/ati/r128.h 7 Aug 2005 04:20:50 -0000 @@ -224,7 +224,6 @@ typedef struct { EntityInfoPtr pEnt; pciVideoPtr PciInfo; - PCITAG PciTag; int Chipset; Bool Primary; Index: hw/xfree86/drivers/ati/r128_dri.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v retrieving revision 1.7 diff -u -r1.7 r128_dri.c --- hw/xfree86/drivers/ati/r128_dri.c 11 Jul 2005 02:29:45 -0000 1.7 +++ hw/xfree86/drivers/ati/r128_dri.c 7 Aug 2005 04:20:53 -0000 @@ -908,9 +908,9 @@ if (!info->irq) { info->irq = drmGetInterruptFromBusID( info->drmFD, - ((pciConfigPtr)info->PciInfo->thisCard)->busnum, - ((pciConfigPtr)info->PciInfo->thisCard)->devnum, - ((pciConfigPtr)info->PciInfo->thisCard)->funcnum); + ((pciConfigPtr)info->PciInfo->thisCard)->pciid.bus, + ((pciConfigPtr)info->PciInfo->thisCard)->pciid.device, + ((pciConfigPtr)info->PciInfo->thisCard)->pciid.func); if((drmCtlInstHandler(info->drmFD, info->irq)) != 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -1028,9 +1028,9 @@ pDRIInfo->busIdString = xalloc(64); sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", - info->PciInfo->bus, - info->PciInfo->device, - info->PciInfo->func); + info->PciInfo->pciid.bus, + info->PciInfo->pciid.device, + info->PciInfo->pciid.func); } pDRIInfo->ddxDriverMajorVersion = R128_VERSION_MAJOR; pDRIInfo->ddxDriverMinorVersion = R128_VERSION_MINOR; Index: hw/xfree86/drivers/ati/r128_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c,v retrieving revision 1.18 diff -u -r1.18 r128_driver.c --- hw/xfree86/drivers/ati/r128_driver.c 11 Jul 2005 02:29:45 -0000 1.18 +++ hw/xfree86/drivers/ati/r128_driver.c 7 Aug 2005 04:20:57 -0000 @@ -400,7 +400,7 @@ } else { info->MMIO = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, - info->PciTag, + &info->PciInfo->pciid, info->MMIOAddr, R128_MMIOSIZE); } @@ -434,7 +434,7 @@ } else { info->FB = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - info->PciTag, + &info->PciInfo->pciid, info->LinearAddr, info->FbMapSize); } @@ -623,14 +623,14 @@ (void)memcpy(info->VBIOS, xf86int10Addr(pInt10, info->BIOSAddr), R128_VBIOS_SIZE); } else { - xf86ReadPciBIOS(0, info->PciTag, 0, info->VBIOS, R128_VBIOS_SIZE); + xf86ReadPciBIOS(0, &info->PciInfo->pciid, 0, info->VBIOS, R128_VBIOS_SIZE); if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Video BIOS not detected in PCI space!\n"); xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Attempting to read Video BIOS from legacy ISA space!\n"); info->BIOSAddr = 0x000c0000; - xf86ReadDomainMemory(info->PciTag, info->BIOSAddr, R128_VBIOS_SIZE, info->VBIOS); + xf86ReadDomainMemory(&info->PciInfo->pciid, info->BIOSAddr, R128_VBIOS_SIZE, info->VBIOS); } } if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) { @@ -2072,15 +2072,12 @@ } info->PciInfo = xf86GetPciInfoForEntity(info->pEnt->index); - info->PciTag = pciTag(info->PciInfo->bus, - info->PciInfo->device, - info->PciInfo->func); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PCI bus %d card %d func %d\n", - info->PciInfo->bus, - info->PciInfo->device, - info->PciInfo->func); + info->PciInfo->pciid.bus, + info->PciInfo->pciid.device, + info->PciInfo->pciid.func); if (xf86RegisterResources(info->pEnt->index, 0, ResNone)) goto fail; if (xf86SetOperatingState(resVga, info->pEnt->index, ResUnusedOpr)) goto fail; Index: hw/xfree86/drivers/ati/radeon.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v retrieving revision 1.24 diff -u -r1.24 radeon.h --- hw/xfree86/drivers/ati/radeon.h 1 Jul 2005 04:16:41 -0000 1.24 +++ hw/xfree86/drivers/ati/radeon.h 7 Aug 2005 04:20:57 -0000 @@ -301,7 +301,6 @@ typedef struct { EntityInfoPtr pEnt; pciVideoPtr PciInfo; - PCITAG PciTag; int Chipset; RADEONChipFamily ChipFamily; RADEONErrata ChipErrata; Index: hw/xfree86/drivers/ati/radeon_bios.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_bios.c,v retrieving revision 1.4 diff -u -r1.4 radeon_bios.c --- hw/xfree86/drivers/ati/radeon_bios.c 11 Jul 2005 02:29:45 -0000 1.4 +++ hw/xfree86/drivers/ati/radeon_bios.c 7 Aug 2005 04:20:57 -0000 @@ -55,7 +55,7 @@ (void)memcpy(info->VBIOS, xf86int10Addr(pInt10, info->BIOSAddr), RADEON_VBIOS_SIZE); } else { - xf86ReadPciBIOS(0, info->PciTag, 0, info->VBIOS, RADEON_VBIOS_SIZE); + xf86ReadPciBIOS(0, &info->PciInfo->pciid, 0, info->VBIOS, RADEON_VBIOS_SIZE); if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Video BIOS not detected in PCI space!\n"); @@ -63,7 +63,7 @@ "Attempting to read Video BIOS from " "legacy ISA space!\n"); info->BIOSAddr = 0x000c0000; - xf86ReadDomainMemory(info->PciTag, info->BIOSAddr, + xf86ReadDomainMemory(&info->PciInfo->pciid, info->BIOSAddr, RADEON_VBIOS_SIZE, info->VBIOS); } } Index: hw/xfree86/drivers/ati/radeon_dri.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c,v retrieving revision 1.18 diff -u -r1.18 radeon_dri.c --- hw/xfree86/drivers/ati/radeon_dri.c 11 Jul 2005 02:29:45 -0000 1.18 +++ hw/xfree86/drivers/ati/radeon_dri.c 7 Aug 2005 04:20:58 -0000 @@ -1150,9 +1150,9 @@ if (!info->irq) { info->irq = drmGetInterruptFromBusID( info->drmFD, - ((pciConfigPtr)info->PciInfo->thisCard)->busnum, - ((pciConfigPtr)info->PciInfo->thisCard)->devnum, - ((pciConfigPtr)info->PciInfo->thisCard)->funcnum); + ((pciConfigPtr)info->PciInfo->thisCard)->pciid.bus, + ((pciConfigPtr)info->PciInfo->thisCard)->pciid.device, + ((pciConfigPtr)info->PciInfo->thisCard)->pciid.func); if ((drmCtlInstHandler(info->drmFD, info->irq)) != 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -1268,9 +1268,9 @@ pDRIInfo->busIdString = xalloc(64); sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", - info->PciInfo->bus, - info->PciInfo->device, - info->PciInfo->func); + info->PciInfo->pciid.bus, + info->PciInfo->pciid.device, + info->PciInfo->pciid.func); } pDRIInfo->ddxDriverMajorVersion = info->allowColorTiling ? RADEON_VERSION_MAJOR_TILED : RADEON_VERSION_MAJOR; Index: hw/xfree86/drivers/ati/radeon_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v retrieving revision 1.63 diff -u -r1.63 radeon_driver.c --- hw/xfree86/drivers/ati/radeon_driver.c 11 Jul 2005 02:29:45 -0000 1.63 +++ hw/xfree86/drivers/ati/radeon_driver.c 7 Aug 2005 04:21:07 -0000 @@ -649,7 +649,7 @@ } else { info->MMIO = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, - info->PciTag, + &info->PciInfo->pciid, info->MMIOAddr, RADEON_MMIOSIZE); } @@ -684,7 +684,7 @@ } else { info->FB = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - info->PciTag, + &info->PciInfo->pciid, info->LinearAddr, info->FbMapSize); } @@ -2776,15 +2776,15 @@ info->IsPCI = TRUE; - if (pciReadLong(info->PciTag, PCI_CMD_STAT_REG) & RADEON_CAP_LIST) { + if (pciReadLong(&info->PciInfo->pciid, PCI_CMD_STAT_REG) & RADEON_CAP_LIST) { CARD32 cap_ptr, cap_id; - cap_ptr = pciReadLong(info->PciTag, + cap_ptr = pciReadLong(&info->PciInfo->pciid, RADEON_CAPABILITIES_PTR_PCI_CONFIG) & RADEON_CAP_PTR_MASK; while(cap_ptr != RADEON_CAP_ID_NULL) { - cap_id = pciReadLong(info->PciTag, cap_ptr); + cap_id = pciReadLong(&info->PciInfo->pciid, cap_ptr); if ((cap_id & 0xff)== RADEON_CAP_ID_AGP) { info->IsPCI = FALSE; break; @@ -4499,9 +4499,6 @@ if (info->pEnt->location.type != BUS_PCI) goto fail; info->PciInfo = xf86GetPciInfoForEntity(info->pEnt->index); - info->PciTag = pciTag(info->PciInfo->bus, - info->PciInfo->device, - info->PciInfo->func); info->MMIOAddr = info->PciInfo->memBase[2] & 0xffffff00; if (info->pEnt->device->IOBase) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, @@ -4523,7 +4520,7 @@ } #if !defined(__alpha__) - if (xf86GetPciDomain(info->PciTag) || + if (xf86GetPciDomain(&info->PciInfo->pciid) || !xf86IsPrimaryPci(info->PciInfo)) RADEONPreInt10Save(pScrn, &int10_save); #else @@ -4571,9 +4568,9 @@ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PCI bus %d card %d func %d\n", - info->PciInfo->bus, - info->PciInfo->device, - info->PciInfo->func); + info->PciInfo->pciid.bus, + info->PciInfo->pciid.device, + info->PciInfo->pciid.func); if (xf86RegisterResources(info->pEnt->index, 0, ResExclusive)) goto fail; Index: hw/xfree86/drivers/ati/radeon_video.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c,v retrieving revision 1.26 diff -u -r1.26 radeon_video.c --- hw/xfree86/drivers/ati/radeon_video.c 11 Jul 2005 02:29:45 -0000 1.26 +++ hw/xfree86/drivers/ati/radeon_video.c 7 Aug 2005 04:21:11 -0000 @@ -1087,7 +1087,7 @@ sprintf(tmp, "RXXX:%d.%d.%d", info->PciInfo->vendor, info->PciInfo->chipType, info->PciInfo->chipRev); pPriv->device_id = MAKE_ATOM(tmp); - sprintf(tmp, "PCI:%02d:%02d.%d", info->PciInfo->bus, info->PciInfo->device, info->PciInfo->func); + sprintf(tmp, "PCI:%02d:%02d.%d", info->PciInfo->pciid.bus, info->PciInfo->pciid.device, info->PciInfo->pciid.func); pPriv->location_id = MAKE_ATOM(tmp); sprintf(tmp, "INSTANCE:%d", pScrn->scrnIndex); pPriv->instance_id = MAKE_ATOM(tmp); Index: hw/xfree86/drivers/chips/ct_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c,v retrieving revision 1.12 diff -u -r1.12 ct_driver.c --- hw/xfree86/drivers/chips/ct_driver.c 11 Jul 2005 02:29:46 -0000 1.12 +++ hw/xfree86/drivers/chips/ct_driver.c 7 Aug 2005 04:21:18 -0000 @@ -1108,9 +1108,6 @@ if (cPtr->pEnt->location.type == BUS_PCI) { pciPtr = xf86GetPciInfoForEntity(cPtr->pEnt->index); cPtr->PciInfo = pciPtr; - cPtr->PciTag = pciTag(cPtr->PciInfo->bus, - cPtr->PciInfo->device, - cPtr->PciInfo->func); } } /* INT10 */ @@ -7031,7 +7028,7 @@ if (IS_HiQV(cPtr)) { if (cPtr->pEnt->location.type == BUS_PCI) cPtr->MMIOBase = xf86MapPciMem(pScrn->scrnIndex, - VIDMEM_MMIO_32BIT,cPtr->PciTag, cPtr->IOAddress, + VIDMEM_MMIO_32BIT,&cPtr->PciInfo->pciid, cPtr->IOAddress, 0x20000L); else cPtr->MMIOBase = xf86MapVidMem(pScrn->scrnIndex, @@ -7039,7 +7036,7 @@ } else { if (cPtr->pEnt->location.type == BUS_PCI) cPtr->MMIOBase = xf86MapPciMem(pScrn->scrnIndex, - VIDMEM_MMIO_32BIT, cPtr->PciTag, cPtr->IOAddress, + VIDMEM_MMIO_32BIT, &cPtr->PciInfo->pciid, cPtr->IOAddress, 0x10000L); else cPtr->MMIOBase = xf86MapVidMem(pScrn->scrnIndex, @@ -7068,7 +7065,7 @@ if (cPtr->pEnt->location.type == BUS_PCI) cPtr->FbBase = xf86MapPciMem(pScrn->scrnIndex,VIDMEM_FRAMEBUFFER, - cPtr->PciTag, Addr, Map); + &cPtr->PciInfo->pciid, Addr, Map); else cPtr->FbBase = xf86MapVidMem(pScrn->scrnIndex,VIDMEM_FRAMEBUFFER, @@ -7079,7 +7076,7 @@ } if (cPtr->Flags & ChipsFullMMIOSupport) { cPtr->MMIOBaseVGA = xf86MapPciMem(pScrn->scrnIndex, - VIDMEM_MMIO,cPtr->PciTag, + VIDMEM_MMIO,&cPtr->PciInfo->pciid, cPtr->IOAddress, 0x2000L); /* 69030 MMIO Fix. * @@ -7091,7 +7088,7 @@ */ if (cPtr->Flags & ChipsDualChannelSupport) cPtr->MMIOBasePipeB = xf86MapPciMem(pScrn->scrnIndex, - VIDMEM_MMIO,cPtr->PciTag, + VIDMEM_MMIO,&cPtr->PciInfo->pciid, cPtr->IOAddress + 0x800000, 0x2000L); cPtr->MMIOBasePipeA = cPtr->MMIOBaseVGA; Index: hw/xfree86/drivers/chips/ct_driver.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h,v retrieving revision 1.3 diff -u -r1.3 ct_driver.h --- hw/xfree86/drivers/chips/ct_driver.h 30 Jul 2004 21:36:39 -0000 1.3 +++ hw/xfree86/drivers/chips/ct_driver.h 7 Aug 2005 04:21:18 -0000 @@ -271,7 +271,6 @@ typedef struct _CHIPSRec { pciVideoPtr PciInfo; - PCITAG PciTag; int Chipset; EntityInfoPtr pEnt; #if XF86_VERSION_CURRENT > XF86_VERSION_NUMERIC(4,1,0,0,0) Index: hw/xfree86/drivers/cirrus/alp_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c,v retrieving revision 1.6 diff -u -r1.6 alp_driver.c --- hw/xfree86/drivers/cirrus/alp_driver.c 11 Jul 2005 02:29:46 -0000 1.6 +++ hw/xfree86/drivers/cirrus/alp_driver.c 7 Aug 2005 04:21:20 -0000 @@ -571,9 +571,6 @@ pCir->Chipset = pCir->pEnt->chipset; /* Find the PCI info for this screen */ pCir->PciInfo = xf86GetPciInfoForEntity(pCir->pEnt->index); - pCir->PciTag = pciTag(pCir->PciInfo->bus, - pCir->PciInfo->device, - pCir->PciInfo->func); if (xf86LoadSubModule(pScrn, "int10")) { xf86LoaderReqSymLists(int10Symbols,NULL); @@ -584,8 +581,8 @@ * This is a hack: We restore the PCI base regs as some Colorgraphic * BIOSes tend to mess them up */ - pciWriteLong(pCir->PciTag,0x10,pCir->PciInfo->memBase[0]); - pciWriteLong(pCir->PciTag,0x14,pCir->PciInfo->memBase[1]); + pciWriteLong(&pCir->PciInfo->pciid,0x10,pCir->PciInfo->memBase[0]); + pciWriteLong(&pCir->PciInfo->pciid,0x14,pCir->PciInfo->memBase[1]); } Index: hw/xfree86/drivers/cirrus/cir.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h,v retrieving revision 1.2 diff -u -r1.2 cir.h --- hw/xfree86/drivers/cirrus/cir.h 23 Apr 2004 19:28:21 -0000 1.2 +++ hw/xfree86/drivers/cirrus/cir.h 7 Aug 2005 04:21:20 -0000 @@ -18,7 +18,6 @@ ScrnInfoPtr pScrn; CARD32 properties; pciVideoPtr PciInfo; - PCITAG PciTag; IOADDRESS PIOReg; union { struct lgRec *lg; Index: hw/xfree86/drivers/cirrus/cir_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c,v retrieving revision 1.5 diff -u -r1.5 cir_driver.c --- hw/xfree86/drivers/cirrus/cir_driver.c 11 Jul 2005 02:29:46 -0000 1.5 +++ hw/xfree86/drivers/cirrus/cir_driver.c 7 Aug 2005 04:21:20 -0000 @@ -334,7 +334,7 @@ if (pCir->FbMapSize) { pCir->FbBase = xf86MapPciMem(scrnIndex, VIDMEM_FRAMEBUFFER, - pCir->PciTag, pCir->FbAddress, + &pCir->PciInfo->pciid, pCir->FbAddress, pCir->FbMapSize); if (pCir->FbBase == NULL) return FALSE; @@ -357,7 +357,7 @@ * sparse mapping for MMIO. */ pCir->IOBase = - xf86MapPciMem(scrnIndex, mmioFlags, pCir->PciTag, + xf86MapPciMem(scrnIndex, mmioFlags, &pCir->PciInfo->pciid, pCir->IOAddress, pCir->IoMapSize); if (pCir->IOBase == NULL) return FALSE; Index: hw/xfree86/drivers/cirrus/lg_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c,v retrieving revision 1.6 diff -u -r1.6 lg_driver.c --- hw/xfree86/drivers/cirrus/lg_driver.c 11 Jul 2005 02:29:46 -0000 1.6 +++ hw/xfree86/drivers/cirrus/lg_driver.c 7 Aug 2005 04:21:22 -0000 @@ -458,9 +458,6 @@ /* Find the PCI info for this screen */ pCir->PciInfo = xf86GetPciInfoForEntity(pCir->pEnt->index); - pCir->PciTag = pciTag(pCir->PciInfo->bus, - pCir->PciInfo->device, - pCir->PciInfo->func); if (xf86LoadSubModule(pScrn, "int10")) { xf86Int10InfoPtr int10InfoPtr; Index: hw/xfree86/drivers/fbdev/fbdev.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c,v retrieving revision 1.12 diff -u -r1.12 fbdev.c --- hw/xfree86/drivers/fbdev/fbdev.c 11 Jul 2005 02:29:47 -0000 1.12 +++ hw/xfree86/drivers/fbdev/fbdev.c 7 Aug 2005 04:21:25 -0000 @@ -289,7 +289,7 @@ ScrnInfoPtr pScrn; GDevPtr *devSections; int numDevSections; - int bus,device,func; + PciBusId bus_id; char *dev; Bool foundScreen = FALSE; @@ -313,9 +313,8 @@ dev = xf86FindOptionValue(devSections[i]->options,"fbdev"); if (devSections[i]->busID) { - if (xf86ParsePciBusString(devSections[i]->busID,&bus,&device, - &func)) { - if (!xf86CheckPciSlot(bus,device,func)) + if (xf86ParsePciBusString(devSections[i]->busID,&bus_id)) { + if (!xf86CheckPciSlot(&bus_id)) continue; isPci = TRUE; } else if (xf86ParseIsaBusString(devSections[i]->busID)) @@ -328,7 +327,7 @@ /* XXX what about when there's no busID set? */ int entity; - entity = xf86ClaimPciSlot(bus,device,func,drv, + entity = xf86ClaimPciSlot(&bus_id,drv, 0,devSections[i], TRUE); pScrn = xf86ConfigPciEntity(pScrn,0,entity, @@ -338,7 +337,7 @@ pScrn->driverName = FBDEV_DRIVER_NAME; pScrn->name = FBDEV_NAME; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "claimed PCI slot %d:%d:%d\n",bus,device,func); + "claimed PCI slot %d:%d:%d\n",bus_id.bus,bus_id.device,bus_id.func); } else if (isIsa) { int entity; Index: hw/xfree86/drivers/glint/glint.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h,v retrieving revision 1.2 diff -u -r1.2 glint.h --- hw/xfree86/drivers/glint/glint.h 23 Apr 2004 19:33:32 -0000 1.2 +++ hw/xfree86/drivers/glint/glint.h 7 Aug 2005 04:21:25 -0000 @@ -75,7 +75,6 @@ int numMultiDevices; int MultiChip; Bool MultiAperture; - PCITAG PciTag; EntityInfoPtr pEnt; GLINTEntPtr entityPrivate; RamDacHelperRecPtr RamDac; Index: hw/xfree86/drivers/glint/glint_dri.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c,v retrieving revision 1.5 diff -u -r1.5 glint_dri.c --- hw/xfree86/drivers/glint/glint_dri.c 11 Jul 2005 02:29:48 -0000 1.5 +++ hw/xfree86/drivers/glint/glint_dri.c 7 Aug 2005 04:21:27 -0000 @@ -493,9 +493,9 @@ } else { pDRIInfo->busIdString = xalloc(64); /* Freed in DRIDestroyInfoRec */ sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", - ((pciConfigPtr)pGlint->PciInfo->thisCard)->busnum, - ((pciConfigPtr)pGlint->PciInfo->thisCard)->devnum, - ((pciConfigPtr)pGlint->PciInfo->thisCard)->funcnum); + ((pciConfigPtr)pGlint->PciInfo->thisCard)->pciid.bus, + ((pciConfigPtr)pGlint->PciInfo->thisCard)->pciid.device, + ((pciConfigPtr)pGlint->PciInfo->thisCard)->pciid.func); } pDRIInfo->ddxDriverMajorVersion = GLINT_MAJOR_VERSION; pDRIInfo->ddxDriverMinorVersion = GLINT_MINOR_VERSION; @@ -778,11 +778,11 @@ if (pGlint->irq <= 0) { pGlint->irq = drmGetInterruptFromBusID(pGlint->drmSubFD, ((pciConfigPtr)pGlint->PciInfo - ->thisCard)->busnum, + ->thisCard)->pciid.bus, ((pciConfigPtr)pGlint->PciInfo - ->thisCard)->devnum, + ->thisCard)->pciid.device, ((pciConfigPtr)pGlint->PciInfo - ->thisCard)->funcnum); + ->thisCard)->pciid.func); } return TRUE; Index: hw/xfree86/drivers/glint/glint_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c,v retrieving revision 1.12 diff -u -r1.12 glint_driver.c --- hw/xfree86/drivers/glint/glint_driver.c 11 Jul 2005 02:29:48 -0000 1.12 +++ hw/xfree86/drivers/glint/glint_driver.c 7 Aug 2005 04:21:30 -0000 @@ -637,7 +637,8 @@ pciVideoPtr pPci, *checkusedPci; GDevPtr *devSections; int numDevSections; - int numUsed,bus,device,func; + int numUsed; + PciBusId bus_id, temp_bus_id; char *dev; int *usedChips = NULL; Bool foundScreen = FALSE; @@ -670,8 +671,8 @@ for (i = 0; i < numDevSections; i++) { dev = xf86FindOptionValue(devSections[i]->options,"fbdev"); if (devSections[i]->busID) { - xf86ParsePciBusString(devSections[i]->busID,&bus,&device,&func); - if (!xf86CheckPciSlot(bus,device,func)) + xf86ParsePciBusString(devSections[i]->busID,&bus_id); + if (!xf86CheckPciSlot(&bus_id)) continue; } if (fbdevHWProbe(NULL,dev,&name)) { @@ -685,7 +686,7 @@ if (devSections[i]->busID) { /* XXX what about when there's no busID set? */ int entity; - entity = xf86ClaimPciSlot(bus,device,func,drv, + entity = xf86ClaimPciSlot(&bus_id,drv, 0,devSections[i], TRUE); pScrn = xf86ConfigPciEntity(pScrn,0,entity, @@ -693,7 +694,7 @@ NULL,NULL,NULL,NULL); if (pScrn) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "claimed PCI slot %d:%d:%d\n",bus,device,func); + "claimed PCI slot %d:%d:%d\n",bus_id.bus,bus_id.device,bus_id.func); } else { /* XXX This is a quick hack */ int entity; @@ -764,16 +765,20 @@ (pPci->subsysCard == 0x3d32)) { int eIndex; if (!xf86IsEntityShared(usedChips[i])) { - eIndex = xf86ClaimPciSlot(pPci->bus, - pPci->device, - 1, + temp_bus_id.domain = pPci->pciid.domain; + temp_bus_id.bus = pPci->pciid.bus; + temp_bus_id.device = pPci->pciid.device; + temp_bus_id.func = 1; + eIndex = xf86ClaimPciSlot(&temp_bus_id, drv, -1 /* XXX */, NULL, FALSE); xf86AddEntityToScreen(pScrn,eIndex); } else { - eIndex = xf86ClaimPciSlot(pPci->bus, - pPci->device, - 2, + temp_bus_id.domain = pPci->pciid.domain; + temp_bus_id.bus = pPci->pciid.bus; + temp_bus_id.device = pPci->pciid.device; + temp_bus_id.func = 2; + eIndex = xf86ClaimPciSlot(&temp_bus_id, drv, -1 /* XXX */, NULL, FALSE); xf86AddEntityToScreen(pScrn,eIndex); @@ -786,14 +791,10 @@ while (*checkusedPci != NULL) { int eIndex; /* make sure we claim all but our source device */ - if ((pPci->bus == (*checkusedPci)->bus && - pPci->device == (*checkusedPci)->device) && - pPci->func != (*checkusedPci)->func) { + if (PCI_COMPARE_IDS(pPci->pciid, (*checkusedPci)->pciid)) { /* Claim other entities on the same card */ - eIndex = xf86ClaimPciSlot((*checkusedPci)->bus, - (*checkusedPci)->device, - (*checkusedPci)->func, + eIndex = xf86ClaimPciSlot(&((*checkusedPci)->pciid), drv, -1 /* XXX */, NULL, FALSE); @@ -801,9 +802,9 @@ xf86AddEntityToScreen(pScrn,eIndex); } else { ErrorF("BusID %d:%d:%d already claimed\n", - (*checkusedPci)->bus, - (*checkusedPci)->device, - (*checkusedPci)->func); + (*checkusedPci)->pciid.bus, + (*checkusedPci)->pciid.device, + (*checkusedPci)->pciid.func); xfree(usedChips); return FALSE; } @@ -1033,8 +1034,6 @@ if (pGlint->pEnt->location.type == BUS_PCI) { pGlint->PciInfo = xf86GetPciInfoForEntity(pGlint->pEnt->index); - pGlint->PciTag = pciTag(pGlint->PciInfo->bus, pGlint->PciInfo->device, - pGlint->PciInfo->func); } pGlint->InFifoSpace = 0; /* Force a Read of FIFO space on first run */ @@ -1488,10 +1487,8 @@ int basecopro = pGlint->MultiPciInfo[0]->memBase[0] & 0xFFFFC000; int basedelta = pGlint->PciInfo->memBase[0] & 0xFFFFC000; - int glintdelta = pGlint->PciTag; - int glintcopro = pciTag(pGlint->MultiPciInfo[0]->bus, - pGlint->MultiPciInfo[0]->device, - pGlint->MultiPciInfo[0]->func); + PciBusId *glintdelta = &pGlint->PciInfo->pciid; + PciBusId *glintcopro = &pGlint->MultiPciInfo[0]->pciid; int base3copro, offset; if( (basedelta & 0x20000) ^ (basecopro & 0x20000) ) { @@ -2461,14 +2458,14 @@ * We always map VGA IO registers - even if we don't need them */ pGlint->IOBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO_32BIT, - pGlint->PciTag, pGlint->IOAddress, 0x20000); + &pGlint->PciInfo->pciid, pGlint->IOAddress, 0x20000); if (pGlint->IOBase == NULL) return FALSE; if (pGlint->FbMapSize != 0) { pGlint->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pGlint->PciTag, + &pGlint->PciInfo->pciid, pGlint->FbAddress, pGlint->FbMapSize); if (pGlint->FbBase == NULL) Index: hw/xfree86/drivers/glint/pm2_video.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c,v retrieving revision 1.4 diff -u -r1.4 pm2_video.c --- hw/xfree86/drivers/glint/pm2_video.c 11 Jul 2005 02:29:49 -0000 1.4 +++ hw/xfree86/drivers/glint/pm2_video.c 7 Aug 2005 04:21:32 -0000 @@ -2764,9 +2764,9 @@ xvipc.pAPriv = pAPriv; /* Server head ID */ xvipc.op = OP_CONNECT; - xvipc.a = pGlint->PciInfo->bus; - xvipc.b = pGlint->PciInfo->device; - xvipc.c = pGlint->PciInfo->func; + xvipc.a = pGlint->PciInfo->pciid.bus; + xvipc.b = pGlint->PciInfo->pciid.device; + xvipc.c = pGlint->PciInfo->pciid.func; xvipc.d = pScrn->videoRam << 10; /* XF86Config overrides probing */ @@ -3002,7 +3002,7 @@ } if (VideoIO) - switch (pciReadLong(pGlint->PciTag, PCI_SUBSYSTEM_ID_REG)) { + switch (pciReadLong(&pGlint->PciInfo->pciid, PCI_SUBSYSTEM_ID_REG)) { case PCI_SUBSYSTEM_ID_WINNER_2000_P2A: case PCI_SUBSYSTEM_ID_WINNER_2000_P2C: case PCI_SUBSYSTEM_ID_GLORIA_SYNERGY_P2A: Index: hw/xfree86/drivers/glint/pm3_dac.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c,v retrieving revision 1.3 diff -u -r1.3 pm3_dac.c --- hw/xfree86/drivers/glint/pm3_dac.c 11 Jul 2005 02:29:49 -0000 1.3 +++ hw/xfree86/drivers/glint/pm3_dac.c 7 Aug 2005 04:21:33 -0000 @@ -68,7 +68,7 @@ /* Mark as VIDMEM_MMIO to avoid write-combining while detecting memory */ pGlint->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - pGlint->PciTag, pGlint->FbAddress, pGlint->FbMapSize); + &pGlint->PciInfo->pciid, pGlint->FbAddress, pGlint->FbMapSize); if (pGlint->FbBase == NULL) return 0; Index: hw/xfree86/drivers/i128/i128.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h,v retrieving revision 1.2 diff -u -r1.2 i128.h --- hw/xfree86/drivers/i128/i128.h 23 Apr 2004 19:34:24 -0000 1.2 +++ hw/xfree86/drivers/i128/i128.h 7 Aug 2005 04:21:33 -0000 @@ -27,7 +27,6 @@ typedef struct { EntityInfoPtr pEnt; pciVideoPtr PciInfo; - PCITAG PciTag; xf86AccessRec Access; int Chipset; int ChipRev; Index: hw/xfree86/drivers/i128/i128_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c,v retrieving revision 1.6 diff -u -r1.6 i128_driver.c --- hw/xfree86/drivers/i128/i128_driver.c 11 Jul 2005 02:29:49 -0000 1.6 +++ hw/xfree86/drivers/i128/i128_driver.c 7 Aug 2005 04:21:36 -0000 @@ -555,9 +555,6 @@ /* Find the PCI info for this screen */ pI128->PciInfo = xf86GetPciInfoForEntity(pI128->pEnt->index); - pI128->PciTag = pciTag(pI128->PciInfo->bus, pI128->PciInfo->device, - pI128->PciInfo->func); - pI128->Primary = xf86IsPrimaryPci(pI128->PciInfo); /* The vgahw module should be allocated here when needed */ @@ -1324,7 +1321,7 @@ pI128->mem.mw0_ad = (unsigned char *)xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pI128->PciTag, + &pI128->PciInfo->pciid, pI128->PciInfo->memBase[0] & 0xFFC00000, pI128->MemorySize*1024); if (pI128->mem.mw0_ad == NULL) @@ -1334,7 +1331,7 @@ pI128->mem.rbase_g = (CARD32 *)xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_MMIO_32BIT, - pI128->PciTag, + &pI128->PciInfo->pciid, pI128->PciInfo->memBase[4] & 0xFFFF0000, 64*1024); if (pI128->mem.rbase_g == NULL) Index: hw/xfree86/drivers/i740/i740.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.h,v retrieving revision 1.2 diff -u -r1.2 i740.h --- hw/xfree86/drivers/i740/i740.h 23 Apr 2004 19:35:03 -0000 1.2 +++ hw/xfree86/drivers/i740/i740.h 7 Aug 2005 04:21:36 -0000 @@ -99,7 +99,6 @@ unsigned long MMIOAddr; EntityInfoPtr pEnt; pciVideoPtr PciInfo; - PCITAG PciTag; int HasSGRAM; I740RegRec SavedReg; I740RegRec ModeReg; Index: hw/xfree86/drivers/i740/i740_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c,v retrieving revision 1.6 diff -u -r1.6 i740_driver.c --- hw/xfree86/drivers/i740/i740_driver.c 11 Jul 2005 02:29:50 -0000 1.6 +++ hw/xfree86/drivers/i740/i740_driver.c 7 Aug 2005 04:21:38 -0000 @@ -507,8 +507,6 @@ if (!vgaHWGetHWRec(pScrn)) return FALSE; pI740->PciInfo = xf86GetPciInfoForEntity(pI740->pEnt->index); - pI740->PciTag = pciTag(pI740->PciInfo->bus, pI740->PciInfo->device, - pI740->PciInfo->func); if (xf86RegisterResources(pI740->pEnt->index, 0, ResNone)) return FALSE; @@ -873,13 +871,13 @@ mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT; pI740->MMIOBase = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, - pI740->PciTag, + &pI740->PciInfo->pciid, pI740->MMIOAddr, 0x80000); if (!pI740->MMIOBase) return FALSE; pI740->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pI740->PciTag, + &pI740->PciInfo->pciid, pI740->LinearAddr, pI740->FbMapSize); if (!pI740->FbBase) return FALSE; Index: hw/xfree86/drivers/i810/i810.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h,v retrieving revision 1.6 diff -u -r1.6 i810.h --- hw/xfree86/drivers/i810/i810.h 4 Dec 2004 00:43:09 -0000 1.6 +++ hw/xfree86/drivers/i810/i810.h 7 Aug 2005 04:21:38 -0000 @@ -186,7 +186,6 @@ IOADDRESS ioBase; EntityInfoPtr pEnt; pciVideoPtr PciInfo; - PCITAG PciTag; I810RingBuffer *LpRing; unsigned int BR[20]; Index: hw/xfree86/drivers/i810/i810_dri.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v retrieving revision 1.8 diff -u -r1.8 i810_dri.c --- hw/xfree86/drivers/i810/i810_dri.c 11 Jul 2005 02:29:51 -0000 1.8 +++ hw/xfree86/drivers/i810/i810_dri.c 7 Aug 2005 04:21:38 -0000 @@ -353,9 +353,9 @@ } else { pDRIInfo->busIdString = xalloc(64); sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", - ((pciConfigPtr) pI810->PciInfo->thisCard)->busnum, - ((pciConfigPtr) pI810->PciInfo->thisCard)->devnum, - ((pciConfigPtr) pI810->PciInfo->thisCard)->funcnum); + ((pciConfigPtr) pI810->PciInfo->thisCard)->pciid.bus, + ((pciConfigPtr) pI810->PciInfo->thisCard)->pciid.device, + ((pciConfigPtr) pI810->PciInfo->thisCard)->pciid.func); } pDRIInfo->ddxDriverMajorVersion = I810_MAJOR_VERSION; pDRIInfo->ddxDriverMinorVersion = I810_MINOR_VERSION; @@ -963,11 +963,11 @@ if (!pI810DRI->irq) { pI810DRI->irq = drmGetInterruptFromBusID(pI810->drmSubFD, ((pciConfigPtr) pI810-> - PciInfo->thisCard)->busnum, + PciInfo->thisCard)->pciid.bus, ((pciConfigPtr) pI810-> - PciInfo->thisCard)->devnum, + PciInfo->thisCard)->pciid.device, ((pciConfigPtr) pI810-> - PciInfo->thisCard)->funcnum); + PciInfo->thisCard)->pciid.func); if ((drmCtlInstHandler(pI810->drmSubFD, pI810DRI->irq)) != 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] failure adding irq handler, there is a device " Index: hw/xfree86/drivers/i810/i810_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v retrieving revision 1.20 diff -u -r1.20 i810_driver.c --- hw/xfree86/drivers/i810/i810_driver.c 11 Jul 2005 02:29:51 -0000 1.20 +++ hw/xfree86/drivers/i810/i810_driver.c 7 Aug 2005 04:21:42 -0000 @@ -521,14 +521,13 @@ */ for (ppPci = VideoInfo; ppPci != NULL && *ppPci != NULL; ppPci++) { if ((*ppPci)->vendor == PCI_VENDOR_INTEL && - (*ppPci)->func == 1) { + (*ppPci)->pciid.func == 1) { for (id = I810PciChipsets; id->PCIid != -1; id++) { if (id->PCIid == (*ppPci)->chipType) { /* Claim slot */ - if (xf86CheckPciSlot((*ppPci)->bus, (*ppPci)->device, - (*ppPci)->func)) { - xf86ClaimPciSlot((*ppPci)->bus, (*ppPci)->device, - (*ppPci)->func, drv, id->PCIid, + if (xf86CheckPciSlot(&(*ppPci)->pciid)) { + xf86ClaimPciSlot(&(*ppPci)->pciid, + drv, id->PCIid, NULL, FALSE); } break; @@ -713,8 +712,6 @@ pI810->ioBase = hwp->PIOOffset; pI810->PciInfo = xf86GetPciInfoForEntity(pI810->pEnt->index); - pI810->PciTag = pciTag(pI810->PciInfo->bus, pI810->PciInfo->device, - pI810->PciInfo->func); if (xf86RegisterResources(pI810->pEnt->index, 0, ResNone)) return FALSE; @@ -900,7 +897,7 @@ /* Find out memory bus frequency. */ { - unsigned long whtcfg_pamr_drp = pciReadLong(pI810->PciTag, + unsigned long whtcfg_pamr_drp = pciReadLong(&pI810->PciInfo->pciid, WHTCFG_PAMR_DRP); /* Need this for choosing watermarks. @@ -954,11 +951,10 @@ /* Calculate Fixed Offsets depending on graphics aperture size */ { - PCITAG bridge; long smram_miscc; + PciBusId bus_id = { 0, 0, 0, 0 }; - bridge = pciTag(0, 0, 0); /* This is always the host bridge */ - smram_miscc = pciReadLong(bridge, SMRAM_MISCC); + smram_miscc = pciReadLong(&bus_id, SMRAM_MISCC); if ((smram_miscc & GFX_MEM_WIN_SIZE) == GFX_MEM_WIN_32M) { pI810->FbMapSize = 0x1000000; pI810->DepthOffset = 0x1000000; @@ -1156,7 +1152,7 @@ #endif pI810->MMIOBase = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, - pI810->PciTag, + &pI810->PciInfo->pciid, pI810->MMIOAddr, I810_REG_SIZE); if (!pI810->MMIOBase) return FALSE; @@ -1176,7 +1172,7 @@ return FALSE; pI810->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pI810->PciTag, + &pI810->PciInfo->pciid, pI810->LinearAddr, pI810->FbMapSize); if (!pI810->FbBase) return FALSE; Index: hw/xfree86/drivers/i810/i830.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i810/i830.h,v retrieving revision 1.11 diff -u -r1.11 i830.h --- hw/xfree86/drivers/i810/i830.h 20 May 2005 15:24:02 -0000 1.11 +++ hw/xfree86/drivers/i810/i830.h 7 Aug 2005 04:21:42 -0000 @@ -251,7 +251,6 @@ IOADDRESS ioBase; EntityInfoPtr pEnt; pciVideoPtr PciInfo; - PCITAG PciTag; CARD8 variant; unsigned int BR[20]; Index: hw/xfree86/drivers/i810/i830_dri.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c,v retrieving revision 1.10 diff -u -r1.10 i830_dri.c --- hw/xfree86/drivers/i810/i830_dri.c 11 Jul 2005 02:29:51 -0000 1.10 +++ hw/xfree86/drivers/i810/i830_dri.c 7 Aug 2005 04:21:42 -0000 @@ -470,9 +470,9 @@ } else { pDRIInfo->busIdString = xalloc(64); sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", - ((pciConfigPtr) pI830->PciInfo->thisCard)->busnum, - ((pciConfigPtr) pI830->PciInfo->thisCard)->devnum, - ((pciConfigPtr) pI830->PciInfo->thisCard)->funcnum); + ((pciConfigPtr) pI830->PciInfo->thisCard)->pciid.bus, + ((pciConfigPtr) pI830->PciInfo->thisCard)->pciid.device, + ((pciConfigPtr) pI830->PciInfo->thisCard)->pciid.func); } pDRIInfo->ddxDriverMajorVersion = I830_MAJOR_VERSION; pDRIInfo->ddxDriverMinorVersion = I830_MINOR_VERSION; @@ -700,11 +700,11 @@ { pI830DRI->irq = drmGetInterruptFromBusID(pI830->drmSubFD, ((pciConfigPtr) pI830-> - PciInfo->thisCard)->busnum, + PciInfo->thisCard)->pciid.bus, ((pciConfigPtr) pI830-> - PciInfo->thisCard)->devnum, + PciInfo->thisCard)->pciid.device, ((pciConfigPtr) pI830-> - PciInfo->thisCard)->funcnum); + PciInfo->thisCard)->pciid.func); if (drmCtlInstHandler(pI830->drmSubFD, pI830DRI->irq)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -790,11 +790,11 @@ { pI830DRI->irq = drmGetInterruptFromBusID(pI830->drmSubFD, ((pciConfigPtr) pI830-> - PciInfo->thisCard)->busnum, + PciInfo->thisCard)->pciid.bus, ((pciConfigPtr) pI830-> - PciInfo->thisCard)->devnum, + PciInfo->thisCard)->pciid.device, ((pciConfigPtr) pI830-> - PciInfo->thisCard)->funcnum); + PciInfo->thisCard)->pciid.func); if (drmCtlInstHandler(pI830->drmSubFD, pI830DRI->irq)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, Index: hw/xfree86/drivers/i810/i830_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c,v retrieving revision 1.27 diff -u -r1.27 i830_driver.c --- hw/xfree86/drivers/i810/i830_driver.c 11 Jul 2005 02:29:51 -0000 1.27 +++ hw/xfree86/drivers/i810/i830_driver.c 7 Aug 2005 04:21:48 -0000 @@ -1311,13 +1311,12 @@ I830DetectMemory(ScrnInfoPtr pScrn) { I830Ptr pI830 = I830PTR(pScrn); - PCITAG bridge; CARD16 gmch_ctrl; int memsize = 0; int range; + PciBusId id_0 = { 0, 0, 0, 0 }; - bridge = pciTag(0, 0, 0); /* This is always the host bridge */ - gmch_ctrl = pciReadWord(bridge, I830_GMCH_CTRL); + gmch_ctrl = pciReadWord(&id_0, I830_GMCH_CTRL); /* We need to reduce the stolen size, by the GTT and the popup. * The GTT varying according the the FbMapSize and the popup is 4KB */ @@ -1389,7 +1388,7 @@ #endif pI830->MMIOBase = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, - pI830->PciTag, + &pI830->PciInfo->pciid, pI830->MMIOAddr, I810_REG_SIZE); if (!pI830->MMIOBase) return FALSE; @@ -1409,7 +1408,7 @@ return FALSE; pI830->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pI830->PciTag, + &pI830->PciInfo->pciid, pI830->LinearAddr, pI830->FbMapSize); if (!pI830->FbBase) return FALSE; @@ -1569,8 +1568,7 @@ int i,j = 0; int reg = (IS_845G(pI830) || IS_I865G(pI830)) ? _845_DRAM_RW_CONTROL : _855_DRAM_RW_CONTROL; - - PCITAG tag =pciTag(0,0,0); + PciBusId id_0 = { 0, 0, 0, 0 }; if(!pI830->PciInfo || !(IS_845G(pI830) || IS_I85X(pI830) || IS_I865G(pI830))) @@ -1611,8 +1609,8 @@ if (preinit && ((ret >> 16) != pI830->vbeInfo->TotalMemory)) return 0; - oldpermission = pciReadLong(tag, reg); - pciWriteLong(tag, reg, DRAM_WRITE | (oldpermission & 0xffff)); + oldpermission = pciReadLong(&id_0, reg); + pciWriteLong(&id_0, reg, DRAM_WRITE | (oldpermission & 0xffff)); *(CARD32 *)position = newsize + 0x21000; @@ -1635,7 +1633,7 @@ } } - pciWriteLong(tag, reg, oldpermission); + pciWriteLong(&id_0, reg, oldpermission); return ret; } @@ -1977,8 +1975,6 @@ return FALSE; pI830->PciInfo = xf86GetPciInfoForEntity(pI830->pEnt->index); - pI830->PciTag = pciTag(pI830->PciInfo->bus, pI830->PciInfo->device, - pI830->PciInfo->func); /* Allocate an entity private if necessary */ if (xf86IsEntityShared(pScrn->entityList[0])) { @@ -2052,7 +2048,7 @@ break; case PCI_CHIP_I855_GM: /* Check capid register to find the chipset variant */ - pI830->variant = (pciReadLong(pI830->PciTag, I85X_CAPID) + pI830->variant = (pciReadLong(&pI830->PciInfo->pciid, I85X_CAPID) >> I85X_VARIANT_SHIFT) & I85X_VARIANT_MASK; switch (pI830->variant) { case I855_GM: @@ -2182,11 +2178,10 @@ #endif if (IS_I830(pI830) || IS_845G(pI830)) { - PCITAG bridge; CARD16 gmch_ctrl; + PciBusId id_0 = { 0, 0, 0, 0 }; - bridge = pciTag(0, 0, 0); /* This is always the host bridge */ - gmch_ctrl = pciReadWord(bridge, I830_GMCH_CTRL); + gmch_ctrl = pciReadWord(&id_0, I830_GMCH_CTRL); if ((gmch_ctrl & I830_GMCH_MEM_MASK) == I830_GMCH_MEM_128M) { pI830->FbMapSize = 0x8000000; } else { Index: hw/xfree86/drivers/imstt/imstt.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h,v retrieving revision 1.2 diff -u -r1.2 imstt.h --- hw/xfree86/drivers/imstt/imstt.h 23 Apr 2004 19:36:46 -0000 1.2 +++ hw/xfree86/drivers/imstt/imstt.h 7 Aug 2005 04:21:48 -0000 @@ -12,7 +12,6 @@ typedef struct _IMSTTRec { pciVideoPtr PciInfo; - PCITAG PciTag; EntityInfoPtr pEnt; CARD32 IOAddress; CARD32 FBAddress; Index: hw/xfree86/drivers/imstt/imstt_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c,v retrieving revision 1.6 diff -u -r1.6 imstt_driver.c --- hw/xfree86/drivers/imstt/imstt_driver.c 11 Jul 2005 02:29:51 -0000 1.6 +++ hw/xfree86/drivers/imstt/imstt_driver.c 7 Aug 2005 04:21:48 -0000 @@ -473,9 +473,6 @@ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chipset: \"%s\"\n", pScrn->chipset); - iptr->PciTag = pciTag(iptr->PciInfo->bus, iptr->PciInfo->device, - iptr->PciInfo->func); - if (!xf86SetGamma(pScrn, gzeros)) return FALSE; @@ -574,7 +571,7 @@ iptr = IMSTTPTR(pScrn); - iptr->MMIOBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, iptr->PciTag, + iptr->MMIOBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, &iptr->PciInfo->pciid, iptr->PciInfo->memBase[0] + 0x800000, 0x41000); if (!iptr->MMIOBase) { @@ -590,7 +587,7 @@ if (iptr->FBDev) { iptr->FBBase = fbdevHWMapVidmem(pScrn); } else { - iptr->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, iptr->PciTag, + iptr->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, &iptr->PciInfo->pciid, iptr->PciInfo->memBase[0], iptr->videoRam); } @@ -601,7 +598,7 @@ } if (iptr->InitDAC) { - iptr->CMAPBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, iptr->PciTag, + iptr->CMAPBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, &iptr->PciInfo->pciid, iptr->PciInfo->memBase[0] + 0x840000, 0x1000); if (!iptr->CMAPBase) { Index: hw/xfree86/drivers/mga/mga.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v retrieving revision 1.7 diff -u -r1.7 mga.h --- hw/xfree86/drivers/mga/mga.h 3 Jul 2005 03:28:27 -0000 1.7 +++ hw/xfree86/drivers/mga/mga.h 7 Aug 2005 04:21:50 -0000 @@ -353,7 +353,6 @@ struct mga_bios_values bios; CARD8 BiosOutputMode; pciVideoPtr PciInfo; - PCITAG PciTag; xf86AccessRec Access; int Chipset; int ChipRev; Index: hw/xfree86/drivers/mga/mga_bios.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_bios.c,v retrieving revision 1.2 diff -u -r1.2 mga_bios.c --- hw/xfree86/drivers/mga/mga_bios.c 11 Jul 2005 02:29:51 -0000 1.2 +++ hw/xfree86/drivers/mga/mga_bios.c 7 Aug 2005 04:21:50 -0000 @@ -407,11 +407,11 @@ } if (pciBIOS) { - rlen = xf86ReadPciBIOS(0, pMga->PciTag, pMga->FbBaseReg, + rlen = xf86ReadPciBIOS(0, &pMga->PciInfo->pciid, pMga->FbBaseReg, bios_data, sizeof(bios_data)); } else { - rlen = xf86ReadDomainMemory(pMga->PciTag, pMga->BiosAddress, + rlen = xf86ReadDomainMemory(&pMga->PciInfo->pciid, pMga->BiosAddress, sizeof(bios_data), bios_data); } Index: hw/xfree86/drivers/mga/mga_dac3026.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dac3026.c,v retrieving revision 1.7 diff -u -r1.7 mga_dac3026.c --- hw/xfree86/drivers/mga/mga_dac3026.c 11 Jul 2005 02:29:51 -0000 1.7 +++ hw/xfree86/drivers/mga/mga_dac3026.c 7 Aug 2005 04:21:50 -0000 @@ -747,7 +747,7 @@ for (i = 0; i < 6; i++) OUTREG16(0x1FDE, (mgaReg->ExtVga[i] << 8) | i); - pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, OPTION_MASK, + pciSetBitsLong(&pMga->PciInfo->pciid, PCI_OPTION_REG, OPTION_MASK, mgaReg->Option); MGA_NOT_HAL( @@ -867,7 +867,7 @@ for (i = 0; i < DACREGSIZE; i++) mgaReg->DacRegs[i] = inTi3026(MGADACregs[i]); - mgaReg->Option = pciReadLong(pMga->PciTag, PCI_OPTION_REG); + mgaReg->Option = pciReadLong(&pMga->PciInfo->pciid, PCI_OPTION_REG); #ifdef DEBUG ErrorF("read: %02X %02X %02X %02X %02X %02X %08lX\n", Index: hw/xfree86/drivers/mga/mga_dacG.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v retrieving revision 1.7 diff -u -r1.7 mga_dacG.c --- hw/xfree86/drivers/mga/mga_dacG.c 11 Jul 2005 02:29:51 -0000 1.7 +++ hw/xfree86/drivers/mga/mga_dacG.c 7 Aug 2005 04:21:51 -0000 @@ -692,13 +692,13 @@ if (!MGAISGx50(pMga)) { /* restore pci_option register */ - pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, optionMask, + pciSetBitsLong(&pMga->PciInfo->pciid, PCI_OPTION_REG, optionMask, mgaReg->Option); if (pMga->Chipset != PCI_CHIP_MGA1064) - pciSetBitsLong(pMga->PciTag, PCI_MGA_OPTION2, OPTION2_MASK, + pciSetBitsLong(&pMga->PciInfo->pciid, PCI_MGA_OPTION2, OPTION2_MASK, mgaReg->Option2); if (pMga->Chipset == PCI_CHIP_MGAG400 || pMga->Chipset == PCI_CHIP_MGAG550) - pciSetBitsLong(pMga->PciTag, PCI_MGA_OPTION3, OPTION3_MASK, + pciSetBitsLong(&pMga->PciInfo->pciid, PCI_MGA_OPTION3, OPTION3_MASK, mgaReg->Option3); } ); /* MGA_NOT_HAL */ @@ -852,11 +852,11 @@ mgaReg->PIXPLLCSaved = TRUE; - mgaReg->Option = pciReadLong(pMga->PciTag, PCI_OPTION_REG); + mgaReg->Option = pciReadLong(&pMga->PciInfo->pciid, PCI_OPTION_REG); - mgaReg->Option2 = pciReadLong(pMga->PciTag, PCI_MGA_OPTION2); + mgaReg->Option2 = pciReadLong(&pMga->PciInfo->pciid, PCI_MGA_OPTION2); if (pMga->Chipset == PCI_CHIP_MGAG400 || pMga->Chipset == PCI_CHIP_MGAG550) - mgaReg->Option3 = pciReadLong(pMga->PciTag, PCI_MGA_OPTION3); + mgaReg->Option3 = pciReadLong(&pMga->PciInfo->pciid, PCI_MGA_OPTION3); ); /* MGA_NOT_HAL */ for (i = 0; i < 6; i++) Index: hw/xfree86/drivers/mga/mga_dri.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v retrieving revision 1.9 diff -u -r1.9 mga_dri.c --- hw/xfree86/drivers/mga/mga_dri.c 11 Jul 2005 02:29:51 -0000 1.9 +++ hw/xfree86/drivers/mga/mga_dri.c 7 Aug 2005 04:21:51 -0000 @@ -923,9 +923,9 @@ if (!pMga->irq) { pMga->irq = drmGetInterruptFromBusID( pMga->drmFD, - ((pciConfigPtr)pMga->PciInfo->thisCard)->busnum, - ((pciConfigPtr)pMga->PciInfo->thisCard)->devnum, - ((pciConfigPtr)pMga->PciInfo->thisCard)->funcnum); + ((pciConfigPtr)pMga->PciInfo->thisCard)->pciid.bus, + ((pciConfigPtr)pMga->PciInfo->thisCard)->pciid.device, + ((pciConfigPtr)pMga->PciInfo->thisCard)->pciid.func); if((drmCtlInstHandler(pMga->drmFD, pMga->irq)) != 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -1049,9 +1049,9 @@ } else { pDRIInfo->busIdString = xalloc(64); sprintf( pDRIInfo->busIdString, "PCI:%d:%d:%d", - ((pciConfigPtr)pMga->PciInfo->thisCard)->busnum, - ((pciConfigPtr)pMga->PciInfo->thisCard)->devnum, - ((pciConfigPtr)pMga->PciInfo->thisCard)->funcnum ); + ((pciConfigPtr)pMga->PciInfo->thisCard)->pciid.bus, + ((pciConfigPtr)pMga->PciInfo->thisCard)->pciid.device, + ((pciConfigPtr)pMga->PciInfo->thisCard)->pciid.func ); } pDRIInfo->ddxDriverMajorVersion = MGA_MAJOR_VERSION; pDRIInfo->ddxDriverMinorVersion = MGA_MINOR_VERSION; Index: hw/xfree86/drivers/mga/mga_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v retrieving revision 1.14 diff -u -r1.14 mga_driver.c --- hw/xfree86/drivers/mga/mga_driver.c 11 Jul 2005 02:29:51 -0000 1.14 +++ hw/xfree86/drivers/mga/mga_driver.c 7 Aug 2005 04:21:56 -0000 @@ -1123,8 +1123,6 @@ /* Find the PCI info for this screen */ pMga->PciInfo = xf86GetPciInfoForEntity(pMga->pEnt->index); - pMga->PciTag = pciTag(pMga->PciInfo->bus, pMga->PciInfo->device, - pMga->PciInfo->func); pMga->Primary = xf86IsPrimaryPci(pMga->PciInfo); @@ -2111,7 +2109,7 @@ (pMga->Chipset != PCI_CHIP_MGA2064) && (pMga->Chipset != PCI_CHIP_MGA2164) && (pMga->Chipset != PCI_CHIP_MGA2164_AGP)) { - CARD32 option_reg = pciReadLong(pMga->PciTag, PCI_OPTION_REG); + CARD32 option_reg = pciReadLong(&pMga->PciInfo->pciid, PCI_OPTION_REG); if(!(option_reg & (1 << 14))) { pMga->HasSDRAM = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Has SDRAM\n"); @@ -2370,12 +2368,12 @@ */ pMga->IOBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, - pMga->PciTag, pMga->IOAddress, 0x4000); + &pMga->PciInfo->pciid, pMga->IOAddress, 0x4000); if (pMga->IOBase == NULL) return FALSE; pMga->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pMga->PciTag, pMga->FbAddress, + &pMga->PciInfo->pciid, pMga->FbAddress, pMga->FbMapSize); if (pMga->FbBase == NULL) return FALSE; @@ -2388,7 +2386,7 @@ pMga->ILOADBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_MMIO_32BIT | VIDMEM_READSIDEEFFECT, - pMga->PciTag, pMga->ILOADAddress, 0x800000); + &pMga->PciInfo->pciid, pMga->ILOADAddress, 0x800000); } else pMga->ILOADBase = NULL; @@ -2418,7 +2416,7 @@ DWORD access on DWORD boundaries to this window */ if(pMga->ILOADAddress) pMga->ILOADBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - pMga->PciTag, pMga->ILOADAddress, 0x800000); + &pMga->PciInfo->pciid, pMga->ILOADAddress, 0x800000); else pMga->ILOADBase = NULL; #endif return TRUE; @@ -3042,7 +3040,7 @@ if (pMga->FBDev) { fbdevHWSave(pScrn); /* Disable VGA core, and leave memory access on */ - pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, 0x100, 0x000); + pciSetBitsLong(&pMga->PciInfo->pciid, PCI_OPTION_REG, 0x100, 0x000); if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) return FALSE; if(pMga->SecondCrtc == FALSE && pMga->HWCursor == TRUE) { Index: hw/xfree86/drivers/mga/mga_merge.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_merge.c,v retrieving revision 1.4 diff -u -r1.4 mga_merge.c --- hw/xfree86/drivers/mga/mga_merge.c 11 Jul 2005 02:29:51 -0000 1.4 +++ hw/xfree86/drivers/mga/mga_merge.c 7 Aug 2005 04:21:58 -0000 @@ -271,8 +271,6 @@ return TRUE; } - pMga->PciTag = pMga1->PciTag; - pMga->Primary = pMga1->Primary; /* Set pScrn->monitor */ Index: hw/xfree86/drivers/neomagic/neo.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo.h,v retrieving revision 1.4 diff -u -r1.4 neo.h --- hw/xfree86/drivers/neomagic/neo.h 20 Apr 2005 12:25:28 -0000 1.4 +++ hw/xfree86/drivers/neomagic/neo.h 7 Aug 2005 04:21:58 -0000 @@ -201,7 +201,6 @@ { int NeoChipset; pciVideoPtr PciInfo; - PCITAG PciTag; EntityInfoPtr pEnt; XAAInfoRecPtr AccelInfoRec; NEOACLRec Accel; Index: hw/xfree86/drivers/neomagic/neo_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c,v retrieving revision 1.13 diff -u -r1.13 neo_driver.c --- hw/xfree86/drivers/neomagic/neo_driver.c 11 Jul 2005 02:29:52 -0000 1.13 +++ hw/xfree86/drivers/neomagic/neo_driver.c 7 Aug 2005 04:21:59 -0000 @@ -779,9 +779,6 @@ /* This driver can handle ISA and PCI buses */ if (nPtr->pEnt->location.type == BUS_PCI) { nPtr->PciInfo = xf86GetPciInfoForEntity(nPtr->pEnt->index); - nPtr->PciTag = pciTag(nPtr->PciInfo->bus, - nPtr->PciInfo->device, - nPtr->PciInfo->func); } } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Chipset is a "); @@ -2060,12 +2057,12 @@ if (nPtr->pEnt->location.type == BUS_PCI){ nPtr->NeoMMIOBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - nPtr->PciTag, nPtr->NeoMMIOAddr, + &nPtr->PciInfo->pciid, nPtr->NeoMMIOAddr, 0x200000L); if (nPtr->NeoMMIOAddr2 != 0){ nPtr->NeoMMIOBase2 = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - nPtr->PciTag, nPtr->NeoMMIOAddr2, + &nPtr->PciInfo->pciid, nPtr->NeoMMIOAddr2, 0x100000L); } } else @@ -2080,7 +2077,7 @@ if (nPtr->pEnt->location.type == BUS_PCI) nPtr->NeoFbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - nPtr->PciTag, + &nPtr->PciInfo->pciid, (unsigned long)nPtr->NeoLinearAddr, nPtr->NeoFbMapSize); else Index: hw/xfree86/drivers/nv/nv_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c,v retrieving revision 1.16 diff -u -r1.16 nv_driver.c --- hw/xfree86/drivers/nv/nv_driver.c 11 Jul 2005 02:29:57 -0000 1.16 +++ hw/xfree86/drivers/nv/nv_driver.c 7 Aug 2005 04:22:01 -0000 @@ -603,18 +603,18 @@ { volatile CARD32 *regs; CARD32 pciid, pcicmd; - PCITAG Tag = ((pciConfigPtr)(pVideo->thisCard))->tag; + PciBusId *pciid_p = &((pciConfigPtr)(pVideo->thisCard))->pciid; - pcicmd = pciReadLong(Tag, PCI_CMD_STAT_REG); - pciWriteLong(Tag, PCI_CMD_STAT_REG, pcicmd | PCI_CMD_MEM_ENABLE); + pcicmd = pciReadLong(pciid_p, PCI_CMD_STAT_REG); + pciWriteLong(pciid_p, PCI_CMD_STAT_REG, pcicmd | PCI_CMD_MEM_ENABLE); - regs = xf86MapPciMem(-1, VIDMEM_MMIO, Tag, pVideo->memBase[0], 0x2000); + regs = xf86MapPciMem(-1, VIDMEM_MMIO, pciid_p, pVideo->memBase[0], 0x2000); pciid = regs[0x1800/4]; xf86UnMapVidMem(-1, (pointer)regs, 0x2000); - pciWriteLong(Tag, PCI_CMD_STAT_REG, pcicmd); + pciWriteLong(pciid_p, PCI_CMD_STAT_REG, pcicmd); if((pciid & 0x0000ffff) == 0x000010DE) pciid = 0x10DE0000 | (pciid >> 16); @@ -1008,8 +1008,6 @@ /* Find the PCI info for this screen */ pNv->PciInfo = xf86GetPciInfoForEntity(pNv->pEnt->index); - pNv->PciTag = pciTag(pNv->PciInfo->bus, pNv->PciInfo->device, - pNv->PciInfo->func); pNv->Primary = xf86IsPrimaryPci(pNv->PciInfo); @@ -1590,7 +1588,7 @@ pNv = NVPTR(pScrn); pNv->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pNv->PciTag, pNv->FbAddress, + &pNv->PciInfo->pciid, pNv->FbAddress, pNv->FbMapSize); if (pNv->FbBase == NULL) return FALSE; Index: hw/xfree86/drivers/nv/nv_hw.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_hw.c,v retrieving revision 1.7 diff -u -r1.7 nv_hw.c --- hw/xfree86/drivers/nv/nv_hw.c 11 Jul 2005 02:29:58 -0000 1.7 +++ hw/xfree86/drivers/nv/nv_hw.c 7 Aug 2005 04:22:03 -0000 @@ -674,15 +674,19 @@ nv10_fifo_info fifo_data; nv10_sim_state sim_data; unsigned int M, N, P, pll, MClk, NVClk, memctrl; + PciBusId id_1 = { 0, 0, 0, 1}; + PciBusId id_2 = { 0, 0, 0, 2}; + PciBusId id_3 = { 0, 0, 0, 3}; + PciBusId id_5 = { 0, 0, 0, 5}; if((pNv->Chipset & 0x0FF0) == 0x01A0) { unsigned int uMClkPostDiv; - uMClkPostDiv = (pciReadLong(pciTag(0, 0, 3), 0x6C) >> 8) & 0xf; + uMClkPostDiv = (pciReadLong(pciTag(&id_3), 0x6C) >> 8) & 0xf; if(!uMClkPostDiv) uMClkPostDiv = 4; MClk = 400000 / uMClkPostDiv; } else { - MClk = pciReadLong(pciTag(0, 0, 5), 0x4C) / 1000; + MClk = pciReadLong(pciTag(&id_5), 0x4C) / 1000; } pll = pNv->PRAMDAC0[0x0500/4]; @@ -691,17 +695,17 @@ sim_data.pix_bpp = (char)pixelDepth; sim_data.enable_video = 0; sim_data.enable_mp = 0; - sim_data.memory_type = (pciReadLong(pciTag(0, 0, 1), 0x7C) >> 12) & 1; + sim_data.memory_type = (pciReadLong(pciTag(&id_1), 0x7C) >> 12) & 1; sim_data.memory_width = 64; - memctrl = pciReadLong(pciTag(0, 0, 3), 0x00) >> 16; + memctrl = pciReadLong(pciTag(&id_3), 0x00) >> 16; if((memctrl == 0x1A9) || (memctrl == 0x1AB) || (memctrl == 0x1ED)) { int dimm[3]; - dimm[0] = (pciReadLong(pciTag(0, 0, 2), 0x40) >> 8) & 0x4F; - dimm[1] = (pciReadLong(pciTag(0, 0, 2), 0x44) >> 8) & 0x4F; - dimm[2] = (pciReadLong(pciTag(0, 0, 2), 0x48) >> 8) & 0x4F; + dimm[0] = (pciReadLong(pciTag(&id_2), 0x40) >> 8) & 0x4F; + dimm[1] = (pciReadLong(pciTag(&id_2), 0x44) >> 8) & 0x4F; + dimm[2] = (pciReadLong(pciTag(&id_2), 0x48) >> 8) & 0x4F; if((dimm[0] + dimm[1]) != dimm[2]) { ErrorF("WARNING: " Index: hw/xfree86/drivers/nv/nv_setup.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c,v retrieving revision 1.7 diff -u -r1.7 nv_setup.c --- hw/xfree86/drivers/nv/nv_setup.c 11 Jul 2005 02:29:58 -0000 1.7 +++ hw/xfree86/drivers/nv/nv_setup.c 7 Aug 2005 04:22:03 -0000 @@ -287,7 +287,7 @@ static void nv10GetConfig (NVPtr pNv) { CARD32 implementation = pNv->Chipset & 0x0ff0; - + PciBusId id_1 = { 0, 0, 0, 1 }; #if X_BYTE_ORDER == X_BIG_ENDIAN /* turn on big endian register access */ if(!(pNv->PMC[0x0004/4] & 0x01000001)) { @@ -297,10 +297,10 @@ #endif if(implementation == 0x01a0) { - int amt = pciReadLong(pciTag(0, 0, 1), 0x7C); + int amt = pciReadLong(&id_1, 0x7C); pNv->RamAmountKBytes = (((amt >> 6) & 31) + 1) * 1024; } else if(implementation == 0x01f0) { - int amt = pciReadLong(pciTag(0, 0, 1), 0x84); + int amt = pciReadLong(&id_1, 0x84); pNv->RamAmountKBytes = (((amt >> 4) & 127) + 1) * 1024; } else { pNv->RamAmountKBytes = (pNv->PFB[0x020C/4] & 0xFFF00000) >> 10; @@ -364,7 +364,7 @@ pNv->REGS = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, - pNv->PciTag, pNv->IOAddress, 0x01000000); + &pNv->PciInfo->pciid, pNv->IOAddress, 0x01000000); pNv->PRAMIN = pNv->REGS + (0x00710000/4); pNv->PCRTC0 = pNv->REGS + (0x00600000/4); Index: hw/xfree86/drivers/nv/nv_type.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h,v retrieving revision 1.5 diff -u -r1.5 nv_type.h --- hw/xfree86/drivers/nv/nv_type.h 21 Apr 2005 22:25:47 -0000 1.5 +++ hw/xfree86/drivers/nv/nv_type.h 7 Aug 2005 04:22:03 -0000 @@ -80,7 +80,6 @@ CARD32 CursorStart; EntityInfoPtr pEnt; pciVideoPtr PciInfo; - PCITAG PciTag; int Chipset; int ChipRev; Bool Primary; Index: hw/xfree86/drivers/nv/riva_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/nv/riva_driver.c,v retrieving revision 1.9 diff -u -r1.9 riva_driver.c --- hw/xfree86/drivers/nv/riva_driver.c 11 Jul 2005 02:29:58 -0000 1.9 +++ hw/xfree86/drivers/nv/riva_driver.c 7 Aug 2005 04:22:04 -0000 @@ -527,8 +527,6 @@ /* Find the PCI info for this screen */ pRiva->PciInfo = xf86GetPciInfoForEntity(pRiva->pEnt->index); - pRiva->PciTag = pciTag(pRiva->PciInfo->bus, pRiva->PciInfo->device, - pRiva->PciInfo->func); pRiva->Primary = xf86IsPrimaryPci(pRiva->PciInfo); @@ -973,12 +971,12 @@ */ pRiva->IOBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, - pRiva->PciTag, pRiva->IOAddress, 0x1000000); + &pRiva->PciInfo->pciid, pRiva->IOAddress, 0x1000000); if (pRiva->IOBase == NULL) return FALSE; pRiva->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pRiva->PciTag, pRiva->FbAddress, + &pRiva->PciInfo->pciid, pRiva->FbAddress, pRiva->FbMapSize); if (pRiva->FbBase == NULL) return FALSE; Index: hw/xfree86/drivers/nv/riva_setup.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/nv/riva_setup.c,v retrieving revision 1.3 diff -u -r1.3 riva_setup.c --- hw/xfree86/drivers/nv/riva_setup.c 11 Jul 2005 02:29:58 -0000 1.3 +++ hw/xfree86/drivers/nv/riva_setup.c 7 Aug 2005 04:22:05 -0000 @@ -233,23 +233,23 @@ mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT; - pRiva->riva.PRAMDAC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, + pRiva->riva.PRAMDAC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, &pRiva->PciInfo->pciid, regBase+0x00680000, 0x00003000); - pRiva->riva.PFB = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, + pRiva->riva.PFB = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, &pRiva->PciInfo->pciid, regBase+0x00100000, 0x00001000); - pRiva->riva.PFIFO = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, + pRiva->riva.PFIFO = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, &pRiva->PciInfo->pciid, regBase+0x00002000, 0x00002000); - pRiva->riva.PGRAPH = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, + pRiva->riva.PGRAPH = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, &pRiva->PciInfo->pciid, regBase+0x00400000, 0x00002000); - pRiva->riva.PEXTDEV = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, + pRiva->riva.PEXTDEV = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, &pRiva->PciInfo->pciid, regBase+0x00101000, 0x00001000); - pRiva->riva.PTIMER = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, + pRiva->riva.PTIMER = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, &pRiva->PciInfo->pciid, regBase+0x00009000, 0x00001000); - pRiva->riva.PMC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, + pRiva->riva.PMC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, &pRiva->PciInfo->pciid, regBase+0x00000000, 0x00009000); - pRiva->riva.FIFO = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, + pRiva->riva.FIFO = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, &pRiva->PciInfo->pciid, regBase+0x00800000, 0x00010000); - pRiva->riva.PRAMIN = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, + pRiva->riva.PRAMIN = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, &pRiva->PciInfo->pciid, frameBase+0x00C00000, 0x00008000); /* @@ -257,13 +257,13 @@ * sparse on alpha. */ pRiva->riva.PCIO = (U008 *)xf86MapPciMem(pScrn->scrnIndex, mmioFlags, - pRiva->PciTag, regBase+0x00601000, + &pRiva->PciInfo->pciid, regBase+0x00601000, 0x00003000); pRiva->riva.PDIO = (U008 *)xf86MapPciMem(pScrn->scrnIndex, mmioFlags, - pRiva->PciTag, regBase+0x00681000, + &pRiva->PciInfo->pciid, regBase+0x00681000, 0x00003000); pRiva->riva.PVIO = (U008 *)xf86MapPciMem(pScrn->scrnIndex, mmioFlags, - pRiva->PciTag, regBase+0x000C0000, + &pRiva->PciInfo->pciid, regBase+0x000C0000, 0x00001000); pRiva->riva.PCRTC = pRiva->riva.PGRAPH; Index: hw/xfree86/drivers/nv/riva_type.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/nv/riva_type.h,v retrieving revision 1.2 diff -u -r1.2 riva_type.h --- hw/xfree86/drivers/nv/riva_type.h 23 Apr 2004 19:42:10 -0000 1.2 +++ hw/xfree86/drivers/nv/riva_type.h 7 Aug 2005 04:22:05 -0000 @@ -54,7 +54,6 @@ RIVA_HW_STATE ModeReg; EntityInfoPtr pEnt; pciVideoPtr PciInfo; - PCITAG PciTag; xf86AccessRec Access; int ChipRev; Bool Primary; Index: hw/xfree86/drivers/rendition/rendition.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c,v retrieving revision 1.4 diff -u -r1.4 rendition.c --- hw/xfree86/drivers/rendition/rendition.c 11 Jul 2005 02:29:58 -0000 1.4 +++ hw/xfree86/drivers/rendition/rendition.c 7 Aug 2005 04:22:06 -0000 @@ -532,8 +532,6 @@ /* Find the PCI info for this screen */ pRendition->PciInfo = xf86GetPciInfoForEntity(pRendition->pEnt->index); - pRendition->pcitag= pciTag(pRendition->PciInfo->bus, - pRendition->PciInfo->device, pRendition->PciInfo->func); /* * XXX This could be refined if some VGA memory resources are not @@ -1428,7 +1426,7 @@ pRendition->board.vmem_base= xf86MapPciMem(pScreenInfo->scrnIndex, mapOption, - pRendition->pcitag, + &pRendition->PciInfo->pciid, (unsigned long)pRendition->board.mem_base, pScreenInfo->videoRam * 1024); return TRUE; Index: hw/xfree86/drivers/rendition/vtypes.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h,v retrieving revision 1.3 diff -u -r1.3 vtypes.h --- hw/xfree86/drivers/rendition/vtypes.h 20 Apr 2005 12:25:29 -0000 1.3 +++ hw/xfree86/drivers/rendition/vtypes.h 7 Aug 2005 04:22:06 -0000 @@ -177,7 +177,6 @@ { struct verite_board_t board; /* information on the board */ struct verite_modeinfo_t mode; /* information on the mode */ - PCITAG pcitag; /* tag for the PCI config space */ pciVideoPtr PciInfo; /* PCI config data */ EntityInfoPtr pEnt; /* entity information */ CloseScreenProcPtr CloseScreen; /* wrap CloseScreen */ Index: hw/xfree86/drivers/s3/s3.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/s3/s3.h,v retrieving revision 1.4 diff -u -r1.4 s3.h --- hw/xfree86/drivers/s3/s3.h 20 Apr 2005 12:25:29 -0000 1.4 +++ hw/xfree86/drivers/s3/s3.h 7 Aug 2005 04:22:06 -0000 @@ -85,7 +85,6 @@ typedef struct _S3Rec { pciVideoPtr PciInfo; - PCITAG PciTag; EntityInfoPtr pEnt; unsigned long IOAddress; unsigned long FBAddress; Index: hw/xfree86/drivers/s3/s3_bios.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_bios.c,v retrieving revision 1.3 diff -u -r1.3 s3_bios.c --- hw/xfree86/drivers/s3/s3_bios.c 11 Jul 2005 02:29:58 -0000 1.3 +++ hw/xfree86/drivers/s3/s3_bios.c 7 Aug 2005 04:22:06 -0000 @@ -47,7 +47,7 @@ if (!init) { init = 1; - if (xf86ReadDomainMemory(pS3->PciTag, BIOSbase, BIOS_BSIZE, bios) != BIOS_BSIZE) + if (xf86ReadDomainMemory(&pS3->PciInfo->pciid, BIOSbase, BIOS_BSIZE, bios) != BIOS_BSIZE) return NULL; if ((bios[0] != 0x55) || (bios[1] != 0xaa)) return NULL; Index: hw/xfree86/drivers/s3/s3_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c,v retrieving revision 1.10 diff -u -r1.10 s3_driver.c --- hw/xfree86/drivers/s3/s3_driver.c 11 Jul 2005 02:29:58 -0000 1.10 +++ hw/xfree86/drivers/s3/s3_driver.c 7 Aug 2005 04:22:06 -0000 @@ -515,9 +515,6 @@ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chipset: \"%s\"\n", pScrn->chipset); - pS3->PciTag = pciTag(pS3->PciInfo->bus, pS3->PciInfo->device, - pS3->PciInfo->func); - switch (pS3->Chipset) { case PCI_CHIP_964_0: case PCI_CHIP_964_1: @@ -1018,7 +1015,7 @@ if (pS3->S3NewMMIO) { pS3->MMIOBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - pS3->PciTag, pS3->IOAddress, + &pS3->PciInfo->pciid, pS3->IOAddress, S3_NEWMMIO_REGSIZE); if (!pS3->MMIOBase) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -1028,7 +1025,7 @@ } pS3->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pS3->PciTag, pS3->FBAddress, + &pS3->PciInfo->pciid, pS3->FBAddress, pScrn->videoRam * 1024); if (!pS3->FBBase) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, Index: hw/xfree86/drivers/s3virge/s3v.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h,v retrieving revision 1.3 diff -u -r1.3 s3v.h --- hw/xfree86/drivers/s3virge/s3v.h 20 Apr 2005 12:25:29 -0000 1.3 +++ hw/xfree86/drivers/s3virge/s3v.h 7 Aug 2005 04:22:08 -0000 @@ -285,7 +285,6 @@ XAAInfoRecPtr AccelInfoRec; /* PCI info vars. */ pciVideoPtr PciInfo; - PCITAG PciTag; /* Chip info, set using PCI */ /* above. */ int Chipset; Index: hw/xfree86/drivers/s3virge/s3v_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c,v retrieving revision 1.10 diff -u -r1.10 s3v_driver.c --- hw/xfree86/drivers/s3virge/s3v_driver.c 11 Jul 2005 02:29:59 -0000 1.10 +++ hw/xfree86/drivers/s3virge/s3v_driver.c 7 Aug 2005 04:22:10 -0000 @@ -418,7 +418,7 @@ #endif /* XFree86LOADER */ -static unsigned char *find_bios_string(PCITAG Tag, int BIOSbase, char *match1, char *match2) +static unsigned char *find_bios_string(PciBusId *pciid, int BIOSbase, char *match1, char *match2) { #define BIOS_BSIZE 1024 #define BIOS_BASE 0xc0000 @@ -429,7 +429,7 @@ if (!init) { init = 1; - if (xf86ReadDomainMemory(Tag, BIOSbase, BIOS_BSIZE, bios) != BIOS_BSIZE) + if (xf86ReadDomainMemory(pciid, BIOSbase, BIOS_BSIZE, bios) != BIOS_BSIZE) return NULL; if ((bios[0] != 0x55) || (bios[1] != 0xaa)) return NULL; @@ -975,9 +975,6 @@ xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", pScrn->chipset); - ps3v->PciTag = pciTag(ps3v->PciInfo->bus, ps3v->PciInfo->device, - ps3v->PciInfo->func); - /* Handle XVideo after we know chipset, so we can give an */ /* intelligent comment about support */ if (xf86IsOptionSet(ps3v->Options, OPTION_XVIDEO)) @@ -1166,7 +1163,7 @@ usleep(10000); /* wait a little bit... */ } - if (find_bios_string(ps3v->PciTag, BIOS_BASE, "S3 86C325", + if (find_bios_string(&ps3v->PciInfo->pciid, BIOS_BASE, "S3 86C325", "MELCO WGP-VG VIDEO BIOS") != NULL) { if (xf86GetVerbosity()) xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "MELCO BIOS found\n"); @@ -1276,12 +1273,12 @@ * Toshiba Tecra 5x0/7x0 seems to use 28.636 MHz * Compaq Armada 7x00 uses 14.318 MHz */ - if (find_bios_string(ps3v->PciTag, BIOS_BASE, "COMPAQ M5 BIOS", NULL) != NULL) { + if (find_bios_string(&ps3v->PciInfo->pciid, BIOS_BASE, "COMPAQ M5 BIOS", NULL) != NULL) { if (xf86GetVerbosity()) xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "COMPAQ M5 BIOS found\n"); /* ps3v->refclk_fact = 1.0; */ } - else if (find_bios_string(ps3v->PciTag, BIOS_BASE, "TOSHIBA Video BIOS", NULL) != NULL) { + else if (find_bios_string(&ps3v->PciInfo->pciid, BIOS_BASE, "TOSHIBA Video BIOS", NULL) != NULL) { if (xf86GetVerbosity()) xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "TOSHIBA Video BIOS found\n"); /* ps3v->refclk_fact = 2.0; */ @@ -2359,13 +2356,13 @@ /* so that we can use registers map */ /* structure - see newmmio.h */ /* around 0x10000 from MemBase */ - ps3v->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, ps3v->PciTag, + ps3v->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, &ps3v->PciInfo->pciid, ps3v->PciInfo->memBase[0] + S3_NEWMMIO_REGBASE, S3_NEWMMIO_REGSIZE); ps3v->MapBaseDense = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO_32BIT, - ps3v->PciTag, + &ps3v->PciInfo->pciid, ps3v->PciInfo->memBase[0] + S3_NEWMMIO_REGBASE, 0x8000); @@ -2377,7 +2374,7 @@ /* Map the framebuffer */ if (ps3v->videoRambytes) { /* not set in PreInit() */ ps3v->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - ps3v->PciTag, ps3v->PciInfo->memBase[0], + &ps3v->PciInfo->pciid, ps3v->PciInfo->memBase[0], ps3v->videoRambytes ); if( !ps3v->FBBase ) { Index: hw/xfree86/drivers/savage/savage_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c,v retrieving revision 1.37 diff -u -r1.37 savage_driver.c --- hw/xfree86/drivers/savage/savage_driver.c 11 Jul 2005 02:29:59 -0000 1.37 +++ hw/xfree86/drivers/savage/savage_driver.c 7 Aug 2005 04:22:13 -0000 @@ -1329,10 +1329,6 @@ xfree(pEnt); - psav->PciTag = pciTag(psav->PciInfo->bus, psav->PciInfo->device, - psav->PciInfo->func); - - /* Set AGP Mode from config */ /* We support 1X 2X and 4X */ #ifdef XF86DRI @@ -2780,7 +2776,8 @@ "mapping MMIO @ 0x%lx with size 0x%x\n", psav->MmioBase, SAVAGE_NEWMMIO_REGSIZE); - psav->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, psav->PciTag, + psav->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, + &psav->PciInfo->pciid, psav->MmioBase, SAVAGE_NEWMMIO_REGSIZE); #if 0 @@ -2816,7 +2813,7 @@ if (psav->videoRambytes) { psav->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - psav->PciTag, psav->FrameBufferBase, + &psav->PciInfo->pciid, psav->FrameBufferBase, psav->videoRambytes); if (!psav->FBBase) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -2837,16 +2834,16 @@ if (psav->IsSecondary) { psav->ApertureMap = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - psav->PciTag, psav->ApertureBase, + &psav->PciInfo->pciid, psav->ApertureBase, 0x01000000 * 2); psav->ApertureMap += 0x1000000; } else if (psav->IsPrimary) { psav->ApertureMap = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - psav->PciTag, psav->ApertureBase, + &psav->PciInfo->pciid, psav->ApertureBase, 0x01000000 * 2); } else { psav->ApertureMap = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - psav->PciTag, psav->ApertureBase, + &psav->PciInfo->pciid, psav->ApertureBase, 0x01000000 * 5); } Index: hw/xfree86/drivers/savage/savage_driver.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h,v retrieving revision 1.18 diff -u -r1.18 savage_driver.h --- hw/xfree86/drivers/savage/savage_driver.h 13 Mar 2005 00:14:02 -0000 1.18 +++ hw/xfree86/drivers/savage/savage_driver.h 7 Aug 2005 04:22:15 -0000 @@ -324,7 +324,6 @@ CloseScreenProcPtr CloseScreen; pciVideoPtr PciInfo; - PCITAG PciTag; int Chipset; int ChipId; int ChipRev; Index: hw/xfree86/drivers/siliconmotion/smi.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h,v retrieving revision 1.5 diff -u -r1.5 smi.h --- hw/xfree86/drivers/siliconmotion/smi.h 20 Apr 2005 12:25:29 -0000 1.5 +++ hw/xfree86/drivers/siliconmotion/smi.h 7 Aug 2005 04:22:15 -0000 @@ -177,7 +177,6 @@ CloseScreen function */ XAAInfoRecPtr AccelInfoRec; /* XAA info Rec */ pciVideoPtr PciInfo; /* PCI info vars */ - PCITAG PciTag; int Chipset; /* Chip info, set using PCI above */ int ChipRev; Index: hw/xfree86/drivers/siliconmotion/smi_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c,v retrieving revision 1.11 diff -u -r1.11 smi_driver.c --- hw/xfree86/drivers/siliconmotion/smi_driver.c 11 Jul 2005 02:29:59 -0000 1.11 +++ hw/xfree86/drivers/siliconmotion/smi_driver.c 7 Aug 2005 04:22:17 -0000 @@ -924,9 +924,6 @@ xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", pScrn->chipset); - pSmi->PciTag = pciTag(pSmi->PciInfo->bus, pSmi->PciInfo->device, - pSmi->PciInfo->func); - SMI_MapMem(pScrn); SMI_DisableVideo(pScrn); @@ -1749,7 +1746,7 @@ pSmi->MapSize = 0x200000; break; } - pSmi->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pSmi->PciTag, + pSmi->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, &pSmi->PciInfo->pciid, memBase, pSmi->MapSize); if (pSmi->MapBase == NULL) @@ -1832,7 +1829,7 @@ if (pSmi->videoRAMBytes) { pSmi->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pSmi->PciTag, + &pSmi->PciInfo->pciid, pScrn->memPhysBase + pSmi->fbMapOffset, pSmi->videoRAMBytes); Index: hw/xfree86/drivers/sis/sis.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h,v retrieving revision 1.48 diff -u -r1.48 sis.h --- hw/xfree86/drivers/sis/sis.h 15 Jul 2005 15:35:18 -0000 1.48 +++ hw/xfree86/drivers/sis/sis.h 7 Aug 2005 04:22:19 -0000 @@ -867,7 +867,6 @@ typedef struct { ScrnInfoPtr pScrn; pciVideoPtr PciInfo; - PCITAG PciTag; EntityInfoPtr pEnt; int Chipset; unsigned char ChipType; Index: hw/xfree86/drivers/sis/sis_dri.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c,v retrieving revision 1.22 diff -u -r1.22 sis_dri.c --- hw/xfree86/drivers/sis/sis_dri.c 11 Jul 2005 02:29:59 -0000 1.22 +++ hw/xfree86/drivers/sis/sis_dri.c 7 Aug 2005 04:22:19 -0000 @@ -320,9 +320,9 @@ #endif pDRIInfo->busIdString = xalloc(64); sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", - ((pciConfigPtr)pSIS->PciInfo->thisCard)->busnum, - ((pciConfigPtr)pSIS->PciInfo->thisCard)->devnum, - ((pciConfigPtr)pSIS->PciInfo->thisCard)->funcnum); + ((pciConfigPtr)pSIS->PciInfo->thisCard)->pciid.bus, + ((pciConfigPtr)pSIS->PciInfo->thisCard)->pciid.device, + ((pciConfigPtr)pSIS->PciInfo->thisCard)->pciid.func); #ifdef SISHAVECREATEBUSID } #endif @@ -630,16 +630,16 @@ /* Eventually grab and enable IRQ */ pSIS->irqEnabled = FALSE; pSIS->irq = drmGetInterruptFromBusID(pSIS->drmSubFD, - ((pciConfigPtr)pSIS->PciInfo->thisCard)->busnum, - ((pciConfigPtr)pSIS->PciInfo->thisCard)->devnum, - ((pciConfigPtr)pSIS->PciInfo->thisCard)->funcnum); + ((pciConfigPtr)pSIS->PciInfo->thisCard)->pciid.bus, + ((pciConfigPtr)pSIS->PciInfo->thisCard)->pciid.device, + ((pciConfigPtr)pSIS->PciInfo->thisCard)->pciid.func); if(pSIS->irq < 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] No valid IRQ number for device %d:%d:%d (code %d)\n", - ((pciConfigPtr)pSIS->PciInfo->thisCard)->busnum, - ((pciConfigPtr)pSIS->PciInfo->thisCard)->devnum, - ((pciConfigPtr)pSIS->PciInfo->thisCard)->funcnum, + ((pciConfigPtr)pSIS->PciInfo->thisCard)->pciid.bus, + ((pciConfigPtr)pSIS->PciInfo->thisCard)->pciid.device, + ((pciConfigPtr)pSIS->PciInfo->thisCard)->pciid.func, pSIS->irq); } else if((drmCtlInstHandler(pSIS->drmSubFD, pSIS->irq)) != 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, Index: hw/xfree86/drivers/sis/sis_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c,v retrieving revision 1.56 diff -u -r1.56 sis_driver.c --- hw/xfree86/drivers/sis/sis_driver.c 13 Jul 2005 17:17:00 -0000 1.56 +++ hw/xfree86/drivers/sis/sis_driver.c 7 Aug 2005 04:22:31 -0000 @@ -3061,7 +3061,6 @@ /* Find the PCI info for this screen */ pSiS->PciInfo = xf86GetPciInfoForEntity(pSiS->pEnt->index); - pSiS->PciTag = pciTag(pSiS->PciInfo->bus, pSiS->PciInfo->device, pSiS->PciInfo->func); /* Determine whether this is primary or secondary display adapter */ pSiS->Primary = xf86IsPrimaryPci(pSiS->PciInfo); @@ -3522,9 +3521,9 @@ /* Added PCI bus/slot/func into in sisfb Version 1.5.08. * Check this to make sure we run on the same card as sisfb */ - if((mysisfbinfo->sisfb_pcibus == pSiS->PciInfo->bus) && - (mysisfbinfo->sisfb_pcislot == pSiS->PciInfo->device) && - (mysisfbinfo->sisfb_pcifunc == pSiS->PciInfo->func) ) { + if((mysisfbinfo->sisfb_pcibus == pSiS->PciInfo->pciid.bus) && + (mysisfbinfo->sisfb_pcislot == pSiS->PciInfo->pciid.device) && + (mysisfbinfo->sisfb_pcifunc == pSiS->PciInfo->pciid.func) ) { pSiS->sisfbfound = TRUE; } } else pSiS->sisfbfound = TRUE; @@ -3536,9 +3535,9 @@ mysisfbinfo->sisfb_version, mysisfbinfo->sisfb_revision, mysisfbinfo->sisfb_patchlevel, - pSiS->PciInfo->bus, - pSiS->PciInfo->device, - pSiS->PciInfo->func); + pSiS->PciInfo->pciid.bus, + pSiS->PciInfo->pciid.device, + pSiS->PciInfo->pciid.func); /* Added version/rev/pl in sisfb 1.4.0 */ if(mysisfbinfo->sisfb_version == 0) { @@ -3756,7 +3755,6 @@ if(pSiSEnt) pSiSEnt->SiS_Pr = pSiS->SiS_Pr; #endif memset(pSiS->SiS_Pr, 0, sizeof(struct SiS_Private)); - pSiS->SiS_Pr->PciTag = pSiS->PciTag; pSiS->SiS_Pr->ChipType = pSiS->ChipType; pSiS->SiS_Pr->ChipRevision = pSiS->ChipRev; pSiS->SiS_Pr->SiS_Backup70xx = 0xff; @@ -4032,7 +4030,7 @@ } if(readpci) { - xf86ReadPciBIOS(0, pSiS->PciTag, 0, pSiS->BIOS, BIOS_SIZE); + xf86ReadPciBIOS(0, &pSiS->PciInfo->pciid, 0, pSiS->BIOS, BIOS_SIZE); if(SISCheckBIOS(pSiS, mypciid, mypcivendor)) { found = TRUE; } @@ -4044,7 +4042,7 @@ #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) if(xf86ReadBIOS(segstart, 0, pSiS->BIOS, BIOS_SIZE) != BIOS_SIZE) continue; #else - if(xf86ReadDomainMemory(pSiS->PciTag, segstart, BIOS_SIZE, pSiS->BIOS) != BIOS_SIZE) continue; + if(xf86ReadDomainMemory(&pSiS->PciInfo->pciid, segstart, BIOS_SIZE, pSiS->BIOS) != BIOS_SIZE) continue; #endif if(!SISCheckBIOS(pSiS, mypciid, mypcivendor)) continue; @@ -6914,13 +6912,13 @@ if(!(pSiSEnt->IOPBase)) { /* Only map if not mapped previously */ pSiSEnt->IOPBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - pSiS->PciTag, pSiS->IOPAddress, 128); + &pSiS->PciInfo->pciid, pSiS->IOPAddress, 128); } pSiS->IOPBase = pSiSEnt->IOPBase; } else #endif pSiS->IOPBase = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, - pSiS->PciTag, pSiS->IOPAddress, 128); + &pSiS->PciInfo->pciid, pSiS->IOPAddress, 128); if(pSiS->IOPBase == NULL) { SISErrorLog(pScrn, "Could not map I/O port area\n"); @@ -6992,13 +6990,13 @@ if(!(pSiSEnt->IOBase)) { /* Only map if not mapped previously */ pSiSEnt->IOBase = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, - pSiS->PciTag, pSiS->IOAddress, (pSiS->mmioSize * 1024)); + &pSiS->PciInfo->pciid, pSiS->IOAddress, (pSiS->mmioSize * 1024)); } pSiS->IOBase = pSiSEnt->IOBase; } else #endif pSiS->IOBase = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, - pSiS->PciTag, pSiS->IOAddress, (pSiS->mmioSize * 1024)); + &pSiS->PciInfo->pciid, pSiS->IOAddress, (pSiS->mmioSize * 1024)); if(pSiS->IOBase == NULL) { SISErrorLog(pScrn, "Could not map MMIO area\n"); @@ -7016,13 +7014,13 @@ if(!(pSiSEnt->IOBaseDense)) { /* Only map if not mapped previously */ pSiSEnt->IOBaseDense = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - pSiS->PciTag, pSiS->IOAddress, (pSiS->mmioSize * 1024)); + &pSiS->PciInfo->pciid, pSiS->IOAddress, (pSiS->mmioSize * 1024)); } pSiS->IOBaseDense = pSiSEnt->IOBaseDense; } else #endif pSiS->IOBaseDense = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - pSiS->PciTag, pSiS->IOAddress, (pSiS->mmioSize * 1024)); + &pSiS->PciInfo->pciid, pSiS->IOAddress, (pSiS->mmioSize * 1024)); if(pSiS->IOBaseDense == NULL) { SISErrorLog(pScrn, "Could not map MMIO dense area\n"); @@ -7037,7 +7035,7 @@ /* Only map if not mapped previously */ pSiSEnt->FbBase = pSiSEnt->RealFbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pSiS->PciTag, (ULong)pSiS->realFbAddress, + &pSiS->PciInfo->pciid, (ULong)pSiS->realFbAddress, pSiS->FbMapSize); } pSiS->FbBase = pSiS->RealFbBase = pSiSEnt->FbBase; @@ -7047,7 +7045,7 @@ #endif pSiS->FbBase = pSiS->RealFbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pSiS->PciTag, (ULong)pSiS->realFbAddress, + &pSiS->PciInfo->pciid, (ULong)pSiS->realFbAddress, pSiS->FbMapSize); pSiS->FbBase += pSiS->dhmOffset; #ifdef SISDUALHEAD Index: hw/xfree86/drivers/sis/sis_utility.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_utility.c,v retrieving revision 1.9 diff -u -r1.9 sis_utility.c --- hw/xfree86/drivers/sis/sis_utility.c 11 Jul 2005 02:29:59 -0000 1.9 +++ hw/xfree86/drivers/sis/sis_utility.c 7 Aug 2005 04:22:32 -0000 @@ -885,9 +885,9 @@ } sdcbuf->sdc_result[0] = pSiS->IsAGPCard ? SDC_BUS_TYPE_AGP : SDC_BUS_TYPE_PCI; if(pSiS->IsPCIExpress) sdcbuf->sdc_result[0] = SDC_BUS_TYPE_PCIE; - sdcbuf->sdc_result[1] = pSiS->PciInfo->bus; - sdcbuf->sdc_result[2] = pSiS->PciInfo->device; - sdcbuf->sdc_result[3] = pSiS->PciInfo->func; + sdcbuf->sdc_result[1] = pSiS->PciInfo->pciid.bus; + sdcbuf->sdc_result[2] = pSiS->PciInfo->pciid.device; + sdcbuf->sdc_result[3] = pSiS->PciInfo->pciid.func; sdcbuf->sdc_result[4] = pSiS->ROM661New ? 1 : (pSiS->HaveXGIBIOS ? 2 : 0), sdcbuf->sdc_result[5] = pSiS->ChipFlags; sdcbuf->sdc_result[6] = pSiS->ChipType; Index: hw/xfree86/drivers/sis/sis_vga.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vga.c,v retrieving revision 1.19 diff -u -r1.19 sis_vga.c --- hw/xfree86/drivers/sis/sis_vga.c 13 Jul 2005 17:17:00 -0000 1.19 +++ hw/xfree86/drivers/sis/sis_vga.c 7 Aug 2005 04:22:35 -0000 @@ -1732,7 +1732,7 @@ #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,0,0,0) pSiS->VGAMemBase = xf86MapDomainMemory(pScrn->scrnIndex, VIDMEM_MMIO_32BIT, - pSiS->PciTag, pSiS->VGAMapPhys, pSiS->VGAMapSize); + &pSiS->PciInfo->pciid, pSiS->VGAMapPhys, pSiS->VGAMapSize); #else pSiS->VGAMemBase = xf86MapVidMem(pScrn->scrnIndex, VIDMEM_MMIO_32BIT, pSiS->VGAMapPhys, pSiS->VGAMapSize); Index: hw/xfree86/drivers/sis/vstruct.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/sis/vstruct.h,v retrieving revision 1.18 diff -u -r1.18 vstruct.h --- hw/xfree86/drivers/sis/vstruct.h 13 Jul 2005 17:17:00 -0000 1.18 +++ hw/xfree86/drivers/sis/vstruct.h 7 Aug 2005 04:22:35 -0000 @@ -233,7 +233,7 @@ { unsigned char ChipType; unsigned char ChipRevision; -#ifdef SIS_XORG_XF86 +#if 0 PCITAG PciTag; #endif #ifdef SIS_LINUX_KERNEL Index: hw/xfree86/drivers/tdfx/tdfx.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h,v retrieving revision 1.2 diff -u -r1.2 tdfx.h --- hw/xfree86/drivers/tdfx/tdfx.h 23 Apr 2004 19:49:53 -0000 1.2 +++ hw/xfree86/drivers/tdfx/tdfx.h 7 Aug 2005 04:22:35 -0000 @@ -146,12 +146,11 @@ int maxClip; int MaxClock; int ChipType; - pciVideoPtr PciInfo; + pciVideoPtr PciInfo[MAXCHIPS]; unsigned long LinearAddr[MAXCHIPS]; unsigned long MMIOAddr[MAXCHIPS]; EntityInfoPtr pEnt; int numChips; - PCITAG PciTag[MAXCHIPS]; Bool Primary; int HasSGRAM; int PciCnt; Index: hw/xfree86/drivers/tdfx/tdfx_dri.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c,v retrieving revision 1.5 diff -u -r1.5 tdfx_dri.c --- hw/xfree86/drivers/tdfx/tdfx_dri.c 11 Jul 2005 02:30:02 -0000 1.5 +++ hw/xfree86/drivers/tdfx/tdfx_dri.c 7 Aug 2005 04:22:35 -0000 @@ -336,13 +336,13 @@ pDRIInfo->drmDriverName = TDFXKernelDriverName; pDRIInfo->clientDriverName = TDFXClientDriverName; if (xf86LoaderCheckSymbol("DRICreatePCIBusID")) { - pDRIInfo->busIdString = DRICreatePCIBusID(pTDFX->PciInfo); + pDRIInfo->busIdString = DRICreatePCIBusID(pTDFX->PciInfo[0]); } else { pDRIInfo->busIdString = xalloc(64); sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", - ((pciConfigPtr)pTDFX->PciInfo->thisCard)->busnum, - ((pciConfigPtr)pTDFX->PciInfo->thisCard)->devnum, - ((pciConfigPtr)pTDFX->PciInfo->thisCard)->funcnum); + ((pciConfigPtr)pTDFX->PciInfo[0]->thisCard)->pciid.bus, + ((pciConfigPtr)pTDFX->PciInfo[0]->thisCard)->pciid.device, + ((pciConfigPtr)pTDFX->PciInfo[0]->thisCard)->pciid.func); } pDRIInfo->ddxDriverMajorVersion = TDFX_MAJOR_VERSION; pDRIInfo->ddxDriverMinorVersion = TDFX_MINOR_VERSION; @@ -502,7 +502,7 @@ pTDFX->pDRIInfo->driverSwapMethod = DRI_HIDE_X_CONTEXT; pTDFXDRI=(TDFXDRIPtr)pTDFX->pDRIInfo->devPrivate; - pTDFXDRI->deviceID=pTDFX->PciInfo->chipType; + pTDFXDRI->deviceID=pTDFX->PciInfo[0]->chipType; pTDFXDRI->width=pScrn->virtualX; pTDFXDRI->height=pScrn->virtualY; pTDFXDRI->mem=pScrn->videoRam*1024; Index: hw/xfree86/drivers/tdfx/tdfx_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c,v retrieving revision 1.6 diff -u -r1.6 tdfx_driver.c --- hw/xfree86/drivers/tdfx/tdfx_driver.c 11 Jul 2005 02:30:02 -0000 1.6 +++ hw/xfree86/drivers/tdfx/tdfx_driver.c 7 Aug 2005 04:22:37 -0000 @@ -585,11 +585,9 @@ pTDFX->numChips=0; pTDFX->ChipType=match->chipType; for (ppPci = xf86GetPciVideoInfo(); *ppPci != NULL; ppPci++) { - if ((*ppPci)->bus == match->bus && - (*ppPci)->device == match->device) { - pTDFX->PciTag[pTDFX->numChips] = pciTag((*ppPci)->bus, - (*ppPci)->device, - (*ppPci)->func); + if ((*ppPci)->pciid.bus == match->pciid.bus && + (*ppPci)->pciid.device == match->pciid.device) { + pTDFX->PciInfo[pTDFX->numChips]->pciid = (*ppPci)->pciid; pTDFX->PIOBase[pTDFX->numChips] = pScrn->domainIOBase + ((*ppPci)->ioBase[2] & 0xFFFFFFFCU); pTDFX->numChips++; @@ -613,10 +611,10 @@ unsigned long mem0base, mem1base, mem0size, mem0bits, mem1size, mem1bits; pTDFX=TDFXPTR(pScrn); - cfgbits=pciReadLong(pTDFX->PciTag[0], CFG_PCI_DECODE); - mem0base=pciReadLong(pTDFX->PciTag[0], CFG_MEM0BASE); - mem1base=pciReadLong(pTDFX->PciTag[0], CFG_MEM1BASE); - initbits=pciReadLong(pTDFX->PciTag[0], CFG_INIT_ENABLE); + cfgbits=pciReadLong(&pTDFX->PciInfo[0]->pciid, CFG_PCI_DECODE); + mem0base=pciReadLong(&pTDFX->PciInfo[0]->pciid, CFG_MEM0BASE); + mem1base=pciReadLong(&pTDFX->PciInfo[0]->pciid, CFG_MEM1BASE); + initbits=pciReadLong(&pTDFX->PciInfo[0]->pciid, CFG_INIT_ENABLE); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "TDFXInitChips: numchips = %d\n", pTDFX->numChips); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, @@ -640,29 +638,29 @@ "TDFXInitChips: cfgbits = 0x%08lx\n", cfgbits); for (i=0; inumChips; i++) { initbits|=BIT(10); - pciWriteLong(pTDFX->PciTag[i], CFG_INIT_ENABLE, initbits); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_INIT_ENABLE, initbits); #if 0 - v=pciReadWord(pTDFX->PciTag[i], CFG_PCI_COMMAND); + v=pciReadWord(&pTDFX->PciInfo[i]->pciid, CFG_PCI_COMMAND); if (!i) - pciWriteWord(pTDFX->PciTag[i], CFG_PCI_COMMAND, v|0x3); + pciWriteWord(&pTDFX->PciInfo[i]->pciid, CFG_PCI_COMMAND, v|0x3); else - pciWriteWord(pTDFX->PciTag[i], CFG_PCI_COMMAND, v|0x2); + pciWriteWord(&pTDFX->PciInfo[i]->pciid, CFG_PCI_COMMAND, v|0x2); #endif pTDFX->MMIOAddr[i]=mem0base+i*mem0size; xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "TDFXInitChips: MMIOAddr[%d] = 0x%08lx\n", i, pTDFX->MMIOAddr[i]); - pciWriteLong(pTDFX->PciTag[i], CFG_MEM0BASE, pTDFX->MMIOAddr[i]); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_MEM0BASE, pTDFX->MMIOAddr[i]); pTDFX->MMIOAddr[i]&=0xFFFFFF00; pTDFX->LinearAddr[i]=mem1base+i*mem1size; - pciWriteLong(pTDFX->PciTag[i], CFG_MEM1BASE, pTDFX->LinearAddr[i]); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_MEM1BASE, pTDFX->LinearAddr[i]); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "TDFXInitChips: LinearAddr[%d] = 0x%08lx\n", i, pTDFX->LinearAddr[i]); pTDFX->LinearAddr[i]&=0xFFFFFF00; - pciWriteLong(pTDFX->PciTag[i], CFG_PCI_DECODE, cfgbits); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_PCI_DECODE, cfgbits); initbits&=~BIT(10); - pciWriteLong(pTDFX->PciTag[i], CFG_INIT_ENABLE, initbits); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_INIT_ENABLE, initbits); } } @@ -741,9 +739,9 @@ #endif #endif - match=pTDFX->PciInfo=xf86GetPciInfoForEntity(pTDFX->pEnt->index); + match=pTDFX->PciInfo[0]=xf86GetPciInfoForEntity(pTDFX->pEnt->index); TDFXFindChips(pScrn, match); - pTDFX->Primary = xf86IsPrimaryPci(pTDFX->PciInfo); + pTDFX->Primary = xf86IsPrimaryPci(pTDFX->PciInfo[0]); if (xf86RegisterResources(pTDFX->pEnt->index, NULL, ResExclusive)) { TDFXFreeRec(pScrn); @@ -1127,7 +1125,7 @@ for (i=0; inumChips; i++) { pTDFX->MMIOBase[i] = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, - pTDFX->PciTag[i], + &pTDFX->PciInfo[i]->pciid, pTDFX->MMIOAddr[i], TDFXIOMAPSIZE); @@ -1135,7 +1133,7 @@ } pTDFX->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pTDFX->PciTag[0], + &pTDFX->PciInfo[0]->pciid, pTDFX->LinearAddr[0], pTDFX->FbMapSize); if (!pTDFX->FbBase) return FALSE; @@ -1522,7 +1520,7 @@ if (!bios) return FALSE; - if (!xf86ReadPciBIOS(0, pTDFX->PciTag[0], 1, bios, T_B_SIZE)) { + if (!xf86ReadPciBIOS(0, &pTDFX->PciInfo[0]->pciid, 1, bios, T_B_SIZE)) { #if 0 xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Bad BIOS read.\n"); xfree(bios); Index: hw/xfree86/drivers/tdfx/tdfx_sli.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_sli.c,v retrieving revision 1.3 diff -u -r1.3 tdfx_sli.c --- hw/xfree86/drivers/tdfx/tdfx_sli.c 11 Jul 2005 02:30:02 -0000 1.3 +++ hw/xfree86/drivers/tdfx/tdfx_sli.c 7 Aug 2005 04:22:39 -0000 @@ -22,33 +22,33 @@ int v; for (i=0; inumChips; i++) { - v=pciReadLong(pTDFX->PciTag[i], CFG_INIT_ENABLE); - pciWriteLong(pTDFX->PciTag[i], CFG_INIT_ENABLE, + v=pciReadLong(&pTDFX->PciInfo[i]->pciid, CFG_INIT_ENABLE); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_INIT_ENABLE, v&~(CFG_SNOOP_MEMBASE0 | CFG_SNOOP_EN | CFG_SNOOP_MEMBASE0_EN | CFG_SNOOP_MEMBASE1_EN | CFG_SNOOP_SLAVE | CFG_SNOOP_FBIINIT_WR_EN | CFG_SWAP_ALGORITHM | CFG_SWAP_QUICK)); - v=pciReadLong(pTDFX->PciTag[i], CFG_SLI_LFB_CTRL); - pciWriteLong(pTDFX->PciTag[i], CFG_SLI_LFB_CTRL, + v=pciReadLong(&pTDFX->PciInfo[i]->pciid, CFG_SLI_LFB_CTRL); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_SLI_LFB_CTRL, v&~(CFG_SLI_LFB_CPU_WR_EN | CFG_SLI_LFB_DPTCH_WR_EN | CFG_SLI_RD_EN)); #ifdef H3VDD pTDFX->writeChipLong(pTDFX, i, SST_3D_SLICTRL, 0); pTDFX->writeChipLong(pTDFX, i, SST_3D_AACTRL, 0); #endif - v=pciReadLong(pTDFX->PciTag[i], CFG_AA_LFB_CTRL); - pciWriteLong(pTDFX->PciTag[i], CFG_AA_LFB_CTRL, + v=pciReadLong(&pTDFX->PciInfo[i]->pciid, CFG_AA_LFB_CTRL); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_AA_LFB_CTRL, v&~(CFG_AA_LFB_CPU_WR_EN | CFG_AA_LFB_DPTCH_WR_EN | CFG_AA_LFB_RD_EN)); - v=pciReadLong(pTDFX->PciTag[i], CFG_SLI_AA_MISC); - pciWriteLong(pTDFX->PciTag[i], CFG_SLI_AA_MISC, + v=pciReadLong(&pTDFX->PciInfo[i]->pciid, CFG_SLI_AA_MISC); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_SLI_AA_MISC, (v&~CFG_VGA_VSYNC_OFFSET) | (0 << CFG_VGA_VSYNC_OFFSET_PIXELS_SHIFT) | (0 << CFG_VGA_VSYNC_OFFSET_CHARS_SHIFT) | (0 << CFG_VGA_VSYNC_OFFSET_HXTRA_SHIFT)); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, 0); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, 0); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL2, 0); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, 0); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, 0); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, 0); if (pTDFX->numChips>1) { v=pTDFX->readChipLong(pTDFX, i, PCIINIT0); @@ -149,27 +149,27 @@ SST_AA_CLK_INVERT); if (pTDFX->numChips>1) { - v=pciReadLong(pTDFX->PciTag[i], CFG_INIT_ENABLE); - pciWriteLong(pTDFX->PciTag[i], CFG_INIT_ENABLE, v | + v=pciReadLong(&pTDFX->PciInfo[i]->pciid, CFG_INIT_ENABLE); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_INIT_ENABLE, v | (CFGSWAPALGORITHM << CFG_SWAPBUFFER_ALGORITHM_SHIFT) | CFG_SWAP_ALGORITHM | ((!i)? CFG_SWAP_MASTER : 0)); if (!i) { - v=pciReadLong(pTDFX->PciTag[i], CFG_INIT_ENABLE); - pciWriteLong(pTDFX->PciTag[i], CFG_INIT_ENABLE, + v=pciReadLong(&pTDFX->PciInfo[i]->pciid, CFG_INIT_ENABLE); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_INIT_ENABLE, v | CFG_SNOOP_EN); - v=pciReadLong(pTDFX->PciTag[i], CFG_PCI_DECODE); + v=pciReadLong(&pTDFX->PciInfo[i]->pciid, CFG_PCI_DECODE); } else { - v=pciReadLong(pTDFX->PciTag[i], CFG_INIT_ENABLE); + v=pciReadLong(&pTDFX->PciInfo[i]->pciid, CFG_INIT_ENABLE); v=(v & ~CFG_SNOOP_MEMBASE0) | CFG_SNOOP_EN | CFG_SNOOP_MEMBASE0_EN | CFG_SNOOP_MEMBASE1_EN | CFG_SNOOP_SLAVE | CFG_SNOOP_FBIINIT_WR_EN | (((pTDFX->MMIOAddr[0]>>22)&0x3ff)<numChips>2)? CFG_SWAP_QUICK : 0); - pciWriteLong(pTDFX->PciTag[i], CFG_INIT_ENABLE, v); - v=pciReadLong(pTDFX->PciTag[i], CFG_PCI_DECODE); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_INIT_ENABLE, v); + v=pciReadLong(&pTDFX->PciInfo[i]->pciid, CFG_PCI_DECODE); v=(v & ~CFG_SNOOP_MEMBASE1) | ((pTDFX->LinearAddr[0]>>22)&0x3ff)<PciTag[i], CFG_PCI_DECODE, v); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_PCI_DECODE, v); } } @@ -186,7 +186,7 @@ #ifndef RD_ABORT_ERROR v|=CFG_SLI_RD_EN; #endif - pciWriteLong(pTDFX->PciTag[i], CFG_SLI_LFB_CTRL, v); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_SLI_LFB_CTRL, v); #ifdef H3VDD pTDFX->writeChipLong(pTDFX, i, SST_3D_SLICTRL, @@ -201,7 +201,7 @@ sli_renderMask = 0; sli_compareMask = 0; sli_scanMask = 0; - pciWriteLong(pTDFX->PciTag[i], CFG_SLI_LFB_CTRL, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_SLI_LFB_CTRL, (sli_renderMask << CFG_SLI_LFB_RENDERMASK_SHIFT) | (sli_compareMask << CFG_SLI_LFB_COMPAREMASK_SHIFT) | (sli_scanMask << CFG_SLI_LFB_SCANMASK_SHIFT) | @@ -226,7 +226,7 @@ #ifndef RD_ABORT_ERROR v|=CFG_SLI_RD_EN; #endif - pciWriteLong(pTDFX->PciTag[i], CFG_SLI_LFB_CTRL, v); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_SLI_LFB_CTRL, v); #ifdef H3VDD pTDFX->writeChipLong(pTDFX, i, SST_3D_SLICTRL, (sli_renderMask << SLICTL_3D_RENDERMASK_SHIFT) | @@ -266,8 +266,8 @@ vsyncOffsetChars=5; vsyncOffsetHXtra=0; } - v=pciReadLong(pTDFX->PciTag[i], CFG_SLI_AA_MISC); - pciWriteLong(pTDFX->PciTag[i], CFG_SLI_AA_MISC, + v=pciReadLong(&pTDFX->PciInfo[i]->pciid, CFG_SLI_AA_MISC); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_SLI_AA_MISC, (v&~CFG_VGA_VSYNC_OFFSET) | (vsyncOffsetPixels << CFG_VGA_VSYNC_OFFSET_PIXELS_SHIFT) | (vsyncOffsetChars << CFG_VGA_VSYNC_OFFSET_CHARS_SHIFT) | @@ -276,65 +276,65 @@ } if (pTDFX->numChips==1 && aaSamples) { /* 1 chip 2 AA */ - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | CFG_VIDEO_OTHERMUX_SEL_PIPE<PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, 0x0 << CFG_SLI_RENDERMASK_FETCH_SHIFT | 0x0 << CFG_SLI_COMPAREMASK_FETCH_SHIFT | 0x0 << CFG_SLI_RENDERMASK_CRT_SHIFT | 0x0 << CFG_SLI_COMPAREMASK_CRT_SHIFT); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, 0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT | 0xff << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT); } else if (pTDFX->numChips==2 && !sliEnable && aaSamples==4 && !sliAnalog) { /* 2 chips 4 digital AA */ if (!i) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | (CFG_VIDEO_OTHERMUX_SEL_PIPE_PLUS_AAFIFO << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | CFG_DIVIDE_VIDEO_BY_4); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (0x0 << CFG_SLI_RENDERMASK_FETCH_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_FETCH_SHIFT) | (0x0 << CFG_SLI_RENDERMASK_CRT_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_CRT_SHIFT)); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } else { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, (CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | CFG_DIVIDE_VIDEO_BY_1)); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (0x0 << CFG_SLI_RENDERMASK_FETCH_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_FETCH_SHIFT) | (0x0 << CFG_SLI_RENDERMASK_CRT_SHIFT) | (0xff << CFG_SLI_COMPAREMASK_CRT_SHIFT)); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } } else if (pTDFX->numChips==2 && !sliEnable && aaSamples==4 && sliAnalog) { /* 2 chips 4 analog AA */ if (!i) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, (CFG_ENHANCED_VIDEO_EN | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | CFG_DIVIDE_VIDEO_BY_4)); } else { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | CFG_DAC_HSYNC_TRISTATE | @@ -342,35 +342,35 @@ (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | CFG_DIVIDE_VIDEO_BY_4); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (0x0 << CFG_SLI_RENDERMASK_FETCH_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_FETCH_SHIFT) | (0x0 << CFG_SLI_RENDERMASK_CRT_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_CRT_SHIFT)); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } } else if (pTDFX->numChips==2 && sliEnable && !aaSamples && !sliAnalog) { /* 2 chips 2 digital SLI */ if (!i) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, (CFG_ENHANCED_VIDEO_EN | (CFG_VIDEO_OTHERMUX_SEL_AAFIFO << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT) | CFG_DIVIDE_VIDEO_BY_1)); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, ((0x1<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, ((0x0<PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | (CFG_VIDEO_OTHERMUX_SEL_PIPE << @@ -378,13 +378,13 @@ (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT) | CFG_DIVIDE_VIDEO_BY_1); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (((pTDFX->numChips-1)<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (((pTDFX->numChips-1)<numChips>=2 && sliEnable && !aaSamples && sliAnalog) { /* 2 or 4 chips 2/4 analog SLI */ if (!i) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT) | CFG_DIVIDE_VIDEO_BY_1); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (((pTDFX->numChips-1)<numChips-1)<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0xff << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } else { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | (CFG_VIDEO_OTHERMUX_SEL_PIPE << @@ -419,7 +419,7 @@ (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT) | CFG_DIVIDE_VIDEO_BY_1); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (((pTDFX->numChips-1)<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0xff << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } } else if (pTDFX->numChips==2 && sliEnable && aaSamples==2 && !sliAnalog) { /* 2 chips 2 AA 2 digital SLI */ if (!i) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | (CFG_VIDEO_OTHERMUX_SEL_AAFIFO << @@ -442,17 +442,17 @@ (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT) | CFG_DIVIDE_VIDEO_BY_2); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, ((0x1<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, ((0x1<PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | @@ -461,13 +461,13 @@ (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT) | CFG_DIVIDE_VIDEO_BY_1); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (((pTDFX->numChips-1)<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (((pTDFX->numChips-1)<numChips==2 && !sliEnable && aaSamples==2 && !sliAnalog) { /* 2 chips 2 digital AA */ if (!i) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | (CFG_VIDEO_OTHERMUX_SEL_PIPE_PLUS_AAFIFO << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | CFG_DIVIDE_VIDEO_BY_2); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (0x0 << CFG_SLI_RENDERMASK_FETCH_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_FETCH_SHIFT) | (0x0 << CFG_SLI_RENDERMASK_CRT_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_CRT_SHIFT)); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } else { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | CFG_DIVIDE_VIDEO_BY_1); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (0x0 << CFG_SLI_RENDERMASK_FETCH_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_FETCH_SHIFT) | (0x0 << CFG_SLI_RENDERMASK_CRT_SHIFT) | (0xff << CFG_SLI_COMPAREMASK_CRT_SHIFT)); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } } else if (pTDFX->numChips==2 && !sliEnable && aaSamples==2 && sliAnalog) { /* 2 chips 2 analog AA */ if (!i) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | CFG_DIVIDE_VIDEO_BY_2); } else { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | CFG_DAC_HSYNC_TRISTATE | @@ -522,56 +522,56 @@ CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | CFG_DIVIDE_VIDEO_BY_2); } - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (0x0 << CFG_SLI_RENDERMASK_FETCH_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_FETCH_SHIFT) | (0x0 << CFG_SLI_RENDERMASK_CRT_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_CRT_SHIFT)); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } else if (pTDFX->numChips>=2 && sliEnable && aaSamples==2 && sliAnalog) { /* 2 or 4 chips 2 AA 2 or 4 analog SLI */ if (!i) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT) | CFG_DIVIDE_VIDEO_BY_2); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (((pTDFX->numChips-1)<numChips-1)<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0xff << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } else { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT) | CFG_DIVIDE_VIDEO_BY_2); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (((pTDFX->numChips-1)<numChips-1)<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0xff << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } } else if (pTDFX->numChips==4 && sliEnable && !aaSamples && !sliAnalog) { /* 4 chips 4 digital SLI */ if (!i) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | (CFG_VIDEO_OTHERMUX_SEL_AAFIFO << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | @@ -579,19 +579,19 @@ CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT) | CFG_SLI_AAFIFO_COMPARE_INV | CFG_DIVIDE_VIDEO_BY_1); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (((pTDFX->numChips-1)<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (((pTDFX->numChips-1)<PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | (CFG_VIDEO_OTHERMUX_SEL_PIPE << @@ -599,13 +599,13 @@ (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT) | CFG_DIVIDE_VIDEO_BY_1); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (((pTDFX->numChips-1)<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (((pTDFX->numChips-1)<numChips==4 && sliEnable && aaSamples==2 && !sliAnalog) { /* 4 chips 2 AA 4 digital SLI */ if (!i) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | (CFG_VIDEO_OTHERMUX_SEL_AAFIFO << @@ -622,18 +622,18 @@ CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT) | CFG_SLI_AAFIFO_COMPARE_INV | CFG_DIVIDE_VIDEO_BY_2); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (((pTDFX->numChips-1)<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (((pTDFX->numChips-1)<PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | @@ -642,13 +642,13 @@ (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT) | CFG_DIVIDE_VIDEO_BY_1); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, (((pTDFX->numChips-1)<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (((pTDFX->numChips-1)<numChips==4 && sliEnable && aaSamples==4 && !sliAnalog) { /* 4 chips 4 AA 2 digital SLI */ if (!i) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | (CFG_VIDEO_OTHERMUX_SEL_PIPE_PLUS_AAFIFO << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | CFG_DIVIDE_VIDEO_BY_4); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, ((0x1<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } else if (i==1 || i==3) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | CFG_DAC_HSYNC_TRISTATE | @@ -679,50 +679,50 @@ (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | CFG_DIVIDE_VIDEO_BY_1); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, ((0x1<>2)<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } else { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | (CFG_VIDEO_OTHERMUX_SEL_PIPE_PLUS_AAFIFO << CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT) | CFG_DIVIDE_VIDEO_BY_4); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, ((0x1<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0xff << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } } else if (pTDFX->numChips==4 && sliEnable && aaSamples==4 && sliAnalog) { /* 4 chips 4 AA 2 analog SLI */ if (!i) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | CFG_DIVIDE_VIDEO_BY_4); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, ((0x1<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } else if (i==1 || i==3) { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | CFG_DAC_HSYNC_TRISTATE | @@ -730,40 +730,40 @@ (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | CFG_DIVIDE_VIDEO_BY_4); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, ((0x1<>2)<>2)<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } else { - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, CFG_ENHANCED_VIDEO_EN | CFG_ENHANCED_VIDEO_SLV | CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY | (CFG_VIDEO_OTHERMUX_SEL_PIPE << CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) | CFG_DIVIDE_VIDEO_BY_4); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL1, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL1, ((0x1<PciTag[i], CFG_VIDEO_CTRL2, + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL2, (0x0 << CFG_SLI_RENDERMASK_AAFIFO_SHIFT) | (0x0 << CFG_SLI_COMPAREMASK_AAFIFO_SHIFT)); } } if (pTDFX->numChips==4 && sliEnable && aaSamples==4 && i==3) { - v=pciReadLong(pTDFX->PciTag[i], CFG_SLI_AA_MISC); - pciWriteLong(pTDFX->PciTag[i], CFG_SLI_AA_MISC, + v=pciReadLong(&pTDFX->PciInfo[i]->pciid, CFG_SLI_AA_MISC); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_SLI_AA_MISC, v | CFG_AA_LFB_RD_SLV_WAIT); } if (i) { - v=pciReadLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0); - pciWriteLong(pTDFX->PciTag[i], CFG_VIDEO_CTRL0, + v=pciReadLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0); + pciWriteLong(&pTDFX->PciInfo[i]->pciid, CFG_VIDEO_CTRL0, v|CFG_VIDPLL_SEL); v=pTDFX->readChipLong(pTDFX, i, MISCINIT1); pTDFX->writeChipLong(pTDFX, i, MISCINIT1, v|SST_POWERDOWN_DAC); Index: hw/xfree86/drivers/tga/tga.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h,v retrieving revision 1.2 diff -u -r1.2 tga.h --- hw/xfree86/drivers/tga/tga.h 23 Apr 2004 19:50:24 -0000 1.2 +++ hw/xfree86/drivers/tga/tga.h 7 Aug 2005 04:22:39 -0000 @@ -38,7 +38,6 @@ typedef struct { pciVideoPtr PciInfo; - PCITAG PciTag; int Chipset; RamDacHelperRecPtr RamDac; int ChipRev; Index: hw/xfree86/drivers/tga/tga_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c,v retrieving revision 1.7 diff -u -r1.7 tga_driver.c --- hw/xfree86/drivers/tga/tga_driver.c 11 Jul 2005 02:30:02 -0000 1.7 +++ hw/xfree86/drivers/tga/tga_driver.c 7 Aug 2005 04:22:39 -0000 @@ -511,9 +511,6 @@ if (pTga->pEnt->location.type == BUS_PCI) { pciPtr = xf86GetPciInfoForEntity(pTga->pEnt->index); pTga->PciInfo = pciPtr; - pTga->PciTag = pciTag(pTga->PciInfo->bus, - pTga->PciInfo->device, - pTga->PciInfo->func); } else return FALSE; @@ -537,11 +534,6 @@ from = X_PROBED; xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", pScrn->chipset); - pTga->PciTag = pciTag(pTga->PciInfo->bus, pTga->PciInfo->device, - pTga->PciInfo->func); - - - /********************* deal with depth and framebuffer size *********************/ @@ -708,14 +700,14 @@ { case PCI_CHIP_TGA2: Base = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO_32BIT, - pTga->PciTag, pTga->IOAddress, 0x1000); + &pTga->PciInfo->pciid, pTga->IOAddress, 0x1000); pTga->CardType = (*(unsigned int *)((char *)Base+TGA_REVISION_REG) >> 21) & 0x3; pTga->CardType ^= (pTga->CardType == 1) ? 0 : 3; xf86UnMapVidMem(pScrn->scrnIndex, Base, 0x1000); break; case PCI_CHIP_DEC21030: Base = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO_32BIT, - pTga->PciTag, pTga->FbAddress, 4); + &pTga->PciInfo->pciid, pTga->FbAddress, 4); pTga->CardType = (*(unsigned int *)Base >> 12) & 0xf; xf86UnMapVidMem(pScrn->scrnIndex, Base, 4); break; @@ -1009,13 +1001,13 @@ accesses are doublewords */ pTga->IOBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO_32BIT, - pTga->PciTag, + &pTga->PciInfo->pciid, pTga->IOAddress, 0x100000); if (pTga->IOBase == NULL) return FALSE; pTga->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pTga->PciTag, + &pTga->PciInfo->pciid, (unsigned long)pTga->FbAddress, pTga->FbMapSize); if (pTga->FbBase == NULL) @@ -1025,14 +1017,14 @@ return TRUE; pTga->ClkBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO_32BIT, - pTga->PciTag, + &pTga->PciInfo->pciid, (unsigned long)pTga->CardAddress + TGA2_CLOCK_OFFSET, 0x10000); if (pTga->ClkBase == NULL) return FALSE; pTga->DACBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO_32BIT, - pTga->PciTag, + &pTga->PciInfo->pciid, (unsigned long)pTga->CardAddress + TGA2_RAMDAC_OFFSET, 0x10000); if (pTga->DACBase == NULL) @@ -1053,7 +1045,7 @@ * SEGVs from happening. */ pTga->HACKBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pTga->PciTag, + &pTga->PciInfo->pciid, (unsigned long)pTga->FbAddress - getpagesize(), getpagesize()); if (pTga->HACKBase == NULL) Index: hw/xfree86/drivers/trident/trident.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h,v retrieving revision 1.2 diff -u -r1.2 trident.h --- hw/xfree86/drivers/trident/trident.h 23 Apr 2004 19:52:01 -0000 1.2 +++ hw/xfree86/drivers/trident/trident.h 7 Aug 2005 04:22:41 -0000 @@ -55,7 +55,6 @@ typedef struct { ScrnInfoPtr pScrn; pciVideoPtr PciInfo; - PCITAG PciTag; EntityInfoPtr pEnt; int Chipset; int DACtype; Index: hw/xfree86/drivers/trident/trident_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c,v retrieving revision 1.11 diff -u -r1.11 trident_driver.c --- hw/xfree86/drivers/trident/trident_driver.c 11 Jul 2005 02:30:05 -0000 1.11 +++ hw/xfree86/drivers/trident/trident_driver.c 7 Aug 2005 04:22:41 -0000 @@ -1073,9 +1073,6 @@ /* This driver can handle ISA and PCI buses */ if (pTrident->pEnt->location.type == BUS_PCI) { pTrident->PciInfo = xf86GetPciInfoForEntity(pTrident->pEnt->index); - pTrident->PciTag = pciTag(pTrident->PciInfo->bus, - pTrident->PciInfo->device, - pTrident->PciInfo->func); pTrident->Linear = TRUE; } else { pTrident->Linear = FALSE; @@ -2453,10 +2450,10 @@ if (IsPciCard && UseMMIO) pTrident->IOBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - pTrident->PciTag, pTrident->IOAddress, mapsize); + &pTrident->PciInfo->pciid, pTrident->IOAddress, mapsize); else { pTrident->IOBase = xf86MapDomainMemory(pScrn->scrnIndex, VIDMEM_MMIO, - pTrident->PciTag, pTrident->IOAddress, 0x1000); + &pTrident->PciInfo->pciid, pTrident->IOAddress, 0x1000); pTrident->IOBase += 0xF00; } @@ -2467,7 +2464,7 @@ if (pTrident->FbMapSize != 0) { pTrident->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pTrident->PciTag, + &pTrident->PciInfo->pciid, (unsigned long)pTrident->FbAddress, pTrident->FbMapSize); if (pTrident->FbBase == NULL) Index: hw/xfree86/drivers/tseng/tseng.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h,v retrieving revision 1.2 diff -u -r1.2 tseng.h --- hw/xfree86/drivers/tseng/tseng.h 23 Apr 2004 19:52:24 -0000 1.2 +++ hw/xfree86/drivers/tseng/tseng.h 7 Aug 2005 04:22:42 -0000 @@ -189,7 +189,6 @@ unsigned char *BresenhamTable; /* normal stuff starts here */ pciVideoPtr PciInfo; - PCITAG PciTag; int Save_Divide; Bool UsePCIRetry; /* Do we use PCI-retry or busy-waiting */ Bool UseAccel; /* Do we use the XAA acceleration architecture */ Index: hw/xfree86/drivers/tseng/tseng_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c,v retrieving revision 1.6 diff -u -r1.6 tseng_driver.c --- hw/xfree86/drivers/tseng/tseng_driver.c 11 Jul 2005 02:30:06 -0000 1.6 +++ hw/xfree86/drivers/tseng/tseng_driver.c 7 Aug 2005 04:22:46 -0000 @@ -687,9 +687,6 @@ pScrn->chipset, ch_rev); } - pTseng->PciTag = pciTag(pTseng->PciInfo->bus, pTseng->PciInfo->device, - pTseng->PciInfo->func); - /* only the ET6000 implements a PCI IO address */ if (Is_ET6K) { if (pTseng->pEnt->device->IOBase != 0) { @@ -1349,7 +1346,7 @@ } else { /* option not specified: use defaults */ from = X_DEFAULT; - if (pTseng->PciTag) + if (pTseng->PciInfo) pTseng->UseLinMem = TRUE; /* use linear memory by default on PCI systems */ else pTseng->UseLinMem = FALSE; /* ... and banked on non-PCI systems */ @@ -1423,7 +1420,7 @@ } } else { from = X_PROBED; - if (pTseng->PciTag) { + if (pTseng->PciInfo) { /* * base0 is the framebuffer and base1 is the PCI IO space. */ @@ -2326,7 +2323,7 @@ if (pTseng->UseLinMem) { pTseng->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pTseng->PciTag, + &pTseng->PciInfo->pciid, (unsigned long)pTseng->LinFbAddress, pTseng->FbMapSize); if (pTseng->FbBase == NULL) { @@ -2337,7 +2334,7 @@ if (pTseng->UseAccel) { pTseng->MMioBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - pTseng->PciTag, + &pTseng->PciInfo->pciid, (unsigned long)pTseng->LinFbAddress, pTseng->FbMapSize); if (!pTseng->MMioBase) { @@ -2353,7 +2350,7 @@ if (pTseng->UseAccel) { pTseng->MMioBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - pTseng->PciTag, + &pTseng->PciInfo->pciid, (unsigned long)hwp->MapPhys, hwp->MapSize); if (!pTseng->MMioBase) { Index: hw/xfree86/drivers/vesa/vesa.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v retrieving revision 1.10 diff -u -r1.10 vesa.c --- hw/xfree86/drivers/vesa/vesa.c 11 Jul 2005 02:30:06 -0000 1.10 +++ hw/xfree86/drivers/vesa/vesa.c 7 Aug 2005 04:22:46 -0000 @@ -481,8 +481,6 @@ if (pVesa->pEnt->location.type == BUS_PCI) { pVesa->pciInfo = xf86GetPciInfoForEntity(pVesa->pEnt->index); - pVesa->pciTag = pciTag(pVesa->pciInfo->bus, pVesa->pciInfo->device, - pVesa->pciInfo->func); pVesa->primary = xf86IsPrimaryPci(pVesa->pciInfo); } else @@ -1125,16 +1123,16 @@ if (pVesa->mapPhys != 0xa0000 && pVesa->pEnt->location.type == BUS_PCI) pVesa->base = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pVesa->pciTag, pScrn->memPhysBase, + &pVesa->pciInfo->pciid, pScrn->memPhysBase, pVesa->mapSize); else - pVesa->base = xf86MapDomainMemory(pScrn->scrnIndex, 0, pVesa->pciTag, + pVesa->base = xf86MapDomainMemory(pScrn->scrnIndex, 0, &pVesa->pciInfo->pciid, pScrn->memPhysBase, pVesa->mapSize); if (pVesa->base) { if (pVesa->mapPhys != 0xa0000) pVesa->VGAbase = xf86MapDomainMemory(pScrn->scrnIndex, 0, - pVesa->pciTag, + &pVesa->pciInfo->pciid, 0xa0000, 0x10000); else pVesa->VGAbase = pVesa->base; Index: hw/xfree86/drivers/vesa/vesa.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v retrieving revision 1.5 diff -u -r1.5 vesa.h --- hw/xfree86/drivers/vesa/vesa.h 9 May 2005 17:40:51 -0000 1.5 +++ hw/xfree86/drivers/vesa/vesa.h 7 Aug 2005 04:22:48 -0000 @@ -93,7 +93,6 @@ VbeInfoBlock *vbeInfo; GDevPtr device; pciVideoPtr pciInfo; - PCITAG pciTag; miBankInfoRec bank; int curBank, bankSwitchWindowB; CARD16 maxBytesPerScanline; Index: hw/xfree86/drivers/via/via_dri.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/via/via_dri.c,v retrieving revision 1.16 diff -u -r1.16 via_dri.c --- hw/xfree86/drivers/via/via_dri.c 11 Jul 2005 02:30:07 -0000 1.16 +++ hw/xfree86/drivers/via/via_dri.c 7 Aug 2005 04:22:48 -0000 @@ -98,9 +98,9 @@ pVIADRI->irqEnabled = drmGetInterruptFromBusID (pVia->drmFD, - ((pciConfigPtr)pVia->PciInfo->thisCard)->busnum, - ((pciConfigPtr)pVia->PciInfo->thisCard)->devnum, - ((pciConfigPtr)pVia->PciInfo->thisCard)->funcnum); + ((pciConfigPtr)pVia->PciInfo->thisCard)->pciid.bus, + ((pciConfigPtr)pVia->PciInfo->thisCard)->pciid.device, + ((pciConfigPtr)pVia->PciInfo->thisCard)->pciid.func); if ((drmCtlInstHandler(pVia->drmFD, pVIADRI->irqEnabled))) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "[drm] Failure adding irq handler. " @@ -633,9 +633,9 @@ pDRIInfo->clientDriverName = VIAClientDriverName; pDRIInfo->busIdString = xalloc(64); sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", - ((pciConfigPtr)pVia->PciInfo->thisCard)->busnum, - ((pciConfigPtr)pVia->PciInfo->thisCard)->devnum, - ((pciConfigPtr)pVia->PciInfo->thisCard)->funcnum); + ((pciConfigPtr)pVia->PciInfo->thisCard)->pciid.bus, + ((pciConfigPtr)pVia->PciInfo->thisCard)->pciid.device, + ((pciConfigPtr)pVia->PciInfo->thisCard)->pciid.func); pDRIInfo->ddxDriverMajorVersion = VIA_DRI_VERSION_MAJOR; pDRIInfo->ddxDriverMinorVersion = VIA_DRI_VERSION_MINOR; pDRIInfo->ddxDriverPatchVersion = PATCHLEVEL; Index: hw/xfree86/drivers/via/via_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.c,v retrieving revision 1.18 diff -u -r1.18 via_driver.c --- hw/xfree86/drivers/via/via_driver.c 11 Jul 2005 02:30:07 -0000 1.18 +++ hw/xfree86/drivers/via/via_driver.c 7 Aug 2005 04:22:50 -0000 @@ -607,7 +607,7 @@ vgaHWPtr hwp; int i, bMemSize = 0; Bool UseVBEModes = FALSE; - + PciBusId id_0 = {0, 0, 0, 0}; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAPreInit\n")); if (pScrn->numEntities > 1) @@ -1097,7 +1097,7 @@ else { /*pVia->ChipRev = pVia->PciInfo->chipRev;*/ /* Read PCI bus 0, dev 0, function 0, index 0xF6 to get chip rev. */ - pVia->ChipRev = pciReadByte(pciTag(0, 0, 0), 0xF6); + pVia->ChipRev = pciReadByte(&id_0, 0xF6); } if (pEnt->device->videoRam != 0) { @@ -1139,9 +1139,6 @@ } #endif /* HAVE_PM800 */ - pVia->PciTag = pciTag(pVia->PciInfo->bus, pVia->PciInfo->device, - pVia->PciInfo->func); - if (!VIAMapMMIO(pScrn)) { VIAFreeRec(pScrn); return FALSE; @@ -1701,14 +1698,14 @@ "mapping MMIO @ 0x%lx with size 0x%x\n", pVia->MmioBase, VIA_MMIO_REGSIZE); - pVia->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag, + pVia->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, &pVia->PciInfo->pciid, pVia->MmioBase, VIA_MMIO_REGSIZE); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "mapping BitBlt MMIO @ 0x%lx with size 0x%x\n", pVia->MmioBase + VIA_MMIO_BLTBASE, VIA_MMIO_BLTSIZE); - pVia->BltBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag, + pVia->BltBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, &pVia->PciInfo->pciid, pVia->MmioBase + VIA_MMIO_BLTBASE, VIA_MMIO_BLTSIZE); @@ -1764,7 +1761,7 @@ if (pVia->videoRambytes) { pVia->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pVia->PciTag, pVia->FrameBufferBase, + &pVia->PciInfo->pciid, pVia->FrameBufferBase, pVia->videoRambytes); if (!pVia->FBBase) { Index: hw/xfree86/drivers/via/via_driver.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h,v retrieving revision 1.8 diff -u -r1.8 via_driver.h --- hw/xfree86/drivers/via/via_driver.h 23 May 2005 20:12:49 -0000 1.8 +++ hw/xfree86/drivers/via/via_driver.h 7 Aug 2005 04:22:50 -0000 @@ -196,7 +196,6 @@ CloseScreenProcPtr CloseScreen; pciVideoPtr PciInfo; - PCITAG PciTag; int Chipset; int ChipId; int ChipRev; Index: hw/xfree86/drivers/vmware/vmware.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c,v retrieving revision 1.7 diff -u -r1.7 vmware.c --- hw/xfree86/drivers/vmware/vmware.c 11 Jul 2005 02:30:07 -0000 1.7 +++ hw/xfree86/drivers/vmware/vmware.c 7 Aug 2005 04:22:51 -0000 @@ -463,8 +463,6 @@ return FALSE; } - pVMWARE->PciTag = pciTag(pVMWARE->PciInfo->bus, pVMWARE->PciInfo->device, - pVMWARE->PciInfo->func); pVMWARE->Primary = xf86IsPrimaryPci(pVMWARE->PciInfo); pScrn->monitor = pScrn->confScreen->monitor; @@ -790,7 +788,7 @@ pVMWARE = VMWAREPTR(pScrn); pVMWARE->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pVMWARE->PciTag, + &pVMWARE->PciInfo[0].pciid, pVMWARE->memPhysBase, pVMWARE->videoRam); if (!pVMWARE->FbBase) @@ -973,7 +971,7 @@ pVMWARE->mmioPhysBase = vmwareReadReg(pVMWARE, SVGA_REG_MEM_START); pVMWARE->mmioSize = vmwareReadReg(pVMWARE, SVGA_REG_MEM_SIZE) & ~3; pVMWARE->mmioVirtBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - pVMWARE->PciTag, + &pVMWARE->PciInfo[0].pciid, pVMWARE->mmioPhysBase, pVMWARE->mmioSize); vmwareFIFO = pVMWARE->vmwareFIFO = (CARD32*)pVMWARE->mmioVirtBase; Index: hw/xfree86/drivers/vmware/vmware.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h,v retrieving revision 1.3 diff -u -r1.3 vmware.h --- hw/xfree86/drivers/vmware/vmware.h 29 Jun 2004 02:20:25 -0000 1.3 +++ hw/xfree86/drivers/vmware/vmware.h 7 Aug 2005 04:22:51 -0000 @@ -54,7 +54,6 @@ typedef struct { EntityInfoPtr pEnt; pciVideoPtr PciInfo; - PCITAG PciTag; Bool Primary; int depth; int bitsPerPixel; Index: hw/xfree86/dummylib/pcitestmulti.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/dummylib/pcitestmulti.c,v retrieving revision 1.6 diff -u -r1.6 pcitestmulti.c --- hw/xfree86/dummylib/pcitestmulti.c 3 Jul 2005 08:53:44 -0000 1.6 +++ hw/xfree86/dummylib/pcitestmulti.c 7 Aug 2005 04:22:51 -0000 @@ -14,7 +14,7 @@ */ int -pciTestMultiDeviceCard(int bus, int dev, int func, PCITAG** pTag) +pciTestMultiDeviceCard(PciBusId *bus_id, PCITAG** pTag) { return 0; } Index: hw/xfree86/etc/pcitweak.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/etc/pcitweak.c,v retrieving revision 1.4 diff -u -r1.4 pcitweak.c --- hw/xfree86/etc/pcitweak.c 3 Jul 2005 08:53:44 -0000 1.4 +++ hw/xfree86/etc/pcitweak.c 7 Aug 2005 04:22:51 -0000 @@ -60,15 +60,14 @@ pciVideoPtr *xf86PciVideoInfo = NULL; static void usage(void); -static Bool parsePciBusString(const char *id, int *bus, int *device, int *func); +static Bool parsePciBusString(const char *id, PciBusId *bus_id); static char *myname = NULL; int main(int argc, char *argv[]) { int c; - PCITAG tag; - int bus, device, func; + PciBusId bus_id; Bool list = FALSE, rd = FALSE, wr = FALSE; Bool byte = FALSE, halfword = FALSE; int offset = 0; @@ -121,7 +120,7 @@ usage(); if (rd || wr) { - if (!parsePciBusString(id, &bus, &device, &func)) { + if (!parsePciBusString(id, &bus_id)) { fprintf(stderr, "%s: Bad PCI ID string\n", myname); usage(); } @@ -163,22 +162,21 @@ */ xf86scanpci(0); - tag = pciTag(bus, device, func); if (rd) { if (byte) { - printf("0x%02x\n", (unsigned int)pciReadByte(tag, offset) & 0xFF); + printf("0x%02x\n", (unsigned int)pciReadByte(&bus_id, offset) & 0xFF); } else if (halfword) { - printf("0x%04x\n", (unsigned int)pciReadWord(tag, offset) & 0xFFFF); + printf("0x%04x\n", (unsigned int)pciReadWord(&bus_id, offset) & 0xFFFF); } else { - printf("0x%08lx\n", (unsigned long)pciReadLong(tag, offset)); + printf("0x%08lx\n", (unsigned long)pciReadLong(&bus_id, offset)); } } else if (wr) { if (byte) { - pciWriteByte(tag, offset, value & 0xFF); + pciWriteByte(&bus_id, offset, value & 0xFF); } else if (halfword) { - pciWriteWord(tag, offset, value & 0xFFFF); + pciWriteWord(&bus_id, offset, value & 0xFFFF); } else { - pciWriteLong(tag, offset, value); + pciWriteLong(&bus_id, offset, value); } } @@ -205,7 +203,7 @@ } Bool -parsePciBusString(const char *busID, int *bus, int *device, int *func) +parsePciBusString(const char *busID, PciBusId *bus_id) { /* * The format is assumed to be "bus:device:func", where bus, device @@ -219,20 +217,20 @@ p = strtok(s, ":"); if (p == NULL || *p == 0) return FALSE; - *bus = strtoul(p, &end, 16); + bus_id->bus = strtoul(p, &end, 16); if (*end != '\0') return FALSE; p = strtok(NULL, ":"); if (p == NULL || *p == 0) return FALSE; - *device = strtoul(p, &end, 16); + bus_id->device = strtoul(p, &end, 16); if (*end != '\0') return FALSE; - *func = 0; + bus_id->func = 0; p = strtok(NULL, ":"); if (p == NULL || *p == 0) return TRUE; - *func = strtoul(p, &end, 16); + bus_id->func = strtoul(p, &end, 16); if (*end != '\0') return FALSE; return TRUE; Index: hw/xfree86/etc/scanpci.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v retrieving revision 1.7 diff -u -r1.7 scanpci.c --- hw/xfree86/etc/scanpci.c 12 Jul 2005 18:16:03 -0000 1.7 +++ hw/xfree86/etc/scanpci.c 7 Aug 2005 04:22:51 -0000 @@ -227,7 +227,7 @@ printf("\npci bus 0x%04x cardnum 0x%02x function 0x%02x:" " vendor 0x%04x device 0x%04x\n", - pcr->busnum, pcr->devnum, pcr->funcnum, + pcr->pciid.bus, pcr->pciid.device, pcr->pciid.func, pcr->pci_vendor, pcr->pci_device); ScanPciFindPciNamesByDevice(pcr->pci_vendor, pcr->pci_device, @@ -636,31 +636,31 @@ (pcr->pci_bridge_control & PCI_B_SERR_EN) ? "" : "NO_", (pcr->pci_bridge_control & PCI_B_P_ERR) ? "" : "NO_"); printf(" TICK 0x%08lx SECCNTL 0x%02x\n", (long) - pciReadLong(pcr->tag, 0x00b0), pciReadByte(pcr->tag, 0x00dd)); + pciReadLong(&pcr->pciid, 0x00b0), pciReadByte(&pcr->pciid, 0x00dd)); printf(" MASTER RETRIES: PRIMARY 0x%02x, SECONDARY 0x%02x\n", - pciReadByte(pcr->tag, 0x00c0), pciReadByte(pcr->tag, 0x00dc)); + pciReadByte(&pcr->pciid, 0x00c0), pciReadByte(&pcr->pciid, 0x00dc)); printf(" TARGET RETRIES: PIO 0x%02x, DMA 0x%02x\n", - pciReadByte(pcr->tag, 0x00d8), pciReadByte(pcr->tag, 0x00da)); + pciReadByte(&pcr->pciid, 0x00d8), pciReadByte(&pcr->pciid, 0x00da)); printf(" TARGET LATENCY: PIO 0x%02x, DMA 0x%02x\n", - pciReadByte(pcr->tag, 0x00d9), pciReadByte(pcr->tag, 0x00db)); + pciReadByte(&pcr->pciid, 0x00d9), pciReadByte(&pcr->pciid, 0x00db)); printf(" DMA AFSR 0x%08lx%08lx AFAR 0x%08lx%08lx\n", - (long)pciReadLong(pcr->tag, 0x00cc), - (long)pciReadLong(pcr->tag, 0x00c8), - (long)pciReadLong(pcr->tag, 0x00d4), - (long)pciReadLong(pcr->tag, 0x00d0)); + (long)pciReadLong(&pcr->pciid, 0x00cc), + (long)pciReadLong(&pcr->pciid, 0x00c8), + (long)pciReadLong(&pcr->pciid, 0x00d4), + (long)pciReadLong(&pcr->pciid, 0x00d0)); printf(" PIO AFSR 0x%08lx%08lx AFAR 0x%08lx%08lx\n", - (long)pciReadLong(pcr->tag, 0x00ec), - (long)pciReadLong(pcr->tag, 0x00e8), - (long)pciReadLong(pcr->tag, 0x00f4), - (long)pciReadLong(pcr->tag, 0x00f0)); + (long)pciReadLong(&pcr->pciid, 0x00ec), + (long)pciReadLong(&pcr->pciid, 0x00e8), + (long)pciReadLong(&pcr->pciid, 0x00f4), + (long)pciReadLong(&pcr->pciid, 0x00f0)); printf(" PCI CNTL 0x%08lx%08lx DIAG 0x%08lx%08lx\n", - (long)pciReadLong(pcr->tag, 0x00e4), - (long)pciReadLong(pcr->tag, 0x00e0), - (long)pciReadLong(pcr->tag, 0x00fc), - (long)pciReadLong(pcr->tag, 0x00f8)); + (long)pciReadLong(&pcr->pciid, 0x00e4), + (long)pciReadLong(&pcr->pciid, 0x00e0), + (long)pciReadLong(&pcr->pciid, 0x00fc), + (long)pciReadLong(&pcr->pciid, 0x00f8)); printf(" MAPS: I/O 0x%02x, MEM 0x%02x\n", - (io = pciReadByte(pcr->tag, 0x00de)), - (mem = pciReadByte(pcr->tag, 0x00df))); + (io = pciReadByte(&pcr->pciid, 0x00de)), + (mem = pciReadByte(&pcr->pciid, 0x00df))); for (i = 0; i < 8; i++) if (io & (1 << i)) printf(" BUS I/O 0x%06x-0x%06x\n", i << 21, ((i + 1) << 21) - 1); @@ -689,41 +689,41 @@ pcr->pci_user_config = tmp; /* Only print what XFree86 might be interested in */ - if (pcr->busnum == 0) { - if ((pcr->devnum != 0x10) || (pcr->funcnum != 0)) + if (pcr->pciid.bus == 0) { + if ((pcr->pciid.device != 0x10) || (pcr->pciid.func != 0)) return; /* Get Chipset Bus Number */ - cbn_460gx = (unsigned int)pciReadByte(pcr->tag, 0x0040); + cbn_460gx = (unsigned int)pciReadByte(&pcr->pciid, 0x0040); printf(" CBN 0x%02x CBUSES 0x%02x\n", - cbn_460gx, pciReadByte(pcr->tag, 0x0044)); + cbn_460gx, pciReadByte(&pcr->pciid, 0x0044)); return; } - if ((pcr->busnum != cbn_460gx) || (pcr->funcnum != 0)) + if ((pcr->pciid.bus != cbn_460gx) || (pcr->pciid.func != 0)) return; - switch (pcr->devnum) { + switch (pcr->pciid.device) { case 0: printf(" F16NUM 0x%02x F16CPL 0x%02x DEVNPRES 0x%08lx\n", - pciReadByte(pcr->tag, 0x0060), pciReadByte(pcr->tag, 0x0078), - (long)pciReadLong(pcr->tag, 0x0070)); + pciReadByte(&pcr->pciid, 0x0060), pciReadByte(&pcr->pciid, 0x0078), + (long)pciReadLong(&pcr->pciid, 0x0070)); return; case 0x10: printf(" TOM 0x%04x IORD 0x%04x\n", - pciReadWord(pcr->tag, 0x0050), pciReadWord(pcr->tag, 0x008E)); + pciReadWord(&pcr->pciid, 0x0050), pciReadWord(&pcr->pciid, 0x008E)); /* Fall through */ case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: printf(" BUSNO 0x%02x SUBNO 0x%02x\n", - pciReadByte(pcr->tag, 0x0048), pciReadByte(pcr->tag, 0x0049)); + pciReadByte(&pcr->pciid, 0x0048), pciReadByte(&pcr->pciid, 0x0049)); printf(" VGASE 0x%02x PCIS 0x%02x IOR 0x%02x\n", - pciReadByte(pcr->tag, 0x0080), pciReadByte(pcr->tag, 0x0084), - pciReadByte(pcr->tag, 0x008C)); + pciReadByte(&pcr->pciid, 0x0080), pciReadByte(&pcr->pciid, 0x0084), + pciReadByte(&pcr->pciid, 0x008C)); /* Fall through */ default: @@ -750,7 +750,7 @@ /* Only print what XFree86 might be interested in */ printf(" ERRCMD 0x%02x GAPEN 0x%02x\n", - pciReadByte(pcr->tag, 0x0046), pciReadByte(pcr->tag, 0x0060)); + pciReadByte(&pcr->pciid, 0x0046), pciReadByte(&pcr->pciid, 0x0060)); } static void @@ -772,9 +772,9 @@ /* Only print what XFree86 might be interested in */ printf(" BAPBASE 0x%08lx%08lx AGPSIZ 0x%02x VGAGE 0x%02x\n", - (long)pciReadLong(pcr->tag, 0x009C), - (long)pciReadLong(pcr->tag, 0x0098), - pciReadByte(pcr->tag, 0x00A2), pciReadByte(pcr->tag, 0x0060)); + (long)pciReadLong(&pcr->pciid, 0x009C), + (long)pciReadLong(&pcr->pciid, 0x0098), + pciReadByte(&pcr->pciid, 0x00A2), pciReadByte(&pcr->pciid, 0x0060)); } #include "xf86getpagesize.c" Index: hw/xfree86/int10/pci.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/int10/pci.c,v retrieving revision 1.3 diff -u -r1.3 pci.c --- hw/xfree86/int10/pci.c 3 Jul 2005 07:01:28 -0000 1.3 +++ hw/xfree86/int10/pci.c 7 Aug 2005 04:22:52 -0000 @@ -18,7 +18,6 @@ int mapPciRom(int pciEntity, unsigned char * address) { - PCITAG tag; unsigned char *mem, *ptr; int length; @@ -31,12 +30,11 @@ return 0; } - tag = pciTag(pvp->bus,pvp->device,pvp->func); length = 1 << pvp->biosSize; /* Read in entire PCI ROM */ mem = ptr = xnfcalloc(length, 1); - length = xf86ReadPciBIOS(0, tag, -1, ptr, length); + length = xf86ReadPciBIOS(0, &pvp->pciid, -1, ptr, length); if (length > 0) memcpy(address, ptr, length); /* unmap/close/disable PCI bios mem */ Index: hw/xfree86/int10/xf86int10.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/int10/xf86int10.c,v retrieving revision 1.3 diff -u -r1.3 xf86int10.c --- hw/xfree86/int10/xf86int10.c 3 Jul 2005 07:01:28 -0000 1.3 +++ hw/xfree86/int10/xf86int10.c 7 Aug 2005 04:22:54 -0000 @@ -25,7 +25,7 @@ static int int42_handler(xf86Int10InfoPtr pInt); #endif static int intE6_handler(xf86Int10InfoPtr pInt); -static PCITAG findPci(xf86Int10InfoPtr pInt, unsigned short bx); +static unsigned int findPci(xf86Int10InfoPtr pInt, unsigned short bx, PciBusId *bus_id); static CARD32 pciSlotBX(pciVideoPtr pvp); int @@ -597,8 +597,8 @@ static int int1A_handler(xf86Int10InfoPtr pInt) { - PCITAG tag; pciVideoPtr pvp; + PciBusId bus_id; if (!(pvp = xf86GetPciInfoForEntity(pInt->entityIndex))) return 0; /* oops */ @@ -668,8 +668,8 @@ #endif return 1; case 0xb108: - if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) { - X86_CL = pciReadByte(tag, X86_EDI); + if ((findPci(pInt, X86_EBX, &bus_id)) != PCI_NOT_FOUND) { + X86_CL = pciReadByte(&bus_id, X86_EDI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */ } else { @@ -681,8 +681,8 @@ #endif return 1; case 0xb109: - if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) { - X86_CX = pciReadWord(tag, X86_EDI); + if ((findPci(pInt, X86_EBX, &bus_id)) != PCI_NOT_FOUND) { + X86_CX = pciReadWord(&bus_id, X86_EDI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */ } else { @@ -694,8 +694,8 @@ #endif return 1; case 0xb10a: - if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) { - X86_ECX = pciReadLong(tag, X86_EDI); + if ((findPci(pInt, X86_EBX, &bus_id)) != PCI_NOT_FOUND) { + X86_ECX = pciReadLong(&bus_id, X86_EDI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */ } else { @@ -707,8 +707,8 @@ #endif return 1; case 0xb10b: - if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) { - pciWriteByte(tag, X86_EDI, X86_CL); + if ((findPci(pInt, X86_EBX, &bus_id)) != PCI_NOT_FOUND) { + pciWriteByte(&bus_id, X86_EDI, X86_CL); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */ } else { @@ -720,8 +720,8 @@ #endif return 1; case 0xb10c: - if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) { - pciWriteWord(tag, X86_EDI, X86_CX); + if ((findPci(pInt, X86_EBX, &bus_id)) != PCI_NOT_FOUND) { + pciWriteWord(&bus_id, X86_EDI, X86_CX); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */ } else { @@ -733,8 +733,8 @@ #endif return 1; case 0xb10d: - if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) { - pciWriteLong(tag, X86_EDI, X86_ECX); + if ((findPci(pInt, X86_EBX, &bus_id)) != PCI_NOT_FOUND) { + pciWriteLong(&bus_id, X86_EDI, X86_ECX); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */ } else { @@ -755,21 +755,23 @@ } } -static PCITAG -findPci(xf86Int10InfoPtr pInt, unsigned short bx) +/* a bit ugly returning a struct - but it isn't exactly fast path code */ +static unsigned int +findPci(xf86Int10InfoPtr pInt, unsigned short bx, PciBusId *bus_id) { - int bus = ((pInt->Tag >> 16) & ~0x00FF) | ((bx >> 8) & 0x00FF); - int dev = (bx >> 3) & 0x1F; - int func = bx & 0x7; - if (xf86IsPciDevPresent(bus, dev, func)) - return pciTag(bus, dev, func); + bus_id->domain = 0; + bus_id->bus = ((pInt->pciid.bus >> 16) & ~0x00FF) | ((bx >> 8) & 0x00FF); + bus_id->device = (bx >> 3) & 0x1F; + bus_id->func = bx & 0x7; + if (xf86IsPciDevPresent(&bus_id)) + return 0; return PCI_NOT_FOUND; } static CARD32 pciSlotBX(pciVideoPtr pvp) { - return ((pvp->bus << 8) & 0x00FF00) | (pvp->device << 3) | (pvp->func); + return ((pvp->pciid.bus << 8) & 0x00FF00) | (pvp->pciid.device << 3) | (pvp->pciid.func); } /* @@ -781,7 +783,7 @@ pciVideoPtr pvp; if ((pvp = xf86GetPciInfoForEntity(pInt->entityIndex))) - X86_AX = (pvp->bus << 8) | (pvp->device << 3) | (pvp->func & 0x7); + X86_AX = (pvp->pciid.bus << 8) | (pvp->pciid.device << 3) | (pvp->pciid.func & 0x7); pushw(pInt, X86_CS); pushw(pInt, X86_IP); X86_CS = pInt->BIOSseg; Index: hw/xfree86/int10/xf86int10.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/int10/xf86int10.h,v retrieving revision 1.4 diff -u -r1.4 xf86int10.h --- hw/xfree86/int10/xf86int10.h 3 Jul 2005 07:01:28 -0000 1.4 +++ hw/xfree86/int10/xf86int10.h 7 Aug 2005 04:22:54 -0000 @@ -45,7 +45,7 @@ int bp; int flags; int stackseg; - PCITAG Tag; + PciBusId pciid; IOADDRESS ioBase; } xf86Int10InfoRec, *xf86Int10InfoPtr; Index: hw/xfree86/os-support/xf86_OSproc.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v retrieving revision 1.5 diff -u -r1.5 xf86_OSproc.h --- hw/xfree86/os-support/xf86_OSproc.h 3 Jul 2005 07:01:29 -0000 1.5 +++ hw/xfree86/os-support/xf86_OSproc.h 7 Aug 2005 04:22:54 -0000 @@ -259,9 +259,9 @@ resPtr xf86AccResFromOS(resPtr ret); #endif /* NEED_OS_RAC_PROTOS */ -extern Bool xf86GetPciSizeFromOS(PCITAG tag, int indx, int* bits); -extern Bool xf86GetPciOffsetFromOS(PCITAG tag, int indx, unsigned long* bases); -extern unsigned long xf86GetOSOffsetFromPCI(PCITAG tag, int space, unsigned long base); +extern Bool xf86GetPciSizeFromOS(PciBusId * tag, int indx, int* bits); +extern Bool xf86GetPciOffsetFromOS(PciBusId * tag, int indx, unsigned long* bases); +extern unsigned long xf86GetOSOffsetFromPCI(PciBusId * tag, int space, unsigned long base); extern void xf86MakeNewMapping(int, int, unsigned long, unsigned long, pointer); extern void xf86InitVidMem(void); Index: hw/xfree86/os-support/bus/Pci.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c,v retrieving revision 1.8 diff -u -r1.8 Pci.c --- hw/xfree86/os-support/bus/Pci.c 3 Jul 2005 07:01:30 -0000 1.8 +++ hw/xfree86/os-support/bus/Pci.c 7 Aug 2005 04:22:56 -0000 @@ -26,12 +26,12 @@ * pciGetBaseSize() - Returns the number of bits in a PCI base * addr mapping * xf86MapPciMem() - Like xf86MapVidMem() except function expects - * a PCI address and a PCITAG that identifies + * a PCI address and a PciBusId * that identifies * a PCI device * xf86ReadPciBIOS() - Like xf86ReadBIOS() but can handle PCI/host * address translation and BIOS decode enabling * xf86scanpci() - Return info about all PCI devices - * xf86GetPciDomain() - Return domain number from a PCITAG + * xf86GetPciDomain() - Return domain number from a PciBusId * * xf86MapDomainMemory() - Like xf86MapPciMem() but can handle * domain/host address translation * xf86MapDomainIO() - Maps PCI I/O spaces @@ -221,10 +221,7 @@ CARD32 pciDevidMask; /* Bit mask applied (AND) before comparison */ /* of real devid's with requested */ -int pciBusNum; /* Bus Number of current device */ -int pciDevNum; /* Device number of current device */ -int pciFuncNum; /* Function number of current device */ -PCITAG pciDeviceTag; /* Tag for current device */ +PciBusId ProbeBusId; /* Tag for current device */ pciBusInfo_t *pciBusInfo[MAX_PCI_BUSES] = { NULL, }; int pciNumBuses = 0; /* Actual number of PCI buses */ @@ -239,8 +236,8 @@ * NOTE: A platform/OS specific pci init procedure can override these defaults * by setting them to the appropriate platform dependent functions. */ -PCITAG (*pciFindFirstFP)(void) = pciGenFindFirst; -PCITAG (*pciFindNextFP)(void) = pciGenFindNext; +unsigned int (*pciFindFirstFP)(PciBusId *) = pciGenFindFirst; +unsigned int (*pciFindNextFP)(PciBusId *) = pciGenFindNext; /* * pciInit - choose correct platform/OS specific PCI init routine @@ -266,8 +263,8 @@ #endif } -PCITAG -pciFindFirst(CARD32 id, CARD32 mask) +unsigned int +pciFindFirst(CARD32 id, CARD32 mask, PciBusId *pciid) { #ifdef DEBUGPCI ErrorF("pciFindFirst(0x%lx, 0x%lx), pciInit = %d\n", id, mask, pciInitialized); @@ -277,24 +274,24 @@ pciDevid = id & mask; pciDevidMask = mask; - return((*pciFindFirstFP)()); + return((*pciFindFirstFP)(pciid)); } -PCITAG -pciFindNext(void) +unsigned int +pciFindNext(PciBusId *pciid) { #ifdef DEBUGPCI ErrorF("pciFindNext(), pciInit = %d\n", pciInitialized); #endif pciInit(); - return((*pciFindNextFP)()); + return((*pciFindNextFP)(pciid)); } CARD32 -pciReadLong(PCITAG tag, int offset) +pciReadLong(PciBusId *pciid, int offset) { - int bus = PCI_BUS_FROM_TAG(tag); + int bus = pciid->bus; #ifdef DEBUGPCI ErrorF("pciReadLong(0x%lx, %d)\n", tag, offset); @@ -303,10 +300,10 @@ if ((bus >= 0) && ((bus < pciNumBuses) || inProbe) && pciBusInfo[bus] && pciBusInfo[bus]->funcs->pciReadLong) { - CARD32 rv = (*pciBusInfo[bus]->funcs->pciReadLong)(tag, offset); + CARD32 rv = (*pciBusInfo[bus]->funcs->pciReadLong)(pciid, offset); PCITRACE(1, ("pciReadLong: tag=0x%x [b=%d,d=%d,f=%d] returns 0x%08x\n", - tag, bus, PCI_DEV_FROM_TAG(tag), PCI_FUNC_FROM_TAG(tag), rv)); + tag, bus, pciid.device, pciid.func, rv)); return(rv); } @@ -314,7 +311,7 @@ } CARD16 -pciReadWord(PCITAG tag, int offset) +pciReadWord(PciBusId * tag, int offset) { CARD32 tmp; int shift = (offset & 3) * 8; @@ -330,7 +327,7 @@ } CARD8 -pciReadByte(PCITAG tag, int offset) +pciReadByte(PciBusId * tag, int offset) { CARD32 tmp; int shift = (offset & 3) * 8; @@ -342,19 +339,18 @@ } void -pciWriteLong(PCITAG tag, int offset, CARD32 val) +pciWriteLong(PciBusId *pciid, int offset, CARD32 val) { - int bus = PCI_BUS_FROM_TAG(tag); - + int bus = pciid->bus; pciInit(); if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] && pciBusInfo[bus]->funcs->pciWriteLong) - (*pciBusInfo[bus]->funcs->pciWriteLong)(tag, offset, val); + (*pciBusInfo[bus]->funcs->pciWriteLong)(pciid, offset, val); } void -pciWriteWord(PCITAG tag, int offset, CARD16 val) +pciWriteWord(PciBusId * tag, int offset, CARD16 val) { CARD32 tmp; int aligned_offset = offset & ~3; @@ -373,7 +369,7 @@ } void -pciWriteByte(PCITAG tag, int offset, CARD8 val) +pciWriteByte(PciBusId * tag, int offset, CARD8 val) { CARD32 tmp; int aligned_offset = offset & ~3; @@ -388,9 +384,9 @@ } void -pciSetBitsLong(PCITAG tag, int offset, CARD32 mask, CARD32 val) +pciSetBitsLong(PciBusId *pciid, int offset, CARD32 mask, CARD32 val) { - int bus = PCI_BUS_FROM_TAG(tag); + int bus = pciid->bus; #ifdef DEBUGPCI ErrorF("pciReadLong(0x%lx, %d)\n", tag, offset); @@ -399,12 +395,12 @@ if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] && pciBusInfo[bus]->funcs->pciSetBitsLong) { - (*pciBusInfo[bus]->funcs->pciSetBitsLong)(tag, offset, mask, val); + (*pciBusInfo[bus]->funcs->pciSetBitsLong)(pciid, offset, mask, val); } } void -pciSetBitsByte(PCITAG tag, int offset, CARD8 mask, CARD8 val) +pciSetBitsByte(PciBusId * tag, int offset, CARD8 mask, CARD8 val) { CARD32 tmp_mask, tmp_val; int aligned_offset = offset & ~3; @@ -416,29 +412,29 @@ } ADDRESS -pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr) +pciBusAddrToHostAddr(PciBusId *pciid, PciAddrType type, ADDRESS addr) { - int bus = PCI_BUS_FROM_TAG(tag); + int bus = pciid->bus; pciInit(); if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] && pciBusInfo[bus]->funcs->pciAddrBusToHost) - return (*pciBusInfo[bus]->funcs->pciAddrBusToHost)(tag, type, addr); + return (*pciBusInfo[bus]->funcs->pciAddrBusToHost)(pciid, type, addr); else return(addr); } ADDRESS -pciHostAddrToBusAddr(PCITAG tag, PciAddrType type, ADDRESS addr) +pciHostAddrToBusAddr(PciBusId *pciid, PciAddrType type, ADDRESS addr) { - int bus = PCI_BUS_FROM_TAG(tag); + int bus = pciid->bus; pciInit(); if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] && pciBusInfo[bus]->funcs->pciAddrHostToBus) - return (*pciBusInfo[bus]->funcs->pciAddrHostToBus)(tag, type, addr); + return (*pciBusInfo[bus]->funcs->pciAddrHostToBus)(pciid, type, addr); else return(addr); } @@ -456,7 +452,7 @@ */ int -pciGetBaseSize(PCITAG tag, int index, Bool destructive, Bool *min) +pciGetBaseSize(PciBusId *busid, int index, Bool destructive, Bool *min) { int offset; CARD32 addr1; @@ -480,7 +476,7 @@ pciInit(); - if (xf86GetPciSizeFromOS(tag, index, &bits)) { + if (xf86GetPciSizeFromOS(busid, index, &bits)) { if (min) *min = TRUE; return bits; @@ -495,21 +491,21 @@ else offset = PCI_MAP_REG_START + (index << 2); - addr1 = pciReadLong(tag, offset); + addr1 = pciReadLong(busid, offset); /* * Check if this is the second part of a 64 bit address. * XXX need to check how endianness affects 64 bit addresses. */ if (index > 0 && index < 6) { - addr2 = pciReadLong(tag, offset - 4); + addr2 = pciReadLong(busid, offset - 4); if (PCI_MAP_IS_MEM(addr2) && PCI_MAP_IS64BITMEM(addr2)) return 0; } if (destructive) { - pciWriteLong(tag, offset, 0xffffffff); - mask1 = pciReadLong(tag, offset); - pciWriteLong(tag, offset, addr1); + pciWriteLong(busid, offset, 0xffffffff); + mask1 = pciReadLong(busid, offset); + pciWriteLong(busid, offset, addr1); } else { mask1 = addr1; } @@ -517,11 +513,11 @@ /* Check if this is the first part of a 64 bit address. */ if (index < 5 && PCI_MAP_IS_MEM(mask1) && PCI_MAP_IS64BITMEM(mask1)) { if (PCIGETMEMORY(mask1) == 0) { - addr2 = pciReadLong(tag, offset + 4); + addr2 = pciReadLong(busid, offset + 4); if (destructive) { - pciWriteLong(tag, offset + 4, 0xffffffff); - mask2 = pciReadLong(tag, offset + 4); - pciWriteLong(tag, offset + 4, addr2); + pciWriteLong(busid, offset + 4, 0xffffffff); + mask2 = pciReadLong(busid, offset + 4); + pciWriteLong(busid, offset + 4, addr2); } else { mask2 = addr2; } @@ -560,28 +556,22 @@ return bits; } -PCITAG -pciTag(int busnum, int devnum, int funcnum) -{ - return(PCI_MAKE_TAG(busnum,devnum,funcnum)); -} - #if defined(PCI_MFDEV_SUPPORT) || defined(PowerMAX_OS) Bool -pciMfDev(int busnum, int devnum) +pciMfDev(PciBusId *pciid) { - PCITAG tag0, tag1; + PciBusId pciid0, pciid1; CARD32 id0, id1, val; /* Detect a multi-function device that complies to the PCI 2.0 spec */ - - tag0 = PCI_MAKE_TAG(busnum, devnum, 0); - id0 = pciReadLong(tag0, PCI_ID_REG); + pciid0 = *pciid; + pciid0.func = 0; + id0 = pciReadLong(&pciid0, PCI_ID_REG); if ((CARD16)(id0 + 1) <= (CARD16)1UL) return FALSE; - val = pciReadLong(tag0, PCI_HEADER_MISC) & 0x00ff0000; + val = pciReadLong(&pciid0, PCI_HEADER_MISC) & 0x00ff0000; if ((val != 0x00ff0000) && (val & PCI_HEADER_MULTIFUNCTION)) return TRUE; @@ -591,8 +581,9 @@ * are different, or the base0 values of func 0 and 1 are differend, * then assume there is a multi-function device. */ - tag1 = PCI_MAKE_TAG(busnum, devnum, 1); - id1 = pciReadLong(tag1, PCI_ID_REG); + pciid1 = *pciid; + pciid1.func = 1; + id1 = pciReadLong(&pciid1, PCI_ID_REG); if ((CARD16)(id1 + 1) <= (CARD16)1UL) return FALSE; @@ -602,8 +593,8 @@ if ((id0 != id1) || /* Note the following test is valid for header types 0, 1 and 2 */ - (pciReadLong(tag0, PCI_MAP_REG_START) != - pciReadLong(tag1, PCI_MAP_REG_START))) + (pciReadLong(&pciid0, PCI_MAP_REG_START) != + pciReadLong(&pciid1, PCI_MAP_REG_START))) return TRUE; return FALSE; @@ -614,15 +605,15 @@ /* * Generic find/read/write functions */ -PCITAG -pciGenFindNext(void) +unsigned int +pciGenFindNext(PciBusId *pciid) { CARD32 devid, tmp; int sec_bus, pri_bus; static int previousBus = 0; Bool speculativeProbe = FALSE; unsigned char base_class, sub_class; - + #ifdef DEBUGPCI ErrorF("pciGenFindNext\n"); #endif @@ -632,7 +623,7 @@ #ifdef DEBUGPCI ErrorF("pciGenFindNext: pciBusNum %d\n", pciBusNum); #endif - if (pciBusNum == -1) { + if (ProbeBusId.bus == -1) { /* * Start at top of the order */ @@ -640,10 +631,10 @@ return(PCI_NOT_FOUND); /* Skip ahead to the first bus defined by pciInit() */ - for (pciBusNum = 0; !pciBusInfo[pciBusNum]; ++pciBusNum); - pciFuncNum = 0; - pciDevNum = 0; - previousBus = pciBusNum; /* make sure previousBus exists */ + for (ProbeBusId.bus = 0; !pciBusInfo[ProbeBusId.bus]; ++ProbeBusId.bus); + ProbeBusId.device = 0; + ProbeBusId.func = 0; + previousBus = ProbeBusId.bus; /* make sure previousBus exists */ } else { #ifdef PCI_MFDEV_SUPPORT #ifdef DEBUGPCI @@ -657,26 +648,26 @@ /* * Is current dev a multifunction device? */ - if (!speculativeProbe && pciMfDev(pciBusNum, pciDevNum)) + if (!speculativeProbe && pciMfDev(&ProbeBusId)) /* Probe for other functions */ - pciFuncNum = 1; + ProbeBusId.func = 1; else /* * No more functions this device. Next * device please */ - pciDevNum ++; - } else if (++pciFuncNum >= 8) { + ProbeBusId.device++; + } else if (++ProbeBusId.func >= 8) { /* No more functions for this device. Next device please */ - pciFuncNum = 0; - pciDevNum ++; + ProbeBusId.func = 0; + ProbeBusId.device ++; } #else pciDevNum ++; #endif if (pciDevNum >= 32 || - !pciBusInfo[pciBusNum] || - pciDevNum >= pciBusInfo[pciBusNum]->numDevices) { + !pciBusInfo[ProbeBusId.bus] || + pciDevNum >= pciBusInfo[ProbeBusId.bus]->numDevices) { #ifdef DEBUGPCI ErrorF("pciGenFindNext: next bus\n"); #endif @@ -685,12 +676,12 @@ */ if (speculativeProbe) { NextSpeculativeBus: - xfree(pciBusInfo[pciBusNum]); - pciBusInfo[pciBusNum] = NULL; + xfree(pciBusInfo[ProbeBusId.bus]); + pciBusInfo[ProbeBusId.bus] = NULL; speculativeProbe = FALSE; } - if (++pciBusNum >= pciMaxBusNum) { + if (++ProbeBusId.bus >= pciMaxBusNum) { #ifdef DEBUGPCI ErrorF("pciGenFindNext: out of buses\n"); #endif @@ -703,29 +694,28 @@ } #ifdef DEBUGPCI - ErrorF("pciGenFindNext: pciBusInfo[%d] = 0x%lx\n", pciBusNum, pciBusInfo[pciBusNum]); + ErrorF("pciGenFindNext: pciBusInfo[%d] = 0x%lx\n", ProbeBusId.bus, pciBusInfo[ProbeBusId.bus]); #endif - if (!pciBusInfo[pciBusNum]) { - pciBusInfo[pciBusNum] = xnfalloc(sizeof(pciBusInfo_t)); - *pciBusInfo[pciBusNum] = *pciBusInfo[previousBus]; + if (!pciBusInfo[ProbeBusId.bus]) { + pciBusInfo[ProbeBusId.bus] = xnfalloc(sizeof(pciBusInfo_t)); + *pciBusInfo[ProbeBusId.bus] = *pciBusInfo[previousBus]; speculativeProbe = TRUE; } /* - * At this point, pciBusNum, pciDevNum, and pciFuncNum have been + * At this point, ProbeBusId.bus, pciDevNum, and pciFuncNum have been * advanced to the next device. Compute the tag, and read the * device/vendor ID field. */ #ifdef DEBUGPCI - ErrorF("pciGenFindNext: [%d, %d, %d]\n", pciBusNum, pciDevNum, pciFuncNum); + ErrorF("pciGenFindNext: [%d, %d, %d]\n", ProbeBusId.bus, pciDevNum, pciFuncNum); #endif - pciDeviceTag = PCI_MAKE_TAG(pciBusNum, pciDevNum, pciFuncNum); inProbe = TRUE; - devid = pciReadLong(pciDeviceTag, PCI_ID_REG); + devid = pciReadLong(&ProbeBusId, PCI_ID_REG); inProbe = FALSE; #ifdef DEBUGPCI - ErrorF("pciGenFindNext: pciDeviceTag = 0x%lx, devid = 0x%lx\n", pciDeviceTag, devid); + ErrorF("pciGenFindNext: pciDevice = 0x%lx, devid = 0x%lx\n", ProbeBusId.device, devid); #endif if ((CARD16)(devid + 1U) <= (CARD16)1UL) continue; /* Nobody home. Next device please */ @@ -735,24 +725,27 @@ * create phantom buses. */ if (speculativeProbe && (pciDevNum == 0) && (pciFuncNum == 0) && - (PCI_BUS_NO_DOMAIN(pciBusNum) > 0)) { + (ProbeBusId.bus > 0)) { for (;;) { - if (++pciDevNum >= pciBusInfo[pciBusNum]->numDevices) + PciBusId temp; + if (++pciDevNum >= pciBusInfo[ProbeBusId.bus]->numDevices) goto NextSpeculativeBus; + temp = ProbeBusId; + temp.func = 0; if (devid != - pciReadLong(PCI_MAKE_TAG(pciBusNum, pciDevNum, 0), + pciReadLong(&temp, PCI_ID_REG)) break; } - pciDevNum = 0; + ProbeBusId.device = 0; } - if (pciNumBuses <= pciBusNum) - pciNumBuses = pciBusNum + 1; + if (pciNumBuses <= ProbeBusId.bus) + pciNumBuses = ProbeBusId.bus + 1; speculativeProbe = FALSE; - previousBus = pciBusNum; + previousBus = ProbeBusId.bus; #ifdef PCI_BRIDGE_SUPPORT /* @@ -760,28 +753,29 @@ * PCI to PCI bridge devices. If one is found, create and * initialize a bus info record (if one does not already exist). */ - tmp = pciReadLong(pciDeviceTag, PCI_CLASS_REG); + tmp = pciReadLong(&ProbeBusId, PCI_CLASS_REG); base_class = PCI_CLASS_EXTRACT(tmp); sub_class = PCI_SUBCLASS_EXTRACT(tmp); if ((base_class == PCI_CLASS_BRIDGE) && ((sub_class == PCI_SUBCLASS_BRIDGE_PCI) || (sub_class == PCI_SUBCLASS_BRIDGE_CARDBUS))) { - tmp = pciReadLong(pciDeviceTag, PCI_PCI_BRIDGE_BUS_REG); - sec_bus = PCI_SECONDARY_BUS_EXTRACT(tmp, pciDeviceTag); - pri_bus = PCI_PRIMARY_BUS_EXTRACT(tmp, pciDeviceTag); + tmp = pciReadLong(&ProbeBusId, PCI_PCI_BRIDGE_BUS_REG); + + sec_bus = PCI_SECONDARY_BUS_EXTRACT(tmp, &ProbeBusId); + pri_bus = PCI_PRIMARY_BUS_EXTRACT(tmp, &ProbeBusId); #ifdef DEBUGPCI ErrorF("pciGenFindNext: pri_bus %d sec_bus %d\n", pri_bus, sec_bus); #endif - if (pciBusNum != pri_bus) { + if (ProbeBusId.bus != pri_bus) { /* Some bridges do not implement the primary bus register */ - if ((PCI_BUS_NO_DOMAIN(pri_bus) != 0) || + if ((pri_bus != 0) || (sub_class != PCI_SUBCLASS_BRIDGE_CARDBUS)) xf86Msg(X_WARNING, "pciGenFindNext: primary bus mismatch on PCI" - " bridge 0x%08lx (0x%02x, 0x%02x)\n", - pciDeviceTag, pciBusNum, pri_bus); - pri_bus = pciBusNum; + " bridge (0x%02x, 0x%02x)\n", + ProbeBusId.bus, pri_bus); + pri_bus = ProbeBusId.bus; } if ((pri_bus < sec_bus) && (sec_bus < pciMaxBusNum) && pciBusInfo[pri_bus]) { @@ -815,19 +809,20 @@ #endif if ((devid & pciDevidMask) == pciDevid) /* Yes - Return it. Otherwise, next device */ - return(pciDeviceTag); /* got a match */ + *pciid = ProbeBusId; + return 0; /* got a match */ } /* for */ /*NOTREACHED*/ } -PCITAG -pciGenFindFirst(void) +unsigned int +pciGenFindFirst(PciBusId *pciid) { /* Reset PCI bus number to start from top */ - pciBusNum = -1; + ProbeBusId.bus = -1; - return pciGenFindNext(); + return pciGenFindNext(pciid); } CARD32 @@ -855,7 +850,7 @@ } ADDRESS -pciAddrNOOP(PCITAG tag, PciAddrType type, ADDRESS addr) +pciAddrNOOP(PciBusId * tag, PciAddrType type, ADDRESS addr) { return(addr); } @@ -866,9 +861,9 @@ pciConfigPtr devp; pciBusInfo_t *busp; int idx = 0, i; - PCITAG tag; + PciBusId pciid; static Bool done = FALSE; - + unsigned int ret; /* * if we haven't found PCI devices checking for pci_devp may * result in an endless recursion if platform/OS specific PCI @@ -885,9 +880,9 @@ XF86SCANPCI_WRAPPER(SCANPCI_INIT); #endif - tag = pciFindFirst(0,0); /* 0 mask means match any valid device */ + ret = pciFindFirst(0,0,&pciid); /* 0 mask means match any valid device */ /* Check if no devices, return now */ - if (tag == PCI_NOT_FOUND) { + if (ret == PCI_NOT_FOUND) { #ifdef XF86SCANPCI_WRAPPER XF86SCANPCI_WRAPPER(SCANPCI_TERM); #endif @@ -901,7 +896,7 @@ xf86MsgVerb(X_INFO, 2, "PCI: PCI scan (all values are in hex)\n"); #endif - while (idx < MAX_PCI_DEVICES && tag != PCI_NOT_FOUND) { + while (idx < MAX_PCI_DEVICES && ret != PCI_NOT_FOUND) { devp = xcalloc(1, sizeof(pciDevice)); if (!devp) { xf86Msg(X_ERROR, @@ -910,14 +905,11 @@ } /* Identify pci device by bus, dev, func, and tag */ - devp->tag = tag; - devp->busnum = PCI_BUS_FROM_TAG(tag); - devp->devnum = PCI_DEV_FROM_TAG(tag); - devp->funcnum = PCI_FUNC_FROM_TAG(tag); + devp->pciid = pciid; /* Read config space for this device */ for (i = 0; i < 17; i++) /* PCI hdr plus 1st dev spec dword */ - devp->cfgspc.dwords[i] = pciReadLong(tag, i * sizeof(CARD32)); + devp->cfgspc.dwords[i] = pciReadLong(&pciid, i * sizeof(CARD32)); /* Some broken devices don't implement this field... */ if (devp->pci_header_type == 0xff) @@ -928,7 +920,7 @@ /* Get base address sizes for type 0 headers */ for (i = 0; i < 7; i++) devp->basesize[i] = - pciGetBaseSize(tag, i, FALSE, &devp->minBasesize); + pciGetBaseSize(&pciid, i, FALSE, &devp->minBasesize); break; case 1: @@ -936,7 +928,7 @@ /* Allow master aborts to complete normally on secondary buses */ if (!(devp->pci_bridge_control & PCI_PCI_BRIDGE_MASTER_ABORT_EN)) break; - pciWriteByte(tag, PCI_PCI_BRIDGE_CONTROL_REG, + pciWriteByte(&pciid, PCI_PCI_BRIDGE_CONTROL_REG, devp->pci_bridge_control & ~(PCI_PCI_BRIDGE_MASTER_ABORT_EN | PCI_PCI_BRIDGE_SECONDARY_RESET)); @@ -948,14 +940,15 @@ #ifdef OLD_FORMAT xf86MsgVerb(X_INFO, 2, "PCI: BusID 0x%.2x,0x%02x,0x%1x " - "ID 0x%04x,0x%04x Rev 0x%02x Class 0x%02x,0x%02x\n", + "ID 0x%04x, +0x%04x Rev 0x%02x Class 0x%02x,0x%02x\n", devp->busnum, devp->devnum, devp->funcnum, devp->pci_vendor, devp->pci_device, devp->pci_rev_id, devp->pci_base_class, devp->pci_sub_class); #else xf86MsgVerb(X_INFO, 2, "PCI: %.2x:%02x:%1x: chip %04x,%04x" " card %04x,%04x rev %02x class %02x,%02x,%02x hdr %02x\n", - devp->busnum, devp->devnum, devp->funcnum, + devp->pciid.bus, devp->pciid.device, devp->pciid.func, devp->pci_vendor, devp->pci_device, devp->pci_subsys_vendor, devp->pci_subsys_card, devp->pci_rev_id, devp->pci_base_class, @@ -964,7 +957,7 @@ #endif pci_devp[idx++] = devp; - tag = pciFindNext(); + ret = pciFindNext(&pciid); #ifdef DEBUGPCI ErrorF("xf86scanpci: tag = pciFindNext = 0x%lx\n", tag); @@ -979,14 +972,14 @@ if ((devp->pci_base_class != PCI_CLASS_BRIDGE) || (devp->pci_sub_class != PCI_SUBCLASS_BRIDGE_HOST)) break; - pciBusInfo[devp->busnum]->bridge = devp; - pciBusInfo[devp->busnum]->primary_bus = devp->busnum; + pciBusInfo[devp->pciid.bus]->bridge = devp; + pciBusInfo[devp->pciid.bus]->primary_bus = devp->pciid.bus; break; case 1: case 2: - i = PCI_SECONDARY_BUS_EXTRACT(devp->pci_pp_bus_register, devp->tag); - if (i > devp->busnum) { + i = PCI_SECONDARY_BUS_EXTRACT(devp->pci_pp_bus_register, &devp->pciid); + if (i > devp->pciid.bus) { if (pciBusInfo[i]) { pciBusInfo[i]->bridge = devp; /* @@ -1001,7 +994,7 @@ } if (!(devp->pci_bridge_control & PCI_PCI_BRIDGE_MASTER_ABORT_EN)) break; - pciWriteByte(devp->tag, PCI_PCI_BRIDGE_CONTROL_REG, + pciWriteByte(&devp->pciid, PCI_PCI_BRIDGE_CONTROL_REG, devp->pci_bridge_control & ~PCI_PCI_BRIDGE_SECONDARY_RESET); break; @@ -1032,7 +1025,7 @@ } CARD32 -pciCheckForBrokenBase(PCITAG Tag,int basereg) +pciCheckForBrokenBase(PciBusId * Tag,int basereg) { pciWriteLong(Tag, PCI_MAP_REG_START + (basereg << 2), 0xffffffff); return pciReadLong(Tag, PCI_MAP_REG_START + (basereg << 2)); @@ -1041,7 +1034,7 @@ #if defined(INCLUDE_XF86_MAP_PCI_MEM) pointer -xf86MapPciMem(int ScreenNum, int Flags, PCITAG Tag, ADDRESS Base, +xf86MapPciMem(int ScreenNum, int Flags, PciBusId * Tag, ADDRESS Base, unsigned long Size) { ADDRESS hostbase = pciBusAddrToHostAddr(Tag, PCI_MEM,Base); @@ -1075,8 +1068,8 @@ } static int -handlePciBIOS(PCITAG Tag, int basereg, - int (*func)(PCITAG, CARD8*, ADDRESS, pointer), +handlePciBIOS(PciBusId *pciid, int basereg, + int (*func)(PciBusId *, CARD8*, ADDRESS, pointer), pointer args) { CARD32 romsave = 0; @@ -1086,7 +1079,7 @@ CARD8 tmp[64]; int ret = 0; - romsave = pciReadLong(Tag, PCI_MAP_ROM_REG); + romsave = pciReadLong(pciid, PCI_MAP_ROM_REG); for (i = ROM_BASE_PRESET; i <= ROM_BASE_FIND; i++) { memType savebase = 0, newbase, romaddr; @@ -1100,51 +1093,50 @@ } else b_reg = i; - if (!(newbase = getValidBIOSBase(Tag, b_reg))) + if (!(newbase = getValidBIOSBase(pciid, b_reg))) continue; /* no valid address found */ romaddr = PCIGETROM(newbase); /* if we use a mem base save it and move it out of the way */ if (b_reg >= 0 && b_reg <= 5) { - savebase = pciReadLong(Tag, PCI_MAP_REG_START+(b_reg<<2)); + savebase = pciReadLong(pciid, PCI_MAP_REG_START+(b_reg<<2)); xf86MsgVerb(X_INFO,5,"xf86ReadPciBios: modifying membase[%i]" - " for device %i:%i:%i\n", basereg, - (int)PCI_BUS_FROM_TAG(Tag), (int)PCI_DEV_FROM_TAG(Tag), - (int)PCI_FUNC_FROM_TAG(Tag)); - pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2), + " for device %i:%i\n", basereg, + pciid->bus, pciid->device); + pciWriteLong(pciid, PCI_MAP_REG_START + (b_reg << 2), (CARD32)~0); } /* Set ROM base address and enable ROM address decoding */ - pciWriteLong(Tag, PCI_MAP_ROM_REG, romaddr + pciWriteLong(pciid, PCI_MAP_ROM_REG, romaddr | PCI_MAP_ROM_DECODE_ENABLE); - hostbase = pciBusAddrToHostAddr(Tag, PCI_MEM, PCIGETROM(romaddr)); + hostbase = pciBusAddrToHostAddr(pciid, PCI_MEM, PCIGETROM(romaddr)); - if ((xf86ReadDomainMemory(Tag, hostbase, sizeof(tmp), tmp) != + if ((xf86ReadDomainMemory(pciid, hostbase, sizeof(tmp), tmp) != sizeof(tmp)) || (tmp[0] != 0x55) || (tmp[1] != 0xaa) || !tmp[2] ) { /* Restore the base registers if they were changed. */ - pciWriteLong(Tag, PCI_MAP_ROM_REG, romsave); - if (savebase) pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2), + pciWriteLong(pciid, PCI_MAP_ROM_REG, romsave); + if (savebase) pciWriteLong(pciid, PCI_MAP_REG_START + (b_reg << 2), (CARD32) savebase); /* No BIOS found: try another address */ continue; } - ret = (*func)(Tag, tmp, hostbase, args); + ret = (*func)(pciid, tmp, hostbase, args); /* Restore the base register if it was changed. */ - if (savebase) pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2), + if (savebase) pciWriteLong(pciid, PCI_MAP_REG_START + (b_reg << 2), (CARD32) savebase); /* Restore ROM address decoding */ - pciWriteLong(Tag, PCI_MAP_ROM_REG, romsave); + pciWriteLong(pciid, PCI_MAP_ROM_REG, romsave); return ret; } /* Restore ROM address decoding */ - pciWriteLong(Tag, PCI_MAP_ROM_REG, romsave); + pciWriteLong(pciid, PCI_MAP_ROM_REG, romsave); return 0; } @@ -1156,7 +1148,7 @@ } readBios, *readBiosPtr; static int -readPciBios(PCITAG Tag, CARD8* tmp, ADDRESS hostbase, pointer args) +readPciBios(PciBusId * pciid, CARD8* tmp, ADDRESS hostbase, pointer args) { unsigned int image_length = 0; readBiosPtr rd = args; @@ -1168,7 +1160,7 @@ unsigned char data[0x18]; unsigned char type; - if ((xf86ReadDomainMemory(Tag, hostbase + data_off, sizeof(data), data) + if ((xf86ReadDomainMemory(pciid, hostbase + data_off, sizeof(data), data) != sizeof(data)) || (data[0] != 'P') || (data[1] != 'C') || @@ -1190,7 +1182,7 @@ image_length, indicator); #endif hostbase += i_length; - if (xf86ReadDomainMemory(Tag, hostbase, sizeof(tmp), tmp) + if (xf86ReadDomainMemory(pciid, hostbase, sizeof(tmp), tmp) != sizeof(tmp)) break; continue; @@ -1230,14 +1222,14 @@ } /* Read BIOS */ - ret = xf86ReadDomainMemory(Tag, hostbase + rd->Offset, rd->Len, rd->Buf); + ret = xf86ReadDomainMemory(pciid, hostbase + rd->Offset, rd->Len, rd->Buf); } return ret; } static int -getPciBIOSTypes(PCITAG Tag, CARD8* tmp, ADDRESS hostbase, pointer arg) +getPciBIOSTypes(PciBusId * pciid, CARD8* tmp, ADDRESS hostbase, pointer arg) { int n = 0; PciBiosType *Buf = arg; @@ -1248,7 +1240,7 @@ unsigned char data[0x16]; unsigned int i_length; - if ((xf86ReadDomainMemory(Tag, hostbase + data_off, sizeof(data), data) + if ((xf86ReadDomainMemory(pciid, hostbase + data_off, sizeof(data), data) != sizeof(data)) || (data[0] != 'P') || (data[1] != 'C') || @@ -1273,7 +1265,7 @@ image_length, indicator); #endif hostbase += i_length; - if (xf86ReadDomainMemory(Tag, hostbase, sizeof(tmp), tmp) + if (xf86ReadDomainMemory(pciid, hostbase, sizeof(tmp), tmp) != sizeof(tmp)) break; continue; @@ -1281,56 +1273,58 @@ return n; } -typedef CARD32 (*ReadProcPtr)(PCITAG, int); -typedef void (*WriteProcPtr)(PCITAG, int, CARD32); +typedef CARD32 (*ReadProcPtr)(PciBusId *, int); +typedef void (*WriteProcPtr)(PciBusId *, int, CARD32); static int -HandlePciBios(PCITAG Tag, int basereg, - int (*func)(PCITAG, CARD8*, ADDRESS, pointer), +HandlePciBios(PciBusId *pciid, int basereg, + int (*func)(PciBusId *, CARD8*, ADDRESS, pointer), pointer ptr) { int n, num; CARD32 Acc1, Acc2; - PCITAG *pTag; + PciBusId *pTag; int i; + PciBusId bus_id; - n = handlePciBIOS(Tag,basereg,func,ptr); + n = handlePciBIOS(pciid,basereg,func,ptr); if (n) return n; - num = pciTestMultiDeviceCard(PCI_BUS_FROM_TAG(Tag), - PCI_DEV_FROM_TAG(Tag), - PCI_FUNC_FROM_TAG(Tag),&pTag); + bus_id = *pciid; + + num = pciTestMultiDeviceCard(&bus_id, &pTag); if (!num) return 0; #define PCI_ENA (PCI_CMD_MEM_ENABLE | PCI_CMD_IO_ENABLE) - Acc1 = pciReadLong(Tag, PCI_CMD_STAT_REG); - pciWriteLong(Tag, PCI_CMD_STAT_REG, (Acc1 & ~PCI_ENA)); + Acc1 = pciReadLong(&bus_id, PCI_CMD_STAT_REG); + pciWriteLong(&bus_id, PCI_CMD_STAT_REG, (Acc1 & ~PCI_ENA)); for (i = 0; i < num; i++) { - Acc2 = pciReadLong(pTag[i], PCI_CMD_STAT_REG); - pciWriteLong(pTag[i], PCI_CMD_STAT_REG, (Acc2 | PCI_ENA)); + Acc2 = pciReadLong(&pTag[i], PCI_CMD_STAT_REG); + pciWriteLong(&pTag[i], PCI_CMD_STAT_REG, (Acc2 | PCI_ENA)); - n = handlePciBIOS(pTag[i],0,func,ptr); + n = handlePciBIOS(&pTag[i],0,func,ptr); - pciWriteLong(pTag[i], PCI_CMD_STAT_REG, Acc2); + pciWriteLong(&pTag[i], PCI_CMD_STAT_REG, Acc2); if (n) break; } - pciWriteLong(Tag, PCI_CMD_STAT_REG, Acc1); + pciFreeTestMultiDeviceCardIds(pTag); + pciWriteLong(&bus_id, PCI_CMD_STAT_REG, Acc1); return n; } int -xf86ReadPciBIOS(unsigned long Offset, PCITAG Tag, int basereg, +xf86ReadPciBIOS(unsigned long Offset, PciBusId * Tag, int basereg, unsigned char *Buf, int Len) { return xf86ReadPciBIOSByType(Offset, Tag, basereg, Buf, Len, PCI_BIOS_PC); } int -xf86ReadPciBIOSByType(unsigned long Offset, PCITAG Tag, int basereg, +xf86ReadPciBIOSByType(unsigned long Offset, PciBusId * Tag, int basereg, unsigned char *Buf, int Len, PciBiosType Type) { @@ -1344,7 +1338,7 @@ } int -xf86GetAvailablePciBIOSTypes(PCITAG Tag, int basereg, PciBiosType *Buf) +xf86GetAvailablePciBIOSTypes(PciBusId * Tag, int basereg, PciBiosType *Buf) { return HandlePciBios(Tag, basereg, getPciBIOSTypes, (pointer) Buf); } @@ -1354,27 +1348,27 @@ #ifdef INCLUDE_XF86_NO_DOMAIN int -xf86GetPciDomain(PCITAG Tag) +xf86GetPciDomain(PciBusId * Tag) { return 0; } pointer -xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag, +xf86MapDomainMemory(int ScreenNum, int Flags, PciBusId * Tag, ADDRESS Base, unsigned long Size) { return xf86MapVidMem(ScreenNum, Flags, Base, Size); } IOADDRESS -xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag, +xf86MapDomainIO(int ScreenNum, int Flags, PciBusId * Tag, IOADDRESS Base, unsigned long Size) { return Base; } int -xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf) +xf86ReadDomainMemory(PciBusId *Tag, ADDRESS Base, int Len, unsigned char *Buf) { int ret, length, rlength; Index: hw/xfree86/os-support/bus/Pci.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v retrieving revision 1.9 diff -u -r1.9 Pci.h --- hw/xfree86/os-support/bus/Pci.h 3 Jul 2005 07:01:30 -0000 1.9 +++ hw/xfree86/os-support/bus/Pci.h 7 Aug 2005 04:22:56 -0000 @@ -131,41 +131,17 @@ #define DEVID(vendor, device) \ ((CARD32)((PCI_##device << 16) | PCI_##vendor)) -#ifndef PCI_DOM_MASK -# define PCI_DOM_MASK 0x0ffu -#endif -#define PCI_DOMBUS_MASK (((PCI_DOM_MASK) << 8) | 0x0ffu) - -/* - * "b" contains an optional domain number. - */ -#define PCI_MAKE_TAG(b,d,f) ((((b) & (PCI_DOMBUS_MASK)) << 16) | \ - (((d) & 0x00001fu) << 11) | \ - (((f) & 0x000007u) << 8)) - -#define PCI_MAKE_BUS(d,b) ((((d) & (PCI_DOM_MASK)) << 8) | ((b) & 0xffu)) - -#define PCI_DOM_FROM_TAG(tag) (((tag) >> 24) & (PCI_DOM_MASK)) -#define PCI_BUS_FROM_TAG(tag) (((tag) >> 16) & (PCI_DOMBUS_MASK)) -#define PCI_DEV_FROM_TAG(tag) (((tag) & 0x0000f800u) >> 11) -#define PCI_FUNC_FROM_TAG(tag) (((tag) & 0x00000700u) >> 8) - -#define PCI_DFN_FROM_TAG(tag) (((tag) & 0x0000ff00u) >> 8) -#define PCI_BDEV_FROM_TAG(tag) ((tag) & 0x00fff800u) - -#define PCI_DOM_FROM_BUS(bus) (((bus) >> 8) & (PCI_DOM_MASK)) -#define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu) -#define PCI_TAG_NO_DOMAIN(tag) ((tag) & 0x00ffff00u) - /* * Macros for bus numbers found in P2P headers. */ -#define PCI_PRIMARY_BUS_EXTRACT(x, tag) \ - ((((x) & PCI_PRIMARY_BUS_MASK ) >> 0) | (PCI_DOM_FROM_TAG(tag) << 8)) -#define PCI_SECONDARY_BUS_EXTRACT(x, tag) \ - ((((x) & PCI_SECONDARY_BUS_MASK ) >> 8) | (PCI_DOM_FROM_TAG(tag) << 8)) -#define PCI_SUBORDINATE_BUS_EXTRACT(x, tag) \ - ((((x) & PCI_SUBORDINATE_BUS_MASK) >> 16) | (PCI_DOM_FROM_TAG(tag) << 8)) +#define PCI_PRIMARY_BUS_EXTRACT(x, id) \ + (((x) & PCI_PRIMARY_BUS_MASK) >> 0) | ((id)->domain << 8) +#define PCI_SECONDARY_BUS_EXTRACT(x, id) \ + ((((x) & PCI_SECONDARY_BUS_MASK ) >> 8) | (id)->domain << 8) +#define PCI_SUBORDINATE_BUS_EXTRACT(x, id) \ + ((((x) & PCI_SUBORDINATE_BUS_MASK) >> 16) | (id)->domain << 8) + +#if 0 #define PCI_PRIMARY_BUS_INSERT(x, y) \ (((x) & ~PCI_PRIMARY_BUS_MASK ) | (((y) & 0xffu) << 0)) @@ -188,6 +164,7 @@ PCI_SECONDARY_BUS_INSERT(x, tag) #define PCI_CB_SUBORDINATE_BUS_INSERT(x, tag) \ PCI_SUBORDINATE_BUS_INSERT(x, tag) +#endif #if X_BYTE_ORDER == X_BIG_ENDIAN #define PCI_CPU(val) (((val >> 24) & 0x000000ff) | \ @@ -369,11 +346,11 @@ * (e.g. a primary PCI bus and all of its secondaries) */ typedef struct pci_bus_funcs { - CARD32 (*pciReadLong)(PCITAG, int); - void (*pciWriteLong)(PCITAG, int, CARD32); - void (*pciSetBitsLong)(PCITAG, int, CARD32, CARD32); - ADDRESS (*pciAddrHostToBus)(PCITAG, PciAddrType, ADDRESS); - ADDRESS (*pciAddrBusToHost)(PCITAG, PciAddrType, ADDRESS); + CARD32 (*pciReadLong)(PciBusId *, int); + void (*pciWriteLong)(PciBusId *, int, CARD32); + void (*pciSetBitsLong)(PciBusId *, int, CARD32, CARD32); + ADDRESS (*pciAddrHostToBus)(PciBusId *, PciAddrType, ADDRESS); + ADDRESS (*pciAddrBusToHost)(PciBusId *, PciAddrType, ADDRESS); /* * The next three are optional. If NULL, the corresponding function is * to be performed generically. @@ -410,18 +387,18 @@ #define PCI_CFG_MECH_OTHER 3 /* Something else */ /* Generic PCI service functions and helpers */ -PCITAG pciGenFindFirst(void); -PCITAG pciGenFindNext(void); -CARD32 pciCfgMech1Read(PCITAG tag, int offset); -void pciCfgMech1Write(PCITAG tag, int offset, CARD32 val); -void pciCfgMech1SetBits(PCITAG tag, int offset, CARD32 mask, +unsigned int pciGenFindFirst(PciBusId *pciid); +unsigned int pciGenFindNext(PciBusId *pciid); +CARD32 pciCfgMech1Read(PciBusId * tag, int offset); +void pciCfgMech1Write(PciBusId * tag, int offset, CARD32 val); +void pciCfgMech1SetBits(PciBusId * tag, int offset, CARD32 mask, CARD32 val); CARD32 pciByteSwap(CARD32); -Bool pciMfDev(int, int); -ADDRESS pciAddrNOOP(PCITAG tag, PciAddrType type, ADDRESS); +Bool pciMfDev(PciBusId *); +ADDRESS pciAddrNOOP(PciBusId * tag, PciAddrType type, ADDRESS); -extern PCITAG (*pciFindFirstFP)(void); -extern PCITAG (*pciFindNextFP)(void); +extern unsigned int (*pciFindFirstFP)(PciBusId *); +extern unsigned int (*pciFindNextFP)(PciBusId *); extern CARD32 pciDevid; extern CARD32 pciDevidMask; @@ -431,7 +408,7 @@ extern int pciBusNum; extern int pciDevNum; extern int pciFuncNum; -extern PCITAG pciDeviceTag; +extern PciBusId *pciDeviceTag; extern pciBusInfo_t *pciBusInfo[]; Index: hw/xfree86/os-support/bus/ix86Pci.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c,v retrieving revision 1.5 diff -u -r1.5 ix86Pci.c --- hw/xfree86/os-support/bus/ix86Pci.c 3 Jul 2005 07:01:30 -0000 1.5 +++ hw/xfree86/os-support/bus/ix86Pci.c 7 Aug 2005 04:22:56 -0000 @@ -172,15 +172,15 @@ /* * Intel x86 platform specific PCI access functions */ -static CARD32 ix86PciReadLongSetup(PCITAG tag, int off); -static void ix86PciWriteLongSetup(PCITAG, int off, CARD32 val); -static void ix86PciSetBitsLongSetup(PCITAG, int off, CARD32 mask, CARD32 val); -static CARD32 ix86PciReadLongCFG1(PCITAG tag, int off); -static void ix86PciWriteLongCFG1(PCITAG, int off, CARD32 val); -static void ix86PciSetBitsLongCFG1(PCITAG, int off, CARD32 mask, CARD32 val); -static CARD32 ix86PciReadLongCFG2(PCITAG tag, int off); -static void ix86PciWriteLongCFG2(PCITAG, int off, CARD32 val); -static void ix86PciSetBitsLongCFG2(PCITAG, int off, CARD32 mask, CARD32 val); +static CARD32 ix86PciReadLongSetup(PciBusId *pciid, int off); +static void ix86PciWriteLongSetup(PciBusId *, int off, CARD32 val); +static void ix86PciSetBitsLongSetup(PciBusId *, int off, CARD32 mask, CARD32 val); +static CARD32 ix86PciReadLongCFG1(PciBusId *pciid, int off); +static void ix86PciWriteLongCFG1(PciBusId *, int off, CARD32 val); +static void ix86PciSetBitsLongCFG1(PciBusId *, int off, CARD32 mask, CARD32 val); +static CARD32 ix86PciReadLongCFG2(PciBusId *pciid, int off); +static void ix86PciWriteLongCFG2(PciBusId *, int off, CARD32 val); +static void ix86PciSetBitsLongCFG2(PciBusId *, int off, CARD32 mask, CARD32 val); static pciBusFuncs_t ix86Funcs0 = { /* pciReadLong */ ix86PciReadLongSetup, @@ -223,19 +223,22 @@ static Bool ix86PciBusCheck(void) { - PCITAG tag; + PciBusId pciid; CARD32 id, class; CARD8 device; for (device = 0; device < ix86Pci0.numDevices; device++) { - tag = PCI_MAKE_TAG(0, device, 0); - id = (*ix86Pci0.funcs->pciReadLong)(tag, PCI_ID_REG); + pciid.bus = 0; + pciid.domain = 0; + pciid.device = device; + pciid.func = 0; + id = (*ix86Pci0.funcs->pciReadLong)(&pciid, PCI_ID_REG); if ((CARD16)(id + 1U) <= (CARD16)1UL) continue; /* The rest of this is inspired by the Linux kernel */ - class = (*ix86Pci0.funcs->pciReadLong)(tag, PCI_CLASS_REG); + class = (*ix86Pci0.funcs->pciReadLong)(&pciid, PCI_CLASS_REG); /* Ignore revision id and programming interface */ switch (class >> 16) { @@ -550,22 +553,22 @@ #endif static CARD32 -ix86PciReadLongSetup(PCITAG Tag, int reg) +ix86PciReadLongSetup(PciBusId *pciid, int reg) { ix86PciSelectCfgmech(); - return (*ix86Pci0.funcs->pciReadLong)(Tag,reg); + return (*ix86Pci0.funcs->pciReadLong)(pciid,reg); } static CARD32 -ix86PciReadLongCFG1(PCITAG Tag, int reg) +ix86PciReadLongCFG1(PciBusId *pciid, int reg) { CARD32 addr, data = 0; #ifdef DEBUGPCI - ErrorF("ix86PciReadLong 0x%lx, %d\n", Tag, reg); + ErrorF("ix86PciReadLong %d:%d:%d, %d\n", pciid->bus, pciid->device, pciid->func, reg); #endif - addr = PCI_ADDR_FROM_TAG_CFG1(Tag,reg); + addr = PCI_ADDR_FROM_TAG_CFG1(pciid,reg); outl(PCI_CFGMECH1_ADDRESS_REG, addr); data = inl(PCI_CFGMECH1_DATA_REG); outl(PCI_CFGMECH1_ADDRESS_REG, 0); @@ -578,7 +581,7 @@ } static CARD32 -ix86PciReadLongCFG2(PCITAG Tag, int reg) +ix86PciReadLongCFG2(PciBusId *pciid, int reg) { CARD32 addr, data = 0; CARD8 forward, enable; @@ -605,14 +608,14 @@ } static void -ix86PciWriteLongSetup(PCITAG Tag, int reg, CARD32 data) +ix86PciWriteLongSetup(PciBusId *pciid, int reg, CARD32 data) { ix86PciSelectCfgmech(); (*ix86Pci0.funcs->pciWriteLong)(Tag,reg,data); } static void -ix86PciWriteLongCFG1(PCITAG Tag, int reg, CARD32 data) +ix86PciWriteLongCFG1(PciBusId *pciid, int reg, CARD32 data) { CARD32 addr; @@ -623,7 +626,7 @@ } static void -ix86PciWriteLongCFG2(PCITAG Tag, int reg, CARD32 data) +ix86PciWriteLongCFG2(PciBusId *pciid, int reg, CARD32 data) { CARD32 addr; CARD8 forward, enable; @@ -640,14 +643,14 @@ } static void -ix86PciSetBitsLongSetup(PCITAG Tag, int reg, CARD32 mask, CARD32 val) +ix86PciSetBitsLongSetup(PciBusId *pciid, int reg, CARD32 mask, CARD32 val) { ix86PciSelectCfgmech(); (*ix86Pci0.funcs->pciSetBitsLong)(Tag,reg,mask,val); } static void -ix86PciSetBitsLongCFG1(PCITAG Tag, int reg, CARD32 mask, CARD32 val) +ix86PciSetBitsLongCFG1(PciBusId *pciid, int reg, CARD32 mask, CARD32 val) { CARD32 addr, data = 0; @@ -664,7 +667,7 @@ } static void -ix86PciSetBitsLongCFG2(PCITAG Tag, int reg, CARD32 mask, CARD32 val) +ix86PciSetBitsLongCFG2(PciBusId *pciid, int reg, CARD32 mask, CARD32 val) { CARD32 addr, data = 0; CARD8 enable, forward; Index: hw/xfree86/os-support/bus/xf86Pci.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h,v retrieving revision 1.7 diff -u -r1.7 xf86Pci.h --- hw/xfree86/os-support/bus/xf86Pci.h 3 Jul 2005 08:53:46 -0000 1.7 +++ hw/xfree86/os-support/bus/xf86Pci.h 7 Aug 2005 04:22:57 -0000 @@ -413,7 +413,15 @@ /* Primitive Types */ typedef unsigned long ADDRESS; /* Memory/PCI address */ typedef unsigned long IOADDRESS; /* Must be large enough for a pointer */ -typedef unsigned long PCITAG; + +typedef struct { + int domain; + int bus; + int device; + int func; +} PciBusId; + +#define PCI_COMPARE_IDS(x, y) (((x).domain==(y).domain) && ((x).bus==(y).bus) && ((x).device==(y).device) && ((x).func==(y).func)) /* * PCI configuration space @@ -656,10 +664,7 @@ * PCI config space header */ typedef struct pci_device { - PCITAG tag; - int busnum; - int devnum; - int funcnum; + PciBusId pciid; pciCfgSpc cfgspc; int basesize[7]; /* number of bits in base addr allocations */ Bool minBasesize; @@ -759,41 +764,40 @@ /* Public PCI access functions */ void pciInit(void); -PCITAG pciFindFirst(CARD32 id, CARD32 mask); -PCITAG pciFindNext(void); -CARD32 pciReadLong(PCITAG tag, int offset); -CARD16 pciReadWord(PCITAG tag, int offset); -CARD8 pciReadByte(PCITAG tag, int offset); -void pciWriteLong(PCITAG tag, int offset, CARD32 val); -void pciWriteWord(PCITAG tag, int offset, CARD16 val); -void pciWriteByte(PCITAG tag, int offset, CARD8 val); -void pciSetBitsLong(PCITAG tag, int offset, CARD32 mask, CARD32 val); -void pciSetBitsByte(PCITAG tag, int offset, CARD8 mask, CARD8 val); -ADDRESS pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr); -ADDRESS pciHostAddrToBusAddr(PCITAG tag, PciAddrType type, ADDRESS addr); -PCITAG pciTag(int busnum, int devnum, int funcnum); -int pciGetBaseSize(PCITAG tag, int indx, Bool destructive, Bool *min); -CARD32 pciCheckForBrokenBase(PCITAG tag,int basereg); -pointer xf86MapPciMem(int ScreenNum, int Flags, PCITAG Tag, +unsigned int pciFindFirst(CARD32 id, CARD32 mask, PciBusId *); +unsigned int pciFindNext(PciBusId *); +CARD32 pciReadLong(PciBusId *tag, int offset); +CARD16 pciReadWord(PciBusId *tag, int offset); +CARD8 pciReadByte(PciBusId *tag, int offset); +void pciWriteLong(PciBusId *tag, int offset, CARD32 val); +void pciWriteWord(PciBusId *tag, int offset, CARD16 val); +void pciWriteByte(PciBusId *tag, int offset, CARD8 val); +void pciSetBitsLong(PciBusId *tag, int offset, CARD32 mask, CARD32 val); +void pciSetBitsByte(PciBusId *tag, int offset, CARD8 mask, CARD8 val); +ADDRESS pciBusAddrToHostAddr(PciBusId *tag, PciAddrType type, ADDRESS addr); +ADDRESS pciHostAddrToBusAddr(PciBusId *tag, PciAddrType type, ADDRESS addr); +int pciGetBaseSize(PciBusId *busid, int indx, Bool destructive, Bool *min); +CARD32 pciCheckForBrokenBase(PciBusId *tag,int basereg); +pointer xf86MapPciMem(int ScreenNum, int Flags, PciBusId *Tag, ADDRESS Base, unsigned long Size); -int xf86ReadPciBIOS(unsigned long Offset, PCITAG Tag, int basereg, +int xf86ReadPciBIOS(unsigned long Offset, PciBusId *Tag, int basereg, unsigned char *Buf, int Len); -int xf86ReadPciBIOSByType(unsigned long Offset, PCITAG Tag, +int xf86ReadPciBIOSByType(unsigned long Offset, PciBusId *Tag, int basereg, unsigned char *Buf, int Len, PciBiosType Type); -int xf86GetAvailablePciBIOSTypes(PCITAG Tag, int basereg, +int xf86GetAvailablePciBIOSTypes(PciBusId *Tag, int basereg, PciBiosType *Buf); pciConfigPtr *xf86scanpci(int flags); extern int pciNumBuses; /* Domain access functions. Some of these probably shouldn't be public */ -int xf86GetPciDomain(PCITAG tag); -pointer xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag, +int xf86GetPciDomain(PciBusId *tag); +pointer xf86MapDomainMemory(int ScreenNum, int Flags, PciBusId *Tag, ADDRESS Base, unsigned long Size); -IOADDRESS xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag, +IOADDRESS xf86MapDomainIO(int ScreenNum, int Flags, PciBusId *Tag, IOADDRESS Base, unsigned long Size); -int xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, +int xf86ReadDomainMemory(PciBusId *Tag, ADDRESS Base, int Len, unsigned char *Buf); typedef enum { Index: hw/xfree86/os-support/linux/lnx_pci.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c,v retrieving revision 1.7 diff -u -r1.7 lnx_pci.c --- hw/xfree86/os-support/linux/lnx_pci.c 3 Jul 2005 08:53:46 -0000 1.7 +++ hw/xfree86/os-support/linux/lnx_pci.c 7 Aug 2005 04:22:57 -0000 @@ -24,12 +24,13 @@ #endif Bool -xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits) +xf86GetPciSizeFromOS(PciBusId *tag, int index, int* bits) { FILE *file; char c[0x200]; char *res; - unsigned int bus, devfn, dev, fn; + PciBusId bus_id; + unsigned int bus, devfn; unsigned PCIADDR_TYPE size[7]; unsigned int num; signed PCIADDR_TYPE Size; @@ -67,9 +68,11 @@ fclose(file); return FALSE; } - dev = devfn >> 3; - fn = devfn & 0x7; - if (tag == pciTag(bus,dev,fn)) { + bus_id.domain = 0; + bus_id.bus = bus; + bus_id.device = devfn >> 3; + bus_id.func = devfn & 0x7; + if (PCI_COMPARE_IDS(*tag, bus_id)) { *bits = 0; if (size[index] != 0) { Size = size[index] - ((PCIADDR_TYPE) 1); @@ -92,12 +95,13 @@ /* Query the kvirt address (64bit) of a BAR range from TAG */ Bool -xf86GetPciOffsetFromOS(PCITAG tag, int index, unsigned long* bases) +xf86GetPciOffsetFromOS(PciBusId *tag, int index, unsigned long* bases) { FILE *file; char c[0x200]; char *res; - unsigned int bus, devfn, dev, fn; + PciBusId bus_id; + unsigned int bus, devfn; unsigned PCIADDR_TYPE offset[7]; unsigned int num; @@ -134,10 +138,12 @@ fclose(file); return FALSE; } - - dev = devfn >> 3; - fn = devfn & 0x7; - if (tag == pciTag(bus,dev,fn)) { + + bus_id.domain = 0; + bus_id.bus = bus; + bus_id.device = devfn >> 3; + bus_id.func = devfn & 0x7; + if (PCI_COMPARE_IDS(*tag, bus_id)) { /* return the offset for the index requested */ *bases = offset[index]; fclose(file); @@ -152,12 +158,13 @@ /* Query the kvirt address (64bit) of a BAR range from size for a given TAG */ unsigned long -xf86GetOSOffsetFromPCI(PCITAG tag, int space, unsigned long base) +xf86GetOSOffsetFromPCI(PciBusId *tag, int space, unsigned long base) { FILE *file; char c[0x200]; char *res; - unsigned int bus, devfn, dev, fn; + PciBusId bus_id; + unsigned int bus, devfn; unsigned PCIADDR_TYPE offset[7]; unsigned PCIADDR_TYPE size[7]; unsigned int num; @@ -195,9 +202,11 @@ return NULL; } - dev = devfn >> 3; - fn = devfn & 0x7; - if (tag == pciTag(bus,dev,fn)) { + bus_id.domain = 0; + bus_id.bus = bus; + bus_id.device = devfn >> 3; + bus_id.func = devfn & 0x7; + if (PCI_COMPARE_IDS(*tag, bus_id)) { /* ok now look through all the BAR values of this device */ for (ndx=0; ndx<7; ndx++) { unsigned long savePtr; Index: hw/xfree86/scanpci/xf86ScanPci.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.c,v retrieving revision 1.6 diff -u -r1.6 xf86ScanPci.c --- hw/xfree86/scanpci/xf86ScanPci.c 3 Jul 2005 08:53:48 -0000 1.6 +++ hw/xfree86/scanpci/xf86ScanPci.c 7 Aug 2005 04:22:57 -0000 @@ -350,7 +350,7 @@ const char *prefix1 = "", *prefix2 = ""; xf86MsgVerb(X_NONE, -verbosity, "(%d:%d:%d) ", - pcrp->busnum, pcrp->devnum, pcrp->funcnum); + pcrp->pciid.bus, pcrp->pciid.device, pcrp->pciid.func); /* * Lookup as much as we can about the device. Index: hw/xfree86/vgahw/vgaHW.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c,v retrieving revision 1.9 diff -u -r1.9 vgaHW.c --- hw/xfree86/vgahw/vgaHW.c 3 Jul 2005 08:53:48 -0000 1.9 +++ hw/xfree86/vgahw/vgaHW.c 7 Aug 2005 04:22:59 -0000 @@ -1721,7 +1721,7 @@ hwp->PIOOffset = scrp->domainIOBase; if ((pvp = xf86GetPciInfoForEntity(scrp->entityList[0]))) - hwp->Tag = pciTag(pvp->bus, pvp->device, pvp->func); + hwp->Tag = pciTag(&pvp->pciid); return TRUE; } Index: hw/xfree86/vgahw/vgaHW.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h,v retrieving revision 1.8 diff -u -r1.8 vgaHW.h --- hw/xfree86/vgahw/vgaHW.h 3 Jul 2005 08:53:48 -0000 1.8 +++ hw/xfree86/vgahw/vgaHW.h 7 Aug 2005 04:22:59 -0000 @@ -161,7 +161,7 @@ = pioreg */ vgaHWReadProcPtr readEnable; vgaHWWriteProcPtr writeEnable; - PCITAG Tag; + PciBusId Tag; } vgaHWRec; /* Some macros that VGA drivers can use in their ChipProbe() function */ Index: hw/xfree86/xf86cfg/loadmod.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/xf86cfg/loadmod.c,v retrieving revision 1.3 diff -u -r1.3 loadmod.c --- hw/xfree86/xf86cfg/loadmod.c 4 Dec 2004 00:43:11 -0000 1.3 +++ hw/xfree86/xf86cfg/loadmod.c 7 Aug 2005 04:22:59 -0000 @@ -78,7 +78,7 @@ void xf86DrvMsg(int, int, const char*, ...); pciConfigPtr *xf86GetPciConfigInfo(void); Bool xf86IsPrimaryPci(pcVideoPtr*); -Bool xf86CheckPciSlot(int bus, int device, int func); +Bool xf86CheckPciSlot(PciBusId *bus_id); #endif extern char *loaderPath, **loaderList, **ploaderList; @@ -675,7 +675,7 @@ } Bool -xf86CheckPciSlot(int bus, int device, int func) +xf86CheckPciSlot(PciBusId *bus_id) { return (False); }