I have a problem that makes no sense with HalGetBusData(). It is
actually
locking up the computer after finding two of the 4 PCI cards in the NT
4.0 computer.
It works fine on another computer. Following is an excerpt of the code.
Before finding the card that I am looking for, the system hangs on
HalGetBusData() after finding the second card(my PCI card is the last
card
in the system). It step to HalGetBusData() and it never returns.
What could possibly be the problem?
Thanks,
Ed
Note: Please see my code below…
int PCIFindDevice(struct packed_port_param *pcb,UI *DevBase,UI *DevIrq)
{
PCI_COMMON_CONFIG PCIInfo;
PCI_SLOT_NUMBER SlotNumber;
int BusNumber;
int DeviceNumber;
int FunctionNumber;
ULONG stat;
UI found=0;
for (BusNumber=0;;BusNumber++)
for (DeviceNumber=0;DeviceNumber<pci_max_devices> for (FunctionNumber=0; FunctionNumber<pci_max_function> FunctionNumber++)
{
SlotNumber.u.bits.Reserved = 0;
SlotNumber.u.bits.DeviceNumber = DeviceNumber;
SlotNumber.u.bits.FunctionNumber = FunctionNumber;
if ((stat=HalGetBusData(PCIConfiguration,
BusNumber,SlotNumber.u.AsULONG,&PCIInfo,
sizeof(PCI_COMMON_CONFIG))) == 0)
return(RS232ERR_PORT);
if (stat == 2)
continue;
if ((PCIInfo.VendorID == pcb->ser_rs232_base) &&
(PCIInfo.DeviceID == pcb->cardseg))
if (++found == pcb->dflag)
{
*DevBase
=(PCIInfo.u.type0.BaseAddresses[pcb->ddata]
& 0xfffe) + (pcb->aux_addr1 * 8);
*DevIrq =PCIInfo.u.type0.InterruptLine;
return(RS232ERR_NONE);
}
continue;
}
}
WCSC(Willies Computer Software Co)
http://www.wcscnet.com
Tel: (281)360-4232 Fax: (281)360-3231</pci_max_function></pci_max_devices>