ETHFW API Guide
Ethernet Switch Proxy Server APIs

Introduction

This section contains APIs for CPSW Proxy Server APIs.

The CPSW Proxy Server resides on the master core and enables clients on remote cores to configure the Ethernet Switch. The CPSW Proxy Server is the application interface to the ethernet remote device server.

The application configures and instantiates a CPSW Proxy Server instance. Once instantiated the CPSW will listen to, process and respond to CPSW_PROXY_CLIENT messages from remote cores.

Data Structures

struct  CpswProxyServer_RemoteCoreConfig
 Cpsw Proxy Server Remote Core Configuration structure. More...
 
struct  CpswProxyServer_Config_t
 Cpsw Proxy Server Remote Configuration structure. More...
 

Functions

int32_t CpswProxyServer_init (CpswProxyServer_Config_t *cfg)
 Cpsw proxy server initialization function. More...
 
int32_t CpswProxyServer_start (void)
 Start the Cpsw proxy server. More...
 

Typedefs

typedef void(* CpswProxyServer_InitEthfwDeviceDataCb) (uint32_t host_id, struct rpmsg_kdrv_ethswitch_device_data *eth_dev_data)
 Application callback function pointer to initialize Ethernet Firmware data. More...
 
typedef void(* CpswProxyServer_GetMcmCmdIfCb) (Enet_Type enetType, EnetMcm_CmdIf **pMcmCmdIfHandle)
 Application callback function pointer to get Multiclient Manager (MCM) command mailbox. More...
 
typedef void(* CpswProxyServer_NotifyCb) (uint32_t host_id, Enet_Handle hEnet, Enet_Type enetType, uint32_t core_key, enum rpmsg_kdrv_ethswitch_client_notify_type notifyid, uint8_t *notify_info, uint32_t notify_info_len)
 Application Callback function pointer to handle custom notification from remote client. More...
 

Typedef Documentation

◆ CpswProxyServer_InitEthfwDeviceDataCb

typedef void(* CpswProxyServer_InitEthfwDeviceDataCb) (uint32_t host_id, struct rpmsg_kdrv_ethswitch_device_data *eth_dev_data)

Application callback function pointer to initialize Ethernet Firmware data.

When a client connection from remote core to cpsw proxy server is established, the server will invoke this application callback to populate firmware info which is exported as remote device data to the remote core client.

Parameters
host_idRemote Core Id
eth_dev_dataFirmware device data to be populated

◆ CpswProxyServer_GetMcmCmdIfCb

typedef void(* CpswProxyServer_GetMcmCmdIfCb) (Enet_Type enetType, EnetMcm_CmdIf **pMcmCmdIfHandle)

Application callback function pointer to get Multiclient Manager (MCM) command mailbox.

The MCM manages access to single CPSW LLD handle across multiple clients on both remote core and local core.

The CPSW Proxy server needs the MCM command interface to perform ATTACH. The MCM command interface is obtained by invoking this application callback.

Parameters
enetTypeEnet instance type
pMcmCmdIfHandlePointer to MCM command interface structure which will be populated by application

◆ CpswProxyServer_NotifyCb

typedef void(* CpswProxyServer_NotifyCb) (uint32_t host_id, Enet_Handle hEnet, Enet_Type enetType, uint32_t core_key, enum rpmsg_kdrv_ethswitch_client_notify_type notifyid, uint8_t *notify_info, uint32_t notify_info_len)

Application Callback function pointer to handle custom notification from remote client.

This is application handler for custom client to server notification from remote cores. The proxy layer just passes the notify info and notify_info_len. The client and server application interpretation of the custom notify info should match.

Parameters
host_idRemote Core IPC core id
hEnetHandle to CPSW
enetTypeEnet instance type
notifyidCustom notify id. Will be RPMSG_KDRV_TP_ETHSWITCH_CLIENTNOTIFY_CUSTOM
notify_infoNotify info
notify_info_lenNotify info length

Function Documentation

◆ CpswProxyServer_init()

int32_t CpswProxyServer_init ( CpswProxyServer_Config_t cfg)

Cpsw proxy server initialization function.

Parameters
cfgCpsw Proxy Server configuration

◆ CpswProxyServer_start()

int32_t CpswProxyServer_start ( void  )

Start the Cpsw proxy server.

Starts the remote device framework.

Returns
ENET_SOK if succeeded, an error code otherwise.