CIFX Device Driver (INtime) - Using Interrupt Mode
Introduction
Using Interrupt Mode, IRQ resource limitations must be considered.
As INtime does not support sharing IRQ lines with Windows devices, the interrupt line which INtime uses must be available for exclusive use.
Finding an exclusive IRQ often requires physically moving hardware around in the system or disabling other Windows devices.
This Application Note explains, how the Interrupt Number is assigned by the System and how to search for a free interrupt number in case of shared IRQ.
Physical Interrupt Number
With PCI / PCIE hardware, interrupt numbers are distributed to the hardware either by the BIOS or the operating system.
By default, our PCI / PCIe cards always request an interrupt and therefore should get one assigned.
In Windows, this is visible in the hardware resources:
By changing the view in the device manager to "resources by type", the assigned IRQ number for each device is shown:
Assign exclusive Interrupt
Since it is part of the BIOS and the operating system to distribute hardware resources, there is no way to do this manually.
Searching for a free Interrupt
Changing card slots can work to a limited extent.
In general, there are 4 legacy interrupt lines (A / B / C / D), which are alternately assigned to the PCI devices and also to the PCI slot on a main board.
There is a mapping matrix on the hardware for these general lines, where an interrupt number is assigned to these lines.
If a card slot now shares the interrupt with other PCI devices in a computer, an attempt can be made to deactivate the other devices.
Of course, this only works if the devices that need to be deactivated are not required by the system.
In this example, the "Intel Active Management" device could be deactivated.
Nevertheless, it could happen that next time the system is started, it reconfigures another device in such a way, that there is a shared interrupt again.
Interrupt and CIFX Device Driver (INtime)
If the driver identifies a CIFX Card, the CIFX Card will be integrated to its administrative structure.
At the end of the initialization, the settings from the registry are requested.
The Registry Entry with the requested settings is saved in the following path:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\cifXDrv\DeviceConfig\(Article_Number)\(Serial_Number)
or: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\cifXDrv\DeviceConfig\Slot\(Slot_Number)
Activate Interrupt Mode
For the interrupt to be enabled, there must be an Interrupt assigned to the Hardware.
The following applies here:
- Interrupt Number 0 = no Interrupt
- Interrupt Number > 0 ⇒ Physical Interrupt Number (Legacy Interrupt : 1 - 19)
- Interrupt Number < 0 ⇒ Message-based Interrupt Number (MSI)
MSI is not supported by Hilscher CIFX Cards.
Due to the configuration and the information from the INF files for installing the hardware, the operating system is informed that the hardware does not support MSI and therefore does not receive an MSI interrupt number.
Therefore, only 0 or interrupt numbers from 1 to 19 are important here.
In addition to the information from the hardware, the driver reads the user settings for each card from the registry to decide whether the interrupt should be switched on or not.
For the Handling of the Interrupt, a so-called Interrupt Thread is needed, and the Interrupt needs to be registered to the system.
If an error occurs during this process, although the interrupt was "enabled" in the registry, the internal interrupt flag is deleted and the interrupt handling is "disabled".
The result can be seen in the "Board information" structure, in which "bIrqEnabled" is set to 0.
For more information about the "Board information" structure, please see page 18 of the following manual: cifX API (Revision 9)