RDK-B
Ethernet Switch HAL APIs

Description

Macros

#define UP   "up"
 
#define DOWN   "down"
 

Typedefs

typedef int(* CcspHalExtSw_ethAssociatedDevice_callback) (eth_device_t *eth_dev)
 This call back will be invoked when new Ethernet client come to associate to AP, or existing Ethernet client left. More...
 

Functions

int CcspHalEthSwInit (void)
 
int CcspHalEthSwGetPortStatus (CCSP_HAL_ETHSW_PORT PortId, PCCSP_HAL_ETHSW_LINK_RATE pLinkRate, PCCSP_HAL_ETHSW_DUPLEX_MODE pDuplexMode, PCCSP_HAL_ETHSW_LINK_STATUS pStatus)
 
int CcspHalEthSwGetPortCfg (CCSP_HAL_ETHSW_PORT PortId, PCCSP_HAL_ETHSW_LINK_RATE pLinkRate, PCCSP_HAL_ETHSW_DUPLEX_MODE pDuplexMode)
 
int CcspHalEthSwSetPortCfg (CCSP_HAL_ETHSW_PORT PortId, CCSP_HAL_ETHSW_LINK_RATE LinkRate, CCSP_HAL_ETHSW_DUPLEX_MODE DuplexMode)
 
int CcspHalEthSwGetPortAdminStatus (CCSP_HAL_ETHSW_PORT PortId, PCCSP_HAL_ETHSW_ADMIN_STATUS pAdminStatus)
 
int CcspHalEthSwSetPortAdminStatus (CCSP_HAL_ETHSW_PORT PortId, CCSP_HAL_ETHSW_ADMIN_STATUS AdminStatus)
 
int CcspHalEthSwSetAgingSpeed (CCSP_HAL_ETHSW_PORT PortId, int AgingSpeed)
 
int CcspHalEthSwLocatePortByMacAddress (unsigned char *mac, int *port)
 
int CcspHalExtSw_getAssociatedDevice (unsigned long *output_array_size, eth_device_t **output_struct)
 The HAL need to allocate array and return the array size by output_array_size. More...
 
void CcspHalExtSw_ethAssociatedDevice_callback_register (CcspHalExtSw_ethAssociatedDevice_callback callback_proc)
 Callback registration function. More...
 
int CcspHalExtSw_getEthWanEnable (unsigned char *pFlag)
 
int CcspHalExtSw_setEthWanEnable (unsigned char Flag)
 
int CcspHalExtSw_getEthWanPort (unsigned int *pPort)
 
int CcspHalExtSw_setEthWanPort (unsigned int Port)
 
int CcspHalEthSwGetEthPortStats (CCSP_HAL_ETHSW_PORT PortId, PCCSP_HAL_ETH_STATS pStats)
 
void GWP_RegisterEthWan_Callback (appCallBack *obj)
 This function will get used to register RDKB functions to the callback pointers. More...
 
int GWP_GetEthWanLinkStatus ()
 
int GWP_GetEthWanInterfaceName (unsigned char *Interface, unsigned long maxSize)
 This function will get used to retrieve the ETHWAN interface name. API returns 0 = success and 1 = fail. More...
 

Macro Definition Documentation

◆ UP

#define UP   "up"

Definition at line 711 of file ccsp_hal_ethsw.h.

◆ DOWN

#define DOWN   "down"

Definition at line 712 of file ccsp_hal_ethsw.h.

Typedef Documentation

◆ CcspHalExtSw_ethAssociatedDevice_callback

typedef int( * CcspHalExtSw_ethAssociatedDevice_callback) (eth_device_t *eth_dev)

This call back will be invoked when new Ethernet client come to associate to AP, or existing Ethernet client left.

Definition at line 539 of file ccsp_hal_ethsw.h.

Function Documentation

◆ CcspHalEthSwInit()

int CcspHalEthSwInit ( void  )

@description Do what needed to intialize the Eth hal.

Parameters
None
Returns
The status of the operation.
Return values
RETURN_OKif successful.
RETURN_ERRif any error is detected
Execution:\n Synchronous.
Side Effects:\n None.
Note
This function must not suspend and must not invoke any blocking system calls. It should probably just send a message to a driver event handler task.

◆ CcspHalEthSwGetPortStatus()

int CcspHalEthSwGetPortStatus ( CCSP_HAL_ETHSW_PORT  PortId,
PCCSP_HAL_ETHSW_LINK_RATE  pLinkRate,
PCCSP_HAL_ETHSW_DUPLEX_MODE  pDuplexMode,
PCCSP_HAL_ETHSW_LINK_STATUS  pStatus 
)

@description Retrieve the current port status – link speed, duplex mode, etc.

Parameters
PortId– Port ID as defined in CCSP_HAL_ETHSW_PORT
pLinkRate– Receives the current link rate, as in CCSP_HAL_ETHSW_LINK_RATE
pDuplexMode– Receives the current duplex mode, as in CCSP_HAL_ETHSW_DUPLEX_MODE
pStatus– Receives the current link status, as in CCSP_HAL_ETHSW_LINK_STATUS
Returns
The status of the operation.
Return values
RETURN_OKif successful.
RETURN_ERRif any error is detected
Execution:\n Synchronous.
Side Effects:\n None.
Note
This function must not suspend and must not invoke any blocking system calls. It should probably just send a message to a driver event handler task.

◆ CcspHalEthSwGetPortCfg()

int CcspHalEthSwGetPortCfg ( CCSP_HAL_ETHSW_PORT  PortId,
PCCSP_HAL_ETHSW_LINK_RATE  pLinkRate,
PCCSP_HAL_ETHSW_DUPLEX_MODE  pDuplexMode 
)

@description Retrieve the current port config – link speed, duplex mode, etc.

Parameters
PortId– Port ID as defined in CCSP_HAL_ETHSW_PORT
pLinkRate– Receives the current link rate, as in CCSP_HAL_ETHSW_LINK_RATE
pDuplexMode– Receives the current duplex mode, as in CCSP_HAL_ETHSW_DUPLEX_MODE
Returns
The status of the operation.
Return values
RETURN_OKif successful.
RETURN_ERRif any error is detected
Execution:\n Synchronous.
Side Effects:\n None.
Note
This function must not suspend and must not invoke any blocking system calls. It should probably just send a message to a driver event handler task.

◆ CcspHalEthSwSetPortCfg()

int CcspHalEthSwSetPortCfg ( CCSP_HAL_ETHSW_PORT  PortId,
CCSP_HAL_ETHSW_LINK_RATE  LinkRate,
CCSP_HAL_ETHSW_DUPLEX_MODE  DuplexMode 
)

@description Set the port configuration – link speed, duplex mode

Parameters
PortId– Port ID as defined in CCSP_HAL_ETHSW_PORT
LinkRate– Set the link rate, as in CCSP_HAL_ETHSW_LINK_RATE
DuplexMode– Set the duplex mode, as in CCSP_HAL_ETHSW_DUPLEX_MODE
Returns
The status of the operation.
Return values
RETURN_OKif successful.
RETURN_ERRif any error is detected
Execution:\n Synchronous.
Side Effects:\n None.
Note
This function must not suspend and must not invoke any blocking system calls. It should probably just send a message to a driver event handler task.

◆ CcspHalEthSwGetPortAdminStatus()

int CcspHalEthSwGetPortAdminStatus ( CCSP_HAL_ETHSW_PORT  PortId,
PCCSP_HAL_ETHSW_ADMIN_STATUS  pAdminStatus 
)

@description Retrieve the current port admin status.

Parameters
PortId– Port ID as defined in CCSP_HAL_ETHSW_PORT
pAdminStatus– Receives the current admin status
Returns
The status of the operation.
Return values
RETURN_OKif successful.
RETURN_ERRif any error is detected
Execution:\n Synchronous.
Side Effects:\n None.
Note
This function must not suspend and must not invoke any blocking system calls. It should probably just send a message to a driver event handler task.

◆ CcspHalEthSwSetPortAdminStatus()

int CcspHalEthSwSetPortAdminStatus ( CCSP_HAL_ETHSW_PORT  PortId,
CCSP_HAL_ETHSW_ADMIN_STATUS  AdminStatus 
)

@description Set the ethernet port admin status

Parameters
AdminStatus– Set the admin status, as defined in CCSP_HAL_ETHSW_ADMIN_STATUS
Returns
The status of the operation.
Return values
RETURN_OKif successful.
RETURN_ERRif any error is detected
Execution:\n Synchronous.
Side Effects:\n None.
Note
This function must not suspend and must not invoke any blocking system calls. It should probably just send a message to a driver event handler task.

◆ CcspHalEthSwSetAgingSpeed()

int CcspHalEthSwSetAgingSpeed ( CCSP_HAL_ETHSW_PORT  PortId,
int  AgingSpeed 
)

@description Set the ethernet port configuration – admin up/down, link speed, duplex mode

Parameters
PortId– Port ID as defined in CCSP_HAL_ETHSW_PORT
AgingSpeed– Integer value of aging speed
Returns
The status of the operation.
Return values
RETURN_OKif successful.
RETURN_ERRif any error is detected
Execution:\n Synchronous.
Side Effects:\n None.
Note
This function must not suspend and must not invoke any blocking system calls. It should probably just send a message to a driver event handler task.

◆ CcspHalEthSwLocatePortByMacAddress()

int CcspHalEthSwLocatePortByMacAddress ( unsigned char *  mac,
int *  port 
)

@description Query Moca and External switch port for the given MAC address

Parameters
mac– MAC address to search for
port– The return values are: 0: MoCA, 1-4: Ethernet port
Returns
The status of the operation.
Return values
RETURN_OKif successful.
RETURN_ERRif any error is detected or MAC address is not found
Execution:\n Synchronous.
Side Effects:\n None.
Note
This function must not suspend and must not invoke any blocking system calls. It should probably just send a message to a driver event handler task.

◆ CcspHalExtSw_getAssociatedDevice()

int CcspHalExtSw_getAssociatedDevice ( unsigned long *  output_array_size,
eth_device_t **  output_struct 
)

The HAL need to allocate array and return the array size by output_array_size.

◆ CcspHalExtSw_ethAssociatedDevice_callback_register()

void CcspHalExtSw_ethAssociatedDevice_callback_register ( CcspHalExtSw_ethAssociatedDevice_callback  callback_proc)

Callback registration function.

◆ CcspHalExtSw_getEthWanEnable()

int CcspHalExtSw_getEthWanEnable ( unsigned char *  pFlag)

@description Get EthernetWAN enable status.

Parameters
pFlag- Pointer to BOOLEAN to store current EthernetWAN enable value
Returns
The status of the operation
Return values
RETURN_OKif successful
RETURN_ERRif any error is detected
Side Effects:\n None

◆ CcspHalExtSw_setEthWanEnable()

int CcspHalExtSw_setEthWanEnable ( unsigned char  Flag)

@description Enable/Disable EthernetWAN functionality.

Parameters
Flag- EthernetWAN enable value
Returns
The status of the operation
Return values
RETURN_OKif successful
RETURN_ERRif any error is detected
Side Effects:\n None

◆ CcspHalExtSw_getEthWanPort()

int CcspHalExtSw_getEthWanPort ( unsigned int *  pPort)

@description Get EthernetWAN port number value.

Parameters
pPort- Pointer to UINT value to store current setting
Returns
The status of the operation
Return values
RETURN_OKif successful
RETURN_ERRif any error is detected
Side Effects:\n None

◆ CcspHalExtSw_setEthWanPort()

int CcspHalExtSw_setEthWanPort ( unsigned int  Port)

@description Set EthernetWAN interface/port number.

Parameters
Port- UINT value to set the setting
Returns
The status of the operation
Return values
RETURN_OKif successful
RETURN_ERRif any error is detected
Side Effects:\n None

◆ CcspHalEthSwGetEthPortStats()

int CcspHalEthSwGetEthPortStats ( CCSP_HAL_ETHSW_PORT  PortId,
PCCSP_HAL_ETH_STATS  pStats 
)

Description: Retrieve the current port's statistics.

Parameters : PortId – Port ID as defined in CCSP_HAL_ETHSW_PORT pStats – Receives port statistics

Returns
The status of the operation.
Return values
RETURN_OKif successful.
RETURN_ERRif any error is detected
Execution:\n Synchronous.
Side Effects:\n None.
Note
This function must not suspend and must not invoke any blocking system  calls. It should probably just send a message to a driver event handler task.

◆ GWP_RegisterEthWan_Callback()

void GWP_RegisterEthWan_Callback ( appCallBack obj)

This function will get used to register RDKB functions to the callback pointers.

◆ GWP_GetEthWanLinkStatus()

int GWP_GetEthWanLinkStatus ( )

Returns 1 if active, 0 for inactive

◆ GWP_GetEthWanInterfaceName()

int GWP_GetEthWanInterfaceName ( unsigned char *  Interface,
unsigned long  maxSize 
)

This function will get used to retrieve the ETHWAN interface name. API returns 0 = success and 1 = fail.