AM263Px MCU+ SDK  11.00.00
enet_mod_tas.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2021
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 
47 #ifndef ENET_MOD_TAS_H_
48 #define ENET_MOD_TAS_H_
49 
50 /* ========================================================================== */
51 /* Include Files */
52 /* ========================================================================== */
53 
54 #include <stdint.h>
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 /* ========================================================================== */
63 /* Macros */
64 /* ========================================================================== */
65 
67 #define ENET_TAS_PUBLIC_IOCTL(x) (ENET_IOCTL_TYPE_PUBLIC | \
68  ENET_IOCTL_TAS_BASE | \
69  ENET_IOCTL_MIN(x))
70 
72 #define ENET_TAS_GATE_MASK(tc7, tc6, tc5, tc4, tc3, tc2, tc1, tc0) \
73  (((((tc7) != 0U) ? 1U : 0U) << 7U) | \
74  ((((tc6) != 0U) ? 1U : 0U) << 6U) | \
75  ((((tc5) != 0U) ? 1U : 0U) << 5U) | \
76  ((((tc4) != 0U) ? 1U : 0U) << 4U) | \
77  ((((tc3) != 0U) ? 1U : 0U) << 3U) | \
78  ((((tc2) != 0U) ? 1U : 0U) << 2U) | \
79  ((((tc1) != 0U) ? 1U : 0U) << 1U) | \
80  ((((tc0) != 0U) ? 1U : 0U) << 0U))
81 
83 #define ENET_TAS_MAX_CMD_LISTS (16)
84 
86 #define ENET_TAS_MAX_NUM_QUEUES (8)
87 
88 /* ========================================================================== */
89 /* Structures and Enums */
90 /* ========================================================================== */
91 
95 typedef enum EnetTas_Ioctl_e
96 {
107 
118 
134 
145 
156 
167 
178 
189 } EnetTas_Ioctl;
190 
194 typedef struct EnetTas_GenericInArgs_s
195 {
199 
203 typedef enum EnetTas_OperStatus_s
204 {
207 
211 
215 typedef enum EnetTas_TasState_s
216 {
219 
222 
226 
230 typedef struct EnetTas_GateCmdEntry_s
231 {
233  uint32_t timeInterval;
234 
236  uint8_t gateStateMask;
238 
242 typedef struct EnetTas_MaxSDUTable_s
243 {
245  uint16_t maxSDU[ENET_TAS_MAX_NUM_QUEUES];
247 
251 typedef struct EnetTas_ControlList_s
252 {
256  uint64_t baseTime;
257 
260 
262  uint64_t cycleTime;
263 
265  uint8_t listLength;
266 
270 
274 typedef struct EnetTas_ConfigStatus_s
275 {
278 
282 
284  uint8_t configPending;
285 
288  uint8_t configChange;
290 
294 typedef struct EnetTas_SetAdminListInArgs_s
295 {
298 
302 
306 typedef struct EnetTas_SetStateInArgs_s
307 {
310 
314 
315 /* ========================================================================== */
316 /* Global Variables Declarations */
317 /* ========================================================================== */
318 
319 /* None */
320 
321 /* ========================================================================== */
322 /* Function Declarations */
323 /* ========================================================================== */
324 
325 /* None */
326 
327 /* ========================================================================== */
328 /* Deprecated Function Declarations */
329 /* ========================================================================== */
330 
331 /* None */
332 
333 /* ========================================================================== */
334 /* Static Function Definitions */
335 /* ========================================================================== */
336 
337 /* None */
338 
339 #ifdef __cplusplus
340 }
341 #endif
342 
343 #endif /* ENET_MOD_TAS_H_ */
344 
EnetTas_GateCmdEntry::timeInterval
uint32_t timeInterval
Definition: enet_mod_tas.h:233
EnetTas_ControlList::listLength
uint8_t listLength
Definition: enet_mod_tas.h:265
EnetTas_ConfigStatus
Config state machine variables. See IEEE Std 802.1Q-2018 8.6.8.4.
Definition: enet_mod_tas.h:275
EnetTas_GenericInArgs
Generic input args.
Definition: enet_mod_tas.h:195
ENET_TAS_MAX_CMD_LISTS
#define ENET_TAS_MAX_CMD_LISTS
Maximum number of gate command entries in each list.
Definition: enet_mod_tas.h:83
EnetTas_TasState
EnetTas_TasState
TAS state types.
Definition: enet_mod_tas.h:216
EnetTas_SetStateInArgs
Input args for ENET_TAS_IOCTL_SET_STATE commands.
Definition: enet_mod_tas.h:307
EnetTas_ControlList::cycleTime
uint64_t cycleTime
Definition: enet_mod_tas.h:262
EnetTas_ConfigStatus::configChangeTime
uint64_t configChangeTime
Definition: enet_mod_tas.h:277
EnetTas_ConfigStatus::configPending
uint8_t configPending
Definition: enet_mod_tas.h:284
ENET_TAS_IOCTL_GET_OPER_LIST_STATUS
@ ENET_TAS_IOCTL_GET_OPER_LIST_STATUS
Get the status of the operational list update.
Definition: enet_mod_tas.h:133
enet_types.h
This file contains the basic types using across the Enet driver.
EnetTas_ConfigStatus::configChangeErrorCounter
uint32_t configChangeErrorCounter
Definition: enet_mod_tas.h:281
Enet_MacPort
Enet_MacPort
MAC port.
Definition: enet_types.h:412
ENET_TAS_IOCTL_GET_ADMIN_LIST
@ ENET_TAS_IOCTL_GET_ADMIN_LIST
Get the admin list parameters of the TAS module.
Definition: enet_mod_tas.h:166
enet_ioctl.h
This file contains the type definitions and helper macros for the Enet IOCTL interface.
EnetTas_SetAdminListInArgs::adminList
EnetTas_ControlList adminList
Definition: enet_mod_tas.h:300
EnetTas_MaxSDUTable
Max SDU table. See IEEE Std 802.1Q-2018 12.29.1.1.
Definition: enet_mod_tas.h:243
ENET_TAS_OPER_LIST_NOT_YET_UPDATED
@ ENET_TAS_OPER_LIST_NOT_YET_UPDATED
Definition: enet_mod_tas.h:206
EnetTas_SetAdminListInArgs
Input args for ENET_TAS_IOCTL_SET_ADMIN_LIST commands.
Definition: enet_mod_tas.h:295
EnetTas_ControlList
Gate control list. See IEEE Std 802.1Q-2018 8.6.9.4 D3-1.
Definition: enet_mod_tas.h:252
EnetTas_SetStateInArgs::macPort
Enet_MacPort macPort
Definition: enet_mod_tas.h:309
ENET_TAS_IOCTL_CONFIG_CHANGE_STATUS_PARAMS
@ ENET_TAS_IOCTL_CONFIG_CHANGE_STATUS_PARAMS
Get the TAS config change status parameters.
Definition: enet_mod_tas.h:188
EnetTas_Ioctl
EnetTas_Ioctl
TAS module IOCTL commands.
Definition: enet_mod_tas.h:96
ENET_TAS_IOCTL_GET_OPER_LIST
@ ENET_TAS_IOCTL_GET_OPER_LIST
Get the operational list parameters of the TAS module.
Definition: enet_mod_tas.h:177
EnetTas_ControlList::sduTable
EnetTas_MaxSDUTable sduTable
Definition: enet_mod_tas.h:268
EnetTas_OperStatus
EnetTas_OperStatus
TAS state types.
Definition: enet_mod_tas.h:204
ENET_TAS_MAX_NUM_QUEUES
#define ENET_TAS_MAX_NUM_QUEUES
Maximum number of transmit queues supported by implementation.
Definition: enet_mod_tas.h:86
ENET_TAS_OPER_LIST_UPDATED
@ ENET_TAS_OPER_LIST_UPDATED
Definition: enet_mod_tas.h:209
EnetTas_GenericInArgs::macPort
Enet_MacPort macPort
Definition: enet_mod_tas.h:197
ENET_TAS_PUBLIC_IOCTL
#define ENET_TAS_PUBLIC_IOCTL(x)
Helper macro to create IOCTL commands for TAS module.
Definition: enet_mod_tas.h:67
EnetTas_ConfigStatus::configChange
uint8_t configChange
Definition: enet_mod_tas.h:288
ENET_TAS_IOCTL_SET_STATE
@ ENET_TAS_IOCTL_SET_STATE
Set the state of the TAS module.
Definition: enet_mod_tas.h:144
EnetTas_SetAdminListInArgs::macPort
Enet_MacPort macPort
Definition: enet_mod_tas.h:297
EnetTas_SetStateInArgs::state
EnetTas_TasState state
Definition: enet_mod_tas.h:312
EnetTas_GateCmdEntry
Gate control list. See IEEE Std 802.1Q-2018 8.6.8.4.
Definition: enet_mod_tas.h:231
EnetTas_GateCmdEntry::gateStateMask
uint8_t gateStateMask
Definition: enet_mod_tas.h:236
ENET_TAS_IOCTL_GET_VERSION
@ ENET_TAS_IOCTL_GET_VERSION
Get the hardware version of the TAS module.
Definition: enet_mod_tas.h:106
ENET_TAS_ENABLE
@ ENET_TAS_ENABLE
Definition: enet_mod_tas.h:221
ENET_TAS_IOCTL_GET_STATE
@ ENET_TAS_IOCTL_GET_STATE
Get the state of the TAS module.
Definition: enet_mod_tas.h:155
ENET_TAS_RESET
@ ENET_TAS_RESET
Definition: enet_mod_tas.h:224
EnetTas_ControlList::baseTime
uint64_t baseTime
Definition: enet_mod_tas.h:256
ENET_TAS_IOCTL_SET_ADMIN_LIST
@ ENET_TAS_IOCTL_SET_ADMIN_LIST
Set the admin list parameters of the TAS module.
Definition: enet_mod_tas.h:117
ENET_TAS_DISABLE
@ ENET_TAS_DISABLE
Definition: enet_mod_tas.h:218