xnb.h revision 876de206688d9fe008ad80c116a23a56701579d1
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
fd0939ef389f48c901faf4bf0b60b82d4bc58b64David Edmondson * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Use is subject to license terms.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * xnb.h - definitions for Xen dom0 network driver
843e19887f64dde75055cf8842fc4db2171eff45johnlevextern "C" {
876de206688d9fe008ad80c116a23a56701579d1Richard Lowe#define NET_TX_RING_SIZE __CONST_RING_SIZE(netif_tx, PAGESIZE)
876de206688d9fe008ad80c116a23a56701579d1Richard Lowe#define NET_RX_RING_SIZE __CONST_RING_SIZE(netif_rx, 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);
565679070e884800f5d041d42d226813c0bbf6d8David Edmondson boolean_t (*xf_mcast_add)(xnb_t *, ether_addr_t *);
565679070e884800f5d041d42d226813c0bbf6d8David Edmondson boolean_t (*xf_mcast_del)(xnb_t *, ether_addr_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 */
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 */