/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SGFRU_MBOX_H
#define _SGFRU_MBOX_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/sgfru_priv.h>
#include <sys/ddi_impldefs.h>
/*
* Max time sgfru waits for mailbox to respond before
* it decides to timeout. (measured in seconds)
*/
/*
* FRU Mailbox Definitions
*
* Request (from Solaris to SC):
* msg_len = CONTAINER_HDL_SIZE
* msg_buf = pointer to unpadded container_hdl_t
* Response (from SC to Solaris):
* msg_len = FRU_CNT_SIZE
* msg_buf = pointer to unpadded fru_cnt_t
* msg_status = return value, see below.
* Error Notes:
*/
/*
* Request (from Solaris to SC):
* msg_len = FRU_INFO_SIZE
* msg_buf = pointer to unpadded fru_info_t containing:
* parent container_hdl_t and max fru_cnt_t (in #sections)
* Response (from SC to Solaris):
* msg_len = FRU_INFO_SIZE + (SECTION_SIZE * max fru_cnt_t)
* msg_buf = caddr_t of msg_len, contains:
* unpadded container_hdl_t and actual fru_cnt_t
* unpadded section_t array
* msg_status = return value, see below.
* Error Notes:
* Please return SG_MBOX_STATUS_NO_MEMORY if the buffer is not big enough.
*/
/*
* Request (from Solaris to SC):
* msg_len = SECTION_HDL_SIZE
* msg_buf = pointer to unpadded section_hdl_t
* Response (from SC to Solaris):
* msg_len = FRU_CNT_SIZE
* msg_buf = pointer to unpadded fru_cnt_t
* msg_status = return value, see below.
* Error Notes:
*/
/*
* FRU Mailbox definitions
*
* Request (from Solaris to SC):
* msg_len = FRU_INFO_SIZE
* msg_buf = pointer to unpadded fru_info_t containing:
* parent section_hdl_t and max fru_cnt_t (in #segments)
* Response (from SC to Solaris):
* msg_len = FRU_INFO_SIZE + (SEGMENT_SIZE * max fru_cnt_t)
* msg_buf = caddr_t of msg_len, contains:
* unpadded parent section_hdl_t and actual fru_cnt_t
* unpadded segment_t array
* msg_status = return value, see below.
* Error Notes:
* Please return SG_MBOX_STATUS_NO_MEMORY if the buffer is not big enough.
*/
/*
* Request (from Solaris to SC):
* msg_len = SECTION_HDL_SIZE + SEGMENT_SIZE
* msg_buf = caddr_t of msg_len, contains:
* unpadded parent section_hdl_t
* unpadded segment_t
* Response (from SC to Solaris):
* msg_len = SEGMENT_HDL_SIZE
* msg_buf = pointer to:
* segment_hdl_t of newly created segment
* updated parent section_hdl_t
* msg_status = return value, see below.
* Error Notes:
* Please return SG_MBOX_STATUS_STALE_OBJECT if the section_hdl_t is stale.
* Please return SG_MBOX_STATUS_NO_SEPROM_SPACE if the seprom is out of space
*/
/*
* Request (from Solaris to SC):
* msg_len = SEGMENT_HDL_SIZE
* msg_buf = pointer to segment_hdl_t of segment to be deleted
* Response (from SC to Solaris):
* msg_len = SECTION_HDL_SIZE
* msg_buf = pointer to updated section_hdl_t of deleted segment
* msg_status = return value, see below
* Error Notes:
*/
/*
* Request (from Solaris to SC):
* msg_len = FRU_INFO_SIZE
* msg_buf = caddr_t of msg_len, contains:
* unpadded fru_info_t: segment_hdl_t and max count in bytes
* Response (from SC to Solaris):
* msg_len = FRU_INFO_SIZE
* msg_buf = caddr_t of msg_len, contains:
* unpadded fru_info_t: segment_hdl_t and actual count in bytes
* unpadded data of actual fru_cnt_t bytes
* msg_status = return value, see below.
* Error Notes:
* Please return SG_MBOX_STATUS_NO_MEMORY if the buffer is not big enough.
*/
/*
* Request (from Solaris to SC):
* msg_len = FRU_INFO_SIZE + fru_cnt_t bytes
* msg_buf = caddr_t of msg_len, contains:
* unpadded fru_info_t: segment_hdl_t and count in bytes
* unpadded data of fru_cnt_t bytes
* Response (from SC to Solaris):
* msg_len = FRU_INFO_SIZE
* msg_buf = caddr_t of msg_len, contains:
* unpadded fru_info_t: segment_hdl_t and count in bytes
* msg_status = return value, see below.
* Error Notes:
* Please return SG_MBOX_STATUS_ILLEGAL_PARAMETER if it's
* not an opaque segment.
*/
/*
* Request (from Solaris to SC):
* msg_len = SEGMENT_HDL_SIZE
* msg_buf = pointer to unpadded segment_hdl_t
* Response (from SC to Solaris):
* msg_len = FRU_CNT_SIZE
* msg_buf = pointer to unpadded fru_cnt_t
* msg_status = return value, see below.
* Error Notes:
*/
/*
* Request (from Solaris to SC):
* msg_len = FRU_INFO_SIZE
* msg_buf = pointer to unpadded fru_info_t, containing:
* unpadded segment_hdl_t plus max fru_cnt_t in bytes
* Response (from SC to Solaris):
* msg_len = FRU_INFO_SIZE + (PACKET_SIZE * max fru_cnt_t)
* msg_buf = caddr_t of msg_len, contains:
* unpadded parent segment_hdl_t and actual fru_cnt_t
* unpadded packet_t array
* msg_status = return value, see below.
* Error Notes:
* Please return SG_MBOX_STATUS_NO_MEMORY if the buffer is not big enough.
*/
/*
* Request (from Solaris to SC):
* msg_len = FRU_INFO_SIZE + PACKET_SIZE + fru_cnt_t size
* msg_buf = caddr_t of msg_len, contains:
* unpadded fru_info_t with parent segment_hdl_t and fru_cnt_t
* unpadded packet_t
* unpadded data of size fru_cnt_t (in bytes)
* Response (from SC to Solaris):
* msg_len = SEGMENT_HDL_SIZE + PACKET_HDL_SIZE
* msg_buf = pointer to:
* packet_hdl_t of newly created packet
* updated parent segment_hdl_t
* msg_status = return value, see below.
* Error Notes:
* Please return SG_MBOX_STATUS_NO_SEPROM_SPACE if the seprom is out of space
*/
/*
* Request (from Solaris to SC):
* msg_len = PACKET_HDL_SIZE
* msg_buf = pointer to packet_hdl_t of packet to be deleted
* Response (from SC to Solaris):
* msg_len = SEGMENT_HDL_SIZE
* msg_buf = pointer to updated segment_hdl_t of deleted packet
* msg_status = return value, see below
* Error Notes:
*/
/*
* Request (from Solaris to SC):
* msg_len = FRU_INFO_SIZE
* msg_buf = caddr_t of msg_len, contains:
* unpadded fru_info_t with packet_hdl_t and max fru_cnt_t
* Response (from SC to Solaris):
* msg_len = FRU_INFO_SIZE + max fru_cnt_t
* msg_buf = caddr_t of msg_len, contains:
* unpadded fru_info_t with packet_hdl_t and actual fru_cnt_t
* unpadded data of size fru_cnt_t (in bytes)
* msg_status = return value, see below.
* Error Notes:
* Please return SG_MBOX_STATUS_NO_MEMORY if the buffer is not big enough.
*/
/*
* Request (from Solaris to SC):
* msg_len = FRU_INFO_SIZE + fru_cnt_t size
* msg_buf = caddr_t of msg_len, contains:
* unpadded fru_info_t with packet_hdl_t and actual count
* unpadded payload data buf of fru_cnt_t size (in bytes)
* Response (from SC to Solaris):
* msg_len = FRU_INFO_SIZE
* msg_buf = caddr_t of msg_len, contains:
* unpadded fru_hdl_t with updated handle
* unpadded data of size fru_cnt_t (in bytes)
* msg_status = return value, see below.
* Error Notes:
* Please return SG_MBOX_STATUS_NO_SEPROM_SPACE if the seprom is out of space
*/
/*
* FRU Mailbox Definitions
*
* Request (from Solaris to SC):
* msg_len = FRU_INFO_SIZE
* msg_buf = pointer to unpadded fru_info_t containing:
* parent fru_hdl_t and max fru_cnt_t (in node_t's)
* Response (from SC to Solaris):
* msg_len = NODE_SIZE * max fru_cnt_t (in node_t's)
* msg_buf = caddr_t of msg_len, contains:
* unpadded fru_hdl_t and actual fru_cnt_t
* unpadded node_t array
* msg_status = return value, see below.
* Error Notes:
*/
/*
* FRU Mailbox Definitions
*
* Request (from Solaris to SC):
* msg_len = FRU_INFO_SIZE
* msg_buf = pointer to unpadded fru_info_t containing:
* parent fru_hdl_t and max fru_cnt_t (in fru_hdl_t's)
* Response (from SC to Solaris):
* msg_len = FRU_HDL_SIZE * max fru_cnt_t (in fru_hdl_t's)
* msg_buf = caddr_t of msg_len, contains:
* unpadded fru_hdl_t and actual fru_cnt_t
* unpadded fru_hdl_t array
* msg_status = return value, see below.
* Error Notes:
*/
/*
* Request (from Solaris to SC):
* msg_len = FRU_INFO_SIZE
* msg_buf = pointer to unpadded fru_hdl_t
* Response (from SC to Solaris):
* msg_len = NODE_SIZE
* msg_buf = caddr_t of msg_len, contains:
* unpadded node_t
* msg_status = return value, see below.
* Error Notes:
*/
/*
* The defines below are used for translating padded (C) to non-padded (Java),
* and must directly correspond to the structures defined in fru_data_access.h
* and sgfru.h.
*/
fru_info_t *fru);
#ifdef __cplusplus
}
#endif
#endif /* _SGFRU_MBOX_H */