[Previous] [Contents] [Next]

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

pmd_attr_setpower()

Specify driver's setpower() function

Synopsis:

#include <sys/pm.h>

void pmd_attr_setpower(pmd_attr_t *pmd, 
                       pmd_setpower_t func, 
                       void *data);

Arguments:

pmd
Pointer to the pmd_attr_t structure to be initialized.
func
Pointer to the driver specific function to set the device power mode.
data
Pointer to driver specific data passed to func.

Library:

libpm

Description:

The pmd_attr_setpower() initializes the pmd_attr_t's setpower and data fields to the specified driver specific values.

The func() is the driver specific function to set the device power mode:

int (*func)(pmd_attr_t *pmd, unsigned flags);

Where:

pmd->cur_attr points to the pmd_mode_attr_t for the current device mode.

pmd->new_attr points to the pmd_mode_attr_t for the mode to be set.

pmd->new_flags contains the mode flags that apply to the new power mode.

This function is responsible for performing all necessary actions to set the new mode:

pmd->setpower() is called by the following library helper functions:

These functions call setpower() with the pmd exclusive lock held to serialize power mode changes. If the driver needs to call pmd->setpower() itself, for example, when a draining operation completes, it should acquire this lock using pmd_lock_exclusive() first.

Examples:

For more information, see the device driver chapter.

Classification:

Neutrino

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

pmd_attr_t, pmd_attr_init(), pmd_confirm(), pmd_activate(), pmd_handler(), pmd_power(), pmd_lock_exclusive()


[Previous] [Contents] [Next]