xnb.h revision 843e19887f64dde75055cf8842fc4db2171eff45
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* xnb.h - definitions for Xen dom0 network driver
*/
#ifndef _SYS_XNB_H
#define _SYS_XNB_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/ethernet.h>
#include <sys/hypervisor.h>
#ifdef __cplusplus
extern "C" {
#endif
/* DEBUG flags */
#define XNBDDI 0x01
#define XNBTRACE 0x02
#define XNBSEND 0x04
#define XNBRECV 0x08
#define XNBINTR 0x10
#define XNBRING 0x20
#define XNBCKSUM 0x40
/*
* The xnb module provides core inter-domain network protocol functionality.
* It is connected to the rest of Solaris in two ways:
* - as a GLDv3 driver (with xnbu),
* - as a GLDv3 consumer (with xnbo).
*
* The different modes of operation are termed "flavours" and each
* instance of an xnb based driver operates in one and only one mode.
* The common xnb driver exports a set of functions to these drivers
* (declarations at the foot of this file) and calls back into the
* drivers via the xnb_flavour_t structure.
*/
typedef struct xnb_flavour {
void (*xf_peer_connected)(xnb_t *);
void (*xf_peer_disconnected)(xnb_t *);
typedef struct xnb_rxbuf {
unsigned int xr_flags;
#define XNB_RXBUF_INUSE 0x01
} xnb_rxbuf_t;
/* Per network-interface-controller driver private structure */
struct xnb {
/* most interesting stuff first to assist debugging */
void *x_flavour_data;
unsigned char x_mac_addr[ETHERADDRL];
int x_rx_unmop_count;
int x_rx_buf_count;
void *x_rx_ring_addr;
void *x_tx_ring_addr;
int x_evtchn; /* channel to front end */
};
extern void xnb_detach(dev_info_t *);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_XNB_H */