ETHFW API Guide
|
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... | |
#define CPSWPROXY_SOK (0) |
Success.
#define CPSWPROXY_SINPROGRESS (1) |
Operation in progress.
#define CPSWPROXY_EFAIL (-1) |
Generic failure error condition (typically caused by hardware).
#define CPSWPROXY_EBADARGS (-2) |
Bad arguments (i.e. NULL pointer).
#define CPSWPROXY_EINVALIDPARAMS (-3) |
Invalid parameters (i.e. value out-of-range).
#define CPSWPROXY_ETIMEOUT (-4) |
Time out while waiting for a given condition to happen.
#define CPSWPROXY_EALLOC (-8) |
Allocation failure.
#define CPSWPROXY_EUNEXPECTED (-9) |
Unexpected condition occurred (sometimes unrecoverable).
#define CPSWPROXY_EBUSY (-10) |
The resource is currently busy performing an operation.
#define CPSWPROXY_EALREADYOPEN (-11) |
Already open error.
#define CPSWPROXY_EPERM (-12) |
Operation not permitted.
#define CPSWPROXY_ENOTSUPPORTED (-13) |
Operation not supported.
#define CPSWPROXY_ENOTFOUND (-14) |
Resource not found.
#define CPSWPROXY_EUNKNOWNIOCTL (-15) |
Unknown IOCTL.
#define CPSWPROXY_EMALFORMEDIOCTL (-16) |
Malformed IOCTL (args pointer or size not as expected).
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.
eth_dev_data | Pointer to device data |
typedef struct CpswProxy_ClientObj_s* CpswProxy_Handle |
CPSW Proxy handle.
CPSW Proxy opaque handle.
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.
masterCoreId | Master core id on which the Cpsw Remote Device Server exists |
masterEndpt | Master core's Cpsw Remote Device endpoint |
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.
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.
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.
cfg | Configuration of the CPSW Proxy client |
void CpswProxy_close | ( | CpswProxy_Handle | hProxy | ) |
Close CPSW proxy client.
Close and free the CPSW proxy client instance.
hProxy | Cpsw Proxy Handle |
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.
hProxy | Handle to Cpsw Proxy |
enetType | Enet instance type |
pCpswHandle | Pointer to unique opaque handle populated by this function |
coreKey | Pointer to Core key populated by this function |
rxMtu | Pointer to maximum receive packet length. Populated by this function |
txMtu | Array of maximum transmit packet length per priority supported by ethernet switch |
macPort | Underlying 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. |
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.
hProxy | Handle to Cpsw Proxy |
enetType | Enet instance type |
pCpswHandle | Pointer to unique opaque handle populated by this function |
coreKey | Pointer to Core key populated by this function |
rxMtu | Pointer to maximum receive packet length. Populated by this function |
txMtu | Array of maximum transmit packet length per priority supported by ethernet switch |
txPSILThreadId | Pointer to allocated Tx Channel CPSW PSIL destination thread id populated by this function |
rxFlowStartIdx | Pointer to allocated Rx Flow Index Base value populated by this function: Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx) |
rxFlowIdx | Pointer to allocated allocated Rx Flow Index offset value populated by this function |
macAddress | Pointer to allocated destination MAC address allocated to remote core populated by this function |
macPort | Underlying 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. |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
txPSILThreadId | Allocated Tx Channel CPSW PSIL Destination thread id populated by this function |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
txChNum | Tx Channel CPSW PSIL Destination thread id to be freed |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
rxFlowStartIdx | Pointer to allocated Rx Flow Index Base value populated by this function. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx) |
rxFlowIdx | Pointer to allocated allocated Rx flow Index offset value populated by this function |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
rxFlowStartIdx | Allocated Rx Flow Index Base value populated by this function. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx) |
rxFlowIdx | Allocated Rx flow Index offset value populated by this function |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
macAddress | Destination MAC address. Populated by this function with allocated DST MAC address |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
macAddress | Destination MAC address to be freed |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
rxFlowStartIdx | Rx flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx) |
rxFlowOffsetIdx | Flow Id from to which the traffic with the given DST MAC address will be directed |
macAddress | Destination MAC address to be registered |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
rxFlowStartIdx | Rx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx) |
rxFlowOffsetIdx | Flow Id from to which the traffic with the given DST MAC address will no longer be directed |
macAddress | Destination MAC address to be unregistered |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
rxFlowStartIdx | Rx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx) |
rxFlowOffsetIdx | rxFlowOffsetIdx to which the EtherType packets be directed |
etherType | Ethertype to be associated with the given rx flow id |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
rxFlowStartIdx | Rx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx) |
rxFlowOffsetIdx | rxFlowOffsetIdx to which the EtherType packets were directed |
etherType | Ethertype to be disassociated from the given rx flow id |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
rxFlowStartIdx | Rx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx) |
rxFlowOffsetIdx | Default Flow Id from to which the default flow will no longer be directed |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
rxFlowStartIdx | Rx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx) |
rxFlowOffsetIdx | Default Flow Id from to which the default flow will no longer be directed |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
macAddr | MAC address with which the IPv4 address will be associated |
ipv4Addr | IPv4 address to be added to ARP database |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
ipv4Addr | IPv4 address to be unregistered |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
macAddr | Unicast MAC address to be added to the switch address resolution table as host port entry |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
macAddr | MAC address to be deleted from the switch address resolution table |
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.
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
rxFlowStartIdx | Rx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx) |
rxFlowOffsetIdx | Default Flow Id from to which the default flow will no longer be directed |
macAddress | Multicast MAC address to be added to receive filter |
vlanId | VLAN id |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
rxFlowStartIdx | Rx Flow Index Base value. Absolute RxFlowIdx = (rxFlowStartIdx + rxFlowIdx) |
rxFlowOffsetIdx | Default Flow Id from to which the default flow will no longer be directed |
macAddress | Multicast MAC address to be deleted from receive filter |
vlanId | VLAN id |
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
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
cmd | CPSW IOCTL CMD id. Refer CPSW LLD documentation for list of CPSW LLD IOCTLs |
prms | CPSW IOCTL params. Refer CPSW LLD documentation for details of this structure |
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.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
portNum | MAC port for which PHY link status is queried |
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
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
notifyId | Notify id |
notifyInfo | Notify info to be sent to server |
notifyInfoLength | Notify info length |
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).
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
timerId | Input Id number of timer in TSR |
hwPushNum | Hardware push number of CPTS |
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).
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
hwPushNum | Hardware push number of CPTS |
int32_t CpswProxy_registerHwPushNotifyCb | ( | CpswRemoteNotifyService_hwPushNotifyCbFxn | cbFxn, |
void * | cbArg | ||
) |
Register hardware push notification callback.
cbFxn | Callback function to be called when event occurs |
cbArg | Callback arguments |
void CpswProxy_unregisterHwPushNotifyCb | ( | void | ) |
Unregister hardware push notification callback.
void CpswProxy_setPromiscMode | ( | CpswProxy_Handle | hProxy, |
Enet_Handle | hEnet, | ||
uint32_t | coreKey, | ||
bool | enable | ||
) |
Set promiscuous mode.
hProxy | Handle to Cpsw Proxy |
hEnet | Unique opaque handle returned by CpswProxy_attach() or CpswProxy_attachExtended() |
coreKey | Unique core_key returned by CpswProxy_attach() or CpswProxy_attachExtended() |
enable | Promiscuous mode (enable or disable) |