• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2013 Intel Corporation */
2 #include <stdio.h>
3 #include "internal.h"
4 
5 int
ixgbevf_dump_regs(struct ethtool_drvinfo * info maybe_unused,struct ethtool_regs * regs)6 ixgbevf_dump_regs(struct ethtool_drvinfo *info maybe_unused,
7 		  struct ethtool_regs *regs)
8 {
9 	u32 *regs_buff = (u32 *)regs->data;
10 	u8 version = (u8)(regs->version >> 24);
11 	u8 i;
12 
13 	if (version == 0)
14 		return -1;
15 
16 	fprintf(stdout,
17 		"0x00000: VFCTRL      (VF Control Register) (Write Only) N/A\n");
18 
19 	fprintf(stdout,
20 		"0x00008: VFSTATUS    (VF Status Register)               0x%08X\n",
21 		regs_buff[1]);
22 
23 	fprintf(stdout,
24 		"0x00010: VFLINKS     (VF Link Status Register)          0x%08X\n",
25 		regs_buff[2]);
26 
27 	fprintf(stdout,
28 		"0x03190: VFRXMEMWRAP (Rx Packet Buffer Flush Detect)    0x%08X\n",
29 		regs_buff[3]);
30 
31 	fprintf(stdout,
32 		"0x00048: VFFRTIMER   (VF Free Running Timer)            0x%08X\n",
33 		regs_buff[4]);
34 
35 	fprintf(stdout,
36 		"0x00100: VFEICR      (VF Extended Interrupt Cause)      0x%08X\n",
37 		regs_buff[5]);
38 
39 	fprintf(stdout,
40 		"0x00104: VFEICS      (VF Extended Interrupt Cause Set)  0x%08X\n",
41 		regs_buff[6]);
42 
43 	fprintf(stdout,
44 		"0x00108: VFEIMS      (VF Extended Interrupt Mask Set)   0x%08X\n",
45 		regs_buff[7]);
46 
47 	fprintf(stdout,
48 		"0x0010C: VFEIMC      (VF Extended Interrupt Mask Clear) 0x%08X\n",
49 		regs_buff[8]);
50 
51 	fprintf(stdout,
52 		"0x00110: VFEIAC      (VF Extended Interrupt Auto Clear) 0x%08X\n",
53 		regs_buff[9]);
54 
55 	fprintf(stdout,
56 		"0x00114: VFEIAM      (VF Extended Interrupt Auto Mask)  0x%08X\n",
57 		regs_buff[10]);
58 
59 	fprintf(stdout,
60 		"0x00820: VFEITR(0)   (VF Extended Interrupt Throttle)   0x%08X\n",
61 		regs_buff[11]);
62 
63 	fprintf(stdout,
64 		"0x00120: VFIVAR(0)   (VF Interrupt Vector Allocation)   0x%08X\n",
65 		regs_buff[12]);
66 
67 	fprintf(stdout,
68 		"0x00140: VFIVAR_MISC (VF Interrupt Vector Misc)         0x%08X\n",
69 		regs_buff[13]);
70 
71 	fprintf(stdout,
72 		"0x00104: VFPSRTYPE   (VF Replication Packet Split Type) 0x%08X\n",
73 		regs_buff[28]);
74 
75 	for (i = 0; i < 2; i++)
76 		fprintf(stdout,
77 			"0x%05x: VFRDBAL(%d)  (VF Rx Desc. Base Addr Low %d)      0x%08X\n",
78 			0x1000 + 0x40*i,
79 			i, i,
80 			regs_buff[14+i]);
81 
82 	for (i = 0; i < 2; i++)
83 		fprintf(stdout,
84 			"0x%05x: VFRDBAH(%d)  (VF Rx Desc. Base Addr High %d)     0x%08X\n",
85 			0x1004 + 0x40*i,
86 			i, i,
87 			regs_buff[16+i]);
88 
89 	for (i = 0; i < 2; i++)
90 		fprintf(stdout,
91 			"0x%05x: VFRDLEN(%d)  (VF Rx Desc. Length %d)             0x%08X\n",
92 			0x1008 + 0x40*i,
93 			i, i,
94 			regs_buff[18+i]);
95 
96 	for (i = 0; i < 2; i++)
97 		fprintf(stdout,
98 			"0x%05x: VFRDH(%d)    (VF Rx Desc. Head %d)               0x%08X\n",
99 			0x1010 + 0x40*i,
100 			i, i,
101 			regs_buff[20+i]);
102 
103 	for (i = 0; i < 2; i++)
104 		fprintf(stdout,
105 			"0x%05x: VFRDT(%d)    (VF Rx Desc. Tail %d)               0x%08X\n",
106 			0x1018 + 0x40*i,
107 			i, i,
108 			regs_buff[22+i]);
109 
110 	for (i = 0; i < 2; i++)
111 		fprintf(stdout,
112 			"0x%05x: VFRDT(%d)    (VF Rx Desc. Control %d),           0x%08X\n",
113 			0x1028 + 0x40*i,
114 			i, i,
115 			regs_buff[24+i]);
116 
117 	for (i = 0; i < 2; i++)
118 		fprintf(stdout,
119 			"0x%05x: VFSRRCTL(%d) (VF Split Rx Control %d)            0x%08X\n",
120 			0x1014 + 0x40*i,
121 			i, i,
122 			regs_buff[26+i]);
123 
124 	for (i = 0; i < 2; i++)
125 		fprintf(stdout,
126 			"0x%05x: VFTDBAL(%d)  (VF Tx Desc. Base Addr Low %d)      0x%08X\n",
127 			0x2000 + 0x40*i,
128 			i, i,
129 			regs_buff[29+i]);
130 
131 	for (i = 0; i < 2; i++)
132 		fprintf(stdout,
133 			"0x%05x: VFTDBAH(%d)  (VF Tx Desc. Base Addr High %d)     0x%08X\n",
134 			0x2004 + 0x40*i,
135 			i, i,
136 			regs_buff[31+i]);
137 
138 	for (i = 0; i < 2; i++)
139 		fprintf(stdout,
140 			"0x%05x: VFTDLEN(%d)  (VF Tx Desc. Length %d)             0x%08X\n",
141 			0x2008 + 0x40*i,
142 			i, i,
143 			regs_buff[33+i]);
144 
145 	for (i = 0; i < 2; i++)
146 		fprintf(stdout,
147 			"0x%05x: VFTDH(%d)    (VF Tx Desc. Head %d)               0x%08X\n",
148 			0x2010 + 0x40*i,
149 			i, i,
150 			regs_buff[35+i]);
151 
152 	for (i = 0; i < 2; i++)
153 		fprintf(stdout,
154 			"0x%05x: VFTDT(%d)    (VF Tx Desc. Tail %d)               0x%08X\n",
155 			0x2018 + 0x40*i,
156 			i, i,
157 			regs_buff[37+i]);
158 
159 	for (i = 0; i < 2; i++)
160 		fprintf(stdout,
161 			"0x%05x: VFTDT(%d)    (VF Tx Desc. Control %d)            0x%08X\n",
162 			0x2028 + 0x40*i,
163 			i, i,
164 			regs_buff[39+i]);
165 
166 	for (i = 0; i < 2; i++)
167 		fprintf(stdout,
168 			"0x%05x: VFTDWBAL(%d) (VF Tx Desc. Write Back Addr Lo %d) 0x%08X\n",
169 			0x2038 + 0x40*i,
170 			i, i,
171 			regs_buff[41+i]);
172 
173 	for (i = 0; i < 2; i++)
174 		fprintf(stdout,
175 			"0x%05x: VFTDWBAH(%d) (VF Tx Desc. Write Back Addr Hi %d) 0x%08X\n",
176 			0x203C + 0x40*i,
177 			i, i,
178 			regs_buff[43+i]);
179 
180 	return 0;
181 }
182