linux/drivers/net/ethernet/ezchip/nps_enet.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright(c) 2015 EZchip Technologies.
 */

#ifndef _NPS_ENET_H
#define _NPS_ENET_H

/* default values */
#define NPS_ENET_NAPI_POLL_WEIGHT
#define NPS_ENET_MAX_FRAME_LENGTH
#define NPS_ENET_GE_MAC_CFG_0_TX_FC_RETR
#define NPS_ENET_GE_MAC_CFG_0_RX_IFG
#define NPS_ENET_GE_MAC_CFG_0_TX_IFG
#define NPS_ENET_GE_MAC_CFG_0_TX_PR_LEN
#define NPS_ENET_GE_MAC_CFG_2_STAT_EN
#define NPS_ENET_GE_MAC_CFG_3_RX_IFG_TH
#define NPS_ENET_GE_MAC_CFG_3_MAX_LEN
#define NPS_ENET_ENABLE
#define NPS_ENET_DISABLE

/* register definitions  */
#define NPS_ENET_REG_TX_CTL
#define NPS_ENET_REG_TX_BUF
#define NPS_ENET_REG_RX_CTL
#define NPS_ENET_REG_RX_BUF
#define NPS_ENET_REG_BUF_INT_ENABLE
#define NPS_ENET_REG_GE_MAC_CFG_0
#define NPS_ENET_REG_GE_MAC_CFG_1
#define NPS_ENET_REG_GE_MAC_CFG_2
#define NPS_ENET_REG_GE_MAC_CFG_3
#define NPS_ENET_REG_GE_RST
#define NPS_ENET_REG_PHASE_FIFO_CTL

/* Tx control register masks and shifts */
#define TX_CTL_NT_MASK
#define TX_CTL_NT_SHIFT
#define TX_CTL_ET_MASK
#define TX_CTL_ET_SHIFT
#define TX_CTL_CT_MASK
#define TX_CTL_CT_SHIFT

/* Rx control register masks and shifts */
#define RX_CTL_NR_MASK
#define RX_CTL_NR_SHIFT
#define RX_CTL_CRC_MASK
#define RX_CTL_CRC_SHIFT
#define RX_CTL_ER_MASK
#define RX_CTL_ER_SHIFT
#define RX_CTL_CR_MASK
#define RX_CTL_CR_SHIFT

/* Interrupt enable for data buffer events register masks and shifts */
#define RX_RDY_MASK
#define RX_RDY_SHIFT
#define TX_DONE_MASK
#define TX_DONE_SHIFT

/* Gbps Eth MAC Configuration 0 register masks and shifts */
#define CFG_0_RX_EN_MASK
#define CFG_0_RX_EN_SHIFT
#define CFG_0_TX_EN_MASK
#define CFG_0_TX_EN_SHIFT
#define CFG_0_TX_FC_EN_MASK
#define CFG_0_TX_FC_EN_SHIFT
#define CFG_0_TX_PAD_EN_MASK
#define CFG_0_TX_PAD_EN_SHIFT
#define CFG_0_TX_CRC_EN_MASK
#define CFG_0_TX_CRC_EN_SHIFT
#define CFG_0_RX_FC_EN_MASK
#define CFG_0_RX_FC_EN_SHIFT
#define CFG_0_RX_CRC_STRIP_MASK
#define CFG_0_RX_CRC_STRIP_SHIFT
#define CFG_0_RX_CRC_IGNORE_MASK
#define CFG_0_RX_CRC_IGNORE_SHIFT
#define CFG_0_RX_LENGTH_CHECK_EN_MASK
#define CFG_0_RX_LENGTH_CHECK_EN_SHIFT
#define CFG_0_TX_FC_RETR_MASK
#define CFG_0_TX_FC_RETR_SHIFT
#define CFG_0_RX_IFG_MASK
#define CFG_0_RX_IFG_SHIFT
#define CFG_0_TX_IFG_MASK
#define CFG_0_TX_IFG_SHIFT
#define CFG_0_RX_PR_CHECK_EN_MASK
#define CFG_0_RX_PR_CHECK_EN_SHIFT
#define CFG_0_NIB_MODE_MASK
#define CFG_0_NIB_MODE_SHIFT
#define CFG_0_TX_IFG_NIB_MASK
#define CFG_0_TX_IFG_NIB_SHIFT
#define CFG_0_TX_PR_LEN_MASK
#define CFG_0_TX_PR_LEN_SHIFT

/* Gbps Eth MAC Configuration 1 register masks and shifts */
#define CFG_1_OCTET_0_MASK
#define CFG_1_OCTET_0_SHIFT
#define CFG_1_OCTET_1_MASK
#define CFG_1_OCTET_1_SHIFT
#define CFG_1_OCTET_2_MASK
#define CFG_1_OCTET_2_SHIFT
#define CFG_1_OCTET_3_MASK
#define CFG_1_OCTET_3_SHIFT

/* Gbps Eth MAC Configuration 2 register masks and shifts */
#define CFG_2_OCTET_4_MASK
#define CFG_2_OCTET_4_SHIFT
#define CFG_2_OCTET_5_MASK
#define CFG_2_OCTET_5_SHIFT
#define CFG_2_DISK_MC_MASK
#define CFG_2_DISK_MC_SHIFT
#define CFG_2_DISK_BC_MASK
#define CFG_2_DISK_BC_SHIFT
#define CFG_2_DISK_DA_MASK
#define CFG_2_DISK_DA_SHIFT
#define CFG_2_STAT_EN_MASK
#define CFG_2_STAT_EN_SHIFT
#define CFG_2_TRANSMIT_FLUSH_EN_MASK
#define CFG_2_TRANSMIT_FLUSH_EN_SHIFT

/* Gbps Eth MAC Configuration 3 register masks and shifts */
#define CFG_3_TM_HD_MODE_MASK
#define CFG_3_TM_HD_MODE_SHIFT
#define CFG_3_RX_CBFC_EN_MASK
#define CFG_3_RX_CBFC_EN_SHIFT
#define CFG_3_RX_CBFC_REDIR_EN_MASK
#define CFG_3_RX_CBFC_REDIR_EN_SHIFT
#define CFG_3_REDIRECT_CBFC_SEL_MASK
#define CFG_3_REDIRECT_CBFC_SEL_SHIFT
#define CFG_3_CF_DROP_MASK
#define CFG_3_CF_DROP_SHIFT
#define CFG_3_CF_TIMEOUT_MASK
#define CFG_3_CF_TIMEOUT_SHIFT
#define CFG_3_RX_IFG_TH_MASK
#define CFG_3_RX_IFG_TH_SHIFT
#define CFG_3_TX_CBFC_EN_MASK
#define CFG_3_TX_CBFC_EN_SHIFT
#define CFG_3_MAX_LEN_MASK
#define CFG_3_MAX_LEN_SHIFT
#define CFG_3_EXT_OOB_CBFC_SEL_MASK
#define CFG_3_EXT_OOB_CBFC_SEL_SHIFT

/* GE MAC, PCS reset control register masks and shifts */
#define RST_SPCS_MASK
#define RST_SPCS_SHIFT
#define RST_GMAC_0_MASK
#define RST_GMAC_0_SHIFT

/* Tx phase sync FIFO control register masks and shifts */
#define PHASE_FIFO_CTL_RST_MASK
#define PHASE_FIFO_CTL_RST_SHIFT
#define PHASE_FIFO_CTL_INIT_MASK
#define PHASE_FIFO_CTL_INIT_SHIFT

/**
 * struct nps_enet_priv - Storage of ENET's private information.
 * @regs_base:      Base address of ENET memory-mapped control registers.
 * @irq:            For RX/TX IRQ number.
 * @tx_skb:         socket buffer of sent frame.
 * @napi:           Structure for NAPI.
 */
struct nps_enet_priv {};

/**
 * nps_enet_reg_set - Sets ENET register with provided value.
 * @priv:       Pointer to EZchip ENET private data structure.
 * @reg:        Register offset from base address.
 * @value:      Value to set in register.
 */
static inline void nps_enet_reg_set(struct nps_enet_priv *priv,
				    s32 reg, s32 value)
{}

/**
 * nps_enet_reg_get - Gets value of specified ENET register.
 * @priv:       Pointer to EZchip ENET private data structure.
 * @reg:        Register offset from base address.
 *
 * returns:     Value of requested register.
 */
static inline u32 nps_enet_reg_get(struct nps_enet_priv *priv, s32 reg)
{}

#endif /* _NPS_ENET_H */