Go to the source code of this file.
API for OCS power managment
Definition in file ocs_pm.h.
Data Structures | |
| struct | ocs_pm_context_t |
Enumerations | |
| enum | ocs_pm_msg_e { OCS_PM_PREPARE = 1, OCS_PM_SLEEP, OCS_PM_HIBERNATE, OCS_PM_RESUME } |
| Power State change message types. More... | |
| enum | ocs_pm_state_e { OCS_PM_STATE_S0 = 0, OCS_PM_STATE_S1, OCS_PM_STATE_S2, OCS_PM_STATE_S3, OCS_PM_STATE_S4 } |
| Power State values. More... | |
Functions | |
| int32_t | ocs_pm_request (ocs_t *ocs, ocs_pm_msg_e msg, int32_t(*callback)(ocs_t *ocs, int32_t status, void *arg), void *arg) |
| Handle Power Management Request. More... | |
| ocs_pm_state_e | ocs_pm_get_state (ocs_t *ocs) |
| Return driver power state. More... | |
| const char * | ocs_pm_get_state_string (ocs_t *ocs) |
| Return driver power state as an ascii string. More... | |
| enum ocs_pm_msg_e |
| enum ocs_pm_state_e |
| ocs_pm_state_e ocs_pm_get_state | ( | ocs_t * | ocs | ) |
Return driver power state.
The current power state is returned. Note, that in some implementations, the power state may differ from that requested and completed using ocs_pm_request(). (SLI4 HIBERNATE requests will sleep)
| ocs | pointer to device structure |
| const char* ocs_pm_get_state_string | ( | ocs_t * | ocs | ) |
| int32_t ocs_pm_request | ( | ocs_t * | ocs, |
| ocs_pm_msg_e | msg, | ||
| int32_t(*)(ocs_t *ocs, int32_t status, void *arg) | callback, | ||
| void * | arg | ||
| ) |
Handle Power Management Request.
Function is called by management or OS to request a change in the power state of the device controlled by the OCS driver. The API supports requesting the following:
OCS_PM_PREPARE The device (in state S0) is notified that a power state change is forthcoming. OCS_PM_SLEEP The device is transitioned to state S3 (sleep/standby). OCS_PM_HIBERNATE The device is transitioned to state S4 (hibernate) OCS_PM_RESUME The device resumes OCS_PM_CANCEL Cancel any pending request. If a callback was expected for the pending request, the callback will be made with an error status indicating the request was cancelled.
| ocs | pointer to device structure |
| msg | power manatement request message |
| callback | callback function to be invoked when request has completed. |
| arg | arbitrary argument that is passed to the callback |
Arguments to the callback function are as follows:
ocs pointer to device structure status integer value indicating the success or failure of the requested operation. 0 for success, negative value for failure. arg pointer to the caller supplied argument
For the OCS driver on the SLI4 adapters at the time of writing, SLEEP and HIBERNATE both transition to S3, assumming power on the device and memory is retained. IO's are quiesced, the port is offlined, interrupts are disabled, link is taken down. Back end calls will result, not disimilar to the bahavior of loss of link.
RESUME will bring the port back online, initiate discovery (for initiator).