FreeBSD/sys/dev/e1000/if_lem.c
/**********************************************************************
 *
 *  Update the board statistics counters.
 *
 **********************************************************************/
Update the board statistics counters.
Update the board statistics counters .
static void
lem_update_stats_counters(struct adapter *adapter)
{
	if(adapter->hw.phy.media_type == e1000_media_type_copper ||
	   (E1000_READ_REG(&adapter->hw, E1000_STATUS) & E1000_STATUS_LU)) {
		adapter->stats.symerrs += E1000_READ_REG(&adapter->hw, E1000_SYMERRS);
		adapter->stats.sec += E1000_READ_REG(&adapter->hw, E1000_SEC);
	}
	adapter->stats.crcerrs += E1000_READ_REG(&adapter->hw, E1000_CRCERRS);
	adapter->stats.mpc += E1000_READ_REG(&adapter->hw, E1000_MPC);
	adapter->stats.scc += E1000_READ_REG(&adapter->hw, E1000_SCC);
	adapter->stats.ecol += E1000_READ_REG(&adapter->hw, E1000_ECOL);
	adapter->stats.mcc += E1000_READ_REG(&adapter->hw, E1000_MCC);
	adapter->stats.latecol += E1000_READ_REG(&adapter->hw, E1000_LATECOL);
	adapter->stats.colc += E1000_READ_REG(&adapter->hw, E1000_COLC);
	adapter->stats.dc += E1000_READ_REG(&adapter->hw, E1000_DC);
	adapter->stats.rlec += E1000_READ_REG(&adapter->hw, E1000_RLEC);
	adapter->stats.xonrxc += E1000_READ_REG(&adapter->hw, E1000_XONRXC);
	adapter->stats.xontxc += E1000_READ_REG(&adapter->hw, E1000_XONTXC);
	adapter->stats.xoffrxc += E1000_READ_REG(&adapter->hw, E1000_XOFFRXC);
	adapter->stats.xofftxc += E1000_READ_REG(&adapter->hw, E1000_XOFFTXC);
	adapter->stats.fcruc += E1000_READ_REG(&adapter->hw, E1000_FCRUC);
	adapter->stats.prc64 += E1000_READ_REG(&adapter->hw, E1000_PRC64);
	adapter->stats.prc127 += E1000_READ_REG(&adapter->hw, E1000_PRC127);
	adapter->stats.prc255 += E1000_READ_REG(&adapter->hw, E1000_PRC255);
	adapter->stats.prc511 += E1000_READ_REG(&adapter->hw, E1000_PRC511);
	adapter->stats.prc1023 += E1000_READ_REG(&adapter->hw, E1000_PRC1023);
	adapter->stats.prc1522 += E1000_READ_REG(&adapter->hw, E1000_PRC1522);
	adapter->stats.gprc += E1000_READ_REG(&adapter->hw, E1000_GPRC);
	adapter->stats.bprc += E1000_READ_REG(&adapter->hw, E1000_BPRC);
	adapter->stats.mprc += E1000_READ_REG(&adapter->hw, E1000_MPRC);
	adapter->stats.gptc += E1000_READ_REG(&adapter->hw, E1000_GPTC);
	adapter->stats.gorc += E1000_READ_REG(&adapter->hw, E1000_GORCL) +
	    ((u64)E1000_READ_REG(&adapter->hw, E1000_GORCH) << 32);
	adapter->stats.gotc += E1000_READ_REG(&adapter->hw, E1000_GOTCL) +
	    ((u64)E1000_READ_REG(&adapter->hw, E1000_GOTCH) << 32);
	adapter->stats.rnbc += E1000_READ_REG(&adapter->hw, E1000_RNBC);
	adapter->stats.ruc += E1000_READ_REG(&adapter->hw, E1000_RUC);
	adapter->stats.rfc += E1000_READ_REG(&adapter->hw, E1000_RFC);
	adapter->stats.roc += E1000_READ_REG(&adapter->hw, E1000_ROC);
	adapter->stats.rjc += E1000_READ_REG(&adapter->hw, E1000_RJC);
	adapter->stats.tor += E1000_READ_REG(&adapter->hw, E1000_TORH);
	adapter->stats.tot += E1000_READ_REG(&adapter->hw, E1000_TOTH);
	adapter->stats.tpr += E1000_READ_REG(&adapter->hw, E1000_TPR);
	adapter->stats.tpt += E1000_READ_REG(&adapter->hw, E1000_TPT);
	adapter->stats.ptc64 += E1000_READ_REG(&adapter->hw, E1000_PTC64);
	adapter->stats.ptc127 += E1000_READ_REG(&adapter->hw, E1000_PTC127);
	adapter->stats.ptc255 += E1000_READ_REG(&adapter->hw, E1000_PTC255);
	adapter->stats.ptc511 += E1000_READ_REG(&adapter->hw, E1000_PTC511);
	adapter->stats.ptc1023 += E1000_READ_REG(&adapter->hw, E1000_PTC1023);
	adapter->stats.ptc1522 += E1000_READ_REG(&adapter->hw, E1000_PTC1522);
	adapter->stats.mptc += E1000_READ_REG(&adapter->hw, E1000_MPTC);
	adapter->stats.bptc += E1000_READ_REG(&adapter->hw, E1000_BPTC);
	if (adapter->hw.mac.type >= e1000_82543) {
		adapter->stats.algnerrc += 
		E1000_READ_REG(&adapter->hw, E1000_ALGNERRC);
		adapter->stats.rxerrc += 
		E1000_READ_REG(&adapter->hw, E1000_RXERRC);
		adapter->stats.tncrs += 
		E1000_READ_REG(&adapter->hw, E1000_TNCRS);
		adapter->stats.cexterr += 
		E1000_READ_REG(&adapter->hw, E1000_CEXTERR);
		adapter->stats.tsctc += 
		E1000_READ_REG(&adapter->hw, E1000_TSCTC);
		adapter->stats.tsctfc += 
		E1000_READ_REG(&adapter->hw, E1000_TSCTFC);
	}
}
static void lem_update_stats_counters ( struct adapter * adapter ) { if ( adapter -> hw . phy . media_type == e1000_media_type_copper || ( E1000_READ_REG ( & adapter -> hw , E1000_STATUS ) & E1000_STATUS_LU ) ) { adapter -> stats . symerrs += E1000_READ_REG ( & adapter -> hw , E1000_SYMERRS ) ; adapter -> stats . sec += E1000_READ_REG ( & adapter -> hw , E1000_SEC ) ; } adapter -> stats . crcerrs += E1000_READ_REG ( & adapter -> hw , E1000_CRCERRS ) ; adapter -> stats . mpc += E1000_READ_REG ( & adapter -> hw , E1000_MPC ) ; adapter -> stats . scc += E1000_READ_REG ( & adapter -> hw , E1000_SCC ) ; adapter -> stats . ecol += E1000_READ_REG ( & adapter -> hw , E1000_ECOL ) ; adapter -> stats . mcc += E1000_READ_REG ( & adapter -> hw , E1000_MCC ) ; adapter -> stats . latecol += E1000_READ_REG ( & adapter -> hw , E1000_LATECOL ) ; adapter -> stats . colc += E1000_READ_REG ( & adapter -> hw , E1000_COLC ) ; adapter -> stats . dc += E1000_READ_REG ( & adapter -> hw , E1000_DC ) ; adapter -> stats . rlec += E1000_READ_REG ( & adapter -> hw , E1000_RLEC ) ; adapter -> stats . xonrxc += E1000_READ_REG ( & adapter -> hw , E1000_XONRXC ) ; adapter -> stats . xontxc += E1000_READ_REG ( & adapter -> hw , E1000_XONTXC ) ; adapter -> stats . xoffrxc += E1000_READ_REG ( & adapter -> hw , E1000_XOFFRXC ) ; adapter -> stats . xofftxc += E1000_READ_REG ( & adapter -> hw , E1000_XOFFTXC ) ; adapter -> stats . fcruc += E1000_READ_REG ( & adapter -> hw , E1000_FCRUC ) ; adapter -> stats . prc64 += E1000_READ_REG ( & adapter -> hw , E1000_PRC64 ) ; adapter -> stats . prc127 += E1000_READ_REG ( & adapter -> hw , E1000_PRC127 ) ; adapter -> stats . prc255 += E1000_READ_REG ( & adapter -> hw , E1000_PRC255 ) ; adapter -> stats . prc511 += E1000_READ_REG ( & adapter -> hw , E1000_PRC511 ) ; adapter -> stats . prc1023 += E1000_READ_REG ( & adapter -> hw , E1000_PRC1023 ) ; adapter -> stats . prc1522 += E1000_READ_REG ( & adapter -> hw , E1000_PRC1522 ) ; adapter -> stats . gprc += E1000_READ_REG ( & adapter -> hw , E1000_GPRC ) ; adapter -> stats . bprc += E1000_READ_REG ( & adapter -> hw , E1000_BPRC ) ; adapter -> stats . mprc += E1000_READ_REG ( & adapter -> hw , E1000_MPRC ) ; adapter -> stats . gptc += E1000_READ_REG ( & adapter -> hw , E1000_GPTC ) ; adapter -> stats . gorc += E1000_READ_REG ( & adapter -> hw , E1000_GORCL ) + ( ( u64 ) E1000_READ_REG ( & adapter -> hw , E1000_GORCH ) << 32 ) ; adapter -> stats . gotc += E1000_READ_REG ( & adapter -> hw , E1000_GOTCL ) + ( ( u64 ) E1000_READ_REG ( & adapter -> hw , E1000_GOTCH ) << 32 ) ; adapter -> stats . rnbc += E1000_READ_REG ( & adapter -> hw , E1000_RNBC ) ; adapter -> stats . ruc += E1000_READ_REG ( & adapter -> hw , E1000_RUC ) ; adapter -> stats . rfc += E1000_READ_REG ( & adapter -> hw , E1000_RFC ) ; adapter -> stats . roc += E1000_READ_REG ( & adapter -> hw , E1000_ROC ) ; adapter -> stats . rjc += E1000_READ_REG ( & adapter -> hw , E1000_RJC ) ; adapter -> stats . tor += E1000_READ_REG ( & adapter -> hw , E1000_TORH ) ; adapter -> stats . tot += E1000_READ_REG ( & adapter -> hw , E1000_TOTH ) ; adapter -> stats . tpr += E1000_READ_REG ( & adapter -> hw , E1000_TPR ) ; adapter -> stats . tpt += E1000_READ_REG ( & adapter -> hw , E1000_TPT ) ; adapter -> stats . ptc64 += E1000_READ_REG ( & adapter -> hw , E1000_PTC64 ) ; adapter -> stats . ptc127 += E1000_READ_REG ( & adapter -> hw , E1000_PTC127 ) ; adapter -> stats . ptc255 += E1000_READ_REG ( & adapter -> hw , E1000_PTC255 ) ; adapter -> stats . ptc511 += E1000_READ_REG ( & adapter -> hw , E1000_PTC511 ) ; adapter -> stats . ptc1023 += E1000_READ_REG ( & adapter -> hw , E1000_PTC1023 ) ; adapter -> stats . ptc1522 += E1000_READ_REG ( & adapter -> hw , E1000_PTC1522 ) ; adapter -> stats . mptc += E1000_READ_REG ( & adapter -> hw , E1000_MPTC ) ; adapter -> stats . bptc += E1000_READ_REG ( & adapter -> hw , E1000_BPTC ) ; if ( adapter -> hw . mac . type >= e1000_82543 ) { adapter -> stats . algnerrc += E1000_READ_REG ( & adapter -> hw , E1000_ALGNERRC ) ; adapter -> stats . rxerrc += E1000_READ_REG ( & adapter -> hw , E1000_RXERRC ) ; adapter -> stats . tncrs += E1000_READ_REG ( & adapter -> hw , E1000_TNCRS ) ; adapter -> stats . cexterr += E1000_READ_REG ( & adapter -> hw , E1000_CEXTERR ) ; adapter -> stats . tsctc += E1000_READ_REG ( & adapter -> hw , E1000_TSCTC ) ; adapter -> stats . tsctfc += E1000_READ_REG ( & adapter -> hw , E1000_TSCTFC ) ; } }
Update the board statistics counters.
Update the board statistics counters .
/* For the 64-bit byte counters the low dword must be read first. */ /* Both registers clear on the read of the high dword */