9815 Want basic AHCI enclosure services
[unleashed.git] / usr / src / uts / common / sys / ppmio.h
blob81eac535c8f0d3536472365c661eec0705601a1f
1 /*
2 * CDDL HEADER START
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]
19 * CDDL HEADER END
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_PPMIO_H
27 #define _SYS_PPMIO_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <sys/types.h>
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
37 #define PPMIOC ('p' << 8)
38 #define PPMIOCSET (PPMIOC | 1)
39 #define PPMIOCGET (PPMIOC | 2)
40 #define PPMGET_DPWR (PPMIOC | 3)
41 #define PPMGET_DOMBYDEV (PPMIOC | 4)
42 #define PPMGET_DEVBYDOM (PPMIOC | 5)
44 * The following two ioctls are used for testing purposes only.
46 #if defined(__x86)
47 #define PPMGET_NORMAL (PPMIOC | 6)
48 #define PPMSET_NORMAL (PPMIOC | 7)
49 #endif
52 * PPMIOCGET
53 * Note: this ioctl command is available for Excalibur and Grover
54 * only, but will be removed in future, replacing with PPMGET_DPWR
56 typedef struct ppmreq {
57 int ppmdev;
58 union ppmop {
59 struct idev_power {
60 int level;
61 } idev_power;
62 } ppmop;
63 } ppmreq_t;
65 /* definition for ppmdev */
66 #define PPM_INTERNAL_DEVICE_POWER 1
69 * PPMGET_DPWR
71 struct ppm_dpwr {
72 char *domain; /* domain name */
73 int level; /* domain power level */
77 * PPMGET_DOMBYDEV
79 struct ppm_bydev {
80 char *path; /* device prom path */
81 char *domlist; /* domain names */
82 size_t size; /* size of domlist buffer */
86 * PPMGET_DEVBYDOM
88 struct ppm_bydom {
89 char *domain; /* domain name */
90 char *devlist; /* domain device list */
91 size_t size; /* size of devlist buffer */
95 * PPM[GS]ET_NORM
97 struct ppm_norm {
98 char *path; /* device prom path */
99 int norm; /* normal level */
102 #ifdef _SYSCALL32
104 * kernel view of ILP32 data structure
106 struct ppm_dpwr32 {
107 caddr32_t domain; /* domain name */
108 int32_t level; /* domain power level */
111 struct ppm_bydev32 {
112 caddr32_t path; /* device prom path */
113 caddr32_t domlist; /* domain names */
114 size32_t size; /* size of domlist buffer */
117 struct ppm_bydom32 {
118 caddr32_t domain; /* domain name */
119 caddr32_t devlist; /* domain device list */
120 size32_t size; /* size of devlist buffer */
123 struct ppm_norm32 {
124 caddr32_t path; /* device prom path */
125 int32_t norm; /* normal level */
127 #endif /* _SYSCALL32 */
130 * .level may be the following
132 #define PPMIO_POWER_OFF 0
133 #define PPMIO_POWER_ON 1
134 #define PPMIO_LED_BLINKING 2
135 #define PPMIO_LED_SOLIDON 3
136 /* (s10) */
137 #define PPM_IDEV_POWER_OFF PPMIO_POWER_OFF
138 #define PPM_IDEV_POWER_ON PPMIO_POWER_ON
141 #ifdef __cplusplus
143 #endif
145 #endif /* _SYS_PPMIO_H */