FreeBSD/sys/dev/cxgb/common/cxgb_t3_hw.c
/**
 *	clear_sge_ctxt - completely clear an SGE context
 *	@adapter: the adapter
 *	@id: the context id
 *	@type: the context type
 *
 *	Completely clear an SGE context.  Used predominantly at post-reset
 *	initialization.  Note in particular that we don't skip writing to any
 *	"sensitive bits" in the contexts the way that t3_sge_write_context()
 *	does ...
 */
completely clear an SGE context
@adapter: the adapter
@id: the context id
@type: the context type

Completely clear an SGE context.  Used predominantly at post-reset
initialization.  Note in particular that we don't skip writing to any
"sensitive bits" in the contexts the way that t3_sge_write_context()
does
completely clear an SGE context @adapter : the adapter @id : the context id @type : the context type Completely clear an SGE context . Used predominantly at post - reset initialization . Note in particular that we don ' t skip writing to any " sensitive bits " in the contexts the way that t3_sge_write_context () does
static int clear_sge_ctxt(adapter_t *adap, unsigned int id, unsigned int type)
{
	t3_write_reg(adap, A_SG_CONTEXT_DATA0, 0);
	t3_write_reg(adap, A_SG_CONTEXT_DATA1, 0);
	t3_write_reg(adap, A_SG_CONTEXT_DATA2, 0);
	t3_write_reg(adap, A_SG_CONTEXT_DATA3, 0);
	t3_write_reg(adap, A_SG_CONTEXT_MASK0, 0xffffffff);
	t3_write_reg(adap, A_SG_CONTEXT_MASK1, 0xffffffff);
	t3_write_reg(adap, A_SG_CONTEXT_MASK2, 0xffffffff);
	t3_write_reg(adap, A_SG_CONTEXT_MASK3, 0xffffffff);
	t3_write_reg(adap, A_SG_CONTEXT_CMD,
		     V_CONTEXT_CMD_OPCODE(1) | type | V_CONTEXT(id));
	return t3_wait_op_done(adap, A_SG_CONTEXT_CMD, F_CONTEXT_CMD_BUSY,
			       0, SG_CONTEXT_CMD_ATTEMPTS, 1);
}
static int clear_sge_ctxt ( adapter_t * adap , unsigned int id , unsigned int type ) { t3_write_reg ( adap , A_SG_CONTEXT_DATA0 , 0 ) ; t3_write_reg ( adap , A_SG_CONTEXT_DATA1 , 0 ) ; t3_write_reg ( adap , A_SG_CONTEXT_DATA2 , 0 ) ; t3_write_reg ( adap , A_SG_CONTEXT_DATA3 , 0 ) ; t3_write_reg ( adap , A_SG_CONTEXT_MASK0 , 0xffffffff ) ; t3_write_reg ( adap , A_SG_CONTEXT_MASK1 , 0xffffffff ) ; t3_write_reg ( adap , A_SG_CONTEXT_MASK2 , 0xffffffff ) ; t3_write_reg ( adap , A_SG_CONTEXT_MASK3 , 0xffffffff ) ; t3_write_reg ( adap , A_SG_CONTEXT_CMD , V_CONTEXT_CMD_OPCODE ( 1 ) | type | V_CONTEXT ( id ) ) ; return t3_wait_op_done ( adap , A_SG_CONTEXT_CMD , F_CONTEXT_CMD_BUSY , 0 , SG_CONTEXT_CMD_ATTEMPTS , 1 ) ; }
clear_sge_ctxt - completely clear an SGE context
      @adapter: the adapter
      @id: the context id
      @type: the context type
clear_sge_ctxt - completely clear an SGE context @adapter : the adapter @id : the context id @type : the context type