Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb fix up USB drivers printing of autoconf information



details:   https://anonhg.NetBSD.org/src/rev/20b4d54620a3
branches:  trunk
changeset: 747604:20b4d54620a3
user:      plunky <plunky%NetBSD.org@localhost>
date:      Wed Sep 23 19:07:19 2009 +0000

description:
fix up USB drivers printing of autoconf information

1. expand the USB_ATTACH_SETUP macro (requested by jmcneill)

2. reorder the attach function so that the first thing it does is print
   newlines.

3. after this, we can call usbd_devinfo_alloc(), which polls the device
   allowing a context switch, and aprint_normal() the device information.

this avoids problems where autoconf messages are getting mixed up.

diffstat:

 sys/dev/usb/if_atu.c         |   7 ++++---
 sys/dev/usb/if_aue.c         |   7 ++++---
 sys/dev/usb/if_axe.c         |  17 ++++++++---------
 sys/dev/usb/if_cdce.c        |  10 ++++++----
 sys/dev/usb/if_cue.c         |   8 +++++---
 sys/dev/usb/if_kue.c         |   8 +++++---
 sys/dev/usb/if_rum.c         |   8 +++++---
 sys/dev/usb/if_udav.c        |   8 +++++---
 sys/dev/usb/if_upl.c         |   8 +++++---
 sys/dev/usb/if_ural.c        |   8 +++++---
 sys/dev/usb/if_url.c         |   8 +++++---
 sys/dev/usb/if_zyd.c         |   7 ++++---
 sys/dev/usb/moscom.c         |   8 +++++---
 sys/dev/usb/pseye.c          |  14 ++++++++------
 sys/dev/usb/uaudio.c         |  13 +++++++------
 sys/dev/usb/uberry.c         |   8 +++++---
 sys/dev/usb/ubsa.c           |   9 ++++++---
 sys/dev/usb/ubt.c            |   8 +++++---
 sys/dev/usb/uchcom.c         |   8 +++++---
 sys/dev/usb/udsbr.c          |   8 +++++---
 sys/dev/usb/uep.c            |   9 ++++++---
 sys/dev/usb/uftdi.c          |  16 +++++++++-------
 sys/dev/usb/ugen.c           |   8 +++++---
 sys/dev/usb/ugensa.c         |  16 +++++++++-------
 sys/dev/usb/uhidev.c         |   9 ++++++---
 sys/dev/usb/uhmodem.c        |   8 +++++---
 sys/dev/usb/uipaq.c          |  16 +++++++++-------
 sys/dev/usb/uirda.c          |   8 +++++---
 sys/dev/usb/ulpt.c           |   8 +++++---
 sys/dev/usb/umass.c          |  10 ++++++----
 sys/dev/usb/umct.c           |   8 +++++---
 sys/dev/usb/umodem_common.c  |  12 +++++++-----
 sys/dev/usb/uplcom.c         |   8 +++++---
 sys/dev/usb/urio.c           |   8 +++++---
 sys/dev/usb/uscanner.c       |   8 +++++---
 sys/dev/usb/uslsa.c          |  26 +++++++++++++-------------
 sys/dev/usb/usscanner.c      |   8 +++++---
 sys/dev/usb/ustir.c          |   8 +++++---
 sys/dev/usb/utoppy.c         |   8 +++++---
 sys/dev/usb/uvisor.c         |  16 +++++++++-------
 sys/dev/usb/uvscom.c         |  10 ++++++----
 sys/dev/usb/uyap.c           |   8 +++++---
 sys/dev/usb/xboxcontroller.c |  11 +++++++----
 43 files changed, 254 insertions(+), 173 deletions(-)

diffs (truncated from 1454 to 300 lines):

diff -r 67289c8a7549 -r 20b4d54620a3 sys/dev/usb/if_atu.c
--- a/sys/dev/usb/if_atu.c      Wed Sep 23 17:48:55 2009 +0000
+++ b/sys/dev/usb/if_atu.c      Wed Sep 23 19:07:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_atu.c,v 1.32 2009/09/04 18:10:08 dyoung Exp $ */
+/*     $NetBSD: if_atu.c,v 1.33 2009/09/23 19:07:19 plunky Exp $ */
 /*     $OpenBSD: if_atu.c,v 1.48 2004/12/30 01:53:21 dlg Exp $ */
 /*
  * Copyright (c) 2003, 2004
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_atu.c,v 1.32 2009/09/04 18:10:08 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_atu.c,v 1.33 2009/09/23 19:07:19 plunky Exp $");
 
 #include "bpfilter.h"
 
@@ -1182,9 +1182,10 @@
        sc->atu_dev = self;
        sc->sc_state = ATU_S_UNCONFIG;
 
-       devinfop = usbd_devinfo_alloc(dev, 0);
        aprint_naive("\n");
        aprint_normal("\n");
+
+       devinfop = usbd_devinfo_alloc(dev, 0);
        aprint_normal_dev(self, "%s\n", devinfop);
        usbd_devinfo_free(devinfop);
 
diff -r 67289c8a7549 -r 20b4d54620a3 sys/dev/usb/if_aue.c
--- a/sys/dev/usb/if_aue.c      Wed Sep 23 17:48:55 2009 +0000
+++ b/sys/dev/usb/if_aue.c      Wed Sep 23 19:07:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_aue.c,v 1.114 2009/09/04 18:10:08 dyoung Exp $      */
+/*     $NetBSD: if_aue.c,v 1.115 2009/09/23 19:07:19 plunky Exp $      */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.114 2009/09/04 18:10:08 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.115 2009/09/23 19:07:19 plunky Exp $");
 
 #include "opt_inet.h"
 #include "bpfilter.h"
@@ -742,9 +742,10 @@
 
        sc->aue_dev = self;
 
-       devinfop = usbd_devinfo_alloc(uaa->device, 0);
        aprint_naive("\n");
        aprint_normal("\n");
+
+       devinfop = usbd_devinfo_alloc(uaa->device, 0);
        aprint_normal_dev(self, "%s\n", devinfop);
        usbd_devinfo_free(devinfop);
 
diff -r 67289c8a7549 -r 20b4d54620a3 sys/dev/usb/if_axe.c
--- a/sys/dev/usb/if_axe.c      Wed Sep 23 17:48:55 2009 +0000
+++ b/sys/dev/usb/if_axe.c      Wed Sep 23 19:07:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axe.c,v 1.28 2009/09/04 18:10:08 dyoung Exp $       */
+/*     $NetBSD: if_axe.c,v 1.29 2009/09/23 19:07:19 plunky Exp $       */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.28 2009/09/04 18:10:08 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.29 2009/09/23 19:07:19 plunky Exp $");
 
 #if defined(__NetBSD__)
 #include "opt_inet.h"
@@ -426,15 +426,18 @@
        struct ifnet *ifp;
        int i, s;
 
-       devinfop = usbd_devinfo_alloc(dev, 0);
+       sc->axe_dev = self;
+
        aprint_naive("\n");
        aprint_normal("\n");
-       sc->axe_dev = self;
+
+       devinfop = usbd_devinfo_alloc(dev, 0);
+       aprint_normal_dev(self, "%s\n", devinfop);
+       usbd_devinfo_free(devinfop);
 
        err = usbd_set_config_no(dev, AXE_CONFIG_NO, 1);
        if (err) {
                aprint_error_dev(self, "getting interface handle failed\n");
-               usbd_devinfo_free(devinfop);
                return;
        }
 
@@ -445,7 +448,6 @@
        err = usbd_device2interface_handle(dev, AXE_IFACE_IDX, &sc->axe_iface);
        if (err) {
                aprint_error_dev(self, "getting interface handle failed\n");
-               usbd_devinfo_free(devinfop);
                return;
        }
 
@@ -455,9 +457,6 @@
 
        id = usbd_get_interface_descriptor(sc->axe_iface);
 
-       aprint_normal_dev(self, "%s\n", devinfop);
-       usbd_devinfo_free(devinfop);
-
        /* Find endpoints. */
        for (i = 0; i < id->bNumEndpoints; i++) {
                ed = usbd_interface2endpoint_descriptor(sc->axe_iface, i);
diff -r 67289c8a7549 -r 20b4d54620a3 sys/dev/usb/if_cdce.c
--- a/sys/dev/usb/if_cdce.c     Wed Sep 23 17:48:55 2009 +0000
+++ b/sys/dev/usb/if_cdce.c     Wed Sep 23 19:07:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cdce.c,v 1.24 2009/09/04 18:10:08 dyoung Exp $ */
+/*     $NetBSD: if_cdce.c,v 1.25 2009/09/23 19:07:19 plunky Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul%windriver.com@localhost>
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.24 2009/09/04 18:10:08 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.25 2009/09/23 19:07:19 plunky Exp $");
 #include "bpfilter.h"
 #ifdef __NetBSD__
 #include "opt_inet.h"
@@ -154,10 +154,12 @@
        const usb_cdc_ethernet_descriptor_t *ue;
        char                             eaddr_str[USB_MAX_ENCODED_STRING_LEN];
 
-       devinfop = usbd_devinfo_alloc(dev, 0);
+       sc->cdce_dev = self;
+
        aprint_naive("\n");
        aprint_normal("\n");
-       sc->cdce_dev = self;
+
+       devinfop = usbd_devinfo_alloc(dev, 0);
        aprint_normal_dev(self, "%s\n", devinfop);
        usbd_devinfo_free(devinfop);
 
diff -r 67289c8a7549 -r 20b4d54620a3 sys/dev/usb/if_cue.c
--- a/sys/dev/usb/if_cue.c      Wed Sep 23 17:48:55 2009 +0000
+++ b/sys/dev/usb/if_cue.c      Wed Sep 23 19:07:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cue.c,v 1.54 2008/11/07 00:20:12 dyoung Exp $       */
+/*     $NetBSD: if_cue.c,v 1.55 2009/09/23 19:07:19 plunky Exp $       */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.54 2008/11/07 00:20:12 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.55 2009/09/23 19:07:19 plunky Exp $");
 
 #if defined(__NetBSD__)
 #include "opt_inet.h"
@@ -491,8 +491,10 @@
 
        sc->cue_dev = self;
 
+       aprint_naive("\n");
+       aprint_normal("\n");
+
        devinfop = usbd_devinfo_alloc(dev, 0);
-       USB_ATTACH_SETUP;
        aprint_normal_dev(self, "%s\n", devinfop);
        usbd_devinfo_free(devinfop);
 
diff -r 67289c8a7549 -r 20b4d54620a3 sys/dev/usb/if_kue.c
--- a/sys/dev/usb/if_kue.c      Wed Sep 23 17:48:55 2009 +0000
+++ b/sys/dev/usb/if_kue.c      Wed Sep 23 19:07:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_kue.c,v 1.65 2009/09/04 18:10:08 dyoung Exp $       */
+/*     $NetBSD: if_kue.c,v 1.66 2009/09/23 19:07:19 plunky Exp $       */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.65 2009/09/04 18:10:08 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.66 2009/09/23 19:07:19 plunky Exp $");
 
 #if defined(__NetBSD__)
 #include "opt_inet.h"
@@ -429,8 +429,10 @@
 
        sc->kue_dev = self;
 
+       aprint_naive("\n");
+       aprint_normal("\n");
+
        devinfop = usbd_devinfo_alloc(dev, 0);
-       USB_ATTACH_SETUP;
        aprint_normal_dev(self, "%s\n", devinfop);
        usbd_devinfo_free(devinfop);
 
diff -r 67289c8a7549 -r 20b4d54620a3 sys/dev/usb/if_rum.c
--- a/sys/dev/usb/if_rum.c      Wed Sep 23 17:48:55 2009 +0000
+++ b/sys/dev/usb/if_rum.c      Wed Sep 23 19:07:19 2009 +0000
@@ -1,5 +1,5 @@
 /*     $OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $      */
-/*     $NetBSD: if_rum.c,v 1.27 2009/08/02 20:55:45 tshiozak Exp $     */
+/*     $NetBSD: if_rum.c,v 1.28 2009/09/23 19:07:19 plunky Exp $       */
 
 /*-
  * Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini%free.fr@localhost>
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.27 2009/08/02 20:55:45 tshiozak Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.28 2009/09/23 19:07:19 plunky Exp $");
 
 #include "bpfilter.h"
 
@@ -311,8 +311,10 @@
        sc->sc_udev = uaa->device;
        sc->sc_flags = 0;
 
+       aprint_naive("\n");
+       aprint_normal("\n");
+
        devinfop = usbd_devinfo_alloc(sc->sc_udev, 0);
-       USB_ATTACH_SETUP;
        aprint_normal_dev(self, "%s\n", devinfop);
        usbd_devinfo_free(devinfop);
 
diff -r 67289c8a7549 -r 20b4d54620a3 sys/dev/usb/if_udav.c
--- a/sys/dev/usb/if_udav.c     Wed Sep 23 17:48:55 2009 +0000
+++ b/sys/dev/usb/if_udav.c     Wed Sep 23 19:07:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_udav.c,v 1.25 2009/03/18 10:22:41 cegger Exp $      */
+/*     $NetBSD: if_udav.c,v 1.26 2009/09/23 19:07:19 plunky Exp $      */
 /*     $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $   */
 /*
  * Copyright (c) 2003
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.25 2009/03/18 10:22:41 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.26 2009/09/23 19:07:19 plunky Exp $");
 
 #include "opt_inet.h"
 #include "bpfilter.h"
@@ -189,8 +189,10 @@
 
        sc->sc_dev = self;
 
+       aprint_naive("\n");
+       aprint_normal("\n");
+
        devinfop = usbd_devinfo_alloc(dev, 0);
-       USB_ATTACH_SETUP;
        aprint_normal_dev(self, "%s\n", devinfop);
        usbd_devinfo_free(devinfop);
 
diff -r 67289c8a7549 -r 20b4d54620a3 sys/dev/usb/if_upl.c
--- a/sys/dev/usb/if_upl.c      Wed Sep 23 17:48:55 2009 +0000
+++ b/sys/dev/usb/if_upl.c      Wed Sep 23 19:07:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_upl.c,v 1.33 2008/11/07 00:20:13 dyoung Exp $       */
+/*     $NetBSD: if_upl.c,v 1.34 2009/09/23 19:07:19 plunky Exp $       */
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.33 2008/11/07 00:20:13 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.34 2009/09/23 19:07:19 plunky Exp $");
 
 #include "opt_inet.h"
 #include "bpfilter.h"
@@ -232,8 +232,10 @@
 
        sc->sc_dev = self;
 
+       aprint_naive("\n");
+       aprint_normal("\n");
+
        devinfop = usbd_devinfo_alloc(dev, 0);
-       USB_ATTACH_SETUP;
        aprint_normal_dev(self, "%s\n", devinfop);



Home | Main Index | Thread Index | Old Index