1 /* $NetBSD: uhub.c,v 1.68 2004/06/29 06:30:05 mycroft Exp $ */
4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Lennart Augustsson (lennart@augustsson.net) at
9 * Carlstedt Research & Technology.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the NetBSD
22 * Foundation, Inc. and its contributors.
23 * 4. Neither the name of The NetBSD Foundation nor the names of its
24 * contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
40 #include <sys/cdefs.h>
41 __FBSDID("$FreeBSD$");
44 * USB spec: http://www.usb.org/developers/docs/usbspec.zip
47 #include <sys/param.h>
48 #include <sys/systm.h>
49 #include <sys/kernel.h>
50 #include <sys/malloc.h>
51 #if defined(__NetBSD__) || defined(__OpenBSD__)
52 #include <sys/device.h>
54 #elif defined(__FreeBSD__)
55 #include <sys/module.h>
58 #include <sys/mutex.h>
60 #include <sys/sysctl.h>
62 #include <machine/bus.h>
64 #include <dev/usb/usb.h>
65 #include <dev/usb/usbdi.h>
66 #include <dev/usb/usbdi_util.h>
67 #include <dev/usb/usbdivar.h>
69 #define UHUB_INTR_INTERVAL 255 /* ms */
72 #define DPRINTF(x) if (uhubdebug) logprintf x
73 #define DPRINTFN(n,x) if (uhubdebug>(n)) logprintf x
75 SYSCTL_NODE(_hw_usb, OID_AUTO, uhub, CTLFLAG_RW, 0, "USB uhub");
76 SYSCTL_INT(_hw_usb_uhub, OID_AUTO, debug, CTLFLAG_RW,
77 &uhubdebug, 0, "uhub debug level");
84 device_t sc_dev; /* base device */
85 usbd_device_handle sc_hub; /* USB device */
86 usbd_pipe_handle sc_ipipe; /* interrupt pipe */
87 u_int8_t sc_status[1]; /* XXX more ports */
90 #define UHUB_PROTO(sc) ((sc)->sc_hub->ddesc.bDeviceProtocol)
91 #define UHUB_IS_HIGH_SPEED(sc) (UHUB_PROTO(sc) != UDPROTO_FSHUB)
92 #define UHUB_IS_SINGLE_TT(sc) (UHUB_PROTO(sc) == UDPROTO_HSHUBSTT)
94 static usbd_status uhub_explore(usbd_device_handle hub);
95 static void uhub_intr(usbd_xfer_handle, usbd_private_handle,usbd_status);
97 #if defined(__FreeBSD__)
98 static bus_child_location_str_t uhub_child_location_str;
99 static bus_child_pnpinfo_str_t uhub_child_pnpinfo_str;
104 * We need two attachment points:
105 * hub to usb and hub to hub
106 * Every other driver only connects to hubs
109 #if defined(__NetBSD__) || defined(__OpenBSD__)
110 USB_DECLARE_DRIVER(uhub);
112 /* Create the driver instance for the hub connected to hub case */
113 CFATTACH_DECL(uhub_uhub, sizeof(struct uhub_softc),
114 uhub_match, uhub_attach, uhub_detach, uhub_activate);
115 #elif defined(__FreeBSD__)
116 USB_DECLARE_DRIVER_INIT(uhub,
117 DEVMETHOD(bus_child_pnpinfo_str, uhub_child_pnpinfo_str),
118 DEVMETHOD(bus_child_location_str, uhub_child_location_str),
119 DEVMETHOD(bus_driver_added, bus_generic_driver_added),
120 DEVMETHOD(device_suspend, bus_generic_suspend),
121 DEVMETHOD(device_resume, bus_generic_resume),
122 DEVMETHOD(device_shutdown, bus_generic_shutdown)
125 /* Create the driver instance for the hub connected to usb case. */
126 devclass_t uhubroot_devclass;
128 static device_method_t uhubroot_methods[] = {
129 DEVMETHOD(bus_child_location_str, uhub_child_location_str),
130 DEVMETHOD(bus_child_pnpinfo_str, uhub_child_pnpinfo_str),
131 DEVMETHOD(bus_driver_added, bus_generic_driver_added),
133 DEVMETHOD(device_probe, uhub_match),
134 DEVMETHOD(device_attach, uhub_attach),
135 DEVMETHOD(device_detach, uhub_detach),
136 DEVMETHOD(device_suspend, bus_generic_suspend),
137 DEVMETHOD(device_resume, bus_generic_resume),
138 DEVMETHOD(device_shutdown, bus_generic_shutdown),
142 static driver_t uhubroot_driver = {
145 sizeof(struct uhub_softc)
151 USB_MATCH_START(uhub, uaa);
152 usb_device_descriptor_t *dd = usbd_get_device_descriptor(uaa->device);
154 DPRINTFN(5,("uhub_match, dd=%p\n", dd));
156 * The subclass for hubs seems to be 0 for some and 1 for others,
157 * so we just ignore the subclass.
159 if (uaa->iface == NULL && dd->bDeviceClass == UDCLASS_HUB)
160 return (UMATCH_DEVCLASS_DEVSUBCLASS);
161 return (UMATCH_NONE);
166 USB_ATTACH_START(uhub, sc, uaa);
167 usbd_device_handle dev = uaa->device;
170 struct usbd_hub *hub = NULL;
171 usb_device_request_t req;
172 usb_hub_descriptor_t hubdesc;
173 int p, port, nports, nremov, pwrdly;
174 usbd_interface_handle iface;
175 usb_endpoint_descriptor_t *ed;
176 struct usbd_tt *tts = NULL;
178 devinfo = malloc(1024, M_TEMP, M_NOWAIT);
179 if (devinfo == NULL) {
180 USB_ATTACH_ERROR_RETURN;
182 DPRINTFN(1,("uhub_attach\n"));
184 usbd_devinfo(dev, 1, devinfo);
187 if (dev->depth > 0 && UHUB_IS_HIGH_SPEED(sc)) {
188 printf("%s: %s transaction translator%s\n",
189 device_get_nameunit(sc->sc_dev),
190 UHUB_IS_SINGLE_TT(sc) ? "single" : "multiple",
191 UHUB_IS_SINGLE_TT(sc) ? "" : "s");
193 err = usbd_set_config_index(dev, 0, 1);
195 DPRINTF(("%s: configuration failed, error=%s\n",
196 device_get_nameunit(sc->sc_dev), usbd_errstr(err)));
197 free(devinfo, M_TEMP);
198 USB_ATTACH_ERROR_RETURN;
201 if (dev->depth > USB_HUB_MAX_DEPTH) {
202 printf("%s: hub depth (%d) exceeded, hub ignored\n",
203 device_get_nameunit(sc->sc_dev), USB_HUB_MAX_DEPTH);
204 free(devinfo, M_TEMP);
205 USB_ATTACH_ERROR_RETURN;
208 /* Get hub descriptor. */
209 req.bmRequestType = UT_READ_CLASS_DEVICE;
210 req.bRequest = UR_GET_DESCRIPTOR;
211 USETW2(req.wValue, (dev->address > 1 ? UDESC_HUB : 0), 0);
212 USETW(req.wIndex, 0);
213 USETW(req.wLength, USB_HUB_DESCRIPTOR_SIZE);
214 DPRINTFN(1,("usb_init_hub: getting hub descriptor\n"));
215 err = usbd_do_request(dev, &req, &hubdesc);
216 nports = hubdesc.bNbrPorts;
217 if (!err && nports > 7) {
218 USETW(req.wLength, USB_HUB_DESCRIPTOR_SIZE + (nports+1) / 8);
219 err = usbd_do_request(dev, &req, &hubdesc);
222 DPRINTF(("%s: getting hub descriptor failed, error=%s\n",
223 device_get_nameunit(sc->sc_dev), usbd_errstr(err)));
224 free(devinfo, M_TEMP);
225 USB_ATTACH_ERROR_RETURN;
228 for (nremov = 0, port = 1; port <= nports; port++)
229 if (!UHD_NOT_REMOV(&hubdesc, port))
231 printf("%s: %d port%s with %d removable, %s powered\n",
232 device_get_nameunit(sc->sc_dev), nports, nports != 1 ? "s" : "",
233 nremov, dev->self_powered ? "self" : "bus");
236 printf("%s: no ports, hub ignored\n", device_get_nameunit(sc->sc_dev));
240 hub = malloc(sizeof(*hub) + (nports-1) * sizeof(struct usbd_port),
243 free(devinfo, M_TEMP);
244 USB_ATTACH_ERROR_RETURN;
247 dev->hub->hubsoftc = sc;
248 hub->explore = uhub_explore;
249 hub->hubdesc = hubdesc;
251 DPRINTFN(1,("usbhub_init_hub: selfpowered=%d, parent=%p, "
252 "parent->selfpowered=%d\n",
253 dev->self_powered, dev->powersrc->parent,
254 dev->powersrc->parent ?
255 dev->powersrc->parent->self_powered : 0));
257 if (!dev->self_powered && dev->powersrc->parent != NULL &&
258 !dev->powersrc->parent->self_powered) {
259 printf("%s: bus powered hub connected to bus powered hub, "
260 "ignored\n", device_get_nameunit(sc->sc_dev));
264 /* Set up interrupt pipe. */
265 err = usbd_device2interface_handle(dev, 0, &iface);
267 printf("%s: no interface handle\n", device_get_nameunit(sc->sc_dev));
270 ed = usbd_interface2endpoint_descriptor(iface, 0);
272 printf("%s: no endpoint descriptor\n", device_get_nameunit(sc->sc_dev));
275 if ((ed->bmAttributes & UE_XFERTYPE) != UE_INTERRUPT) {
276 printf("%s: bad interrupt endpoint\n", device_get_nameunit(sc->sc_dev));
280 err = usbd_open_pipe_intr(iface, ed->bEndpointAddress,
281 USBD_SHORT_XFER_OK, &sc->sc_ipipe, sc, sc->sc_status,
282 sizeof(sc->sc_status), uhub_intr, UHUB_INTR_INTERVAL);
284 printf("%s: cannot open interrupt pipe\n",
285 device_get_nameunit(sc->sc_dev));
289 /* Wait with power off for a while. */
290 usbd_delay_ms(dev, USB_POWER_DOWN_TIME);
292 usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, USBDEV(sc->sc_dev));
295 * To have the best chance of success we do things in the exact same
296 * order as Windoze98. This should not be necessary, but some
297 * devices do not follow the USB specs to the letter.
299 * These are the events on the bus when a hub is attached:
300 * Get device and config descriptors (see attach code)
301 * Get hub descriptor (see above)
304 * wait for power to become stable
305 * (all below happens in explore code)
307 * clear C_PORT_CONNECTION
310 * if device connected
316 * proceed with device attachment
319 if (UHUB_IS_HIGH_SPEED(sc)) {
320 tts = malloc((UHUB_IS_SINGLE_TT(sc) ? 1 : nports) *
321 sizeof (struct usbd_tt), M_USBDEV, M_NOWAIT);
326 /* Set up data structures */
327 for (p = 0; p < nports; p++) {
328 struct usbd_port *up = &hub->ports[p];
332 if (dev->self_powered)
333 /* Self powered hub, give ports maximum current. */
334 up->power = USB_MAX_POWER;
336 up->power = USB_MIN_POWER;
338 if (UHUB_IS_HIGH_SPEED(sc)) {
339 up->tt = &tts[UHUB_IS_SINGLE_TT(sc) ? 0 : p];
346 /* XXX should check for none, individual, or ganged power? */
348 pwrdly = dev->hub->hubdesc.bPwrOn2PwrGood * UHD_PWRON_FACTOR
349 + USB_EXTRA_POWER_UP_TIME;
350 for (port = 1; port <= nports; port++) {
351 /* Turn the power on. */
352 err = usbd_set_port_feature(dev, port, UHF_PORT_POWER);
354 printf("%s: port %d power on failed, %s\n",
355 device_get_nameunit(sc->sc_dev), port,
357 DPRINTF(("usb_init_port: turn on port %d power\n", port));
358 /* Wait for stable power. */
359 usbd_delay_ms(dev, pwrdly);
362 /* The usual exploration will finish the setup. */
366 USB_ATTACH_SUCCESS_RETURN;
371 free(devinfo, M_TEMP);
373 USB_ATTACH_ERROR_RETURN;
377 uhub_explore(usbd_device_handle dev)
379 usb_hub_descriptor_t *hd = &dev->hub->hubdesc;
380 struct uhub_softc *sc = dev->hub->hubsoftc;
381 struct usbd_port *up;
387 DPRINTFN(10, ("uhub_explore dev=%p addr=%d\n", dev, dev->address));
390 return (USBD_NOT_STARTED);
392 /* Ignore hubs that are too deep. */
393 if (dev->depth > USB_HUB_MAX_DEPTH)
394 return (USBD_TOO_DEEP);
396 for(port = 1; port <= hd->bNbrPorts; port++) {
397 up = &dev->hub->ports[port-1];
398 err = usbd_get_port_status(dev, port, &up->status);
400 DPRINTF(("uhub_explore: get port status failed, "
401 "error=%s\n", usbd_errstr(err)));
404 status = UGETW(up->status.wPortStatus);
405 change = UGETW(up->status.wPortChange);
406 DPRINTFN(3,("uhub_explore: %s port %d status 0x%04x 0x%04x\n",
407 device_get_nameunit(sc->sc_dev), port, status, change));
408 if (change & UPS_C_PORT_ENABLED) {
409 DPRINTF(("uhub_explore: C_PORT_ENABLED 0x%x\n", change));
410 usbd_clear_port_feature(dev, port, UHF_C_PORT_ENABLE);
411 if (change & UPS_C_CONNECT_STATUS) {
412 /* Ignore the port error if the device
414 } else if (status & UPS_PORT_ENABLED) {
415 printf("%s: illegal enable change, port %d\n",
416 device_get_nameunit(sc->sc_dev), port);
418 /* Port error condition. */
419 if (up->restartcnt) /* no message first time */
420 printf("%s: port error, restarting "
422 device_get_nameunit(sc->sc_dev), port);
424 if (up->restartcnt++ < USBD_RESTART_MAX)
427 printf("%s: port error, giving up "
429 device_get_nameunit(sc->sc_dev), port);
432 if (!(change & UPS_C_CONNECT_STATUS)) {
433 DPRINTFN(3,("uhub_explore: port=%d !C_CONNECT_"
435 /* No status change, just do recursive explore. */
436 if (up->device != NULL && up->device->hub != NULL)
437 up->device->hub->explore(up->device);
438 #if 0 && defined(DIAGNOSTIC)
439 if (up->device == NULL &&
440 (status & UPS_CURRENT_CONNECT_STATUS))
441 printf("%s: connected, no device\n",
442 device_get_nameunit(sc->sc_dev));
447 /* We have a connect status change, handle it. */
449 DPRINTF(("uhub_explore: status change hub=%d port=%d\n",
450 dev->address, port));
451 usbd_clear_port_feature(dev, port, UHF_C_PORT_CONNECTION);
452 /*usbd_clear_port_feature(dev, port, UHF_C_PORT_ENABLE);*/
454 * If there is already a device on the port the change status
455 * must mean that is has disconnected. Looking at the
456 * current connect status is not enough to figure this out
457 * since a new unit may have been connected before we handle
461 if (up->device != NULL) {
463 DPRINTF(("uhub_explore: device addr=%d disappeared "
464 "on port %d\n", up->device->address, port));
465 usb_disconnect_port(up, USBDEV(sc->sc_dev));
466 usbd_clear_port_feature(dev, port,
467 UHF_C_PORT_CONNECTION);
469 if (!(status & UPS_CURRENT_CONNECT_STATUS)) {
470 /* Nothing connected, just ignore it. */
471 DPRINTFN(3,("uhub_explore: port=%d !CURRENT_CONNECT"
478 if (!(status & UPS_PORT_POWER))
479 printf("%s: strange, connected port %d has no power\n",
480 device_get_nameunit(sc->sc_dev), port);
482 /* Wait for maximum device power up time. */
483 usbd_delay_ms(dev, USB_PORT_POWERUP_DELAY);
485 /* Reset port, which implies enabling it. */
486 if (usbd_reset_port(dev, port, &up->status)) {
487 printf("%s: port %d reset failed\n",
488 device_get_nameunit(sc->sc_dev), port);
491 /* Get port status again, it might have changed during reset */
492 err = usbd_get_port_status(dev, port, &up->status);
494 DPRINTF(("uhub_explore: get port status failed, "
495 "error=%s\n", usbd_errstr(err)));
498 status = UGETW(up->status.wPortStatus);
499 change = UGETW(up->status.wPortChange);
500 if (!(status & UPS_CURRENT_CONNECT_STATUS)) {
501 /* Nothing connected, just ignore it. */
503 printf("%s: port %d, device disappeared after reset\n",
504 device_get_nameunit(sc->sc_dev), port);
510 if (UHUB_IS_HIGH_SPEED(sc) && !(status & UPS_HIGH_SPEED)) {
511 printf("%s: port %d, transaction translation not "
512 "implemented, low/full speed device ignored\n",
513 device_get_nameunit(sc->sc_dev), port);
518 /* Figure out device speed */
519 if (status & UPS_HIGH_SPEED)
520 speed = USB_SPEED_HIGH;
521 else if (status & UPS_LOW_SPEED)
522 speed = USB_SPEED_LOW;
524 speed = USB_SPEED_FULL;
525 /* Get device info and set its address. */
526 err = usbd_new_device(USBDEV(sc->sc_dev), dev->bus,
527 dev->depth + 1, speed, port, up);
528 /* XXX retry a few times? */
530 DPRINTFN(-1,("uhub_explore: usb_new_device failed, "
531 "error=%s\n", usbd_errstr(err)));
532 /* Avoid addressing problems by disabling. */
533 /* usbd_reset_port(dev, port, &up->status); */
536 * The unit refused to accept a new address, or had
537 * some other serious problem. Since we cannot leave
538 * at 0 we have to disable the port instead.
540 printf("%s: device problem (%s), disabling port %d\n",
541 device_get_nameunit(sc->sc_dev), usbd_errstr(err), port);
542 usbd_clear_port_feature(dev, port, UHF_PORT_ENABLE);
544 /* The port set up succeeded, reset error count. */
548 up->device->hub->explore(up->device);
551 return (USBD_NORMAL_COMPLETION);
554 #if defined(__NetBSD__) || defined(__OpenBSD__)
556 uhub_activate(device_t self, enum devact act)
558 struct uhub_softc *sc = (struct uhub_softc *)self;
559 struct usbd_hub *hub = sc->sc_hub->hub;
560 usbd_device_handle dev;
567 case DVACT_DEACTIVATE:
568 if (hub == NULL) /* malfunctioning hub */
570 nports = hub->hubdesc.bNbrPorts;
571 for(port = 0; port < nports; port++) {
572 dev = hub->ports[port].device;
573 if (dev != NULL && dev->subdevs != NULL) {
574 for (i = 0; dev->subdevs[i] != NULL; i++)
575 config_deactivate(dev->subdevs[i]);
585 * Called from process context when the hub is gone.
586 * Detach all devices on active ports.
590 USB_DETACH_START(uhub, sc);
591 struct usbd_hub *hub = sc->sc_hub->hub;
592 struct usbd_port *rup;
595 #if defined(__NetBSD__) || defined(__OpenBSD__)
596 DPRINTF(("uhub_detach: sc=%p flags=%d\n", sc, flags));
597 #elif defined(__FreeBSD__)
598 DPRINTF(("uhub_detach: sc=%port\n", sc));
601 if (hub == NULL) /* Must be partially working */
604 usbd_abort_pipe(sc->sc_ipipe);
605 usbd_close_pipe(sc->sc_ipipe);
607 nports = hub->hubdesc.bNbrPorts;
608 for(port = 0; port < nports; port++) {
609 rup = &hub->ports[port];
611 usb_disconnect_port(rup, self);
614 usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_hub,
617 if (hub->ports[0].tt)
618 free(hub->ports[0].tt, M_USBDEV);
620 sc->sc_hub->hub = NULL;
625 #if defined(__FreeBSD__)
627 uhub_child_location_str(device_t cbdev, device_t child, char *buf,
630 struct uhub_softc *sc = device_get_softc(cbdev);
631 usbd_device_handle devhub = sc->sc_hub;
632 usbd_device_handle dev;
638 nports = devhub->hub->hubdesc.bNbrPorts;
639 for (port = 0; port < nports; port++) {
640 dev = devhub->hub->ports[port].device;
641 if (dev && dev->subdevs) {
642 for (i = 0; dev->subdevs[i]; i++) {
643 if (dev->subdevs[i] == child) {
644 if (dev->ifacenums == NULL) {
645 snprintf(buf, buflen,
648 snprintf(buf, buflen,
649 "port=%i interface=%i",
650 port, dev->ifacenums[i]);
657 DPRINTFN(0,("uhub_child_location_str: device not on hub\n"));
665 uhub_child_pnpinfo_str(device_t cbdev, device_t child, char *buf,
668 struct uhub_softc *sc = device_get_softc(cbdev);
669 usbd_device_handle devhub = sc->sc_hub;
670 usbd_device_handle dev;
671 struct usbd_interface *iface;
678 nports = devhub->hub->hubdesc.bNbrPorts;
679 for (port = 0; port < nports; port++) {
680 dev = devhub->hub->ports[port].device;
681 if (dev && dev->subdevs) {
682 for (i = 0; dev->subdevs[i]; i++) {
683 if (dev->subdevs[i] == child) {
689 DPRINTFN(0,("uhub_child_pnpinfo_str: device not on hub\n"));
696 (void)usbd_get_string(dev, dev->ddesc.iSerialNumber, &serial[0]);
697 if (dev->ifacenums == NULL) {
698 snprintf(buf, buflen, "vendor=0x%04x product=0x%04x "
699 "devclass=0x%02x devsubclass=0x%02x "
700 "release=0x%04x sernum=\"%s\"",
701 UGETW(dev->ddesc.idVendor), UGETW(dev->ddesc.idProduct),
702 dev->ddesc.bDeviceClass, dev->ddesc.bDeviceSubClass,
703 UGETW(dev->ddesc.bcdDevice), serial);
705 iface = &dev->ifaces[dev->ifacenums[i]];
706 snprintf(buf, buflen, "vendor=0x%04x product=0x%04x "
707 "devclass=0x%02x devsubclass=0x%02x "
708 "release=0x%04x sernum=\"%s\" "
709 "intclass=0x%02x intsubclass=0x%02x",
710 UGETW(dev->ddesc.idVendor), UGETW(dev->ddesc.idProduct),
711 dev->ddesc.bDeviceClass, dev->ddesc.bDeviceSubClass,
712 UGETW(dev->ddesc.bcdDevice), serial,
713 iface->idesc->bInterfaceClass,
714 iface->idesc->bInterfaceSubClass);
724 * This an indication that some port has changed status.
725 * Notify the bus event handler thread that we need
726 * to be explored again.
729 uhub_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
731 struct uhub_softc *sc = addr;
733 DPRINTFN(5,("uhub_intr: sc=%p\n", sc));
734 if (status == USBD_STALLED)
735 usbd_clear_endpoint_stall_async(sc->sc_ipipe);
736 else if (status == USBD_NORMAL_COMPLETION)
737 usb_needs_explore(sc->sc_hub);
740 #if defined(__FreeBSD__)
741 DRIVER_MODULE(uhub, usb, uhubroot_driver, uhubroot_devclass, 0, 0);
742 DRIVER_MODULE(uhub, uhub, uhub_driver, uhub_devclass, usbd_driver_load, 0);