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