pm.h revision c42872d4489d6f0fbccfabe2a62f3c976ee1e5d6
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_PM_H
#define _SYS_PM_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* The following ioctls may not exist or may have a different
* interpretation in a future release.
*/
typedef enum {
PM_SCHEDULE, /* obsolete, not supported */
PM_GET_IDLE_TIME, /* obsolete, not supported */
PM_GET_NUM_CMPTS, /* obsolete, not supported */
PM_GET_THRESHOLD, /* obsolete, not supported */
PM_SET_THRESHOLD, /* obsolete */
PM_GET_NORM_PWR, /* obsolete */
PM_SET_CUR_PWR, /* obsolete */
PM_GET_CUR_PWR, /* obsolete */
PM_GET_NUM_DEPS, /* obsolete, not supported */
PM_GET_DEP, /* obsolete, not supported */
PM_ADD_DEP, /* obsolete */
PM_REM_DEP, /* obsolete, not supported */
PM_REM_DEVICE, /* obsolete, not supported */
PM_REM_DEVICES, /* obsolete */
PM_REPARSE_PM_PROPS, /* used only by ddivs pm tests */
PM_DISABLE_AUTOPM, /* obsolete */
PM_REENABLE_AUTOPM, /* obsolete */
PM_SET_NORM_PWR, /* obsolete, not supported */
PM_SET_CURRENT_POWER, /* replaces PM_SET_CUR_PWR */
PM_GET_CURRENT_POWER, /* replaces PM_GET_CUR_PWR */
PM_GET_FULL_POWER, /* replaces PM_GET_NORM_PWR */
PM_ADD_DEPENDENT, /* replaces PM_ADD_DEP */
PM_GET_TIME_IDLE, /* replaces PM_IDLE_TIME */
} pm_cmds;
/*
* Old name for these ioctls.
*/
#define PM_GET_POWER PM_GET_NORM_PWR
#define PM_SET_POWER PM_SET_CUR_PWR
/*
* This structure is obsolete and will be removed in a later release
*/
typedef struct {
int select; /* Selects the component or dependent */
/* of the device */
int level; /* Power or threshold level */
int size; /* Size of dependent buffer */
} pm_request;
/*
* This is the new struct that replaces pm_request
*/
typedef struct pm_req {
char *physpath; /* physical path of device to configure */
/* see libdevinfo(3) */
int component; /* Selects the component of the device */
int value; /* power level, threshold value, or count */
void *data; /* command-dependent variable sized data */
} pm_req_t;
/*
* Use these for PM_ADD_DEPENDENT and PM_ADD_DEPENDENT_PROPERTY
*/
/*
* Possible values for the event field of pm_state_change below
*/
typedef enum {
PSC_PENDING_CHANGE, /* device needs to change, is blocked */
PSC_HAS_CHANGED /* device level has changed */
} psc_events;
/*
* Special value for power level fields in pm_state_change below
*/
typedef struct pm_state_change {
int component; /* which component changed state */
#if defined(_BIG_ENDIAN)
#else
#endif
int old_level; /* power level changing from */
int new_level; /* power level changing to */
#ifdef _SYSCALL32
/* Kernel's view of ILP32 structure version. */
/*
* This struct is obsolete and will be removed in a later release
*/
typedef struct {
int select; /* Selects the component or dependent */
/* of the device */
int level; /* Power or threshold level */
/* dependent */
} pm_request32;
typedef struct pm_req32 {
/* see libdevinfo(3) */
int component; /* selects the component of the device */
int value; /* power level, threshold value, or count */
} pm_req32_t;
typedef struct pm_state_change32 {
int component; /* which component changed state */
#if defined(_BIG_ENDIAN)
#else
#endif
int old_level; /* power level changing from */
int new_level; /* power level changing to */
#endif
/*
* Return values from ioctl commands that return pm state info.
*/
typedef enum {
} pm_states;
#ifdef __cplusplus
}
#endif
#endif /* _SYS_PM_H */