mirror of
https://github.com/plappermaul/realtek-doc.git
synced 2025-12-10 07:44:41 +01:00
1198 lines
32 KiB
C
1198 lines
32 KiB
C
/*
|
|
* Copyright (C) 2009-2016 Realtek Semiconductor Corp.
|
|
* All Rights Reserved.
|
|
*
|
|
* This program is the proprietary software of Realtek Semiconductor
|
|
* Corporation and/or its licensors, and only be used, duplicated,
|
|
* modified or distributed under the authorized license from Realtek.
|
|
*
|
|
* ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
|
|
* THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
|
|
*
|
|
* $Revision$
|
|
* $Date$
|
|
*
|
|
* Purpose : Definition of Port API
|
|
*
|
|
* Feature : The file have include the following module and sub-modules
|
|
* (1) Parameter settings for the port-based view
|
|
* (2) UDLD
|
|
* (3) RLDP
|
|
*/
|
|
|
|
#ifndef __RTK_PORT_H__
|
|
#define __RTK_PORT_H__
|
|
|
|
/*
|
|
* Include Files
|
|
*/
|
|
#include <common/rt_type.h>
|
|
#include <hal/chipdef/chipdef.h>
|
|
#include <rtk/sds.h>
|
|
#include <rtk/phy.h>
|
|
/*
|
|
* Symbol Definition
|
|
*/
|
|
#define RTK_PHY_MAC_INTF_SDS_MAX (2)
|
|
|
|
typedef enum rtk_portMiscCtrl_e {
|
|
RTK_PORT_MISC_CTRL_IPG_STK_MODE, /* per port IPG stacking mode */
|
|
RTK_PORT_MISC_CTRL_END
|
|
} rtk_portMiscCtrl_t;
|
|
|
|
|
|
/*
|
|
* Function Declaration
|
|
*/
|
|
|
|
|
|
/* Function Name:
|
|
* rtk_port_init
|
|
* Description:
|
|
* Initialize port module of the specified device.
|
|
* Input:
|
|
* unit - unit id
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* Must initialize port module before calling any port APIs.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_init(uint32 unit);
|
|
|
|
/* Module Name : Port */
|
|
/* Sub-module Name: Parameter settings for the port-based view */
|
|
|
|
/* Function Name:
|
|
* rtk_port_link_get
|
|
* Description:
|
|
* Get the link status of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* Output:
|
|
* pStatus - pointer to the link status
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* The link status of the port is as following:
|
|
* - PORT_LINKDOWN
|
|
* - PORT_LINKUP
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_link_get(uint32 unit, rtk_port_t port, rtk_port_linkStatus_t *pStatus);
|
|
|
|
/* Function Name:
|
|
* rtk_port_flowctrl_get
|
|
* Description:
|
|
* Get the negotiated flow control status of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* Output:
|
|
* pTxStatus - pointer to the negotiation result of the Tx flow control
|
|
* pRxStatus - pointer to the negotiation result of the Rx flow control
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* RT_ERR_PORT_LINKDOWN - link down port status
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_flowctrl_get(
|
|
uint32 unit,
|
|
rtk_port_t port,
|
|
uint32 *pTxStatus,
|
|
uint32 *pRxStatus);
|
|
|
|
/* Function Name:
|
|
* rtk_port_cpuPortId_get
|
|
* Description:
|
|
* Get CPU port id of the specific unit
|
|
* Input:
|
|
* unit - unit id
|
|
* Output:
|
|
* pPort - pointer to CPU port id
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_cpuPortId_get(uint32 unit, rtk_port_t *pPort);
|
|
|
|
/* Function Name:
|
|
* rtk_port_isolation_get
|
|
* Description:
|
|
* Get the portmask of the port isolation
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* Output:
|
|
* pPortmask - pointer to the portmask
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* (1) Each port can specify an allowable egress forwarding portmask.
|
|
* (2) To config switches in stacking system, uses rtk_port_isolationExt_get() instead.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_isolation_get(uint32 unit, rtk_port_t port, rtk_portmask_t *pPortmask);
|
|
|
|
/* Function Name:
|
|
* rtk_port_isolation_set
|
|
* Description:
|
|
* Set the portmask of the port isolation
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* pPortmask - pointer to the portmask
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_PORT_MASK - invalid port mask
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* (1) Each port can specify an allowable egress forwarding portmask.
|
|
* (2) To config switches in stacking system, uses rtk_port_isolationExt_set() instead.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_isolation_set(uint32 unit, rtk_port_t port, rtk_portmask_t *pPortmask);
|
|
|
|
/* Function Name:
|
|
* rtk_port_isolationExt_get
|
|
* Description:
|
|
* Get the port isolation portmask for packet received from specified unit and port.
|
|
* Input:
|
|
* unit - unit id
|
|
* devID - source dev id
|
|
* srcPort - source port id
|
|
* Output:
|
|
* pPortmask - pointer to the portmask that packet can be forwarded to when it is received from devID and srcPort
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 9300, 9310
|
|
* Note:
|
|
* In stacking system, each (dev, port) pair should be assigned the permit outgoing portmask of this device.
|
|
* Changes:
|
|
* [3.2.0]
|
|
* Change srcUnit to devID.
|
|
* [SDK_3.0.0]
|
|
* New added function.
|
|
*/
|
|
int32
|
|
rtk_port_isolationExt_get(uint32 unit, uint32 devID, rtk_port_t srcPort, rtk_portmask_t *pPortmask);
|
|
|
|
/* Function Name:
|
|
* rtk_port_isolationExt_set
|
|
* Description:
|
|
* Set the port isolation portmask for packet received from specified unit and port.
|
|
* Input:
|
|
* unit - unit id
|
|
* devID - source dev id
|
|
* srcPort - source port id
|
|
* pPortmask - pointer to the portmask that packet can be forwarded to when it is received from devID and srcPort
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_PORT_MASK - invalid port mask
|
|
* Applicable:
|
|
* 9300, 9310
|
|
* Note:
|
|
* In stacking system, each (dev, port) pair should be assigned the permit outgoing portmask of this device.
|
|
* Changes:
|
|
* [3.2.0]
|
|
* Change srcUnit to devID.
|
|
* [SDK_3.0.0]
|
|
* New added function.
|
|
*/
|
|
int32
|
|
rtk_port_isolationExt_set(uint32 unit, uint32 devID, rtk_port_t srcPort, rtk_portmask_t *pPortmask);
|
|
|
|
/* Function Name:
|
|
* rtk_port_isolation_add
|
|
* Description:
|
|
* Add an isolation port to the certain port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* iso_port - isolation port id
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* (1) Default value of each port represent bit in portmask is 1
|
|
* (2) Port and iso_port will be isolated when this API is called
|
|
* (3) The iso_port to the relative portmask bit will be set to 1
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_isolation_add(uint32 unit, rtk_port_t port, rtk_port_t iso_port);
|
|
|
|
/* Function Name:
|
|
* rtk_port_isolation_del
|
|
* Description:
|
|
* Delete an existing isolation port of the certain port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* iso_port - isolation port id
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* (1) Default value of each port represent bit in portmask is 1
|
|
* (2) Isolated status between the port and the iso_port is removed when this API is called
|
|
* (3) The iso_port to the relative portmask bit will be set to 0
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_isolation_del(uint32 unit, rtk_port_t port, rtk_port_t iso_port);
|
|
|
|
/* Function Name:
|
|
* rtk_port_isolationRestrictRoute_get
|
|
* Description:
|
|
* Get status of routed packet whether restrict by port isolation
|
|
* Input:
|
|
* unit - unit id
|
|
* Output:
|
|
* pEnable - pointer to enable status of port isolation restrict route
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* Applicable:
|
|
* 9300, 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* [SDK_3.0.0]
|
|
* New added function.
|
|
*/
|
|
int32
|
|
rtk_port_isolationRestrictRoute_get(uint32 unit, rtk_enable_t *pEnable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_isolationRestrictRoute_set
|
|
* Description:
|
|
* Set status of routed packet whether restrict by port isolation
|
|
* Input:
|
|
* unit - unit id
|
|
* enable - enable status of port isolaiton restrict route
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* Applicable:
|
|
* 9300, 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* [SDK_3.0.0]
|
|
* New added function.
|
|
*/
|
|
extern int32
|
|
rtk_port_isolationRestrictRoute_set(uint32 unit, rtk_enable_t enable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_backpressureEnable_get
|
|
* Description:
|
|
* Get the half duplex backpressure enable status of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* Output:
|
|
* pEnable - pointer to the enable status of backpressure in half duplex mode
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* (1) The mac back pressure enable status of the port is as following:
|
|
* - DISABLED
|
|
* - ENABLED
|
|
* (2) Used to support backpressure in half mode.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_backpressureEnable_get(uint32 unit, rtk_port_t port, rtk_enable_t *pEnable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_backpressureEnable_set
|
|
* Description:
|
|
* Set the half duplex backpressure enable status of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* enable - enable status of backpressure in half duplex mode
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_INPUT - invalid input parameter
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* (1) The mac back pressure enable status of the port is as following:
|
|
* - DISABLED
|
|
* - ENABLED
|
|
* (2) Used to support backpressure in half mode.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_backpressureEnable_set(uint32 unit, rtk_port_t port, rtk_enable_t enable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_linkMon_enable
|
|
* Description:
|
|
* Enable link monitor thread
|
|
* Input:
|
|
* scan_interval_us - scan interval in us.
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK - initialize success
|
|
* RT_ERR_FAILED - initialize fail
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_OUT_OF_RANGE - scan interval is too small
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* When enable link monitor thread, all link change interrupt will be handled by thread.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_linkMon_enable(uint32 unit, uint32 scan_interval_us);
|
|
|
|
/* Function Name:
|
|
* rtk_port_linkMon_disable
|
|
* Description:
|
|
* Disable link scan thread
|
|
* Input:
|
|
* unit - unit index
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK - initialize success
|
|
* RT_ERR_FAILED - initialize fail
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* When disable link monitor thread, all link change interrupt will be callback to upper layer.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_linkMon_disable(uint32 unit);
|
|
|
|
/* Function Name:
|
|
* rtk_port_linkMon_register
|
|
* Description:
|
|
* Register callback function for link change notification
|
|
* Input:
|
|
* linkMon_callback - callback function for link change
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_linkMon_register(rtk_port_linkMon_callback_t linkMon_callback);
|
|
|
|
/* Function Name:
|
|
* rtk_port_linkMon_unregister
|
|
* Description:
|
|
* Unregister callback function for link change notification
|
|
* Input:
|
|
* linkMon_callback - callback function for link change
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_linkMon_unregister(rtk_port_linkMon_callback_t linkMon_callback);
|
|
|
|
/* Function Name:
|
|
* rtk_port_linkMon_swScanPorts_set
|
|
* Description:
|
|
* Configure portmask of software linkscan for certain unit
|
|
* Input:
|
|
* unit - callback function for link change
|
|
* pSwScan_portmask - portmask for software scan
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK - initialize success
|
|
* RT_ERR_FAILED - initialize fail
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_linkMon_swScanPorts_set(uint32 unit, rtk_portmask_t *pSwScan_portmask);
|
|
|
|
/* Function Name:
|
|
* rtk_port_linkMon_swScanPorts_get
|
|
* Description:
|
|
* Get portmask of software linkscan for certain unit
|
|
* Input:
|
|
* unit - callback function for link change
|
|
* Output:
|
|
* pSwScan_portmask - portmask for software scan
|
|
* Return:
|
|
* RT_ERR_OK - initialize success
|
|
* RT_ERR_FAILED - initialize fail
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_linkMon_swScanPorts_get(uint32 unit, rtk_portmask_t *pSwScan_portmask);
|
|
|
|
/* Function Name:
|
|
* rtk_port_txEnable_get
|
|
* Description:
|
|
* Get the TX enable status of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* Output:
|
|
* pEnable - pointer to the port TX status
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* The TX enable status of the port is as following:
|
|
* - DISABLED
|
|
* - ENABLED
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_txEnable_get(uint32 unit, rtk_port_t port, rtk_enable_t *pEnable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_txEnable_set
|
|
* Description:
|
|
* Set the TX enable status of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* enable - enable status of TX
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_INPUT - invalid input parameter
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* The TX enable status of the port is as following:
|
|
* - DISABLED
|
|
* - ENABLED
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_txEnable_set(uint32 unit, rtk_port_t port, rtk_enable_t enable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_rxEnable_get
|
|
* Description:
|
|
* Get the RX enable status of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* Output:
|
|
* pEnable - pointer to the port RX status
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* The RX enable status of the port is as following:
|
|
* - DISABLED
|
|
* - ENABLED
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_rxEnable_get(uint32 unit, rtk_port_t port, rtk_enable_t *pEnable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_rxEnable_set
|
|
* Description:
|
|
* Set the RX enable status of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* enable - enable status of RX
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_INPUT - invalid input parameter
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* The RX enable status of the port is as following:
|
|
* - DISABLED
|
|
* - ENABLED
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_rxEnable_set(uint32 unit, rtk_port_t port, rtk_enable_t enable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_specialCongest_get
|
|
* Description:
|
|
* Get the congest seconds of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* Output:
|
|
* pSecond - pointer to congest timer (seconds)
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* If a port is continuously congested for congest seconds, the system would drain out the packets of the port,
|
|
* so the control traffic has chance to transmit to solve the congest situation.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_specialCongest_get(uint32 unit, rtk_port_t port, uint32* pSecond);
|
|
|
|
/* Function Name:
|
|
* rtk_port_specialCongest_set
|
|
* Description:
|
|
* Set the congest seconds of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* second - congest timer (seconds)
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_INPUT - invalid input parameter
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* If a port is continuously congested for congest seconds, the system would drain out the packets of the port,
|
|
* so the control traffic has chance to transmit to solve the congest situation.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_specialCongest_set(uint32 unit, rtk_port_t port, uint32 second);
|
|
|
|
/* Function Name:
|
|
* rtk_port_flowCtrlEnable_get
|
|
* Description:
|
|
* Get the flow control status of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* Output:
|
|
* pEnable - pointer to the status of the flow control
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* The API get the flow control status by port based, no matter N-WAY is enabled or disabled.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_flowCtrlEnable_get(uint32 unit, rtk_port_t port, rtk_enable_t *pEnable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_flowCtrlEnable_set
|
|
* Description:
|
|
* Set the flow control status to the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* enable - enable status of flow control
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_INPUT - invalid input parameter
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* The API is apply the flow control status by port based, no matter N-WAY is enabled or disabled.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_flowCtrlEnable_set(uint32 unit, rtk_port_t port, rtk_enable_t enable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_vlanBasedIsolationEntry_get
|
|
* Description:
|
|
* Get VLAN-based port isolation entry
|
|
* Input:
|
|
* unit - unit id
|
|
* index - index id
|
|
* Output:
|
|
* pEntry - pointer to vlan-based port isolation entry
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_INPUT - invalid input parameter
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* Valid index is 0~15.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_vlanBasedIsolationEntry_get(uint32 unit, uint32 index, rtk_port_vlanIsolationEntry_t *pEntry);
|
|
|
|
/* Function Name:
|
|
* rtk_port_vlanBasedIsolationEntry_set
|
|
* Description:
|
|
* Set VLAN-based port isolation entry
|
|
* Input:
|
|
* unit - unit id
|
|
* index - index id
|
|
* pEntry - pointer to vlan-based port isolation entry
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_INPUT - invalid input parameter
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* RT_ERR_VLAN_VID - invalid vid
|
|
* RT_ERR_PORT_VLAN_ISO_VID_EXIST_IN_OTHER_IDX - vid exists in other entry
|
|
* Applicable:
|
|
* 8380, 8390, 9300, 9310
|
|
* Note:
|
|
* Valid index is 0~15.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_vlanBasedIsolationEntry_set(uint32 unit, uint32 index, rtk_port_vlanIsolationEntry_t *pEntry);
|
|
|
|
/* Function Name:
|
|
* rtk_port_vlanBasedIsolation_vlanSource_get
|
|
* Description:
|
|
* Get VLAN source of VLAN-based port isolation
|
|
* Input:
|
|
* unit - unit id
|
|
* Output:
|
|
* pVlanSrc - pointer to vlan source
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 8380, 8390
|
|
* Note:
|
|
* Always use forward vid for 9300,9310
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_vlanBasedIsolation_vlanSource_get(uint32 unit, rtk_port_vlanIsolationSrc_t *pVlanSrc);
|
|
|
|
/* Function Name:
|
|
* rtk_port_vlanBasedIsolation_vlanSource_set
|
|
* Description:
|
|
* Set VLAN source of VLAN-based port isolation
|
|
* Input:
|
|
* unit - unit id
|
|
* vlanSrc - vlan source
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_INPUT - invalid input parameter
|
|
* Applicable:
|
|
* 8380, 8390
|
|
* Note:
|
|
* Always use forward vid for 9300,9310
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_vlanBasedIsolation_vlanSource_set(uint32 unit, rtk_port_vlanIsolationSrc_t vlanSrc);
|
|
|
|
/* Function Name:
|
|
* rtk_port_vlanBasedIsolationEgrBypass_get
|
|
* Description:
|
|
* Get Egress Port Bypass Status of VLAN-based port isolation
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* Output:
|
|
* pEnable - pointer to egress port bypass status
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 9300, 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* [SDK_3.0.0]
|
|
* New added function.
|
|
*/
|
|
int32
|
|
rtk_port_vlanBasedIsolationEgrBypass_get(uint32 unit, rtk_port_t port,rtk_enable_t *pEnable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_vlanBasedIsolationEgrBypass_set
|
|
* Description:
|
|
* Set egress port bypass status of VLAN-based port isolation
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* pEnable - pointer to egress port bypass status
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 9300, 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* [SDK_3.0.0]
|
|
* New added function.
|
|
*/
|
|
int32
|
|
rtk_port_vlanBasedIsolationEgrBypass_set(uint32 unit, rtk_port_t port,rtk_enable_t enable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_fiberUnidirEnable_get
|
|
* Description:
|
|
* Get fiber unidirection enable status of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* Output:
|
|
* pEnable - - pointer to the enable status of fiber unidirection
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_INPUT - invalid input parameter
|
|
* Applicable:
|
|
* 9300, 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* [3.2.0]
|
|
* New added function.
|
|
*/
|
|
int32
|
|
rtk_port_fiberUnidirEnable_get(uint32 unit, rtk_port_t port, rtk_enable_t *pEnable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_fiberUnidirEnable_set
|
|
* Description:
|
|
* Set fiber unidirection enable status of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* enable - enable status of fiber unidirection
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_INPUT - invalid input parameter
|
|
* Applicable:
|
|
* 9300, 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* [3.2.0]
|
|
* New added function.
|
|
*/
|
|
int32
|
|
rtk_port_fiberUnidirEnable_set(uint32 unit, rtk_port_t port, rtk_enable_t enable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_fiberOAMLoopBackEnable_set
|
|
* Description:
|
|
* Set Fiber-port OAM Loopback enable or not,
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* enable - fiber oam loopback enable or not
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* Applicable:
|
|
* 8380, 8390
|
|
* Note:
|
|
* 9300,931X is supported by new method, API is not avaliable currently.
|
|
* Changes:
|
|
* None
|
|
*/
|
|
int32
|
|
rtk_port_fiberOAMLoopBackEnable_set(uint32 unit, rtk_port_t port,
|
|
rtk_enable_t enable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_macForceFc_set
|
|
* Description:
|
|
* Set MAC flow control status to the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* forceFc - enable force flow control
|
|
* txPause - enable tx pause
|
|
* rxPause - enable rx pause
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* Applicable:
|
|
* 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* [SDK_3.8.0]
|
|
* New added function.
|
|
*/
|
|
int32
|
|
rtk_port_macForceFc_set(uint32 unit, rtk_port_t port, rtk_enable_t forceFc,
|
|
rtk_enable_t txPause, rtk_enable_t rxPause);
|
|
|
|
/* Function Name:
|
|
* rtk_port_macForceFc_get
|
|
* Description:
|
|
* Get MAC flow control status from the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* Output:
|
|
* pForceFc - pointer to force flow control mode
|
|
* pRxPause - pointer to tx pause mode
|
|
* pRxPause - pointer to rx pause mode
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_NOT_INIT - The module is not initial
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* RT_ERR_NULL_POINTER - input parameter may be null pointer
|
|
* Applicable:
|
|
* 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* [SDK_3.8.0]
|
|
* New added function.
|
|
*/
|
|
int32
|
|
rtk_port_macForceFc_get(uint32 unit, rtk_port_t port, rtk_enable_t *pForceFc,
|
|
rtk_enable_t *pTxPause, rtk_enable_t *pRxPause);
|
|
|
|
/* Function Name:
|
|
* rtk_port_fiberDownSpeedEnable_get
|
|
* Description:
|
|
* Get fiber down speed status of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* Output:
|
|
* pEnable - fiber down speed status
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* Applicable:
|
|
* 8218FB, 8214FC, 8295R, 8214QF
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* None
|
|
*/
|
|
extern int32
|
|
rtk_port_fiberDownSpeedEnable_get(uint32 unit, rtk_port_t port,
|
|
rtk_enable_t *pEnable);
|
|
|
|
/* Function Name:
|
|
* rtk_port_fiberDownSpeedEnable_set
|
|
* Description:
|
|
* Set fiber down speed status of the specific port
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* enable - fiber down speed status
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* RT_ERR_UNIT_ID - invalid unit id
|
|
* RT_ERR_PORT_ID - invalid port id
|
|
* Applicable:
|
|
* 8218FB, 8214FC, 8295R, 8214QF
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* None
|
|
*/
|
|
extern int32
|
|
rtk_port_fiberDownSpeedEnable_set(uint32 unit, rtk_port_t port,
|
|
rtk_enable_t enable);
|
|
|
|
|
|
/* Function Name:
|
|
* rtk_port_miscCtrl_get
|
|
* Description:
|
|
* Get port specific misc settings
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* ctrl_type - setting type
|
|
* Output:
|
|
* pValue - pointer to setting value
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* Applicable:
|
|
* 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* [SDK_3.8.0]
|
|
* New added function.
|
|
*/
|
|
extern int32
|
|
rtk_port_miscCtrl_get(uint32 unit, rtk_port_t port, rtk_portMiscCtrl_t ctrl_type, uint32 *pValue);
|
|
|
|
/* Function Name:
|
|
* rtk_port_miscCtrl_set
|
|
* Description:
|
|
* Set port specific misc settings
|
|
* Input:
|
|
* unit - unit id
|
|
* port - port id
|
|
* ctrl_type - setting type
|
|
* value - setting value
|
|
* Output:
|
|
* None
|
|
* Return:
|
|
* RT_ERR_OK
|
|
* RT_ERR_FAILED
|
|
* Applicable:
|
|
* 9310
|
|
* Note:
|
|
* None
|
|
* Changes:
|
|
* [SDK_3.8.0]
|
|
* New added function.
|
|
*/
|
|
extern int32
|
|
rtk_port_miscCtrl_set(uint32 unit, rtk_port_t port, rtk_portMiscCtrl_t ctrl_type, uint32 value);
|
|
|
|
#endif /* __RTK_PORT_H__ */
|
|
|