xref: /onnv-gate/usr/src/uts/sun4u/lw8/sys/lw8.h (revision 1708:ea74d8598a3a)
1*1708Sstevel /*
2*1708Sstevel  * CDDL HEADER START
3*1708Sstevel  *
4*1708Sstevel  * The contents of this file are subject to the terms of the
5*1708Sstevel  * Common Development and Distribution License (the "License").
6*1708Sstevel  * You may not use this file except in compliance with the License.
7*1708Sstevel  *
8*1708Sstevel  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*1708Sstevel  * or http://www.opensolaris.org/os/licensing.
10*1708Sstevel  * See the License for the specific language governing permissions
11*1708Sstevel  * and limitations under the License.
12*1708Sstevel  *
13*1708Sstevel  * When distributing Covered Code, include this CDDL HEADER in each
14*1708Sstevel  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*1708Sstevel  * If applicable, add the following below this CDDL HEADER, with the
16*1708Sstevel  * fields enclosed by brackets "[]" replaced with your own identifying
17*1708Sstevel  * information: Portions Copyright [yyyy] [name of copyright owner]
18*1708Sstevel  *
19*1708Sstevel  * CDDL HEADER END
20*1708Sstevel  */
21*1708Sstevel 
22*1708Sstevel /*
23*1708Sstevel  * Copyright 2001 Sun Microsystems, Inc.  All rights reserved.
24*1708Sstevel  * Use is subject to license terms.
25*1708Sstevel  */
26*1708Sstevel 
27*1708Sstevel #ifndef _SYS_LW8_H
28*1708Sstevel #define	_SYS_LW8_H
29*1708Sstevel 
30*1708Sstevel #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*1708Sstevel 
32*1708Sstevel #ifdef	__cplusplus
33*1708Sstevel extern "C" {
34*1708Sstevel #endif
35*1708Sstevel 
36*1708Sstevel /*
37*1708Sstevel  * subset of ioctl commands from PSARC 2000/019
38*1708Sstevel  */
39*1708Sstevel 
40*1708Sstevel #define	LOMIOCALCTL		_IOW('a', 4, lom_aldata_t)
41*1708Sstevel #define	LOMIOCALSTATE		_IOWR('a', 5, lom_aldata_t)
42*1708Sstevel #define	LOMIOCFLEDSTATE		_IOR('a', 24, lom_fled_info_t)
43*1708Sstevel #define	LOMIOCINFO		_IOR('a', 25, lom_info_t)
44*1708Sstevel #define	LOMIOCINFO2		_IOWR('a', 46, lom2_info_t)
45*1708Sstevel #define	LOMIOCCTL		_IOW('a', 27, lom_ctl_t)
46*1708Sstevel #define	LOMIOCCTL2		_IOW('a', 40, lom_ctl2_t)
47*1708Sstevel #define	LOMIOCPROG		_IOWR('a', 28, lom_prog_t)
48*1708Sstevel #define	LOMIOCWTMON		_IOWR('a', 2, int)
49*1708Sstevel #define	LOMIOCMREAD		_IOR('a', 33, lom_mprog_t)
50*1708Sstevel #define	LOMIOCEVENTLOG2		_IOWR('a', 45, lom_eventlog2_t)
51*1708Sstevel 
52*1708Sstevel #define	LOM_SERIAL_EVENTS_ON	0x100
53*1708Sstevel #define	LOM_SERIAL_EVENTS_OFF	0x200
54*1708Sstevel #define	LOM_SERIAL_EVENTS_DEF 	0x300
55*1708Sstevel 
56*1708Sstevel typedef struct {
57*1708Sstevel 	int alarm_no;
58*1708Sstevel 	int state;
59*1708Sstevel } lom_aldata_t;
60*1708Sstevel 
61*1708Sstevel typedef struct {
62*1708Sstevel 	int on;
63*1708Sstevel } lom_fled_info_t;
64*1708Sstevel 
65*1708Sstevel typedef struct {
66*1708Sstevel 	char ser_char;
67*1708Sstevel 	char pad1[7];
68*1708Sstevel 	int fault_led;
69*1708Sstevel 	int pad2[2];
70*1708Sstevel } lom_ctl_t;
71*1708Sstevel 
72*1708Sstevel typedef struct {
73*1708Sstevel 	char escape_chars[6];
74*1708Sstevel 	char pad1[2];
75*1708Sstevel 	int serial_events;
76*1708Sstevel } lom_ctl2_t;
77*1708Sstevel 
78*1708Sstevel typedef struct {
79*1708Sstevel 	int pad1[4];
80*1708Sstevel 	int config;
81*1708Sstevel 	int pad2[8];
82*1708Sstevel } lom_mprog_t;
83*1708Sstevel 
84*1708Sstevel typedef struct {
85*1708Sstevel 	char ser_char;
86*1708Sstevel 	char pad1[7];
87*1708Sstevel 	int fver;
88*1708Sstevel 	int fchksum;
89*1708Sstevel 	int prod_rev;
90*1708Sstevel 	char prod_id[12];
91*1708Sstevel 	int pad2[1];
92*1708Sstevel } lom_info_t;
93*1708Sstevel 
94*1708Sstevel typedef struct {
95*1708Sstevel 	char escape_chars[6];
96*1708Sstevel 	char pad1[2];
97*1708Sstevel 	int serial_events;
98*1708Sstevel 	int pad2[1];
99*1708Sstevel 	int fver;
100*1708Sstevel 	int fchksum;
101*1708Sstevel 	int prod_rev;
102*1708Sstevel 	char prod_id[12];
103*1708Sstevel 	int serial_config;
104*1708Sstevel 	int baud_rate;
105*1708Sstevel 	int serial_hw_config;
106*1708Sstevel 	int phone_home_config;
107*1708Sstevel 	char phone_home_script[128];
108*1708Sstevel 	int pad3[16];
109*1708Sstevel } lom2_info_t;
110*1708Sstevel 
111*1708Sstevel typedef struct {
112*1708Sstevel 	int index;	/* bit 0x8000 should be set if last buffer */
113*1708Sstevel 	uint8_t data[0x400];
114*1708Sstevel 	int size;
115*1708Sstevel } lom_prog_t;
116*1708Sstevel 
117*1708Sstevel #define	MAX_EVENTS	128
118*1708Sstevel #define	MAX_EVENT_STR	80
119*1708Sstevel 
120*1708Sstevel typedef struct {
121*1708Sstevel 	int   num; /* no. events requested and no. returned */
122*1708Sstevel 	int   level; /* level of events requested */
123*1708Sstevel 	int   pad1[MAX_EVENTS];
124*1708Sstevel 	char  string[MAX_EVENTS][MAX_EVENT_STR];
125*1708Sstevel 	int   pad2[MAX_EVENTS];
126*1708Sstevel } lom_eventlog2_t;
127*1708Sstevel 
128*1708Sstevel /*
129*1708Sstevel  * Project private ioctl commands - used by lw8 picl frutree plugin only
130*1708Sstevel  */
131*1708Sstevel 
132*1708Sstevel #define	LOMIOCGETLED		_IOWR('a', 100, lom_get_led_t)
133*1708Sstevel #define	LOMIOCSETLED		_IOWR('a', 101, lom_set_led_t)
134*1708Sstevel 
135*1708Sstevel #define	MAX_ID_LEN 16
136*1708Sstevel #define	MAX_LOCATION_LEN 16
137*1708Sstevel #define	MAX_COLOR_LEN 16
138*1708Sstevel 
139*1708Sstevel #define	LOM_LED_STATUS_OFF	0
140*1708Sstevel #define	LOM_LED_STATUS_ON	1
141*1708Sstevel #define	LOM_LED_STATUS_FLASHING	2
142*1708Sstevel #define	LOM_LED_STATUS_BLINKING	3
143*1708Sstevel 
144*1708Sstevel #define	LOM_LED_POSITION_FRU		0
145*1708Sstevel #define	LOM_LED_POSITION_LOCATION	1
146*1708Sstevel 
147*1708Sstevel typedef struct {
148*1708Sstevel 	char    location[MAX_LOCATION_LEN];
149*1708Sstevel 	char	id[MAX_ID_LEN];
150*1708Sstevel 	int 	status;
151*1708Sstevel 	int	position;
152*1708Sstevel 	char	color[MAX_COLOR_LEN];
153*1708Sstevel 	char	next_id[MAX_ID_LEN];
154*1708Sstevel } lom_get_led_t;
155*1708Sstevel 
156*1708Sstevel typedef struct {
157*1708Sstevel 	char    location[MAX_LOCATION_LEN];
158*1708Sstevel 	char	id[MAX_ID_LEN];
159*1708Sstevel 	int 	status;
160*1708Sstevel } lom_set_led_t;
161*1708Sstevel 
162*1708Sstevel #ifdef	__cplusplus
163*1708Sstevel }
164*1708Sstevel #endif
165*1708Sstevel 
166*1708Sstevel #endif	/* _SYS_LW8_H */
167