NAME | SYNOPSIS | DESCRIPTION | IOCTLS | ERRORS | ATTRIBUTES | SEE ALSO | NOTES
/dev/pm
The Power Management driver provides an interface for applications to configure devices within the system for power management. The interface is provided through ioctl(2) commands. The pm driver may be accessed using /dev/pm.
The pm model of power management is to view the system as a collection of devices. Each device is a collection of components. A component is the smallest power manageable unit. The definition of power manageable components of a device is under the control of the device driver. A power manageable component has three states. It may be busy (in use), it may be idle (not in use but using normal power), or it may be power managed (not in use and not using normal power).
Normally, the pm driver manages the component transition from idle to power managed. pm uses two factors to determine this transition: the component must have been idle for at least the threshold time, and the device to which the component belongs must satisfy any dependency requirements. A dependency occurs when a device requires another device to be power managed before it can be power managed. Dependencies occur on a per device basis: when a dependency exists, no components of a device may be managed unless all the devices it depends upon are first power managed. See power.conf( 4), power(9E), pm_create_components(9F), pm_idle_component(9F), pm_busy_component(9F), pm_destroy_components(9F), and Writing Device Drivers for additional information.
Using the commands below, an application may take control of the power management of a device from the pm driver and manage the transition of device power levels directly. Xsun(1) does this to power manage the display.
For all ioctl commands, arg (see ioctl(2)) points to a structure of type pm_request defined in <sys/pm.h>:
typedef struct { char *who; /* device to configure */ int select; /* selects the component or dependent of the device */ int level; /* power level or threshold value */ char *dependent; /* hold name of dependent */ int size; /* size of dependent buffer */ } pm_request;
The fields should contain the following data:
Pointer to the name of the device to be configured. The name must be in the format described in power.conf(4).
Non-negative integer specifying the component or dependent being configured. The numbering starts at zero.
Non-negative integer specifying the threshold value in seconds or the desired power level.
Pointer to a buffer which contains or receives the name of a device on which this device has a dependency. It uses the same format as the who field.
Size of the dependent buffer.
Not all fields are used in each command.
The device named by who is disabled from being automatically power managed. The caller will power manage the device directly using the commands below. If this command is not successfully executed, subsequent PM_SET_CUR_PWR calls will fail. Error codes:
Device already disabled for auto power management.
Caller is neither superuser nor owner of the device.
The normal power level of the component select of the device named by who is returned. The normal power level of the component is the power level to which the component will be set when it becomes busy again. Error codes:
Device component out of range.
Device has no power-manageable components.
The current power level of component select of the device named by who is returned. Error codes:
Device component out of range.
Component select of the device named by who is brought to power level level. If select is not 0 and component 0 of the device is at power level 0, component 0 is brought to its normal power level. Each component of each device which depends on this device is brought to its normal power level. Each component of each ancestor of each device affected is brought to its normal power level. Error codes:
Device component out of range, or power level < 0.
Failed to power device or its ancestors or its dependees or their ancestors.
Caller is neither superuser nor owner of the device.
The device named by who is re-enabled for automatic power management. By default, all configured devices are automatically power managed by the pm device. Error codes:
Device already being power managed automatically.
Caller is neither superuser nor owner of the device.
Upon error, the commands will return -1, and set errno. In addition to the error codes listed above by command, the following error codes are common to all commands:
Bad address passed in as argument.
Device is not power manageable, or device is not configured.
Too many opens attempted.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Unstable |
pmconfig(1M), intro(2), ioctl(2), power.conf(4), attributes(5), attach(9E), detach(9E), power(9E), ddi_dev_is_needed(9F), pm_busy_component(9F), pm_create_components(9F), pm_destroy_components(9F), pm_get_normal_power(9F), pm_idle_component(9F), pm_set_normal_power (9F)
To unload a power managed driver, the driver must first be unmanaged (see pmconfig(1M)).
pm(7D) is not a stable API. The commands documented within this reference manual page may not exist or may have a different interpretation in a future release. That other reference manual pages lack this notice does not imply that they document a stable API.
NAME | SYNOPSIS | DESCRIPTION | IOCTLS | ERRORS | ATTRIBUTES | SEE ALSO | NOTES