/*
* 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
*/
/*
*/
#ifndef _SYS_VIO_MAILBOX_H
#define _SYS_VIO_MAILBOX_H
#ifdef __cplusplus
extern "C" {
#endif
/* Message types */
/* Message sub-types */
/*
* VIO specific control envelopes: 0x0000 - 0x00FF
* VNET specific control envelopes: 0x0100 - 0x01FF
* VDSK specific control envelopes: 0x0200 - 0x02FF
* UNUSED envelopes: 0x0300 - 0x0FFF
*/
/*
* Generic Control Subtype Envelopes:
* type == VIO_TYPE_CTRL
* subtype == VIO_SUBTYPE_{INFO|ACK|NACK}
*
* 0x0000 - 0x003F
*/
/*
* Generic subtype Data envelopes
* type == VIO_TYPE_DATA
* subtype == VIO_SUBTYPE_{INFO|ACK|NACK}
*
* 0x0040 - 0x007F
*/
/*
* Generic subtype Error envelopes
* type == VIO_TYPE_ERR
* subtype == VIO_SUBTYPE_{INFO|ACK|NACK}
*
* 0x0080 - 0x00FF
*
* Currently unused
*/
/*
* Supported Device Types
*/
/*
* VIO data transfer mode
*/
/*
* VIO Descriptor Ring registration options
* (intended use for Descriptor Ring)
*/
/*
* Size of message payload
*/
/*
* Peer dring processing state. Either actively processing dring
* or stopped.
*/
/*
* VIO device message tag.
*
* These 64 bits are used as a common header for all VIO message types.
*/
typedef union vio_msg_tag {
struct {
} _hdr;
/*
* VIO version negotation message.
*
* tag.msgtype == VIO_TYPE_CTRL
* tag.submsgtype = VIO_SUBTYPE_{INFO|ACK|NACK}
* tag.subtype_env == VIO_VER_INFO
*/
/* Structure to store a version tuple */
typedef struct vio_ver {
} vio_ver_t;
typedef struct vio_ver_msg {
/* Common tag */
/* version specific payload */
/* padding */
/*
* VIO Descriptor Ring Register message.
*
* tag.msgtype == VIO_TYPE_CTRL
* tag.submsgtype = VIO_SUBTYPE_{INFO|ACK|NACK}
* tag.subtype_env == VIO_DRING_REG
*/
typedef struct vio_dring_reg_msg {
/* Common tag */
/* Descriptor ring information */
/*
* The rest of the structure is variable in size. The first member that
* follows is the descriptor ring cookie(s), that is used in all dring
* modes. Following that are the members that are needed only in
* RxDringData mode. If the dring mode is not RxDringData and the # of
* dring cookies is 1, the message can be sent by LDC without
* fragmentation. As dring cookie array is variable in size depending
* on ncookies, the subsequent members are defined in a separate
* structure vio_dring_reg_msg_ext_t as shown below.
*/
/*
* VIO Descriptor Ring Register Extended message; used in RxDringData mode.
*/
typedef struct vio_dring_reg_extended_msg {
/*
* The data_cookie[] array is variable in size based on data_ncookies.
*/
/*
* VIO Descriptor Ring Unregister message.
*
* tag.msgtype == VIO_TYPE_CTRL
* tag.submsgtype = VIO_SUBTYPE_{INFO|ACK|NACK}
* tag.subtype_env == VIO_DRING_UNREG
*/
typedef struct vio_dring_unreg_msg {
/* Common tag */
/* Descriptor ring information */
/*
* Definition of a generic VIO message (with no payload) which can be cast
* to other message types.
*/
typedef struct vio_msg {
/* Common tag */
/* no payload */
} vio_msg_t;
/*
* VIO Ready to Receive message.
*
* tag.msgtype == VIO_TYPE_CTRL
* tag.submsgtype = VIO_SUBTYPE_{INFO|ACK}
* tag.subtype_env == VIO_RDX
*/
/*
* VIO error message.
*
* tag.msgtype == VIO_TYPE_ERR
* tag.subtype == VIO_SUBTYPE_{INFO|ACK|NACK}
* tag.subtype_env == TBD
*/
/*
* VIO descriptor ring data message.
*
* tag.msgtype == VIO_TYPE_DATA
* tag.subtype == VIO_SUBTYPE_{INFO|ACK|NACK}
* tag.subtype_env == VIO_DRING_DATA
*/
typedef struct vio_dring_msg {
/* Common message tag */
/* Data dring info */
/*
* Padding.
*/
/*
* VIO Common header for inband descriptor messages.
*
* Clients will then combine this header with a device specific payload.
*/
typedef struct vio_inband_desc_msg_hdr {
/* Common message tag */
/*
* VIO raw data message.
*
* tag.msgtype == VIO_TYPE_DATA
* tag.subtype == VIO_SUBTYPE_{INFO|ACK|NACK}
* tag.subtype_env == VIO_PKT_DATA
*
* Note the data payload is so small to keep this message
* within the size LDC can cope with without fragmentation.
* If it turns out in the future that we are not concerned
* with fragmentation then we can increase the size of this
* field.
*/
typedef struct vio_raw_data_msg {
/* Common message tag */
/* Raw data packet payload */
#define VIO_PKT_DATA_HDRSIZE \
(sizeof (vio_msg_tag_t) + sizeof (uint64_t))
/*
* Definitions of the valid states a Descriptor can be in.
*/
/* Macro to populate the generic fields of the DRing data msg */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_VIO_MAILBOX_H */