FreeBSD/sys/dev/cxgb/common/cxgb_t3_hw.c
/**
 *	t3_tp_set_coalescing_size - set receive coalescing size
 *	@adap: the adapter
 *	@size: the receive coalescing size
 *	@psh: whether a set PSH bit should deliver coalesced data
 *
 *	Set the receive coalescing size and PSH bit handling.
 */
set receive coalescing size
@adap: the adapter
@size: the receive coalescing size
@psh: whether a set PSH bit should deliver coalesced data

Set the receive coalescing size and PSH bit handling.
set receive coalescing size @adap : the adapter @size : the receive coalescing size @psh : whether a set PSH bit should deliver coalesced data Set the receive coalescing size and PSH bit handling .
int t3_tp_set_coalescing_size(adapter_t *adap, unsigned int size, int psh)
{
	u32 val;
	if (size > MAX_RX_COALESCING_LEN)
		return -EINVAL;
	val = t3_read_reg(adap, A_TP_PARA_REG3);
	val &= ~(F_RXCOALESCEENABLE | F_RXCOALESCEPSHEN);
	if (size) {
		val |= F_RXCOALESCEENABLE;
		if (psh)
			val |= F_RXCOALESCEPSHEN;
		size = min(MAX_RX_COALESCING_LEN, size);
		t3_write_reg(adap, A_TP_PARA_REG2, V_RXCOALESCESIZE(size) |
			     V_MAXRXDATA(MAX_RX_COALESCING_LEN));
	}
	t3_write_reg(adap, A_TP_PARA_REG3, val);
	return 0;
}
int t3_tp_set_coalescing_size ( adapter_t * adap , unsigned int size , int psh ) { u32 val ; if ( size > MAX_RX_COALESCING_LEN ) return - EINVAL ; val = t3_read_reg ( adap , A_TP_PARA_REG3 ) ; val &= ~ ( F_RXCOALESCEENABLE | F_RXCOALESCEPSHEN ) ; if ( size ) { val |= F_RXCOALESCEENABLE ; if ( psh ) val |= F_RXCOALESCEPSHEN ; size = min ( MAX_RX_COALESCING_LEN , size ) ; t3_write_reg ( adap , A_TP_PARA_REG2 , V_RXCOALESCESIZE ( size ) | V_MAXRXDATA ( MAX_RX_COALESCING_LEN ) ) ; } t3_write_reg ( adap , A_TP_PARA_REG3 , val ) ; return 0 ; }
t3_tp_set_coalescing_size - set receive coalescing size
      @adap: the adapter
      @size: the receive coalescing size
      @psh: whether a set PSH bit should deliver coalesced data
t3_tp_set_coalescing_size - set receive coalescing size @adap : the adapter @size : the receive coalescing size @psh : whether a set PSH bit should deliver coalesced data