34 High Availability Software for the Intel® NetStructureTM ZT 4901 Technical Product Specification
High Availability CompactPCI Device Drivers
Add Device
Resume Operations
Suspend Operations
Remove Device
5.1.2.1 Add Device
Add Device is the device driver call made by the Hot Swap Manager either when an asserted
ENUM signal is detected or during the kernel load time. The Add Device callback execution
indicates to a device driver that an instance of a device that the driver can control has been
detected. The driver should perform any internal structure initialization, but should not attempt to
initialize the device.
This is where device driver design on a Redundant Host architecture capable device branches from
common device driver practices. Normally during the Add Device callback the driver initializes the
device. During the Add Device execution in a Redundant Host architecture, the device cannot be
assumed to be physically visible to the Host making the Add Device call.
The Intel® Redundant Host architecture supplies a PCI Configuration Space Spoofing mechanism
that provides the Host with the ability to query the configuration of backplane devices, whether or
not the devices are physically visible. In this manner a device driver can query the information
required to allocate the appropriate resources. Any operations that require direct access to the
backplane device may only occur in the Resume Operations and Suspend Operations callbacks.
5.1.2.2 Resume Operations
The kernel calls the Resume Operations function only when the Host has visibility of the
CompactPCI backplane device. It is during this operation that the device driver can perform direct
device accesses. This may entail initializing the device, querying current device status, or simply
placing the device into a known state. It is normally in the Resume Operations callback that the
Interrupt Service Routine (ISR) is connected or chained to the appropriate interrupt signal.
As stated earlier, to the driver should not attempt to access a device unless the Host has physical
visibility to the device. If an access is attempted to a non-owned or non-visible CompactPCI device
then a system crash may occur.
This also applies to kernel accesses to non-visible devices. An example of this is if the kernel
detects an interrupt and executes the ISRs attached to what could be a shared interrupt signal. The
device driver normally does this by querying the controlled device. If the device is not visible to the
querying Host, then a system crash may occur.
Two ways to help protect against this situation are:
1. Connect the device driver’s ISR only when the Resume Operation callback is executed
2. Make a sanity check at the top of the ISR to see if the device is visible to the executing Host.
The Intel HA SDK provides a kernel level query function that can be used by device drivers to
determine if the Host controls the bus segment on which the CompactPCI device resides.