ETHFW API Guide
rpmsg-kdrv-transport-ethswitch.h File Reference

Go to the source code of this file.

Data Structures

struct  rpmsg_kdrv_ethswitch_message_header
 
struct  rpmsg_kdrv_ethswitch_common_request_info
 
struct  rpmsg_kdrv_ethswitch_common_response_info
 
struct  rpmsg_kdrv_ethswitch_attach_request
 
struct  rpmsg_kdrv_ethswitch_attach_response
 
struct  rpmsg_kdrv_ethswitch_attach_extended_request
 
struct  rpmsg_kdrv_ethswitch_attach_extended_response
 
struct  rpmsg_kdrv_ethswitch_alloc_request
 Alloc request CMD params. More...
 
struct  rpmsg_kdrv_ethswitch_alloc_rx_response
 Alloc request CMD params. More...
 
struct  rpmsg_kdrv_ethswitch_alloc_tx_response
 Alloc Tx channel CMD response msg. More...
 
struct  rpmsg_kdrv_ethswitch_alloc_mac_response
 Alloc MAC CMD response msg. More...
 
struct  rpmsg_kdrv_ethswitch_register_rx_default_request
 Register Rx Default flow CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_register_rx_default_response
 Register Rx Default flow CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_register_mac_request
 Register MAC address CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_register_mac_response
 Register MAC address CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_unregister_mac_request
 UnRegister MAC address CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_unregister_mac_response
 UnRegister MAC address CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_free_mac_request
 Free MAC address CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_free_mac_response
 Free MAC address CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_free_tx_request
 Free Tx Channel CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_free_tx_response
 Free Tx Channel CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_unregister_rx_default_request
 Unregister Default Flow CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_unregister_rx_default_response
 Unregister Default Flow CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_free_rx_request
 Free Rx Flow CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_free_rx_response
 Free Rx Flow CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_detach_request
 Detach CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_detach_response
 Detach CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_ioctl_request
 IOCTL CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_ioctl_response
 IOCTL CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_regwr_request
 Register Write CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_regwr_response
 Register Write CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_regrd_request
 Register Read CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_regrd_response
 Register Read CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_ipv4_register_mac_request
 Register IPv4:MAC Address mapping CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_ipv6_register_mac_request
 Register IPv6:MAC Address mapping CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_ipv4_register_mac_response
 Register IPv4:MAC Address mapping CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_ipv6_register_mac_response
 Register IPv6:MAC Address mapping CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_ipv4_unregister_mac_request
 Unregister IPv4:MAC Address mapping CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_ipv6_unregister_mac_request
 Unregister IPv6:MAC Address mapping CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_ipv4_unregister_mac_response
 Unregister IPv4:MAC Address mapping CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_ipv6_unregister_mac_response
 Unregister IPv6:MAC Address mapping CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_register_ethertype_request
 Register Ethertype CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_register_ethertype_response
 Register Ethertype CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_unregister_ethertype_request
 UnRegister Ethertype CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_unregister_ethertype_response
 UnRegister Ethertype CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_register_remotetimer_request
 Register Remote timer CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_register_remotetimer_response
 Register Remote timer CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_unregister_remotetimer_request
 UnRegister Remote timer CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_unregister_remotetimer_response
 UnRegister Remote timer CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_set_promisc_mode_request
 Set promiscuous mode CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_set_promisc_mode_response
 Set promiscuous mode CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_filter_add_mac_request
 Add multicast MAC address to receive filter CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_filter_add_mac_response
 Add multicast MAC address to receive filter CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_filter_del_mac_request
 Delete multicast MAC address from receive filter CMD request params. More...
 
struct  rpmsg_kdrv_ethswitch_filter_del_mac_response
 Delete multicast MAC address from receive filter CMD response params. More...
 
struct  rpmsg_kdrv_ethswitch_firmware_version_info
 Firmware version info returned by remote device attach to the ethernet switch device. More...
 
struct  rpmsg_kdrv_ethswitch_device_data
 Ethernet Switch Remote Device Data. More...
 
struct  rpmsg_kdrv_ethswitch_ping_request
 Ethernet Switch Remote Device Ping Request. More...
 
struct  rpmsg_kdrv_ethswitch_ping_response
 Ethernet Switch Remote Device Ping Response. More...
 
struct  rpmsg_kdrv_ethswitch_s2c_notify
 Ethernet Switch Remote Device Server to Client Notify. More...
 
struct  rpmsg_kdrv_ethswitch_c2s_notify
 Ethernet Switch Remote Device Client to Server Notify. More...
 

Macros

#define RPMSG_KDRV_TP_ETHSWITCH_MESSAGE_DATA_LEN   (192)
 
#define RPMSG_KDRV_TP_ETHSWITCH_IOCTL_INARGS_LEN   (192)
 
#define RPMSG_KDRV_TP_ETHSWITCH_IOCTL_OUTARGS_LEN   (192)
 
#define RPMSG_KDRV_TP_ETHSWITCH_CPSW_PRIORITY_NUM   (8)
 
#define RPMSG_KDRV_TP_ETHSWITCH_MACADDRLEN   (6)
 
#define RPMSG_KDRV_TP_ETHSWITCH_IPV4ADDRLEN   (4)
 
#define RPMSG_KDRV_TP_ETHSWITCH_IPV6ADDRLEN   (16)
 
#define RPMSG_KDRV_TP_ETHSWITCH_VLAN_USE_DFLT   (0xFFFF)
 
#define RPMSG_KDRV_TP_ETHSWITCH_YEARLEN   (4)
 
#define RPMSG_KDRV_TP_ETHSWITCH_MONTHLEN   (3)
 
#define RPMSG_KDRV_TP_ETHSWITCH_DATELEN   (2)
 
#define RPMSG_KDRV_TP_ETHSWITCH_COMMITSHALEN   (8)
 
Ethernet Switch Remote Device Version Info

API version info for the ethernet switch remote device Any remote core client should check API version is compatible with this API version

#define RPMSG_KDRV_TP_ETHSWITCH_VERSION_MAJOR   (0)
 
#define RPMSG_KDRV_TP_ETHSWITCH_VERSION_MINOR   (2)
 
#define RPMSG_KDRV_TP_ETHSWITCH_VERSION_REVISION   (0)
 
Ethernet Switch Remote Device CMD response code
#define RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OK   (0)
 
#define RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EAGAIN   (-1)
 
#define RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAIL   (-2)
 
#define RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EACCESS   (-3)
 
Ethernet Switch Remote Device CPSW IP Supported Feature Bitmask
#define RPMSG_KDRV_TP_ETHSWITCH_FEATURE_TXCSUM   (1 << 0)
 
#define RPMSG_KDRV_TP_ETHSWITCH_FEATURE_MAC_ONLY   (1 << 2)
 
#define RPMSG_KDRV_TP_ETHSWITCH_FEATURE_MC_FILTER   (1 << 3)
 

Enumerations

enum  rpmsg_kdrv_ethswitch_message_type {
  RPMSG_KDRV_TP_ETHSWITCH_ATTACH = 0x00, RPMSG_KDRV_TP_ETHSWITCH_ATTACH_EXT = 0x01, RPMSG_KDRV_TP_ETHSWITCH_ALLOC_TX = 0x02, RPMSG_KDRV_TP_ETHSWITCH_ALLOC_RX = 0x03,
  RPMSG_KDRV_TP_ETHSWITCH_REGISTER_DEFAULTFLOW = 0x04, RPMSG_KDRV_TP_ETHSWITCH_ALLOC_MAC = 0x05, RPMSG_KDRV_TP_ETHSWITCH_REGISTER_MAC = 0x06, RPMSG_KDRV_TP_ETHSWITCH_UNREGISTER_MAC = 0x07,
  RPMSG_KDRV_TP_ETHSWITCH_UNREGISTER_DEFAULTFLOW = 0x08, RPMSG_KDRV_TP_ETHSWITCH_FREE_MAC = 0x09, RPMSG_KDRV_TP_ETHSWITCH_FREE_TX = 0x0A, RPMSG_KDRV_TP_ETHSWITCH_FREE_RX = 0x0B,
  RPMSG_KDRV_TP_ETHSWITCH_DETACH = 0x0C, RPMSG_KDRV_TP_ETHSWITCH_IOCTL = 0x0D, RPMSG_KDRV_TP_ETHSWITCH_REGWR = 0x0E, RPMSG_KDRV_TP_ETHSWITCH_REGRD = 0x0F,
  RPMSG_KDRV_TP_ETHSWITCH_IPV4_MAC_REGISTER = 0x10, RPMSG_KDRV_TP_ETHSWITCH_IPV6_MAC_REGISTER = 0x11, RPMSG_KDRV_TP_ETHSWITCH_IPV4_MAC_UNREGISTER = 0x12, RPMSG_KDRV_TP_ETHSWITCH_IPV6_MAC_UNREGISTER = 0x13,
  RPMSG_KDRV_TP_ETHSWITCH_PING_REQUEST = 0x14, RPMSG_KDRV_TP_ETHSWITCH_S2C_NOTIFY = 0x15, RPMSG_KDRV_TP_ETHSWITCH_C2S_NOTIFY = 0x16, RPMSG_KDRV_TP_ETHSWITCH_REGISTER_ETHTYPE = 0x17,
  RPMSG_KDRV_TP_ETHSWITCH_UNREGISTER_ETHTYPE = 0x18, RPMSG_KDRV_TP_ETHSWITCH_REGISTER_REMOTEIMER = 0x19, RPMSG_KDRV_TP_ETHSWITCH_UNREGISTER_REMOTEIMER = 0x1A, RPMSG_KDRV_TP_ETHSWITCH_SET_PROMISC_MODE = 0x1B,
  RPMSG_KDRV_TP_ETHSWITCH_FILTER_ADD_MAC = 0x1C, RPMSG_KDRV_TP_ETHSWITCH_FILTER_DEL_MAC = 0x1D, RPMSG_KDRV_TP_ETHSWITCH_MAX = 0x1E
}
 Ethernet Switch Remote Device commands. More...
 
enum  rpmsg_kdrv_ethswitch_cpsw_type { RPMSG_KDRV_TP_ETHSWITCH_CPSWTYPE_MCU, RPMSG_KDRV_TP_ETHSWITCH_CPSWTYPE_MAIN, RPMSG_KDRV_TP_ETHSWITCH_CPSWTYPE_MAX }
 CPSW Type supported by Ethernet Switch Remote Device. More...
 
enum  rpmsg_kdrv_ethswitch_client_notify_type { RPMSG_KDRV_TP_ETHSWITCH_CLIENTNOTIFY_DUMPSTATS, RPMSG_KDRV_TP_ETHSWITCH_CLIENTNOTIFY_CUSTOM, RPMSG_KDRV_TP_ETHSWITCH_CLIENTNOTIFY_MAX }
 Etheret Remote Device Client to Server notify types. More...
 

Functions

struct rpmsg_kdrv_ethswitch_message_header __attribute__ ((packed))
 

Variables

u8 message_type
 
u64 id
 
u32 core_key
 
s32 status
 
struct rpmsg_kdrv_ethswitch_message_header header
 
u8 cpsw_type
 
struct rpmsg_kdrv_ethswitch_common_response_info info
 
u32 rx_mtu
 
u32 tx_mtu [RPMSG_KDRV_TP_ETHSWITCH_CPSW_PRIORITY_NUM]
 
u32 features
 
u32 mac_only_port
 
u32 alloc_flow_idx
 
u32 tx_cpsw_psil_dst_id
 
u8 mac_address [RPMSG_KDRV_TP_ETHSWITCH_MACADDRLEN]
 
u32 default_flow_idx
 
u32 flow_idx
 
u32 cmd
 
u32 inargs_len
 
u8 inargs [RPMSG_KDRV_TP_ETHSWITCH_IOCTL_INARGS_LEN]
 
u32 outargs_len
 
u8 outargs [RPMSG_KDRV_TP_ETHSWITCH_IOCTL_OUTARGS_LEN]
 
u32 regaddr
 
u32 regval
 
uint8_t ipv4_addr [RPMSG_KDRV_TP_ETHSWITCH_IPV4ADDRLEN]
 
uint8_t ipv6_addr [RPMSG_KDRV_TP_ETHSWITCH_IPV6ADDRLEN]
 
u16 ether_type
 
u8 timer_id
 
u8 hwPushNum
 
u32 enable
 
u16 vlan_id
 
u32 major
 
u32 minor
 
u32 rev
 
char year [RPMSG_KDRV_TP_ETHSWITCH_YEARLEN]
 
char month [RPMSG_KDRV_TP_ETHSWITCH_MONTHLEN]
 
char date [RPMSG_KDRV_TP_ETHSWITCH_DATELEN]
 
char commit_hash [RPMSG_KDRV_TP_ETHSWITCH_COMMITSHALEN]
 
struct rpmsg_kdrv_ethswitch_firmware_version_info fw_ver
 
u32 permission_flags
 
u32 uart_connected
 
u32 uart_id
 
u8 data [RPMSG_KDRV_TP_ETHSWITCH_MESSAGE_DATA_LEN]
 
u8 notifyid
 
u32 notify_info_len
 
u8 notify_info [RPMSG_KDRV_TP_ETHSWITCH_MESSAGE_DATA_LEN]
 

Variable Documentation

◆ message_type

u8 message_type

Message Type enum: rpmsg_kdrv_ethswitch_message_type

◆ id

u64 id

opaque unique handle returned by ATTACH

unique handle used by all further CMDs. All further commands are required to use the id as a param

unique handle used by all further CMDs

◆ core_key

u32 core_key

Core specific key returned by attach

Core specific key to indicate attached core. All further commands are required to use the core_key as a param

Core specific key to indicate attached core

◆ status

s32 status

Status of request. Refer Ethernet Switch Remote Device CMD response code

◆ header

common message header

Common CMD header

◆ cpsw_type

u8 cpsw_type

CPSW TYPE enum: rpmsg_kdrv_ethswitch_cpsw_type

◆ info

common response info

Alloc Request common info

Common info associated with all CMDs other than ATTACH

◆ rx_mtu

u32 rx_mtu

MTU of rx packet

◆ tx_mtu

u32 tx_mtu

MTU of tx packet per priority

◆ features

u32 features

Feature bitmask based on defines RPMSG_KDRV_TP_ETHSWITCH_FEATURE_xxx

◆ mac_only_port

u32 mac_only_port

1-relative MAC-only port number. 0 for non MAC-only ports

◆ alloc_flow_idx

u32 alloc_flow_idx

Allocated flow's index

Rx flow id to be freed

◆ tx_cpsw_psil_dst_id

u32 tx_cpsw_psil_dst_id

Tx PSIL Peer destination thread id which should be paired with the Tx UDMA channel

Tx Channel CPSW PSIL Destination thread id to be freed

◆ mac_address

u8 mac_address

Mac address allocated

mac address to be associated with flow

mac address to be unregistered from the rx flow

Mac address to be freed

Mac address associated with the IP address which should be added to the ARP table

Multicast MAC address to be added to receive filter

Multicast MAC address to be deleted from receive filter

◆ default_flow_idx

u32 default_flow_idx

Default flow will be associated with the given index

Default flow index to be unregistered

◆ flow_idx

u32 flow_idx

Flow's index associated with the mac address to be registered in ALE

rx flow index from which the mac_address association will be removed

Flow's index associated with the MAC address to be registered in ALE

Flow's index associated with the MAC address to be unregistered in ALE

◆ cmd

u32 cmd

CPSW IOCTL CMD id. Refer CPSW LLD documentation for list of CPSW LLD IOCTLs

◆ inargs_len

u32 inargs_len

CPSW IOCTL CMD input arguments length

◆ inargs

CPSW IOCTL CMD input arguments .Byte array is typecast to the inArgs structure associated with the IOCTL

◆ outargs_len

u32 outargs_len

CPSW IOCTL CMD output arguments length

◆ outargs

CPSW IOCTL CMD output arguments .Byte array is typecast to the outArgs structure associated with the IOCTL

◆ regaddr

u32 regaddr

Register Address

◆ regval

u32 regval

Register Value to be written

Updated register value

Register Read Value

◆ ipv4_addr

uint8_t ipv4_addr

IPv4 address

◆ ipv6_addr

uint8_t ipv6_addr

IPv6 address

◆ ether_type

u16 ether_type

Ether type to be associated with flow

Ether type to be unregistered from the rx flow

◆ timer_id

u8 timer_id

Timer id to be used for timesync router configuration

◆ hwPushNum

u8 hwPushNum

CPTS hardware push number to be used for timesync router configuration

CPTS hardware push number used for timesync router configuration

◆ enable

u32 enable

Promiscuous mode: enable or disable

◆ vlan_id

u16 vlan_id

◆ major

u32 major

Remote Ethernet Switch Device API Major version number

◆ minor

u32 minor

Remote Ethernet Switch Device API Minor version number

◆ rev

u32 rev

Remote Ethernet Switch Device API Revision version number

◆ year

Remote Ethernet Switch Device Firmware Build year : char string in the form YYYY eg: 2019

◆ month

Remote Ethernet Switch Device Firmware Build month : char string in the form MON eg: Dec

◆ date

Remote Ethernet Switch Device Firmware Build month : char string in the form DD eg: 12

◆ commit_hash

GIT commit SHA of the firmware: char string in the form fd52c34f

◆ fw_ver

Ethernet Switch Remote Device Firmware version info

◆ permission_flags

u32 permission_flags

Flag indicating permission enabled for each enum rpmsg_kdrv_ethswitch_message_type command for the connecting client

◆ uart_connected

u32 uart_connected

Flag indicating if UART is connected: 1 indicates UART connected , 0 indicates UART not connected

◆ uart_id

u32 uart_id

UART ID used by firmware for log prints

◆ data

u8 data

Ping data.Client populates this which serves copies in its reponse message

Ping data response

Notify data.Presently no S2C notify are supported . API will be updated to support S2C notify events such as PHY link down and this API param is expected to change

◆ notifyid

u8 notifyid

Notify Id. Of type enum rpmsg_kdrv_ethswitch_client_notify_type

◆ notify_info_len

u32 notify_info_len

Filled length of notify info

◆ notify_info

Notify Message data