PDK API Guide for AM65xx
cpsw_hostport_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 
41 #ifndef CPSW_HOSTPORT_PRIV_H_
42 #define CPSW_HOSTPORT_PRIV_H_
43 
44 /* ========================================================================== */
45 /* Include Files */
46 /* ========================================================================== */
47 
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 /* ========================================================================== */
55 /* Macros */
56 /* ========================================================================== */
57 
59 #define CPSW_HOSTPORT_PRIVATE_IOCTL(x) (ENET_IOCTL_TYPE_PRIVATE | \
60  ENET_IOCTL_HOSTPORT_BASE | \
61  ENET_IOCTL_PER_CPSW | \
62  ENET_IOCTL_MIN(x))
63 
64 /* ========================================================================== */
65 /* Structures and Enums */
66 /* ========================================================================== */
67 
71 typedef enum CpswHostPort_PrivIoctls_e
72 {
84 
88 typedef struct CpswHostPort_Obj_s
89 {
92 
95 
97  uint32_t instId;
99 
104 
105 /* ========================================================================== */
106 /* Global Variables Declarations */
107 /* ========================================================================== */
108 
109 /* None */
110 
111 /* ========================================================================== */
112 /* Function Declarations */
113 /* ========================================================================== */
114 
126 int32_t CpswHostPort_open(EnetMod_Handle hMod,
127  Enet_Type enetType,
128  uint32_t instId,
129  const void *cfg,
130  uint32_t cfgSize);
131 
142  Enet_Type enetType,
143  uint32_t instId);
144 
155  uint32_t cmd,
156  Enet_IoctlPrms *prms);
157 
164 
165 /* ========================================================================== */
166 /* Deprecated Function Declarations */
167 /* ========================================================================== */
168 
169 /* None */
170 
171 /* ========================================================================== */
172 /* Static Function Definitions */
173 /* ========================================================================== */
174 
175 /* None */
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 
181 #endif /* CPSW_HOSTPORT_PRIV_H_ */
void CpswHostPort_close(EnetMod_Handle hMod)
Close CPSW host port.
Enet_Type
Ethernet peripheral type.
Definition: enet_types.h:195
uint32_t instId
Definition: cpsw_hostport_priv.h:97
Set flow ID offset.
Definition: cpsw_hostport_priv.h:82
Ethernet Module object.
Definition: enet_mod.h:136
CPSW host port object.
Definition: cpsw_hostport_priv.h:88
CpswHostPort_PrivIoctls
Host port private IOCTL commands.
Definition: cpsw_hostport_priv.h:71
CpswHostPort_Obj * CpswHostPort_Handle
Host port module handle.
Definition: cpsw_hostport_priv.h:103
This file contains the type definitions and helper macros for the Enet Hostport module interface.
Enet_Type enetType
Definition: cpsw_hostport_priv.h:94
int32_t CpswHostPort_ioctl(EnetMod_Handle hMod, uint32_t cmd, Enet_IoctlPrms *prms)
Run an IOCTL operation on CPSW host port.
int32_t CpswHostPort_open(EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)
Open and initialize CPSW host port.
Enet IOCTL param.
Definition: enet_ioctl.h:229
EnetMod_Obj enetMod
Definition: cpsw_hostport_priv.h:91
int32_t CpswHostPort_rejoin(EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId)
Rejoin a running CPSW host port.
#define CPSW_HOSTPORT_PRIVATE_IOCTL(x)
Helper macro to create private IOCTL commands for CPSW MAC port module.
Definition: cpsw_hostport_priv.h:59
struct EnetMod_Obj_s * EnetMod_Handle
Ethernet Module handle.
Definition: enet_mod.h:71