![]() |
ETHFW API Guide
|
This section contains APIs for CPSW Proxy Client. The CPSW Proxy Client resides on the remote cores and enables clients on remote cores to configure the Ethernet device via RPC.
CPSW Proxy Client implements a subset of the commands and notifications supported by Ethernet Firmware Remote Configuration interface described in Ethernet Firmware Remote Config Interface.
CPSW Proxy Client is currently used by remote clients running RTOS. It could be repurposed for other OSes, but may or may not require porting.
Data Structures | |
struct | CpswProxy_Config |
Cpsw Proxy client configuration structure. More... | |
struct | CpswProxy_HeartbeatCb |
Cpsw Proxy Heartbeat Callback info. More... | |
struct | CpswProxy_TimeSyncCb |
Cpsw Proxy TimeSync Callback info. More... | |
struct | CpswProxy_initParams |
Cpsw Proxy init params structure. More... | |
Functions | |
void | CpswProxy_initConfig (CpswProxy_initParams *params) |
CPSW Proxy init configuration parameters. More... | |
int32_t | CpswProxy_init (const CpswProxy_initParams *params) |
Initialize CPSW Proxy on a given core. More... | |
void | CpswProxy_deinit (void) |
De-initialize 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... | |
int32_t | CpswProxy_attach (CpswProxy_Handle hProxy, EthRemoteCfg_VirtPort virtPort, uint32_t *rxMtu, uint32_t *txMtu, uint32_t *pNumTxCh, uint32_t *pNumRxFlow, uint32_t *features) |
Attach to Ethernet device. More... | |
int32_t | CpswProxy_attachExtended (CpswProxy_Handle hProxy, EthRemoteCfg_VirtPort virtPort, uint32_t *rxMtu, uint32_t *txMtu, uint32_t *txPSILThreadId, uint32_t *rxFlowIdxBase, uint32_t *rxFlowIdxOffset, uint8_t *macAddr, uint32_t *features) |
Attach to Ethernet device with extended response. More... | |
int32_t | CpswProxy_detach (CpswProxy_Handle hProxy) |
Detach from Ethernet device. More... | |
int32_t | CpswProxy_allocTxCh (CpswProxy_Handle hProxy, uint32_t *txPSILThreadId, uint32_t chRelPriority) |
Allocate Tx channel. More... | |
int32_t | CpswProxy_freeTxCh (CpswProxy_Handle hProxy, uint32_t txChNum) |
Free Tx channel. More... | |
int32_t | CpswProxy_allocRxFlow (CpswProxy_Handle hProxy, uint32_t *rxFlowIdxBase, uint32_t *rxFlowIdxOffset, uint32_t flowIdx) |
Alloc Rx flow. More... | |
int32_t | CpswProxy_freeRxFlow (CpswProxy_Handle hProxy, uint32_t rxFlowIdxBase, uint32_t rxFlowIdxOffset) |
Free Rx flow. More... | |
int32_t | CpswProxy_allocMac (CpswProxy_Handle hProxy, uint8_t *macAddr) |
Allocate MAC address. More... | |
int32_t | CpswProxy_freeMac (CpswProxy_Handle hProxy, const uint8_t *macAddr) |
Free MAC address. More... | |
int32_t | CpswProxy_registerDstMacRxFlow (CpswProxy_Handle hProxy, uint32_t flowIdxBase, uint32_t flowIdxOffset, const uint8_t *macAddr) |
Register destination MAC address with the given flow index. More... | |
int32_t | CpswProxy_unregisterDstMacRxFlow (CpswProxy_Handle hProxy, uint32_t flowIdxBase, uint32_t flowIdxOffset, const uint8_t *macAddr) |
Unregister destination MAC address from the given flow index. More... | |
int32_t | CpswProxy_registerEthertypeRxFlow (CpswProxy_Handle hProxy, uint32_t flowIdxBase, uint32_t flowIdxOffset, uint16_t etherType) |
Register EtherType to the given Rx flow id. More... | |
int32_t | CpswProxy_unregisterEthertypeRxFlow (CpswProxy_Handle hProxy, uint16_t etherType) |
Unregister the given EtherType to the given rx flow id. More... | |
int32_t | CpswProxy_registerDefaultRxFlow (CpswProxy_Handle hProxy, uint32_t flowIdxBase, uint32_t flowIdxOffset) |
Register default flow to the given flow index. More... | |
int32_t | CpswProxy_unregisterDefaultRxFlow (CpswProxy_Handle hProxy, uint32_t flowIdxBase, uint32_t flowIdxOffset) |
Unregister default flow from the given flow index. More... | |
int32_t | CpswProxy_registerIPV4Addr (CpswProxy_Handle hProxy, uint8_t *macAddr, uint8_t *ipv4Addr) |
Register association of IPv4 address with MAC address by adding ARP entry in the master core. More... | |
int32_t | CpswProxy_unregisterIPV4Addr (CpswProxy_Handle hProxy, uint8_t *ipv4Addr) |
Unregister association of IPv4 address with MAC address by removing ARP entry in the master core. More... | |
int32_t | CpswProxy_joinVlan (CpswProxy_Handle hProxy, uint32_t flowIdxBase, uint32_t flowIdxOffset, const uint8_t *macAddr, uint16_t vlanId) |
Join a VLAN. More... | |
int32_t | CpswProxy_leaveVlan (CpswProxy_Handle hProxy, uint32_t flowIdxBase, uint32_t flowIdxOffset, const uint8_t *macAddr, uint16_t vlanId) |
Leave a VLAN. More... | |
int32_t | CpswProxy_filterAddMac (CpswProxy_Handle hProxy, uint32_t flowIdxBase, uint32_t flowIdxOffset, const uint8_t *macAddr, uint16_t vlanId) |
Add multicast address to receive filter. More... | |
int32_t | CpswProxy_filterDelMac (CpswProxy_Handle hProxy, const uint8_t *macAddr, uint16_t vlanId) |
Delete multicast address from receive filter. More... | |
bool | CpswProxy_isPhyLinked (CpswProxy_Handle hProxy) |
Query the link status. More... | |
int32_t | CpswProxy_teardownCompletion (CpswProxy_Handle hProxy) |
Send DMA teardown completion notification. More... | |
int32_t | CpswProxy_dumpStats (CpswProxy_Handle hProxy) |
Dump network statistics on remote side. More... | |
int32_t | CpswProxy_getServerStatus (CpswProxy_Handle hProxy, EthRemoteCfg_ServerStatus *serverStatus) |
Get Server status. More... | |
int32_t | CpswProxy_registerRemoteTimer (CpswProxy_Handle hProxy, uint8_t timerId, uint8_t hwPushNum) |
Register remote core's timer for synchronization. More... | |
int32_t | CpswProxy_unregisterRemoteTimer (CpswProxy_Handle hProxy, uint8_t hwPushNum) |
Unregister remote core's timer for synchronization,. More... | |
int32_t | CpswProxy_registerNotifyCb (CpswProxy_Handle hProxy, uint32_t notifyType, CpswProxy_NotifyCbFxn cbFxn, void *cbArg) |
Register notification callback. More... | |
int32_t | CpswProxy_unregisterNotifyCb (CpswProxy_Handle hProxy, uint32_t notifyType) |
Unregister notification callback. More... | |
int32_t | CpswProxy_allocHwPushInst (CpswProxy_Handle hProxy, uint32_t *hwPushNum) |
Allocate CPTS HW push instance. More... | |
int32_t | CpswProxy_freeHwPushInst (CpswProxy_Handle hProxy, uint32_t hwPushNum) |
Free CPTS HW push instance. More... | |
int32_t | CpswProxy_sendCmd (CpswProxy_Handle hProxy, uint32_t reqType, EthRemoteCfg_ReqHdr *req, uint16_t reqLen, EthRemoteCfg_ResHdr *res, uint16_t resLen) |
Send an remote command. More... | |
static bool | CpswProxy_isSwitchPort (EthRemoteCfg_VirtPort portId) |
Check whether port is a virtual switch port or not. More... | |
static bool | CpswProxy_isMacPort (EthRemoteCfg_VirtPort portId) |
Check whether port is a virtual MAC port or not. More... | |
static uint32_t | CpswProxy_getPortNum (EthRemoteCfg_VirtPort portId) |
Get virtual port number. More... | |
Typedefs | |
typedef void(* | CpswProxy_NotifyCbFxn) (uint32_t notifyType, void *notifyArg, void *cbArg) |
CPSW remote notification callback. More... | |
typedef void(* | CpswProxy_HeartbeatCbFxn) (EthRemoteCfg_ServerStatus serverStatus, void *cbArg) |
CPSW Proxy Heartbeat notification callback. More... | |
typedef struct CpswProxy_ClientObj_s * | CpswProxy_Handle |
CPSW Proxy handle. More... | |
Macros | |
#define | CPSWPROXY_HB_DEFAULT_POLL_PERIOD_MS (1000U) |
#define | CPSWPROXY_CMD_DEFAULT_TIMEOUT_MS (1000U) |
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).
#define CPSWPROXY_HB_DEFAULT_POLL_PERIOD_MS (1000U) |
Heartbeat default period.
#define CPSWPROXY_CMD_DEFAULT_TIMEOUT_MS (1000U) |
Command response default timeout.
typedef void(* CpswProxy_NotifyCbFxn) (uint32_t notifyType, void *notifyArg, void *cbArg) |
CPSW remote notification callback.
Clients can register a callback function of this type to get notified of events on the Ethernet Firmware remote side.
notifyType | Notification type, see EthRemoteCfg_NotifyType. |
notifyArg | Notification argument, specific to the notification type. |
cbArg | Callback argument passed at the time of registration. |
typedef void(* CpswProxy_HeartbeatCbFxn) (EthRemoteCfg_ServerStatus serverStatus, void *cbArg) |
CPSW Proxy Heartbeat notification callback.
Clients can register a callback function of this type to get notified of status of the Ethernet Firmware remote side.
serverStatus | Status of ETHFW server. |
cbArg | Callback argument passed at the time of registration. |
typedef struct CpswProxy_ClientObj_s* CpswProxy_Handle |
CPSW Proxy handle.
CPSW Proxy opaque handle.
void CpswProxy_initConfig | ( | CpswProxy_initParams * | params | ) |
CPSW Proxy init configuration parameters.
Sets the CPSW Proxy configuration parameters. It needs to be called only once per core and it is optional function that app should call, but not mandatory.
params | Init configuration params. |
int32_t CpswProxy_init | ( | const CpswProxy_initParams * | params | ) |
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 is mandatory function that app should call.
params | Init configuration params. |
void CpswProxy_deinit | ( | void | ) |
De-initialize CPSW Proxy on a given core.
Performs one-time de-initialization 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. Each virtPort will get a proxy handle, which will be used in CPSW Proxy APIs.
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 |
int32_t CpswProxy_attach | ( | CpswProxy_Handle | hProxy, |
EthRemoteCfg_VirtPort | virtPort, | ||
uint32_t * | rxMtu, | ||
uint32_t * | txMtu, | ||
uint32_t * | pNumTxCh, | ||
uint32_t * | pNumRxFlow, | ||
uint32_t * | features | ||
) |
Attach to Ethernet device.
This is the first function to be called by a client after the connection with the remote Ethernet device has been established via CpswProxy_open().
Alternatively, clients that require a single Rx and single Tx channel could use CpswProxy_attachExtended() which provides the same functionality as this function, but it also performs allocation of one Tx channel, one Rx flow and one MAC address.
hProxy | Handle to Cpsw Proxy. |
virtPort | Virtual port id to attach to. |
rxMtu | Pointer to maximum receive packet length. Populated by this function. |
txMtu | Array of maximum transmit packet length per priority supported by the Ethernet device. |
pNumTxCh | Pointer to number of tx channels allocated to the virtual port |
pNumRxFlow | Pointer to number of rx flows allocated to the virtual port |
features | Supported features flag (see EthRemoteCfg_FeatureMask) |
int32_t CpswProxy_attachExtended | ( | CpswProxy_Handle | hProxy, |
EthRemoteCfg_VirtPort | virtPort, | ||
uint32_t * | rxMtu, | ||
uint32_t * | txMtu, | ||
uint32_t * | txPSILThreadId, | ||
uint32_t * | rxFlowIdxBase, | ||
uint32_t * | rxFlowIdxOffset, | ||
uint8_t * | macAddr, | ||
uint32_t * | features | ||
) |
Attach to Ethernet device with extended response.
This is the first function to be called by a client after the connection with the remote Ethernet device has been established via CpswProxy_open().
It's an alternative option to CpswProxy_attach() that can be used in clients that require a single Rx and single Tx channel. In addition to attaching to the remote Ethernet device, this function also allocates one Tx channel, one Rx flow and one MAC address.
hProxy | Handle to Cpsw Proxy. |
virtPort | Virtual port id to attach to. |
rxMtu | Pointer to maximum receive packet length. Populated by this function. |
txMtu | Array of maximum transmit packet length per priority supported by Ethernet device. |
txPSILThreadId | Pointer to allocated Tx Channel CPSW PSIL destination thread id populated by this function. |
rxFlowIdxBase | Pointer to RX flow index base value. |
rxFlowIdxOffset | Pointer to RX flow offset to be allocated. |
macAddr | Pointer to allocated destination MAC address allocated to remote core populated by this function. |
features | Supported features flag (see EthRemoteCfg_FeatureMask) |
int32_t CpswProxy_detach | ( | CpswProxy_Handle | hProxy | ) |
Detach from Ethernet device.
Detaches the local client from remote Ethernet device.
hProxy | Handle to Cpsw Proxy. |
int32_t CpswProxy_allocTxCh | ( | CpswProxy_Handle | hProxy, |
uint32_t * | txPSILThreadId, | ||
uint32_t | chRelPriority | ||
) |
Allocate Tx channel.
Allocates a TX channel to be used exclusively by this client. The channel is returned as a Tx PSIL destination thread id which client can use to configure the DMA channel.
hProxy | Handle to Cpsw Proxy. |
txPSILThreadId | Allocated Tx channel CPSW PSIL destination thread id, populated by this function. |
chRelPriority | Tx channel priority (relative) which client want to allocate |
int32_t CpswProxy_freeTxCh | ( | CpswProxy_Handle | hProxy, |
uint32_t | txChNum | ||
) |
Free Tx channel.
Deallocates a TX channel previously allocated through CpswProxy_allocTxCh() or CpswProxy_attachExtended().
hProxy | Handle to Cpsw Proxy. |
txChNum | Tx channel CPSW PSIL destination thread id to be freed. |
int32_t CpswProxy_allocRxFlow | ( | CpswProxy_Handle | hProxy, |
uint32_t * | rxFlowIdxBase, | ||
uint32_t * | rxFlowIdxOffset, | ||
uint32_t | flowIdx | ||
) |
Alloc Rx flow.
Allocates a Rx flow to be used exclusively by this client. The Rx flow idx is returned as a pair of base and offset values. The absolute flow idx is: rxFlowIdxBase + rxFlowIdxOffset
.
hProxy | Handle to Cpsw Proxy. |
rxFlowIdxBase | Pointer to RX flow index base value. |
rxFlowIdxOffset | Pointer to RX flow offset to be allocated. |
flowIdx | Relative index of rx flow among available numRxFlow |
int32_t CpswProxy_freeRxFlow | ( | CpswProxy_Handle | hProxy, |
uint32_t | rxFlowIdxBase, | ||
uint32_t | rxFlowIdxOffset | ||
) |
Free Rx flow.
Frees a Rx flow previously allocated through CpswProxy_allocRxFlow() or CpswProxy_attachExtended().
hProxy | Handle to Cpsw Proxy. |
rxFlowIdxBase | RX flow index base value. |
rxFlowIdxOffset | RX flow offset to be freed. |
int32_t CpswProxy_allocMac | ( | CpswProxy_Handle | hProxy, |
uint8_t * | macAddr | ||
) |
Allocate MAC address.
Allocates a MAC address from server's MAC address pool. Client may choose to use a locally allocated MAC address instead, in which case this function is not required.
hProxy | Handle to Cpsw Proxy |
macAddr | Pointer to MAC address to be allocated. |
int32_t CpswProxy_freeMac | ( | CpswProxy_Handle | hProxy, |
const uint8_t * | macAddr | ||
) |
Free MAC address.
Frees a MAC address previously allocated through CpswProxy_allocMac() or CpswProxy_attachExtended().
hProxy | Handle to Cpsw Proxy. |
macAddr | MAC address to be freed. |
int32_t CpswProxy_registerDstMacRxFlow | ( | CpswProxy_Handle | hProxy, |
uint32_t | flowIdxBase, | ||
uint32_t | flowIdxOffset, | ||
const uint8_t * | macAddr | ||
) |
Register destination MAC address with the given flow index.
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 (flowIdxBase + flowIdxOffset).
RX flow idx must be set up prior to calling this function.
hProxy | Handle to Cpsw Proxy. |
flowIdxBase | RX flow index base value. |
flowIdxOffset | RX flow offset. |
macAddr | Destination MAC address to be registered. |
int32_t CpswProxy_unregisterDstMacRxFlow | ( | CpswProxy_Handle | hProxy, |
uint32_t | flowIdxBase, | ||
uint32_t | flowIdxOffset, | ||
const uint8_t * | macAddr | ||
) |
Unregister destination MAC address from the given flow index.
Unregister a destination MAC address previously registered via CpswProxy_registerDstMacRxFlow(). Upon successful unregistration, packets with the provided MAC address will no longer be routed to RX flow index (flowIdxBase + flowIdxBase).
hProxy | Handle to Cpsw Proxy. |
flowIdxBase | RX flow index base value. |
flowIdxOffset | RX flow offset. |
macAddr | Destination MAC address to be unregistered. |
int32_t CpswProxy_registerEthertypeRxFlow | ( | CpswProxy_Handle | hProxy, |
uint32_t | flowIdxBase, | ||
uint32_t | flowIdxOffset, | ||
uint16_t | etherType | ||
) |
Register EtherType to the given Rx flow id.
Registers an EtherType-based route to the provided flow idx.
RX flow idx must be set up prior to calling this function.
hProxy | Handle to Cpsw Proxy. |
flowIdxBase | RX flow index base value. |
flowIdxOffset | RX flow offset. |
etherType | EtherType to be associated with the Rx flow idx. |
int32_t CpswProxy_unregisterEthertypeRxFlow | ( | CpswProxy_Handle | hProxy, |
uint16_t | etherType | ||
) |
Unregister the given EtherType to the given rx flow id.
Unregisters the EtherType-based route. Upon successful unregistration, packets with the given EtherType will be routed to the default flow.
hProxy | Handle to Cpsw Proxy. |
etherType | Ethertype to be disassociated from the given Rx flow idx. |
int32_t CpswProxy_registerDefaultRxFlow | ( | CpswProxy_Handle | hProxy, |
uint32_t | flowIdxBase, | ||
uint32_t | flowIdxOffset | ||
) |
Register default flow to the given flow index.
Enables routing of default traffic (traffic not matching any classifier with thread id configured) to the given Rx flowIdx.
RX flow idx must be set up prior to calling this function.
hProxy | Handle to Cpsw Proxy. |
flowIdxBase | RX flow index base value. |
flowIdxOffset | RX flow offset. |
int32_t CpswProxy_unregisterDefaultRxFlow | ( | CpswProxy_Handle | hProxy, |
uint32_t | flowIdxBase, | ||
uint32_t | flowIdxOffset | ||
) |
Unregister default flow from the given flow index.
Disables routing of default traffic (traffic not matching any classifier with thread id configured) to the given Rx flowIdx. Once disabled, all default traffic will be routed to the reserved flow resulting in all packets of default flow being dropped.
hProxy | Handle to Cpsw Proxy. |
flowIdxBase | RX flow index base value. |
flowIdxOffset | RX flow offset. |
int32_t CpswProxy_registerIPV4Addr | ( | CpswProxy_Handle | hProxy, |
uint8_t * | macAddr, | ||
uint8_t * | ipv4Addr | ||
) |
Register association of IPv4 address with MAC address by adding ARP entry in the master core.
Register an IPv4 address in master core ARP table which will respond to ARP request messages on behalf of the client.
hProxy | Handle to Cpsw Proxy. |
macAddr | MAC address with which the IPv4 address will be associated. |
ipv4Addr | IPv4 address to be added to ARP database. |
int32_t CpswProxy_unregisterIPV4Addr | ( | CpswProxy_Handle | hProxy, |
uint8_t * | ipv4Addr | ||
) |
Unregister association of IPv4 address with MAC address by removing ARP entry in the master core.
Unregisters an IPv4 address from master core ARP table. Upon successful unregistration, the remote core will no longer respond to ARP request messages for the IPv4 address.
hProxy | Handle to Cpsw Proxy. |
ipv4Addr | IPv4 address to be unregistered. |
int32_t CpswProxy_joinVlan | ( | CpswProxy_Handle | hProxy, |
uint32_t | flowIdxBase, | ||
uint32_t | flowIdxOffset, | ||
const uint8_t * | macAddr, | ||
uint16_t | vlanId | ||
) |
Join a VLAN.
Joins a client to a VLAN registered on the server side.
VLAN creation is done by Ethernet Firmware server at init time, it sets up all VLANs, including the VLAN member list, flood masks, etc. The server also defines which remote clients can join the VLAN.
If the client is allowed to join the VLAN, the server will setup a route for VLAN tagged unicast packets matching the destination MAC address provided in this function.
RX flow idx must be set up prior to calling this function.
hProxy | Handle to Cpsw Proxy. |
flowIdxBase | RX flow index base value. |
flowIdxOffset | RX flow offset. |
macAddr | MAC address (unicast). |
vlanId | VLAN id to join. |
int32_t CpswProxy_leaveVlan | ( | CpswProxy_Handle | hProxy, |
uint32_t | flowIdxBase, | ||
uint32_t | flowIdxOffset, | ||
const uint8_t * | macAddr, | ||
uint16_t | vlanId | ||
) |
Leave a VLAN.
Leaves a previously joined VLAN, registered on the server side.
Client's route setup at the time of joining will be deleted after client leaves the VLAN.
hProxy | Handle to Cpsw Proxy. |
flowIdxBase | RX flow index base value. |
flowIdxOffset | RX flow offset. |
macAddr | MAC address (unicast). |
vlanId | VLAN id to leave. |
int32_t CpswProxy_filterAddMac | ( | CpswProxy_Handle | hProxy, |
uint32_t | flowIdxBase, | ||
uint32_t | flowIdxOffset, | ||
const uint8_t * | macAddr, | ||
uint16_t | vlanId | ||
) |
Add multicast address to receive filter.
Adds a multicast address to the receive filter. Ethernet Firmware differentiates multicast addresses as shared or _exclusive).
RX flow idx must be set up prior to calling this function.
hProxy | Handle to Cpsw Proxy |
flowIdxBase | RX flow index base value. |
flowIdxOffset | RX flow offset. |
macAddr | Multicast MAC address to be added to receive filter. |
vlanId | VLAN id. |
int32_t CpswProxy_filterDelMac | ( | CpswProxy_Handle | hProxy, |
const uint8_t * | macAddr, | ||
uint16_t | vlanId | ||
) |
Delete multicast address from receive filter.
Deletes a multicast address to the receive filter previous added through CpswProxy_filterAddMac().
hProxy | Handle to Cpsw Proxy. |
macAddr | Multicast MAC address to be deleted from receive filter. |
vlanId | VLAN id. |
bool CpswProxy_isPhyLinked | ( | CpswProxy_Handle | hProxy | ) |
Query the link status.
Queries the link status of the virtual port which depends on the virtual port type:
hProxy | Handle to Cpsw Proxy. |
int32_t CpswProxy_teardownCompletion | ( | CpswProxy_Handle | hProxy | ) |
Send DMA teardown completion notification.
Sends a DMA tear-down completion notification to ETHFW so it can proceed with Ethernet device recovery.
hProxy | Handle to Cpsw Proxy. |
int32_t CpswProxy_dumpStats | ( | CpswProxy_Handle | hProxy | ) |
Dump network statistics on remote side.
Request network statistics, ALE table, policer table to be dumped into ETHFW logs.
hProxy | Handle to Cpsw Proxy. |
int32_t CpswProxy_getServerStatus | ( | CpswProxy_Handle | hProxy, |
EthRemoteCfg_ServerStatus * | serverStatus | ||
) |
Get Server status.
Get the status of the Ethernet Firmware.
hProxy | Handle to Cpsw Proxy. |
serverStatus | Pointer to status of ETHFW server. |
int32_t CpswProxy_registerRemoteTimer | ( | CpswProxy_Handle | hProxy, |
uint8_t | timerId, | ||
uint8_t | hwPushNum | ||
) |
Register remote core's timer for synchronization.
Register the remote core's timer with Ethernet Firmware, which will configure the Time Sync Router (TSR) to route timer timerId
events to the given CPTS hardware push number.
hProxy | Handle to Cpsw Proxy. |
timerId | Input Id number of timer in TSR. |
hwPushNum | CPTS hardware push number. |
int32_t CpswProxy_unregisterRemoteTimer | ( | CpswProxy_Handle | hProxy, |
uint8_t | hwPushNum | ||
) |
Unregister remote core's timer for synchronization,.
Unregisters the remote core's timer previously registered through CpswProxy_registerRemoteTimer(). Ethernet Firmware will clear the Time Sync Router (TSR) configuration previously done for the given CPTS hardware push number.
hProxy | Handle to Cpsw Proxy. |
hwPushNum | Hardware push number of CPTS. |
int32_t CpswProxy_registerNotifyCb | ( | CpswProxy_Handle | hProxy, |
uint32_t | notifyType, | ||
CpswProxy_NotifyCbFxn | cbFxn, | ||
void * | cbArg | ||
) |
Register notification callback.
Registers a callback function for the provided notification type in oder to get notified of events on the Ethernet Firmware remote side.
hProxy | Handle to Cpsw Proxy. |
notifyType | Notification type, see EthRemoteCfg_NotifyType. |
cbFxn | Callback function to be called when event occurs. |
cbArg | App's specific callback arguments. |
int32_t CpswProxy_unregisterNotifyCb | ( | CpswProxy_Handle | hProxy, |
uint32_t | notifyType | ||
) |
Unregister notification callback.
Unregisters a callback function for the provided notification type.
hProxy | Handle to Cpsw Proxy. |
notifyType | Notification type, see EthRemoteCfg_NotifyType. |
int32_t CpswProxy_allocHwPushInst | ( | CpswProxy_Handle | hProxy, |
uint32_t * | hwPushNum | ||
) |
Allocate CPTS HW push instance.
Allocates a CPTS HW push instance from RM.
hProxy | Handle to Cpsw Proxy |
hwPushNum | Pointer to HW push instance to be allocated. |
int32_t CpswProxy_freeHwPushInst | ( | CpswProxy_Handle | hProxy, |
uint32_t | hwPushNum | ||
) |
Free CPTS HW push instance.
Frees an allocated CPTS HW push instance from RM.
hProxy | Handle to Cpsw Proxy |
hwPushNum | HW push instance to be freed. |
int32_t CpswProxy_sendCmd | ( | CpswProxy_Handle | hProxy, |
uint32_t | reqType, | ||
EthRemoteCfg_ReqHdr * | req, | ||
uint16_t | reqLen, | ||
EthRemoteCfg_ResHdr * | res, | ||
uint16_t | resLen | ||
) |
Send an remote command.
Send an command to ETHFW.This function can be used to send any supported remote commands to ETHFW.Note that it's recommended to use the dedicated CPSW Proxy Client API if one exists for the desired functionality.
hProxy | Handle to Cpsw Proxy. |
reqType | Request type. |
req | Command request message, see EthRemoteCfg_ReqHdr. |
reqLen | Command request length. |
res | Command response message, see EthRemoteCfg_ResHdr. |
resLen | Command response length. |
|
inlinestatic |
Check whether port is a virtual switch port or not.
portId | [in] Virtual port id. |
|
inlinestatic |
Check whether port is a virtual MAC port or not.
portId | [in] Virtual port id. |
|
inlinestatic |
Get virtual port number.
Gets the port number of a virtual port. Virtual switch ports numbers are 0-relative and virtual MAC ports are 1-relative.
portId | [in] Virtual port id. |