AM64x MCU+ SDK  09.02.01
enet_mod_port.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 ENET_MOD_PORT_H_
41 #define ENET_MOD_PORT_H_
42 
43 /* ========================================================================== */
44 /* Include Files */
45 /* ========================================================================== */
46 
47 #include <stdint.h>
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 /* ========================================================================== */
55 /* Macros */
56 /* ========================================================================== */
57 
58 /* None */
59 
60 /* ========================================================================== */
61 /* Structures and Enums */
62 /* ========================================================================== */
63 
67 typedef struct EnetPort_VlanCfg_s
68 {
70  uint32_t portPri;
71 
73  uint32_t portCfi;
74 
76  uint32_t portVID;
78 
82 typedef enum EnetPort_EgressPriorityType_e
83 {
86 
90 
94 typedef struct EnetPort_TrafficShapingRates_s
95 {
98 
102 
106 typedef struct EnetPort_CreditBasedShapingCfg_s
107 {
109  uint32_t queueNum;
110 
112  uint64_t idleSlope;
114 
118 typedef struct EnetPort_TrafficShapingCfg_s
119 {
123 
130 typedef struct EnetPort_PriorityMap_s
131 {
134  uint32_t priorityMap[ENET_PRI_NUM];
136 
140 typedef struct EnetPort_DscpPriorityMap_s
141 {
143  uint32_t tosMap[ENET_TOS_PRI_NUM];
144 
147 
151 
155 typedef struct EnetPort_MaxLen_s
156 {
158  uint32_t mtu[ENET_PRI_NUM];
159 
161  uint32_t mru;
163 
164 #if ENET_CFG_IS_ON(CPSW_CUTTHRU)
165 typedef struct EnetPort_CutThruParams_s
166 {
168  bool portSpeedAutoEn;
169 
171  uint32_t rxPriCutThruEn;
172 
174  uint32_t txPriCutThruEn;
175 } EnetPort_CutThruParams;
176 #endif
177 
178 /* ========================================================================== */
179 /* Global Variables Declarations */
180 /* ========================================================================== */
181 
182 /* None */
183 
184 /* ========================================================================== */
185 /* Function Declarations */
186 /* ========================================================================== */
187 
188 /* None */
189 
190 /* ========================================================================== */
191 /* Deprecated Function Declarations */
192 /* ========================================================================== */
193 
194 /* None */
195 
196 /* ========================================================================== */
197 /* Static Function Definitions */
198 /* ========================================================================== */
199 
200 /* None */
201 
202 #ifdef __cplusplus
203 }
204 #endif
205 
206 #endif /* ENET_MOD_PORT_H_ */
EnetPort_PriorityMap
Priority map.
Definition: enet_mod_port.h:131
EnetPort_DscpPriorityMap::dscpIPv6En
bool dscpIPv6En
Definition: enet_mod_port.h:149
EnetPort_VlanCfg
VLAN configuration parameters.
Definition: enet_mod_port.h:68
EnetPort_MaxLen::mru
uint32_t mru
Definition: enet_mod_port.h:161
enet_types.h
This file contains the basic types using across the Enet driver.
EnetPort_DscpPriorityMap
DSCP priority map.
Definition: enet_mod_port.h:141
EnetPort_CreditBasedShapingCfg::queueNum
uint32_t queueNum
Definition: enet_mod_port.h:109
ENET_PRI_NUM
#define ENET_PRI_NUM
Packet priority.
Definition: enet_types.h:165
EnetPort_EgressPriorityType
EnetPort_EgressPriorityType
Egress priority type.
Definition: enet_mod_port.h:83
EnetPort_VlanCfg::portPri
uint32_t portPri
Definition: enet_mod_port.h:70
EnetPort_TrafficShapingCfg
Traffic shaping configuration for all priorities.
Definition: enet_mod_port.h:119
EnetPort_MaxLen
Maximum packet lengths for TX and RX.
Definition: enet_mod_port.h:156
ENET_EGRESS_PRI_TYPE_ESCALATE
@ ENET_EGRESS_PRI_TYPE_ESCALATE
Definition: enet_mod_port.h:88
EnetPort_TrafficShapingRates
Traffic shaping parameters (committed and excess rates).
Definition: enet_mod_port.h:95
EnetPort_CreditBasedShapingCfg::idleSlope
uint64_t idleSlope
Definition: enet_mod_port.h:112
EnetPort_VlanCfg::portCfi
uint32_t portCfi
Definition: enet_mod_port.h:73
ENET_EGRESS_PRI_TYPE_FIXED
@ ENET_EGRESS_PRI_TYPE_FIXED
Definition: enet_mod_port.h:85
ENET_TOS_PRI_NUM
#define ENET_TOS_PRI_NUM
Type of Service (ToS) priority.
Definition: enet_types.h:174
EnetPort_TrafficShapingRates::committedRateBitsPerSec
uint64_t committedRateBitsPerSec
Definition: enet_mod_port.h:97
EnetPort_DscpPriorityMap::dscpIPv4En
bool dscpIPv4En
Definition: enet_mod_port.h:146
EnetPort_VlanCfg::portVID
uint32_t portVID
Definition: enet_mod_port.h:76
EnetPort_CreditBasedShapingCfg
Credit Based shaping parameters (idleSlope).
Definition: enet_mod_port.h:107
EnetPort_TrafficShapingRates::excessRateBitsPerSec
uint64_t excessRateBitsPerSec
Definition: enet_mod_port.h:100