1 /* 2 * Copyright 2021-2024 NXP 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 /** 7 * @file Eth_GeneralTypes.h 8 * @version 2.0.0 9 * 10 * @brief AUTOSAR BaseNXP driver type definitions header file 11 * @details Definitions of types for the Ethernet driver 12 * This file contains sample code only. It is not part of the production code deliverables 13 * @addtogroup BASENXP_COMPONENT 14 * @{ 15 */ 16 17 #ifndef ETH_GENERALTYPES_H 18 #define ETH_GENERALTYPES_H 19 20 #ifdef __cplusplus 21 extern "C"{ 22 #endif 23 24 /*================================================================================================== 25 * INCLUDE FILES 26 * 1) system and project includes 27 * 2) needed interfaces from external units 28 * 3) internal and external interfaces from this unit 29 ==================================================================================================*/ 30 31 #include "ComStackTypes.h" /* Mandatory include - see the SWS */ 32 33 /*================================================================================================== 34 * SOURCE FILE VERSION INFORMATION 35 ==================================================================================================*/ 36 /** 37 @{ 38 * @brief Parameters that shall be published within the modules header file. 39 * The integration of incompatible files shall be avoided. 40 */ 41 #define ETH_GENERALTYPES_AR_RELEASE_MAJOR_VERSION 4 42 #define ETH_GENERALTYPES_AR_RELEASE_MINOR_VERSION 7 43 44 /*================================================================================================== 45 * FILE VERSION CHECKS 46 ==================================================================================================*/ 47 48 /*================================================================================================== 49 * CONSTANTS 50 ==================================================================================================*/ 51 52 /*================================================================================================== 53 * DEFINES AND MACROS 54 ==================================================================================================*/ 55 56 /*================================================================================================== 57 * ENUMS 58 ==================================================================================================*/ 59 /** 60 * @brief The Ethernet driver state. 61 * @details A variable of this type holds the state of the Ethernet driver 62 * module. The driver is at the ETH_STATE_UNINIT at the beginning 63 * until the Eth_Init() function is called. The state remains 64 * equal to the ETH_STATE_INIT until the Eth_ControllerInit() 65 * function is called. Then the state is ETH_STATE_ACTIVE. 66 * @implements Eth_StateType_enum 67 */ 68 typedef enum 69 { 70 ETH_STATE_UNINIT = 0, /**< The driver has not been initialized yet */ 71 ETH_STATE_INIT /**< The driver has not been configured and 72 the controller was configured */ 73 } Eth_StateType; 74 75 /** 76 * @brief The Ethernet controller mode. 77 * @details This type is used to store the information whether the 78 * Ethernet controller is stopped or running. 79 * @implements Eth_ModeType_enum 80 */ 81 typedef enum 82 { 83 ETH_MODE_DOWN = 0U, /**< Controller is shut down */ 84 ETH_MODE_ACTIVE = 1U, /**< Controller is active */ 85 ETH_MODE_ACTIVE_WITH_WAKEUP_REQUEST = 2U /**< Controller is active with wakeup request. */ 86 } Eth_ModeType; 87 88 /** 89 * @brief The Ethernet reception status 90 * @details This status is returned by the @c Eth_Receive() function to indicate 91 * whether any frame has been received and if yes, whether there is any 92 * frame still waiting in the queue (for another @c Eth_Receive() call). 93 * @implements Eth_RxStatusType_enum 94 */ 95 typedef enum 96 { 97 ETH_RECEIVED = 0, /**< A frame has been received and there are no more frames in the queue */ 98 ETH_NOT_RECEIVED, /**< No frames received */ 99 ETH_RECEIVED_MORE_DATA_AVAILABLE /**< A frame received and at least another one in the queue detected */ 100 } Eth_RxStatusType; 101 102 /** 103 * @brief Action type for PHY address filtering 104 * @details The Enumeration type describes the action to be taken 105 * for the MAC address given in *PhysAddrPtr 106 * @implements Eth_FilterActionType_enum 107 */ 108 typedef enum 109 { 110 ETH_ADD_TO_FILTER = 0, /**< Add address to the filter */ 111 ETH_REMOVE_FROM_FILTER /**< Remove address */ 112 } Eth_FilterActionType; 113 114 /** 115 * @brief The Ethernet quality of timestamp type 116 * @details Depending on the HW, quality information regarding the evaluated time stamp 117 * might be supported. If not supported, the value shall be always Valid. For 118 * Uncertain and Invalid values, the upper layer shall discard the time stamp. 119 * @implements Eth_TimeStampQualType_enum 120 */ 121 typedef enum 122 { 123 ETH_VALID = 0, /**< Success */ 124 ETH_INVALID, /**< General failure */ 125 ETH_UNCERTAIN /**< Ethernet hardware access failure */ 126 } Eth_TimeStampQualType; 127 128 /** 129 * @brief This type defines the transceiver modes 130 * @details The Enumeration type describes the transceiver modes 131 * @implements EthTrcv_ModeType_enum 132 */ 133 typedef enum 134 { 135 ETHTRCV_MODE_DOWN = 0, /**< Transceiver disabled */ 136 ETHTRCV_MODE_ACTIVE /**< Transceiver enable */ 137 } EthTrcv_ModeType; 138 /** 139 * @brief This type defines the Ethernet link state. The link state changes after an Ethernet cable gets plugged in and the transceivers on both ends negotiated the transmission parameters (i.e. baud rate and duplex mode) 140 * @implements EthTrcv_LinkStateType_enum 141 */ 142 typedef enum 143 { 144 /**< @brief No physical Ethernet connection established. */ 145 ETHTRCV_LINK_STATE_DOWN = (uint8)0x0U, 146 /**< @brief Physical Ethernet connection established. */ 147 ETHTRCV_LINK_STATE_ACTIVE = (uint8)0x1U 148 149 } EthTrcv_LinkStateType; 150 151 /** 152 * @brief This type defines the Ethernet link state. The link state changes after an Ethernet cable gets plugged in and the transceivers on both ends negotiated the transmission parameters (i.e. baud rate and duplex mode) 153 * @implements EthTrcv_StateType_enum 154 */ 155 typedef enum 156 { 157 /**< @brief Driver is not yet configured */ 158 ETHTRCV_STATE_UNINIT = (uint8)0x0U, 159 /**< @brief Driver is configured. */ 160 ETHTRCV_STATE_INIT = (uint8)0x1U 161 162 } EthTrcv_StateType; 163 164 /** 165 * @brief This type defines the Ethernet baud rate. The baud rate gets either negotiated between the connected transceivers or has to be configured. 166 * @implements EthTrcv_BaudRateType_enum 167 */ 168 typedef enum 169 { 170 /**< @brief 10MBIT Ethernet connection */ 171 ETHTRCV_BAUD_RATE_10MBIT = (uint8)0x0U, 172 /**< @brief 100MBIT Ethernet connection */ 173 ETHTRCV_BAUD_RATE_100MBIT = (uint8)0x1U, 174 /**< @brief 1000MBIT Ethernet connection */ 175 ETHTRCV_BAUD_RATE_1000MBIT = (uint8)0x2U, 176 /**< @brief 2500MBIT Ethernet connection */ 177 ETHTRCV_BAUD_RATE_2500MBIT 178 179 } EthTrcv_BaudRateType; 180 181 /** 182 * @brief This type defines the Ethernet duplex mode. The duplex mode gets either negotiated between the connected transceivers or has to be configured. 183 * @implements EthTrcv_DuplexModeType_enum 184 */ 185 typedef enum 186 { 187 /**< @brief Half duplex Ethernet connection */ 188 ETHTRCV_DUPLEX_MODE_HALF = (uint8)0x0U, 189 /**< @brief Full duplex Ethernet connection */ 190 ETHTRCV_DUPLEX_MODE_FULL = (uint8)0x1U 191 192 } EthTrcv_DuplexModeType; 193 194 /** 195 * @brief This type controls the transceiver wake up modes and/or clears the wake-up reason. 196 * @implements EthTrcv_WakeupModeType_enum 197 */ 198 typedef enum 199 { 200 /**< @brief Transceiver wake up disabled */ 201 ETHTRCV_WUM_DISABLE = (uint8)0x0U, 202 /**< @brief Transceiver wake up enabled */ 203 ETHTRCV_WUM_ENABLE = (uint8)0x1U, 204 /**< @brief Transceiver wake up reason cleared. */ 205 ETHTRCV_WUM_CLEAR 206 207 } EthTrcv_WakeupModeType; 208 209 /** 210 * @brief This type defines the transceiver wake up reasons. 211 * @implements EthTrcv_WakeupReasonType_enum 212 */ 213 typedef enum 214 { 215 /**< @brief No wake up reason detected. */ 216 ETHTRCV_WUR_NONE = (uint8)0x0U, 217 /**< @brief General wake up detected, no distinct reason supported by hardware. */ 218 ETHTRCV_WUR_GENERAL = (uint8)0x1U, 219 /**< @brief Internal wake up detected. Available if supported by hardware. */ 220 ETHTRCV_WUR_INTERNAL = (uint8)0x3U, 221 /**< @brief Reset wake up detected. Available if supported by hardware. */ 222 ETHTRCV_WUR_RESET = (uint8)0x4U, 223 /**< @brief Power on wake up detected. Available if supported by hardware. */ 224 ETHTRCV_WUR_POWER_ON = (uint8)0x5U, 225 /**< @brief Pin wake up detected. Available if supported by hardware. */ 226 ETHTRCV_WUR_PIN = (uint8)0x6U, 227 /**< @brief System error wake up detected. Available if supported by hardware. */ 228 ETHTRCV_WUR_SYSERR = (uint8)0x7U, 229 /**< @brief Wake-up on data line (WUP = wake up pulse) detected while link is down of the corresponding Ethernet hardware (e.g. PHY). 230 Only available if EthTrcvWakeupSleepOn DatalineEnabled is set to TRUE */ 231 ETHTRCV_WUR_WODL_WUP = (uint8)0x8U, 232 /**< @brief Wake-up on data line (WUR = wake up request) detected while link is active of the used Ethernet hardware (e.g. PHY). 233 Only available if EthTrcvWakeupSleepOnDataline Enabled is set to TRUE */ 234 ETHTRCV_WUR_WODL_WUR = (uint8)0x9U, 235 /**< @brief Device internal transfer of wake-up on data line from a neighboring PHY. Only possible if Ethernet hardware is compliant to OA TC10. 236 Only available if EthTrcvWakeupSleepOn DatalineEnabled is set to TRUE. */ 237 ETHTRCV_WUR_TRANSFER = (uint8)0xAU 238 239 } EthTrcv_WakeupReasonType; 240 241 /** 242 * @brief Describes the possible PHY test modes 243 * @implements EthTrcv_PhyTestModeType_enum 244 */ 245 typedef enum 246 { 247 /**< @brief normal operation */ 248 ETHTRCV_PHYTESTMODE_NONE = (uint8)0x0U, 249 /**< @brief test transmitter droop */ 250 ETHTRCV_PHYTESTMODE_1 = (uint8)0x1U, 251 /**< @brief test master timing jitter */ 252 ETHTRCV_PHYTESTMODE_2 = (uint8)0x2U, 253 /**< @brief test slave timing jitter */ 254 ETHTRCV_PHYTESTMODE_3 = (uint8)0x3U, 255 /**< @brief test transmitter distortion */ 256 ETHTRCV_PHYTESTMODE_4 = (uint8)0x4U, 257 /**< @brief test power spectral density (PSD) mask */ 258 ETHTRCV_PHYTESTMODE_5 = (uint8)0x5U 259 260 } EthTrcv_PhyTestModeType; 261 262 /** 263 * @brief Describes the possible PHY loopback modes 264 * @implements EthTrcv_PhyLoopbackModeType_enum 265 */ 266 typedef enum 267 { 268 /**< @brief normal operation */ 269 ETHTRCV_PHYLOOPBACK_NONE = (uint8)0x0U, 270 /**< @brief internal loopback */ 271 ETHTRCV_PHYLOOPBACK_INTERNAL = (uint8)0x1U, 272 /**< @brief external loopback */ 273 ETHTRCV_PHYLOOPBACK_EXTERNAL = (uint8)0x2U, 274 /**< @brief remote loopback */ 275 ETHTRCV_PHYLOOPBACK_REMOTE = (uint8)0x3U 276 277 } EthTrcv_PhyLoopbackModeType; 278 279 /** 280 * @brief Describes the possible PHY transmit modes 281 * @implements EthTrcv_PhyTxModeType_enum 282 */ 283 typedef enum 284 { 285 /**< @brief normal operation */ 286 ETHTRCV_PHYTXMODE_NORMAL = (uint8)0x0U, 287 /**< @brief transmitter disabled */ 288 ETHTRCV_PHYTXMODE_TX_OFF = (uint8)0x1U, 289 /**< @brief scrambler disabled */ 290 ETHTRCV_PHYTXMODE_SCRAMBLER_OFF = (uint8)0x2U 291 292 } EthTrcv_PhyTxModeType; 293 294 /** 295 * @brief Describes the results of the cable diagnostics. 296 * @implements EthTrcv_CableDiagResultType_enum 297 */ 298 typedef enum 299 { 300 /**< @brief Cable diagnostic ok */ 301 ETHTRCV_CABLEDIAG_OK = (uint8)0x0U, 302 /**< @brief Cable diagnostic failed */ 303 ETHTRCV_CABLEDIAG_ERROR = (uint8)0x1U, 304 /**< @brief Short circuit detected */ 305 ETHTRCV_CABLEDIAG_SHORT = (uint8)0x2U, 306 /**< @brief Open circuit detected */ 307 ETHTRCV_CABLEDIAG_OPEN = (uint8)0x3U, 308 /**< @brief cable diagnostic is still running */ 309 ETHTRCV_CABLEDIAG_PENDING = (uint8)0x4U, 310 /**< @brief cable diagnostics has detected wrong polarity of the "Ethernet physical+" or "Ethernet physical-" lines */ 311 ETHTRCV_CABLEDIAG_WRONG_POLARITY = (uint8)0x5U 312 313 } EthTrcv_CableDiagResultType; 314 315 /** 316 * @brief Status supervision used for Development Error Detection. The state shall be available for debugging. 317 * @implements EthSwt_StateType_enum 318 */ 319 typedef enum 320 { 321 ETHSWT_STATE_UNINIT = (uint8)0x0U, /**< @brief The Eth Switch Driver is not yet configured. */ 322 ETHSWT_STATE_INIT = (uint8)0x1U, /**< @brief The Eth Switch Driver is configured */ 323 ETHSWT_STATE_PORTINIT_COMPLETED = (uint8)0x2U, /**< @brief Port initialization is completed. */ 324 ETHSWT_STATE_ACTIVE = (uint8)0x3U /**< @brief The Eth Switch driver is active. */ 325 } EthSwt_StateType; 326 327 /** 328 * @brief MAC learning type enumeration. 329 * @implements EthSwt_MacLearningType_enum 330 */ 331 typedef enum 332 { 333 ETHSWT_MACLEARNING_HWDISABLED = (uint8)0x0U, /**< @brief If hardware learning disabled, the switch must not learn new MAC addresses */ 334 ETHSWT_MACLEARNING_HWENABLED = (uint8)0x1U, /**< @brief If hardware learning enabled, the switch learns new MAC addresses */ 335 ETHSWT_MACLEARNING_SWENABLED = (uint8)0x2U /**< @brief If software learning enabled, the hardware learning is disabled and the switch forwards packets with an unknown source address to a host CPU */ 336 } EthSwt_MacLearningType; 337 338 /** 339 * @brief Type to request or obtain the port mirroring state (enable/disable) for a particular port mirror configuration per Ethernet switch. 340 * @implements EthSwt_PortMirrorStateType_enum 341 */ 342 typedef enum 343 { 344 PORT_MIRROR_DISABLED = (uint8)0x0U, /**< @brief port mirroring disabled. */ 345 PORT_MIRROR_ENABLED = (uint8)0x1U /**< @brief port mirroring enabled. */ 346 } EthSwt_PortMirrorStateType; 347 348 /** 349 * @brief Holds information if upper layer or EthSwt is owner of mgmt_obj. 350 * @implements EthSwt_MgmtOwner_enum 351 */ 352 typedef enum 353 { 354 ETHSWT_MGMT_OBJ_UNUSED = (uint8)0x0U, /**< @brief Object unused */ 355 ETHSWT_MGMT_OBJ_OWNED_BY_ETHSWT = (uint8)0x1U, /**< @brief Object used and EthSwt collects needed data */ 356 ETHSWT_MGMT_OBJ_OWNED_BY_UPPER_LAYER = (uint8)0x2U /**< @brief Object used and the upper layer does calculations */ 357 } EthSwt_MgmtOwner; 358 359 /*================================================================================================== 360 * STRUCTURES AND OTHER TYPEDEFS 361 ==================================================================================================*/ 362 /** 363 * @brief Frame type. 364 * @details This type is used to pass the value of type or length field in the 365 * Ethernet frame header. It is 16 bits long unsigned integer. 366 * - Values less than or equal to 1500 represent the length. 367 * - Values grater than 1500 represent the type (i.e. 0x800 = IP). 368 * @implements Eth_FrameType_type 369 */ 370 typedef uint16 Eth_FrameType; 371 372 /** 373 * @brief Type used to pass transmit or receive data to or from the driver. 374 * @details This type was defined as 8 bit wide unsigned integer because 375 * this definition is available on all CPU types. 376 * @implements Eth_DataType_type 377 */ 378 typedef uint8 Eth_DataType; 379 380 /** 381 * @brief Type used to identify the ethernet buffer. 382 * @details This type was defined for index of buffer used in transmitted and received data. 383 * @implements Eth_BufIdxType_type 384 */ 385 typedef uint32 Eth_BufIdxType; 386 387 /** 388 * @brief Type used to express the timestamp value. 389 * @details Variables of this type are used for expressing time stamps including relative time 390 * and absolute calendar time. The absolute time starts acc. to "[5], Annex C/C1" 391 * specification at 1970-01-01. 392 * 0 to 281474976710655s 393 * == 3257812230d 394 * [0xFFFF FFFF FFFF] 395 * 0 to 999999999ns 396 * [0x3B9A C9FF] 397 * invalid value in nanoseconds: [0x3B9A CA00] to [0x3FFF FFFF] 398 * Bit 30 and 31 reserved, default: 0 399 * @implements Eth_TimeStampType_struct 400 */ 401 typedef struct 402 { 403 uint32 nanoseconds; /**< @brief Nanoseconds part of the time */ 404 uint32 seconds; /**< @brief 32 bit LSB of the 48 bits Seconds part of the time */ 405 uint16 secondsHi; /**< @brief 16 bit MSB of the 48 bits Seconds part of the time */ 406 } Eth_TimeStampType; 407 408 /** 409 * @brief Type used to express the diff between timestamp values. 410 * @details Variables of this type are used to express time differences in a usual way. The 411 * described "TimeInterval" type referenced in ", chapter 6.3.3.3" will not be used 412 * and hereby slightly simplified. 413 * @implements Eth_TimeIntDiffType_structure 414 */ 415 typedef struct 416 { 417 Eth_TimeStampType diff; /**< @brief diff time difference */ 418 boolean sign; /**< @brief Positive (True) Or negative (False) time */ 419 } Eth_TimeIntDiffType; 420 421 /** 422 * @brief Type used to express frequency ratio. 423 * @details Variables of this type are used to express frequency ratios. 424 * @implements Eth_RateRatioType_structure 425 */ 426 typedef struct 427 { 428 Eth_TimeIntDiffType IngressTimeStampDelta; /**< @brief IngressTimeStampSync2 -IngressTimeStampSync1 */ 429 Eth_TimeIntDiffType OriginTimeStampDelta; /**< @brief OriginTimeStampSync2[FUP2]-OriginTimeStampSync1[FUP1] */ 430 } Eth_RateRatioType; 431 432 /** 433 * @brief Type used to statistic counter for diagnostics. 434 * @details Variables of this type are used to statistic counter for diagnostics. 435 * @implements Eth_CounterType_structure 436 */ 437 typedef struct{ 438 uint32 DropPktBufOverrun; 439 uint32 DropPktCrc; 440 uint32 UndersizePkt; 441 uint32 OversizePkt; 442 uint32 AlgnmtErr; 443 uint32 SqeTestErr; 444 uint32 DiscInbdPkt; 445 uint32 ErrInbdPkt; 446 uint32 DiscOtbdPkt; 447 uint32 ErrOtbdPkt; 448 uint32 SnglCollPkt; 449 uint32 MultCollPkt; 450 uint32 DfrdPkt; 451 uint32 LatCollPkt; 452 uint32 HwDepCtr0; 453 uint32 HwDepCtr1; 454 uint32 HwDepCtr2; 455 uint32 HwDepCtr3; 456 }Eth_CounterType; 457 458 /** 459 * @brief Type used to statistic counter for diagnostics. 460 * @details Variables of this type are used to statistic counter for diagnostics. 461 * @implements Eth_RxStatsType_structure 462 */ 463 typedef struct 464 { 465 uint32 RxStatsDropEvents; 466 uint32 RxStatsOctets; 467 uint32 RxStatsPkts; 468 uint32 RxStatsBroadcastPkts; 469 uint32 RxStatsMulticastPkts; 470 uint32 RxStatsCrcAlignErrors; 471 uint32 RxStatsUndersizePkts; 472 uint32 RxStatsOversizePkts; 473 uint32 RxStatsFragments; 474 uint32 RxStatsJabbers; 475 uint32 RxStatsCollisions; 476 uint32 RxStatsPkts64Octets; 477 uint32 RxStatsPkts65to127Octets; 478 uint32 RxStatsPkts128to255Octets; 479 uint32 RxStatsPkts256to511Octets; 480 uint32 RxStatsPkts512to1023Octets; 481 uint32 RxStatsPkts1024to1518Octets; 482 uint32 RxUnicastFrames; 483 }Eth_RxStatsType; 484 485 /** 486 * @brief Type used to statistic counter for diagnostics. 487 * @details Variables of this type are used to statistic counter for diagnostics. 488 * @implements Eth_TxStatsType_structure 489 */ 490 typedef struct 491 { 492 uint32 TxNumberOfOctets; 493 uint32 TxNUcastPkts; 494 uint32 TxUniCastPkts; 495 }Eth_TxStatsType; 496 497 /** 498 * @brief Type used to statistic counter for diagnostics. 499 * @details Variables of this type are used to statistic counter for diagnostics. 500 * @implements Eth_TxErrorCounterValuesType_structure 501 */ 502 typedef struct 503 { 504 uint32 TxDroppedNoErrorPkts; 505 uint32 TxDroppedErrorPkts; 506 uint32 TxDeferredTrans; 507 uint32 TxSingleCollision; 508 uint32 TxMultipleCollision; 509 uint32 TxLateCollision; 510 uint32 TxExcessiveCollison; 511 }Eth_TxErrorCounterValuesType; 512 513 /** 514 * @brief Type used for VLAN management in EthSwt. 515 * @details Variables of this type are used to store information related to VLAN. 516 * @implements Eth_MacVlanType_structure 517 */ 518 typedef struct 519 { 520 uint8 MacAddr[6]; 521 uint16 VlanId; 522 uint8 SwitchPort; 523 }Eth_MacVlanType; 524 525 /** 526 * @brief Type for holding the management information received/transmitted on Switches (ports). 527 * @details It contains the switch index and the port index of the switch 528 */ 529 typedef struct 530 { 531 uint8 SwitchIdx; /**< @brief Switch index */ 532 uint8 SwitchPortIdx; /**< @brief Port index of the switch */ 533 } EthSwt_MgmtInfoType; 534 535 /** 536 * @brief The EthSwt_PortMirrorCfgType specify the port mirror configuration which is set up per Ethernet switch. The configuration is written to the Ethernet switch driver by calling EthSwt_WritePortMirrorConfiguration. One port mirror configuration is maintained per Ethernet Switch. 537 */ 538 typedef struct 539 { 540 uint8 srcMacAddrFilter[6U]; /**< @brief Specifies the source MAC address [0..255,0..255,0..255,0..255,0..255,0..255] that should be mirrored. If set to 0,0,0,0,0,0, no source MAC address filtering shall take place. */ 541 uint8 dstMacAddrFilter[6U]; /**< @brief Specifies the destination MAC address [0..255,0..255,0..255,0..255,0..255,0..255] that should be mirrored. If set to 0,0,0,0,0,0, no destination MAC address filtering shall take place. */ 542 uint16 VlanIdFilter; /**< @brief Specifies the VLAN address 0..4094 that should be mirrored. If set to 65535, no VLAN filtering shall take place. */ 543 uint8 MirroringPacketDivider; /**< @brief Divider if only a subset of received frames should be mirrored. E.g. MirroringPacketDivider = 2 means every second frames is mirrored */ 544 uint8 MirroringMode; /**< @brief specifies the mode how the mirrored traffic should be tagged : 0x00 == No VLAN retagging; 0x01 == VLAN retagging; 0x03 == VLAN Double tagging */ 545 uint32 TrafficDirectionIngressBitMask; /**< @brief Specifies the bit mask of Ethernet switch ingress port traffic direction to be mirrored. The bit mask is calculated depending of the values of EthSwtPortIdx. (e.g. set EthSwtPortIdx == 2 => TrafficDirectionIngressBitMask = 0b0000 0000 0000 0000 0000 0000 0000 0100). 0b0 == enable ingress port mirroring 0b1 == disable ingress port mirroring Example: TrafficDirectionIngressBitMask = 0b0000 0000 0000 0000 0000 0000 0000 0100 => Ingress traffic mirroring is enabled of Ethernet switch port with EthSwtPortIdx=2 */ 546 uint32 TrafficDirectionEgressBitMask; /**< @brief Specifies the bit mask of Ethernet switch egress port traffic direction to be mirrored. The bit mask is calculated depending of the values of EthSwtPortIdx. (e.g. set EthSwtPortIdx == 2 => TrafficDirectionEgressBitMask = 0b0000 0000 0000 0000 0000 0000 0000 0100). 0b0 == enable egress port mirroring 0b1 == disable egress port mirroring Example: TrafficDirectionEgressBitMask = 0b0000 0000 0000 0000 0000 0000 0000 0001 => Egress traffic mirroring is enabled of Ethernet switch port with EthSwtPortIdx=0 */ 547 uint8 CapturePortIdx; /**< @brief Specifies the Ethernet switch port which capture the mirrored traffic */ 548 uint16 ReTaggingVlanId; /**< @brief Specifies the VLAN address 0..4094 which shall be used for re-tagging if MirroringMode is set to 0x01 (VLAN re-tagging). If the value is set to 65535, the value shall be ignored, because the VLAN address for re-tagging is provided by the Ethernet switch configuration */ 549 uint16 DoubleTaggingVlanId; /**< @brief Specifies the VLAN address 0..4094 which shall be used for double-tagging if MirroringMode is set to 0x02 (VLAN double tagging). If the value is set to 65535, the value shall be ignored, because the VLAN address for double tagging is provided by the Ethernet switch configuration */ 550 } EthSwt_PortMirrorCfgType; 551 552 553 /** 554 * @brief Will be set from EthSwt and marks EthSwt_MgmtObject as valid or not. So the upper layer will be able to detect inconsistencies. 555 */ 556 typedef struct 557 { 558 Std_ReturnType IngressTimestampValid; /**< @brief IngressTimestampValid shall be set to E_NOT_OK if ingress timestamp is not available */ 559 Std_ReturnType EgressTimestampValid; /**< @brief EgressTimestampValid shall be set to E_NOT_OK if ingress timestamp is not available. */ 560 Std_ReturnType MgmtInfoValid; /**< @brief MgmtInfoValid shall be set to E_NOT_OK if ingress timestamp is not available(e.g. timeout). */ 561 } EthSwt_MgmtObjectValidType; 562 563 /** 564 * @brief Provides information about all struct member elements. The ownership gives information whether EthSwt has finished its activities in providing all struct member elements. 565 */ 566 typedef struct 567 { 568 EthSwt_MgmtObjectValidType Validation; /**< @brief The validation information for the mgmt_obj. */ 569 Eth_TimeStampType IngressTimestamp; /**< @brief The ingress timestamp value out of the switch. */ 570 Eth_TimeStampType EgressTimestamp; /**< @brief The egress timestamp value out of the switch. */ 571 EthSwt_MgmtInfoType MgmtInfo; /**< @brief Received/Transmitted Management information of the switches. */ 572 EthSwt_MgmtOwner Ownership; /**< @brief The ownership of MgmtObj. */ 573 } EthSwt_MgmtObjectType; 574 /*================================================================================================== 575 * GLOBAL VARIABLE DECLARATIONS 576 ==================================================================================================*/ 577 578 /*================================================================================================== 579 * FUNCTION PROTOTYPES 580 ==================================================================================================*/ 581 582 #ifdef __cplusplus 583 } 584 #endif 585 586 #endif /* ETH_GENERALTYPES_H */ 587 /** @} */ 588