pdiag_restore_state
Purpose
Restores resource and children to their initial state before testing.
Syntax
#include <sys/pdiag_def.h>
int32 pdiag_restore_state ( char *device_instance )
Description
The pdiag_restore_state subroutine puts the device, and its children if necessary, back to the original state before the pdiag_diagnose_state routine was called.
This function is platform-implementation specific. Its main purpose is to make sure that the target device is back in its original state prior to performing diagnostics on the device, and that the Enhanced Error Handling (EEH) option is disabled. If the device is already in the correct state, then this function should return a successful status value of zero. If an error occurs, then this function should return a non-zero value.
The diag_cfg_errno global variable will be set to the return value of the method invoked for the device.
Parameters
Parameter | Description |
---|---|
device_instance | Name of the device under test. |
Return Value
The pdiag_restore_state subroutine returns one of the following values:
Return Value | Description |
---|---|
0 | Successful return. |
-1 | Software error. |
1 | Error returned from device method. The diag_cfg_errno variable contains the error code from the device method. Refer to the/usr/include/cf.h file. The E_FINDCHILD and E_NEWCHILD values are not failures. |
-2 | EEH hardware error. |