40.4.11 VLAN Support
The following table describes an Ethernet encoded 802.1Q VLAN tag.
TPID (Tag Protocol Identifier) 16 bits | TCI (Tag Control Information) 16 bits |
---|---|
0x8100 | First 3 bits priority, then CFI bit, last 12 bits VID |
The VLAN tag is inserted at the 13th byte of the frame, adding an extra four bytes to the frame. If the VID (VLAN identifier) is null (0x000), this indicates a priority-tagged frame. The MAC can support frame lengths up to 1536 bytes, 18 bytes more than the original Ethernet maximum frame length of 1518 bytes. This is achieved by setting bit 8 in the EMAC_NCFGR.
The following bits in the receive buffer descriptor status word give information about VLAN tagged frames:
- Bit 21 set if receive frame is VLAN tagged (i.e., type ID of 0x8100)
- Bit 20 set if receive frame is priority tagged (i.e., type ID of 0x8100 and null VID). (If bit 20 is set, bit 21 is set also.)
- Bit 19, 18 and 17 set to priority if bit 21 is set
- Bit 16 set to CFI if bit 21 is set