Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/cadence Add gem versions of collision counters.



details:   https://anonhg.NetBSD.org/src/rev/984901c70033
branches:  trunk
changeset: 339858:984901c70033
user:      rjs <rjs%NetBSD.org@localhost>
date:      Thu Aug 13 14:51:35 2015 +0000

description:
Add gem versions of collision counters.

diffstat:

 sys/dev/cadence/cemacreg.h |   4 +++-
 sys/dev/cadence/if_cemac.c |  10 +++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diffs (49 lines):

diff -r a465831fafdd -r 984901c70033 sys/dev/cadence/cemacreg.h
--- a/sys/dev/cadence/cemacreg.h        Thu Aug 13 13:21:04 2015 +0000
+++ b/sys/dev/cadence/cemacreg.h        Thu Aug 13 14:51:35 2015 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: cemacreg.h,v 1.1 2015/01/23 12:34:09 hkenken Exp $    */
+/*      $NetBSD: cemacreg.h,v 1.2 2015/08/13 14:51:35 rjs Exp $        */
 
 /*-
  * Copyright (c) 2015  Genetec Corporation.  All rights reserved.
@@ -109,6 +109,8 @@
 #define        GEM_SA3H        0x009C
 #define        GEM_SA4L        0x0090
 #define        GEM_SA4H        0x0094
+#define        GEM_SCOL        0x0138
+#define        GEM_MCOL        0x013C
 #define        GEM_DCFG2       0x0284
 #define        GEM_DCFG3       0x0288
 #define        GEM_DCFG4       0x028C
diff -r a465831fafdd -r 984901c70033 sys/dev/cadence/if_cemac.c
--- a/sys/dev/cadence/if_cemac.c        Thu Aug 13 13:21:04 2015 +0000
+++ b/sys/dev/cadence/if_cemac.c        Thu Aug 13 14:51:35 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cemac.c,v 1.2 2015/05/20 09:17:18 ozaki-r Exp $     */
+/*     $NetBSD: if_cemac.c,v 1.3 2015/08/13 14:51:35 rjs Exp $ */
 
 /*
  * Copyright (c) 2015  Genetec Corporation.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.2 2015/05/20 09:17:18 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.3 2015/08/13 14:51:35 rjs Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -689,7 +689,11 @@
        struct ifnet * ifp = &sc->sc_ethercom.ec_if;
        int s;
 
-       ifp->if_collisions += CEMAC_READ(ETH_SCOL) + CEMAC_READ(ETH_MCOL);
+       if (ISSET(sc->cemac_flags, CEMAC_FLAG_GEM))
+               ifp->if_collisions += CEMAC_READ(GEM_SCOL) + CEMAC_READ(GEM_MCOL);
+       else
+               ifp->if_collisions += CEMAC_READ(ETH_SCOL) + CEMAC_READ(ETH_MCOL);
+
        /* These misses are ok, they will happen if the RAM/CPU can't keep up */
        if (!ISSET(sc->cemac_flags, CEMAC_FLAG_GEM)) {
                uint32_t misses = CEMAC_READ(ETH_DRFC);



Home | Main Index | Thread Index | Old Index