summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhub.c
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2002-04-07 11:29:31 +0000
committerjoe <joe@FreeBSD.org>2002-04-07 11:29:31 +0000
commitd360d25ed8e8747f880170f55c0eb36ad91ead6e (patch)
treed4d5d24ad267957dab8462b450e24020941ce4de /sys/dev/usb/uhub.c
parentd0ff37e318a57c921798cd6aebe4de1061c9e1bd (diff)
downloadFreeBSD-src-d360d25ed8e8747f880170f55c0eb36ad91ead6e.zip
FreeBSD-src-d360d25ed8e8747f880170f55c0eb36ad91ead6e.tar.gz
Reduce the difference between our version and NetBSD's. (No
functional changes.)
Diffstat (limited to 'sys/dev/usb/uhub.c')
-rw-r--r--sys/dev/usb/uhub.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index bc76d1d..3fbc572 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -117,6 +117,7 @@ devclass_t uhubroot_devclass;
Static device_method_t uhubroot_methods[] = {
DEVMETHOD(device_probe, uhub_match),
DEVMETHOD(device_attach, uhub_attach),
+
/* detach is not allowed for a root hub */
DEVMETHOD(device_suspend, bus_generic_suspend),
DEVMETHOD(device_resume, bus_generic_resume),
@@ -456,7 +457,7 @@ uhub_explore(usbd_device_handle dev)
if (!(status & UPS_CURRENT_CONNECT_STATUS)) {
/* Nothing connected, just ignore it. */
#ifdef DIAGNOSTIC
- printf("%s: device disappeared on port %d\n",
+ printf("%s: port %d, device disappeared after reset\n",
USBDEVNAME(sc->sc_dev), port);
#endif
continue;
@@ -469,11 +470,9 @@ uhub_explore(usbd_device_handle dev)
speed = USB_SPEED_LOW;
else
speed = USB_SPEED_FULL;
-
/* Get device info and set its address. */
err = usbd_new_device(USBDEV(sc->sc_dev), dev->bus,
dev->depth + 1, speed, port, up);
-
/* XXX retry a few times? */
if (err) {
DPRINTFN(-1,("uhub_explore: usb_new_device failed, "
@@ -538,7 +537,7 @@ uhub_activate(device_ptr_t self, enum devact act)
USB_DETACH(uhub)
{
USB_DETACH_START(uhub, sc);
- usbd_device_handle dev = sc->sc_hub;
+ struct usbd_hub *hub = sc->sc_hub->hub;
struct usbd_port *rup;
int port, nports;
@@ -548,23 +547,24 @@ USB_DETACH(uhub)
DPRINTF(("uhub_detach: sc=%port\n", sc));
#endif
- if (dev->hub == NULL) /* Must be partially working */
+ if (hub == NULL) /* Must be partially working */
return (0);
usbd_abort_pipe(sc->sc_ipipe);
usbd_close_pipe(sc->sc_ipipe);
- nports = dev->hub->hubdesc.bNbrPorts;
+ nports = hub->hubdesc.bNbrPorts;
for(port = 0; port < nports; port++) {
- rup = &dev->hub->ports[port];
+ rup = &hub->ports[port];
if (rup->device)
usb_disconnect_port(rup, self);
}
- usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, dev, USBDEV(sc->sc_dev));
+ usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_hub,
+ USBDEV(sc->sc_dev));
- free(dev->hub, M_USBDEV);
- dev->hub = NULL;
+ free(hub, M_USBDEV);
+ sc->sc_hub->hub = NULL;
return (0);
}
@@ -617,7 +617,6 @@ uhub_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
usbd_clear_endpoint_stall_async(sc->sc_ipipe);
else if (status == USBD_NORMAL_COMPLETION)
usb_needs_explore(sc->sc_hub);
-
}
#if defined(__FreeBSD__)
OpenPOWER on IntegriCloud