Module Name: src Committed By: skrll Date: Sun Apr 5 09:12:06 UTC 2015
Modified Files: src/sys/dev/usb: usb_subr.c Log Message: More debug. To generate a diff of this commit: cvs rdiff -u -r1.199 -r1.200 src/sys/dev/usb/usb_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/usb/usb_subr.c diff -u src/sys/dev/usb/usb_subr.c:1.199 src/sys/dev/usb/usb_subr.c:1.200 --- src/sys/dev/usb/usb_subr.c:1.199 Fri Mar 27 07:28:56 2015 +++ src/sys/dev/usb/usb_subr.c Sun Apr 5 09:12:06 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: usb_subr.c,v 1.199 2015/03/27 07:28:56 skrll Exp $ */ +/* $NetBSD: usb_subr.c,v 1.200 2015/04/05 09:12:06 skrll Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */ /* @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.199 2015/03/27 07:28:56 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.200 2015/04/05 09:12:06 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -847,9 +847,12 @@ usbd_attachinterfaces(device_t parent, u ifaces = malloc(nifaces * sizeof(*ifaces), M_USB, M_NOWAIT|M_ZERO); if (!ifaces) return (USBD_NOMEM); - for (i = 0; i < nifaces; i++) - if (!dev->subdevs[i]) + for (i = 0; i < nifaces; i++) { + if (!dev->subdevs[i]) { ifaces[i] = &dev->ifaces[i]; + } + DPRINTF(("%s: interface %d %p\n", __func__, i, ifaces[i])); + } uiaa.device = dev; uiaa.port = port; @@ -866,13 +869,19 @@ usbd_attachinterfaces(device_t parent, u ilocs[USBIFIFCF_CONFIGURATION] = uiaa.configno; for (i = 0; i < nifaces; i++) { - if (!ifaces[i]) + if (!ifaces[i]) { + DPRINTF(("%s: interface %d claimed\n", __func__, i)); continue; /* interface already claimed */ + } uiaa.iface = ifaces[i]; uiaa.class = ifaces[i]->idesc->bInterfaceClass; uiaa.subclass = ifaces[i]->idesc->bInterfaceSubClass; uiaa.proto = ifaces[i]->idesc->bInterfaceProtocol; uiaa.ifaceno = ifaces[i]->idesc->bInterfaceNumber; + + DPRINTF(("%s: searching for interface %d " + "class %x subclass %x proto %x ifaceno %d\n", __func__, i, + uiaa.class, uiaa.subclass, uiaa.proto, uiaa.ifaceno)); ilocs[USBIFIFCF_INTERFACE] = uiaa.ifaceno; if (locators != NULL) { loc = locators[USBIFIFCF_CONFIGURATION]; @@ -891,6 +900,8 @@ usbd_attachinterfaces(device_t parent, u /* account for ifaces claimed by the driver behind our back */ for (j = 0; j < nifaces; j++) { if (!ifaces[j] && !dev->subdevs[j]) { + DPRINTF(("%s: interface %d claimed " + "behind our back", __func__, j)); dev->subdevs[j] = dv; dev->nifaces_claimed++; }