dds.h revision 678453a8ed49104d8adad58f3ba591bdc39883e8
678453a8ed49104d8adad58f3ba591bdc39883e8speer/*
678453a8ed49104d8adad58f3ba591bdc39883e8speer * CDDL HEADER START
678453a8ed49104d8adad58f3ba591bdc39883e8speer *
678453a8ed49104d8adad58f3ba591bdc39883e8speer * The contents of this file are subject to the terms of the
678453a8ed49104d8adad58f3ba591bdc39883e8speer * Common Development and Distribution License (the "License").
678453a8ed49104d8adad58f3ba591bdc39883e8speer * You may not use this file except in compliance with the License.
678453a8ed49104d8adad58f3ba591bdc39883e8speer *
678453a8ed49104d8adad58f3ba591bdc39883e8speer * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
678453a8ed49104d8adad58f3ba591bdc39883e8speer * or http://www.opensolaris.org/os/licensing.
678453a8ed49104d8adad58f3ba591bdc39883e8speer * See the License for the specific language governing permissions
678453a8ed49104d8adad58f3ba591bdc39883e8speer * and limitations under the License.
678453a8ed49104d8adad58f3ba591bdc39883e8speer *
678453a8ed49104d8adad58f3ba591bdc39883e8speer * When distributing Covered Code, include this CDDL HEADER in each
678453a8ed49104d8adad58f3ba591bdc39883e8speer * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
678453a8ed49104d8adad58f3ba591bdc39883e8speer * If applicable, add the following below this CDDL HEADER, with the
678453a8ed49104d8adad58f3ba591bdc39883e8speer * fields enclosed by brackets "[]" replaced with your own identifying
678453a8ed49104d8adad58f3ba591bdc39883e8speer * information: Portions Copyright [yyyy] [name of copyright owner]
678453a8ed49104d8adad58f3ba591bdc39883e8speer *
678453a8ed49104d8adad58f3ba591bdc39883e8speer * CDDL HEADER END
678453a8ed49104d8adad58f3ba591bdc39883e8speer */
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer/*
678453a8ed49104d8adad58f3ba591bdc39883e8speer * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
678453a8ed49104d8adad58f3ba591bdc39883e8speer * Use is subject to license terms.
678453a8ed49104d8adad58f3ba591bdc39883e8speer */
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer#ifndef _DDS_H
678453a8ed49104d8adad58f3ba591bdc39883e8speer#define _DDS_H
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer#pragma ident "%Z%%M% %I% %E% SMI"
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer#ifdef __cplusplus
678453a8ed49104d8adad58f3ba591bdc39883e8speerextern "C" {
678453a8ed49104d8adad58f3ba591bdc39883e8speer#endif
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer/*
678453a8ed49104d8adad58f3ba591bdc39883e8speer * DDS class values
678453a8ed49104d8adad58f3ba591bdc39883e8speer * DDS_GENERIC_XXX 0x0 - 0xf
678453a8ed49104d8adad58f3ba591bdc39883e8speer * DDS_VNET_XXX 0x10 - 0x1f
678453a8ed49104d8adad58f3ba591bdc39883e8speer * DDS_VDSK_XXX 0x20 - 0x2f
678453a8ed49104d8adad58f3ba591bdc39883e8speer * reserved 0x30 - 0xff
678453a8ed49104d8adad58f3ba591bdc39883e8speer */
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer#define DDS_VNET_NIU 0x10 /* NIU vNet class */
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer/*
678453a8ed49104d8adad58f3ba591bdc39883e8speer * Subclasses for DDS_VNET_NIU class
678453a8ed49104d8adad58f3ba591bdc39883e8speer */
678453a8ed49104d8adad58f3ba591bdc39883e8speer#define DDS_VNET_ADD_SHARE 0x01 /* Add a share */
678453a8ed49104d8adad58f3ba591bdc39883e8speer#define DDS_VNET_DEL_SHARE 0x02 /* Delete a share */
678453a8ed49104d8adad58f3ba591bdc39883e8speer#define DDS_VNET_REL_SHARE 0x03 /* Release a share */
678453a8ed49104d8adad58f3ba591bdc39883e8speer#define DDS_VNET_MOD_SHARE 0x04 /* Modify a share */
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer/*
678453a8ed49104d8adad58f3ba591bdc39883e8speer * The following structure is used for the following class/subclass messages.
678453a8ed49104d8adad58f3ba591bdc39883e8speer * DDS_VNET_NIU/DDS_VNET_ADD_SHARE
678453a8ed49104d8adad58f3ba591bdc39883e8speer * DDS_VNET_NIU/DDS_VNET_DEL_SHARE
678453a8ed49104d8adad58f3ba591bdc39883e8speer * DDS_VNET_NIU/DDS_VNET_REL_SHARE
678453a8ed49104d8adad58f3ba591bdc39883e8speer */
678453a8ed49104d8adad58f3ba591bdc39883e8speertypedef struct dds_share_msg {
678453a8ed49104d8adad58f3ba591bdc39883e8speer /*
678453a8ed49104d8adad58f3ba591bdc39883e8speer * MAC-address to which this resource belongs to.
678453a8ed49104d8adad58f3ba591bdc39883e8speer * It is stored in the following fashion:
678453a8ed49104d8adad58f3ba591bdc39883e8speer * Bytes: 7 6 5 4 3 2 1 0
678453a8ed49104d8adad58f3ba591bdc39883e8speer * X X M0 M1 M2 M3 M4 M5
678453a8ed49104d8adad58f3ba591bdc39883e8speer */
678453a8ed49104d8adad58f3ba591bdc39883e8speer uint64_t macaddr;
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer /*
678453a8ed49104d8adad58f3ba591bdc39883e8speer * A 64 bit cookie. It consists two pars:
678453a8ed49104d8adad58f3ba591bdc39883e8speer * Low 32bits == HV cookie
678453a8ed49104d8adad58f3ba591bdc39883e8speer * High 32bits == config_hdl of NIU
678453a8ed49104d8adad58f3ba591bdc39883e8speer */
678453a8ed49104d8adad58f3ba591bdc39883e8speer uint64_t cookie;
678453a8ed49104d8adad58f3ba591bdc39883e8speer} dds_share_msg_t;
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer/*
678453a8ed49104d8adad58f3ba591bdc39883e8speer * The following structure is used as a response for all DDS_VNET_NIU
678453a8ed49104d8adad58f3ba591bdc39883e8speer * messages.
678453a8ed49104d8adad58f3ba591bdc39883e8speer */
678453a8ed49104d8adad58f3ba591bdc39883e8speertypedef struct dds_share_resp_msg {
678453a8ed49104d8adad58f3ba591bdc39883e8speer /*
678453a8ed49104d8adad58f3ba591bdc39883e8speer * When the response is NACK, resp_val can be used optionally
678453a8ed49104d8adad58f3ba591bdc39883e8speer * to provide additional information regarding failure.
678453a8ed49104d8adad58f3ba591bdc39883e8speer */
678453a8ed49104d8adad58f3ba591bdc39883e8speer uint64_t status;
678453a8ed49104d8adad58f3ba591bdc39883e8speer} dds_share_resp_msg_t;
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer/*
678453a8ed49104d8adad58f3ba591bdc39883e8speer * status values
678453a8ed49104d8adad58f3ba591bdc39883e8speer */
678453a8ed49104d8adad58f3ba591bdc39883e8speer#define DDS_VNET_SUCCESS 0x0 /* Operation success */
678453a8ed49104d8adad58f3ba591bdc39883e8speer#define DDS_VNET_FAIL 0x1 /* Operation failed */
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer/*
678453a8ed49104d8adad58f3ba591bdc39883e8speer * The following structure is used for the following class/subclass messages.
678453a8ed49104d8adad58f3ba591bdc39883e8speer * DDS_VNET_NIU/DDS_VNET_MODIFY_SHARE
678453a8ed49104d8adad58f3ba591bdc39883e8speer */
678453a8ed49104d8adad58f3ba591bdc39883e8speertypedef struct dds_share_modify_msg {
678453a8ed49104d8adad58f3ba591bdc39883e8speer uint64_t macaddr;
678453a8ed49104d8adad58f3ba591bdc39883e8speer uint64_t cookie;
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer /*
678453a8ed49104d8adad58f3ba591bdc39883e8speer * rx_res_map -- Intended modification to RX resources
678453a8ed49104d8adad58f3ba591bdc39883e8speer * indicated as a map.
678453a8ed49104d8adad58f3ba591bdc39883e8speer * tx_res_map -- Intended modification to TX resources
678453a8ed49104d8adad58f3ba591bdc39883e8speer * indicated as a map.
678453a8ed49104d8adad58f3ba591bdc39883e8speer */
678453a8ed49104d8adad58f3ba591bdc39883e8speer uint64_t rx_res_map;
678453a8ed49104d8adad58f3ba591bdc39883e8speer uint64_t tx_res_map;
678453a8ed49104d8adad58f3ba591bdc39883e8speer} dds_share_modify_msg_t;
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer/*
678453a8ed49104d8adad58f3ba591bdc39883e8speer * VIO DDS Info message.
678453a8ed49104d8adad58f3ba591bdc39883e8speer *
678453a8ed49104d8adad58f3ba591bdc39883e8speer * tag.msgtype == VIO_TYPE_CTRL
678453a8ed49104d8adad58f3ba591bdc39883e8speer * tag.submsgtype = VIO_SUBTYPE_{INFO|ACK|NACK}
678453a8ed49104d8adad58f3ba591bdc39883e8speer * tag.subtype_env == VIO_DDS_INFO
678453a8ed49104d8adad58f3ba591bdc39883e8speer */
678453a8ed49104d8adad58f3ba591bdc39883e8speertypedef struct vio_dds_msg {
678453a8ed49104d8adad58f3ba591bdc39883e8speer /* Common tag */
678453a8ed49104d8adad58f3ba591bdc39883e8speer vio_msg_tag_t tag;
678453a8ed49104d8adad58f3ba591bdc39883e8speer uint8_t dds_class;
678453a8ed49104d8adad58f3ba591bdc39883e8speer uint8_t dds_subclass;
678453a8ed49104d8adad58f3ba591bdc39883e8speer uint16_t resv;
678453a8ed49104d8adad58f3ba591bdc39883e8speer uint32_t dds_req_id;
678453a8ed49104d8adad58f3ba591bdc39883e8speer union {
678453a8ed49104d8adad58f3ba591bdc39883e8speer struct dds_share_msg share_msg;
678453a8ed49104d8adad58f3ba591bdc39883e8speer struct dds_share_resp_msg share_resp_msg;
678453a8ed49104d8adad58f3ba591bdc39883e8speer struct dds_share_modify_msg share_mod_msg;
678453a8ed49104d8adad58f3ba591bdc39883e8speer uint64_t pad2[5];
678453a8ed49104d8adad58f3ba591bdc39883e8speer } msg;
678453a8ed49104d8adad58f3ba591bdc39883e8speer} vio_dds_msg_t;
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer#ifdef __cplusplus
678453a8ed49104d8adad58f3ba591bdc39883e8speer}
678453a8ed49104d8adad58f3ba591bdc39883e8speer#endif
678453a8ed49104d8adad58f3ba591bdc39883e8speer
678453a8ed49104d8adad58f3ba591bdc39883e8speer#endif /* _DDS_H */