xref: /illumos-gate/usr/src/uts/sun4u/lw8/sys/sgfru_mbox.h (revision 03831d35)
1*03831d35Sstevel /*
2*03831d35Sstevel  * CDDL HEADER START
3*03831d35Sstevel  *
4*03831d35Sstevel  * The contents of this file are subject to the terms of the
5*03831d35Sstevel  * Common Development and Distribution License (the "License").
6*03831d35Sstevel  * You may not use this file except in compliance with the License.
7*03831d35Sstevel  *
8*03831d35Sstevel  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*03831d35Sstevel  * or http://www.opensolaris.org/os/licensing.
10*03831d35Sstevel  * See the License for the specific language governing permissions
11*03831d35Sstevel  * and limitations under the License.
12*03831d35Sstevel  *
13*03831d35Sstevel  * When distributing Covered Code, include this CDDL HEADER in each
14*03831d35Sstevel  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*03831d35Sstevel  * If applicable, add the following below this CDDL HEADER, with the
16*03831d35Sstevel  * fields enclosed by brackets "[]" replaced with your own identifying
17*03831d35Sstevel  * information: Portions Copyright [yyyy] [name of copyright owner]
18*03831d35Sstevel  *
19*03831d35Sstevel  * CDDL HEADER END
20*03831d35Sstevel  */
21*03831d35Sstevel 
22*03831d35Sstevel /*
23*03831d35Sstevel  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*03831d35Sstevel  * Use is subject to license terms.
25*03831d35Sstevel  */
26*03831d35Sstevel 
27*03831d35Sstevel #ifndef _SGFRU_MBOX_H
28*03831d35Sstevel #define	_SGFRU_MBOX_H
29*03831d35Sstevel 
30*03831d35Sstevel #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*03831d35Sstevel 
32*03831d35Sstevel #ifdef	__cplusplus
33*03831d35Sstevel extern "C" {
34*03831d35Sstevel #endif
35*03831d35Sstevel 
36*03831d35Sstevel #include <sys/sgfru_priv.h>
37*03831d35Sstevel #include <sys/conf.h>
38*03831d35Sstevel #include <sys/ddi_impldefs.h>
39*03831d35Sstevel 
40*03831d35Sstevel /*
41*03831d35Sstevel  * Max time sgfru waits for mailbox to respond before
42*03831d35Sstevel  * it decides to timeout. (measured in seconds)
43*03831d35Sstevel  */
44*03831d35Sstevel #define	SGFRU_DEFAULT_MAX_MBOX_WAIT_TIME	86400
45*03831d35Sstevel 
46*03831d35Sstevel /*
47*03831d35Sstevel  *  FRU Mailbox Definitions
48*03831d35Sstevel  *
49*03831d35Sstevel  *	Request (from Solaris to SC):
50*03831d35Sstevel  *		msg_len = CONTAINER_HDL_SIZE
51*03831d35Sstevel  *  		msg_buf = pointer to unpadded container_hdl_t
52*03831d35Sstevel  *  	Response (from SC to Solaris):
53*03831d35Sstevel  *		msg_len = FRU_CNT_SIZE
54*03831d35Sstevel  *  		msg_buf = pointer to unpadded fru_cnt_t
55*03831d35Sstevel  *  		msg_status = return value, see below.
56*03831d35Sstevel  *  Error Notes:
57*03831d35Sstevel  */
58*03831d35Sstevel #define	SGFRU_MBOX_GETNUMSECTIONS		0x7001
59*03831d35Sstevel /*
60*03831d35Sstevel  *	Request (from Solaris to SC):
61*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE
62*03831d35Sstevel  *  		msg_buf = pointer to unpadded fru_info_t containing:
63*03831d35Sstevel  *		    parent container_hdl_t and max fru_cnt_t (in #sections)
64*03831d35Sstevel  *  	Response (from SC to Solaris):
65*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE + (SECTION_SIZE * max fru_cnt_t)
66*03831d35Sstevel  *              msg_buf = caddr_t of msg_len, contains:
67*03831d35Sstevel  *		    unpadded container_hdl_t and actual fru_cnt_t
68*03831d35Sstevel  *		    unpadded section_t array
69*03831d35Sstevel  *  		msg_status = return value, see below.
70*03831d35Sstevel  *  Error Notes:
71*03831d35Sstevel  *  Please return SG_MBOX_STATUS_NO_MEMORY if the buffer is not big enough.
72*03831d35Sstevel  */
73*03831d35Sstevel #define	SGFRU_MBOX_GETSECTIONS			0x7002
74*03831d35Sstevel /*
75*03831d35Sstevel  *	Request (from Solaris to SC):
76*03831d35Sstevel  *		msg_len = SECTION_HDL_SIZE
77*03831d35Sstevel  *  		msg_buf = pointer to unpadded section_hdl_t
78*03831d35Sstevel  *  	Response (from SC to Solaris):
79*03831d35Sstevel  *		msg_len = FRU_CNT_SIZE
80*03831d35Sstevel  *  		msg_buf = pointer to unpadded fru_cnt_t
81*03831d35Sstevel  *  		msg_status = return value, see below.
82*03831d35Sstevel  *  Error Notes:
83*03831d35Sstevel  */
84*03831d35Sstevel #define	SGFRU_MBOX_GETNUMSEGMENTS		0x7003
85*03831d35Sstevel /*
86*03831d35Sstevel  * FRU  Mailbox definitions
87*03831d35Sstevel  *
88*03831d35Sstevel  *	Request (from Solaris to SC):
89*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE
90*03831d35Sstevel  *  		msg_buf = pointer to unpadded fru_info_t containing:
91*03831d35Sstevel  *		    parent section_hdl_t and max fru_cnt_t (in #segments)
92*03831d35Sstevel  *  	Response (from SC to Solaris):
93*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE + (SEGMENT_SIZE * max fru_cnt_t)
94*03831d35Sstevel  *              msg_buf = caddr_t of msg_len, contains:
95*03831d35Sstevel  *		    unpadded parent section_hdl_t and actual fru_cnt_t
96*03831d35Sstevel  *		    unpadded segment_t array
97*03831d35Sstevel  *  		msg_status = return value, see below.
98*03831d35Sstevel  *  Error Notes:
99*03831d35Sstevel  *  Please return SG_MBOX_STATUS_NO_MEMORY if the buffer is not big enough.
100*03831d35Sstevel  */
101*03831d35Sstevel #define	SGFRU_MBOX_GETSEGMENTS			0x7004
102*03831d35Sstevel /*
103*03831d35Sstevel  *	Request (from Solaris to SC):
104*03831d35Sstevel  *		msg_len = SECTION_HDL_SIZE + SEGMENT_SIZE
105*03831d35Sstevel  *  		msg_buf = caddr_t of msg_len, contains:
106*03831d35Sstevel  *		    unpadded parent section_hdl_t
107*03831d35Sstevel  *		    unpadded segment_t
108*03831d35Sstevel  *  	Response (from SC to Solaris):
109*03831d35Sstevel  *  		msg_len = SEGMENT_HDL_SIZE
110*03831d35Sstevel  *              msg_buf = pointer to:
111*03831d35Sstevel  *		    segment_hdl_t of newly created segment
112*03831d35Sstevel  *		    updated parent section_hdl_t
113*03831d35Sstevel  *  		msg_status = return value, see below.
114*03831d35Sstevel  *  Error Notes:
115*03831d35Sstevel  *  Please return SG_MBOX_STATUS_STALE_OBJECT if the section_hdl_t is stale.
116*03831d35Sstevel  *  Please return SG_MBOX_STATUS_NO_SEPROM_SPACE if the seprom is out of space
117*03831d35Sstevel  */
118*03831d35Sstevel #define	SGFRU_MBOX_ADDSEGMENT			0x7005
119*03831d35Sstevel /*
120*03831d35Sstevel  *	Request (from Solaris to SC):
121*03831d35Sstevel  *		msg_len = SEGMENT_HDL_SIZE
122*03831d35Sstevel  *  		msg_buf = pointer to segment_hdl_t of segment to be deleted
123*03831d35Sstevel  *  	Response (from SC to Solaris):
124*03831d35Sstevel  *		msg_len = SECTION_HDL_SIZE
125*03831d35Sstevel  *  		msg_buf = pointer to updated section_hdl_t of deleted segment
126*03831d35Sstevel  *  		msg_status = return value, see below
127*03831d35Sstevel  *  Error Notes:
128*03831d35Sstevel  */
129*03831d35Sstevel #define	SGFRU_MBOX_DELETESEGMENT		0x7006
130*03831d35Sstevel /*
131*03831d35Sstevel  *	Request (from Solaris to SC):
132*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE
133*03831d35Sstevel  *  		msg_buf = caddr_t of msg_len, contains:
134*03831d35Sstevel  *		    unpadded fru_info_t: segment_hdl_t and max count in bytes
135*03831d35Sstevel  *  	Response (from SC to Solaris):
136*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE
137*03831d35Sstevel  *              msg_buf = caddr_t of msg_len, contains:
138*03831d35Sstevel  *		    unpadded fru_info_t: segment_hdl_t and actual count in bytes
139*03831d35Sstevel  *		    unpadded data of actual fru_cnt_t bytes
140*03831d35Sstevel  *  		msg_status = return value, see below.
141*03831d35Sstevel  *  Error Notes:
142*03831d35Sstevel  *  Please return SG_MBOX_STATUS_NO_MEMORY if the buffer is not big enough.
143*03831d35Sstevel  */
144*03831d35Sstevel #define	SGFRU_MBOX_READRAWSEGMENT		0x7007
145*03831d35Sstevel /*
146*03831d35Sstevel  *	Request (from Solaris to SC):
147*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE + fru_cnt_t bytes
148*03831d35Sstevel  *  		msg_buf = caddr_t of msg_len, contains:
149*03831d35Sstevel  *		    unpadded fru_info_t: segment_hdl_t and count in bytes
150*03831d35Sstevel  *		    unpadded data of fru_cnt_t bytes
151*03831d35Sstevel  *  	Response (from SC to Solaris):
152*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE
153*03831d35Sstevel  *              msg_buf = caddr_t of msg_len, contains:
154*03831d35Sstevel  *		    unpadded fru_info_t: segment_hdl_t and count in bytes
155*03831d35Sstevel  *  		msg_status = return value, see below.
156*03831d35Sstevel  *  Error Notes:
157*03831d35Sstevel  *  Please return SG_MBOX_STATUS_ILLEGAL_PARAMETER if it's
158*03831d35Sstevel  *  	not an opaque segment.
159*03831d35Sstevel  */
160*03831d35Sstevel #define	SGFRU_MBOX_WRITERAWSEGMENT		0x7008
161*03831d35Sstevel /*
162*03831d35Sstevel  *	Request (from Solaris to SC):
163*03831d35Sstevel  *		msg_len = SEGMENT_HDL_SIZE
164*03831d35Sstevel  *  		msg_buf = pointer to unpadded segment_hdl_t
165*03831d35Sstevel  *  	Response (from SC to Solaris):
166*03831d35Sstevel  *		msg_len = FRU_CNT_SIZE
167*03831d35Sstevel  *  		msg_buf = pointer to unpadded fru_cnt_t
168*03831d35Sstevel  *  		msg_status = return value, see below.
169*03831d35Sstevel  *  Error Notes:
170*03831d35Sstevel  */
171*03831d35Sstevel #define	SGFRU_MBOX_GETNUMPACKETS		0x7009
172*03831d35Sstevel /*
173*03831d35Sstevel  *	Request (from Solaris to SC):
174*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE
175*03831d35Sstevel  *  		msg_buf = pointer to unpadded fru_info_t, containing:
176*03831d35Sstevel  *		    unpadded segment_hdl_t plus max fru_cnt_t in bytes
177*03831d35Sstevel  *  	Response (from SC to Solaris):
178*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE + (PACKET_SIZE * max fru_cnt_t)
179*03831d35Sstevel  *              msg_buf = caddr_t of msg_len, contains:
180*03831d35Sstevel  *		    unpadded parent segment_hdl_t and actual fru_cnt_t
181*03831d35Sstevel  *		    unpadded packet_t array
182*03831d35Sstevel  *  		msg_status = return value, see below.
183*03831d35Sstevel  *  Error Notes:
184*03831d35Sstevel  *  Please return SG_MBOX_STATUS_NO_MEMORY if the buffer is not big enough.
185*03831d35Sstevel  */
186*03831d35Sstevel #define	SGFRU_MBOX_GETPACKETS			0x700a
187*03831d35Sstevel /*
188*03831d35Sstevel  *	Request (from Solaris to SC):
189*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE + PACKET_SIZE + fru_cnt_t size
190*03831d35Sstevel  *  		msg_buf = caddr_t of msg_len, contains:
191*03831d35Sstevel  *		    unpadded fru_info_t with parent segment_hdl_t and fru_cnt_t
192*03831d35Sstevel  *		    unpadded packet_t
193*03831d35Sstevel  *		    unpadded data of size fru_cnt_t (in bytes)
194*03831d35Sstevel  *  	Response (from SC to Solaris):
195*03831d35Sstevel  *  		msg_len = SEGMENT_HDL_SIZE + PACKET_HDL_SIZE
196*03831d35Sstevel  *              msg_buf = pointer to:
197*03831d35Sstevel  *		    packet_hdl_t of newly created packet
198*03831d35Sstevel  *		    updated parent segment_hdl_t
199*03831d35Sstevel  *  		msg_status = return value, see below.
200*03831d35Sstevel  *  Error Notes:
201*03831d35Sstevel  *  Please return SG_MBOX_STATUS_NO_SEPROM_SPACE if the seprom is out of space
202*03831d35Sstevel  */
203*03831d35Sstevel #define	SGFRU_MBOX_APPENDPACKET			0x700b
204*03831d35Sstevel /*
205*03831d35Sstevel  *	Request (from Solaris to SC):
206*03831d35Sstevel  *		msg_len = PACKET_HDL_SIZE
207*03831d35Sstevel  *  		msg_buf = pointer to packet_hdl_t of packet to be deleted
208*03831d35Sstevel  *  	Response (from SC to Solaris):
209*03831d35Sstevel  *		msg_len = SEGMENT_HDL_SIZE
210*03831d35Sstevel  *  		msg_buf = pointer to updated segment_hdl_t of deleted packet
211*03831d35Sstevel  *  		msg_status = return value, see below
212*03831d35Sstevel  *  Error Notes:
213*03831d35Sstevel  */
214*03831d35Sstevel #define	SGFRU_MBOX_DELETEPACKET			0x700c
215*03831d35Sstevel /*
216*03831d35Sstevel  *	Request (from Solaris to SC):
217*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE
218*03831d35Sstevel  *              msg_buf = caddr_t of msg_len, contains:
219*03831d35Sstevel  *		    unpadded fru_info_t with packet_hdl_t and max fru_cnt_t
220*03831d35Sstevel  *  	Response (from SC to Solaris):
221*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE + max fru_cnt_t
222*03831d35Sstevel  *              msg_buf = caddr_t of msg_len, contains:
223*03831d35Sstevel  *		    unpadded fru_info_t with packet_hdl_t and actual fru_cnt_t
224*03831d35Sstevel  *		    unpadded data of size fru_cnt_t (in bytes)
225*03831d35Sstevel  *  		msg_status = return value, see below.
226*03831d35Sstevel  *  Error Notes:
227*03831d35Sstevel  *  Please return SG_MBOX_STATUS_NO_MEMORY if the buffer is not big enough.
228*03831d35Sstevel  */
229*03831d35Sstevel #define	SGFRU_MBOX_GETPAYLOAD			0x700d
230*03831d35Sstevel /*
231*03831d35Sstevel  *	Request (from Solaris to SC):
232*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE + fru_cnt_t size
233*03831d35Sstevel  *              msg_buf = caddr_t of msg_len, contains:
234*03831d35Sstevel  *		    unpadded fru_info_t with packet_hdl_t and actual count
235*03831d35Sstevel  *		    unpadded payload data buf of fru_cnt_t size (in bytes)
236*03831d35Sstevel  *  	Response (from SC to Solaris):
237*03831d35Sstevel  *		msg_len = FRU_INFO_SIZE
238*03831d35Sstevel  *  		msg_buf = caddr_t of msg_len, contains:
239*03831d35Sstevel  *		    unpadded fru_hdl_t with updated handle
240*03831d35Sstevel  *		    unpadded data of size fru_cnt_t (in bytes)
241*03831d35Sstevel  *  		msg_status = return value, see below.
242*03831d35Sstevel  *  Error Notes:
243*03831d35Sstevel  *  Please return SG_MBOX_STATUS_NO_SEPROM_SPACE if the seprom is out of space
244*03831d35Sstevel  */
245*03831d35Sstevel #define	SGFRU_MBOX_UPDATEPAYLOAD		0x700e
246*03831d35Sstevel /*
247*03831d35Sstevel  *  FRU Mailbox Definitions
248*03831d35Sstevel  *
249*03831d35Sstevel  *      Request (from Solaris to SC):
250*03831d35Sstevel  *              msg_len = FRU_INFO_SIZE
251*03831d35Sstevel  *              msg_buf = pointer to unpadded fru_info_t containing:
252*03831d35Sstevel  *                  parent fru_hdl_t and max fru_cnt_t (in node_t's)
253*03831d35Sstevel  *      Response (from SC to Solaris):
254*03831d35Sstevel  *              msg_len = NODE_SIZE * max fru_cnt_t (in node_t's)
255*03831d35Sstevel  *              msg_buf = caddr_t of msg_len, contains:
256*03831d35Sstevel  *                  unpadded fru_hdl_t and actual fru_cnt_t
257*03831d35Sstevel  *                  unpadded node_t array
258*03831d35Sstevel  *              msg_status = return value, see below.
259*03831d35Sstevel  *  Error Notes:
260*03831d35Sstevel  */
261*03831d35Sstevel #define	SGFRU_MBOX_GETCHILDLIST			0x700f
262*03831d35Sstevel /*
263*03831d35Sstevel  *  FRU Mailbox Definitions
264*03831d35Sstevel  *
265*03831d35Sstevel  *      Request (from Solaris to SC):
266*03831d35Sstevel  *              msg_len = FRU_INFO_SIZE
267*03831d35Sstevel  *              msg_buf = pointer to unpadded fru_info_t containing:
268*03831d35Sstevel  *                  parent fru_hdl_t and max fru_cnt_t (in fru_hdl_t's)
269*03831d35Sstevel  *      Response (from SC to Solaris):
270*03831d35Sstevel  *              msg_len = FRU_HDL_SIZE * max fru_cnt_t (in fru_hdl_t's)
271*03831d35Sstevel  *              msg_buf = caddr_t of msg_len, contains:
272*03831d35Sstevel  *                  unpadded fru_hdl_t and actual fru_cnt_t
273*03831d35Sstevel  *                  unpadded fru_hdl_t array
274*03831d35Sstevel  *              msg_status = return value, see below.
275*03831d35Sstevel  *  Error Notes:
276*03831d35Sstevel  */
277*03831d35Sstevel #define	SGFRU_MBOX_GETCHILDHANDLES		0x7010
278