4.4  The Configuration Manager

4.4.1  Overview

When developing a hot swap aware driver, using the WinDriver driver development toolkit or any other development tool, Go-HotSwap is able to interface directly with the driver within the kernel mode. However, legacy PCI drivers were written without hot swap support, and are provided by vendors without the necessary software layers required to support hot swapping.

Go-HotSwap Configuration Manager enables immediate implementation of hot swap capabilities using a legacy PCI driver without any driver code programming or modifications. In this case, the Configuration Manager initiates the Hot Swap Engine and interfaces with the user to receive further instructions.

The user can instruct the Configuration Manager to load/unload a PCI driver during the insertion/extraction of a board, or to run any user-mode application or script. These instructions are kept in the Configuration Manager's database, as a configuration file. The Configuration Manager's database is constructed of a list of hot swap enabled cards, and a list of instructions for each card, to be performed upon insertion or removal of the card.

The Configuration Manager is not needed when a CompactPCI hot swap aware driver is developed with the included Go-HotSwap driver development toolkit, other than for activating/stopping the Hot Swap Engine. In this case, the data from the Hot Swap Engine is transferred directly to the newly developed CompactPCI driver using the kernel-mode Messaging Mechanism. The Hot Swap Engine can also be activated by adding WD_WatchPciStart() [A.1.3] to the hot swap aware driver developed with Go-HotSwap/WinDriver, instead of using the Configuration Manager.

[Note]
The Configuration Manager is currently included only in the Windows versions. On Linux you may use hs_activate, which is the console version of this utility.

4.4.2  Configuration Manager Database

The Database can be viewed by opening the Configuration Manager screen.

Figure 4.2  The Configuration Manager Database

The Configuration Manager Database


In order for the Configuration Manager to support a card's hot swap functionality, the card must be registered to the Configuration Manager's database.

The registration can be initiated manually by the user, otherwise it is automatically registered by Go-HotSwap, when a card that is not listed in the database is hot swapped.

4.4.2.1  Manual Registration Initiation

In order to manually add a board to the database, simply open the Go-HotSwap Configuration Manager's device configuration screen, press Add and fill in the relevant details in the appropriate fields: device ID, vendor ID and if necessary, bus, slot and function.

4.4.2.2  Automatic Registration Initiation

When a board that is not listed in the Configuration Manager's database is hot swapped, a pop-up message appears, asking the user whether to enable the board hot swap abilities, ignore the device or always ignore the device:

Figure 4.3  New Device Inserted

New Device Inserted


Any of the options will result in an automatic registration of the card to the Configuration Manager database.

4.4.3  Configuring the Configuration Manager

Go-HotSwap user-mode Configuration Manager enables the user to configure the system to perform certain actions upon card insertion and/or card removal.

The following actions are supported:

  • Running a batch file (a file that contains a sequence of commands to be executed together).
  • Running an EXE file (an executable file with an .EXE extension, file in a format that the computer can directly execute).
  • Starting/stopping a service (this includes starting/stopping NT drivers).

Figure 4.4  Edit Device Configuration

Edit Device Configuration


The Configuration Manager can be configured easily using the Edit Device Configuration screen to execute any of the above listed tasks, upon insertion or removal of the card.
In the Edit Device Configuration screen, you can easily add or remove tasks, and edit each one of the tasks as described later.

The Configuration Manager can be configured to run any of the tasks in parallel or serially (i.e. complete one task before starting the next one).

4.4.4  Running a Batch File

Open the Go-HotSwap Configuration Manager, press Edit, and the Edit Device Configuration screen will be displayed. Press Add to open the Define Insertion/Removal Action screen:

Figure 4.5  Define Insertion Action

Define Insertion Action


Specify the batch file name in the File/Service box along with any other parameters required, if any. The parameters must be entered as shown below:

<Batch File> #bus# #slot# #function# #vendor# #device#

where:

  • <Batch File> is the name of your batch file with or without the extension. If the absolute path of the file is not specified, then the batch file is assumed to be in the current directory.
  • #bus# – instructs Go-HotSwap to send the bus number on which the board resides to the batch file.
  • #slot# – instructs Go-HotSwap to send the appropriate slot number in which the board resides to the batch file.
  • #function# – instructs Go-HotSwap to send the appropriate function number of the card to the batch file.
  • #vendor# – instructs Go-HotSwap to send the relevant Vendor ID of the card to the batch file.
  • #device# – instructs Go-HotSwap to send the relevant Device ID of the card to the batch file.

[Note]
The parameters are meta parameters; do not replace them with real values. For example, if the name of the batch file is MyFile.bat and it requires the bus and function numbers to be sent to the batch file, then type exactly:
MyFile.bat #bus# #function#

4.4.5  Running an EXE File

An EXE file can also be run automatically during the card insertion and removal. The format of the parameters passed for the EXE file is the same as that for a batch file.

4.4.6  Starting and Stopping Services

On Windows 7/Vista/Server 2008/Server 2003/XP/2000, a service can be dynamically started and stopped using the following commands:

  • \> net start <driver name>
  • \> net stop <driver name>

4.4.7  Using Legacy Drivers on Windows

Generally legacy drivers are not hot swap aware, specifically they are incapable of detecting hot insertion or removal. Go-HotSwap adds hot swap awareness to PnP compliant legacy drivers. Go-HotSwap detects hot insertion/removal of all CompactPCI devices and uses the standard operating system's PnP support to notify the legacy driver of PnP events.

In order to use Go-HotSwap with legacy drivers, you must first install the legacy driver's INF file supplied by the vendor. Then activate the Go-HotSwap Configuration Manager, which starts the Hot Swap Engine. Once the INF is installed and the Hot Swap Engine is activated, the Windows PnP Manager will notify the legacy driver of PnP events.