linux/drivers/net/ethernet/broadcom/asp2/bcmasp.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Broadcom STB ASP 2.0 Driver
 *
 * Copyright (c) 2023 Broadcom
 */
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_platform.h>
#include <linux/clk.h>

#include "bcmasp.h"
#include "bcmasp_intf_defs.h"

static void _intr2_mask_clear(struct bcmasp_priv *priv, u32 mask)
{}

static void _intr2_mask_set(struct bcmasp_priv *priv, u32 mask)
{}

void bcmasp_enable_phy_irq(struct bcmasp_intf *intf, int en)
{}

void bcmasp_enable_tx_irq(struct bcmasp_intf *intf, int en)
{}
EXPORT_SYMBOL_GPL();

void bcmasp_enable_rx_irq(struct bcmasp_intf *intf, int en)
{}
EXPORT_SYMBOL_GPL();

static void bcmasp_intr2_mask_set_all(struct bcmasp_priv *priv)
{}

static void bcmasp_intr2_clear_all(struct bcmasp_priv *priv)
{}

static void bcmasp_intr2_handling(struct bcmasp_intf *intf, u32 status)
{}

static irqreturn_t bcmasp_isr(int irq, void *data)
{}

void bcmasp_flush_rx_port(struct bcmasp_intf *intf)
{}

static void bcmasp_netfilt_hw_en_wake(struct bcmasp_priv *priv,
				      struct bcmasp_net_filter *nfilt)
{}

#define MAX_WAKE_FILTER_SIZE
enum asp_netfilt_reg_type {};

static int bcmasp_netfilt_get_reg_offset(struct bcmasp_priv *priv,
					 struct bcmasp_net_filter *nfilt,
					 enum asp_netfilt_reg_type reg_type,
					 u32 offset)
{}

static void bcmasp_netfilt_wr(struct bcmasp_priv *priv,
			      struct bcmasp_net_filter *nfilt,
			      enum asp_netfilt_reg_type reg_type,
			      u32 val, u32 offset)
{}

static u32 bcmasp_netfilt_rd(struct bcmasp_priv *priv,
			     struct bcmasp_net_filter *nfilt,
			     enum asp_netfilt_reg_type reg_type,
			     u32 offset)
{}

static int bcmasp_netfilt_wr_m_wake(struct bcmasp_priv *priv,
				    struct bcmasp_net_filter *nfilt,
				    u32 offset, void *match, void *mask,
				    size_t size)
{}

static void bcmasp_netfilt_reset_hw(struct bcmasp_priv *priv,
				    struct bcmasp_net_filter *nfilt)
{}

static void bcmasp_netfilt_tcpip4_wr(struct bcmasp_priv *priv,
				     struct bcmasp_net_filter *nfilt,
				     struct ethtool_tcpip4_spec *match,
				     struct ethtool_tcpip4_spec *mask,
				     u32 offset)
{}

static void bcmasp_netfilt_tcpip6_wr(struct bcmasp_priv *priv,
				     struct bcmasp_net_filter *nfilt,
				     struct ethtool_tcpip6_spec *match,
				     struct ethtool_tcpip6_spec *mask,
				     u32 offset)
{}

static int bcmasp_netfilt_wr_to_hw(struct bcmasp_priv *priv,
				   struct bcmasp_net_filter *nfilt)
{}

void bcmasp_netfilt_suspend(struct bcmasp_intf *intf)
{}

int bcmasp_netfilt_get_all_active(struct bcmasp_intf *intf, u32 *rule_locs,
				  u32 *rule_cnt)
{}

int bcmasp_netfilt_get_active(struct bcmasp_intf *intf)
{}

bool bcmasp_netfilt_check_dup(struct bcmasp_intf *intf,
			      struct ethtool_rx_flow_spec *fs)
{}

/* If no network filter found, return open filter.
 * If no more open filters return NULL
 */
struct bcmasp_net_filter *bcmasp_netfilt_get_init(struct bcmasp_intf *intf,
						  u32 loc, bool wake_filter,
						  bool init)
{}

void bcmasp_netfilt_release(struct bcmasp_intf *intf,
			    struct bcmasp_net_filter *nfilt)
{}

static void bcmasp_addr_to_uint(unsigned char *addr, u32 *high, u32 *low)
{}

static void bcmasp_set_mda_filter(struct bcmasp_intf *intf,
				  const unsigned char *addr,
				  unsigned char *mask,
				  unsigned int i)
{}

static void bcmasp_en_mda_filter(struct bcmasp_intf *intf, bool en,
				 unsigned int i)
{}

/* There are 32 MDA filters shared between all ports, we reserve 4 filters per
 * port for the following.
 * - Promisc: Filter to allow all packets when promisc is enabled
 * - All Multicast
 * - Broadcast
 * - Own address
 *
 * The reserved filters are identified as so.
 * - Promisc: (index * 4) + 0
 * - All Multicast: (index * 4) + 1
 * - Broadcast: (index * 4) + 2
 * - Own address: (index * 4) + 3
 */
enum asp_rx_filter_id {};

#define ASP_RX_FILT_MDA(intf, name)

static int bcmasp_total_res_mda_cnt(struct bcmasp_priv *priv)
{}

void bcmasp_set_promisc(struct bcmasp_intf *intf, bool en)
{}

void bcmasp_set_allmulti(struct bcmasp_intf *intf, bool en)
{}

void bcmasp_set_broad(struct bcmasp_intf *intf, bool en)
{}

void bcmasp_set_oaddr(struct bcmasp_intf *intf, const unsigned char *addr,
		      bool en)
{}

void bcmasp_disable_all_filters(struct bcmasp_intf *intf)
{}

static int bcmasp_combine_set_filter(struct bcmasp_intf *intf,
				     unsigned char *addr, unsigned char *mask,
				     int i)
{}

int bcmasp_set_en_mda_filter(struct bcmasp_intf *intf, unsigned char *addr,
			     unsigned char *mask)
{}

static void bcmasp_core_init_filters(struct bcmasp_priv *priv)
{}

/* ASP core initialization */
static void bcmasp_core_init(struct bcmasp_priv *priv)
{}

static void bcmasp_core_clock_select_many(struct bcmasp_priv *priv, bool slow)
{}

static void bcmasp_core_clock_select_one(struct bcmasp_priv *priv, bool slow)
{}

static void bcmasp_core_clock_set_ll(struct bcmasp_priv *priv, u32 clr, u32 set)
{}

static void bcmasp_core_clock_set(struct bcmasp_priv *priv, u32 clr, u32 set)
{}

void bcmasp_core_clock_set_intf(struct bcmasp_intf *intf, bool en)
{}

static irqreturn_t bcmasp_isr_wol(int irq, void *data)
{}

static int bcmasp_get_and_request_irq(struct bcmasp_priv *priv, int i)
{}

static void bcmasp_init_wol_shared(struct bcmasp_priv *priv)
{}

static void bcmasp_enable_wol_shared(struct bcmasp_intf *intf, bool en)
{}

static void bcmasp_wol_irq_destroy_shared(struct bcmasp_priv *priv)
{}

static void bcmasp_init_wol_per_intf(struct bcmasp_priv *priv)
{}

static void bcmasp_enable_wol_per_intf(struct bcmasp_intf *intf, bool en)
{}

static void bcmasp_wol_irq_destroy_per_intf(struct bcmasp_priv *priv)
{}

static void bcmasp_eee_fixup(struct bcmasp_intf *intf, bool en)
{}

static struct bcmasp_hw_info v20_hw_info =;

static const struct bcmasp_plat_data v20_plat_data =;

static struct bcmasp_hw_info v21_hw_info =;

static const struct bcmasp_plat_data v21_plat_data =;

static const struct bcmasp_plat_data v22_plat_data =;

static void bcmasp_set_pdata(struct bcmasp_priv *priv, const struct bcmasp_plat_data *pdata)
{}

static const struct of_device_id bcmasp_of_match[] =;
MODULE_DEVICE_TABLE(of, bcmasp_of_match);

static const struct of_device_id bcmasp_mdio_of_match[] =;
MODULE_DEVICE_TABLE(of, bcmasp_mdio_of_match);

static void bcmasp_remove_intfs(struct bcmasp_priv *priv)
{}

static int bcmasp_probe(struct platform_device *pdev)
{}

static void bcmasp_remove(struct platform_device *pdev)
{}

static void bcmasp_shutdown(struct platform_device *pdev)
{}

static int __maybe_unused bcmasp_suspend(struct device *d)
{}

static int __maybe_unused bcmasp_resume(struct device *d)
{}

static SIMPLE_DEV_PM_OPS(bcmasp_pm_ops,
			 bcmasp_suspend, bcmasp_resume);

static struct platform_driver bcmasp_driver =;
module_platform_driver();

MODULE_DESCRIPTION();
MODULE_ALIAS();
MODULE_LICENSE();