realtek-doc/sources/rtk-gp3000/include/dal/apollomp/dal_apollomp_stp.h
2025-12-04 22:26:46 +05:00

114 lines
2.7 KiB
C

/*
* Copyright(c) Realtek Semiconductor Corporation, 2008
* All rights reserved.
*
* $Revision$
* $Date$
*
* Purpose : Definition those public STP APIs and its data type in the SDK.
*
* Feature : The file have include the following module and sub-modules
* 1) spanning tree (1D, 1w and 1s)
*
*/
#ifndef __DAL_APOLLOMP_STP_H__
#define __DAL_APOLLOMP_STP_H__
/*
* Include Files
*/
#include <common/rt_type.h>
#include <rtk/stp.h>
/*
* Symbol Definition
*/
/*
* Macro Declaration
*/
/*
* Function Declaration
*/
/* Module Name : STP */
/* Function Name:
* dal_apollomp_stp_init
* Description:
* Initialize stp module of the specified device.
* Input:
* None
* Output:
* None
* Return:
* RT_ERR_OK
* RT_ERR_FAILED
* Note:
* Must initialize stp module before calling any stp APIs.
*/
extern int32
dal_apollomp_stp_init(void);
/* Function Name:
* dal_apollomp_stp_mstpState_get
* Description:
* Get port spanning tree state of the msti from the specified device.
* Input:
* unit - unit id
* msti - multiple spanning tree instance
* port - port id
* Output:
* pStp_state - pointer buffer of spanning tree state
* Return:
* RT_ERR_OK
* RT_ERR_FAILED
* RT_ERR_NOT_INIT - The module is not initial
* RT_ERR_MSTI - invalid msti
* RT_ERR_PORT_ID - invalid port id
* RT_ERR_NULL_POINTER - input parameter may be null pointer
* Note:
* 1. For single spanning tree mode, input CIST0 (msti=0).
* 2. Spanning tree state as following
* - STP_STATE_DISABLED
* - STP_STATE_BLOCKING
* - STP_STATE_LEARNING
* - STP_STATE_FORWARDING
*/
extern int32
dal_apollomp_stp_mstpState_get(uint32 msti, rtk_port_t port, rtk_stp_state_t *pStp_state);
/* Function Name:
* dal_apollomp_stp_mstpState_set
* Description:
* Set port spanning tree state of the msti to the specified device.
* Input:
* msti - multiple spanning tree instance
* port - port id
* stp_state - spanning tree state
* Output:
* None
* Return:
* RT_ERR_OK
* RT_ERR_FAILED
* RT_ERR_NOT_INIT - The module is not initial
* RT_ERR_MSTI - invalid msti
* RT_ERR_PORT_ID - invalid port id
* RT_ERR_MSTP_STATE - invalid spanning tree status
* Note:
* 1. For single spanning tree mode, input CIST0 (msti=0).
* 2. Spanning tree state as following
* - STP_STATE_DISABLED
* - STP_STATE_BLOCKING
* - STP_STATE_LEARNING
* - STP_STATE_FORWARDING
*/
extern int32
dal_apollomp_stp_mstpState_set(uint32 msti, rtk_port_t port, rtk_stp_state_t stp_state);
#endif /*__DAL_APOLLOMP_STP_H__*/