Intel ZT 4901 manual Redundant Host-Aware Callback Definitions, Prhdeviceobj AddDevice

Models: ZT 4901

1 136
Download 136 pages 35.65 Kb
Page 116
Image 116

HSK Device Driver Interface for VxWorks* 5.4

A driver can have itself removed from the HSK Manager’s registry by calling the rhHskUnregisterDriver routine. Use the RH driver object as an input parameter for this routine. If a driver requests to unregister itself and any of the driver’s devices are not in the uninitialized state, the rhHskUnregisterDriver function returns with an unsuccessful status.

The following code segment illustrates an AddDevice function. This callback has two objectives:

The driver gives a status to a device it controls and allocates any internal values associated with a specific device.

The driver must create a device object that is used by the HSK Manager to communicate to the Redundant Host-aware device driver which device is being exercised.

The AddDevice function is called once for every device associated with the registered driver. This association is determined by the compatibility device definition passed to the rhHskRegisterDriver function as shown in the previous code sample.

C.4 Redundant Host-Aware Callback Definitions

This section describes callback function syntax and functionality.

C.4.1 PRH_DEVICE_OBJ AddDevice

AddDevice is called for each device associated with a particular device driver after the driver registers itself with the HSK Manager. During the AddDevice routine, the device’s internal structures are set up and a device object is created. A device object is a device context used by the RH callback functions to perform appropriate operations on the device. No further actions are required after an AddDevice call on a Standby Host. On an active system master, the device driver should initialize the actual device.

Syntax

(PRH_DRIVER_EXT driverExt, PCI_LOCATION pci)

Parameters

driverExt

Pointer to a driver object extension. This data extension is specific to the driver that allocated it and can be used for whatever purposes the driver sees fit.

pci

A PCI location structure. This structure contains the PCI bus, device, and function location where the device being notified of the AddDevice call is located.

Return Value

Returns a pointer to a driver-defined device object. This object pointer is kept by the HSK Manager and used as an input parameter to the RH device driver callback functions. If the AddDevice call is unsuccessful, than a NULL pointer value is returned.

116

High Availability Software for the Intel® NetStructureTM ZT 4901 Technical Product Specification

Page 116
Image 116
Intel ZT 4901 manual Redundant Host-Aware Callback Definitions, Prhdeviceobj AddDevice