#ifndef __DPAA2_ETH_H
#define __DPAA2_ETH_H
#include <linux/dcbnl.h>
#include <linux/netdevice.h>
#include <linux/if_vlan.h>
#include <linux/fsl/mc.h>
#include <linux/net_tstamp.h>
#include <net/devlink.h>
#include <net/xdp.h>
#include <soc/fsl/dpaa2-io.h>
#include <soc/fsl/dpaa2-fd.h>
#include "dpni.h"
#include "dpni-cmd.h"
#include "dpaa2-eth-trace.h"
#include "dpaa2-eth-debugfs.h"
#include "dpaa2-mac.h"
#define DPAA2_WRIOP_VERSION(x, y, z) …
#define DPAA2_ETH_STORE_SIZE …
#define DPAA2_ETH_MAX_SG_ENTRIES …
#define DPAA2_ETH_MFL …
#define DPAA2_ETH_MAX_MTU …
#define DPAA2_ETH_L2_MAX_FRM(mtu) …
#define DPAA2_ETH_FQ_TAILDROP_THRESH …
#define DPAA2_ETH_MAX_BURST_SIZE …
#define DPAA2_ETH_TXCONF_PER_NAPI …
#define DPAA2_ETH_TX_ZC_PER_NAPI …
#define DPAA2_ETH_NUM_BUFS …
#define DPAA2_ETH_REFILL_THRESH …
#define DPAA2_ETH_CG_TAILDROP_THRESH(priv) …
#define DPAA2_ETH_CN_THRESH_ENTRY(priv) …
#define DPAA2_ETH_CN_THRESH_EXIT(priv) …
#define DPAA2_ETH_BUFS_PER_CMD …
#define DPAA2_ETH_TX_BUF_ALIGN …
#define DPAA2_ETH_RX_BUF_RAW_SIZE …
#define DPAA2_ETH_RX_BUF_TAILROOM …
#define DPAA2_ETH_RX_BUF_SIZE …
#define DPAA2_ETH_RX_HWA_SIZE …
#define DPAA2_ETH_TX_HWA_SIZE …
#define DPAA2_PTP_CLK_PERIOD_NS …
#define DPAA2_ETH_RX_BUF_ALIGN_REV1 …
#define DPAA2_ETH_RX_BUF_ALIGN …
#define DPAA2_ETH_DEFAULT_BP_IDX …
#define DPAA2_ETH_MAX_BPS …
#define DPAA2_ETH_SWA_SIZE …
enum dpaa2_eth_swa_type { … };
struct dpaa2_eth_swa { … };
#define DPAA2_FD_FRC_FASV …
#define DPAA2_FD_FRC_FAEADV …
#define DPAA2_FD_FRC_FAPRV …
#define DPAA2_FD_FRC_FAIADV …
#define DPAA2_FD_FRC_FASWOV …
#define DPAA2_FD_FRC_FAICFDV …
#define DPAA2_FD_RX_ERR_MASK …
#define DPAA2_FD_TX_ERR_MASK …
#define DPAA2_FD_CTRL_ASAL …
struct dpaa2_fas { … };
#define DPAA2_FAS_OFFSET …
#define DPAA2_FAS_SIZE …
#define DPAA2_TS_OFFSET …
struct dpaa2_fapr { … };
#define DPAA2_FAPR_OFFSET …
#define DPAA2_FAPR_SIZE …
#define DPAA2_FAEAD_OFFSET …
struct dpaa2_faead { … };
#define DPAA2_FAEAD_A2V …
#define DPAA2_FAEAD_A4V …
#define DPAA2_FAEAD_UPDV …
#define DPAA2_FAEAD_EBDDV …
#define DPAA2_FAEAD_UPD …
struct ptp_tstamp { … };
static inline void ns_to_ptp_tstamp(struct ptp_tstamp *tstamp, u64 ns)
{ … }
static inline void *dpaa2_get_hwa(void *buf_addr, bool swa)
{ … }
static inline struct dpaa2_fas *dpaa2_get_fas(void *buf_addr, bool swa)
{ … }
static inline __le64 *dpaa2_get_ts(void *buf_addr, bool swa)
{ … }
static inline struct dpaa2_fapr *dpaa2_get_fapr(void *buf_addr, bool swa)
{ … }
static inline struct dpaa2_faead *dpaa2_get_faead(void *buf_addr, bool swa)
{ … }
#define DPAA2_FAS_DISC …
#define DPAA2_FAS_MS …
#define DPAA2_FAS_PTP …
#define DPAA2_FAS_MC …
#define DPAA2_FAS_BC …
#define DPAA2_FAS_KSE …
#define DPAA2_FAS_EOFHE …
#define DPAA2_FAS_MNLE …
#define DPAA2_FAS_TIDE …
#define DPAA2_FAS_PIEE …
#define DPAA2_FAS_FLE …
#define DPAA2_FAS_FPE …
#define DPAA2_FAS_PTE …
#define DPAA2_FAS_ISP …
#define DPAA2_FAS_PHE …
#define DPAA2_FAS_BLE …
#define DPAA2_FAS_L3CV …
#define DPAA2_FAS_L3CE …
#define DPAA2_FAS_L4CV …
#define DPAA2_FAS_L4CE …
#define DPAA2_FAS_RX_ERR_MASK …
#define DPAA2_ETH_LINK_STATE_REFRESH …
#define DPAA2_ETH_ENQUEUE_RETRIES …
#define DPAA2_ETH_SWP_BUSY_RETRIES …
struct dpaa2_eth_drv_stats { … };
struct dpaa2_eth_fq_stats { … };
struct dpaa2_eth_ch_stats { … };
#define DPAA2_ETH_CH_STATS …
#define DPAA2_ETH_MAX_TCS …
#define DPAA2_ETH_MAX_RX_QUEUES_PER_TC …
#define DPAA2_ETH_MAX_RX_QUEUES …
#define DPAA2_ETH_MAX_TX_QUEUES …
#define DPAA2_ETH_MAX_RX_ERR_QUEUES …
#define DPAA2_ETH_MAX_QUEUES …
#define DPAA2_ETH_MAX_NETDEV_QUEUES …
#define DPAA2_ETH_MAX_DPCONS …
enum dpaa2_eth_fq_type { … };
struct dpaa2_eth_priv;
struct dpaa2_eth_channel;
struct dpaa2_eth_fq;
struct dpaa2_eth_xdp_fds { … };
dpaa2_eth_consume_cb_t;
struct dpaa2_eth_fq { … };
struct dpaa2_eth_ch_xdp { … };
struct dpaa2_eth_bp { … };
struct dpaa2_eth_channel { … };
struct dpaa2_eth_dist_fields { … };
struct dpaa2_eth_cls_rule { … };
#define DPAA2_ETH_SGT_CACHE_SIZE …
struct dpaa2_eth_sgt_cache { … };
struct dpaa2_eth_trap_item { … };
struct dpaa2_eth_trap_data { … };
#define DPAA2_ETH_SG_ENTRIES_MAX …
#define DPAA2_ETH_DEFAULT_COPYBREAK …
#define DPAA2_ETH_ENQUEUE_MAX_FDS …
struct dpaa2_eth_fds { … };
struct dpaa2_eth_priv { … };
struct dpaa2_eth_devlink_priv { … };
#define TX_TSTAMP …
#define TX_TSTAMP_ONESTEP_SYNC …
#define DPAA2_RXH_SUPPORTED …
#define DPAA2_RXH_DEFAULT …
#define dpaa2_eth_hash_enabled(priv) …
#define DPAA2_CLASSIFIER_DMA_SIZE …
extern const struct ethtool_ops dpaa2_ethtool_ops;
extern int dpaa2_phc_index;
extern struct ptp_qoriq *dpaa2_ptp;
static inline int dpaa2_eth_cmp_dpni_ver(struct dpaa2_eth_priv *priv,
u16 ver_major, u16 ver_minor)
{ … }
#define DPNI_RX_DIST_KEY_VER_MAJOR …
#define DPNI_RX_DIST_KEY_VER_MINOR …
#define dpaa2_eth_has_legacy_dist(priv) …
#define dpaa2_eth_fs_enabled(priv) …
#define dpaa2_eth_fs_mask_enabled(priv) …
#define dpaa2_eth_fs_count(priv) …
#define dpaa2_eth_tc_count(priv) …
#define dpaa2_eth_queue_count(priv) …
enum dpaa2_eth_rx_dist { … };
#define DPAA2_ETH_DIST_ETHDST …
#define DPAA2_ETH_DIST_ETHSRC …
#define DPAA2_ETH_DIST_ETHTYPE …
#define DPAA2_ETH_DIST_VLAN …
#define DPAA2_ETH_DIST_IPSRC …
#define DPAA2_ETH_DIST_IPDST …
#define DPAA2_ETH_DIST_IPPROTO …
#define DPAA2_ETH_DIST_L4SRC …
#define DPAA2_ETH_DIST_L4DST …
#define DPAA2_ETH_DIST_ALL …
#define DPNI_PTP_ONESTEP_VER_MAJOR …
#define DPNI_PTP_ONESTEP_VER_MINOR …
#define DPAA2_ETH_FEATURE_ONESTEP_CFG_DIRECT …
#define DPAA2_PTP_SINGLE_STEP_ENABLE …
#define DPAA2_PTP_SINGLE_STEP_CH …
#define DPAA2_PTP_SINGLE_CORRECTION_OFF(v) …
#define DPNI_PAUSE_VER_MAJOR …
#define DPNI_PAUSE_VER_MINOR …
#define dpaa2_eth_has_pause_support(priv) …
static inline bool dpaa2_eth_tx_pause_enabled(u64 link_options)
{ … }
static inline bool dpaa2_eth_rx_pause_enabled(u64 link_options)
{ … }
static inline unsigned int dpaa2_eth_needed_headroom(struct sk_buff *skb)
{ … }
static inline unsigned int dpaa2_eth_rx_head_room(struct dpaa2_eth_priv *priv)
{ … }
static inline bool dpaa2_eth_is_type_phy(struct dpaa2_eth_priv *priv)
{ … }
static inline bool dpaa2_eth_has_mac(struct dpaa2_eth_priv *priv)
{ … }
int dpaa2_eth_set_hash(struct net_device *net_dev, u64 flags);
int dpaa2_eth_set_cls(struct net_device *net_dev, u64 key);
int dpaa2_eth_cls_key_size(u64 key);
int dpaa2_eth_cls_fld_off(int prot, int field);
void dpaa2_eth_cls_trim_rule(void *key_mem, u64 fields);
void dpaa2_eth_set_rx_taildrop(struct dpaa2_eth_priv *priv,
bool tx_pause, bool pfc);
extern const struct dcbnl_rtnl_ops dpaa2_eth_dcbnl_ops;
int dpaa2_eth_dl_alloc(struct dpaa2_eth_priv *priv);
void dpaa2_eth_dl_free(struct dpaa2_eth_priv *priv);
void dpaa2_eth_dl_register(struct dpaa2_eth_priv *priv);
void dpaa2_eth_dl_unregister(struct dpaa2_eth_priv *priv);
int dpaa2_eth_dl_port_add(struct dpaa2_eth_priv *priv);
void dpaa2_eth_dl_port_del(struct dpaa2_eth_priv *priv);
int dpaa2_eth_dl_traps_register(struct dpaa2_eth_priv *priv);
void dpaa2_eth_dl_traps_unregister(struct dpaa2_eth_priv *priv);
struct dpaa2_eth_trap_item *dpaa2_eth_dl_get_trap(struct dpaa2_eth_priv *priv,
struct dpaa2_fapr *fapr);
struct dpaa2_eth_bp *dpaa2_eth_allocate_dpbp(struct dpaa2_eth_priv *priv);
void dpaa2_eth_free_dpbp(struct dpaa2_eth_priv *priv, struct dpaa2_eth_bp *bp);
struct sk_buff *dpaa2_eth_alloc_skb(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch,
const struct dpaa2_fd *fd, u32 fd_length,
void *fd_vaddr);
void dpaa2_eth_receive_skb(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch,
const struct dpaa2_fd *fd, void *vaddr,
struct dpaa2_eth_fq *fq,
struct rtnl_link_stats64 *percpu_stats,
struct sk_buff *skb);
void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch,
const struct dpaa2_fd *fd,
struct dpaa2_eth_fq *fq);
struct dpaa2_eth_bp *dpaa2_eth_allocate_dpbp(struct dpaa2_eth_priv *priv);
void dpaa2_eth_free_dpbp(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_bp *bp);
void *dpaa2_iova_to_virt(struct iommu_domain *domain, dma_addr_t iova_addr);
void dpaa2_eth_recycle_buf(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch,
dma_addr_t addr);
void dpaa2_eth_xdp_enqueue(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch,
struct dpaa2_fd *fd,
void *buf_start, u16 queue_id);
int dpaa2_xsk_wakeup(struct net_device *dev, u32 qid, u32 flags);
int dpaa2_xsk_setup_pool(struct net_device *dev, struct xsk_buff_pool *pool, u16 qid);
void dpaa2_eth_free_tx_fd(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch,
struct dpaa2_eth_fq *fq,
const struct dpaa2_fd *fd, bool in_napi);
bool dpaa2_xsk_tx(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch);
void *dpaa2_eth_sgt_get(struct dpaa2_eth_priv *priv);
void dpaa2_eth_sgt_recycle(struct dpaa2_eth_priv *priv, void *sgt_buf);
#endif