AM64x MCU+ SDK  08.02.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 
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 {
99 
109 
110 
114 typedef struct CpswHostPort_FifoStats_s
115 {
118 
120  uint32_t txBlockCount;
121 
126 
129 
131  bool txActiveFifo[ENET_PRI_NUM];
133 
137 typedef struct CpswHostPort_Cfg_s
138 {
142 
144  bool removeCrc;
145 
148 
152 
154  uint32_t rxMtu;
155 
159 
166 
172 
177 
182 
185 
188 
192 
193 /* ========================================================================== */
194 /* Global Variables Declarations */
195 /* ========================================================================== */
196 
197 /* None */
198 
199 /* ========================================================================== */
200 /* Function Declarations */
201 /* ========================================================================== */
202 
209 
210 /* ========================================================================== */
211 /* Deprecated Function Declarations */
212 /* ========================================================================== */
213 
214 /* None */
215 
216 /* ========================================================================== */
217 /* Static Function Definitions */
218 /* ========================================================================== */
219 
220 /* None */
221 
222 #ifdef __cplusplus
223 }
224 #endif
225 
226 #endif /* CPSW_HOSTPORT_H_ */
227 
CpswHostPort_Cfg::removeCrc
bool removeCrc
Definition: cpsw_hostport.h:144
CpswHostPort_Cfg::rxVlanRemapEn
bool rxVlanRemapEn
Definition: cpsw_hostport.h:171
EnetPort_VlanCfg
VLAN configuration parameters.
Definition: enet_mod_port.h:68
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
CpswHostPort_Cfg::csumOffloadEn
bool csumOffloadEn
Definition: cpsw_hostport.h:165
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_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:220
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:83
CpswHostPort_FifoStats::rxBlockCountExpress
uint32_t rxBlockCountExpress
Definition: cpsw_hostport.h:125
CpswHostPort_Cfg::rxPriorityType
EnetHostPort_IngressPriorityType rxPriorityType
Definition: cpsw_hostport.h:187
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:176
CpswHostPort_Cfg::rxDscpIPv6RemapEn
bool rxDscpIPv6RemapEn
Definition: cpsw_hostport.h:181
CpswHostPort_Cfg::txPriorityType
EnetPort_EgressPriorityType txPriorityType
Definition: cpsw_hostport.h:190
CpswHostPort_Cfg
Host port module configuration parameters.
Definition: cpsw_hostport.h:138
CpswHostPort_Cfg::vlanCfg
EnetPort_VlanCfg vlanCfg
Definition: cpsw_hostport.h:184
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:244
CpswHostPort_Ioctl
CpswHostPort_Ioctl
CPSW MAC 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