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 
65 /* ========================================================================== */
66 /* Structures and Enums */
67 /* ========================================================================== */
68 
72 typedef enum CpswAle_AddrType_e
73 {
76 
80 
84 typedef struct CpswAle_Obj_s
85 {
88 
90  uint32_t numPorts;
91 
94 
97 
99  uint32_t instId;
100 
102  bool pvidEn;
103 
106 
109 
111  uint32_t softTickCnt;
112 
114  uint32_t tickTimeoutCnt;
115 
117  uint32_t aleFreqHz;
118 
121 } CpswAle_Obj;
122 
127 
128 /* ========================================================================== */
129 /* Global Variables Declarations */
130 /* ========================================================================== */
131 
132 /* None */
133 
134 /* ========================================================================== */
135 /* Function Declarations */
136 /* ========================================================================== */
137 
149 int32_t CpswAle_open(EnetMod_Handle hMod,
150  Enet_Type enetType,
151  uint32_t instId,
152  const void *cfg,
153  uint32_t cfgSize);
154 
164 int32_t CpswAle_rejoin(EnetMod_Handle hMod,
165  Enet_Type enetType,
166  uint32_t instId);
167 
177 int32_t CpswAle_ioctl(EnetMod_Handle hMod,
178  uint32_t cmd,
179  Enet_IoctlPrms *prms);
180 
186 void CpswAle_close(EnetMod_Handle hMod);
187 
188 /* ========================================================================== */
189 /* Deprecated Function Declarations */
190 /* ========================================================================== */
191 
192 /* None */
193 
194 /* ========================================================================== */
195 /* Static Function Definitions */
196 /* ========================================================================== */
197 
198 /* None */
199 
200 #ifdef __cplusplus
201 }
202 #endif
203 
204 #endif /* CPSW_ALE_PRIV_H_ */
uint32_t tickTimeoutCnt
Definition: cpsw_ale_priv.h:114
Enet_Type
Ethernet peripheral type.
Definition: enet_types.h:195
CPSW ALE object.
Definition: cpsw_ale_priv.h:84
CSL_CPSW_ALETABLE_TYPE
Defines ALE table types support.
Definition: csl_cpsw.h:464
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:99
CpswAle_Obj * CpswAle_Handle
CPSW ALE module handle.
Definition: cpsw_ale_priv.h:126
Ethernet Module object.
Definition: enet_mod.h:136
EnetMod_Obj enetMod
Definition: cpsw_ale_priv.h:87
Definition: cpsw_ale_priv.h:75
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:96
#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:105
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:838
CSL_CPSW_ALETABLE_TYPE tableType
Definition: cpsw_ale_priv.h:93
uint32_t aleFreqHz
Definition: cpsw_ale_priv.h:117
API CSL header file for CPSW Ethernet switch module CSL.
VLAN entry type info.
Definition: cpsw_ale.h:999
Enet IOCTL param.
Definition: enet_ioctl.h:232
bool pvidEn
Definition: cpsw_ale_priv.h:102
uint32_t numPorts
Definition: cpsw_ale_priv.h:90
bool softTimerActive
Definition: cpsw_ale_priv.h:108
struct EnetMod_Obj_s * EnetMod_Handle
Ethernet Module handle.
Definition: enet_mod.h:71
Definition: cpsw_ale_priv.h:78
void CpswAle_close(EnetMod_Handle hMod)
Close CPSW ALE.
uint32_t softTickCnt
Definition: cpsw_ale_priv.h:111
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:72