ETHFW API Guide
Ethernet Switch Remote Device Server APIs

Introduction

This section contains APIs for Ethernet Switch Remote Device Server APIs.

The ethernet switch remote device server resides on the master core and enables clients on remote cores to configure the Ethernet Switch

Data Structures

struct  rdevEthSwitchServerInstPrm_t
 Ethernet Switch Remote device server instance initialization parameters. More...
 
struct  rdevEthSwitchServerCbFxn_t
 Ethernet Switch Remote Device Server Callback function table. More...
 
struct  rdevEthSwitchServerInitPrm_t
 Ethernet Switch Remote device server instance initialization parameters. More...
 
union  rdevEthSwitchServerMessageList_u
 Union of all ethswitch remote device messages. Used internally in the server/client implementation. More...
 

Functions

union rdevEthSwitchServerMessageList_u __attribute__ ((packed)) rdevEthSwitchServerMessageList_t
 Union of all ethswitch remote device messages. Used internally in the server/client implementation. More...
 
static void rdevEthSwitchServerInitPrmSetDefault (rdevEthSwitchServerInitPrm_t *prm)
 Set EThernet Switch Remote Server init parameters to default state. More...
 
int32_t rdevEthSwitchServerInit (rdevEthSwitchServerInitPrm_t *prm)
 Initialize ethernet switch remote device instance. More...
 

Macros

#define ETHREMOTECFG_SERVER_MAX_NAME_LEN   (128)
 Max length of ethernet switch remote device exported name. More...
 
#define ETHREMOTECFG_SERVER_MAX_INSTANCES   (4)
 
#define ETHREMOTEDEVICE_REMOTEDEVICE_FRAMEWORK_SERVICE   "rpmsg-kdrv"
 

Ethernet Switch Remote Device Server App Callback function pointers

On recieving a ethernet switch remote device command from a remote core, the server will invoke application registered callback for each CMD

typedef int32_t(* ethrdev_srv_cb_attach_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint8_t cpsw_type, uint64_t *pId, uint32_t *pCoreKey, uint32_t *pRxMtu, uint32_t *pTxMtu, uint32_t txMtuArraySize, uint32_t *pFeatures, uint32_t *pMacOnlyPort)
 
typedef int32_t(* ethrdev_srv_cb_attach_ext_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint8_t cpsw_type, uint64_t *pId, uint32_t *pCoreKey, uint32_t *pRxMtu, uint32_t *pTxMtu, uint32_t txMtuArraySize, uint32_t *pFeatures, uint32_t *pAllocFlowIdx, uint32_t *pTxCpswPsilDstId, uint8_t *macAddress, uint32_t *pMacOnlyPort)
 
typedef int32_t(* ethrdev_srv_cb_alloc_tx_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t *pTxCpswPsilDstId)
 
typedef int32_t(* ethrdev_srv_cb_alloc_rx_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t *pAllocFlowIdx)
 
typedef int32_t(* ethrdev_srv_cb_alloc_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address)
 
typedef int32_t(* ethrdev_srv_cb_register_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address, uint32_t flow_idx)
 
typedef int32_t(* ethrdev_srv_cb_unregister_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address, uint32_t flow_idx)
 
typedef int32_t(* ethrdev_srv_cb_register_rx_default_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t flow_idx)
 
typedef int32_t(* ethrdev_srv_cb_unregister_rx_default_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t flow_idx)
 
typedef int32_t(* ethrdev_srv_cb_free_tx_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t tx_cpsw_psil_dst_id)
 
typedef int32_t(* ethrdev_srv_cb_free_rx_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t alloc_flow_idx)
 
typedef int32_t(* ethrdev_srv_cb_free_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, u8 *mac_address)
 
typedef int32_t(* ethrdev_srv_cb_detach_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key)
 
typedef int32_t(* ethrdev_srv_cb_ioctl_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, u32 cmd, const u8 *inargs, u32 inargs_len, u8 *outargs, uint32_t outargs_len)
 
typedef int32_t(* ethrdev_srv_cb_regwr_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint32_t regaddr, uint32_t regval, uint32_t *pRegval)
 
typedef int32_t(* ethrdev_srv_cb_regrd_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint32_t regaddr, uint32_t *pRegval)
 
typedef int32_t(* ethrdev_srv_cb_register_ipv4_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address, uint8_t *ipv4_addr)
 
typedef int32_t(* ethrdev_srv_cb_register_ipv6_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address, uint8_t *ipv6_addr)
 
typedef int32_t(* ethrdev_srv_cb_unregister_ipv4_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *ipv4_addr)
 
typedef int32_t(* ethrdev_srv_cb_unregister_ipv6_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *ipv6_addr)
 
typedef void(* ethrdev_srv_cb_client_notify_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, enum rpmsg_kdrv_ethswitch_client_notify_type notifyid, uint8_t *notify_info, uint32_t notify_info_len)
 
typedef void(* ethrdev_srv_cb_init_device_data_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, struct rpmsg_kdrv_ethswitch_device_data *eth_dev_data)
 
typedef int32_t(* ethrdev_srv_cb_register_ethertype_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint16_t ether_type, uint32_t flow_idx)
 
typedef int32_t(* ethrdev_srv_cb_unregister_ethertype_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint16_t ether_type, uint32_t flow_idx)
 
typedef int32_t(* ethrdev_srv_cb_register_remotetimer_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint8_t *name, uint64_t handle, uint32_t core_key, uint8_t timer_id, uint8_t hwPushNum)
 
typedef int32_t(* ethrdev_srv_cb_unregister_remotetimer_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint8_t *name, uint64_t handle, uint32_t core_key, uint8_t hwPushNum)
 
typedef int32_t(* ethrdev_srv_cb_set_promisc_mode_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t enable)
 
typedef int32_t(* ethrdev_srv_cb_filter_add_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address, uint16_t vlan_id, uint32_t flow_idx)
 
typedef int32_t(* ethrdev_srv_cb_filter_del_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address, uint16_t vlan_id, uint32_t flow_idx)
 

Macro Definition Documentation

◆ ETHREMOTECFG_SERVER_MAX_NAME_LEN

#define ETHREMOTECFG_SERVER_MAX_NAME_LEN   (128)

Max length of ethernet switch remote device exported name.

The Remote Device Server advertises a name to each of the remote cores it supports connecting to the server.

◆ ETHREMOTECFG_SERVER_MAX_INSTANCES

#define ETHREMOTECFG_SERVER_MAX_INSTANCES   (4)

Max number of remote clients supported by ethernet switch remote device server

◆ ETHREMOTEDEVICE_REMOTEDEVICE_FRAMEWORK_SERVICE

#define ETHREMOTEDEVICE_REMOTEDEVICE_FRAMEWORK_SERVICE   "rpmsg-kdrv"

Service name of the remote device framework

Typedef Documentation

◆ ethrdev_srv_cb_attach_handler_t

typedef int32_t(* ethrdev_srv_cb_attach_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint8_t cpsw_type, uint64_t *pId, uint32_t *pCoreKey, uint32_t *pRxMtu, uint32_t *pTxMtu, uint32_t txMtuArraySize, uint32_t *pFeatures, uint32_t *pMacOnlyPort)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_ATTACH

Parameters
virtPortVirtual port id.
host_idRemote Core Id
cpswtype CPSW TYPE of type enum rpmsg_kdrv_ethswitch_cpsw_type
pIdPointer to Unique Opaque Handle populated by callback handler
pCoreKeyPointer to Core key populated by callback handler
pRxMtuPointer to Maximum receive packet length . Populated by callback handler
pTxMtuArray of Maximum transmit packet length per priority supported by ethernet switch
txMtuArraySizeNumber of priority supported
pFeaturesPointer to feature bitmap. Bitmask of type RPMSG_KDRV_TP_ETHSWITCH_FEATURE_xxx
pMacOnlyPortMAC-only port number (1-based). 0 for non MAC only ports.
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_attach_ext_handler_t

typedef int32_t(* ethrdev_srv_cb_attach_ext_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint8_t cpsw_type, uint64_t *pId, uint32_t *pCoreKey, uint32_t *pRxMtu, uint32_t *pTxMtu, uint32_t txMtuArraySize, uint32_t *pFeatures, uint32_t *pAllocFlowIdx, uint32_t *pTxCpswPsilDstId, uint8_t *macAddress, uint32_t *pMacOnlyPort)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_ATTACH_EXT

Parameters
virtPortVirtual port id.
host_idRemote Core Id
cpswtype CPSW TYPE of type enum rpmsg_kdrv_ethswitch_cpsw_type
pIdPointer to Unique Opaque Handle populated by callback handler
pCoreKeyPointer to Core key populated by callback handler
pRxMtuPointer to Maximum receive packet length . Populated by callback handler
pTxMtuArray of Maximum transmit packet length per priority supported by ethernet switch
txMtuArraySizeNumber of priority supported
pFeaturesPointer to feature bitmap. Bitmask of type RPMSG_KDRV_TP_ETHSWITCH_FEATURE_xxx
pAllocFlowIdxPointer to allocated Rx Flow Index populated by callback handler
pTxCpswPsilDstIdPointer to allocated Tx Channel CPSW PSIL destination thread id populated by callback handler
macAddressPointer to allocated destination mac address allocated to remote core populated by callback handler
pMacOnlyPortMAC-only port number (1-based). 0 for non MAC only ports.
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_alloc_tx_handler_t

typedef int32_t(* ethrdev_srv_cb_alloc_tx_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t *pTxCpswPsilDstId)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_ALLOC_TX

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
pTxCpswPsilDstIdPointer to allocated Tx Channel CPSW PSIL destination thread id populated by callback handler
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_alloc_rx_handler_t

typedef int32_t(* ethrdev_srv_cb_alloc_rx_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t *pAllocFlowIdx)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_ALLOC_RX

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
pAllocFlowIdxPointer to allocated Rx Flow Index populated by callback handler
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_alloc_mac_handler_t

typedef int32_t(* ethrdev_srv_cb_alloc_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_ALLOC_MAC

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
macAddressPointer to allocated destination mac address allocated to remote core populated by callback handler
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_register_mac_handler_t

typedef int32_t(* ethrdev_srv_cb_register_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address, uint32_t flow_idx)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_REGISTER_MAC

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
macAddressDestination mac address to be registered
flow_idxRx Flow Index to eb associated with the destination MAC address
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_unregister_mac_handler_t

typedef int32_t(* ethrdev_srv_cb_unregister_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address, uint32_t flow_idx)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_UNREGISTER_MAC

Parameters
virtPortVirtual port id.
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
macAddressDestination mac address to be unregistered
flow_idxRx Flow Index to eb disassociated with the destination MAC address
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_register_rx_default_handler_t

typedef int32_t(* ethrdev_srv_cb_register_rx_default_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t flow_idx)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_REGISTER_DEFAULTFLOW

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
flow_idxRx Flow Index to which default flow traffic will be routed
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_unregister_rx_default_handler_t

typedef int32_t(* ethrdev_srv_cb_unregister_rx_default_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t flow_idx)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_UNREGISTER_DEFAULTFLOW

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
flow_idxRx Flow Index to which default flow mapping is to be removed.
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_free_tx_handler_t

typedef int32_t(* ethrdev_srv_cb_free_tx_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t tx_cpsw_psil_dst_id)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_FREE_TX

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
tx_cpsw_psil_dst_idAllocated Tx Channel CPSW PSIL destination thread id to be freed
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_free_rx_handler_t

typedef int32_t(* ethrdev_srv_cb_free_rx_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t alloc_flow_idx)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_FREE_RX

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
alloc_flow_idxAllocated Rx Flow Index to be freed
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_free_mac_handler_t

typedef int32_t(* ethrdev_srv_cb_free_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, u8 *mac_address)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_FREE_MAC

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
mac_addressDestination mac address to be freed
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_detach_handler_t

typedef int32_t(* ethrdev_srv_cb_detach_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_DETACH

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_ioctl_handler_t

typedef int32_t(* ethrdev_srv_cb_ioctl_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, u32 cmd, const u8 *inargs, u32 inargs_len, u8 *outargs, uint32_t outargs_len)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_IOCTL

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
cmdIOCTL id supported by CPSW LLD. Refer CPSW LLD documentation for list of CPSW LLD IOCTLs
inargsCPSW IOCTL CMD input arguments .Byte array is typecast to the inArgs structure associated with the IOCTL
inargs_lenCPSW IOCTL CMD input arguments length
outargsCPSW IOCTL CMD output arguments .Byte array is typecast to the outArgs structure associated with the IOCTL. Populated by callback handler
outargs_lenCPSW IOCTL CMD output arguments length
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_regwr_handler_t

typedef int32_t(* ethrdev_srv_cb_regwr_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint32_t regaddr, uint32_t regval, uint32_t *pRegval)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_REGWR

Parameters
virtPortVirtual port id.
host_idRemote Core Id
regaddrRegister address to be written to
regvalRegister value to be written
pRegvalPointer to register value after register write. Populated by callback handler
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_regrd_handler_t

typedef int32_t(* ethrdev_srv_cb_regrd_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint32_t regaddr, uint32_t *pRegval)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_REGRD

Parameters
virtPortVirtual port id.
host_idRemote Core Id
regaddrRegister address to be read from
pRegvalPointer to register value read from regaddr. Populated by callback handler
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_register_ipv4_mac_handler_t

typedef int32_t(* ethrdev_srv_cb_register_ipv4_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address, uint8_t *ipv4_addr)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_IPV4_MAC_REGISTER

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
mac_addressDestination mac address with which the IPv4 address will be associated in the ARP database
ipv4_addrIPv4 address to be added in the ARP database with associated MAC address
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_register_ipv6_mac_handler_t

typedef int32_t(* ethrdev_srv_cb_register_ipv6_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address, uint8_t *ipv6_addr)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_IPV6_MAC_REGISTER

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
mac_addressDestination mac address with which the IPv6 address will be associated in the ARP database
ipv6_addrIPv6 address to be added in the ARP database with associated MAC address
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_unregister_ipv4_mac_handler_t

typedef int32_t(* ethrdev_srv_cb_unregister_ipv4_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *ipv4_addr)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_IPV4_MAC_UNREGISTER

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
ipv4_addrIPv4 address to be removed from the ARP database
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_unregister_ipv6_mac_handler_t

typedef int32_t(* ethrdev_srv_cb_unregister_ipv6_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *ipv6_addr)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_IPV6_MAC_UNREGISTER

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
ipv6_addrIPv6 address to be removed from the ARP database
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_client_notify_handler_t

typedef void(* ethrdev_srv_cb_client_notify_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, enum rpmsg_kdrv_ethswitch_client_notify_type notifyid, uint8_t *notify_info, uint32_t notify_info_len)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_C2S_NOTIFY

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
notifyidClient to server notify id of type enum rpmsg_kdrv_ethswitch_client_notify_type
notify_infoNotify info associated with the notify id
notify_info_lenNotify info length

◆ ethrdev_srv_cb_init_device_data_t

typedef void(* ethrdev_srv_cb_init_device_data_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, struct rpmsg_kdrv_ethswitch_device_data *eth_dev_data)

Server Callback Handler for Remote Device Framework Device attach

Parameters
virtPortVirtual port id.
host_idRemote Core Id
eth_dev_dataEthernet Switch Remote Device Data to be populated by the callback handler

◆ ethrdev_srv_cb_register_ethertype_handler_t

typedef int32_t(* ethrdev_srv_cb_register_ethertype_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint16_t ether_type, uint32_t flow_idx)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_REGISTER_ETHTYPE

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
ether_typeEthertype to be registered
flow_idxRx Flow Index to eb associated with the destination MAC address
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_unregister_ethertype_handler_t

typedef int32_t(* ethrdev_srv_cb_unregister_ethertype_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint16_t ether_type, uint32_t flow_idx)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_UNREGISTER_ETHTYPE

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
ether_typeEthertype to be unregistered
flow_idxRx Flow Index to eb disassociated with the destination MAC address
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_register_remotetimer_handler_t

typedef int32_t(* ethrdev_srv_cb_register_remotetimer_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint8_t *name, uint64_t handle, uint32_t core_key, uint8_t timer_id, uint8_t hwPushNum)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_REGISTER_REMOTEIMER

Parameters
virtPortVirtual port id.
host_idRemote Core Id
nameRemote Core name
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
timer_idTimer to be registered with CPTS for time synchronization
hwPushNumCPTS hardware push number used for time synchronization
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_unregister_remotetimer_handler_t

typedef int32_t(* ethrdev_srv_cb_unregister_remotetimer_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint8_t *name, uint64_t handle, uint32_t core_key, uint8_t hwPushNum)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_UNREGISTER_REMOTEIMER

Parameters
virtPortVirtual port id.
host_idRemote Core Id
nameRemote Core name
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
hwPushNumCPTS hardware push number used for time synchronization
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_set_promisc_mode_handler_t

typedef int32_t(* ethrdev_srv_cb_set_promisc_mode_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint32_t enable)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_SET_PROMISC_MODE

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
enablePromiscuous mode (enable or disable)
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_filter_add_mac_handler_t

typedef int32_t(* ethrdev_srv_cb_filter_add_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address, uint16_t vlan_id, uint32_t flow_idx)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_FILTER_ADD_MAC

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
macAddressDestination mac address to be added to the receive filter
vlan_idVLAN Id
flow_idxRx Flow Index for which the multicast MAC association will be added
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

◆ ethrdev_srv_cb_filter_del_mac_handler_t

typedef int32_t(* ethrdev_srv_cb_filter_del_mac_handler_t) (EthRemoteCfg_VirtPort virtPort, uint32_t host_id, uint64_t handle, uint32_t core_key, uint8_t *mac_address, uint16_t vlan_id, uint32_t flow_idx)

Server Callback Handler for RPMSG_KDRV_TP_ETHSWITCH_FILTER_DEL_MAC

Parameters
virtPortVirtual port id.
host_idRemote Core Id
handleUnique Opaque Handle returned by attach / attach ext CMD
core_keyCore key returned by attach / attach ext CMD
macAddressDestination mac address to be deleted from the receive filter
vlan_idVLAN Id
flow_idxRx Flow Index for which the multicast MAC association will be deleted
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILError allocating response message or sending message.

Function Documentation

◆ __attribute__()

union rdevEthSwitchServerMessageList_u __attribute__ ( (packed)  )

Union of all ethswitch remote device messages. Used internally in the server/client implementation.

◆ rdevEthSwitchServerInitPrmSetDefault()

static void rdevEthSwitchServerInitPrmSetDefault ( rdevEthSwitchServerInitPrm_t *  prm)
static

Set EThernet Switch Remote Server init parameters to default state.

Recommend to call this API before callnig rdevEthSwitchServerInit.

Parameters
prm[out] Parameters set to default

◆ rdevEthSwitchServerInit()

int32_t rdevEthSwitchServerInit ( rdevEthSwitchServerInitPrm_t *  prm)

Initialize ethernet switch remote device instance.

Parameters
prm[in] Initialization parameters
Returns
0 on success, else failure