Rockwell Automation 2711P Software Development Kit User Manual User Manual
Page 89

Publication 2711P-UM005A-EN-P - March 2007
Device Drivers 89
pDrvData->Gii.CheckPort = TRUE;
#if defined(DRV_USE_IO)
pDrvData->Gii.PortIsIO = TRUE;
#else // defined(DRV_USE_IO)
pDrvData->Gii.PortIsIO = FALSE;
#endif // defined(DRV_USE_IO)
#if defined(DRV_USE_ISR)
pDrvData->Gii.UseMaskReg = FALSE;
pDrvData->Gii.PortAddr = DRV_PORT_ADDR;
pDrvData->Gii.PortSize = DRV_PORT_SIZE;
pDrvData->Gii.Mask = DRV_INTSTAT_PENDING;
#endif // defined(DRV_USE_ISR)
#if defined(DRV_USE_PCI)
//
// Find the PCI devices driver information placed in
// the registry by the PCIBus enumerator.
//
if (!(dwErr = PciFindDevice((TCHAR *)dwContext,
DRV_VENDOR_ID,
DRV_DEVICE_ID,
&pDrvData->Dwi,
&pDrvData->Dii,
&pDrvData->Dpi)))
{
ERRORMSG(1,(_T("DRV_Init: call to PciFindDevice() failed [0x%08x]!\r\n"),dwErr));
DEBUGMSG(ZONE_FUNC, (TEXT("DRV_Init-\r\n")));
DRV_Deinit((DWORD)pDrvData);
return (0);
}
#else // defined(DRV_USE_PCI)
//
// Here you may want to load registry values from
// another location
//
#endif // defined(DRV_USE_PCI)
//
// If the IRQ value has not been set yet, try
// alternate methods to setting it.
//
if (0 == pDrvData->Dii.dwIrq)
{
#if defined(DRV_USE_PCI)
PCI_COMMON_CONFIG Pcc;
PCI_SLOT_NUMBER Sn;
DWORD dwLength;
#endif // defined(DRV_USE_PCI)
// Set a default value from a constant.
//
pDrvData->Dii.dwIrq = DRV_IRQ;
#if defined(DRV_USE_PCI)