AM261x MCU+ SDK: enet_mod_port.h Source File

| AM261x MCU+ SDK 26.00.00 |

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>
48 #include <include/core/enet_types.h>
49 #include <include/core/enet_ioctl.h>
50
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54
55 /* ========================================================================== */
56 /* Macros */
57 /* ========================================================================== */
58
59 /* None */
60
61 /* ========================================================================== */
62 /* Structures and Enums */
63 /* ========================================================================== */
64
68 typedef struct EnetPort_VlanCfg_s
69 {
71 uint32_t portPri;
72
74 uint32_t portCfi;
75
77 uint32_t portVID;
78 } EnetPort_VlanCfg;
79
83 typedef enum EnetPort_EgressPriorityType_e
84 {
86 ENET_EGRESS_PRI_TYPE_FIXED = 0U,
87
89 ENET_EGRESS_PRI_TYPE_ESCALATE,
90 } EnetPort_EgressPriorityType;
91
95 typedef struct EnetPort_TrafficShapingRates_s
96 {
98 uint64_t committedRateBitsPerSec;
99
101 uint64_t excessRateBitsPerSec;
102 } EnetPort_TrafficShapingRates;
103
107 typedef struct EnetPort_CreditBasedShapingCfg_s
108 {
110 uint32_t queueNum;
111
113 uint64_t idleSlope;
114 } EnetPort_CreditBasedShapingCfg;
115
119 typedef struct EnetPort_TrafficShapingCfg_s
120 {
122 EnetPort_TrafficShapingRates rates[ENET_PRI_NUM];
123 } EnetPort_TrafficShapingCfg;
124
131 typedef struct EnetPort_PriorityMap_s
132 {
135 uint32_t priorityMap[ENET_PRI_NUM];
136 } EnetPort_PriorityMap;
137
141 typedef struct EnetPort_DscpPriorityMap_s
142 {
144 uint32_t tosMap[ENET_TOS_PRI_NUM];
145
147 bool dscpIPv4En;
148
150 bool dscpIPv6En;
151 } EnetPort_DscpPriorityMap;
152
156 typedef struct EnetPort_MaxLen_s
157 {
159 uint32_t mtu[ENET_PRI_NUM];
160
162 uint32_t mru;
163 } EnetPort_MaxLen;
164
165 #if ENET_CFG_IS_ON(CPSW_CUTTHRU)
166 typedef struct EnetPort_CutThruParams_s
167 {
169 bool portSpeedAutoEn;
170
172 uint32_t rxPriCutThruEn;
173
175 uint32_t txPriCutThruEn;
176 } EnetPort_CutThruParams;
177 #endif
178
179 /* ========================================================================== */
180 /* Global Variables Declarations */
181 /* ========================================================================== */
182
183 /* None */
184
185 /* ========================================================================== */
186 /* Function Declarations */
187 /* ========================================================================== */
188
189 /* None */
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 /* ENET_MOD_PORT_H_ */
EnetPort_PriorityMap
Priority map.
Definition: enet_mod_port.h:132
EnetPort_DscpPriorityMap::dscpIPv6En
bool dscpIPv6En
Definition: enet_mod_port.h:150
EnetPort_VlanCfg
VLAN configuration parameters.
Definition: enet_mod_port.h:69
EnetPort_MaxLen::mru
uint32_t mru
Definition: enet_mod_port.h:162
enet_types.h
This file contains the basic types using across the Enet driver.
enet_ioctl.h
This file contains the type definitions and helper macros for the Enet IOCTL interface.
EnetPort_DscpPriorityMap
DSCP priority map.
Definition: enet_mod_port.h:142
EnetPort_CreditBasedShapingCfg::queueNum
uint32_t queueNum
Definition: enet_mod_port.h:110
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:84
EnetPort_VlanCfg::portPri
uint32_t portPri
Definition: enet_mod_port.h:71
EnetPort_TrafficShapingCfg
Traffic shaping configuration for all priorities.
Definition: enet_mod_port.h:120
EnetPort_MaxLen
Maximum packet lengths for TX and RX.
Definition: enet_mod_port.h:157
ENET_EGRESS_PRI_TYPE_ESCALATE
@ ENET_EGRESS_PRI_TYPE_ESCALATE
Definition: enet_mod_port.h:89
EnetPort_TrafficShapingRates
Traffic shaping parameters (committed and excess rates).
Definition: enet_mod_port.h:96
EnetPort_CreditBasedShapingCfg::idleSlope
uint64_t idleSlope
Definition: enet_mod_port.h:113
EnetPort_VlanCfg::portCfi
uint32_t portCfi
Definition: enet_mod_port.h:74
ENET_EGRESS_PRI_TYPE_FIXED
@ ENET_EGRESS_PRI_TYPE_FIXED
Definition: enet_mod_port.h:86
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:98
EnetPort_DscpPriorityMap::dscpIPv4En
bool dscpIPv4En
Definition: enet_mod_port.h:147
EnetPort_VlanCfg::portVID
uint32_t portVID
Definition: enet_mod_port.h:77
EnetPort_CreditBasedShapingCfg
Credit Based shaping parameters (idleSlope).
Definition: enet_mod_port.h:108
EnetPort_TrafficShapingRates::excessRateBitsPerSec
uint64_t excessRateBitsPerSec
Definition: enet_mod_port.h:101