1 #include <stdio.h>
2 #include <string.h>
3 #include "internal.h"
4
lan78xx_dump_regs(struct ethtool_drvinfo * info maybe_unused,struct ethtool_regs * regs)5 int lan78xx_dump_regs(struct ethtool_drvinfo *info maybe_unused,
6 struct ethtool_regs *regs)
7 {
8 unsigned int *lan78xx_reg = (unsigned int *)regs->data;
9
10 fprintf(stdout, "LAN78xx Registers:\n");
11 fprintf(stdout, "------------------\n");
12 fprintf(stdout, "ID_REV = 0x%08X\n", *lan78xx_reg++);
13 fprintf(stdout, "INT_STS = 0x%08X\n", *lan78xx_reg++);
14 fprintf(stdout, "HW_CFG = 0x%08X\n", *lan78xx_reg++);
15 fprintf(stdout, "PMT_CTRL = 0x%08X\n", *lan78xx_reg++);
16 fprintf(stdout, "E2P_CMD = 0x%08X\n", *lan78xx_reg++);
17 fprintf(stdout, "E2P_DATA = 0x%08X\n", *lan78xx_reg++);
18 fprintf(stdout, "USB_STATUS = 0x%08X\n", *lan78xx_reg++);
19 fprintf(stdout, "VLAN_TYPE = 0x%08X\n", *lan78xx_reg++);
20 fprintf(stdout, "\n");
21
22 fprintf(stdout, "MAC Registers:\n");
23 fprintf(stdout, "--------------\n");
24 fprintf(stdout, "MAC_CR = 0x%08X\n", *lan78xx_reg++);
25 fprintf(stdout, "MAC_RX = 0x%08X\n", *lan78xx_reg++);
26 fprintf(stdout, "MAC_TX = 0x%08X\n", *lan78xx_reg++);
27 fprintf(stdout, "FLOW = 0x%08X\n", *lan78xx_reg++);
28 fprintf(stdout, "ERR_STS = 0x%08X\n", *lan78xx_reg++);
29 fprintf(stdout, "MII_ACC = 0x%08X\n", *lan78xx_reg++);
30 fprintf(stdout, "MII_DATA = 0x%08X\n", *lan78xx_reg++);
31 fprintf(stdout, "EEE_TX_LPI_REQ_DLY = 0x%08X\n", *lan78xx_reg++);
32 fprintf(stdout, "EEE_TW_TX_SYS = 0x%08X\n", *lan78xx_reg++);
33 fprintf(stdout, "EEE_TX_LPI_REM_DLY = 0x%08X\n", *lan78xx_reg++);
34 fprintf(stdout, "WUCSR = 0x%08X\n", *lan78xx_reg++);
35 fprintf(stdout, "\n");
36
37 fprintf(stdout, "PHY Registers:\n");
38 fprintf(stdout, "--------------\n");
39 fprintf(stdout, "Mode Control = 0x%04X\n", *lan78xx_reg++);
40 fprintf(stdout, "Mode Status = 0x%04X\n", *lan78xx_reg++);
41 fprintf(stdout, "Device identifier1 = 0x%04X\n", *lan78xx_reg++);
42 fprintf(stdout, "Device identifier2 = 0x%04X\n", *lan78xx_reg++);
43 fprintf(stdout, "Auto-Neg Advertisement = 0x%04X\n",
44 *lan78xx_reg++);
45 fprintf(stdout, "Auto-Neg Link Partner Ability = 0x%04X\n",
46 *lan78xx_reg++);
47 fprintf(stdout, "Auto-Neg Expansion = 0x%04X\n", *lan78xx_reg++);
48 fprintf(stdout, "Auto-Neg Next Page TX = 0x%04X\n", *lan78xx_reg++);
49 fprintf(stdout, "Auto-Neg Link Partner Next Page RX = 0x%04X\n",
50 *lan78xx_reg++);
51 fprintf(stdout, "1000BASE-T Control = 0x%04X\n", *lan78xx_reg++);
52 fprintf(stdout, "1000BASE-T Status = 0x%04X\n", *lan78xx_reg++);
53 fprintf(stdout, "Reserved = 0x%04X\n", *lan78xx_reg++);
54 fprintf(stdout, "Reserved = 0x%04X\n", *lan78xx_reg++);
55 fprintf(stdout, "MMD Access Control = 0x%04X\n", *lan78xx_reg++);
56 fprintf(stdout, "MMD Access Address/Data = 0x%04X\n", *lan78xx_reg++);
57 fprintf(stdout, "1000BASE-T Status Extension1 = 0x%04X\n",
58 *lan78xx_reg++);
59 fprintf(stdout, "1000BASE-TX Status Extension = 0x%04X\n",
60 *lan78xx_reg++);
61 fprintf(stdout, "1000BASE-T Status Extension2 = 0x%04X\n",
62 *lan78xx_reg++);
63 fprintf(stdout, "Bypass Control = 0x%04X\n", *lan78xx_reg++);
64 fprintf(stdout,
65 "100BASE-TX/1000BASE-T Rx Error Counter = 0x%04X\n",
66 *lan78xx_reg++);
67 fprintf(stdout,
68 "100BASE-TX/1000BASE-T FC Err Counter = 0x%04X\n",
69 *lan78xx_reg++);
70 fprintf(stdout,
71 "10BASE-T/100BASE-TX/1000BASE-T LD Counter = 0x%04X\n",
72 *lan78xx_reg++);
73 fprintf(stdout, "Extended 10BASE-T Control and Status = 0x%04X\n",
74 *lan78xx_reg++);
75 fprintf(stdout, "Extended PHY Control1 = 0x%04X\n", *lan78xx_reg++);
76 fprintf(stdout, "Extended PHY Control2 = 0x%04X\n", *lan78xx_reg++);
77 fprintf(stdout, "Interrupt Mask = 0x%04X\n", *lan78xx_reg++);
78 fprintf(stdout, "Interrupt Status = 0x%04X\n", *lan78xx_reg++);
79 fprintf(stdout, "Reserved = 0x%04X\n", *lan78xx_reg++);
80 fprintf(stdout, "Auxiliary Control and Status = 0x%04X\n",
81 *lan78xx_reg++);
82 fprintf(stdout, "LED Mode Select = 0x%04X\n", *lan78xx_reg++);
83 fprintf(stdout, "LED Behavior = 0x%04X\n", *lan78xx_reg++);
84 fprintf(stdout, "Extended Page Access = 0x%04X\n", *lan78xx_reg++);
85 fprintf(stdout, "\n");
86
87 return 0;
88 }
89