AM263x MCU+ SDK  10.00.00
enet_rm.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 
46 #ifndef ENET_RM_H_
47 #define ENET_RM_H_
48 
49 /* ========================================================================== */
50 /* Include Files */
51 /* ========================================================================== */
52 
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 /* ========================================================================== */
60 /* Macros */
61 /* ========================================================================== */
62 
64 #define ENET_RM_PUBLIC_IOCTL(x) (ENET_IOCTL_TYPE_PUBLIC | \
65  ENET_IOCTL_RM_BASE | \
66  ENET_IOCTL_PER_GENERIC | \
67  ENET_IOCTL_MIN(x))
68 
77 #define ENET_RM_TXCHNUM_INVALID (0xABCDABCDU)
78 
80 #define ENET_RM_RXFLOWIDX_INVALID (0xABCDABCDU)
81 
83 #define ENET_RM_INVALIDCORE (0x5562AEFEU)
84 
88 #define ENET_RM_NUM_IOCTL_PERM_ENTRY_MAX (16U)
89 
91 #define ENET_RM_NUM_MACADDR_MAX (10U)
92 
100 #define ENET_RM_NUM_RXCHAN_MAX (2U)
101 
102 /* ========================================================================== */
103 /* Structures and Enums */
104 /* ========================================================================== */
105 
109 typedef enum EnetRm_Ioctls_e
110 {
119 
128 
137 
146 
155 
164 } EnetRm_Ioctls;
165 
172 typedef struct EnetRm_ResourceInfo_s
173 {
175  uint32_t coreId;
176 
178  uint32_t numTxCh;
179 
181  uint32_t numRxCh;
182 
189  uint32_t numRxFlows;
190 
192  uint32_t numMacAddress;
194 
201 typedef struct EnetRm_ResPrms_s
202 {
204  uint32_t numCores;
205 
209 
216 typedef struct EnetRm_IoctlPermissionEntry_s
217 {
219  uint32_t cmd;
220 
225 
232 typedef struct EnetRm_IoctlPermissionTable_s
233 {
237 
239  uint32_t numEntries;
240 
244 
250 typedef struct EnetRm_MacAddressPool_s
251 {
253  uint32_t numMacAddress;
254 
258 
262 typedef struct EnetRm_AllocRxFlowInArgs_s
263 {
265  uint32_t coreKey;
266 
268  uint32_t chIdx;
270 
274 typedef struct EnetRm_AllocRxFlow_s
275 {
277  uint32_t startIdx;
278 
280  uint32_t flowIdx;
282 
286 typedef struct EnetRm_AllocMacAddrOutArgs_s
287 {
289  uint8_t macAddr[ENET_MAC_ADDR_LEN];
291 
295 typedef struct EnetRm_FreeTxChInArgs_s
296 {
298  uint32_t coreKey;
299 
301  uint32_t txChNum;
303 
307 typedef struct EnetRm_FreeRxFlowInArgs_s
308 {
310  uint32_t coreKey;
311 
313  uint32_t chIdx;
314 
316  uint32_t flowIdx;
318 
322 typedef struct EnetRm_FreeMacAddrInArgs_s
323 {
325  uint32_t coreKey;
326 
328  uint8_t macAddr[ENET_MAC_ADDR_LEN];
330 
336 typedef struct EnetRm_ResCfg_s
337 {
339  uint32_t selfCoreId;
340 
343 
346 
349 } EnetRm_ResCfg;
350 
351 /* ========================================================================== */
352 /* Global Variables Declarations */
353 /* ========================================================================== */
354 
355 /* None */
356 
357 /* ========================================================================== */
358 /* Function Declarations */
359 /* ========================================================================== */
360 
361 /* None */
362 
363 /* ========================================================================== */
364 /* Deprecated Function Declarations */
365 /* ========================================================================== */
366 
367 /* None */
368 
369 /* ========================================================================== */
370 /* Static Function Definitions */
371 /* ========================================================================== */
372 
373 /* None */
374 
375 #ifdef __cplusplus
376 }
377 #endif
378 
379 #endif /* ENET_RM_H_ */
380 
EnetRm_AllocRxFlow::flowIdx
uint32_t flowIdx
Definition: enet_rm.h:280
EnetRm_IoctlPermissionEntry::cmd
uint32_t cmd
Definition: enet_rm.h:219
ENET_CFG_REMOTE_CLIENT_CORES_MAX
#define ENET_CFG_REMOTE_CLIENT_CORES_MAX
Maximum number of remote clients cores.
Definition: enet_soc_cfg.h:106
EnetRm_IoctlPermissionTable::defaultPermittedCoreMask
uint32_t defaultPermittedCoreMask
Definition: enet_rm.h:236
EnetRm_ResourceInfo::numTxCh
uint32_t numTxCh
Definition: enet_rm.h:178
EnetRm_FreeRxFlowInArgs::flowIdx
uint32_t flowIdx
Definition: enet_rm.h:316
EnetRm_ResCfg::macList
EnetRm_MacAddressPool macList
Definition: enet_rm.h:348
EnetRm_MacAddressPool
Enet RM MAC address pool.
Definition: enet_rm.h:251
EnetRm_ResPrms
Enet RM resource parameters.
Definition: enet_rm.h:202
EnetRm_ResourceInfo::coreId
uint32_t coreId
Definition: enet_rm.h:175
enet_types.h
This file contains the basic types using across the Enet driver.
EnetRm_ResourceInfo::numMacAddress
uint32_t numMacAddress
Definition: enet_rm.h:192
ENET_RM_PUBLIC_IOCTL
#define ENET_RM_PUBLIC_IOCTL(x)
Helper macro to create IOCTL commands for Enet RM module.
Definition: enet_rm.h:64
EnetRm_AllocRxFlow
Output args for ENET_RM_IOCTL_ALLOC_RX_FLOW command.
Definition: enet_rm.h:275
EnetRm_FreeRxFlowInArgs
Input args for ENET_RM_IOCTL_FREE_RX_FLOW command.
Definition: enet_rm.h:308
ENET_RM_IOCTL_ALLOC_TX_CH_PEERID
@ ENET_RM_IOCTL_ALLOC_TX_CH_PEERID
Alloc TX channel peer id.
Definition: enet_rm.h:154
EnetRm_ResCfg::ioctlPermissionInfo
EnetRm_IoctlPermissionTable ioctlPermissionInfo
Definition: enet_rm.h:345
EnetRm_ResCfg
Resource manager configuration parameters.
Definition: enet_rm.h:337
EnetRm_AllocRxFlowInArgs::coreKey
uint32_t coreKey
Definition: enet_rm.h:265
EnetRm_FreeTxChInArgs::coreKey
uint32_t coreKey
Definition: enet_rm.h:298
EnetRm_Ioctls
EnetRm_Ioctls
Enet RM IOCTL commands.
Definition: enet_rm.h:110
EnetRm_FreeTxChInArgs::txChNum
uint32_t txChNum
Definition: enet_rm.h:301
EnetRm_FreeRxFlowInArgs::coreKey
uint32_t coreKey
Definition: enet_rm.h:310
EnetRm_IoctlPermissionTable::numEntries
uint32_t numEntries
Definition: enet_rm.h:239
EnetRm_AllocRxFlow::startIdx
uint32_t startIdx
Definition: enet_rm.h:277
EnetRm_ResCfg::resPartInfo
EnetRm_ResPrms resPartInfo
Definition: enet_rm.h:342
ENET_RM_IOCTL_ALLOC_RX_FLOW
@ ENET_RM_IOCTL_ALLOC_RX_FLOW
Alloc RX flow.
Definition: enet_rm.h:136
EnetRm_IoctlPermissionEntry
Enet RM IOCTL permission entry.
Definition: enet_rm.h:217
EnetRm_FreeMacAddrInArgs
Input args for ENET_RM_IOCTL_FREE_MAC_ADDR command.
Definition: enet_rm.h:323
ENET_RM_NUM_MACADDR_MAX
#define ENET_RM_NUM_MACADDR_MAX
Maximum number of macaddress to be managed by RM.
Definition: enet_rm.h:91
ENET_RM_IOCTL_FREE_RX_FLOW
@ ENET_RM_IOCTL_FREE_RX_FLOW
Free RX flow.
Definition: enet_rm.h:145
EnetRm_FreeRxFlowInArgs::chIdx
uint32_t chIdx
Definition: enet_rm.h:313
EnetRm_ResCfg::selfCoreId
uint32_t selfCoreId
Definition: enet_rm.h:339
EnetRm_IoctlPermissionEntry::permittedCoreMask
uint32_t permittedCoreMask
Definition: enet_rm.h:223
ENET_RM_IOCTL_ALLOC_MAC_ADDR
@ ENET_RM_IOCTL_ALLOC_MAC_ADDR
Alloc MAC address.
Definition: enet_rm.h:118
EnetRm_AllocRxFlowInArgs::chIdx
uint32_t chIdx
Definition: enet_rm.h:268
EnetRm_AllocRxFlowInArgs
Input args for ENET_RM_IOCTL_ALLOC_RX_FLOW command.
Definition: enet_rm.h:263
EnetRm_AllocMacAddrOutArgs
Input args for ENET_RM_IOCTL_ALLOC_MAC_ADDR command.
Definition: enet_rm.h:287
EnetRm_ResourceInfo
Enet RM resource information.
Definition: enet_rm.h:173
EnetRm_ResourceInfo::numRxFlows
uint32_t numRxFlows
Definition: enet_rm.h:189
EnetRm_MacAddressPool::numMacAddress
uint32_t numMacAddress
Definition: enet_rm.h:253
EnetRm_ResPrms::numCores
uint32_t numCores
Definition: enet_rm.h:204
ENET_RM_IOCTL_FREE_TX_CH_PEERID
@ ENET_RM_IOCTL_FREE_TX_CH_PEERID
Free TX channel peer id.
Definition: enet_rm.h:163
EnetRm_FreeTxChInArgs
Input args for ENET_RM_IOCTL_FREE_TX_CH_PEERID command.
Definition: enet_rm.h:296
ENET_MAC_ADDR_LEN
#define ENET_MAC_ADDR_LEN
MAC address length in bytes/octets.
Definition: enet_types.h:153
ENET_RM_IOCTL_FREE_MAC_ADDR
@ ENET_RM_IOCTL_FREE_MAC_ADDR
Free MAC address.
Definition: enet_rm.h:127
ENET_RM_NUM_IOCTL_PERM_ENTRY_MAX
#define ENET_RM_NUM_IOCTL_PERM_ENTRY_MAX
Maximum number of entries for IOCTL permission.
Definition: enet_rm.h:88
EnetRm_ResourceInfo::numRxCh
uint32_t numRxCh
Definition: enet_rm.h:181
EnetRm_IoctlPermissionTable
Enet RM IOCTL permission table.
Definition: enet_rm.h:233
EnetRm_FreeMacAddrInArgs::coreKey
uint32_t coreKey
Definition: enet_rm.h:325