AM261x MCU+ SDK: cpsw_hostport.h Source File

| AM261x MCU+ SDK 26.00.00 |

cpsw_hostport.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
59 #ifndef CPSW_HOSTPORT_H_
60 #define CPSW_HOSTPORT_H_
61
62 /* ========================================================================== */
63 /* Include Files */
64 /* ========================================================================== */
65
66 #include <include/core/enet_mod_hostport.h>
67
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71
72 /* ========================================================================== */
73 /* Macros */
74 /* ========================================================================== */
75
77 #define CPSW_HOSTPORT_PUBLIC_IOCTL(x) (ENET_IOCTL_TYPE_PUBLIC | \
78 ENET_IOCTL_HOSTPORT_BASE | \
79 ENET_IOCTL_PER_CPSW | \
80 ENET_IOCTL_MIN(x))
81
82 /* ========================================================================== */
83 /* Structures and Enums */
84 /* ========================================================================== */
85
89 typedef enum CpswHostPort_Ioctl_s
90 {
98 CPSW_HOSTPORT_IOCTL_GET_FIFO_STATS = CPSW_HOSTPORT_PUBLIC_IOCTL(0U),
99
107 CPSW_HOSTPORT_GET_FLOW_ID_OFFSET = CPSW_HOSTPORT_PUBLIC_IOCTL(1U),
108 } CpswHostPort_Ioctl;
109
110
114 typedef struct CpswHostPort_FifoStats_s
115 {
117 uint32_t rxThroughputRate;
118
120 uint32_t txBlockCount;
121
125 uint32_t rxBlockCountExpress;
126
128 uint32_t rxBlockCountPreempt;
129
131 bool txActiveFifo[ENET_PRI_NUM];
132 } CpswHostPort_FifoStats;
133
137 typedef struct CpswHostPort_Cfg_s
138 {
141 Enet_CrcType crcType;
142
144 bool removeCrc;
145
147 bool padShortPacket;
148
151 bool passCrcErrors;
152
154 uint32_t rxMtu;
155
158 bool passPriorityTaggedUnchanged;
159
168 bool txCsumOffloadEn;
169
173 bool rxCsumOffloadEn;
174
179 bool rxVlanRemapEn;
180
184 bool rxDscpIPv4RemapEn;
185
189 bool rxDscpIPv6RemapEn;
190
192 EnetPort_VlanCfg vlanCfg;
193
195 EnetHostPort_IngressPriorityType rxPriorityType;
196
198 EnetPort_EgressPriorityType txPriorityType;
199 } CpswHostPort_Cfg;
200
201 /* ========================================================================== */
202 /* Global Variables Declarations */
203 /* ========================================================================== */
204
205 /* None */
206
207 /* ========================================================================== */
208 /* Function Declarations */
209 /* ========================================================================== */
210
216 void CpswHostPort_initCfg(CpswHostPort_Cfg *hostPortCfg);
217
218 /* ========================================================================== */
219 /* Deprecated Function Declarations */
220 /* ========================================================================== */
221
222 /* None */
223
224 /* ========================================================================== */
225 /* Static Function Definitions */
226 /* ========================================================================== */
227
228 /* None */
229
230 #ifdef __cplusplus
231 }
232 #endif
233
234 #endif /* CPSW_HOSTPORT_H_ */
235
CpswHostPort_Cfg::removeCrc
bool removeCrc
Definition: cpsw_hostport.h:144
CpswHostPort_Cfg::rxVlanRemapEn
bool rxVlanRemapEn
Definition: cpsw_hostport.h:179
EnetPort_VlanCfg
VLAN configuration parameters.
Definition: enet_mod_port.h:69
CPSW_HOSTPORT_IOCTL_GET_FIFO_STATS
@ CPSW_HOSTPORT_IOCTL_GET_FIFO_STATS
Get host port's FIFO statistics.
Definition: cpsw_hostport.h:98
CpswHostPort_Cfg::padShortPacket
bool padShortPacket
Definition: cpsw_hostport.h:147
CpswHostPort_Cfg::passCrcErrors
bool passCrcErrors
Definition: cpsw_hostport.h:151
CPSW_HOSTPORT_PUBLIC_IOCTL
#define CPSW_HOSTPORT_PUBLIC_IOCTL(x)
Helper macro to create IOCTL commands for CPSW host port module.
Definition: cpsw_hostport.h:77
CpswHostPort_Cfg::rxCsumOffloadEn
bool rxCsumOffloadEn
Definition: cpsw_hostport.h:173
CpswHostPort_FifoStats::txBlockCount
uint32_t txBlockCount
Definition: cpsw_hostport.h:120
CPSW_HOSTPORT_GET_FLOW_ID_OFFSET
@ CPSW_HOSTPORT_GET_FLOW_ID_OFFSET
Get host port flow Id offset.
Definition: cpsw_hostport.h:107
EnetHostPort_IngressPriorityType
EnetHostPort_IngressPriorityType
Port priority type.
Definition: enet_mod_hostport.h:239
CpswHostPort_Cfg::passPriorityTaggedUnchanged
bool passPriorityTaggedUnchanged
Definition: cpsw_hostport.h:158
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
CpswHostPort_Cfg::txCsumOffloadEn
bool txCsumOffloadEn
Definition: cpsw_hostport.h:168
CpswHostPort_FifoStats::rxBlockCountExpress
uint32_t rxBlockCountExpress
Definition: cpsw_hostport.h:125
CpswHostPort_Cfg::rxPriorityType
EnetHostPort_IngressPriorityType rxPriorityType
Definition: cpsw_hostport.h:195
CpswHostPort_initCfg
void CpswHostPort_initCfg(CpswHostPort_Cfg *hostPortCfg)
Initialize CPSW host port configuration parameters.
CpswHostPort_FifoStats
FIFO related statistics of the host port.
Definition: cpsw_hostport.h:115
CpswHostPort_FifoStats::rxBlockCountPreempt
uint32_t rxBlockCountPreempt
Definition: cpsw_hostport.h:128
CpswHostPort_FifoStats::rxThroughputRate
uint32_t rxThroughputRate
Definition: cpsw_hostport.h:117
CpswHostPort_Cfg::rxDscpIPv4RemapEn
bool rxDscpIPv4RemapEn
Definition: cpsw_hostport.h:184
CpswHostPort_Cfg::rxDscpIPv6RemapEn
bool rxDscpIPv6RemapEn
Definition: cpsw_hostport.h:189
CpswHostPort_Cfg::txPriorityType
EnetPort_EgressPriorityType txPriorityType
Definition: cpsw_hostport.h:198
CpswHostPort_Cfg
Host port module configuration parameters.
Definition: cpsw_hostport.h:138
CpswHostPort_Cfg::vlanCfg
EnetPort_VlanCfg vlanCfg
Definition: cpsw_hostport.h:192
enet_mod_hostport.h
This file contains the type definitions and helper macros for the Enet Hostport module interface.
Enet_CrcType
Enet_CrcType
CRC type.
Definition: enet_types.h:250
CpswHostPort_Ioctl
CpswHostPort_Ioctl
CPSW HOST port IOCTL commands.
Definition: cpsw_hostport.h:90
CpswHostPort_Cfg::rxMtu
uint32_t rxMtu
Definition: cpsw_hostport.h:154
CpswHostPort_Cfg::crcType
Enet_CrcType crcType
Definition: cpsw_hostport.h:141