xref: /illumos-gate/usr/src/uts/common/sys/sysevent/pwrctl.h (revision 2d6eb4a5e0a47d30189497241345dc5466bb68ab)
1*d2ec54f7Sphitran /*
2*d2ec54f7Sphitran  * CDDL HEADER START
3*d2ec54f7Sphitran  *
4*d2ec54f7Sphitran  * The contents of this file are subject to the terms of the
5*d2ec54f7Sphitran  * Common Development and Distribution License (the "License").
6*d2ec54f7Sphitran  * You may not use this file except in compliance with the License.
7*d2ec54f7Sphitran  *
8*d2ec54f7Sphitran  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*d2ec54f7Sphitran  * or http://www.opensolaris.org/os/licensing.
10*d2ec54f7Sphitran  * See the License for the specific language governing permissions
11*d2ec54f7Sphitran  * and limitations under the License.
12*d2ec54f7Sphitran  *
13*d2ec54f7Sphitran  * When distributing Covered Code, include this CDDL HEADER in each
14*d2ec54f7Sphitran  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*d2ec54f7Sphitran  * If applicable, add the following below this CDDL HEADER, with the
16*d2ec54f7Sphitran  * fields enclosed by brackets "[]" replaced with your own identifying
17*d2ec54f7Sphitran  * information: Portions Copyright [yyyy] [name of copyright owner]
18*d2ec54f7Sphitran  *
19*d2ec54f7Sphitran  * CDDL HEADER END
20*d2ec54f7Sphitran  */
21*d2ec54f7Sphitran /*
22*d2ec54f7Sphitran  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23*d2ec54f7Sphitran  * Use is subject to license terms.
24*d2ec54f7Sphitran  */
25*d2ec54f7Sphitran 
26*d2ec54f7Sphitran #ifndef	_SYS_SYSEVENT_PWRCTL_H
27*d2ec54f7Sphitran #define	_SYS_SYSEVENT_PWRCTL_H
28*d2ec54f7Sphitran 
29*d2ec54f7Sphitran #ifdef	__cplusplus
30*d2ec54f7Sphitran extern "C" {
31*d2ec54f7Sphitran #endif
32*d2ec54f7Sphitran 
33*d2ec54f7Sphitran /*
34*d2ec54f7Sphitran  * Event type schema for EC_PWRCTL:
35*d2ec54f7Sphitran  *	Event Class	- EC_PWRCTL
36*d2ec54f7Sphitran  *	Event Sub-Class	- ESC_PWRCTL_ADD |
37*d2ec54f7Sphitran  *                        ESC_PWRCTL_REMOVE |
38*d2ec54f7Sphitran  *                        ESC_PWRCTL_WARN |
39*d2ec54f7Sphitran  *                        ESC_PWRCTL_LOW |
40*d2ec54f7Sphitran  *                        ESC_PWRCTL_STATE_CHANGE |
41*d2ec54f7Sphitran  *			  ESC_PWRCTL_POWER_BUTTON |
42*d2ec54f7Sphitran  *			  ESC_PWRCTL_BRIGHTNESS_UP |
43*d2ec54f7Sphitran  *			  ESC_PWRCTL_BRIGHTNESS_DOWN
44*d2ec54f7Sphitran  *	Event Publisher	- SUNW:kern:[environmental monitor name]
45*d2ec54f7Sphitran  *	Attribute Name	- PWRCTL_VERSION
46*d2ec54f7Sphitran  *	Attribute Type	- SE_DATA_TYPE_UINT32
47*d2ec54f7Sphitran  *	Attribute Value	- [version of the schema]
48*d2ec54f7Sphitran  *	Attribute Name	- PWRCTL_DEV_HID
49*d2ec54f7Sphitran  *	Attribute Type  - SE_DATA_TYPE_STRING
50*d2ec54f7Sphitran  *	Attribute Value	- [Label identifying the ACPI hardware]
51*d2ec54f7Sphitran  *	Attribute Name	- PWRCTL_DEV_UID
52*d2ec54f7Sphitran  *	Attribute Type  - SE_DATA_TYPE_STRING
53*d2ec54f7Sphitran  *	Attribute Value	- [Both the _HID and _UID values can be of either type
54*d2ec54f7Sphitran  *	                   STRING or NUMBER in the ACPI tables. In order to
55*d2ec54f7Sphitran  *	                   provide a consistent data type in the external
56*d2ec54f7Sphitran  *	                   interface, these values are always returned as NULL
57*d2ec54f7Sphitran  *	                   terminated strings, regardless of the original data
58*d2ec54f7Sphitran  *	                   type in the source ACPI table.]
59*d2ec54f7Sphitran  *	Attribute Name	- PWRCTL_DEV_INDEX
60*d2ec54f7Sphitran  *	Attribute Type	- SE_DATA_TYPE_UINT32
61*d2ec54f7Sphitran  *	Attribute Value	- [Device index]
62*d2ec54f7Sphitran  *
63*d2ec54f7Sphitran  * ESC_PWRCTL_WARN, ESC_PWRCTL_LOW only field:
64*d2ec54f7Sphitran  *	Attribute Name	- PWRCTL_CHARGE_LEVEL
65*d2ec54f7Sphitran  *	Attribute Type  - SE_DATA_TYPE_UINT32
66*d2ec54f7Sphitran  *	Attribute Value	- [charge level]
67*d2ec54f7Sphitran  */
68*d2ec54f7Sphitran 
69*d2ec54f7Sphitran #define	PWRCTL_VERSION		"pwrctl_version" /* Version of the schema */
70*d2ec54f7Sphitran #define	PWRCTL_DEV_PHYS_PATH	"pwrctl_dev_phys_path" /* Physical Path */
71*d2ec54f7Sphitran #define	PWRCTL_DEV_HID		"pwrctl_dev_hid" /* ACPI device Hardware Id */
72*d2ec54f7Sphitran #define	PWRCTL_DEV_UID		"pwrctl_dev_uid" /* ACPI device Unique Id */
73*d2ec54f7Sphitran #define	PWRCTL_DEV_INDEX	"pwrctl_dev_index" /* Device index */
74*d2ec54f7Sphitran #define	PWRCTL_CHARGE_LEVEL	"pwrctl_charge_level" /* Event related state */
75*d2ec54f7Sphitran #define	PWRCTL_BRIGHTNESS_LEVEL	"pwrctl_brightness_level"
76*d2ec54f7Sphitran 
77*d2ec54f7Sphitran #ifdef	__cplusplus
78*d2ec54f7Sphitran }
79*d2ec54f7Sphitran #endif
80*d2ec54f7Sphitran 
81*d2ec54f7Sphitran #endif /* _SYS_SYSEVENT_PWRCTL_H */
82