/*
* 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 _VNET_COMMON_H
#define _VNET_COMMON_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/vio_common.h>
#include <sys/vio_mailbox.h>
#include <sys/ethernet.h>
/*
* This header file contains definitions common to LDoms Virtual Network
* server (vsw) and client (vnet).
*/
/* max # of cookies per frame size in TxDring mode */
/*
* Max # of data area cookies that we support in RxDringData mode. This is
* pre-defined to avoid allocating and importing a large # of cookies for the
* data area. We know that the export map table on the exporting end point is
* per LDC. We also know that a single cookie can be obtained if we manage
* to get consecutive entries in the export map table. We use this knowledge to
* limit the # of cookies to a pre-defined maximum value.
*/
/*
* Size of dring reg msg in RxDringData mode, given # of data area cookies.
* This assumes that the # of dring cookies in vio_dring_reg_msg_t is 1.
* The given # of data area cookies is reduced by 1, as vio_dring_reg_msg_ext_t
* itself contains 1 data cookie.
*/
(sizeof (vio_dring_reg_msg_t) + sizeof (vio_dring_reg_ext_msg_t) + \
/* Max supported size of dring reg msg in RxDringData mode */
#define VNET_DRING_REG_EXT_MSG_SIZE_MAX \
/* initial send sequence number */
/*
* Maximum MTU value currently supported. MAX_COOKIES for data has been defined
* already based on ETHERMAX. Hence we limit the MTU to be within 2 8K pages
* and take some additional steps (see related code in .c files) to ensure that
* ldc cookies for each data buffer is within the MAX_COOKIES. This allows us
* to support Jumbo MTUs without changing the size of the descriptor.
*/
/*
* Max frame size to data block size in RxDringData mode
*/
/* vnet descriptor */
typedef struct vnet_public_desc {
/*
* Vnet in-band descriptor. Used by those vnet clients
* such as OBP who do not use descriptor rings.
*/
typedef struct vnet_ibnd_desc {
/* payload */
/*
* Descriptor format in RxDringData mode.
*/
typedef struct vnet_rxdring_data_desc {
/* exported functions */
#ifdef __cplusplus
}
#endif
#endif /* _VNET_COMMON_H */