linux/drivers/net/ethernet/asix/ax88796c_main.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2010 ASIX Electronics Corporation
 * Copyright (c) 2020 Samsung Electronics
 *
 * ASIX AX88796C SPI Fast Ethernet Linux driver
 */

#ifndef _AX88796C_MAIN_H
#define _AX88796C_MAIN_H

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

#include "ax88796c_spi.h"

/* These identify the driver base version and may not be removed. */
#define DRV_NAME
#define ADP_NAME

#define TX_QUEUE_HIGH_WATER
#define TX_QUEUE_LOW_WATER

#define AX88796C_REGDUMP_LEN
#define AX88796C_PHY_REGDUMP_LEN
#define AX88796C_PHY_ID

#define TX_OVERHEAD
#define TX_EOP_SIZE

#define AX_MCAST_FILTER_SIZE
#define AX_MAX_MCAST
#define AX_MAX_CLK
#define TX_HDR_SOP_DICF
#define TX_HDR_SOP_CPHI
#define TX_HDR_SOP_INT
#define TX_HDR_SOP_MDEQ
#define TX_HDR_SOP_PKTLEN
#define TX_HDR_SOP_SEQNUM
#define TX_HDR_SOP_PKTLENBAR

#define TX_HDR_SEG_FS
#define TX_HDR_SEG_LS
#define TX_HDR_SEG_SEGNUM
#define TX_HDR_SEG_SEGLEN
#define TX_HDR_SEG_EOFST
#define TX_HDR_SEG_SOFST
#define TX_HDR_SEG_SEGLENBAR

#define TX_HDR_EOP_SEQNUM
#define TX_HDR_EOP_PKTLEN
#define TX_HDR_EOP_SEQNUMBAR
#define TX_HDR_EOP_PKTLENBAR

/* Rx header fields mask */
#define RX_HDR1_MCBC
#define RX_HDR1_STUFF_PKT
#define RX_HDR1_MII_ERR
#define RX_HDR1_CRC_ERR
#define RX_HDR1_PKT_LEN

#define RX_HDR2_SEQ_NUM
#define RX_HDR2_PKT_LEN_BAR

#define RX_HDR3_PE
#define RX_HDR3_L3_TYPE_IPV4V6
#define RX_HDR3_L3_TYPE_IP
#define RX_HDR3_L3_TYPE_IPV6
#define RX_HDR3_L4_TYPE_ICMPV6
#define RX_HDR3_L4_TYPE_TCP
#define RX_HDR3_L4_TYPE_IGMP
#define RX_HDR3_L4_TYPE_ICMP
#define RX_HDR3_L4_TYPE_UDP
#define RX_HDR3_L3_ERR
#define RX_HDR3_L4_ERR
#define RX_HDR3_PRIORITY(x)
#define RX_HDR3_STRIP
#define RX_HDR3_VLAN_ID

struct ax88796c_pcpu_stats {};

struct ax88796c_device {};

#define to_ax88796c_device(ndev)

enum skb_state {};

struct skb_data {};

/* A88796C register definition */
	/* Definition of PAGE0 */
#define P0_PSR
	#define PSR_DEV_READY
	#define PSR_RESET
	#define PSR_RESET_CLR
#define P0_BOR
#define P0_FER
	#define FER_IPALM
	#define FER_DCRC
	#define FER_RH3M
	#define FER_HEADERSWAP
	#define FER_WSWAP
	#define FER_BSWAP
	#define FER_INTHI
	#define FER_INTLO
	#define FER_IRQ_PULL
	#define FER_RXEN
	#define FER_TXEN
#define P0_ISR
	#define ISR_RXPKT
	#define ISR_MDQ
	#define ISR_TXT
	#define ISR_TXPAGES
	#define ISR_TXERR
	#define ISR_LINK
#define P0_IMR
	#define IMR_RXPKT
	#define IMR_MDQ
	#define IMR_TXT
	#define IMR_TXPAGES
	#define IMR_TXERR
	#define IMR_LINK
	#define IMR_MASKALL
	#define IMR_DEFAULT
#define P0_WFCR
	#define WFCR_PMEIND
	#define WFCR_PMETYPE
	#define WFCR_PMEPOL
	#define WFCR_PMERST
	#define WFCR_SLEEP
	#define WFCR_WAKEUP
	#define WFCR_WAITEVENT
	#define WFCR_CLRWAKE
	#define WFCR_LINKCH
	#define WFCR_MAGICP
	#define WFCR_WAKEF
	#define WFCR_PMEEN
	#define WFCR_LINKCHS
	#define WFCR_MAGICPS
	#define WFCR_WAKEFS
	#define WFCR_PMES
#define P0_PSCR
	#define PSCR_PS_MASK
	#define PSCR_PS_D0
	#define PSCR_PS_D1
	#define PSCR_PS_D2
	#define PSCR_FPS
	#define PSCR_SWPS
						 /* PS control */
	#define PSCR_WOLPS
	#define PSCR_SWWOL
						 /* WOL PS */
	#define PSCR_PHYOSC
	#define PSCR_FOFEF
	#define PSCR_FOF
	#define PSCR_PHYPD
						  /* Active high */
	#define PSCR_PHYRST
						  /* Active low */
	#define PSCR_PHYCSIL
	#define PSCR_PHYCOFF
	#define PSCR_PHYLINK
	#define PSCR_EEPOK
#define P0_MACCR
	#define MACCR_RXEN
	#define MACCR_DUPLEX_FULL
	#define MACCR_SPEED_100
	#define MACCR_RXFC_ENABLE
	#define MACCR_RXFC_MASK
	#define MACCR_TXFC_ENABLE
	#define MACCR_TXFC_MASK
	#define MACCR_PSI
					       /* Power Saving Interrupt */
	#define MACCR_PF
	#define MACCR_PMM_BITS
	#define MACCR_PMM_MASK
	#define MACCR_PMM_RESET
	#define MACCR_PMM_WAIT
	#define MACCR_PMM_READY
	#define MACCR_PMM_D1
	#define MACCR_PMM_D2
	#define MACCR_PMM_WAKE
	#define MACCR_PMM_D1_WAKE
	#define MACCR_PMM_D2_WAKE
	#define MACCR_PMM_SLEEP
	#define MACCR_PMM_PHY_RESET
	#define MACCR_PMM_SOFT_D1
	#define MACCR_PMM_SOFT_D2
#define P0_TFBFCR
	#define TFBFCR_SCHE_FREE_PAGE
	#define TFBFCR_FREE_PAGE_BITS
	#define TFBFCR_FREE_PAGE_LATCH
	#define TFBFCR_SET_FREE_PAGE(x)
	#define TFBFCR_TX_PAGE_SET
	#define TFBFCR_MANU_ENTX
	#define TX_FREEBUF_MASK
	#define TX_DPTSTART

#define P0_TSNR
	#define TXNR_TXB_ERR
	#define TXNR_TXB_IDLE
	#define TSNR_PKT_CNT(x)
	#define TXNR_TXB_REINIT
	#define TSNR_TXB_START
#define P0_RTDPR
#define P0_RXBCR1
	#define RXBCR1_RXB_DISCARD
	#define RXBCR1_RXB_START
#define P0_RXBCR2
	#define RXBCR2_PKT_MASK
	#define RXBCR2_RXPC_MASK
	#define RXBCR2_RXB_READY
	#define RXBCR2_RXB_IDLE
	#define RXBCR2_RXB_REINIT
#define P0_RTWCR
	#define RTWCR_RXWC_MASK
	#define RTWCR_RX_LATCH
#define P0_RCPHR

	/* Definition of PAGE1 */
#define P1_RPPER
	#define RPPER_RXEN
#define P1_MRCR
#define P1_MDR
#define P1_RMPR
#define P1_TMPR
#define P1_RXBSPCR
	#define RXBSPCR_STUF_WORD_CNT(x)
	#define RXBSPCR_STUF_ENABLE
#define P1_MCR
	#define MCR_SBP
	#define MCR_SM
	#define MCR_CRCENLAN
	#define MCR_STP
	/* Definition of PAGE2 */
#define P2_CIR
#define P2_PCR
	#define PCR_POLL_EN
	#define PCR_POLL_FLOWCTRL
	#define PCR_POLL_BMCR
	#define PCR_PHYID(x)
#define P2_PHYSR
#define P2_MDIODR
#define P2_MDIOCR
	#define MDIOCR_RADDR(x)
	#define MDIOCR_FADDR(x)
	#define MDIOCR_VALID
	#define MDIOCR_READ
	#define MDIOCR_WRITE
#define P2_LCR0
	#define LCR_LED0_EN
	#define LCR_LED0_100MODE
	#define LCR_LED0_DUPLEX
	#define LCR_LED0_LINK
	#define LCR_LED0_ACT
	#define LCR_LED0_COL
	#define LCR_LED0_10MODE
	#define LCR_LED0_DUPCOL
	#define LCR_LED1_EN
	#define LCR_LED1_100MODE
	#define LCR_LED1_DUPLEX
	#define LCR_LED1_LINK
	#define LCR_LED1_ACT
	#define LCR_LED1_COL
	#define LCR_LED1_10MODE
	#define LCR_LED1_DUPCOL
#define P2_LCR1
	#define LCR_LED2_MASK
	#define LCR_LED2_EN
	#define LCR_LED2_100MODE
	#define LCR_LED2_DUPLEX
	#define LCR_LED2_LINK
	#define LCR_LED2_ACT
	#define LCR_LED2_COL
	#define LCR_LED2_10MODE
	#define LCR_LED2_DUPCOL
#define P2_IPGCR
#define P2_CRIR
#define P2_FLHWCR
#define P2_RXCR
	#define RXCR_PRO
	#define RXCR_AMALL
	#define RXCR_SEP
	#define RXCR_AB
	#define RXCR_AM
	#define RXCR_AP
	#define RXCR_ARP
#define P2_JLCR
#define P2_MPLR

	/* Definition of PAGE3 */
#define P3_MACASR0
	#define P3_MACASR(x)
	#define MACASR_LOWBYTE_MASK
	#define MACASR_HIGH_BITS
#define P3_MACASR1
#define P3_MACASR2
#define P3_MFAR01
#define P3_MFAR_BASE
	#define P3_MFAR(x)

#define P3_MFAR23
#define P3_MFAR45
#define P3_MFAR67
#define P3_VID0FR
#define P3_VID1FR
#define P3_EECSR
#define P3_EEDR
#define P3_EECR
	#define EECR_ADDR_MASK
	#define EECR_READ_ACT
	#define EECR_WRITE_ACT
	#define EECR_WRITE_DISABLE
	#define EECR_WRITE_ENABLE
	#define EECR_EE_READY
	#define EECR_RELOAD
	#define EECR_RESET
#define P3_TPCR
	#define TPCR_PATT_MASK
	#define TPCR_RAND_PKT_EN
	#define TPCR_FIXED_PKT_EN
#define P3_TPLR
	/* Definition of PAGE4 */
#define P4_SPICR
	#define SPICR_RCEN
	#define SPICR_QCEN
	#define SPICR_RBRE
	#define SPICR_PMM
	#define SPICR_LOOPBACK
	#define SPICR_CORE_RES_CLR
	#define SPICR_SPI_RES_CLR
#define P4_SPIISMR

#define P4_COERCR0
	#define COERCR0_RXIPCE
	#define COERCR0_RXIPVE
	#define COERCR0_RXV6PE
	#define COERCR0_RXTCPE
	#define COERCR0_RXUDPE
	#define COERCR0_RXICMP
	#define COERCR0_RXIGMP
	#define COERCR0_RXICV6

	#define COERCR0_RXTCPV6
	#define COERCR0_RXUDPV6
	#define COERCR0_RXICMV6
	#define COERCR0_RXIGMV6
	#define COERCR0_RXICV6V6

	#define COERCR0_DEFAULT
#define P4_COERCR1
	#define COERCR1_IPCEDP
	#define COERCR1_IPVEDP
	#define COERCR1_V6VEDP
	#define COERCR1_TCPEDP
	#define COERCR1_UDPEDP
	#define COERCR1_ICMPDP
	#define COERCR1_IGMPDP
	#define COERCR1_ICV6DP
	#define COERCR1_RX64TE
	#define COERCR1_RXPPPE
	#define COERCR1_TCP6DP
	#define COERCR1_UDP6DP
	#define COERCR1_IC6DP
	#define COERCR1_IG6DP
	#define COERCR1_ICV66DP
	#define COERCR1_RPCE

	#define COERCR1_DEFAULT

#define P4_COETCR0
	#define COETCR0_TXIP
	#define COETCR0_TXTCP
	#define COETCR0_TXUDP
	#define COETCR0_TXICMP
	#define COETCR0_TXIGMP
	#define COETCR0_TXICV6
	#define COETCR0_TXTCPV6
	#define COETCR0_TXUDPV6
	#define COETCR0_TXICMV6
	#define COETCR0_TXIGMV6
	#define COETCR0_TXICV6V6

	#define COETCR0_DEFAULT
#define P4_COETCR1
	#define COETCR1_TX64TE
	#define COETCR1_TXPPPE

#define P4_COECEDR
#define P4_L2CECR

	/* Definition of PAGE5 */
#define P5_WFTR
	#define WFTR_2MS
	#define WFTR_4MS
	#define WFTR_8MS
	#define WFTR_16MS
	#define WFTR_32MS
	#define WFTR_64MS
	#define WFTR_128MS
	#define WFTR_256MS
	#define WFTR_512MS
	#define WFTR_1024MS
	#define WFTR_2048MS
	#define WFTR_4096MS
	#define WFTR_8192MS
	#define WFTR_16384MS
	#define WFTR_32768MS
#define P5_WFCCR
#define P5_WFCR03
	#define WFCR03_F0_EN
	#define WFCR03_F1_EN
	#define WFCR03_F2_EN
	#define WFCR03_F3_EN
#define P5_WFCR47
	#define WFCR47_F4_EN
	#define WFCR47_F5_EN
	#define WFCR47_F6_EN
	#define WFCR47_F7_EN
#define P5_WF0BMR0
#define P5_WF0BMR1
#define P5_WF0CR
#define P5_WF0OBR
#define P5_WF1BMR0
#define P5_WF1BMR1
#define P5_WF1CR
#define P5_WF1OBR
#define P5_WF2BMR0
#define P5_WF2BMR1

	/* Definition of PAGE6 */
#define P6_WF2CR
#define P6_WF2OBR
#define P6_WF3BMR0
#define P6_WF3BMR1
#define P6_WF3CR
#define P6_WF3OBR
#define P6_WF4BMR0
#define P6_WF4BMR1
#define P6_WF4CR
#define P6_WF4OBR
#define P6_WF5BMR0
#define P6_WF5BMR1
#define P6_WF5CR
#define P6_WF5OBR

/* Definition of PAGE7 */
#define P7_WF6BMR0
#define P7_WF6BMR1
#define P7_WF6CR
#define P7_WF6OBR
#define P7_WF7BMR0
#define P7_WF7BMR1
#define P7_WF7CR
#define P7_WF7OBR
#define P7_WFR01
#define P7_WFR23
#define P7_WFR45
#define P7_WFR67
#define P7_WFPC0
#define P7_WFPC1

/* Tx headers structure */
struct tx_sop_header {};

struct tx_segment_header {};

struct tx_eop_header {};

struct tx_pkt_info {};

/* Rx headers structure */
struct rx_header {};

extern unsigned long ax88796c_no_regs_mask[];

#endif /* #ifndef _AX88796C_MAIN_H */