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]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_SGSBBC_MAILBOX_H
28 #define _SYS_SGSBBC_MAILBOX_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <sys/sgsbbc.h>
39 * Message types - one per client!
41 #define SBBC_BROADCAST_MSG 0x0
44 #define WILDCAT_RSM_MBOX 0x3
45 #define SG_ENV 0x4 /* environmental data */
47 #define INFO_MBOX 0x6 /* for passing info to the SC */
48 #define SGFRU_MBOX 0x7 /* FRUID messages */
49 #define MBOX_EVENT_GENERIC 0x8
50 #define MBOX_EVENT_KEY_SWITCH 0x9
51 #define MBOX_EVENT_PANIC_SHUTDOWN 0xb
52 #define MBOX_EVENT_ENV 0xc
53 #define MBOX_EVENT_CPCI_ENUM 0xd
55 #define MBOX_EVENT_LW8 0xf
56 #define MBOX_EVENT_DP_ERROR 0x10 /* datapath error */
57 #define MBOX_EVENT_DP_FAULT 0x11 /* datapath fault */
60 #define DBG_MBOX 0x1f /* debug messages */
64 * INFO_MBOX message sub-types
66 #define INFO_MBOX_NODENAME 0x6000 /* for passing nodename to SC */
67 #define INFO_MBOX_ERROR_NOTICE 0x6001 /* for logging ECC errors to SC */
68 #define INFO_MBOX_ERROR_ECC 0x6003 /* updated interface for logging */
69 /* ECC errors to SC */
70 #define INFO_MBOX_ERROR_INDICT 0x6004 /* for logging ECC indictments to SC */
71 #define INFO_MBOX_ECC 0x6005 /* new interface for logging */
72 #define INFO_MBOX_ECC_CAP 0x6006 /* capability message */
75 * Message status values returned by the SC to the various mailbox clients.
77 * These values need to be kept in sync with MailboxProtocol.java
78 * in the SCAPP source code.
80 #define SG_MBOX_STATUS_SUCCESS 0
81 #define SG_MBOX_STATUS_COMMAND_FAILURE (-1)
82 #define SG_MBOX_STATUS_HARDWARE_FAILURE (-2)
83 #define SG_MBOX_STATUS_ILLEGAL_PARAMETER (-3)
84 #define SG_MBOX_STATUS_BOARD_ACCESS_DENIED (-4)
85 #define SG_MBOX_STATUS_STALE_CONTENTS (-5)
86 #define SG_MBOX_STATUS_STALE_OBJECT (-6)
87 #define SG_MBOX_STATUS_NO_SEPROM_SPACE (-7)
88 #define SG_MBOX_STATUS_NO_MEMORY (-8)
89 #define SG_MBOX_STATUS_NOT_SUPPORTED (-9)
90 #define SG_MBOX_STATUS_ILLEGAL_NODE (-10)
91 #define SG_MBOX_STATUS_ILLEGAL_SLOT (-11)
95 * Time out values in seconds.
97 * These definitions should not be used directly except by the
98 * sbbc_mbox_xxx_timeout variables. All clients should then use
99 * these variables to allow running kernels to modify wait times.
101 #define MBOX_MIN_TIMEOUT 1 /* min time to wait before timeout */
102 #define MBOX_DEFAULT_TIMEOUT 30 /* suggested wait time */
107 extern int sbbc_mbox_min_timeout
; /* minimum wait time */
108 extern int sbbc_mbox_default_timeout
; /* suggested wait time */
112 * Message type consists of two parts
114 * sub_type - client defined message type
122 * this struct is used by client programs to request
123 * mailbox message services
125 typedef struct sbbc_msg
{
126 sbbc_msg_type_t msg_type
; /* message type */
127 int msg_status
; /* message return value */
128 int msg_len
; /* size of message buffer */
129 int msg_bytes
; /* number of bytes returned */
130 caddr_t msg_buf
; /* message buffer */
131 int32_t msg_data
[2]; /* for junk mail */
135 * This data structure is used for queueing up ECC event mailbox
136 * messages through the SBBC taskq.
139 typedef struct sbbc_ecc_mbox
{
140 sbbc_msg_t ecc_req
; /* request */
141 sbbc_msg_t ecc_resp
; /* response */
142 int ecc_log_error
; /* Log errors to /var/adm/messages */
146 * ECC event mailbox taskq parameters
148 #define ECC_MBOX_TASKQ_MIN 2 /* minimum number of jobs */
149 #define ECC_MBOX_TASKQ_MAX 512 /* maximum number of jobs */
152 * These are used to throttle error messages that may appear if
153 * the attempt to enqueue an ECC event message to the SC fails.
154 * If set to N > 0, then only every Nth message will be output.
155 * Set to 0 or 1 to disable this throttling and allow all error
156 * messages to appear.
158 * ECC_MBOX_TASKQ_ERR_THROTTLE is the default value for
159 * sbbc_ecc_mbox_err_throttle, which may be overridden in
160 * /etc/system or at run time via debugger.
162 #define ECC_MBOX_TASKQ_ERR_THROTTLE 64
163 extern int sbbc_ecc_mbox_err_throttle
;
165 extern int sbbc_mbox_reg_intr(uint32_t, sbbc_intrfunc_t
,
166 sbbc_msg_t
*, uint_t
*, kmutex_t
*);
167 extern int sbbc_mbox_unreg_intr(uint32_t, sbbc_intrfunc_t
);
168 extern int sbbc_mbox_request_response(sbbc_msg_t
*,
169 sbbc_msg_t
*, time_t);
175 #endif /* _SYS_SGSBBC_MAILBOX_H */