43#include <sys/kernel.h>
45#include <sys/malloc.h>
46#include <sys/module.h>
48#include <sys/sysctl.h>
49#include <sys/syslog.h>
52#include <sys/taskqueue.h>
54#include <machine/stdarg.h>
56#include <xen/xen-os.h>
57#include <xen/gnttab.h>
72 device_set_desc(dev,
"Xen Frontend Devices");
111 unsigned int i, count;
114 xbs = device_get_softc(dev);
115 error = xs_directory(XST_NIL, xbs->
xbs_node, type, &count, &dir);
118 for (i = 0; i < count; i++)
121 free(dir, M_XENSTORE);
151 error = xs_gather(XST_NIL, ivars->
xd_node,
153 "backend", NULL, &otherend_path,
159 free(otherend_path, M_XENSTORE);
165static device_method_t xenbusb_front_methods[] = {
170 DEVMETHOD(device_detach, bus_generic_detach),
171 DEVMETHOD(device_shutdown, bus_generic_shutdown),
172 DEVMETHOD(device_suspend, bus_generic_suspend),
179 DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
180 DEVMETHOD(bus_release_resource, bus_generic_release_resource),
181 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
182 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
190DEFINE_CLASS_0(xenbusb_front, xenbusb_front_driver, xenbusb_front_methods,
192devclass_t xenbusb_front_devclass;
194DRIVER_MODULE(xenbusb_front, xenstore, xenbusb_front_driver,
195 xenbusb_front_devclass, 0, 0);
Container for all state needed to manage a Xenbus Bus attachment.
int xenbusb_attach(device_t dev, char *bus_node, u_int id_components)
Perform common XenBus bus attach processing.
int xenbusb_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
Common XenBus child instance variable read access method.
int xenbusb_print_child(device_t dev, device_t child)
Pretty-prints information about a child of a XenBus bus.
int xenbusb_add_device(device_t dev, const char *type, const char *id)
Attempt to add a XenBus device instance to this XenBus bus.
void xenbusb_identify(driver_t *driver __unused, device_t parent)
Identify instances of this device type in the system.
int xenbusb_resume(device_t dev)
Perform common XenBus bus resume handling.
int xenbusb_write_ivar(device_t dev, device_t child, int index, uintptr_t value)
Common XenBus child instance variable write access method.
static int xenbusb_front_attach(device_t dev)
Attach the XenBus front bus.
static int xenbusb_front_probe(device_t dev)
Probe for the existence of the XenBus front bus.
static int xenbusb_front_enumerate_type(device_t dev, const char *type)
Enumerate all devices of the given type on this bus.
static int xenbusb_front_get_otherend_node(device_t dev, struct xenbus_device_ivars *ivars)
Determine and store the XenStore path for the other end of a split device whose local end is represen...
Datastructures and function declarations for usedby device drivers operating on the XenBus.