summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/usb/if_aue.c16
-rw-r--r--sys/dev/usb/if_auereg.h1
2 files changed, 14 insertions, 3 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c
index 44614d5bc1d1..ca5e51754470 100644
--- a/sys/dev/usb/if_aue.c
+++ b/sys/dev/usb/if_aue.c
@@ -618,7 +618,7 @@ USB_MATCH(aue)
USB_MATCH_START(aue, uaa);
struct aue_type *t;
- if (uaa->iface == NULL)
+ if (uaa->iface != NULL)
return (UMATCH_NONE);
t = aue_devs;
@@ -643,6 +643,8 @@ USB_ATTACH(aue)
char devinfo[1024];
u_char eaddr[ETHER_ADDR_LEN];
struct ifnet *ifp;
+ usbd_interface_handle iface;
+ usbd_status err;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
int i;
@@ -652,7 +654,6 @@ USB_ATTACH(aue)
usbd_devinfo(uaa->device, 0, devinfo);
- sc->aue_iface = uaa->iface;
sc->aue_udev = uaa->device;
sc->aue_unit = device_get_unit(self);
@@ -662,6 +663,15 @@ USB_ATTACH(aue)
USB_ATTACH_ERROR_RETURN;
}
+ err = usbd_device2interface_handle(uaa->device, AUE_IFACE_IDX, &iface);
+ if (err) {
+ printf("aue%d: getting interface handle failed\n",
+ sc->aue_unit);
+ USB_ATTACH_ERROR_RETURN;
+ }
+
+ sc->aue_iface = iface;
+
t = aue_devs;
while(t->aue_vid) {
if (uaa->vendor == t->aue_vid &&
@@ -680,7 +690,7 @@ USB_ATTACH(aue)
/* Find endpoints. */
for (i = 0; i < id->bNumEndpoints; i++) {
- ed = usbd_interface2endpoint_descriptor(uaa->iface, i);
+ ed = usbd_interface2endpoint_descriptor(iface, i);
if (ed == NULL) {
printf("aue%d: couldn't get ep %d\n",
sc->aue_unit, i);
diff --git a/sys/dev/usb/if_auereg.h b/sys/dev/usb/if_auereg.h
index 59914ec33cd9..4c45285f9a2a 100644
--- a/sys/dev/usb/if_auereg.h
+++ b/sys/dev/usb/if_auereg.h
@@ -50,6 +50,7 @@
#define AUE_UR_WRITEREG 0xF1
#define AUE_CONFIG_NO 1
+#define AUE_IFACE_IDX 0
/*
* Note that while the ADMtek technically has four