FreeBSD/sys/dev/cxgb/common/cxgb_t3_hw.c
/**
 *	t3_check_tpsram_version - read the tp sram version
 *	@adapter: the adapter
 *
 */
read the tp sram version
@adapter: the adapter
read the tp sram version @adapter : the adapter
int t3_check_tpsram_version(adapter_t *adapter)
{
	int ret;
	u32 vers;
	unsigned int major, minor;
	if (adapter->params.rev == T3_REV_A)
		return 0;
	ret = t3_get_tp_version(adapter, &vers);
	if (ret)
		return ret;
	vers = t3_read_reg(adapter, A_TP_EMBED_OP_FIELD1);
	major = G_TP_VERSION_MAJOR(vers);
	minor = G_TP_VERSION_MINOR(vers);
	if (major == TP_VERSION_MAJOR && minor == TP_VERSION_MINOR)
		return 0;
	else {
		CH_ERR(adapter, "found wrong TP version (%u.%u), "
		       "driver compiled for version %d.%d\n", major, minor,
		       TP_VERSION_MAJOR, TP_VERSION_MINOR);
	}
	return -EINVAL;
}
int t3_check_tpsram_version ( adapter_t * adapter ) { int ret ; u32 vers ; unsigned int major , minor ; if ( adapter -> params . rev == T3_REV_A ) return 0 ; ret = t3_get_tp_version ( adapter , & vers ) ; if ( ret ) return ret ; vers = t3_read_reg ( adapter , A_TP_EMBED_OP_FIELD1 ) ; major = G_TP_VERSION_MAJOR ( vers ) ; minor = G_TP_VERSION_MINOR ( vers ) ; if ( major == TP_VERSION_MAJOR && minor == TP_VERSION_MINOR ) return 0 ; else { CH_ERR ( adapter , " " " \n " , major , minor , TP_VERSION_MAJOR , TP_VERSION_MINOR ) ; } return - EINVAL ; }
t3_check_tpsram_version - read the tp sram version
      @adapter: the adapter
t3_check_tpsram_version - read the tp sram version @adapter : the adapter