4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
33 #include <sys/types.h>
36 * The following ioctls may not exist or may have a different
37 * interpretation in a future release.
41 PM_SCHEDULE
, /* obsolete, not supported */
42 PM_GET_IDLE_TIME
, /* obsolete, not supported */
43 PM_GET_NUM_CMPTS
, /* obsolete, not supported */
44 PM_GET_THRESHOLD
, /* obsolete, not supported */
45 PM_SET_THRESHOLD
, /* obsolete */
46 PM_GET_NORM_PWR
, /* obsolete */
47 PM_SET_CUR_PWR
, /* obsolete */
48 PM_GET_CUR_PWR
, /* obsolete */
49 PM_GET_NUM_DEPS
, /* obsolete, not supported */
50 PM_GET_DEP
, /* obsolete, not supported */
51 PM_ADD_DEP
, /* obsolete */
52 PM_REM_DEP
, /* obsolete, not supported */
53 PM_REM_DEVICE
, /* obsolete, not supported */
54 PM_REM_DEVICES
, /* obsolete */
55 PM_REPARSE_PM_PROPS
, /* used only by ddivs pm tests */
56 PM_DISABLE_AUTOPM
, /* obsolete */
57 PM_REENABLE_AUTOPM
, /* obsolete */
58 PM_SET_NORM_PWR
, /* obsolete, not supported */
59 PM_SET_DEVICE_THRESHOLD
,
60 PM_GET_SYSTEM_THRESHOLD
,
61 PM_SET_SYSTEM_THRESHOLD
,
66 PM_GET_DEVICE_THRESHOLD
,
69 PM_GET_NUM_COMPONENTS
,
70 PM_GET_COMPONENT_NAME
,
71 PM_GET_NUM_POWER_LEVELS
,
73 PM_GET_STATE_CHANGE_WAIT
,
77 PM_DIRECT_NOTIFY_WAIT
,
78 PM_RESET_DEVICE_THRESHOLD
,
81 PM_SET_COMPONENT_THRESHOLDS
,
82 PM_GET_COMPONENT_THRESHOLDS
,
84 PM_GET_DEVICE_THRESHOLD_BASIS
,
85 PM_SET_CURRENT_POWER
, /* replaces PM_SET_CUR_PWR */
86 PM_GET_CURRENT_POWER
, /* replaces PM_GET_CUR_PWR */
87 PM_GET_FULL_POWER
, /* replaces PM_GET_NORM_PWR */
88 PM_ADD_DEPENDENT
, /* replaces PM_ADD_DEP */
89 PM_GET_TIME_IDLE
, /* replaces PM_IDLE_TIME */
90 PM_GET_DEFAULT_SYSTEM_THRESHOLD
,
91 PM_ADD_DEPENDENT_PROPERTY
,
99 PM_ENABLE_S3
, /* allow pm to go to S3 state */
100 PM_DISABLE_S3
, /* do not allow pm to go to S3 state */
101 PM_ENTER_S3
, /* obsolete, not supported */
104 PM_SEARCH_LIST
, /* search S3 enable/disable list */
106 PM_GET_S3_SUPPORT_STATE
,
108 PM_DISABLE_CPU_DEEP_IDLE
,
109 PM_ENABLE_CPU_DEEP_IDLE
,
110 PM_DEFAULT_CPU_DEEP_IDLE
114 * Old name for these ioctls.
116 #define PM_GET_POWER PM_GET_NORM_PWR
117 #define PM_SET_POWER PM_SET_CUR_PWR
120 * This structure is obsolete and will be removed in a later release
123 caddr_t who
; /* Device to configure */
124 int select
; /* Selects the component or dependent */
126 int level
; /* Power or threshold level */
127 caddr_t dependent
; /* Buffer to hold name of dependent */
128 int size
; /* Size of dependent buffer */
132 * This is the new struct that replaces pm_request
134 typedef struct pm_req
{
135 char *physpath
; /* physical path of device to configure */
136 /* see libdevinfo(3) */
137 int component
; /* Selects the component of the device */
138 int value
; /* power level, threshold value, or count */
139 void *data
; /* command-dependent variable sized data */
140 size_t datasize
; /* Size of data buffer */
144 * PM_SEARCH_LIST requires a list name, manufacturer and product name
145 * Searches the named list for a matching tuple.
146 * NOTE: This structure may be removed in a later release.
148 typedef struct pm_searchargs
{
149 char *pms_listname
; /* name of list to search */
150 char *pms_manufacturer
; /* 1st elment of tuple */
151 char *pms_product
; /* 2nd elment of tuple */
155 * Use these for PM_ADD_DEPENDENT and PM_ADD_DEPENDENT_PROPERTY
157 #define pmreq_keeper physpath /* keeper in the physpath field */
158 #define pmreq_kept data /* kept in the data field */
161 * Possible values for the event field of pm_state_change below
164 PSC_PENDING_CHANGE
, /* device needs to change, is blocked */
165 PSC_HAS_CHANGED
/* device level has changed */
168 #define PSC_EVENT_LOST 0x4000 /* buffer overrun */
169 #define PSC_ALL_LOWEST 0x8000 /* all devices at lowest power */
172 * Special value for power level fields in pm_state_change below
174 #define PM_LEVEL_UNKNOWN -1 /* power level is unknown */
176 typedef struct pm_state_change
{
177 caddr_t physpath
; /* Device which has changed state */
178 int component
; /* which component changed state */
179 #if defined(_BIG_ENDIAN)
180 ushort_t flags
; /* PSC_EVENT_LOST, PSC_ALL_LOWEST */
181 ushort_t event
; /* type of event */
183 ushort_t event
; /* type of event */
184 ushort_t flags
; /* PSC_EVENT_LOST, PSC_ALL_LOWEST */
186 time_t timestamp
; /* time of state change */
187 int old_level
; /* power level changing from */
188 int new_level
; /* power level changing to */
189 size_t size
; /* size of buffer physpath points to */
194 /* Kernel's view of ILP32 structure version. */
197 * This struct is obsolete and will be removed in a later release
200 caddr32_t who
; /* Device to configure */
201 int select
; /* Selects the component or dependent */
203 int level
; /* Power or threshold level */
204 caddr32_t dependent
; /* Buffer to hold name of */
206 size32_t size
; /* Size of dependent buffer */
209 typedef struct pm_req32
{
210 caddr32_t physpath
; /* physical path of device to configure */
211 /* see libdevinfo(3) */
212 int component
; /* selects the component of the device */
213 int value
; /* power level, threshold value, or count */
214 caddr32_t data
; /* command-dependent variable sized data */
215 size32_t datasize
; /* Size of data buffer */
218 typedef struct pm_state_change32
{
219 caddr32_t physpath
; /* Device which has changed state */
220 int component
; /* which component changed state */
221 #if defined(_BIG_ENDIAN)
222 ushort_t flags
; /* PSC_EVENT_LOST, PSC_ALL_LOWEST */
223 ushort_t event
; /* type of event */
225 ushort_t event
; /* type of event */
226 ushort_t flags
; /* PSC_EVENT_LOST, PSC_ALL_LOWEST */
228 time32_t timestamp
; /* time of state change */
229 int old_level
; /* power level changing from */
230 int new_level
; /* power level changing to */
231 size32_t size
; /* size of buffer physpath points to */
232 } pm_state_change32_t
;
234 typedef struct pm_searchargs32_t
{
235 caddr32_t pms_listname
;
236 caddr32_t pms_manufacturer
;
237 caddr32_t pms_product
;
244 * Return values from ioctl commands that return pm state info.
248 PM_SYSTEM_PM_ENABLED
,
249 PM_SYSTEM_PM_DISABLED
,
251 PM_CREATE_COMPONENTS
,
253 PM_DEFAULT_THRESHOLD
,
255 PM_COMPONENT_THRESHOLD
,
264 PM_S3_SUPPORT_ENABLED
,
265 PM_S3_SUPPORT_DISABLED
272 #endif /* _SYS_PM_H */