linux/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright (c) 2014-2015 Hisilicon Limited.
 */

#ifndef __HNS_DSAF_MAIN_H
#define __HNS_DSAF_MAIN_H
#include "hnae.h"

#include "hns_dsaf_reg.h"
#include "hns_dsaf_mac.h"

struct hns_mac_cb;

#define DSAF_DRV_NAME
#define DSAF_MOD_VERSION
#define DSAF_DEVICE_NAME

#define HNS_DSAF_DEBUG_NW_REG_OFFSET

#define DSAF_BASE_INNER_PORT_NUM

#define DSAF_MAX_CHIP_NUM

#define DSAF_DEFAUTL_QUEUE_NUM_PER_PPE

#define HNS_DSAF_MAX_DESC_CNT
#define HNS_DSAF_MIN_DESC_CNT

#define DSAF_INVALID_ENTRY_IDX

#define DSAF_CFG_READ_CNT

#define DSAF_DUMP_REGS_NUM
#define DSAF_STATIC_NUM
#define DSAF_V2_STATIC_NUM
#define DSAF_PRIO_NR
#define DSAF_REG_PER_ZONE

#define DSAF_ROCE_CREDIT_CHN
#define DSAF_ROCE_CHAN_MODE

#define HNS_MAX_WAIT_CNT

enum dsaf_roce_port_mode {};

enum dsaf_roce_port_num {};

enum dsaf_roce_qos_sl {};

#define DSAF_STATS_READ(p, offset)
#define HNS_DSAF_IS_DEBUG(dev)

enum hal_dsaf_mode {};

enum hal_dsaf_tc_mode {};

struct dsaf_vm_def_vlan {};

struct dsaf_tbl_tcam_data {};

#define DSAF_PORT_MSK_NUM
struct dsaf_tbl_tcam_mcast_cfg {};

struct dsaf_tbl_tcam_ucast_cfg {};

struct dsaf_tbl_line_cfg {};

enum dsaf_port_rate_mode {};

enum dsaf_stp_port_type {};

enum dsaf_sw_port_type {};

#define DSAF_SUB_BASE_SIZE

/* dsaf mode define */
enum dsaf_mode {};

#define DSAF_DEST_PORT_NUM
#define DSAF_WORD_BIT_CNT

/*mac entry, mc or uc entry*/
struct dsaf_drv_mac_single_dest_entry {};

/*only mc entry*/
struct dsaf_drv_mac_multi_dest_entry {};

struct dsaf_hw_stats {};

struct hnae_vf_cb {};

struct dsaf_int_xge_src {};

struct dsaf_int_ppe_src {};

struct dsaf_int_rocee_src {};

struct dsaf_int_tbl_src {};

struct dsaf_int_stat {};

struct dsaf_misc_op {};

/* Dsaf device struct define ,and mac ->  dsaf */
struct dsaf_device {};

static inline void *hns_dsaf_dev_priv(const struct dsaf_device *dsaf_dev)
{}

#define DSAF_TBL_TCAM_KEY_PORT_S
#define DSAF_TBL_TCAM_KEY_PORT_M
#define DSAF_TBL_TCAM_KEY_VLAN_S
#define DSAF_TBL_TCAM_KEY_VLAN_M

struct dsaf_drv_tbl_tcam_key {};

struct dsaf_drv_soft_mac_tbl {};

struct dsaf_drv_priv {};

static inline void hns_dsaf_tbl_tcam_addr_cfg(struct dsaf_device *dsaf_dev,
					      u32 tab_tcam_addr)
{}

static inline void hns_dsaf_tbl_tcam_load_pul(struct dsaf_device *dsaf_dev)
{}

static inline void hns_dsaf_tbl_line_addr_cfg(struct dsaf_device *dsaf_dev,
					      u32 tab_line_addr)
{}

static inline struct hnae_vf_cb *hns_ae_get_vf_cb(
	struct hnae_handle *handle)
{}

int hns_dsaf_set_mac_uc_entry(struct dsaf_device *dsaf_dev,
			      struct dsaf_drv_mac_single_dest_entry *mac_entry);
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);
void hns_dsaf_fix_mac_mode(struct hns_mac_cb *mac_cb);

int hns_dsaf_ae_init(struct dsaf_device *dsaf_dev);
void hns_dsaf_ae_uninit(struct dsaf_device *dsaf_dev);

void hns_dsaf_update_stats(struct dsaf_device *dsaf_dev, u32 inode_num);

int hns_dsaf_get_sset_count(struct dsaf_device *dsaf_dev, int stringset);
void hns_dsaf_get_stats(struct dsaf_device *ddev, u64 *data, int port);
void hns_dsaf_get_strings(int stringset, u8 *data, int port,
			  struct dsaf_device *dsaf_dev);

void hns_dsaf_get_regs(struct dsaf_device *ddev, u32 port, void *data);
int hns_dsaf_get_regs_count(void);
void hns_dsaf_set_promisc_mode(struct dsaf_device *dsaf_dev, u32 en);
void hns_dsaf_set_promisc_tcam(struct dsaf_device *dsaf_dev,
			       u32 port, bool enable);

void hns_dsaf_get_rx_mac_pause_en(struct dsaf_device *dsaf_dev, int mac_id,
				  u32 *en);
int hns_dsaf_set_rx_mac_pause_en(struct dsaf_device *dsaf_dev, int mac_id,
				 u32 en);
int hns_dsaf_rm_mac_addr(
	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);
int hns_dsaf_wait_pkt_clean(struct dsaf_device *dsaf_dev, int port);

int hns_dsaf_roce_reset(struct fwnode_handle *dsaf_fwnode, bool dereset);

#endif /* __HNS_DSAF_MAIN_H__ */