xref: /linux/drivers/net/ethernet/microchip/lan743x_ethtool.h (revision 7ae9fb1b7ecbb5d85d07857943f677fd1a559b18)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /* Copyright (C) 2018 Microchip Technology Inc. */
3 
4 #ifndef _LAN743X_ETHTOOL_H
5 #define _LAN743X_ETHTOOL_H
6 
7 #include "linux/ethtool.h"
8 
9 #define LAN743X_ETH_REG_VERSION         1
10 
11 enum {
12 	ETH_PRIV_FLAGS,
13 	ETH_ID_REV,
14 	ETH_FPGA_REV,
15 	ETH_STRAP_READ,
16 	ETH_INT_STS,
17 	ETH_HW_CFG,
18 	ETH_PMT_CTL,
19 	ETH_E2P_CMD,
20 	ETH_E2P_DATA,
21 	ETH_MAC_CR,
22 	ETH_MAC_RX,
23 	ETH_MAC_TX,
24 	ETH_FLOW,
25 	ETH_MII_ACC,
26 	ETH_MII_DATA,
27 	ETH_EEE_TX_LPI_REQ_DLY,
28 	ETH_WUCSR,
29 	ETH_WK_SRC,
30 
31 	/* Add new registers above */
32 	MAX_LAN743X_ETH_COMMON_REGS
33 };
34 
35 enum {
36 	/* SGMII Register */
37 	ETH_SR_VSMMD_DEV_ID1,
38 	ETH_SR_VSMMD_DEV_ID2,
39 	ETH_SR_VSMMD_PCS_ID1,
40 	ETH_SR_VSMMD_PCS_ID2,
41 	ETH_SR_VSMMD_STS,
42 	ETH_SR_VSMMD_CTRL,
43 	ETH_SR_MII_CTRL,
44 	ETH_SR_MII_STS,
45 	ETH_SR_MII_DEV_ID1,
46 	ETH_SR_MII_DEV_ID2,
47 	ETH_SR_MII_AN_ADV,
48 	ETH_SR_MII_LP_BABL,
49 	ETH_SR_MII_EXPN,
50 	ETH_SR_MII_EXT_STS,
51 	ETH_SR_MII_TIME_SYNC_ABL,
52 	ETH_SR_MII_TIME_SYNC_TX_MAX_DLY_LWR,
53 	ETH_SR_MII_TIME_SYNC_TX_MAX_DLY_UPR,
54 	ETH_SR_MII_TIME_SYNC_TX_MIN_DLY_LWR,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_VR_MII_GEN2_GEN4_LVL_CTRL,
91 	ETH_VR_MII_GEN4_MISC_CTRL2,
92 	ETH_VR_MII_GEN2_GEN4_MISC_CTRL0,
93 	ETH_VR_MII_GEN2_GEN4_MISC_CTRL1,
94 	ETH_VR_MII_SNPS_CR_CTRL,
95 	ETH_VR_MII_SNPS_CR_ADDR,
96 	ETH_VR_MII_SNPS_CR_DATA,
97 	ETH_VR_MII_DIG_CTRL2,
98 	ETH_VR_MII_DIG_ERRCNT,
99 
100 	/* Add new registers above */
101 	MAX_LAN743X_ETH_SGMII_REGS
102 };
103 
104 extern const struct ethtool_ops lan743x_ethtool_ops;
105 
106 #endif /* _LAN743X_ETHTOOL_H */
107