#include <linux/acpi.h>
#include <linux/device.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/mfd/syscon.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/vmalloc.h>
#include "hns_dsaf_mac.h"
#include "hns_dsaf_main.h"
#include "hns_dsaf_ppe.h"
#include "hns_dsaf_rcb.h"
#include "hns_dsaf_misc.h"
static const char *g_dsaf_mode_match[DSAF_MODE_MAX] = …;
static const struct acpi_device_id hns_dsaf_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, hns_dsaf_acpi_match);
static int hns_dsaf_get_cfg(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_sbm_link_sram_init_en(struct dsaf_device *dsaf_dev)
{ … }
static void
hns_dsaf_reg_cnt_clr_ce(struct dsaf_device *dsaf_dev, u32 reg_cnt_clr_ce)
{ … }
static void
hns_dsaf_ppe_qid_cfg(struct dsaf_device *dsaf_dev, u32 qid_cfg)
{ … }
static void hns_dsaf_mix_def_qid_cfg(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_inner_qid_cfg(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_sw_port_type_cfg(struct dsaf_device *dsaf_dev,
enum dsaf_sw_port_type port_type)
{ … }
static void hns_dsaf_stp_port_type_cfg(struct dsaf_device *dsaf_dev,
enum dsaf_stp_port_type port_type)
{ … }
#define HNS_DSAF_SBM_NUM(dev) …
static void hns_dsaf_sbm_cfg(struct dsaf_device *dsaf_dev)
{ … }
static int hns_dsaf_sbm_cfg_mib_en(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_sbm_bp_wl_cfg(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsafv2_sbm_bp_wl_cfg(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_voq_bp_all_thrd_cfg(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_tbl_tcam_match_cfg(
struct dsaf_device *dsaf_dev,
struct dsaf_tbl_tcam_data *ptbl_tcam_data)
{ … }
static void hns_dsaf_tbl_tcam_data_cfg(
struct dsaf_device *dsaf_dev,
struct dsaf_tbl_tcam_data *ptbl_tcam_data)
{ … }
static void hns_dsaf_tbl_tcam_mcast_cfg(
struct dsaf_device *dsaf_dev,
struct dsaf_tbl_tcam_mcast_cfg *mcast)
{ … }
static void hns_dsaf_tbl_tcam_ucast_cfg(
struct dsaf_device *dsaf_dev,
struct dsaf_tbl_tcam_ucast_cfg *tbl_tcam_ucast)
{ … }
static void hns_dsaf_tbl_line_cfg(struct dsaf_device *dsaf_dev,
struct dsaf_tbl_line_cfg *tbl_lin)
{ … }
static void hns_dsaf_tbl_tcam_mcast_pul(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_tbl_line_pul(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_tbl_tcam_data_mcast_pul(
struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_tbl_tcam_data_ucast_pul(
struct dsaf_device *dsaf_dev)
{ … }
void hns_dsaf_set_promisc_mode(struct dsaf_device *dsaf_dev, u32 en)
{ … }
static void hns_dsaf_tbl_stat_en(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_rocee_bp_en(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_int_xge_msk_set(struct dsaf_device *dsaf_dev,
u32 chnn_num, u32 mask_set)
{ … }
static void hns_dsaf_int_ppe_msk_set(struct dsaf_device *dsaf_dev,
u32 chnn_num, u32 msk_set)
{ … }
static void hns_dsaf_int_rocee_msk_set(struct dsaf_device *dsaf_dev,
u32 chnn, u32 msk_set)
{ … }
static void
hns_dsaf_int_tbl_msk_set(struct dsaf_device *dsaf_dev, u32 msk_set)
{ … }
static void hns_dsaf_int_xge_src_clr(struct dsaf_device *dsaf_dev,
u32 chnn_num, u32 int_src)
{ … }
static void hns_dsaf_int_ppe_src_clr(struct dsaf_device *dsaf_dev,
u32 chnn, u32 int_src)
{ … }
static void hns_dsaf_int_rocee_src_clr(struct dsaf_device *dsaf_dev,
u32 chnn, u32 int_src)
{ … }
static void hns_dsaf_int_tbl_src_clr(struct dsaf_device *dsaf_dev,
u32 int_src)
{ … }
static void hns_dsaf_single_line_tbl_cfg(
struct dsaf_device *dsaf_dev,
u32 address, struct dsaf_tbl_line_cfg *ptbl_line)
{ … }
static void hns_dsaf_tcam_uc_cfg(
struct dsaf_device *dsaf_dev, u32 address,
struct dsaf_tbl_tcam_data *ptbl_tcam_data,
struct dsaf_tbl_tcam_ucast_cfg *ptbl_tcam_ucast)
{ … }
static void hns_dsaf_tcam_mc_cfg(
struct dsaf_device *dsaf_dev, u32 address,
struct dsaf_tbl_tcam_data *ptbl_tcam_data,
struct dsaf_tbl_tcam_data *ptbl_tcam_mask,
struct dsaf_tbl_tcam_mcast_cfg *ptbl_tcam_mcast)
{ … }
static void hns_dsaf_tcam_uc_cfg_vague(struct dsaf_device *dsaf_dev,
u32 address,
struct dsaf_tbl_tcam_data *tcam_data,
struct dsaf_tbl_tcam_data *tcam_mask,
struct dsaf_tbl_tcam_ucast_cfg *tcam_uc)
{ … }
static void hns_dsaf_tcam_mc_cfg_vague(struct dsaf_device *dsaf_dev,
u32 address,
struct dsaf_tbl_tcam_data *tcam_data,
struct dsaf_tbl_tcam_data *tcam_mask,
struct dsaf_tbl_tcam_mcast_cfg *tcam_mc)
{ … }
static void hns_dsaf_tcam_mc_invld(struct dsaf_device *dsaf_dev, u32 address)
{ … }
static void
hns_dsaf_tcam_addr_get(struct dsaf_drv_tbl_tcam_key *mac_key, u8 *addr)
{ … }
static void hns_dsaf_tcam_uc_get(
struct dsaf_device *dsaf_dev, u32 address,
struct dsaf_tbl_tcam_data *ptbl_tcam_data,
struct dsaf_tbl_tcam_ucast_cfg *ptbl_tcam_ucast)
{ … }
static void hns_dsaf_tcam_mc_get(
struct dsaf_device *dsaf_dev, u32 address,
struct dsaf_tbl_tcam_data *ptbl_tcam_data,
struct dsaf_tbl_tcam_mcast_cfg *ptbl_tcam_mcast)
{ … }
static void hns_dsaf_tbl_line_init(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_tbl_tcam_init(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_pfc_en_cfg(struct dsaf_device *dsaf_dev,
int mac_id, int tc_en)
{ … }
static void hns_dsaf_set_pfc_pause(struct dsaf_device *dsaf_dev,
int mac_id, int tx_en, int rx_en)
{ … }
int hns_dsaf_set_rx_mac_pause_en(struct dsaf_device *dsaf_dev, int mac_id,
u32 en)
{ … }
void hns_dsaf_get_rx_mac_pause_en(struct dsaf_device *dsaf_dev, int mac_id,
u32 *en)
{ … }
static void hns_dsaf_comm_init(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_inode_init(struct dsaf_device *dsaf_dev)
{ … }
static int hns_dsaf_sbm_init(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_tbl_init(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_voq_init(struct dsaf_device *dsaf_dev)
{ … }
static int hns_dsaf_init_hw(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_remove_hw(struct dsaf_device *dsaf_dev)
{ … }
static int hns_dsaf_init(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_free(struct dsaf_device *dsaf_dev)
{ … }
static u16 hns_dsaf_find_soft_mac_entry(
struct dsaf_device *dsaf_dev,
struct dsaf_drv_tbl_tcam_key *mac_key)
{ … }
static u16 hns_dsaf_find_empty_mac_entry(struct dsaf_device *dsaf_dev)
{ … }
static u16 hns_dsaf_find_empty_mac_entry_reverse(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_set_mac_key(
struct dsaf_device *dsaf_dev,
struct dsaf_drv_tbl_tcam_key *mac_key, u16 vlan_id, u8 in_port_num,
u8 *addr)
{ … }
int hns_dsaf_set_mac_uc_entry(
struct dsaf_device *dsaf_dev,
struct dsaf_drv_mac_single_dest_entry *mac_entry)
{ … }
int hns_dsaf_rm_mac_addr(
struct dsaf_device *dsaf_dev,
struct dsaf_drv_mac_single_dest_entry *mac_entry)
{ … }
static void hns_dsaf_setup_mc_mask(struct dsaf_device *dsaf_dev,
u8 port_num, u8 *mask, u8 *addr)
{ … }
static void hns_dsaf_mc_mask_bit_clear(char *dst, const char *src)
{ … }
int hns_dsaf_add_mac_mc_port(struct dsaf_device *dsaf_dev,
struct dsaf_drv_mac_single_dest_entry *mac_entry)
{ … }
int hns_dsaf_del_mac_entry(struct dsaf_device *dsaf_dev, u16 vlan_id,
u8 in_port_num, u8 *addr)
{ … }
int hns_dsaf_del_mac_mc_port(struct dsaf_device *dsaf_dev,
struct dsaf_drv_mac_single_dest_entry *mac_entry)
{ … }
int hns_dsaf_clr_mac_mc_port(struct dsaf_device *dsaf_dev, u8 mac_id,
u8 port_num)
{ … }
static struct dsaf_device *hns_dsaf_alloc_dev(struct device *dev,
size_t sizeof_priv)
{ … }
static void hns_dsaf_free_dev(struct dsaf_device *dsaf_dev)
{ … }
static void hns_dsaf_pfc_unit_cnt(struct dsaf_device *dsaf_dev, int mac_id,
enum dsaf_port_rate_mode rate)
{ … }
static void
hns_dsaf_port_work_rate_cfg(struct dsaf_device *dsaf_dev, int mac_id,
enum dsaf_port_rate_mode rate_mode)
{ … }
void hns_dsaf_fix_mac_mode(struct hns_mac_cb *mac_cb)
{ … }
static u32 hns_dsaf_get_inode_prio_reg(int index)
{ … }
void hns_dsaf_update_stats(struct dsaf_device *dsaf_dev, u32 node_num)
{ … }
void hns_dsaf_get_regs(struct dsaf_device *ddev, u32 port, void *data)
{ … }
static char *hns_dsaf_get_node_stats_strings(char *data, int node,
struct dsaf_device *dsaf_dev)
{ … }
static u64 *hns_dsaf_get_node_stats(struct dsaf_device *ddev, u64 *data,
int node_num)
{ … }
void hns_dsaf_get_stats(struct dsaf_device *ddev, u64 *data, int port)
{ … }
int hns_dsaf_get_sset_count(struct dsaf_device *dsaf_dev, int stringset)
{ … }
void hns_dsaf_get_strings(int stringset, u8 *data, int port,
struct dsaf_device *dsaf_dev)
{ … }
int hns_dsaf_get_regs_count(void)
{ … }
static int hns_dsaf_get_port_id(u8 port)
{ … }
static void set_promisc_tcam_enable(struct dsaf_device *dsaf_dev, u32 port)
{ … }
static void set_promisc_tcam_disable(struct dsaf_device *dsaf_dev, u32 port)
{ … }
void hns_dsaf_set_promisc_tcam(struct dsaf_device *dsaf_dev,
u32 port, bool enable)
{ … }
int hns_dsaf_wait_pkt_clean(struct dsaf_device *dsaf_dev, int port)
{ … }
static int hns_dsaf_probe(struct platform_device *pdev)
{ … }
static void hns_dsaf_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id g_dsaf_match[] = …;
MODULE_DEVICE_TABLE(of, g_dsaf_match);
static struct platform_driver g_dsaf_driver = …;
module_platform_driver(…) …;
int hns_dsaf_roce_reset(struct fwnode_handle *dsaf_fwnode, bool dereset)
{ … }
EXPORT_SYMBOL(…);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_VERSION(…);