This source file includes following definitions.
- mdio_phy_id_c45
1
2
3
4
5
6
7
8
9
10
11 #ifndef _UAPI__LINUX_MDIO_H__
12 #define _UAPI__LINUX_MDIO_H__
13
14 #include <linux/types.h>
15 #include <linux/mii.h>
16
17
18 #define MDIO_MMD_PMAPMD 1
19
20 #define MDIO_MMD_WIS 2
21 #define MDIO_MMD_PCS 3
22 #define MDIO_MMD_PHYXS 4
23 #define MDIO_MMD_DTEXS 5
24 #define MDIO_MMD_TC 6
25 #define MDIO_MMD_AN 7
26 #define MDIO_MMD_C22EXT 29
27 #define MDIO_MMD_VEND1 30
28 #define MDIO_MMD_VEND2 31
29
30
31 #define MDIO_CTRL1 MII_BMCR
32 #define MDIO_STAT1 MII_BMSR
33 #define MDIO_DEVID1 MII_PHYSID1
34 #define MDIO_DEVID2 MII_PHYSID2
35 #define MDIO_SPEED 4
36 #define MDIO_DEVS1 5
37 #define MDIO_DEVS2 6
38 #define MDIO_CTRL2 7
39 #define MDIO_STAT2 8
40 #define MDIO_PMA_TXDIS 9
41 #define MDIO_PMA_RXDET 10
42 #define MDIO_PMA_EXTABLE 11
43 #define MDIO_PKGID1 14
44 #define MDIO_PKGID2 15
45 #define MDIO_AN_ADVERTISE 16
46 #define MDIO_AN_LPA 19
47 #define MDIO_PCS_EEE_ABLE 20
48 #define MDIO_PCS_EEE_ABLE2 21
49 #define MDIO_PMA_NG_EXTABLE 21
50 #define MDIO_PCS_EEE_WK_ERR 22
51 #define MDIO_PHYXS_LNSTAT 24
52 #define MDIO_AN_EEE_ADV 60
53 #define MDIO_AN_EEE_LPABLE 61
54 #define MDIO_AN_EEE_ADV2 62
55 #define MDIO_AN_EEE_LPABLE2 63
56
57
58 #define MDIO_PMA_10GBT_SWAPPOL 130
59 #define MDIO_PMA_10GBT_TXPWR 131
60 #define MDIO_PMA_10GBT_SNR 133
61
62 #define MDIO_PMA_10GBR_FECABLE 170
63 #define MDIO_PCS_10GBX_STAT1 24
64 #define MDIO_PCS_10GBRT_STAT1 32
65 #define MDIO_PCS_10GBRT_STAT2 33
66 #define MDIO_AN_10GBT_CTRL 32
67 #define MDIO_AN_10GBT_STAT 33
68
69
70 #define MDIO_PMA_LASI_RXCTRL 0x9000
71 #define MDIO_PMA_LASI_TXCTRL 0x9001
72 #define MDIO_PMA_LASI_CTRL 0x9002
73 #define MDIO_PMA_LASI_RXSTAT 0x9003
74 #define MDIO_PMA_LASI_TXSTAT 0x9004
75 #define MDIO_PMA_LASI_STAT 0x9005
76
77
78
79 #define MDIO_CTRL1_SPEEDSELEXT (BMCR_SPEED1000 | BMCR_SPEED100)
80
81 #define MDIO_CTRL1_SPEEDSEL (MDIO_CTRL1_SPEEDSELEXT | 0x003c)
82 #define MDIO_CTRL1_FULLDPLX BMCR_FULLDPLX
83 #define MDIO_CTRL1_LPOWER BMCR_PDOWN
84 #define MDIO_CTRL1_RESET BMCR_RESET
85 #define MDIO_PMA_CTRL1_LOOPBACK 0x0001
86 #define MDIO_PMA_CTRL1_SPEED1000 BMCR_SPEED1000
87 #define MDIO_PMA_CTRL1_SPEED100 BMCR_SPEED100
88 #define MDIO_PCS_CTRL1_LOOPBACK BMCR_LOOPBACK
89 #define MDIO_PHYXS_CTRL1_LOOPBACK BMCR_LOOPBACK
90 #define MDIO_AN_CTRL1_RESTART BMCR_ANRESTART
91 #define MDIO_AN_CTRL1_ENABLE BMCR_ANENABLE
92 #define MDIO_AN_CTRL1_XNP 0x2000
93 #define MDIO_PCS_CTRL1_CLKSTOP_EN 0x400
94
95
96 #define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00)
97
98 #define MDIO_CTRL1_SPEED10P2B (MDIO_CTRL1_SPEEDSELEXT | 0x04)
99
100 #define MDIO_CTRL1_SPEED2_5G (MDIO_CTRL1_SPEEDSELEXT | 0x18)
101
102 #define MDIO_CTRL1_SPEED5G (MDIO_CTRL1_SPEEDSELEXT | 0x1c)
103
104
105 #define MDIO_STAT1_LPOWERABLE 0x0002
106 #define MDIO_STAT1_LSTATUS BMSR_LSTATUS
107 #define MDIO_STAT1_FAULT 0x0080
108 #define MDIO_AN_STAT1_LPABLE 0x0001
109 #define MDIO_AN_STAT1_ABLE BMSR_ANEGCAPABLE
110 #define MDIO_AN_STAT1_RFAULT BMSR_RFAULT
111 #define MDIO_AN_STAT1_COMPLETE BMSR_ANEGCOMPLETE
112 #define MDIO_AN_STAT1_PAGE 0x0040
113 #define MDIO_AN_STAT1_XNP 0x0080
114
115
116 #define MDIO_SPEED_10G 0x0001
117 #define MDIO_PMA_SPEED_2B 0x0002
118 #define MDIO_PMA_SPEED_10P 0x0004
119 #define MDIO_PMA_SPEED_1000 0x0010
120 #define MDIO_PMA_SPEED_100 0x0020
121 #define MDIO_PMA_SPEED_10 0x0040
122 #define MDIO_PCS_SPEED_10P2B 0x0002
123
124
125 #define MDIO_DEVS_PRESENT(devad) (1 << (devad))
126 #define MDIO_DEVS_C22PRESENT MDIO_DEVS_PRESENT(0)
127 #define MDIO_DEVS_PMAPMD MDIO_DEVS_PRESENT(MDIO_MMD_PMAPMD)
128 #define MDIO_DEVS_WIS MDIO_DEVS_PRESENT(MDIO_MMD_WIS)
129 #define MDIO_DEVS_PCS MDIO_DEVS_PRESENT(MDIO_MMD_PCS)
130 #define MDIO_DEVS_PHYXS MDIO_DEVS_PRESENT(MDIO_MMD_PHYXS)
131 #define MDIO_DEVS_DTEXS MDIO_DEVS_PRESENT(MDIO_MMD_DTEXS)
132 #define MDIO_DEVS_TC MDIO_DEVS_PRESENT(MDIO_MMD_TC)
133 #define MDIO_DEVS_AN MDIO_DEVS_PRESENT(MDIO_MMD_AN)
134 #define MDIO_DEVS_C22EXT MDIO_DEVS_PRESENT(MDIO_MMD_C22EXT)
135 #define MDIO_DEVS_VEND1 MDIO_DEVS_PRESENT(MDIO_MMD_VEND1)
136 #define MDIO_DEVS_VEND2 MDIO_DEVS_PRESENT(MDIO_MMD_VEND2)
137
138
139 #define MDIO_PMA_CTRL2_TYPE 0x000f
140 #define MDIO_PMA_CTRL2_10GBCX4 0x0000
141 #define MDIO_PMA_CTRL2_10GBEW 0x0001
142 #define MDIO_PMA_CTRL2_10GBLW 0x0002
143 #define MDIO_PMA_CTRL2_10GBSW 0x0003
144 #define MDIO_PMA_CTRL2_10GBLX4 0x0004
145 #define MDIO_PMA_CTRL2_10GBER 0x0005
146 #define MDIO_PMA_CTRL2_10GBLR 0x0006
147 #define MDIO_PMA_CTRL2_10GBSR 0x0007
148 #define MDIO_PMA_CTRL2_10GBLRM 0x0008
149 #define MDIO_PMA_CTRL2_10GBT 0x0009
150 #define MDIO_PMA_CTRL2_10GBKX4 0x000a
151 #define MDIO_PMA_CTRL2_10GBKR 0x000b
152 #define MDIO_PMA_CTRL2_1000BT 0x000c
153 #define MDIO_PMA_CTRL2_1000BKX 0x000d
154 #define MDIO_PMA_CTRL2_100BTX 0x000e
155 #define MDIO_PMA_CTRL2_10BT 0x000f
156 #define MDIO_PMA_CTRL2_2_5GBT 0x0030
157 #define MDIO_PMA_CTRL2_5GBT 0x0031
158 #define MDIO_PCS_CTRL2_TYPE 0x0003
159 #define MDIO_PCS_CTRL2_10GBR 0x0000
160 #define MDIO_PCS_CTRL2_10GBX 0x0001
161 #define MDIO_PCS_CTRL2_10GBW 0x0002
162 #define MDIO_PCS_CTRL2_10GBT 0x0003
163
164
165 #define MDIO_STAT2_RXFAULT 0x0400
166 #define MDIO_STAT2_TXFAULT 0x0800
167 #define MDIO_STAT2_DEVPRST 0xc000
168 #define MDIO_STAT2_DEVPRST_VAL 0x8000
169 #define MDIO_PMA_STAT2_LBABLE 0x0001
170 #define MDIO_PMA_STAT2_10GBEW 0x0002
171 #define MDIO_PMA_STAT2_10GBLW 0x0004
172 #define MDIO_PMA_STAT2_10GBSW 0x0008
173 #define MDIO_PMA_STAT2_10GBLX4 0x0010
174 #define MDIO_PMA_STAT2_10GBER 0x0020
175 #define MDIO_PMA_STAT2_10GBLR 0x0040
176 #define MDIO_PMA_STAT2_10GBSR 0x0080
177 #define MDIO_PMD_STAT2_TXDISAB 0x0100
178 #define MDIO_PMA_STAT2_EXTABLE 0x0200
179 #define MDIO_PMA_STAT2_RXFLTABLE 0x1000
180 #define MDIO_PMA_STAT2_TXFLTABLE 0x2000
181 #define MDIO_PCS_STAT2_10GBR 0x0001
182 #define MDIO_PCS_STAT2_10GBX 0x0002
183 #define MDIO_PCS_STAT2_10GBW 0x0004
184 #define MDIO_PCS_STAT2_RXFLTABLE 0x1000
185 #define MDIO_PCS_STAT2_TXFLTABLE 0x2000
186
187
188 #define MDIO_PMD_TXDIS_GLOBAL 0x0001
189 #define MDIO_PMD_TXDIS_0 0x0002
190 #define MDIO_PMD_TXDIS_1 0x0004
191 #define MDIO_PMD_TXDIS_2 0x0008
192 #define MDIO_PMD_TXDIS_3 0x0010
193
194
195 #define MDIO_PMD_RXDET_GLOBAL 0x0001
196 #define MDIO_PMD_RXDET_0 0x0002
197 #define MDIO_PMD_RXDET_1 0x0004
198 #define MDIO_PMD_RXDET_2 0x0008
199 #define MDIO_PMD_RXDET_3 0x0010
200
201
202 #define MDIO_PMA_EXTABLE_10GCX4 0x0001
203 #define MDIO_PMA_EXTABLE_10GBLRM 0x0002
204 #define MDIO_PMA_EXTABLE_10GBT 0x0004
205 #define MDIO_PMA_EXTABLE_10GBKX4 0x0008
206 #define MDIO_PMA_EXTABLE_10GBKR 0x0010
207 #define MDIO_PMA_EXTABLE_1000BT 0x0020
208 #define MDIO_PMA_EXTABLE_1000BKX 0x0040
209 #define MDIO_PMA_EXTABLE_100BTX 0x0080
210 #define MDIO_PMA_EXTABLE_10BT 0x0100
211 #define MDIO_PMA_EXTABLE_NBT 0x4000
212
213
214 #define MDIO_PHYXS_LNSTAT_SYNC0 0x0001
215 #define MDIO_PHYXS_LNSTAT_SYNC1 0x0002
216 #define MDIO_PHYXS_LNSTAT_SYNC2 0x0004
217 #define MDIO_PHYXS_LNSTAT_SYNC3 0x0008
218 #define MDIO_PHYXS_LNSTAT_ALIGN 0x1000
219
220
221 #define MDIO_PMA_10GBT_SWAPPOL_ABNX 0x0001
222 #define MDIO_PMA_10GBT_SWAPPOL_CDNX 0x0002
223 #define MDIO_PMA_10GBT_SWAPPOL_AREV 0x0100
224 #define MDIO_PMA_10GBT_SWAPPOL_BREV 0x0200
225 #define MDIO_PMA_10GBT_SWAPPOL_CREV 0x0400
226 #define MDIO_PMA_10GBT_SWAPPOL_DREV 0x0800
227
228
229 #define MDIO_PMA_10GBT_TXPWR_SHORT 0x0001
230
231
232
233 #define MDIO_PMA_10GBT_SNR_BIAS 0x8000
234 #define MDIO_PMA_10GBT_SNR_MAX 127
235
236
237 #define MDIO_PMA_10GBR_FECABLE_ABLE 0x0001
238 #define MDIO_PMA_10GBR_FECABLE_ERRABLE 0x0002
239
240
241 #define MDIO_PCS_10GBRT_STAT1_BLKLK 0x0001
242
243
244 #define MDIO_PCS_10GBRT_STAT2_ERR 0x00ff
245 #define MDIO_PCS_10GBRT_STAT2_BER 0x3f00
246
247
248 #define MDIO_AN_10GBT_CTRL_ADV2_5G 0x0080
249 #define MDIO_AN_10GBT_CTRL_ADV5G 0x0100
250 #define MDIO_AN_10GBT_CTRL_ADV10G 0x1000
251
252
253 #define MDIO_AN_10GBT_STAT_LP2_5G 0x0020
254 #define MDIO_AN_10GBT_STAT_LP5G 0x0040
255 #define MDIO_AN_10GBT_STAT_LPTRR 0x0200
256 #define MDIO_AN_10GBT_STAT_LPLTABLE 0x0400
257 #define MDIO_AN_10GBT_STAT_LP10G 0x0800
258 #define MDIO_AN_10GBT_STAT_REMOK 0x1000
259 #define MDIO_AN_10GBT_STAT_LOCOK 0x2000
260 #define MDIO_AN_10GBT_STAT_MS 0x4000
261 #define MDIO_AN_10GBT_STAT_MSFLT 0x8000
262
263
264
265
266
267
268
269 #define MDIO_AN_EEE_ADV_100TX 0x0002
270 #define MDIO_AN_EEE_ADV_1000T 0x0004
271
272
273
274
275
276 #define MDIO_EEE_100TX MDIO_AN_EEE_ADV_100TX
277 #define MDIO_EEE_1000T MDIO_AN_EEE_ADV_1000T
278 #define MDIO_EEE_10GT 0x0008
279 #define MDIO_EEE_1000KX 0x0010
280 #define MDIO_EEE_10GKX4 0x0020
281 #define MDIO_EEE_10GKR 0x0040
282 #define MDIO_EEE_40GR_FW 0x0100
283 #define MDIO_EEE_40GR_DS 0x0200
284 #define MDIO_EEE_100GR_FW 0x1000
285 #define MDIO_EEE_100GR_DS 0x2000
286
287 #define MDIO_EEE_2_5GT 0x0001
288 #define MDIO_EEE_5GT 0x0002
289
290
291 #define MDIO_PMA_NG_EXTABLE_2_5GBT 0x0001
292 #define MDIO_PMA_NG_EXTABLE_5GBT 0x0002
293
294
295 #define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001
296 #define MDIO_PMA_LASI_RX_PCSLFLT 0x0008
297 #define MDIO_PMA_LASI_RX_PMALFLT 0x0010
298 #define MDIO_PMA_LASI_RX_OPTICPOWERFLT 0x0020
299 #define MDIO_PMA_LASI_RX_WISLFLT 0x0200
300
301
302 #define MDIO_PMA_LASI_TX_PHYXSLFLT 0x0001
303 #define MDIO_PMA_LASI_TX_PCSLFLT 0x0008
304 #define MDIO_PMA_LASI_TX_PMALFLT 0x0010
305 #define MDIO_PMA_LASI_TX_LASERPOWERFLT 0x0080
306 #define MDIO_PMA_LASI_TX_LASERTEMPFLT 0x0100
307 #define MDIO_PMA_LASI_TX_LASERBICURRFLT 0x0200
308
309
310 #define MDIO_PMA_LASI_LSALARM 0x0001
311 #define MDIO_PMA_LASI_TXALARM 0x0002
312 #define MDIO_PMA_LASI_RXALARM 0x0004
313
314
315
316 #define MDIO_PHY_ID_C45 0x8000
317 #define MDIO_PHY_ID_PRTAD 0x03e0
318 #define MDIO_PHY_ID_DEVAD 0x001f
319 #define MDIO_PHY_ID_C45_MASK \
320 (MDIO_PHY_ID_C45 | MDIO_PHY_ID_PRTAD | MDIO_PHY_ID_DEVAD)
321
322 static inline __u16 mdio_phy_id_c45(int prtad, int devad)
323 {
324 return MDIO_PHY_ID_C45 | (prtad << 5) | devad;
325 }
326
327 #endif