PDK API Guide for J721E
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>
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 /* ========================================================================== */
62 /* Macros */
63 /* ========================================================================== */
64 
66 #define ENET_TAS_PUBLIC_IOCTL(x) (ENET_IOCTL_TYPE_PUBLIC | \
67  ENET_IOCTL_TAS_BASE | \
68  ENET_IOCTL_MIN(x))
69 
71 #define ENET_TAS_GATE_MASK(tc7, tc6, tc5, tc4, tc3, tc2, tc1, tc0) \
72  (((((tc7) != 0U) ? 1U : 0U) << 7U) | \
73  ((((tc6) != 0U) ? 1U : 0U) << 6U) | \
74  ((((tc5) != 0U) ? 1U : 0U) << 5U) | \
75  ((((tc4) != 0U) ? 1U : 0U) << 4U) | \
76  ((((tc3) != 0U) ? 1U : 0U) << 3U) | \
77  ((((tc2) != 0U) ? 1U : 0U) << 2U) | \
78  ((((tc1) != 0U) ? 1U : 0U) << 1U) | \
79  ((((tc0) != 0U) ? 1U : 0U) << 0U))
80 
82 #define ENET_TAS_MAX_CMD_LISTS (16)
83 
85 #define ENET_TAS_MAX_NUM_QUEUES (8)
86 
88 #define ENET_TAS_MIN_CYCLE_TIME_NS (1000000)
89 
91 #define ENET_TAS_MIN_WINDOW_DURATION_NS (10000)
92 
93 /* ========================================================================== */
94 /* Structures and Enums */
95 /* ========================================================================== */
96 
100 typedef enum EnetTas_Ioctl_e
101 {
112 
123 
138 
149 
160 
171 
182 
193 } EnetTas_Ioctl;
194 
198 typedef struct EnetTas_GenericInArgs_s
199 {
203 
207 typedef enum EnetTas_OperStatus_s
208 {
211 
215 
219 typedef enum EnetTas_TasState_s
220 {
223 
226 
230 
234 typedef struct EnetTas_GateCmdEntry_s
235 {
237  uint32_t timeInterval;
238 
240  uint8_t gateStateMask;
242 
246 typedef struct EnetTas_MaxSDUTable_s
247 {
248  uint16_t maxSDU[ENET_TAS_MAX_NUM_QUEUES];
250 
254 typedef struct EnetTas_ControlList_s
255 {
259  uint64_t baseTime;
260 
263 
265  uint64_t cycleTime;
266 
268  uint8_t listLength;
269 
273 
277 typedef struct EnetTas_ConfigStatus_s
278 {
281 
285 
287  uint8_t configPending;
288 
291  uint8_t configChange;
293 
297 typedef struct EnetTas_SetAdminListInArgs_s
298 {
301 
305 
309 typedef struct EnetTas_SetStateInArgs_s
310 {
313 
317 
318 /* ========================================================================== */
319 /* Global Variables Declarations */
320 /* ========================================================================== */
321 
322 /* None */
323 
324 /* ========================================================================== */
325 /* Function Declarations */
326 /* ========================================================================== */
327 
328 /* None */
329 
330 /* ========================================================================== */
331 /* Deprecated Function Declarations */
332 /* ========================================================================== */
333 
334 /* None */
335 
336 /* ========================================================================== */
337 /* Static Function Definitions */
338 /* ========================================================================== */
339 
340 /* None */
341 
342 #ifdef __cplusplus
343 }
344 #endif
345 
346 #endif /* ENET_MOD_TAS_H_ */
347 
348 /* @} */
Get the TAS config change status parameters.
Definition: enet_mod_tas.h:192
Generic input args.
Definition: enet_mod_tas.h:198
uint64_t cycleTime
Definition: enet_mod_tas.h:265
Definition: enet_mod_tas.h:228
Input args for ENET_TAS_IOCTL_SET_STATE commands.
Definition: enet_mod_tas.h:309
EnetTas_ControlList adminList
Definition: enet_mod_tas.h:303
uint8_t configChange
Definition: enet_mod_tas.h:291
EnetTas_TasState
TAS state types.
Definition: enet_mod_tas.h:219
#define ENET_TAS_MAX_CMD_LISTS
Maximum number of gate command entries in each list.
Definition: enet_mod_tas.h:82
Set the State of the TAS module.
Definition: enet_mod_tas.h:148
#define ENET_TAS_MAX_NUM_QUEUES
Maximum number of transmit queues supported by implementation.
Definition: enet_mod_tas.h:85
Get the State of the TAS module.
Definition: enet_mod_tas.h:159
uint8_t listLength
Definition: enet_mod_tas.h:268
Get the operational list parameters of the TAS module.
Definition: enet_mod_tas.h:181
Gate control list. See IEEE Std 802.1Q-2018 8.6.8.4.
Definition: enet_mod_tas.h:234
Get the status of the operational list update.
Definition: enet_mod_tas.h:137
Get the admin list parameters of the TAS module.
Definition: enet_mod_tas.h:170
Max SDU table. See IEEE Std 802.1Q-2018 12.29.1.1.
Definition: enet_mod_tas.h:246
Definition: enet_mod_tas.h:225
Definition: enet_mod_tas.h:213
Gate control list. See IEEE Std 802.1Q-2018 8.6.9.4 D3-1.
Definition: enet_mod_tas.h:254
Enet_MacPort macPort
Definition: enet_mod_tas.h:300
EnetTas_MaxSDUTable sduTable
Definition: enet_mod_tas.h:271
uint64_t baseTime
Definition: enet_mod_tas.h:259
EnetTas_OperStatus
ICSSG TAS state types.
Definition: enet_mod_tas.h:207
EnetTas_TasState state
Definition: enet_mod_tas.h:315
Config state machine variables. See IEEE Std 802.1Q-2018 8.6.8.4.
Definition: enet_mod_tas.h:277
uint8_t gateStateMask
Definition: enet_mod_tas.h:240
EnetTas_Ioctl
TAS module IOCTL commands.
Definition: enet_mod_tas.h:100
uint32_t configChangeErrorCounter
Definition: enet_mod_tas.h:284
Get the hardware version of the TAS module.
Definition: enet_mod_tas.h:111
uint64_t configChangeTime
Definition: enet_mod_tas.h:280
uint8_t configPending
Definition: enet_mod_tas.h:287
Enet_MacPort macPort
Definition: enet_mod_tas.h:201
uint32_t timeInterval
Definition: enet_mod_tas.h:237
Enet_MacPort
MAC port.
Definition: enet_types.h:405
Definition: enet_mod_tas.h:210
Input args for ENET_TAS_IOCTL_SET_ADMIN_LIST commands.
Definition: enet_mod_tas.h:297
Set the admin list parameters of the TAS module.
Definition: enet_mod_tas.h:122
Definition: enet_mod_tas.h:222
#define ENET_TAS_PUBLIC_IOCTL(x)
Helper macro to create IOCTL commands for TAS module.
Definition: enet_mod_tas.h:66
This file contains the type definitions and helper macros for the Enet Module interface.
Enet_MacPort macPort
Definition: enet_mod_tas.h:312