|
AM64x MCU+ SDK
10.00.00
|
|
Go to the documentation of this file.
66 #define ENET_IOCTL_TYPE_OFFSET (24U)
69 #define ENET_IOCTL_PER_OFFSET (16U)
72 #define ENET_IOCTL_MAJOR_OFFSET (8U)
75 #define ENET_IOCTL_MINOR_OFFSET (0U)
78 #define ENET_IOCTL_GET_TYPE(x) ((x) & 0xFF000000U)
81 #define ENET_IOCTL_GET_PER(x) ((x) & 0x00FF0000U)
84 #define ENET_IOCTL_GET_MAJ(x) ((x) & 0x0000FF00U)
87 #define ENET_IOCTL_GET_MIN(x) ((x) & 0x000000FFU)
90 #define ENET_IOCTL_TYPE(x) ((x) << ENET_IOCTL_TYPE_OFFSET)
93 #define ENET_IOCTL_PER(x) ((x) << ENET_IOCTL_PER_OFFSET)
96 #define ENET_IOCTL_MAJ(x) ((x) << ENET_IOCTL_MAJOR_OFFSET)
99 #define ENET_IOCTL_MIN(x) ((x) << ENET_IOCTL_MINOR_OFFSET)
104 #define ENET_IOCTL_SET_NO_ARGS(prms) \
106 (prms)->inArgs = NULL; \
107 (prms)->inArgsSize = 0U; \
108 (prms)->outArgs = NULL; \
109 (prms)->outArgsSize = 0U; \
115 #define ENET_IOCTL_SET_IN_ARGS(prms, in) \
117 (prms)->inArgs = (in); \
118 (prms)->inArgsSize = sizeof(*(in)); \
119 (prms)->outArgs = NULL; \
120 (prms)->outArgsSize = 0U; \
126 #define ENET_IOCTL_SET_OUT_ARGS(prms, out) \
128 (prms)->inArgs = NULL; \
129 (prms)->inArgsSize = 0U; \
130 (prms)->outArgs = (out); \
131 (prms)->outArgsSize = sizeof(*(out)); \
137 #define ENET_IOCTL_SET_INOUT_ARGS(prms, in, out) \
139 (prms)->inArgs = (in); \
140 (prms)->inArgsSize = sizeof(*(in)); \
141 (prms)->outArgs = (out); \
142 (prms)->outArgsSize = sizeof(*(out)); \
149 #define ENET_IOCTL_VALID_PRMS(cmdId, inSize, outSize) \
150 [ENET_IOCTL_GET_MIN(cmdId)] = \
153 .inArgsSize = (inSize), \
154 .outArgsSize = (outSize), \
181 #define ENET_IOCTL(hEnet, coreId, ioctlCmd,prms,status) \
183 extern int32_t Enet_ioctl(Enet_Handle enetHandle, \
184 uint32_t ioctlCoreId, \
186 Enet_IoctlPrms *ioctlPrms); \
188 extern int32_t Enet_ioctl_register_##ioctlCmd(Enet_Handle enetHandle, \
189 uint32_t ioctlCoreId); \
191 status = Enet_ioctl_register_##ioctlCmd(hEnet, coreId); \
192 if (ENET_SOK == status) \
194 status = Enet_ioctl(hEnet, coreId, ioctlCmd,prms); \
274 typedef struct Enet_IoctlPrms_s
295 typedef struct Enet_IoctlValidate_s
330 uint32_t inArgsSize);
358 uint32_t outArgsSize);
388 uint32_t outArgsSize);
390 #if ENET_CFG_IS_ON(DEV_ERROR)
427 int32_t Enet_validateIoctl(uint32_t cmd,
430 uint32_t numValidIoctls);
446 return ((prms != NULL) &&
454 return ((prms != NULL) &&
461 uint32_t outArgsSize)
463 return ((prms != NULL) &&
471 return ((prms != NULL) &&
479 uint32_t outArgsSize)
481 return ((prms != NULL) &&
@ ENET_IOCTL_PER_CPSW
Definition: enet_ioctl.h:224
Enet_IoctlMajor_e
IOCTL base number.
Definition: enet_ioctl.h:237
@ ENET_IOCTL_HOSTPORT_BASE
Definition: enet_ioctl.h:248
Enet IOCTL expected param sizes.
Definition: enet_ioctl.h:296
#define ENET_EMALFORMEDIOCTL
Malformed IOCTL (args pointer or size not as expected).
Definition: enet_types.h:118
uint32_t cmd
Definition: enet_ioctl.h:298
@ ENET_IOCTL_TYPE_PUBLIC
Definition: enet_ioctl.h:209
@ ENET_IOCTL_PER_BASE
Definition: enet_ioctl.h:239
#define ENET_IOCTL_MAJ(x)
Helper macro to set the IOCTL major number.
Definition: enet_ioctl.h:96
Enet_IoctlType_e
IOCTL types.
Definition: enet_ioctl.h:207
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:443
Enet IOCTL param.
Definition: enet_ioctl.h:275
@ ENET_IOCTL_PER_GENERIC
Definition: enet_ioctl.h:221
@ ENET_IOCTL_STATS_BASE
Definition: enet_ioctl.h:257
@ ENET_IOCTL_PER_ICSSG
Definition: enet_ioctl.h:227
#define ENET_IOCTL_PER(x)
Helper macro to set the IOCTL type.
Definition: enet_ioctl.h:93
@ ENET_IOCTL_MDIO_BASE
Definition: enet_ioctl.h:254
@ ENET_IOCTL_FDB_BASE
Definition: enet_ioctl.h:242
@ ENET_IOCTL_PHY_BASE
Definition: enet_ioctl.h:260
Enet_IoctlPer_e
IOCTL peripheral types.
Definition: enet_ioctl.h:219
uint32_t inArgsSize
Definition: enet_ioctl.h:301
@ ENET_IOCTL_RM_BASE
Definition: enet_ioctl.h:263
@ ENET_IOCTL_PER_GMAC
Definition: enet_ioctl.h:230
static uint32_t Enet_checkNoOutArgs(const Enet_IoctlPrms *prms)
Check IOCTL output args for commands that don't have output.
Definition: enet_ioctl.h:469
@ ENET_IOCTL_MACPORT_BASE
Definition: enet_ioctl.h:251
@ ENET_IOCTL_TIMESYNC_BASE
Definition: enet_ioctl.h:245
const void * inArgs
Definition: enet_ioctl.h:277
@ ENET_IOCTL_TAS_BASE
Definition: enet_ioctl.h:266
@ ENET_IOCTL_TYPE_PRIVATE
Definition: enet_ioctl.h:212
#define ENET_SOK
Success.
Definition: enet_types.h:76
uint32_t inArgsSize
Definition: enet_ioctl.h:280
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:477
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:452
uint32_t outArgsSize
Definition: enet_ioctl.h:286
This file contains the Enet configuration parameters.
#define ENET_IOCTL_TYPE(x)
Helper macro to set the IOCTL type.
Definition: enet_ioctl.h:90
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:460
void * outArgs
Definition: enet_ioctl.h:283
uint32_t outArgsSize
Definition: enet_ioctl.h:304