summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/usb/if_atu.c11
-rw-r--r--sys/dev/usb/if_cue.c12
-rw-r--r--sys/dev/usb/if_mos.c11
-rw-r--r--sys/dev/usb/if_otus.c10
-rw-r--r--sys/dev/usb/if_ral.c10
-rw-r--r--sys/dev/usb/if_uath.c10
-rw-r--r--sys/dev/usb/if_upgt.c11
-rw-r--r--sys/dev/usb/if_upl.c11
-rw-r--r--sys/dev/usb/if_url.c11
-rw-r--r--sys/dev/usb/uberry.c15
-rw-r--r--sys/dev/usb/udl.c10
-rw-r--r--sys/dev/usb/udsbr.c17
-rw-r--r--sys/dev/usb/uipaq.c12
-rw-r--r--sys/dev/usb/uow.c13
-rw-r--r--sys/dev/usb/usps.c12
15 files changed, 30 insertions, 146 deletions
diff --git a/sys/dev/usb/if_atu.c b/sys/dev/usb/if_atu.c
index 1187191efbe..b54ddc945de 100644
--- a/sys/dev/usb/if_atu.c
+++ b/sys/dev/usb/if_atu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atu.c,v 1.119 2016/04/13 11:03:37 mpi Exp $ */
+/* $OpenBSD: if_atu.c,v 1.120 2016/11/06 12:58:01 mpi Exp $ */
/*
* Copyright (c) 2003, 2004
* Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved.
@@ -1102,7 +1102,7 @@ atu_match(struct device *parent, void *match, void *aux)
struct usb_attach_arg *uaa = aux;
int i;
- if (!uaa->iface)
+ if (uaa->iface == NULL || uaa->configno != ATU_CONFIG_NO)
return(UMATCH_NONE);
for (i = 0; i < nitems(atu_devs); i++) {
@@ -1253,13 +1253,6 @@ atu_attach(struct device *parent, struct device *self, void *aux)
sc->atu_unit = self->dv_unit;
sc->atu_udev = dev;
- err = usbd_set_config_no(dev, ATU_CONFIG_NO, 1);
- if (err) {
- printf("%s: setting config no failed\n",
- sc->atu_dev.dv_xname);
- goto fail;
- }
-
err = usbd_device2interface_handle(dev, ATU_IFACE_IDX, &sc->atu_iface);
if (err) {
printf("%s: getting interface handle failed\n",
diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c
index e0a1d0fa74a..c5c2df36e12 100644
--- a/sys/dev/usb/if_cue.c
+++ b/sys/dev/usb/if_cue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cue.c,v 1.75 2016/04/13 11:03:37 mpi Exp $ */
+/* $OpenBSD: if_cue.c,v 1.76 2016/11/06 12:58:01 mpi Exp $ */
/* $NetBSD: if_cue.c,v 1.40 2002/07/11 21:14:26 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -415,7 +415,7 @@ cue_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != CUE_CONFIG_NO)
return (UMATCH_NONE);
return (usb_lookup(cue_devs, uaa->vendor, uaa->product) != NULL ?
@@ -444,14 +444,6 @@ cue_attach(struct device *parent, struct device *self, void *aux)
DPRINTFN(5,(" : cue_attach: sc=%p, dev=%p", sc, dev));
sc->cue_udev = dev;
-
- err = usbd_set_config_no(dev, CUE_CONFIG_NO, 1);
- if (err) {
- printf("%s: setting config no failed\n",
- sc->cue_dev.dv_xname);
- return;
- }
-
sc->cue_product = uaa->product;
sc->cue_vendor = uaa->vendor;
diff --git a/sys/dev/usb/if_mos.c b/sys/dev/usb/if_mos.c
index 0b015b72979..e8f12c5320a 100644
--- a/sys/dev/usb/if_mos.c
+++ b/sys/dev/usb/if_mos.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mos.c,v 1.36 2016/04/13 11:03:37 mpi Exp $ */
+/* $OpenBSD: if_mos.c,v 1.37 2016/11/06 12:58:01 mpi Exp $ */
/*
* Copyright (c) 2008 Johann Christian Rode <jcrode@gmx.net>
@@ -607,7 +607,7 @@ mos_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (!uaa->iface)
+ if (uaa->iface == NULL || uaa->configno != MOS_CONFIG_NO)
return(UMATCH_NONE);
return (mos_lookup(uaa->vendor, uaa->product) != NULL ?
@@ -635,13 +635,6 @@ mos_attach(struct device *parent, struct device *self, void *aux)
sc->mos_udev = dev;
sc->mos_unit = self->dv_unit;
- err = usbd_set_config_no(dev, MOS_CONFIG_NO, 1);
- if (err) {
- printf("%s: getting interface handle failed\n",
- sc->mos_dev.dv_xname);
- return;
- }
-
usb_init_task(&sc->mos_tick_task, mos_tick_task, sc,
USB_TASK_TYPE_GENERIC);
rw_init(&sc->mos_mii_lock, "mosmii");
diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c
index 86e24086d4c..5b37a1ccb53 100644
--- a/sys/dev/usb/if_otus.c
+++ b/sys/dev/usb/if_otus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_otus.c,v 1.53 2016/04/13 11:03:37 mpi Exp $ */
+/* $OpenBSD: if_otus.c,v 1.54 2016/11/06 12:58:01 mpi Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -176,7 +176,7 @@ otus_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != 1)
return UMATCH_NONE;
return (usb_lookup(otus_devs, uaa->vendor, uaa->product) != NULL) ?
@@ -199,12 +199,6 @@ otus_attach(struct device *parent, struct device *self, void *aux)
sc->amrr.amrr_min_success_threshold = 1;
sc->amrr.amrr_max_success_threshold = 10;
- if (usbd_set_config_no(sc->sc_udev, 1, 0) != 0) {
- printf("%s: could not set configuration no\n",
- sc->sc_dev.dv_xname);
- return;
- }
-
/* Get the first interface handle. */
error = usbd_device2interface_handle(sc->sc_udev, 0, &sc->sc_iface);
if (error != 0) {
diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c
index a649865c836..e6aebc9d627 100644
--- a/sys/dev/usb/if_ral.c
+++ b/sys/dev/usb/if_ral.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ral.c,v 1.140 2016/07/20 10:24:43 stsp Exp $ */
+/* $OpenBSD: if_ral.c,v 1.141 2016/11/06 12:58:01 mpi Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -196,7 +196,7 @@ ural_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != RAL_CONFIG_NO)
return UMATCH_NONE;
return (usb_lookup(ural_devs, uaa->vendor, uaa->product) != NULL) ?
@@ -217,12 +217,6 @@ ural_attach(struct device *parent, struct device *self, void *aux)
sc->sc_udev = uaa->device;
- if (usbd_set_config_no(sc->sc_udev, RAL_CONFIG_NO, 0) != 0) {
- printf("%s: could not set configuration no\n",
- sc->sc_dev.dv_xname);
- return;
- }
-
/* get the first interface handle */
error = usbd_device2interface_handle(sc->sc_udev, RAL_IFACE_INDEX,
&sc->sc_iface);
diff --git a/sys/dev/usb/if_uath.c b/sys/dev/usb/if_uath.c
index 3fb3abe3c17..3d0d95465f3 100644
--- a/sys/dev/usb/if_uath.c
+++ b/sys/dev/usb/if_uath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_uath.c,v 1.77 2016/04/13 11:03:37 mpi Exp $ */
+/* $OpenBSD: if_uath.c,v 1.78 2016/11/06 12:58:01 mpi Exp $ */
/*-
* Copyright (c) 2006
@@ -191,7 +191,7 @@ uath_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != UATH_CONFIG_NO)
return UMATCH_NONE;
return (uath_lookup(uaa->vendor, uaa->product) != NULL) ?
@@ -245,12 +245,6 @@ uath_attach(struct device *parent, struct device *self, void *aux)
sc->sc_flags = uath_lookup(uaa->vendor, uaa->product)->flags;
- if (usbd_set_config_no(sc->sc_udev, UATH_CONFIG_NO, 0) != 0) {
- printf("%s: could not set configuration no\n",
- sc->sc_dev.dv_xname);
- return;
- }
-
/* get the first interface handle */
error = usbd_device2interface_handle(sc->sc_udev, UATH_IFACE_INDEX,
&sc->sc_iface);
diff --git a/sys/dev/usb/if_upgt.c b/sys/dev/usb/if_upgt.c
index 705f1149a2d..61a699c36ef 100644
--- a/sys/dev/usb/if_upgt.c
+++ b/sys/dev/usb/if_upgt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_upgt.c,v 1.77 2016/04/13 11:03:37 mpi Exp $ */
+/* $OpenBSD: if_upgt.c,v 1.78 2016/11/06 12:58:01 mpi Exp $ */
/*
* Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
@@ -180,7 +180,7 @@ upgt_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != UPGT_CONFIG_NO)
return (UMATCH_NONE);
if (usb_lookup(upgt_devs_1, uaa->vendor, uaa->product) != NULL)
@@ -211,13 +211,6 @@ upgt_attach(struct device *parent, struct device *self, void *aux)
if (upgt_device_type(sc, uaa->vendor, uaa->product) != 0)
return;
- /* set configuration number */
- if (usbd_set_config_no(sc->sc_udev, UPGT_CONFIG_NO, 0) != 0) {
- printf("%s: could not set configuration no!\n",
- sc->sc_dev.dv_xname);
- return;
- }
-
/* get the first interface handle */
error = usbd_device2interface_handle(sc->sc_udev, UPGT_IFACE_INDEX,
&sc->sc_iface);
diff --git a/sys/dev/usb/if_upl.c b/sys/dev/usb/if_upl.c
index 8a8e113a93a..f9cf9d529af 100644
--- a/sys/dev/usb/if_upl.c
+++ b/sys/dev/usb/if_upl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_upl.c,v 1.71 2016/04/13 11:03:37 mpi Exp $ */
+/* $OpenBSD: if_upl.c,v 1.72 2016/11/06 12:58:01 mpi Exp $ */
/* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -187,7 +187,7 @@ upl_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != UPL_CONFIG_NO)
return (UMATCH_NONE);
return (usb_lookup(upl_devs, uaa->vendor, uaa->product) != NULL ?
@@ -210,13 +210,6 @@ upl_attach(struct device *parent, struct device *self, void *aux)
DPRINTFN(5,(" : upl_attach: sc=%p, dev=%p", sc, dev));
- err = usbd_set_config_no(dev, UPL_CONFIG_NO, 1);
- if (err) {
- printf("%s: setting config no failed\n",
- sc->sc_dev.dv_xname);
- return;
- }
-
sc->sc_udev = dev;
err = usbd_device2interface_handle(dev, UPL_IFACE_IDX, &iface);
diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c
index 31fe48286a3..13478c8b544 100644
--- a/sys/dev/usb/if_url.c
+++ b/sys/dev/usb/if_url.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_url.c,v 1.80 2016/04/13 11:03:37 mpi Exp $ */
+/* $OpenBSD: if_url.c,v 1.81 2016/11/06 12:58:01 mpi Exp $ */
/* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */
/*
* Copyright (c) 2001, 2002
@@ -163,7 +163,7 @@ url_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != URL_CONFIG_NO)
return (UMATCH_NONE);
return (url_lookup(uaa->vendor, uaa->product) != NULL ?
@@ -188,13 +188,6 @@ url_attach(struct device *parent, struct device *self, void *aux)
sc->sc_udev = dev;
- /* Move the device into the configured state. */
- err = usbd_set_config_no(dev, URL_CONFIG_NO, 1);
- if (err) {
- printf("%s: setting config no failed\n", devname);
- goto bad;
- }
-
usb_init_task(&sc->sc_tick_task, url_tick_task, sc,
USB_TASK_TYPE_GENERIC);
rw_init(&sc->sc_mii_lock, "urlmii");
diff --git a/sys/dev/usb/uberry.c b/sys/dev/usb/uberry.c
index a2ec6bfba1e..f3d2248b130 100644
--- a/sys/dev/usb/uberry.c
+++ b/sys/dev/usb/uberry.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uberry.c,v 1.23 2014/12/19 22:44:59 guenther Exp $ */
+/* $OpenBSD: uberry.c,v 1.24 2016/11/06 12:58:01 mpi Exp $ */
/*-
* Copyright (c) 2006 Theo de Raadt <deraadt@openbsd.org>
@@ -74,7 +74,7 @@ uberry_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != UBERRY_CONFIG_NO)
return UMATCH_NONE;
return (usb_lookup(uberry_devices, uaa->vendor, uaa->product) != NULL) ?
@@ -92,17 +92,6 @@ uberry_attach(struct device *parent, struct device *self, void *aux)
dd = usbd_get_device_descriptor(uaa->device);
- /* Enable configuration, to keep it connected... */
- if (usbd_set_config_no(sc->sc_udev, UBERRY_CONFIG_NO, 1) != 0) {
- /*
- * Really ancient (ie. 7250) devices when off will
- * only charge at 100mA when turned off.
- */
- printf("%s: Charging at %dmA\n", sc->sc_dev.dv_xname,
- sc->sc_udev->power);
- return;
- }
-
printf("%s: Charging at %dmA", sc->sc_dev.dv_xname,
sc->sc_udev->power);
if (sc->sc_udev->power >= 250)
diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c
index b353aa27304..b0709ca84e8 100644
--- a/sys/dev/usb/udl.c
+++ b/sys/dev/usb/udl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udl.c,v 1.84 2015/12/11 16:07:02 mpi Exp $ */
+/* $OpenBSD: udl.c,v 1.85 2016/11/06 12:58:01 mpi Exp $ */
/*
* Copyright (c) 2009 Marcus Glocker <mglocker@openbsd.org>
@@ -258,7 +258,7 @@ udl_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != 1)
return (UMATCH_NONE);
if (udl_lookup(uaa->vendor, uaa->product) != NULL)
@@ -303,12 +303,6 @@ udl_attach(struct device *parent, struct device *self, void *aux)
if (udl_select_chip(sc))
return;
- /*
- * Set device configuration descriptor number.
- */
- error = usbd_set_config_no(sc->sc_udev, 1, 0);
- if (error != USBD_NORMAL_COMPLETION)
- return;
/*
* Create device handle to interface descriptor.
diff --git a/sys/dev/usb/udsbr.c b/sys/dev/usb/udsbr.c
index 4b3628b8422..1ba3d96d2e7 100644
--- a/sys/dev/usb/udsbr.c
+++ b/sys/dev/usb/udsbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udsbr.c,v 1.26 2015/03/14 03:38:49 jsg Exp $ */
+/* $OpenBSD: udsbr.c,v 1.27 2016/11/06 12:58:01 mpi Exp $ */
/* $NetBSD: udsbr.c,v 1.7 2002/07/11 21:14:27 augustss Exp $ */
/*
@@ -114,7 +114,7 @@ udsbr_match(struct device *parent, void *match, void *aux)
DPRINTFN(50,("udsbr_match\n"));
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != UDSBR_CONFIG_NO)
return (UMATCH_NONE);
if (uaa->vendor != USB_VENDOR_CYPRESS ||
@@ -129,21 +129,8 @@ udsbr_attach(struct device *parent, struct device *self, void *aux)
struct udsbr_softc *sc = (struct udsbr_softc *)self;
struct usb_attach_arg *uaa = aux;
struct usbd_device *dev = uaa->device;
- usbd_status err;
-
- DPRINTFN(10,("udsbr_attach: sc=%p\n", sc));
-
- err = usbd_set_config_no(dev, UDSBR_CONFIG_NO, 1);
- if (err) {
- printf("%s: setting config no failed\n",
- sc->sc_dev.dv_xname);
- return;
- }
sc->sc_udev = dev;
-
- DPRINTFN(10, ("udsbr_attach: %p\n", sc->sc_udev));
-
sc->sc_child = radio_attach_mi(&udsbr_hw_if, sc, &sc->sc_dev);
}
diff --git a/sys/dev/usb/uipaq.c b/sys/dev/usb/uipaq.c
index f1139f9a7b8..d52f15c6e64 100644
--- a/sys/dev/usb/uipaq.c
+++ b/sys/dev/usb/uipaq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipaq.c,v 1.25 2015/03/14 03:38:50 jsg Exp $ */
+/* $OpenBSD: uipaq.c,v 1.26 2016/11/06 12:58:01 mpi Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -139,7 +139,7 @@ uipaq_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != UIPAQ_CONFIG_NO)
return (UMATCH_NONE);
DPRINTFN(20,("uipaq: vendor=0x%x, product=0x%x\n",
@@ -165,14 +165,6 @@ uipaq_attach(struct device *parent, struct device *self, void *aux)
DPRINTFN(10,("\nuipaq_attach: sc=%p\n", sc));
- /* Move the device into the configured state. */
- err = usbd_set_config_no(dev, UIPAQ_CONFIG_NO, 1);
- if (err) {
- printf(": failed to set configuration, err=%s\n",
- usbd_errstr(err));
- goto bad;
- }
-
err = usbd_device2interface_handle(dev, UIPAQ_IFACE_INDEX, &iface);
if (err) {
printf(": failed to get interface, err=%s\n",
diff --git a/sys/dev/usb/uow.c b/sys/dev/usb/uow.c
index 13231a4c8ec..193ea59c85b 100644
--- a/sys/dev/usb/uow.c
+++ b/sys/dev/usb/uow.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uow.c,v 1.34 2015/08/31 07:32:15 mpi Exp $ */
+/* $OpenBSD: uow.c,v 1.35 2016/11/06 12:58:01 mpi Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -100,7 +100,7 @@ uow_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != DS2490_USB_CONFIG)
return (UMATCH_NONE);
return ((usb_lookup(uow_devs, uaa->vendor, uaa->product) != NULL) ?
@@ -121,15 +121,6 @@ uow_attach(struct device *parent, struct device *self, void *aux)
sc->sc_udev = uaa->device;
- /* Set USB configuration */
- if ((error = usbd_set_config_no(sc->sc_udev,
- DS2490_USB_CONFIG, 0)) != 0) {
- printf("%s: failed to set config %d: %s\n",
- sc->sc_dev.dv_xname, DS2490_USB_CONFIG,
- usbd_errstr(error));
- return;
- }
-
/* Get interface handle */
if ((error = usbd_device2interface_handle(sc->sc_udev,
DS2490_USB_IFACE, &sc->sc_iface)) != 0) {
diff --git a/sys/dev/usb/usps.c b/sys/dev/usb/usps.c
index 259a047d5b0..eff543ac242 100644
--- a/sys/dev/usb/usps.c
+++ b/sys/dev/usb/usps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usps.c,v 1.7 2014/07/12 21:24:33 mpi Exp $ */
+/* $OpenBSD: usps.c,v 1.8 2016/11/06 12:58:01 mpi Exp $ */
/*
* Copyright (c) 2011 Yojiro UO <yuo@nui.org>
@@ -134,7 +134,7 @@ usps_match(struct device *parent, void *match, void *aux)
{
struct usb_attach_arg *uaa = aux;
- if (uaa->iface != NULL)
+ if (uaa->iface == NULL || uaa->configno != 1)
return UMATCH_NONE;
if (usps_lookup(uaa->vendor, uaa->product) == NULL)
@@ -157,15 +157,7 @@ usps_attach(struct device *parent, struct device *self, void *aux)
sc->sc_udev = uaa->device;
#define USPS_USB_IFACE 0
-#define USPS_USB_CONFIG 1
- /* set configuration */
- if ((err = usbd_set_config_no(sc->sc_udev, USPS_USB_CONFIG, 0)) != 0){
- printf("%s: failed to set config %d: %s\n",
- sc->sc_dev.dv_xname, USPS_USB_CONFIG, usbd_errstr(err));
- return;
- }
-
/* get interface handle */
if ((err = usbd_device2interface_handle(sc->sc_udev, USPS_USB_IFACE,
&sc->sc_iface)) != 0) {