|
AM62x MCU+ SDK
10.01.00
|
|
Go to the documentation of this file.
73 #define ENET_IOCTL_TYPE_OFFSET (24U)
76 #define ENET_IOCTL_PER_OFFSET (16U)
79 #define ENET_IOCTL_MAJOR_OFFSET (8U)
82 #define ENET_IOCTL_MINOR_OFFSET (0U)
85 #define ENET_IOCTL_GET_TYPE(x) ((x) & 0xFF000000U)
88 #define ENET_IOCTL_GET_PER(x) ((x) & 0x00FF0000U)
91 #define ENET_IOCTL_GET_MAJ(x) ((x) & 0x0000FF00U)
94 #define ENET_IOCTL_GET_MIN(x) ((x) & 0x000000FFU)
97 #define ENET_IOCTL_TYPE(x) ((x) << ENET_IOCTL_TYPE_OFFSET)
100 #define ENET_IOCTL_PER(x) ((x) << ENET_IOCTL_PER_OFFSET)
103 #define ENET_IOCTL_MAJ(x) ((x) << ENET_IOCTL_MAJOR_OFFSET)
106 #define ENET_IOCTL_MIN(x) ((x) << ENET_IOCTL_MINOR_OFFSET)
111 #define ENET_IOCTL_SET_NO_ARGS(prms) \
113 (prms)->inArgs = NULL; \
114 (prms)->inArgsSize = 0U; \
115 (prms)->outArgs = NULL; \
116 (prms)->outArgsSize = 0U; \
122 #define ENET_IOCTL_SET_IN_ARGS(prms, in) \
124 (prms)->inArgs = (in); \
125 (prms)->inArgsSize = sizeof(*(in)); \
126 (prms)->outArgs = NULL; \
127 (prms)->outArgsSize = 0U; \
133 #define ENET_IOCTL_SET_OUT_ARGS(prms, out) \
135 (prms)->inArgs = NULL; \
136 (prms)->inArgsSize = 0U; \
137 (prms)->outArgs = (out); \
138 (prms)->outArgsSize = sizeof(*(out)); \
144 #define ENET_IOCTL_SET_INOUT_ARGS(prms, in, out) \
146 (prms)->inArgs = (in); \
147 (prms)->inArgsSize = sizeof(*(in)); \
148 (prms)->outArgs = (out); \
149 (prms)->outArgsSize = sizeof(*(out)); \
156 #define ENET_IOCTL_VALID_PRMS(cmdId, inSize, outSize) \
157 [ENET_IOCTL_GET_MIN(cmdId)] = \
160 .inArgsSize = (inSize), \
161 .outArgsSize = (outSize), \
188 #define ENET_IOCTL(hEnet, coreId, ioctlCmd, prms, status) \
190 extern int32_t Enet_ioctl(Enet_Handle enetHandle, \
191 uint32_t ioctlCoreId, \
193 Enet_IoctlPrms *ioctlPrms); \
195 extern int32_t Enet_ioctl_register_##ioctlCmd(Enet_Handle enetHandle, \
196 uint32_t ioctlCoreId); \
198 status = Enet_ioctl_register_##ioctlCmd(hEnet, coreId); \
199 if (ENET_SOK == status) \
201 status = Enet_ioctl(hEnet, coreId, ioctlCmd, prms); \
281 typedef struct Enet_IoctlPrms_s
302 typedef struct Enet_IoctlValidate_s
337 uint32_t inArgsSize);
365 uint32_t outArgsSize);
395 uint32_t outArgsSize);
397 #if ENET_CFG_IS_ON(DEV_ERROR)
434 int32_t Enet_validateIoctl(uint32_t cmd,
437 uint32_t numValidIoctls);
453 return ((prms !=
NULL) &&
461 return ((prms !=
NULL) &&
468 uint32_t outArgsSize)
470 return ((prms !=
NULL) &&
478 return ((prms !=
NULL) &&
486 uint32_t outArgsSize)
488 return ((prms !=
NULL) &&
@ ENET_IOCTL_PER_CPSW
Definition: enet_ioctl.h:231
Enet_IoctlMajor_e
IOCTL base number.
Definition: enet_ioctl.h:244
@ ENET_IOCTL_HOSTPORT_BASE
Definition: enet_ioctl.h:255
Enet IOCTL expected param sizes.
Definition: enet_ioctl.h:303
#define ENET_EMALFORMEDIOCTL
Malformed IOCTL (args pointer or size not as expected).
Definition: enet_types.h:118
uint32_t cmd
Definition: enet_ioctl.h:305
@ ENET_IOCTL_TYPE_PUBLIC
Definition: enet_ioctl.h:216
@ ENET_IOCTL_PER_BASE
Definition: enet_ioctl.h:246
#define NULL
Define NULL if not defined.
Definition: csl_types.h:100
#define ENET_IOCTL_MAJ(x)
Helper macro to set the IOCTL major number.
Definition: enet_ioctl.h:103
Enet_IoctlType_e
IOCTL types.
Definition: enet_ioctl.h:214
static uint32_t Enet_checkInArgs(const Enet_IoctlPrms *prms, uint32_t inArgsSize)
Check IOCTL input args for commands that expect an input.
Definition: enet_ioctl.h:450
Enet IOCTL param.
Definition: enet_ioctl.h:282
@ ENET_IOCTL_PER_GENERIC
Definition: enet_ioctl.h:228
@ ENET_IOCTL_STATS_BASE
Definition: enet_ioctl.h:264
@ ENET_IOCTL_PER_ICSSG
Definition: enet_ioctl.h:234
#define ENET_IOCTL_PER(x)
Helper macro to set the IOCTL hardware peripheral.
Definition: enet_ioctl.h:100
@ ENET_IOCTL_MDIO_BASE
Definition: enet_ioctl.h:261
@ ENET_IOCTL_FDB_BASE
Definition: enet_ioctl.h:249
@ ENET_IOCTL_PHY_BASE
Definition: enet_ioctl.h:267
Enet_IoctlPer_e
IOCTL peripheral types.
Definition: enet_ioctl.h:226
uint32_t inArgsSize
Definition: enet_ioctl.h:308
@ ENET_IOCTL_RM_BASE
Definition: enet_ioctl.h:270
@ ENET_IOCTL_PER_GMAC
Definition: enet_ioctl.h:237
static uint32_t Enet_checkNoOutArgs(const Enet_IoctlPrms *prms)
Check IOCTL output args for commands that don't have output.
Definition: enet_ioctl.h:476
@ ENET_IOCTL_MACPORT_BASE
Definition: enet_ioctl.h:258
@ ENET_IOCTL_TIMESYNC_BASE
Definition: enet_ioctl.h:252
const void * inArgs
Definition: enet_ioctl.h:284
@ ENET_IOCTL_TAS_BASE
Definition: enet_ioctl.h:273
@ ENET_IOCTL_TYPE_PRIVATE
Definition: enet_ioctl.h:219
#define ENET_SOK
Success.
Definition: enet_types.h:76
uint32_t inArgsSize
Definition: enet_ioctl.h:287
static uint32_t Enet_checkInOutArgs(const Enet_IoctlPrms *prms, uint32_t inArgsSize, uint32_t outArgsSize)
Check IOCTL input and output args.
Definition: enet_ioctl.h:484
static uint32_t Enet_checkNoInArgs(const Enet_IoctlPrms *prms)
Check IOCTL input args for commands that don't expect an input.
Definition: enet_ioctl.h:459
uint32_t outArgsSize
Definition: enet_ioctl.h:293
This file contains the Enet configuration parameters.
#define ENET_IOCTL_TYPE(x)
Helper macro to set the IOCTL type.
Definition: enet_ioctl.h:97
static uint32_t Enet_checkOutArgs(const Enet_IoctlPrms *prms, uint32_t outArgsSize)
Check IOCTL output args for commands that expect an output.
Definition: enet_ioctl.h:467
void * outArgs
Definition: enet_ioctl.h:290
uint32_t outArgsSize
Definition: enet_ioctl.h:311