FreeBSD/sys/dev/stge/if_stge.c
/*
 * stge_stats_update:
 *
 *	Read the TC9021 statistics counters.
 */
Read the TC9021 statistics counters.
Read the TC9021 statistics counters .
static void
stge_stats_update(struct stge_softc *sc)
{
	struct ifnet *ifp;
	STGE_LOCK_ASSERT(sc);
	ifp = sc->sc_ifp;
	CSR_READ_4(sc,STGE_OctetRcvOk);
	if_inc_counter(ifp, IFCOUNTER_IPACKETS, CSR_READ_4(sc, STGE_FramesRcvdOk));
	if_inc_counter(ifp, IFCOUNTER_IERRORS, CSR_READ_2(sc, STGE_FramesLostRxErrors));
	CSR_READ_4(sc, STGE_OctetXmtdOk);
	if_inc_counter(ifp, IFCOUNTER_OPACKETS, CSR_READ_4(sc, STGE_FramesXmtdOk));
	if_inc_counter(ifp, IFCOUNTER_COLLISIONS,
	    CSR_READ_4(sc, STGE_LateCollisions) +
	    CSR_READ_4(sc, STGE_MultiColFrames) +
	    CSR_READ_4(sc, STGE_SingleColFrames));
	if_inc_counter(ifp, IFCOUNTER_OERRORS,
	    CSR_READ_2(sc, STGE_FramesAbortXSColls) +
	    CSR_READ_2(sc, STGE_FramesWEXDeferal));
}
static void stge_stats_update ( struct stge_softc * sc ) { struct ifnet * ifp ; STGE_LOCK_ASSERT ( sc ) ; ifp = sc -> sc_ifp ; CSR_READ_4 ( sc , STGE_OctetRcvOk ) ; if_inc_counter ( ifp , IFCOUNTER_IPACKETS , CSR_READ_4 ( sc , STGE_FramesRcvdOk ) ) ; if_inc_counter ( ifp , IFCOUNTER_IERRORS , CSR_READ_2 ( sc , STGE_FramesLostRxErrors ) ) ; CSR_READ_4 ( sc , STGE_OctetXmtdOk ) ; if_inc_counter ( ifp , IFCOUNTER_OPACKETS , CSR_READ_4 ( sc , STGE_FramesXmtdOk ) ) ; if_inc_counter ( ifp , IFCOUNTER_COLLISIONS , CSR_READ_4 ( sc , STGE_LateCollisions ) + CSR_READ_4 ( sc , STGE_MultiColFrames ) + CSR_READ_4 ( sc , STGE_SingleColFrames ) ) ; if_inc_counter ( ifp , IFCOUNTER_OERRORS , CSR_READ_2 ( sc , STGE_FramesAbortXSColls ) + CSR_READ_2 ( sc , STGE_FramesWEXDeferal ) ) ; }
stge_stats_update:
      Read the TC9021 statistics counters.
stge_stats_update : Read the TC9021 statistics counters .