PERFORCE change 90437 for review
Scott Long
scottl at FreeBSD.org
Thu Jan 26 16:17:21 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=90437
Change 90437 by scottl at scottl-junior on 2006/01/27 00:16:31
Begin restoring the newbus infrastructure for xenbus.
Affected files ...
.. //depot/projects/xen3-newbus/src/sys/dev/xen/xenbus/xenbus_probe.c#3 edit
Differences ...
==== //depot/projects/xen3-newbus/src/sys/dev/xen/xenbus/xenbus_probe.c#3 (text+ko) ====
@@ -1051,8 +1051,33 @@
}
#endif
+
+statuc void
+xenhub_identify(driver_t *driver, device_t parent)
+{
+ device_t child;
+
+ if (device_find_child(parent, "xenhub", 0) != NULL)
+ return;
+
+ if ((child = BUS_ADD_CHILD(parent, 0, "xenhub", 0)) == NULL) {
+ device_printf(parent, "xenhub_identify failed\n");
+ return;
+ }
+
+ return;
+}
+
+static int
+xenhub_probe(device_t dev)
+{
+
+ device_set_desc(dev, "Xen 3.0 Hub");
+ return (0);
+}
+
static int
-xenbus_probe_sysinit(void *unused)
+xenhub_attach(device_t dev)
{
int err = 0, dom0;
@@ -1154,25 +1179,43 @@
return 0;
}
+static int
+xenhub_suspend(device_t dev)
+{
+
+ return (EINVAL);
+}
+
+static int
+xenhub_resume(device_t dev)
+{
+
+ return (0);
+}
+
+static int
+xenhub_add_child(device_t parent, device_t child)
+{
+
+ return (0);
+}
+
SYSINIT(xenbus_probe_sysinit, SI_SUB_PSEUDO, SI_ORDER_FIRST, xenbus_probe_sysinit, NULL);
-#if 0
-static device_method_t xenbus_methods[] = {
+static device_method_t xenhub_methods[] = {
/* Device interface */
-#if 0
- DEVMETHOD(device_identify, xenbus_identify),
- DEVMETHOD(device_probe, xenbus_probe),
- DEVMETHOD(device_attach, xenbus_attach),
+ DEVMETHOD(device_identify, xenhub_identify),
+ DEVMETHOD(device_probe, xenhub_probe),
+ DEVMETHOD(device_attach, xenhub_attach),
DEVMETHOD(device_detach, bus_generic_detach),
DEVMETHOD(device_shutdown, bus_generic_shutdown),
-#endif
- DEVMETHOD(device_suspend, xenbus_suspend),
- DEVMETHOD(device_resume, xenbus_resume),
+ DEVMETHOD(device_suspend, xenhub_suspend),
+ DEVMETHOD(device_resume, xenhub_resume),
/* Bus interface */
DEVMETHOD(bus_print_child, bus_generic_print_child),
- DEVMETHOD(bus_add_child, xenbus_add_child),
+ DEVMETHOD(bus_add_child, xenhub_add_child),
DEVMETHOD(bus_read_ivar, bus_generic_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
#if 0
@@ -1194,15 +1237,13 @@
static char driver_name[] = "xenbus";
static driver_t xenbus_driver = {
- driver_name,
- xenbus_methods,
- sizeof(struct xenbus_device),
+ "xenhub",
+ xenhub_methods,
+ sizeof(struct xenhub_device),
};
-devclass_t xenbus_devclass;
+devclass_t xenhub_devclass;
-DRIVER_MODULE(xenbus, nexus, xenbus_driver, xenbus_devclass, 0, 0);
-
-#endif
+DRIVER_MODULE(xenhub, nexus, xenhub_driver, xenhub_devclass, 0, 0);
/*
* Local variables:
More information about the p4-projects
mailing list