1 /*
2  * Copyright 2021-2022 NXP
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef NETC_ETH_IP_H
8 #define NETC_ETH_IP_H
9 
10 /**
11 *   @file Netc_Eth_Ip.h
12 *
13 *   @addtogroup NETC_ETH_DRIVER NETC_ETH Driver
14 *   @{
15 */
16 
17 #ifdef __cplusplus
18 extern "C"{
19 #endif
20 
21 /*==================================================================================================
22 *                                          INCLUDE FILES
23 * 1) system and project includes
24 * 2) needed interfaces from external units
25 * 3) internal and external interfaces from this unit
26 ==================================================================================================*/
27 #include "Netc_Eth_Ip_Types.h"
28 
29 /*==================================================================================================
30 *                                 SOURCE FILE VERSION INFORMATION
31 ==================================================================================================*/
32 #define NETC_ETH_IP_VENDOR_ID                    43
33 #define NETC_ETH_IP_AR_RELEASE_MAJOR_VERSION     4
34 #define NETC_ETH_IP_AR_RELEASE_MINOR_VERSION     7
35 #define NETC_ETH_IP_AR_RELEASE_REVISION_VERSION  0
36 #define NETC_ETH_IP_SW_MAJOR_VERSION             0
37 #define NETC_ETH_IP_SW_MINOR_VERSION             9
38 #define NETC_ETH_IP_SW_PATCH_VERSION             0
39 
40 /*==================================================================================================
41 *                                       FILE VERSION CHECKS
42 ==================================================================================================*/
43 /* Checks against Netc_Eth_Ip_Types.h */
44 #if (NETC_ETH_IP_VENDOR_ID != NETC_ETH_IP_TYPES_VENDOR_ID)
45     #error "Netc_Eth_Ip.h and Netc_Eth_Ip_Types.h have different vendor ids"
46 #endif
47 #if ((NETC_ETH_IP_AR_RELEASE_MAJOR_VERSION    != NETC_ETH_IP_TYPES_AR_RELEASE_MAJOR_VERSION) || \
48      (NETC_ETH_IP_AR_RELEASE_MINOR_VERSION    != NETC_ETH_IP_TYPES_AR_RELEASE_MINOR_VERSION) || \
49      (NETC_ETH_IP_AR_RELEASE_REVISION_VERSION != NETC_ETH_IP_TYPES_AR_RELEASE_REVISION_VERSION))
50     #error "AUTOSAR Version Numbers of Netc_Eth_Ip.h and Netc_Eth_Ip_Types.h are different"
51 #endif
52 #if ((NETC_ETH_IP_SW_MAJOR_VERSION != NETC_ETH_IP_TYPES_SW_MAJOR_VERSION) || \
53      (NETC_ETH_IP_SW_MINOR_VERSION != NETC_ETH_IP_TYPES_SW_MINOR_VERSION) || \
54      (NETC_ETH_IP_SW_PATCH_VERSION != NETC_ETH_IP_TYPES_SW_PATCH_VERSION) \
55     )
56     #error "Software Version Numbers of Netc_Eth_Ip.h and Netc_Eth_Ip_Types.h are different"
57 #endif
58 
59 /*==================================================================================================
60 *                                            CONSTANTS
61 ==================================================================================================*/
62 
63 /*==================================================================================================
64 *                                       DEFINES AND MACROS
65 ==================================================================================================*/
66 #define ETH_43_NETC_START_SEC_CONFIG_DATA_UNSPECIFIED
67 #include "Eth_43_NETC_MemMap.h"
68 
69 NETC_ETH_IP_CONFIG_EXT
70 
71 #define ETH_43_NETC_STOP_SEC_CONFIG_DATA_UNSPECIFIED
72 #include "Eth_43_NETC_MemMap.h"
73 
74 /*==================================================================================================
75 *                                              ENUMS
76 ==================================================================================================*/
77 
78 /*==================================================================================================
79 *                                  STRUCTURES AND OTHER TYPEDEFS
80 ==================================================================================================*/
81 
82 /*==================================================================================================
83 *                                  GLOBAL VARIABLE DECLARATIONS
84 ==================================================================================================*/
85 
86 /*==================================================================================================
87 *                                       FUNCTION PROTOTYPES
88 ==================================================================================================*/
89 #define ETH_43_NETC_START_SEC_CODE
90 #include "Eth_43_NETC_MemMap.h"
91 
92 /*!
93  * @brief Initializes the ENETC station interface
94  *
95  * This function initializes and enables the ENETC station instance, configuring receive and transmit control
96  * settings, the receive and transmit descriptors rings and the MAC physical address.
97  *
98  * @param[in] ctrlIndex Instance number
99  * @param[in] config Pointer to the instance configuration structure
100  *
101  * @retval NETC_ETH_IP_STATUS_SUCCESS The initialization was successful.
102  * @retval NETC_ETH_IP_STATUS_TIMEOUT The initialization returned a timeout.
103  */
104 Netc_Eth_Ip_StatusType Netc_Eth_Ip_Init(uint8 ctrlIndex, const Netc_Eth_Ip_ConfigType *config);
105 
106 /*!
107  * @brief Gets the current power state of the NETC instance
108  *
109  * @param[in] CtrlIndex Instance number
110  * @return Netc_Eth_Ip_PowerStateType The power state of the controller
111  */
112 Netc_Eth_Ip_PowerStateType Netc_Eth_Ip_GetPowerState(uint8 CtrlIndex);
113 
114 /*!
115  * @brief Enables the specified SI.
116  *
117  * @param[in] ctrlIndex SI number
118  *
119  * @retval NETC_ETH_IP_STATUS_SUCCESS The initialization was successful.
120  */
121 Netc_Eth_Ip_StatusType Netc_Eth_Ip_EnableController(uint8 ctrlIndex);
122 
123 /*!
124  * @brief Disables the controller and resets all the configured transmit and receive buffers
125  *
126  * Warning: This function ignores all pending transmission and reception requests
127  *
128  * @param[in] ctrlIndex SI number
129  *
130  * @retval NETC_ETH_IP_STATUS_SUCCESS The controller was successfully disabled.
131  * @retval NETC_ETH_IP_STATUS_ERROR   The controller cannot be disabled because of consuming pending ring.
132  */
133 Netc_Eth_Ip_StatusType Netc_Eth_Ip_DisableController(uint8 ctrlIndex);
134 
135 /*!
136  * @brief Provides a transmit buffer to be used by the application for transmission.
137  *
138  * This function provides an internal buffer which can further be used by the application
139  * to store the transmit data.
140  *
141  * Note: The buffer will be marked as locked and won't be released until after a call to
142  * Netc_Eth_Ip_GetTransmitStatus for the same buffer returns NETC_ETH_IP_STATUS_SUCCESS.
143  *
144  * Important: The driver does not ensure synchronization between different threads trying
145  * to get a buffer at the same time. This synchronization shall be implemented by the
146  * application.
147  *
148  * @param[in]     ctrlIndex Instance number
149  * @param[in]     ring   Ring number
150  * @param[in,out] buff   In:  Buffer containing the desired length
151  *                       Out: Buffer containing the granted length or available length in case of overflow.
152  * @param[out]    buffId Index of the buffer (descriptor) within the ring.
153  *                       If this information is not needed, this parameter should be NULL_PTR.
154  * @retval NETC_ETH_IP_STATUS_SUCCESS The buffer has been successfully locked.
155  * @retval NETC_ETH_IP_STATUS_TX_BUFF_BUSY All buffers are currently in use for the current ring.
156  * @retval NETC_ETH_IP_STATUS_TX_BUFF_OVERFLOW The requested buffer length cannot be granted.
157  * @retval NETC_ETH_IP_STATUS_INVALID_FRAME_LENGTH The buffer length is smaller than minium of frame length.
158  */
159 Netc_Eth_Ip_StatusType Netc_Eth_Ip_GetTxBuff(uint8 ctrlIndex,
160                                              uint8 ring,
161                                              Netc_Eth_Ip_BufferType *buff,
162                                              uint16 *buffId);
163 
164 /*!
165  * @brief Sends an Ethernet frame
166  *
167  * This function sends an Ethernet frame, contained in the buffer received as parameter.
168  *
169  * Note: Since the transmission of the frame is not complete when this function returns,
170  * the application must not change/alter/re-use the provided buffer until after a call
171  * to Netc_Eth_Ip_GetTransmitStatus for the same buffer returns NETC_ETH_IP_STATUS_SUCCESS.
172  *
173  * Important: The driver does not ensure synchronization between different threads trying
174  * to send a frame at the same time. This synchronization shall be implemented by the
175  * application.
176  *
177  * @param[in] ctrlIndex Instance number
178  * @param[in] ring The ring number
179  * @param[in] buff The buffer containing the frame
180  * @param[in] options Configuration options applicable to this buffer's transmission only.
181  * Can be NULL_PTR, if no special option is required.
182  * @retval NETC_ETH_IP_STATUS_SUCCESS       The frame was successfully enqueued for transmission.
183  * @retval NETC_ETH_IP_STATUS_TX_QUEUE_FULL There is no available space for the frame in the queue.
184  * @retval NETC_ETH_IP_STATUS_INVALID_FRAME_LENGTH Length of the external buffer is smaller than minium of frame length.
185  * @retval NETC_ETH_IP_STATUS_TX_BUFF_OVERFLOW The requested buffer length cannot be granted.
186  */
187 Netc_Eth_Ip_StatusType Netc_Eth_Ip_SendFrame(uint8 ctrlIndex,
188                                              uint8 ring,
189                                             Netc_Eth_Ip_BufferType * buff,
190                                              const Netc_Eth_Ip_TxOptionsType * options
191                                             );
192 
193 
194 /*!
195  * @brief Sends an Ethernet frame which is scattered in multiple buffers
196  *
197  * This function sends an Ethernet frame, contained in the buffers received as parameter.
198  *
199  * Note: Since the transmission of the frame is not complete when this function returns,
200  * the application must not change/alter/re-use the provided buffer until after a call
201  * to Netc_Eth_Ip_GetTransmitStatus for the same buffer returns NETC_ETH_IP_STATUS_SUCCESS.
202  *
203  * Important: The driver does not ensure synchronization between different threads trying
204  * to send a frame at the same time. This synchronization shall be implemented by the
205  * application.
206  *
207  * @param[in] ctrlIndex Instance number
208  * @param[in] ring The ring number
209  * @param[in] Buffers The list of buffers containing the frame
210  * @param[in] options Configuration options applicable to this buffer's transmission only.
211  *                    Can be NULL_PTR, if no special option is required.
212  * @param[in] NumBuffers Number of buffers available in Buffers
213  * @retval NETC_ETH_IP_STATUS_SUCCESS       The frame was successfully enqueued for transmission.
214  * @retval NETC_ETH_IP_STATUS_TX_QUEUE_FULL There is no available space for the frame in the queue.
215  * @retval NETC_ETH_IP_STATUS_INVALID_FRAME_LENGTH Length of the external buffer is smaller than minium of frame length.
216  * @retval NETC_ETH_IP_STATUS_TX_BUFF_OVERFLOW The requested buffer length cannot be granted.
217  */
218 Netc_Eth_Ip_StatusType Netc_Eth_Ip_SendMultiBufferFrame(uint8 ctrlIndex,
219                                                         uint8 ring,
220                                                         Netc_Eth_Ip_BufferType Buffers[],
221                                                         const Netc_Eth_Ip_TxOptionsType *options,
222                                                         uint16 NumBuffers);
223 
224 /*!
225  * @brief Provides a transmit buffer to be used by the application for transmission.
226  *
227  * This function will verify if there are enough descriptors free and that each of
228  * the descriptors can hold the parts of the frame to be send using Netc_Eth_Ip_SendMultiBufferFrame.
229  *
230  * Note: This function will only return the first buffer descriptor index starting with which the
231  * multi buffer frame can be sent.
232  *
233  * Important: This function is meant for internal use only and will be called from an upper layer to get
234  * the first buffer descriptor index from a sequence of buffers that will be used for sending a
235  * multi buffer frame.
236  *
237  * @param[in]     ctrlIndex     Instance number
238  * @param[in]     ring          Ring number
239  * @param[in]     NumBuffers    Number of buffers
240  * @param[in]     BufferLength  List with the length of each chunk of the frame
241  * @param[out]    buffId        Index of the buffer (descriptor) within the ring.
242  * @retval NETC_ETH_IP_STATUS_SUCCESS The buffer has been successfully locked.
243  * @retval NETC_ETH_IP_STATUS_TX_BUFF_BUSY All buffers are currently in use for the current ring.
244  * @retval NETC_ETH_IP_STATUS_TX_BUFF_OVERFLOW The requested buffer length cannot be granted.
245  * @retval NETC_ETH_IP_STATUS_INVALID_FRAME_LENGTH The buffer length is smaller than minium of frame length.
246  */
247 Netc_Eth_Ip_StatusType Netc_Eth_Ip_GetTxMultiBuff(uint8 ctrlIndex,
248                                                   uint8 ring,
249                                                   uint16 NumBuffers,
250                                                   const uint16 BufferLength[],
251                                                   uint16 *buffId);
252 
253 /*!
254  * @brief Reads a received Ethernet frame
255  *
256  * This function reads the first received Ethernet frame in the Rx queue. The buffer received
257  * as parameter will be updated by the driver and the .data field will point to a memory area
258  * containing the frame data.
259  *
260  * Note: Once the application finished processing the buffer, it could be reused by the
261  * driver for further receptions by invoking Netc_Eth_Ip_ProvideRxBuff.
262  *
263  * Important: The driver does not ensure synchronization between different threads trying
264  * to read a frame at the same time. This synchronization shall be implemented by the
265  * application.
266  *
267  * @param[in]  ctrlIndex Instance number
268  * @param[in]  ring The ring number
269  * @param[out] buff The buffer containing the frame
270  * @param[out] info Enhanced information related to the data contained by this receive buffer.
271  * If this information is not needed, this parameter should be NULL_PTR.
272  * @retval NETC_ETH_IP_STATUS_SUCCESS        A frame was successfully read.
273  * @retval NETC_ETH_IP_STATUS_RX_QUEUE_EMPTY There is no available frame in the queue.
274  * @retval NETC_ETH_IP_STATUS_ERROR       There is at least an error in reception.
275  */
276 Netc_Eth_Ip_StatusType Netc_Eth_Ip_ReadFrame(uint8 ctrlIndex,
277                                              uint8 ring,
278                                              Netc_Eth_Ip_BufferType *buff,
279                                              Netc_Eth_Ip_RxInfoType *info
280                                             );
281 
282 /*!
283  * @brief Provides a receive buffer to be used by the driver for reception.
284  *
285  * This function provides a buffer which can further be used by the reception mechanism
286  * in order to store the received data.
287  *
288  * Note: The application can either provide a buffer previously obtained in a Netc_Eth_Ip_ReadFrame
289  * call (when it is no longer needed after being fully processed), or allocate a new buffer.
290  * The former approach is recommended as it has a simpler usage model and re-uses the same initial
291  * memory range for the entire driver lifetime operation. The later approach could provide more
292  * flexibility, but since it involves constant memory free/alloc operations it is only recommended
293  * with an efficient pool-based memory allocator.
294  *
295  * Important: The driver does not ensure synchronization between different threads trying
296  * to provide a buffer at the same time. This synchronization shall be implemented by the
297  * application.
298  *
299  * Important: The application is responsible for providing one Rx buffer for every frame it
300  * receives, otherwise the reception ring can fill-up, affecting further reception.
301  *
302  * Usage example:
303  *
304  * stat = Netc_Eth_Ip_ReadFrame(0U, 0U, &rxBuff);
305  *
306  * if (stat == NETC_ETH_IP_STATUS_SUCCESS)
307  * {
308  *     process_buffer(&rxBuff);
309  *     Netc_Eth_Ip_ProvideRxBuff(0U, 0U, &rxBuff);
310  * }
311  *
312  * @param[in] ctrlIndex Instance number
313  * @param[in] ring The ring number
314  * @param[in] buff The buffer to be added to the reception ring
315  */
316 Netc_Eth_Ip_StatusType Netc_Eth_Ip_ProvideRxBuff(uint8 ctrlIndex,
317                                                  uint8 ring,
318                                                  const Netc_Eth_Ip_BufferType *buff);
319 
320 /**
321  * @brief This function will be used when RX should be used at maximum capacity, instead of providing
322  *        one by one buffer for reception, a batch of buffers will be provided
323  *
324  * @param[in] CtrlIndex Instance number.
325  * @param[in] Ring      The ring number.
326  * @param[in] BuffList  This should be NULL_PTR if internal buffers are used, otherwise this should respect
327  *                  the follwing indications:
328  *                   - List of the external buffers used for descriptor restauration;
329  * @param[inout] BuffListSize [IN]  Number of buffers in list. When the internal buffers are in use, this parameter shall
330  *                                  contain the number of BD which need to be restored after a reception of a more than one packet.
331  *                            [OUT] Returns how many Buffer Descriptors have been released.
332  * @retval NETC_ETH_IP_STATUS_SUCCESS Execution with success.
333  */
334 Netc_Eth_Ip_StatusType Netc_Eth_Ip_ProvideMultipleRxBuff(uint8 CtrlIndex,
335                                                          uint8 Ring,
336                                                          uint8* BuffList[],
337                                                          uint16* BuffListSize);
338 
339 /*!
340  * @brief Checks if there are more frames available in the given queue
341  *
342  * This function takes a peek at the given Rx queue to check if there are more Ethernet
343  * frames to be received. Its intended usage is to provide this information without
344  * also extracting the frame as "Netc_Eth_Ip_ReadFrame".
345  *
346  * @param[in]  ctrlIndex Instance number
347  * @param[in]  ring The ring number
348  * @retval TRUE  There is an available frame in the queue.
349  * @retval FALSE There is no available frame in the queue.
350  */
351 boolean Netc_Eth_Ip_IsFrameAvailable(uint8 ctrlIndex,
352                                      uint8 ring
353                                     );
354 /*!
355  * @brief Checks if the transmission of a buffer is complete.
356  *
357  * This function checks if the transmission of the given buffer is complete.
358  *
359  * TODO: Descrition should be improved to indicate that this is not normally
360  * needed in regular transmit workflow since GetTxBuff already exposes HW
361  * consumption of TX entries
362  *
363  * Note: If the buffer is not found in the Tx ring, the function will return NETC_ETH_IP_STATUS_BUFF_NOT_FOUND.
364  *
365  * @param[in]  CtrlIndex Instance number
366  * @param[in]  ring The ring number
367  * @param[in]  buff The transmit buffer for which the status shall be checked
368  * @param[out] info Extended information related to the buffer. If this information is not needed,
369  * this parameter should be NULL_PTR.
370  * @retval NETC_ETH_IP_STATUS_TX_BUFF_BUSY    The frame is still enqueued for transmission.
371  * @retval NETC_ETH_IP_STATUS_BUFF_NOT_FOUND  The buffer was not found in the Tx queue.
372  * @retval NETC_ETH_IP_STATUS_ERROR        There is at least an error in transmission.
373  * @retval NETC_ETH_IP_STATUS_SUCCESS         Otherwise.
374  */
375 Netc_Eth_Ip_StatusType Netc_Eth_Ip_GetTransmitStatus(uint8 ctrlIndex,
376                                                      uint8 ring,
377                                                      const Netc_Eth_Ip_BufferType * buff,
378                                                      Netc_Eth_Ip_TxInfoType * info
379                                                     );
380 
381 /*!
382  * @brief Configures the physical address of the MAC
383  *
384  * @param[in] CtrlIndex Instance number
385  * @param[in] MacAddr The MAC address to be configured
386  *
387  * @retval NETC_ETH_IP_STATUS_SUCCESS Physical address of mac is configured successfully.
388  * @retval NETC_ETH_IP_STATUS_TIMEOUT Changing the physical address was not changed because a timeout has occured.
389  */
390 Netc_Eth_Ip_StatusType Netc_Eth_Ip_SetMacAddr(uint8 CtrlIndex, const uint8 *MacAddr);
391 
392 /**
393  * @brief Gets the physical address of the MAC for a controller.
394  *
395  * @param[in]  CtrlIndex Instance number
396  * @param[out] MacAddr The physical address of the MAC
397  */
398 void Netc_Eth_Ip_GetMacAddr(uint8 CtrlIndex, uint8 *MacAddr);
399 
400 /**
401  * @brief Gets statistics from the specified counter
402  *
403  * @param[in] CtrlIndex Instance number
404  * @param[in] Counter The counter to be read
405  * @return The value of the requested counter
406  */
407 uint32 Netc_Eth_Ip_GetCounter(uint8 CtrlIndex, Netc_Eth_Ip_CounterType Counter);
408 
409 /**
410  * @brief Adds a hardware address to the hash filter. The destination address of
411  * an incoming packet is passed through hash function and then is added as an
412  * entry in the hash table.
413  *
414  * @param[in] CtrlIndex Instance number.
415  * @param[in] MacAddr   Destination MAC address to be added in hash filter.
416  * @return Netc_Eth_Ip_StatusType NETC_ETH_IP_STATUS_SUCCESS - successfully operation
417  *                                NETC_ETH_IP_STATUS_ERROR   - unsuccessfully operation
418  *                                NETC_ETH_IP_STATUS_MAC_ADDR_TABLE_FULL - MAC table used for hash filter is full
419  *                                NETC_ETH_IP_STATUS_TIMEOUT - Only for VSIs - the command was not processed in the allotted time
420  */
421 Netc_Eth_Ip_StatusType Netc_Eth_Ip_AddMulticastDstAddrToHashFilter(uint8 CtrlIndex, const uint8 *MacAddr);
422 
423 /**
424  * @brief Removes a hardware address from the hash filter. The destination address of
425  * an incoming packet is passed through hash function and then is removed from
426  * hash table.
427  *
428  * @param[in] CtrlIndex Instance number.
429  * @param[in] MacAddr   Destination MAC address to be removed from hash filer.
430  * @return Netc_Eth_Ip_StatusType NETC_ETH_IP_STATUS_SUCCESS - successfully operation
431  *                                NETC_ETH_IP_STATUS_ERROR   - unsuccessfully operation
432  *                                NETC_ETH_IP_STATUS_MAC_ADDR_NOT_FOUND - the current destination MAC was not
433  *                                found in the hash filter table
434  *                                NETC_ETH_IP_STATUS_TIMEOUT - Only for VSIs - the command was not processed in the allotted time
435  */
436 Netc_Eth_Ip_StatusType Netc_Eth_Ip_RemoveMulticastDstAddrFromHashFilter(uint8 CtrlIndex, const uint8 *MacAddr);
437 
438 /**
439  * @brief Enables/Disables forwarding of the multicast traffic.
440  *
441  * @param[in]  CtrlIdx Instance number
442  * @param[in]  Enable  TRUE -> cotroller will receive all the multicast traffic;
443  *                     FALSE-> cotroller will stop receive all the multicast traffic;
444  * @return Netc_Eth_Ip_StatusType NETC_ETH_IP_STATUS_SUCCESS - successfully operation
445  *                                NETC_ETH_IP_STATUS_TIMEOUT - Only for VSIs - the command was not processed in the allotted time
446  */
447 Netc_Eth_Ip_StatusType Netc_Eth_Ip_SetMulticastForwardAll(uint8 CtrlIndex, boolean EnableMulticast);
448 
449 /**
450  * @brief Disable multicast promiscuous and delete all entries in multicast MAC filter table.
451  *
452  * @param[in] CtrlIdx Instance number.
453  * @return Netc_Eth_Ip_StatusType NETC_ETH_IP_STATUS_SUCCESS - successfully operation
454  *                                NETC_ETH_IP_STATUS_TIMEOUT - Only for VSIs - the command was not processed in the allotted time
455  */
456 Netc_Eth_Ip_StatusType Netc_Eth_Ip_CloseMulticastReceiving(uint8 CtrlIndex);
457 /**
458  * @brief Realease multiple transmission buffers at once.
459  *
460  * @param CtrlIdx Instance number.
461  * @param Ring    Ring number.
462  */
463 void Netc_Eth_Ip_ReleaseTxBuffers(uint8 CtrlIdx, uint8 Ring);
464 
465 /**
466  * @brief Set the threshold values for Rx coalescing interrupt.
467  *
468  * @param[in]  CtrlIdx  Controller number
469  * @param[in]  RingIdx  Ring Index on which the settings will be applied.
470  * @param[in]  PacketsThreshold  No of packets after which the ISR will be triggered. Must be different than 0 in order to set the value.
471  * @param[in]  TimerThreshold  No of ticks after which the ISR will be triggered. Must be different than 0 in order to set the value.
472  *
473  *
474  * @return Netc_Eth_Ip_StatusType NETC_ETH_IP_STATUS_SUCCESS - successfully operation
475  *                                NETC_ETH_IP_STATUS_ERROR - Either the coalescing interrupt is not enabled or the No of packets passed exceedes the
476  *                                                        size of the ring.
477  */
478 Netc_Eth_Ip_StatusType Netc_Eth_Ip_SetRxCoalescingThresholds(uint8 CtrlIdx, uint8 RingIdx, uint16 PacketsThreshold, uint32 TimerThreshold);
479 
480 /**
481  * @brief Set the threshold values for Tx coalescing interrupt.
482  *
483  * @param[in]  CtrlIdx  Controller number
484  * @param[in]  RingIdx  Ring Index on which the settings will be applied.
485  * @param[in]  PacketsThreshold  No of packets after which the ISR will be triggered. Must be different than 0 in order to set the value.
486  * @param[in]  TimerThreshold  No of ticks after which the ISR will be triggered. Must be different than 0 in order to set the value.
487  *
488  * @return Netc_Eth_Ip_StatusType NETC_ETH_IP_STATUS_SUCCESS - successfully operation
489  *                                NETC_ETH_IP_STATUS_ERROR - Either the coalescing interrupt is not enabled or the No of packets passed exceedes the
490  *                                                        size of the ring.
491  */
492 Netc_Eth_Ip_StatusType Netc_Eth_Ip_SetTxCoalescingThresholds(uint8 CtrlIdx, uint8 RingIdx, uint16 PacketsThreshold, uint32 TimerThreshold);
493 
494 #if (STD_ON == NETC_ETH_IP_EXTENDED_BUFF)
495 #ifdef NETC_ETH_0_USED
496 /**
497  * @brief Set management information for a frame which will be send using management.
498  *
499  * @param CtrlIdx Instance number
500  * @param BuffIdx Uniq buffer index id.
501  * @param ManagementInfo Pointer to the timestamp information for frame identified by BuffIdx.
502  * @param Status Enable/Disable management transmission on this frame.
503  */
504 void Netc_Eth_Ip_ManagementFrame(uint8 CtrlIdx, uint16 BuffIdx, const Netc_Eth_Ip_TxTimestampInfoType *ManagementInfo, boolean Status);
505 
506 /**
507  * @brief
508  *
509  * @param CtrlIndex Instance number
510  * @param Ring
511  * @return void
512  */
513 void Netc_Eth_Ip_ReleaseUnusedTxBuff(uint8 CtrlIndex, uint8 Ring);
514 
515 /**
516  * @brief
517  *
518  * @param CtrlIdx Instance number
519  * @param BuffIdx Uniq buffer index id.
520  * @return Netc_Eth_Ip_StatusType
521  */
522 Netc_Eth_Ip_StatusType Netc_Eth_Ip_GetTxTimestampInfo(const uint8 CtrlIdx, const uint32 BuffIdx, Netc_Eth_Ip_TxTimestampInfoType **TimestampInfo);
523 
524 #endif /* NETC_ETH_0_USED */
525 
526 /**
527  * @brief
528  *
529  * @param CtrlIdx
530  * @param DataPtr
531  * @param RxTimestampInfo
532  * @return Netc_Eth_Ip_StatusType
533  */
534 Netc_Eth_Ip_StatusType Netc_Eth_Ip_GetRxTimestampInfo(uint8 CtrlIdx, const uint8 *DataPtr, Netc_Eth_Ip_RxTimestampInfoType **RxTimestampInfo);
535 
536 #endif /* STD_ON == NETC_ETH_IP_EXTENDED_BUFF */
537 
538 /**
539  * @brief
540  *
541  * @param ctrlIndex
542  * @param TimePtr
543  */
544 void Netc_Eth_Ip_GetCurrentTime(uint8 ctrlIndex, Netc_Eth_Ip_TimeType *TimePtr);
545 
546 #define ETH_43_NETC_STOP_SEC_CODE
547 #include "Eth_43_NETC_MemMap.h"
548 
549 #ifdef __cplusplus
550 }
551 #endif
552 
553 /** @} */
554 
555 #endif
556