linux/drivers/net/ethernet/altera/altera_tse.h

/* SPDX-License-Identifier: GPL-2.0-only */
/* Altera Triple-Speed Ethernet MAC driver
 * Copyright (C) 2008-2014 Altera Corporation. All rights reserved
 *
 * Contributors:
 *   Dalon Westergreen
 *   Thomas Chou
 *   Ian Abbott
 *   Yuriy Kozlov
 *   Tobias Klauser
 *   Andriy Smolskyy
 *   Roman Bulgakov
 *   Dmytro Mytarchuk
 *   Matthew Gerlach
 *
 * Original driver contributed by SLS.
 * Major updates contributed by GlobalLogic
 */

#ifndef __ALTERA_TSE_H__
#define __ALTERA_TSE_H__

#define ALTERA_TSE_RESOURCE_NAME

#include <linux/bitops.h>
#include <linux/if_vlan.h>
#include <linux/list.h>
#include <linux/netdevice.h>
#include <linux/phy.h>
#include <linux/phylink.h>

#define ALTERA_TSE_SW_RESET_WATCHDOG_CNTR
#define ALTERA_TSE_MAC_FIFO_WIDTH
/* Rx FIFO default settings */
#define ALTERA_TSE_RX_SECTION_EMPTY
#define ALTERA_TSE_RX_SECTION_FULL
#define ALTERA_TSE_RX_ALMOST_EMPTY
#define ALTERA_TSE_RX_ALMOST_FULL

/* Tx FIFO default settings */
#define ALTERA_TSE_TX_SECTION_EMPTY
#define ALTERA_TSE_TX_SECTION_FULL
#define ALTERA_TSE_TX_ALMOST_EMPTY
#define ALTERA_TSE_TX_ALMOST_FULL

/* MAC function configuration default settings */
#define ALTERA_TSE_TX_IPG_LENGTH

#define ALTERA_TSE_PAUSE_QUANTA

#define GET_BIT_VALUE(v, bit)

/* MAC Command_Config Register Bit Definitions
 */
#define MAC_CMDCFG_TX_ENA
#define MAC_CMDCFG_RX_ENA
#define MAC_CMDCFG_XON_GEN
#define MAC_CMDCFG_ETH_SPEED
#define MAC_CMDCFG_PROMIS_EN
#define MAC_CMDCFG_PAD_EN
#define MAC_CMDCFG_CRC_FWD
#define MAC_CMDCFG_PAUSE_FWD
#define MAC_CMDCFG_PAUSE_IGNORE
#define MAC_CMDCFG_TX_ADDR_INS
#define MAC_CMDCFG_HD_ENA
#define MAC_CMDCFG_EXCESS_COL
#define MAC_CMDCFG_LATE_COL
#define MAC_CMDCFG_SW_RESET
#define MAC_CMDCFG_MHASH_SEL
#define MAC_CMDCFG_LOOP_ENA
#define MAC_CMDCFG_TX_ADDR_SEL(v)
#define MAC_CMDCFG_MAGIC_ENA
#define MAC_CMDCFG_SLEEP
#define MAC_CMDCFG_WAKEUP
#define MAC_CMDCFG_XOFF_GEN
#define MAC_CMDCFG_CNTL_FRM_ENA
#define MAC_CMDCFG_NO_LGTH_CHECK
#define MAC_CMDCFG_ENA_10
#define MAC_CMDCFG_RX_ERR_DISC
#define MAC_CMDCFG_DISABLE_READ_TIMEOUT
#define MAC_CMDCFG_CNT_RESET

#define MAC_CMDCFG_TX_ENA_GET(v)
#define MAC_CMDCFG_RX_ENA_GET(v)
#define MAC_CMDCFG_XON_GEN_GET(v)
#define MAC_CMDCFG_ETH_SPEED_GET(v)
#define MAC_CMDCFG_PROMIS_EN_GET(v)
#define MAC_CMDCFG_PAD_EN_GET(v)
#define MAC_CMDCFG_CRC_FWD_GET(v)
#define MAC_CMDCFG_PAUSE_FWD_GET(v)
#define MAC_CMDCFG_PAUSE_IGNORE_GET(v)
#define MAC_CMDCFG_TX_ADDR_INS_GET(v)
#define MAC_CMDCFG_HD_ENA_GET(v)
#define MAC_CMDCFG_EXCESS_COL_GET(v)
#define MAC_CMDCFG_LATE_COL_GET(v)
#define MAC_CMDCFG_SW_RESET_GET(v)
#define MAC_CMDCFG_MHASH_SEL_GET(v)
#define MAC_CMDCFG_LOOP_ENA_GET(v)
#define MAC_CMDCFG_TX_ADDR_SEL_GET(v)
#define MAC_CMDCFG_MAGIC_ENA_GET(v)
#define MAC_CMDCFG_SLEEP_GET(v)
#define MAC_CMDCFG_WAKEUP_GET(v)
#define MAC_CMDCFG_XOFF_GEN_GET(v)
#define MAC_CMDCFG_CNTL_FRM_ENA_GET(v)
#define MAC_CMDCFG_NO_LGTH_CHECK_GET(v)
#define MAC_CMDCFG_ENA_10_GET(v)
#define MAC_CMDCFG_RX_ERR_DISC_GET(v)
#define MAC_CMDCFG_DISABLE_READ_TIMEOUT_GET(v)
#define MAC_CMDCFG_CNT_RESET_GET(v)

/* MDIO registers within MAC register Space
 */
struct altera_tse_mdio {};

/* MAC register Space. Note that some of these registers may or may not be
 * present depending upon options chosen by the user when the core was
 * configured and built. Please consult the Altera Triple Speed Ethernet User
 * Guide for details.
 */
struct altera_tse_mac {};

#define tse_csroffs(a)

/* Transmit and Receive Command Registers Bit Definitions
 */
#define ALTERA_TSE_TX_CMD_STAT_OMIT_CRC
#define ALTERA_TSE_TX_CMD_STAT_TX_SHIFT16
#define ALTERA_TSE_RX_CMD_STAT_RX_SHIFT16

/* Wrapper around a pointer to a socket buffer,
 * so a DMA handle can be stored along with the buffer
 */
struct tse_buffer {};

struct altera_tse_private;

#define ALTERA_DTYPE_SGDMA
#define ALTERA_DTYPE_MSGDMA

/* standard DMA interface for SGDMA and MSGDMA */
struct altera_dmaops {};

/* This structure is private to each device.
 */
struct altera_tse_private {};

/* Function prototypes
 */
void altera_tse_set_ethtool_ops(struct net_device *);

static inline
u32 csrrd32(void __iomem *mac, size_t offs)
{}

static inline
u16 csrrd16(void __iomem *mac, size_t offs)
{}

static inline
u8 csrrd8(void __iomem *mac, size_t offs)
{}

static inline
void csrwr32(u32 val, void __iomem *mac, size_t offs)
{}

static inline
void csrwr16(u16 val, void __iomem *mac, size_t offs)
{}

static inline
void csrwr8(u8 val, void __iomem *mac, size_t offs)
{}

#endif /* __ALTERA_TSE_H__ */