linux/drivers/net/ethernet/wangxun/ngbe/ngbe_type.h

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2019 - 2022 Beijing WangXun Technology Co., Ltd. */

#ifndef _NGBE_TYPE_H_
#define _NGBE_TYPE_H_

#include <linux/types.h>
#include <linux/netdevice.h>

/************ NGBE_register.h ************/
/* Device IDs */
#define NGBE_DEV_ID_EM_WX1860AL_W
#define NGBE_DEV_ID_EM_WX1860A2
#define NGBE_DEV_ID_EM_WX1860A2S
#define NGBE_DEV_ID_EM_WX1860A4
#define NGBE_DEV_ID_EM_WX1860A4S
#define NGBE_DEV_ID_EM_WX1860AL2
#define NGBE_DEV_ID_EM_WX1860AL2S
#define NGBE_DEV_ID_EM_WX1860AL4
#define NGBE_DEV_ID_EM_WX1860AL4S
#define NGBE_DEV_ID_EM_WX1860LC
#define NGBE_DEV_ID_EM_WX1860A1
#define NGBE_DEV_ID_EM_WX1860A1L

/* Subsystem ID */
#define NGBE_SUBID_M88E1512_SFP
#define NGBE_SUBID_OCP_CARD
#define NGBE_SUBID_LY_M88E1512_SFP
#define NGBE_SUBID_M88E1512_RJ45
#define NGBE_SUBID_M88E1512_MIX
#define NGBE_SUBID_YT8521S_SFP
#define NGBE_SUBID_INTERNAL_YT8521S_SFP
#define NGBE_SUBID_YT8521S_SFP_GPIO
#define NGBE_SUBID_INTERNAL_YT8521S_SFP_GPIO
#define NGBE_SUBID_LY_YT8521S_SFP
#define NGBE_SUBID_RGMII_FPGA

#define NGBE_OEM_MASK

#define NGBE_NCSI_SUP
#define NGBE_NCSI_MASK
#define NGBE_WOL_SUP
#define NGBE_WOL_MASK

/**************** EM Registers ****************************/
/* chip control Registers */
#define NGBE_MIS_PRB_CTL
/* FMGR Registers */
#define NGBE_SPI_ILDR_STATUS
#define NGBE_SPI_ILDR_STATUS_PERST
#define NGBE_SPI_ILDR_STATUS_PWRRST

/* Checksum and EEPROM pointers */
#define NGBE_CALSUM_COMMAND
#define NGBE_CALSUM_CAP_STATUS
#define NGBE_EEPROM_VERSION_STORE_REG
#define NGBE_SAN_MAC_ADDR_PTR
#define NGBE_DEVICE_CAPS
#define NGBE_EEPROM_VERSION_L
#define NGBE_EEPROM_VERSION_H

/* GPIO Registers */
#define NGBE_GPIO_DR
#define NGBE_GPIO_DDR
/*GPIO bit */
#define NGBE_GPIO_DR_0
#define NGBE_GPIO_DR_1
#define NGBE_GPIO_DDR_0
#define NGBE_GPIO_DDR_1

/* Extended Interrupt Enable Set */
#define NGBE_PX_MISC_IEN_DEV_RST
#define NGBE_PX_MISC_IEN_ETH_LK
#define NGBE_PX_MISC_IEN_INT_ERR
#define NGBE_PX_MISC_IEN_GPIO
#define NGBE_PX_MISC_IEN_MASK

#define NGBE_INTR_ALL
#define NGBE_INTR_MISC

#define NGBE_PHY_CONFIG(reg_offset)
#define NGBE_CFG_LAN_SPEED
#define NGBE_CFG_PORT_ST

/* Wake up registers */
#define NGBE_PSR_WKUP_CTL
/* Wake Up Filter Control Bit */
#define NGBE_PSR_WKUP_CTL_LNKC
#define NGBE_PSR_WKUP_CTL_MAG
#define NGBE_PSR_WKUP_CTL_EX
#define NGBE_PSR_WKUP_CTL_MC
#define NGBE_PSR_WKUP_CTL_BC
#define NGBE_PSR_WKUP_CTL_ARP
#define NGBE_PSR_WKUP_CTL_IPV4
#define NGBE_PSR_WKUP_CTL_IPV6

#define NGBE_FW_EEPROM_CHECKSUM_CMD
#define NGBE_FW_NVM_DATA_OFFSET
#define NGBE_FW_CMD_DEFAULT_CHECKSUM
#define NGBE_FW_CMD_ST_PASS
#define NGBE_FW_CMD_ST_FAIL

#define NGBE_MAX_FDIR_INDICES
#define NGBE_MAX_RSS_INDICES

#define NGBE_MAX_RX_QUEUES
#define NGBE_MAX_TX_QUEUES

#define NGBE_ETH_LENGTH_OF_ADDRESS
#define NGBE_MAX_MSIX_VECTORS
#define NGBE_RAR_ENTRIES
#define NGBE_RX_PB_SIZE
#define NGBE_MC_TBL_SIZE
#define NGBE_SP_VFT_TBL_SIZE
#define NGBE_TDB_PB_SZ

/* TX/RX descriptor defines */
#define NGBE_DEFAULT_TXD
#define NGBE_DEFAULT_TX_WORK
#define NGBE_MAX_TXD
#define NGBE_MIN_TXD

#define NGBE_DEFAULT_RXD
#define NGBE_DEFAULT_RX_WORK
#define NGBE_MAX_RXD
#define NGBE_MIN_RXD

extern char ngbe_driver_name[];

void ngbe_down(struct wx *wx);
void ngbe_up(struct wx *wx);
int ngbe_setup_tc(struct net_device *dev, u8 tc);

#endif /* _NGBE_TYPE_H_ */