• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ rtl8370_setAsicReg函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: rtl8370_setAsicRrcp

/*
@func ret_t | rtl8370_setAsicRrcp | Set RRCP function enable/disable.
@parm uint32 | vOneEnable | 1: enabled, 0: disabled.
@parm uint32 | vTwoEnable | 1: enabled, 0: disabled.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error. 
@rvalue RT_ERR_INPUT | Invalid input parameter.
@comm
    Enable / Disable RRCPv1 and RRCPv2 function
    Note that RRCPv1 and RRCPv2 shall not be enabled together
    Only one is needed.
*/
ret_t rtl8370_setAsicRrcp(uint32 vOneEnable, uint32 vTwoEnable)
{
    ret_t  retVal;    
	uint32 tmp;

    if((vOneEnable > 1) || (vTwoEnable > 1))
        return RT_ERR_INPUT;

    retVal = rtl8370_getAsicReg(RTL8370_RRCP_CTRL0_REG, &tmp);
    if(retVal != RT_ERR_OK)
        return RT_ERR_FAILED;

    tmp &= ~(1 << RTL8370_RRCP_V1_EN_OFFSET);
	tmp &= ~(1 << RTL8370_RRCP_V2_EN_OFFSET);

	tmp |= ((vOneEnable & 1) << RTL8370_RRCP_V1_EN_OFFSET);
	tmp |= ((vTwoEnable & 1) << RTL8370_RRCP_V2_EN_OFFSET);

    retVal = rtl8370_setAsicReg(RTL8370_RRCP_CTRL0_REG, tmp);
    if(retVal != RT_ERR_OK)
        return RT_ERR_FAILED;
    
    retVal = rtl8370_setAsicReg(RTL8370_OLD_RRCP_CTRL, tmp);
    if(retVal != RT_ERR_OK)
        return RT_ERR_FAILED;
    
    return RT_ERR_OK;
}
开发者ID:LXiong,项目名称:openwrt-rtk,代码行数:40,代码来源:rtl8370_asicdrv_rrcp.c


示例2: mode

/*
@func ret_t | rtl8370_setAsicLedOperationMode | Set LED operation mode
@parm uint32 | mode | LED mode. 1:scan mode 1, 2:parallel mode, 3:mdx mode (serial mode)
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_INPUT | Invalid input value.
@comm
    The API can turn on/off led serial mode and set signal to active high/low.
 */
ret_t rtl8370_setAsicLedOperationMode(uint32 mode)
{
    ret_t retVal;

    /* Invalid input parameter */
    if( mode >= LEDOP_MAX)
        return RT_ERR_INPUT;

    if( mode == LEDOP_SCAN0)
        return RT_ERR_INPUT;

    switch(mode)
    {
        case LEDOP_SCAN0:
            break;
        case LEDOP_SCAN1:
            if((retVal = rtl8370_setAsicReg(RTL8370_REG_LED_SYS_CONFIG,0x1471))!=  RT_ERR_OK)
		    return retVal;
            if((retVal = rtl8370_setAsicReg(RTL8370_REG_SCAN1_LED_IO_EN,0xFFBF))!=  RT_ERR_OK)
		        return retVal;
            break;
        case LEDOP_PARALLEL:
            if((retVal = rtl8370_setAsicReg(RTL8370_REG_LED_SYS_CONFIG,0x1472))!=  RT_ERR_OK)
		        return retVal;
            break;
        case LEDOP_SERIAL:
            if((retVal = rtl8370_setAsicReg(RTL8370_REG_LED_SYS_CONFIG,0x14F7))!=  RT_ERR_OK)
		        return retVal;
            break;
        default:
            break;
    }

    return RT_ERR_OK;
}
开发者ID:mausvt,项目名称:seagate_central_cns3420_2-6-35,代码行数:44,代码来源:rtl8370_asicdrv_led.c


示例3: location

/*
@func ret_t | rtl8370_getAsicVlan4kEntry | Get VID mapped entry to 4K VLAN table. 
@parm rtl8370_user_vlan4kentry* | ptr_vlan4kEntry | VLAN entry seting for 4K table. There is VID field in entry structure and  entry is directly mapping to 4K table location (1 to 1).
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_INPUT | Invalid input parameter.
@rvalue RT_ERR_VLAN_VID | Invalid VID parameter (0~4095).
@comm
    The API can get entry of 4k VLAN table. Software must prepare the retrieving VID first at writing data and used control word to access desired VLAN entry.
    
*/
ret_t rtl8370_getAsicVlan4kEntry(rtl8370_user_vlan4kentry *ptr_vlan4kEntry )
{
#if defined(DISABLE_VLAN_SHADOW)
    rtl8370_vlan4kentrysmi vlan_4k_entry;
    uint32                    page_idx;
    uint16                    *tableAddr;
    ret_t                     retVal;
    uint32                     regData;

    if(NULL == ptr_vlan4kEntry)     
        return RT_ERR_INPUT;

    /* Write Address (VLAN_ID) */
    regData = ptr_vlan4kEntry->vid;
    retVal = rtl8370_setAsicReg(RTL8370_TABLE_ACCESS_ADDR_REG, regData);
    if(retVal !=  RT_ERR_OK)
        return retVal;

    /* Read Command */
    retVal = rtl8370_setAsicReg(RTL8370_TABLE_ACCESS_CTRL_REG, RTL8370_TABLE_ACCESS_REG_DATA(TB_OP_READ,TB_TARGET_CVLAN));
    if(retVal !=  RT_ERR_OK)
        return retVal;

    /* Check ASIC Command */

    /* Read VLAN data from register */
    tableAddr = (uint16 *)&vlan_4k_entry;
    for(page_idx = 0; page_idx < (sizeof(rtl8370_vlan4kentrysmi) / 2); page_idx++)
    {
        retVal = rtl8370_getAsicReg(RTL8370_TABLE_ACCESS_DATA_BASE + page_idx, &regData);
        if(retVal !=  RT_ERR_OK)
            return retVal;

        *tableAddr = regData;
        tableAddr++;
    }

    _rtl8370_Vlan4kStSmi2User(&vlan_4k_entry, ptr_vlan4kEntry);

#else

    uint16  vid;

    if(ptr_vlan4kEntry->vid > RTL8370_VIDMAX)
        return RT_ERR_VLAN_VID;

    vid = ptr_vlan4kEntry->vid;
    memcpy(ptr_vlan4kEntry, &user_4kvlan[ptr_vlan4kEntry->vid], sizeof(rtl8370_user_vlan4kentry));
    ptr_vlan4kEntry->vid = vid;

#endif

#if defined(CONFIG_RTL8370_ASICDRV_TEST)
    _rtl8370_Vlan4kStSmi2User(&Rtl8370sVirtualVlanTable[ptr_vlan4kEntry->vid], ptr_vlan4kEntry);
#endif

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


示例4: number

/*
@func ret_t | rtl8370_getAsicPHYReg | Set PHY registers .
@parm uint32 | phyNo | PHY number (0~7).
@parm uint32 | phyAddr | PHY address (0~31).
@parm uint32* | data | Read 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 | iinvalid port id
@rvalue RT_ERR_BUSYWAIT_TIMEOUT | PHY access busy
@comm
     The API can get internal PHY register 0~31. There are 8 internal PHYs in switch and each PHY can be
    accessed by software.
 */
ret_t rtl8370_getAsicPHYReg( uint32 phyNo, uint32 phyAddr, uint32 *data )
{
    ret_t retVal;
    uint32 regData;
    uint32 busyFlag,checkCounter;

    if(phyNo > RTL8370_PHY_INTERNALNOMAX)
        return RT_ERR_PORT_ID;

    if(phyAddr > RTL8370_PHY_REGNOMAX)
        return RT_ERR_PHY_REG_ID;

    /*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 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 READ Command*/
    retVal = rtl8370_setAsicReg(RTL8370_REG_INDRECT_ACCESS_CRTL, RTL8370_CMD_MASK );
    if(retVal !=  RT_ERR_OK)
        return retVal;

    checkCounter = 5;
    while(checkCounter)
    {
        retVal = rtl8370_getAsicRegBit(RTL8370_REG_INDRECT_ACCESS_STATUS, RTL8370_PHY_BUSY_OFFSET,&busyFlag);
        if(retVal !=  RT_ERR_OK)
        {
            checkCounter --;
            if(0 == checkCounter)
                return retVal;
        }
        else
        {
            checkCounter = 0;
        }        
    }

    /*get PHY register*/
    retVal = rtl8370_getAsicReg(RTL8370_REG_INDRECT_ACCESS_READ_DATA, &regData);
    if(retVal !=  RT_ERR_OK)
        return retVal;

    *data = regData;

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


示例5: rtl8370_getAsicAclAct

ret_t rtl8370_getAsicAclAct( uint32 index, rtl8370_acl_act_t *aclAct)
{
    rtl8370_acl_act_smi_t aclActSmi;
    ret_t retVal;
    uint32 regAddr, regData;
    uint16* tableAddr;
    uint32 i;
    
    if(index > RTL8370_ACLRULEMAX)
        return RT_ERR_FILTER_ENTRYIDX;
    
    memset(&aclActSmi,0x00,sizeof(rtl8370_acl_act_smi_t));


    /* Write ACS_ADR register for data bits */
    regAddr = RTL8370_TABLE_ACCESS_ADDR_REG;
    regData = index;
    retVal = rtl8370_setAsicReg(regAddr, regData);
    if(retVal !=RT_ERR_OK)
        return retVal;
    

    /* Write ACS_CMD register */
    regAddr = RTL8370_TABLE_ACCESS_CTRL_REG;
    regData = RTL8370_TABLE_ACCESS_REG_DATA(TB_OP_READ, TB_TARGET_ACLACT);
    retVal = rtl8370_setAsicReg(regAddr, regData);
    if(retVal !=RT_ERR_OK)
        return retVal;
    

    /* Read Data Bits */
    regAddr = RTL8370_TABLE_ACCESS_DATA_BASE;
    tableAddr = (uint16*)&aclActSmi;
    for(i=0;i<RTL8370_ACLACTTBLEN;i++)
    {
        retVal = rtl8370_getAsicReg(regAddr, &regData);
        if(retVal !=RT_ERR_OK)
            return retVal;

        *tableAddr = regData;
        
        regAddr ++;
        tableAddr ++;
    }

     _rtl8370_aclActStSmi2User(aclAct, &aclActSmi);
     
#ifdef CONFIG_RTL8370_ASICDRV_TEST
    Rtl8370sVirtualAclActTable[index] = aclActSmi;
#endif

    return RT_ERR_OK;
}
开发者ID:LXiong,项目名称:openwrt-rtk,代码行数:53,代码来源:rtl8370_asicdrv_acl.c


示例6: rtl8370_setAsicSvlanMemberConfiguration

/*
@func ret_t | rtl8370_setAsicSvlanMemberConfiguration| Configure system 64 S-tag content
@parm uint32 | index | index of 64 s-tag configuration
@parm rtl8370_svlan_memconf_t* | svlanMemConf | SVLAN member configuration
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_SVLAN_ENTRY_INDEX | Invalid input SVLAN index parameter.
@comm
    The API can set system 64 accepted s-tag frame format. Only 64 SVID S-tag frame will be accpeted
    to receiving from uplink ports. Other SVID S-tag frame or S-untagged frame will be droped.

*/
ret_t rtl8370_setAsicSvlanMemberConfiguration(uint32 index,rtl8370_svlan_memconf_t* svlanMemConf)
{
    ret_t retVal;
    uint32 regData;
    uint16 *accessPtr;
    uint32 i;

    rtl8370_svlan_memconf_smi_t smiSvlanMemConf;

    if(index > RTL8370_SVIDXMAX)
        return RT_ERR_SVLAN_ENTRY_INDEX;

    memset(&smiSvlanMemConf,0x00,sizeof(smiSvlanMemConf));
    _rtl8370_svlanConfStUser2Smi(svlanMemConf,&smiSvlanMemConf);

    accessPtr =  (uint16*)&smiSvlanMemConf;

    
    regData = *accessPtr;
    for(i = 0; i < 4; i++)
    {
        retVal = rtl8370_setAsicReg(RTL8370_SVLAN_MEMBERCFG_BASE_REG+(index<<2)+i,regData);
        if(retVal !=  RT_ERR_OK)
            return retVal;

        accessPtr ++;
        regData = *accessPtr;
    }
    
    
    return retVal;  
}   
开发者ID:appleorange1,项目名称:asus-rt-n12-lx,代码行数:44,代码来源:rtl8370_asicdrv_svlan.c


示例7: _rtl8370_setAsicEeelldpFrameDataReg

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

    accessPtr = (uint16*)writeDataPtr;

    for(i=0; i < dataLength / 2; i++)
    {
        regData = *accessPtr;
        ret = rtl8370_setAsicReg(regAddr + i, regData);
        if(RT_ERR_OK != ret)
            return ret;

        accessPtr++;
    }
    
    if (dataLength & 0x1)
    {
        regData = *accessPtr;
        ret = rtl8370_setAsicRegBits(regAddr + dataLength / 2, 0xFF, regData);
        if(RT_ERR_OK != ret)
            return ret;
    }

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


示例8: rtl8370_setAsicRldpTxPortmask

/*
@func ret_t | rtl8370_setAsicRldpTxPortmask | Set portmask that send/forward RLDP frame.
@parm uint32 | pmsk | 0~0xFFFF
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error. 
@rvalue RT_ERR_INPUT | Invalid input parameter.
@comm
    This API set the portmask of sending broadcast packet and flooding port mask of RLDP packet
    RLDP frame is a kind ofbroadcast frame, but the destination ports will
    follow RLDP_TX_PMSK.
*/
ret_t rtl8370_setAsicRldpTxPortmask(uint32 pmsk)
{
    if(pmsk > RTL8370_PORTMASK)
        return RT_ERR_PORT_MASK;

    return rtl8370_setAsicReg(RTL8370_RLDP_TX_PMSK_REG, pmsk);
}
开发者ID:jing-git,项目名称:rt-n56u,代码行数:18,代码来源:rtl8370_asicdrv_rldp.c


示例9: index

/*
@func ret_t | rtl8370_setAsicShareMeter | Set 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_INPUT | Invalid input parameter
@rvalue RT_ERR_RATE | Invalid rate
@rvalue RT_ERR_FILTER_METER_ID | Invalid meter
@comm
    The API can set shared meter rate and ifg include for each meter. Rate unit is 8Kbps.    
 */
ret_t rtl8370_setAsicShareMeter(uint32 index, uint32 rate ,uint32 ifg)
{
    ret_t retVal;

    if(index > RTL8370_METERMAX)
        return RT_ERR_FILTER_METER_ID;

    if(rate > RTL8370_QOS_GRANULARTY_MAX)
        return RT_ERR_RATE;
    
    if(ifg > 1)
        return RT_ERR_INPUT;

    /*17-bits Rate*/
    retVal = rtl8370_setAsicReg(RTL8370_METER_RATE_REG(index), (rate & 0xFFFF));
    if(retVal != RT_ERR_OK)
        return retVal;

    retVal = rtl8370_setAsicReg(RTL8370_METER_RATE_REG(index) + 1, ((rate & 0x10000) >> 16));
    if(retVal != RT_ERR_OK)
        return retVal;

    /*IFG*/
    return rtl8370_setAsicRegBit(RTL8370_METER_IFG_CTRL_REG(index), RTL8370_METER_IFG_OFFSET(index), ifg);
}
开发者ID:jing-git,项目名称:rt-n56u,代码行数:38,代码来源:rtl8370_asicdrv_meter.c


示例10: rtl8370_setAsicMacAddress

/*
@func ret_t | rtl8370_setAsicMacAddress | Set switch MAC address
@parm ether_addr_t | mac | switch mac
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error. 
@comm
    The API can set Switch MAC
*/
ret_t rtl8370_setAsicMacAddress(ether_addr_t mac)
{
    ret_t retVal;
    uint32 regData;
    uint8 *accessPtr;
    uint32 i;

    accessPtr =  (uint8*)&mac;

    retVal = 0;
    regData = 0;
    for(i = 0; i <= 5; i++)
    {
        if (0 == (i%2))
        {
            regData = *accessPtr << 8;
        }
		else
		{
		    regData = regData | (*accessPtr);
            retVal = rtl8370_setAsicReg(RTL8370_SWITCH_MAC_BASE-(i/2),regData);
            if(retVal !=  RT_ERR_OK)
                return retVal;
			regData = 0;          		
		}
        accessPtr ++;
        
    }

    return retVal;
}
开发者ID:LXiong,项目名称:openwrt-rtk,代码行数:39,代码来源:rtl8370_asicdrv_misc.c


示例11: index

/*
@func ret_t | rtl8370_setAsicVlanProtocolBasedGroupData | Set 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 set 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_setAsicVlanProtocolBasedGroupData(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;

    if(ptr_pbcfg->frame_type >= PPVLAN_FRAME_TYPE_MAX_BOUND )
        return RT_ERR_INPUT;

    if((ptr_pbcfg->frame_type==PPVLAN_FRAME_TYPE_ETHERNET)&&(ptr_pbcfg->ether_type<0x0600)&&(ptr_pbcfg->ether_type!=0))
        return RT_ERR_INPUT;    

    frame_type = ptr_pbcfg->frame_type;
    ether_type = ptr_pbcfg->ether_type;

    /* Frame type */
    retVal = rtl8370_setAsicRegBits(RTL8370SG_VLAN_PPB_FRAMETYPE_REG(index), RTL8370SG_VLAN_PPB_FRAMETYPE_MASK, frame_type);
    if(retVal != RT_ERR_OK)
        return retVal;
    
    /* Ether type */
    retVal = rtl8370_setAsicReg(RTL8370_VLAN_PPB_ETHERTYPR_REG(index), ether_type);
    if(retVal != RT_ERR_OK)
        return retVal;

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


示例12: rtl8370_setAsicSvlanUplinkPortMask

/*
@func ret_t | rtl8370_setAsicSvlanUplinkPortMask | Configure uplink ports mask.
@parm uint32 | portMask | Uplink port mask setting.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_PORT_MASK | Invalid portmask.
@comm
    Uplink port mask is setting which ports are connected to provider switch. If ports are belong uplink ports and all frames receiving from these port must 
    contain accept SVID in S-tag field.
*/
ret_t rtl8370_setAsicSvlanUplinkPortMask(uint32 portMask)
{
    if(portMask > RTL8370_PORTMASK)
        return RT_ERR_PORT_MASK;
    
    return rtl8370_setAsicReg(RTL8370_REG_SVLAN_UPLINK_PORTMASK,portMask);
}
开发者ID:appleorange1,项目名称:asus-rt-n12-lx,代码行数:17,代码来源:rtl8370_asicdrv_svlan.c


示例13: rtl8370_setAsicSvlanMC2SConf

/*
@func ret_t | rtl8370_setAsicSvlanMC2SConf| Configure system 32 S-tag content
@parm uint32 | index | index of 32 Multicast to SVLAN configuration
@parm rtl8370_svlan_mc2s_t* | svlanMC2SConf | SVLAN Multicast to SVLAN member configuration
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_INPUT | Invalid input parameter.
@rvalue RT_ERR_OUT_OF_RANGE | input out of range.
@comm
    The API can set system 32 Mutlicast to SVID configuration. If upstream packet is L2 multicast or IPv4 multicast
    packet and DMAC/DIP is matched MC2S configuration, ASIC will assign egress SVID to the packet.

*/
ret_t rtl8370_setAsicSvlanMC2SConf(uint32 index,rtl8370_svlan_mc2s_t* svlanMC2SConf)
{
    ret_t retVal;
    uint32 regData;
    uint16 *accessPtr;
    uint32 i;

    rtl8370_svlan_mc2s_smi_t smiSvlanMC2S;

    if(index > RTL8370_MC2SIDXMAX)
        return RT_ERR_OUT_OF_RANGE;

    memset(&smiSvlanMC2S,0x00,sizeof(smiSvlanMC2S));
    _rtl8370_svlanMc2sStUser2Smi(svlanMC2SConf,&smiSvlanMC2S);

    accessPtr =  (uint16*)&smiSvlanMC2S;

    
    regData = *accessPtr;
    for(i = 0; i < 5; i++)
    {
        retVal = rtl8370_setAsicReg(RTL8370SG_SVLAN_MCAST2S_ENTRY_BASE_REG+(index*5)+i,regData);
        if(retVal !=  RT_ERR_OK)
            return retVal;

        accessPtr ++;
        regData = *accessPtr;
    }
    
    
    return retVal;  
}   
开发者ID:appleorange1,项目名称:asus-rt-n12-lx,代码行数:45,代码来源:rtl8370_asicdrv_svlan.c


示例14: portmask

/*
@func ret_t | rtl8370_setAsicPortForceFlush | Set per port force flush setting
@parm uint32 | pmsk | portmask(0~0xFFFF)
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_PORT_MASK | Invalid portmask.
@comm
     This function trigger flushing of per-port L2 learning.
     When flushing operaton completes, the corresponding bit will be clear.
*/
ret_t rtl8370_setAsicPortForceFlush(uint32 pmsk)
{
    if(pmsk > RTL8370_PORTMASK)
        return RT_ERR_PORT_MASK;

    return rtl8370_setAsicReg(RTL8370_FORCE_FLUSH_REG, pmsk);
}
开发者ID:xtra72,项目名称:s805,代码行数:16,代码来源:rtl8370_asicdrv_port.c


示例15: rtl8370_setAsicForceGroupLed

/*
@func ret_t | rtl8370_setAsicForceGroupLed | Turn on/off Led of all ports
@parm uint32 | groupmask | LED group mask.
@parm uint32 | mode | LED mode, 0b00:normal mode, 0b01:force blink, 0b10:force off, 0b11:force on.
@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_setAsicForceGroupLed(uint32 groupmask, uint32 mode)
{
    ret_t retVal;
	uint32 i,bitmask;
    CONST_T uint16 bits[3]= {0x0004,0x0010,0x0040};

    /* Invalid input parameter */
    if(groupmask > RTL8370_LEDGROUPMASK)
        return RT_ERR_INPUT;

    if(mode >= LEDFORCEMODE_MAX)
        return RT_ERR_INPUT;

    bitmask = 0;
	for(i=0;i<=RTL8370_LEDGROUPMAX;i++)
	{
	    if(groupmask&(1<<i))
	    {
            bitmask = bitmask | bits[i];
	    }
	}

    bitmask = bitmask | mode;

    retVal = rtl8370_setAsicReg(RTL8370_LED_FORCE_CTRL, bitmask);
	if( retVal !=  RT_ERR_OK)
    return retVal;

    return RT_ERR_OK;
}
开发者ID:mausvt,项目名称:seagate_central_cns3420_2-6-35,代码行数:41,代码来源:rtl8370_asicdrv_led.c


示例16: rtl8370_setAsicInterruptRelatedStatus

/*
@func ret_t | rtl8370_setAsicInterruptRelatedStatus | get interrupt status
@parm uint32 | type | per port Learn over, per-port speed change, per-port special congest, share meter exceed status
@parm uint32 | status | per port Learn over, per-port speed change, per-port special congest, share meter exceed status, write 1 to clear.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_INPUT | Invalid input value
@comm
    This API can be used to clear ASIC interrupt per port related status and share meter exceed status. All status will be clear by write 1.
*/
ret_t rtl8370_setAsicInterruptRelatedStatus(uint32 type, uint32 status)
{
    if(type >= INTRST_MAX )
        return RT_ERR_INPUT;

    return rtl8370_setAsicReg(RTL8370_INTR_INDICATOR_BASED + type, status);
}
开发者ID:schidler,项目名称:flyzjhz-rt-n56u,代码行数:16,代码来源:rtl8370_asicdrv_interrupt.c


示例17: Spd100

/*
@func ret_t | rtl8370_setAsicLedIndicateInfoConfig | Set Leds indicated information mode
@parm uint32 | ledno | LED group number. There are 1 to 1 led mapping to each port in each led group.
@parm enum RTL8370_LEDCONF | config | Support 16 types configuration.
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@comm
    The API can set LED indicated information configuration for each LED group with 1 to 1 led mapping to each port.
    Definition        LED Statuses            Description
    0000        LED_Off                LED pin Tri-State.
    0001        Dup/Col                Collision, Full duplex Indicator. Blinking every 43ms when collision happens. Low for full duplex, and high for half duplex mode.
    0010        Link/Act               Link, Activity Indicator. Low for link established. Link/Act Blinks every 43ms when the corresponding port is transmitting or receiving.
    0011        Spd1000                1000Mb/s Speed Indicator. Low for 1000Mb/s.
    0100        Spd100                 100Mb/s Speed Indicator. Low for 100Mb/s.
    0101        Spd10                  10Mb/s Speed Indicator. Low for 10Mb/s.
    0110        Spd1000/Act            1000Mb/s Speed/Activity Indicator. Low for 1000Mb/s. Blinks every 43ms when the corresponding port is transmitting or receiving.
    0111        Spd100/Act             100Mb/s Speed/Activity Indicator. Low for 100Mb/s. Blinks every 43ms when the corresponding port is transmitting or receiving.
    1000        Spd10/Act              10Mb/s Speed/Activity Indicator. Low for 10Mb/s. Blinks every 43ms when the corresponding port is transmitting or receiving.
    1001        Spd100 (10)/Act        10/100Mb/s Speed/Activity Indicator. Low for 10/100Mb/s. Blinks every 43ms when the corresponding port is transmitting or receiving.
    1010        Fiber                  Fiber link Indicator. Low for Fiber.
    1011        Fault                  Auto-negotiation     Fault Indicator. Low for Fault.
    1100        Link/Rx                Link, Activity Indicator. Low for link established. Link/Rx Blinks every 43ms when the corresponding port is transmitting.
    1101        Link/Tx                Link, Activity Indicator. Low for link established. Link/Tx Blinks every 43ms when the corresponding port is receiving.
    1110        Master                 Link on Master Indicator. Low for link Master established.
    1111        Act                    Activity Indicator. Low for link established.
 */
ret_t rtl8370_setAsicLedIndicateInfoConfig(uint32 ledno, enum RTL8370_LEDCONF config)
{
    ret_t retVal;
    uint32 regData;
    CONST_T uint16 bits[RTL8370_LEDGROUPMAX+1]= { RTL8370_LED0_CFG_MASK, RTL8370_LED1_CFG_MASK, RTL8370_LED2_CFG_MASK};
    CONST_T uint16 offsets[RTL8370_LEDGROUPMAX+1]= { RTL8370_LED0_CFG_OFFSET, RTL8370_LED1_CFG_OFFSET, RTL8370_LED2_CFG_OFFSET};

    if(ledno > RTL8370_LEDGROUPMAX)
        return RT_ERR_INPUT;

    if(config > LEDCONF_ACT)
        return RT_ERR_INPUT;

    retVal = rtl8370_getAsicReg(RTL8370_REG_LED_CONFIGURATION,&regData);
	if( retVal !=  RT_ERR_OK)
		return retVal;

    regData = regData & (~RTL8370_LED_CONFIG_SEL_MASK);
    regData = regData & (~bits[ledno]);
    regData = regData | ((config & RTL8370_LED0_CFG_MASK)<<offsets[ledno]);

    retVal = rtl8370_setAsicReg(RTL8370_REG_LED_CONFIGURATION,regData);

    return retVal;
}
开发者ID:mausvt,项目名称:seagate_central_cns3420_2-6-35,代码行数:51,代码来源:rtl8370_asicdrv_led.c


示例18: portmask

/*
@func ret_t | rtl8370_setAsicCputagPortmask | Set ports that can parse CPU tag
@parm uint32 | pmsk | portmask (0~0xFFFF)
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error. 
@rvalue RT_ERR_PORT_MASK | Invalid portmask.
@comm
    This API can set ports that are able to parse CPU tag
*/
ret_t rtl8370_setAsicCputagPortmask(uint32 pmsk)
{
    if(pmsk > RTL8370_PORTMASK)
        return RT_ERR_PORT_MASK;

    return rtl8370_setAsicReg(RTL8370_CPU_PORT_MASK_REG, pmsk);
}
开发者ID:jing-git,项目名称:rt-n56u,代码行数:16,代码来源:rtl8370_asicdrv_cputag.c


示例19: rtl8370_setAsicSvlanSP2CConf

/*
@func ret_t | rtl8370_setAsicSvlanSP2CConf| Configure system 128 SP2C content
@parm uint32 | index | index of 128 SVLAN & Port to CVLAN configuration
@parm rtl8370_svlan_s2c_t* | svlanSP2CConf | SVLAN & Port to CVLAN configuration
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_INPUT | Invalid input parameter.
@rvalue RT_ERR_OUT_OF_RANGE | input out of range.
@comm
    The API can set system 128 SVID & Destination Port to CVLAN configuration. 

*/
ret_t rtl8370_setAsicSvlanSP2CConf(uint32 index,rtl8370_svlan_s2c_t* svlanSP2CConf)
{
    ret_t retVal;
    uint32 regData;
    uint16 *accessPtr;
    uint32 i;

    rtl8370_svlan_s2c_smi_t smiSvlanSP2C;

    if(index > RTL8370_SP2CMAX)
        return RT_ERR_OUT_OF_RANGE;

    memset(&smiSvlanSP2C,0x00,sizeof(smiSvlanSP2C));
    _rtl8370_svlanSp2cStUser2Smi(svlanSP2CConf,&smiSvlanSP2C);

    accessPtr =  (uint16*)&smiSvlanSP2C;

    
    regData = *accessPtr;
    for(i=0;i<2;i++)
    {
        retVal = rtl8370_setAsicReg(RTL8370_SVLAN_S2C_ENTRY_BASE_REG +(index*2)+i,regData);
        if(retVal !=  RT_ERR_OK)
            return retVal;

        accessPtr ++;
        regData = *accessPtr;
    }
    
    
    return retVal;  
}   
开发者ID:appleorange1,项目名称:asus-rt-n12-lx,代码行数:44,代码来源:rtl8370_asicdrv_svlan.c


示例20: size

/*
@func ret_t | rtl8370_setAsicWFQBurstSize | Set WFQ leaky bucket burst size.
@parm uint32 | burstsize | Leaky bucket burst size, unit byte
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@comm
    The API can set WFQ leaky bucket burst size(aka high threshold) 
 */
ret_t rtl8370_setAsicWFQBurstSize(uint32 burstsize)
{
    ret_t retVal;

    retVal = rtl8370_setAsicReg(RTL8370_SCHEDULE_WFQ_BURST_SIZE_REG, burstsize);
    
    return retVal;
}
开发者ID:LXiong,项目名称:openwrt-rtk,代码行数:16,代码来源:rtl8370_asicdrv_scheduling.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ rtl8370_setAsicRegBit函数代码示例发布时间:2022-05-30
下一篇:
C++ rtl8370_getAsicRegBits函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap