/*
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _VNET_H
#define _VNET_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/vnet_res.h>
#include <sys/vnet_mailbox.h>
#include <sys/mac_client.h>
/*
* Flags used to indicate the state of the vnet device and its associated
* resources.
*/
typedef enum vnet_flags {
} vnet_flags_t;
typedef struct vnet_hio_stats {
/* MIB II variables */
typedef struct vnet_hio_kstats {
/* required by kstat for MIB II objects(RFC 1213) */
typedef struct vnet_tx_ring_stats {
/*
* A vnet resource structure.
*/
typedef struct vnet_res {
} vnet_res_t;
/* An instance specific DDS structure */
typedef struct vnet_dds_info {
/* rwlock macros */
typedef enum {
/*
* # of Pseudo TX Rings is defined based on the possible
* # of TX Hardware Rings from a Hybrid resource.
*/
/*
* # of Pseudo RX Rings that are reserved and exposed by default.
* 1 for LDC resource to vsw + 2 for RX rings of Hybrid resource.
*/
/* Pseudo RX Ring States */
typedef enum {
/* Pseudo TX Ring States */
typedef enum {
/*
* Psuedo TX Ring
*/
typedef struct vnet_pseudo_tx_ring {
/* ring handle. Hybrid res: ring hdl */
/* of hardware rx ring; LDC res: hdl */
/* to the res itself (vnet_res_t) */
/*
* Psuedo RX Ring
*/
typedef struct vnet_pseudo_rx_ring {
/* ring handle. Hybrid res: ring hdl */
/* of hardware tx ring; otherwise */
/* NULL */
/*
* Psuedo TX Ring Group
*/
typedef struct vnet_pseudo_tx_group {
/*
* Psuedo RX Ring Group
*/
typedef struct vnet_pseudo_rx_group {
/*
* vnet instance state information
*/
typedef struct vnet {
/* pseudo ring groups */
} vnet_t;
#ifdef DEBUG
/*
* debug levels:
* DBG_LEVEL2: Info messages
* DBG_LEVEL3: Warning messages
* DBG_LEVEL4: Error messages
*/
#define DBG1(...) do { \
if ((vnet_dbglevel & DBG_LEVEL1) != 0) { \
} \
#define DBG2(...) do { \
if ((vnet_dbglevel & DBG_LEVEL2) != 0) { \
} \
#define DWARN(...) do { \
if ((vnet_dbglevel & DBG_WARN) != 0) { \
} \
#define DERR(...) do { \
if ((vnet_dbglevel & DBG_ERR) != 0) { \
} \
#else
#define DBG1(...) if (0) do { } while (0)
#define DBG2(...) if (0) do { } while (0)
#define DWARN(...) if (0) do { } while (0)
#define DERR(...) if (0) do { } while (0)
#endif
#ifdef VNET_IOC_DEBUG /* Debug ioctls */
#endif
#ifdef __cplusplus
}
#endif
#endif /* _VNET_H */