Device Polling APIs
APIs documented in this section are used for polling devices.
icp_sal_poll_device_events
This function polls for device reset events.
Syntax
CpaStatus icp_sal_poll_device_events(void);
Parameters
None
Return Value
The icp_sal_poll_device_events
function returns one of the following codes:
|
Successful operation. |
|
Indicates a failure. |
Note
The events are sent to each instance that has registered a callback function. The callbacks are registered using cpaCyInstanceSetNotificationCb
and cpaDcInstanceSetNotificationCb
.
cpaCyInstanceSetNotificationCb
Cryptographic instances use this function to register for device event notifications.
Syntax
CpaStatus cpaCyInstanceSetNotificationCb(const CpaInstanceHandle instanceHandle, const CpaCyInstanceNotificationCbFunc pinstanceNotificationCb, void *pCallbackTag);
Parameters
|
Instance handle. |
|
Instance notification callback function pointer. |
|
Opaque value provided by user. |
Return Value
The cpaCyInstanceSetNotificationCb
function returns one of the following codes:
|
The function was successful. |
|
Indicates a failure. |
|
Invalid parameter passed in. |
|
Function is not supported. |
The signature for the callback function is:
typedef void (*CpaCyInstanceNotificationCbFunc)( const CpaInstanceHandle instanceHandle, void * pCallbackTag, const CpaInstanceEvent instanceEvent);
Parameter:
typedef enum _CpaInstanceEvent { CPA_INSTANCE_EVENT_RESTARTING = 0, CPA_INSTANCE_EVENT_RESTARTED, CPA_INSTANCE_EVENT_FATAL_ERROR } CpaInstanceEvent;
cpaDcInstanceSetNotificationCb
Data compression instances use this function to register for device event notifications.
Syntax
CpaStatus cpaDcInstanceSetNotificationCb(const CpaInstanceHandle instanceHandle, const CpaDcInstanceNotificationCbFunc pinstanceNotificationCb, void *pCallbackTag);
Parameters
|
Instance handle. |
|
Instance notification callback function pointer. |
|
Opaque value provided by user. |
Return Value
The cpaDcInstanceSetNotificationCb
function returns one of the following codes:
|
The function was successful. |
|
Indicates a failure. |
|
Invalid parameter passed in. |
|
Function is not supported. |
The signature for the callback function is:
typedef void (*CpaDcInstanceNotificationCbFunc)( const CpaInstanceHandle instanceHandle, void * pCallbackTag, const CpaInstanceEvent instanceEvent);
Parameter:
typedef enum _CpaInstanceEvent { CPA_INSTANCE_EVENT_RESTARTING = 0, CPA_INSTANCE_EVENT_RESTARTED, CPA_INSTANCE_EVENT_FATAL_ERROR } CpaInstanceEvent;