8354 sync regcomp(3C) with upstream (fix make catalog)
[unleashed/tickless.git] / usr / src / uts / sun4u / lw8 / sys / lw8_impl.h
blob559f14e9f88cdc6b0297a57618510c092780a880
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
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_LW8_IMPL_H
28 #define _SYS_LW8_IMPL_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
37 * local driver defines and structures
40 #define LW8_DEFAULT_MAX_MBOX_WAIT_TIME 30
42 typedef struct lw8_event {
43 int32_t event_type;
44 } lw8_event_t;
47 * mailbox commands
49 #define LW8_MBOX_UPDATE_FW 0
50 #define LW8_MBOX_GET_INFO 1
51 #define LW8_MBOX_SET_CTL 2
52 #define LW8_MBOX_GET_LED 3
53 #define LW8_MBOX_SET_LED 4
54 #define LW8_MBOX_GET_EVENTS 5
55 #define LW8_MBOX_GET_NEXT_MSG 6
56 #define LW8_MBOX_WDT_GET 7
57 #define LW8_MBOX_WDT_SET 8
60 * mailbox events
62 #define LW8_EVENT_REQUESTED_SHUTDOWN 0
63 #define LW8_EVENT_VOLTAGE_SHUTDOWN 1
64 #define LW8_EVENT_TEMPERATURE_SHUTDOWN 2
65 #define LW8_EVENT_FANFAIL_SHUTDOWN 3
66 #define LW8_EVENT_NO_SCC_SHUTDOWN 4
67 #define LW8_EVENT_NEW_LOG_MSG 5
68 #define LW8_EVENT_SC_RESTARTED 6
71 * led requests
73 #define MAX_LEDS_PER_FRU 9
74 #define MAX_FRUS 24
76 typedef struct lw8_get_led_payload {
77 char value[(3 * (MAX_FRUS - 1)) + MAX_LEDS_PER_FRU];
78 } lw8_get_led_payload_t;
80 typedef struct lw8_set_led_payload {
81 char offset;
82 char value;
83 } lw8_set_led_payload_t;
85 typedef struct {
86 int num; /* no. events requested and no. returned */
87 int level; /* level of events requested */
88 } lom_eventreq_t;
90 #define MAX_EVENTS 128
91 #define MAX_EVENT_STR 80
93 typedef struct {
94 int num; /* no. events requested and no. returned */
95 int level; /* level of events requested */
96 char string[MAX_EVENTS][MAX_EVENT_STR];
97 } lom_eventresp_t;
99 #define MAX_MSG_STR 1012
100 typedef struct {
101 int level; /* syslog msg level */
102 int msg_valid; /* 1 if valid, 0 if not valid */
103 int num_remaining; /* num of msg's left to retrieve after this */
104 char msg[MAX_MSG_STR]; /* the message text */
105 } lw8_logmsg_t;
108 * LW8_MBOX_WDT_GET message: SC <-> Solaris
110 * SC and Solaris use this message to learn what its peer has
111 * as their current state for these watchdog state-machine
112 * variables.
114 typedef struct {
115 int recovery_enabled; /* 1/0 => {en,dis}abled */
116 int watchdog_enabled; /* 1/0 => {en,dis}abled */
117 int timeout; /* in seconds */
118 } lw8_get_wdt_t;
121 * LW8_MBOX_WDT_SET message: SC <- Solaris
123 * Solaris uses this to update the SC with the latest
124 * 'value' for the specified 'property_id'.
126 * Eg, to specify that the watchdog state-machine is in
127 * System Mode, <property_id, value> would be set to:
129 * <LW8_WDT_PROP_MODE, LW8_PROP_MODE_SWDT>
131 typedef struct {
132 int property_id;
133 int value;
134 } lw8_set_wdt_t;
136 /* choices for 'property_id' field: */
137 #define LW8_WDT_PROP_RECOV 0 /* recovery_enabled */
138 #define LW8_WDT_PROP_WDT 1 /* watchdog_enabled */
139 #define LW8_WDT_PROP_TO 2 /* timeout duration */
140 #define LW8_WDT_PROP_MODE 3 /* mode: AWDT or SWDT */
143 * choices for 'value' field (for the specified 'property_id'):
145 /* LW8_WDT_PROP_RECOV */
146 #define LW8_PROP_RECOV_ENABLED 1
147 #define LW8_PROP_RECOV_DISABLED 0
149 /* LW8_WDT_PROP_WDT */
150 #define LW8_PROP_WDT_ENABLED 1
151 #define LW8_PROP_WDT_DISABLED 0
153 /* LW8_WDT_PROP_TO: integral number of seconds */
155 /* LW8_WDT_PROP_MODE */
156 #define LW8_PROP_MODE_AWDT 1 /* App wdog mode */
157 #define LW8_PROP_MODE_SWDT 0 /* System wdog mode */
159 #ifdef __cplusplus
161 #endif
163 #endif /* _SYS_LW8_IMPL_H */