linux/drivers/net/ethernet/mellanox/mlxsw/item.h

/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
/* Copyright (c) 2015-2018 Mellanox Technologies. All rights reserved */

#ifndef _MLXSW_ITEM_H
#define _MLXSW_ITEM_H

#include <linux/types.h>
#include <linux/string.h>
#include <linux/bitops.h>

struct mlxsw_item {};

static inline unsigned int
__mlxsw_item_offset(const struct mlxsw_item *item, unsigned short index,
		    size_t typesize)
{}

static inline u8 __mlxsw_item_get8(const char *buf,
				   const struct mlxsw_item *item,
				   unsigned short index)
{}

static inline void __mlxsw_item_set8(char *buf, const struct mlxsw_item *item,
				     unsigned short index, u8 val)
{}

static inline u16 __mlxsw_item_get16(const char *buf,
				     const struct mlxsw_item *item,
				     unsigned short index)
{}

static inline void __mlxsw_item_set16(char *buf, const struct mlxsw_item *item,
				      unsigned short index, u16 val)
{}

static inline u32 __mlxsw_item_get32(const char *buf,
				     const struct mlxsw_item *item,
				     unsigned short index)
{}

static inline void __mlxsw_item_set32(char *buf, const struct mlxsw_item *item,
				      unsigned short index, u32 val)
{}

static inline u64 __mlxsw_item_get64(const char *buf,
				     const struct mlxsw_item *item,
				     unsigned short index)
{}

static inline void __mlxsw_item_set64(char *buf, const struct mlxsw_item *item,
				      unsigned short index, u64 val)
{}

static inline void __mlxsw_item_memcpy_from(const char *buf, char *dst,
					    const struct mlxsw_item *item,
					    unsigned short index)
{}

static inline void __mlxsw_item_memcpy_to(char *buf, const char *src,
					  const struct mlxsw_item *item,
					  unsigned short index)
{}

static inline char *__mlxsw_item_data(char *buf, const struct mlxsw_item *item,
				      unsigned short index)
{}

static inline u16
__mlxsw_item_bit_array_offset(const struct mlxsw_item *item,
			      u16 index, u8 *shift)
{}

static inline u8 __mlxsw_item_bit_array_get(const char *buf,
					    const struct mlxsw_item *item,
					    u16 index)
{}

static inline void __mlxsw_item_bit_array_set(char *buf,
					      const struct mlxsw_item *item,
					      u16 index, u8 val)
{}

#define __ITEM_NAME(_type, _cname, _iname)

/* _type: cmd_mbox, reg, etc.
 * _cname: containter name (e.g. command name, register name)
 * _iname: item name within the container
 */

#define MLXSW_ITEM8(_type, _cname, _iname, _offset, _shift, _sizebits)

#define MLXSW_ITEM8_INDEXED(_type, _cname, _iname, _offset, _shift, _sizebits,	\
			    _step, _instepoffset, _norealshift)

#define MLXSW_ITEM16(_type, _cname, _iname, _offset, _shift, _sizebits)

#define MLXSW_ITEM16_INDEXED(_type, _cname, _iname, _offset, _shift, _sizebits,	\
			     _step, _instepoffset, _norealshift)

#define MLXSW_ITEM32(_type, _cname, _iname, _offset, _shift, _sizebits)

#define LOCAL_PORT_LSB_SIZE
#define LOCAL_PORT_MSB_SIZE

#define MLXSW_ITEM32_LP(_type, _cname, _offset1, _shift1, _offset2, _shift2)

#define MLXSW_ITEM32_INDEXED(_type, _cname, _iname, _offset, _shift, _sizebits,	\
			     _step, _instepoffset, _norealshift)

#define MLXSW_ITEM64(_type, _cname, _iname, _offset, _shift, _sizebits)

#define MLXSW_ITEM64_INDEXED(_type, _cname, _iname, _offset, _shift,		\
			     _sizebits, _step, _instepoffset, _norealshift)

#define MLXSW_ITEM_BUF(_type, _cname, _iname, _offset, _sizebytes)

#define MLXSW_ITEM_BUF_INDEXED(_type, _cname, _iname, _offset, _sizebytes,	\
			       _step, _instepoffset)

#define MLXSW_ITEM_BIT_ARRAY(_type, _cname, _iname, _offset, _sizebytes,	\
			     _element_size)										\

#endif