31#ifndef _KSZ8895_DRIVER_H
32#define _KSZ8895_DRIVER_H
38#define KSZ8895_PORT1 1
39#define KSZ8895_PORT2 2
40#define KSZ8895_PORT3 3
41#define KSZ8895_PORT4 4
42#define KSZ8895_PORT5 5
45#define KSZ8895_PORT_MASK 0x1F
46#define KSZ8895_PORT1_MASK 0x01
47#define KSZ8895_PORT2_MASK 0x02
48#define KSZ8895_PORT3_MASK 0x04
49#define KSZ8895_PORT4_MASK 0x08
50#define KSZ8895_PORT5_MASK 0x10
53#define KSZ8895_SPI_CMD_WRITE 0x02
54#define KSZ8895_SPI_CMD_READ 0x03
57#define KSZ8895_STATIC_MAC_TABLE_SIZE 32
58#define KSZ8895_DYNAMIC_MAC_TABLE_SIZE 1024
59#define KSZ8895_VLAN_TABLE_SIZE 4096
62#define KSZ8895_TAIL_TAG_NORMAL_ADDR_LOOKUP 0x80
63#define KSZ8895_TAIL_TAG_PORT_SEL 0x40
64#define KSZ8895_TAIL_TAG_DEST_QUEUE 0x30
65#define KSZ8895_TAIL_TAG_DEST_PORT4 0x08
66#define KSZ8895_TAIL_TAG_DEST_PORT3 0x04
67#define KSZ8895_TAIL_TAG_DEST_PORT2 0x02
68#define KSZ8895_TAIL_TAG_DEST_PORT1 0x01
71#define KSZ8895_TAIL_TAG_SRC_PORT 0x03
74#define KSZ8895_BMCR 0x00
75#define KSZ8895_BMSR 0x01
76#define KSZ8895_PHYID1 0x02
77#define KSZ8895_PHYID2 0x03
78#define KSZ8895_ANAR 0x04
79#define KSZ8895_ANLPAR 0x05
80#define KSZ8895_LINKMD 0x1D
81#define KSZ8895_PHYSCS 0x1F
84#define KSZ8895_CHIP_ID0 0x00
85#define KSZ8895_CHIP_ID1 0x01
86#define KSZ8895_GLOBAL_CTRL0 0x02
87#define KSZ8895_GLOBAL_CTRL1 0x03
88#define KSZ8895_GLOBAL_CTRL2 0x04
89#define KSZ8895_GLOBAL_CTRL3 0x05
90#define KSZ8895_GLOBAL_CTRL4 0x06
91#define KSZ8895_GLOBAL_CTRL5 0x07
92#define KSZ8895_GLOBAL_CTRL6 0x08
93#define KSZ8895_GLOBAL_CTRL7 0x09
94#define KSZ8895_GLOBAL_CTRL8 0x0A
95#define KSZ8895_GLOBAL_CTRL9 0x0B
96#define KSZ8895_GLOBAL_CTRL10 0x0C
97#define KSZ8895_GLOBAL_CTRL11 0x0D
98#define KSZ8895_PD_MGMT_CTRL1 0x0E
99#define KSZ8895_PD_MGMT_CTRL2 0x0F
100#define KSZ8895_PORT1_CTRL0 0x10
101#define KSZ8895_PORT1_CTRL1 0x11
102#define KSZ8895_PORT1_CTRL2 0x12
103#define KSZ8895_PORT1_CTRL3 0x13
104#define KSZ8895_PORT1_CTRL4 0x14
105#define KSZ8895_PORT1_STAT0 0x19
106#define KSZ8895_PORT1_PSCS 0x1A
107#define KSZ8895_PORT1_LINKMD 0x1B
108#define KSZ8895_PORT1_CTRL5 0x1C
109#define KSZ8895_PORT1_CTRL6 0x1D
110#define KSZ8895_PORT1_STAT1 0x1E
111#define KSZ8895_PORT1_CTRL7_STAT2 0x1F
112#define KSZ8895_PORT2_CTRL0 0x20
113#define KSZ8895_PORT2_CTRL1 0x21
114#define KSZ8895_PORT2_CTRL2 0x22
115#define KSZ8895_PORT2_CTRL3 0x23
116#define KSZ8895_PORT2_CTRL4 0x24
117#define KSZ8895_PORT2_STAT0 0x29
118#define KSZ8895_PORT2_PSCS 0x2A
119#define KSZ8895_PORT2_LINKMD 0x2B
120#define KSZ8895_PORT2_CTRL5 0x2C
121#define KSZ8895_PORT2_CTRL6 0x2D
122#define KSZ8895_PORT2_STAT1 0x2E
123#define KSZ8895_PORT2_CTRL7_STAT2 0x2F
124#define KSZ8895_PORT3_CTRL0 0x30
125#define KSZ8895_PORT3_CTRL1 0x31
126#define KSZ8895_PORT3_CTRL2 0x32
127#define KSZ8895_PORT3_CTRL3 0x33
128#define KSZ8895_PORT3_CTRL4 0x34
129#define KSZ8895_PORT3_STAT0 0x39
130#define KSZ8895_PORT3_PSCS 0x3A
131#define KSZ8895_PORT3_LINKMD 0x3B
132#define KSZ8895_PORT3_CTRL5 0x3C
133#define KSZ8895_PORT3_CTRL6 0x3D
134#define KSZ8895_PORT3_STAT1 0x3E
135#define KSZ8895_PORT3_CTRL7_STAT2 0x3F
136#define KSZ8895_PORT4_CTRL0 0x40
137#define KSZ8895_PORT4_CTRL1 0x41
138#define KSZ8895_PORT4_CTRL2 0x42
139#define KSZ8895_PORT4_CTRL3 0x43
140#define KSZ8895_PORT4_CTRL4 0x44
141#define KSZ8895_PORT4_STAT0 0x49
142#define KSZ8895_PORT4_PSCS 0x4A
143#define KSZ8895_PORT4_LINKMD 0x4B
144#define KSZ8895_PORT4_CTRL5 0x4C
145#define KSZ8895_PORT4_CTRL6 0x4D
146#define KSZ8895_PORT4_STAT1 0x4E
147#define KSZ8895_PORT4_CTRL7_STAT2 0x4F
148#define KSZ8895_PORT5_CTRL0 0x50
149#define KSZ8895_PORT5_CTRL1 0x51
150#define KSZ8895_PORT5_CTRL2 0x52
151#define KSZ8895_PORT5_CTRL3 0x53
152#define KSZ8895_PORT5_CTRL4 0x54
153#define KSZ8895_RMII_MGMT_CTRL 0x57
154#define KSZ8895_PORT5_STAT0 0x59
155#define KSZ8895_PORT5_PSCS 0x5A
156#define KSZ8895_PORT5_LINKMD 0x5B
157#define KSZ8895_PORT5_CTRL5 0x5C
158#define KSZ8895_PORT5_CTRL6 0x5D
159#define KSZ8895_PORT5_STAT1 0x5E
160#define KSZ8895_PORT5_CTRL7_STAT2 0x5F
161#define KSZ8895_MAC_ADDR0 0x68
162#define KSZ8895_MAC_ADDR1 0x69
163#define KSZ8895_MAC_ADDR2 0x6A
164#define KSZ8895_MAC_ADDR3 0x6B
165#define KSZ8895_MAC_ADDR4 0x6C
166#define KSZ8895_MAC_ADDR5 0x6D
167#define KSZ8895_INDIRECT_CTRL0 0x6E
168#define KSZ8895_INDIRECT_CTRL1 0x6F
169#define KSZ8895_INDIRECT_DATA8 0x70
170#define KSZ8895_INDIRECT_DATA7 0x71
171#define KSZ8895_INDIRECT_DATA6 0x72
172#define KSZ8895_INDIRECT_DATA5 0x73
173#define KSZ8895_INDIRECT_DATA4 0x74
174#define KSZ8895_INDIRECT_DATA3 0x75
175#define KSZ8895_INDIRECT_DATA2 0x76
176#define KSZ8895_INDIRECT_DATA1 0x77
177#define KSZ8895_INDIRECT_DATA0 0x78
178#define KSZ8895_INT_STAT 0x7C
179#define KSZ8895_INT_MASK 0x7D
180#define KSZ8895_GLOBAL_CTRL12 0x80
181#define KSZ8895_GLOBAL_CTRL13 0x81
182#define KSZ8895_GLOBAL_CTRL14 0x82
183#define KSZ8895_GLOBAL_CTRL15 0x83
184#define KSZ8895_GLOBAL_CTRL16 0x84
185#define KSZ8895_GLOBAL_CTRL17 0x85
186#define KSZ8895_GLOBAL_CTRL18 0x86
187#define KSZ8895_GLOBAL_CTRL19 0x87
188#define KSZ8895_ID 0x89
189#define KSZ8895_TOS_PRIO_CTRL0 0x90
190#define KSZ8895_TOS_PRIO_CTRL1 0x91
191#define KSZ8895_TOS_PRIO_CTRL2 0x92
192#define KSZ8895_TOS_PRIO_CTRL3 0x93
193#define KSZ8895_TOS_PRIO_CTRL4 0x94
194#define KSZ8895_TOS_PRIO_CTRL5 0x95
195#define KSZ8895_TOS_PRIO_CTRL6 0x96
196#define KSZ8895_TOS_PRIO_CTRL7 0x97
197#define KSZ8895_TOS_PRIO_CTRL8 0x98
198#define KSZ8895_TOS_PRIO_CTRL9 0x99
199#define KSZ8895_TOS_PRIO_CTRL10 0x9A
200#define KSZ8895_TOS_PRIO_CTRL11 0x9B
201#define KSZ8895_TOS_PRIO_CTRL12 0x9C
202#define KSZ8895_TOS_PRIO_CTRL13 0x9D
203#define KSZ8895_TOS_PRIO_CTRL14 0x9E
204#define KSZ8895_TOS_PRIO_CTRL15 0x9F
205#define KSZ8895_PORT1_CTRL8 0xB0
206#define KSZ8895_PORT1_CTRL9 0xB1
207#define KSZ8895_PORT1_CTRL10 0xB2
208#define KSZ8895_PORT1_CTRL11 0xB3
209#define KSZ8895_PORT1_CTRL12 0xB4
210#define KSZ8895_PORT1_CTRL13 0xB5
211#define KSZ8895_PORT1_RATE_LIMIT_CTRL 0xB6
212#define KSZ8895_PORT1_PRIO0_IG_LIMIT_CTRL1 0xB7
213#define KSZ8895_PORT1_PRIO1_IG_LIMIT_CTRL2 0xB8
214#define KSZ8895_PORT1_PRIO2_IG_LIMIT_CTRL3 0xB9
215#define KSZ8895_PORT1_PRIO3_IG_LIMIT_CTRL4 0xBA
216#define KSZ8895_PORT1_QUEUE0_EG_LIMIT_CTRL1 0xBB
217#define KSZ8895_PORT1_QUEUE1_EG_LIMIT_CTRL2 0xBC
218#define KSZ8895_PORT1_QUEUE2_EG_LIMIT_CTRL3 0xBD
219#define KSZ8895_PORT1_QUEUE3_EG_LIMIT_CTRL4 0xBE
220#define KSZ8895_TEST1 0xBF
221#define KSZ8895_PORT2_CTRL8 0xC0
222#define KSZ8895_PORT2_CTRL9 0xC1
223#define KSZ8895_PORT2_CTRL10 0xC2
224#define KSZ8895_PORT2_CTRL11 0xC3
225#define KSZ8895_PORT2_CTRL12 0xC4
226#define KSZ8895_PORT2_CTRL13 0xC5
227#define KSZ8895_PORT2_RATE_LIMIT_CTRL 0xC6
228#define KSZ8895_PORT2_PRIO0_IG_LIMIT_CTRL1 0xC7
229#define KSZ8895_PORT2_PRIO1_IG_LIMIT_CTRL2 0xC8
230#define KSZ8895_PORT2_PRIO2_IG_LIMIT_CTRL3 0xC9
231#define KSZ8895_PORT2_PRIO3_IG_LIMIT_CTRL4 0xCA
232#define KSZ8895_PORT2_QUEUE0_EG_LIMIT_CTRL1 0xCB
233#define KSZ8895_PORT2_QUEUE1_EG_LIMIT_CTRL2 0xCC
234#define KSZ8895_PORT2_QUEUE2_EG_LIMIT_CTRL3 0xCD
235#define KSZ8895_PORT2_QUEUE3_EG_LIMIT_CTRL4 0xCE
236#define KSZ8895_PORT3_CTRL8 0xD0
237#define KSZ8895_PORT3_CTRL9 0xD1
238#define KSZ8895_PORT3_CTRL10 0xD2
239#define KSZ8895_PORT3_CTRL11 0xD3
240#define KSZ8895_PORT3_CTRL12 0xD4
241#define KSZ8895_PORT3_CTRL13 0xD5
242#define KSZ8895_PORT3_RATE_LIMIT_CTRL 0xD6
243#define KSZ8895_PORT3_PRIO0_IG_LIMIT_CTRL1 0xD7
244#define KSZ8895_PORT3_PRIO1_IG_LIMIT_CTRL2 0xD8
245#define KSZ8895_PORT3_PRIO2_IG_LIMIT_CTRL3 0xD9
246#define KSZ8895_PORT3_PRIO3_IG_LIMIT_CTRL4 0xDA
247#define KSZ8895_PORT3_QUEUE0_EG_LIMIT_CTRL1 0xDB
248#define KSZ8895_PORT3_QUEUE1_EG_LIMIT_CTRL2 0xDC
249#define KSZ8895_PORT3_QUEUE2_EG_LIMIT_CTRL3 0xDD
250#define KSZ8895_PORT3_QUEUE3_EG_LIMIT_CTRL4 0xDE
251#define KSZ8895_TEST2 0xDF
252#define KSZ8895_PORT4_CTRL8 0xE0
253#define KSZ8895_PORT4_CTRL9 0xE1
254#define KSZ8895_PORT4_CTRL10 0xE2
255#define KSZ8895_PORT4_CTRL11 0xE3
256#define KSZ8895_PORT4_CTRL12 0xE4
257#define KSZ8895_PORT4_CTRL13 0xE5
258#define KSZ8895_PORT4_RATE_LIMIT_CTRL 0xE6
259#define KSZ8895_PORT4_PRIO0_IG_LIMIT_CTRL1 0xE7
260#define KSZ8895_PORT4_PRIO1_IG_LIMIT_CTRL2 0xE8
261#define KSZ8895_PORT4_PRIO2_IG_LIMIT_CTRL3 0xE9
262#define KSZ8895_PORT4_PRIO3_IG_LIMIT_CTRL4 0xEA
263#define KSZ8895_PORT4_QUEUE0_EG_LIMIT_CTRL1 0xEB
264#define KSZ8895_PORT4_QUEUE1_EG_LIMIT_CTRL2 0xEC
265#define KSZ8895_PORT4_QUEUE2_EG_LIMIT_CTRL3 0xED
266#define KSZ8895_PORT4_QUEUE3_EG_LIMIT_CTRL4 0xEE
267#define KSZ8895_PORT3_COPPER_FIBER_CTRL 0xEF
268#define KSZ8895_PORT5_CTRL8 0xF0
269#define KSZ8895_PORT5_CTRL9 0xF1
270#define KSZ8895_PORT5_CTRL10 0xF2
271#define KSZ8895_PORT5_CTRL11 0xF3
272#define KSZ8895_PORT5_CTRL12 0xF4
273#define KSZ8895_PORT5_CTRL13 0xF5
274#define KSZ8895_PORT5_RATE_LIMIT_CTRL 0xF6
275#define KSZ8895_PORT5_PRIO0_IG_LIMIT_CTRL1 0xF7
276#define KSZ8895_PORT5_PRIO1_IG_LIMIT_CTRL2 0xF8
277#define KSZ8895_PORT5_PRIO2_IG_LIMIT_CTRL3 0xF9
278#define KSZ8895_PORT5_PRIO3_IG_LIMIT_CTRL4 0xFA
279#define KSZ8895_PORT5_QUEUE0_EG_LIMIT_CTRL1 0xFB
280#define KSZ8895_PORT5_QUEUE1_EG_LIMIT_CTRL2 0xFC
281#define KSZ8895_PORT5_QUEUE2_EG_LIMIT_CTRL3 0xFD
282#define KSZ8895_PORT5_QUEUE3_EG_LIMIT_CTRL4 0xFE
283#define KSZ8895_TEST3 0xFF
286#define KSZ8895_PORTn_CTRL0(port) (0x00 + ((port) * 0x10))
287#define KSZ8895_PORTn_CTRL1(port) (0x01 + ((port) * 0x10))
288#define KSZ8895_PORTn_CTRL2(port) (0x02 + ((port) * 0x10))
289#define KSZ8895_PORTn_CTRL3(port) (0x03 + ((port) * 0x10))
290#define KSZ8895_PORTn_CTRL4(port) (0x04 + ((port) * 0x10))
291#define KSZ8895_PORTn_STAT0(port) (0x09 + ((port) * 0x10))
292#define KSZ8895_PORTn_PSCS(port) (0x0A + ((port) * 0x10))
293#define KSZ8895_PORTn_LINKMD(port) (0x0B + ((port) * 0x10))
294#define KSZ8895_PORTn_CTRL5(port) (0x0C + ((port) * 0x10))
295#define KSZ8895_PORTn_CTRL6(port) (0x0D + ((port) * 0x10))
296#define KSZ8895_PORTn_STAT1(port) (0x0E + ((port) * 0x10))
297#define KSZ8895_PORTn_CTRL7_STAT2(port) (0x0F + ((port) * 0x10))
298#define KSZ8895_PORTn_CTRL8(port) (0xA0 + ((port) * 0x10))
299#define KSZ8895_PORTn_CTRL9(port) (0xA1 + ((port) * 0x10))
300#define KSZ8895_PORTn_CTRL10(port) (0xA2 + ((port) * 0x10))
301#define KSZ8895_PORTn_CTRL11(port) (0xA3 + ((port) * 0x10))
302#define KSZ8895_PORTn_CTRL12(port) (0xA4 + ((port) * 0x10))
303#define KSZ8895_PORTn_CTRL13(port) (0xA5 + ((port) * 0x10))
304#define KSZ8895_PORTn_RATE_LIMIT_CTRL(port) (0xA6 + ((port) * 0x10))
305#define KSZ8895_PORTn_PRIO0_IG_LIMIT_CTRL1(port) (0xA7 + ((port) * 0x10))
306#define KSZ8895_PORTn_PRIO1_IG_LIMIT_CTRL2(port) (0xA8 + ((port) * 0x10))
307#define KSZ8895_PORTn_PRIO2_IG_LIMIT_CTRL3(port) (0xA9 + ((port) * 0x10))
308#define KSZ8895_PORTn_PRIO3_IG_LIMIT_CTRL4(port) (0xAA + ((port) * 0x10))
309#define KSZ8895_PORTn_QUEUE0_EG_LIMIT_CTRL1(port) (0xAB + ((port) * 0x10))
310#define KSZ8895_PORTn_QUEUE1_EG_LIMIT_CTRL2(port) (0xAC + ((port) * 0x10))
311#define KSZ8895_PORTn_QUEUE2_EG_LIMIT_CTRL3(port) (0xAD + ((port) * 0x10))
312#define KSZ8895_PORTn_QUEUE3_EG_LIMIT_CTRL4(port) (0xAE + ((port) * 0x10))
315#define KSZ8895_BMCR_RESET 0x8000
316#define KSZ8895_BMCR_LOOPBACK 0x4000
317#define KSZ8895_BMCR_FORCE_100 0x2000
318#define KSZ8895_BMCR_AN_EN 0x1000
319#define KSZ8895_BMCR_POWER_DOWN 0x0800
320#define KSZ8895_BMCR_ISOLATE 0x0400
321#define KSZ8895_BMCR_RESTART_AN 0x0200
322#define KSZ8895_BMCR_FORCE_FULL_DUPLEX 0x0100
323#define KSZ8895_BMCR_COL_TEST 0x0080
324#define KSZ8895_BMCR_HP_MDIX 0x0020
325#define KSZ8895_BMCR_FORCE_MDI 0x0010
326#define KSZ8895_BMCR_AUTO_MDIX_DIS 0x0008
327#define KSZ8895_BMCR_FAR_END_FAULT_DIS 0x0004
328#define KSZ8895_BMCR_TRANSMIT_DIS 0x0002
329#define KSZ8895_BMCR_LED_DIS 0x0001
332#define KSZ8895_BMSR_100BT4 0x8000
333#define KSZ8895_BMSR_100BTX_FD 0x4000
334#define KSZ8895_BMSR_100BTX_HD 0x2000
335#define KSZ8895_BMSR_10BT_FD 0x1000
336#define KSZ8895_BMSR_10BT_HD 0x0800
337#define KSZ8895_BMSR_PREAMBLE_SUPPR 0x0040
338#define KSZ8895_BMSR_AN_COMPLETE 0x0020
339#define KSZ8895_BMSR_FAR_END_FAULT 0x0010
340#define KSZ8895_BMSR_AN_CAPABLE 0x0008
341#define KSZ8895_BMSR_LINK_STATUS 0x0004
342#define KSZ8895_BMSR_JABBER_TEST 0x0002
343#define KSZ8895_BMSR_EXTENDED_CAPABLE 0x0001
346#define KSZ8895_PHYID1_DEFAULT 0x0022
349#define KSZ8895_PHYID2_DEFAULT 0x1450
352#define KSZ8895_ANAR_NEXT_PAGE 0x8000
353#define KSZ8895_ANAR_REMOTE_FAULT 0x2000
354#define KSZ8895_ANAR_PAUSE 0x0400
355#define KSZ8895_ANAR_100BTX_FD 0x0100
356#define KSZ8895_ANAR_100BTX_HD 0x0080
357#define KSZ8895_ANAR_10BT_FD 0x0040
358#define KSZ8895_ANAR_10BT_HD 0x0020
359#define KSZ8895_ANAR_SELECTOR 0x001F
360#define KSZ8895_ANAR_SELECTOR_DEFAULT 0x0001
363#define KSZ8895_ANLPAR_NEXT_PAGE 0x8000
364#define KSZ8895_ANLPAR_LP_ACK 0x4000
365#define KSZ8895_ANLPAR_REMOTE_FAULT 0x2000
366#define KSZ8895_ANLPAR_PAUSE 0x0400
367#define KSZ8895_ANLPAR_100BTX_FD 0x0100
368#define KSZ8895_ANLPAR_100BTX_HD 0x0080
369#define KSZ8895_ANLPAR_10BT_FD 0x0040
370#define KSZ8895_ANLPAR_10BT_HD 0x0020
373#define KSZ8895_LINKMD_TEST_EN 0x8000
374#define KSZ8895_LINKMD_RESULT 0x6000
375#define KSZ8895_LINKMD_SHORT 0x1000
376#define KSZ8895_LINKMD_FAULT_COUNT 0x01FF
379#define KSZ8895_PHYSCS_OP_MODE 0x0700
380#define KSZ8895_PHYSCS_OP_MODE_AN 0x0100
381#define KSZ8895_PHYSCS_OP_MODE_10BT_HD 0x0200
382#define KSZ8895_PHYSCS_OP_MODE_100BTX_HD 0x0300
383#define KSZ8895_PHYSCS_OP_MODE_10BT_FD 0x0500
384#define KSZ8895_PHYSCS_OP_MODE_100BTX_FD 0x0600
385#define KSZ8895_PHYSCS_OP_MODE_ISOLATE 0x0700
386#define KSZ8895_PHYSCS_POLRVS 0x0020
387#define KSZ8895_PHYSCS_MDIX_STATUS 0x0010
388#define KSZ8895_PHYSCS_FORCE_LINK 0x0008
389#define KSZ8895_PHYSCS_PWRSAVE 0x0004
390#define KSZ8895_PHYSCS_REMOTE_LOOPBACK 0x0002
393#define KSZ8895_CHIP_ID0_FAMILY_ID 0xFF
394#define KSZ8895_CHIP_ID0_FAMILY_ID_DEFAULT 0x95
397#define KSZ8895_CHIP_ID1_CHIP_ID 0xF0
398#define KSZ8895_CHIP_ID1_CHIP_ID_MQX_FQX_MLX 0x40
399#define KSZ8895_CHIP_ID1_CHIP_ID_RQX 0x60
400#define KSZ8895_CHIP_ID1_REVISION_ID 0x0E
401#define KSZ8895_CHIP_ID1_START_SWITCH 0x01
404#define KSZ8895_GLOBAL_CTRL0_NEW_BACK_OFF_EN 0x80
405#define KSZ8895_GLOBAL_CTRL0_FLUSH_DYNAMIC_MAC_TABLE 0x20
406#define KSZ8895_GLOBAL_CTRL0_FLUSH_STATIC_MAC_TABLE 0x10
407#define KSZ8895_GLOBAL_CTRL0_PHY_MII_RMII_EN 0x08
408#define KSZ8895_GLOBAL_CTRL0_UNH_MODE 0x02
409#define KSZ8895_GLOBAL_CTRL0_LINK_CHANGE_AGE 0x01
412#define KSZ8895_GLOBAL_CTRL1_PASS_ALL_FRAMES 0x80
413#define KSZ8895_GLOBAL_CTRL1_2KB_PKT_SUPPORT 0x40
414#define KSZ8895_GLOBAL_CTRL1_TX_FLOW_CTRL_DIS 0x20
415#define KSZ8895_GLOBAL_CTRL1_RX_FLOW_CTRL_DIS 0x10
416#define KSZ8895_GLOBAL_CTRL1_FRAME_LEN_CHECK_EN 0x08
417#define KSZ8895_GLOBAL_CTRL1_AGING_EN 0x04
418#define KSZ8895_GLOBAL_CTRL1_FAST_AGE_EN 0x02
419#define KSZ8895_GLOBAL_CTRL1_AGGRESSIVE_BACK_OFF_EN 0x01
422#define KSZ8895_GLOBAL_CTRL2_UNI_VLAN_MISMATCH_DISCARD 0x80
423#define KSZ8895_GLOBAL_CTRL2_MCAST_STORM_PROTECT_DIS 0x40
424#define KSZ8895_GLOBAL_CTRL2_BACK_PRESSURE_MODE 0x20
425#define KSZ8895_GLOBAL_CTRL2_FLOW_CTRL_FAIR_MODE 0x10
426#define KSZ8895_GLOBAL_CTRL2_NO_EXCESSIVE_COL_DROP 0x08
427#define KSZ8895_GLOBAL_CTRL2_HUGE_PKT_SUPPORT 0x04
428#define KSZ8895_GLOBAL_CTRL2_MAX_PKT_SIZE_CHECK_DIS 0x02
431#define KSZ8895_GLOBAL_CTRL3_VLAN_EN 0x80
432#define KSZ8895_GLOBAL_CTRL3_SW5_IGMP_SNOOP_EN 0x40
433#define KSZ8895_GLOBAL_CTRL3_SW5_DIRECT_MODE_EN 0x20
434#define KSZ8895_GLOBAL_CTRL3_SW5_PRE_TAG_EN 0x10
435#define KSZ8895_GLOBAL_CTRL3_TAG_MASK_EN 0x02
436#define KSZ8895_GLOBAL_CTRL3_SNIFF_MODE_SEL 0x01
439#define KSZ8895_GLOBAL_CTRL4_SW5_BACK_PRESSURE_EN 0x80
440#define KSZ8895_GLOBAL_CTRL4_SW5_HALF_DUPLEX_MODE 0x40
441#define KSZ8895_GLOBAL_CTRL4_SW5_FLOW_CTRL_EN 0x20
442#define KSZ8895_GLOBAL_CTRL4_SW5_SPEED 0x10
443#define KSZ8895_GLOBAL_CTRL4_NULL_VID_REPLACEMENT 0x08
444#define KSZ8895_GLOBAL_CTRL4_BCAST_STORM_PROTECT_RATE_MSB 0x07
447#define KSZ8895_GLOBAL_CTRL5_BCAST_STORM_PROTECT_RATE_LSB 0xFF
450#define KSZ8895_GLOBAL_CTRL6_FACTORY_TESTING 0xFF
453#define KSZ8895_GLOBAL_CTRL7_FACTORY_TESTING 0xFF
456#define KSZ8895_GLOBAL_CTRL8_FACTORY_TESTING 0xFF
459#define KSZ8895_GLOBAL_CTRL9_SW5_REFCLK_EDGE_SEL 0x40
460#define KSZ8895_GLOBAL_CTRL9_SW5_REFCLK_EDGE_SEL_RISING 0x00
461#define KSZ8895_GLOBAL_CTRL9_SW5_REFCLK_EDGE_SEL_FALLING 0x40
462#define KSZ8895_GLOBAL_CTRL9_PHY_PWR_SAVE 0x08
463#define KSZ8895_GLOBAL_CTRL9_LED_MODE 0x02
464#define KSZ8895_GLOBAL_CTRL9_SPI_READ_CLK_EDGE_SEL 0x01
465#define KSZ8895_GLOBAL_CTRL9_SPI_READ_CLK_EDGE_SEL_FALLING 0x00
466#define KSZ8895_GLOBAL_CTRL9_SPI_READ_CLK_EDGE_SEL_RISING 0x01
469#define KSZ8895_GLOBAL_CTRL10_CLK_MODE 0x40
470#define KSZ8895_GLOBAL_CTRL10_CPU_CLK_SEL 0x30
471#define KSZ8895_GLOBAL_CTRL10_RESTORE_PREAMBLE_EN 0x04
472#define KSZ8895_GLOBAL_CTRL10_TAIL_TAG_EN 0x02
473#define KSZ8895_GLOBAL_CTRL10_PASS_FLOW_CTRL_PKT 0x01
476#define KSZ8895_GLOBAL_CTRL11_FACTORY_TESTING 0xFF
479#define KSZ8895_PD_MGMT_CTRL1_PLL_PWR_DOWN 0x20
480#define KSZ8895_PD_MGMT_CTRL1_PWR_MGMT_MODE 0x18
481#define KSZ8895_PD_MGMT_CTRL1_PWR_MGMT_MODE_NORMAL 0x00
482#define KSZ8895_PD_MGMT_CTRL1_PWR_MGMT_MODE_ENERGY_DETECT 0x08
483#define KSZ8895_PD_MGMT_CTRL1_PWR_MGMT_MODE_SOFT_PWR_DOWN 0x10
484#define KSZ8895_PD_MGMT_CTRL1_PWR_MGMT_MODE_PWR_SAVING 0x18
487#define KSZ8895_PD_MGMT_CTRL2_GO_SLEEP_TIME 0xFF
490#define KSZ8895_PORTn_CTRL0_BCAST_STORM_PROTECT_EN 0x80
491#define KSZ8895_PORTn_CTRL0_DIFFSERV_PRIO_CLASS_EN 0x40
492#define KSZ8895_PORTn_CTRL0_802_1P_PRIO_CLASS_EN 0x20
493#define KSZ8895_PORTn_CTRL0_PORT_PRIO_CLASS_EN 0x18
494#define KSZ8895_PORTn_CTRL0_TAG_INSERTION 0x04
495#define KSZ8895_PORTn_CTRL0_TAG_REMOVAL 0x02
496#define KSZ8895_PORTn_CTRL0_TWO_QUEUE_SPLIT_EN 0x01
499#define KSZ8895_PORTn_CTRL1_SNIFFER_PORT 0x80
500#define KSZ8895_PORTn_CTRL1_RECEIVE_SNIFF 0x40
501#define KSZ8895_PORTn_CTRL1_TRANSMIT_SNIFF 0x20
502#define KSZ8895_PORTn_CTRL1_PORT_VLAN_MEMBERSHIP 0x1F
505#define KSZ8895_PORTn_CTRL2_USER_PRIO_CEILING 0x80
506#define KSZ8895_PORTn_CTRL2_INGRESS_VLAN_FILT 0x40
507#define KSZ8895_PORTn_CTRL2_DISCARD_NON_PVID_PKT 0x20
508#define KSZ8895_PORTn_CTRL2_FORCE_FLOW_CTRL 0x10
509#define KSZ8895_PORTn_CTRL2_BACK_PRESSURE_EN 0x08
510#define KSZ8895_PORTn_CTRL2_TRANSMIT_EN 0x04
511#define KSZ8895_PORTn_CTRL2_RECEIVE_EN 0x02
512#define KSZ8895_PORTn_CTRL2_LEARNING_DIS 0x01
515#define KSZ8895_PORTn_CTRL3_DEFAULT_USER_PRIO 0xE0
516#define KSZ8895_PORTn_CTRL3_DEFAULT_CFI 0x10
517#define KSZ8895_PORTn_CTRL3_DEFAULT_VID_MSB 0x0F
520#define KSZ8895_PORTn_CTRL4_DEFAULT_VID_LSB 0xFF
523#define KSZ8895_RMII_MGMT_CTRL_SW5_CLK_OUT_DIS 0x08
524#define KSZ8895_RMII_MGMT_CTRL_P5_CLK_OUT_DIS 0x04
527#define KSZ8895_PORTn_STAT0_HP_MDIX 0x80
528#define KSZ8895_PORTn_STAT0_POLRVS 0x20
529#define KSZ8895_PORTn_STAT0_TX_FLOW_CTRL_EN 0x10
530#define KSZ8895_PORTn_STAT0_RX_FLOW_CTRL_EN 0x08
531#define KSZ8895_PORTn_STAT0_OP_SPEED 0x04
532#define KSZ8895_PORTn_STAT0_OP_DUPLEX 0x02
535#define KSZ8895_PORTn_PSCS_VCT_10M_SHORT 0x80
536#define KSZ8895_PORTn_PSCS_VCT_RESULT 0x60
537#define KSZ8895_PORTn_PSCS_VCT_EN 0x10
538#define KSZ8895_PORTn_PSCS_FORCE_LNK 0x08
539#define KSZ8895_PORTn_PSCS_PWRSAVE 0x04
540#define KSZ8895_PORTn_PSCS_REMOTE_LOOPBACK 0x02
541#define KSZ8895_PORTn_PSCS_VCT_FAULT_COUNT_MSB 0x01
544#define KSZ8895_PORTn_LINKMD_VCT_FAULT_COUNT_LSB 0xFF
547#define KSZ8895_PORTn_CTRL5_AN_DIS 0x80
548#define KSZ8895_PORTn_CTRL5_FORCED_SPEED 0x40
549#define KSZ8895_PORTn_CTRL5_FORCED_DUPLEX 0x20
550#define KSZ8895_PORTn_CTRL5_ADV_FLOW_CTRL 0x10
551#define KSZ8895_PORTn_CTRL5_ADV_100BT_FD 0x08
552#define KSZ8895_PORTn_CTRL5_ADV_100BT_HD 0x04
553#define KSZ8895_PORTn_CTRL5_ADV_10BT_FD 0x02
554#define KSZ8895_PORTn_CTRL5_ADV_10BT_HD 0x01
557#define KSZ8895_PORTn_CTRL6_LED_OFF 0x80
558#define KSZ8895_PORTn_CTRL6_TX_DIS 0x40
559#define KSZ8895_PORTn_CTRL6_RESTART_AN 0x20
560#define KSZ8895_PORTn_CTRL6_FAR_END_FAULT_DIS 0x10
561#define KSZ8895_PORTn_CTRL6_POWER_DOWN 0x08
562#define KSZ8895_PORTn_CTRL6_AUTO_MDIX_DIS 0x04
563#define KSZ8895_PORTn_CTRL6_FORCED_MDI 0x02
564#define KSZ8895_PORTn_CTRL6_MAC_LOOPBACK 0x01
567#define KSZ8895_PORTn_STAT1_MDIX_STATUS 0x80
568#define KSZ8895_PORTn_STAT1_AN_DONE 0x40
569#define KSZ8895_PORTn_STAT1_LINK_GOOD 0x20
570#define KSZ8895_PORTn_STAT1_LP_FLOW_CTRL_CAPABLE 0x10
571#define KSZ8895_PORTn_STAT1_LP_100BTX_FD_CAPABLE 0x08
572#define KSZ8895_PORTn_STAT1_LP_100BTX_HF_CAPABLE 0x04
573#define KSZ8895_PORTn_STAT1_LP_10BT_FD_CAPABLE 0x02
574#define KSZ8895_PORTn_STAT1_LP_10BT_HD_CAPABLE 0x01
577#define KSZ8895_PORTn_CTRL7_STAT2_PHY_LOOPBACK 0x80
578#define KSZ8895_PORTn_CTRL7_STAT2_PHY_ISOLATE 0x20
579#define KSZ8895_PORTn_CTRL7_STAT2_SOFT_RESET 0x10
580#define KSZ8895_PORTn_CTRL7_STAT2_FORCE_LINK 0x08
581#define KSZ8895_PORTn_CTRL7_STAT2_OP_MODE 0x07
582#define KSZ8895_PORTn_CTRL7_STAT2_OP_MODE_AN 0x01
583#define KSZ8895_PORTn_CTRL7_STAT2_OP_MODE_10BT_HD 0x02
584#define KSZ8895_PORTn_CTRL7_STAT2_OP_MODE_100BTX_HD 0x03
585#define KSZ8895_PORTn_CTRL7_STAT2_OP_MODE_10BT_FD 0x05
586#define KSZ8895_PORTn_CTRL7_STAT2_OP_MODE_100BTX_FD 0x06
589#define KSZ8895_INDIRECT_CTRL0_WRITE 0x00
590#define KSZ8895_INDIRECT_CTRL0_READ 0x10
591#define KSZ8895_INDIRECT_CTRL0_TABLE_SEL 0x0C
592#define KSZ8895_INDIRECT_CTRL0_TABLE_SEL_STATIC_MAC 0x00
593#define KSZ8895_INDIRECT_CTRL0_TABLE_SEL_VLAN 0x04
594#define KSZ8895_INDIRECT_CTRL0_TABLE_SEL_DYNAMIC_MAC 0x08
595#define KSZ8895_INDIRECT_CTRL0_TABLE_SEL_MIB_COUNTER 0x0C
596#define KSZ8895_INDIRECT_CTRL0_ADDR_H 0x03
599#define KSZ8895_INDIRECT_CTRL1_ADDR_L 0xFF
602#define KSZ8895_INT_STAT_PORT5 0x10
603#define KSZ8895_INT_STAT_PORT4 0x08
604#define KSZ8895_INT_STAT_PORT3 0x04
605#define KSZ8895_INT_STAT_PORT2 0x02
606#define KSZ8895_INT_STAT_PORT1 0x01
609#define KSZ8895_INT_MASK_PORT5 0x10
610#define KSZ8895_INT_MASK_PORT4 0x08
611#define KSZ8895_INT_MASK_PORT3 0x04
612#define KSZ8895_INT_MASK_PORT2 0x02
613#define KSZ8895_INT_MASK_PORT1 0x01
616#define KSZ8895_GLOBAL_CTRL12_TAG3 0xC0
617#define KSZ8895_GLOBAL_CTRL12_TAG2 0x30
618#define KSZ8895_GLOBAL_CTRL12_TAG1 0x0C
619#define KSZ8895_GLOBAL_CTRL12_TAG0 0x03
622#define KSZ8895_GLOBAL_CTRL13_TAG7 0xC0
623#define KSZ8895_GLOBAL_CTRL13_TAG6 0x30
624#define KSZ8895_GLOBAL_CTRL13_TAG5 0x0C
625#define KSZ8895_GLOBAL_CTRL13_TAG4 0x03
628#define KSZ8895_GLOBAL_CTRL14_PRI_2Q 0xC0
631#define KSZ8895_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD 0x20
632#define KSZ8895_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP 0x1F
633#define KSZ8895_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_FILT 0x00
634#define KSZ8895_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_PORT1 0x01
635#define KSZ8895_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_PORT2 0x02
636#define KSZ8895_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_PORT3 0x04
637#define KSZ8895_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_PORT4 0x08
638#define KSZ8895_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_PORT5 0x10
639#define KSZ8895_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_ALL 0x1F
642#define KSZ8895_GLOBAL_CTRL16_CHIP_OUT_DRIVE_STRENGTH 0xC0
643#define KSZ8895_GLOBAL_CTRL16_CHIP_OUT_DRIVE_STRENGTH_4MA 0x00
644#define KSZ8895_GLOBAL_CTRL16_CHIP_OUT_DRIVE_STRENGTH_8MA 0x40
645#define KSZ8895_GLOBAL_CTRL16_CHIP_OUT_DRIVE_STRENGTH_10MA 0x80
646#define KSZ8895_GLOBAL_CTRL16_CHIP_OUT_DRIVE_STRENGTH_14MA 0xC0
647#define KSZ8895_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD 0x20
648#define KSZ8895_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP 0x1F
649#define KSZ8895_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_FILT 0x00
650#define KSZ8895_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT1 0x01
651#define KSZ8895_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT2 0x02
652#define KSZ8895_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT3 0x04
653#define KSZ8895_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT4 0x08
654#define KSZ8895_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT5 0x10
655#define KSZ8895_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_ALL 0x1F
658#define KSZ8895_GLOBAL_CTRL17_UNKNOWN_VID_FWD 0x20
659#define KSZ8895_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP 0x1F
660#define KSZ8895_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_FILT 0x00
661#define KSZ8895_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_PORT1 0x01
662#define KSZ8895_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_PORT2 0x02
663#define KSZ8895_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_PORT3 0x04
664#define KSZ8895_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_PORT4 0x08
665#define KSZ8895_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_PORT5 0x10
666#define KSZ8895_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_ALL 0x1F
669#define KSZ8895_GLOBAL_CTRL18_SELF_ADDR_FILTER_EN 0x40
670#define KSZ8895_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD 0x20
671#define KSZ8895_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP 0x1F
672#define KSZ8895_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_FILT 0x00
673#define KSZ8895_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_PORT1 0x01
674#define KSZ8895_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_PORT2 0x02
675#define KSZ8895_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_PORT3 0x04
676#define KSZ8895_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_PORT4 0x08
677#define KSZ8895_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_PORT5 0x10
678#define KSZ8895_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_ALL 0x1F
681#define KSZ8895_GLOBAL_CTRL19_IG_RATE_LIMIT_PERIOD 0x30
682#define KSZ8895_GLOBAL_CTRL19_IG_RATE_LIMIT_PERIOD_16MS 0x00
683#define KSZ8895_GLOBAL_CTRL19_IG_RATE_LIMIT_PERIOD_64MS 0x10
684#define KSZ8895_GLOBAL_CTRL19_IG_RATE_LIMIT_PERIOD_256MS 0x20
685#define KSZ8895_GLOBAL_CTRL19_QUEUE_BASED_EG_RATE_LIMITE_EN 0x08
686#define KSZ8895_GLOBAL_CTRL19_INSERT_SRC_PORT_PVID_TAG_EN 0x04
689#define KSZ8895_ID_REVISION_ID 0xF0
690#define KSZ8895_ID_REVISION_ID_MQX_RQX_FQX_REV_A2 0x40
691#define KSZ8895_ID_REVISION_ID_ML_REV_B2 0x40
692#define KSZ8895_ID_REVISION_ID_MQX_RQX_FQX_REV_A3 0x50
693#define KSZ8895_ID_REVISION_ID_ML_REV_B3 0x50
694#define KSZ8895_ID_REVISION_ID_MQX_RQX_FQX_REV_A4 0x60
697#define KSZ8895_PORTn_CTRL9_FOUR_QUEUE_SPLIT_EN 0x02
698#define KSZ8895_PORTn_CTRL9_DROPPING_TAG_EN 0x01
701#define KSZ8895_PORTn_CTRL10_PORT_TX_QUEUE3_RATIO_EN 0x80
702#define KSZ8895_PORTn_CTRL10_PORT_TX_QUEUE3_RATIO 0x7F
705#define KSZ8895_PORTn_CTRL11_PORT_TX_QUEUE2_RATIO_EN 0x80
706#define KSZ8895_PORTn_CTRL11_PORT_TX_QUEUE2_RATIO 0x7F
709#define KSZ8895_PORTn_CTRL12_PORT_TX_QUEUE1_RATIO_EN 0x80
710#define KSZ8895_PORTn_CTRL12_PORT_TX_QUEUE1_RATIO 0x7F
713#define KSZ8895_PORTn_CTRL13_PORT_TX_QUEUE0_RATIO_EN 0x80
714#define KSZ8895_PORTn_CTRL13_PORT_TX_QUEUE0_RATIO 0x7F
717#define KSZ8895_PORTn_RATE_LIMIT_CTRL_LIMIT_EN 0x10
718#define KSZ8895_PORTn_RATE_LIMIT_CTRL_LIMIT_MODE 0x0C
719#define KSZ8895_PORTn_RATE_LIMIT_CTRL_COUNT_IFG 0x02
720#define KSZ8895_PORTn_RATE_LIMIT_CTRL_COUNT_PRE 0x01
723#define KSZ8895_PORT3_COPPER_FIBER_CTRL_FIBER_SEL 0x80
726#define KSZ8895_TEST3_SW5_RMII_INV_SMTXC 0x40
727#define KSZ8895_TEST3_SW5_RMII_INV_SMRXC 0x10
735#if defined(__CWCC__) || defined(_WIN32)
736 #pragma pack(push, 1)
746#if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
749 uint8_t reserved : 1;
750 uint8_t override : 1;
752 uint8_t forwardPorts : 5;
756 uint8_t forwardPorts : 5;
758 uint8_t override : 1;
759 uint8_t reserved : 1;
772#if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
774 uint8_t override : 1;
776 uint8_t forwardPorts : 5;
778 uint8_t forwardPorts : 5;
780 uint8_t override : 1;
793#if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
794 uint8_t macEmpty : 1;
795 uint8_t numValidEntriesH : 7;
796 uint8_t numValidEntriesL : 3;
797 uint8_t timestamp : 2;
798 uint8_t sourcePort : 3;
799 uint8_t dataNotReady : 1;
802 uint8_t numValidEntriesH : 7;
803 uint8_t macEmpty : 1;
804 uint8_t sourcePort : 3;
805 uint8_t timestamp : 2;
806 uint8_t numValidEntriesL : 3;
808 uint8_t dataNotReady : 1;
815#if defined(__CWCC__) || defined(_WIN32)
823error_t ksz8895Init(NetInterface *interface);
824void ksz8895InitHook(NetInterface *interface);
826void ksz8895Tick(NetInterface *interface);
828void ksz8895EnableIrq(NetInterface *interface);
829void ksz8895DisableIrq(NetInterface *interface);
831void ksz8895EventHandler(NetInterface *interface);
834 size_t *offset, NetTxAncillary *ancillary);
836error_t ksz8895UntagFrame(NetInterface *interface, uint8_t **frame,
837 size_t *length, NetRxAncillary *ancillary);
839bool_t ksz8895GetLinkState(NetInterface *interface, uint8_t port);
840uint32_t ksz8895GetLinkSpeed(NetInterface *interface, uint8_t port);
841NicDuplexMode ksz8895GetDuplexMode(NetInterface *interface, uint8_t port);
843void ksz8895SetPortState(NetInterface *interface, uint8_t port,
846SwitchPortState ksz8895GetPortState(NetInterface *interface, uint8_t port);
848void ksz8895SetAgingTime(NetInterface *interface, uint32_t agingTime);
850void ksz8895EnableIgmpSnooping(NetInterface *interface, bool_t enable);
851void ksz8895EnableMldSnooping(NetInterface *interface, bool_t enable);
852void ksz8895EnableRsvdMcastTable(NetInterface *interface, bool_t enable);
854error_t ksz8895AddStaticFdbEntry(NetInterface *interface,
857error_t ksz8895DeleteStaticFdbEntry(NetInterface *interface,
860error_t ksz8895GetStaticFdbEntry(NetInterface *interface, uint_t index,
863void ksz8895FlushStaticFdbTable(NetInterface *interface);
865error_t ksz8895GetDynamicFdbEntry(NetInterface *interface, uint_t index,
868void ksz8895FlushDynamicFdbTable(NetInterface *interface, uint8_t port);
870void ksz8895SetUnknownMcastFwdPorts(NetInterface *interface,
871 bool_t enable, uint32_t forwardPorts);
873void ksz8895WritePhyReg(NetInterface *interface, uint8_t port,
874 uint8_t address, uint16_t data);
876uint16_t ksz8895ReadPhyReg(NetInterface *interface, uint8_t port,
879void ksz8895DumpPhyReg(NetInterface *interface, uint8_t port);
881void ksz8895WriteSwitchReg(NetInterface *interface, uint8_t address,
884uint8_t ksz8895ReadSwitchReg(NetInterface *interface, uint8_t address);
886void ksz8895DumpSwitchReg(NetInterface *interface);
error_t
Error codes.
Definition error.h:43
Network interface controller abstraction layer.
NicDuplexMode
Duplex mode.
Definition nic.h:122
SwitchPortState
Switch port state.
Definition nic.h:134
Dynamic MAC table entry.
Definition ksz8895_driver.h:792
Static MAC table entry (read operation)
Definition ksz8895_driver.h:745
Static MAC table entry (write operation)
Definition ksz8895_driver.h:770
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89
Ethernet switch driver.
Definition nic.h:322
Forwarding database entry.
Definition nic.h:149