summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authordrochner <drochner@NetBSD.org>2008-06-06 17:52:02 +0000
committerdrochner <drochner@NetBSD.org>2008-06-06 17:52:02 +0000
commitad077b5aaa0352908b22be3fd1d818e841e3d0b2 (patch)
treef760355ebf723d17339a598d7055cf18dd7c6207 /sys/dev
parentb9a1c75c4b26741eb89de16d8ab78c6211d114b5 (diff)
oops, forgot to pass locators when I simplified the autoconf code
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/usb_subr.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index 44a8c2ef872..e5d79b2383b 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_subr.c,v 1.157 2008/05/27 20:46:16 drochner Exp $ */
+/* $NetBSD: usb_subr.c,v 1.158 2008/06/06 17:52:02 drochner 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.157 2008/05/27 20:46:16 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.158 2008/06/06 17:52:02 drochner Exp $");
#include "opt_compat_netbsd.h"
#include "opt_usbverbose.h"
@@ -55,6 +55,8 @@ __KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.157 2008/05/27 20:46:16 drochner Exp
#include <dev/usb/usbdevs.h>
#include <dev/usb/usb_quirks.h>
+#include "locators.h"
+
#ifdef USB_DEBUG
#define DPRINTF(x) if (usbdebug) logprintf x
#define DPRINTFN(n,x) if (usbdebug>(n)) logprintf x
@@ -802,6 +804,8 @@ usbd_probe_and_attach(device_ptr_t parent, usbd_device_handle dev,
usbd_status err;
device_ptr_t dv;
usbd_interface_handle *ifaces;
+ int dlocs[USBDEVIFCF_NLOCS];
+ int ilocs[USBIFIFCF_NLOCS];
uaa.device = dev;
uaa.usegeneric = 0;
@@ -813,9 +817,17 @@ usbd_probe_and_attach(device_ptr_t parent, usbd_device_handle dev,
uaa.subclass = dd->bDeviceSubClass;
uaa.proto = dd->bDeviceProtocol;
+ dlocs[USBDEVIFCF_PORT] = uaa.port;
+ dlocs[USBDEVIFCF_VENDOR] = uaa.vendor;
+ dlocs[USBDEVIFCF_PRODUCT] = uaa.product;
+ dlocs[USBDEVIFCF_RELEASE] = uaa.release;
+ /* the rest is historical ballast */
+ dlocs[USBDEVIFCF_CONFIGURATION] = -1;
+ dlocs[USBDEVIFCF_INTERFACE] = -1;
+
/* First try with device specific drivers. */
DPRINTF(("usbd_probe_and_attach: trying device specific drivers\n"));
- dv = config_found_sm_loc(parent, "usbdevif", NULL, &uaa, usbd_print,
+ dv = config_found_sm_loc(parent, "usbdevif", dlocs, &uaa, usbd_print,
config_stdsubmatch);
if (dv) {
dev->subdevs = malloc(sizeof dv, M_USB, M_NOWAIT);
@@ -834,6 +846,11 @@ usbd_probe_and_attach(device_ptr_t parent, usbd_device_handle dev,
uiaa.product = UGETW(dd->idProduct);
uiaa.release = UGETW(dd->bcdDevice);
+ ilocs[USBIFIFCF_PORT] = uiaa.port;
+ ilocs[USBIFIFCF_VENDOR] = uiaa.vendor;
+ ilocs[USBIFIFCF_PRODUCT] = uiaa.product;
+ ilocs[USBIFIFCF_RELEASE] = uiaa.release;
+
DPRINTF(("usbd_probe_and_attach: looping over %d configurations\n",
dd->bNumConfigurations));
/* Next try with interface drivers. */
@@ -854,6 +871,8 @@ usbd_probe_and_attach(device_ptr_t parent, usbd_device_handle dev,
}
nifaces = dev->cdesc->bNumInterface;
uiaa.configno = dev->cdesc->bConfigurationValue;
+ ilocs[USBIFIFCF_CONFIGURATION] = uiaa.configno;
+
ifaces = malloc(nifaces * sizeof(*ifaces), M_USB, M_NOWAIT);
if (ifaces == NULL)
goto nomem;
@@ -879,7 +898,8 @@ nomem:
uiaa.subclass = ifaces[i]->idesc->bInterfaceSubClass;
uiaa.proto = ifaces[i]->idesc->bInterfaceProtocol;
uiaa.ifaceno = ifaces[i]->idesc->bInterfaceNumber;
- dv = config_found_sm_loc(parent, "usbifif", NULL, &uiaa,
+ ilocs[USBIFIFCF_INTERFACE] = uiaa.ifaceno;
+ dv = config_found_sm_loc(parent, "usbifif", ilocs, &uiaa,
usbd_ifprint, config_stdsubmatch);
if (dv != NULL) {
found++;
@@ -905,7 +925,7 @@ nomem:
/* Finally try the generic driver. */
uaa.usegeneric = 1;
- dv = config_found_sm_loc(parent, "usbdevif", NULL, &uaa, usbd_print,
+ dv = config_found_sm_loc(parent, "usbdevif", dlocs, &uaa, usbd_print,
config_stdsubmatch);
if (dv != NULL) {
dev->subdevs = malloc(sizeof dv, M_USB, M_NOWAIT);