The Hot Swap Engine acts as a generic Hot-Swap/Hot-Plug System Driver (as described in the Hot Swap Specification PICMG 2.1 R2.0). Its main task is to detect hot swap events and identify the hot swapped board's required resources. On Windows platforms you have the option to use the Hot Swap Engine to dynamically allocate the hot swapped board's resources (or de-allocate them upon the board removal).
In order to detect live insertion/removal of CompactPCI devices from the bus, the Hot Swap Engine can use one of the following methods: polling the CompactPCI bus periodically, or polling the ENUM# signal[2].
When the polling mechanism is activated by WD_WatchPciStart(), the
Hot Swap Engine starts polling the bus periodically. This is Go-HotSwap's
default mechanism for detection of hot swap events, because it allows
compliance with all CompactPCI system configurations and board types
(including basic and full hot swap boards).
The Hot Swap Specification PICMG 2.1 R1.0 allows the ENUM# signal to either
drive an interrupt or be polled by the system software at regular intervals.
The implementation and support of the ENUM# signal requires platform specific
support, making the bus polling mechanism a better choice as the default
mechanism for detection of hot swap events. Moreover, this architecture allows
Go-HotSwap to enable hot swap with boards that do not implement the ENUM#
signal at all.
After initiation, the Hot Swap Engine scans the CompactPCI bus to determine
which devices are actually present. To do this, the Hot Swap Engine accesses
the PCI Configuration Space and reads the Vendor ID register in each
one of the possible 32 CompactPCI slots on each of the CompactPCI buses. The
bus reports an attempt to read the Vendor ID of non-existent devices by
returning a value of all 1's.
When a board is found, the Hot Swap Engine retrieves additional information,
such as:
At the end of this process the Hot Swap Engine constructs a list of existing buses, boards and functions.
At the next polling cycle the Hot Swap Engine will poll the listed buses, boards and functions, along with the PCI buses, updating the scan list according to changes that result from insertion/extraction of boards, into or out of the system.
From this point onward, the PCI buses are polled constantly at regular intervals, thus updating and constructing a new scan list whenever a change is made.
Once a new scan list has been constructed, the engine compares the new list to
the old one. It sends a message concerning any modification it detected to the
kernel-mode Messaging Mechanism, from where it can be extracted by the
relevant processes (user-mode applications or device drivers).
The Hot Swap Engine will detect one of the following modifications:
Go-HotSwap enables you to hook into the ENUM# signal in order to detect hot swap events. In this case you should not activate the polling mechanism, but instead instruct your application to listen to the ENUM# interrupt in order to detect the hot swap events. Listening to the ENUM# interrupt is done with WinDriver's interrupt handling API. Please refer to the WinDriver PCI Manual for detailed information.
![]() | |
The resource allocation is performed by the Hot Swap Engine unless you specify
to use the operating system's Plug-and-Play Manager for this purpose. In
WD_WatchPciStart() [A.1.3] the
dwOptions field can be changed to specify that the operating system is
responsible for resource allocation.
|
In non-hot swap systems, enumeration only takes place as the system boots.
The Go-HotSwap software enables live enumeration under a running system. When
a hot swap board is inserted into the system, the Hot Swap Engine performs the
process of Dynamic Configuration, whereby it allocates system resources to the
board[3] while the system is running.
When using the polling method, the Hot Swap Engine automatically allocates (or
de-allocates) the required resources. When using the ENUM# signal to detect
hot swap events, the Go-HotSwap function WD_HsEventSend() should
be called in order to allocate (or de-allocate) the required resources. Please
refer to the Go-HotSwap Function Reference for more information regarding this
function.
The allocated system resources are some or all of the following:
The resource allocation process differs in the case of a simple board and a PCI Bus Master.
When the Hot Swap Engine detects a board that requires interrupts, it assigns the interrupts as follows:
In order to access the board, the engine sets the Command register in the PCI configuration space to a predefined value, as defined in the PCI specification R2.2.
When the allocation process is complete, the relevant drivers/applications are notified by the Hot Swap Engine of the boards'/ devices' newly allocated resources. This message is either transferred directly to the driver (if a hot swap aware driver had been developed), or via the Go-HotSwap Configuration Manager (if a legacy PCI driver had been used without any driver code programming or modifications).