src/dpdk/drivers/net/bnxt/tf_ulp/ulp_mapper.c
static int32_t
ulp_mapper_glb_resource_write(struct bnxt_ulp_mapper_data *data,
			      struct bnxt_ulp_glb_resource_info *res,
			      uint64_t regval)
{
	struct bnxt_ulp_mapper_glb_resource_entry *ent;

	/* validate the arguments */
	if (!data || res->direction >= TF_DIR_MAX ||
	    res->glb_regfile_index >= BNXT_ULP_GLB_REGFILE_INDEX_LAST)
		return -EINVAL;

	/* write to the mapper data */
	ent = &data->glb_res_tbl[res->direction][res->glb_regfile_index];
	ent->resource_func = res->resource_func;
	ent->resource_type = res->resource_type;
	ent->resource_hndl = regval;
	return 0;
}
/*
 * Write a global resource to the mapper global resource list
 *
 * The regval value must be in big-endian.
 *
 * return 0 on success.
 */
Write a global resource to the mapper global resource list
The regval value must be in big-endian.

return 0 on success.
Write a global resource to the mapper global resource list The regval value must be in big - endian . return 0 on success .
static int32_t
ulp_mapper_glb_resource_write(struct bnxt_ulp_mapper_data *data,
			      struct bnxt_ulp_glb_resource_info *res,
			      uint64_t regval)
{
	struct bnxt_ulp_mapper_glb_resource_entry *ent;
	if (!data || res->direction >= TF_DIR_MAX ||
	    res->glb_regfile_index >= BNXT_ULP_GLB_REGFILE_INDEX_LAST)
		return -EINVAL;
	ent = &data->glb_res_tbl[res->direction][res->glb_regfile_index];
	ent->resource_func = res->resource_func;
	ent->resource_type = res->resource_type;
	ent->resource_hndl = regval;
	return 0;
}
static int32_t ulp_mapper_glb_resource_write ( struct bnxt_ulp_mapper_data * data , struct bnxt_ulp_glb_resource_info * res , uint64_t regval ) { struct bnxt_ulp_mapper_glb_resource_entry * ent ; if ( ! data || res -> direction >= TF_DIR_MAX || res -> glb_regfile_index >= BNXT_ULP_GLB_REGFILE_INDEX_LAST ) return - EINVAL ; ent = & data -> glb_res_tbl [ res -> direction ] [ res -> glb_regfile_index ] ; ent -> resource_func = res -> resource_func ; ent -> resource_type = res -> resource_type ; ent -> resource_hndl = regval ; return 0 ; }
Write a global resource to the mapper global resource list
 The regval value must be in big-endian.
Write a global resource to the mapper global resource list The regval value must be in big - endian .
/* validate the arguments */ /* write to the mapper data */