PDK API Guide for J721E
cpsw_ale_priv.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 
40 #ifndef CPSW_ALE_PRIV_H_
41 #define CPSW_ALE_PRIV_H_
42 
43 /* ========================================================================== */
44 /* Include Files */
45 /* ========================================================================== */
46 
47 #include <ti/csl/csl_cpswitch.h>
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /* ========================================================================== */
56 /* Macros */
57 /* ========================================================================== */
58 
60 #define CPSW_ALE_FEATURE_FLOW_PRIORITY (ENET_BIT(0U))
61 
63 #define CPSW_ALE_FEATURE_IP_HDR_WHITELIST (ENET_BIT(1U))
64 
66 #define CPSW_ALE_FEATURE_MULTIHOST (ENET_BIT(2U))
67 
68 /* ========================================================================== */
69 /* Structures and Enums */
70 /* ========================================================================== */
71 
75 typedef enum CpswAle_AddrType_e
76 {
79 
83 
87 typedef struct CpswAle_Obj_s
88 {
91 
93  uint32_t numPorts;
94 
97 
100 
102  uint32_t instId;
103 
105  bool pvidEn;
106 
109 
112 
114  uint32_t softTickCnt;
115 
117  uint32_t tickTimeoutCnt;
118 
120  uint32_t aleFreqHz;
121 
124 } CpswAle_Obj;
125 
130 
131 /* ========================================================================== */
132 /* Global Variables Declarations */
133 /* ========================================================================== */
134 
135 /* None */
136 
137 /* ========================================================================== */
138 /* Function Declarations */
139 /* ========================================================================== */
140 
152 int32_t CpswAle_open(EnetMod_Handle hMod,
153  Enet_Type enetType,
154  uint32_t instId,
155  const void *cfg,
156  uint32_t cfgSize);
157 
167 int32_t CpswAle_rejoin(EnetMod_Handle hMod,
168  Enet_Type enetType,
169  uint32_t instId);
170 
180 int32_t CpswAle_ioctl(EnetMod_Handle hMod,
181  uint32_t cmd,
182  Enet_IoctlPrms *prms);
183 
189 void CpswAle_close(EnetMod_Handle hMod);
190 
191 /* ========================================================================== */
192 /* Deprecated Function Declarations */
193 /* ========================================================================== */
194 
195 /* None */
196 
197 /* ========================================================================== */
198 /* Static Function Definitions */
199 /* ========================================================================== */
200 
201 /* None */
202 
203 #ifdef __cplusplus
204 }
205 #endif
206 
207 #endif /* CPSW_ALE_PRIV_H_ */
uint32_t tickTimeoutCnt
Definition: cpsw_ale_priv.h:117
Enet_Type
Ethernet peripheral type.
Definition: enet_types.h:195
CPSW ALE object.
Definition: cpsw_ale_priv.h:87
CSL_CPSW_ALETABLE_TYPE
Defines ALE table types support.
Definition: csl_cpsw.h:467
int32_t CpswAle_rejoin(EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId)
Rejoin a running CPSW ALE module.
This file contains the type definitions and helper macros for the CPSW Address Lookup Engine (ALE) mo...
uint32_t instId
Definition: cpsw_ale_priv.h:102
CpswAle_Obj * CpswAle_Handle
CPSW ALE module handle.
Definition: cpsw_ale_priv.h:129
Ethernet Module object.
Definition: enet_mod.h:136
EnetMod_Obj enetMod
Definition: cpsw_ale_priv.h:90
Definition: cpsw_ale_priv.h:78
int32_t CpswAle_open(EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)
Open and initialize CPSW ALE.
Enet_Type enetType
Definition: cpsw_ale_priv.h:99
#define CPSW_ALE_NUM_PORTS
Number of switch ports in the subsystem.
Definition: cpsw_ale.h:89
CpswAle_RxFilter rxFilter
Definition: cpsw_ale_priv.h:108
This file contains the type definitions and helper macros for the Enet Forwarding Database (FDB) modu...
CpswAle_RxFilter
Packet filtering type (cumulative).
Definition: cpsw_ale.h:841
CSL_CPSW_ALETABLE_TYPE tableType
Definition: cpsw_ale_priv.h:96
uint32_t aleFreqHz
Definition: cpsw_ale_priv.h:120
API CSL header file for CPSW Ethernet switch module CSL.
VLAN entry type info.
Definition: cpsw_ale.h:1002
Enet IOCTL param.
Definition: enet_ioctl.h:232
bool pvidEn
Definition: cpsw_ale_priv.h:105
gptp_ipc_command_t cmd
Definition: gptpipc.h:140
uint32_t numPorts
Definition: cpsw_ale_priv.h:93
bool softTimerActive
Definition: cpsw_ale_priv.h:111
struct EnetMod_Obj_s * EnetMod_Handle
Ethernet Module handle.
Definition: enet_mod.h:71
Definition: cpsw_ale_priv.h:81
void CpswAle_close(EnetMod_Handle hMod)
Close CPSW ALE.
uint32_t softTickCnt
Definition: cpsw_ale_priv.h:114
int32_t CpswAle_ioctl(EnetMod_Handle hMod, uint32_t cmd, Enet_IoctlPrms *prms)
Run an IOCTL operation on CPSW ALE.
CpswAle_AddrType
Address type: source or destination.
Definition: cpsw_ale_priv.h:75