vnet_gen.h revision bbfa0259e68b6b625e9e085053d41d620f185eee
/*
* 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 2008 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
#include <sys/vgen_stats.h>
#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 */
/* receive thread 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 {
} vgen_ver_t;
/*
* vnet-protocol-version dependent function prototypes.
*/
typedef int (*vgen_ldctx_t) (void *, mblk_t *);
typedef void (*vgen_ldcrx_pktdata_t) (void *, void *, uint32_t);
/* Channel information associated with a vgen-port */
typedef struct vgen_ldc {
/*
* Locks:
* locking hierarchy when more than one lock is held concurrently:
* cblock > rxlock > 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 */
/* receive thread field */
/* channel statistics */
} vgen_ldc_t;
/* Channel list structure */
typedef struct vgen_ldclist_s {
/* port information structure */
typedef struct vgen_port {
int port_num; /* port number */
int num_ldcs; /* # of channels in this port */
} vgen_port_t;
/* port list structure */
typedef struct vgen_portlist {
/* vgen instance information */
typedef struct vgen {
int instance; /* vnet instance */
int flags; /* flags */
} vgen_t;
#ifdef __cplusplus
}
#endif
#endif /* _VNET_GEN_H */