linux/drivers/net/ethernet/davicom/dm9051.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2022 Davicom Semiconductor,Inc.
 * Davicom DM9051 SPI Fast Ethernet Linux driver
 */

#ifndef _DM9051_H_
#define _DM9051_H_

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

#define DM9051_ID

#define DM9051_NCR
#define DM9051_NSR
#define DM9051_TCR
#define DM9051_RCR
#define DM9051_BPTR
#define DM9051_FCR
#define DM9051_EPCR
#define DM9051_EPAR
#define DM9051_EPDRL
#define DM9051_EPDRH
#define DM9051_PAR
#define DM9051_MAR
#define DM9051_GPCR
#define DM9051_GPR

#define DM9051_VIDL
#define DM9051_VIDH
#define DM9051_PIDL
#define DM9051_PIDH
#define DM9051_SMCR
#define DM9051_ATCR
#define DM9051_SPIBCR
#define DM9051_INTCR
#define DM9051_PPCR

#define DM9051_MPCR
#define DM9051_LMCR
#define DM9051_MBNDRY

#define DM9051_MRRL
#define DM9051_MRRH
#define DM9051_MWRL
#define DM9051_MWRH
#define DM9051_TXPLL
#define DM9051_TXPLH
#define DM9051_ISR
#define DM9051_IMR

#define DM_SPI_MRCMDX
#define DM_SPI_MRCMD
#define DM_SPI_MWCMD

#define DM_SPI_WR

/* dm9051 Ethernet controller registers bits
 */
/* 0x00 */
#define NCR_WAKEEN
#define NCR_FDX
#define NCR_RST
/* 0x01 */
#define NSR_SPEED
#define NSR_LINKST
#define NSR_WAKEST
#define NSR_TX2END
#define NSR_TX1END
/* 0x02 */
#define TCR_DIS_JABBER_TIMER
#define TCR_TXREQ
/* 0x05 */
#define RCR_DIS_WATCHDOG_TIMER
#define RCR_DIS_LONG
#define RCR_DIS_CRC
#define RCR_ALL
#define RCR_PRMSC
#define RCR_RXEN
#define RCR_RX_DISABLE
/* 0x06 */
#define RSR_RF
#define RSR_MF
#define RSR_LCS
#define RSR_RWTO
#define RSR_PLE
#define RSR_AE
#define RSR_CE
#define RSR_FOE
#define RSR_ERR_BITS
/* 0x0A */
#define FCR_TXPEN
#define FCR_BKPM
#define FCR_FLCE
#define FCR_RXTX_BITS
/* 0x0B */
#define EPCR_WEP
#define EPCR_EPOS
#define EPCR_ERPRR
#define EPCR_ERPRW
#define EPCR_ERRE
/* 0x1E */
#define GPCR_GEP_CNTL
/* 0x1F */
#define GPR_PHY_OFF
/* 0x30 */
#define ATCR_AUTO_TX
/* 0x39 */
#define INTCR_POL_LOW
#define INTCR_POL_HIGH
/* 0x3D */
/* Pause Packet Control Register - default = 1 */
#define PPCR_PAUSE_COUNT
/* 0x55 */
#define MPCR_RSTTX
#define MPCR_RSTRX
/* 0x57 */
/* LEDMode Control Register - LEDMode1 */
/* Value 0x81 : bit[7] = 1, bit[2] = 0, bit[1:0] = 01b */
#define LMCR_NEWMOD
#define LMCR_TYPED1
#define LMCR_TYPED0
#define LMCR_MODE1
/* 0x5E */
#define MBNDRY_BYTE
/* 0xFE */
#define ISR_MBS
#define ISR_LNKCHG
#define ISR_ROOS
#define ISR_ROS
#define ISR_PTS
#define ISR_PRS
#define ISR_CLR_INT
#define ISR_STOP_MRCMD
/* 0xFF */
#define IMR_PAR
#define IMR_LNKCHGI
#define IMR_PTM
#define IMR_PRM

/* Const
 */
#define DM9051_PHY_ADDR
#define DM9051_PHY
#define DM9051_PKT_RDY
#define DM9051_PKT_MAX
#define DM9051_TX_QUE_HI_WATER
#define DM9051_TX_QUE_LO_WATER
#define DM_EEPROM_MAGIC

#define DM_RXHDR_SIZE

static inline struct board_info *to_dm9051_board(struct net_device *ndev)
{}

#endif /* _DM9051_H_ */