diff options
author | n_hibma <n_hibma@FreeBSD.org> | 1999-11-28 21:01:06 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 1999-11-28 21:01:06 +0000 |
commit | 5d92bd7267d9ba2166b9b58284bb0396467d6197 (patch) | |
tree | 9845d01307e9589c43a370ceeb59e655d689691c /sys/dev/usb/uhub.c | |
parent | ad78000b3149c3f3dddc75e91200a76036cefa75 (diff) | |
download | FreeBSD-src-5d92bd7267d9ba2166b9b58284bb0396467d6197.zip FreeBSD-src-5d92bd7267d9ba2166b9b58284bb0396467d6197.tar.gz |
Synchronisation with NetBSD 1999/11/27
- more req[uest]->xfer changes.
- get the corresponding NetBSD Id's right
ohci.c
- move untimeout above print statement
- remove usb_delay that panics the system (tsleep in intr context) when
ohcidebug > 5.
ugen.c
- create the devices for endpoints with make_dev.
uhub.c
- change from using usbdebug to uhubdebug
- add more debugging statements
Diffstat (limited to 'sys/dev/usb/uhub.c')
-rw-r--r-- | sys/dev/usb/uhub.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 015dce9..f8d9c2a 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -1,4 +1,4 @@ -/* $NetBSD: uhub.c,v 1.32 1999/10/13 08:10:56 augustss Exp $ */ +/* $NetBSD: uhub.c,v 1.34 1999/11/18 23:32:29 augustss Exp $ */ /* $FreeBSD$ */ /* @@ -63,9 +63,9 @@ #include <dev/usb/usbdivar.h> #ifdef UHUB_DEBUG -#define DPRINTF(x) if (usbdebug) logprintf x -#define DPRINTFN(n,x) if (usbdebug>(n)) logprintf x -extern int usbdebug; +#define DPRINTF(x) if (uhubdebug) logprintf x +#define DPRINTFN(n,x) if (uhubdebug>(n)) logprintf x +int uhubdebug; #else #define DPRINTF(x) #define DPRINTFN(n,x) @@ -81,7 +81,7 @@ struct uhub_softc { static usbd_status uhub_init_port __P((struct usbd_port *)); static usbd_status uhub_explore __P((usbd_device_handle hub)); -static void uhub_intr __P((usbd_xfer_handle, usbd_private_handle, usbd_status)); +static void uhub_intr __P((usbd_xfer_handle, usbd_private_handle,usbd_status)); #if defined(__FreeBSD__) static bus_child_detached_t uhub_child_detached; @@ -95,7 +95,7 @@ static bus_child_detached_t uhub_child_detached; */ #if defined(__NetBSD__) || defined(__OpenBSD__) -USB_DECLARE_DRIVER(uhub) +USB_DECLARE_DRIVER(uhub); /* Create the driver instance for the hub connected to hub case */ struct cfattach uhub_uhub_ca = { @@ -236,7 +236,7 @@ USB_ATTACH(uhub) } err = usbd_open_pipe_intr(iface, ed->bEndpointAddress, - USBD_SHORT_XFER_OK, &sc->sc_ipipe, sc, sc->sc_status, + USBD_SHORT_XFER_OK, &sc->sc_ipipe, sc, sc->sc_status, sizeof(sc->sc_status), uhub_intr); if (err) { printf("%s: cannot open interrupt pipe\n", @@ -364,9 +364,10 @@ uhub_explore(dev) } status = UGETW(up->status.wPortStatus); change = UGETW(up->status.wPortChange); - DPRINTFN(5, ("uhub_explore: port %d status 0x%04x 0x%04x\n", - port, status, change)); + DPRINTFN(3,("uhub_explore: port %d status 0x%04x 0x%04x\n", + port, status, change)); if (change & UPS_C_PORT_ENABLED) { + DPRINTF(("uhub_explore: C_PORT_ENABLED\n")); usbd_clear_port_feature(dev, port, UHF_C_PORT_ENABLE); if (status & UPS_PORT_ENABLED) { printf("%s: illegal enable change, port %d\n", @@ -386,6 +387,8 @@ uhub_explore(dev) } } if (!(change & UPS_C_CONNECT_STATUS)) { + DPRINTFN(3,("uhub_explore: port=%d !C_CONNECT_" + "STATUS\n", port)); /* No status change, just do recursive explore. */ if (up->device && up->device->hub) up->device->hub->explore(up->device); @@ -405,14 +408,17 @@ uhub_explore(dev) disco: if (up->device != NULL) { /* Disconnected */ - DPRINTF(("uhub_explore: device %d disappeared " + DPRINTF(("uhub_explore: device addr=%d disappeared " "on port %d\n", up->device->address, port)); usb_disconnect_port(up, USBDEV(sc->sc_dev)); usbd_clear_port_feature(dev, port, UHF_C_PORT_CONNECTION); } - if (!(status & UPS_CURRENT_CONNECT_STATUS)) + if (!(status & UPS_CURRENT_CONNECT_STATUS)) { + DPRINTFN(3,("uhub_explore: port=%d !CURRENT_CONNECT" + "_STATUS\n", port)); continue; + } /* Connected */ up->restartcnt = 0; @@ -421,9 +427,11 @@ uhub_explore(dev) usbd_delay_ms(dev, USB_PORT_POWERUP_DELAY); /* Reset port, which implies enabling it. */ - if (usbd_reset_port(dev, port, &up->status) != - USBD_NORMAL_COMPLETION) + if (usbd_reset_port(dev, port, &up->status)) { + DPRINTF(("uhub_explore: port=%d reset failed\n", + port)); continue; + } /* Get device info and set its address. */ err = usbd_new_device(USBDEV(sc->sc_dev), dev->bus, |