From owner-p4-projects@FreeBSD.ORG Fri Jan 27 00:17:21 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E513F16A43E; Fri, 27 Jan 2006 00:17:19 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7ABD516A423 for ; Fri, 27 Jan 2006 00:17:19 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 28E8543D4C for ; Fri, 27 Jan 2006 00:17:19 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0R0HJ6O041009 for ; Fri, 27 Jan 2006 00:17:19 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0R0HI0Z041003 for perforce@freebsd.org; Fri, 27 Jan 2006 00:17:18 GMT (envelope-from scottl@freebsd.org) Date: Fri, 27 Jan 2006 00:17:18 GMT Message-Id: <200601270017.k0R0HI0Z041003@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Cc: Subject: PERFORCE change 90437 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2006 00:17:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=90437 Change 90437 by scottl@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: