vnet_gen.h revision 1ae0874509b6811fdde1dfd46f0d93fd09867a3f
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _VNET_GEN_H
#define _VNET_GEN_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#define VGEN_SUCCESS (0) /* successful return */
/* vgen_t flags */
#define VGEN_STOPPED 0x0
#define VGEN_STARTED 0x1
/* channel flags */
#define CHANNEL_ATTACHED 0x1
#define CHANNEL_STARTED 0x2
/* transmit return values */
#define VGEN_TX_SUCCESS 0 /* transmit success */
/* private descriptor flags */
/* get the address of next tbuf */
/* increment recv index */
/* decrement recv index */
/* increment tx index */
/* decrement tx index */
/* bounds check rx index */
/* bounds check tx index */
/* private descriptor */
typedef struct vgen_priv_desc {
/*
* Handshake parameters (per vio_mailbox.h) of each ldc end point, used
* during handshake negotiation.
*/
typedef struct vgen_handshake_params {
/* version specific params */
/* attributes specific params */
/* descriptor ring params */
/* version info */
typedef struct vgen_ver {
ver_minor:16;
} vgen_ver_t;
typedef struct vgen_stats {
#if 0
#endif
/* MIB II variables */
/* Tx Statistics */
/* Rx Statistics */
/* Callback statistics */
} vgen_stats_t;
typedef struct vgen_kstats {
/*
*/
#if 0
#endif
/*
* required by kstat for MIB II objects(RFC 1213)
*/
/* Tx Statistics */
/* Rx Statistics */
/* Callback statistics */
/* Channel information associated with a vgen-port */
typedef struct vgen_ldc {
/*
* Locks:
* locking hierarchy when more than one lock is held concurrently:
* cblock > txlock > tclock.
*/
/* channel info from ldc layer */
/* handshake info */
int hphase; /* handshake phase */
int hstate; /* handshake state bits */
/* transmit and receive descriptor ring info */
/* misc */
/* channel statistics */
} vgen_ldc_t;
/* Channel list structure */
typedef struct vgen_ldclist_s {
int num_ldcs; /* number of channels in the list */
/* port information structure */
typedef struct vgen_port {
int port_num; /* port number */
} vgen_port_t;
/* port list structure */
typedef struct vgen_portlist {
/* vgen instance information */
typedef struct vgen {
void *vnetp; /* associated vnet instance */
void *vnetmacp; /* mac_t of vnet */
int flags; /* flags */
} vgen_t;
#ifdef __cplusplus
}
#endif
#endif /* _VNET_GEN_H */