-/* $OpenBSD: if_udav.c,v 1.70 2015/03/23 08:41:52 mpi Exp $ */
+/* $OpenBSD: if_udav.c,v 1.71 2015/06/19 20:39:34 uaa Exp $ */
/* $NetBSD: if_udav.c,v 1.3 2004/04/23 17:25:25 itojun Exp $ */
/* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */
/*
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != 1)
return (UMATCH_NONE);
return (udav_lookup(uaa->vendor, uaa->product) != NULL ?
- UMATCH_VENDOR_PRODUCT : UMATCH_NONE);
+ UMATCH_VENDOR_PRODUCT_CONF_IFACE : UMATCH_NONE);
}
/* Attach */
struct udav_softc *sc = (struct udav_softc *)self;
struct usb_attach_arg *uaa = aux;
struct usbd_device *dev = uaa->device;
- struct usbd_interface *iface;
+ struct usbd_interface *iface = uaa->iface;
usbd_status err;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
sc->sc_udev = dev;
- /* Move the device into the configured state. */
- err = usbd_set_config_no(dev, UDAV_CONFIG_NO, 1);
- if (err) {
- printf("setting config no failed\n");
- goto bad;
- }
-
usb_init_task(&sc->sc_tick_task, udav_tick_task, sc,
USB_TASK_TYPE_GENERIC);
rw_init(&sc->sc_mii_lock, "udavmii");
usb_init_task(&sc->sc_stop_task, (void (*)(void *)) udav_stop_task, sc,
USB_TASK_TYPE_GENERIC);
- /* get control interface */
- err = usbd_device2interface_handle(dev, UDAV_IFACE_INDEX, &iface);
- if (err) {
- printf("failed to get interface, err=%s\n", usbd_errstr(err));
- goto bad;
- }
-
sc->sc_ctl_iface = iface;
sc->sc_flags = udav_lookup(uaa->vendor, uaa->product)->udav_flags;
-/* $OpenBSD: if_udavreg.h,v 1.14 2014/01/22 04:13:22 sasano Exp $ */
+/* $OpenBSD: if_udavreg.h,v 1.15 2015/06/19 20:39:34 uaa Exp $ */
/* $NetBSD: if_udavreg.h,v 1.2 2003/09/04 15:17:39 tsutsui Exp $ */
/* $nabe: if_udavreg.h,v 1.2 2003/08/21 16:26:40 nabe Exp $ */
/*
*
*/
-#define UDAV_IFACE_INDEX 0
-#define UDAV_CONFIG_NO 1
-
#define UDAV_TX_LIST_CNT 1
#define UDAV_RX_LIST_CNT 1