This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Called to request power mode change for a node
#include <sys/pmm.h> int mode_request(void *data, pm_power_mode_t mode, unsigned flags, const pm_power_attr_t *attr);
libc
This function is called when a request is made to change the power mode for a node:
If this is set, the policy should allow the change.
This is typically be used by a driver to indicate to the power manager that mode is a more appropriate mode for the driver in its current state of operation.
The return value from this function determines whether the mode change is allowed by the policy:
The policy must allow the change if PM_MODE_FORCE is set.
if PM_MODE_REQUEST is set, the driver changes the mode on return from the power manager request. Otherwise, the library will deliver an event to the driver. This is in order to request a mode change.
If PM_MODE_REQUEST is not set, and the policy does not agree to the mode change, it should return an appropriate error code.
The default action (if the policy does not override this function) is to allow all requests.
Safety: | |
---|---|
Cancellation point | Unknown |
Interrupt handler | Unknown |
Signal handler | Unknown |
Thread | Unknown |