AM263Px INDUSTRIAL COMMUNICATIONS SDK  10.02.00

Introduction

Functions

int32_t EIP_configureVlanFilter (PRUICSS_Handle pruicssHandle, uint8_t command)
 Master control function for VLAN filtering mechanism. More...
 
int32_t EIP_configureUntaggedFrameRx (PRUICSS_Handle pruicssHandle, uint8_t command)
 Configure reception behavior for untagged frames in VLAN filtering. More...
 
int32_t EIP_configurePriorityTaggedFrameRx (PRUICSS_Handle pruicssHandle, uint8_t command)
 Configure reception behavior for priority-tagged frames in VLAN filtering. More...
 
int32_t EIP_configureVidRx (PRUICSS_Handle pruicssHandle, uint16_t vid, uint8_t command)
 Configure VLAN ID filtering for host receive in the VLAN filter table. More...
 

Function Documentation

◆ EIP_configureVlanFilter()

int32_t EIP_configureVlanFilter ( PRUICSS_Handle  pruicssHandle,
uint8_t  command 
)

Master control function for VLAN filtering mechanism.

This function enables or disables the entire VLAN filtering feature by controlling a master control bit in shared memory. It serves as the main switch for all VLAN filtering operations.

When enabled:

  • Forwarding of incoming frames is filtered based on the VLAN Filter configuration
  • Other VLAN filtering settings become active (untagged, priority-tagged, VID filtering)
  • Frames must match filtering criteria to be received by host

When disabled:

  • VLAN filtering is bypassed
  • Other VLAN filtering settings are ignored

Memory layout:

  • Uses VLAN_FLTR_CTRL_BYTE in shared RAM
  • VLAN_FLTR_CTRL_SHIFT defines the control bit position

Control bit states:

  • Bit cleared: VLAN filtering disabled
  • Bit set: VLAN filtering enabled
Parameters
pruicssHandle[in] Handle to PRU ICSS instance Contains pointers to base addresses & offsets Must not be NULL
command[in] VLAN filtering control command:
  • VLAN_FLTR_DISABLE (0x00):
    • Disable VLAN filtering
    • Clear the control bit
  • VLAN_FLTR_ENABLE (0x01):
    • Enable VLAN filtering
    • Set the control bit
Returns
SystemP_SUCCESS: Configuration successful SystemP_FAILURE: Invalid parameter (NULL handle)
Note
  1. This is the primary control for all VLAN filtering features
  2. Should be configured before other VLAN filtering functions:
  3. Disabling this function overrides all other VLAN filtering settings

Recommended configuration sequence:

// Step 1: Enable VLAN filtering
EIP_configureVlanFilter(pruicssHandle, VLAN_FLTR_ENABLE);
// Step 2: Configure specific VLAN filtering rules
EIP_configureUntaggedFrameRx(pruicssHandle, VLAN_FLTR_UNTAG_HOST_RCV_ALL);
EIP_configurePriorityTaggedFrameRx(pruicssHandle, VLAN_FLTR_PRIOTAG_HOST_RCV_ALL);
EIP_configureVidRx(pruicssHandle, someVID, ADD_VLAN_VID);

◆ EIP_configureUntaggedFrameRx()

int32_t EIP_configureUntaggedFrameRx ( PRUICSS_Handle  pruicssHandle,
uint8_t  command 
)

Configure reception behavior for untagged frames in VLAN filtering.

Untagged frames are standard Ethernet frames without any VLAN tag information. This function controls whether such frames should be processed by the host or filtered out.

The configuration is controlled through a dedicated bit in shared memory:

  • Bit cleared (ALL mode): Host receives untagged frames
  • Bit set (NAL mode): Host does not receive untagged frames

Memory layout:

  • Uses VLAN_FLTR_CTRL_BYTE in shared RAM
  • VLAN_FLTR_UNTAG_HOST_RCV_CTRL_SHIFT defines the control bit position

Operation details:

  1. ALL mode (Allow untagged frames):
    • Set then clear the control bit for atomic operation
    • Host will receive all untagged frames
  2. NAL mode (Not Allowed):
    • Set the control bit
    • Host will not receive any untagged frames
Parameters
pruicssHandle[in] Handle to PRU ICSS instance Contains pointers to base addresses & offsets Must not be NULL
command[in] Reception control command:
  • VLAN_FLTR_UNTAG_HOST_RCV_ALL (0x00):
    • Allow untagged frames to host
    • Clear the control bit
  • VLAN_FLTR_UNTAG_HOST_RCV_NAL (0x01):
    • Block untagged frames from host
    • Set the control bit
Returns
SystemP_SUCCESS: Configuration successful
SystemP_FAILURE: Invalid parameter (NULL handle)
Note
  1. This configuration is independent of the VLAN ID filtering
  2. The setting affects all untagged frames regardless of their content
  3. Should be used in conjunction with main VLAN filter configuration
  4. Command parameter is treated as boolean - any non-zero value will be interpreted as VLAN_FLTR_UNTAG_HOST_RCV_NAL

Example usage:

// Allow untagged frames to host
EIP_configureUntaggedFrameRx(pruicssHandle, VLAN_FLTR_UNTAG_HOST_RCV_ALL);
// Block untagged frames from host
EIP_configureUntaggedFrameRx(pruicssHandle, VLAN_FLTR_UNTAG_HOST_RCV_NAL);

◆ EIP_configurePriorityTaggedFrameRx()

int32_t EIP_configurePriorityTaggedFrameRx ( PRUICSS_Handle  pruicssHandle,
uint8_t  command 
)

Configure reception behavior for priority-tagged frames in VLAN filtering.

Priority-tagged frames are Ethernet frames with a VLAN tag where:

  • VLAN ID (VID) field is set to 0
  • Priority Code Point (PCP) field contains valid priority information

This function controls whether such frames should be:

  • Received by the host (ALL mode)
  • Not received by the host (NAL - Not ALlowed mode)

The configuration is done by manipulating a control bit in shared memory:

  • Clear bit: Allow priority-tagged frames to host
  • Set bit: Block priority-tagged frames from host

Memory layout:

  • Uses VLAN_FLTR_CTRL_BYTE in shared RAM
  • VLAN_FLTR_PRIOTAG_HOST_RCV_CTRL_SHIFT defines the control bit position
Parameters
pruicssHandle[in] Handle to PRU ICSS instance Contains pointers to base addresses & offsets Must not be NULL
command[in] Reception control command:
  • VLAN_FLTR_PRIOTAG_HOST_RCV_ALL (0x00):
    • Allow priority-tagged frames to host
    • Clear the control bit
  • VLAN_FLTR_PRIOTAG_HOST_RCV_NAL (0x01):
    • Block priority-tagged frames from host
    • Set the control bit
Returns
SystemP_SUCCESS: Configuration successful
SystemP_FAILURE: Invalid parameter (NULL handle)
Note
  1. This function should be used in conjunction with the main VLAN filter configuration (EIP_configureVlanFilter)
  2. The command parameter is treated as boolean - any non-zero value will be interpreted as VLAN_FLTR_PRIOTAG_HOST_RCV_NAL

Example usage:

// Allow priority-tagged frames to host
EIP_configurePriorityTaggedFrameRx(pruicssHandle, VLAN_FLTR_PRIOTAG_HOST_RCV_ALL);
// Block priority-tagged frames from host
EIP_configurePriorityTaggedFrameRx(pruicssHandle, VLAN_FLTR_PRIOTAG_HOST_RCV_NAL);

◆ EIP_configureVidRx()

int32_t EIP_configureVidRx ( PRUICSS_Handle  pruicssHandle,
uint16_t  vid,
uint8_t  command 
)

Configure VLAN ID filtering for host receive in the VLAN filter table.

This function manages the VLAN filter table which controls whether packets with specific VLAN IDs (VIDs) should be received by the host or not. The filter table is implemented as a bit array where each bit corresponds to a VID (0-4095).

The VLAN filter table layout:

  • Total size: 512 bytes (4096 bits, one per VID)
  • Each byte controls 8 VIDs
  • Bit value 1: Allow packets with this VID to host
  • Bit value 0: Drop packets with this VID

Implementation details:

  • VID to byte mapping: VID/8 gives byte offset in table
  • VID to bit mapping: VID%8 (implemented as VID & 0x07) gives bit position in byte
Parameters
pruicssHandle[in] Handle to PRU ICSS instance Contains pointers to base addresses & offsets Must not be NULL
vid[in] VLAN ID to configure (0-4095) Since vid is unsigned, only upper bound (4095) is checked
command[in] Configuration command:
  • ADD_VLAN_VID (0x01): Enable reception of packets with this VID
  • REM_VLAN_VID (0x00): Disable reception of packets with this VID
Returns
SystemP_SUCCESS: Configuration successful
SystemP_FAILURE: Invalid parameters (NULL handle or invalid VID)
Note
The function performs the following validations:
  1. NULL check for pruicssHandle
  2. Valid range check for vid (0-4095)
The command parameter is not validated - any non-zero value is treated as ADD_VLAN_VID

Example usage:

// Allow packets with VID 100 to be received by host
EIP_configureVidRx(pruicssHandle, 100, ADD_VLAN_VID);
// Block packets with VID 200 from being received by host
EIP_configureVidRx(pruicssHandle, 200, REM_VLAN_VID);
EIP_configureUntaggedFrameRx
int32_t EIP_configureUntaggedFrameRx(PRUICSS_Handle pruicssHandle, uint8_t command)
Configure reception behavior for untagged frames in VLAN filtering.
EIP_configureVidRx
int32_t EIP_configureVidRx(PRUICSS_Handle pruicssHandle, uint16_t vid, uint8_t command)
Configure VLAN ID filtering for host receive in the VLAN filter table.
EIP_configurePriorityTaggedFrameRx
int32_t EIP_configurePriorityTaggedFrameRx(PRUICSS_Handle pruicssHandle, uint8_t command)
Configure reception behavior for priority-tagged frames in VLAN filtering.
EIP_configureVlanFilter
int32_t EIP_configureVlanFilter(PRUICSS_Handle pruicssHandle, uint8_t command)
Master control function for VLAN filtering mechanism.