linux/drivers/net/ethernet/microchip/sparx5/sparx5_sdlb.c

// SPDX-License-Identifier: GPL-2.0+
/* Microchip Sparx5 Switch driver
 *
 * Copyright (c) 2023 Microchip Technology Inc. and its subsidiaries.
 */

#include "sparx5_main_regs.h"
#include "sparx5_main.h"

struct sparx5_sdlb_group sdlb_groups[SPX5_SDLB_GROUP_CNT] =;

int sparx5_sdlb_clk_hz_get(struct sparx5 *sparx5)
{}

static int sparx5_sdlb_pup_interval_get(struct sparx5 *sparx5, u32 max_token,
					u64 max_rate)
{}

int sparx5_sdlb_pup_token_get(struct sparx5 *sparx5, u32 pup_interval, u64 rate)
{}

static void sparx5_sdlb_group_disable(struct sparx5 *sparx5, u32 group)
{}

static void sparx5_sdlb_group_enable(struct sparx5 *sparx5, u32 group)
{}

static u32 sparx5_sdlb_group_get_first(struct sparx5 *sparx5, u32 group)
{}

static u32 sparx5_sdlb_group_get_next(struct sparx5 *sparx5, u32 group,
				      u32 lb)
{}

static bool sparx5_sdlb_group_is_first(struct sparx5 *sparx5, u32 group,
				       u32 lb)
{}

static bool sparx5_sdlb_group_is_last(struct sparx5 *sparx5, u32 group,
				      u32 lb)
{}

static bool sparx5_sdlb_group_is_empty(struct sparx5 *sparx5, u32 group)
{}

static u32 sparx5_sdlb_group_get_last(struct sparx5 *sparx5, u32 group)
{}

static bool sparx5_sdlb_group_is_singular(struct sparx5 *sparx5, u32 group)
{}

static int sparx5_sdlb_group_get_adjacent(struct sparx5 *sparx5, u32 group,
					  u32 idx, u32 *prev, u32 *next,
					  u32 *first)
{}

static int sparx5_sdlb_group_get_count(struct sparx5 *sparx5, u32 group)
{}

int sparx5_sdlb_group_get_by_rate(struct sparx5 *sparx5, u32 rate, u32 burst)
{}

int sparx5_sdlb_group_get_by_index(struct sparx5 *sparx5, u32 idx, u32 *group)
{}

static int sparx5_sdlb_group_link(struct sparx5 *sparx5, u32 group, u32 idx,
				  u32 first, u32 next, bool empty)
{
	/* Stop leaking */
	sparx5_sdlb_group_disable(sparx5, group);

	if (empty)
		return 0;

	/* Link insertion lb to next lb */
	spx5_wr(ANA_AC_SDLB_XLB_NEXT_LBSET_NEXT_SET(next) |
			ANA_AC_SDLB_XLB_NEXT_LBGRP_SET(group),
		sparx5, ANA_AC_SDLB_XLB_NEXT(idx));

	/* Set the first lb */
	spx5_wr(ANA_AC_SDLB_XLB_START_LBSET_START_SET(first), sparx5,
		ANA_AC_SDLB_XLB_START(group));

	/* Start leaking */
	sparx5_sdlb_group_enable(sparx5, group);

	return 0;
};

int sparx5_sdlb_group_add(struct sparx5 *sparx5, u32 group, u32 idx)
{}

int sparx5_sdlb_group_del(struct sparx5 *sparx5, u32 group, u32 idx)
{}

void sparx5_sdlb_group_init(struct sparx5 *sparx5, u64 max_rate, u32 min_burst,
			    u32 frame_size, u32 idx)
{}