11991Sheppo /* 21991Sheppo * CDDL HEADER START 31991Sheppo * 41991Sheppo * The contents of this file are subject to the terms of the 51991Sheppo * Common Development and Distribution License (the "License"). 61991Sheppo * You may not use this file except in compliance with the License. 71991Sheppo * 81991Sheppo * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 91991Sheppo * or http://www.opensolaris.org/os/licensing. 101991Sheppo * See the License for the specific language governing permissions 111991Sheppo * and limitations under the License. 121991Sheppo * 131991Sheppo * When distributing Covered Code, include this CDDL HEADER in each 141991Sheppo * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 151991Sheppo * If applicable, add the following below this CDDL HEADER, with the 161991Sheppo * fields enclosed by brackets "[]" replaced with your own identifying 171991Sheppo * information: Portions Copyright [yyyy] [name of copyright owner] 181991Sheppo * 191991Sheppo * CDDL HEADER END 201991Sheppo */ 211991Sheppo 221991Sheppo /* 231991Sheppo * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 241991Sheppo * Use is subject to license terms. 251991Sheppo */ 261991Sheppo 271991Sheppo #ifndef _VNET_COMMON_H 281991Sheppo #define _VNET_COMMON_H 291991Sheppo 301991Sheppo #pragma ident "%Z%%M% %I% %E% SMI" 311991Sheppo 321991Sheppo #ifdef __cplusplus 331991Sheppo extern "C" { 341991Sheppo #endif 351991Sheppo 361991Sheppo #include <sys/vio_common.h> 371991Sheppo #include <sys/vio_mailbox.h> 381991Sheppo #include <sys/ethernet.h> 391991Sheppo 401991Sheppo /* 411991Sheppo * This header file contains definitions common to LDoms Virtual Network 421991Sheppo * server (vsw) and client (vnet). 431991Sheppo */ 441991Sheppo 451991Sheppo /* max # of cookies per frame size */ 462336Snarayan #define MAX_COOKIES ((ETHERMAX >> MMU_PAGESHIFT) + 2ULL) 471991Sheppo 481991Sheppo /* initial send sequence number */ 491991Sheppo #define VNET_ISS 0x1 501991Sheppo 512336Snarayan #define VNET_IPALIGN 6 /* padding for IP header alignment */ 522336Snarayan 53*3297Ssb155480 #define VNET_NUM_HANDSHAKES 3 /* # of handshake attempts */ 54*3297Ssb155480 551991Sheppo /* vnet descriptor */ 561991Sheppo typedef struct vnet_public_desc { 571991Sheppo vio_dring_entry_hdr_t hdr; /* descriptor header */ 581991Sheppo uint32_t nbytes; /* data length */ 591991Sheppo uint32_t ncookies; /* number of data cookies */ 601991Sheppo ldc_mem_cookie_t memcookie[MAX_COOKIES]; /* data cookies */ 611991Sheppo } vnet_public_desc_t; 621991Sheppo 631991Sheppo /* 64*3297Ssb155480 * Vnet in-band descriptor. Used by those vnet clients 651991Sheppo * such as OBP who do not use descriptor rings. 661991Sheppo */ 67*3297Ssb155480 typedef struct vnet_ibnd_desc { 681991Sheppo vio_inband_desc_msg_hdr_t hdr; 691991Sheppo 701991Sheppo /* payload */ 711991Sheppo uint32_t nbytes; 721991Sheppo uint32_t ncookies; 731991Sheppo ldc_mem_cookie_t memcookie[MAX_COOKIES]; 74*3297Ssb155480 } vnet_ibnd_desc_t; 751991Sheppo 761991Sheppo #ifdef __cplusplus 771991Sheppo } 781991Sheppo #endif 791991Sheppo 801991Sheppo #endif /* _VNET_COMMON_H */ 81