FreeBSD/sys/dev/cxgb/common/cxgb_t3_hw.c
/**
 * 	t3_sge_write_context - write an SGE context
 * 	@adapter: the adapter
 * 	@id: the context id
 * 	@type: the context type
 *
 * 	Program an SGE context with the values already loaded in the
 * 	CONTEXT_DATA? registers.
 */
write an SGE context
@adapter: the adapter
@id: the context id
@type: the context type

Program an SGE context with the values already loaded in the
CONTEXT_DATA. registers.
write an SGE context @adapter : the adapter @id : the context id @type : the context type Program an SGE context with the values already loaded in the CONTEXT_DATA . registers .
static int t3_sge_write_context(adapter_t *adapter, unsigned int id,
				unsigned int type)
{
	if (type == F_RESPONSEQ) {
		t3_write_reg(adapter, A_SG_CONTEXT_MASK0, 0xffffffff);
		t3_write_reg(adapter, A_SG_CONTEXT_MASK1, 0xffffffff);
		t3_write_reg(adapter, A_SG_CONTEXT_MASK2, 0x17ffffff);
		t3_write_reg(adapter, A_SG_CONTEXT_MASK3, 0xffffffff);
	} else {
		t3_write_reg(adapter, A_SG_CONTEXT_MASK0, 0xffffffff);
		t3_write_reg(adapter, A_SG_CONTEXT_MASK1, 0xffffffff);
		t3_write_reg(adapter, A_SG_CONTEXT_MASK2, 0xffffffff);
		t3_write_reg(adapter, A_SG_CONTEXT_MASK3, 0xffffffff);
	}
	t3_write_reg(adapter, A_SG_CONTEXT_CMD,
		     V_CONTEXT_CMD_OPCODE(1) | type | V_CONTEXT(id));
	return t3_wait_op_done(adapter, A_SG_CONTEXT_CMD, F_CONTEXT_CMD_BUSY,
			       0, SG_CONTEXT_CMD_ATTEMPTS, 1);
}
static int t3_sge_write_context ( adapter_t * adapter , unsigned int id , unsigned int type ) { if ( type == F_RESPONSEQ ) { t3_write_reg ( adapter , A_SG_CONTEXT_MASK0 , 0xffffffff ) ; t3_write_reg ( adapter , A_SG_CONTEXT_MASK1 , 0xffffffff ) ; t3_write_reg ( adapter , A_SG_CONTEXT_MASK2 , 0x17ffffff ) ; t3_write_reg ( adapter , A_SG_CONTEXT_MASK3 , 0xffffffff ) ; } else { t3_write_reg ( adapter , A_SG_CONTEXT_MASK0 , 0xffffffff ) ; t3_write_reg ( adapter , A_SG_CONTEXT_MASK1 , 0xffffffff ) ; t3_write_reg ( adapter , A_SG_CONTEXT_MASK2 , 0xffffffff ) ; t3_write_reg ( adapter , A_SG_CONTEXT_MASK3 , 0xffffffff ) ; } t3_write_reg ( adapter , A_SG_CONTEXT_CMD , V_CONTEXT_CMD_OPCODE ( 1 ) | type | V_CONTEXT ( id ) ) ; return t3_wait_op_done ( adapter , A_SG_CONTEXT_CMD , F_CONTEXT_CMD_BUSY , 0 , SG_CONTEXT_CMD_ATTEMPTS , 1 ) ; }
t3_sge_write_context - write an SGE context
      @adapter: the adapter
      @id: the context id
      @type: the context type
t3_sge_write_context - write an SGE context @adapter : the adapter @id : the context id @type : the context type
/*
		 * Can't write the Response Queue Context bits for
		 * Interrupt Armed or the Reserve bits after the chip
		 * has been initialized out of reset.  Writing to these
		 * bits can confuse the hardware.
		 */