When transmitting frames, the outgoing frame is detected as a VLAN frame by recognizing a VLAN TPID in the Type/Length field and comparing it against user-defined values in the VLAN TPID Word 0 Register and VLAN TPID Word 1 Register. The TPID values are shared between the receive and transmit paths.
After a VLAN frame is identified, the 12-bit Unique VLAN Identifier (VID) is used to access the TEMAC Receive Configuration Word 0 Register to supply a replacement VID value which is substituted into the outgoing frame. See the following figure.
Using transmit In-Band FCS mode of the TEMAC core is not allowed when using VLAN translation because the user-provided FCS field value is not correct for the new VID field. For double and triple-tagged VLAN frames, only the outer VID is translated. The following TPID values are commonly used to flag VLAN frames: 0x8100, 0x9100, 0x9200, and 0x88A8. However, the TPID values used to identify VLAN frames are programmable through the TPID registers. Transmit and receive VLAN translation can be enabled separately with their respective parameters. For VID values that do not need to be translated, the VLAN data table location associated with their value must be initialized to that same value.