ETHFW API Guide
cpsw_proxy.h File Reference

Go to the source code of this file.

Data Structures

struct  CpswProxy_Config
 Cpsw Proxy Client Configuration structure. More...
 

Macros

CpswProxy Error Codes

Error codes returned by the CPSW Proxy client APIs.

#define CPSWPROXY_SOK   (0)
 Success. More...
 
#define CPSWPROXY_SINPROGRESS   (1)
 Operation in progress. More...
 
#define CPSWPROXY_EFAIL   (-1)
 Generic failure error condition (typically caused by hardware). More...
 
#define CPSWPROXY_EBADARGS   (-2)
 Bad arguments (i.e. NULL pointer). More...
 
#define CPSWPROXY_EINVALIDPARAMS   (-3)
 Invalid parameters (i.e. value out-of-range). More...
 
#define CPSWPROXY_ETIMEOUT   (-4)
 Time out while waiting for a given condition to happen. More...
 
#define CPSWPROXY_EALLOC   (-8)
 Allocation failure. More...
 
#define CPSWPROXY_EUNEXPECTED   (-9)
 Unexpected condition occurred (sometimes unrecoverable). More...
 
#define CPSWPROXY_EBUSY   (-10)
 The resource is currently busy performing an operation. More...
 
#define CPSWPROXY_EALREADYOPEN   (-11)
 Already open error. More...
 
#define CPSWPROXY_EPERM   (-12)
 Operation not permitted. More...
 
#define CPSWPROXY_ENOTSUPPORTED   (-13)
 Operation not supported. More...
 
#define CPSWPROXY_ENOTFOUND   (-14)
 Resource not found. More...
 
#define CPSWPROXY_EUNKNOWNIOCTL   (-15)
 Unknown IOCTL. More...
 
#define CPSWPROXY_EMALFORMEDIOCTL   (-16)
 Malformed IOCTL (args pointer or size not as expected). More...
 

Typedefs

typedef void(* CpswProxy_deviceDataNotifyCbFxn) (struct rpmsg_kdrv_ethswitch_device_data *eth_dev_data)
 Application Callback function pointers to notify when remote ethernet device data is received on remote core. More...
 
typedef struct CpswProxy_ClientObj_s * CpswProxy_Handle
 CPSW Proxy handle. More...
 

Functions

void CpswProxy_init (uint32_t masterCoreId, uint32_t masterEndpt)
 Initialize CPSW Proxy on a given core. More...
 
void CpswProxy_deinit (void)
 Deinitialize CPSW Proxy on a given core. More...
 
int32_t CpswProxy_connect (void)
 Connect to the Cpsw Proxy server. More...
 
CpswProxy_Handle CpswProxy_open (const CpswProxy_Config *cfg)
 Open CPSW proxy client instance with the given configuration. More...
 
void CpswProxy_close (CpswProxy_Handle hProxy)
 Close CPSW proxy client. More...
 
void CpswProxy_attach (CpswProxy_Handle hProxy, Enet_Type enetType, Enet_Handle *pCpswHandle, uint32_t *coreKey, uint32_t *rxMtu, uint32_t *txMtu, Enet_MacPort *macPort)
 Attach to Ethernet Switch Remote Device. More...
 
void CpswProxy_attachExtended (CpswProxy_Handle hProxy, Enet_Type enetType, Enet_Handle *pCpswHandle, uint32_t *coreKey, uint32_t *rxMtu, uint32_t *txMtu, uint32_t *txPSILThreadId, uint32_t *rxFlowStartIdx, uint32_t *rxFlowIdx, uint8_t *macAddress, Enet_MacPort *macPort)
 Attach to Ethernet Switch Remote Device with extended response. More...
 
void CpswProxy_detach (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey)
 Detach from Ethernet Switch Remote Device. More...
 
void CpswProxy_allocTxCh (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint32_t *txPSILThreadId)
 Alloc Tx Channel CPSW PSIL Destination thread id. More...
 
void CpswProxy_freeTxCh (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint32_t txChNum)
 Free Tx Channel CPSW PSIL Destination thread id. More...
 
void CpswProxy_allocRxFlow (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint32_t *rxFlowStartIdx, uint32_t *rxFlowIdx)
 Alloc Rx flow Id. More...
 
void CpswProxy_freeRxFlow (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint32_t rxFlowStartIdx, uint32_t rxFlowIdx)
 Free Rx flow Id. More...
 
void CpswProxy_allocMac (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint8_t *macAddress)
 Alloc Destination MAC address. More...
 
void CpswProxy_freeMac (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, const uint8_t *macAddress)
 Free Tx Channel CPSW PSIL Destination thread id. More...
 
void CpswProxy_registerDstMacRxFlow (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint32_t rxFlowStartIdx, uint32_t rxFlowOffsetIdx, const uint8_t *macAddress)
 Register Destination MAC address with the given flow index. More...
 
void CpswProxy_unregisterDstMacRxFlow (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint32_t rxFlowStartIdx, uint32_t rxFlowOffsetIdx, const uint8_t *macAddress)
 Unregister Destination MAC address from the given flow index. More...
 
void CpswProxy_registerEthertypeRxFlow (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint32_t rxFlowStartIdx, uint32_t rxFlowOffsetIdx, uint16_t etherType)
 Register the given EtherType to the given rx flow id. More...
 
void CpswProxy_unregisterEthertypeRxFlow (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint32_t rxFlowStartIdx, uint32_t rxFlowOffsetIdx, uint16_t etherType)
 Unregister the given EtherType to the given rx flow id. More...
 
void CpswProxy_registerDefaultRxFlow (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint32_t rxFlowStartIdx, uint32_t rxFlowOffsetIdx)
 Register Default Flow to the given flow index. More...
 
void CpswProxy_unregisterDefaultRxFlow (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint32_t rxFlowStartIdx, uint32_t rxFlowOffsetIdx)
 Unregister Default Flow from the given flow index. More...
 
void CpswProxy_registerIPV4Addr (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint8_t *macAddr, uint8_t *ipv4Addr)
 Register association of IPv4 address with MAC address by adding ARP entry in the master core. More...
 
void CpswProxy_unregisterIPV4Addr (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint8_t *ipv4Addr)
 Unregister association of IPv4 address with MAC address by removing ARP entry in the master core. More...
 
void CpswProxy_addHostPortEntry (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, const uint8_t *macAddr)
 Add the given unicast macAddr as host port MAC address. More...
 
void CpswProxy_delAddrEntry (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, const uint8_t *macAddr)
 Remove macAddress from the switch address resolution table. More...
 
int32_t CpswProxy_filterAddMac (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint32_t rxFlowStartIdx, uint32_t rxFlowOffsetIdx, const uint8_t *macAddress, uint16_t vlanId)
 Add multicast address to receive filter. More...
 
int32_t CpswProxy_filterDelMac (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint32_t rxFlowStartIdx, uint32_t rxFlowOffsetIdx, const uint8_t *macAddress, uint16_t vlanId)
 Delete multicast address from receive filter. More...
 
void CpswProxy_ioctl (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint32_t cmd, Enet_IoctlPrms *prms)
 Invoke Cpsw IOCTL. More...
 
bool CpswProxy_isPhyLinked (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, Enet_MacPort portNum)
 Query if the link for PHY associated with the given MAC Port is up. More...
 
void CpswProxy_sendNotify (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint8_t notifyId, uint8_t *notifyInfo, uint32_t notifyInfoLength)
 Send custom notification info from client to server. More...
 
void CpswProxy_registerRemoteTimer (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint8_t timerId, uint8_t hwPushNum)
 Register remote core's timer for synchronization. More...
 
void CpswProxy_unregisterRemoteTimer (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, uint8_t hwPushNum)
 Unregister remote core's timer for synchronization. More...
 
int32_t CpswProxy_registerHwPushNotifyCb (CpswRemoteNotifyService_hwPushNotifyCbFxn cbFxn, void *cbArg)
 Register hardware push notification callback. More...
 
void CpswProxy_unregisterHwPushNotifyCb (void)
 Unregister hardware push notification callback. More...
 
void CpswProxy_setPromiscMode (CpswProxy_Handle hProxy, Enet_Handle hEnet, uint32_t coreKey, bool enable)
 Set promiscuous mode. More...