1 /* 2 * Copyright 2021-2022 NXP 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 /** 7 * @file Eth_GeneralTypes.h 8 * @version 0.9.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 Bus wake up detected. Available if supported by hardware. */ 220 ETHTRCV_WUR_BUS = (uint8)0x2U, 221 /**< @brief Internal wake up detected. Available if supported by hardware. */ 222 ETHTRCV_WUR_INTERNAL = (uint8)0x3U, 223 /**< @brief Reset wake up detected. Available if supported by hardware. */ 224 ETHTRCV_WUR_RESET = (uint8)0x4U, 225 /**< @brief Power on wake up detected. Available if supported by hardware. */ 226 ETHTRCV_WUR_POWER_ON = (uint8)0x5U, 227 /**< @brief Pin wake up detected. Available if supported by hardware. */ 228 ETHTRCV_WUR_PIN = (uint8)0x6U, 229 /**< @brief System error wake up detected. Available if supported by hardware. */ 230 ETHTRCV_WUR_SYSERR = (uint8)0x7U 231 232 } EthTrcv_WakeupReasonType; 233 234 /** 235 * @brief Describes the possible PHY test modes 236 * @implements EthTrcv_PhyTestModeType_enum 237 */ 238 typedef enum 239 { 240 /**< @brief normal operation */ 241 ETHTRCV_PHYTESTMODE_NONE = (uint8)0x0U, 242 /**< @brief test transmitter droop */ 243 ETHTRCV_PHYTESTMODE_1 = (uint8)0x1U, 244 /**< @brief test master timing jitter */ 245 ETHTRCV_PHYTESTMODE_2 = (uint8)0x2U, 246 /**< @brief test slave timing jitter */ 247 ETHTRCV_PHYTESTMODE_3 = (uint8)0x3U, 248 /**< @brief test transmitter distortion */ 249 ETHTRCV_PHYTESTMODE_4 = (uint8)0x4U, 250 /**< @brief test power spectral density (PSD) mask */ 251 ETHTRCV_PHYTESTMODE_5 = (uint8)0x5U 252 253 } EthTrcv_PhyTestModeType; 254 255 /** 256 * @brief Describes the possible PHY loopback modes 257 * @implements EthTrcv_PhyLoopbackModeType_enum 258 */ 259 typedef enum 260 { 261 /**< @brief normal operation */ 262 ETHTRCV_PHYLOOPBACK_NONE = (uint8)0x0U, 263 /**< @brief internal loopback */ 264 ETHTRCV_PHYLOOPBACK_INTERNAL = (uint8)0x1U, 265 /**< @brief external loopback */ 266 ETHTRCV_PHYLOOPBACK_EXTERNAL = (uint8)0x2U, 267 /**< @brief remote loopback */ 268 ETHTRCV_PHYLOOPBACK_REMOTE = (uint8)0x3U 269 270 } EthTrcv_PhyLoopbackModeType; 271 272 /** 273 * @brief Describes the possible PHY transmit modes 274 * @implements EthTrcv_PhyTxModeType_enum 275 */ 276 typedef enum 277 { 278 /**< @brief normal operation */ 279 ETHTRCV_PHYTXMODE_NORMAL = (uint8)0x0U, 280 /**< @brief transmitter disabled */ 281 ETHTRCV_PHYTXMODE_TX_OFF = (uint8)0x1U, 282 /**< @brief scrambler disabled */ 283 ETHTRCV_PHYTXMODE_SCRAMBLER_OFF = (uint8)0x2U 284 285 } EthTrcv_PhyTxModeType; 286 287 /** 288 * @brief Describes the results of the cable diagnostics. 289 * @implements EthTrcv_CableDiagResultType_enum 290 */ 291 typedef enum 292 { 293 /**< @brief Cable diagnostic ok */ 294 ETHTRCV_CABLEDIAG_OK = (uint8)0x0U, 295 /**< @brief Cable diagnostic failed */ 296 ETHTRCV_CABLEDIAG_ERROR = (uint8)0x1U, 297 /**< @brief Short circuit detected */ 298 ETHTRCV_CABLEDIAG_SHORT = (uint8)0x2U, 299 /**< @brief Open circuit detected */ 300 ETHTRCV_CABLEDIAG_OPEN = (uint8)0x3U, 301 /**< @brief cable diagnostic is still running */ 302 ETHTRCV_CABLEDIAG_PENDING = (uint8)0x4U, 303 /**< @brief cable diagnostics has detected wrong polarity of the "Ethernet physical+" or "Ethernet physical-" lines */ 304 ETHTRCV_CABLEDIAG_WRONG_POLARITY = (uint8)0x5U 305 306 } EthTrcv_CableDiagResultType; 307 308 /** 309 * @brief Status supervision used for Development Error Detection. The state shall be available for debugging. 310 * @implements EthSwt_StateType_enum 311 */ 312 typedef enum 313 { 314 ETHSWT_STATE_UNINIT = (uint8)0x0U, /**< @brief The Eth Switch Driver is not yet configured. */ 315 ETHSWT_STATE_INIT = (uint8)0x1U, /**< @brief The Eth Switch Driver is configured */ 316 ETHSWT_STATE_PORTINIT_COMPLETED = (uint8)0x2U, /**< @brief Port initialization is completed. */ 317 ETHSWT_STATE_ACTIVE = (uint8)0x3U /**< @brief The Eth Switch driver is active. */ 318 } EthSwt_StateType; 319 320 /** 321 * @brief MAC learning type enumeration. 322 * @implements EthSwt_MacLearningType_enum 323 */ 324 typedef enum 325 { 326 ETHSWT_MACLEARNING_HWDISABLED = (uint8)0x0U, /**< @brief If hardware learning disabled, the switch must not learn new MAC addresses */ 327 ETHSWT_MACLEARNING_HWENABLED = (uint8)0x1U, /**< @brief If hardware learning enabled, the switch learns new MAC addresses */ 328 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 */ 329 } EthSwt_MacLearningType; 330 331 /** 332 * @brief Type to request or obtain the port mirroring state (enable/disable) for a particular port mirror configuration per Ethernet switch. 333 * @implements EthSwt_PortMirrorStateType_enum 334 */ 335 typedef enum 336 { 337 PORT_MIRROR_DISABLED = (uint8)0x0U, /**< @brief port mirroring disabled. */ 338 PORT_MIRROR_ENABLED = (uint8)0x1U /**< @brief port mirroring enabled. */ 339 } EthSwt_PortMirrorStateType; 340 341 /** 342 * @brief Holds information if upper layer or EthSwt is owner of mgmt_obj. 343 * @implements EthSwt_MgmtOwner_enum 344 */ 345 typedef enum 346 { 347 ETHSWT_MGMT_OBJ_UNUSED = (uint8)0x0U, /**< @brief Object unused */ 348 ETHSWT_MGMT_OBJ_OWNED_BY_ETHSWT = (uint8)0x1U, /**< @brief Object used and EthSwt collects needed data */ 349 ETHSWT_MGMT_OBJ_OWNED_BY_UPPER_LAYER = (uint8)0x2U /**< @brief Object used and the upper layer does calculations */ 350 } EthSwt_MgmtOwner; 351 352 /*================================================================================================== 353 * STRUCTURES AND OTHER TYPEDEFS 354 ==================================================================================================*/ 355 /** 356 * @brief Frame type. 357 * @details This type is used to pass the value of type or length field in the 358 * Ethernet frame header. It is 16 bits long unsigned integer. 359 * - Values less than or equal to 1500 represent the length. 360 * - Values grater than 1500 represent the type (i.e. 0x800 = IP). 361 * @implements Eth_FrameType_type 362 */ 363 typedef uint16 Eth_FrameType; 364 365 /** 366 * @brief Type used to pass transmit or receive data to or from the driver. 367 * @details This type was defined as 8 bit wide unsigned integer because 368 * this definition is available on all CPU types. 369 * @implements Eth_DataType_type 370 */ 371 typedef uint8 Eth_DataType; 372 373 /** 374 * @brief Type used to identify the ethernet buffer. 375 * @details This type was defined for index of buffer used in transmitted and received data. 376 * @implements Eth_BufIdxType_type 377 */ 378 typedef uint32 Eth_BufIdxType; 379 380 /** 381 * @brief Type used to express the timestamp value. 382 * @details Variables of this type are used for expressing time stamps including relative time 383 * and absolute calendar time. The absolute time starts acc. to "[5], Annex C/C1" 384 * specification at 1970-01-01. 385 * 0 to 281474976710655s 386 * == 3257812230d 387 * [0xFFFF FFFF FFFF] 388 * 0 to 999999999ns 389 * [0x3B9A C9FF] 390 * invalid value in nanoseconds: [0x3B9A CA00] to [0x3FFF FFFF] 391 * Bit 30 and 31 reserved, default: 0 392 * @implements Eth_TimeStampType_struct 393 */ 394 typedef struct 395 { 396 uint32 nanoseconds; /**< @brief Nanoseconds part of the time */ 397 uint32 seconds; /**< @brief 32 bit LSB of the 48 bits Seconds part of the time */ 398 uint16 secondsHi; /**< @brief 16 bit MSB of the 48 bits Seconds part of the time */ 399 } Eth_TimeStampType; 400 401 /** 402 * @brief Type used to express the diff between timestamp values. 403 * @details Variables of this type are used to express time differences in a usual way. The 404 * described "TimeInterval" type referenced in ", chapter 6.3.3.3" will not be used 405 * and hereby slightly simplified. 406 * @implements Eth_TimeIntDiffType_structure 407 */ 408 typedef struct 409 { 410 Eth_TimeStampType diff; /**< @brief diff time difference */ 411 boolean sign; /**< @brief Positive (True) Or negative (False) time */ 412 } Eth_TimeIntDiffType; 413 414 /** 415 * @brief Type used to express frequency ratio. 416 * @details Variables of this type are used to express frequency ratios. 417 * @implements Eth_RateRatioType_structure 418 */ 419 typedef struct 420 { 421 Eth_TimeIntDiffType IngressTimeStampDelta; /**< @brief IngressTimeStampSync2 -IngressTimeStampSync1 */ 422 Eth_TimeIntDiffType OriginTimeStampDelta; /**< @brief OriginTimeStampSync2[FUP2]-OriginTimeStampSync1[FUP1] */ 423 } Eth_RateRatioType; 424 425 /** 426 * @brief Type used to statistic counter for diagnostics. 427 * @details Variables of this type are used to statistic counter for diagnostics. 428 * @implements Eth_CounterType_structure 429 */ 430 typedef struct{ 431 uint32 DropPktBufOverrun; 432 uint32 DropPktCrc; 433 uint32 UndersizePkt; 434 uint32 OversizePkt; 435 uint32 AlgnmtErr; 436 uint32 SqeTestErr; 437 uint32 DiscInbdPkt; 438 uint32 ErrInbdPkt; 439 uint32 DiscOtbdPkt; 440 uint32 ErrOtbdPkt; 441 uint32 SnglCollPkt; 442 uint32 MultCollPkt; 443 uint32 DfrdPkt; 444 uint32 LatCollPkt; 445 uint32 HwDepCtr0; 446 uint32 HwDepCtr1; 447 uint32 HwDepCtr2; 448 uint32 HwDepCtr3; 449 }Eth_CounterType; 450 451 /** 452 * @brief Type used to statistic counter for diagnostics. 453 * @details Variables of this type are used to statistic counter for diagnostics. 454 * @implements Eth_RxStatsType_structure 455 */ 456 typedef struct 457 { 458 uint32 RxStatsDropEvents; 459 uint32 RxStatsOctets; 460 uint32 RxStatsPkts; 461 uint32 RxStatsBroadcastPkts; 462 uint32 RxStatsMulticastPkts; 463 uint32 RxStatsCrcAlignErrors; 464 uint32 RxStatsUndersizePkts; 465 uint32 RxStatsOversizePkts; 466 uint32 RxStatsFragments; 467 uint32 RxStatsJabbers; 468 uint32 RxStatsCollisions; 469 uint32 RxStatsPkts64Octets; 470 uint32 RxStatsPkts65to127Octets; 471 uint32 RxStatsPkts128to255Octets; 472 uint32 RxStatsPkts256to511Octets; 473 uint32 RxStatsPkts512to1023Octets; 474 uint32 RxStatsPkts1024to1518Octets; 475 uint32 RxUnicastFrames; 476 }Eth_RxStatsType; 477 478 /** 479 * @brief Type used to statistic counter for diagnostics. 480 * @details Variables of this type are used to statistic counter for diagnostics. 481 * @implements Eth_TxStatsType_structure 482 */ 483 typedef struct 484 { 485 uint32 TxNumberOfOctets; 486 uint32 TxNUcastPkts; 487 uint32 TxUniCastPkts; 488 }Eth_TxStatsType; 489 490 /** 491 * @brief Type used to statistic counter for diagnostics. 492 * @details Variables of this type are used to statistic counter for diagnostics. 493 * @implements Eth_TxErrorCounterValuesType_structure 494 */ 495 typedef struct 496 { 497 uint32 TxDroppedNoErrorPkts; 498 uint32 TxDroppedErrorPkts; 499 uint32 TxDeferredTrans; 500 uint32 TxSingleCollision; 501 uint32 TxMultipleCollision; 502 uint32 TxLateCollision; 503 uint32 TxExcessiveCollison; 504 }Eth_TxErrorCounterValuesType; 505 506 /** 507 * @brief Type used for VLAN management in EthSwt. 508 * @details Variables of this type are used to store information related to VLAN. 509 * @implements Eth_MacVlanType_structure 510 */ 511 typedef struct 512 { 513 uint8 MacAddr[6]; 514 uint16 VlanId; 515 uint8 SwitchPort; 516 uint16 HashValue; 517 }Eth_MacVlanType; 518 519 /** 520 * @brief Type for holding the management information received/transmitted on Switches (ports). 521 * @details It contains the switch index and the port index of the switch 522 */ 523 typedef struct 524 { 525 uint8 SwitchIdx; /**< @brief Switch index */ 526 uint8 SwitchPortIdx; /**< @brief Port index of the switch */ 527 } EthSwt_MgmtInfoType; 528 529 /** 530 * @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. 531 */ 532 typedef struct 533 { 534 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. */ 535 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. */ 536 uint16 VlanIdFilter; /**< @brief Specifies the VLAN address 0..4094 that should be mirrored. If set to 65535, no VLAN filtering shall take place. */ 537 uint8 MirroringPacketDivider; /**< @brief Divider if only a subset of received frames should be mirrored. E.g. MirroringPacketDivider = 2 means every second frames is mirrored */ 538 uint8 MirroringMode; /**< @brief specifies the mode how the mirrored traffic should be tagged : 0x00 == No VLAN retagging; 0x01 == VLAN retagging; 0x03 == VLAN Double tagging */ 539 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 */ 540 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 */ 541 uint8 CapturePortIdx; /**< @brief Specifies the Ethernet switch port which capture the mirrored traffic */ 542 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 */ 543 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 */ 544 } EthSwt_PortMirrorCfgType; 545 546 547 /** 548 * @brief Will be set from EthSwt and marks EthSwt_MgmtObject as valid or not. So the upper layer will be able to detect inconsistencies. 549 */ 550 typedef struct 551 { 552 Std_ReturnType IngressTimestampValid; /**< @brief IngressTimestampValid shall be set to E_NOT_OK if ingress timestamp is not available */ 553 Std_ReturnType EgressTimestampValid; /**< @brief EgressTimestampValid shall be set to E_NOT_OK if ingress timestamp is not available. */ 554 Std_ReturnType MgmtInfoValid; /**< @brief MgmtInfoValid shall be set to E_NOT_OK if ingress timestamp is not available(e.g. timeout). */ 555 } EthSwt_MgmtObjectValidType; 556 557 /** 558 * @brief Provides information about all struct member elements. The ownership gives information whether EthSwt has finished its activities in providing all struct member elements. 559 */ 560 typedef struct 561 { 562 EthSwt_MgmtObjectValidType Validation; /**< @brief The validation information for the mgmt_obj. */ 563 Eth_TimeStampType IngressTimestamp; /**< @brief The ingress timestamp value out of the switch. */ 564 Eth_TimeStampType EgressTimestamp; /**< @brief The egress timestamp value out of the switch. */ 565 EthSwt_MgmtInfoType MgmtInfo; /**< @brief Received/Transmitted Management information of the switches. */ 566 EthSwt_MgmtOwner Ownership; /**< @brief The ownership of MgmtObj. */ 567 } EthSwt_MgmtObjectType; 568 /*================================================================================================== 569 * GLOBAL VARIABLE DECLARATIONS 570 ==================================================================================================*/ 571 572 /*================================================================================================== 573 * FUNCTION PROTOTYPES 574 ==================================================================================================*/ 575 576 #ifdef __cplusplus 577 } 578 #endif 579 580 #endif /* ETH_GENERALTYPES_H */ 581 /** @} */ 582