v_voip_framer
Xilinx SDK Drivers API Documentation
xframer.h File Reference

Overview

This is the main header file for VoIP Framer core.

VoIP Framer core is used for generating Ethernet Headers for Incoming ST2022 RTP Packets or RTP Compliant Packet.

The VoIP Framer has 3 main Interface

  • AXI4-Stream Interface for accepting Incoming Ethernet Packet
  • AXI4-Stream Interface for transmitting RTP Packet <RTP Header | Payload>
  • AXI4-Lite interface for processor, controls the VoIP Decapsulator.

VoIP Framer Performs Following Operation

  • Add Ethernet Header, (MAC, IP, & UDP Header)
  • Statistic Monitoring of Incoming and Outgoing Packet

Software Initialization & Configuration

The application needs to do following steps in order for preparing the VoIP Framer core to be ready.

  • Call XFramer_LookupConfig using a device ID to find the core configuration.
  • Call XFramer_CfgInitialize to initialize the device and the driver instance associated with it.

Virtual Memory

Threads

Asserts

Building the driver

The VoIP Framer driver is composed of several source files. This allows the user to build and link only those parts of the driver that are necessary.

MODIFICATION HISTORY:
Ver   Who    Date     Changes


1.00 mmo 02/12/16 Initial release.

 

Data Structures

struct  XFramer_Header
 This typedef contains VoIP Framer Header Generation Parameter. More...
 
struct  XFramer_ChannelCfg
 This typedef contains VoIP Framer Channel Parameter Configuration. More...
 
struct  XFramer_Config
 This typedef contains configuration information for the VoIP Framer core. More...
 
struct  XFramer
 The XFramer driver instance data. More...
 

Macros

#define XFRAMER_H_
 Prevent circular inclusions by using protection macros. More...
 
#define XFramer_BusyBit(InstancePtr)
 This macro Check the VoIP Framer Busy Status which indicates the core is still updating the registers. More...
 

Enumerations

Transmit Enable/Disable
enum  XFramerTXEnable
 These constants specify specify the VoIP Framer to Enable/Disable the Transmission Packet. More...
 
Enable VLAN
enum  XFramerVLANEnable
 These constants contains component to Enable VLAN Packet Generation. More...
 
IPV6 Enable (Future Implementation)
enum  XFramerIPV6Enable
 These constants contains component to enable IPv6 Packet Generation. More...
 

Functions

XFramer_ConfigXFramer_LookupConfig (u16 DeviceId)
 This function returns a reference to an XFramer_Config structure based on the core id, DeviceId. More...
 
int XFramer_CfgInitialize (XFramer *InstancePtr, XFramer_Config *CfgPtr, UINTPTR EffectiveAddr)
 This function initializes the VoIP Framer core. More...
 
void XFramer_CoreConfig (XFramer *InstancePtr)
 This function configures the entire VoIP Framer based on user configured value. More...
 
void XFramer_CoreChannelConfig (XFramer *InstancePtr)
 This function configures the entire Channel Space of VoIP Framer based on user configured value. More...
 
void XFramer_ChannelConfig (XFramer *InstancePtr, u16 Channels)
 This function Configures the VoIP Framer Channels Parameter. More...
 
XFramer_ChannelCfg XFramer_ChStatus (XFramer *InstancePtr, u16 Channels)
 This function Reads the VoIP Framer Channels Parameter Register. More...
 
XFramer_Config XFramer_CoreInfo (XFramer *InstancePtr)
 This function reads the Core Information (Configured by user through GUI), in the VoIP Framer Register. More...
 
void XFramer_SoftReset (XFramer *InstancePtr)
 This function perform software resets on VoIP Framer, which clears all the registers. More...
 
void XFramer_ChannelUpdate (XFramer *InstancePtr)
 This function send a pulse on VoIP Framer to update the configured channel. More...
 
void XFramer_ChannelAccess (XFramer *InstancePtr, u16 Channels)
 This function accesses the current configuration channel. More...
 
void XFramer_EthSrcAddr0 (XFramer *InstancePtr)
 This function Set the Lower Ethernet MAC Source Address. More...
 
void XFramer_EthSrcAddr1 (XFramer *InstancePtr)
 This function Set the Higher Ethernet MAC Source Address. More...
 
u16 XFramer_GetEthSrcAddr1 (XFramer *InstancePtr)
 This function Gets the Lower Ethernet MAC Source Address from Register. More...
 
u32 XFramer_GetEthSrcAddr0 (XFramer *InstancePtr)
 This function Gets the Lower Ethernet MAC Source Address from Register. More...
 
u8 XFramer_GetPeakBufferLevel (XFramer *InstancePtr)
 This function Gets the Peak Observed Buffer Level. More...
 
void XFramer_ClearPeakBufferLevel (XFramer *InstancePtr)
 This function Clears the Peak Observed Buffer Level Register. More...
 
u32 XFramer_GetRXPcktCnt (XFramer *InstancePtr)
 This function Gets the Current Received Packet Count Statistic. More...
 
void XFramer_ClearRXPcktCnt (XFramer *InstancePtr)
 This function Clears the Received Packet Count Statistic Register. More...
 
u32 XFramer_GetDropPcktCnt (XFramer *InstancePtr)
 This function Gets the Current Drop Packet Count Statistic. More...
 
void XFramer_ClearDropPcktCnt (XFramer *InstancePtr)
 This function Clears the Drop Packet Count Statistic Register. More...
 
void XFramer_TransmitEnable (XFramer *InstancePtr, u16 Channels)
 This function Set the Transmission Enable Bit. More...
 
u8 XFramer_GetTransmitEnable (XFramer *InstancePtr, u16 Channels)
 This function Gets the Current Configure Transmission Enable Bit. More...
 
void XFramer_EthDestAddr0 (XFramer *InstancePtr, u16 Channels)
 This function Sets the Lower 32 Bit Ethernet Destination MAC Address. More...
 
void XFramer_EthDestAddr1 (XFramer *InstancePtr, u16 Channels)
 This function Sets the Higher 16 Bit Ethernet Destination MAC Address. More...
 
void XFramer_VLANID (XFramer *InstancePtr, u16 Channels)
 This function Sets the VLAN ID of the Ethernet Packet. More...
 
void XFramer_SetVLAN (XFramer *InstancePtr, u16 Channels)
 This function Set the Core to Generate Packets with VLAN. More...
 
void XFramer_MediaTOS (XFramer *InstancePtr, u16 Channels)
 This function Set the Media Type of Service (TOS). More...
 
void XFramer_MediaTTL (XFramer *InstancePtr, u16 Channels)
 This function Set the Media Time-To-Live (TTL). More...
 
void XFramer_FECTOS (XFramer *InstancePtr, u16 Channels)
 This function Set the FEC Type of Service (TOS). More...
 
void XFramer_FECTTL (XFramer *InstancePtr, u16 Channels)
 This function Set the FEC Time-To-Live (TTL). More...
 
void XFramer_IP0Dest (XFramer *InstancePtr, u16 Channels)
 This function Sets the IP Destination Address. More...
 
void XFramer_IP0Src (XFramer *InstancePtr, u16 Channels)
 This function Sets the IP Source Address. More...
 
void XFramer_UDPDest (XFramer *InstancePtr, u16 Channels)
 This function Sets the UDP Destination Port. More...
 
void XFramer_UDPSrc (XFramer *InstancePtr, u16 Channels)
 This function Sets the UDP Source Port. More...
 
u32 XFramer_GetTXPcktCnt (XFramer *InstancePtr, u16 Channels)
 This function Gets the current transmitted packet count statistic. More...
 
void XFramer_ClearTXPcktCnt (XFramer *InstancePtr, u16 Channels)
 This function Clears the current transmitted packet count statistic register. More...
 

Macro Definition Documentation

#define XFramer_BusyBit (   InstancePtr)
Value:
XFramer_ReadReg((InstancePtr)->Config.BaseAddress, (XFRAMER_CONTROL)) \
& (XFRAMER_STATUS_UPDATE_BUSY_MASK)
#define XFramer_ReadReg(BaseAddress, RegOffset)
This macro reads a value from a VoIP Framer register.
Definition: xframer_hw.h:190

This macro Check the VoIP Framer Busy Status which indicates the core is still updating the registers.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
BusyBitStatus.
Note
  void XFramer_AssertSoftReset(XFramer *InstancePtr)

Referenced by XFramer_CfgInitialize(), and XFramer_ChannelAccess().

#define XFRAMER_H_

Prevent circular inclusions by using protection macros.

Enumeration Type Documentation

These constants contains component to enable IPv6 Packet Generation.

These constants specify specify the VoIP Framer to Enable/Disable the Transmission Packet.

These constants contains component to Enable VLAN Packet Generation.

Function Documentation

int XFramer_CfgInitialize ( XFramer InstancePtr,
XFramer_Config CfgPtr,
UINTPTR  EffectiveAddr 
)

This function initializes the VoIP Framer core.

This function must be called prior to using the VoIP Framer core. Initialization of the VoIP Framer includes setting up the instance data and ensuring the hardware is in a quiescent state.

Parameters
InstancePtris a pointer to the XDecap core instance.
CfgPtrpoints to the configuration structure associated with the VoIP Framer core.
EffectiveAddris the base address of the device. If address translation is being used, then this parameter must reflect the virtual base address. Otherwise, the physical address should be used.
Returns
  • XST_SUCCESS if XFramer_CfgInitialize was successful.
  • XST_FAILURE if Channel Number has mismatched with value reflected on the register, and if the Overflow strategy has mismatched with the value reflected on the register.
Note
None.

References XFramer_Config::BaseAddress, XFramer_Config::HWChannelNumber, XFramer_Config::OverflowHandlingStrategy, XFramer_BusyBit, XFramer_CoreInfo(), and XFramer_SoftReset().

void XFramer_ChannelAccess ( XFramer InstancePtr,
u16  Channels 
)
void XFramer_ChannelConfig ( XFramer InstancePtr,
u16  Channels 
)

This function Configures the VoIP Framer Channels Parameter.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_ChannelAccess(), XFramer_EthDestAddr0(), XFramer_EthDestAddr1(), XFramer_FECTOS(), XFramer_FECTTL(), XFramer_IP0Dest(), XFramer_IP0Src(), XFramer_MediaTOS(), XFramer_MediaTTL(), XFramer_SetVLAN(), XFramer_TransmitEnable(), XFramer_UDPDest(), XFramer_UDPSrc(), and XFramer_VLANID().

Referenced by XFramer_CoreChannelConfig().

void XFramer_ChannelUpdate ( XFramer InstancePtr)

This function send a pulse on VoIP Framer to update the configured channel.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
None.
Note
None.

References XFramer_ReadReg, and XFramer_WriteReg.

Referenced by XFramer_ClearTXPcktCnt(), XFramer_CoreChannelConfig(), XFramer_EthDestAddr0(), XFramer_EthDestAddr1(), XFramer_FECTOS(), XFramer_FECTTL(), XFramer_IP0Dest(), XFramer_IP0Src(), XFramer_MediaTOS(), XFramer_MediaTTL(), XFramer_SetVLAN(), XFramer_TransmitEnable(), XFramer_UDPDest(), XFramer_UDPSrc(), and XFramer_VLANID().

XFramer_ChannelCfg XFramer_ChStatus ( XFramer InstancePtr,
u16  Channels 
)

This function Reads the VoIP Framer Channels Parameter Register.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), and XFramer_ReadReg.

void XFramer_ClearDropPcktCnt ( XFramer InstancePtr)

This function Clears the Drop Packet Count Statistic Register.

This is Self Clear Register.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, and XFramer_WriteReg.

void XFramer_ClearPeakBufferLevel ( XFramer InstancePtr)

This function Clears the Peak Observed Buffer Level Register.

This is Self Clear Register.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, and XFramer_WriteReg.

void XFramer_ClearRXPcktCnt ( XFramer InstancePtr)

This function Clears the Received Packet Count Statistic Register.

This is Self Clear Register.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, and XFramer_WriteReg.

void XFramer_ClearTXPcktCnt ( XFramer InstancePtr,
u16  Channels 
)

This function Clears the current transmitted packet count statistic register.

This is a self clear register.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), and XFramer_WriteReg.

void XFramer_CoreChannelConfig ( XFramer InstancePtr)

This function configures the entire Channel Space of VoIP Framer based on user configured value.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
None.
Note
None.

References XFramer_ChannelAccess(), XFramer_ChannelConfig(), and XFramer_ChannelUpdate().

Referenced by XFramer_CoreConfig().

void XFramer_CoreConfig ( XFramer InstancePtr)

This function configures the entire VoIP Framer based on user configured value.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
None.
Note
None.

References XFramer_CoreChannelConfig(), XFramer_EthSrcAddr0(), and XFramer_EthSrcAddr1().

XFramer_Config XFramer_CoreInfo ( XFramer InstancePtr)

This function reads the Core Information (Configured by user through GUI), in the VoIP Framer Register.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
XFramer_Config_RegValue of the HW Channel Number and the Overflow Handling Strategy
Note
None.

References XFramer_Config::BaseAddress, XFramer_Config::HWChannelNumber, XFramer_Config::OverflowHandlingStrategy, and XFramer_ReadReg.

Referenced by XFramer_CfgInitialize().

void XFramer_EthDestAddr0 ( XFramer InstancePtr,
u16  Channels 
)

This function Sets the Lower 32 Bit Ethernet Destination MAC Address.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), and XFramer_WriteReg.

Referenced by XFramer_ChannelConfig().

void XFramer_EthDestAddr1 ( XFramer InstancePtr,
u16  Channels 
)

This function Sets the Higher 16 Bit Ethernet Destination MAC Address.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), XFramer_ReadReg, and XFramer_WriteReg.

Referenced by XFramer_ChannelConfig().

void XFramer_EthSrcAddr0 ( XFramer InstancePtr)

This function Set the Lower Ethernet MAC Source Address.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, and XFramer_WriteReg.

Referenced by XFramer_CoreConfig().

void XFramer_EthSrcAddr1 ( XFramer InstancePtr)

This function Set the Higher Ethernet MAC Source Address.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, and XFramer_WriteReg.

Referenced by XFramer_CoreConfig().

void XFramer_FECTOS ( XFramer InstancePtr,
u16  Channels 
)

This function Set the FEC Type of Service (TOS).

Component of the IP Header.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), XFramer_ReadReg, and XFramer_WriteReg.

Referenced by XFramer_ChannelConfig().

void XFramer_FECTTL ( XFramer InstancePtr,
u16  Channels 
)

This function Set the FEC Time-To-Live (TTL).

Component of the IP Header.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), XFramer_ReadReg, and XFramer_WriteReg.

Referenced by XFramer_ChannelConfig().

u32 XFramer_GetDropPcktCnt ( XFramer InstancePtr)

This function Gets the Current Drop Packet Count Statistic.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
RegValue is the Current Drop Packet Count
Note
None.

References XFramer_Config::BaseAddress, and XFramer_ReadReg.

u32 XFramer_GetEthSrcAddr0 ( XFramer InstancePtr)

This function Gets the Lower Ethernet MAC Source Address from Register.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
RegValue is the Ethernet Lower MAC Address Register Value.
Note
None.

References XFramer_Config::BaseAddress, and XFramer_ReadReg.

u16 XFramer_GetEthSrcAddr1 ( XFramer InstancePtr)

This function Gets the Lower Ethernet MAC Source Address from Register.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
RegValue is the Ethernet Lower MAC Address Register Value.
Note
None.

References XFramer_Config::BaseAddress, and XFramer_ReadReg.

u8 XFramer_GetPeakBufferLevel ( XFramer InstancePtr)

This function Gets the Peak Observed Buffer Level.

Ensure this value is not greater than the Elastic Buffer Set during Core Generation. This is Debug Function.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
RegValue is the Peak Observed Buffer Level
Note
None.

References XFramer_Config::BaseAddress, and XFramer_ReadReg.

u32 XFramer_GetRXPcktCnt ( XFramer InstancePtr)

This function Gets the Current Received Packet Count Statistic.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
RegValue is the Current Received Packet Count
Note
None.

References XFramer_Config::BaseAddress, and XFramer_ReadReg.

u8 XFramer_GetTransmitEnable ( XFramer InstancePtr,
u16  Channels 
)

This function Gets the Current Configure Transmission Enable Bit.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
RegValue is the Transmission Enable Bit Register Value.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), and XFramer_ReadReg.

u32 XFramer_GetTXPcktCnt ( XFramer InstancePtr,
u16  Channels 
)

This function Gets the current transmitted packet count statistic.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), and XFramer_ReadReg.

void XFramer_IP0Dest ( XFramer InstancePtr,
u16  Channels 
)

This function Sets the IP Destination Address.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), and XFramer_WriteReg.

Referenced by XFramer_ChannelConfig().

void XFramer_IP0Src ( XFramer InstancePtr,
u16  Channels 
)

This function Sets the IP Source Address.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), and XFramer_WriteReg.

Referenced by XFramer_ChannelConfig().

XFramer_Config* XFramer_LookupConfig ( u16  DeviceId)

This function returns a reference to an XFramer_Config structure based on the core id, DeviceId.

The return value will refer to an entry in the device configuration table defined in the xframer_g.c file.

Parameters
DeviceIdis the unique core ID of the Decap core for the lookup operation.
Returns
XFramer_LookupConfig returns a reference to a config record in the configuration table (in xframer_g.c) corresponding to DeviceId, or NULL if no match is found.
Note
None.
void XFramer_MediaTOS ( XFramer InstancePtr,
u16  Channels 
)

This function Set the Media Type of Service (TOS).

Component of the IP Header.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), XFramer_ReadReg, and XFramer_WriteReg.

Referenced by XFramer_ChannelConfig().

void XFramer_MediaTTL ( XFramer InstancePtr,
u16  Channels 
)

This function Set the Media Time-To-Live (TTL).

Component of the IP Header.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), XFramer_ReadReg, and XFramer_WriteReg.

Referenced by XFramer_ChannelConfig().

void XFramer_SetVLAN ( XFramer InstancePtr,
u16  Channels 
)

This function Set the Core to Generate Packets with VLAN.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), XFramer_ReadReg, and XFramer_WriteReg.

Referenced by XFramer_ChannelConfig().

void XFramer_SoftReset ( XFramer InstancePtr)

This function perform software resets on VoIP Framer, which clears all the registers.

Parameters
InstancePtris a pointer to the XFramer core instance.
Returns
None.
Note
None.

References XFramer_ReadReg, and XFramer_WriteReg.

Referenced by XFramer_CfgInitialize().

void XFramer_TransmitEnable ( XFramer InstancePtr,
u16  Channels 
)

This function Set the Transmission Enable Bit.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), and XFramer_WriteReg.

Referenced by XFramer_ChannelConfig().

void XFramer_UDPDest ( XFramer InstancePtr,
u16  Channels 
)

This function Sets the UDP Destination Port.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), XFramer_ReadReg, and XFramer_WriteReg.

Referenced by XFramer_ChannelConfig().

void XFramer_UDPSrc ( XFramer InstancePtr,
u16  Channels 
)

This function Sets the UDP Source Port.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), XFramer_ReadReg, and XFramer_WriteReg.

Referenced by XFramer_ChannelConfig().

void XFramer_VLANID ( XFramer InstancePtr,
u16  Channels 
)

This function Sets the VLAN ID of the Ethernet Packet.

Parameters
InstancePtris a pointer to the XFramer core instance.
Channelsis current configured channel
Returns
None.
Note
None.

References XFramer_Config::BaseAddress, XFramer_ChannelAccess(), XFramer_ChannelUpdate(), XFramer_ReadReg, and XFramer_WriteReg.

Referenced by XFramer_ChannelConfig().