#include <linux/kernel.h>
#include <linux/bitops.h>
#include "spectrum.h"
#include "core.h"
#include "reg.h"
#include "resources.h"
struct mlxsw_sp2_kvdl_part_info { … };
#define MLXSW_SP2_KVDL_PART_INFO(_entry_type, _res_type, \
_usage_bit_count_res_id, _index_range_res_id) …
static const struct mlxsw_sp2_kvdl_part_info mlxsw_sp2_kvdl_parts_info[] = …;
#define MLXSW_SP2_KVDL_PARTS_INFO_LEN …
struct mlxsw_sp2_kvdl_part { … };
struct mlxsw_sp2_kvdl { … };
static int mlxsw_sp2_kvdl_part_find_zero_bits(struct mlxsw_sp2_kvdl_part *part,
unsigned int bit_count,
unsigned int *p_bit)
{ … }
static int mlxsw_sp2_kvdl_part_alloc(struct mlxsw_sp2_kvdl_part *part,
unsigned int size,
u32 *p_kvdl_index)
{ … }
static int mlxsw_sp2_kvdl_rec_del(struct mlxsw_sp *mlxsw_sp, u8 res_type,
u16 size, u32 kvdl_index)
{ … }
static void mlxsw_sp2_kvdl_part_free(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp2_kvdl_part *part,
unsigned int size, u32 kvdl_index)
{ … }
static int mlxsw_sp2_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, void *priv,
enum mlxsw_sp_kvdl_entry_type type,
unsigned int entry_count,
u32 *p_entry_index)
{ … }
static void mlxsw_sp2_kvdl_free(struct mlxsw_sp *mlxsw_sp, void *priv,
enum mlxsw_sp_kvdl_entry_type type,
unsigned int entry_count,
int entry_index)
{ … }
static int mlxsw_sp2_kvdl_alloc_size_query(struct mlxsw_sp *mlxsw_sp,
void *priv,
enum mlxsw_sp_kvdl_entry_type type,
unsigned int entry_count,
unsigned int *p_alloc_count)
{ … }
static struct mlxsw_sp2_kvdl_part *
mlxsw_sp2_kvdl_part_init(struct mlxsw_sp *mlxsw_sp,
const struct mlxsw_sp2_kvdl_part_info *info)
{ … }
static void mlxsw_sp2_kvdl_part_fini(struct mlxsw_sp2_kvdl_part *part)
{ … }
static int mlxsw_sp2_kvdl_parts_init(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp2_kvdl *kvdl)
{ … }
static void mlxsw_sp2_kvdl_parts_fini(struct mlxsw_sp2_kvdl *kvdl)
{ … }
static int mlxsw_sp2_kvdl_init(struct mlxsw_sp *mlxsw_sp, void *priv)
{ … }
static void mlxsw_sp2_kvdl_fini(struct mlxsw_sp *mlxsw_sp, void *priv)
{ … }
const struct mlxsw_sp_kvdl_ops mlxsw_sp2_kvdl_ops = …;