xref: /titanic_51/usr/src/cmd/picl/plugins/sun4u/snowbird/lib/libctsmc/smclib.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	__SMCLIB_H__
28 #define	__SMCLIB_H__
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/types.h>
33 #include <smc_if.h>
34 #include <smc_commands.h>
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * SMC error codes
42  */
43 typedef enum {
44 	SMC_SUCCESS 		= 0x0,
45 	SMC_FAILURE		= 0x1,
46 	SMC_REQ_FAILURE		= 0x2,
47 	SMC_ACK_TIMEOUT		= 0x3,
48 	SMC_ACK_FAILURE		= 0x4,
49 	SMC_RSP_FAILURE		= 0x5,
50 	SMC_RSP_TIMEOUT		= 0x6,
51 	SMC_INVALID_SEQ		= 0x7,
52 	SMC_RSP_ERROR		= 0x8
53 } smc_errno_t;
54 
55 extern smc_errno_t smc_init_smc_msg(sc_reqmsg_t *req_msg, smc_app_command_t cmd,
56 	uint8_t msg_id, uint8_t msg_data_size);
57 
58 extern smc_errno_t smc_init_ipmi_msg(sc_reqmsg_t *req_msg, uint8_t cmd,
59 	uint8_t msg_id, uint8_t msg_data_size, uint8_t *msg_data_buf,
60 	int8_t seq_num, int ipmb_addr, smc_netfn_t netfn, smc_lun_t lun);
61 
62 extern smc_errno_t smc_send_msg(int fd, sc_reqmsg_t *req_pkt,
63 	sc_rspmsg_t *rsp_pkt, int poll_time);
64 
65 #ifdef	__cplusplus
66 }
67 #endif
68 
69 #endif	/* __SMCLIB_H__ */
70