ETHFW API Guide
Ethernet Switch Remote Device Client APIs

Introduction

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

The ethernet switch remote device client resides on different remote cores. The client attach to the ethernet switch remote device server using the remote device framework Once connected to the server the client can configure the ethernet switch using the client APIs

Data Structures

struct  rdevEthSwitchClientInitPrms_t
 Ethernet Switch Remote Device Client Device Connect params. More...
 

Functions

int32_t rdevEthSwitchClient_connect (rdevEthSwitchClientInitPrms_t *initPrms)
 Connect to Ethernet Switch Remote Device. More...
 
int32_t rdevEthSwitchClient_disconnect (uint32_t device_id)
 Disconnect to Ethernet Switch Remote Device. More...
 
int32_t rdevEthSwitchClient_sendping (uint32_t device_id, char *ping_msg, uint32_t ping_len, char *respMsg, uint32_t respMaxLen)
 Send Ping to Ethernet Switch Remote Device. More...
 
int32_t rdevEthSwitchClient_ipv4macunregister (uint32_t device_id, uint64_t id, uint32_t core_key, uint8_t *ipv4_address)
 Unregister association of IPv4 address with MAC address by removing ARP entry in the master core. More...
 
int32_t rdevEthSwitchClient_ipv6macregister (uint32_t device_id, uint64_t id, uint32_t core_key, uint8_t *mac_address, uint8_t *ipv6_address)
 Register association of IPv6 address with MAC address by adding ARP entry in the master core. More...
 
int32_t rdevEthSwitchClient_ipv4macregister (uint32_t device_id, uint64_t id, uint32_t core_key, uint8_t *mac_address, uint8_t *ipv4_address)
 Register association of IPv4 address with MAC address by adding ARP entry in the master core. More...
 
int32_t rdevEthSwitchClient_regrd (uint32_t device_id, uint32_t regaddr, uint32_t *pregval)
 Register Read Function. More...
 
int32_t rdevEthSwitchClient_regwr (uint32_t device_id, uint32_t regaddr, uint32_t regval, uint32_t *post_wr_regval)
 Register Write Function. More...
 
int32_t rdevEthSwitchClient_ioctl (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t cmd, const void *inargs, uint32_t inargs_len, void *outargs, uint32_t outargs_len)
 Invoke Cpsw IOCTL. More...
 
int32_t rdevEthSwitchClient_detach (uint32_t device_id, uint64_t id, uint32_t core_key)
 Detach from Ethernet Switch Remote Device. More...
 
int32_t rdevEthSwitchClient_freerx (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t alloc_flow_idx)
 Free Rx Flow Id. More...
 
int32_t rdevEthSwitchClient_freetx (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t tx_cpsw_psil_dst_id)
 Free Tx Channel CPSW PSIL Destination thread id. More...
 
int32_t rdevEthSwitchClient_freemac (uint32_t device_id, uint64_t id, uint32_t core_key, uint8_t *mac_address)
 Free Tx Channel CPSW PSIL Destination thread id. More...
 
int32_t rdevEthSwitchClient_unregisterrxdefault (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t default_flow_idx)
 Unregister Default Flow from the given flow index. More...
 
int32_t rdevEthSwitchClient_unregistermac (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t flow_idx, uint8_t *mac_address)
 Unregister Destination MAC address from the given flow index. More...
 
int32_t rdevEthSwitchClient_registermac (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t flow_idx, uint8_t *mac_address)
 Register Destination MAC address with the given flow index. More...
 
int32_t rdevEthSwitchClient_allocmac (uint32_t device_id, uint64_t id, uint32_t core_key, uint8_t *mac_address, uint32_t mac_address_len)
 Alloc Destination MAC address. More...
 
int32_t rdevEthSwitchClient_registerrxdefault (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t default_flow_idx)
 Register Default Flow to the given flow index. More...
 
int32_t rdevEthSwitchClient_allocrx (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t *rx_flow_allocidx)
 Alloc Rx Flow Id. More...
 
int32_t rdevEthSwitchClient_alloctx (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t *tx_cpsw_psil_dst_id)
 Alloc Tx Channel CPSW PSIL Destination thread id. More...
 
int32_t rdevEthSwitchClient_attach (uint32_t device_id, uint8_t enetType, uint64_t *id, uint32_t *core_key, uint32_t *rx_mtu, uint32_t tx_mtu[], uint32_t tx_mtu_array_size, uint32_t *features, uint32_t *mac_only_port)
 Attach to Ethernet Switch Remote Device. More...
 
int32_t rdevEthSwitchClient_attachext (uint32_t device_id, uint8_t enetType, uint64_t *id, uint32_t *core_key, uint32_t *rx_mtu, uint32_t tx_mtu[], uint32_t tx_mtu_array_size, uint32_t *features, uint32_t *tx_cpsw_psil_dst_id, uint32_t *rx_flow_allocidx, uint8_t *mac_address, uint32_t mac_address_len, uint32_t *mac_only_port)
 Attach to Ethernet Switch Remote Device with extended response. More...
 
int32_t rdevEthSwitchClient_sendNotify (uint32_t device_id, u64 id, u32 core_key, enum rpmsg_kdrv_ethswitch_client_notify_type notify_id, uint8_t *notify_info, uint32_t notify_info_len)
 Send Notify From Client to server. More...
 
uint32_t rdevEthSwitchClient_printText (void *priv, void *data)
 Remote Device Framework print function callback. More...
 
int32_t rdevEthSwitchClient_registerethtype (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t flow_idx, uint16_t ether_type)
 Register Ethertype with the given flow index. More...
 
int32_t rdevEthSwitchClient_unregisterethtype (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t flow_idx, uint16_t ether_type)
 Unregister Ethertype from the given flow index. More...
 
int32_t rdevEthSwitchClient_registerremotetimer (uint32_t device_id, uint64_t id, uint32_t core_key, uint8_t timerid, uint8_t hwPushNum)
 Register remote timer with CPTS using timerid. More...
 
int32_t rdevEthSwitchClient_unregisterremotetimer (uint32_t device_id, uint64_t id, uint32_t core_key, uint8_t hwPushNum)
 Unregister remote timer from CPTS using timerid. More...
 
int32_t rdevEthSwitchClient_setPromiscMode (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t enable)
 Set promiscuous mode. More...
 
int32_t rdevEthSwitchClient_filterAddMac (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t flow_idx, uint8_t *mac_address, uint16_t vlan_id)
 Add multicast address to receive filter. More...
 
int32_t rdevEthSwitchClient_filterDelMac (uint32_t device_id, uint64_t id, uint32_t core_key, uint32_t flow_idx, uint8_t *mac_address, uint16_t vlan_id)
 Delete multicast address from receive filter. More...
 

Function Documentation

◆ rdevEthSwitchClient_connect()

int32_t rdevEthSwitchClient_connect ( rdevEthSwitchClientInitPrms_t initPrms)

Connect to Ethernet Switch Remote Device.

The client must first connect to the Ethernet Switch Remote Device server After connect the client can invoke the Ethernet Switch Remote Device Client APIs to configure the remote ethernet switch device

Parameters
initPrmsServer Connect params
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of incorrect init parameters or any failure connecting to remote server side.

◆ rdevEthSwitchClient_disconnect()

int32_t rdevEthSwitchClient_disconnect ( uint32_t  device_id)

Disconnect to Ethernet Switch Remote Device.

The client can disconnect from the Ethernet Switch Remote Device server.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any failure disconnecting from server side.

◆ rdevEthSwitchClient_sendping()

int32_t rdevEthSwitchClient_sendping ( uint32_t  device_id,
char *  ping_msg,
uint32_t  ping_len,
char *  respMsg,
uint32_t  respMaxLen 
)

Send Ping to Ethernet Switch Remote Device.

The server will respond to ping request

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
ping_msgPing message sent by client app
ping_lenLength of ping msg
respMsgResponse to ping message received from server
respMaxLenLength of response ping msg
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_ipv4macunregister()

int32_t rdevEthSwitchClient_ipv4macunregister ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint8_t *  ipv4_address 
)

Unregister association of IPv4 address with MAC address by removing ARP entry in the master core.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
ipv4_addressIPV4 address to be unregistered
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_ipv6macregister()

int32_t rdevEthSwitchClient_ipv6macregister ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint8_t *  mac_address,
uint8_t *  ipv6_address 
)

Register association of IPv6 address with MAC address by adding ARP entry in the master core.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
mac_addressMAC address with which the IPv4 address will be associated
ipv6_addressIPV4 address to be added to ARP database
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_ipv4macregister()

int32_t rdevEthSwitchClient_ipv4macregister ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint8_t *  mac_address,
uint8_t *  ipv4_address 
)

Register association of IPv4 address with MAC address by adding ARP entry in the master core.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
mac_addressMAC address with which the IPv4 address will be associated
ipv4_addressIPV4 address to be added to ARP database
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_regrd()

int32_t rdevEthSwitchClient_regrd ( uint32_t  device_id,
uint32_t  regaddr,
uint32_t *  pregval 
)

Register Read Function.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
regaddrRegister Address to be read from
pregvalPointer to register value which will be populated by this function
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_regwr()

int32_t rdevEthSwitchClient_regwr ( uint32_t  device_id,
uint32_t  regaddr,
uint32_t  regval,
uint32_t *  post_wr_regval 
)

Register Write Function.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
regaddrRegister Address to be read from
regvalRegister value to be written
post_wr_regvalPointer to register value after register write populated by this function
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_ioctl()

int32_t rdevEthSwitchClient_ioctl ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t  cmd,
const void *  inargs,
uint32_t  inargs_len,
void *  outargs,
uint32_t  outargs_len 
)

Invoke Cpsw IOCTL.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
cmdCPSW IOCTL CMD id. 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 input arguments .Byte array is typecast to the outArgs structure associated with the IOCTL. Populated by this function
outargs_lenCPSW IOCTL CMD output arguments length
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_detach()

int32_t rdevEthSwitchClient_detach ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key 
)

Detach from Ethernet Switch Remote Device.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_freerx()

int32_t rdevEthSwitchClient_freerx ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t  alloc_flow_idx 
)

Free Rx Flow Id.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
alloc_flow_idxRx Flow Id to be freed
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_freetx()

int32_t rdevEthSwitchClient_freetx ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t  tx_cpsw_psil_dst_id 
)

Free Tx Channel CPSW PSIL Destination thread id.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
tx_cpsw_psil_dst_idTx Channel CPSW PSIL Destination thread id to be freed
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_freemac()

int32_t rdevEthSwitchClient_freemac ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint8_t *  mac_address 
)

Free Tx Channel CPSW PSIL Destination thread id.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
mac_addressDestination mac address to be freed
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_unregisterrxdefault()

int32_t rdevEthSwitchClient_unregisterrxdefault ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t  default_flow_idx 
)

Unregister Default Flow from the given flow index.

This function disables routing of default traffic (traffic not matching any classifier with thread id configured) to the given rx flow_idx. Once disabled, all default traffic will be routed to the reserved flow resulting in all packets of default flow being dropped

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
default_flow_idxDefault Flow Id from to which the default flow will no longer be directed
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_unregistermac()

int32_t rdevEthSwitchClient_unregistermac ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t  flow_idx,
uint8_t *  mac_address 
)

Unregister Destination MAC address from the given flow index.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
flow_idxFlow Id from to which the traffic with the given DST mac address will no longer be directed
mac_addressDestination mac address to be unregistered
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_registermac()

int32_t rdevEthSwitchClient_registermac ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t  flow_idx,
uint8_t *  mac_address 
)

Register Destination MAC address with the given flow index.

This function registers the destination mac to the given rx flow index. This causes all packets with the given destination mac address to be routed to the given rx flow index.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
flow_idxFlow Id to which the traffic with the given DST mac address will directed
mac_addressDestination mac address to be registered
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_allocmac()

int32_t rdevEthSwitchClient_allocmac ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint8_t *  mac_address,
uint32_t  mac_address_len 
)

Alloc Destination MAC address.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
mac_addressDestination mac address .Populated by this function with allocated DST MAC address
mac_address_lenDestination mac address buffer length
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_registerrxdefault()

int32_t rdevEthSwitchClient_registerrxdefault ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t  default_flow_idx 
)

Register Default Flow to the given flow index.

This function enables routing of default traffic (traffic not matching any classifier with thread id configured) to the given rx flow_idx.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
default_flow_idxDefault Flow Id from to which the default flow will no longer be directed
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_allocrx()

int32_t rdevEthSwitchClient_allocrx ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t *  rx_flow_allocidx 
)

Alloc Rx Flow Id.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
rx_flow_allocidxAllocated Rx Flow Index populated by this function
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_alloctx()

int32_t rdevEthSwitchClient_alloctx ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t *  tx_cpsw_psil_dst_id 
)

Alloc Tx Channel CPSW PSIL Destination thread id.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
tx_cpsw_psil_dst_idAllocated Tx Channel CPSW PSIL Destination thread id populated by this function
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_attach()

int32_t rdevEthSwitchClient_attach ( uint32_t  device_id,
uint8_t  enetType,
uint64_t *  id,
uint32_t *  core_key,
uint32_t *  rx_mtu,
uint32_t  tx_mtu[],
uint32_t  tx_mtu_array_size,
uint32_t *  features,
uint32_t *  mac_only_port 
)

Attach to Ethernet Switch Remote Device.

Clients must first attach to the ethernet switch remote device.Attach returns the core_key and id which are used as params for all further client fucntions except regrd / regwr functions

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
enetTypeCPSW TYPE of type enum rpmsg_kdrv_ethswitch_cpsw_type
idPointer to Unique Opaque Handle populated by this function
core_keyPointer to Core key populated by this function
rx_mtuPointer to Maximum receive packet length . Populated by this function
tx_mtuArray of Maximum transmit packet length per priority supported by ethernet switch
tx_mtu_array_sizeSize of tx_mtu array.Must be sufficient to store MTU size for all priorities supported by the CPSW
featuresPointer to feature bitmap. Bitmask of type RPMSG_KDRV_TP_ETHSWITCH_FEATURE_xxx
mac_only_portPointer to MAC-only port. 1-relative MAC-only port number, 0 for non MAC-only ports
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_attachext()

int32_t rdevEthSwitchClient_attachext ( uint32_t  device_id,
uint8_t  enetType,
uint64_t *  id,
uint32_t *  core_key,
uint32_t *  rx_mtu,
uint32_t  tx_mtu[],
uint32_t  tx_mtu_array_size,
uint32_t *  features,
uint32_t *  tx_cpsw_psil_dst_id,
uint32_t *  rx_flow_allocidx,
uint8_t *  mac_address,
uint32_t  mac_address_len,
uint32_t *  mac_only_port 
)

Attach to Ethernet Switch Remote Device with extended response.

Clients must first attach to the ethernet switch remote device.Attach returns the core_key and id which are used as params for all further client fucntions except regrd / regwr functions For remote core clients that require only one rx/one tx and one dst mac address, rdevEthSwitchClient_attachext allows a single attach call to return all the required params Client can avoid further calls to alloctx/allocrx etc.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
enetTypeCPSW TYPE of type enum rpmsg_kdrv_ethswitch_cpsw_type
idPointer to Unique Opaque Handle populated by this function
core_keyPointer to Core key populated by this function
rx_mtuPointer to Maximum receive packet length . Populated by this function
tx_mtuArray of Maximum transmit packet length per priority supported by ethernet switch
tx_mtu_array_sizeSize of tx_mtu array.Must be sufficient to store MTU size for all priorities supported by the CPSW
featuresPointer to feature bitmap. Bitmask of type RPMSG_KDRV_TP_ETHSWITCH_FEATURE_xxx
tx_cpsw_psil_dst_idPointer to allocated Tx Channel CPSW PSIL destination thread id populated by this function
rx_flow_allocidxPointer to allocated Rx Flow Index populated by this function
mac_addressPointer to allocated destination mac address allocated to remote core populated by this function
mac_address_lenDestination mac address buffer length
mac_only_portPointer to MAC-only port. 1-relative MAC-only port number, 0 for non MAC-only ports
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_sendNotify()

int32_t rdevEthSwitchClient_sendNotify ( uint32_t  device_id,
u64  id,
u32  core_key,
enum rpmsg_kdrv_ethswitch_client_notify_type  notify_id,
uint8_t *  notify_info,
uint32_t  notify_info_len 
)

Send Notify From Client to server.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
notify_idClient 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
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_printText()

uint32_t rdevEthSwitchClient_printText ( void *  priv,
void *  data 
)

Remote Device Framework print function callback.

This function is for internal use of the remote device framework which expects all its clients to provide a printText callback

Parameters
privContext Pointer associated with printText call
dataFormatted string buffer to be printed
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.

◆ rdevEthSwitchClient_registerethtype()

int32_t rdevEthSwitchClient_registerethtype ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t  flow_idx,
uint16_t  ether_type 
)

Register Ethertype with the given flow index.

This function registers the ethertype to the given rx flow index. This causes all packets with the given ethertype to be routed to the given rx flow index.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
flow_idxFlow Id to which the traffic with the given DST mac address will directed
ether_typeEthertype to be registered
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_unregisterethtype()

int32_t rdevEthSwitchClient_unregisterethtype ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t  flow_idx,
uint16_t  ether_type 
)

Unregister Ethertype from the given flow index.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
flow_idxFlow Id from to which the traffic with the given DST mac address will no longer be directed
ether_typeEthertype to be unregistered
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_registerremotetimer()

int32_t rdevEthSwitchClient_registerremotetimer ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint8_t  timerid,
uint8_t  hwPushNum 
)

Register remote timer with CPTS using timerid.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
timeridTimer Id used for configuring timesync router
hwPushNumHardware push number of CPTS
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_unregisterremotetimer()

int32_t rdevEthSwitchClient_unregisterremotetimer ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint8_t  hwPushNum 
)

Unregister remote timer from CPTS using timerid.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
hwPushNumHardware push number of CPTS
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_setPromiscMode()

int32_t rdevEthSwitchClient_setPromiscMode ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t  enable 
)

Set promiscuous mode.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach/rdevEthSwitchClient_attachext
enablePromiscuous mode (enable or disable)
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_filterAddMac()

int32_t rdevEthSwitchClient_filterAddMac ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t  flow_idx,
uint8_t *  mac_address,
uint16_t  vlan_id 
)

Add multicast address to receive filter.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach or rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach or rdevEthSwitchClient_attachext
flow_idxFlow Id to which the traffic with the given MAC address will be directed. Applicable only for multicast addresses with exclusive access
mac_addressMulticast MAC address to be added
vlan_idVLAN id
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.

◆ rdevEthSwitchClient_filterDelMac()

int32_t rdevEthSwitchClient_filterDelMac ( uint32_t  device_id,
uint64_t  id,
uint32_t  core_key,
uint32_t  flow_idx,
uint8_t *  mac_address,
uint16_t  vlan_id 
)

Delete multicast address from receive filter.

Parameters
device_idDevice id returned by rdevEthSwitchClient_connect
idUnique Opaque Handle returned by rdevEthSwitchClient_attach or rdevEthSwitchClient_attachext
core_keyUnique core_key returned by rdevEthSwitchClient_attach or rdevEthSwitchClient_attachext
flow_idxFlow Id to which the traffic with the given MAC address will no longer be directed. Applicable only for multicast addresses with exclusive access
mac_addressMulticast MAC address to be deleted
vlan_idVLAN id
Return values
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OKSuccess.
RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAILIn case of any error while executing the command on the server side or an argument mismatch.