Go to the documentation of this file.
31 #ifndef _LAN8651_DRIVER_H
32 #define _LAN8651_DRIVER_H
38 #ifndef LAN8651_PLCA_SUPPORT
39 #define LAN8651_PLCA_SUPPORT ENABLED
40 #elif (LAN8651_PLCA_SUPPORT != ENABLED && LAN8651_PLCA_SUPPORT != DISABLED)
41 #error LAN8651_PLCA_SUPPORT parameter is not valid
45 #ifndef LAN8651_NODE_COUNT
46 #define LAN8651_NODE_COUNT 8
47 #elif (LAN8651_NODE_COUNT < 0 || LAN8651_NODE_COUNT > 255)
48 #error LAN8651_NODE_COUNT parameter is not valid
52 #ifndef LAN8651_LOCAL_ID
53 #define LAN8651_LOCAL_ID 1
54 #elif (LAN8651_LOCAL_ID < 0 || LAN8651_LOCAL_ID > 255)
55 #error LAN8651_LOCAL_ID parameter is not valid
59 #ifndef LAN8651_ETH_RX_BUFFER_SIZE
60 #define LAN8651_ETH_RX_BUFFER_SIZE 1536
61 #elif (LAN8651_ETH_RX_BUFFER_SIZE != 1536)
62 #error LAN8651_ETH_RX_BUFFER_SIZE parameter is not valid
66 #define LAN8651_CHUNK_PAYLOAD_SIZE 64
69 #define LAN8651_TX_HEADER_DNC 0x80000000
70 #define LAN8651_TX_HEADER_SEQ 0x40000000
71 #define LAN8651_TX_HEADER_NORX 0x20000000
72 #define LAN8651_TX_HEADER_VS 0x00C00000
73 #define LAN8651_TX_HEADER_DV 0x00200000
74 #define LAN8651_TX_HEADER_SV 0x00100000
75 #define LAN8651_TX_HEADER_SWO 0x000F0000
76 #define LAN8651_TX_HEADER_EV 0x00004000
77 #define LAN8651_TX_HEADER_EBO 0x00003F00
78 #define LAN8651_TX_HEADER_TSC 0x000000C0
79 #define LAN8651_TX_HEADER_P 0x00000001
82 #define LAN8651_RX_FOOTER_EXST 0x80000000
83 #define LAN8651_RX_FOOTER_HDRB 0x40000000
84 #define LAN8651_RX_FOOTER_SYNC 0x20000000
85 #define LAN8651_RX_FOOTER_RCA 0x1F000000
86 #define LAN8651_RX_FOOTER_VS 0x00C00000
87 #define LAN8651_RX_FOOTER_DV 0x00200000
88 #define LAN8651_RX_FOOTER_SV 0x00100000
89 #define LAN8651_RX_FOOTER_SWO 0x000F0000
90 #define LAN8651_RX_FOOTER_FD 0x00008000
91 #define LAN8651_RX_FOOTER_EV 0x00004000
92 #define LAN8651_RX_FOOTER_EBO 0x00003F00
93 #define LAN8651_RX_FOOTER_RTSA 0x00000080
94 #define LAN8651_RX_FOOTER_RTSP 0x00000040
95 #define LAN8651_RX_FOOTER_TXC 0x0000003E
96 #define LAN8651_RX_FOOTER_P 0x00000001
99 #define LAN8651_CTRL_HEADER_DNC 0x80000000
100 #define LAN8651_CTRL_HEADER_HDRB 0x40000000
101 #define LAN8651_CTRL_HEADER_WNR 0x20000000
102 #define LAN8651_CTRL_HEADER_AID 0x10000000
103 #define LAN8651_CTRL_HEADER_MMS 0x0F000000
104 #define LAN8651_CTRL_HEADER_ADDR 0x00FFFF00
105 #define LAN8651_CTRL_HEADER_LEN 0x000000FE
106 #define LAN8651_CTRL_HEADER_P 0x00000001
109 #define LAN8651_MMS_STD 0x00
110 #define LAN8651_MMS_MAC 0x01
111 #define LAN8651_MMS_PHY_PCS 0x02
112 #define LAN8651_MMS_PHY_PMA_PMD 0x03
113 #define LAN8651_MMS_PHY_VS 0x04
114 #define LAN8651_MMS_PHY_MISC 0x0A
117 #define LAN8651_OA_ID 0x00, 0x0000
118 #define LAN8651_OA_PHYID 0x00, 0x0001
119 #define LAN8651_OA_STDCAP 0x00, 0x0002
120 #define LAN8651_OA_RESET 0x00, 0x0003
121 #define LAN8651_OA_CONFIG0 0x00, 0x0004
122 #define LAN8651_OA_STATUS0 0x00, 0x0008
123 #define LAN8651_OA_STATUS1 0x00, 0x0009
124 #define LAN8651_OA_BUFSTS 0x00, 0x000B
125 #define LAN8651_OA_IMASK0 0x00, 0x000C
126 #define LAN8651_OA_MASK1 0x00, 0x000D
127 #define LAN8651_TTSCAH 0x00, 0x0010
128 #define LAN8651_TTSCAL 0x00, 0x0011
129 #define LAN8651_TTSCBH 0x00, 0x0012
130 #define LAN8651_TTSCBL 0x00, 0x0013
131 #define LAN8651_TTSCCH 0x00, 0x0014
132 #define LAN8651_TTSCCL 0x00, 0x0015
133 #define LAN8651_BASIC_CONTROL 0x00, 0xFF00
134 #define LAN8651_BASIC_STATUS 0x00, 0xFF01
135 #define LAN8651_PHY_ID1 0x00, 0xFF02
136 #define LAN8651_PHY_ID2 0x00, 0xFF03
137 #define LAN8651_MMDCTRL 0x00, 0xFF0D
138 #define LAN8651_MMDAD 0x00, 0xFF0E
141 #define LAN8651_MAC_NCR 0x01, 0x0000
142 #define LAN8651_MAC_NCFGR 0x01, 0x0001
143 #define LAN8651_MAC_HRB 0x01, 0x0020
144 #define LAN8651_MAC_HRT 0x01, 0x0021
145 #define LAN8651_MAC_SAB1 0x01, 0x0022
146 #define LAN8651_MAC_SAT1 0x01, 0x0023
147 #define LAN8651_MAC_SAB2 0x01, 0x0024
148 #define LAN8651_MAC_SAT2 0x01, 0x0025
149 #define LAN8651_MAC_SAB3 0x01, 0x0026
150 #define LAN8651_MAC_SAT3 0x01, 0x0027
151 #define LAN8651_MAC_SAB4 0x01, 0x0028
152 #define LAN8651_MAC_SAT4 0x01, 0x0029
153 #define LAN8651_MAC_TIDM1 0x01, 0x002A
154 #define LAN8651_MAC_TIDM2 0x01, 0x002B
155 #define LAN8651_MAC_TIDM3 0x01, 0x002C
156 #define LAN8651_MAC_TIDM4 0x01, 0x002D
157 #define LAN8651_MAC_SAMB1 0x01, 0x0032
158 #define LAN8651_MAC_SAMT1 0x01, 0x0033
159 #define LAN8651_MAC_TISUBN 0x01, 0x006F
160 #define LAN8651_MAC_TSH 0x01, 0x0070
161 #define LAN8651_MAC_TSL 0x01, 0x0074
162 #define LAN8651_MAC_TN 0x01, 0x0075
163 #define LAN8651_MAC_TA 0x01, 0x0076
164 #define LAN8651_MAC_TI 0x01, 0x0077
165 #define LAN8651_BMGR_CTL 0x01, 0x0280
166 #define LAN8651_STATS0 0x01, 0x0288
167 #define LAN8651_STATS1 0x01, 0x0289
168 #define LAN8651_STATS2 0x01, 0x028A
169 #define LAN8651_STATS3 0x01, 0x028B
170 #define LAN8651_STATS4 0x01, 0x028C
171 #define LAN8651_STATS5 0x01, 0x028D
172 #define LAN8651_STATS6 0x01, 0x028E
173 #define LAN8651_STATS7 0x01, 0x028F
174 #define LAN8651_STATS8 0x01, 0x0290
175 #define LAN8651_STATS9 0x01, 0x0291
176 #define LAN8651_STATS10 0x01, 0x0292
177 #define LAN8651_STATS11 0x01, 0x0293
178 #define LAN8651_STATS12 0x01, 0x0294
181 #define LAN8651_T1SPCSCTL 0x02, 0x08F3
182 #define LAN8651_T1SPCSSTS 0x02, 0x08F4
183 #define LAN8651_T1SPCSDIAG1 0x02, 0x08F5
184 #define LAN8651_T1SPCSDIAG2 0x02, 0x08F6
187 #define LAN8651_T1PMAPMDEXTA 0x03, 0x0012
188 #define LAN8651_T1PMAPMDCTL 0x03, 0x0834
189 #define LAN8651_T1SPMACTL 0x03, 0x08F9
190 #define LAN8651_T1SPMASTS 0x03, 0x08FA
191 #define LAN8651_T1STSTCTL 0x03, 0x08FB
194 #define LAN8651_CTRL1 0x04, 0x0010
195 #define LAN8651_STS1 0x04, 0x0018
196 #define LAN8651_STS2 0x04, 0x0019
197 #define LAN8651_STS3 0x04, 0x001A
198 #define LAN8651_IMSK1 0x04, 0x001C
199 #define LAN8651_IMSK2 0x04, 0x001D
200 #define LAN8651_CTRCTRL 0x04, 0x0020
201 #define LAN8651_TOCNTH 0x04, 0x0024
202 #define LAN8651_TOCNTL 0x04, 0x0025
203 #define LAN8651_BCNCNTH 0x04, 0x0026
204 #define LAN8651_BCNCNTL 0x04, 0x0027
205 #define LAN8651_PRTMGMT2 0x04, 0x003D
206 #define LAN8651_IWDTOH 0x04, 0x003E
207 #define LAN8651_IWDTOL 0x04, 0x003F
208 #define LAN8651_SLPCTL0 0x04, 0x0080
209 #define LAN8651_SLPCTL1 0x04, 0x0081
210 #define LAN8651_ANALOG5 0x04, 0x00D5
211 #define LAN8651_MIDVER 0x04, 0xCA00
212 #define LAN8651_PLCA_CTRL0 0x04, 0xCA01
213 #define LAN8651_PLCA_CTRL1 0x04, 0xCA02
214 #define LAN8651_PLCA_STS 0x04, 0xCA03
215 #define LAN8651_PLCA_TOTMR 0x04, 0xCA04
216 #define LAN8651_PLCA_BURST 0x04, 0xCA05
219 #define LAN8651_QTXCFG 0x0A, 0x81
220 #define LAN8651_QRXCFG 0x0A, 0x82
221 #define LAN8651_PADCTRL 0x0A, 0x88
222 #define LAN8651_MISC 0x0A, 0x8C
223 #define LAN8651_DEVID 0x0A, 0x94
226 #define LAN8651_OA_ID_MAJVER 0x000000F0
227 #define LAN8651_OA_ID_MAJVER_DEFAULT 0x00000010
228 #define LAN8651_OA_ID_MINVER 0x0000000F
229 #define LAN8651_OA_ID_MINVER_DEFAULT 0x00000001
232 #define LAN8651_OA_PHYID_OUI 0xFFFFFC00
233 #define LAN8651_OA_PHYID_OUI_DEFAULT 0x02003C00
234 #define LAN8651_OA_PHYID_MODEL 0x000003F0
235 #define LAN8651_OA_PHYID_MODEL_DEFAULT 0x000001B0
236 #define LAN8651_OA_PHYID_REV 0x0000000F
237 #define LAN8651_OA_PHYID_REV_DEFAULT 0x00000003
240 #define LAN8651_OA_STDCAP_TXFCSVC 0x00000400
241 #define LAN8651_OA_STDCAP_IPRAC 0x00000200
242 #define LAN8651_OA_STDCAP_DPRAC 0x00000100
243 #define LAN8651_OA_STDCAP_CTC 0x00000080
244 #define LAN8651_OA_STDCAP_FTSC 0x00000040
245 #define LAN8651_OA_STDCAP_AIDC 0x00000020
246 #define LAN8651_OA_STDCAP_SEQC 0x00000010
247 #define LAN8651_OA_STDCAP_MINCPS 0x00000007
250 #define LAN8651_OA_RESET_SWRESET 0x00000001
253 #define LAN8651_OA_CONFIG0_SYNC 0x00008000
254 #define LAN8651_OA_CONFIG0_TXFCSVE 0x00004000
255 #define LAN8651_OA_CONFIG0_RFA 0x00003000
256 #define LAN8651_OA_CONFIG0_RFA_DEFAULT 0x00000000
257 #define LAN8651_OA_CONFIG0_RFA_ZARFE 0x00001000
258 #define LAN8651_OA_CONFIG0_RFA_CSARFE 0x00002000
259 #define LAN8651_OA_CONFIG0_RFA_INVALID 0x00003000
260 #define LAN8651_OA_CONFIG0_TXCTHRESH 0x00000C00
261 #define LAN8651_OA_CONFIG0_TXCTHRESH_1_CREDIT 0x00000000
262 #define LAN8651_OA_CONFIG0_TXCTHRESH_4_CREDITS 0x00000400
263 #define LAN8651_OA_CONFIG0_TXCTHRESH_8_CREDITS 0x00000800
264 #define LAN8651_OA_CONFIG0_TXCTHRESH_16_CREDITS 0x00000C00
265 #define LAN8651_OA_CONFIG0_TXCTE 0x00000200
266 #define LAN8651_OA_CONFIG0_RXCTE 0x00000100
267 #define LAN8651_OA_CONFIG0_FTSE 0x00000080
268 #define LAN8651_OA_CONFIG0_FTSS 0x00000040
269 #define LAN8651_OA_CONFIG0_PROTE 0x00000020
270 #define LAN8651_OA_CONFIG0_SEQE 0x00000010
271 #define LAN8651_OA_CONFIG0_CPS 0x00000007
272 #define LAN8651_OA_CONFIG0_CPS_32_BYTES 0x00000005
273 #define LAN8651_OA_CONFIG0_CPS_64_BYTES 0x00000006
276 #define LAN8651_OA_STATUS0_CPDE 0x00001000
277 #define LAN8651_OA_STATUS0_TXFSE 0x00000800
278 #define LAN8651_OA_STATUS0_TTSCAC 0x00000400
279 #define LAN8651_OA_STATUS0_TTSCAB 0x00000200
280 #define LAN8651_OA_STATUS0_TTSCAA 0x00000100
281 #define LAN8651_OA_STATUS0_PHYINT 0x00000080
282 #define LAN8651_OA_STATUS0_RESETC 0x00000040
283 #define LAN8651_OA_STATUS0_HDRE 0x00000020
284 #define LAN8651_OA_STATUS0_LOFE 0x00000010
285 #define LAN8651_OA_STATUS0_RXBOE 0x00000008
286 #define LAN8651_OA_STATUS0_TXBUE 0x00000004
287 #define LAN8651_OA_STATUS0_TXBOE 0x00000002
288 #define LAN8651_OA_STATUS0_TXPE 0x00000001
291 #define LAN8651_OA_STATUS1_UV18 0x00080000
294 #define LAN8651_OA_BUFSTS_TXC 0x0000FF00
295 #define LAN8651_OA_BUFSTS_RCA 0x000000FF
298 #define LAN8651_OA_IMASK0_CPDEM 0x00001000
299 #define LAN8651_OA_IMASK0_TXFCSEM 0x00000800
300 #define LAN8651_OA_IMASK0_TTSCACM 0x00000400
301 #define LAN8651_OA_IMASK0_TTSCABM 0x00000200
302 #define LAN8651_OA_IMASK0_TTSCAAM 0x00000100
303 #define LAN8651_OA_IMASK0_PHYINTM 0x00000080
304 #define LAN8651_OA_IMASK0_RESETCM 0x00000040
305 #define LAN8651_OA_IMASK0_HDREM 0x00000020
306 #define LAN8651_OA_IMASK0_LOFEM 0x00000010
307 #define LAN8651_OA_IMASK0_RXBOEM 0x00000008
308 #define LAN8651_OA_IMASK0_TXBUEM 0x00000004
309 #define LAN8651_OA_IMASK0_TXBOEM 0x00000002
310 #define LAN8651_OA_IMASK0_TXPEM 0x00000001
313 #define LAN8651_OA_MASK1_UV18 0x00080000
316 #define LAN8651_TTSCAH_TIMESTAMPA_63_32 0xFFFFFFFF
319 #define LAN8651_TTSCAL_TIMESTAMPA_31_0 0xFFFFFFFF
322 #define LAN8651_TTSCBH_TIMESTAMPB_63_32 0xFFFFFFFF
325 #define LAN8651_TTSCBL_TIMESTAMPB_31_0 0xFFFFFFFF
328 #define LAN8651_TTSCCH_TIMESTAMPC_63_32 0xFFFFFFFF
331 #define LAN8651_TTSCCL_TIMESTAMPC_31_0 0xFFFFFFFF
334 #define LAN8651_BASIC_CONTROL_SW_RESET 0x8000
335 #define LAN8651_BASIC_CONTROL_LOOPBACK 0x4000
336 #define LAN8651_BASIC_CONTROL_SPD_SEL_LSB 0x2000
337 #define LAN8651_BASIC_CONTROL_AUTONEGEN 0x1000
338 #define LAN8651_BASIC_CONTROL_PD 0x0800
339 #define LAN8651_BASIC_CONTROL_REAUTONEG 0x0200
340 #define LAN8651_BASIC_CONTROL_DUPLEXMD 0x0100
341 #define LAN8651_BASIC_CONTROL_SPD_SEL_MSB 0x0040
344 #define LAN8651_BASIC_STATUS_100BT4A 0x8000
345 #define LAN8651_BASIC_STATUS_100BTXFDA 0x4000
346 #define LAN8651_BASIC_STATUS_100BTXHDA 0x2000
347 #define LAN8651_BASIC_STATUS_10BTFDA 0x1000
348 #define LAN8651_BASIC_STATUS_10BTHDA 0x0800
349 #define LAN8651_BASIC_STATUS_100BT2FDA 0x0400
350 #define LAN8651_BASIC_STATUS_100BT2HDA 0x0200
351 #define LAN8651_BASIC_STATUS_EXTSTS 0x0100
352 #define LAN8651_BASIC_STATUS_AUTONEGC 0x0020
353 #define LAN8651_BASIC_STATUS_RMTFLTD 0x0010
354 #define LAN8651_BASIC_STATUS_AUTONEGA 0x0008
355 #define LAN8651_BASIC_STATUS_LNKSTS 0x0004
356 #define LAN8651_BASIC_STATUS_JABDET 0x0002
357 #define LAN8651_BASIC_STATUS_EXTCAPA 0x0001
360 #define LAN8651_PHY_ID1_OUI_2_9 0x0000FF00
361 #define LAN8651_PHY_ID1_OUI_2_9_DEFAULT 0x00000000
362 #define LAN8651_PHY_ID1_OUI_10_17 0x000000FF
363 #define LAN8651_PHY_ID1_OUI_10_17_DEFAULT 0x00000007
366 #define LAN8651_PHY_ID2_OUI_18_23 0x0000FC00
367 #define LAN8651_PHY_ID2_OUI_18_23_DEFAULT 0x0000C000
368 #define LAN8651_PHY_ID2_MODEL 0x000003F0
369 #define LAN8651_PHY_ID2_MODEL_DEFAULT 0x000001B0
370 #define LAN8651_PHY_ID2_REV 0x0000000F
371 #define LAN8651_PHY_ID2_REV_3 0x00000003
374 #define LAN8651_MMDCTRL_FNCTN 0xC000
375 #define LAN8651_MMDCTRL_FNCTN_ADDR 0x0000
376 #define LAN8651_MMDCTRL_FNCTN_DATA_NO_POST_INC 0x4000
377 #define LAN8651_MMDCTRL_FNCTN_DATA_POST_INC_RW 0x8000
378 #define LAN8651_MMDCTRL_FNCTN_DATA_POST_INC_W 0xC000
379 #define LAN8651_MMDCTRL_DEVAD 0x001F
380 #define LAN8651_MMDCTRL_DEVAD_PMA_PMD 0x0001
381 #define LAN8651_MMDCTRL_DEVAD_PCS 0x0002
382 #define LAN8651_MMDCTRL_DEVAD_VENDOR_SPECIFIC_2 0x001F
385 #define LAN8651_MMDAD_ADR_DATA 0xFFFF
388 #define LAN8651_MAC_NCR_TXEN 0x00000008
389 #define LAN8651_MAC_NCR_RXEN 0x00000004
390 #define LAN8651_MAC_NCR_LBL 0x00000002
393 #define LAN8651_MAC_NCFGR_RXBP 0x20000000
394 #define LAN8651_MAC_NCFGR_IRXFCS 0x04000000
395 #define LAN8651_MAC_NCFGR_EFRHD 0x02000000
396 #define LAN8651_MAC_NCFGR_RFCS 0x00020000
397 #define LAN8651_MAC_NCFGR_LFERD 0x00010000
398 #define LAN8651_MAC_NCFGR_MAXFS 0x00000100
399 #define LAN8651_MAC_NCFGR_UNIHEN 0x00000080
400 #define LAN8651_MAC_NCFGR_MTIHEN 0x00000040
401 #define LAN8651_MAC_NCFGR_NBC 0x00000020
402 #define LAN8651_MAC_NCFGR_CAF 0x00000010
403 #define LAN8651_MAC_NCFGR_DNVLAN 0x00000004
406 #define LAN8651_MAC_SAB1_ADDR_31_0 0xFFFFFFFF
409 #define LAN8651_MAC_SAT1_FLTTYP 0x00010000
410 #define LAN8651_MAC_SAT1_ADDR_47_32 0x0000FFFF
413 #define LAN8651_MAC_SAB2_ADDR_31_0 0xFFFFFFFF
416 #define LAN8651_MAC_SAT2_FLTTYP 0x00010000
417 #define LAN8651_MAC_SAT2_ADDR_47_32 0x0000FFFF
420 #define LAN8651_MAC_SAB3_ADDR_31_0 0xFFFFFFFF
423 #define LAN8651_MAC_SAT3_FLTTYP 0x00010000
424 #define LAN8651_MAC_SAT3_ADDR_47_32 0x0000FFFF
427 #define LAN8651_MAC_SAB4_ADDR_31_0 0xFFFFFFFF
430 #define LAN8651_MAC_SAT4_FLTTYP 0x00010000
431 #define LAN8651_MAC_SAT4_ADDR_47_32 0x0000FFFF
434 #define LAN8651_MAC_TIDM1_ENID 0x80000000
435 #define LAN8651_MAC_TIDM1_TID 0x0000FFFF
438 #define LAN8651_MAC_TIDM2_ENID 0x80000000
439 #define LAN8651_MAC_TIDM2_TID 0x0000FFFF
442 #define LAN8651_MAC_TIDM3_ENID 0x80000000
443 #define LAN8651_MAC_TIDM3_TID 0x0000FFFF
446 #define LAN8651_MAC_TIDM4_ENID 0x80000000
447 #define LAN8651_MAC_TIDM4_TID 0x0000FFFF
450 #define LAN8651_MAC_SAMB1_ADDR_31_0 0xFFFFFFFF
453 #define LAN8651_MAC_SAMT1_ADDR_47_32 0x0000FFFF
456 #define LAN8651_MAC_TISUBN_LSBTIR 0xFF000000
457 #define LAN8651_MAC_TISUBN_MSBTIR 0x0000FFFF
460 #define LAN8651_MAC_TSH_TCS_47_32 0x0000FFFF
463 #define LAN8651_MAC_TSL_TCS_31_0 0xFFFFFFFF
466 #define LAN8651_MAC_TN_TNS 0x3FFFFFFF
469 #define LAN8651_MAC_TA_ADJ 0x80000000
470 #define LAN8651_MAC_TA_ITDT 0x3FFFFFFF
473 #define LAN8651_MAC_TI_CNS 0x000000FF
476 #define LAN8651_BMGR_CTL_SNAPSTATS 0x00000020
477 #define LAN8651_BMGR_CTL_CLRSTATS 0x00000010
480 #define LAN8651_STATS0_RXSE 0xFF000000
481 #define LAN8651_STATS0_LFER 0x00FF0000
482 #define LAN8651_STATS0_OFRX 0x0000FF00
483 #define LAN8651_STATS0_UFRX 0x000000FF
486 #define LAN8651_STATS1_RXRER 0xFF000000
487 #define LAN8651_STATS1_RXBOVR 0x00FF0000
488 #define LAN8651_STATS1_RXFOVR 0x0000FF00
491 #define LAN8651_STATS2_FCSE 0x000000FF
494 #define LAN8651_STATS3_TID4MCNT 0xFF000000
495 #define LAN8651_STATS3_TID3MCNT 0x00FF0000
496 #define LAN8651_STATS3_TID2MCNT 0x0000FF00
497 #define LAN8651_STATS3_TID1MCNT 0x000000FF
500 #define LAN8651_STATS4_SA4MCNT 0xFF000000
501 #define LAN8651_STATS4_SA3MCNT 0x00FF0000
502 #define LAN8651_STATS4_SA2MCNT 0x0000FF00
503 #define LAN8651_STATS4_SA1MCNT 0x000000FF
506 #define LAN8651_STATS5_UHMFRX 0xFF000000
507 #define LAN8651_STATS5_MHMFRX 0x00FF0000
508 #define LAN8651_STATS5_BFRX 0x0000FF00
509 #define LAN8651_STATS5_VTRX 0x000000FF
512 #define LAN8651_STATS6_TFRX 0xFFFFFFFF
515 #define LAN8651_STATS7_FRX 0xFFFFFFFF
518 #define LAN8651_STATS8_TXAIE 0x000000FF
521 #define LAN8651_STATS9_TXAEE 0xFF000000
522 #define LAN8651_STATS9_TXFUR 0x00FF0000
523 #define LAN8651_STATS9_TXBUR 0x0000FF00
526 #define LAN8651_STATS10_XCOL 0x000000FF
529 #define LAN8651_STATS11_TFTX 0xFFFFFFFF
532 #define LAN8651_STATS12_FTX 0xFFFFFFFF
535 #define LAN8651_T1SPCSCTL_RST 0x8000
536 #define LAN8651_T1SPCSCTL_LBE 0x4000
537 #define LAN8651_T1SPCSCTL_DUPLEX 0x0100
540 #define LAN8651_T1SPCSSTS_FAULT 0x0080
543 #define LAN8651_T1SPCSDIAG1_RMTJABCNT 0xFFFF
546 #define LAN8651_T1SPCSDIAG2_CORTXCNT 0xFFFF
549 #define LAN8651_T1PMAPMDEXTA_T1SABL 0x0008
550 #define LAN8651_T1PMAPMDEXTA_T1LABL 0x0004
553 #define LAN8651_T1PMAPMDCTL_TYPSEL 0x000F
554 #define LAN8651_T1PMAPMDCTL_TYPSEL_100BT1 0x0000
555 #define LAN8651_T1PMAPMDCTL_TYPSEL_1000BT1 0x0001
556 #define LAN8651_T1PMAPMDCTL_TYPSEL_10BT1L 0x0002
557 #define LAN8651_T1PMAPMDCTL_TYPSEL_10BT1S 0x0003
560 #define LAN8651_T1SPMACTL_RST 0x8000
561 #define LAN8651_T1SPMACTL_TXD 0x4000
562 #define LAN8651_T1SPMACTL_LPE 0x0800
563 #define LAN8651_T1SPMACTL_MDE 0x0400
564 #define LAN8651_T1SPMACTL_LBE 0x0001
567 #define LAN8651_T1SPMASTS_LBA 0x2000
568 #define LAN8651_T1SPMASTS_LPA 0x0800
569 #define LAN8651_T1SPMASTS_MDA 0x0400
570 #define LAN8651_T1SPMASTS_RXFA 0x0200
571 #define LAN8651_T1SPMASTS_RXFD 0x0002
574 #define LAN8651_T1STSTCTL_TSTCTL 0xE000
575 #define LAN8651_T1STSTCTL_TSTCTL_NORMAL 0x0000
576 #define LAN8651_T1STSTCTL_TSTCTL_TEST_MODE_1 0x2000
577 #define LAN8651_T1STSTCTL_TSTCTL_TEST_MODE_2 0x4000
578 #define LAN8651_T1STSTCTL_TSTCTL_TEST_MODE_3 0x6000
579 #define LAN8651_T1STSTCTL_TSTCTL_TEST_MODE_4 0x8000
582 #define LAN8651_CTRL1_IWDE 0x0008
583 #define LAN8651_CTRL1_DIGLBE 0x0002
586 #define LAN8651_STS1_PSTC 0x0800
587 #define LAN8651_STS1_TXCOL 0x0400
588 #define LAN8651_STS1_TXJAB 0x0200
589 #define LAN8651_STS1_EMPCYC 0x0080
590 #define LAN8651_STS1_RXINTO 0x0040
591 #define LAN8651_STS1_UNEXPB 0x0020
592 #define LAN8651_STS1_BCNBFTO 0x0010
593 #define LAN8651_STS1_PLCASYM 0x0004
594 #define LAN8651_STS1_ESDERR 0x0002
595 #define LAN8651_STS1_DEC5B 0x0001
598 #define LAN8651_STS2_WKEMDI 0x0400
599 #define LAN8651_STS2_WKEWI 0x0200
600 #define LAN8651_STS2_UV33 0x0100
601 #define LAN8651_STS2_OT 0x0040
602 #define LAN8651_STS2_IWDTO 0x0020
605 #define LAN8651_STS3_ERRTOID 0x00FF
608 #define LAN8651_IMSK1_PSTCM 0x0800
609 #define LAN8651_IMSK1_TXCOLM 0x0400
610 #define LAN8651_IMSK1_TXJABM 0x0200
611 #define LAN8651_IMSK1_EMPCYCM 0x0080
612 #define LAN8651_IMSK1_RXINTOM 0x0040
613 #define LAN8651_IMSK1_UNEXPBM 0x0020
614 #define LAN8651_IMSK1_BCNBFTOM 0x0010
615 #define LAN8651_IMSK1_PLCASYMM 0x0004
616 #define LAN8651_IMSK1_ESDERRM 0x0002
617 #define LAN8651_IMSK1_DEC5BM 0x0001
620 #define LAN8651_IMSK2_WKEMDIM 0x0400
621 #define LAN8651_IMSK2_WKEWIM 0x0200
622 #define LAN8651_IMSK2_UV33M 0x0100
623 #define LAN8651_IMSK2_OTM 0x0040
624 #define LAN8651_IMSK2_IWDTOM 0x0020
627 #define LAN8651_CTRCTRL_TOCTRE 0x0002
628 #define LAN8651_CTRCTRL_BCNCTRE 0x0001
631 #define LAN8651_TOCNTH_TOCNT_31_16 0xFFFF
634 #define LAN8651_TOCNTL_TOCNT_15_0 0xFFFF
637 #define LAN8651_BCNCNTH_BCNCNT_31_16 0xFFFF
640 #define LAN8651_BCNCNTL_BCNCNT_15_0 0xFFFF
643 #define LAN8651_PRTMGMT2_MIRXWDEN 0x2000
644 #define LAN8651_PRTMGMT2_PRIWDEN 0x1000
645 #define LAN8651_PRTMGMT2_MITXWDEN 0x0800
648 #define LAN8651_IWDTOH_TIMEOUT_31_16 0xFFFF
651 #define LAN8651_IWDTOL_TIMEOUT_15_0 0xFFFF
654 #define LAN8651_SLPCTL0_SLPEN 0x8000
655 #define LAN8651_SLPCTL0_WKINEN 0x4000
656 #define LAN8651_SLPCTL0_MDIWKEN 0x2000
657 #define LAN8651_SLPCTL0_SLPINHDLY 0x1800
658 #define LAN8651_SLPCTL0_SLPINHDLY_0MS 0x0000
659 #define LAN8651_SLPCTL0_SLPINHDLY_50MS 0x0800
660 #define LAN8651_SLPCTL0_SLPINHDLY_100MS 0x1000
661 #define LAN8651_SLPCTL0_SLPINHDLY_200MS 0x1800
664 #define LAN8651_SLPCTL1_WIPOL 0x0020
665 #define LAN8651_SLPCTL1_WAKEIND 0x0010
666 #define LAN8651_SLPCTL1_CLRWKI 0x0008
667 #define LAN8651_SLPCTL1_MWKFWD 0x0004
668 #define LAN8651_SLPCTL1_WKOFWDEN 0x0002
669 #define LAN8651_SLPCTL1_MDIFWDEN 0x0001
672 #define LAN8651_ANALOG5_UV33FTM 0xFF00
673 #define LAN8651_ANALOG5_UV33FTM_DEFAULT 0x1400
676 #define LAN8651_MIDVER_IDM 0xFF00
677 #define LAN8651_MIDVER_IDM_DEFAULT 0x0A00
678 #define LAN8651_MIDVER_VER 0x00FF
679 #define LAN8651_MIDVER_VER_DEFAULT 0x0010
682 #define LAN8651_PLCA_CTRL0_EN 0x8000
683 #define LAN8651_PLCA_CTRL0_RST 0x4000
686 #define LAN8651_PLCA_CTRL1_NCNT 0xFF00
687 #define LAN8651_PLCA_CTRL1_ID 0x00FF
690 #define LAN8651_PLCA_STS_PST 0x8000
693 #define LAN8651_PLCA_TOTMR_TOTMR 0x00FF
694 #define LAN8651_PLCA_TOTMR_TOTMR_DEFAULT 0x0020
697 #define LAN8651_PLCA_BURST_MAXBC 0xFF00
698 #define LAN8651_PLCA_BURST_MAXBC_DEFAULT 0x0000
699 #define LAN8651_PLCA_BURST_BTMR 0x00FF
700 #define LAN8651_PLCA_BURST_BTMR_DEFAULT 0x0080
703 #define LAN8651_QTXCFG_CTTHR 0xC0000000
704 #define LAN8651_QTXCFG_CTTHR_1_CHUNK 0x00000000
705 #define LAN8651_QTXCFG_CTTHR_2_CHUNKS 0x40000000
706 #define LAN8651_QTXCFG_CTTHR_3_CHUNKS 0x80000000
707 #define LAN8651_QTXCFG_CTTHR_4_CHUNKS 0xC0000000
708 #define LAN8651_QTXCFG_BUFSZ 0x00700000
709 #define LAN8651_QTXCFG_BUFSZ_32_BYTES 0x00000000
710 #define LAN8651_QTXCFG_BUFSZ_64_BYTES 0x00100000
711 #define LAN8651_QTXCFG_MACFCSDIS 0x00080000
714 #define LAN8651_QRXCFG_BUFSZ 0x00700000
715 #define LAN8651_QRXCFG_BUFSZ_32_BYTES 0x00000000
716 #define LAN8651_QRXCFG_BUFSZ_64_BYTES 0x00100000
719 #define LAN8651_PADCTRL_PDRV3 0xC0000000
720 #define LAN8651_PADCTRL_PDRV3_LOW 0x00000000
721 #define LAN8651_PADCTRL_PDRV3_MEDIUM_LOW 0x40000000
722 #define LAN8651_PADCTRL_PDRV3_MEDIUM_HIGH 0x80000000
723 #define LAN8651_PADCTRL_PDRV3_HIGH 0xC0000000
724 #define LAN8651_PADCTRL_PDRV2 0x30000000
725 #define LAN8651_PADCTRL_PDRV2_LOW 0x00000000
726 #define LAN8651_PADCTRL_PDRV2_MEDIUM_LOW 0x10000000
727 #define LAN8651_PADCTRL_PDRV2_MEDIUM_HIGH 0x20000000
728 #define LAN8651_PADCTRL_PDRV2_HIGH 0x30000000
729 #define LAN8651_PADCTRL_PDRV1 0x0C000000
730 #define LAN8651_PADCTRL_PDRV1_LOW 0x00000000
731 #define LAN8651_PADCTRL_PDRV1_MEDIUM_LOW 0x04000000
732 #define LAN8651_PADCTRL_PDRV1_MEDIUM_HIGH 0x08000000
733 #define LAN8651_PADCTRL_PDRV1_HIGH 0x0C000000
736 #define LAN8651_MISC_UV18FEN 0x00001000
737 #define LAN8651_MISC_UV18FTM 0x00000FFF
738 #define LAN8651_MISC_UV18FTM_DEFAULT 0x00000040
741 #define LAN8651_DEVID_MODEL 0x000FFFF0
742 #define LAN8651_DEVID_MODEL_DEFAULT 0x00086510
743 #define LAN8651_DEVID_REV 0x0000000F
744 #define LAN8651_DEVID_REV_1 0x00000001
uint16_t lan8651ReadMmdReg(NetInterface *interface, uint8_t devAddr, uint16_t regAddr)
Read MMD register.
error_t lan8651SendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.
Structure describing a buffer that spans multiple chunks.
void lan8651InitHook(NetInterface *interface)
LAN8651 custom configuration.
void lan8651EnableIrq(NetInterface *interface)
Enable interrupts.
error_t lan8651Init(NetInterface *interface)
LAN8651 controller initialization.
void lan8651WriteReg(NetInterface *interface, uint8_t mms, uint16_t address, uint32_t data)
Write register.
void lan8651Tick(NetInterface *interface)
LAN8651 timer handler.
uint32_t lan8651ReadReg(NetInterface *interface, uint8_t mms, uint16_t address)
Read register.
int8_t lan8651ReadIndirectReg(NetInterface *interface, uint8_t address)
Read indirect register.
void lan8651EventHandler(NetInterface *interface)
LAN8651 event handler.
void lan8651DumpReg(NetInterface *interface, uint8_t mms, uint16_t address, uint_t num)
Dump registers for debugging purpose.
void lan8651WriteMmdReg(NetInterface *interface, uint8_t devAddr, uint16_t regAddr, uint16_t data)
Write MMD register.
void lan8651DisableIrq(NetInterface *interface)
Disable interrupts.
error_t lan8651UpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
void lan8651Config(NetInterface *interface)
LAN8651 controller configuration.
const NicDriver lan8651Driver
LAN8651 driver.
Network interface controller abstraction layer.
error_t lan8651ReceivePacket(NetInterface *interface)
Receive a packet.
uint32_t lan8651CalcParity(uint32_t data)
Calculate parity bit over a 32-bit data.
bool_t lan8651IrqHandler(NetInterface *interface)
LAN8651 interrupt service routine.