[Previous] [Contents] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

mode_request() callback

Called to request power mode change for a node

Synopsis:

#include <sys/pmm.h>

int mode_request(void *data, pm_power_mode_t mode, 
     unsigned flags, const pm_power_attr_t *attr);

Library:

libc

Description:

This function is called when a request is made to change the power mode for a node:

data
Policy specific data returned by the create() function when the node is created.
mode
New mode that is being requested.
flags
Contain the following:
PM_MODE_FORCE
Force the object to change to mode.

If this is set, the policy should allow the change.

PM_MODE_REQUEST
Use this flag to request permission from the power manager to implement a power mode 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.

attr
Contains the current power mode attributes of the node:

The return value from this function determines whether the mode change is allowed by the policy:

The default action (if the policy does not override this function) is to allow all requests.

Returns:

Classification:

QNX Neutrino

Safety:
Cancellation point Unknown
Interrupt handler Unknown
Signal handler Unknown
Thread Unknown

See also:


[Previous] [Contents] [Next]