Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

Using Interrupt Mode, IRQ resource limitations must be considered.

...

Finding an exclusive IRQ often requires physically moving hardware around in the system or disabling other Windows devices.

This Application Note explainesexplains, how the Interrupt Number is assigned by the System and how to search for a free interrupt number in case of shared IRQ.

Interrupt and CIFX Device Driver (INtime)

Erkennt der Treiber eine CIFX-Karte, so wird diese in die interne Verwaltungsstruktur auf genommen und dann am Ende der Initialisierung wird nach den Settings aus der Registry gefragt.

Damit der Interrupt auch eingeschaltet werden kann, muß die Hardware auch einen Interrupt zugeordnet bekommen haben.

Hierbei gilt:

...

MSI gibt es nur bei PCIe Hardware und unsere Karten unterstützen dies leider nicht.

Durch die Konfiguration unserer Karte und den Information aus den INF-Dateien zum Installieren der Harware, bekommt das Betriebssystem mitgeteilt das die Hardware kein MSI unterstützt und somit auch keine MSI Interrupt-Nummer erhält.

Also sind hier nur 0 oder Interrupt-Nummer von 1 bis 19 von Bedeutung.
 

Zu den Informationen von der Hardware liest der Treiber auch noch die User-Settings zu jeder Karte aus der Registry aus, um zu entscheiden ob der Interrupt eingeschaltet werden soll oder nicht.

Activate Interrupt mode

Für das interne Handling von Interrupten ist dann noch ein sog. Interrupt-Thread erforderlich und der Interrupt muss am System angemeldet werden.

Sollte hier ein Fehler auftreten dann wird, obwohl der Interrupt in der Registry "endabled" wurde, das interne Interrupt-Flag gelöscht und damit das Interrupt-Handling "disabled".

Das Ergebnis sieht man dann in der "BOARD_INFORMATION" Struktur,in der das Element "bIrqEnabled" auf 0 sitzt.

Eigentlich besitzt unser Treiber eine TRACE-Ausgabe und diese sollte bei einem internen Fehler eine entsprechende Fehlerausgabe generieren.

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 PCIe cards always request an interrupt and therefore should get one assigned.

...

By changing the view in the device manager to "ressources resources by type", the assigned IRQ number for each device is shown:



Interrupte Exclusive Zuordnen

Da es Sache des BIOS und des Betriebssystems ist Hardware-Resourcen zu verteilen gibt es hier, soweit uns bekannt ist, keine Möglichkeit dies manuell zu machen.

Suchen eine freien Interrupts

...

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), die abwechseln den PCI Geräten und auch den PCI-Slot auf einem Main-Board zu geordnet sind.

Zu diesen generellen Leitungen gibt es dann eine Mapping-Matrix auf der Hardware, wo diesen Leitungen einer Interrupt-Nummer zugeordnet werden.

Sollte sich nun ein Karten-Slot mit anderen PCI Geräte in einem Rechner den Interrupt teilen, dann kann versucht werden die anderen Geräte zu deaktivieren.

Dies funktioniert natürlich nur insoweit, wie die Geräte die zu deaktivieren sind nicht vom System benötigt werden.

Image Removed

In diesem Beispiel könnte man versuchen das "Intel Active Management" Gerät zu deaktivieren.

Aber es kann dann auch passieren, das beim nächsten Start, das System einen anderes Gerät so umkonfiguriert das es dann wieder ein Interrupt-sharing gibt.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.

Image Added

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)

Image Added

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)