Go-HotSwap and the included WinDriver toolkit provide an API with which you can achieve hot swap capabilities. From a process point of view, if you choose this method, there are two development challenges:
Here is a more detailed description of these steps:
If you have not yet developed hardware access code, we recommend you use Jungo's WinDriver toolkit, for it dramatically reduces development time; moreover, the generated code has cross operating system capabilities. Detailed information on driver development issues (such as interrupt handling, DMA, improving performance, etc.), and the WinDriver tools, can be found in the WinDriver PCI Manual.
The WinDriver toolkit includes a wizard that helps generate your skeletal driver's hardware access code. During this process, you are asked to select your driver's options, one of which is Plug-and-Play notifications, another is power management notifications. Make sure to select these options in order to use WinDriver's application with the Hot Swap Engine, as demonstrated in Figure 4.1.
As explained earlier, it is not a requirement to have the driver's hardware access code generated with WinDriver; hot swap capabilities can also be achieved with drivers developed in other ways.
In order to make your driver or application hot swap aware and to utilize the hot swap services provided by Go-HotSwap, you must add the Go-HotSwap API, as well as some relevant WinDriver API. A list of the API can be found in the Go-HotSwap Function Reference chapter, later on in this manual.
The API should be used according the following procedure:
WD_WatchPciStart() [A.1.3]. Each application should call
WD_WatchPciStart() before implementing another Go-HotSwap API. You can call it even if the Hot Swap Engine has already been activated; so there is no need to check if the Hot Swap Engine is activated or not.
EventRegister() [A.2.6]. This function allows you to determine the devices and types of events for which you wish to receive notifications.
receives as one of its parameters (
func) an event handler
callback function, which will be called for each occurrence of a registered
event. The parameters of the event handler callback include information
regarding the event that occurred, as well as data that was received from
the user in the call to
EventRegister() (see the
You should implement your event handler callback to perform any functionality pertinent to the event that occurred. For example, if you receive a notification regarding the insertion of a VoIP board into the chassis, your event handler callback can start the board's specific functionality. A simpler example would be to just print a message from your event handler to the screen, describing the hot swap event that has just occurred, as demonstrated by the hs_detect utility.
EventUnregister() [A.2.7] to unregister your application from receiving events notifications.
The API can be also used to light the blue led of a cPCI board when it is safe (from the application's perspective) to physically remove it from the backplane. The proper procedure is:
The last stage of the hot swap procedure is to turn off the Hot Swap Engine.
This is done by calling the
WD_WatchPciStop() [A.1.4] function.