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
33extern "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
56typedef struct {
57	int alarm_no;
58	int state;
59} lom_aldata_t;
60
61typedef struct {
62	int on;
63} lom_fled_info_t;
64
65typedef struct {
66	char ser_char;
67	char pad1[7];
68	int fault_led;
69	int pad2[2];
70} lom_ctl_t;
71
72typedef struct {
73	char escape_chars[6];
74	char pad1[2];
75	int serial_events;
76} lom_ctl2_t;
77
78typedef struct {
79	int pad1[4];
80	int config;
81	int pad2[8];
82} lom_mprog_t;
83
84typedef 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
94typedef 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
111typedef 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
120typedef 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
147typedef 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
156typedef 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