* data [in] The value is written into this variable. It is going to be in the
* same byte order as it was written.
*
- * size [in] The size in bytes of the value beingritten into this
+ * size [in] The size in bytes of the value being written into this
* variable.
*
* returns 0 on success
datalen,
data);
if (!rc) {
- BNXT_TF_DBG(ERR, "Failed ro write blob\n");
+ BNXT_TF_DBG(ERR, "Failed to write blob\n");
return 0;
}
blob->write_idx += datalen;
datalen,
data);
if (!rc) {
- BNXT_TF_DBG(ERR, "Failed ro write blob\n");
+ BNXT_TF_DBG(ERR, "Failed to write blob\n");
return 0;
}
/* copy the previously stored data */
*
* data [in] 32-bit value to be added to the blob.
*
- * datalen [in] The number of bits to be added ot the blob.
+ * datalen [in] The number of bits to be added to the blob.
*
* The offset of the data is updated after each push of data.
* NULL returned on error, pointer pushed value otherwise.
* The offset of the data is updated after each push of data.
* NULL returned on error, pointer pushed value otherwise.
*/
-uint32_t
+int32_t
ulp_blob_push_encap(struct ulp_blob *blob,
uint8_t *data,
uint32_t datalen)
if (!blob || !data ||
datalen > (uint32_t)(blob->bitlen - blob->write_idx)) {
BNXT_TF_DBG(ERR, "invalid argument\n");
- return 0;
+ return -1;
}
initial_size = ULP_BYTE_2_BITS(sizeof(uint64_t)) -
}
if (!ulp_blob_push(blob, val, size)) {
BNXT_TF_DBG(ERR, "push field failed\n");
- return 0;
+ return -1;
}
val += ULP_BITS_2_BYTE(size);
write_size -= size;
}
/* Function to check if bitmap is not zero. Return 1 on success */
-uint32_t ulp_bitmap_notzero(uint8_t *bitmap, int32_t size)
+uint32_t ulp_bitmap_notzero(const uint8_t *bitmap, int32_t size)
{
while (size-- > 0) {
if (*bitmap != 0)