src/dpdk/drivers/net/bnxt/tf_ulp/ulp_utils.c
int32_t
ulp_blob_pull(struct ulp_blob *blob, uint8_t *data, uint32_t data_size,
	      uint16_t offset, uint16_t len)
{
	/* validate the arguments */
	if (!blob || (offset + len) > blob->bitlen ||
	    ULP_BYTE_2_BITS(data_size) < len) {
		BNXT_TF_DBG(ERR, "invalid argument\n");
		return -1; /* failure */
	}

	if (blob->byte_order == BNXT_ULP_BYTE_ORDER_BE) {
		BNXT_TF_DBG(ERR, "Big endian pull not implemented\n");
		return -1; /* failure */
	}
	ulp_bs_pull_lsb(blob->data, data, data_size, offset, len);
	return 0;
}
/*
 * Extract data from the binary blob using given offset.
 *
 * blob [in] The blob that data is extracted from. The blob must
 * be initialized prior to pulling data.
 *
 * data [in] A pointer to put the data.
 * data_size [in] size of the data buffer in bytes.
 *offset [in] - Offset in the blob to extract the data in bits format.
 * len [in] The number of bits to be pulled from the blob.
 *
 * Output: zero on success, -1 on failure
 */
Extract data from the binary blob using given offset.
blob [in] The blob that data is extracted from. The blob must
be initialized prior to pulling data.

data [in] A pointer to put the data.
data_size [in] size of the data buffer in bytes.
offset [in] - Offset in the blob to extract the data in bits format.
len [in] The number of bits to be pulled from the blob.

zero on success, -1 on failure
Extract data from the binary blob using given offset . blob [ in ] The blob that data is extracted from . The blob must be initialized prior to pulling data . data [ in ] A pointer to put the data . data_size [ in ] size of the data buffer in bytes . offset [ in ] - Offset in the blob to extract the data in bits format . len [ in ] The number of bits to be pulled from the blob . zero on success - 1 on failure
int32_t
ulp_blob_pull(struct ulp_blob *blob, uint8_t *data, uint32_t data_size,
	      uint16_t offset, uint16_t len)
{
	if (!blob || (offset + len) > blob->bitlen ||
	    ULP_BYTE_2_BITS(data_size) < len) {
		BNXT_TF_DBG(ERR, "invalid argument\n");
		return -1; 
	}
	if (blob->byte_order == BNXT_ULP_BYTE_ORDER_BE) {
		BNXT_TF_DBG(ERR, "Big endian pull not implemented\n");
		return -1; 
	}
	ulp_bs_pull_lsb(blob->data, data, data_size, offset, len);
	return 0;
}
int32_t ulp_blob_pull ( struct ulp_blob * blob , uint8_t * data , uint32_t data_size , uint16_t offset , uint16_t len ) { if ( ! blob || ( offset + len ) > blob -> bitlen || ULP_BYTE_2_BITS ( data_size ) < len ) { BNXT_TF_DBG ( ERR , " \n " ) ; return -1 ; } if ( blob -> byte_order == BNXT_ULP_BYTE_ORDER_BE ) { BNXT_TF_DBG ( ERR , " \n " ) ; return -1 ; } ulp_bs_pull_lsb ( blob -> data , data , data_size , offset , len ) ; return 0 ; }
Extract data from the binary blob using given offset.
Extract data from the binary blob using given offset .
/* validate the arguments */ /* failure */ /* failure */