xref: /illumos-gate/usr/src/uts/common/sys/ppmio.h (revision 3db86aab)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1999-2002 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_PPMIO_H
28 #define	_SYS_PPMIO_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/types.h>
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 #define	PPMIOC			('p' << 8)
39 #define	PPMIOCSET		(PPMIOC | 1)
40 #define	PPMIOCGET		(PPMIOC | 2)
41 #define	PPMGET_DPWR		(PPMIOC | 3)
42 #define	PPMGET_DOMBYDEV		(PPMIOC | 4)
43 #define	PPMGET_DEVBYDOM		(PPMIOC | 5)
44 
45 /*
46  * PPMIOCGET
47  * Note: this ioctl command is available for Excalibur and Grover
48  * only, but will be removed in future, replacing with PPMGET_DPWR
49  */
50 typedef struct ppmreq {
51 	int	ppmdev;
52 	union ppmop {
53 		struct idev_power {
54 			int level;
55 		} idev_power;
56 	} ppmop;
57 } ppmreq_t;
58 
59 /* definition for ppmdev */
60 #define	PPM_INTERNAL_DEVICE_POWER	1
61 
62 /*
63  * PPMGET_DPWR
64  */
65 struct ppm_dpwr {
66 	char *domain;	/* domain name */
67 	int  level;	/* domain power level */
68 };
69 
70 /*
71  * PPMGET_DOMBYDEV
72  */
73 struct ppm_bydev {
74 	char *path;	/* device prom path */
75 	char *domlist;	/* domain names */
76 	size_t   size;	/* size of domlist buffer */
77 };
78 
79 /*
80  * PPMGET_DEVBYDOM
81  */
82 struct ppm_bydom {
83 	char *domain;	/* domain name */
84 	char *devlist;	/* domain device list */
85 	size_t   size;	/* size of devlist buffer */
86 };
87 
88 
89 #ifdef	_SYSCALL32
90 /*
91  * kernel view of ILP32 data structure
92  */
93 struct ppm_dpwr32 {
94 	caddr32_t domain;	/* domain name */
95 	int32_t  level;		/* domain power level */
96 };
97 
98 struct ppm_bydev32 {
99 	caddr32_t path;		/* device prom path */
100 	caddr32_t domlist;	/* domain names */
101 	size32_t   size;	/* size of domlist buffer */
102 };
103 
104 struct ppm_bydom32 {
105 	caddr32_t domain;	/* domain name */
106 	caddr32_t devlist;	/* domain device list */
107 	size32_t   size;	/* size of devlist buffer */
108 };
109 #endif	/* _SYSCALL32 */
110 
111 /*
112  * .level may be the following
113  */
114 #define	PPMIO_POWER_OFF		0
115 #define	PPMIO_POWER_ON		1
116 #define	PPMIO_LED_BLINKING	2
117 #define	PPMIO_LED_SOLIDON	3
118 /* (s10) */
119 #define	PPM_IDEV_POWER_OFF	PPMIO_POWER_OFF
120 #define	PPM_IDEV_POWER_ON	PPMIO_POWER_ON
121 
122 
123 #ifdef	__cplusplus
124 }
125 #endif
126 
127 #endif	/* _SYS_PPMIO_H */
128