diff options
Diffstat (limited to 'sys/dev/usb/uhub.c')
-rw-r--r-- | sys/dev/usb/uhub.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 5fc4c45..0d97de8 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -94,7 +94,7 @@ Static bus_child_detached_t uhub_child_detached; #endif -/* +/* * We need two attachment points: * hub to usb and hub to hub * Every other driver only connects to hubs @@ -116,7 +116,7 @@ USB_DECLARE_DRIVER_INIT(uhub, DEVMETHOD(device_resume, bus_generic_resume), DEVMETHOD(device_shutdown, bus_generic_shutdown) ); - + /* Create the driver instance for the hub connected to usb case. */ devclass_t uhubroot_devclass; @@ -142,9 +142,9 @@ USB_MATCH(uhub) { USB_MATCH_START(uhub, uaa); usb_device_descriptor_t *dd = usbd_get_device_descriptor(uaa->device); - + DPRINTFN(5,("uhub_match, dd=%p\n", dd)); - /* + /* * The subclass for hubs seems to be 0 for some and 1 for others, * so we just ignore the subclass. */ @@ -165,7 +165,7 @@ USB_ATTACH(uhub) int p, port, nports, nremov, pwrdly; usbd_interface_handle iface; usb_endpoint_descriptor_t *ed; - + devinfo = malloc(1024, M_TEMP, M_NOWAIT); if (devinfo == NULL) { USB_ATTACH_ERROR_RETURN; @@ -228,11 +228,11 @@ USB_ATTACH(uhub) dev->hub->hubsoftc = sc; hub->explore = uhub_explore; hub->hubdesc = hubdesc; - + DPRINTFN(1,("usbhub_init_hub: selfpowered=%d, parent=%p, " "parent->selfpowered=%d\n", dev->self_powered, dev->powersrc->parent, - dev->powersrc->parent ? + dev->powersrc->parent ? dev->powersrc->parent->self_powered : 0)); if (!dev->self_powered && dev->powersrc->parent != NULL && @@ -259,10 +259,10 @@ 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, UHUB_INTR_INTERVAL); if (err) { - printf("%s: cannot open interrupt pipe\n", + printf("%s: cannot open interrupt pipe\n", USBDEVNAME(sc->sc_dev)); goto bad; } @@ -318,7 +318,7 @@ USB_ATTACH(uhub) /* Turn the power on. */ err = usbd_set_port_feature(dev, port, UHF_PORT_POWER); if (err) - printf("%s: port %d power on failed, %s\n", + printf("%s: port %d power on failed, %s\n", USBDEVNAME(sc->sc_dev), port, usbd_errstr(err)); DPRINTF(("usb_init_port: turn on port %d power\n", port)); @@ -399,7 +399,7 @@ uhub_explore(usbd_device_handle dev) if (up->device != NULL && up->device->hub != NULL) up->device->hub->explore(up->device); #if 0 && defined(DIAGNOSTIC) - if (up->device == NULL && + if (up->device == NULL && (status & UPS_CURRENT_CONNECT_STATUS)) printf("%s: connected, no device\n", USBDEVNAME(sc->sc_dev)); @@ -426,7 +426,7 @@ uhub_explore(usbd_device_handle dev) 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, + usbd_clear_port_feature(dev, port, UHF_C_PORT_CONNECTION); } if (!(status & UPS_CURRENT_CONNECT_STATUS)) { @@ -477,7 +477,7 @@ uhub_explore(usbd_device_handle dev) else speed = USB_SPEED_FULL; /* Get device info and set its address. */ - err = usbd_new_device(USBDEV(sc->sc_dev), dev->bus, + err = usbd_new_device(USBDEV(sc->sc_dev), dev->bus, dev->depth + 1, speed, port, up); /* XXX retry a few times? */ if (err) { @@ -486,7 +486,7 @@ uhub_explore(usbd_device_handle dev) /* Avoid addressing problems by disabling. */ /* usbd_reset_port(dev, port, &up->status); */ - /* + /* * The unit refused to accept a new address, or had * some other serious problem. Since we cannot leave * at 0 we have to disable the port instead. @@ -587,7 +587,7 @@ uhub_child_detached(device_t self, device_t child) int port; int i; - if (!devhub->hub) + if (!devhub->hub) /* should never happen; children are only created after init */ panic("hub not fully initialised, but child deleted?"); |