当前位置: 首页>>代码示例>>C++>>正文


C++ rtl8370_getAsicRegBits函数代码示例

本文整理汇总了C++中rtl8370_getAsicRegBits函数的典型用法代码示例。如果您正苦于以下问题:C++ rtl8370_getAsicRegBits函数的具体用法?C++ rtl8370_getAsicRegBits怎么用?C++ rtl8370_getAsicRegBits使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rtl8370_getAsicRegBits函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: number

/*
@func ret_t | rtl8370_getAsicSpecialCongestModeTimer | Get ASIC special congest mode timer. 
@parm uint32 | port | port number (0~15).
@uint32* | timer | time (0-15).
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_INPUT | Invalid port number.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
    The API can get ASIC special congest mode time from congestion state to normal state now per port.
*/
ret_t rtl8370_getAsicSpecialCongestModeTimer(uint32 port, uint32* timer)
{
    if(port > RTL8370_PORTNO)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBits(RTL8370_PORT_SPECIAL_CONGEST_MODE_TIMER_REG(port), RTL8370_PORT_SPECIAL_CONGEST_MODE_TIMER_MASK, timer);
}
开发者ID:StephenMacras,项目名称:dsl-n55u-bender,代码行数:18,代码来源:rtl8370_asicdrv_specialCongest.c

示例2: rtl8370_getAsicRldpLoopedPortPair

/*
@func ret_t | rtl8370_getAsicRldpLoopedPortmask | Get port number of looped pair.
@parm uint32 | port | 0~15
@parm uint32* | port | 0~15
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error. 
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
    This API get the looped pair of each port.
    If port n is a looped port, port that looped with port n in switch 
    will be record. 
*/
ret_t rtl8370_getAsicRldpLoopedPortPair(uint32 port, uint32 *loopedPair)
{
    if(port > RTL8370_PORTIDMAX)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBits(RTL8370_RLDP_LOOP_PORT_REG(port), RTL8370_RLDP_LOOP_PORT_MASK(port), loopedPair);
}
开发者ID:jing-git,项目名称:rt-n56u,代码行数:19,代码来源:rtl8370_asicdrv_rldp.c

示例3: id

/*
@func ret_t | rtl8370_getAsicPortExtMode | Get external interface mode configuration.
@parm uint32 | id | external interface id (0~1).
@parm uint32 |mode | external interface mode.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_FAILED | Invalid parameter.
@comm
  This API can get external interface mode properties. 
    DISABLE,
    RGMII,
    MII_MAC,
    MII_PHY, 
    TMII_MAC,
    TMII_PHY, 
    GMII     
 */
ret_t rtl8370_getAsicPortExtMode(uint32 id, uint32 *mode)
{
    if(id >= RTL8370_EXTNO)
        return RT_ERR_INPUT;	
	
    return rtl8370_getAsicRegBits(RTL8370_REG_DIGITIAL_INTERFACE_SELECT, RTL8370_SELECT_RGMII_0_MASK<<(id*RTL8370_SELECT_RGMII_1_OFFSET), mode);
}
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:24,代码来源:rtl8370_asicdrv_port.c

示例4: priority

/*
@func ret_t | rtl8370_getAsicCputagPriorityRemapping | Get queue assignment of CPU port
@parm uint32 | srcPri | internal priority (0~7)
@parm uint32* | newPri | internal priority after remapping (0~7)
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error. 
@rvalue RT_ERR_QOS_INT_PRIORITY | Invalid priority.
@comm
    This API can set the priority remapping of frames to CPU port
*/
ret_t rtl8370_getAsicCputagPriorityRemapping(uint32 srcPri, uint32 *newPri)
{
    if(srcPri > RTL8370_PRIMAX)
        return RT_ERR_QOS_INT_PRIORITY;

    return rtl8370_getAsicRegBits(RTL8370_QOS_PRIPORITY_REMAPPING_IN_CPU_REG(srcPri), RTL8370_QOS_PRIPORITY_REMAPPING_IN_CPU_MASK(srcPri), newPri);
}
开发者ID:qwerty1023,项目名称:wive-rtnl-firmware,代码行数:17,代码来源:rtl8370_asicdrv_cputag.c

示例5: _rtl8370_getAsicEeelldpFrameDataReg

ret_t _rtl8370_getAsicEeelldpFrameDataReg(uint32 regAddr, uint32 dataLength, int8 *readDataPtr)
{
    ret_t ret;
    uint32 i;
    uint32 regData;
    uint16 *accessPtr;

    accessPtr = (uint16*)readDataPtr;

    for(i=0; i < dataLength / 2; i++)
    {
        ret = rtl8370_getAsicReg(regAddr + i, &regData);
        if(RT_ERR_OK != ret)
            return ret;
        
        *accessPtr = (int16)regData;
        accessPtr++;
    }
    
    if (dataLength & 0x1)
    {
        ret = rtl8370_getAsicRegBits(regAddr + dataLength / 2, 0xFF, &regData);
        if (RT_ERR_OK != ret)
            return ret;

        *accessPtr = (int16)regData;
    }

    return RT_ERR_OK;
}
开发者ID:jing-git,项目名称:rt-n56u,代码行数:30,代码来源:rtl8370_asicdrv_eeelldp.c

示例6: number

/*
@func ret_t | rtl8370_getAsicUnknownIPv4MulticastBehavior | Get behavior of L2 multicast
@parm uint32 | port | Physical port number (0~15).
@parm uint32* | behav | 0: flooding, 1: drop, 2: trap
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error. 
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
    When receives an unknown multicast packet, switch may trap, drop or flood this packet
*/
ret_t rtl8370_getAsicUnknownIPv4MulticastBehavior(uint32 port, uint32 *behav)
{
    if(port >  RTL8370_PORTIDMAX)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBits(RTL8370_UNKNOWN_IPV4_MULTICAST_REG(port), RTL8370_UNKNOWN_IPV4_MULTICAST_MASK(port), behav);
}
开发者ID:LXiong,项目名称:openwrt-rtk,代码行数:17,代码来源:rtl8370_asicdrv_unknownMulticast.c

示例7: group

/*
@func ret_t | rtl8370_getAsicTrunkingGroup | Get trunking group available port mask
@parm uint32 | group | Port trunking group (0~3).
@parm uint32* | portmask | Logic trunking enable port mask, max 4 ports
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_LA_TRUNK_ID | Invalid trunking group
@comm
    The API can get 4 port trunking group enabled port mask. Each port trunking group has max 4 ports.
    If enabled port mask has less than 2 ports available setting, then this trunking group function is disabled.    
 */
ret_t rtl8370_getAsicTrunkingGroup(uint32 group,uint32* portmask)
{
    if(group > RTL8370_TRUNKING_GROUPMAX)
        return RT_ERR_LA_TRUNK_ID;

    return rtl8370_getAsicRegBits(RTL8370_PORT_TRUNK_GROUP_MASK_REG, RTL8370_PORT_TRUNK_GROUP_MASK_MASK(group), portmask);
}
开发者ID:LXiong,项目名称:openwrt-rtk,代码行数:18,代码来源:rtl8370_asicdrv_trunking.c

示例8: number

/*
@func ret_t | rtl8370_getAsicStormFilterUnknownUnicastMeter | Get per-port unknown unicast storm filter meter.
@parm uint32 | port | Physical port number (0~15).
@parm uint32* | meter | meter index (0~63).
@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 meter
    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_getAsicStormFilterUnknownUnicastMeter(uint32 port, uint32 *meter)
{
    if(port >= RTL8370_PORTNO)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBits(RTL8370_STORM_UNDA_METER_CRTL_REG(port), RTL8370_STORM_UNDA_METER_CRTL_MASK(port), meter);
}
开发者ID:alessiocarrafa,项目名称:dsl-n55u-bender,代码行数:21,代码来源:rtl8370_asicdrv_storm.c

示例9: index

/*
@func ret_t | rtl8370_getAsicVlanProtocolBasedGroupData | Get protocol and port based group database.
@parm uint32 | index | Index of protocol and port based database index (0~7).
@parm rtl8370_protocolgdatacfg* | ptr_pbcfg | Protocol and port based group database entry.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_OUT_OF_RANGE | input out of range.
@comm
    This API can get protocol and port based group database.
    System supported only 4 entries and 3 types of frame format. Supported frame types are defined 
    as Ethernet (frame type = 0b00, Ether type > 0x05FF), RFC 1042 (frame type = 0b01,6 bytes after 
    Type/Length = AA-AA-03-00-00-00) and LLC other(frame type = 0b10). ASIC has available setting of
    each frame type per port and available system setting each defined frame type. If per system 
    frame type is set to invalid, then per port frame setting is take no effect. There is contained 
    valid bit setting in each group database.    
*/
ret_t rtl8370_getAsicVlanProtocolBasedGroupData(uint32 index, rtl8370_protocolgdatacfg *ptr_pbcfg)
{
    uint32  frame_type;
    uint32  ether_type;
    ret_t    retVal;

    /* Error Checking */
    if(index > RTL8370_PROTOVLAN_GIDX_MAX)
        return RT_ERR_OUT_OF_RANGE;

    if(NULL == ptr_pbcfg)
        return RT_ERR_INPUT;

    /* Read Frame type */
    retVal = rtl8370_getAsicRegBits(RTL8370SG_VLAN_PPB_FRAMETYPE_REG(index), RTL8370SG_VLAN_PPB_FRAMETYPE_MASK, &frame_type);
    if(retVal != RT_ERR_OK)
        return retVal;

    /* Read Ether type */
    retVal = rtl8370_getAsicReg(RTL8370_VLAN_PPB_ETHERTYPR_REG(index), &ether_type);
    if(retVal != RT_ERR_OK)
        return retVal;


    ptr_pbcfg->frame_type = frame_type;
    ptr_pbcfg->ether_type = ether_type;
    return RT_ERR_OK;
}
开发者ID:schidler,项目名称:flyzjhz-rt-n56u,代码行数:44,代码来源:rtl8370_asicdrv_vlan.c

示例10: rtl8370_getAsicPortIsolationEfid

ret_t rtl8370_getAsicPortIsolationEfid(uint32 port, uint32 *efid)
{
    if(port >= RTL8370_PORTNO)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBits(RTL8370_PORT_EFID_REG(port), RTL8370_PORT_EFID_MASK(port), efid);
}
开发者ID:alessiocarrafa,项目名称:dsl-n55u-bender,代码行数:7,代码来源:rtl8370_asicdrv_portIsolation.c

示例11: rtl8370_getAsic1xProcConfig

/*
@func ret_t | rtl8370_getAsic1xProcConfig | get 802.1x unauth. behavior configuration
@parm uint32 | port | Physical port number.
@parm uint32* | proc | 802.1x unauth. behavior configuration 0:drop 1:trap to CPU 2:Guest VLAN
@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 unauth. behavior configuration.
*/
ret_t rtl8370_getAsic1xProcConfig(uint32 port, uint32* proc)
{
    if(port >= RTL8370_PORTNO)
        return RT_ERR_PORT_ID;

    return rtl8370_getAsicRegBits(RTL8370_DOT1X_UNAUTH_ACT_REG(port), RTL8370_DOT1X_UNAUTH_ACT_MASK(port),proc);
}
开发者ID:alessiocarrafa,项目名称:dsl-n55u-bender,代码行数:17,代码来源:rtl8370_asicdrv_dot1x.c

示例12: rtl8370_getAsicPriorityDecision

/*
@func ret_t | rtl8370_getAsicPriorityDecision | Get priority decision table.
@parm enum PRIDECISION | prisrc | Priority decision source 
@parm uint32* | decisionpri | Decision priority assignment.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_QOS_SEL_PRI_SOURCE | Invalid priority decision source parameter.
@comm
    The API can get the priorities of Port-based, ACL-based,1Q-based, DSCP-based, SVLAN-based, 
    CVLAN-based and DA/SA based prioriity assignments in output queue priority decision table. 
 */
ret_t rtl8370_getAsicPriorityDecision( enum PRIDECISION prisrc, uint32* decisionpri)
{
    /* Invalid input parameter */
    if(prisrc >= PRIDEC_MAX ) 
        return RT_ERR_QOS_SEL_PRI_SOURCE;

    /* Get Related Registers */
    return rtl8370_getAsicRegBits(RTL8370_QOS_INTERNAL_PRIORITY_DECISION_REG(prisrc), RTL8370_QOS_INTERNAL_PRIORITY_DECISION_MASK(prisrc),decisionpri);        
}
开发者ID:LXiong,项目名称:openwrt-rtk,代码行数:20,代码来源:rtl8370_asicdrv_qos.c

示例13: number

/*
@func ret_t | rtl8370_getAsicVlanPortAndProtocolBased | Get protocol and port based VLAN configuration. 
@parm uint32 | port | Physical port number (0~15).
@parm uint32 | index | Index of protocol and port based database index.
@parm rtl8370_protocolvlancfg* | ptr_ppbcfg | Protocol and port based VLAN configuration.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@rvalue RT_ERR_OUT_OF_RANGE | input out of range.
@comm
    Each port has 4 VLAN configurations for each protocol and port based group database. 
    Protocol and port based VLAN configuration contained 1 valid bit setting for each 
    group database entry. There is 802.1q priority field setting for each group database 
    entry. Different with port based VLAN information retrieving, ASIC decided 802.1q priority 
    of reveiving frame from dedicated port based VLAN configuration and didn't decide from 
    priority field of system VLAN 16 member configurations.
    
*/
ret_t rtl8370_getAsicVlanPortAndProtocolBased(uint32 port, uint32 index, rtl8370_protocolvlancfg *ptr_ppbcfg)
{
    uint32  reg_addr, bit_mask, bit_value;
    ret_t   retVal;

    /* Error Checking */
    if(port > RTL8370_PORTIDMAX)
        return RT_ERR_PORT_ID;

    if(index > RTL8370_PROTOVLAN_GIDX_MAX)
        return RT_ERR_OUT_OF_RANGE;

    if(NULL == ptr_ppbcfg)
        return RT_ERR_INPUT;

    /* Valid bit */
    reg_addr  = RTL8370_VLAN_PPB_VALID_REG(index);
    bit_mask  = 0x0001 << port;
    retVal    = rtl8370_getAsicRegBits(reg_addr, bit_mask, &bit_value);
    if(retVal != RT_ERR_OK)
        return retVal;

    ptr_ppbcfg->valid = bit_value;

    /* CVLAN index */
    reg_addr = RTL8370_VLAN_PPB_CTRL_REG(index,port);
    bit_mask = RTL8370_VLAN_PPB_CTRL_MASK(port);
    retVal = rtl8370_getAsicRegBits(reg_addr, bit_mask, &bit_value);
    if(retVal != RT_ERR_OK)
        return retVal;

    ptr_ppbcfg->vlan_idx = bit_value;
    

    /* priority */
    reg_addr = RTL8370_VLAN_PPB_PRIORITY_ITEM_REG(port,index);
    bit_mask = RTL8370_VLAN_PPB_PRIORITY_ITEM_MASK(port);
    retVal = rtl8370_getAsicRegBits(reg_addr, bit_mask, &bit_value);
    if(retVal != RT_ERR_OK)
        return retVal;

    ptr_ppbcfg->priority = bit_value;
    return RT_ERR_OK;
}
开发者ID:schidler,项目名称:flyzjhz-rt-n56u,代码行数:62,代码来源:rtl8370_asicdrv_vlan.c

示例14: rtl8370_getAsicVlanEgressTagMode

/*
@func ret_t | rtl8370_getAsicVlanEgressTagMode | Get CVLAN egress tag mode
@parm uint32 | port | The EGRESS port number
@parm rtl8370_egtagmode* | ptr_tag_mode | The egress tag mode. Including Original mode, Keep tag mode and Priority tag mode.
@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 Egress tag mode. There are 3 mode for egress tag:
    Original mode : Output frame will follow VLAN untag setting.
    Keep tag mode : Output frame will keep VLAN original format.
    Priority tag mode : Output frame will be priority tag.
*/
ret_t rtl8370_getAsicVlanEgressTagMode( uint32 port, rtl8370_egtagmode *ptr_tag_mode)
{
    if(port > RTL8370_PORTIDMAX)
        return RT_ERR_PORT_ID;

    if(NULL == ptr_tag_mode)
        return RT_ERR_INPUT;

    return rtl8370_getAsicRegBits(RTL8370_PORT_MISC_CFG_REG(port), RTL8370_VLAN_EGRESS_MDOE_MASK, (uint32*)ptr_tag_mode);
}
开发者ID:schidler,项目名称:flyzjhz-rt-n56u,代码行数:24,代码来源:rtl8370_asicdrv_vlan.c

示例15: rtl8370_getAsicRldpLoopStatePara

/*
@func ret_t | rtl8370_getAsicRldpLoopStatePara | Get retry count and retry period of loop state.
@parm uint32* | retryCount | 0~0xFF (times)
@parm uint32 | retryPeriod | 0~0xFFFF (ms)
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error. 
@rvalue RT_ERR_INPUT | Invalid input parameter.
@comm
    This API et the retry count and retry period of loop state
    Retry count and retry period decide the times Switch sends RLDP frame and 
    the interval between two transmission respecitively in loop state.
*/
ret_t rtl8370_getAsicRldpLoopStatePara(uint32 *retryCount, uint32 *retryPeriod)
{
    ret_t ret;

    ret = rtl8370_getAsicRegBits(RTL8370_RLDP_RETRY_COUNT_REG, RTL8370_RLDP_RETRY_COUNT_LOOPSTATE_READ_MASK, retryCount);
    if(RT_ERR_OK != ret)
        return ret;

    return rtl8370_getAsicReg(RTL8370_RLDP_RETRY_PERIOD_LOOPSTATE_REG, retryPeriod);
}
开发者ID:jing-git,项目名称:rt-n56u,代码行数:22,代码来源:rtl8370_asicdrv_rldp.c


注:本文中的rtl8370_getAsicRegBits函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。