src/dpdk/drivers/net/bnxt/tf_ulp/ulp_utils.c
static void
ulp_bs_get_lsb(uint8_t *src, uint16_t bitpos, uint8_t bitlen, uint8_t *dst)
{
	uint8_t bitoffs = bitpos % ULP_BLOB_BYTE;
	uint16_t index  = ULP_BITS_2_BYTE_NR(bitpos);
	uint8_t mask, partial, shift;

	shift = bitoffs;
	partial = ULP_BLOB_BYTE - bitoffs;
	if (bitoffs + bitlen <= ULP_BLOB_BYTE) {
		mask = ((1 << bitlen) - 1) << shift;
		*dst = (src[index] & mask) >> shift;
	} else {
		mask = ((1 << partial) - 1) << shift;
		*dst = (src[index] & mask) >> shift;
		index++;
		partial = bitlen - partial;
		mask = ((1 << partial) - 1);
		*dst |= (src[index] & mask) << (ULP_BLOB_BYTE - bitoffs);
	}
}
/* Get data from src and put into dst using little-endian format */
Get data from src and put into dst using little-endian format
Get data from src and put into dst using little - endian format
static void
ulp_bs_get_lsb(uint8_t *src, uint16_t bitpos, uint8_t bitlen, uint8_t *dst)
{
	uint8_t bitoffs = bitpos % ULP_BLOB_BYTE;
	uint16_t index  = ULP_BITS_2_BYTE_NR(bitpos);
	uint8_t mask, partial, shift;
	shift = bitoffs;
	partial = ULP_BLOB_BYTE - bitoffs;
	if (bitoffs + bitlen <= ULP_BLOB_BYTE) {
		mask = ((1 << bitlen) - 1) << shift;
		*dst = (src[index] & mask) >> shift;
	} else {
		mask = ((1 << partial) - 1) << shift;
		*dst = (src[index] & mask) >> shift;
		index++;
		partial = bitlen - partial;
		mask = ((1 << partial) - 1);
		*dst |= (src[index] & mask) << (ULP_BLOB_BYTE - bitoffs);
	}
}
static void ulp_bs_get_lsb ( uint8_t * src , uint16_t bitpos , uint8_t bitlen , uint8_t * dst ) { uint8_t bitoffs = bitpos % ULP_BLOB_BYTE ; uint16_t index = ULP_BITS_2_BYTE_NR ( bitpos ) ; uint8_t mask , partial , shift ; shift = bitoffs ; partial = ULP_BLOB_BYTE - bitoffs ; if ( bitoffs + bitlen <= ULP_BLOB_BYTE ) { mask = ( ( 1 << bitlen ) - 1 ) << shift ; * dst = ( src [ index ] & mask ) >> shift ; } else { mask = ( ( 1 << partial ) - 1 ) << shift ; * dst = ( src [ index ] & mask ) >> shift ; index ++ ; partial = bitlen - partial ; mask = ( ( 1 << partial ) - 1 ) ; * dst |= ( src [ index ] & mask ) << ( ULP_BLOB_BYTE - bitoffs ) ; } }
Get data from src and put into dst using little-endian format
Get data from src and put into dst using little - endian format