1 /* SPDX-License-Identifier: BSD-3-Clause */
4 * This is a copy from upstream:
5 * https://chromium.googlesource.com/chromiumos/platform/vpd/+/master/include/lib/vpd_decode.h
19 VPD_TYPE_TERMINATOR
= 0,
22 VPD_TYPE_IMPLICIT_TERMINATOR
= 0xff,
25 /* Callback for vpd_decode_string to invoke. */
26 typedef int vpd_decode_callback(
27 const u8
*key
, u32 key_len
, const u8
*value
, u32 value_len
,
33 * Given the encoded string, this function invokes callback with extracted
34 * (key, value). The *consumed will be incremented by the number of bytes
35 * consumed in this function.
37 * The input_buf points to the first byte of the input buffer.
39 * The *consumed starts from 0, which is actually the next byte to be decoded.
40 * It can be non-zero to be used in multiple calls.
42 * If one entry is successfully decoded, sends it to callback and returns the
45 int vpd_decode_string(
46 const u32 max_len
, const u8
*input_buf
, u32
*consumed
,
47 vpd_decode_callback callback
, void *callback_arg
);
49 #endif /* __VPD_DECODE_H */