Пример #1
0
/*
@func ret_t | rtl8370_getAsicPortDisableAging | Get L2 LUT aging per port setting.
@parm uint32 | port | Physical port number.
@parm uint32* | disable | 0: enable aging; 1: disabling aging
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
     This API can be used to get L2 LUT aging function per port. 
*/
ret_t rtl8370_getAsicPortDisableAging(uint32 port, uint32 *disable)
{
    if(port > RTL8370_PORTIDMAX)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBit(RTL8370_LUT_AGEOUT_CRTL_REG, port, disable);
}
/*
@func ret_t | rtl8370_getAsic1xPBAuthConfig | get 802.1x port-based auth. port configuration
@parm uint32 | port | Physical port number.
@parm uint32* | auth | 1: authorised, 0: non-authorised.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
    The API can get 802.1x port-based auth. port information.
    
*/
ret_t rtl8370_getAsic1xPBAuthConfig(uint32 port,uint32 *auth)
{
    if(port >= RTL8370_PORTNO)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBit(RTL8370_DOT1X_PORT_AUTH_REG, port, auth);
}
/*
@func ret_t | rtl8370_getAsic1xPBOpdirConfig | get 802.1x port-based operational direction configuration
@parm uint32 | port | Physical port number.
@parm uint32* | opdir | Operation direction 1: IN, 0:BOTH
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
    The API can get 802.1x port-based operational direction information.
    
*/
ret_t rtl8370_getAsic1xPBOpdirConfig(uint32 port,uint32* opdir)
{
    if(port >= RTL8370_PORTNO)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBit(RTL8370_DOT1X_PORT_OPDIR_REG, port, opdir);
}
/*
@func ret_t  | rtl8370_getAsic1xPBEnConfig | Get 802.1x port-based port enable configuration
@parm uint32 | port | port number (0~15)
@parm uint32* | enabled | 1: enabled, 0: disabled.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
    The API can update the port-based port enable register content.
*/
ret_t rtl8370_getAsic1xPBEnConfig(uint32 port,uint32 *enabled)
{
    if(port >= RTL8370_PORTNO)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBit(RTL8370_DOT1X_PORT_ENABLE_REG, port, enabled);
}
/*
@func ret_t | rtl8370_getAsicEeeRxEnable | Get eee TX  function enable/disable.
@parm uint32 | port | The port number.
@parm uint32* | enabled | 1: enabled, 0: disabled.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_INPUT | Invalid input parameter.
@comm
    This API get the EEE RX enable function.
*/
ret_t rtl8370_getAsicEeeRxEnable(uint32 port, uint32 *enable)
{
    if(port >= RTL8370_PORTNO)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBit(RTL8370_PORT_EEE_CFG_REG(port), RTL8370_PORT_EEE_RX_ENABLE_OFFSET, enable);
}
/*
@func ret_t | rtl8370_getAsicMeterState | Get shared meter status.
@parm uint32 | index | Shared meter index (0-63) of 64 shared meter index
@parm uint32* | state | 0: rate doesn't exceed     1: rate exceeds
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_FILTER_METER_ID | Invalid meter
@rvalue RT_ERR_FAILED | Invalid parameter.
@comm
    If rate is over rate*8Kbps of a meter, the state bit of this meter is set to 1.
    Clear by write.
 */
ret_t rtl8370_getAsicMeterState(uint32 index, uint32* state)
{
    if(index > RTL8370_METERMAX)
        return RT_ERR_FILTER_METER_ID;

    return rtl8370_getAsicRegBit(RTL8370_METER_OVERRATE_INDICATOR_REG(index), RTL8370_METER_EXCEED_OFFSET(index), &(*state));
}
/*
@func ret_t | rtl8370_getAsicEeeForceMode | Get eee force mode function enable/disable.
@parm uint32 | port | The port number.
@parm uint32* | enabled | 1: enabled, 0: disabled.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_INPUT | Invalid input parameter.
@comm
    This API get the EEE force mode function.
*/
ret_t rtl8370_getAsicEeeForceMode(uint32 port, uint32 *enable)
{
    if(port >= RTL8370_PORTNO)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBit(RTL8370_PORT_EEE_CFG_REG(port), RTL8370_PORT_EEE_FORCE_OFFSET, enable);
}
/*
@func ret_t | rtl8370_getAsicEeeGiga | Get 100M eee enable/disable.
@parm uint32 | port | The port number.
@parm uint32* | enabled | 1: enabled, 0: disabled.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_INPUT | Invalid input parameter.
@comm
    This API get the 100M EEE function.
*/
ret_t rtl8370_getAsicEeeGiga(uint32 port, uint32 *enable)
{
    if(port >= RTL8370_PORTNO)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBit(RTL8370_PORT_EEE_CFG_REG(port), RTL8370_PORT_EEE_GIGA_OFFSET, enable);
}
/*
@func ret_t | rtl8370_getAsicGreenHighPriorityTraffic | Set traffic type for each priority
@parm uint32 | port | The port number
@parm uint32* | indicator | Have received high priority traffic indicator. If 1 means ASCI had received high priority in 1second checking priod.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
    The API can get indicator which ASIC had received high priority traffic or not.
*/
ret_t rtl8370_getAsicGreenHighPriorityTraffic(uint32 port, uint32* indicator)
{
    if(port > RTL8370_PORTIDMAX)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBit(RTL8370_REG_HIGHPRI_INDICATOR, port, indicator);
}
Пример #10
0
/*
@func ret_t | rtl8370_getAsicStormFilterBroadcastEnable | Get per-port broadcast storm filter enable/disable.
@parm uint32 | port | Physical port number (0~15).
@parm uint32* | enabled | 1: enabled, 0: disabled.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
    This API get per-port broadcast stomr filter enable/disable
    Broadcast storm filters of each port point to some meters. If
    broadcast storm filter of port n is enabled, data length of
    broadcast packet will be included in the meter pointed by port
    n to elminate broadcast packet egress rate.
*/
ret_t rtl8370_getAsicStormFilterBroadcastEnable(uint32 port, uint32 *enable)
{
    if(port >= RTL8370_PORTNO)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBit(RTL8370_STORM_BCAST_REG, port, enable);
}
Пример #11
0
/*
@func ret_t | rtl8370_getAsicStormFilterUnknownUnicastEnable | Get per-port unknown unicast storm filter enable/disable.
@parm uint32 | port | Physical port number (0~15).
@parm uint32* | enabled | 1: enabled, 0: disabled.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
    This API get per-port unknown unicast storm filter enable/disable
    Unknown unicast storm filters of each port point to some meters. If
    unknown unicast storm filter of port n is enabled, data length of
    unknown unicast packet will be included in the meter pointed by port
    n to elminate unknown unicast packet egress rate.
*/
ret_t rtl8370_getAsicStormFilterUnknownUnicastEnable(uint32 port, uint32 *enable)
{
    if(port >= RTL8370_PORTNO)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBit(RTL8370_STORM_UNKNOWN_UCAST_REG, port, enable);
}
Пример #12
0
/*
@func ret_t | rtl8370_getAsicPortBlockSpa | Disable blocking frame if source port and destination port are the same.
@parm uint32 | port | Physical port number.
@parm uint32 | permit | 0: block; 1: permit
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
     This API is setted to disable block frame if source port = destination port.
*/
ret_t rtl8370_getAsicPortBlockSpa(uint32 port,uint32* permit)
{
    if(port >= RTL8370_PORTNO)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBit(RTL8370_SOURCE_PORT_BLOCK_REG, port, permit);
}
Пример #13
0
/*
@func ret_t | rtl8370_getAsicGreenTrafficType | Get traffic type for each priority
@parm uint32 | priority | internal priority (0~7).
@parm uint32* | traffictype | high/low traffic type, 1:high priority traffic type, 0:low priority traffic type
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error. 
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
    The API can get internal priority to traffic type. ASIC will set indicator for receiving high-prioirty traffic in 1second by traffic type configuration.
*/
ret_t rtl8370_getAsicGreenTrafficType(uint32 priority, uint32* traffictype)
{
    
    if(priority > RTL8370_PRIMAX)
        return RT_ERR_QOS_INT_PRIORITY;

    return rtl8370_getAsicRegBit(RTL8370_REG_HIGHPRI_CFG, priority, traffictype);
}
/*
@func ret_t | rtl8370_getAsicVlanIngressFilter | Get VLAN Ingress Filter
@parm uint32 | port | The port number
@parm uint32* | ptr_enabled | Enable or disable Ingress filter
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_INPUT | Invalid input parameter.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
    The API can Get the VLAN ingress filter.
*/
ret_t rtl8370_getAsicVlanIngressFilter(uint32 port, uint32 *ptr_enabled)
{
    if(port > RTL8370_PORTIDMAX)
        return RT_ERR_PORT_ID;

    if(NULL == ptr_enabled) 
        return RT_ERR_INPUT;

    return rtl8370_getAsicRegBit(RTL8370SG_VLAN_INGRESS_REG, port, ptr_enabled);
}
/*
@func ret_t | rtl8370_getAsicAprEnable | Set per-port APR enable.
@parm uint32 | port | The port number
@parm uint32* | aprEnable | APR enable seting 1:enable 0:disable.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
    The API can get per-port APR enable setting
*/
ret_t rtl8370_getAsicAprEnable(uint32 port, uint32 *aprEnable)
{
    ret_t retVal;
    
    if(port > RTL8370_PORTIDMAX)
        return RT_ERR_PORT_ID;

    retVal = rtl8370_getAsicRegBit(RTL8370_SCHEDULE_APR_CRTL_REG, RTL8370_SCHEDULE_APR_CRTL_OFFSET(port), aprEnable);

    return retVal;
}
Пример #16
0
/*
@func ret_t | rtl8370_getAsicLutCamTbUsage | Configure Lut CAM table usage.
@parm uint32* | enabled | L2 CAM table usage 1: enabled, 0: disabled.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@common
    The API can get LUT CAM usage setting
*/
ret_t rtl8370_getAsicLutCamTbUsage(uint32* enabled)
{
    ret_t   retVal;
    uint32  regData;

    if ((retVal = rtl8370_getAsicRegBit(RTL8370_REG_LUT_CFG, RTL8370_BCAM_DISABLE_OFFSET, &regData)) != RT_ERR_OK)
        return retVal;

    *enabled = regData ? 0 : 1;

    return RT_ERR_OK;
}
/*
@func ret_t | rtl8370_getAsicQueueType | Get type of WFQ.
@parm uint32 | port | The port number.
@parm uint32 | qid | The queue ID wanted to set.
@parm uint32* | queueType | Pointer to the returned queue type.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@rvalue RT_ERR_QUEUE_ID | Invalid queue id.
@comm
    The API can get type, strict priority or weight fair queue (WFQ), of the specified queue.  
 */
ret_t rtl8370_getAsicQueueType(uint32 port, uint32 qid, uint32 *queueType)
{
    ret_t retVal;

    /* Invalid input parameter */
    if(port  > RTL8370_PORTIDMAX)
        return RT_ERR_PORT_ID;

    if(qid > RTL8370_QIDMAX)
        return RT_ERR_QUEUE_ID;

    retVal = rtl8370_getAsicRegBit(RTL8370_SCHEDULE_QUEUE_TYPE_REG(port), RTL8370_SCHEDULE_QUEUE_TYPE_OFFSET(port, qid),queueType);    

    return retVal;
}
Пример #18
0
/*
@func ret_t | rtl8370_getAsicPortEnableAll | Get ALL ports enable.
@parm uint32 | *enable | enable all ports.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_FAILED | Invalid parameter.
@rvalue RT_ERR_INPUT | Invalid input parameter.
@comm
  This API can set all ports enable.  
 */
ret_t rtl8370_getAsicPortEnableAll(uint32 *enable)
{
    ret_t retVal;
    uint32 regData;
    
    retVal = rtl8370_getAsicRegBit(RTL8370_REG_PHY_AD, RTL8370_PHY_AD_DUMMY_1_OFFSET, &regData);
    if(retVal !=  RT_ERR_OK)
        return retVal;

    if (regData==0)
        *enable = 1;
    else
        *enable = 0;

    return RT_ERR_OK;
}
/*
@func ret_t | rtl8370_getAsicLedSystemEnable | Turn on/off Led of all system ports
@parm uint32 | *enable | LED system configuration.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@rvalue RT_ERR_INPUT | Invalid input value.
@comm
    The API can turn on/off leds of dedicated port while indicated information configuration of LED group is set to force mode.
 */
ret_t rtl8370_getAsicLedSystemEnable(uint32 *enable)
{
    ret_t retVal;
    uint32 regData;

	if ((retVal = rtl8370_getAsicRegBit(RTL8370_REG_LED_SYS_CONFIG, RTL8370_LED_IO_DISABLE_OFFSET, &regData))!=RT_ERR_OK)
        return retVal;

    if (regData == 1)
    {
        *enable = 0;
    }
    else
    {
        *enable = 1;
    }

    return RT_ERR_OK;
}
Пример #20
0
/*
@func ret_t | rtl8370_setAsicPHYReg | Set PHY registers .
@parm uint32 | phyNo | PHY number (0~7).
@parm uint32 | phyAddr | PHY address (0~31).
@parm uint32 | data | Writing data.
@rvalue RT_ERR_OK | 
@rvalue RT_ERR_FAILED | invalid parameter
@rvalue RT_ERR_PHY_REG_ID | invalid PHY address
@rvalue RT_ERR_PORT_ID | invalid port id.
@rvalue RT_ERR_BUSYWAIT_TIMEOUT | PHY access busy
@comm
    The API can set internal PHY register 0~31. There are 8 internal PHYs in switch and each PHY can be
    accessed by software.
 */
ret_t rtl8370_setAsicPHYReg( uint32 phyNo, uint32 phyAddr, uint32 data )
{
    ret_t retVal;
    uint32 regData;
    uint32 busyFlag;

    if(phyNo > RTL8370_PHY_INTERNALNOMAX)
        return RT_ERR_PORT_ID;


    if(phyAddr > RTL8370_PHY_REGNOMAX)
        return RT_ERR_PHY_REG_ID;

/*
word address    a[15]    a[14]    a[13]    a[12]    a[11]    a[10]    a[9]    a[8]    a[7]    a[6]    a[5]    a[4]    a[3]    a[2]    a[1]    a[0]
phy0 ~ phy7     [        3'd1         ]    [ 0        0        0        0      0 ]    [      PHY No.     ]    [        reg adr[4:0]              ]
*/

    /*Check internal phy access busy or not*/
    retVal = rtl8370_getAsicRegBit(RTL8370_REG_INDRECT_ACCESS_STATUS, RTL8370_PHY_BUSY_OFFSET,&busyFlag);
    if(retVal !=  RT_ERR_OK)
        return retVal;

    if(busyFlag)
        return RT_ERR_BUSYWAIT_TIMEOUT;

    /*prepare access data*/
    retVal = rtl8370_setAsicReg(RTL8370_REG_INDRECT_ACCESS_WRITE_DATA, data);
    if(retVal !=  RT_ERR_OK)
        return retVal;
    
    /*prepare access address*/
    regData = RTL8370_PHY_BASE | (phyNo<<RTL8370_PHY_OFFSET) | phyAddr; 
	
    retVal = rtl8370_setAsicReg(RTL8370_REG_INDRECT_ACCESS_ADDRESS, regData);
    if(retVal !=  RT_ERR_OK)
        return retVal;

    /*Set WRITE Command*/
    return rtl8370_setAsicReg(RTL8370_REG_INDRECT_ACCESS_CRTL, RTL8370_CMD_MASK | RTL8370_RW_MASK);
}
Пример #21
0
/*
@func ret_t | rtl8370_getAsicShareMeter | Get meter configuration
@parm uint32 | index | Shared meter index (0-63) of 64 shared meter index
@parm uint32* | rate | 17-bits rate of share meter, unit is 8Kpbs
@parm uint32* | ifg | Rate's calculation including IFG 1:include 0:exclude 
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_FILTER_METER_ID | Invalid meter
@comm
    The API can get shared meter rate and ifg include for each meter. Rate unit is 8Kbps.    
 */
ret_t rtl8370_getAsicShareMeter(uint32 index, uint32 *rate ,uint32 *ifg)
{
    uint32 regData;
    uint32 regData2;
    ret_t retVal;

    if(index > RTL8370_METERMAX)
        return RT_ERR_FILTER_METER_ID;

    /*17-bits Rate*/
    retVal = rtl8370_getAsicReg(RTL8370_METER_RATE_REG(index), &regData);
    if(retVal != RT_ERR_OK)
        return retVal;

    retVal = rtl8370_getAsicReg(RTL8370_METER_RATE_REG(index)+1, &regData2);
    if(retVal != RT_ERR_OK)
        return retVal;

    *rate = ((regData2 << 16) & 0x10000) | regData;
    /*IFG*/
    return rtl8370_getAsicRegBit(RTL8370_METER_IFG_CTRL_REG(index), RTL8370_METER_IFG_OFFSET(index), ifg);
}
/*
@func ret_t | rtl8370_getAsicPortEgressRate | Set per-port egress rate
@parm uint32 | port | The port number.
@parm uint32* | rate | Egress rate
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
    The API can set per-port egress rate.
 */
ret_t rtl8370_getAsicPortEgressRate(uint32 port, uint32 *rate)
{
    ret_t retVal;
    uint32 regAddr, regData,regData2;

    if(port > RTL8370_PORTIDMAX)
        return RT_ERR_PORT_ID;

    regAddr = RTL8370_PORT_EGRESSBW_LSB_REG(port);
    
    retVal = rtl8370_getAsicReg(regAddr, &regData);
    if(retVal != RT_ERR_OK)
        return retVal;

    regAddr = RTL8370_PORT_EGRESSBW_MSB_REG(port);
    retVal = rtl8370_getAsicRegBit(regAddr, RTL8370_PORT_EGRESSBW_MSB_OFFSET, &regData2);
    if(retVal != RT_ERR_OK)
        return retVal;

    *rate = regData | (regData2 << RTL8370_QOS_GRANULARTY_MSB_OFFSET);

    return RT_ERR_OK;
}
Пример #23
0
/*
@func ret_t | rtl8370_getAsicPortMirrorRxFunction | Enable the mirror function on RX of the mirrored port. 
@parm uint32* | enabled | 1: enabled, 0: disabled. 
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@comm
    If the API is setted to enabled, the RX of mirrored port will be mirrorred to 
    the current monitor port.
*/
ret_t rtl8370_getAsicPortMirrorRxFunction(uint32* enabled)
{
    return rtl8370_getAsicRegBit(RTL8370_MIRROR_CTRL_REG, RTL8370_MIRROR_RX_OFFSET, enabled);
}
Пример #24
0
/*
@func ret_t | rtl8370_getAsicPortMirrorIsolation | Enable the traffic isolation on monitor port 
@parm uint32* | enabled | 1: enabled, 0: disabled. 
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@comm
    The API can get the current mointor port isolation status.
*/
ret_t rtl8370_getAsicPortMirrorIsolation(uint32* enabled)
{
    return rtl8370_getAsicRegBit(RTL8370_MIRROR_CTRL_REG, RTL8370_MIRROR_ISO_OFFSET, enabled);
}
Пример #25
0
/*
@func ret_t | rtl8370_getAsicRrcpV2Trap8051 | Set trap to 8051 setting enable/disable.
@parm uint32* | trap | 0: disable/1: enable.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error. 
@rvalue RT_ERR_INPUT | Invalid input parameter.
@comm
    This API get trap RRCPv2 frame to 8051 enable/disable
    Trap to RRCP frame to 8051 setting. If this bit is set, ASIC will
    not handled the received RRCP frame.
*/
ret_t rtl8370_getAsicRrcpV2Trap8051(uint32 *trap)
{
    return rtl8370_getAsicRegBit(RTL8370_RRCP_CTRL0_REG, RTL8370_RRCP_TRAP_8051_OFFSET, trap);    
}
/*
@func ret_t | rtl8370_getAsicInterruptPolarity | set interrupt trigger polarity
@parm uint32* | polarity | 0:pull high 1: pull low
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_INPUT | Invalid input parameter.
@comm
    This API can be used to set I/O polarity while port linking status chnaged. Pull high GPIO
    while setting value is 0 and pull low while setting value 1
*/
ret_t rtl8370_getAsicInterruptPolarity(uint32* polarity)
{
    return rtl8370_getAsicRegBit(RTL8370_INTR_CTRL_REG, RTL8370_INTR_POLARITY_OFFSET, polarity);
}
Пример #27
0
/*
@func ret_t | rtl8370_getAsicCputagEnable | Get cpu tag function enable/disable.
@parm uint32* | enable | 1: enabled, 0: disabled.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error. 
@comm
    The API can get CPU TAG enable function.

    If CPU tag function is disabled, CPU tag will not be added to frame
    forwarded to CPU port, and all ports cannot parse CPU tag.

*/
ret_t rtl8370_getAsicCputagEnable(uint32 *enable)
{
    return rtl8370_getAsicRegBit(RTL8370_CPU_CTRL_REG, RTL8370_CPU_EN_OFFSET, enable);
}
Пример #28
0
/*
@func ret_t | rtl8370_getAsicRemarkingDscpAbility | Get DSCP remarking ability.
@parm uint32* | enabled | 1: enabled, 0: disabled.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@comm
    The API can get DSCP remarking ability of whole system.
 */
ret_t rtl8370_getAsicRemarkingDscpAbility( uint32* enabled)
{
    return rtl8370_getAsicRegBit(RTL8370_REMARKING_CTRL_REG, RTL8370_REMARKING_DSCP_ENABLE_OFFSET, enabled);    
}
/*
@func ret_t | rtl8370_getAsicSvlanEgressUnassign | Configure unplink stream without egress SVID action.
@parm uint32 | enabled | 1:Trap egress unassigned frames to CPU, 0: Use SVLAN setup in VS_CPSVIDX as egress SVID. 
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_INPUT | Invalid input parameter.
@comm
     The API can set trapping function in uplink port while the egress frame is unassigned.
     
*/
ret_t rtl8370_getAsicSvlanEgressUnassign(uint32* enabled)
{
    return rtl8370_getAsicRegBit(RTL8370_REG_SVLAN_CFG, RTL8370_VS_UIFSEG_OFFSET, enabled);
}
/*
@func ret_t | rtl8370_getAsicSvlanIngressUnmatch | Configure enable trap received unmatched Stag frame to CPU from unplink port.
@parm uint32* | enabled | Trap received unmatched Stag frame to CPU 1: enabled, 0: disabled. 
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_INPUT | Invalid input parameter.
@comm
    The API can get configuration of trapping function in uplink port while receiving unmatched Stag frame.
    
*/
ret_t rtl8370_getAsicSvlanIngressUnmatch(uint32* enabled)
{
    return rtl8370_getAsicRegBit(RTL8370_REG_SVLAN_CFG, RTL8370_VS_UNMAT_OFFSET, enabled);
}