aboutsummaryrefslogtreecommitdiff
path: root/cpu/ixp/npe/include/IxEthAcc.h
blob: b424648e9d897497e4c05f1ea84325354e63b53a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
/** @file    IxEthAcc.h
 *
 * @brief this file contains the public API of @ref IxEthAcc component
 *
 * Design notes:
 * The IX_OSAL_MBUF address is to be specified on bits [31-5] and must 
 * be cache aligned (bits[4-0] cleared)
 *
 * 
 * @par
 * IXP400 SW Release version 2.0
 * 
 * -- Copyright Notice --
 * 
 * @par
 * Copyright 2001-2005, Intel Corporation.
 * All rights reserved.
 * 
 * @par
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the Intel Corporation nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 * 
 * @par
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * 
 * @par
 * -- End of Copyright Notice --
 *
 */

#ifndef IxEthAcc_H
#define IxEthAcc_H

#include <IxOsBuffMgt.h>
#include <IxTypes.h>

/**
 * @defgroup IxEthAcc IXP400 Ethernet Access (IxEthAcc) API
 *
 * @brief ethAcc is a library that does provides access to the internal IXP400 10/100Bt Ethernet MACs.
 *
 *@{
 */

/**
 * @ingroup IxEthAcc
 * @brief Definition of the Ethernet Access status
 */
typedef enum /* IxEthAccStatus */
{
    IX_ETH_ACC_SUCCESS = IX_SUCCESS, /**< return success*/
    IX_ETH_ACC_FAIL = IX_FAIL, /**< return fail*/
    IX_ETH_ACC_INVALID_PORT, /**< return invalid port*/
    IX_ETH_ACC_PORT_UNINITIALIZED, /**< return uninitialized*/
    IX_ETH_ACC_MAC_UNINITIALIZED, /**< return MAC uninitialized*/
    IX_ETH_ACC_INVALID_ARG, /**< return invalid arg*/
    IX_ETH_TX_Q_FULL, /**< return tx queue is full*/
    IX_ETH_ACC_NO_SUCH_ADDR /**< return no such address*/
} IxEthAccStatus;

/**
 * @ingroup IxEthAcc
 * @enum IxEthAccPortId
 * @brief Definition of the IXP400 Mac Ethernet device.
 */
typedef enum  
{
	IX_ETH_PORT_1 = 0, /**< Ethernet Port 1 */
	IX_ETH_PORT_2 = 1  /**< Ethernet port 2 */
	,IX_ETH_PORT_3 = 2 /**< Ethernet port 3 */
} IxEthAccPortId;

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETH_ACC_NUMBER_OF_PORTS
 *
 * @brief  Definition of the number of ports
 *
 */
#ifdef __ixp46X
#define IX_ETH_ACC_NUMBER_OF_PORTS (3)
#else
#define IX_ETH_ACC_NUMBER_OF_PORTS (2)
#endif

/**
 * @ingroup IxEthAcc
 *
 * @def IX_IEEE803_MAC_ADDRESS_SIZE
 *
 * @brief  Definition of the size of the MAC address
 *
 */
#define IX_IEEE803_MAC_ADDRESS_SIZE (6)


/**
 *
 * @brief Definition of the IEEE 802.3 Ethernet MAC address structure.
 *
 * The data should be packed with bytes xx:xx:xx:xx:xx:xx 
 * @note
 * The data must be packed in network byte order.
 */
typedef struct  
{
    UINT8 macAddress[IX_IEEE803_MAC_ADDRESS_SIZE]; /**< MAC address */
} IxEthAccMacAddr;

/**
 * @ingroup IxEthAcc
 * @def IX_ETH_ACC_NUM_TX_PRIORITIES
 * @brief Definition of the number of transmit priorities
 * 
 */
#define IX_ETH_ACC_NUM_TX_PRIORITIES (8)

/**
 * @ingroup IxEthAcc
 * @enum IxEthAccTxPriority
 * @brief Definition of the relative priority used to transmit a frame
 * 
 */
typedef enum  
{
	IX_ETH_ACC_TX_PRIORITY_0 = 0, /**<Lowest Priority submission */
	IX_ETH_ACC_TX_PRIORITY_1 = 1, /**<submission prority of 1 (0 is lowest)*/
	IX_ETH_ACC_TX_PRIORITY_2 = 2, /**<submission prority of 2 (0 is lowest)*/
	IX_ETH_ACC_TX_PRIORITY_3 = 3, /**<submission prority of 3 (0 is lowest)*/
	IX_ETH_ACC_TX_PRIORITY_4 = 4, /**<submission prority of 4 (0 is lowest)*/
	IX_ETH_ACC_TX_PRIORITY_5 = 5, /**<submission prority of 5 (0 is lowest)*/
	IX_ETH_ACC_TX_PRIORITY_6 = 6, /**<submission prority of 6 (0 is lowest)*/
	IX_ETH_ACC_TX_PRIORITY_7 = 7, /**<Highest priority submission */

	IX_ETH_ACC_TX_DEFAULT_PRIORITY = IX_ETH_ACC_TX_PRIORITY_0 /**< By default send all 
								 packets with lowest priority */
} IxEthAccTxPriority;

/**
 * @ingroup IxEthAcc
 * @enum IxEthAccRxFrameType
 * @brief Identify the type of a frame.
 * 
 * @sa IX_ETHACC_NE_FLAGS
 * @sa IX_ETHACC_NE_LINKMASK
 */
typedef enum  
{
	IX_ETHACC_RX_LLCTYPE = 0x00, /**< 802.3 - 8802, with LLC/SNAP */
	IX_ETHACC_RX_ETHTYPE = 0x10, /**< 802.3 (Ethernet) without LLC/SNAP */
	IX_ETHACC_RX_STATYPE = 0x20, /**< 802.11, AP <=> STA */
	IX_ETHACC_RX_APTYPE  = 0x30  /**< 802.11, AP <=> AP */
} IxEthAccRxFrameType;

/**
 * @ingroup IxEthAcc
 * @enum IxEthAccDuplexMode
 * @brief Definition to provision the duplex mode of the MAC. 
 * 
 */
typedef enum
{
    IX_ETH_ACC_FULL_DUPLEX, /**< Full duplex operation of the MAC */
    IX_ETH_ACC_HALF_DUPLEX  /**< Half duplex operation of the MAC */
} IxEthAccDuplexMode;


/**
 * @ingroup IxEthAcc
 * @struct IxEthAccNe
 * @brief Definition of service-specific informations.
 * 
 * This structure defines the Ethernet service-specific informations
 * and enable QoS and VLAN features.
 */
typedef struct
{
    UINT32 ixReserved_next;    /**< reserved for chaining */
    UINT32 ixReserved_lengths; /**< reserved for buffer lengths */
    UINT32 ixReserved_data;    /**< reserved for buffer pointer */
    UINT8  ixDestinationPortId; /**< Destination portId for this packet, if known by NPE */
    UINT8  ixSourcePortId; /**< Source portId for this packet */
    UINT16 ixFlags;        /**< BitField of option for this frame */
    UINT8  ixQoS;          /**< QoS class of the frame */
    UINT8  ixReserved;     /**< reserved */
    UINT16 ixVlanTCI;      /**< Vlan TCI */
    UINT8  ixDestMac[IX_IEEE803_MAC_ADDRESS_SIZE]; /**< Destination MAC address */
    UINT8  ixSourceMac[IX_IEEE803_MAC_ADDRESS_SIZE]; /**< Source MAC address */
} IxEthAccNe;

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_PORT_UNKNOWN
 *
 * @brief  Contents of the field @a IX_ETHACC_NE_DESTPORTID when no
 * destination port can be found by the NPE for this frame.
 *
 */
#define IX_ETHACC_NE_PORT_UNKNOWN   (0xff)

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_DESTMAC
 *
 * @brief The location of the destination MAC address in the Mbuf header.
 *
 */
#define IX_ETHACC_NE_DESTMAC(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixDestMac

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_SOURCEMAC
 *
 * @brief The location of the source MAC address in the Mbuf header.
 *
 */
#define IX_ETHACC_NE_SOURCEMAC(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixSourceMac

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_VLANTCI
 *
 * @brief The VLAN Tag Control Information associated with this frame
 * 
 * The VLAN Tag Control Information associated with this frame. On Rx
 * path, this field is extracted from the packet header.
 * On Tx path, the value of this field is inserted in the frame when
 * the port is configured to insert or replace vlan tags in the 
 * egress frames.
 *
 * @sa IX_ETHACC_NE_FLAGS
 */
#define IX_ETHACC_NE_VLANTCI(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixVlanTCI

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_SOURCEPORTID
 *
 * @brief The port where this frame came from.
 *
 * The port where this frame came from. This field is set on receive
 * with the port information. This field is ignored on Transmit path.
 */
#define IX_ETHACC_NE_SOURCEPORTID(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixSourcePortId

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_DESTPORTID
 *
 * @brief The destination port where this frame should be sent.
 *
 * The destination port where this frame should be sent.
 *
 * @li In the transmit direction, this field contains the destination port
 * and is ignored unless @a IX_ETHACC_NE_FLAG_DST is set.
 * 
 * @li In the receive direction, this field contains the port where the
 * destination MAC addresses has been learned. If the destination
 * MAC address is unknown, then this value is set to the reserved value
 * @a IX_ETHACC_NE_PORT_UNKNOWN
 *
 */
#define IX_ETHACC_NE_DESTPORTID(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixDestinationPortId

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_QOS
 *
 * @brief QualityOfService class (QoS) for this received frame.
 *
 */
#define IX_ETHACC_NE_QOS(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixQoS

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_FLAGS
 *
 * @brief Bit Mask of the different flags associated with a frame
 * 
 * The flags are the bit-oring combination 
 * of the following different fields :
 *
 *      @li IP flag (Rx @a IX_ETHACC_NE_IPMASK)
 *      @li Spanning Tree flag (Rx @a IX_ETHACC_NE_STMASK)
 *      @li Link layer type (Rx and Tx @a IX_ETHACC_NE_LINKMASK)
 *      @li VLAN Tagged Frame (Rx @a IX_ETHACC_NE_VLANMASK)
 *      @li New source MAC address (Rx @a IX_ETHACC_NE_NEWSRCMASK)
 *      @li Multicast flag (Rx @a IX_ETHACC_NE_MCASTMASK)
 *      @li Broadcast flag (Rx @a IX_ETHACC_NE_BCASTMASK)
 *      @li Destination port flag (Tx @a IX_ETHACC_NE_PORTMASK)
 *      @li Tag/Untag Tx frame (Tx @a IX_ETHACC_NE_TAGMODEMASK)
 *      @li Overwrite destination port (Tx @a IX_ETHACC_NE_PORTOVERMASK)
 *      @li Filtered frame (Rx @a IX_ETHACC_NE_STMASK)
 *      @li VLAN Enabled (Rx and Tx @a IX_ETHACC_NE_VLANENABLEMASK)
 */
#define IX_ETHACC_NE_FLAGS(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixFlags

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_BCASTMASK
 *
 * @brief This mask defines if a received frame is a broadcast frame.
 *
 * This mask defines if a received frame is a broadcast frame.
 * The BCAST flag is set when the destination MAC address of 
 * a frame is broadcast.
 *
 * @sa IX_ETHACC_NE_FLAGS 
 *
 */
#define IX_ETHACC_NE_BCASTMASK      (0x1)

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_MCASTMASK
 *
 * @brief This mask defines if a received frame is a multicast frame.
 *
 * This mask defines if a received frame is a multicast frame.
 * The MCAST flag is set when the destination MAC address of 
 * a frame is multicast.
 *
 * @sa IX_ETHACC_NE_FLAGS 
 *
 */
#define IX_ETHACC_NE_MCASTMASK      (0x1 << 1)

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_IPMASK
 *
 * @brief This mask defines if a received frame is a IP frame.
 *
 * This mask applies to @a IX_ETHACC_NE_FLAGS and defines if a received 
 * frame is a IP frame. The IP flag is set on Rx direction, depending on 
 * the frame contents. The flag is set when the length/type field of a 
 * received frame is 0x8000.
 *
 * @sa IX_ETHACC_NE_FLAGS
 *
 */
#define IX_ETHACC_NE_IPMASK         (0x1 << 2)

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_VLANMASK
 *
 * @brief This mask defines if a received frame is VLAN tagged.
 *
 * This mask defines if a received frame is VLAN tagged.
 * When set, the Rx frame is VLAN-tagged and the tag value 
 * is available thru @a IX_ETHACC_NE_VLANID.
 * Note that when sending frames which are already tagged
 * this flag should be set, to avoid inserting another VLAN tag.
 *
 * @sa IX_ETHACC_NE_FLAGS 
 * @sa IX_ETHACC_NE_VLANID
 *
 */
#define IX_ETHACC_NE_VLANMASK       (0x1 << 3)

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_LINKMASK
 *
 * @brief This mask is the link layer protocol indicator
 *
 * This mask applies to @a IX_ETHACC_NE_FLAGS.
 * It reflects the state of a frame as it exits an NPE on the Rx path
 * or enters an NPE on the Tx path. Its values are as follows:
 *      @li 0x00 - IEEE802.3 - 8802 (Rx) / IEEE802.3 - 8802 (Tx)
 *      @li 0x01 - IEEE802.3 - Ethernet (Rx) / IEEE802.3 - Ethernet (Tx)
 *      @li 0x02 - IEEE802.11 AP -> STA (Rx) / IEEE802.11 STA -> AP (Tx)
 *      @li 0x03 - IEEE802.11 AP -> AP (Rx) / IEEE802.11 AP->AP (Tx)
 *
 * @sa IX_ETHACC_NE_FLAGS
 *
 */
#define IX_ETHACC_NE_LINKMASK       (0x3 << 4)

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_STMASK
 *
 * @brief This mask defines if a received frame is a Spanning Tree frame.
 *
 * This mask applies to @a IX_ETHACC_NE_FLAGS.
 * On rx direction, it defines if a received if frame is a Spanning Tree frame.
 * Setting this fkag on transmit direction overrides the port settings 
 * regarding the VLAN options and 
 *
 * @sa IX_ETHACC_NE_FLAGS
 *
 */
#define IX_ETHACC_NE_STMASK         (0x1 << 6)

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_FILTERMASK
 *
 * @brief This bit indicates whether a frame has been filtered by the Rx service.
 *
 * This mask applies to @a IX_ETHACC_NE_FLAGS.
 * Certain frames, which should normally be fully filtered by the NPE to due
 * the destination MAC address being on the same segment as the Rx port are
 * still forwarded to the XScale (although the payload is invalid) in order
 * to learn the MAC address of the transmitting station, if this is unknown.
 * Normally EthAcc will filter and recycle these framess internally and no
 * frames with the FILTER bit set will be received by the client.
 *
 * @sa IX_ETHACC_NE_FLAGS
 *
 */
#define IX_ETHACC_NE_FILTERMASK     (0x1 << 7)

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_PORTMASK
 *
 * @brief This mask defines the rule to transmit a frame
 *
 * This mask defines the rule to transmit a frame. When set, a frame
 * is transmitted to the destination port as set by the macro
 * @a IX_ETHACC_NE_DESTPORTID. If not set, the destination port 
 * is searched using the destination MAC address.
 *
 * @note This flag is meaningful only for multiport Network Engines.
 * 
 * @sa IX_ETHACC_NE_FLAGS 
 * @sa IX_ETHACC_NE_DESTPORTID
 *
 */
#define IX_ETHACC_NE_PORTOVERMASK   (0x1 << 8)

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_TAGMODEMASK
 *
 * @brief This mask defines the tagging rules to apply to a transmit frame.
 *
 * This mask defines the tagging rules to apply to a transmit frame
 * regardless of the default setting for a port. When used together 
 * with @a IX_ETHACC_NE_TAGOVERMASK and when set, the 
 * frame will be tagged prior to transmission. When not set,
 * the frame will be untagged prior to transmission. This is accomplished
 * irrespective of the Egress tagging rules, constituting a per-frame override.
 *
 * @sa IX_ETHACC_NE_FLAGS
 * @sa IX_ETHACC_NE_TAGOVERMASK 
 *
 */
#define IX_ETHACC_NE_TAGMODEMASK    (0x1 << 9)

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_TAGOVERMASK
 *
 * @brief This mask defines the rule to transmit a frame
 *
 * This mask defines the rule to transmit a frame. When set, the
 * default transmit rules of a port are overriden.
 * When not set, the default rules as set by @ref IxEthDB should apply.
 *
 * @sa IX_ETHACC_NE_FLAGS
 * @sa IX_ETHACC_NE_TAGMODEMASK
 *
 */
#define IX_ETHACC_NE_TAGOVERMASK    (0x1 << 10)

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_VLANENABLEMASK
 *
 * @brief This mask defines if a frame is a VLAN frame or not
 *
 * When set, frames undergo normal VLAN processing on the Tx path
 * (membership filtering, tagging, tag removal etc). If this flag is
 * not set, the frame is considered to be a regular non-VLAN frame
 * and no VLAN processing will be performed.
 *
 * Note that VLAN-enabled NPE images will always set this flag in all
 * Rx frames, and images which are not VLAN enabled will clear this
 * flag for all received frames.
 *
 * @sa IX_ETHACC_NE_FLAGS
 *
 */
#define IX_ETHACC_NE_VLANENABLEMASK (0x1 << 14)

/**
 * @ingroup IxEthAcc
 *
 * @def IX_ETHACC_NE_NEWSRCMASK
 *
 * @brief This mask defines if a received frame has been learned.
 *
 * This mask defines if the source MAC address of a frame is 
 * already known. If the bit is set, the source MAC address was
 * unknown to the NPE at the time the frame was received.
 *
 * @sa IX_ETHACC_NE_FLAGS 
 *
 */
#define IX_ETHACC_NE_NEWSRCMASK     (0x1 << 15)

/**
 * @ingroup IxEthAcc
 *
 * @brief This defines the recommanded minimum size of MBUF's submitted
 * to the frame receive service.
 *
 */
#define IX_ETHACC_RX_MBUF_MIN_SIZE (2048)

/**
 * @ingroup IxEthAcc
 *
 * @brief This defines the highest MII address of any attached PHYs 
 * 
 * The maximum number for PHY address is 31, add on for range checking.
 *
 */
#define IXP425_ETH_ACC_MII_MAX_ADDR   32

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccInit(void)
 * 
 * @brief Initializes the IXP400 Ethernet Access Service.
 * 
 * @li Reentrant    - no
 * @li ISR Callable - no
 * 
 * This should be called once per module initialization.
 * @pre
 *   The NPE must first be downloaded with the required microcode which supports all
 *   required features.
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_FAIL	:  Service has failed to initialize.
 *
 * <hr>
 */
PUBLIC IxEthAccStatus ixEthAccInit(void);


/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccUnload(void)
 * 
 * @brief Unload the Ethernet Access Service.
 * 
 * @li Reentrant    - no
 * @li ISR Callable - no
 *
 * @return void 
 *
 * <hr>
 */
PUBLIC void ixEthAccUnload(void);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortInit( IxEthAccPortId portId)
 *
 * @brief Initializes an NPE/Ethernet MAC Port.
 *
 * The NPE/Ethernet port initialisation includes the following steps
 * @li Initialize the NPE/Ethernet MAC hardware.
 * @li Verify NPE downloaded and operational.
 * @li The NPE shall be available for usage once this API returns.
 * @li Verify that the Ethernet port is present before initializing
 *
 * @li Reentrant    - no
 * @li ISR Callable - no
 *
 * This should be called once per mac device.
 * The NPE/MAC shall be in disabled state after init.
 *
 * @pre
 *   The component must be initialized via @a ixEthAccInit
 *   The NPE must first be downloaded with the required microcode which supports all
 *   required features.
 *
 * Dependant on Services: (Must be initialized before using this service may be initialized)
 * 	ixNPEmh - NPE Message handling service.
 * 	ixQmgr	- Queue Manager component.
 *
 * @param portId  @ref IxEthAccPortId [in]
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS: if the ethernet port is not present, a warning is issued.
 * @li @a IX_ETH_ACC_FAIL : The NPE processor has failed to initialize.
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 *
 * <hr>
 */
PUBLIC IxEthAccStatus ixEthAccPortInit(IxEthAccPortId portId);


/*************************************************************************

 #####     ##     #####    ##            #####     ##     #####  #    #
 #    #   #  #      #     #  #           #    #   #  #      #    #    #
 #    #  #    #     #    #    #          #    #  #    #     #    ######
 #    #  ######     #    ######          #####   ######     #    #    #
 #    #  #    #     #    #    #          #       #    #     #    #    #
 #####   #    #     #    #    #          #       #    #     #    #    #

*************************************************************************/


/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortTxFrameSubmit( 
    IxEthAccPortId portId,
    IX_OSAL_MBUF *buffer, 
    IxEthAccTxPriority priority)
 * 
 * @brief This function shall be used to submit MBUFs buffers for transmission on a particular MAC device. 
 *
 * When the frame is transmitted, the buffer shall be returned thru the 
 * callback @a IxEthAccPortTxDoneCallback.
 *
 * In case of over-submitting, the order of the frames on the 
 * network may be modified.
 *
 * Buffers shall be not queued for transmission if the port is disabled.
 * The port can be enabled using @a ixEthAccPortEnable
 *
 * 
 * @li Reentrant    - yes
 * @li ISR Callable - yes
 *
 *
 * @pre 
 *  @a ixEthAccPortTxDoneCallbackRegister must be called to register a function to allow this service to
 *   return the buffer to the calling service. 
 * 
 * @note 
 *  If the buffer submit fails for any reason the user has retained ownership of the buffer.
 *
 * @param portId @ref IxEthAccPortId [in] - MAC port ID to transmit Ethernet frame on.
 * @param buffer @ref IX_OSAL_MBUF [in] - pointer to an MBUF formatted buffer. Chained buffers are supported for transmission.
 *             Chained packets are not supported and the field IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR is ignored. 
 * @param priority @ref IxEthAccTxPriority [in]
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_FAIL  : Failed to queue frame for transmission. 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */

PUBLIC IxEthAccStatus ixEthAccPortTxFrameSubmit( 
    IxEthAccPortId portId,
    IX_OSAL_MBUF *buffer, 
    IxEthAccTxPriority priority);

/**
 * @ingroup IxEthAcc
 *
 * @brief Function prototype for Ethernet Tx Buffer Done callback. Registered 
 *  via @a ixEthAccTxBufferDoneCallbackRegister 
 * 
 * This function is called once the previously submitted buffer is no longer required by this service.
 * It may be returned upon successful transmission of the frame or during the shutdown of 
 * the port prior to the transmission of a queued frame.
 * The calling of this registered function is not a guarantee of successful transmission of the buffer.
 *
 *  
 * @li Reentrant    - yes , The user provided function should be reentrant.
 * @li ISR Callable - yes , The user provided function must be callable from an ISR.
 *
 *
 * <b>Calling Context </b>: 
 * @par
 *   This callback is called in the context of the queue manager dispatch loop @a ixQmgrgrDispatcherLoopRun
 *   within the @ref IxQMgrAPI component. The calling context may be from interrupt or high priority thread. 
 *   The decision is system specific.
 *
 * @param callbackTag UINT32 [in] - This tag is that provided when the callback was registered for a particular MAC 
 * via @a ixEthAccPortTxDoneCallbackRegister. It allows the same callback to be used for multiple MACs.
 * @param mbuf @ref IX_OSAL_MBUF [in] - Pointer to the Tx mbuf descriptor. 
 * 
 * @return void
 *
 * @note
 * The field IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR is modified by the access layer and reset to NULL.
 *
 * <hr>
 */
typedef void (*IxEthAccPortTxDoneCallback) ( UINT32 callbackTag, IX_OSAL_MBUF *buffer );



/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortTxDoneCallbackRegister( IxEthAccPortId portId, 
					   IxEthAccPortTxDoneCallback txCallbackFn, 
 					   UINT32 callbackTag)
 *
 * @brief Register a callback function to allow 
 * the transmitted buffers to return to the user.
 * 
 * This function registers the transmit buffer done function callback for a particular port.
 *
 * The registered callback function is called once the previously submitted buffer is no longer required by this service.
 * It may be returned upon successful transmission of the frame or  shutdown of port prior to submission.
 * The calling of this registered function is not a guarantee of successful transmission of the buffer.
 *
 * If called several times the latest callback shall be registered for a particular port.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - yes
 *
 * @pre
 *	The port must be initialized via @a ixEthAccPortInit
 *
 *
 * @param portId @ref IxEthAccPortId [in] - Register callback for a particular MAC device.
 * @param txCallbackFn @ref IxEthAccPortTxDoneCallback [in] - Function to be called to return transmit buffers to the user.
 * @param callbackTag UINT32 [in] -  This tag shall be provided to the callback function.
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 * @li @a IX_ETH_ACC_INVALID_ARG : An argument other than portId is invalid.
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortTxDoneCallbackRegister(IxEthAccPortId portId,
								   IxEthAccPortTxDoneCallback txCallbackFn,
								   UINT32 callbackTag);



/**
 * @ingroup IxEthAcc
 *
 * @brief Function prototype for Ethernet Frame Rx callback. Registered via @a ixEthAccPortRxCallbackRegister 
 * 
 * It is the responsibility of the user function to free any MBUF's which it receives.
 *  
 * @li Reentrant    - yes , The user provided function should be reentrant.
 * @li ISR Callable - yes , The user provided function must be callable from an ISR.
 * @par
 *
 * This function dispatches frames to the user level
 * via the provided function. The invocation shall be made for each
 * frame dequeued from the Ethernet QM queue. The user is required to free any MBUF's 
 * supplied via this callback. In addition the registered callback must free up MBUF's
 * from the receive free queue when the port is disabled 
 * 
 * If called several times the latest callback shall be registered for a particular port.
 *
 * <b>Calling Context </b>: 
 * @par
 *   This callback is called in the context of the queue manager dispatch loop @a ixQmgrgrDispatcherLoopRun
 *   within the @ref IxQMgrAPI component. The calling context may be from interrupt or high priority thread. 
 *   The decision is system specific.
 *
 *
 * @param callbackTag UINT32 [in] - This tag is that provided when the callback was registered for a particular MAC 
 * via @a ixEthAccPortRxCallbackRegister. It allows the same callback to be used for multiple MACs.
 * @param mbuf @ref IX_OSAL_MBUF [in] - Pointer to the Rx mbuf header. Mbufs may be chained if 
 *               the frame length is greater than the supplied mbuf length.
 * @param reserved [in] - deprecated parameter The information is passed 
 *      thru the IxEthAccNe header destination port ID field 
 *      (@sa IX_ETHACC_NE_DESTPORTID). For backward 
 *      compatibility,the value is equal to IX_ETH_DB_UNKNOWN_PORT (0xff). 
 * 
 * @return void
 *
 * @note
 * Buffers may not be filled up to the length supplied in 
 * @a ixEthAccPortRxFreeReplenish(). The firmware fills
 * them to the previous 64 bytes boundary. The user has to be aware 
 * that the length of the received mbufs may be smaller than the length
 * of the supplied mbufs. 
 * The mbuf header contains the following modified field
 * @li @a IX_OSAL_MBUF_PKT_LEN is set in the header of the first mbuf and indicates
 *  the total frame size
 * @li @a IX_OSAL_MBUF_MLEN is set each mbuf header and indicates the payload length
 * @li @a IX_OSAL_MBUF_NEXT_BUFFER_IN_PKT_PTR contains a pointer to the next 
 *     mbuf, or NULL at the end of a chain.
 * @li @a IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR is modified. Its value is reset to NULL
 * @li @a IX_OSAL_MBUF_FLAGS contains the bit 4 set for a broadcast packet and the bit 5
 *     set for a multicast packet. Other bits are unmodified.
 *
 * <hr>
 */
typedef void (*IxEthAccPortRxCallback) (UINT32 callbackTag, IX_OSAL_MBUF *buffer, UINT32 reserved);

/**
 * @ingroup IxEthAcc
 *
 * @brief Function prototype for Ethernet Frame Rx callback. Registered via @a ixEthAccPortMultiBufferRxCallbackRegister 
 * 
 * It is the responsibility of the user function to free any MBUF's which it receives.
 *  
 * @li Reentrant    - yes , The user provided function should be reentrant.
 * @li ISR Callable - yes , The user provided function must be callable from an ISR.
 * @par
 *
 * This function dispatches many frames to the user level
 * via the provided function. The invocation shall be made for multiple frames
 * dequeued from the Ethernet QM queue. The user is required to free any MBUF's 
 * supplied via this callback. In addition the registered callback must free up MBUF's
 * from the receive free queue when the port is disabled 
 * 
 * If called several times the latest callback shall be registered for a particular port.
 *
 * <b>Calling Context </b>: 
 * @par
 *   This callback is called in the context of the queue manager dispatch loop @a ixQmgrDispatcherLoopRun
 *   within the @ref IxQMgrAPI component. The calling context may be from interrupt or high priority thread. 
 *   The decision is system specific.
 *
 *
 * @param callbackTag - This tag is that provided when the callback was registered for a particular MAC 
 * via @a ixEthAccPortMultiBufferRxCallbackRegister. It allows the same callback to be used for multiple MACs.
 * @param mbuf - Pointer to an array of Rx mbuf headers. Mbufs 
 *               may be chained if 
 *               the frame length is greater than the supplied mbuf length.
 *               The end of the array contains a zeroed entry (NULL pointer).
 *
 * @return void
 *
 * @note The mbufs passed to this callback have the same structure than the
 *  buffers passed to @a IxEthAccPortRxCallback interfac. 
 *
 * @note The usage of this callback is exclusive with the usage of
 *  @a ixEthAccPortRxCallbackRegister and @a IxEthAccPortRxCallback 
 *
 * @sa ixEthAccPortMultiBufferRxCallbackRegister
 * @sa IxEthAccPortMultiBufferRxCallback
 * @sa ixEthAccPortRxCallbackRegister
 * @sa IxEthAccPortRxCallback
 * <hr>
 */

typedef void (*IxEthAccPortMultiBufferRxCallback) (UINT32 callbackTag, IX_OSAL_MBUF **buffer);




/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortRxCallbackRegister( IxEthAccPortId portId, IxEthAccPortRxCallback rxCallbackFn, UINT32 callbackTag)
 *
 * @brief Register a callback function to allow 
 * the reception of frames.
 *
 * The registered callback function is called once a frame is received  by this service.
 *
 * If called several times the latest callback shall be registered for a particular port.
 *
 *
 * @li Reentrant    - yes
 * @li ISR Callable - yes
 *
 *
 * @param portId @ref IxEthAccPortId [in] - Register callback for a particular MAC device.
 * @param rxCallbackFn @ref IxEthAccPortRxCallback [in] - Function to be called when Ethernet frames are availble.
 * @param callbackTag UINT32 [in] -  This tag shall be provided to the callback function.
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 * @li @a IX_ETH_ACC_INVALID_ARG : An argument other than portId is invalid.
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortRxCallbackRegister(IxEthAccPortId portId,
							   IxEthAccPortRxCallback rxCallbackFn,
							   UINT32 callbackTag);


/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortMultiBufferRxCallbackRegister( IxEthAccPortId portId, IxEthAccPortMultiBufferRxCallback rxCallbackFn, UINT32 callbackTag)
 *
 * @brief Register a callback function to allow 
 * the reception of frames.
 * 
 * The registered callback function is called once a frame is 
 * received  by this service. If many frames are already received, 
 * the function is called once.
 *
 * If called several times the latest callback shall be registered for a particular port.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - yes
 *
 *
 * @param portId - Register callback for a particular MAC device.
 * @param rxCallbackFn - @a IxEthAccMultiBufferRxCallbackFn - Function to be called when Ethernet frames are availble.
 * @param callbackTag -  This tag shall be provided to the callback function.
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 * @li @a IX_ETH_ACC_INVALID_ARG : An argument other than portId is invalid.
 *
 * @sa ixEthAccPortMultiBufferRxCallbackRegister
 * @sa IxEthAccPortMultiBufferRxCallback
 * @sa ixEthAccPortRxCallbackRegister
 * @sa IxEthAccPortRxCallback
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortMultiBufferRxCallbackRegister(IxEthAccPortId portId,
										  IxEthAccPortMultiBufferRxCallback rxCallbackFn,
										  UINT32 callbackTag);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortRxFreeReplenish( IxEthAccPortId portId, IX_OSAL_MBUF *buffer)
 *
 * @brief This function provides buffers for the Ethernet receive path. 
 *
 * This component does not have a buffer management mechanisms built in. All Rx buffers must be supplied to it
 * via this interface. 
 *
 * @li Reentrant    - yes
 * @li ISR Callable - yes
 *
 * @param portId @ref IxEthAccPortId [in] - Provide buffers only to specific Rx MAC. 
 * @param buffer @ref IX_OSAL_MBUF [in] - Provide an MBUF to the Ethernet receive mechanism. 
 *                 Buffers size smaller than IX_ETHACC_RX_MBUF_MIN_SIZE may result in poor
 *                 performances and excessive buffer chaining. Buffers
 *                 larger than this size may be suitable for jumbo frames.
 *                 Chained packets are not supported and the field IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR must be NULL. 
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_FAIL : Buffer has was not able to queue the 
 *                     buffer in the receive service.
 * @li @a IX_ETH_ACC_FAIL : Buffer size is less than IX_ETHACC_RX_MBUF_MIN_SIZE
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * @note
 * If the buffer replenish operation fails it is the responsibility 
 * of the user to free the buffer.
 *
 * @note
 * Sufficient buffers must be supplied to the component to maintain
 * receive throughput and avoid rx buffer underflow conditions.
 * To meet this goal, It is expected that the user preload the 
 * component with a sufficent number of buffers prior to enabling the
 * NPE Ethernet receive path. The recommended minimum number of 
 * buffers is 8.
 *
 * @note
 * For maximum performances, the mbuf size should be greater 
 * than the maximum frame size (Ethernet header, payload and FCS) + 64. 
 * Supplying smaller mbufs to the service results in mbuf
 * chaining and degraded performances. The recommended size
 * is @a IX_ETHACC_RX_MBUF_MIN_SIZE, which is
 * enough to take care of 802.3 frames and "baby jumbo" frames without
 * chaining, and "jumbo" frame within chaining.
 *
 * @note
 * Buffers may not be filled up to their length. The firware fills
 * them up to the previous 64 bytes boundary. The user has to be aware 
 * that the length of the received mbufs may be smaller than the length
 * of the supplied mbufs.
 *
 * @warning This function checks the parameters if the NDEBUG 
 * flag is not defined. Turning on the argument checking (disabled by 
 * default) results in a lower EthAcc performance as this function
 * is part of the data path.
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortRxFreeReplenish( IxEthAccPortId portId, IX_OSAL_MBUF *buffer);



/***************************************************************

  ####    ####   #    #   #####  #####    ####   #
 #    #  #    #  ##   #     #    #    #  #    #  #
 #       #    #  # #  #     #    #    #  #    #  #
 #       #    #  #  # #     #    #####   #    #  #
 #    #  #    #  #   ##     #    #   #   #    #  #
  ####    ####   #    #     #    #    #   ####   ######


         #####   #         ##    #    #  ######
         #    #  #        #  #   ##   #  #
         #    #  #       #    #  # #  #  #####
         #####   #       ######  #  # #  #
         #       #       #    #  #   ##  #
         #       ######  #    #  #    #  ######

***************************************************************/

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortEnable(IxEthAccPortId portId)
 *
 * @brief This enables an Ethernet port for both Tx and Rx. 
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @pre The port must first be initialized via @a ixEthAccPortInit and the MAC address 
 * must be set using @a ixEthAccUnicastMacAddressSet before enabling it
 * The rx and Tx Done callbacks registration via @a
 * ixEthAccPortTxDoneCallbackRegister amd @a  ixEthAccPortRxCallbackRegister
 * has to be done before enabling the traffic.
 * 
 * @param  portId @ref IxEthAccPortId [in] - Port id to act upon.
 * 
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is not initialized
 * @li @a IX_ETH_ACC_MAC_UNINITIALIZED : port MAC address is not initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus ixEthAccPortEnable(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortDisable(IxEthAccPortId portId)
 *
 * @brief This disables an Ethernet port for both Tx and Rx. 
 *
 * Free MBufs are returned to the user via the registered callback when the port is disabled 
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @pre The port must be enabled with @a ixEthAccPortEnable, otherwise this
 * function has no effect
 *
 * @param  portId @ref IxEthAccPortId [in] - Port id to act upon.
 * 
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is not initialized
 * @li @a IX_ETH_ACC_MAC_UNINITIALIZED : port MAC address is not initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus ixEthAccPortDisable(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortEnabledQuery(IxEthAccPortId portId, BOOL *enabled)
 *
 * @brief Get the enabled state of a port.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - yes
 *
 * @pre The port must first be initialized via @a ixEthAccPortInit
 *
 * @param  portId @ref IxEthAccPortId [in] - Port id to act upon.
 * @param  enabled BOOL [out] - location to store the state of the port
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortEnabledQuery(IxEthAccPortId portId, BOOL *enabled);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortPromiscuousModeClear(IxEthAccPortId portId)
 *
 * @brief Put the Ethernet MAC device in non-promiscuous mode.
 * 
 * In non-promiscuous mode the MAC filters all frames other than 
 * destination MAC address which matches the following criteria:
 * @li Unicast address provisioned via @a ixEthAccUnicastMacAddressSet
 * @li All broadcast frames.
 * @li Multicast addresses provisioned via @a ixEthAccMulticastAddressJoin
 *
 * Other functions modify the MAC filtering
 *
 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
 *     frames are forwarded to the application
 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
 *     effects of @a ixEthAccPortMulticastAddressJoinAll()
 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new 
 *     filtering address
 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new 
 *     filtering address
 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are 
 *     forwarded to the application regardless of the multicast 
 *     address provisioned
 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded 
 *     to the application following the multicast address provisioned
 *
 * In all cases, unicast and broadcast addresses are forwarded to 
 * the application.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 * 
 * @sa ixEthAccPortPromiscuousModeSet
 * 
 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
 * 
 * @return IxEthAccStatus 
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus ixEthAccPortPromiscuousModeClear(IxEthAccPortId portId);


/**
 * @ingroup IxEthAcc
 *
 * @fn  ixEthAccPortPromiscuousModeSet(IxEthAccPortId portId)
 *
 * @brief Put the MAC device in promiscuous mode.
 * 
 * If the device is in promiscuous mode then all all received frames shall be forwared
 * to the NPE for processing.
 *
 * Other functions modify the MAC filtering
 *
 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
 *     frames are forwarded to the application
 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
 *     effects of @a ixEthAccPortMulticastAddressJoinAll()
 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new 
 *     filtering address
 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new 
 *     filtering address
 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are 
 *     forwarded to the application regardless of the multicast 
 *     address provisioned
 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded 
 *     to the application following the multicast address provisioned
 *
 * In all cases, unicast and broadcast addresses are forwarded to 
 * the application.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 * 
 * @sa ixEthAccPortPromiscuousModeClear
 *
 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
 * 
 * @return IxEthAccStatus 
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus ixEthAccPortPromiscuousModeSet(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortUnicastMacAddressSet(      IxEthAccPortId portId,
                                                  IxEthAccMacAddr *macAddr)
 *
 * @brief Configure unicast MAC address for a particular port
 *
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
 * @param *macAddr @ref IxEthAccMacAddr [in] - Ethernet Mac address.
 *
 * @return IxEthAccStatus 
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus ixEthAccPortUnicastMacAddressSet(IxEthAccPortId portId,
													   IxEthAccMacAddr *macAddr);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortUnicastMacAddressGet(	IxEthAccPortId portId, 
					IxEthAccMacAddr *macAddr)
 *
 * @brief Get unicast MAC address for a particular MAC port 
 *
 * @pre
 * The MAC address must first be set via @a ixEthAccMacPromiscuousModeSet
 * If the MAC address has not been set, the function returns a 
 * IX_ETH_ACC_MAC_UNINITIALIZED status
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
 * @param *macAddr @ref IxEthAccMacAddr [out] - Ethernet MAC address.
 *
 * @return  IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_MAC_UNINITIALIZED : port MAC address is not initialized.
 * @li @a IX_ETH_ACC_FAIL : macAddr is invalid.
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortUnicastMacAddressGet(IxEthAccPortId portId,
								 IxEthAccMacAddr *macAddr);




/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortMulticastAddressJoin(      IxEthAccPortId portId,
                                             IxEthAccMacAddr *macAddr)
 *
 * @brief Add a multicast address to the MAC address table.
 *
 *  @note
 *  Due to the operation of the Ethernet MAC multicast filtering mechanism, frames which do not 
 *  have a multicast destination address which were provisioned via this API may be forwarded 
 *  to the NPE's. This is a result of the hardware comparison  algorithm used in the destination mac address logic
 *  within the Ethernet MAC. 
 *
 *  See Also: IXP425 hardware development manual.
 * 
 * Other functions modify the MAC filtering
 *
 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
 *     frames are forwarded to the application
 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
 *     effects of @a ixEthAccPortMulticastAddressJoinAll()
 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new 
 *     filtering address
 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new 
 *     filtering address
 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are 
 *     forwarded to the application regardless of the multicast 
 *     address provisioned
 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded 
 *     to the application following the multicast address provisioned
 *
 * In all cases, unicast and broadcast addresses are forwarded to 
 * the application.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
 * @param *macAddr @ref IxEthAccMacAddr [in] - Ethernet Mac address.
 *
 * @return IxEthAccStatus 
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_FAIL : Error writing to the MAC registers
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortMulticastAddressJoin(IxEthAccPortId portId,
								 IxEthAccMacAddr *macAddr);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortMulticastAddressJoinAll(  IxEthAccPortId portId)
 *
 * @brief Filter all frames with multicast dest.
 *
 * This function clears the MAC address table, and then sets
 * the MAC to forward ALL multicast frames to the NPE.
 * Specifically, it forwards all frames whose destination address
 * has the LSB of the highest byte set  (01:00:00:00:00:00).  This
 * bit is commonly referred to as the "multicast bit".
 * Broadcast frames will still be forwarded. 
 *
 * Other functions modify the MAC filtering
 *
 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
 *     frames are forwarded to the application
 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
 *     effects of @a ixEthAccPortMulticastAddressJoinAll()
 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new 
 *     filtering address
 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new 
 *     filtering address
 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are 
 *     forwarded to the application regardless of the multicast 
 *     address provisioned
 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded 
 *     to the application following the multicast address provisioned
 *
 * In all cases, unicast and broadcast addresses are forwarded to 
 * the application.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
 *
 * @return IxEthAccStatus 
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortMulticastAddressJoinAll(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortMulticastAddressLeave( IxEthAccPortId portId,
                                         IxEthAccMacAddr *macAddr)
 *
 * @brief Remove a multicast address from the MAC address table.
 *
 * Other functions modify the MAC filtering
 *
 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
 *     frames are forwarded to the application
 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
 *     effects of @a ixEthAccPortMulticastAddressJoinAll()
 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new 
 *     filtering address
 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new 
 *     filtering address
 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are 
 *     forwarded to the application regardless of the multicast 
 *     address provisioned
 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded 
 *     to the application following the multicast address provisioned
 *
 * In all cases, unicast and broadcast addresses are forwarded to 
 * the application.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
 * @param *macAddr @ref IxEthAccMacAddr [in] - Ethernet Mac address.
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_NO_SUCH_ADDR :  Failed if MAC address was not in the table.
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortMulticastAddressLeave(IxEthAccPortId portId,
								  IxEthAccMacAddr *macAddr);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortMulticastAddressLeaveAll( IxEthAccPortId portId)
 *
 * @brief This function unconfigures the multicast filtering settings
 *
 * This function first clears the MAC address table, and then sets
 * the MAC as configured by the promiscuous mode current settings.
 *
 * Other functions modify the MAC filtering
 *
 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
 *     frames are forwarded to the application
 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
 *     effects of @a ixEthAccPortMulticastAddressJoinAll()
 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new 
 *     filtering address
 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new 
 *     filtering address
 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are 
 *     forwarded to the application regardless of the multicast 
 *     address provisioned
 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded 
 *     to the application following the multicast address provisioned
 *
 * In all cases, unicast and broadcast addresses are forwarded to 
 * the application.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortMulticastAddressLeaveAll(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortUnicastAddressShow(IxEthAccPortId portId)
 *
 * @brief Displays unicast MAC address
 *
 * Displays unicast address which is configured using 
 * @a ixEthAccUnicastMacAddressSet. This function also displays the MAC filter used
 * to filter multicast frames.
 *
 * Other functions modify the MAC filtering
 *
 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
 *     frames are forwarded to the application
 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
 *     effects of @a ixEthAccPortMulticastAddressJoinAll()
 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new 
 *     filtering address
 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new 
 *     filtering address
 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are 
 *     forwarded to the application regardless of the multicast 
 *     address provisioned
 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded 
 *     to the application following the multicast address provisioned
 *
 * In all cases, unicast and broadcast addresses are forwarded to 
 * the application.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
 *
 * @return void
 *
 * <hr>
 */
PUBLIC IxEthAccStatus ixEthAccPortUnicastAddressShow(IxEthAccPortId portId);


/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortMulticastAddressShow( IxEthAccPortId portId)
 *
 * @brief Displays multicast MAC address
 *
 * Displays multicast address which have been configured using @a ixEthAccMulticastAddressJoin
 * 
 * @li Reentrant    - yes
 * @li ISR Callable - no
 * 
 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
 *
 * @return void
 *
 * <hr>
 */
PUBLIC void ixEthAccPortMulticastAddressShow( IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortDuplexModeSet( IxEthAccPortId portId, IxEthAccDuplexMode mode )
 *
 * @brief  Set the duplex mode for the MAC.
 *
 * Configure the IXP400 MAC to either full or half duplex. 
 *
 * @note 
 * The configuration should match that provisioned on the PHY.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in]
 * @param mode @ref IxEthAccDuplexMode [in]
 *
 * @return IxEthAccStatus 
 * @li @a IX_ETH_ACC_SUCCESS 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus 
ixEthAccPortDuplexModeSet(IxEthAccPortId portId,IxEthAccDuplexMode mode);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortDuplexModeGet( IxEthAccPortId portId, IxEthAccDuplexMode *mode )
 *
 * @brief  Get the duplex mode for the MAC.
 *
 * return the duplex configuration of the IXP400 MAC.
 *
 * @note
 * The configuration should match that provisioned on the PHY.
 * See @a ixEthAccDuplexModeSet
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in]
 * @param *mode @ref IxEthAccDuplexMode [out]
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 *
 */
PUBLIC IxEthAccStatus 
ixEthAccPortDuplexModeGet(IxEthAccPortId portId,IxEthAccDuplexMode *mode );

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortTxFrameAppendPaddingEnable( IxEthAccPortId portId)
 *
 * @brief  Enable padding bytes to be appended to runt frames submitted to
 * this port
 * 
 * Enable up to 60 null-bytes padding bytes to be appended to runt frames 
 * submitted to this port. This is the default behavior of the access 
 * component.
 *
 * @warning Do not change this behaviour while the port is enabled.
 *
 * @note When Tx padding is enabled, Tx FCS generation is turned on
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @sa ixEthAccPortTxFrameAppendFCSDusable
 *
 * @param portId @ref IxEthAccPortId [in]
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortTxFrameAppendPaddingEnable(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortTxFrameAppendPaddingDisable( IxEthAccPortId portId)
 *
 * @brief  Disable padding bytes to be appended to runt frames submitted to
 * this port
 * 
 * Disable padding bytes to be appended to runt frames 
 * submitted to this port. This is not the default behavior of the access 
 * component.
 *
 * @warning Do not change this behaviour while the port is enabled.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in] 
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortTxFrameAppendPaddingDisable(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortTxFrameAppendFCSEnable( IxEthAccPortId portId)
 *
 * @brief  Enable the appending of Ethernet FCS to all frames submitted to this port
 * 
 * When enabled, the FCS is added to the submitted frames. This is the default 
 * behavior of the access component.
 * Do not change this behaviour while the port is enabled.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in] 
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortTxFrameAppendFCSEnable(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortTxFrameAppendFCSDisable( IxEthAccPortId portId)
 *
 * @brief  Disable the appending of Ethernet FCS to all frames submitted to this port.
 * 
 * When disabled, the Ethernet FCS is not added to the submitted frames. 
 * This is not the default
 * behavior of the access component.
 *
 * @note Since the FCS is not appended to the frame it is expected that the frame submitted to the 
 * component includes a valid FCS at the end of the data, although this will not be validated.
 *
 * The component shall forward the frame to the Ethernet MAC WITHOUT modification.
 *
 * Do not change this behaviour while the port is enabled.
 *
 * @note Tx FCS append is not disabled while Tx padding is enabled.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @sa ixEthAccPortTxFrameAppendPaddingEnable
 *
 * @param portId @ref IxEthAccPortId [in] 
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortTxFrameAppendFCSDisable(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortRxFrameAppendFCSEnable( IxEthAccPortId portId)
 *
 * @brief Forward frames with FCS included in the receive buffer.
 *
 * The FCS is not striped from the receive buffer. 
 * The received frame length includes the FCS size (4 bytes). ie. 
 * A minimum sized ethernet frame shall have a length of 64bytes.
 *
 * Frame FCS validity checks are still carried out on all received frames.
 *
 * This is not the default
 * behavior of the access component.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in]
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortRxFrameAppendFCSEnable(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccPortRxFrameAppendFCSDisable( IxEthAccPortId portId)
 *
 * @brief  Do not forward the FCS portion of the received Ethernet frame to the user. 
 * The FCS is striped from the receive buffer. 
 * The received frame length does not include the FCS size (4 bytes).
 * Frame FCS validity checks are still carried out on all received frames.
 *
 * This is the default behavior of the component.
 * Do not change this behaviour while the port is enabled.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in]
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS 
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccPortRxFrameAppendFCSDisable(IxEthAccPortId portId);




/**
 * @ingroup IxEthAcc
 *
 * @enum IxEthAccSchedulerDiscipline
 *
 * @brief  Definition for the port scheduling discipline
 *
 * Select the port scheduling discipline on receive and transmit path
 * @li FIFO : No Priority : In this configuration all frames are processed
 *                       in the access component in the strict order in which 
 *                        the component received them.
 * @li FIFO : Priority : This shall be a very simple priority mechanism. 
 *                     Higher prior-ity frames shall be forwarded 
 *                     before lower priority frames. There shall be no 
 *                     fairness mechanisms applied across different 
 *                     priorities. Higher priority frames could starve 
 *                     lower priority frames indefinitely.
 */
typedef  enum 
{
    FIFO_NO_PRIORITY, /**<frames submitted with no priority*/
    FIFO_PRIORITY /**<higher prority frames submitted before lower priority*/
}IxEthAccSchedulerDiscipline;

/**
 * @ingroup IxEthAcc
 *
 * @def IxEthAccTxSchedulerDiscipline
 *
 * @brief  Deprecated definition for the port transmit scheduling discipline
 */ 
#define IxEthAccTxSchedulerDiscipline IxEthAccSchedulerDiscipline



/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccTxSchedulingDisciplineSet( IxEthAccPortId portId, IxEthAccSchedulerDiscipline sched)
 *
 * @brief Set the port scheduling to one of @a IxEthAccSchedulerDiscipline
 *
 * The default behavior of the component is @a FIFO_NO_PRIORITY.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @pre
 *
 *
 * @param portId @ref IxEthAccPortId [in] 
 * @param sched @ref IxEthAccSchedulerDiscipline [in] 
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS : Set appropriate discipline.
 * @li @a IX_ETH_ACC_FAIL :  Invalid/unsupported discipline.
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccTxSchedulingDisciplineSet(IxEthAccPortId portId, 
								  IxEthAccSchedulerDiscipline sched);


/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccRxSchedulingDisciplineSet(IxEthAccSchedulerDiscipline sched)
 *
 * @brief Set the Rx scheduling to one of @a IxEthAccSchedulerDiscipline
 *
 * The default behavior of the component is @a FIFO_NO_PRIORITY.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @pre
 *
 * @param sched : @a IxEthAccSchedulerDiscipline 
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS : Set appropriate discipline.
 * @li @a IX_ETH_ACC_FAIL :  Invalid/unsupported discipline.
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccRxSchedulingDisciplineSet(IxEthAccSchedulerDiscipline sched);

/**
 * @ingroup IxEthAcc
 *
 * @fn IxEthAccStatus ixEthAccNpeLoopbackEnable(IxEthAccPortId portId)
 *
 * @brief Enable NPE loopback
 *
 * When this loopback mode is enabled all the transmitted frames are
 * received on the same port, without payload.
 *
 * This function is recommended for power-up diagnostic checks and
 * should never be used under normal Ethernet traffic operations.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @pre
 *
 * @param portId : ID of the port 
 *
 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
 * guaranteed to restore correct Ethernet Tx/Rx operation.
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS : NPE loopback mode enabled
 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus 
ixEthAccPortNpeLoopbackEnable(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn IxEthAccStatus ixEthAccPortNpeLoopbackDisable(IxEthAccPortId portId)
 *
 * @brief Disable NPE loopback
 *
 * This function is used to disable the NPE loopback if previously
 * enabled using ixEthAccNpeLoopbackEnable.
 *
 * This function is recommended for power-up diagnostic checks and
 * should never be used under normal Ethernet traffic operations.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @pre
 *
 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
 * guaranteed to restore correct Ethernet Tx/Rx operation.
 *
 * @param portId : ID of the port 
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS : NPE loopback successfully disabled
 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus 
ixEthAccPortNpeLoopbackDisable(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn IxEthAccStatus ixEthAccPortTxEnable(IxEthAccPortId portId)
 *
 * @brief Enable Tx on the port
 *
 * This function is the complement of ixEthAccPortTxDisable and should
 * be used only after Tx was disabled. A MAC core reset is required before
 * this function is called (see @a ixEthAccPortMacReset).
 *
 * This function is the recommended usage scenario for emergency security
 * shutdown and hardware failure recovery and should never be used for throttling 
 * traffic.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @pre
 *
 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
 * guaranteed to restore correct Ethernet Tx/Rx operation.
 *
 * @param portId : ID of the port 
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS : Tx successfully enabled
 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus 
ixEthAccPortTxEnable(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn IxEthAccStatus ixEthAccPortTxDisable(IxEthAccPortId portId)
 *
 * @brief Disable Tx on the port
 *
 * This function can be used to disable Tx in the MAC core.
 * Tx can be re-enabled, although this is not guaranteed, by performing
 * a MAC core reset (@a ixEthAccPortMacReset) and calling ixEthAccPortTxEnable.
 * Note that using this function is not recommended, except for shutting
 * down Tx for emergency reasons. For proper port shutdown and re-enabling
 * see ixEthAccPortEnable and ixEthAccPortDisable.
 *
 * This function is the recommended usage scenario for emergency security
 * shutdown and hardware failure recovery and should never be used for throttling 
 * traffic.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
 * guaranteed to restore correct Ethernet Tx/Rx operation.
 *
 * @pre
 *
 * @param portId : ID of the port 
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS : Tx successfully disabled
 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus 
ixEthAccPortTxDisable(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn IxEthAccStatus ixEthAccPortRxEnable(IxEthAccPortId portId)
 *
 * @brief Enable Rx on the port
 *
 * This function is the complement of ixEthAccPortRxDisable and should
 * be used only after Rx was disabled.
 *
 * This function is the recommended usage scenario for emergency security
 * shutdown and hardware failure recovery and should never be used for throttling 
 * traffic.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
 * guaranteed to restore correct Ethernet Tx/Rx operation.
 *
 * @pre
 *
 * @param portId : ID of the port 
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS : Rx successfully enabled
 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus 
ixEthAccPortRxEnable(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn IxEthAccStatus ixEthAccPortRxDisable(IxEthAccPortId portId)
 *
 * @brief Disable Rx on the port
 *
 * This function can be used to disable Rx in the MAC core.
 * Rx can be re-enabled, although this is not guaranteed, by performing
 * a MAC core reset (@a ixEthAccPortMacReset) and calling ixEthAccPortRxEnable.
 * Note that using this function is not recommended, except for shutting
 * down Rx for emergency reasons. For proper port shutdown and re-enabling
 * see ixEthAccPortEnable and ixEthAccPortDisable.
 *
 * This function is the recommended usage scenario for emergency security
 * shutdown and hardware failure recovery and should never be used for throttling 
 * traffic.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @pre
 *
 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
 * guaranteed to restore correct Ethernet Tx/Rx operation.
 *
 * @param portId : ID of the port 
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS : Rx successfully disabled
 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus 
ixEthAccPortRxDisable(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn IxEthAccStatus ixEthAccPortMacReset(IxEthAccPortId portId)
 *
 * @brief Reset MAC core on the port
 *
 * This function will perform a MAC core reset (NPE Ethernet coprocessor).
 * This function is inherently unsafe and the NPE recovery is not guaranteed
 * after this function is called. The proper manner of performing port disable
 * and enable (which will reset the MAC as well) is ixEthAccPortEnable/ixEthAccPortDisable.
 *
 * This function is the recommended usage scenario for hardware failure recovery
 * and should never be used for throttling traffic.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @pre
 *
 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
 * guaranteed to restore correct Ethernet Tx/Rx operation.
 *
 * @param portId : ID of the port 
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS : MAC core reset
 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus 
ixEthAccPortMacReset(IxEthAccPortId portId);

/*********************************************************************************
  ####    #####    ##     #####     #     ####    #####     #     ####    ####
 #          #     #  #      #       #    #          #       #    #    #  #
  ####      #    #    #     #       #     ####      #       #    #        ####
      #     #    ######     #       #         #     #       #    #            #
 #    #     #    #    #     #       #    #    #     #       #    #    #  #    #
  ####      #    #    #     #       #     ####      #       #     ####    ####
**********************************************************************************/


/**
 *
 * @brief This struct defines the statistics returned by this component.
 *
 * The component returns MIB2 EthObj variables which are obtained from the 
 * hardware or maintained by this component. 
 *
 *
 */
typedef struct   
{
    UINT32 dot3StatsAlignmentErrors;            /**< link error count (rx) */
    UINT32 dot3StatsFCSErrors;                  /**< link error count (rx) */
    UINT32 dot3StatsInternalMacReceiveErrors;   /**< link error count (rx) */
    UINT32 RxOverrunDiscards;                   /**< NPE: discarded frames count (rx) */
    UINT32 RxLearnedEntryDiscards;                /**< NPE: discarded frames count(rx)  */
    UINT32 RxLargeFramesDiscards;                 /**< NPE: discarded frames count(rx)  */
    UINT32 RxSTPBlockedDiscards;                  /**< NPE: discarded frames count(rx)  */
    UINT32 RxVLANTypeFilterDiscards;              /**< NPE: discarded frames count (rx) */
    UINT32 RxVLANIdFilterDiscards;                /**< NPE: discarded frames count (rx) */
    UINT32 RxInvalidSourceDiscards;               /**< NPE: discarded frames count (rx) */
    UINT32 RxBlackListDiscards;                   /**< NPE: discarded frames count (rx) */
    UINT32 RxWhiteListDiscards;                   /**< NPE: discarded frames count (rx) */
    UINT32 RxUnderflowEntryDiscards;              /**< NPE: discarded frames count (rx) */
    UINT32 dot3StatsSingleCollisionFrames;      /**< link error count (tx) */
    UINT32 dot3StatsMultipleCollisionFrames;    /**< link error count (tx) */
    UINT32 dot3StatsDeferredTransmissions;      /**< link error count (tx) */
    UINT32 dot3StatsLateCollisions;             /**< link error count (tx) */
    UINT32 dot3StatsExcessiveCollsions;         /**< link error count (tx) */
    UINT32 dot3StatsInternalMacTransmitErrors;  /**< link error count (tx) */
    UINT32 dot3StatsCarrierSenseErrors;         /**< link error count (tx) */
    UINT32 TxLargeFrameDiscards;                /**< NPE: discarded frames count (tx) */
    UINT32 TxVLANIdFilterDiscards;              /**< NPE: discarded frames count (tx) */

}IxEthEthObjStats;

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccMibIIStatsGet(IxEthAccPortId portId ,IxEthEthObjStats *retStats )
 *
 * @brief  Returns the statistics maintained for a port.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @pre
 *
 *
 * @param portId @ref IxEthAccPortId [in] 
 * @param retStats @ref IxEthEthObjStats [out]
 * @note Please note the user is responsible for cache coheriency of the retStat
 * buffer. The data is actually populated via the NPE's. As such cache safe
 * memory should be used in the retStats argument.
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_FAIL : Invalid arguments.
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccMibIIStatsGet(IxEthAccPortId portId, IxEthEthObjStats *retStats );

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccMibIIStatsGetClear(IxEthAccPortId portId, IxEthEthObjStats *retStats)
 * 
 * @brief  Returns and clears the statistics maintained for a port. 
 *
 * @li Reentrant    - yes
 * @li ISR Callable - yes
 *
 * @pre
 *
 * @param portId @ref IxEthAccPortId [in] 
 * @param retStats @ref IxEthEthObjStats [out]
 * @note Please note the user is responsible for cache coheriency of the retStats
 * buffer. The data is actually populated via the NPE's. As such cache safe
 * memory should be used in the retStats argument.
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_FAIL : invalid arguments.
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccMibIIStatsGetClear(IxEthAccPortId portId, IxEthEthObjStats *retStats);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccMibIIStatsClear(IxEthAccPortId portId)
 *
 * @brief   Clears the statistics maintained for a port.
 *
 * @li Reentrant    - yes
 * @li ISR Callable - no
 *
 * @pre
 *
 * @param portId @ref IxEthAccPortId [in]
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_FAIL : Invalid arguments.
 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
 *
 * <hr>
 */
PUBLIC IxEthAccStatus ixEthAccMibIIStatsClear(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccMacInit(IxEthAccPortId portId)
 * 
 * @brief Initializes the ethernet MAC settings 
 * 
 * @li Reentrant    - no
 * @li ISR Callable - no
 *
 * @param portId @ref IxEthAccPortId [in]
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_INVALID_PORT	:  portId is invalid.
 *
 * <hr>
 */
PUBLIC IxEthAccStatus ixEthAccMacInit(IxEthAccPortId portId);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccStatsShow(IxEthAccPortId portId)
 *
 *
 * @brief Displays a ports statistics on the standard io console using printf.
 *
 * @li Reentrant    - no
 * @li ISR Callable - no
 *
 * @pre
 *
 * @param portId @ref IxEthAccPortId [in]
 *
 * @return void
 *
 * <hr>
 */
PUBLIC void ixEthAccStatsShow(IxEthAccPortId portId);

/*************************************************************************

 #    #     #       #            #    #  #####      #     ####
 ##  ##     #       #            ##  ##  #    #     #    #    #
 # ## #     #       #            # ## #  #    #     #    #    #
 #    #     #       #            #    #  #    #     #    #    #
 #    #     #       #            #    #  #    #     #    #    #
 #    #     #       #            #    #  #####      #     ####

*************************************************************************/


/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccMiiReadRtn (UINT8 phyAddr, 
                           UINT8 phyReg, 
	                   UINT16 *value)
 *
 *
 * @brief Reads a 16 bit value from a PHY
 *
 * Reads a 16-bit word from a register of a MII-compliant PHY. Reading
 * is performed through the MII management interface.  This function returns
 * when the read operation has successfully completed, or when a timeout has elapsed.
 *
 * @li Reentrant    - no
 * @li ISR Callable - no
 *
 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
 *   
 * @param phyAddr UINT8 [in] - the address of the Ethernet PHY (0-31)
 * @param phyReg UINT8 [in] -  the number of the MII register to read (0-31)
 * @param value UINT16 [in] -  the value read from the register
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_FAIL : failed to read the register.
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccMiiReadRtn (UINT8 phyAddr, UINT8 phyReg, UINT16 *value);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccMiiWriteRtn (UINT8 phyAddr, 
                            UINT8 phyReg, 
	                    UINT16 value)
 *
 *
 * @brief Writes a 16 bit value to a PHY
 *
 * Writes a 16-bit word from a register of a MII-compliant PHY. Writing
 * is performed through the MII management interface.  This function returns
 * when the write operation has successfully completed, or when a timeout has elapsed.
 *
 * @li Reentrant    - no
 * @li ISR Callable - no
 *
 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
 *   
 * @param phyAddr UINT8 [in] - the address of the Ethernet PHY (0-31)
 * @param phyReg UINT8 [in] -  the number of the MII register to write (0-31)
 * @param value UINT16 [out] -  the value to write to the register
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_FAIL : failed to write register.
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccMiiWriteRtn (UINT8 phyAddr, UINT8 phyReg, UINT16 value);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccMiiAccessTimeoutSet(UINT32 timeout)
 *
 * @brief Overrides the default timeout value and retry count when reading or 
 * writing MII registers using ixEthAccMiiWriteRtn or ixEthAccMiiReadRtn
 *
 * The default behavior of the component is to use a IX_ETH_ACC_MII_10TH_SEC_IN_MILLIS ms
 * timeout (declared as 100 in IxEthAccMii_p.h) and a retry count of IX_ETH_ACC_MII_TIMEOUT_10TH_SECS
 * (declared as 5 in IxEthAccMii_p.h).
 *
 * The MII read and write functions will attempt to read the status of the register up
 * to the retry count times, delaying between each attempt with the timeout value.
 *
 * @li Reentrant    - no
 * @li ISR Callable - no
 *
 * @pre
 *
 * @param timeout UINT32 [in] - new timeout value, in milliseconds
 * @param timeout UINT32 [in] - new retry count (a minimum value of 1 must be used)
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_FAIL : invalid parameter(s)
 *
 * <hr>
 */
PUBLIC IxEthAccStatus
ixEthAccMiiAccessTimeoutSet(UINT32 timeout, UINT32 retryCount);

/**
 * @ingroup IxEthAcc
 *
 * @fn ixEthAccMiiStatsShow (UINT32 phyAddr)
 *
 *
 * @brief Displays detailed information on a specified PHY
 *
 * Displays the current values of the first eigth MII registers for a PHY, 
 *
 * @li Reentrant    - no
 * @li ISR Callable - no
 *
 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and 
 *      generating the MDIO clock.
 *   
 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
 *
 * @return IxEthAccStatus
 * @li @a IX_ETH_ACC_SUCCESS
 * @li @a IX_ETH_ACC_FAIL : invalid arguments.
 *
 * <hr>
 */
PUBLIC IxEthAccStatus ixEthAccMiiStatsShow (UINT32 phyAddr);



/******* BOARD SPECIFIC DEPRECATED API *********/

/* The following functions are high level functions which rely
 * on the properties and interface of some Ethernet PHYs. The
 * implementation is hardware specific and has been moved to 
 * the hardware-specific component IxEthMii.
 */

 #include "IxEthMii.h"

/**
 * @ingroup IxEthAcc
 *
 * @def  ixEthAccMiiPhyScan
 *
 * @brief : deprecated API entry point. This definition 
 * ensures backward compatibility
 *
 * See @ref ixEthMiiPhyScan
 *
 * @note this feature is board specific
 *
 */
#define ixEthAccMiiPhyScan(phyPresent) ixEthMiiPhyScan(phyPresent,IXP425_ETH_ACC_MII_MAX_ADDR)

/**
 * @ingroup IxEthAcc
 *
 * @def ixEthAccMiiPhyConfig
 *
 * @brief : deprecated API entry point. This definition 
 * ensures backward compatibility
 *
 * See @ref ixEthMiiPhyConfig
 *
 * @note this feature is board specific
 */
#define ixEthAccMiiPhyConfig(phyAddr,speed100,fullDuplex,autonegotiate) \
           ixEthMiiPhyConfig(phyAddr,speed100,fullDuplex,autonegotiate)

/**
 * @ingroup IxEthAcc
 *
 * @def ixEthAccMiiPhyReset
 *
 * @brief : deprecated API entry point. This definition 
 * ensures backward compatibility
 *
 * See @ref ixEthMiiPhyReset
 *
 * @note this feature is board specific
 */
#define ixEthAccMiiPhyReset(phyAddr) \
           ixEthMiiPhyReset(phyAddr)

/**
 * @ingroup IxEthAcc
 *
 * @def ixEthAccMiiLinkStatus
 *
 * @brief : deprecated API entry point. This definition 
 * ensures backward compatibility
 *
 * See @ref ixEthMiiLinkStatus
 *
 * @note this feature is board specific
 */
#define ixEthAccMiiLinkStatus(phyAddr,linkUp,speed100,fullDuplex,autoneg) \
           ixEthMiiLinkStatus(phyAddr,linkUp,speed100,fullDuplex,autoneg)



/**
 * @ingroup IxEthAcc
 *
 * @def ixEthAccMiiShow  
 *
 * @brief : deprecated API entry point. This definition 
 * ensures backward compatibility
 *
 * See @ref ixEthMiiPhyShow
 *
 * @note this feature is board specific
 */
#define ixEthAccMiiShow(phyAddr) \
        ixEthMiiPhyShow(phyAddr)

#endif /* ndef IxEthAcc_H */
/**
 *@}
 */