AM261x MCU+ SDK: mod_null.h Source File

| AM261x MCU+ SDK 26.00.00 |

mod_null.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 MOD_NULL_H_
41 #define MOD_NULL_H_
42
43 /* ========================================================================== */
44 /* Include Files */
45 /* ========================================================================== */
46
47 #include <stdint.h>
48 #include <include/core/enet_types.h>
49 #include <include/core/enet_types.h>
50 #include <include/core/enet_ioctl.h>
51 #include <include/core/enet_trace.h>
52
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56
57 /* ========================================================================== */
58 /* Macros */
59 /* ========================================================================== */
60
62 #define ENET_NULLMOD_FEAT1 (ENET_BIT(0U))
63
65 #define ENET_NULLMOD_ERRATA1 (ENET_BIT(0U))
66
68 #define ENET_NULLMOD_ERRATA2 (ENET_BIT(1U))
69
70 /* ========================================================================== */
71 /* Structures and Enums */
72 /* ========================================================================== */
73
77 typedef struct NullMod_Cfg_s
78 {
80 uint32_t dummy;
81 } NullMod_Cfg;
82
86 typedef struct NullMod_Obj_s
87 {
89 const char *name;
90
92 uint64_t physAddr;
93
95 void *virtAddr;
96
98 uint64_t physAddr2;
99
101 void *virtAddr2;
102
104 uint32_t features;
105
107 uint32_t errata;
108
110 Enet_Magic magic;
111 } NullMod_Obj;
112
116 typedef struct NullMod_Obj_s *NullMod_Handle;
117
118 /* ========================================================================== */
119 /* Global Variables Declarations */
120 /* ========================================================================== */
121
122 /* None */
123
124 /* ========================================================================== */
125 /* Function Declarations */
126 /* ========================================================================== */
127
135 void NullMod_initCfg(NullMod_Cfg *nullModCfg);
136
150 int32_t NullMod_open(NullMod_Handle hNull,
151 Enet_Type enetType,
152 uint32_t instId,
153 const NullMod_Cfg *nullModCfg);
154
167 int32_t NullMod_rejoin(NullMod_Handle hNull,
168 Enet_Type enetType,
169 uint32_t instId);
170
182 int32_t NullMod_ioctl(NullMod_Handle hNull,
183 uint32_t cmd,
184 Enet_IoctlPrms *prms);
185
193 void NullMod_close(NullMod_Handle hNull);
194
195
196 /* ========================================================================== */
197 /* Deprecated Function Declarations */
198 /* ========================================================================== */
199
200 /* None */
201
202 /* ========================================================================== */
203 /* Static Function Definitions */
204 /* ========================================================================== */
205
206 /* None */
207
208 #ifdef __cplusplus
209 }
210 #endif
211
212 #endif /* MOD_NULL_H_ */
NullMod_Obj::features
uint32_t features
Definition: mod_null.h:104
NullMod_initCfg
void NullMod_initCfg(NullMod_Cfg *nullModCfg)
Initialize Null module's configuration parameters.
NullMod_Obj::name
const char * name
Definition: mod_null.h:89
NullMod_Obj::virtAddr
void * virtAddr
Definition: mod_null.h:95
NullMod_Handle
struct NullMod_Obj_s * NullMod_Handle
Null Module handle.
Definition: mod_null.h:116
enet_trace.h
This file contains the type definitions and helper macros for the Enet Trace interface.
enet_types.h
This file contains the basic types using across the Enet driver.
NullMod_Obj::magic
Enet_Magic magic
Definition: mod_null.h:110
enet_ioctl.h
This file contains the type definitions and helper macros for the Enet IOCTL interface.
NullMod_Obj::physAddr
uint64_t physAddr
Definition: mod_null.h:92
Enet_Magic
Enet_Magic
Enet driver magic value, used to indicate if driver is open or not.
Definition: enet_types.h:238
Enet_IoctlPrms
Enet IOCTL param.
Definition: enet_ioctl.h:282
NullMod_Obj
Null Module object.
Definition: mod_null.h:87
NullMod_Cfg
Null Module configuration parameters.
Definition: mod_null.h:78
NullMod_close
void NullMod_close(NullMod_Handle hNull)
Close the Null Module.
NullMod_Obj::physAddr2
uint64_t physAddr2
Definition: mod_null.h:98
NullMod_rejoin
int32_t NullMod_rejoin(NullMod_Handle hNull, Enet_Type enetType, uint32_t instId)
Rejoin the Null Module.
Enet_Type
Enet_Type
Ethernet peripheral type.
Definition: enet_types.h:202
NullMod_ioctl
int32_t NullMod_ioctl(NullMod_Handle hNull, uint32_t cmd, Enet_IoctlPrms *prms)
Issue an operation on the Null Module.
NullMod_open
int32_t NullMod_open(NullMod_Handle hNull, Enet_Type enetType, uint32_t instId, const NullMod_Cfg *nullModCfg)
Open and initialize the Null Module.
NullMod_Cfg::dummy
uint32_t dummy
Definition: mod_null.h:80
NullMod_Obj::virtAddr2
void * virtAddr2
Definition: mod_null.h:101
NullMod_Obj::errata
uint32_t errata
Definition: mod_null.h:107