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

CpswProxy_Handle CpswProxy_init (const CpswProxy_Config *cfg)
 Initialize CPSW proxy client with the given configuration. More...
 
void CpswProxy_deInit (CpswProxy_Handle hProxy)
 Deinit CPSW proxy client. More...
 
void CpswProxy_start (CpswProxy_Handle hProxy)
 Start 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)
 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)
 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 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...
 
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 *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 (CpswProxy_Handle hProxy, CpswRemoteNotifyService_hwPushNotifyCbFxn cbFxn)
 Register hardware push notification callback. 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_Obj_s * CpswProxy_Handle
 CPSW Proxy handle. More...
 

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_Obj_s* CpswProxy_Handle

CPSW Proxy handle.

CPSW Proxy opaque handle.

Function Documentation

◆ CpswProxy_init()

CpswProxy_Handle CpswProxy_init ( const CpswProxy_Config cfg)

Initialize CPSW proxy client 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_init() failed

◆ CpswProxy_deInit()

void CpswProxy_deInit ( CpswProxy_Handle  hProxy)

Deinit CPSW proxy client.

Deletes the CPW proxy client instance.

Parameters
hProxyCpsw Proxy Handle

◆ CpswProxy_start()

void CpswProxy_start ( CpswProxy_Handle  hProxy)

Start CPSW proxy client.

Application can invoke Cpsw_proxy RPC APIs only after the client is started

Parameters
hProxyHandle to Cpsw Proxy

◆ CpswProxy_attach()

void CpswProxy_attach ( CpswProxy_Handle  hProxy,
Enet_Type  enetType,
Enet_Handle *  pCpswHandle,
uint32_t *  coreKey,
uint32_t *  rxMtu,
uint32_t *  txMtu 
)

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

◆ 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 
)

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

◆ 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  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()
rxFlowIdxRx flow Id to be freed

◆ 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_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 *  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()
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 ( CpswProxy_Handle  hProxy,
CpswRemoteNotifyService_hwPushNotifyCbFxn  cbFxn 
)

Register hardware push notification callback.

Parameters
hProxyHandle to Cpsw Proxy
cbFxnCallback function to be called when event occurs
Returns
status ENET_SOK if registered callback successfully ENET_EALREADYOPEN if callback is already registered.