
HSK Device Driver Interface for VxWorks* 5.4
UINT8 BaseClass;
UINT16 SubVendorID;
UINT16 SubSystemID;
} RH_COMPAT_DEVICE, *PRH_COMPAT_DEVICE;
C.3 HSK Driver Instantiation Code Segment
The following code segment populates the HA Driver object. Return status validation has been omitted, but an HA device driver should respond appropriately to failed return values.
STATUS RHDrv(void)
{
RH_DEVICE_INFO* devInfo = NULL;
RH_HSK_DRV_OBJ* drvObj = NULL;
/* Create our RH data object for Rh driver registration */ drvObj = (RH_HSK_DRV_OBJ*)malloc(sizeof(RH_HSK_DRV_OBJ)); memset(drvObj, 0x00, sizeof(RH_HSK_DRV_OBJ));
/* Create the device info object */
devInfo = (RH_DEVICE_INFO*)malloc(sizeof(RH_DEVICE_INFO) +
sizeof(RH_COMPAT_DEVICE));
memset(devInfo, 0x00, sizeof(RH_DEVICE_INFO) + sizeof(RH_COMPAT_DEVICE));
COMPAT_LIST_CHECK_DEVICE;
COMPAT_LIST_CHECK_DEVICE;
/* Attach the device list to our RH driver object */
/* Set pointers to our hotplug callback routines */
= | bptdAddDevice; | |
= | bptdStartDevice; | |
= | bptdStopDevice; | |
= | bptdRemoveDevice; | |
bptdRemoveDevice; | ||
/* Register this driver's | Interface with the RH/HSK driver */ |
rhHskRegisterDriver(drvObj);
return OK;
}
High Availability Software for the Intel® NetStructureTM ZT 4901 Technical Product Specification | 115 |