Altera SoCAL  16.0
The Altera SoC Abstraction Layer (SoCAL) API Reference Manual
 All Data Structures Variables Typedefs Groups
Register : gmacgrp_vlan_tag

Description

Register 7 (VLAN Tag Register)

The VLAN Tag register contains the IEEE 802.1Q VLAN Tag to identify the VLAN frames. The MAC compares the 13th and 14th bytes of the receiving frame (Length/Type) with 16'h8100, and the following two bytes are compared with the VLAN tag. If a match occurs, the MAC sets the received VLAN bit in the receive frame status. The legal length of the frame is increased from 1,518 bytes to 1,522 bytes.

If the VLAN Tag register is configured to be double-synchronized to the (G)MII clock domain, then consecutive writes to these register should be performed only after at least four clock cycles in the destination clock domain.

Register Layout

Bits Access Reset Description
[15:0] RW 0x0 ALT_EMAC_GMAC_VLAN_TAG_VL
[16] RW 0x0 ALT_EMAC_GMAC_VLAN_TAG_ETV
[17] RW 0x0 ALT_EMAC_GMAC_VLAN_TAG_VTIM
[18] RW 0x0 ALT_EMAC_GMAC_VLAN_TAG_ESVL
[19] R 0x0 ALT_EMAC_GMAC_VLAN_TAG_VTHM
[31:20] R 0x0 ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20

Field : vl

VLAN Tag Identifier for Receive Frames

This field contains the 802.1Q VLAN tag to identify the VLAN frames and is compared to the 15th and 16th bytes of the frames being received for VLAN frames. The following list describes the bits of this field:

  • Bits [15:13]: User Priority
  • Bit 12: Canonical Format Indicator (CFI) or Drop Eligible Indicator (DEI)
  • Bits[11:0]: VLAN tag's VLAN Identifier (VID) field

When the ETV bit is set, only the VID (Bits[11:0]) is used for comparison.

If VL (VL[11:0] if ETV is set) is all zeros, the MAC does not check the fifteenth and 16th bytes for VLAN tag comparison, and declares all frames with a Type field value of 0x8100 or 0x88a8 as VLAN frames.

Field Access Macros:

#define ALT_EMAC_GMAC_VLAN_TAG_VL_LSB   0
 
#define ALT_EMAC_GMAC_VLAN_TAG_VL_MSB   15
 
#define ALT_EMAC_GMAC_VLAN_TAG_VL_WIDTH   16
 
#define ALT_EMAC_GMAC_VLAN_TAG_VL_SET_MSK   0x0000ffff
 
#define ALT_EMAC_GMAC_VLAN_TAG_VL_CLR_MSK   0xffff0000
 
#define ALT_EMAC_GMAC_VLAN_TAG_VL_RESET   0x0
 
#define ALT_EMAC_GMAC_VLAN_TAG_VL_GET(value)   (((value) & 0x0000ffff) >> 0)
 
#define ALT_EMAC_GMAC_VLAN_TAG_VL_SET(value)   (((value) << 0) & 0x0000ffff)
 

Field : etv

Enable 12-Bit VLAN Tag Comparison

When this bit is set, a 12-bit VLAN identifier is used for comparing and filtering instead of the complete 16-bit VLAN tag. Bits [11:0] of VLAN tag are compared with the corresponding field in the received VLAN-tagged frame. Similarly, when enabled, only 12 bits of the VLAN tag in the received frame are used for hash-based VLAN filtering.

When this bit is reset, all 16 bits of the 15th and 16th bytes of the received VLAN frame are used for comparison and VLAN hash filtering.

Field Enumeration Values:

Enum | Value | Description :--------------------------------------------------------------------------—|:---—|:---------— ALT_EMAC_GMAC_VLAN_TAG_ETV_E_DISD | 0x0 | ALT_EMAC_GMAC_VLAN_TAG_ETV_E_END | 0x1 |

Field Access Macros:

#define ALT_EMAC_GMAC_VLAN_TAG_ETV_E_DISD   0x0
 
#define ALT_EMAC_GMAC_VLAN_TAG_ETV_E_END   0x1
 
#define ALT_EMAC_GMAC_VLAN_TAG_ETV_LSB   16
 
#define ALT_EMAC_GMAC_VLAN_TAG_ETV_MSB   16
 
#define ALT_EMAC_GMAC_VLAN_TAG_ETV_WIDTH   1
 
#define ALT_EMAC_GMAC_VLAN_TAG_ETV_SET_MSK   0x00010000
 
#define ALT_EMAC_GMAC_VLAN_TAG_ETV_CLR_MSK   0xfffeffff
 
#define ALT_EMAC_GMAC_VLAN_TAG_ETV_RESET   0x0
 
#define ALT_EMAC_GMAC_VLAN_TAG_ETV_GET(value)   (((value) & 0x00010000) >> 16)
 
#define ALT_EMAC_GMAC_VLAN_TAG_ETV_SET(value)   (((value) << 16) & 0x00010000)
 

Field : vtim

VLAN Tag Inverse Match Enable

When set, this bit enables the VLAN Tag inverse matching. The frames that do not have matching VLAN Tag are marked as matched.

When reset, this bit enables the VLAN Tag perfect matching. The frames with matched VLAN Tag are marked as matched.

Field Access Macros:

#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_LSB   17
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_MSB   17
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_WIDTH   1
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_SET_MSK   0x00020000
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_CLR_MSK   0xfffdffff
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_RESET   0x0
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_GET(value)   (((value) & 0x00020000) >> 17)
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_SET(value)   (((value) << 17) & 0x00020000)
 

Field : esvl

Enable S-VLAN

When this bit is set, the MAC transmitter and receiver also consider the S-VLAN (Type = 0x88A8) frames as valid VLAN tagged frames.

Field Access Macros:

#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_LSB   18
 
#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_MSB   18
 
#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_WIDTH   1
 
#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_SET_MSK   0x00040000
 
#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_CLR_MSK   0xfffbffff
 
#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_RESET   0x0
 
#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_GET(value)   (((value) & 0x00040000) >> 18)
 
#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_SET(value)   (((value) << 18) & 0x00040000)
 

Field : vthm

VLAN Tag Hash Table Match Enable

When set, the most significant four bits of the VLAN tag's CRC are used to index the content of Register 354 (VLAN Hash Table Register). A value of 1 in the VLAN Hash Table register, corresponding to the index, indicates that the frame matched the VLAN hash table.

When Bit 16 (ETV) is set, the CRC of the 12-bit VLAN Identifier (VID) is used for comparison whereas when ETV is reset, the CRC of the 16-bit VLAN tag is used for comparison.

When reset, the VLAN Hash Match operation is not performed. If the VLAN Hash feature is not enabled during core configuration, this bit is reserved (RO with default value).

Field Access Macros:

#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_LSB   19
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_MSB   19
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_WIDTH   1
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_SET_MSK   0x00080000
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_CLR_MSK   0xfff7ffff
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_RESET   0x0
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_GET(value)   (((value) & 0x00080000) >> 19)
 
#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_SET(value)   (((value) << 19) & 0x00080000)
 

Field : reserved_31_20

Reserved

Field Access Macros:

#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_LSB   20
 
#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_MSB   31
 
#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_WIDTH   12
 
#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_SET_MSK   0xfff00000
 
#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_CLR_MSK   0x000fffff
 
#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_RESET   0x0
 
#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_GET(value)   (((value) & 0xfff00000) >> 20)
 
#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_SET(value)   (((value) << 20) & 0xfff00000)
 

Data Structures

struct  ALT_EMAC_GMAC_VLAN_TAG_s
 

Macros

#define ALT_EMAC_GMAC_VLAN_TAG_RESET   0x00000000
 
#define ALT_EMAC_GMAC_VLAN_TAG_OFST   0x1c
 
#define ALT_EMAC_GMAC_VLAN_TAG_ADDR(base)   ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_EMAC_GMAC_VLAN_TAG_OFST))
 

Typedefs

typedef struct
ALT_EMAC_GMAC_VLAN_TAG_s 
ALT_EMAC_GMAC_VLAN_TAG_t
 

Data Structure Documentation

struct ALT_EMAC_GMAC_VLAN_TAG_s

WARNING: The C register and register group struct declarations are provided for convenience and illustrative purposes. They should, however, be used with caution as the C language standard provides no guarantees about the alignment or atomicity of device memory accesses. The recommended practice for writing hardware drivers is to use the SoCAL access macros and alt_read_word() and alt_write_word() functions.

The struct declaration for register ALT_EMAC_GMAC_VLAN_TAG.

Data Fields
uint32_t vl: 16 ALT_EMAC_GMAC_VLAN_TAG_VL
uint32_t etv: 1 ALT_EMAC_GMAC_VLAN_TAG_ETV
uint32_t vtim: 1 ALT_EMAC_GMAC_VLAN_TAG_VTIM
uint32_t esvl: 1 ALT_EMAC_GMAC_VLAN_TAG_ESVL
const uint32_t vthm: 1 ALT_EMAC_GMAC_VLAN_TAG_VTHM
const uint32_t reserved_31_20: 12 ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20

Macro Definitions

#define ALT_EMAC_GMAC_VLAN_TAG_VL_LSB   0

The Least Significant Bit (LSB) position of the ALT_EMAC_GMAC_VLAN_TAG_VL register field.

#define ALT_EMAC_GMAC_VLAN_TAG_VL_MSB   15

The Most Significant Bit (MSB) position of the ALT_EMAC_GMAC_VLAN_TAG_VL register field.

#define ALT_EMAC_GMAC_VLAN_TAG_VL_WIDTH   16

The width in bits of the ALT_EMAC_GMAC_VLAN_TAG_VL register field.

#define ALT_EMAC_GMAC_VLAN_TAG_VL_SET_MSK   0x0000ffff

The mask used to set the ALT_EMAC_GMAC_VLAN_TAG_VL register field value.

#define ALT_EMAC_GMAC_VLAN_TAG_VL_CLR_MSK   0xffff0000

The mask used to clear the ALT_EMAC_GMAC_VLAN_TAG_VL register field value.

#define ALT_EMAC_GMAC_VLAN_TAG_VL_RESET   0x0

The reset value of the ALT_EMAC_GMAC_VLAN_TAG_VL register field.

#define ALT_EMAC_GMAC_VLAN_TAG_VL_GET (   value)    (((value) & 0x0000ffff) >> 0)

Extracts the ALT_EMAC_GMAC_VLAN_TAG_VL field value from a register.

#define ALT_EMAC_GMAC_VLAN_TAG_VL_SET (   value)    (((value) << 0) & 0x0000ffff)

Produces a ALT_EMAC_GMAC_VLAN_TAG_VL register field value suitable for setting the register.

#define ALT_EMAC_GMAC_VLAN_TAG_ETV_E_DISD   0x0

Enumerated value for register field ALT_EMAC_GMAC_VLAN_TAG_ETV

#define ALT_EMAC_GMAC_VLAN_TAG_ETV_E_END   0x1

Enumerated value for register field ALT_EMAC_GMAC_VLAN_TAG_ETV

#define ALT_EMAC_GMAC_VLAN_TAG_ETV_LSB   16

The Least Significant Bit (LSB) position of the ALT_EMAC_GMAC_VLAN_TAG_ETV register field.

#define ALT_EMAC_GMAC_VLAN_TAG_ETV_MSB   16

The Most Significant Bit (MSB) position of the ALT_EMAC_GMAC_VLAN_TAG_ETV register field.

#define ALT_EMAC_GMAC_VLAN_TAG_ETV_WIDTH   1

The width in bits of the ALT_EMAC_GMAC_VLAN_TAG_ETV register field.

#define ALT_EMAC_GMAC_VLAN_TAG_ETV_SET_MSK   0x00010000

The mask used to set the ALT_EMAC_GMAC_VLAN_TAG_ETV register field value.

#define ALT_EMAC_GMAC_VLAN_TAG_ETV_CLR_MSK   0xfffeffff

The mask used to clear the ALT_EMAC_GMAC_VLAN_TAG_ETV register field value.

#define ALT_EMAC_GMAC_VLAN_TAG_ETV_RESET   0x0

The reset value of the ALT_EMAC_GMAC_VLAN_TAG_ETV register field.

#define ALT_EMAC_GMAC_VLAN_TAG_ETV_GET (   value)    (((value) & 0x00010000) >> 16)

Extracts the ALT_EMAC_GMAC_VLAN_TAG_ETV field value from a register.

#define ALT_EMAC_GMAC_VLAN_TAG_ETV_SET (   value)    (((value) << 16) & 0x00010000)

Produces a ALT_EMAC_GMAC_VLAN_TAG_ETV register field value suitable for setting the register.

#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_LSB   17

The Least Significant Bit (LSB) position of the ALT_EMAC_GMAC_VLAN_TAG_VTIM register field.

#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_MSB   17

The Most Significant Bit (MSB) position of the ALT_EMAC_GMAC_VLAN_TAG_VTIM register field.

#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_WIDTH   1

The width in bits of the ALT_EMAC_GMAC_VLAN_TAG_VTIM register field.

#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_SET_MSK   0x00020000

The mask used to set the ALT_EMAC_GMAC_VLAN_TAG_VTIM register field value.

#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_CLR_MSK   0xfffdffff

The mask used to clear the ALT_EMAC_GMAC_VLAN_TAG_VTIM register field value.

#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_RESET   0x0

The reset value of the ALT_EMAC_GMAC_VLAN_TAG_VTIM register field.

#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_GET (   value)    (((value) & 0x00020000) >> 17)

Extracts the ALT_EMAC_GMAC_VLAN_TAG_VTIM field value from a register.

#define ALT_EMAC_GMAC_VLAN_TAG_VTIM_SET (   value)    (((value) << 17) & 0x00020000)

Produces a ALT_EMAC_GMAC_VLAN_TAG_VTIM register field value suitable for setting the register.

#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_LSB   18

The Least Significant Bit (LSB) position of the ALT_EMAC_GMAC_VLAN_TAG_ESVL register field.

#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_MSB   18

The Most Significant Bit (MSB) position of the ALT_EMAC_GMAC_VLAN_TAG_ESVL register field.

#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_WIDTH   1

The width in bits of the ALT_EMAC_GMAC_VLAN_TAG_ESVL register field.

#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_SET_MSK   0x00040000

The mask used to set the ALT_EMAC_GMAC_VLAN_TAG_ESVL register field value.

#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_CLR_MSK   0xfffbffff

The mask used to clear the ALT_EMAC_GMAC_VLAN_TAG_ESVL register field value.

#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_RESET   0x0

The reset value of the ALT_EMAC_GMAC_VLAN_TAG_ESVL register field.

#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_GET (   value)    (((value) & 0x00040000) >> 18)

Extracts the ALT_EMAC_GMAC_VLAN_TAG_ESVL field value from a register.

#define ALT_EMAC_GMAC_VLAN_TAG_ESVL_SET (   value)    (((value) << 18) & 0x00040000)

Produces a ALT_EMAC_GMAC_VLAN_TAG_ESVL register field value suitable for setting the register.

#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_LSB   19

The Least Significant Bit (LSB) position of the ALT_EMAC_GMAC_VLAN_TAG_VTHM register field.

#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_MSB   19

The Most Significant Bit (MSB) position of the ALT_EMAC_GMAC_VLAN_TAG_VTHM register field.

#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_WIDTH   1

The width in bits of the ALT_EMAC_GMAC_VLAN_TAG_VTHM register field.

#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_SET_MSK   0x00080000

The mask used to set the ALT_EMAC_GMAC_VLAN_TAG_VTHM register field value.

#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_CLR_MSK   0xfff7ffff

The mask used to clear the ALT_EMAC_GMAC_VLAN_TAG_VTHM register field value.

#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_RESET   0x0

The reset value of the ALT_EMAC_GMAC_VLAN_TAG_VTHM register field.

#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_GET (   value)    (((value) & 0x00080000) >> 19)

Extracts the ALT_EMAC_GMAC_VLAN_TAG_VTHM field value from a register.

#define ALT_EMAC_GMAC_VLAN_TAG_VTHM_SET (   value)    (((value) << 19) & 0x00080000)

Produces a ALT_EMAC_GMAC_VLAN_TAG_VTHM register field value suitable for setting the register.

#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_LSB   20

The Least Significant Bit (LSB) position of the ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20 register field.

#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_MSB   31

The Most Significant Bit (MSB) position of the ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20 register field.

#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_WIDTH   12

The width in bits of the ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20 register field.

#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_SET_MSK   0xfff00000

The mask used to set the ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20 register field value.

#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_CLR_MSK   0x000fffff

The mask used to clear the ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20 register field value.

#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_RESET   0x0

The reset value of the ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20 register field.

#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_GET (   value)    (((value) & 0xfff00000) >> 20)

Extracts the ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20 field value from a register.

#define ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20_SET (   value)    (((value) << 20) & 0xfff00000)

Produces a ALT_EMAC_GMAC_VLAN_TAG_RSVD_31_20 register field value suitable for setting the register.

#define ALT_EMAC_GMAC_VLAN_TAG_RESET   0x00000000

The reset value of the ALT_EMAC_GMAC_VLAN_TAG register.

#define ALT_EMAC_GMAC_VLAN_TAG_OFST   0x1c

The byte offset of the ALT_EMAC_GMAC_VLAN_TAG register from the beginning of the component.

#define ALT_EMAC_GMAC_VLAN_TAG_ADDR (   base)    ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_EMAC_GMAC_VLAN_TAG_OFST))

The address of the ALT_EMAC_GMAC_VLAN_TAG register.

Typedef Documentation

The typedef declaration for register ALT_EMAC_GMAC_VLAN_TAG.