From owner-svn-soc-all@FreeBSD.ORG Sun Jul 21 17:16:23 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D195D9BA for ; Sun, 21 Jul 2013 17:16:23 +0000 (UTC) (envelope-from bguan@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) by mx1.freebsd.org (Postfix) with ESMTP id C1986A5C for ; Sun, 21 Jul 2013 17:16:23 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6LHGNjq054585 for ; Sun, 21 Jul 2013 17:16:23 GMT (envelope-from bguan@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r6LHGN7J054583 for svn-soc-all@FreeBSD.org; Sun, 21 Jul 2013 17:16:23 GMT (envelope-from bguan@FreeBSD.org) Date: Sun, 21 Jul 2013 17:16:23 GMT Message-Id: <201307211716.r6LHGN7J054583@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to bguan@FreeBSD.org using -f From: bguan@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r255006 - soc2013/bguan/head/sys/dev/xen/usbfront MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2013 17:16:24 -0000 Author: bguan Date: Sun Jul 21 17:16:23 2013 New Revision: 255006 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=255006 Log: get rid of the pci stuff Modified: soc2013/bguan/head/sys/dev/xen/usbfront/usbfront.c Modified: soc2013/bguan/head/sys/dev/xen/usbfront/usbfront.c ============================================================================== --- soc2013/bguan/head/sys/dev/xen/usbfront/usbfront.c Sun Jul 21 17:15:35 2013 (r255005) +++ soc2013/bguan/head/sys/dev/xen/usbfront/usbfront.c Sun Jul 21 17:16:23 2013 (r255006) @@ -26,6 +26,8 @@ //__FBSDID("$FreeBSD: release/9.1.0/sys/dev/xen/usbfront/usbfront.c 237873 2013-07-01 05:13:50Z ken $"); __FBSDID("$FreeBSD$"); +#include +#include #include #include #include @@ -74,8 +76,8 @@ #include #include -#include #include +#include #include "xenbus_if.h" @@ -86,13 +88,18 @@ #define DPRINTK(fmt, args...) #endif +static int usbfront_probe(device_t dev); +static int usbfront_attach(device_t dev); static int usbfront_detach(device_t dev); +static int usbfront_suspend(device_t dev); +static int usbfront_resume(device_t dev); + /** * Entry point to this code when a new device is created. Allocate the basic * structures and the ring buffers for communication with the backend, and * inform the backend of the appropriate details for those. Switch to - * Connected state. + * Connected state. */ static int usbfront_probe(device_t dev) @@ -119,7 +126,7 @@ { struct xenhci_softc *sc; int err; - int rid; + //int rid; int i; int num_ports; @@ -130,15 +137,11 @@ sc = device_get_softc(dev); - /* initialise some bus fields */ - sc->sc_bus.parent = dev; - - /* set up the bus struct */ - sc->sc_bus.methods = &xenhci_bus_methods; - - /* setup devices array */ - sc->sc_bus.devices = sc->sc_devices; - sc->sc_bus.devices_max = XENHCI_MAX_DEVICES; + /* initialise some bus fields */ + if (xenhci_init(sc, dev)) { + device_printf(dev, "Could not initialize xen usb hc softc\n"); + goto error; + } /* set the bus revision, read the revision from xenstore */ backend_path = xenbus_get_otherend_path(dev); @@ -162,38 +165,15 @@ return (err); } - /* allocate resource for usb host controller (copy from xhci_pci.c) */ - pci_enable_busmaster(dev); - - rid = PCI_CBMEM; - sc->sc_io_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (!sc->sc_io_res) { - device_printf(dev, "Could not map memory\n"); - goto error; - } - sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); - sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); - sc->sc_io_size = rman_get_size(sc->sc_io_res); - - usb_callout_init_mtx(&sc->sc_callout, &sc->sc_bus.bus_mtx, 0); - - rid = 0; - sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); - if (sc->sc_irq_res == NULL) { - device_printf(dev, "Could not allocate IRQ\n"); - } - sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); if (sc->sc_bus.bdev == NULL) { device_printf(dev, "Could not add USB device\n"); goto error; } + printf("[gbdebug-pvusb]device_add_child() done!\n"); device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); - - /* xen related stuff*/ + /* xen shared ring related stuff*/ err = xs_scanf(XST_NIL, backend_path, "num-ports", NULL, "%d", &num_ports); if (err) { xenbus_dev_fatal(dev, err, "reading num-ports"); @@ -216,7 +196,7 @@ sc->shadow[USB_URB_RING_SIZE-1].req.id = 0x0fff; - /* attach the xen host controller */ + /* attach the xen host controller */ //TODO?? err = device_probe_and_attach(sc->sc_bus.bdev); if (err) { device_printf(dev, "XENHCI halt/start/probe failed err=%d\n", err);