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

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

#include <net/switchdev.h>
#include <linux/if_bridge.h>
#include <linux/iopoll.h>

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

/* Commands for Mac Table Command register */
#define MAC_CMD_LEARN
#define MAC_CMD_UNLEARN
#define MAC_CMD_LOOKUP
#define MAC_CMD_READ
#define MAC_CMD_WRITE
#define MAC_CMD_SCAN
#define MAC_CMD_FIND_SMALLEST
#define MAC_CMD_CLEAR_ALL

/* Commands for MAC_ENTRY_ADDR_TYPE */
#define MAC_ENTRY_ADDR_TYPE_UPSID_PN
#define MAC_ENTRY_ADDR_TYPE_UPSID_CPU_OR_INT
#define MAC_ENTRY_ADDR_TYPE_GLAG
#define MAC_ENTRY_ADDR_TYPE_MC_IDX

#define TABLE_UPDATE_SLEEP_US
#define TABLE_UPDATE_TIMEOUT_US

struct sparx5_mact_entry {};

static int sparx5_mact_get_status(struct sparx5 *sparx5)
{}

static int sparx5_mact_wait_for_completion(struct sparx5 *sparx5)
{}

static void sparx5_mact_select(struct sparx5 *sparx5,
			       const unsigned char mac[ETH_ALEN],
			       u16 vid)
{}

int sparx5_mact_learn(struct sparx5 *sparx5, int pgid,
		      const unsigned char mac[ETH_ALEN], u16 vid)
{}

int sparx5_mc_unsync(struct net_device *dev, const unsigned char *addr)
{}

int sparx5_mc_sync(struct net_device *dev, const unsigned char *addr)
{}

static int sparx5_mact_get(struct sparx5 *sparx5,
			   unsigned char mac[ETH_ALEN],
			   u16 *vid, u32 *pcfg2)
{}

bool sparx5_mact_getnext(struct sparx5 *sparx5,
			 unsigned char mac[ETH_ALEN], u16 *vid, u32 *pcfg2)
{}

int sparx5_mact_find(struct sparx5 *sparx5,
		     const unsigned char mac[ETH_ALEN], u16 vid, u32 *pcfg2)
{}

int sparx5_mact_forget(struct sparx5 *sparx5,
		       const unsigned char mac[ETH_ALEN], u16 vid)
{}

static struct sparx5_mact_entry *alloc_mact_entry(struct sparx5 *sparx5,
						  const unsigned char *mac,
						  u16 vid, u16 port_index)
{}

static struct sparx5_mact_entry *find_mact_entry(struct sparx5 *sparx5,
						 const unsigned char *mac,
						 u16 vid, u16 port_index)
{}

static void sparx5_fdb_call_notifiers(enum switchdev_notifier_type type,
				      const char *mac, u16 vid,
				      struct net_device *dev, bool offloaded)
{}

int sparx5_add_mact_entry(struct sparx5 *sparx5,
			  struct net_device *dev,
			  u16 portno,
			  const unsigned char *addr, u16 vid)
{}

int sparx5_del_mact_entry(struct sparx5 *sparx5,
			  const unsigned char *addr,
			  u16 vid)
{}

static void sparx5_mact_handle_entry(struct sparx5 *sparx5,
				     unsigned char mac[ETH_ALEN],
				     u16 vid, u32 cfg2)
{}

void sparx5_mact_pull_work(struct work_struct *work)
{}

void sparx5_set_ageing(struct sparx5 *sparx5, int msecs)
{}

void sparx5_mact_init(struct sparx5 *sparx5)
{}