diff options
Diffstat (limited to 'sys/dev/usb/if_axen.c')
-rw-r--r-- | sys/dev/usb/if_axen.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/sys/dev/usb/if_axen.c b/sys/dev/usb/if_axen.c index 92c9a38bcdf..6d7e9c65c83 100644 --- a/sys/dev/usb/if_axen.c +++ b/sys/dev/usb/if_axen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axen.c,v 1.12 2015/03/20 11:58:04 mpi Exp $ */ +/* $OpenBSD: if_axen.c,v 1.13 2015/06/12 15:47:31 mpi Exp $ */ /* * Copyright (c) 2013 Yojiro UO <yuo@openbsd.org> @@ -641,11 +641,11 @@ axen_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 (axen_lookup(uaa->vendor, uaa->product) != NULL ? - UMATCH_VENDOR_PRODUCT : UMATCH_NONE); + UMATCH_VENDOR_PRODUCT_CONF_IFACE : UMATCH_NONE); } void @@ -653,8 +653,6 @@ axen_attach(struct device *parent, struct device *self, void *aux) { struct axen_softc *sc = (struct axen_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; @@ -664,15 +662,8 @@ axen_attach(struct device *parent, struct device *self, void *aux) int i, s; sc->axen_unit = self->dv_unit; /*device_get_unit(self);*/ - sc->axen_udev = dev; - - err = usbd_set_config_no(dev, AXEN_CONFIG_NO, 1); - if (err) { - printf("%s: getting interface handle failed\n", - sc->axen_dev.dv_xname); - return; - } - + sc->axen_udev = uaa->device; + sc->axen_iface = uaa->iface; sc->axen_flags = axen_lookup(uaa->vendor, uaa->product)->axen_flags; usb_init_task(&sc->axen_tick_task, axen_tick_task, sc, @@ -681,14 +672,6 @@ axen_attach(struct device *parent, struct device *self, void *aux) usb_init_task(&sc->axen_stop_task, (void (*)(void *))axen_stop, sc, USB_TASK_TYPE_GENERIC); - err = usbd_device2interface_handle(dev, AXEN_IFACE_IDX, - &sc->axen_iface); - if (err) { - printf("%s: getting interface handle failed\n", - sc->axen_dev.dv_xname); - return; - } - sc->axen_product = uaa->product; sc->axen_vendor = uaa->vendor; |