PDK API Guide for AM65xx
enet.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2020
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
55 #ifndef ENET_H_
56 #define ENET_H_
57 
58 /* ========================================================================== */
59 /* Include Files */
60 /* ========================================================================== */
61 
62 #include <stdint.h>
63 #include <stdbool.h>
64 #include <ti/drv/enet/enet_cfg.h>
78 
79 /* ========================================================================== */
80 /* Macros */
81 /* ========================================================================== */
82 
83 /* None */
84 
85 /* ========================================================================== */
86 /* Structures and Enums */
87 /* ========================================================================== */
88 
89 /* ========================================================================== */
90 /* Global Variables Declarations */
91 /* ========================================================================== */
92 
93 /* None */
94 
95 /* ========================================================================== */
96 /* Function Declarations */
97 /* ========================================================================== */
98 
107 uint32_t Enet_getCoreId(void);
108 
123 
132 
145 void Enet_initOsalCfg(EnetOsal_Cfg *osalCfg);
146 
160 void Enet_initUtilsCfg(EnetUtils_Cfg *utilsCfg);
161 
181 void Enet_init(const EnetOsal_Cfg *osalCfg,
182  const EnetUtils_Cfg *utilsCfg);
183 
193 void Enet_deinit(void);
194 
208  uint32_t instId);
209 
221 uint32_t Enet_getMacPortMax(Enet_Type enetType,
222  uint32_t instId);
223 
239 void Enet_initCfg(Enet_Type enetType,
240  uint32_t instId,
241  void *cfg,
242  uint32_t cfgSize);
243 
264  uint32_t instId,
265  const void *cfg,
266  uint32_t cfgSize);
267 
281  uint32_t instId);
282 
297 
317 int32_t Enet_ioctl(Enet_Handle hEnet,
318  uint32_t coreId,
319  uint32_t cmd,
320  Enet_IoctlPrms *prms);
321 
336  Enet_Event evt,
337  uint32_t evtNum,
338  Enet_EventCallback evtCb,
339  void *evtCbArgs);
340 
351  Enet_Event evt,
352  uint32_t evtNum);
353 
370 void Enet_poll(Enet_Handle hEnet,
371  Enet_Event evt,
372  const void *arg,
373  uint32_t argSize);
374 
382 void Enet_periodicTick(Enet_Handle hEnet);
383 
395 uint32_t Enet_getMacPortCnt(Enet_Handle hEnet);
396 
404 void Enet_close(Enet_Handle hEnet);
405 
406 /* ========================================================================== */
407 /* Deprecated Function Declarations */
408 /* ========================================================================== */
409 
410 /* None */
411 
412 #endif /* ENET_H_ */
413 
Enet_Type
Ethernet peripheral type.
Definition: enet_types.h:195
void Enet_close(Enet_Handle hEnet)
Close the Enet peripheral.
struct Enet_Obj_s * Enet_Handle
Ethernet driver handle.
Definition: enet_base.h:105
EnetTrace_TraceLevel Enet_getTraceLevel(void)
Get current trace level.
void Enet_initUtilsCfg(EnetUtils_Cfg *utilsCfg)
Initialize utils configuration.
void Enet_init(const EnetOsal_Cfg *osalCfg, const EnetUtils_Cfg *utilsCfg)
Initialize Enet LLD.
This file contains the basic types using across the Enet driver.
This file contains the type definitions and helper macros for the Enet software queue.
This file contains the type definitions and helper macros for the Enet Data Path (DMA) interface.
Enet OSAL configuration paramters.
Definition: enet_osal.h:196
This file contains the type definitions and helper macros for the Ethernet PHY interface.
Enet_Handle Enet_getHandle(Enet_Type enetType, uint32_t instId)
Get the Enet handle of a peripheral.
void Enet_initOsalCfg(EnetOsal_Cfg *osalCfg)
Initialize OSAL configuration.
This file contains the type definitions and helper macros for the Enet Peripheral interface.
uint32_t Enet_getMacPortMax(Enet_Type enetType, uint32_t instId)
Get number of MAC ports available in the Ethernet peripheral.
struct EnetUdma_DrvObj_s * EnetDma_Handle
Opaque handle for Enet UDMA driver object.
Definition: enet_udma_types.h:86
int32_t Enet_ioctl(Enet_Handle hEnet, uint32_t coreId, uint32_t cmd, Enet_IoctlPrms *prms)
Issue an operation on the Enet Peripheral.
This file contains the type definitions and helper macros that are common for host and MAC ports.
void Enet_registerEventCb(Enet_Handle hEnet, Enet_Event evt, uint32_t evtNum, Enet_EventCallback evtCb, void *evtCbArgs)
Register a callback for an event.
Enet_Handle Enet_open(Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)
Open and initializes the Enet driver for a peripheral.
EnetTrace_TraceLevel
Enumerates the types of trace level.
Definition: enet_trace.h:108
This file contains the type definitions and helper macros for the Enet IOCTL interface.
EnetTrace_TraceLevel Enet_setTraceLevel(EnetTrace_TraceLevel level)
Set global trace level.
This file contains the type definitions and helper macros for the Enet Forwarding Database (FDB) modu...
This file contains the OSAL API of the Enet driver.
void Enet_periodicTick(Enet_Handle hEnet)
Run periodic tick on the Ethernet peripheral.
Enet utils parameters.
Definition: enet_utils.h:196
uint32_t Enet_getMacPortCnt(Enet_Handle hEnet)
Get number of MAC ports available in the Ethernet peripheral.
EnetDma_Handle Enet_getDmaHandle(Enet_Handle hEnet)
Get the handle to the DMA used for packet transmit/receive.
Enet IOCTL param.
Definition: enet_ioctl.h:229
void Enet_deinit(void)
De-initialize Enet LLD.
Enet_Handle Enet_rejoin(Enet_Type enetType, uint32_t instId)
Rejoin a running Ethernet peripheral.
Enet_Event
Ethernet events.
Definition: enet_types.h:258
This file contains the type definitions and helper macros for the Enet Time Synchronization module in...
This file contains the type definitions and helper macros for the Enet SoC interface.
void Enet_initCfg(Enet_Type enetType, uint32_t instId, void *cfg, uint32_t cfgSize)
Initialize the peripheral configuration parameters.
void Enet_poll(Enet_Handle hEnet, Enet_Event evt, const void *arg, uint32_t argSize)
Poll for Ethernet events.
void(* Enet_EventCallback)(Enet_Event evt, uint32_t evtNum, void *evtCbArgs, void *arg1, void *arg2)
Event callback.
Definition: enet_types.h:445
uint32_t Enet_getCoreId(void)
This file contains the type definitions and function prototypes of the Enet Utils functionality.
This file contains the type definitions and helper macros for the Enet Trace interface.
void Enet_unregisterEventCb(Enet_Handle hEnet, Enet_Event evt, uint32_t evtNum)
Unregister callback for an event.
This file contains the Enet configuration parameters.