31#ifndef _KSZ9896_DRIVER_H
32#define _KSZ9896_DRIVER_H
38#define KSZ9896_PORT1 1
39#define KSZ9896_PORT2 2
40#define KSZ9896_PORT3 3
41#define KSZ9896_PORT4 4
42#define KSZ9896_PORT5 5
43#define KSZ9896_PORT6 6
46#define KSZ9896_PORT_MASK 0x3F
47#define KSZ9896_PORT1_MASK 0x01
48#define KSZ9896_PORT2_MASK 0x02
49#define KSZ9896_PORT3_MASK 0x04
50#define KSZ9896_PORT4_MASK 0x08
51#define KSZ9896_PORT5_MASK 0x10
52#define KSZ9896_PORT6_MASK 0x20
55#define KSZ9896_SPI_CMD_WRITE 0x40000000
56#define KSZ9896_SPI_CMD_READ 0x60000000
57#define KSZ9896_SPI_CMD_ADDR 0x001FFFE0
60#define KSZ9896_STATIC_MAC_TABLE_SIZE 16
61#define KSZ9896_DYNAMIC_MAC_TABLE_SIZE 4096
64#define KSZ9896_TAIL_TAG_NORMAL_ADDR_LOOKUP 0x0400
65#define KSZ9896_TAIL_TAG_PORT_BLOCKING_OVERRIDE 0x0200
66#define KSZ9896_TAIL_TAG_PRIORITY 0x0180
67#define KSZ9896_TAIL_TAG_DEST_PORT6 0x0020
68#define KSZ9896_TAIL_TAG_DEST_PORT5 0x0010
69#define KSZ9896_TAIL_TAG_DEST_PORT4 0x0008
70#define KSZ9896_TAIL_TAG_DEST_PORT3 0x0004
71#define KSZ9896_TAIL_TAG_DEST_PORT2 0x0002
72#define KSZ9896_TAIL_TAG_DEST_PORT1 0x0001
75#define KSZ9896_TAIL_TAG_PTP_MSG 0x80
76#define KSZ9896_TAIL_TAG_SRC_PORT 0x07
79#define KSZ9896_BMCR 0x00
80#define KSZ9896_BMSR 0x01
81#define KSZ9896_PHYID1 0x02
82#define KSZ9896_PHYID2 0x03
83#define KSZ9896_ANAR 0x04
84#define KSZ9896_ANLPAR 0x05
85#define KSZ9896_ANER 0x06
86#define KSZ9896_ANNPR 0x07
87#define KSZ9896_ANLPNPR 0x08
88#define KSZ9896_GBCR 0x09
89#define KSZ9896_GBSR 0x0A
90#define KSZ9896_MMDACR 0x0D
91#define KSZ9896_MMDAADR 0x0E
92#define KSZ9896_GBESR 0x0F
93#define KSZ9896_RLB 0x11
94#define KSZ9896_LINKMD 0x12
95#define KSZ9896_DPMAPCSS 0x13
96#define KSZ9896_RXERCTR 0x15
97#define KSZ9896_ICSR 0x1B
98#define KSZ9896_AUTOMDI 0x1C
99#define KSZ9896_PHYCON 0x1F
102#define KSZ9896_MMD_LED_MODE 0x02, 0x00
103#define KSZ9896_MMD_EEE_ADV 0x07, 0x3C
106#define KSZ9896_CHIP_ID0 0x0000
107#define KSZ9896_CHIP_ID1 0x0001
108#define KSZ9896_CHIP_ID2 0x0002
109#define KSZ9896_CHIP_ID3 0x0003
110#define KSZ9896_PME_PIN_CTRL 0x0006
111#define KSZ9896_GLOBAL_INT_STAT 0x0010
112#define KSZ9896_GLOBAL_INT_MASK 0x0014
113#define KSZ9896_GLOBAL_PORT_INT_STAT 0x0018
114#define KSZ9896_GLOBAL_PORT_INT_MASK 0x001C
115#define KSZ9896_SERIAL_IO_CTRL 0x0100
116#define KSZ9896_OUT_CLK_CTRL 0x0103
117#define KSZ9896_IBA_CTRL 0x0104
118#define KSZ9896_IO_DRIVE_STRENGTH 0x010D
119#define KSZ9896_IBA_OP_STAT1 0x0110
120#define KSZ9896_LED_OVERRIDE 0x0120
121#define KSZ9896_LED_OUTPUT 0x0124
122#define KSZ9896_PWR_DOWN_CTRL0 0x0201
123#define KSZ9896_LED_STRAP_IN 0x0210
124#define KSZ9896_SWITCH_OP 0x0300
125#define KSZ9896_SWITCH_MAC_ADDR0 0x0302
126#define KSZ9896_SWITCH_MAC_ADDR1 0x0303
127#define KSZ9896_SWITCH_MAC_ADDR2 0x0304
128#define KSZ9896_SWITCH_MAC_ADDR3 0x0305
129#define KSZ9896_SWITCH_MAC_ADDR4 0x0306
130#define KSZ9896_SWITCH_MAC_ADDR5 0x0307
131#define KSZ9896_SWITCH_MTU 0x0308
132#define KSZ9896_SWITCH_ISP_TPID 0x030A
133#define KSZ9896_SWITCH_LUE_CTRL0 0x0310
134#define KSZ9896_SWITCH_LUE_CTRL1 0x0311
135#define KSZ9896_SWITCH_LUE_CTRL2 0x0312
136#define KSZ9896_SWITCH_LUE_CTRL3 0x0313
137#define KSZ9896_ALU_TABLE_INT 0x0314
138#define KSZ9896_ALU_TABLE_MASK 0x0315
139#define KSZ9896_ALU_TABLE_ENTRY_INDEX0 0x0316
140#define KSZ9896_ALU_TABLE_ENTRY_INDEX1 0x0318
141#define KSZ9896_ALU_TABLE_ENTRY_INDEX2 0x031A
142#define KSZ9896_UNKNOWN_UNICAST_CTRL 0x0320
143#define KSZ9896_UNKONWN_MULTICAST_CTRL 0x0324
144#define KSZ9896_UNKNOWN_VLAN_ID_CTRL 0x0328
145#define KSZ9896_SWITCH_MAC_CTRL0 0x0330
146#define KSZ9896_SWITCH_MAC_CTRL1 0x0331
147#define KSZ9896_SWITCH_MAC_CTRL2 0x0332
148#define KSZ9896_SWITCH_MAC_CTRL3 0x0333
149#define KSZ9896_SWITCH_MAC_CTRL4 0x0334
150#define KSZ9896_SWITCH_MAC_CTRL5 0x0335
151#define KSZ9896_SWITCH_MIB_CTRL 0x0336
152#define KSZ9896_802_1P_PRIO_MAPPING0 0x0338
153#define KSZ9896_802_1P_PRIO_MAPPING1 0x0339
154#define KSZ9896_802_1P_PRIO_MAPPING2 0x033A
155#define KSZ9896_802_1P_PRIO_MAPPING3 0x033B
156#define KSZ9896_IP_DIFFSERV_PRIO_EN 0x033E
157#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING0 0x0340
158#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING1 0x0341
159#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING2 0x0342
160#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING3 0x0343
161#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING4 0x0344
162#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING5 0x0345
163#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING6 0x0346
164#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING7 0x0347
165#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING8 0x0348
166#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING9 0x0349
167#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING10 0x034A
168#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING11 0x034B
169#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING12 0x034C
170#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING13 0x034D
171#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING14 0x034E
172#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING15 0x034F
173#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING16 0x0350
174#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING17 0x0351
175#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING18 0x0352
176#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING19 0x0353
177#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING20 0x0354
178#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING21 0x0355
179#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING22 0x0356
180#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING23 0x0357
181#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING24 0x0358
182#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING25 0x0359
183#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING26 0x035A
184#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING27 0x035B
185#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING28 0x035C
186#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING29 0x035D
187#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING30 0x035E
188#define KSZ9896_IP_DIFFSERV_PRIO_MAPPING31 0x035F
189#define KSZ9896_GLOBAL_PORT_MIRROR_SNOOP_CTRL 0x0370
190#define KSZ9896_WRED_DIFFSERV_COLOR_MAPPING 0x0378
191#define KSZ9896_QUEUE_MGMT_CTRL0 0x0390
192#define KSZ9896_VLAN_TABLE_ENTRY0 0x0400
193#define KSZ9896_VLAN_TABLE_ENTRY1 0x0404
194#define KSZ9896_VLAN_TABLE_ENTRY2 0x0408
195#define KSZ9896_VLAN_TABLE_INDEX 0x040C
196#define KSZ9896_VLAN_TABLE_ACCESS_CTRL 0x040E
197#define KSZ9896_ALU_TABLE_INDEX0 0x0410
198#define KSZ9896_ALU_TABLE_INDEX1 0x0414
199#define KSZ9896_ALU_TABLE_CTRL 0x0418
200#define KSZ9896_STATIC_RES_MCAST_TABLE_CTRL 0x041C
201#define KSZ9896_ALU_TABLE_ENTRY1 0x0420
202#define KSZ9896_STATIC_TABLE_ENTRY1 0x0420
203#define KSZ9896_ALU_TABLE_ENTRY2 0x0424
204#define KSZ9896_STATIC_TABLE_ENTRY2 0x0424
205#define KSZ9896_RES_MCAST_TABLE_ENTRY2 0x0424
206#define KSZ9896_ALU_TABLE_ENTRY3 0x0428
207#define KSZ9896_STATIC_TABLE_ENTRY3 0x0428
208#define KSZ9896_ALU_TABLE_ENTRY4 0x042C
209#define KSZ9896_STATIC_TABLE_ENTRY4 0x042C
210#define KSZ9896_PORT1_DEFAULT_TAG0 0x1000
211#define KSZ9896_PORT1_DEFAULT_TAG1 0x1001
212#define KSZ9896_PORT1_PME_WOL_EVENT 0x1013
213#define KSZ9896_PORT1_PME_WOL_EN 0x1017
214#define KSZ9896_PORT1_INT_STATUS 0x101B
215#define KSZ9896_PORT1_INT_MASK 0x101F
216#define KSZ9896_PORT1_OP_CTRL0 0x1020
217#define KSZ9896_PORT1_STATUS 0x1030
218#define KSZ9896_PORT1_MAC_CTRL0 0x1400
219#define KSZ9896_PORT1_MAC_CTRL1 0x1401
220#define KSZ9896_PORT1_IG_RATE_LIMIT_CTRL 0x1403
221#define KSZ9896_PORT1_PRIO0_IG_LIMIT_CTRL 0x1410
222#define KSZ9896_PORT1_PRIO1_IG_LIMIT_CTRL 0x1411
223#define KSZ9896_PORT1_PRIO2_IG_LIMIT_CTRL 0x1412
224#define KSZ9896_PORT1_PRIO3_IG_LIMIT_CTRL 0x1413
225#define KSZ9896_PORT1_PRIO4_IG_LIMIT_CTRL 0x1414
226#define KSZ9896_PORT1_PRIO5_IG_LIMIT_CTRL 0x1415
227#define KSZ9896_PORT1_PRIO6_IG_LIMIT_CTRL 0x1416
228#define KSZ9896_PORT1_PRIO7_IG_LIMIT_CTRL 0x1417
229#define KSZ9896_PORT1_QUEUE0_EG_LIMIT_CTRL 0x1420
230#define KSZ9896_PORT1_QUEUE1_EG_LIMIT_CTRL 0x1421
231#define KSZ9896_PORT1_QUEUE2_EG_LIMIT_CTRL 0x1422
232#define KSZ9896_PORT1_QUEUE3_EG_LIMIT_CTRL 0x1423
233#define KSZ9896_PORT1_MIB_CTRL_STAT 0x1500
234#define KSZ9896_PORT1_MIB_DATA 0x1504
235#define KSZ9896_PORT1_ACL_ACCESS0 0x1600
236#define KSZ9896_PORT1_ACL_ACCESS1 0x1601
237#define KSZ9896_PORT1_ACL_ACCESS2 0x1602
238#define KSZ9896_PORT1_ACL_ACCESS3 0x1603
239#define KSZ9896_PORT1_ACL_ACCESS4 0x1604
240#define KSZ9896_PORT1_ACL_ACCESS5 0x1605
241#define KSZ9896_PORT1_ACL_ACCESS6 0x1606
242#define KSZ9896_PORT1_ACL_ACCESS7 0x1607
243#define KSZ9896_PORT1_ACL_ACCESS8 0x1608
244#define KSZ9896_PORT1_ACL_ACCESS9 0x1609
245#define KSZ9896_PORT1_ACL_ACCESS10 0x160A
246#define KSZ9896_PORT1_ACL_ACCESS11 0x160B
247#define KSZ9896_PORT1_ACL_ACCESS12 0x160C
248#define KSZ9896_PORT1_ACL_ACCESS13 0x160D
249#define KSZ9896_PORT1_ACL_ACCESS14 0x160E
250#define KSZ9896_PORT1_ACL_ACCESS15 0x160F
251#define KSZ9896_PORT1_ACL_BYTE_EN_MSB 0x1610
252#define KSZ9896_PORT1_ACL_BYTE_EN_LSB 0x1611
253#define KSZ9896_PORT1_ACL_ACCESS_CTRL0 0x1612
254#define KSZ9896_PORT1_MIRRORING_CTRL 0x1800
255#define KSZ9896_PORT1_PRIO_CTRL 0x1801
256#define KSZ9896_PORT1_IG_MAC_CTRL 0x1802
257#define KSZ9896_PORT1_AUTH_CTRL 0x1803
258#define KSZ9896_PORT1_PTR 0x1804
259#define KSZ9896_PORT1_PRIO_TO_QUEUE_MAPPING 0x1808
260#define KSZ9896_PORT1_POLICE_CTRL 0x180C
261#define KSZ9896_PORT1_POLICE_QUEUE_RATE 0x1820
262#define KSZ9896_PORT1_POLICE_QUEUE_BURST_SIZE 0x1824
263#define KSZ9896_PORT1_WRED_PKT_MEM_CTRL0 0x1830
264#define KSZ9896_PORT1_WRED_PKT_MEM_CTRL1 0x1834
265#define KSZ9896_PORT1_WRED_QUEUE_CTRL0 0x1840
266#define KSZ9896_PORT1_WRED_QUEUE_CTRL1 0x1844
267#define KSZ9896_PORT1_WRED_QUEUE_PERF_MON_CTRL 0x1848
268#define KSZ9896_PORT1_TX_QUEUE_INDEX 0x1900
269#define KSZ9896_PORT1_TX_QUEUE_PVID 0x1904
270#define KSZ9896_PORT1_TX_QUEUE_CTRL0 0x1914
271#define KSZ9896_PORT1_TX_QUEUE_CTRL1 0x1915
272#define KSZ9896_PORT1_CTRL0 0x1A00
273#define KSZ9896_PORT1_CTRL1 0x1A04
274#define KSZ9896_PORT1_CTRL2 0x1B00
275#define KSZ9896_PORT1_MSTP_PTR 0x1B01
276#define KSZ9896_PORT1_MSTP_STATE 0x1B04
277#define KSZ9896_PORT2_DEFAULT_TAG0 0x2000
278#define KSZ9896_PORT2_DEFAULT_TAG1 0x2001
279#define KSZ9896_PORT2_PME_WOL_EVENT 0x2013
280#define KSZ9896_PORT2_PME_WOL_EN 0x2017
281#define KSZ9896_PORT2_INT_STATUS 0x201B
282#define KSZ9896_PORT2_INT_MASK 0x201F
283#define KSZ9896_PORT2_OP_CTRL0 0x2020
284#define KSZ9896_PORT2_STATUS 0x2030
285#define KSZ9896_PORT2_MAC_CTRL0 0x2400
286#define KSZ9896_PORT2_MAC_CTRL1 0x2401
287#define KSZ9896_PORT2_IG_RATE_LIMIT_CTRL 0x2403
288#define KSZ9896_PORT2_PRIO0_IG_LIMIT_CTRL 0x2410
289#define KSZ9896_PORT2_PRIO1_IG_LIMIT_CTRL 0x2411
290#define KSZ9896_PORT2_PRIO2_IG_LIMIT_CTRL 0x2412
291#define KSZ9896_PORT2_PRIO3_IG_LIMIT_CTRL 0x2413
292#define KSZ9896_PORT2_PRIO4_IG_LIMIT_CTRL 0x2414
293#define KSZ9896_PORT2_PRIO5_IG_LIMIT_CTRL 0x2415
294#define KSZ9896_PORT2_PRIO6_IG_LIMIT_CTRL 0x2416
295#define KSZ9896_PORT2_PRIO7_IG_LIMIT_CTRL 0x2417
296#define KSZ9896_PORT2_QUEUE0_EG_LIMIT_CTRL 0x2420
297#define KSZ9896_PORT2_QUEUE1_EG_LIMIT_CTRL 0x2421
298#define KSZ9896_PORT2_QUEUE2_EG_LIMIT_CTRL 0x2422
299#define KSZ9896_PORT2_QUEUE3_EG_LIMIT_CTRL 0x2423
300#define KSZ9896_PORT2_MIB_CTRL_STAT 0x2500
301#define KSZ9896_PORT2_MIB_DATA 0x2504
302#define KSZ9896_PORT2_ACL_ACCESS0 0x2600
303#define KSZ9896_PORT2_ACL_ACCESS1 0x2601
304#define KSZ9896_PORT2_ACL_ACCESS2 0x2602
305#define KSZ9896_PORT2_ACL_ACCESS3 0x2603
306#define KSZ9896_PORT2_ACL_ACCESS4 0x2604
307#define KSZ9896_PORT2_ACL_ACCESS5 0x2605
308#define KSZ9896_PORT2_ACL_ACCESS6 0x2606
309#define KSZ9896_PORT2_ACL_ACCESS7 0x2607
310#define KSZ9896_PORT2_ACL_ACCESS8 0x2608
311#define KSZ9896_PORT2_ACL_ACCESS9 0x2609
312#define KSZ9896_PORT2_ACL_ACCESS10 0x260A
313#define KSZ9896_PORT2_ACL_ACCESS11 0x260B
314#define KSZ9896_PORT2_ACL_ACCESS12 0x260C
315#define KSZ9896_PORT2_ACL_ACCESS13 0x260D
316#define KSZ9896_PORT2_ACL_ACCESS14 0x260E
317#define KSZ9896_PORT2_ACL_ACCESS15 0x260F
318#define KSZ9896_PORT2_ACL_BYTE_EN_MSB 0x2610
319#define KSZ9896_PORT2_ACL_BYTE_EN_LSB 0x2611
320#define KSZ9896_PORT2_ACL_ACCESS_CTRL0 0x2612
321#define KSZ9896_PORT2_MIRRORING_CTRL 0x2800
322#define KSZ9896_PORT2_PRIO_CTRL 0x2801
323#define KSZ9896_PORT2_IG_MAC_CTRL 0x2802
324#define KSZ9896_PORT2_AUTH_CTRL 0x2803
325#define KSZ9896_PORT2_PTR 0x2804
326#define KSZ9896_PORT2_PRIO_TO_QUEUE_MAPPING 0x2808
327#define KSZ9896_PORT2_POLICE_CTRL 0x280C
328#define KSZ9896_PORT2_POLICE_QUEUE_RATE 0x2820
329#define KSZ9896_PORT2_POLICE_QUEUE_BURST_SIZE 0x2824
330#define KSZ9896_PORT2_WRED_PKT_MEM_CTRL0 0x2830
331#define KSZ9896_PORT2_WRED_PKT_MEM_CTRL1 0x2834
332#define KSZ9896_PORT2_WRED_QUEUE_CTRL0 0x2840
333#define KSZ9896_PORT2_WRED_QUEUE_CTRL1 0x2844
334#define KSZ9896_PORT2_WRED_QUEUE_PERF_MON_CTRL 0x2848
335#define KSZ9896_PORT2_TX_QUEUE_INDEX 0x2900
336#define KSZ9896_PORT2_TX_QUEUE_PVID 0x2904
337#define KSZ9896_PORT2_TX_QUEUE_CTRL0 0x2914
338#define KSZ9896_PORT2_TX_QUEUE_CTRL1 0x2915
339#define KSZ9896_PORT2_CTRL0 0x2A00
340#define KSZ9896_PORT2_CTRL1 0x2A04
341#define KSZ9896_PORT2_CTRL2 0x2B00
342#define KSZ9896_PORT2_MSTP_PTR 0x2B01
343#define KSZ9896_PORT2_MSTP_STATE 0x2B04
344#define KSZ9896_PORT3_DEFAULT_TAG0 0x3000
345#define KSZ9896_PORT3_DEFAULT_TAG1 0x3001
346#define KSZ9896_PORT3_PME_WOL_EVENT 0x3013
347#define KSZ9896_PORT3_PME_WOL_EN 0x3017
348#define KSZ9896_PORT3_INT_STATUS 0x301B
349#define KSZ9896_PORT3_INT_MASK 0x301F
350#define KSZ9896_PORT3_OP_CTRL0 0x3020
351#define KSZ9896_PORT3_STATUS 0x3030
352#define KSZ9896_PORT3_MAC_CTRL0 0x3400
353#define KSZ9896_PORT3_MAC_CTRL1 0x3401
354#define KSZ9896_PORT3_IG_RATE_LIMIT_CTRL 0x3403
355#define KSZ9896_PORT3_PRIO0_IG_LIMIT_CTRL 0x3410
356#define KSZ9896_PORT3_PRIO1_IG_LIMIT_CTRL 0x3411
357#define KSZ9896_PORT3_PRIO2_IG_LIMIT_CTRL 0x3412
358#define KSZ9896_PORT3_PRIO3_IG_LIMIT_CTRL 0x3413
359#define KSZ9896_PORT3_PRIO4_IG_LIMIT_CTRL 0x3414
360#define KSZ9896_PORT3_PRIO5_IG_LIMIT_CTRL 0x3415
361#define KSZ9896_PORT3_PRIO6_IG_LIMIT_CTRL 0x3416
362#define KSZ9896_PORT3_PRIO7_IG_LIMIT_CTRL 0x3417
363#define KSZ9896_PORT3_QUEUE0_EG_LIMIT_CTRL 0x3420
364#define KSZ9896_PORT3_QUEUE1_EG_LIMIT_CTRL 0x3421
365#define KSZ9896_PORT3_QUEUE2_EG_LIMIT_CTRL 0x3422
366#define KSZ9896_PORT3_QUEUE3_EG_LIMIT_CTRL 0x3423
367#define KSZ9896_PORT3_MIB_CTRL_STAT 0x3500
368#define KSZ9896_PORT3_MIB_DATA 0x3504
369#define KSZ9896_PORT3_ACL_ACCESS0 0x3600
370#define KSZ9896_PORT3_ACL_ACCESS1 0x3601
371#define KSZ9896_PORT3_ACL_ACCESS2 0x3602
372#define KSZ9896_PORT3_ACL_ACCESS3 0x3603
373#define KSZ9896_PORT3_ACL_ACCESS4 0x3604
374#define KSZ9896_PORT3_ACL_ACCESS5 0x3605
375#define KSZ9896_PORT3_ACL_ACCESS6 0x3606
376#define KSZ9896_PORT3_ACL_ACCESS7 0x3607
377#define KSZ9896_PORT3_ACL_ACCESS8 0x3608
378#define KSZ9896_PORT3_ACL_ACCESS9 0x3609
379#define KSZ9896_PORT3_ACL_ACCESS10 0x360A
380#define KSZ9896_PORT3_ACL_ACCESS11 0x360B
381#define KSZ9896_PORT3_ACL_ACCESS12 0x360C
382#define KSZ9896_PORT3_ACL_ACCESS13 0x360D
383#define KSZ9896_PORT3_ACL_ACCESS14 0x360E
384#define KSZ9896_PORT3_ACL_ACCESS15 0x360F
385#define KSZ9896_PORT3_ACL_BYTE_EN_MSB 0x3610
386#define KSZ9896_PORT3_ACL_BYTE_EN_LSB 0x3611
387#define KSZ9896_PORT3_ACL_ACCESS_CTRL0 0x3612
388#define KSZ9896_PORT3_MIRRORING_CTRL 0x3800
389#define KSZ9896_PORT3_PRIO_CTRL 0x3801
390#define KSZ9896_PORT3_IG_MAC_CTRL 0x3802
391#define KSZ9896_PORT3_AUTH_CTRL 0x3803
392#define KSZ9896_PORT3_PTR 0x3804
393#define KSZ9896_PORT3_PRIO_TO_QUEUE_MAPPING 0x3808
394#define KSZ9896_PORT3_POLICE_CTRL 0x380C
395#define KSZ9896_PORT3_POLICE_QUEUE_RATE 0x3820
396#define KSZ9896_PORT3_POLICE_QUEUE_BURST_SIZE 0x3824
397#define KSZ9896_PORT3_WRED_PKT_MEM_CTRL0 0x3830
398#define KSZ9896_PORT3_WRED_PKT_MEM_CTRL1 0x3834
399#define KSZ9896_PORT3_WRED_QUEUE_CTRL0 0x3840
400#define KSZ9896_PORT3_WRED_QUEUE_CTRL1 0x3844
401#define KSZ9896_PORT3_WRED_QUEUE_PERF_MON_CTRL 0x3848
402#define KSZ9896_PORT3_TX_QUEUE_INDEX 0x3900
403#define KSZ9896_PORT3_TX_QUEUE_PVID 0x3904
404#define KSZ9896_PORT3_TX_QUEUE_CTRL0 0x3914
405#define KSZ9896_PORT3_TX_QUEUE_CTRL1 0x3915
406#define KSZ9896_PORT3_CTRL0 0x3A00
407#define KSZ9896_PORT3_CTRL1 0x3A04
408#define KSZ9896_PORT3_CTRL2 0x3B00
409#define KSZ9896_PORT3_MSTP_PTR 0x3B01
410#define KSZ9896_PORT3_MSTP_STATE 0x3B04
411#define KSZ9896_PORT4_DEFAULT_TAG0 0x4000
412#define KSZ9896_PORT4_DEFAULT_TAG1 0x4001
413#define KSZ9896_PORT4_PME_WOL_EVENT 0x4013
414#define KSZ9896_PORT4_PME_WOL_EN 0x4017
415#define KSZ9896_PORT4_INT_STATUS 0x401B
416#define KSZ9896_PORT4_INT_MASK 0x401F
417#define KSZ9896_PORT4_OP_CTRL0 0x4020
418#define KSZ9896_PORT4_STATUS 0x4030
419#define KSZ9896_PORT4_MAC_CTRL0 0x4400
420#define KSZ9896_PORT4_MAC_CTRL1 0x4401
421#define KSZ9896_PORT4_IG_RATE_LIMIT_CTRL 0x4403
422#define KSZ9896_PORT4_PRIO0_IG_LIMIT_CTRL 0x4410
423#define KSZ9896_PORT4_PRIO1_IG_LIMIT_CTRL 0x4411
424#define KSZ9896_PORT4_PRIO2_IG_LIMIT_CTRL 0x4412
425#define KSZ9896_PORT4_PRIO3_IG_LIMIT_CTRL 0x4413
426#define KSZ9896_PORT4_PRIO4_IG_LIMIT_CTRL 0x4414
427#define KSZ9896_PORT4_PRIO5_IG_LIMIT_CTRL 0x4415
428#define KSZ9896_PORT4_PRIO6_IG_LIMIT_CTRL 0x4416
429#define KSZ9896_PORT4_PRIO7_IG_LIMIT_CTRL 0x4417
430#define KSZ9896_PORT4_QUEUE0_EG_LIMIT_CTRL 0x4420
431#define KSZ9896_PORT4_QUEUE1_EG_LIMIT_CTRL 0x4421
432#define KSZ9896_PORT4_QUEUE2_EG_LIMIT_CTRL 0x4422
433#define KSZ9896_PORT4_QUEUE3_EG_LIMIT_CTRL 0x4423
434#define KSZ9896_PORT4_MIB_CTRL_STAT 0x4500
435#define KSZ9896_PORT4_MIB_DATA 0x4504
436#define KSZ9896_PORT4_ACL_ACCESS0 0x4600
437#define KSZ9896_PORT4_ACL_ACCESS1 0x4601
438#define KSZ9896_PORT4_ACL_ACCESS2 0x4602
439#define KSZ9896_PORT4_ACL_ACCESS3 0x4603
440#define KSZ9896_PORT4_ACL_ACCESS4 0x4604
441#define KSZ9896_PORT4_ACL_ACCESS5 0x4605
442#define KSZ9896_PORT4_ACL_ACCESS6 0x4606
443#define KSZ9896_PORT4_ACL_ACCESS7 0x4607
444#define KSZ9896_PORT4_ACL_ACCESS8 0x4608
445#define KSZ9896_PORT4_ACL_ACCESS9 0x4609
446#define KSZ9896_PORT4_ACL_ACCESS10 0x460A
447#define KSZ9896_PORT4_ACL_ACCESS11 0x460B
448#define KSZ9896_PORT4_ACL_ACCESS12 0x460C
449#define KSZ9896_PORT4_ACL_ACCESS13 0x460D
450#define KSZ9896_PORT4_ACL_ACCESS14 0x460E
451#define KSZ9896_PORT4_ACL_ACCESS15 0x460F
452#define KSZ9896_PORT4_ACL_BYTE_EN_MSB 0x4610
453#define KSZ9896_PORT4_ACL_BYTE_EN_LSB 0x4611
454#define KSZ9896_PORT4_ACL_ACCESS_CTRL0 0x4612
455#define KSZ9896_PORT4_MIRRORING_CTRL 0x4800
456#define KSZ9896_PORT4_PRIO_CTRL 0x4801
457#define KSZ9896_PORT4_IG_MAC_CTRL 0x4802
458#define KSZ9896_PORT4_AUTH_CTRL 0x4803
459#define KSZ9896_PORT4_PTR 0x4804
460#define KSZ9896_PORT4_PRIO_TO_QUEUE_MAPPING 0x4808
461#define KSZ9896_PORT4_POLICE_CTRL 0x480C
462#define KSZ9896_PORT4_POLICE_QUEUE_RATE 0x4820
463#define KSZ9896_PORT4_POLICE_QUEUE_BURST_SIZE 0x4824
464#define KSZ9896_PORT4_WRED_PKT_MEM_CTRL0 0x4830
465#define KSZ9896_PORT4_WRED_PKT_MEM_CTRL1 0x4834
466#define KSZ9896_PORT4_WRED_QUEUE_CTRL0 0x4840
467#define KSZ9896_PORT4_WRED_QUEUE_CTRL1 0x4844
468#define KSZ9896_PORT4_WRED_QUEUE_PERF_MON_CTRL 0x4848
469#define KSZ9896_PORT4_TX_QUEUE_INDEX 0x4900
470#define KSZ9896_PORT4_TX_QUEUE_PVID 0x4904
471#define KSZ9896_PORT4_TX_QUEUE_CTRL0 0x4914
472#define KSZ9896_PORT4_TX_QUEUE_CTRL1 0x4915
473#define KSZ9896_PORT4_CTRL0 0x4A00
474#define KSZ9896_PORT4_CTRL1 0x4A04
475#define KSZ9896_PORT4_CTRL2 0x4B00
476#define KSZ9896_PORT4_MSTP_PTR 0x4B01
477#define KSZ9896_PORT4_MSTP_STATE 0x4B04
478#define KSZ9896_PORT5_DEFAULT_TAG0 0x5000
479#define KSZ9896_PORT5_DEFAULT_TAG1 0x5001
480#define KSZ9896_PORT5_PME_WOL_EVENT 0x5013
481#define KSZ9896_PORT5_PME_WOL_EN 0x5017
482#define KSZ9896_PORT5_INT_STATUS 0x501B
483#define KSZ9896_PORT5_INT_MASK 0x501F
484#define KSZ9896_PORT5_OP_CTRL0 0x5020
485#define KSZ9896_PORT5_STATUS 0x5030
486#define KSZ9896_PORT5_MAC_CTRL0 0x5400
487#define KSZ9896_PORT5_MAC_CTRL1 0x5401
488#define KSZ9896_PORT5_IG_RATE_LIMIT_CTRL 0x5403
489#define KSZ9896_PORT5_PRIO0_IG_LIMIT_CTRL 0x5410
490#define KSZ9896_PORT5_PRIO1_IG_LIMIT_CTRL 0x5411
491#define KSZ9896_PORT5_PRIO2_IG_LIMIT_CTRL 0x5412
492#define KSZ9896_PORT5_PRIO3_IG_LIMIT_CTRL 0x5413
493#define KSZ9896_PORT5_PRIO4_IG_LIMIT_CTRL 0x5414
494#define KSZ9896_PORT5_PRIO5_IG_LIMIT_CTRL 0x5415
495#define KSZ9896_PORT5_PRIO6_IG_LIMIT_CTRL 0x5416
496#define KSZ9896_PORT5_PRIO7_IG_LIMIT_CTRL 0x5417
497#define KSZ9896_PORT5_QUEUE0_EG_LIMIT_CTRL 0x5420
498#define KSZ9896_PORT5_QUEUE1_EG_LIMIT_CTRL 0x5421
499#define KSZ9896_PORT5_QUEUE2_EG_LIMIT_CTRL 0x5422
500#define KSZ9896_PORT5_QUEUE3_EG_LIMIT_CTRL 0x5423
501#define KSZ9896_PORT5_MIB_CTRL_STAT 0x5500
502#define KSZ9896_PORT5_MIB_DATA 0x5504
503#define KSZ9896_PORT5_ACL_ACCESS0 0x5600
504#define KSZ9896_PORT5_ACL_ACCESS1 0x5601
505#define KSZ9896_PORT5_ACL_ACCESS2 0x5602
506#define KSZ9896_PORT5_ACL_ACCESS3 0x5603
507#define KSZ9896_PORT5_ACL_ACCESS4 0x5604
508#define KSZ9896_PORT5_ACL_ACCESS5 0x5605
509#define KSZ9896_PORT5_ACL_ACCESS6 0x5606
510#define KSZ9896_PORT5_ACL_ACCESS7 0x5607
511#define KSZ9896_PORT5_ACL_ACCESS8 0x5608
512#define KSZ9896_PORT5_ACL_ACCESS9 0x5609
513#define KSZ9896_PORT5_ACL_ACCESS10 0x560A
514#define KSZ9896_PORT5_ACL_ACCESS11 0x560B
515#define KSZ9896_PORT5_ACL_ACCESS12 0x560C
516#define KSZ9896_PORT5_ACL_ACCESS13 0x560D
517#define KSZ9896_PORT5_ACL_ACCESS14 0x560E
518#define KSZ9896_PORT5_ACL_ACCESS15 0x560F
519#define KSZ9896_PORT5_ACL_BYTE_EN_MSB 0x5610
520#define KSZ9896_PORT5_ACL_BYTE_EN_LSB 0x5611
521#define KSZ9896_PORT5_ACL_ACCESS_CTRL0 0x5612
522#define KSZ9896_PORT5_MIRRORING_CTRL 0x5800
523#define KSZ9896_PORT5_PRIO_CTRL 0x5801
524#define KSZ9896_PORT5_IG_MAC_CTRL 0x5802
525#define KSZ9896_PORT5_AUTH_CTRL 0x5803
526#define KSZ9896_PORT5_PTR 0x5804
527#define KSZ9896_PORT5_PRIO_TO_QUEUE_MAPPING 0x5808
528#define KSZ9896_PORT5_POLICE_CTRL 0x580C
529#define KSZ9896_PORT5_POLICE_QUEUE_RATE 0x5820
530#define KSZ9896_PORT5_POLICE_QUEUE_BURST_SIZE 0x5824
531#define KSZ9896_PORT5_WRED_PKT_MEM_CTRL0 0x5830
532#define KSZ9896_PORT5_WRED_PKT_MEM_CTRL1 0x5834
533#define KSZ9896_PORT5_WRED_QUEUE_CTRL0 0x5840
534#define KSZ9896_PORT5_WRED_QUEUE_CTRL1 0x5844
535#define KSZ9896_PORT5_WRED_QUEUE_PERF_MON_CTRL 0x5848
536#define KSZ9896_PORT5_TX_QUEUE_INDEX 0x5900
537#define KSZ9896_PORT5_TX_QUEUE_PVID 0x5904
538#define KSZ9896_PORT5_TX_QUEUE_CTRL0 0x5914
539#define KSZ9896_PORT5_TX_QUEUE_CTRL1 0x5915
540#define KSZ9896_PORT5_CTRL0 0x5A00
541#define KSZ9896_PORT5_CTRL1 0x5A04
542#define KSZ9896_PORT5_CTRL2 0x5B00
543#define KSZ9896_PORT5_MSTP_PTR 0x5B01
544#define KSZ9896_PORT5_MSTP_STATE 0x5B04
545#define KSZ9896_PORT6_DEFAULT_TAG0 0x6000
546#define KSZ9896_PORT6_DEFAULT_TAG1 0x6001
547#define KSZ9896_PORT6_PME_WOL_EVENT 0x6013
548#define KSZ9896_PORT6_PME_WOL_EN 0x6017
549#define KSZ9896_PORT6_INT_STATUS 0x601B
550#define KSZ9896_PORT6_INT_MASK 0x601F
551#define KSZ9896_PORT6_OP_CTRL0 0x6020
552#define KSZ9896_PORT6_STATUS 0x6030
553#define KSZ9896_PORT6_XMII_CTRL0 0x6300
554#define KSZ9896_PORT6_XMII_CTRL1 0x6301
555#define KSZ9896_PORT6_MAC_CTRL0 0x6400
556#define KSZ9896_PORT6_MAC_CTRL1 0x6401
557#define KSZ9896_PORT6_IG_RATE_LIMIT_CTRL 0x6403
558#define KSZ9896_PORT6_PRIO0_IG_LIMIT_CTRL 0x6410
559#define KSZ9896_PORT6_PRIO1_IG_LIMIT_CTRL 0x6411
560#define KSZ9896_PORT6_PRIO2_IG_LIMIT_CTRL 0x6412
561#define KSZ9896_PORT6_PRIO3_IG_LIMIT_CTRL 0x6413
562#define KSZ9896_PORT6_PRIO4_IG_LIMIT_CTRL 0x6414
563#define KSZ9896_PORT6_PRIO5_IG_LIMIT_CTRL 0x6415
564#define KSZ9896_PORT6_PRIO6_IG_LIMIT_CTRL 0x6416
565#define KSZ9896_PORT6_PRIO7_IG_LIMIT_CTRL 0x6417
566#define KSZ9896_PORT6_QUEUE0_EG_LIMIT_CTRL 0x6420
567#define KSZ9896_PORT6_QUEUE1_EG_LIMIT_CTRL 0x6421
568#define KSZ9896_PORT6_QUEUE2_EG_LIMIT_CTRL 0x6422
569#define KSZ9896_PORT6_QUEUE3_EG_LIMIT_CTRL 0x6423
570#define KSZ9896_PORT6_MIB_CTRL_STAT 0x6500
571#define KSZ9896_PORT6_MIB_DATA 0x6504
572#define KSZ9896_PORT6_ACL_ACCESS0 0x6600
573#define KSZ9896_PORT6_ACL_ACCESS1 0x6601
574#define KSZ9896_PORT6_ACL_ACCESS2 0x6602
575#define KSZ9896_PORT6_ACL_ACCESS3 0x6603
576#define KSZ9896_PORT6_ACL_ACCESS4 0x6604
577#define KSZ9896_PORT6_ACL_ACCESS5 0x6605
578#define KSZ9896_PORT6_ACL_ACCESS6 0x6606
579#define KSZ9896_PORT6_ACL_ACCESS7 0x6607
580#define KSZ9896_PORT6_ACL_ACCESS8 0x6608
581#define KSZ9896_PORT6_ACL_ACCESS9 0x6609
582#define KSZ9896_PORT6_ACL_ACCESS10 0x660A
583#define KSZ9896_PORT6_ACL_ACCESS11 0x660B
584#define KSZ9896_PORT6_ACL_ACCESS12 0x660C
585#define KSZ9896_PORT6_ACL_ACCESS13 0x660D
586#define KSZ9896_PORT6_ACL_ACCESS14 0x660E
587#define KSZ9896_PORT6_ACL_ACCESS15 0x660F
588#define KSZ9896_PORT6_ACL_BYTE_EN_MSB 0x6610
589#define KSZ9896_PORT6_ACL_BYTE_EN_LSB 0x6611
590#define KSZ9896_PORT6_ACL_ACCESS_CTRL0 0x6612
591#define KSZ9896_PORT6_MIRRORING_CTRL 0x6800
592#define KSZ9896_PORT6_PRIO_CTRL 0x6801
593#define KSZ9896_PORT6_IG_MAC_CTRL 0x6802
594#define KSZ9896_PORT6_AUTH_CTRL 0x6803
595#define KSZ9896_PORT6_PTR 0x6804
596#define KSZ9896_PORT6_PRIO_TO_QUEUE_MAPPING 0x6808
597#define KSZ9896_PORT6_POLICE_CTRL 0x680C
598#define KSZ9896_PORT6_POLICE_QUEUE_RATE 0x6820
599#define KSZ9896_PORT6_POLICE_QUEUE_BURST_SIZE 0x6824
600#define KSZ9896_PORT6_WRED_PKT_MEM_CTRL0 0x6830
601#define KSZ9896_PORT6_WRED_PKT_MEM_CTRL1 0x6834
602#define KSZ9896_PORT6_WRED_QUEUE_CTRL0 0x6840
603#define KSZ9896_PORT6_WRED_QUEUE_CTRL1 0x6844
604#define KSZ9896_PORT6_WRED_QUEUE_PERF_MON_CTRL 0x6848
605#define KSZ9896_PORT6_TX_QUEUE_INDEX 0x6900
606#define KSZ9896_PORT6_TX_QUEUE_PVID 0x6904
607#define KSZ9896_PORT6_TX_QUEUE_CTRL0 0x6914
608#define KSZ9896_PORT6_TX_QUEUE_CTRL1 0x6915
609#define KSZ9896_PORT6_CTRL0 0x6A00
610#define KSZ9896_PORT6_CTRL1 0x6A04
611#define KSZ9896_PORT6_CTRL2 0x6B00
612#define KSZ9896_PORT6_MSTP_PTR 0x6B01
613#define KSZ9896_PORT6_MSTP_STATE 0x6B04
616#define KSZ9896_PORTn_DEFAULT_TAG0(port) (0x0000 + ((port) * 0x1000))
617#define KSZ9896_PORTn_DEFAULT_TAG1(port) (0x0001 + ((port) * 0x1000))
618#define KSZ9896_PORTn_PME_WOL_EVENT(port) (0x0013 + ((port) * 0x1000))
619#define KSZ9896_PORTn_PME_WOL_EN(port) (0x0017 + ((port) * 0x1000))
620#define KSZ9896_PORTn_INT_STATUS(port) (0x001B + ((port) * 0x1000))
621#define KSZ9896_PORTn_INT_MASK(port) (0x001F + ((port) * 0x1000))
622#define KSZ9896_PORTn_OP_CTRL0(port) (0x0020 + ((port) * 0x1000))
623#define KSZ9896_PORTn_STATUS(port) (0x0030 + ((port) * 0x1000))
624#define KSZ9896_PORTn_MAC_CTRL0(port) (0x0400 + ((port) * 0x1000))
625#define KSZ9896_PORTn_MAC_CTRL1(port) (0x0401 + ((port) * 0x1000))
626#define KSZ9896_PORTn_IG_RATE_LIMIT_CTRL(port) (0x0403 + ((port) * 0x1000))
627#define KSZ9896_PORTn_PRIO0_IG_LIMIT_CTRL(port) (0x0410 + ((port) * 0x1000))
628#define KSZ9896_PORTn_PRIO1_IG_LIMIT_CTRL(port) (0x0411 + ((port) * 0x1000))
629#define KSZ9896_PORTn_PRIO2_IG_LIMIT_CTRL(port) (0x0412 + ((port) * 0x1000))
630#define KSZ9896_PORTn_PRIO3_IG_LIMIT_CTRL(port) (0x0413 + ((port) * 0x1000))
631#define KSZ9896_PORTn_PRIO4_IG_LIMIT_CTRL(port) (0x0414 + ((port) * 0x1000))
632#define KSZ9896_PORTn_PRIO5_IG_LIMIT_CTRL(port) (0x0415 + ((port) * 0x1000))
633#define KSZ9896_PORTn_PRIO6_IG_LIMIT_CTRL(port) (0x0416 + ((port) * 0x1000))
634#define KSZ9896_PORTn_PRIO7_IG_LIMIT_CTRL(port) (0x0417 + ((port) * 0x1000))
635#define KSZ9896_PORTn_QUEUE0_EG_LIMIT_CTRL(port) (0x0420 + ((port) * 0x1000))
636#define KSZ9896_PORTn_QUEUE1_EG_LIMIT_CTRL(port) (0x0421 + ((port) * 0x1000))
637#define KSZ9896_PORTn_QUEUE2_EG_LIMIT_CTRL(port) (0x0422 + ((port) * 0x1000))
638#define KSZ9896_PORTn_QUEUE3_EG_LIMIT_CTRL(port) (0x0423 + ((port) * 0x1000))
639#define KSZ9896_PORTn_MIB_CTRL_STAT(port) (0x0500 + ((port) * 0x1000))
640#define KSZ9896_PORTn_MIB_DATA(port) (0x0504 + ((port) * 0x1000))
641#define KSZ9896_PORTn_ACL_ACCESS0(port) (0x0600 + ((port) * 0x1000))
642#define KSZ9896_PORTn_ACL_ACCESS1(port) (0x0601 + ((port) * 0x1000))
643#define KSZ9896_PORTn_ACL_ACCESS2(port) (0x0602 + ((port) * 0x1000))
644#define KSZ9896_PORTn_ACL_ACCESS3(port) (0x0603 + ((port) * 0x1000))
645#define KSZ9896_PORTn_ACL_ACCESS4(port) (0x0604 + ((port) * 0x1000))
646#define KSZ9896_PORTn_ACL_ACCESS5(port) (0x0605 + ((port) * 0x1000))
647#define KSZ9896_PORTn_ACL_ACCESS6(port) (0x0606 + ((port) * 0x1000))
648#define KSZ9896_PORTn_ACL_ACCESS7(port) (0x0607 + ((port) * 0x1000))
649#define KSZ9896_PORTn_ACL_ACCESS8(port) (0x0608 + ((port) * 0x1000))
650#define KSZ9896_PORTn_ACL_ACCESS9(port) (0x0609 + ((port) * 0x1000))
651#define KSZ9896_PORTn_ACL_ACCESS10(port) (0x060A + ((port) * 0x1000))
652#define KSZ9896_PORTn_ACL_ACCESS11(port) (0x060B + ((port) * 0x1000))
653#define KSZ9896_PORTn_ACL_ACCESS12(port) (0x060C + ((port) * 0x1000))
654#define KSZ9896_PORTn_ACL_ACCESS13(port) (0x060D + ((port) * 0x1000))
655#define KSZ9896_PORTn_ACL_ACCESS14(port) (0x060E + ((port) * 0x1000))
656#define KSZ9896_PORTn_ACL_ACCESS15(port) (0x060F + ((port) * 0x1000))
657#define KSZ9896_PORTn_ACL_BYTE_EN_MSB(port) (0x0610 + ((port) * 0x1000))
658#define KSZ9896_PORTn_ACL_BYTE_EN_LSB(port) (0x0611 + ((port) * 0x1000))
659#define KSZ9896_PORTn_ACL_ACCESS_CTRL0(port) (0x0612 + ((port) * 0x1000))
660#define KSZ9896_PORTn_MIRRORING_CTRL(port) (0x0800 + ((port) * 0x1000))
661#define KSZ9896_PORTn_PRIO_CTRL(port) (0x0801 + ((port) * 0x1000))
662#define KSZ9896_PORTn_IG_MAC_CTRL(port) (0x0802 + ((port) * 0x1000))
663#define KSZ9896_PORTn_AUTH_CTRL(port) (0x0803 + ((port) * 0x1000))
664#define KSZ9896_PORTn_PTR(port) (0x0804 + ((port) * 0x1000))
665#define KSZ9896_PORTn_PRIO_TO_QUEUE_MAPPING(port) (0x0808 + ((port) * 0x1000))
666#define KSZ9896_PORTn_POLICE_CTRL(port) (0x080C + ((port) * 0x1000))
667#define KSZ9896_PORTn_POLICE_QUEUE_RATE(port) (0x0820 + ((port) * 0x1000))
668#define KSZ9896_PORTn_POLICE_QUEUE_BURST_SIZE(port) (0x0824 + ((port) * 0x1000))
669#define KSZ9896_PORTn_WRED_PKT_MEM_CTRL0(port) (0x0830 + ((port) * 0x1000))
670#define KSZ9896_PORTn_WRED_PKT_MEM_CTRL1(port) (0x0834 + ((port) * 0x1000))
671#define KSZ9896_PORTn_WRED_QUEUE_CTRL0(port) (0x0840 + ((port) * 0x1000))
672#define KSZ9896_PORTn_WRED_QUEUE_CTRL1(port) (0x0844 + ((port) * 0x1000))
673#define KSZ9896_PORTn_WRED_QUEUE_PERF_MON_CTRL(port) (0x0848 + ((port) * 0x1000))
674#define KSZ9896_PORTn_TX_QUEUE_INDEX(port) (0x0900 + ((port) * 0x1000))
675#define KSZ9896_PORTn_TX_QUEUE_PVID(port) (0x0904 + ((port) * 0x1000))
676#define KSZ9896_PORTn_TX_QUEUE_CTRL0(port) (0x0914 + ((port) * 0x1000))
677#define KSZ9896_PORTn_TX_QUEUE_CTRL1(port) (0x0915 + ((port) * 0x1000))
678#define KSZ9896_PORTn_CTRL0(port) (0x0A00 + ((port) * 0x1000))
679#define KSZ9896_PORTn_CTRL1(port) (0x0A04 + ((port) * 0x1000))
680#define KSZ9896_PORTn_CTRL2(port) (0x0B00 + ((port) * 0x1000))
681#define KSZ9896_PORTn_MSTP_PTR(port) (0x0B01 + ((port) * 0x1000))
682#define KSZ9896_PORTn_MSTP_STATE(port) (0x0B04 + ((port) * 0x1000))
683#define KSZ9896_PORTn_ETH_PHY_REG(port, addr) (0x0100 + ((port) * 0x1000) + ((addr) * 2))
686#define KSZ9896_BMCR_RESET 0x8000
687#define KSZ9896_BMCR_LOOPBACK 0x4000
688#define KSZ9896_BMCR_SPEED_SEL_LSB 0x2000
689#define KSZ9896_BMCR_AN_EN 0x1000
690#define KSZ9896_BMCR_POWER_DOWN 0x0800
691#define KSZ9896_BMCR_ISOLATE 0x0400
692#define KSZ9896_BMCR_RESTART_AN 0x0200
693#define KSZ9896_BMCR_DUPLEX_MODE 0x0100
694#define KSZ9896_BMCR_COL_TEST 0x0080
695#define KSZ9896_BMCR_SPEED_SEL_MSB 0x0040
698#define KSZ9896_BMSR_100BT4 0x8000
699#define KSZ9896_BMSR_100BTX_FD 0x4000
700#define KSZ9896_BMSR_100BTX_HD 0x2000
701#define KSZ9896_BMSR_10BT_FD 0x1000
702#define KSZ9896_BMSR_10BT_HD 0x0800
703#define KSZ9896_BMSR_EXTENDED_STATUS 0x0100
704#define KSZ9896_BMSR_MF_PREAMBLE_SUPPR 0x0040
705#define KSZ9896_BMSR_AN_COMPLETE 0x0020
706#define KSZ9896_BMSR_REMOTE_FAULT 0x0010
707#define KSZ9896_BMSR_AN_CAPABLE 0x0008
708#define KSZ9896_BMSR_LINK_STATUS 0x0004
709#define KSZ9896_BMSR_JABBER_DETECT 0x0002
710#define KSZ9896_BMSR_EXTENDED_CAPABLE 0x0001
713#define KSZ9896_PHYID1_DEFAULT 0x0022
716#define KSZ9896_PHYID2_DEFAULT 0x1631
719#define KSZ9896_ANAR_NEXT_PAGE 0x8000
720#define KSZ9896_ANAR_REMOTE_FAULT 0x2000
721#define KSZ9896_ANAR_PAUSE 0x0C00
722#define KSZ9896_ANAR_100BT4 0x0200
723#define KSZ9896_ANAR_100BTX_FD 0x0100
724#define KSZ9896_ANAR_100BTX_HD 0x0080
725#define KSZ9896_ANAR_10BT_FD 0x0040
726#define KSZ9896_ANAR_10BT_HD 0x0020
727#define KSZ9896_ANAR_SELECTOR 0x001F
728#define KSZ9896_ANAR_SELECTOR_DEFAULT 0x0001
731#define KSZ9896_ANLPAR_NEXT_PAGE 0x8000
732#define KSZ9896_ANLPAR_ACK 0x4000
733#define KSZ9896_ANLPAR_REMOTE_FAULT 0x2000
734#define KSZ9896_ANLPAR_PAUSE 0x0C00
735#define KSZ9896_ANLPAR_100BT4 0x0200
736#define KSZ9896_ANLPAR_100BTX_FD 0x0100
737#define KSZ9896_ANLPAR_100BTX_HD 0x0080
738#define KSZ9896_ANLPAR_10BT_FD 0x0040
739#define KSZ9896_ANLPAR_10BT_HD 0x0020
740#define KSZ9896_ANLPAR_SELECTOR 0x001F
741#define KSZ9896_ANLPAR_SELECTOR_DEFAULT 0x0001
744#define KSZ9896_ANER_PAR_DETECT_FAULT 0x0010
745#define KSZ9896_ANER_LP_NEXT_PAGE_ABLE 0x0008
746#define KSZ9896_ANER_NEXT_PAGE_ABLE 0x0004
747#define KSZ9896_ANER_PAGE_RECEIVED 0x0002
748#define KSZ9896_ANER_LP_AN_ABLE 0x0001
751#define KSZ9896_ANNPR_NEXT_PAGE 0x8000
752#define KSZ9896_ANNPR_MSG_PAGE 0x2000
753#define KSZ9896_ANNPR_ACK2 0x1000
754#define KSZ9896_ANNPR_TOGGLE 0x0800
755#define KSZ9896_ANNPR_MESSAGE 0x07FF
758#define KSZ9896_ANLPNPR_NEXT_PAGE 0x8000
759#define KSZ9896_ANLPNPR_ACK 0x4000
760#define KSZ9896_ANLPNPR_MSG_PAGE 0x2000
761#define KSZ9896_ANLPNPR_ACK2 0x1000
762#define KSZ9896_ANLPNPR_TOGGLE 0x0800
763#define KSZ9896_ANLPNPR_MESSAGE 0x07FF
766#define KSZ9896_GBCR_TEST_MODE 0xE000
767#define KSZ9896_GBCR_MS_MAN_CONF_EN 0x1000
768#define KSZ9896_GBCR_MS_MAN_CONF_VAL 0x0800
769#define KSZ9896_GBCR_PORT_TYPE 0x0400
770#define KSZ9896_GBCR_1000BT_FD 0x0200
771#define KSZ9896_GBCR_1000BT_HD 0x0100
774#define KSZ9896_GBSR_MS_CONF_FAULT 0x8000
775#define KSZ9896_GBSR_MS_CONF_RES 0x4000
776#define KSZ9896_GBSR_LOCAL_RECEIVER_STATUS 0x2000
777#define KSZ9896_GBSR_REMOTE_RECEIVER_STATUS 0x1000
778#define KSZ9896_GBSR_LP_1000BT_FD 0x0800
779#define KSZ9896_GBSR_LP_1000BT_HD 0x0400
780#define KSZ9896_GBSR_IDLE_ERR_COUNT 0x00FF
783#define KSZ9896_MMDACR_FUNC 0xC000
784#define KSZ9896_MMDACR_FUNC_ADDR 0x0000
785#define KSZ9896_MMDACR_FUNC_DATA_NO_POST_INC 0x4000
786#define KSZ9896_MMDACR_FUNC_DATA_POST_INC_RW 0x8000
787#define KSZ9896_MMDACR_FUNC_DATA_POST_INC_W 0xC000
788#define KSZ9896_MMDACR_DEVAD 0x001F
791#define KSZ9896_GBESR_1000BX_FD 0x8000
792#define KSZ9896_GBESR_1000BX_HD 0x4000
793#define KSZ9896_GBESR_1000BT_FD 0x2000
794#define KSZ9896_GBESR_1000BT_HD 0x1000
797#define KSZ9896_RLB_REMOTE_LOOPBACK 0x0100
800#define KSZ9896_LINKMD_TEST_EN 0x8000
801#define KSZ9896_LINKMD_PAIR 0x3000
802#define KSZ9896_LINKMD_PAIR_A 0x0000
803#define KSZ9896_LINKMD_PAIR_B 0x1000
804#define KSZ9896_LINKMD_PAIR_C 0x2000
805#define KSZ9896_LINKMD_PAIR_D 0x3000
806#define KSZ9896_LINKMD_STATUS 0x0300
807#define KSZ9896_LINKMD_STATUS_NORMAL 0x0000
808#define KSZ9896_LINKMD_STATUS_OPEN 0x0100
809#define KSZ9896_LINKMD_STATUS_SHORT 0x0200
810#define KSZ9896_LINKMD_RESULT 0x00FF
813#define KSZ9896_DPMAPCSS_1000BT_LINK_STATUS 0x0002
814#define KSZ9896_DPMAPCSS_100BTX_LINK_STATUS 0x0001
817#define KSZ9896_ICSR_JABBER_IE 0x8000
818#define KSZ9896_ICSR_RECEIVE_ERROR_IE 0x4000
819#define KSZ9896_ICSR_PAGE_RECEIVED_IE 0x2000
820#define KSZ9896_ICSR_PAR_DETECT_FAULT_IE 0x1000
821#define KSZ9896_ICSR_LP_ACK_IE 0x0800
822#define KSZ9896_ICSR_LINK_DOWN_IE 0x0400
823#define KSZ9896_ICSR_REMOTE_FAULT_IE 0x0200
824#define KSZ9896_ICSR_LINK_UP_IE 0x0100
825#define KSZ9896_ICSR_JABBER_IF 0x0080
826#define KSZ9896_ICSR_RECEIVE_ERROR_IF 0x0040
827#define KSZ9896_ICSR_PAGE_RECEIVED_IF 0x0020
828#define KSZ9896_ICSR_PAR_DETECT_FAULT_IF 0x0010
829#define KSZ9896_ICSR_LP_ACK_IF 0x0008
830#define KSZ9896_ICSR_LINK_DOWN_IF 0x0004
831#define KSZ9896_ICSR_REMOTE_FAULT_IF 0x0002
832#define KSZ9896_ICSR_LINK_UP_IF 0x0001
835#define KSZ9896_AUTOMDI_MDI_SET 0x0080
836#define KSZ9896_AUTOMDI_SWAP_OFF 0x0040
839#define KSZ9896_PHYCON_JABBER_EN 0x0200
840#define KSZ9896_PHYCON_SPEED_1000BT 0x0040
841#define KSZ9896_PHYCON_SPEED_100BTX 0x0020
842#define KSZ9896_PHYCON_SPEED_10BT 0x0010
843#define KSZ9896_PHYCON_DUPLEX_STATUS 0x0008
844#define KSZ9896_PHYCON_1000BT_MS_STATUS 0x0004
847#define KSZ9896_MMD_LED_MODE_LED_MODE 0x0010
848#define KSZ9896_MMD_LED_MODE_LED_MODE_TRI_COLOR_DUAL 0x0000
849#define KSZ9896_MMD_LED_MODE_LED_MODE_SINGLE 0x0010
850#define KSZ9896_MMD_LED_MODE_RESERVED 0x000F
851#define KSZ9896_MMD_LED_MODE_RESERVED_DEFAULT 0x0001
854#define KSZ9896_MMD_EEE_ADV_1000BT_EEE_EN 0x0004
855#define KSZ9896_MMD_EEE_ADV_100BT_EEE_EN 0x0002
858#define KSZ9896_CHIP_ID0_DEFAULT 0x00
861#define KSZ9896_CHIP_ID1_DEFAULT 0x98
864#define KSZ9896_CHIP_ID2_DEFAULT 0x96
867#define KSZ9896_CHIP_ID3_REVISION_ID 0xF0
868#define KSZ9896_CHIP_ID3_GLOBAL_SOFT_RESET 0x01
871#define KSZ9896_PME_PIN_CTRL_PME_PIN_OUT_EN 0x02
872#define KSZ9896_PME_PIN_CTRL_PME_PIN_OUT_POL 0x01
875#define KSZ9896_GLOBAL_INT_STAT_LUE 0x80000000
878#define KSZ9896_GLOBAL_INT_MASK_LUE 0x80000000
881#define KSZ9896_GLOBAL_PORT_INT_STAT_PORT6 0x00000020
882#define KSZ9896_GLOBAL_PORT_INT_STAT_PORT5 0x00000010
883#define KSZ9896_GLOBAL_PORT_INT_STAT_PORT4 0x00000008
884#define KSZ9896_GLOBAL_PORT_INT_STAT_PORT3 0x00000004
885#define KSZ9896_GLOBAL_PORT_INT_STAT_PORT2 0x00000002
886#define KSZ9896_GLOBAL_PORT_INT_STAT_PORT1 0x00000001
889#define KSZ9896_GLOBAL_PORT_INT_MASK_PORT6 0x00000020
890#define KSZ9896_GLOBAL_PORT_INT_MASK_PORT5 0x00000010
891#define KSZ9896_GLOBAL_PORT_INT_MASK_PORT4 0x00000008
892#define KSZ9896_GLOBAL_PORT_INT_MASK_PORT3 0x00000004
893#define KSZ9896_GLOBAL_PORT_INT_MASK_PORT2 0x00000002
894#define KSZ9896_GLOBAL_PORT_INT_MASK_PORT1 0x00000001
897#define KSZ9896_SERIAL_IO_CTRL_MIIM_PREAMBLE_SUPPR 0x04
898#define KSZ9896_SERIAL_IO_CTRL_AUTO_SPI_DATA_OUT_EDGE_SEL 0x02
899#define KSZ9896_SERIAL_IO_CTRL_SPI_DATA_OUT_EDGE_SEL 0x01
900#define KSZ9896_SERIAL_IO_CTRL_SPI_DATA_OUT_EDGE_SEL_FALLING 0x00
901#define KSZ9896_SERIAL_IO_CTRL_SPI_DATA_OUT_EDGE_SEL_RISING 0x01
904#define KSZ9896_OUT_CLK_CTRL_CLKO_25_125_EN 0x02
905#define KSZ9896_OUT_CLK_CTRL_CLKO_25_125_FREQ 0x01
906#define KSZ9896_OUT_CLK_CTRL_CLKO_25_125_FREQ_25MHZ 0x00
907#define KSZ9896_OUT_CLK_CTRL_CLKO_25_125_FREQ_125MHZ 0x01
910#define KSZ9896_IBA_CTRL_IBA_EN 0x80000000
911#define KSZ9896_IBA_CTRL_DEST_MAC_ADDR_MATCH_EN 0x40000000
912#define KSZ9896_IBA_CTRL_IBA_RESET 0x20000000
913#define KSZ9896_IBA_CTRL_RESP_PRIO_QUEUE 0x00C00000
914#define KSZ9896_IBA_CTRL_RESP_PRIO_QUEUE_DEFAULT 0x00400000
915#define KSZ9896_IBA_CTRL_IBA_COMM 0x00070000
916#define KSZ9896_IBA_CTRL_IBA_COMM_PORT1 0x00000000
917#define KSZ9896_IBA_CTRL_IBA_COMM_PORT2 0x00010000
918#define KSZ9896_IBA_CTRL_IBA_COMM_PORT3 0x00020000
919#define KSZ9896_IBA_CTRL_IBA_COMM_PORT4 0x00030000
920#define KSZ9896_IBA_CTRL_IBA_COMM_PORT5 0x00040000
921#define KSZ9896_IBA_CTRL_IBA_COMM_PORT6 0x00050000
922#define KSZ9896_IBA_CTRL_TPID 0x0000FFFF
923#define KSZ9896_IBA_CTRL_TPID_DEFAULT 0x000040FE
926#define KSZ9896_IO_DRIVE_STRENGTH_HIGH_SPEED_DRIVE_STRENGTH 0x70
927#define KSZ9896_IO_DRIVE_STRENGTH_LOW_SPEED_DRIVE_STRENGTH 0x07
930#define KSZ9896_IBA_OP_STAT1_GOOD_PKT_DETECT 0x80000000
931#define KSZ9896_IBA_OP_STAT1_RESP_PKT_TX_DONE 0x40000000
932#define KSZ9896_IBA_OP_STAT1_EXEC_DONE 0x20000000
933#define KSZ9896_IBA_OP_STAT1_MAC_ADDR_MISMATCH_ERR 0x00004000
934#define KSZ9896_IBA_OP_STAT1_ACCESS_FORMAT_ERR 0x00002000
935#define KSZ9896_IBA_OP_STAT1_ACCESS_CODE_ERR 0x00001000
936#define KSZ9896_IBA_OP_STAT1_ACCESS_CMD_ERR 0x00000800
937#define KSZ9896_IBA_OP_STAT1_OVERSIZE_PKT_ERR 0x00000400
938#define KSZ9896_IBA_OP_STAT1_ACCESS_CODE_ERR_LOC 0x0000007F
941#define KSZ9896_LED_OVERRIDE_OVERRIDE 0x000003FF
942#define KSZ9896_LED_OVERRIDE_OVERRIDE_LED1_0 0x00000001
943#define KSZ9896_LED_OVERRIDE_OVERRIDE_LED1_1 0x00000002
944#define KSZ9896_LED_OVERRIDE_OVERRIDE_LED2_0 0x00000004
945#define KSZ9896_LED_OVERRIDE_OVERRIDE_LED2_1 0x00000008
946#define KSZ9896_LED_OVERRIDE_OVERRIDE_LED3_0 0x00000010
947#define KSZ9896_LED_OVERRIDE_OVERRIDE_LED3_1 0x00000020
948#define KSZ9896_LED_OVERRIDE_OVERRIDE_LED4_0 0x00000040
949#define KSZ9896_LED_OVERRIDE_OVERRIDE_LED4_1 0x00000080
950#define KSZ9896_LED_OVERRIDE_OVERRIDE_LED5_0 0x00000100
951#define KSZ9896_LED_OVERRIDE_OVERRIDE_LED5_1 0x00000200
954#define KSZ9896_LED_OUTPUT_GPIO_OUT_CTRL 0x000003FF
955#define KSZ9896_LED_OUTPUT_GPIO_OUT_CTRL_LED1_0 0x00000001
956#define KSZ9896_LED_OUTPUT_GPIO_OUT_CTRL_LED1_1 0x00000002
957#define KSZ9896_LED_OUTPUT_GPIO_OUT_CTRL_LED2_0 0x00000004
958#define KSZ9896_LED_OUTPUT_GPIO_OUT_CTRL_LED2_1 0x00000008
959#define KSZ9896_LED_OUTPUT_GPIO_OUT_CTRL_LED3_0 0x00000010
960#define KSZ9896_LED_OUTPUT_GPIO_OUT_CTRL_LED3_1 0x00000020
961#define KSZ9896_LED_OUTPUT_GPIO_OUT_CTRL_LED4_0 0x00000040
962#define KSZ9896_LED_OUTPUT_GPIO_OUT_CTRL_LED4_1 0x00000080
963#define KSZ9896_LED_OUTPUT_GPIO_OUT_CTRL_LED5_0 0x00000100
964#define KSZ9896_LED_OUTPUT_GPIO_OUT_CTRL_LED5_1 0x00000200
967#define KSZ9896_PWR_DOWN_CTRL0_PLL_PWR_DOWN 0x20
968#define KSZ9896_PWR_DOWN_CTRL0_PWR_MGMT_MODE 0x18
969#define KSZ9896_PWR_DOWN_CTRL0_PWR_MGMT_MODE_NORMAL 0x00
970#define KSZ9896_PWR_DOWN_CTRL0_PWR_MGMT_MODE_EDPD 0x08
971#define KSZ9896_PWR_DOWN_CTRL0_PWR_MGMT_MODE_SOFT_PWR_DOWN 0x10
974#define KSZ9896_LED_STRAP_IN_STRAP_IN 0x000003FF
975#define KSZ9896_LED_STRAP_IN_STRAP_IN_LED1_0 0x00000001
976#define KSZ9896_LED_STRAP_IN_STRAP_IN_LED1_1 0x00000002
977#define KSZ9896_LED_STRAP_IN_STRAP_IN_LED2_0 0x00000004
978#define KSZ9896_LED_STRAP_IN_STRAP_IN_LED2_1 0x00000008
979#define KSZ9896_LED_STRAP_IN_STRAP_IN_LED3_0 0x00000010
980#define KSZ9896_LED_STRAP_IN_STRAP_IN_LED3_1 0x00000020
981#define KSZ9896_LED_STRAP_IN_STRAP_IN_LED4_0 0x00000040
982#define KSZ9896_LED_STRAP_IN_STRAP_IN_LED4_1 0x00000080
983#define KSZ9896_LED_STRAP_IN_STRAP_IN_LED5_0 0x00000100
984#define KSZ9896_LED_STRAP_IN_STRAP_IN_LED5_1 0x00000200
987#define KSZ9896_SWITCH_OP_DOUBLE_TAG_EN 0x80
988#define KSZ9896_SWITCH_OP_SOFT_HARD_RESET 0x02
989#define KSZ9896_SWITCH_OP_START_SWITCH 0x01
992#define KSZ9896_SWITCH_MTU_MTU 0x3FFF
993#define KSZ9896_SWITCH_MTU_MTU_DEFAULT 0x07D0
996#define KSZ9896_SWITCH_LUE_CTRL0_VLAN_EN 0x80
997#define KSZ9896_SWITCH_LUE_CTRL0_DROP_INVALID_VID 0x40
998#define KSZ9896_SWITCH_LUE_CTRL0_AGE_COUNT 0x38
999#define KSZ9896_SWITCH_LUE_CTRL0_AGE_COUNT_DEFAULT 0x20
1000#define KSZ9896_SWITCH_LUE_CTRL0_RESERVED_MCAST_LOOKUP_EN 0x04
1001#define KSZ9896_SWITCH_LUE_CTRL0_HASH_OPTION 0x03
1002#define KSZ9896_SWITCH_LUE_CTRL0_HASH_OPTION_NONE 0x00
1003#define KSZ9896_SWITCH_LUE_CTRL0_HASH_OPTION_CRC 0x01
1004#define KSZ9896_SWITCH_LUE_CTRL0_HASH_OPTION_XOR 0x02
1007#define KSZ9896_SWITCH_LUE_CTRL1_UNICAST_LEARNING_DIS 0x80
1008#define KSZ9896_SWITCH_LUE_CTRL1_SELF_ADDR_FILT 0x40
1009#define KSZ9896_SWITCH_LUE_CTRL1_FLUSH_ALU_TABLE 0x20
1010#define KSZ9896_SWITCH_LUE_CTRL1_FLUSH_MSTP_ENTRIES 0x10
1011#define KSZ9896_SWITCH_LUE_CTRL1_MCAST_SRC_ADDR_FILT 0x08
1012#define KSZ9896_SWITCH_LUE_CTRL1_AGING_EN 0x04
1013#define KSZ9896_SWITCH_LUE_CTRL1_FAST_AGING 0x02
1014#define KSZ9896_SWITCH_LUE_CTRL1_LINK_DOWN_FLUSH 0x01
1017#define KSZ9896_SWITCH_LUE_CTRL2_DOUBLE_TAG_MCAST_TRAP 0x40
1018#define KSZ9896_SWITCH_LUE_CTRL2_DYNAMIC_ENTRY_EG_VLAN_FILT 0x20
1019#define KSZ9896_SWITCH_LUE_CTRL2_STATIC_ENTRY_EG_VLAN_FILT 0x10
1020#define KSZ9896_SWITCH_LUE_CTRL2_FLUSH_OPTION 0x0C
1021#define KSZ9896_SWITCH_LUE_CTRL2_FLUSH_OPTION_NONE 0x00
1022#define KSZ9896_SWITCH_LUE_CTRL2_FLUSH_OPTION_DYNAMIC 0x04
1023#define KSZ9896_SWITCH_LUE_CTRL2_FLUSH_OPTION_STATIC 0x08
1024#define KSZ9896_SWITCH_LUE_CTRL2_FLUSH_OPTION_BOTH 0x0C
1025#define KSZ9896_SWITCH_LUE_CTRL2_MAC_ADDR_PRIORITY 0x03
1028#define KSZ9896_SWITCH_LUE_CTRL3_AGE_PERIOD 0xFF
1029#define KSZ9896_SWITCH_LUE_CTRL3_AGE_PERIOD_DEFAULT 0x4B
1032#define KSZ9896_ALU_TABLE_INT_LEARN_FAIL 0x04
1033#define KSZ9896_ALU_TABLE_INT_ALMOST_FULL 0x02
1034#define KSZ9896_ALU_TABLE_INT_WRITE_FAIL 0x01
1037#define KSZ9896_ALU_TABLE_MASK_LEARN_FAIL 0x04
1038#define KSZ9896_ALU_TABLE_MASK_ALMOST_FULL 0x02
1039#define KSZ9896_ALU_TABLE_MASK_WRITE_FAIL 0x01
1042#define KSZ9896_ALU_TABLE_ENTRY_INDEX0_ALMOST_FULL_ENTRY_INDEX 0x0FFF
1043#define KSZ9896_ALU_TABLE_ENTRY_INDEX0_FAIL_WRITE_INDEX 0x03FF
1046#define KSZ9896_ALU_TABLE_ENTRY_INDEX1_FAIL_LEARN_INDEX 0x03FF
1049#define KSZ9896_ALU_TABLE_ENTRY_INDEX2_CPU_ACCESS_INDEX 0x03FF
1052#define KSZ9896_UNKNOWN_UNICAST_CTRL_FWD 0x80000000
1053#define KSZ9896_UNKNOWN_UNICAST_CTRL_FWD_MAP 0x0000003F
1054#define KSZ9896_UNKNOWN_UNICAST_CTRL_FWD_MAP_PORT1 0x00000001
1055#define KSZ9896_UNKNOWN_UNICAST_CTRL_FWD_MAP_PORT2 0x00000002
1056#define KSZ9896_UNKNOWN_UNICAST_CTRL_FWD_MAP_PORT3 0x00000004
1057#define KSZ9896_UNKNOWN_UNICAST_CTRL_FWD_MAP_PORT4 0x00000008
1058#define KSZ9896_UNKNOWN_UNICAST_CTRL_FWD_MAP_PORT5 0x00000010
1059#define KSZ9896_UNKNOWN_UNICAST_CTRL_FWD_MAP_PORT6 0x00000020
1060#define KSZ9896_UNKNOWN_UNICAST_CTRL_FWD_MAP_ALL 0x0000003F
1063#define KSZ9896_UNKONWN_MULTICAST_CTRL_FWD 0x80000000
1064#define KSZ9896_UNKONWN_MULTICAST_CTRL_FWD_MAP 0x0000003F
1065#define KSZ9896_UNKONWN_MULTICAST_CTRL_FWD_MAP_PORT1 0x00000001
1066#define KSZ9896_UNKONWN_MULTICAST_CTRL_FWD_MAP_PORT2 0x00000002
1067#define KSZ9896_UNKONWN_MULTICAST_CTRL_FWD_MAP_PORT3 0x00000004
1068#define KSZ9896_UNKONWN_MULTICAST_CTRL_FWD_MAP_PORT4 0x00000008
1069#define KSZ9896_UNKONWN_MULTICAST_CTRL_FWD_MAP_PORT5 0x00000010
1070#define KSZ9896_UNKONWN_MULTICAST_CTRL_FWD_MAP_PORT6 0x00000020
1071#define KSZ9896_UNKONWN_MULTICAST_CTRL_FWD_MAP_ALL 0x0000003F
1074#define KSZ9896_UNKNOWN_VLAN_ID_CTRL_FWD 0x80000000
1075#define KSZ9896_UNKNOWN_VLAN_ID_CTRL_FWD_MAP 0x0000003F
1076#define KSZ9896_UNKNOWN_VLAN_ID_CTRL_FWD_MAP_PORT1 0x00000001
1077#define KSZ9896_UNKNOWN_VLAN_ID_CTRL_FWD_MAP_PORT2 0x00000002
1078#define KSZ9896_UNKNOWN_VLAN_ID_CTRL_FWD_MAP_PORT3 0x00000004
1079#define KSZ9896_UNKNOWN_VLAN_ID_CTRL_FWD_MAP_PORT4 0x00000008
1080#define KSZ9896_UNKNOWN_VLAN_ID_CTRL_FWD_MAP_PORT5 0x00000010
1081#define KSZ9896_UNKNOWN_VLAN_ID_CTRL_FWD_MAP_PORT6 0x00000020
1082#define KSZ9896_UNKNOWN_VLAN_ID_CTRL_FWD_MAP_ALL 0x0000003F
1085#define KSZ9896_SWITCH_MAC_CTRL0_ALT_BACK_OFF_MODE 0x80
1086#define KSZ9896_SWITCH_MAC_CTRL0_FRAME_LEN_CHECK_EN 0x08
1087#define KSZ9896_SWITCH_MAC_CTRL0_FLOW_CTRL_PKT_DROP_MODE 0x02
1088#define KSZ9896_SWITCH_MAC_CTRL0_AGGRESSIVE_BACK_OFF_EN 0x01
1091#define KSZ9896_SWITCH_MAC_CTRL1_MCAST_STORM_PROTECT_DIS 0x40
1092#define KSZ9896_SWITCH_MAC_CTRL1_BACK_PRESSURE_MODE 0x20
1093#define KSZ9896_SWITCH_MAC_CTRL1_FLOW_CTRL_FAIR_MODE 0x10
1094#define KSZ9896_SWITCH_MAC_CTRL1_NO_EXCESSIVE_COL_DROP 0x08
1095#define KSZ9896_SWITCH_MAC_CTRL1_JUMBO_PKT_SUPPORT 0x04
1096#define KSZ9896_SWITCH_MAC_CTRL1_MAX_PKT_SIZE_CHECK_DIS 0x02
1097#define KSZ9896_SWITCH_MAC_CTRL1_PASS_SHORT_PKT 0x01
1100#define KSZ9896_SWITCH_MAC_CTRL2_NULL_VID_REPLACEMENT 0x08
1101#define KSZ9896_SWITCH_MAC_CTRL2_BCAST_STORM_PROTECT_RATE_MSB 0x07
1104#define KSZ9896_SWITCH_MAC_CTRL3_BCAST_STORM_PROTECT_RATE_LSB 0xFF
1107#define KSZ9896_SWITCH_MAC_CTRL4_PASS_FLOW_CTRL_PKT 0x01
1110#define KSZ9896_SWITCH_MAC_CTRL5_IG_RATE_LIMIT_PERIOD 0x30
1111#define KSZ9896_SWITCH_MAC_CTRL5_IG_RATE_LIMIT_PERIOD_16MS 0x00
1112#define KSZ9896_SWITCH_MAC_CTRL5_IG_RATE_LIMIT_PERIOD_64MS 0x10
1113#define KSZ9896_SWITCH_MAC_CTRL5_IG_RATE_LIMIT_PERIOD_256MS 0x20
1114#define KSZ9896_SWITCH_MAC_CTRL5_QUEUE_BASED_EG_RATE_LIMITE_EN 0x08
1117#define KSZ9896_SWITCH_MIB_CTRL_FLUSH 0x80
1118#define KSZ9896_SWITCH_MIB_CTRL_FREEZE 0x40
1121#define KSZ9896_GLOBAL_PORT_MIRROR_SNOOP_CTRL_IGMP_SNOOP_EN 0x40
1122#define KSZ9896_GLOBAL_PORT_MIRROR_SNOOP_CTRL_MLD_SNOOP_OPT 0x08
1123#define KSZ9896_GLOBAL_PORT_MIRROR_SNOOP_CTRL_MLD_SNOOP_EN 0x04
1124#define KSZ9896_GLOBAL_PORT_MIRROR_SNOOP_CTRL_SNIFF_MODE_SEL 0x01
1127#define KSZ9896_WRED_DIFFSERV_COLOR_MAPPING_RED 0x30
1128#define KSZ9896_WRED_DIFFSERV_COLOR_MAPPING_YELLOW 0x0C
1129#define KSZ9896_WRED_DIFFSERV_COLOR_MAPPING_GREEN 0x03
1132#define KSZ9896_QUEUE_MGMT_CTRL0_PRIORITY_2Q 0x000000C0
1133#define KSZ9896_QUEUE_MGMT_CTRL0_UNICAST_PORT_VLAN_DISCARD 0x00000002
1136#define KSZ9896_VLAN_TABLE_ENTRY0_VALID 0x80000000
1137#define KSZ9896_VLAN_TABLE_ENTRY0_FORWARD_OPTION 0x08000000
1138#define KSZ9896_VLAN_TABLE_ENTRY0_PRIORITY 0x07000000
1139#define KSZ9896_VLAN_TABLE_ENTRY0_MSTP_INDEX 0x00007000
1140#define KSZ9896_VLAN_TABLE_ENTRY0_FID 0x0000007F
1143#define KSZ9896_VLAN_TABLE_ENTRY1_PORT_UNTAG 0x0000003F
1144#define KSZ9896_VLAN_TABLE_ENTRY1_PORT6_UNTAG 0x00000020
1145#define KSZ9896_VLAN_TABLE_ENTRY1_PORT5_UNTAG 0x00000010
1146#define KSZ9896_VLAN_TABLE_ENTRY1_PORT4_UNTAG 0x00000008
1147#define KSZ9896_VLAN_TABLE_ENTRY1_PORT3_UNTAG 0x00000004
1148#define KSZ9896_VLAN_TABLE_ENTRY1_PORT2_UNTAG 0x00000002
1149#define KSZ9896_VLAN_TABLE_ENTRY1_PORT1_UNTAG 0x00000001
1152#define KSZ9896_VLAN_TABLE_ENTRY2_PORT_FORWARD 0x0000003F
1153#define KSZ9896_VLAN_TABLE_ENTRY2_PORT6_FORWARD 0x00000020
1154#define KSZ9896_VLAN_TABLE_ENTRY2_PORT5_FORWARD 0x00000010
1155#define KSZ9896_VLAN_TABLE_ENTRY2_PORT4_FORWARD 0x00000008
1156#define KSZ9896_VLAN_TABLE_ENTRY2_PORT3_FORWARD 0x00000004
1157#define KSZ9896_VLAN_TABLE_ENTRY2_PORT2_FORWARD 0x00000002
1158#define KSZ9896_VLAN_TABLE_ENTRY2_PORT1_FORWARD 0x00000001
1161#define KSZ9896_VLAN_TABLE_INDEX_VLAN_INDEX 0x0FFF
1164#define KSZ9896_VLAN_TABLE_ACCESS_CTRL_START_FINISH 0x80
1165#define KSZ9896_VLAN_TABLE_ACCESS_CTRL_ACTION 0x03
1166#define KSZ9896_VLAN_TABLE_ACCESS_CTRL_ACTION_NOP 0x00
1167#define KSZ9896_VLAN_TABLE_ACCESS_CTRL_ACTION_WRITE 0x01
1168#define KSZ9896_VLAN_TABLE_ACCESS_CTRL_ACTION_READ 0x02
1169#define KSZ9896_VLAN_TABLE_ACCESS_CTRL_ACTION_CLEAR 0x03
1172#define KSZ9896_ALU_TABLE_INDEX0_FID_INDEX 0x007F0000
1173#define KSZ9896_ALU_TABLE_INDEX0_MAC_INDEX_MSB 0x0000FFFF
1176#define KSZ9896_ALU_TABLE_INDEX1_MAC_INDEX_LSB 0xFFFFFFFF
1179#define KSZ9896_ALU_TABLE_CTRL_VALID_COUNT 0x3FFF0000
1180#define KSZ9896_ALU_TABLE_CTRL_START_FINISH 0x00000080
1181#define KSZ9896_ALU_TABLE_CTRL_VALID 0x00000040
1182#define KSZ9896_ALU_TABLE_CTRL_VALID_ENTRY_OR_SEARCH_END 0x00000020
1183#define KSZ9896_ALU_TABLE_CTRL_DIRECT 0x00000004
1184#define KSZ9896_ALU_TABLE_CTRL_ACTION 0x00000003
1185#define KSZ9896_ALU_TABLE_CTRL_ACTION_NOP 0x00000000
1186#define KSZ9896_ALU_TABLE_CTRL_ACTION_WRITE 0x00000001
1187#define KSZ9896_ALU_TABLE_CTRL_ACTION_READ 0x00000002
1188#define KSZ9896_ALU_TABLE_CTRL_ACTION_SEARCH 0x00000003
1191#define KSZ9896_STATIC_RES_MCAST_TABLE_CTRL_TABLE_INDEX 0x003F0000
1192#define KSZ9896_STATIC_RES_MCAST_TABLE_CTRL_START_FINISH 0x00000080
1193#define KSZ9896_STATIC_RES_MCAST_TABLE_CTRL_TABLE_SELECT 0x00000002
1194#define KSZ9896_STATIC_RES_MCAST_TABLE_CTRL_ACTION 0x00000001
1195#define KSZ9896_STATIC_RES_MCAST_TABLE_CTRL_ACTION_READ 0x00000000
1196#define KSZ9896_STATIC_RES_MCAST_TABLE_CTRL_ACTION_WRITE 0x00000001
1199#define KSZ9896_ALU_TABLE_ENTRY1_STATIC 0x80000000
1200#define KSZ9896_ALU_TABLE_ENTRY1_SRC_FILTER 0x40000000
1201#define KSZ9896_ALU_TABLE_ENTRY1_DES_FILTER 0x20000000
1202#define KSZ9896_ALU_TABLE_ENTRY1_PRIORITY 0x1C000000
1203#define KSZ9896_ALU_TABLE_ENTRY1_AGE_COUNT 0x1C000000
1204#define KSZ9896_ALU_TABLE_ENTRY1_MSTP 0x00000007
1207#define KSZ9896_ALU_TABLE_ENTRY2_OVERRIDE 0x80000000
1208#define KSZ9896_ALU_TABLE_ENTRY2_PORT_FORWARD 0x0000003F
1209#define KSZ9896_ALU_TABLE_ENTRY2_PORT6_FORWARD 0x00000020
1210#define KSZ9896_ALU_TABLE_ENTRY2_PORT5_FORWARD 0x00000010
1211#define KSZ9896_ALU_TABLE_ENTRY2_PORT4_FORWARD 0x00000008
1212#define KSZ9896_ALU_TABLE_ENTRY2_PORT3_FORWARD 0x00000004
1213#define KSZ9896_ALU_TABLE_ENTRY2_PORT2_FORWARD 0x00000002
1214#define KSZ9896_ALU_TABLE_ENTRY2_PORT1_FORWARD 0x00000001
1217#define KSZ9896_ALU_TABLE_ENTRY3_FID 0x007F0000
1218#define KSZ9896_ALU_TABLE_ENTRY3_MAC_ADDR_MSB 0x0000FFFF
1221#define KSZ9896_ALU_TABLE_ENTRY4_MAC_ADDR_LSB 0xFFFFFFFF
1224#define KSZ9896_STATIC_TABLE_ENTRY1_VALID 0x80000000
1225#define KSZ9896_STATIC_TABLE_ENTRY1_SRC_FILTER 0x40000000
1226#define KSZ9896_STATIC_TABLE_ENTRY1_DES_FILTER 0x20000000
1227#define KSZ9896_STATIC_TABLE_ENTRY1_PRIORITY 0x1C000000
1228#define KSZ9896_STATIC_TABLE_ENTRY1_MSTP 0x00000007
1231#define KSZ9896_STATIC_TABLE_ENTRY2_OVERRIDE 0x80000000
1232#define KSZ9896_STATIC_TABLE_ENTRY2_USE_FID 0x40000000
1233#define KSZ9896_STATIC_TABLE_ENTRY2_PORT_FORWARD 0x0000003F
1234#define KSZ9896_STATIC_TABLE_ENTRY2_PORT6_FORWARD 0x00000020
1235#define KSZ9896_STATIC_TABLE_ENTRY2_PORT5_FORWARD 0x00000010
1236#define KSZ9896_STATIC_TABLE_ENTRY2_PORT4_FORWARD 0x00000008
1237#define KSZ9896_STATIC_TABLE_ENTRY2_PORT3_FORWARD 0x00000004
1238#define KSZ9896_STATIC_TABLE_ENTRY2_PORT2_FORWARD 0x00000002
1239#define KSZ9896_STATIC_TABLE_ENTRY2_PORT1_FORWARD 0x00000001
1242#define KSZ9896_STATIC_TABLE_ENTRY3_FID 0x007F0000
1243#define KSZ9896_STATIC_TABLE_ENTRY3_MAC_ADDR_MSB 0x0000FFFF
1246#define KSZ9896_STATIC_TABLE_ENTRY4_MAC_ADDR_LSB 0xFFFFFFFF
1249#define KSZ9896_RES_MCAST_TABLE_ENTRY2_PORT_FORWARD 0x0000003F
1250#define KSZ9896_RES_MCAST_TABLE_ENTRY2_PORT6_FORWARD 0x00000020
1251#define KSZ9896_RES_MCAST_TABLE_ENTRY2_PORT5_FORWARD 0x00000010
1252#define KSZ9896_RES_MCAST_TABLE_ENTRY2_PORT4_FORWARD 0x00000008
1253#define KSZ9896_RES_MCAST_TABLE_ENTRY2_PORT3_FORWARD 0x00000004
1254#define KSZ9896_RES_MCAST_TABLE_ENTRY2_PORT2_FORWARD 0x00000002
1255#define KSZ9896_RES_MCAST_TABLE_ENTRY2_PORT1_FORWARD 0x00000001
1258#define KSZ9896_PORTn_DEFAULT_TAG0_PCP 0xE0
1259#define KSZ9896_PORTn_DEFAULT_TAG0_DEI 0x10
1260#define KSZ9896_PORTn_DEFAULT_TAG0_VID_MSB 0x0F
1263#define KSZ9896_PORTn_DEFAULT_TAG1_VID_LSB 0xFF
1266#define KSZ9896_PORTn_INT_STATUS_PHY 0x02
1267#define KSZ9896_PORTn_INT_STATUS_ACL 0x01
1270#define KSZ9896_PORTn_INT_MASK_PHY 0x02
1271#define KSZ9896_PORTn_INT_MASK_ACL 0x01
1274#define KSZ9896_PORTn_OP_CTRL0_LOCAL_LOOPBACK 0x80
1275#define KSZ9896_PORTn_OP_CTRL0_REMOTE_LOOPBACK 0x40
1276#define KSZ9896_PORTn_OP_CTRL0_TAIL_TAG_EN 0x04
1277#define KSZ9896_PORTn_OP_CTRL0_TX_QUEUE_SPLIT_EN 0x03
1280#define KSZ9896_PORTn_STATUS_SPEED 0x18
1281#define KSZ9896_PORTn_STATUS_SPEED_10MBPS 0x00
1282#define KSZ9896_PORTn_STATUS_SPEED_100MBPS 0x08
1283#define KSZ9896_PORTn_STATUS_SPEED_1000MBPS 0x10
1284#define KSZ9896_PORTn_STATUS_DUPLEX 0x04
1285#define KSZ9896_PORTn_STATUS_TX_FLOW_CTRL_EN 0x02
1286#define KSZ9896_PORTn_STATUS_RX_FLOW_CTRL_EN 0x01
1289#define KSZ9896_PORT6_XMII_CTRL0_DUPLEX 0x40
1290#define KSZ9896_PORT6_XMII_CTRL0_TX_FLOW_CTRL_EN 0x20
1291#define KSZ9896_PORT6_XMII_CTRL0_SPEED_10_100 0x10
1292#define KSZ9896_PORT6_XMII_CTRL0_RX_FLOW_CTRL_EN 0x08
1295#define KSZ9896_PORT6_XMII_CTRL1_SPEED_1000 0x40
1296#define KSZ9896_PORT6_XMII_CTRL1_RGMII_ID_IG 0x10
1297#define KSZ9896_PORT6_XMII_CTRL1_RGMII_ID_EG 0x08
1298#define KSZ9896_PORT6_XMII_CTRL1_MII_RMII_MODE 0x04
1299#define KSZ9896_PORT6_XMII_CTRL1_IF_TYPE 0x03
1300#define KSZ9896_PORT6_XMII_CTRL1_IF_TYPE_RGMII 0x00
1301#define KSZ9896_PORT6_XMII_CTRL1_IF_TYPE_RMII 0x01
1302#define KSZ9896_PORT6_XMII_CTRL1_IF_TYPE_GMII 0x02
1303#define KSZ9896_PORT6_XMII_CTRL1_IF_TYPE_MII 0x03
1306#define KSZ9896_PORTn_MAC_CTRL0_BCAST_STORM_PROTECT_EN 0x02
1309#define KSZ9896_PORTn_MAC_CTRL1_BACK_PRESSURE_EN 0x08
1310#define KSZ9896_PORTn_MAC_CTRL1_PASS_ALL_FRAMES 0x01
1313#define KSZ9896_PORTn_MIB_CTRL_STAT_MIB_COUNTER_OVERFLOW 0x80000000
1314#define KSZ9896_PORTn_MIB_CTRL_STAT_MIB_READ 0x02000000
1315#define KSZ9896_PORTn_MIB_CTRL_STAT_MIB_FLUSH_FREEZE 0x01000000
1316#define KSZ9896_PORTn_MIB_CTRL_STAT_MIB_INDEX 0x00FF0000
1317#define KSZ9896_PORTn_MIB_CTRL_STAT_MIB_COUNTER_VALUE_35_32 0x0000000F
1320#define KSZ9896_PORTn_MIB_DATA_MIB_COUNTER_VALUE_31_0 0xFFFFFFFF
1323#define KSZ9896_PORTn_ACL_ACCESS_CTRL0_WRITE_STATUS 0x40
1324#define KSZ9896_PORTn_ACL_ACCESS_CTRL0_READ_STATUS 0x20
1325#define KSZ9896_PORTn_ACL_ACCESS_CTRL0_READ 0x00
1326#define KSZ9896_PORTn_ACL_ACCESS_CTRL0_WRITE 0x10
1327#define KSZ9896_PORTn_ACL_ACCESS_CTRL0_ACL_INDEX 0x0F
1330#define KSZ9896_PORTn_MIRRORING_CTRL_RECEIVE_SNIFF 0x40
1331#define KSZ9896_PORTn_MIRRORING_CTRL_TRANSMIT_SNIFF 0x20
1332#define KSZ9896_PORTn_MIRRORING_CTRL_SNIFFER_PORT 0x02
1335#define KSZ9896_PORTn_AUTH_CTRL_ACL_EN 0x04
1336#define KSZ9896_PORTn_AUTH_CTRL_AUTH_MODE 0x03
1337#define KSZ9896_PORTn_AUTH_CTRL_AUTH_MODE_PASS 0x00
1338#define KSZ9896_PORTn_AUTH_CTRL_AUTH_MODE_BLOCK 0x01
1339#define KSZ9896_PORTn_AUTH_CTRL_AUTH_MODE_TRAP 0x02
1342#define KSZ9896_PORTn_PTR_PORT_INDEX 0x00070000
1343#define KSZ9896_PORTn_PTR_QUEUE_PTR 0x00000003
1346#define KSZ9896_PORTn_CTRL1_PORT_VLAN_MEMBERSHIP 0x0000003F
1347#define KSZ9896_PORTn_CTRL1_PORT6_VLAN_MEMBERSHIP 0x00000020
1348#define KSZ9896_PORTn_CTRL1_PORT5_VLAN_MEMBERSHIP 0x00000010
1349#define KSZ9896_PORTn_CTRL1_PORT4_VLAN_MEMBERSHIP 0x00000008
1350#define KSZ9896_PORTn_CTRL1_PORT3_VLAN_MEMBERSHIP 0x00000004
1351#define KSZ9896_PORTn_CTRL1_PORT2_VLAN_MEMBERSHIP 0x00000002
1352#define KSZ9896_PORTn_CTRL1_PORT1_VLAN_MEMBERSHIP 0x00000001
1355#define KSZ9896_PORTn_CTRL2_NULL_VID_LOOKUP_EN 0x80
1356#define KSZ9896_PORTn_CTRL2_INGRESS_VLAN_FILT 0x40
1357#define KSZ9896_PORTn_CTRL2_DISCARD_NON_PVID_PKT 0x20
1358#define KSZ9896_PORTn_CTRL2_802_1X_EN 0x10
1359#define KSZ9896_PORTn_CTRL2_SELF_ADDR_FILT 0x08
1362#define KSZ9896_PORTn_MSTP_PTR_MSTP_PTR 0x07
1365#define KSZ9896_PORTn_MSTP_STATE_TRANSMIT_EN 0x04
1366#define KSZ9896_PORTn_MSTP_STATE_RECEIVE_EN 0x02
1367#define KSZ9896_PORTn_MSTP_STATE_LEARNING_DIS 0x01
1378error_t ksz9896Init(NetInterface *interface);
1379void ksz9896InitHook(NetInterface *interface);
1381void ksz9896Tick(NetInterface *interface);
1383void ksz9896EnableIrq(NetInterface *interface);
1384void ksz9896DisableIrq(NetInterface *interface);
1386void ksz9896EventHandler(NetInterface *interface);
1389 size_t *offset, NetTxAncillary *ancillary);
1391error_t ksz9896UntagFrame(NetInterface *interface, uint8_t **frame,
1392 size_t *length, NetRxAncillary *ancillary);
1394bool_t ksz9896GetLinkState(NetInterface *interface, uint8_t port);
1395uint32_t ksz9896GetLinkSpeed(NetInterface *interface, uint8_t port);
1396NicDuplexMode ksz9896GetDuplexMode(NetInterface *interface, uint8_t port);
1398void ksz9896SetPortState(NetInterface *interface, uint8_t port,
1401SwitchPortState ksz9896GetPortState(NetInterface *interface, uint8_t port);
1403void ksz9896SetAgingTime(NetInterface *interface, uint32_t agingTime);
1405void ksz9896EnableIgmpSnooping(NetInterface *interface, bool_t enable);
1406void ksz9896EnableMldSnooping(NetInterface *interface, bool_t enable);
1407void ksz9896EnableRsvdMcastTable(NetInterface *interface, bool_t enable);
1409error_t ksz9896AddStaticFdbEntry(NetInterface *interface,
1412error_t ksz9896DeleteStaticFdbEntry(NetInterface *interface,
1415error_t ksz9896GetStaticFdbEntry(NetInterface *interface, uint_t index,
1418void ksz9896FlushStaticFdbTable(NetInterface *interface);
1420error_t ksz9896GetDynamicFdbEntry(NetInterface *interface, uint_t index,
1423void ksz9896FlushDynamicFdbTable(NetInterface *interface, uint8_t port);
1425void ksz9896SetUnknownMcastFwdPorts(NetInterface *interface,
1426 bool_t enable, uint32_t forwardPorts);
1428void ksz9896WritePhyReg(NetInterface *interface, uint8_t port,
1429 uint8_t address, uint16_t data);
1431uint16_t ksz9896ReadPhyReg(NetInterface *interface, uint8_t port,
1434void ksz9896DumpPhyReg(NetInterface *interface, uint8_t port);
1436void ksz9896WriteMmdReg(NetInterface *interface, uint8_t port,
1437 uint8_t devAddr, uint16_t regAddr, uint16_t data);
1439uint16_t ksz9896ReadMmdReg(NetInterface *interface, uint8_t port,
1440 uint8_t devAddr, uint16_t regAddr);
1442void ksz9896WriteSwitchReg8(NetInterface *interface, uint16_t address,
1445uint8_t ksz9896ReadSwitchReg8(NetInterface *interface, uint16_t address);
1447void ksz9896WriteSwitchReg16(NetInterface *interface, uint16_t address,
1450uint16_t ksz9896ReadSwitchReg16(NetInterface *interface, uint16_t address);
1452void ksz9896WriteSwitchReg32(NetInterface *interface, uint16_t address,
1455uint32_t ksz9896ReadSwitchReg32(NetInterface *interface, uint16_t address);
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
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