Add gem versions of collision counters.

This commit is contained in:
rjs 2015-08-13 14:51:35 +00:00
parent ea36dfc342
commit 314f76f867
2 changed files with 10 additions and 4 deletions

View File

@ -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

View File

@ -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 @@ cemac_tick(void *arg)
struct ifnet * ifp = &sc->sc_ethercom.ec_if;
int s;
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);