Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Don't count bit0 events in gintsts. bit 0 tells ...



details:   https://anonhg.NetBSD.org/src/rev/81255d5f03cf
branches:  trunk
changeset: 784133:81255d5f03cf
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Jan 19 14:07:37 2013 +0000

description:
Don't count bit0 events in gintsts. bit 0 tells us which mode we're in
0 = device, 1 = host

diffstat:

 sys/dev/usb/dwc_otg.c    |  15 +++++++++------
 sys/dev/usb/dwc_otgvar.h |  15 ++++++++++++---
 2 files changed, 21 insertions(+), 9 deletions(-)

diffs (88 lines):

diff -r 1373aeb8a68d -r 81255d5f03cf sys/dev/usb/dwc_otg.c
--- a/sys/dev/usb/dwc_otg.c     Sat Jan 19 14:03:08 2013 +0000
+++ b/sys/dev/usb/dwc_otg.c     Sat Jan 19 14:07:37 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dwc_otg.c,v 1.25 2013/01/19 07:41:51 skrll Exp $       */
+/*     $NetBSD: dwc_otg.c,v 1.26 2013/01/19 14:07:37 skrll Exp $       */
 
 /*-
  * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc_otg.c,v 1.25 2013/01/19 07:41:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_otg.c,v 1.26 2013/01/19 14:07:37 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -3389,8 +3389,8 @@
        status = DWC_OTG_READ_4(sc, DOTG_GINTSTS);
        DWC_OTG_WRITE_4(sc, DOTG_GINTSTS, status);
 
-       for (size_t i = 0; i < 32; i++) {
-               if (status & (1<<i)) {
+       for (size_t i = DWC_OTG_INTRBITF; i < DWC_OTG_NINTRBITS; i++) {
+               if (status & (1 << i)) {
                        DOTG_EVCNT_INCR(sc->sc_ev_intr_bit[i]);
                }
        }
@@ -4119,8 +4119,11 @@
        usb_schedsoftintr(&sc->sc_bus);
 }
 
+/*
+ * curmode is a mode indication bit 0 = device, 1 = host
+ */
 static const char * const intnames[32] = {
-       "curmod",       "modemis",      "otgint",       "sof",
+       "curmode",      "modemis",      "otgint",       "sof",
        "rxflvl",       "nptxfemp",     "ginnakeff",    "goutnakeff",
        "ulpickint",    "i2cint",       "erlysusp",     "usbsusp",
        "usbrst",       "enumdone",     "isooutdrop",   "eopf",
@@ -4185,7 +4188,7 @@
        evcnt_attach_dynamic(&sc->sc_ev_xferpoolput, EVCNT_TYPE_MISC,
            NULL, xname, "xfer pool put");
 
-       for (size_t i = 0; i < 32; i++) {
+       for (size_t i = DWC_OTG_INTRBITF; i < DWC_OTG_NINTRBITS; i++) {
                evcnt_attach_dynamic(&sc->sc_ev_intr_bit[i], EVCNT_TYPE_INTR,
                    NULL, xname, intnames[i]);
        }       
diff -r 1373aeb8a68d -r 81255d5f03cf sys/dev/usb/dwc_otgvar.h
--- a/sys/dev/usb/dwc_otgvar.h  Sat Jan 19 14:03:08 2013 +0000
+++ b/sys/dev/usb/dwc_otgvar.h  Sat Jan 19 14:07:37 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dwc_otgvar.h,v 1.5 2013/01/13 15:21:47 skrll Exp $ */
+/*     $NetBSD: dwc_otgvar.h,v 1.6 2013/01/19 14:07:37 skrll Exp $ */
 
 /* $FreeBSD: src/sys/dev/usb/controller/dwc_otg.h,v 1.12 2012/09/27 15:23:38 hselasky Exp $ */
 /*-
@@ -40,6 +40,16 @@
 #define        DWC_OTG_MAX_ENDPOINTS 16
 #define        DWC_OTG_HOST_TIMER_RATE 10 /* ms */
 
+#define DOTG_COUNTERS
+#ifdef DOTG_COUNTERS
+/*
+ * curmode (bit 0)is a mode indication bit 0 = device, 1 = host
+ */
+#define        DWC_OTG_INTRBITF        1
+#define        DWC_OTG_INTRBITL        31
+#define        DWC_OTG_NINTRBITS       32
+#endif
+
 struct dwc_otg_td;
 struct dwc_otg_softc;
 
@@ -202,9 +212,8 @@
        pool_cache_t sc_xferpool;
        
 #ifdef DOTG_COUNTERS
-
        struct evcnt sc_ev_intr;
-       struct evcnt sc_ev_intr_bit[32];
+       struct evcnt sc_ev_intr_bit[DWC_OTG_NINTRBITS];
 
        struct evcnt sc_ev_soft_intr;
        struct evcnt sc_ev_work;



Home | Main Index | Thread Index | Old Index