本文整理汇总了C++中rtl8370_getAsicReg函数的典型用法代码示例。如果您正苦于以下问题:C++ rtl8370_getAsicReg函数的具体用法?C++ rtl8370_getAsicReg怎么用?C++ rtl8370_getAsicReg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rtl8370_getAsicReg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: number
/*
@func ret_t | rtl8370_getAsicPortBasedFid | Get port based FID
@parm uint32 | port | Physical port number (0~15).
@parm uint32* | fid | Port based fid(0~0xFFF)
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_L2_FID | Invalid FID (0~4095).
@rvalue RT_ERR_PORT_ID | Invalid port number.
@comm
This API can get Port-Based FID.There are three FID sources of receiving packet.
*/
ret_t rtl8370_getAsicPortBasedFid(uint32 port, uint32* fid)
{
if(port > RTL8370_PORTIDMAX)
return RT_ERR_PORT_ID;
return rtl8370_getAsicReg(RTL8370_PORT_PBFID_REG(port),fid);
}
示例2: index
/*
@func ret_t | rtl8370_getAsicShareMeterBucketSize | Get meter related leaky bucket threshold
@parm uint32 | index | Shared meter index (0-63) of 64 shared meter index
@parm uint32 | lbthreshold | Leaky bucket threshold of this meter
@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 leaky bucket threshold for each meter.
*/
ret_t rtl8370_getAsicShareMeterBucketSize(uint32 index, uint32 *lbthreshold)
{
if(index > RTL8370_METERMAX)
return RT_ERR_FILTER_METER_ID;
return rtl8370_getAsicReg(RTL8370_METER_BUCKET_SIZE_REG(index), lbthreshold);
}
示例3: 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), ðer_type);
if(retVal != RT_ERR_OK)
return retVal;
ptr_pbcfg->frame_type = frame_type;
ptr_pbcfg->ether_type = ether_type;
return RT_ERR_OK;
}
示例4: id
/*
@func ret_t | rtl8370_getAsicPortForceLinkExt | Get external interface force linking configuration.
@parm uint32 | id | external interface id (0~1).
@parm rtl8370_port_ability_t* | portability | port ability configuration
@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 force mode properties.
*/
ret_t rtl8370_getAsicPortForceLinkExt(uint32 id, rtl8370_port_ability_t *portability)
{
ret_t retVal;
uint32 regData;
uint16 *accessPtr;
rtl8370_port_ability_t ability;
/* Invalid input parameter */
if(id >= RTL8370_EXTNO)
return RT_ERR_PORT_ID;
memset(&ability,0x00,sizeof(rtl8370_port_ability_t));
accessPtr = (uint16*)&ability;
retVal = rtl8370_getAsicReg(RTL8370_REG_DIGITIAL_INTERFACE0_FORCE + id, ®Data);
if(retVal != RT_ERR_OK)
return retVal;
*accessPtr = regData;
memcpy(portability, &ability, sizeof(rtl8370_port_ability_t));
return RT_ERR_OK;
}
示例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, ®Data);
if(RT_ERR_OK != ret)
return ret;
*accessPtr = (int16)regData;
accessPtr++;
}
if (dataLength & 0x1)
{
ret = rtl8370_getAsicRegBits(regAddr + dataLength / 2, 0xFF, ®Data);
if (RT_ERR_OK != ret)
return ret;
*accessPtr = (int16)regData;
}
return RT_ERR_OK;
}
示例6: rtl8370_getAsicEeeRxMeter
/*
@func ret_t | rtl8370_getAsicEeeGiga | Get eee RX meter.
@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_getAsicEeeRxMeter(uint32 port, uint32 *cnt)
{
if(port >= RTL8370_PORTNO)
return RT_ERR_PORT_ID;
return rtl8370_getAsicReg(RTL8370_PORT_EEE_RX_METER_REG(port), cnt);
}
示例7: rtl8370_getAsicSvlanMC2SConf
/*
@func ret_t | rtl8370_getAsicSvlanMC2SConf| Get 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.
@comm
The API can get 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_getAsicSvlanMC2SConf(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));
accessPtr = (uint16*)&smiSvlanMC2S;
for(i = 0; i < 5; i++)
{
retVal = rtl8370_getAsicReg(RTL8370SG_SVLAN_MCAST2S_ENTRY_BASE_REG+(index*5)+i,®Data);
if(retVal != RT_ERR_OK)
return retVal;
*accessPtr = regData;
accessPtr ++;
}
_rtl8370_svlanMc2sStSmi2User(svlanMC2SConf,&smiSvlanMC2S);
return RT_ERR_OK;
}
示例8: rtl8370_getAsicSvlanSP2CConf
/*
@func ret_t | rtl8370_getAsicSvlanSP2CConf| Get configure system 128 SP2C content
@parm uint32 | index | index of 128 SVLAN & Port to CVLAN configuration
@parm rtl8370_svlan_mc2s_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.
@comm
The API can get system 128 SVID & Destination Port to CVLAN configuration.
*/
ret_t rtl8370_getAsicSvlanSP2CConf(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));
accessPtr = (uint16*)&smiSvlanSP2C;
for(i=0;i<5;i++)
{
retVal = rtl8370_getAsicReg(RTL8370_SVLAN_S2C_ENTRY_BASE_REG+(index*2)+i,®Data);
if(retVal != RT_ERR_OK)
return retVal;
*accessPtr = regData;
accessPtr ++;
}
_rtl8370_svlanSp2cStSmi2User(svlanSP2CConf,&smiSvlanSP2C);
return RT_ERR_OK;
}
示例9: rtl8370_getAsicInterruptRelatedStatus
/*
@func ret_t | rtl8370_getAsicInterruptRelatedStatus | 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
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_INPUT | Invalid input value
@comm
This API can be used to get ASIC interrupt per port related status and share meter exceed status. All status will be clear by READ.
*/
ret_t rtl8370_getAsicInterruptRelatedStatus(uint32 type,uint32* status)
{
if(type >= INTRST_MAX )
return RT_ERR_INPUT;
return rtl8370_getAsicReg(RTL8370_INTR_INDICATOR_BASED + type, status);
}
示例10: 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,®Data);
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;
}
示例11: rtl8370_getAsicSvlanMemberConfiguration
/*
@func ret_t | rtl8370_getAsicSvlanMemberConfiguration| Get SVLAN member Configure.
@parm uint32 | index | index of 8 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 SVLAN configuration index.
@comm
The API can get 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_getAsicSvlanMemberConfiguration(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));
accessPtr = (uint16*)&smiSvlanMemConf;
for(i = 0; i < 4; i++)
{
retVal = rtl8370_getAsicReg(RTL8370_SVLAN_MEMBERCFG_BASE_REG+(index<<2)+i,®Data);
if(retVal != RT_ERR_OK)
return retVal;
*accessPtr = regData;
accessPtr ++;
}
_rtl8370_svlanConfStSmi2User(svlanMemConf,&smiSvlanMemConf);
return RT_ERR_OK;
}
示例12: 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;
}
示例13: rtl8370_getAsicLutLearnLimitNo
/*
@func ret_t | rtl8370_getAsicLutLearnLimitNo | Get per-Port auto learning limit number
@parm uint32 | port | The port number
@parm uint32* | number | ASIC auto learning entries limit number
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_PORT_ID | Invalid port number.
@common
The API can get per-port ASIC auto learning limit number
*/
ret_t rtl8370_getAsicLutLearnLimitNo(uint32 port,uint32* number)
{
if(port > RTL8370_PORTIDMAX)
return RT_ERR_PORT_ID;
return rtl8370_getAsicReg(RTL8370_LUT_PORT_LEARN_LIMITNO_REG(port), number);
}
示例14: number
/*
@func ret_t | rtl8370_getAsicPortIsolationPermittedPortmask | Get permitted port isolation portmask
@parm uint32 | port | Physical port number (0~15).
@parm uint32* | permitPortmask | portmask (0~0xFFFF)
@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 port mask that a port can trasmit packet to of each port
A port can only transmit packet to ports included in permitted portmask
*/
ret_t rtl8370_getAsicPortIsolationPermittedPortmask(uint32 port, uint32 *permitPortmask)
{
if(port >= RTL8370_PORTNO)
return RT_ERR_PORT_ID;
return rtl8370_getAsicReg(RTL8370_PORT_ISOLATION_PORT_MASK_REG(port), permitPortmask);
}
示例15: rtl8370_getAsicPortForceLink
/*
@func ret_t | rtl8370_getAsicPortForceLink | Get port force linking configuration.
@parm uint32 | port | port number.
@parm rtl8370_port_ability_t* | portability | port ability configuration
@rvalue RT_ERR_OK | Success.
@rvalue RT_ERR_SMI | SMI access error.
@rvalue RT_ERR_FAILED | Invalid parameter.
@comm
This API can get Port/MAC force mode properties.
*/
ret_t rtl8370_getAsicPortForceLink(uint32 port, rtl8370_port_ability_t *portability)
{
ret_t retVal;
uint32 regData;
uint16 *accessPtr;
rtl8370_port_ability_t ability;
/* Invalid input parameter */
if(port >=RTL8370_PORTNO)
return RT_ERR_PORT_ID;
memset(&ability, 0x00, sizeof(rtl8370_port_ability_t));
accessPtr = (uint16*)&ability;
retVal = rtl8370_getAsicReg(RTL8370_REG_MAC0_FORCE_SELECT+port,®Data);
if(retVal != RT_ERR_OK)
return retVal;
*accessPtr = regData;
memcpy(portability, &ability, sizeof(rtl8370_port_ability_t));
return RT_ERR_OK;
}