xnbe.c 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Xen network backend - ioemu version.
*
* HVM guest domains use an emulated network device (typically the
* rtl8139) to access the physical network via IO emulation running in
* a backend domain (generally domain 0).
*
* The IO emulation code sends and receives packets using DLPI, usually
* through a virtual NIC (vnic).
*
* The creation of the relevant vnic to correspond to the network interface
* in the guest domain requires the use of 'hotplug' scripts in the backend
* domain. This driver ensures that the hotplug scripts are run when
* such guest domains are created.
*
* It is used as a result of the 'compatible' property associated with
*/
#ifdef DEBUG
#define XNBE_DEBUG 1
#endif /* DEBUG */
#ifdef XNBE_DEBUG
#endif /* XNBE_DEBUG */
#ifdef XNBE_DEBUG
int xnbe_debug = 0;
#endif /* XNBE_DEBUG */
static int
{
#ifdef XNBE_DEBUG
if (xnbe_debug > 0)
#endif /* XNBE_DEBUG */
switch (cmd) {
case DDI_ATTACH:
break;
case DDI_RESUME:
return (DDI_SUCCESS);
default:
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
#ifdef XNBE_DEBUG
if (xnbe_debug > 0)
#endif /* XNBE_DEBUG */
switch (cmd) {
case DDI_DETACH:
return (DDI_SUCCESS);
case DDI_SUSPEND:
return (DDI_SUCCESS);
default:
return (DDI_FAILURE);
}
}
nulldev, /* open */
nulldev, /* close */
nodev, /* strategy */
nodev, /* print */
nodev, /* dump */
nodev, /* read */
nodev, /* write */
nodev, /* ioctl */
nodev, /* devmap */
nodev, /* mmap */
nodev, /* segmap */
nochpoll, /* poll */
ddi_prop_op, /* cb_prop_op */
0, /* streamtab */
};
DEVO_REV, /* devo_rev */
0, /* devo_refcnt */
nulldev, /* devo_getinfo */
nulldev, /* devo_identify */
nulldev, /* devo_probe */
xnbe_attach, /* devo_attach */
xnbe_detach, /* devo_detach */
nodev, /* devo_reset */
&cb_ops, /* devo_cb_ops */
(struct bus_ops *)0, /* devo_bus_ops */
NULL /* devo_power */
};
};
static struct modlinkage modlinkage = {
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
{
}
int
_fini(void)
{
return (mod_remove(&modlinkage));
}