ETHFW API Guide
Ethernet Switch Proxy Client APIs

Introduction

This section contains APIs for CPSW Proxy Client APIs.

The CPSW proxy client resides on the remote cores and enables clients on remote cores to configure the Ethernet Switch via RPC

The Cpsw Proxy APIs for switch configuration are RPC APIs

Data Structures

struct  CpswProxy_Config
 Cpsw Proxy Client Configuration structure. 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...
 

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...
 

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...
 

Macro Definition Documentation

◆ CPSWPROXY_SOK

#define CPSWPROXY_SOK   (0)

Success.

◆ CPSWPROXY_SINPROGRESS

#define CPSWPROXY_SINPROGRESS   (1)

Operation in progress.

◆ CPSWPROXY_EFAIL

#define CPSWPROXY_EFAIL   (-1)

Generic failure error condition (typically caused by hardware).

◆ CPSWPROXY_EBADARGS

#define CPSWPROXY_EBADARGS   (-2)

Bad arguments (i.e. NULL pointer).

◆ CPSWPROXY_EINVALIDPARAMS

#define CPSWPROXY_EINVALIDPARAMS   (-3)

Invalid parameters (i.e. value out-of-range).

◆ CPSWPROXY_ETIMEOUT

#define CPSWPROXY_ETIMEOUT   (-4)

Time out while waiting for a given condition to happen.

◆ CPSWPROXY_EALLOC

#define CPSWPROXY_EALLOC   (-8)

Allocation failure.

◆ CPSWPROXY_EUNEXPECTED

#define CPSWPROXY_EUNEXPECTED   (-9)

Unexpected condition occurred (sometimes unrecoverable).

◆ CPSWPROXY_EBUSY

#define CPSWPROXY_EBUSY   (-10)

The resource is currently busy performing an operation.

◆ CPSWPROXY_EALREADYOPEN

#define CPSWPROXY_EALREADYOPEN   (-11)

Already open error.

◆ CPSWPROXY_EPERM

#define CPSWPROXY_EPERM   (-12)

Operation not permitted.

◆ CPSWPROXY_ENOTSUPPORTED

#define CPSWPROXY_ENOTSUPPORTED   (-13)

Operation not supported.

◆ CPSWPROXY_ENOTFOUND

#define CPSWPROXY_ENOTFOUND   (-14)

Resource not found.

◆ CPSWPROXY_EUNKNOWNIOCTL

#define CPSWPROXY_EUNKNOWNIOCTL   (-15)

Unknown IOCTL.

◆ CPSWPROXY_EMALFORMEDIOCTL

#define CPSWPROXY_EMALFORMEDIOCTL   (-16)

Malformed IOCTL (args pointer or size not as expected).

Typedef Documentation

◆ CpswProxy_deviceDataNotifyCbFxn

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.

The client will attach to the server and the server will send the ethernet device data to the server. This data is passed onto the application by means of this callback.

Parameters
eth_dev_dataPointer to device data

◆ CpswProxy_Handle

typedef struct CpswProxy_ClientObj_s* CpswProxy_Handle

CPSW Proxy handle.

CPSW Proxy opaque handle.

Function Documentation

◆ CpswProxy_init()

void CpswProxy_init ( uint32_t  masterCoreId,
uint32_t  masterEndpt 
)

Initialize CPSW Proxy on a given core.

Performs one-time initialization of the CPSW Proxy layer. It needs to be called only once per core and it must be the very first CpswProxy API to be called.

This API will initialize the underlying client-side EthSwitch remote device and will block until server-side EthSwitch remote device is initialized.

Parameters
masterCoreIdMaster core id on which the Cpsw Remote Device Server exists
masterEndptMaster core's Cpsw Remote Device endpoint

◆ CpswProxy_deinit()

void CpswProxy_deinit ( void  )

Deinitialize CPSW Proxy on a given core.

Performs one-time deinitialization of the CPSW Proxy layer. It needs to be called only once per core and it must be the very last CpswProxy API to be called.

◆ CpswProxy_connect()

int32_t CpswProxy_connect ( void  )

Connect to the Cpsw Proxy server.

Connect with the server side if it has been initialized. Client side then continues its initialization steps which are dependent on server.

Application should call this function until connection is established before calling CpswProxy_open() or any other CpswProxy API.

Returns
IPC_SOK in case of success. Negative IPC error otherwise.

◆ CpswProxy_open()

CpswProxy_Handle CpswProxy_open ( const CpswProxy_Config cfg)

Open CPSW proxy client instance with the given configuration.

Application will get a handle to Cpsw Proxy which will be used in all CPSW Proxy APIs. Only a single proxy instance per remote core is supported currently.

Parameters
cfgConfiguration of the CPSW Proxy client
Returns
Cpsw Proxy Handle which will be used in all Cpsw Proxy APIs. NULL value indicates CpswProxy_open() failed

◆ CpswProxy_close()

void CpswProxy_close ( CpswProxy_Handle  hProxy)

Close CPSW proxy client.

Close and free the CPSW proxy client instance.

Parameters
hProxyCpsw Proxy Handle

◆ CpswProxy_attach()

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.

Clients must first attach to the ethernet switch remote device. CpswProxy_attach() returns the core_key and id which are used as params for all further client fucntions.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
enetTypeEnet instance type
pCpswHandlePointer to unique opaque handle populated by this function
coreKeyPointer to Core key populated by this function
rxMtuPointer to maximum receive packet length. Populated by this function
txMtuArray of maximum transmit packet length per priority supported by ethernet switch
macPortUnderlying MAC port. ENET_MAC_PORT_INV for virtual switch ports, or a valid MAC port id for virtual MAC ports. This MAC port number can be used as is in Enet DMA APIs for directed or non-directed packets.

◆ CpswProxy_attachExtended()

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.

Clients must first attach to the ethernet switch remote device. CpswProxy_attachExtended() returns the core_key and id which are used as params for all further client functions.

For remote core clients that require only one rx/one tx and one dst MAC address, CpswProxy_attachExtended() allows a single attach call to return all the required params. Client can avoid further calls to alloctx/allocrx, etc.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
enetTypeEnet instance type
pCpswHandlePointer to unique opaque handle populated by this function
coreKeyPointer to Core key populated by this function
rxMtuPointer to maximum receive packet length. Populated by this function
txMtuArray of maximum transmit packet length per priority supported by ethernet switch
txPSILThreadIdPointer to allocated Tx Channel CPSW PSIL destination thread id populated by this function
rxFlowStartIdxPointer to allocated Rx Flow Index Base value populated by this function: Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx)
rxFlowIdxPointer to allocated allocated Rx Flow Index offset value populated by this function
macAddressPointer to allocated destination MAC address allocated to remote core populated by this function
macPortUnderlying MAC port. ENET_MAC_PORT_INV for virtual switch ports, or a valid MAC port id for virtual MAC ports. This MAC port number can be used as is in Enet DMA APIs for directed or non-directed packets.

◆ CpswProxy_detach()

void CpswProxy_detach ( CpswProxy_Handle  hProxy,
Enet_Handle  hEnet,
uint32_t  coreKey 
)

Detach from Ethernet Switch Remote Device.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()

◆ CpswProxy_allocTxCh()

void CpswProxy_allocTxCh ( CpswProxy_Handle  hProxy,
Enet_Handle  hEnet,
uint32_t  coreKey,
uint32_t *  txPSILThreadId 
)

Alloc Tx Channel CPSW PSIL Destination thread id.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
txPSILThreadIdAllocated Tx Channel CPSW PSIL Destination thread id populated by this function

◆ CpswProxy_freeTxCh()

void CpswProxy_freeTxCh ( CpswProxy_Handle  hProxy,
Enet_Handle  hEnet,
uint32_t  coreKey,
uint32_t  txChNum 
)

Free Tx Channel CPSW PSIL Destination thread id.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
txChNumTx Channel CPSW PSIL Destination thread id to be freed

◆ CpswProxy_allocRxFlow()

void CpswProxy_allocRxFlow ( CpswProxy_Handle  hProxy,
Enet_Handle  hEnet,
uint32_t  coreKey,
uint32_t *  rxFlowStartIdx,
uint32_t *  rxFlowIdx 
)

Alloc Rx flow Id.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
rxFlowStartIdxPointer to allocated Rx Flow Index Base value populated by this function. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx)
rxFlowIdxPointer to allocated allocated Rx flow Index offset value populated by this function

◆ CpswProxy_freeRxFlow()

void CpswProxy_freeRxFlow ( CpswProxy_Handle  hProxy,
Enet_Handle  hEnet,
uint32_t  coreKey,
uint32_t  rxFlowStartIdx,
uint32_t  rxFlowIdx 
)

Free Rx flow Id.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
rxFlowStartIdxAllocated Rx Flow Index Base value populated by this function. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx)
rxFlowIdxAllocated Rx flow Index offset value populated by this function

◆ CpswProxy_allocMac()

void CpswProxy_allocMac ( CpswProxy_Handle  hProxy,
Enet_Handle  hEnet,
uint32_t  coreKey,
uint8_t *  macAddress 
)

Alloc Destination MAC address.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
macAddressDestination MAC address. Populated by this function with allocated DST MAC address

◆ CpswProxy_freeMac()

void CpswProxy_freeMac ( CpswProxy_Handle  hProxy,
Enet_Handle  hEnet,
uint32_t  coreKey,
const uint8_t *  macAddress 
)

Free Tx Channel CPSW PSIL Destination thread id.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
macAddressDestination MAC address to be freed

◆ CpswProxy_registerDstMacRxFlow()

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.

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.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
rxFlowStartIdxRx flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx)
rxFlowOffsetIdxFlow Id from to which the traffic with the given DST MAC address will be directed
macAddressDestination MAC address to be registered

◆ CpswProxy_unregisterDstMacRxFlow()

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.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
rxFlowStartIdxRx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx)
rxFlowOffsetIdxFlow Id from to which the traffic with the given DST MAC address will no longer be directed
macAddressDestination MAC address to be unregistered

◆ CpswProxy_registerEthertypeRxFlow()

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.

Any packets received with given EtherType mac will have the specific flow id.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
rxFlowStartIdxRx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx)
rxFlowOffsetIdxrxFlowOffsetIdx to which the EtherType packets be directed
etherTypeEthertype to be associated with the given rx flow id

◆ CpswProxy_unregisterEthertypeRxFlow()

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.

Any packets received with given EtherType MAC will be directed to the default flow.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
rxFlowStartIdxRx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx)
rxFlowOffsetIdxrxFlowOffsetIdx to which the EtherType packets were directed
etherTypeEthertype to be disassociated from the given rx flow id

◆ CpswProxy_registerDefaultRxFlow()

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.

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

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
rxFlowStartIdxRx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx)
rxFlowOffsetIdxDefault Flow Id from to which the default flow will no longer be directed

◆ CpswProxy_unregisterDefaultRxFlow()

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.

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

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
rxFlowStartIdxRx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx)
rxFlowOffsetIdxDefault Flow Id from to which the default flow will no longer be directed

◆ CpswProxy_registerIPV4Addr()

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.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
macAddrMAC address with which the IPv4 address will be associated
ipv4AddrIPv4 address to be added to ARP database

◆ CpswProxy_unregisterIPV4Addr()

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.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
ipv4AddrIPv4 address to be unregistered

◆ CpswProxy_addHostPortEntry()

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.

Any packets received with destination mac will be switched to the host port.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
macAddrUnicast MAC address to be added to the switch address resolution table as host port entry

◆ CpswProxy_delAddrEntry()

void CpswProxy_delAddrEntry ( CpswProxy_Handle  hProxy,
Enet_Handle  hEnet,
uint32_t  coreKey,
const uint8_t *  macAddr 
)

Remove macAddress from the switch address resolution table.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
macAddrMAC address to be deleted from the switch address resolution table

◆ CpswProxy_filterAddMac()

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.

This function adds a multicast address to the receive filter. Ethernet Firmware differentiates multicast addresses as shared or exclusive.

  • Exclusive multicast address - Use is allowed only on a single remote client, the first one to request it. Traffic received with exclusive address is routed to the remote client in hardware to the given RX flow index.
  • Shared multicast address - Traffic received with shared address is fanned out to all remote clients that request it via virtual intercore interface. RX flow index is not relevant in this case.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
rxFlowStartIdxRx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx)
rxFlowOffsetIdxDefault Flow Id from to which the default flow will no longer be directed
macAddressMulticast MAC address to be added to receive filter
vlanIdVLAN id
Returns
Refer to CpswProxy_ErrorCodes.

◆ CpswProxy_filterDelMac()

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.

This function deletes a multicast address to the receive filter which was previous added via CpswProxy_addFilterAdddr().

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
rxFlowStartIdxRx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx)
rxFlowOffsetIdxDefault Flow Id from to which the default flow will no longer be directed
macAddressMulticast MAC address to be deleted from receive filter
vlanIdVLAN id
Returns
Refer to CpswProxy_ErrorCodes.

◆ CpswProxy_ioctl()

void CpswProxy_ioctl ( CpswProxy_Handle  hProxy,
Enet_Handle  hEnet,
uint32_t  coreKey,
uint32_t  cmd,
Enet_IoctlPrms *  prms 
)

Invoke Cpsw IOCTL.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

NOTE: Due to limitation in IPC, maximum size of inArgs and outArgs is 128 bytes If Cpsw IOCTL iargs_len/outargs_len is greater than 128 bytes for a specific IOCTL cmd then CpswProxy_ioctl will fail

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
cmdCPSW IOCTL CMD id. Refer CPSW LLD documentation for list of CPSW LLD IOCTLs
prmsCPSW IOCTL params. Refer CPSW LLD documentation for details of this structure

◆ CpswProxy_isPhyLinked()

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.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
portNumMAC port for which PHY link status is queried

◆ CpswProxy_sendNotify()

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.

The buffer notifyInfo of notifyInfoLength will be sent to the server The client and server application interpretation of the notify info should match. The proxy just passes the info to the remote core

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
notifyIdNotify id
notifyInfoNotify info to be sent to server
notifyInfoLengthNotify info length

◆ CpswProxy_registerRemoteTimer()

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.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

The timerId is used to indicate Ethfw about which timer's event is to be routed to CPTS hardware push via Timesync router(TSR).

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
timerIdInput Id number of timer in TSR
hwPushNumHardware push number of CPTS

◆ CpswProxy_unregisterRemoteTimer()

void CpswProxy_unregisterRemoteTimer ( CpswProxy_Handle  hProxy,
Enet_Handle  hEnet,
uint32_t  coreKey,
uint8_t  hwPushNum 
)

Unregister remote core's timer for synchronization.

Note: The API will send the RPC msg, block for response and if the response status is not success will abort execution. The API will be modified to return error status to allow the application to handle the error in next version.

The timerId is used to indicate Ethfw to stop routing done via Timesync router(TSR).

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
hwPushNumHardware push number of CPTS

◆ CpswProxy_registerHwPushNotifyCb()

int32_t CpswProxy_registerHwPushNotifyCb ( CpswRemoteNotifyService_hwPushNotifyCbFxn  cbFxn,
void *  cbArg 
)

Register hardware push notification callback.

Parameters
cbFxnCallback function to be called when event occurs
cbArgCallback arguments
Returns
status CPSWPROXY_SOK if registered callback successfully CPSWPROXY_EALREADYOPEN if callback is already registered. CPSWPROXY_EBADARGS if invalid input arguments

◆ CpswProxy_unregisterHwPushNotifyCb()

void CpswProxy_unregisterHwPushNotifyCb ( void  )

Unregister hardware push notification callback.

◆ CpswProxy_setPromiscMode()

void CpswProxy_setPromiscMode ( CpswProxy_Handle  hProxy,
Enet_Handle  hEnet,
uint32_t  coreKey,
bool  enable 
)

Set promiscuous mode.

Parameters
hProxyHandle to Cpsw Proxy
hEnetUnique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended()
coreKeyUnique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended()
enablePromiscuous mode (enable or disable)