DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Linking and testing SCO OpenServer 5 drivers

Configuring interrupt handlers

The six different types of interrupt handling that can be used by a device driver are listed on the sdevice(F) manual page. These types can be divided into three basic groups according to the capabilities of the device being controlled and how the driver handles this:


type 0
The device does not use an interrupt request line (IRQ) or the driver registers the IRQ dynamically when it initializes.

types 1 and 2
The driver uses an IRQ exclusively for itself although it may share this among several devices that it controls.

types 3, 4 and 5
The driver can share an IRQ between devices. Note that the number of devices that can share a single IRQ is determined by the NSHINTR tunable parameter. The default value for this parameter is 8 but it can be set as high as 20. NSHINTR is accessed through the configure utility, under Miscellaneous device driver and hardware parameters.
If interrupts are used, you need to decide how the vector is installed. There are three possibilities:
If a device uses a hardware interrupt line exclusively for itself, it may be necessary to change the interrupt it uses if another device uses the same interrupt. This does not apply to bus architectures, such as PCI, which support dynamically allocatable interrupts. On other bus architectures, the device controller card may have jumpers that enable the IRQ setting to be changed, or there may be a setup program available to respecify the IRQ. In some cases, it may not be possible to change the IRQ.

If interrupts are used, you also need to decide on the interrupt priority level (IPL) which is determined by the type of driver; see spl(D3oddi) for more information.

The following tables show the appropriate values to be inserted in the driver's sdevice and mdevice entry. For drivers that register their use of interrupts using add_intr_handler(D3oddi) or idistributed(D3oddi), the appropriate value of the type argument and the mode member of the driver_info structure (defined in <sys/ci/ciintr.h>) are shown respectively.

Use of IRQ installed by sdevice mdevice add_intr_handler
interrupt col 4 col 5 col 6 col 3
by driver IPL type vector chars type
Not used Link Kit only 0 0 0 Not used
Exclusive Link Kit only ipl 1,2 irq Not used
Exclusive Link Kit + driver ipl 1 irq G 1
ipl 2 irq G 2
Exclusive Driver only 0 0 0 1
0 0 0 2
Shared Link Kit only ipl 3 irq Not used
ipl 4 irq Not used
ipl 5 irq Not used
Shared Link Kit + driver ipl 3 irq G 3
ipl 4 irq G 4
ipl 5 irq G 5
Shared Driver only 0 0 0 3
0 0 0 4
0 0 0 5

Use of IRQ installed by sdevice mdevice idistributed
interrupt col 4 col 5 col 6 col 3
by driver IPL type vector chars dip->mode
Not used Link Kit only 0 0 0 IMODE_NONE
Exclusive Link Kit only ipl 1,2 irq IMODE_NONE
Exclusive Link Kit + driver ipl 1 irq G IMODE_EXCLUSIVE
ipl 2 irq G IMODE_SHARED_DRIVER
Exclusive Driver only 0 0 0 IMODE_EXCLUSIVE
0 0 0 IMODE_SHARED_DRIVER
Shared Link Kit only ipl 3 irq IMODE_SHARED_DRIVERIPL
ipl 4 irq IMODE_SHARED_CDRIVERIPL
ipl 5 irq IMODE_SHARED_INTER
Shared Link Kit + driver ipl 3 irq G IMODE_SHARED_DRIVERIPL
ipl 4 irq G IMODE_SHARED_CDRIVERIPL
ipl 5 irq G IMODE_SHARED_INTER
Shared Driver only 0 0 0 IMODE_SHARED_DRIVERIPL
0 0 0 IMODE_SHARED_CDRIVERIPL
0 0 0 IMODE_SHARED_INTER
ipl is the interrupt priority level (IPL) for which the driver is designed. Although it is defined in sdevice(F), its value is not adjustable.

irq is the interrupt request line (IRQ) configured for the hardware on a system. If the hardware allows the IRQ to be changed using jumpers or a setup program:



© 2005 The SCO Group, Inc. All rights reserved.