#ifndef _FBNIC_TLV_H_
#define _FBNIC_TLV_H_
#include <asm/byteorder.h>
#include <linux/bits.h>
#include <linux/const.h>
#include <linux/types.h>
#define FBNIC_TLV_MSG_ALIGN(len) …
#define FBNIC_TLV_MSG_SIZE(len) …
struct fbnic_tlv_hdr { … };
#define FBNIC_TLV_RESULTS_MAX …
struct fbnic_tlv_msg { … };
#define FBNIC_TLV_MSG_ID_UNKNOWN …
enum fbnic_tlv_type { … };
struct fbnic_tlv_index { … };
#define TLV_MAX_DATA …
#define FBNIC_TLV_ATTR_ID_UNKNOWN …
#define FBNIC_TLV_ATTR_STRING(id, len) …
#define FBNIC_TLV_ATTR_FLAG(id) …
#define FBNIC_TLV_ATTR_U32(id) …
#define FBNIC_TLV_ATTR_U64(id) …
#define FBNIC_TLV_ATTR_S32(id) …
#define FBNIC_TLV_ATTR_S64(id) …
#define FBNIC_TLV_ATTR_MAC_ADDR(id) …
#define FBNIC_TLV_ATTR_NESTED(id) …
#define FBNIC_TLV_ATTR_ARRAY(id) …
#define FBNIC_TLV_ATTR_RAW_DATA(id) …
#define FBNIC_TLV_ATTR_LAST …
struct fbnic_tlv_parser { … };
#define FBNIC_TLV_PARSER(id, attr, func) …
static inline void *
fbnic_tlv_attr_get_value_ptr(struct fbnic_tlv_msg *attr)
{ … }
static inline bool fbnic_tlv_attr_get_bool(struct fbnic_tlv_msg *attr)
{ … }
u64 fbnic_tlv_attr_get_unsigned(struct fbnic_tlv_msg *attr);
s64 fbnic_tlv_attr_get_signed(struct fbnic_tlv_msg *attr);
size_t fbnic_tlv_attr_get_string(struct fbnic_tlv_msg *attr, char *str,
size_t max_size);
#define get_unsigned_result(id, location) …
#define get_signed_result(id, location) …
#define get_string_result(id, size, str, max_size) …
#define get_bool(id) …
struct fbnic_tlv_msg *fbnic_tlv_msg_alloc(u16 msg_id);
int fbnic_tlv_attr_put_flag(struct fbnic_tlv_msg *msg, const u16 attr_id);
int fbnic_tlv_attr_put_value(struct fbnic_tlv_msg *msg, const u16 attr_id,
const void *value, const int len);
int __fbnic_tlv_attr_put_int(struct fbnic_tlv_msg *msg, const u16 attr_id,
s64 value, const int len);
#define fbnic_tlv_attr_put_int(msg, attr_id, value) …
int fbnic_tlv_attr_put_mac_addr(struct fbnic_tlv_msg *msg, const u16 attr_id,
const u8 *mac_addr);
int fbnic_tlv_attr_put_string(struct fbnic_tlv_msg *msg, u16 attr_id,
const char *string);
struct fbnic_tlv_msg *fbnic_tlv_attr_nest_start(struct fbnic_tlv_msg *msg,
u16 attr_id);
void fbnic_tlv_attr_nest_stop(struct fbnic_tlv_msg *msg);
void fbnic_tlv_attr_addr_copy(u8 *dest, struct fbnic_tlv_msg *src);
int fbnic_tlv_attr_parse_array(struct fbnic_tlv_msg *attr, int len,
struct fbnic_tlv_msg **results,
const struct fbnic_tlv_index *tlv_index,
u16 tlv_attr_id, size_t array_len);
int fbnic_tlv_attr_parse(struct fbnic_tlv_msg *attr, int len,
struct fbnic_tlv_msg **results,
const struct fbnic_tlv_index *tlv_index);
int fbnic_tlv_msg_parse(void *opaque, struct fbnic_tlv_msg *msg,
const struct fbnic_tlv_parser *parser);
int fbnic_tlv_parser_error(void *opaque, struct fbnic_tlv_msg **results);
#define FBNIC_TLV_MSG_ERROR …
#endif