FreeBSD/sys/dev/cxgb/common/cxgb_t3_hw.c
/**
 *	t3_cim_ctl_blk_read - read a block from CIM control region
 *	@adap: the adapter
 *	@addr: the start address within the CIM control region
 *	@n: number of words to read
 *	@valp: where to store the result
 *
 *	Reads a block of 4-byte words from the CIM control region.
 */
read a block from CIM control region
@adap: the adapter
@addr: the start address within the CIM control region
@n: number of words to read
@valp: where to store the result

Reads a block of 4-byte words from the CIM control region.
read a block from CIM control region @adap : the adapter @addr : the start address within the CIM control region @n : number of words to read @valp : where to store the result Reads a block of 4 - byte words from the CIM control region .
int t3_cim_ctl_blk_read(adapter_t *adap, unsigned int addr, unsigned int n,
			unsigned int *valp)
{
	int ret = 0;
	if (t3_read_reg(adap, A_CIM_HOST_ACC_CTRL) & F_HOSTBUSY)
		return -EBUSY;
	for ( ; !ret && n--; addr += 4) {
		t3_write_reg(adap, A_CIM_HOST_ACC_CTRL, CIM_CTL_BASE + addr);
		ret = t3_wait_op_done(adap, A_CIM_HOST_ACC_CTRL, F_HOSTBUSY,
				      0, 5, 2);
		if (!ret)
			*valp++ = t3_read_reg(adap, A_CIM_HOST_ACC_DATA);
	}
	return ret;
}
int t3_cim_ctl_blk_read ( adapter_t * adap , unsigned int addr , unsigned int n , unsigned int * valp ) { int ret = 0 ; if ( t3_read_reg ( adap , A_CIM_HOST_ACC_CTRL ) & F_HOSTBUSY ) return - EBUSY ; for ( ; ! ret && n -- ; addr += 4 ) { t3_write_reg ( adap , A_CIM_HOST_ACC_CTRL , CIM_CTL_BASE + addr ) ; ret = t3_wait_op_done ( adap , A_CIM_HOST_ACC_CTRL , F_HOSTBUSY , 0 , 5 , 2 ) ; if ( ! ret ) * valp ++ = t3_read_reg ( adap , A_CIM_HOST_ACC_DATA ) ; } return ret ; }
t3_cim_ctl_blk_read - read a block from CIM control region
      @adap: the adapter
      @addr: the start address within the CIM control region
      @n: number of words to read
      @valp: where to store the result
t3_cim_ctl_blk_read - read a block from CIM control region @adap : the adapter @addr : the start address within the CIM control region @n : number of words to read @valp : where to store the result