![]() |
ETHFW API Guide
|
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_VirtPortCfg |
| Cpsw Proxy Server Virtual Port Configuration structure. More... | |
| struct | CpswProxyServer_SharedMcastCfg |
| Ethernet Firmware shared multicast fanout configuration. More... | |
| struct | CpswProxyServer_RsvdMcastCfg |
| Ethernet Firmware reserved multicast configuration. 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 void(* | CpswProxyServer_FilterAddMacSharedCb) (const uint8_t *macAddr, const uint8_t coreId) |
| Filter add shared multicast callback. More... | |
| typedef void(* | CpswProxyServer_FilterDelMacSharedCb) (const uint8_t *macAddr, const uint8_t coreId) |
| Filter delete shared multicast callback. More... | |
Macros | |
| #define | CPSWPROXYSERVER_MAC_PORT_MAX (8U) |
| #define | CPSWPROXYSERVER_SHARED_MCAST_LIST_LEN (8U) |
| #define | CPSWPROXYSERVER_RSVD_MCAST_LIST_LEN (4U) |
| #define | CPSWPROXYSERVER_AUTOSAR_REMOTE_CLIENT_MAX (2U) |
CpswProxyServer Error Codes | |
|
Error codes returned by the CPSW Proxy server APIs. | |
| #define | CPSWPROXYSERVER_SOK (0) |
| Success. More... | |
| #define | CPSWPROXYSERVER_SINPROGRESS (1) |
| Operation in progress. More... | |
| #define | CPSWPROXYSERVER_EFAIL (-1) |
| Generic failure error condition (typically caused by hardware). More... | |
| #define | CPSWPROXYSERVER_EBADARGS (-2) |
| Bad arguments (i.e. NULL pointer). More... | |
| #define | CPSWPROXYSERVER_EINVALIDPARAMS (-3) |
| Invalid parameters (i.e. value out-of-range). More... | |
| #define | CPSWPROXYSERVER_ETIMEOUT (-4) |
| Time out while waiting for a given condition to happen. More... | |
| #define | CPSWPROXYSERVER_EALLOC (-8) |
| Allocation failure. More... | |
| #define | CPSWPROXYSERVER_EUNEXPECTED (-9) |
| Unexpected condition occurred (sometimes unrecoverable). More... | |
| #define | CPSWPROXYSERVER_EBUSY (-10) |
| The resource is currently busy performing an operation. More... | |
| #define | CPSWPROXYSERVER_EALREADYOPEN (-11) |
| Already open error. More... | |
| #define | CPSWPROXYSERVER_EPERM (-12) |
| Operation not permitted. More... | |
| #define | CPSWPROXYSERVER_ENOTSUPPORTED (-13) |
| Operation not supported. More... | |
| #define | CPSWPROXYSERVER_ENOTFOUND (-14) |
| Resource not found. More... | |
| #define | CPSWPROXYSERVER_EUNKNOWNIOCTL (-15) |
| Unknown IOCTL. More... | |
| #define | CPSWPROXYSERVER_EMALFORMEDIOCTL (-16) |
| Malformed IOCTL (args pointer or size not as expected). More... | |
| #define CPSWPROXYSERVER_SOK (0) |
Success.
| #define CPSWPROXYSERVER_SINPROGRESS (1) |
Operation in progress.
| #define CPSWPROXYSERVER_EFAIL (-1) |
Generic failure error condition (typically caused by hardware).
| #define CPSWPROXYSERVER_EBADARGS (-2) |
Bad arguments (i.e. NULL pointer).
| #define CPSWPROXYSERVER_EINVALIDPARAMS (-3) |
Invalid parameters (i.e. value out-of-range).
| #define CPSWPROXYSERVER_ETIMEOUT (-4) |
Time out while waiting for a given condition to happen.
| #define CPSWPROXYSERVER_EALLOC (-8) |
Allocation failure.
| #define CPSWPROXYSERVER_EUNEXPECTED (-9) |
Unexpected condition occurred (sometimes unrecoverable).
| #define CPSWPROXYSERVER_EBUSY (-10) |
The resource is currently busy performing an operation.
| #define CPSWPROXYSERVER_EALREADYOPEN (-11) |
Already open error.
| #define CPSWPROXYSERVER_EPERM (-12) |
Operation not permitted.
| #define CPSWPROXYSERVER_ENOTSUPPORTED (-13) |
Operation not supported.
| #define CPSWPROXYSERVER_ENOTFOUND (-14) |
Resource not found.
| #define CPSWPROXYSERVER_EUNKNOWNIOCTL (-15) |
Unknown IOCTL.
| #define CPSWPROXYSERVER_EMALFORMEDIOCTL (-16) |
Malformed IOCTL (args pointer or size not as expected).
| #define CPSWPROXYSERVER_MAC_PORT_MAX (8U) |
Maximum number of MAC ports
| #define CPSWPROXYSERVER_SHARED_MCAST_LIST_LEN (8U) |
Size of shared multicast address table
| #define CPSWPROXYSERVER_RSVD_MCAST_LIST_LEN (4U) |
Size of reserved multicast address table
| #define CPSWPROXYSERVER_AUTOSAR_REMOTE_CLIENT_MAX (2U) |
Max number of AUTOSAR client cores
| 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.
| host_id | Remote Core Id |
| eth_dev_data | Firmware device data to be populated |
| 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.
| enetType | Enet instance type |
| pMcmCmdIfHandle | Pointer to MCM command interface structure which will be populated by application |
| 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.
| host_id | Remote Core IPC core id |
| hEnet | Handle to CPSW |
| enetType | Enet instance type |
| notifyid | Custom notify id. Will be RPMSG_KDRV_TP_ETHSWITCH_CLIENTNOTIFY_CUSTOM |
| notify_info | Notify info |
| notify_info_len | Notify info length |
| typedef void(* CpswProxyServer_FilterAddMacSharedCb) (const uint8_t *macAddr, const uint8_t coreId) |
Filter add shared multicast callback.
Application callback function called when a remote client requests the addition of a shared multicast address to the filter.
| macAddr | Multicast address being added |
| coreId | Remote core id which originated the multicast 'add' request |
| typedef void(* CpswProxyServer_FilterDelMacSharedCb) (const uint8_t *macAddr, const uint8_t coreId) |
Filter delete shared multicast callback.
Application callback function called when a remote client requests the deletion of a shared multicast address from the filter.
| macAddr | Multicast address being added |
| coreId | Remote core id which originated the multicast 'remove' request |
| int32_t CpswProxyServer_init | ( | CpswProxyServer_Config_t * | cfg | ) |
Cpsw proxy server initialization function.
| cfg | Cpsw Proxy Server configuration |
| int32_t CpswProxyServer_start | ( | void | ) |
Start the Cpsw proxy server.
Starts the remote device framework.