Skip to content
Snippets Groups Projects
Commit 1bf181d9 authored by qzhou's avatar qzhou
Browse files

add set mask function

parent 4906cd47
Branches
Tags
1 merge request!14Monitoring
......@@ -108,6 +108,19 @@ int pcie40_b2l_mask(int dev, int ch){
return ( ( ret & ( 1 << ( SLC_BASE_BIT + ch ) ) )
>> ( SLC_BASE_BIT + ch ));
}
// set mask for corresponding b2l: 0->mask, 1->unmask
int pcie40_b2l_set_mask(int dev, int ch, int mask){
int ret = -1;
if(ch >= 0 && ch <=23){
ret = ecs_write(dev, SLC_BAR, SLC_B2LINK_MASK1, mask);
if(ret != 0) return -1;
}else if (ch >= 24 && ch <= 47 ){
ret = ecs_write(dev, SLC_BAR, SLC_B2LINK_MASK2, mask);
if(ret != 0) return -1;
}
return ret;
}
int pcie40_b2l_txstatus(int dev, int ch){
int ret = -1;
......
......@@ -32,12 +32,12 @@ extern "C" {
#define SLC_B2LINK_RX_STATUS2 0x00050180 // link in the ready state for txdata, channel 0-23, 1 bit pre channel
#define SLC_B2LINK_TX_STATUS1 0x000501A0 // link in the ready state for txdata, channel 0-23, 1 bit pre channel
#define SLC_B2LINK_TX_STATUS2 0x000501C0 // link in the ready state for txdata, channel 0-23, 1 bit pre channel
#define SLC_B2LINK_VETOIDLE 0x00070010 // count vetoidle
#define SLC_B2LINK_VETODATA 0x00070000 // count vetodata
#define SLC_B2LINK_BUFDOWN0 0x00090000 // buffer recent two words of rxdata
#define SLC_B2LINK_BUFDOWN1 0x00080000 // buffer recent two words of rxdata
#define SLC_B2LINK_CNTDOWN 0x000A0010 // buffer recent third words of rxdata [15 downto 0] + three charish {21 downto 16}
#define SLC_B2LINK_MONSTATUS 0x000A0000 // buffer recent two words of rxdata
#define SLC_B2LINK_VETOIDLE 0x00070000 // count vetoidle
#define SLC_B2LINK_VETODATA 0x00070010 // count vetodata
#define SLC_B2LINK_BUFDOWN0 0x00080000 // buffer recent two words of rxdata
#define SLC_B2LINK_BUFDOWN1 0x00090000 // buffer recent two words of rxdata
#define SLC_B2LINK_CNTDOWN 0x000A0000 // buffer recent third words of rxdata [15 downto 0] + three charish {21 downto 16}
#define SLC_B2LINK_MONSTATUS 0x000A0010 // buffer recent two words of rxdata
#define SLC_B2LINK_STATUS1 0x000501E0 // link up/down channel 0-23, 1 bit pre channel
#define SLC_B2LINK_STATUS2 0x00050200 // link up/down channel 24-47, 1 bit pre channel
......@@ -57,6 +57,7 @@ int pcie40_b2l_rxstatus(int dev, int ch);
int pcie40_b2l_txready(int dev, int ch);
int pcie40_b2l_rxready(int dev, int ch);
int pcie40_b2l_mask(int dev, int ch);
int pcie40_b2l_set_mask(int dev, int ch, int mask);
int pcie40_b2l_cnt_vetoidle(int dev, int ch);
int pcie40_b2l_cnt_vetodata(int dev, int ch);
int pcie40_b2l_3rdrxdata(int dev, int ch);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment