 |
AM263Px INDUSTRIAL COMMUNICATIONS SDK
2026.00.00
|
|
◆ 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
- This is the primary control for all VLAN filtering features
- Should be configured before other VLAN filtering functions:
- Disabling this function overrides all other VLAN filtering settings
Recommended configuration sequence:
◆ 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:
- ALL mode (Allow untagged frames):
- Set then clear the control bit for atomic operation
- Host will receive all untagged frames
- 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
- This configuration is independent of the VLAN ID filtering
- The setting affects all untagged frames regardless of their content
- Should be used in conjunction with main VLAN filter configuration
- Command parameter is treated as boolean - any non-zero value will be interpreted as VLAN_FLTR_UNTAG_HOST_RCV_NAL
Example usage:
◆ 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
- This function should be used in conjunction with the main VLAN filter configuration (EIP_configureVlanFilter)
- The command parameter is treated as boolean - any non-zero value will be interpreted as VLAN_FLTR_PRIOTAG_HOST_RCV_NAL
Example usage:
◆ 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:
- NULL check for pruicssHandle
- 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:
int32_t EIP_configureUntaggedFrameRx(PRUICSS_Handle pruicssHandle, uint8_t command)
Configure reception behavior for untagged frames in VLAN filtering.
#define VLAN_FLTR_PRIOTAG_HOST_RCV_NAL
Definition: icss_pn_rtcx.h:679
#define VLAN_FLTR_UNTAG_HOST_RCV_ALL
Definition: icss_pn_rtcx.h:675
#define REM_VLAN_VID
Definition: icss_pn_rtcx.h:685
#define VLAN_FLTR_ENABLE
Definition: icss_pn_rtcx.h:673
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.
#define VLAN_FLTR_UNTAG_HOST_RCV_NAL
Definition: icss_pn_rtcx.h:676
#define ADD_VLAN_VID
Definition: icss_pn_rtcx.h:684
#define VLAN_FLTR_PRIOTAG_HOST_RCV_ALL
Definition: icss_pn_rtcx.h:678
int32_t EIP_configurePriorityTaggedFrameRx(PRUICSS_Handle pruicssHandle, uint8_t command)
Configure reception behavior for priority-tagged frames in VLAN filtering.
int32_t EIP_configureVlanFilter(PRUICSS_Handle pruicssHandle, uint8_t command)
Master control function for VLAN filtering mechanism.