FreeBSD/sys/dev/cxgbe/common/t4_hw.c
/**
 *	t4_read_cimq_cfg - read CIM queue configuration
 *	@adap: the adapter
 *	@base: holds the queue base addresses in bytes
 *	@size: holds the queue sizes in bytes
 *	@thres: holds the queue full thresholds in bytes
 *
 *	Returns the current configuration of the CIM queues, starting with
 *	the IBQs, then the OBQs.
 */
read CIM queue configuration
@adap: the adapter
@base: holds the queue base addresses in bytes
@size: holds the queue sizes in bytes
@thres: holds the queue full thresholds in bytes

Returns the current configuration of the CIM queues, starting with
the IBQs, then the OBQs.
read CIM queue configuration @adap : the adapter @base : holds the queue base addresses in bytes @size : holds the queue sizes in bytes @thres : holds the queue full thresholds in bytes Returns the current configuration of the CIM queues starting with the IBQs then the OBQs .
void t4_read_cimq_cfg(struct adapter *adap, u16 *base, u16 *size, u16 *thres)
{
	unsigned int i, v;
	int cim_num_obq = adap->chip_params->cim_num_obq;
	for (i = 0; i < CIM_NUM_IBQ; i++) {
		t4_write_reg(adap, A_CIM_QUEUE_CONFIG_REF, F_IBQSELECT |
			     V_QUENUMSELECT(i));
		v = t4_read_reg(adap, A_CIM_QUEUE_CONFIG_CTRL);
		*base++ = G_CIMQBASE(v) * 256;
		*size++ = G_CIMQSIZE(v) * 256;
		*thres++ = G_QUEFULLTHRSH(v) * 8; 
	}
	for (i = 0; i < cim_num_obq; i++) {
		t4_write_reg(adap, A_CIM_QUEUE_CONFIG_REF, F_OBQSELECT |
			     V_QUENUMSELECT(i));
		v = t4_read_reg(adap, A_CIM_QUEUE_CONFIG_CTRL);
		*base++ = G_CIMQBASE(v) * 256;
		*size++ = G_CIMQSIZE(v) * 256;
	}
}
void t4_read_cimq_cfg ( struct adapter * adap , u16 * base , u16 * size , u16 * thres ) { unsigned int i , v ; int cim_num_obq = adap -> chip_params -> cim_num_obq ; for ( i = 0 ; i < CIM_NUM_IBQ ; i ++ ) { t4_write_reg ( adap , A_CIM_QUEUE_CONFIG_REF , F_IBQSELECT | V_QUENUMSELECT ( i ) ) ; v = t4_read_reg ( adap , A_CIM_QUEUE_CONFIG_CTRL ) ; * base ++ = G_CIMQBASE ( v ) * 256 ; * size ++ = G_CIMQSIZE ( v ) * 256 ; * thres ++ = G_QUEFULLTHRSH ( v ) * 8 ; } for ( i = 0 ; i < cim_num_obq ; i ++ ) { t4_write_reg ( adap , A_CIM_QUEUE_CONFIG_REF , F_OBQSELECT | V_QUENUMSELECT ( i ) ) ; v = t4_read_reg ( adap , A_CIM_QUEUE_CONFIG_CTRL ) ; * base ++ = G_CIMQBASE ( v ) * 256 ; * size ++ = G_CIMQSIZE ( v ) * 256 ; } }
t4_read_cimq_cfg - read CIM queue configuration
      @adap: the adapter
      @base: holds the queue base addresses in bytes
      @size: holds the queue sizes in bytes
      @thres: holds the queue full thresholds in bytes
t4_read_cimq_cfg - read CIM queue configuration @adap : the adapter @base : holds the queue base addresses in bytes @size : holds the queue sizes in bytes @thres : holds the queue full thresholds in bytes
/* value is in 256-byte units */ /* 8-byte unit */ /* value is in 256-byte units */