FreeBSD/sys/dev/cxgbe/common/t4_hw.c
/**
 *	t4_get_chan_txrate - get the current per channel Tx rates
 *	@adap: the adapter
 *	@nic_rate: rates for NIC traffic
 *	@ofld_rate: rates for offloaded traffic
 *
 *	Return the current Tx rates in bytes/s for NIC and offloaded traffic
 *	for each channel.
 */
get the current per channel Tx rates
@adap: the adapter
@nic_rate: rates for NIC traffic
@ofld_rate: rates for offloaded traffic

Return the current Tx rates in bytes/s for NIC and offloaded traffic
for each channel.
get the current per channel Tx rates @adap : the adapter @nic_rate : rates for NIC traffic @ofld_rate : rates for offloaded traffic Return the current Tx rates in bytes / s for NIC and offloaded traffic for each channel .
void t4_get_chan_txrate(struct adapter *adap, u64 *nic_rate, u64 *ofld_rate)
{
	u32 v;
	v = t4_read_reg(adap, A_TP_TX_TRATE);
	nic_rate[0] = chan_rate(adap, G_TNLRATE0(v));
	nic_rate[1] = chan_rate(adap, G_TNLRATE1(v));
	if (adap->chip_params->nchan > 2) {
		nic_rate[2] = chan_rate(adap, G_TNLRATE2(v));
		nic_rate[3] = chan_rate(adap, G_TNLRATE3(v));
	}
	v = t4_read_reg(adap, A_TP_TX_ORATE);
	ofld_rate[0] = chan_rate(adap, G_OFDRATE0(v));
	ofld_rate[1] = chan_rate(adap, G_OFDRATE1(v));
	if (adap->chip_params->nchan > 2) {
		ofld_rate[2] = chan_rate(adap, G_OFDRATE2(v));
		ofld_rate[3] = chan_rate(adap, G_OFDRATE3(v));
	}
}
void t4_get_chan_txrate ( struct adapter * adap , u64 * nic_rate , u64 * ofld_rate ) { u32 v ; v = t4_read_reg ( adap , A_TP_TX_TRATE ) ; nic_rate [ 0 ] = chan_rate ( adap , G_TNLRATE0 ( v ) ) ; nic_rate [ 1 ] = chan_rate ( adap , G_TNLRATE1 ( v ) ) ; if ( adap -> chip_params -> nchan > 2 ) { nic_rate [ 2 ] = chan_rate ( adap , G_TNLRATE2 ( v ) ) ; nic_rate [ 3 ] = chan_rate ( adap , G_TNLRATE3 ( v ) ) ; } v = t4_read_reg ( adap , A_TP_TX_ORATE ) ; ofld_rate [ 0 ] = chan_rate ( adap , G_OFDRATE0 ( v ) ) ; ofld_rate [ 1 ] = chan_rate ( adap , G_OFDRATE1 ( v ) ) ; if ( adap -> chip_params -> nchan > 2 ) { ofld_rate [ 2 ] = chan_rate ( adap , G_OFDRATE2 ( v ) ) ; ofld_rate [ 3 ] = chan_rate ( adap , G_OFDRATE3 ( v ) ) ; } }
t4_get_chan_txrate - get the current per channel Tx rates
      @adap: the adapter
      @nic_rate: rates for NIC traffic
      @ofld_rate: rates for offloaded traffic
t4_get_chan_txrate - get the current per channel Tx rates @adap : the adapter @nic_rate : rates for NIC traffic @ofld_rate : rates for offloaded traffic