Data Structures | Macros | Typedefs | Enumerations | Functions
cpsw_ale.h File Reference

This file contains the structure definitions and function prototypes of the Address Lookup Engine (ALE). More...

#include "cpsw_types.h"

Data Structures

struct  CpswAle_MacAddrInfo_s
 Structure holding MAC address and VLAN Id. More...
 
struct  CpswAle_Ipv4EntryInfo_s
 IPv4 ALE entry info. More...
 
struct  CpswAle_Ipv6EntryInfo_s
 IPv6 ALE entry info. More...
 
struct  CpswAle_McastEntryInfo_s
 ALE Multicast entry type info apart from MAC address. More...
 
struct  CpswAle_UcastEntryInfo_s
 ALE unicast entry type info apart from MAC address that can be set. More...
 
struct  CpswAle_IpAddrClassifierInfo_s
 ALE IP address classifier info. More...
 
struct  CpswAle_OuiEntryInfo_s
 ALE OUI entry info. More...
 
struct  CpswAle_EtherTypeEntryInfo_s
 ALE Ethertype entry info. More...
 
struct  CpswAle_VlanIdInfo_s
 ALE vlan identifier info. More...
 
struct  CpswAle_VlanEntryInfo_s
 ALE VLAN entry type info. More...
 
struct  CpswAle_MacSrcAddrClassifierInfo_s
 ALE classifier/policer match parameters for srcMacAddr. More...
 
struct  CpswAle_MacDstAddrClassifierInfo_s
 ALE classifier/policer match parameters for dstMacAddr. More...
 
struct  CpswAle_PolicerMatchParams_s
 ALE Classifier/Policer Match parameters. More...
 
struct  CpswAle_HostRxFilterParams_s
 Host port receive packet type filter params. More...
 
struct  CpswAle_MirrorMatchParams_s
 ALE port mirroring configration for mirroring based on packet match. More...
 
struct  CpswAle_PortBcastMcastRateLimitParams_s
 Structure for bcast/mcast bw limit configuration parameters. More...
 
struct  CpswAle_UnregulatedTrafficPolicer_s
 Structure containing unregulated traffic (No classifier hit) policing params. More...
 
struct  CpswAle_AddEntryOutArgs_s
 Output args for IOCTL cmds that add ALE entry, such as: CPSW_ALE_IOCTL_ADD_UNICAST, CPSW_ALE_IOCTL_ADD_VLAN, CPSW_ALE_IOCTL_ADD_ETHERTYPE, CPSW_ALE_IOCTL_ADD_IPV4ADDR, CPSW_ALE_IOCTL_ADD_IPV6ADDR, CPSW_ALE_IOCTL_ADD_OUI, CPSW_ALE_IOCTL_ADD_MULTICAST. More...
 
struct  CpswAle_SetUcastEntryInArgs_s
 Input args for CPSW_ALE_IOCTL_ADD_UNICAST IOCTL command. More...
 
struct  CpswAle_GetUcastEntryOutArgs_s
 Output args for CPSW_ALE_IOCTL_LOOKUP_UNICAST IOCTL command. More...
 
struct  CpswAle_SetMcastEntryInArgs_s
 Output args for CPSW_ALE_IOCTL_ADD_MULTICAST IOCTL command. More...
 
struct  CpswAle_GetMcastEntryInArgs_s
 Input args for CPSW_ALE_IOCTL_LOOKUP_MULTICAST IOCTL command. More...
 
struct  CpswAle_GetMcastEntryOutArgs_s
 Output args for CPSW_ALE_IOCTL_LOOKUP_MULTICAST IOCTL command. More...
 
struct  CpswAle_GetVlanEntryOutArgs_s
 Output args for CPSW_ALE_IOCTL_LOOKUP_MULTICAST IOCTL command. More...
 
struct  CpswAle_SetPolicerEntryInArgs_s
 Input args for CPSW_ALE_IOCTL_SET_POLICER command. More...
 
struct  CpswAle_SetPolicerEntryOutArgs_s
 Input args for CPSW_ALE_IOCTL_SET_POLICER command. More...
 
struct  CpswAle_GetPolicerEntryOutArgs_s
 Output args for CPSW_ALE_IOCTL_GET_POLICER command. More...
 
struct  CpswAle_DelPolicerEntryInArgs_s
 Input args for CPSW_ALE_IOCTL_DEL_POLICER IOCTL command. More...
 
struct  CpswAle_SetOAMLoopbackInArgs_s
 Input args for CPSW_ALE_IOCTL_SET_OAMLPBK_CFG IOCTL command. More...
 
struct  CpswAle_SetPortStateInArgs_s
 Input args for CPSW_ALE_IOCTL_SET_PORT_STATE IOCTL command. More...
 
struct  CpswAle_GetPortStateInArgs_s
 Input args for CPSW_ALE_IOCTL_GET_PORT_STATE IOCTL command. More...
 
struct  CpswAle_GetPortStateOutArgs_s
 Output args for CPSW_ALE_IOCTL_GET_PORT_STATE IOCTL command. More...
 
struct  CpswAle_SetPortMirroringConfigInArgs_s
 Input args for CPSW_ALE_IOCTL_SET_PORT_MIRROR_CFG command. More...
 
struct  CpswAle_SetTrunkConfigInArgs_s
 Input args for CPSW_ALE_IOCTL_SET_TRUNK_CFG command. More...
 
struct  CpswAle_SetDefaultThreadConfigInArgs_s
 Input args for CPSW_ALE_IOCTL_SET_DEFAULT_THREADCFG IOCTL command. More...
 
struct  CpswAle_SetInterVLANConfigInArgs_s
 Output args for CPSW_ALE_IOCTL_SET_DEFAULT_THREADCFG IOCTL command. More...
 
struct  CpswAle_GetPolicerStatsInArgs_s
 Input args for CPSW_ALE_IOCTL_GET_POLICER_STATS IOCTL command. More...
 
struct  CpswAle_GetPolicerStatsOutArgs_s
 Output args for CPSW_ALE_IOCTL_GET_POLICER_STATS IOCTL command. More...
 
struct  CpswAle_SetBcastMcastRateLimitInArgs_s
 Input args for CPSW_ALE_IOCTL_SET_BCAST_MCAST_LIMIT IOCTL command. More...
 
struct  CpswAle_GetBcastMcastRateLimitOutArgs_s
 Output args for CPSW_ALE_IOCTL_GET_BCAST_MCAST_LIMIT IOCTL command. More...
 
struct  CpswAle_GetPortMacAddrInArgs_s
 Input args for CPSW_ALE_IOCTL_GET_PORT_MACADDR IOCTL command. More...
 
struct  CpswAle_GetPortMacAddrOutArgs_s
 Output args for CPSW_ALE_IOCTL_GET_PORT_MACADDR IOCTL command. More...
 
struct  CpswAle_DelLearntEntriesInArgs_s
 Input args for CPSW_ALE_IOCTL_DEL_LEARNT_ENTRIES command. More...
 
struct  CpswAle_SetPolicerThreadConfigInArgs_s
 Input args for CPSW_ALE_IOCTL_SET_POLICER_THREADCFG command. More...
 
struct  CpswAle_PolicerGlobalConfig_s
 Structure for policer global configuration parameters. More...
 
struct  CpswAle_AgingConfig_s
 Structure for ALE aging time configuration. More...
 
struct  CpswAle_InitVlanConfig_s
 Structure for Init time VLAN configuration. More...
 
struct  CpswAle_PortMacModeConfig_s
 Structure for port MAC mode configuration. More...
 
struct  CpswAle_MacAuthConfig_s
 Structure for MAC authentication configuration. More...
 
struct  CpswAle_PortVlanSecurityConfig_s
 Structure for Port specific VLAN security configuration. More...
 
struct  CpswAle_PortLearningSecurityConfig_s
 Structure for Port specific auto learning security configuration. More...
 
struct  CpswAle_IPPktSecurityConfig_s
 Structure for IP packet security configuration. More...
 
struct  CpswAle_MalformedPktSecurityConfig_s
 Structure for malformed packet handling configuration. More...
 
struct  CpswAle_LearningSecurityConfig_s
 Structure for ALE module level auto learning security configuration. More...
 
struct  CpswAle_NetworkSecurityConfig_s
 High level structure with ALE network security configuration. More...
 
struct  CpswAle_PortConfig_s
 ALE init time port specific configuration params. More...
 
struct  CpswAle_Config_s
 ALE configuration. More...
 
struct  CpswAle_RestartConfig_s
 ALE restore configuration. More...
 

Macros

#define CPSW_ALE_NUM_PORTS   ((uint32_t)9)
 Number of switch ports in the subsystem.
 
#define CPSW_ALE_NUM_MAC_PORTS   (CPSW_ALE_NUM_PORTS - 1U)
 Number of external ports in the subsystem.
 
#define CPSW_ALE_MAX_WHITELIST_IP_NXT_HDR   (4U)
 Maximum IP next header whilelist.
 
#define CPSW_ALE_ALL_PORTS_MASK   ((1U << CPSW_ALE_NUM_PORTS) - 1U)
 Mask value for the all the PORTS.
 
#define CPSW_ALE_ALL_MACPORTS_MASK   (((1U << CPSW_ALE_NUM_PORTS) - 1U) - 1U)
 Mask value for the all MAC PORTS.
 
#define CPSW_ALE_HOST_PORT_MASK   (0x1U)
 Mask value for the host PORT.
 
#define CPSW_ALE_HOST_PORT_NUM   (0x0U)
 Port number for the host PORT.
 
#define CPSW_ALE_MCAST_IGN_BITS_MAX   (10U)
 Maximum number of ignore bits in multicast address.
 
#define CPSW_ALE_MACADDR_NUM_OCTETS   (CPSW_MAC_ADDR_LEN)
 Num of octets in MAC address.
 
#define CPSW_ALE_OUIADDR_NUM_OCTETS   (3U)
 Number of octets in OUI address.
 
#define CPSW_ALE_IPV4ADDR_NUM_OCTETS   (4U)
 Number of octets in IPV4 address.
 
#define CPSW_ALE_IPV6ADDR_NUM_OCTETS   (16U)
 Number of octets in IPV6 address.
 
#define CPSW_ALE_PEAKBITRATE_DISABLE   (0U)
 Disable peak bit rate.
 
#define CPSW_ALE_COMMITBITRATE_DISABLE   (0U)
 Disable commit bit rate.
 
#define CPSW_ALE_THREADID_INVALID   (~0U)
 ALE invalid thread id.
 
#define CPSW_ALE_MACPORT_BASE   (1U)
 Base index for MAC ports in ALE context.
 
#define CPSW_ALE_MACPORT_TO_ALEPORT(macPortNum)   (CPSW_NORMALIZE_MACPORT(macPortNum) + CPSW_ALE_MACPORT_BASE)
 Macro to convert MAC port (Cpsw_MacPort) to ALE port number.
 
#define CPSW_ALE_MACPORT_TO_PORTMASK(macPortNum)   CPSW_SET_BIT(CPSW_ALE_MACPORT_TO_ALEPORT(macPortNum))
 Macro to convert MAC port (Cpsw_MacPort) to ALE port mask.
 
#define CPSW_ALE_PUBLIC_IOCTL(x)   (CPSW_IOCTL_ALE_BASE | CPSW_IOCTL_MIN(x))
 Helper macro to create IOCTL commands for ALE submodule.
 
#define CPSW_ALE_CONFIG_MASK_ALE_MODULE_ENABLE   (CPSW_SET_BIT(0))
 Enable ALE.
 
#define CPSW_ALE_CONFIG_MASK_ALE_BYPASS_ENABLE   (CPSW_SET_BIT(1))
 
#define CPSW_ALE_CONFIG_MASK_UNKNOWN_UNICAST_FLOOD2HOST   (CPSW_SET_BIT(2))
 
ALE classifier match types

Classifier match type supported by ALE. Each type is represented by a bit To enable multiple classifiers in a single classifier entry, create bitmask ORing required classifier match type defines

#define CPSW_ALE_POLICER_MATCH_PORT   (CPSW_SET_BIT(0U))
 
#define CPSW_ALE_POLICER_MATCH_PRIORITY   (CPSW_SET_BIT(1U))
 
#define CPSW_ALE_POLICER_MATCH_OUI   (CPSW_SET_BIT(2U))
 
#define CPSW_ALE_POLICER_MATCH_MACDST   (CPSW_SET_BIT(3U))
 
#define CPSW_ALE_POLICER_MATCH_MACSRC   (CPSW_SET_BIT(4U))
 
#define CPSW_ALE_POLICER_MATCH_OVLAN   (CPSW_SET_BIT(5U))
 
#define CPSW_ALE_POLICER_MATCH_IVLAN   (CPSW_SET_BIT(6U))
 
#define CPSW_ALE_POLICER_MATCH_ETHERTYPE   (CPSW_SET_BIT(7U))
 
#define CPSW_ALE_POLICER_MATCH_IPSRC   (CPSW_SET_BIT(8U))
 
#define CPSW_ALE_POLICER_MATCH_IPDST   (CPSW_SET_BIT(9U))
 
ALE classifier aleEntry delete bitmask

Associated with some classifier types are ALE table entries. When deleting the classifier entry application needs to specify by means of below bitmask if the ALE entry associated with the classifier should also be deleted. If not set the ALE entry will remain.

#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_OUI   (CPSW_ALE_POLICER_MATCH_PRIORITY)
 Delete OUI ALE table entry.
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_MACSRC   (CPSW_ALE_POLICER_MATCH_MACSRC)
 Delete MAC source address ALE table entry.
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_MACDST   (CPSW_ALE_POLICER_MATCH_MACDST)
 Delete MAC destination address ALE table entry.
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_IVLAN   (CPSW_ALE_POLICER_MATCH_IVLAN)
 Delete InnerVLAN classifier associated ALE table entry.
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_OVLAN   (CPSW_ALE_POLICER_MATCH_OVLAN)
 Delete OuterVLAN classifier associated ALE table entry.
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_ETHERTYPE   (CPSW_ALE_POLICER_MATCH_ETHERTYPE)
 Delete EtherType classifier associated ALE table entry.
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_IPSRC   (CPSW_ALE_POLICER_MATCH_IPSRC)
 Delete IPv4/IPv6 source address classifier associated ALE table entry.
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_IPDST   (CPSW_ALE_POLICER_MATCH_IPDST)
 Delete IPv4/IPv6 destination address classifier associated ALE table entry.
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_ALL
 Delete all ale entries associated with classifier entries. More...
 

Typedefs

typedef enum CPSW_ALE_IOCTL_TAG CPSW_ALE_IOCTL_E
 The ALE module IOCTL enums.
 
typedef enum CPSW_ALE_FWDSTLVL_TAG CPSW_ALE_FWDSTLVL_E
 
typedef enum
CPSW_ALE_POLICER_NOMATCH_MODE_TAG 
CPSW_ALE_POLICER_NOMATCH_MODE_E
 Policing Match Mode. More...
 
typedef enum CPSW_ALE_PORTSTATE_TAG CPSW_ALE_PORTSTATE_E
 Defines ALE port states.
 
typedef enum
CPSW_ALE_IPADDR_CLASSIFIER_TAG 
CPSW_ALE_IPADDR_CLASSIFIER_E
 Defines IP address classifier type.
 
typedef enum
CPSW_ALE_TBLENTRYTYPE_TAG 
CPSW_ALE_TBLENTRYTYPE_E
 Defines IP address classifier type.
 
typedef enum CPSW_ALE_RXFILTER_TAG CPSW_ALE_RXFILTER_E
 Packet Filtering Settings (cumulative)
 
typedef struct
CpswAle_MacAddrInfo_s 
CpswAle_MacAddrInfo
 Structure holding MAC address and VLAN Id.
 
typedef struct
CpswAle_Ipv4EntryInfo_s 
CpswAle_Ipv4EntryInfo
 IPv4 ALE entry info.
 
typedef struct
CpswAle_Ipv6EntryInfo_s 
CpswAle_Ipv6EntryInfo
 IPv6 ALE entry info.
 
typedef struct
CpswAle_McastEntryInfo_s 
CpswAle_McastEntryInfo
 ALE Multicast entry type info apart from MAC address.
 
typedef struct
CpswAle_UcastEntryInfo_s 
CpswAle_UcastEntryInfo
 ALE unicast entry type info apart from MAC address that can be set.
 
typedef struct
CpswAle_IpAddrClassifierInfo_s 
CpswAle_IpAddrClassifierInfo
 ALE IP address classifier info.
 
typedef struct
CpswAle_OuiEntryInfo_s 
CpswAle_OuiEntryInfo
 ALE OUI entry info.
 
typedef struct
CpswAle_EtherTypeEntryInfo_s 
CpswAle_EtherTypeEntryInfo
 ALE Ethertype entry info.
 
typedef struct CpswAle_VlanIdInfo_s CpswAle_VlanIdInfo
 ALE vlan identifier info.
 
typedef struct
CpswAle_VlanEntryInfo_s 
CpswAle_VlanEntryInfo
 ALE VLAN entry type info.
 
typedef struct
CpswAle_MacSrcAddrClassifierInfo_s 
CpswAle_MacSrcAddrClassifierInfo
 ALE classifier/policer match parameters for srcMacAddr.
 
typedef struct
CpswAle_MacDstAddrClassifierInfo_s 
CpswAle_MacDstAddrClassifierInfo
 ALE classifier/policer match parameters for dstMacAddr.
 
typedef struct
CpswAle_PolicerMatchParams_s 
CpswAle_PolicerMatchParams
 ALE Classifier/Policer Match parameters.
 
typedef struct
CpswAle_HostRxFilterParams_s 
CpswAle_HostRxFilterParams
 Host port receive packet type filter params.
 
typedef struct
CpswAle_MirrorMatchParams_s 
CpswAle_MirrorMatchParams
 ALE port mirroring configration for mirroring based on packet match.
 
typedef CpswAle_VlanEntryInfo CpswAle_PortVlanConfig
 Structure for port default VLAN configuration.
 
typedef struct
CpswAle_PortBcastMcastRateLimitParams_s 
CpswAle_PortBcastMcastRateLimitParams
 Structure for bcast/mcast bw limit configuration parameters.
 
typedef struct
CpswAle_UnregulatedTrafficPolicer_s 
CpswAle_UnregulatedTrafficPolicer
 Structure containing unregulated traffic (No classifier hit) policing params.
 
typedef struct
CpswAle_AddEntryOutArgs_s 
CpswAle_AddEntryOutArgs
 Output args for IOCTL cmds that add ALE entry, such as: CPSW_ALE_IOCTL_ADD_UNICAST, CPSW_ALE_IOCTL_ADD_VLAN, CPSW_ALE_IOCTL_ADD_ETHERTYPE, CPSW_ALE_IOCTL_ADD_IPV4ADDR, CPSW_ALE_IOCTL_ADD_IPV6ADDR, CPSW_ALE_IOCTL_ADD_OUI, CPSW_ALE_IOCTL_ADD_MULTICAST.
 
typedef struct
CpswAle_SetUcastEntryInArgs_s 
CpswAle_SetUcastEntryInArgs
 Input args for CPSW_ALE_IOCTL_ADD_UNICAST IOCTL command.
 
typedef struct
CpswAle_GetUcastEntryOutArgs_s 
CpswAle_GetUcastEntryOutArgs
 Output args for CPSW_ALE_IOCTL_LOOKUP_UNICAST IOCTL command.
 
typedef struct
CpswAle_SetMcastEntryInArgs_s 
CpswAle_SetMcastEntryInArgs
 Output args for CPSW_ALE_IOCTL_ADD_MULTICAST IOCTL command.
 
typedef struct
CpswAle_GetMcastEntryInArgs_s 
CpswAle_GetMcastEntryInArgs
 Input args for CPSW_ALE_IOCTL_LOOKUP_MULTICAST IOCTL command.
 
typedef struct
CpswAle_GetMcastEntryOutArgs_s 
CpswAle_GetMcastEntryOutArgs
 Output args for CPSW_ALE_IOCTL_LOOKUP_MULTICAST IOCTL command.
 
typedef struct
CpswAle_GetVlanEntryOutArgs_s 
CpswAle_GetVlanEntryOutArgs
 Output args for CPSW_ALE_IOCTL_LOOKUP_MULTICAST IOCTL command.
 
typedef struct
CpswAle_SetPolicerEntryInArgs_s 
CpswAle_SetPolicerEntryInArgs
 Input args for CPSW_ALE_IOCTL_SET_POLICER command.
 
typedef struct
CpswAle_SetPolicerEntryOutArgs_s 
CpswAle_SetPolicerEntryOutArgs
 Input args for CPSW_ALE_IOCTL_SET_POLICER command.
 
typedef struct
CpswAle_GetPolicerEntryOutArgs_s 
CpswAle_GetPolicerEntryOutArgs
 Output args for CPSW_ALE_IOCTL_GET_POLICER command.
 
typedef struct
CpswAle_DelPolicerEntryInArgs_s 
CpswAle_DelPolicerEntryInArgs
 Input args for CPSW_ALE_IOCTL_DEL_POLICER IOCTL command.
 
typedef struct
CpswAle_SetOAMLoopbackInArgs_s 
CpswAle_SetOAMLoopbackInArgs
 Input args for CPSW_ALE_IOCTL_SET_OAMLPBK_CFG IOCTL command.
 
typedef struct
CpswAle_SetPortStateInArgs_s 
CpswAle_SetPortStateInArgs
 Input args for CPSW_ALE_IOCTL_SET_PORT_STATE IOCTL command.
 
typedef struct
CpswAle_GetPortStateInArgs_s 
CpswAle_GetPortStateInArgs
 Input args for CPSW_ALE_IOCTL_GET_PORT_STATE IOCTL command.
 
typedef struct
CpswAle_GetPortStateOutArgs_s 
CpswAle_GetPortStateOutArgs
 Output args for CPSW_ALE_IOCTL_GET_PORT_STATE IOCTL command.
 
typedef struct
CpswAle_SetPortMirroringConfigInArgs_s 
CpswAle_SetPortMirroringConfigInArgs
 Input args for CPSW_ALE_IOCTL_SET_PORT_MIRROR_CFG command.
 
typedef struct
CpswAle_SetTrunkConfigInArgs_s 
CpswAle_SetTrunkConfigInArgs
 Input args for CPSW_ALE_IOCTL_SET_TRUNK_CFG command.
 
typedef struct
CpswAle_SetDefaultThreadConfigInArgs_s 
CpswAle_SetDefaultThreadConfigInArgs
 Input args for CPSW_ALE_IOCTL_SET_DEFAULT_THREADCFG IOCTL command.
 
typedef
CpswAle_SetDefaultThreadConfigInArgs 
CpswAle_GetDefaultThreadConfigOutArgs
 Output args for CPSW_ALE_IOCTL_GET_DEFAULT_THREADCFG IOCTL command.
 
typedef struct
CpswAle_SetInterVLANConfigInArgs_s 
CpswAle_SetInterVLANConfigInArgs
 Output args for CPSW_ALE_IOCTL_SET_DEFAULT_THREADCFG IOCTL command. More...
 
typedef
CpswAle_GetPolicerEntryOutArgs 
CpswAle_SetInterVLANConfigOutArgs
 Output args for CPSW_ALE_IOCTL_SET_INTERVLAN_CFG IOCTL command.
 
typedef
CpswAle_GetPolicerEntryOutArgs 
CpswAle_BlockClassifierHostPortOutArgs
 Output args for CPSW_ALE_IOCTL_BLOCK_CLASSIFIER_HOSTPORT IOCTL command.
 
typedef struct
CpswAle_GetPolicerStatsInArgs_s 
CpswAle_GetPolicerStatsInArgs
 Input args for CPSW_ALE_IOCTL_GET_POLICER_STATS IOCTL command.
 
typedef struct
CpswAle_GetPolicerStatsOutArgs_s 
CpswAle_GetPolicerStatsOutArgs
 Output args for CPSW_ALE_IOCTL_GET_POLICER_STATS IOCTL command.
 
typedef struct
CpswAle_SetBcastMcastRateLimitInArgs_s 
CpswAle_SetBcastMcastRateLimitInArgs
 Input args for CPSW_ALE_IOCTL_SET_BCAST_MCAST_LIMIT IOCTL command.
 
typedef struct
CpswAle_GetBcastMcastRateLimitOutArgs_s 
CpswAle_GetBcastMcastRateLimitOutArgs
 Output args for CPSW_ALE_IOCTL_GET_BCAST_MCAST_LIMIT IOCTL command.
 
typedef struct
CpswAle_GetPortMacAddrInArgs_s 
CpswAle_GetPortMacAddrInArgs
 Input args for CPSW_ALE_IOCTL_GET_PORT_MACADDR IOCTL command.
 
typedef struct
CpswAle_GetPortMacAddrOutArgs_s 
CpswAle_GetPortMacAddrOutArgs
 Output args for CPSW_ALE_IOCTL_GET_PORT_MACADDR IOCTL command.
 
typedef struct
CpswAle_DelLearntEntriesInArgs_s 
CpswAle_DelLearntEntriesInArgs
 Input args for CPSW_ALE_IOCTL_DEL_LEARNT_ENTRIES command.
 
typedef struct
CpswAle_SetPolicerThreadConfigInArgs_s 
CpswAle_SetPolicerThreadConfigInArgs
 Input args for CPSW_ALE_IOCTL_SET_POLICER_THREADCFG command. More...
 
typedef
CpswAle_GetPolicerEntryOutArgs 
CpswAle_SetPolicerThreadConfigOutArgs
 Output args for CPSW_ALE_IOCTL_SET_POLICER_THREADCFG IOCTL command.
 
typedef struct
CpswAle_PolicerGlobalConfig_s 
CpswAle_SetPolicerGlobalConfigInArgs
 Input args for CPSW_ALE_IOCTL_SET_POLICER_GLOBAL_CONFIG IOCTL command.
 
typedef struct
CpswAle_PolicerGlobalConfig_s 
CpswAle_GetPolicerGlobalConfigOutArgs
 Output args for CPSW_ALE_IOCTL_GET_POLICER_GLOBAL_CONFIG IOCTL command.
 
typedef struct
CpswAle_PolicerGlobalConfig_s 
CpswAle_PolicerGlobalConfig
 Structure for policer global configuration parameters.
 
typedef struct
CpswAle_AgingConfig_s 
CpswAle_AgingConfig
 Structure for ALE aging time configuration.
 
typedef struct
CpswAle_InitVlanConfig_s 
CpswAle_InitVlanConfig
 Structure for Init time VLAN configuration.
 
typedef struct
CpswAle_PortMacModeConfig_s 
CpswAle_PortMacModeConfig
 Structure for port MAC mode configuration.
 
typedef struct
CpswAle_MacAuthConfig_s 
CpswAle_MacAuthConfig
 Structure for MAC authentication configuration.
 
typedef struct
CpswAle_PortVlanSecurityConfig_s 
CpswAle_PortVlanSecurityConfig
 Structure for Port specific VLAN security configuration.
 
typedef struct
CpswAle_PortLearningSecurityConfig_s 
CpswAle_PortLearningSecurityConfig
 Structure for Port specific auto learning security configuration.
 
typedef struct
CpswAle_IPPktSecurityConfig_s 
CpswAle_IPPktSecurityConfig
 Structure for IP packet security configuration.
 
typedef struct
CpswAle_MalformedPktSecurityConfig_s 
CpswAle_MalformedPktSecurityConfig
 Structure for malformed packet handling configuration.
 
typedef struct
CpswAle_LearningSecurityConfig_s 
CpswAle_LearningSecurityConfig
 Structure for ALE module level auto learning security configuration.
 
typedef struct
CpswAle_NetworkSecurityConfig_s 
CpswAle_NetworkSecurityConfig
 High level structure with ALE network security configuration.
 
typedef struct CpswAle_PortConfig_s CpswAle_PortConfig
 ALE init time port specific configuration params.
 
typedef struct CpswAle_Config_s CpswAle_Config
 ALE configuration. More...
 
typedef struct
CpswAle_RestartConfig_s 
CpswAle_RestartConfig
 ALE restore configuration. More...
 
typedef struct CpswAle_Obj_s * CpswAle_Handle
 Opaque handle for ALE State structure.
 

Enumerations

enum  CPSW_ALE_IOCTL_TAG {
  CPSW_ALE_IOCTL_ADD_UNICAST = CPSW_ALE_PUBLIC_IOCTL(0U), CPSW_ALE_IOCTL_ADD_MULTICAST = CPSW_ALE_PUBLIC_IOCTL(1U), CPSW_ALE_IOCTL_ADD_VLAN = CPSW_ALE_PUBLIC_IOCTL(2U), CPSW_ALE_IOCTL_ADD_OUI = CPSW_ALE_PUBLIC_IOCTL(3U),
  CPSW_ALE_IOCTL_ADD_IPV4ADDR = CPSW_ALE_PUBLIC_IOCTL(4U), CPSW_ALE_IOCTL_ADD_IPV6ADDR = CPSW_ALE_PUBLIC_IOCTL(5U), CPSW_ALE_IOCTL_ADD_ETHERTYPE = CPSW_ALE_PUBLIC_IOCTL(6U), CPSW_ALE_IOCTL_LOOKUP_UNICAST = CPSW_ALE_PUBLIC_IOCTL(7U),
  CPSW_ALE_IOCTL_LOOKUP_MULTICAST = CPSW_ALE_PUBLIC_IOCTL(8U), CPSW_ALE_IOCTL_LOOKUP_VLAN = CPSW_ALE_PUBLIC_IOCTL(9U), CPSW_ALE_IOCTL_REMOVE_ADDR = CPSW_ALE_PUBLIC_IOCTL(10U), CPSW_ALE_IOCTL_REMOVE_VLAN = CPSW_ALE_PUBLIC_IOCTL(11U),
  CPSW_ALE_IOCTL_REMOVE_OUI = CPSW_ALE_PUBLIC_IOCTL(12U), CPSW_ALE_IOCTL_REMOVE_IPV4ADDR = CPSW_ALE_PUBLIC_IOCTL(13U), CPSW_ALE_IOCTL_REMOVE_IPV6ADDR = CPSW_ALE_PUBLIC_IOCTL(14U), CPSW_ALE_IOCTL_REMOVE_ETHERTYPE = CPSW_ALE_PUBLIC_IOCTL(15U),
  CPSW_ALE_IOCTL_SET_POLICER = CPSW_ALE_PUBLIC_IOCTL(16U), CPSW_ALE_IOCTL_GET_POLICER = CPSW_ALE_PUBLIC_IOCTL(17U), CPSW_ALE_IOCTL_DEL_POLICER = CPSW_ALE_PUBLIC_IOCTL(18U), CPSW_ALE_IOCTL_DUMP_TABLE = CPSW_ALE_PUBLIC_IOCTL(19U),
  CPSW_ALE_IOCTL_DUMP_POLICER_ENTRIES = CPSW_ALE_PUBLIC_IOCTL(20U), CPSW_ALE_IOCTL_GET_POLICER_STATS = CPSW_ALE_PUBLIC_IOCTL(21U), CPSW_ALE_IOCTL_SET_PORT_MIRROR_CFG = CPSW_ALE_PUBLIC_IOCTL(22U), CPSW_ALE_IOCTL_SET_TRUNK_CFG = CPSW_ALE_PUBLIC_IOCTL(23U),
  CPSW_ALE_IOCTL_SET_OAMLPBK_CFG = CPSW_ALE_PUBLIC_IOCTL(24U), CPSW_ALE_IOCTL_DEL_ALL_ENTRIES = CPSW_ALE_PUBLIC_IOCTL(25U), CPSW_ALE_IOCTL_SET_RX_FILTER = CPSW_ALE_PUBLIC_IOCTL(26U), CPSW_ALE_IOCTL_GET_RX_FILTER = CPSW_ALE_PUBLIC_IOCTL(27U),
  CPSW_ALE_IOCTL_SET_PORT_STATE = CPSW_ALE_PUBLIC_IOCTL(28U), CPSW_ALE_IOCTL_SET_BCAST_MCAST_LIMIT = CPSW_ALE_PUBLIC_IOCTL(29U), CPSW_ALE_IOCTL_SET_DEFAULT_THREADCFG = CPSW_ALE_PUBLIC_IOCTL(30U), CPSW_ALE_IOCTL_AGE_ALE_ENTRIES = CPSW_ALE_PUBLIC_IOCTL(31U),
  CPSW_ALE_IOCTL_SET_INTERVLAN_CFG = CPSW_ALE_PUBLIC_IOCTL(32U), CPSW_ALE_IOCTL_GET_INTERVLAN_CFG = CPSW_ALE_PUBLIC_IOCTL(33U), CPSW_ALE_IOCTL_DEL_LEARNT_ENTRIES = CPSW_ALE_PUBLIC_IOCTL(34U), CPSW_ALE_IOCTL_SET_POLICER_THREADCFG = CPSW_ALE_PUBLIC_IOCTL(35U),
  CPSW_ALE_IOCTL_GET_PORT_MACADDR = CPSW_ALE_PUBLIC_IOCTL(36U), CPSW_ALE_IOCTL_DISABLE_PORT_MIRROR = CPSW_ALE_PUBLIC_IOCTL(37U), CPSW_ALE_IOCTL_DISABLE_BCAST_MCAST_LIMIT = CPSW_ALE_PUBLIC_IOCTL(38U), CPSW_ALE_IOCTL_SET_POLICER_GLOBAL_CONFIG = CPSW_ALE_PUBLIC_IOCTL(39U),
  CPSW_ALE_IOCTL_GET_BCAST_MCAST_LIMIT = CPSW_ALE_PUBLIC_IOCTL(40U), CPSW_ALE_IOCTL_GET_PORT_STATE = CPSW_ALE_PUBLIC_IOCTL(41U), CPSW_ALE_IOCTL_GET_DEFAULT_THREADCFG = CPSW_ALE_PUBLIC_IOCTL(42U), CPSW_ALE_IOCTL_PRINT_REGS = CPSW_ALE_PUBLIC_IOCTL(43U),
  CPSW_ALE_IOCTL_GET_POLICER_GLOBAL_CONFIG = CPSW_ALE_PUBLIC_IOCTL(44U), CPSW_ALE_IOCTL_DEL_ALL_POLICER_THREADID = CPSW_ALE_PUBLIC_IOCTL(45U), CPSW_ALE_IOCTL_BLOCK_CLASSIFIER_HOSTPORT = CPSW_ALE_PUBLIC_IOCTL(46U)
}
 The ALE module IOCTL enums. More...
 
enum  CPSW_ALE_FWDSTLVL_TAG { CPSW_ALE_FWDSTLVL_FORWARDING = 0, CPSW_ALE_FWDSTLVL_BLK_FWD_LRN = 1, CPSW_ALE_FWDSTLVL_FWD_LRN = 2 }
 
enum  CPSW_ALE_POLICER_YELLOWTHRESH_E {
  CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_100, CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_50, CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_33, CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_25,
  CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_20, CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_17, CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_14, CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_13
}
 Yellow Threshold Value. More...
 
enum  CPSW_ALE_POLICER_NOMATCH_MODE_TAG { CPSW_ALE_POLICER_NOMATCH_MODE_GREEN, CPSW_ALE_POLICER_NOMATCH_MODE_YELLOW, CPSW_ALE_POLICER_NOMATCH_MODE_RED, CPSW_ALE_POLICER_NOMATCH_MODE_UNREGULATED_TRAFFIC_POLICER }
 Policing Match Mode. More...
 
enum  CPSW_ALE_PORTSTATE_TAG { CPSW_ALE_PORTSTATE_DISABLED = 0, CPSW_ALE_PORTSTATE_BLOCKED, CPSW_ALE_PORTSTATE_LEARN, CPSW_ALE_PORTSTATE_FORWARD }
 Defines ALE port states. More...
 
enum  CPSW_ALE_IPADDR_CLASSIFIER_TAG { CPSW_ALE_IPADDR_CLASSIFIER_IPV4 = 0x00U, CPSW_ALE_IPADDR_CLASSIFIER_IPV6 = 0x01U }
 Defines IP address classifier type. More...
 
enum  CPSW_ALE_TBLENTRYTYPE_TAG {
  CPSW_ALE_TBLENTRYTYPE_ADDR, CPSW_ALE_TBLENTRYTYPE_VLAN, CPSW_ALE_TBLENTRYTYPE_ETHERTYPE, CPSW_ALE_TBLENTRYTYPE_OUI,
  CPSW_ALE_TBLENTRYTYPE_IPV4, CPSW_ALE_TBLENTRYTYPE_IPV6
}
 Defines IP address classifier type. More...
 
enum  CPSW_ALE_RXFILTER_TAG {
  CPSW_ALE_RXFILTER_NOTHING = 0x0000U, CPSW_ALE_RXFILTER_DIRECT = 0x0001U, CPSW_ALE_RXFILTER_BROADCAST = 0x0002U, CPSW_ALE_RXFILTER_MULTICAST = 0x0003U,
  CPSW_ALE_RXFILTER_ALLMULTICAST = 0x0004U, CPSW_ALE_RXFILTER_ALL = 0x0005U
}
 Packet Filtering Settings (cumulative) More...
 

Functions

void CpswAle_initParams (CpswAle_Config *pALEConfig)
 Initialize ALE configuration parameters. More...
 
CpswAle_Handle CpswAle_open (Cpsw_Type cpswType, const CpswAle_Config *pALEConfig)
 ALE open configuration. More...
 
int32_t CpswAle_close (CpswAle_Handle hAle)
 ALE close configuration. More...
 
int32_t CpswAle_ioctl (CpswAle_Handle hAle, CPSW_ALE_IOCTL_E cmd, Cpsw_IoctlPrms *prms)
 ALE IOCTL configuration. More...
 
CpswAle_Handle CpswAle_getHandle (Cpsw_Type cpswType)
 Get ALE handle to already opened ALE instance. More...
 
CpswAle_Handle CpswAle_restart (CpswAle_RestartConfig *pALERestartConfig)
 Restore ALE submodule driver after domain reboot. More...
 

Detailed Description

This file contains the structure definitions and function prototypes of the Address Lookup Engine (ALE).

Function Documentation

int32_t CpswAle_close ( CpswAle_Handle  hAle)

ALE close configuration.

Closes ALE.

Parameters
hAle[IN] CPSW ALE opaque handle
Returns
Cpsw_ErrorCodes
CpswAle_Handle CpswAle_getHandle ( Cpsw_Type  cpswType)

Get ALE handle to already opened ALE instance.

Gets the ALE opaque handle to an already opened ALE instance.

Parameters
cpswType[IN] CPSW instance type
Returns
CPSW ALE opaque handle
void CpswAle_initParams ( CpswAle_Config pALEConfig)

Initialize ALE configuration parameters.

Initializes ALE configuratiobn parameters with default values

Parameters
pALEConfig[IN] ALE configuration to be initialized
int32_t CpswAle_ioctl ( CpswAle_Handle  hAle,
CPSW_ALE_IOCTL_E  cmd,
Cpsw_IoctlPrms prms 
)

ALE IOCTL configuration.

Issues a control operation on the CPSW ALE submodule.

Parameters
hAle[IN] CPSW ALE opaque handle
cmd[IN] IOCTL command Id
prms[IN] IOCTL parameters
Returns
Cpsw_ErrorCodes
CpswAle_Handle CpswAle_open ( Cpsw_Type  cpswType,
const CpswAle_Config pALEConfig 
)

ALE open configuration.

Opens CPSW ALE.

Parameters
cpswType[IN] CPSW instance type
pALEConfig[IN] ALE config parameters
Returns
CPSW ALE opaque handle
CpswAle_Handle CpswAle_restart ( CpswAle_RestartConfig pALERestartConfig)

Restore ALE submodule driver after domain reboot.

ALE API to restore ALE software state after Main domain or watch dog reboot. The ALE register contents are retained due to CPSW IP reset isolation feature. The host port is disengaged and all software context is lost

Parameters
pALERestartConfig[IN] ALE restart configuration parameters
Returns
CPSW ALE opaque handle

Copyright 2020, Texas Instruments Incorporated