4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
36 #define _SCIOC ('s' << 8)
41 #define SCIOC_MSG_SPEC (_SCIOC | 0x04)
42 #define SCIOC_RESERVE_SEQN (_SCIOC | 0x05)
43 #define SCIOC_FREE_SEQN (_SCIOC | 0x06)
44 #define SCIOC_SEND_SYNC_CMD (_SCIOC | 0x07)
47 * IOCTLs to facilitate debugging
49 #define SCIOC_ECHO_ON_REQ (_SCIOC | 0x08)
50 #define SCIOC_ECHO_OFF_REQ (_SCIOC | 0x09)
53 * A response message can be sent from any application
54 * to simulate a condition of watchdog expiry or receiving
57 #define SCIOC_ASYNC_SIM (_SCIOC | 0x0A)
63 * structure definitions
73 uint8_t cmd
; /* Will be 0 is non-SMC response, e.g. wdog */
74 uint8_t len
; /* Length of message, including header */
75 uint8_t cc
; /* if non-SMC, contains MSG type */
78 #define SC_SEND_HEADER (sizeof (sc_reqhdr_t))
79 #define SC_RECV_HEADER (sizeof (sc_rsphdr_t))
81 #define SC_MSG_MAX_SIZE 0x3E
82 #define SC_SEND_DSIZE (SC_MSG_MAX_SIZE - SC_SEND_HEADER)
83 #define SC_RECV_DSIZE (SC_MSG_MAX_SIZE - SC_RECV_HEADER)
85 #define SMC_CMD_FAILED -1
98 uint8_t args
[MAX_CMDS
];
101 #define SC_CMDSPEC_ATTR(CMDSPEC) ((CMDSPEC).attribute)
102 #define SC_CMDSPEC_ARGS(CMDSPEC) ((CMDSPEC).args)
105 * Entire SMC Request Message sent down-stream
109 uchar_t data
[SC_SEND_DSIZE
];
113 * Entire SMC Response Message forwarded up-stream
117 uchar_t data
[SC_RECV_DSIZE
];
120 #define SC_MSG_HDR(msg) ((msg)->hdr)
122 #define SC_SEND_DLENGTH(msg) (SC_MSG_HDR(msg).len)
123 #define SC_RECV_DLENGTH(msg) (SC_MSG_HDR(msg).len)
125 #define SC_MSG_ID(msg) (SC_MSG_HDR(msg).msg_id)
126 #define SC_MSG_CMD(msg) (SC_MSG_HDR(msg).cmd)
127 #define SC_MSG_LEN(msg) (SC_MSG_HDR(msg).len)
128 #define SC_MSG_CC(msg) (SC_MSG_HDR(msg).cc)
129 #define SC_MSG_DATA(msg) ((msg)->data)
132 * IPMB sequence number request structure. Application can
133 * reserve a block of sequence numbers for communicating
134 * with each destination
138 uint8_t d_addr
; /* Destination micro-controller addr */
139 int8_t n_seqn
; /* Number of seq# requested, max 16, -1 => free all */
140 uint8_t seq_numbers
[SC_SEQ_SZ
]; /* Placeholder for seq# */
143 #define SC_SEQN_DADDR(SEQDESC) ((SEQDESC).d_addr)
144 #define SC_SEQN_COUNT(SEQDESC) ((SEQDESC).n_seqn)
145 #define SC_SEQN_NUMBERS(SEQDESC) ((SEQDESC).seq_numbers)
151 #endif /* _SYS_SMC_IF_H */