xnb.h revision 024c26ef7a54ce7ac147c58352f2f52a28062711
843e19887f64dde75055cf8842fc4db2171eff45johnlev * CDDL HEADER START
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The contents of this file are subject to the terms of the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Common Development and Distribution License (the "License").
843e19887f64dde75055cf8842fc4db2171eff45johnlev * You may not use this file except in compliance with the License.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
843e19887f64dde75055cf8842fc4db2171eff45johnlev * See the License for the specific language governing permissions
843e19887f64dde75055cf8842fc4db2171eff45johnlev * and limitations under the License.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * When distributing Covered Code, include this CDDL HEADER in each
843e19887f64dde75055cf8842fc4db2171eff45johnlev * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * If applicable, add the following below this CDDL HEADER, with the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * fields enclosed by brackets "[]" replaced with your own identifying
843e19887f64dde75055cf8842fc4db2171eff45johnlev * information: Portions Copyright [yyyy] [name of copyright owner]
843e19887f64dde75055cf8842fc4db2171eff45johnlev * CDDL HEADER END
66f1a35af5debdb90a7c30b19488e1414a029075schuster * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Use is subject to license terms.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * xnb.h - definitions for Xen dom0 network driver
843e19887f64dde75055cf8842fc4db2171eff45johnlevextern "C" {
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGESIZE)
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGESIZE)
843e19887f64dde75055cf8842fc4db2171eff45johnlev/* DEBUG flags */
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The xnb module provides core inter-domain network protocol functionality.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * It is connected to the rest of Solaris in two ways:
843e19887f64dde75055cf8842fc4db2171eff45johnlev * - as a GLDv3 driver (with xnbu),
843e19887f64dde75055cf8842fc4db2171eff45johnlev * - as a GLDv3 consumer (with xnbo).
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The different modes of operation are termed "flavours" and each
843e19887f64dde75055cf8842fc4db2171eff45johnlev * instance of an xnb based driver operates in one and only one mode.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The common xnb driver exports a set of functions to these drivers
843e19887f64dde75055cf8842fc4db2171eff45johnlev * (declarations at the foot of this file) and calls back into the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * drivers via the xnb_flavour_t structure.
843e19887f64dde75055cf8842fc4db2171eff45johnlevtypedef struct xnb_flavour {
843e19887f64dde75055cf8842fc4db2171eff45johnlev mblk_t *(*xf_cksum_from_peer)(xnb_t *, mblk_t *, uint16_t);
024c26ef7a54ce7ac147c58352f2f52a28062711Max zhentypedef struct xnb_txbuf {
024c26ef7a54ce7ac147c58352f2f52a28062711Max zhen unsigned int xt_flags;
843e19887f64dde75055cf8842fc4db2171eff45johnlev/* Per network-interface-controller driver private structure */
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* most interesting stuff first to assist debugging */
551bc2a66868b5cb5be6b70ab9f55515e77a39a9mrj netif_rx_back_ring_t xnb_rx_ring; /* rx interface struct ptr */
551bc2a66868b5cb5be6b70ab9f55515e77a39a9mrj netif_tx_back_ring_t xnb_tx_ring; /* tx interface struct ptr */
024c26ef7a54ce7ac147c58352f2f52a28062711Max zhen gnttab_map_grant_ref_t xnb_tx_mop[NET_TX_RING_SIZE];
024c26ef7a54ce7ac147c58352f2f52a28062711Max zhen gnttab_unmap_grant_ref_t xnb_tx_unmop[NET_TX_RING_SIZE];
551bc2a66868b5cb5be6b70ab9f55515e77a39a9mrj /* store information for unmop */
843e19887f64dde75055cf8842fc4db2171eff45johnlevextern int xnb_attach(dev_info_t *, xnb_flavour_t *, void *);
843e19887f64dde75055cf8842fc4db2171eff45johnlevextern mblk_t *xnb_process_cksum_flags(xnb_t *, mblk_t *, uint32_t);
843e19887f64dde75055cf8842fc4db2171eff45johnlev#endif /* _SYS_XNB_H */