FreeBSD/sys/dev/cxgbe/common/t4_hw.c
/**
 *	t4_pmrx_get_stats - returns the HW stats from PMRX
 *	@adap: the adapter
 *	@cnt: where to store the count statistics
 *	@cycles: where to store the cycle statistics
 *
 *	Returns performance statistics from PMRX.
 */
returns the HW stats from PMRX
@adap: the adapter
@cnt: where to store the count statistics
@cycles: where to store the cycle statistics

Returns performance statistics from PMRX.
returns the HW stats from PMRX @adap : the adapter @cnt : where to store the count statistics @cycles : where to store the cycle statistics Returns performance statistics from PMRX .
void t4_pmrx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[])
{
	int i;
	u32 data[2];
	for (i = 0; i < adap->chip_params->pm_stats_cnt; i++) {
		t4_write_reg(adap, A_PM_RX_STAT_CONFIG, i + 1);
		cnt[i] = t4_read_reg(adap, A_PM_RX_STAT_COUNT);
		if (is_t4(adap)) {
			cycles[i] = t4_read_reg64(adap, A_PM_RX_STAT_LSB);
		} else {
			t4_read_indirect(adap, A_PM_RX_DBG_CTRL,
					 A_PM_RX_DBG_DATA, data, 2,
					 A_PM_RX_DBG_STAT_MSB);
			cycles[i] = (((u64)data[0] << 32) | data[1]);
		}
	}
}
void t4_pmrx_get_stats ( struct adapter * adap , u32 cnt [ ] , u64 cycles [ ] ) { int i ; u32 data [ 2 ] ; for ( i = 0 ; i < adap -> chip_params -> pm_stats_cnt ; i ++ ) { t4_write_reg ( adap , A_PM_RX_STAT_CONFIG , i + 1 ) ; cnt [ i ] = t4_read_reg ( adap , A_PM_RX_STAT_COUNT ) ; if ( is_t4 ( adap ) ) { cycles [ i ] = t4_read_reg64 ( adap , A_PM_RX_STAT_LSB ) ; } else { t4_read_indirect ( adap , A_PM_RX_DBG_CTRL , A_PM_RX_DBG_DATA , data , 2 , A_PM_RX_DBG_STAT_MSB ) ; cycles [ i ] = ( ( ( u64 ) data [ 0 ] << 32 ) | data [ 1 ] ) ; } } }
t4_pmrx_get_stats - returns the HW stats from PMRX
      @adap: the adapter
      @cnt: where to store the count statistics
      @cycles: where to store the cycle statistics
t4_pmrx_get_stats - returns the HW stats from PMRX @adap : the adapter @cnt : where to store the count statistics @cycles : where to store the cycle statistics