MCUSW
Eth.h
Go to the documentation of this file.
1 /*
2 *
3 * Copyright (c) 2019 Texas Instruments Incorporated
4 *
5 * All rights reserved not granted herein.
6 *
7 * Limited License.
8 *
9 * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
10 * license under copyrights and patents it now or hereafter owns or controls to make,
11 * have made, use, import, offer to sell and sell ("Utilize") this software subject to the
12 * terms herein. With respect to the foregoing patent license, such license is granted
13 * solely to the extent that any such patent is necessary to Utilize the software alone.
14 * The patent license shall not apply to any combinations which include this software,
15 * other than combinations with devices manufactured by or for TI ("TI Devices").
16 * No hardware patent is licensed hereunder.
17 *
18 * Redistributions must preserve existing copyright notices and reproduce this license
19 * (including the above copyright notice and the disclaimer and (if applicable) source
20 * code license limitations below) in the documentation and/or other materials provided
21 * with the distribution
22 *
23 * Redistribution and use in binary form, without modification, are permitted provided
24 * that the following conditions are met:
25 *
26 * * No reverse engineering, decompilation, or disassembly of this software is
27 * permitted with respect to any software provided in binary form.
28 *
29 * * any redistribution and use are licensed by TI for use only with TI Devices.
30 *
31 * * Nothing shall obligate TI to provide you with source code for the software
32 * licensed and provided to you in object code.
33 *
34 * If software source code is provided to you, modification and redistribution of the
35 * source code are permitted provided that the following conditions are met:
36 *
37 * * any redistribution and use of the source code, including any resulting derivative
38 * works, are licensed by TI for use only with TI Devices.
39 *
40 * * any redistribution and use of any object code compiled from the source code
41 * and any resulting derivative works, are licensed by TI for use only with TI Devices.
42 *
43 * Neither the name of Texas Instruments Incorporated nor the names of its suppliers
44 *
45 * may be used to endorse or promote products derived from this software without
46 * specific prior written permission.
47 *
48 * DISCLAIMER.
49 *
50 * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
51 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
52 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
53 * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
54 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
55 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
57 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
58 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
59 * OF THE POSSIBILITY OF SUCH DAMAGE.
60 *
61 */
62 
91 /*
92  * Below are the generic requirements met by this Eth driver which can't be
93  * mapped to a specific piece of code
94  */
95 /*
96  * Design: ETH_DesignId_001
97  * Requirements: MCAL-1519, MCAL-1520, MCAL-1522, MCAL-1523,
98  * MCAL-1525, MCAL-1526, MCAL-1531, MCAL-1614,
99  * MCAL-1635, MCAL-1636, MCAL-1703, MCAL-981
100  */
101 
102 #ifndef ETH_H_
103 #define ETH_H_
104 
105 /* ========================================================================== */
106 /* Include Files */
107 /* ========================================================================== */
108 
109 /*
110  * Design: ETH_DesignId_001
111  * Requirements: MCAL-1635
112  */
113 #include "Eth_GeneralTypes.h"
114 #include "ComStack_Types.h"
115 #include <Eth_Packet.h>
116 
117 #ifdef __cplusplus
118 extern "C"
119 {
120 #endif
121 
122 /* ========================================================================== */
123 /* Macros & Typedefs */
124 /* ========================================================================== */
125 
132 /*
133  * Design: ETH_DesignId_001
134  * Requirements: MCAL-1522
135  */
137 #define ETH_SW_MAJOR_VERSION (1U)
138 
139 #define ETH_SW_MINOR_VERSION (2U)
140 
141 #define ETH_SW_PATCH_VERSION (1U)
142 /* @} */
143 
151 #define ETH_AR_RELEASE_MAJOR_VERSION (4U)
152 
153 #define ETH_AR_RELEASE_MINOR_VERSION (3U)
154 
155 #define ETH_AR_RELEASE_REVISION_VERSION (1U)
156 /* @} */
157 
163 #define ETH_VENDOR_ID ((uint16) 44U)
164 
165 #define ETH_MODULE_ID ((uint16) 88U)
166 
167 #define ETH_INSTANCE_ID ((uint8) 0U)
168 /* @} */
169 
176 /*
177  * Design: ETH_DesignId_001
178  * Requirements: MCAL-1519
179  */
181 #define ETH_CONTROLLER_ID_0 (0U)
182 
183 /* @} */
184 
192 /*
193  * Design: ETH_DesignId_003
194  * Requirements: MCAL-1530
195  */
196 #ifndef ETH_E_INV_CTRL_IDX
197 
198 #define ETH_E_INV_CTRL_IDX ((uint8) 0x01U)
199 #endif
200 #ifndef ETH_E_UNINIT
201 
202 #define ETH_E_UNINIT ((uint8) 0x02U)
203 #endif
204 #ifndef ETH_E_PARAM_POINTER
205 
206 #define ETH_E_PARAM_POINTER ((uint8) 0x03U)
207 #endif
208 #ifndef ETH_E_INV_PARAM
209 
210 #define ETH_E_INV_PARAM ((uint8) 0x04U)
211 #endif
212 #ifndef ETH_E_INV_MODE
213 
214 #define ETH_E_INV_MODE ((uint8) 0x05U)
215 #endif
216 #ifndef ETH_E_VIRTMAC_APIMISMATCH
217 
218 #define ETH_E_VIRTMAC_APIMISMATCH ((uint8) 0x07U)
219 #endif
220 #ifndef ETH_E_VIRTMAC_RPCCMDFAILED
221 
222 #define ETH_E_VIRTMAC_RPCCMDFAILED ((uint8) 0x08U)
223 #endif
224 #ifndef ETH_E_VIRTMAC_UNSUPPORTECLIENTNOTIFY
225 
226 #define ETH_E_VIRTMAC_UNSUPPORTECLIENTNOTIFY ((uint8) 0x09U)
227 #endif
228 #ifndef ETH_E_VIRTMAC_UNSUPPORTEDSRVCMD
229 
230 #define ETH_E_VIRTMAC_UNSUPPORTEDSRVCMD ((uint8) 0x0AU)
231 #endif
232 #ifndef ETH_E_BUSY
233 
234 #define ETH_E_BUSY ((uint8) 0x0BU)
235 #endif
236 
237 /* @} */
238 
253 #define ETH_SID_INIT ((uint8) 0x01U)
254 
256 #define ETH_SID_SET_CONTROLLER_MODE ((uint8) 0x03U)
257 
259 #define ETH_SID_GET_CONTROLLER_MODE ((uint8) 0x04U)
260 
262 #define ETH_SID_WRITE_MII ((uint8) 0x05U)
263 
265 #define ETH_SID_READ_MII ((uint8) 0x06U)
266 
268 #define ETH_SID_GET_PHYS_ADDR ((uint8) 0x08U)
269 
271 #define ETH_SID_PROVIDE_TX_BUFFER ((uint8) 0x09U)
272 
274 /* REVISIT: Same as below? */
275 #define ETH_SID_MAIN_FUNCTION ((uint8) 0x0AU)
276 
278 #define ETH_SID_TRANSMIT ((uint8) 0x0BU)
279 
281 #define ETH_SID_RECEIVE ((uint8) 0x0CU)
282 
284 #define ETH_SID_TX_CONFIRMATION ((uint8) 0x0EU)
285 
287 #define ETH_SID_GET_VERSION_INFO ((uint8) 0x0FU)
288 
290 #define ETH_SID_RX_IRQ_HDLR ((uint8) 0x10U)
291 
293 #define ETH_SID_TX_IRQ_HDLR ((uint8) 0x11U)
294 
296 #define ETH_SID_UPDATE_PHYS_ADDR_FILTER ((uint8) 0x12U)
297 
299 #define ETH_SID_SET_PHYS_ADDR ((uint8) 0x13U)
300 
302 #define ETH_SID_GET_COUNTER_VALUES ((uint8) 0x14U)
303 
305 #define ETH_SID_GET_RX_STATS ((uint8) 0x15U)
306 
308 #define ETH_SID_GET_TX_STATS ((uint8) 0x1CU)
309 
311 #define ETH_SID_GET_TXERROR_COUNTERVALUES ((uint8) 0x1DU)
312 
314 #define ETH_SID_GET_CURRENT_TIME ((uint8) 0x16U)
315 
317 #define ETH_SID_ENABLE_EGRESS_TIMESTAMP ((uint8) 0x17U)
318 
320 #define ETH_SID_GET_EGRESS_TIMESTAMP ((uint8) 0x18U)
321 
323 #define ETH_SID_GET_INGRESS_TIMESTAMP ((uint8) 0x19U)
324 
326 #define ETH_SID_SET_CORRECTION_TIME ((uint8) 0x1AU)
327 
329 #define ETH_SID_SET_GLOBAL_TIME ((uint8) 0x1BU)
330 
332 #define ETH_SID_DISPATCH_VIRTMAC_INIT ((uint8) 0x1CU)
333 
335 #define ETH_SID_DISPATCH_VIRTMAC_DEINIT ((uint8) 0x1DU)
336 
338 #define ETH_SID_NOTIFY_VIRTMAC_MSGRECV ((uint8) 0x1EU)
339 
341 #define ETH_SID_DISPATCH_VIRTMAC_SUBSCRIBE_ALLTRAFFIC ((uint8) 0x1FU)
342 
344 #define ETH_SID_DISPATCH_VIRTMAC_UNSUBSCRIBE_ALLTRAFFIC ((uint8) 0x20U)
345 
347 #define ETH_SID_DISPATCH_VIRTMAC_SUBSCRIBE_DSTMAC ((uint8) 0x21U)
348 
350 #define ETH_SID_DISPATCH_VIRTMAC_UNSUBSCRIBE_DSTMAC ((uint8) 0x22U)
351 
353 #define ETH_SID_DISPATCH_VIRTMAC_IPV4_MACADDR_ASSOCIATE ((uint8) 0x23U)
354 
356 #define ETH_SID_DISPATCH_VIRTMAC_IPV4_MACADDR_DISASSOCIATE ((uint8) 0x24U)
357 
359 #define ETH_SID_DISPATCH_VIRTMAC_ADD_UNICAST_MACADDR ((uint8) 0x25U)
360 
362 #define ETH_SID_DISPATCH_VIRTMAC_ADD_MCAST_MACADDR ((uint8) 0x26U)
363 
365 #define ETH_SID_DISPATCH_VIRTMAC_DEL_MACADDR ((uint8) 0x27U)
366 
368 #define ETH_SID_DISPATCH_VIRTMAC_ADD_VLAN ((uint8) 0x28U)
369 
371 #define ETH_SID_DISPATCH_VIRTMAC_DEL_VLAN ((uint8) 0x29U)
372 
374 #define ETH_SID_SEND_CUSTOM_NOTIFY ((uint8) 0x2AU)
375 
377 #define ETH_SID_TRANSMIT_NO_COPY ((uint8) 0x2BU)
378 
380 #define ETH_SID_RETRIEVE_RX_READY_QUEUE ((uint8) 0x2CU)
381 
383 #define ETH_SID_SUBMIT_RX_FREE_QUEUE ((uint8) 0x2DU)
384 
386 #define ETH_SID_SUBMIT_TX_READY_QUEUE ((uint8) 0x2EU)
387 
389 #define ETH_SID_RETRIEVE_TX_DONE_QUEUE ((uint8) 0x2FU)
390 
392 #define ETH_SID_VIRTMAC_RPC_INIT ((uint8) 0x2BU)
393 
394 /* @} */
395 /* @} */
396 
397 /* ========================================================================== */
398 /* Structures and Enums */
399 /* ========================================================================== */
400 
401 /* None */
402 
403 /* ========================================================================== */
404 /* Function Declarations */
405 /* ========================================================================== */
406 
425 FUNC(void, ETH_CODE)
426 Eth_Init(P2CONST(Eth_ConfigType, AUTOMATIC, ETH_PBCFG) CfgPtr);
427 
453 FUNC(Std_ReturnType, ETH_CODE)
454 Eth_SetControllerMode(uint8 CtrlIdx,
455  Eth_ModeType CtrlMode);
456 
481 FUNC(Std_ReturnType, ETH_CODE)
482 Eth_GetControllerMode(uint8 CtrlIdx,
483  P2VAR(Eth_ModeType, AUTOMATIC, ETH_APPL_DATA) CtrlModePtr);
484 
508 FUNC(void, ETH_CODE)
509 Eth_GetPhysAddr(uint8 CtrlIdx,
510  P2VAR(uint8, AUTOMATIC, ETH_APPL_DATA) PhysAddrPtr);
511 
536 FUNC(void, ETH_CODE)
537 Eth_SetPhysAddr(uint8 CtrlIdx,
538  P2CONST(uint8, AUTOMATIC, ETH_APPL_DATA) PhysAddrPtr);
539 
540 #if (STD_ON == ETH_UPDATE_PHYS_ADDR_FILTER_API)
541 
571 FUNC(Std_ReturnType, ETH_CODE)
572 Eth_UpdatePhysAddrFilter(uint8 CtrlIdx,
573  P2VAR(uint8, AUTOMATIC, ETH_APPL_DATA) PhysAddrPtr,
574  Eth_FilterActionType Action);
575 #endif /* (STD_ON == ETH_UPDATE_PHYS_ADDR_FILTER_API) */
576 
577 #if (STD_ON == ETH_ENABLE_MII_API)
578 
608 FUNC(Std_ReturnType, ETH_CODE)
609 Eth_WriteMii(uint8 CtrlIdx,
610  uint8 TrcvIdx,
611  uint8 RegIdx,
612  uint16 RegVal);
613 
643 FUNC(Std_ReturnType, ETH_CODE)
644 Eth_ReadMii(uint8 CtrlIdx,
645  uint8 TrcvIdx,
646  uint8 RegIdx,
647  P2VAR(uint16, AUTOMATIC, ETH_APPL_DATA) RegValPtr);
648 #endif /* (STD_ON == ETH_ENABLE_MII_API) */
649 
650 #if (STD_ON == ETH_GET_COUNTER_VALUES_API)
651 
673 FUNC(Std_ReturnType, ETH_CODE)
674 Eth_GetCounterValues(uint8 CtrlIdx,
675  Eth_CounterType* CounterPtr);
676 #endif /* (STD_ON == ETH_GET_COUNTER_VALUES_API) */
677 
678 #if (STD_ON == ETH_GET_RX_STATS_API)
679 
703 FUNC(Std_ReturnType, ETH_CODE)
704 Eth_GetRxStats(uint8 CtrlIdx,
705  P2VAR(Eth_RxStatsType, AUTOMATIC, ETH_APPL_DATA) RxStats);
706 #endif /* (STD_ON == ETH_GET_RX_STATS_API) */
707 
708 #if (STD_ON == ETH_GET_TX_STATS_API)
709 
733 FUNC(Std_ReturnType, ETH_CODE)
734 Eth_GetTxStats(uint8 CtrlIdx,
735  P2VAR(Eth_TxStatsType, AUTOMATIC, ETH_APPL_DATA) TxStats);
736 #endif /* (STD_ON == ETH_GET_TX_STATS_API) */
737 
738 #if (STD_ON == ETH_GET_TX_ERROR_COUNTERSVALUES_API)
739 
761 FUNC(Std_ReturnType, ETH_CODE)
762 Eth_GetTxErrorCounterValues(uint8 CtrlIdx,
763  P2VAR(Eth_TxErrorCounterValuesType, AUTOMATIC, ETH_APPL_DATA) TxErrorCounterValues);
764 #endif
765 
766 #if (STD_ON == ETH_GLOBALTIMESUPPORT_API)
767 
794 FUNC(Std_ReturnType, ETH_CODE)
795 Eth_GetCurrentTime(uint8 CtrlIdx,
796  P2VAR(Eth_TimeStampQualType, AUTOMATIC, ETH_APPL_DATA) timeQualPtr,
797  P2VAR(Eth_TimeStampType, AUTOMATIC, ETH_APPL_DATA) timeStampPtr);
798 
827 FUNC(void, ETH_CODE)
828 Eth_EnableEgressTimeStamp(uint8 CtrlIdx, uint8 BufIdx);
829 
859 FUNC(void, ETH_CODE)
860 Eth_GetEgressTimeStamp(uint8 CtrlIdx,
861  uint8 BufIdx,
862  P2VAR(Eth_TimeStampQualType, AUTOMATIC, ETH_APPL_DATA) timeQualPtr,
863  P2VAR(Eth_TimeStampType, AUTOMATIC, ETH_APPL_DATA) timeStampPtr);
864 
894 FUNC(void, ETH_CODE)
895 Eth_GetIngressTimeStamp(uint8 CtrlIdx,
896  P2VAR(Eth_DataType, AUTOMATIC, ETH_APPL_DATA) DataPtr,
897  P2VAR(Eth_TimeStampQualType, AUTOMATIC, ETH_APPL_DATA) timeQualPtr,
898  P2VAR(Eth_TimeStampType, AUTOMATIC, ETH_APPL_DATA) timeStampPtr);
899 
931 FUNC(void, ETH_CODE)
932 Eth_SetCorrectionTime(uint8 CtrlIdx,
933  P2VAR(Eth_TimeIntDiffType, AUTOMATIC, ETH_APPL_DAT) timeOffsetPtr,
934  P2VAR(Eth_RateRatioType, AUTOMATIC, ETH_APPL_DAT) rateRatioPtr);
935 
963 FUNC(Std_ReturnType, ETH_CODE)
964 Eth_SetGlobalTime(uint8 CtrlIdx,
965  P2VAR(Eth_TimeStampType, AUTOMATIC, ETH_APPL_DAT) timeStampPtr);
966 #endif /* (STD_ON == ETH_GLOBALTIMESUPPORT_API) */
967 
968 #if (STD_OFF == ETH_USE_Q_APIS)
969 
1002 FUNC(BufReq_ReturnType, ETH_CODE)
1003 Eth_ProvideTxBuffer(uint8 CtrlIdx,
1004  uint8 Priority,
1005  P2VAR(Eth_BufIdxType, AUTOMATIC, ETH_APPL_DAT) BufIdxPtr,
1006  P2VAR(uint8, AUTOMATIC, ETH_APPL_DAT) *BufPtr,
1007  P2VAR(uint16, AUTOMATIC, ETH_APPL_DAT) LenBytePtr);
1008 #endif /* (STD_OFF == ETH_USE_Q_APIS) */
1009 
1010 #if (STD_OFF == ETH_USE_Q_APIS)
1011 
1044 FUNC(Std_ReturnType, ETH_CODE)
1045 Eth_Transmit(uint8 CtrlIdx,
1046  Eth_BufIdxType BufIdx,
1047  Eth_FrameType FrameType,
1048  boolean TxConfirmation,
1049  uint16 LenByte,
1050  P2VAR(uint8, AUTOMATIC, ETH_APPL_DAT) PhysAddrPtr);
1051 #endif /* (STD_ON == ETH_USE_Q_APIS) */
1052 
1053 #if ((STD_ON == ETH_ZERO_COPY_TX) && (STD_OFF == ETH_USE_Q_APIS))
1054 
1085 FUNC(Std_ReturnType, ETH_CODE)
1086 Eth_TransmitNoCpy(uint8 CtrlIdx,
1087  P2VAR(uint8, AUTOMATIC, ETH_APPL_DAT) BufPtr,
1088  Eth_FrameType FrameType,
1089  uint16 LenByte,
1090  P2VAR(uint8, AUTOMATIC, ETH_APPL_DAT) PhysAddrPtr);
1091 #endif /* ((STD_ON == ETH_ZERO_COPY_TX) && (STD_OFF == ETH_USE_Q_APIS)) */
1092 
1093 #if (STD_OFF == ETH_USE_Q_APIS)
1094 
1118 FUNC(void, ETH_CODE)
1119 Eth_Receive(uint8 CtrlIdx,
1120  uint8 FifoIdx,
1121  P2VAR(Eth_RxStatusType, AUTOMATIC, ETH_APPL_DAT) RxStatusPtr);
1122 #endif /* (STD_OFF == ETH_USE_Q_APIS) */
1123 
1143 FUNC(void, ETH_CODE)
1144 Eth_TxConfirmation(uint8 CtrlIdx);
1145 
1146 #if (STD_ON == ETH_VERSION_INFO_API)
1147 
1166 FUNC(void, ETH_CODE)
1167 Eth_GetVersionInfo(P2VAR(Std_VersionInfoType, AUTOMATIC, ETH_APPL_DATA) VersionInfo);
1168 #endif /* (STD_ON == ETH_VERSION_INFO_API) */
1169 
1186 FUNC(void, ETH_CODE)
1187 Eth_MainFunction(void);
1188 
1189 #if (STD_ON == ETH_VIRTUALMAC_SUPPORT)
1190 
1225 FUNC(Std_ReturnType, ETH_CODE)
1226 Eth_VirtMacRpcInit(P2CONST(Eth_ConfigType, AUTOMATIC, ETH_PBCFG) CfgPtr);
1227 #endif /* (STD_ON == ETH_VIRTUALMAC_SUPPORT) */
1228 
1229 #if (STD_ON == ETH_VIRTUALMAC_SUPPORT)
1230 
1266 FUNC(Std_ReturnType, ETH_CODE)
1267 Eth_DispatchVirtmacInit(uint8 CtrlIdx);
1268 #endif /* (STD_ON == ETH_VIRTUALMAC_SUPPORT) */
1269 
1270 #if (STD_ON == ETH_VIRTUALMAC_SUPPORT)
1271 
1297 FUNC(Std_ReturnType, ETH_CODE)
1298 Eth_DispatchVirtmacDeinit(uint8 CtrlIdx);
1299 #endif /* (STD_ON == ETH_VIRTUALMAC_SUPPORT) */
1300 
1301 #if ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_NOTIFYMSGRECEIVED_API))
1302 
1336 FUNC(Std_ReturnType, ETH_CODE)
1337 Eth_NotifyVirtmacMsgReceived(uint8 CtrlIdx);
1338 #endif /* ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_NOTIFYMSGRECEIVED_API)) */
1339 
1340 #if ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_SUBSCRIBEALLTRAFFIC_API))
1341 
1387 FUNC(Std_ReturnType, ETH_CODE)
1389 #endif /* ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_SUBSCRIBEALLTRAFFIC_API)) */
1390 
1391 #if ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_UNSUBSCRIBEALLTRAFFIC_API))
1392 
1441 FUNC(Std_ReturnType, ETH_CODE)
1443 #endif /* ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_UNSUBSCRIBEALLTRAFFIC_API)) */
1444 
1445 #if ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_SUBSCRIBEDSTMAC_API))
1446 
1500 FUNC(Std_ReturnType, ETH_CODE)
1501 Eth_DispatchVirtmacSubscribeDstMac(uint8 CtrlIdx, uint8 *macAddress);
1502 #endif /* ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_SUBSCRIBEDSTMAC_API)) */
1503 
1504 #if ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_UNSUBSCRIBEDSTMAC_API))
1505 
1559 FUNC(Std_ReturnType, ETH_CODE)
1560 Eth_DispatchVirtmacUnsubscribeDstMac(uint8 CtrlIdx, uint8 *macAddress);
1561 #endif /* ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_UNSUBSCRIBEDSTMAC_API)) */
1562 
1563 #if ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_ASSOCIATEIPV4MACADDR_API))
1564 
1613 FUNC(Std_ReturnType, ETH_CODE)
1614 Eth_DispatchVirtmacAssociateIPv4Macaddr(uint8 CtrlIdx, uint8 *ipv4Address, uint8 *macAddress);
1615 #endif /* ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_ASSOCIATEIPV4MACADDR_API)) */
1616 
1617 
1618 #if ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_DISASSOCIATEIPV4MACADDR_API))
1619 
1665 FUNC(Std_ReturnType, ETH_CODE)
1666 Eth_DispatchVirtmacDisassociateIPv4Macaddr(uint8 CtrlIdx, uint8 *ipv4Address);
1667 #endif /* ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_DISASSOCIATEIPV4MACADDR_API)) */
1668 
1669 #if ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_ADD_UNICAST_MACADDR_API))
1670 
1715 FUNC(Std_ReturnType, ETH_CODE)
1716 Eth_DispatchVirtmacAddUnicastAddr(uint8 CtrlIdx, uint8 *macAddress, Eth_PortType port , uint32 vlanId);
1717 #endif /* ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_ADD_UNICAST_MACADDR_API)) */
1718 
1719 #if ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_ADD_MCAST_MACADDR_API))
1720 
1766 FUNC(Std_ReturnType, ETH_CODE)
1767 Eth_DispatchVirtmacAddMcastAddr(uint8 CtrlIdx, uint8 *macAddress, uint32 numLsbToIgnore, uint32 vlanId, Eth_PortListType *portList);
1768 #endif /* ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_ADD_MCAST_MACADDR_API)) */
1769 
1770 #if ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_DEL_MACADDR_API))
1771 /*
1772  * \brief Dispatch virtual mac removal of given mac address from switch address resolution table request to ethernet firmware
1773  *
1774  * \verbatim
1775  * Service name : Eth_DispatchVirtmacDelAddr
1776  * Syntax : Std_ReturnType Eth_DispatchVirtmacDelAddr(uint8 CtrlIdx, uint8 *macAddress, uint32 vlanId)
1777  * Service ID[hex] : 0x27
1778  * Sync/Async : Asynchronous
1779  * Reentrancy : Non-Reentrant
1780  * Parameters (in) : CtrlIdx: Index of the controller within the context of the
1781  * Ethernet Driver
1782  * macAddress: Mac address to be deleted from the switch address resolution table
1783  * vlanId: Vlan Id associated with the mac Address. If vlan id is not needed, 0 should be passed
1784  * Parameters (inout): None
1785  * Parameters (out) : None
1786  * Return value : Std_ReturnType
1787  * E_OK: success
1788  * E_NOT_OK: transmission failed
1789  *
1790  * Description : The function dispatches RPC command to ethernet
1791  * firmware core to remove the given multicast macaddress
1792  * and vlan id from the switch address resolution table
1793  * On removal of entry switch would switch frames
1794  * received with the given destination macAddress:
1795  * vlan id combo by flooding to all the ports in vlan membership.
1796  * Address should have been added previously using Eth_DispatchVirtmacAddMcastAddr()/
1797  * Eth_DispatchVirtmacAddUnicastAddr()
1798  * If configured in virtual mac mode application should
1799  * invoke this API as follows:
1800  * 1. Eth_VirtMacRpcInit()
1801  * 2. Wait for fwRegisteredCb() callback
1802  * 3. Eth_DispatchVirtmacInit
1803  * 4. Wait for rpcCmdComplete() callback with status E_OK
1804  * 5. Eth_Init()
1805  * 6. Eth_DispatchVirtmacSubscribeDstMac()
1806  * 7. Wait for rpcCmdComplete() callback with status E_OK
1807  * 8. Eth_DispatchVirtmacAddMcastAddr()/Eth_DispatchVirtmacAddUnicastAddr()
1808  * 9. Wait for rpcCmdComplete() callback with status E_OK
1809  * 10. Eth_DispatchVirtmacDelAddr()
1810  * 11. Wait for rpcCmdComplete() callback with status E_OK
1811  * The callbacks fwRegisteredCb() and rpcCmdComplete() are
1812  * populated by the application as part of the Eth_ConfigType
1813  * structure
1814  * \endverbatim
1815  */
1816 FUNC(Std_ReturnType, ETH_CODE)
1817 Eth_DispatchVirtmacDelAddr(uint8 CtrlIdx, uint8 *macAddress, uint32 vlanId);
1818 #endif /* ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_DEL_MACADDR_API)) */
1819 
1820 #if ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_ADD_VLAN_API))
1821 
1875 FUNC(Std_ReturnType, ETH_CODE)
1876 Eth_DispatchVirtmacAddVlan(uint8 CtrlIdx, uint32 vlanId, Eth_PortListType *portList);
1877 #endif /* ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_ADD_VLAN_API)) */
1878 
1879 #if ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_DEL_VLAN_API))
1880 /*
1881  * \brief Dispatch virtual mac removal of given vlanid from switch address resolution table request to ethernet firmware
1882  *
1883  * \verbatim
1884  * Service name : Eth_DispatchVirtmacDelVlan
1885  * Syntax : Std_ReturnType Eth_DispatchVirtmacDelVlan(uint8 CtrlIdx, uint32 vlanId)
1886  * Service ID[hex] : 0x29
1887  * Sync/Async : Asynchronous
1888  * Reentrancy : Non-Reentrant
1889  * Parameters (in) : CtrlIdx: Index of the controller within the context of the
1890  * Ethernet Driver
1891  * vlanId: Vlan Id which is to be removed from switch VLAN membership table
1892  * Parameters (inout): None
1893  * Parameters (out) : None
1894  * Return value : Std_ReturnType
1895  * E_OK: success
1896  * E_NOT_OK: transmission failed
1897  *
1898  * Description : The function dispatches RPC command to ethernet
1899  * firmware core to remove the given vlan id
1900  * from the switch vlan membership table
1901  * On removal of vlan membership entry switch would treat any
1902  * frame received with the given vlan as per unknownVlanMembership mask configured in
1903  * switch.Vlan id should have been added previously using Eth_DispatchVirtmacAddVlan()
1904  * If configured in virtual mac mode application should
1905  * invoke this API as follows:
1906  * 1. Eth_VirtMacRpcInit()
1907  * 2. Wait for fwRegisteredCb() callback
1908  * 3. Eth_DispatchVirtmacInit
1909  * 4. Wait for rpcCmdComplete() callback with status E_OK
1910  * 5. Eth_Init()
1911  * 6. Eth_DispatchVirtmacSubscribeDstMac()
1912  * 7. Wait for rpcCmdComplete() callback with status E_OK
1913  * 8. Eth_DispatchVirtmacAddVlan()
1914  * 9. Wait for rpcCmdComplete() callback with status E_OK
1915  * 10. Eth_DispatchVirtmacDelVlan()
1916  * 11. Wait for rpcCmdComplete() callback with status E_OK
1917  * The callbacks fwRegisteredCb() and rpcCmdComplete() are
1918  * populated by the application as part of the Eth_ConfigType
1919  * structure
1920  * \endverbatim
1921  */
1922 FUNC(Std_ReturnType, ETH_CODE)
1923 Eth_DispatchVirtmacDelVlan(uint8 CtrlIdx, uint32 vlanId);
1924 #endif /* ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_DEL_VLAN_API)) */
1925 
1926 
1927 #if ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_SEND_CUSTOM_NOTIFY_API))
1928 /*
1929  * \brief Send a custom notification to the ethernet firmware with given notify info and notify len
1930  *
1931  * \verbatim
1932  * Service name : Eth_SendCustomNotify
1933  * Syntax : Std_ReturnType Eth_SendCustomNotify(uint8 CtrlIdx, void *notifyInfo, uint32 notifyLen)
1934  * Service ID[hex] : 0x28
1935  * Sync/Async : Asynchronous
1936  * Reentrancy : Non-Reentrant
1937  * Parameters (in) : CtrlIdx: Index of the controller within the context of the
1938  * Ethernet Driver
1939  * notifyInfo: Notify info to be sent
1940  * notifyLen: Notify length
1941  * Parameters (inout): None
1942  * Parameters (out) : None
1943  * Return value : Std_ReturnType
1944  * E_OK: success
1945  * E_NOT_OK: transmission failed
1946  *
1947  * Description : The function send a custom notify msg to the ethernet firmware.
1948  * Notify msgs are msgs which do not require response from ethernet firmware.
1949  * The notify info format should mstch the format expected by ethernet firmware application.
1950  * The driver does not interpret the notify info.This API
1951  * is typically used to send some debug info to the ethernet firmware like CPU load, request to dump switch statistics on UART console etc.
1952  * If configured in virtual mac mode application should
1953  * invoke this API as follows:
1954  * 1. Eth_VirtMacRpcInit()
1955  * 2. Wait for fwRegisteredCb() callback
1956  * 3. Eth_DispatchVirtmacInit
1957  * 4. Wait for rpcCmdComplete() callback with status E_OK
1958  * 5. Eth_SendCustomNotify()
1959  * The callbacks fwRegisteredCb() and rpcCmdComplete() are
1960  * populated by the application as part of the Eth_ConfigType
1961  * structure
1962  * \endverbatim
1963  */
1964 FUNC(Std_ReturnType, ETH_CODE)
1965 Eth_SendCustomNotify(uint8 CtrlIdx, void *notifyInfo, uint32 notifyLen);
1966 #endif /* ((STD_ON == ETH_VIRTUALMAC_SUPPORT) && (STD_ON == ETH_VIRTUALMAC_SEND_CUSTOM_NOTIFY_API)) */
1967 
1968 #if (STD_ON == ETH_USE_Q_APIS)
1969 
1993 FUNC(Std_ReturnType, ETH_CODE)
1994 Eth_RetrieveRxReadyQ(uint8 CtrlIdx,
1995  Eth_PktQ *retrievePktQ);
1996 #endif /* (STD_ON == ETH_USE_Q_APIS) */
1997 
1998 #if (STD_ON == ETH_USE_Q_APIS)
1999 
2025 FUNC(Std_ReturnType, ETH_CODE)
2026 Eth_SubmitRxFreeQ(uint8 CtrlIdx,
2027  Eth_PktQ *submitPktQ);
2028 #endif /* (STD_ON == ETH_USE_Q_APIS) */
2029 
2030 #if (STD_ON == ETH_USE_Q_APIS)
2031 
2056 FUNC(Std_ReturnType, ETH_CODE)
2057 Eth_SubmitTxReadyQ(uint8 CtrlIdx,
2058  Eth_PktQ *submitPktQ);
2059 #endif /* (STD_ON == ETH_USE_Q_APIS) */
2060 
2061 #if (STD_ON == ETH_USE_Q_APIS)
2062 
2089 FUNC(Std_ReturnType, ETH_CODE)
2090 Eth_RetrieveTxDoneQ(uint8 CtrlIdx,
2091  Eth_PktQ *retrievePktQ);
2092 #endif /* (STD_ON == ETH_USE_Q_APIS) */
2093 
2094 #ifdef __cplusplus
2095 }
2096 #endif
2097 
2098 #endif /* ETH_H_ */
2099 
2100 /* @} */
Std_ReturnType Eth_DispatchVirtmacSubscribeDstMac(uint8 CtrlIdx, uint8 *macAddress)
Dispatch virtual mac destination mac traffic subscription request to ethernet firmware.
Std_ReturnType Eth_NotifyVirtmacMsgReceived(uint8 CtrlIdx)
Notify Ethernet driver that a RPC msg has been received from ethernet firmware.
Std_ReturnType Eth_GetCurrentTime(uint8 CtrlIdx, Eth_TimeStampQualType *timeQualPtr, Eth_TimeStampType *timeStampPtr)
This function returns a time value out of the HW registers.
void Eth_GetIngressTimeStamp(uint8 CtrlIdx, Eth_DataType *DataPtr, Eth_TimeStampQualType *timeQualPtr, Eth_TimeStampType *timeStampPtr)
This function reads back the ingress time stamp on a dedicated message object.
void Eth_GetPhysAddr(uint8 CtrlIdx, uint8 *PhysAddrPtr)
This function obtains the physical source address used by the indexed controller. ...
Std_ReturnType Eth_DispatchVirtmacDisassociateIPv4Macaddr(uint8 CtrlIdx, uint8 *ipv4Address)
Dispatch virtual mac IPV4 address:destination mac disassociation request to ethernet firmware...
void Eth_GetVersionInfo(Std_VersionInfoType *VersionInfo)
Function returns the version information of this module.
Std_ReturnType Eth_DispatchVirtmacAddVlan(uint8 CtrlIdx, uint32 vlanId, Eth_PortListType *portList)
Dispatch virtual mac addition of given vlan id to switch address resolution table request to ethernet...
void Eth_EnableEgressTimeStamp(uint8 CtrlIdx, uint8 BufIdx)
This function activates egress time stamping on a dedicated message object.
Std_ReturnType Eth_GetRxStats(uint8 CtrlIdx, Eth_RxStatsType *RxStats)
This function reads a list with RX statistics values of the corresponding controller.
Std_ReturnType Eth_GetTxStats(uint8 CtrlIdx, Eth_TxStatsType *TxStats)
This function reads a list with TX statistics values of the corresponding controller.
BufReq_ReturnType Eth_ProvideTxBuffer(uint8 CtrlIdx, uint8 Priority, Eth_BufIdxType *BufIdxPtr, uint8 **BufPtr, uint16 *LenBytePtr)
This function provides access to a transmit buffer of the specified controller.
Std_ReturnType Eth_SetControllerMode(uint8 CtrlIdx, Eth_ModeType CtrlMode)
This function enables / disables the indexed controller.
Std_ReturnType Eth_WriteMii(uint8 CtrlIdx, uint8 TrcvIdx, uint8 RegIdx, uint16 RegVal)
This function configures a transceiver register or triggers a function offered by the receiver Servic...
void Eth_Receive(uint8 CtrlIdx, uint8 FifoIdx, Eth_RxStatusType *RxStatusPtr)
This function triggers frame reception.
Std_ReturnType Eth_DispatchVirtmacAddUnicastAddr(uint8 CtrlIdx, uint8 *macAddress, Eth_PortType port, uint32 vlanId)
Dispatch virtual mac addition of given unicast address to switch address resolution table request to ...
void Eth_SetCorrectionTime(uint8 CtrlIdx, Eth_TimeIntDiffType *timeOffsetPtr, Eth_RateRatioType *rateRatioPtr)
This function allows the Time Slave to adjust the local ETH Reference clock in HW.
Std_ReturnType Eth_GetCounterValues(uint8 CtrlIdx, Eth_CounterType *CounterPtr)
This function reads a list with counter values of the corresponding controller.
Std_ReturnType Eth_ReadMii(uint8 CtrlIdx, uint8 TrcvIdx, uint8 RegIdx, uint16 *RegValPtr)
This function reads a transceiver register.
Std_ReturnType Eth_Transmit(uint8 CtrlIdx, Eth_BufIdxType BufIdx, Eth_FrameType FrameType, boolean TxConfirmation, uint16 LenByte, uint8 *PhysAddrPtr)
This function triggers transmission of a previously filled transmit buffer.
Std_ReturnType Eth_GetControllerMode(uint8 CtrlIdx, Eth_ModeType *CtrlModePtr)
This function obtains the state of the indexed controller.
void Eth_Init(const Eth_ConfigType *CfgPtr)
This function initializes the driver.
Std_ReturnType Eth_TransmitNoCpy(uint8 CtrlIdx, uint8 *BufPtr, Eth_FrameType FrameType, uint16 LenByte, uint8 *PhysAddrPtr)
This function triggers transmission of a packet without buffer copy.
Std_ReturnType Eth_DispatchVirtmacDelAddr(uint8 CtrlIdx, uint8 *macAddress, uint32 vlanId)
Std_ReturnType Eth_DispatchVirtmacInit(uint8 CtrlIdx)
Dispatch virtual mac initialization request to ethernet firmware.
void Eth_MainFunction(void)
The function checks for controller errors and lost frames. Used for polling state changes...
Std_ReturnType Eth_DispatchVirtmacUnsubscribeAllTraffic(uint8 CtrlIdx)
Dispatch virtual mac all traffic unsubscription request to ethernet firmware.
Std_ReturnType Eth_DispatchVirtmacDelVlan(uint8 CtrlIdx, uint32 vlanId)
Std_ReturnType Eth_UpdatePhysAddrFilter(uint8 CtrlIdx, uint8 *PhysAddrPtr, Eth_FilterActionType Action)
This function updates the physical source address to / from the indexed controller filter...
void Eth_TxConfirmation(uint8 CtrlIdx)
This function triggers frame transmission confirmation.
Std_ReturnType Eth_DispatchVirtmacSubscribeAllTraffic(uint8 CtrlIdx)
Dispatch virtual mac all traffic subscription request to ethernet firmware.
Std_ReturnType Eth_RetrieveTxDoneQ(uint8 CtrlIdx, Eth_PktQ *retrievePktQ)
This function retrieves a queue of Ethernet frames that have already being used for transmission...
Std_ReturnType Eth_SubmitRxFreeQ(uint8 CtrlIdx, Eth_PktQ *submitPktQ)
This function submits a queue of free Ethernet frames for future reception.
void Eth_GetEgressTimeStamp(uint8 CtrlIdx, uint8 BufIdx, Eth_TimeStampQualType *timeQualPtr, Eth_TimeStampType *timeStampPtr)
This function reads back the egress time stamp on a dedicated message object.
Std_ReturnType Eth_DispatchVirtmacAssociateIPv4Macaddr(uint8 CtrlIdx, uint8 *ipv4Address, uint8 *macAddress)
Dispatch virtual mac IPV4 address:destination mac association request to ethernet firmware...
Std_ReturnType Eth_DispatchVirtmacDeinit(uint8 CtrlIdx)
Dispatch virtual mac deinit request to ethernet firmware.
Std_ReturnType Eth_DispatchVirtmacAddMcastAddr(uint8 CtrlIdx, uint8 *macAddress, uint32 numLsbToIgnore, uint32 vlanId, Eth_PortListType *portList)
Dispatch virtual mac addition of given multicast address to switch address resolution table request t...
Std_ReturnType Eth_SendCustomNotify(uint8 CtrlIdx, void *notifyInfo, uint32 notifyLen)
Std_ReturnType Eth_DispatchVirtmacUnsubscribeDstMac(uint8 CtrlIdx, uint8 *macAddress)
Dispatch virtual mac destination traffic unsubscription request to ethernet firmware.
void Eth_SetPhysAddr(uint8 CtrlIdx, const uint8 *PhysAddrPtr)
This function sets the physical source address used by the indexed controller.
Std_ReturnType Eth_SubmitTxReadyQ(uint8 CtrlIdx, Eth_PktQ *submitPktQ)
This function submits a queue of Ethernet frames for transmission.
Std_ReturnType Eth_SetGlobalTime(uint8 CtrlIdx, Eth_TimeStampType *timeStampPtr)
This function allows the Time Master to adjust the global ETH Reference clock in HW.
Std_ReturnType Eth_VirtMacRpcInit(const Eth_ConfigType *CfgPtr)
This function initializes Eth Virtual MAC driver&#39;s Remote Procedure Call.
Std_ReturnType Eth_GetTxErrorCounterValues(uint8 CtrlIdx, Eth_TxErrorCounterValuesType *TxErrorCounterValues)
This function reads a list of values to read statistic error counter values for transmission for corr...
Std_ReturnType Eth_RetrieveRxReadyQ(uint8 CtrlIdx, Eth_PktQ *retrievePktQ)
This function retrieves a queue of received Ethernet frames.