xref: /titanic_50/usr/src/uts/sun4u/starcat/sys/sckm_msg.h (revision e7cbe64f7a72dae5cb44f100db60ca88f3313c65)
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 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_SCKM_MSG_H
28 #define	_SYS_SCKM_MSG_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * This header file describes the format of the IOSRAM mailbox messages
38  * exchanged between the sckmr driver on a Starcat Domain and the
39  * Starcat System Controller.
40  */
41 
42 #include <sys/types.h>
43 
44 /*
45  * MBOXSC_MSG_EVENT or MBOXSC_MSG_REQUEST message header.
46  */
47 typedef struct sckm_mbox_req_hdr {
48 	uint32_t sckm_version;		/* protocol version */
49 	uint32_t reserved;
50 } sckm_mbox_req_hdr_t;
51 
52 /*
53  * MBOXSC_MSG_REPLY message header
54  */
55 typedef struct sckm_mbox_rep_hdr {
56 	uint32_t sckm_version;		/* protocol version */
57 	uint32_t status;		/* error code */
58 	uint32_t sadb_msg_errno;	/* PF_KEY errno, if applicable */
59 	uint32_t sadb_msg_version;	/* PF_KEY version, if applicable */
60 } sckm_mbox_rep_hdr_t;
61 
62 /*
63  * Version of this current protocol.
64  */
65 #define	SCKM_PROTOCOL_VERSION	1
66 
67 /*
68  * Keys for SC to Domain and Domain to SC mailboxes
69  */
70 #define	KEY_SCKD	0x53434b44	/* SC to Domain mailbox */
71 #define	KEY_KDSC	0x4b445343	/* Domain to SC mailbox */
72 
73 /*
74  * Max data size, in bytes, for IOSRAM mailboxes
75  */
76 #define	SCKM_SCKD_MAXDATA	1024
77 #define	SCKM_KDSC_MAXDATA	1024
78 
79 /*
80  * Message types.
81  */
82 #define	SCKM_MSG_SADB		0x1	/* SADB message		SC<->D */
83 
84 /*
85  * Values for sckm_msg_rep_hdr status field.
86  */
87 #define	SCKM_SUCCESS		0x0	/* Operation succeeded */
88 #define	SCKM_ERR_VERSION	0x1	/* Unexpected version */
89 #define	SCKM_ERR_SADB_PFKEY	0x2	/* PF_KEY returned an error */
90 #define	SCKM_ERR_SADB_MSG	0x3	/* bad SADB msg detect by driver */
91 #define	SCKM_ERR_DAEMON		0x4	/* Error communicating with daemon */
92 #define	SCKM_ERR_BAD_CMD	0x5	/* unknown command */
93 #define	SCKM_ERR_SADB_VERSION	0x6	/* bad SADB version */
94 #define	SCKM_ERR_SADB_TIMEOUT	0x7	/* no response from key engine */
95 #define	SCKM_ERR_SADB_BAD_TYPE	0x8	/* bad SADB msg type */
96 
97 #ifdef	__cplusplus
98 }
99 #endif
100 
101 #endif /* _SYS_SCKM_MSG_H */
102