linux/drivers/net/ethernet/rocker/rocker_tlv.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * drivers/net/ethernet/rocker/rocker_tlv.h - Rocker switch device driver
 * Copyright (c) 2014-2016 Jiri Pirko <[email protected]>
 * Copyright (c) 2014 Scott Feldman <[email protected]>
 */

#ifndef _ROCKER_TLV_H
#define _ROCKER_TLV_H

#include <linux/types.h>

#include "rocker_hw.h"
#include "rocker.h"

#define ROCKER_TLV_ALIGNTO
#define ROCKER_TLV_ALIGN(len)
#define ROCKER_TLV_HDRLEN

/*  <------- ROCKER_TLV_HDRLEN -------> <--- ROCKER_TLV_ALIGN(payload) --->
 * +-----------------------------+- - -+- - - - - - - - - - - - - - -+- - -+
 * |             Header          | Pad |           Payload           | Pad |
 * |      (struct rocker_tlv)    | ing |                             | ing |
 * +-----------------------------+- - -+- - - - - - - - - - - - - - -+- - -+
 *  <--------------------------- tlv->len -------------------------->
 */

static inline struct rocker_tlv *rocker_tlv_next(const struct rocker_tlv *tlv,
						 int *remaining)
{}

static inline int rocker_tlv_ok(const struct rocker_tlv *tlv, int remaining)
{}

#define rocker_tlv_for_each(pos, head, len, rem)

#define rocker_tlv_for_each_nested(pos, tlv, rem)

static inline int rocker_tlv_attr_size(int payload)
{}

static inline int rocker_tlv_total_size(int payload)
{}

static inline int rocker_tlv_padlen(int payload)
{}

static inline int rocker_tlv_type(const struct rocker_tlv *tlv)
{}

static inline void *rocker_tlv_data(const struct rocker_tlv *tlv)
{}

static inline int rocker_tlv_len(const struct rocker_tlv *tlv)
{}

static inline u8 rocker_tlv_get_u8(const struct rocker_tlv *tlv)
{}

static inline u16 rocker_tlv_get_u16(const struct rocker_tlv *tlv)
{}

static inline __be16 rocker_tlv_get_be16(const struct rocker_tlv *tlv)
{}

static inline u32 rocker_tlv_get_u32(const struct rocker_tlv *tlv)
{}

static inline u64 rocker_tlv_get_u64(const struct rocker_tlv *tlv)
{}

void rocker_tlv_parse(const struct rocker_tlv **tb, int maxtype,
		      const char *buf, int buf_len);

static inline void rocker_tlv_parse_nested(const struct rocker_tlv **tb,
					   int maxtype,
					   const struct rocker_tlv *tlv)
{}

static inline void
rocker_tlv_parse_desc(const struct rocker_tlv **tb, int maxtype,
		      const struct rocker_desc_info *desc_info)
{}

static inline struct rocker_tlv *
rocker_tlv_start(struct rocker_desc_info *desc_info)
{}

int rocker_tlv_put(struct rocker_desc_info *desc_info,
		   int attrtype, int attrlen, const void *data);

static inline int
rocker_tlv_put_u8(struct rocker_desc_info *desc_info, int attrtype, u8 value)
{}

static inline int
rocker_tlv_put_u16(struct rocker_desc_info *desc_info, int attrtype, u16 value)
{}

static inline int
rocker_tlv_put_be16(struct rocker_desc_info *desc_info, int attrtype, __be16 value)
{}

static inline int
rocker_tlv_put_u32(struct rocker_desc_info *desc_info, int attrtype, u32 value)
{}

static inline int
rocker_tlv_put_be32(struct rocker_desc_info *desc_info, int attrtype, __be32 value)
{}

static inline int
rocker_tlv_put_u64(struct rocker_desc_info *desc_info, int attrtype, u64 value)
{}

static inline struct rocker_tlv *
rocker_tlv_nest_start(struct rocker_desc_info *desc_info, int attrtype)
{}

static inline void rocker_tlv_nest_end(struct rocker_desc_info *desc_info,
				       struct rocker_tlv *start)
{}

static inline void rocker_tlv_nest_cancel(struct rocker_desc_info *desc_info,
					  const struct rocker_tlv *start)
{}

#endif