diff options
Diffstat (limited to 'sys/dev/usb/if_axe.c')
-rw-r--r-- | sys/dev/usb/if_axe.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index f1c683af957..3d37736ebd6 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axe.c,v 1.130 2015/05/17 02:44:38 canacar Exp $ */ +/* $OpenBSD: if_axe.c,v 1.131 2015/06/12 15:47:31 mpi Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg@openbsd.org> @@ -671,11 +671,11 @@ axe_match(struct device *parent, void *match, void *aux) { struct usb_attach_arg *uaa = aux; - if (!uaa->iface) - return(UMATCH_NONE); + if (uaa->iface == NULL || uaa->configno != 1) + return (UMATCH_NONE); return (axe_lookup(uaa->vendor, uaa->product) != NULL ? - UMATCH_VENDOR_PRODUCT : UMATCH_NONE); + UMATCH_VENDOR_PRODUCT_CONF_IFACE : UMATCH_NONE); } /* @@ -687,8 +687,6 @@ axe_attach(struct device *parent, struct device *self, void *aux) { struct axe_softc *sc = (struct axe_softc *)self; struct usb_attach_arg *uaa = aux; - struct usbd_device *dev = uaa->device; - usbd_status err; usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; struct mii_data *mii; @@ -698,15 +696,8 @@ axe_attach(struct device *parent, struct device *self, void *aux) int i, s; sc->axe_unit = self->dv_unit; /*device_get_unit(self);*/ - sc->axe_udev = dev; - - err = usbd_set_config_no(dev, AXE_CONFIG_NO, 1); - if (err) { - printf("%s: getting interface handle failed\n", - sc->axe_dev.dv_xname); - return; - } - + sc->axe_udev = uaa->device; + sc->axe_iface = uaa->iface; sc->axe_flags = axe_lookup(uaa->vendor, uaa->product)->axe_flags; usb_init_task(&sc->axe_tick_task, axe_tick_task, sc, @@ -715,13 +706,6 @@ axe_attach(struct device *parent, struct device *self, void *aux) usb_init_task(&sc->axe_stop_task, (void (*)(void *))axe_stop, sc, USB_TASK_TYPE_GENERIC); - err = usbd_device2interface_handle(dev, AXE_IFACE_IDX, &sc->axe_iface); - if (err) { - printf("%s: getting interface handle failed\n", - sc->axe_dev.dv_xname); - return; - } - sc->axe_product = uaa->product; sc->axe_vendor = uaa->vendor; |