summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/ppmio.h
blob: 81eac535c8f0d3536472365c661eec0705601a1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*
 * 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
 * or http://www.opensolaris.org/os/licensing.
 * 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 2007 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _SYS_PPMIO_H
#define	_SYS_PPMIO_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#include <sys/types.h>

#ifdef	__cplusplus
extern "C" {
#endif

#define	PPMIOC			('p' << 8)
#define	PPMIOCSET		(PPMIOC | 1)
#define	PPMIOCGET		(PPMIOC | 2)
#define	PPMGET_DPWR		(PPMIOC | 3)
#define	PPMGET_DOMBYDEV		(PPMIOC | 4)
#define	PPMGET_DEVBYDOM		(PPMIOC | 5)
/*
 * The following two ioctls are used for testing purposes only.
 */
#if defined(__x86)
#define	PPMGET_NORMAL		(PPMIOC | 6)
#define	PPMSET_NORMAL		(PPMIOC | 7)
#endif

/*
 * PPMIOCGET
 * Note: this ioctl command is available for Excalibur and Grover
 * only, but will be removed in future, replacing with PPMGET_DPWR
 */
typedef struct ppmreq {
	int	ppmdev;
	union ppmop {
		struct idev_power {
			int level;
		} idev_power;
	} ppmop;
} ppmreq_t;

/* definition for ppmdev */
#define	PPM_INTERNAL_DEVICE_POWER	1

/*
 * PPMGET_DPWR
 */
struct ppm_dpwr {
	char *domain;	/* domain name */
	int  level;	/* domain power level */
};

/*
 * PPMGET_DOMBYDEV
 */
struct ppm_bydev {
	char *path;	/* device prom path */
	char *domlist;	/* domain names */
	size_t   size;	/* size of domlist buffer */
};

/*
 * PPMGET_DEVBYDOM
 */
struct ppm_bydom {
	char *domain;	/* domain name */
	char *devlist;	/* domain device list */
	size_t   size;	/* size of devlist buffer */
};

/*
 * PPM[GS]ET_NORM
 */
struct ppm_norm {
	char *path;	/* device prom path */
	int  norm;	/* normal level */
};

#ifdef	_SYSCALL32
/*
 * kernel view of ILP32 data structure
 */
struct ppm_dpwr32 {
	caddr32_t domain;	/* domain name */
	int32_t  level;		/* domain power level */
};

struct ppm_bydev32 {
	caddr32_t path;		/* device prom path */
	caddr32_t domlist;	/* domain names */
	size32_t   size;	/* size of domlist buffer */
};

struct ppm_bydom32 {
	caddr32_t domain;	/* domain name */
	caddr32_t devlist;	/* domain device list */
	size32_t   size;	/* size of devlist buffer */
};

struct ppm_norm32 {
	caddr32_t path;		/* device prom path */
	int32_t  norm;		/* normal level */
};
#endif	/* _SYSCALL32 */

/*
 * .level may be the following
 */
#define	PPMIO_POWER_OFF		0
#define	PPMIO_POWER_ON		1
#define	PPMIO_LED_BLINKING	2
#define	PPMIO_LED_SOLIDON	3
/* (s10) */
#define	PPM_IDEV_POWER_OFF	PPMIO_POWER_OFF
#define	PPM_IDEV_POWER_ON	PPMIO_POWER_ON


#ifdef	__cplusplus
}
#endif

#endif	/* _SYS_PPMIO_H */