PDK API Guide for J721E
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>
79 
80 /* ========================================================================== */
81 /* Macros */
82 /* ========================================================================== */
83 
84 /* None */
85 
86 /* ========================================================================== */
87 /* Structures and Enums */
88 /* ========================================================================== */
89 
90 /* ========================================================================== */
91 /* Global Variables Declarations */
92 /* ========================================================================== */
93 
94 /* None */
95 
96 /* ========================================================================== */
97 /* Function Declarations */
98 /* ========================================================================== */
99 
108 uint32_t Enet_getCoreId(void);
109 
124 
133 
146 void Enet_initOsalCfg(EnetOsal_Cfg *osalCfg);
147 
161 void Enet_initUtilsCfg(EnetUtils_Cfg *utilsCfg);
162 
182 void Enet_init(const EnetOsal_Cfg *osalCfg,
183  const EnetUtils_Cfg *utilsCfg);
184 
194 void Enet_deinit(void);
195 
209  uint32_t instId);
210 
222 uint32_t Enet_getMacPortMax(Enet_Type enetType,
223  uint32_t instId);
224 
240 void Enet_initCfg(Enet_Type enetType,
241  uint32_t instId,
242  void *cfg,
243  uint32_t cfgSize);
244 
265  uint32_t instId,
266  const void *cfg,
267  uint32_t cfgSize);
268 
282  uint32_t instId);
283 
298 
318 int32_t Enet_ioctl(Enet_Handle hEnet,
319  uint32_t coreId,
320  uint32_t cmd,
321  Enet_IoctlPrms *prms);
322 
337  Enet_Event evt,
338  uint32_t evtNum,
339  Enet_EventCallback evtCb,
340  void *evtCbArgs);
341 
352  Enet_Event evt,
353  uint32_t evtNum);
354 
371 void Enet_poll(Enet_Handle hEnet,
372  Enet_Event evt,
373  const void *arg,
374  uint32_t argSize);
375 
383 void Enet_periodicTick(Enet_Handle hEnet);
384 
396 uint32_t Enet_getMacPortCnt(Enet_Handle hEnet);
397 
405 void Enet_close(Enet_Handle hEnet);
406 
407 /* ========================================================================== */
408 /* Deprecated Function Declarations */
409 /* ========================================================================== */
410 
411 /* None */
412 
413 #endif /* ENET_H_ */
414 
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:232
void Enet_deinit(void)
De-initialize Enet LLD.
This file contains the type definitions and helper macros for the Enet Time Aware Shaper (TAS) module...
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.