Adding new commiter to ODU-High repo
[o-du/l2.git] / src / cm / cm_tenb_stats.x
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18
19 /**********************************************************************
20  
21     Name:  
22  
23     Type:  
24  
25     Desc:  
26  
27     File:  cm_tenb_stats.x 
28  
29 **********************************************************************/
30  
31 /** @file cm_tenb_stats.x
32 */
33
34 #ifdef TENB_STATS
35  
36 #include "cm_tenb_stats.h"
37 #include "l2_tenb_stats.h"
38
39 #ifndef __TENBSTATSINFX__
40 #define __TENBSTATSINFX__
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif /* __cplusplus */
45
46 typedef struct tsInfL2CellStats
47 {
48    uint32_t   cellId;
49    struct schCellStats{ 
50       uint32_t   msg4Fail;
51       uint32_t   msg3Fail;
52       uint32_t   dlSumCw0Cqi;
53       uint32_t   dlNumCw0Cqi;
54       uint32_t   dlSumCw1Cqi;
55       uint32_t   dlNumCw1Cqi;
56       uint32_t   dlSumCw0iTbs;
57       uint32_t   dlNumCw0iTbs;
58       uint32_t   dlSumCw1iTbs;
59       uint32_t   dlNumCw1iTbs;
60       uint32_t   riCnt[4]; /* Rank = 1..4 */
61       uint32_t   dlNack[2][4];
62       uint32_t   dlAckNack[2][4]; /* [CW_CNT][RV_CNT] */
63       uint32_t   dlDtx[2][4];
64       uint32_t   ulNack[4];
65       uint32_t   ulAckNack[4];    /* [RV_CNT] */
66       uint32_t   ulDtx[4];
67       uint32_t   dlPrbUsage[10]; /* dlPrbUsage[0] to have overall PRB usage */
68       uint32_t   ulPrbUsage[10]; /* dlPrbUsage[0] to have overall PRB usage */
69       uint32_t   dlPdbRatio[10];
70       uint32_t   avgTtiProcTime; /* In us */
71       uint32_t   cntTtiProcTime1000; /* Count of instances where TTI proc time was
72       greater than 1000us */
73       uint32_t   cntTtiProcTime900; /* Count of instances where TTI proc time was
74       greater than 900us and less than 1000us */
75       uint32_t   cntTtiProcTime800;
76       uint32_t   cntTtiProcTime700;
77       uint32_t   cntTtiProcTime600;
78       uint32_t   cntTtiProcTime500;
79 #ifdef RG_5GTF
80       uint32_t   dl5gtfUePick;
81       uint32_t   dl5gtfRbAllocPass;
82       uint32_t   dl5gtfRbAllocFail;
83       uint32_t   dl5gtfFnlzPass;
84       uint32_t   dl5gtfFnlzFail;
85       uint32_t   dl5gtfBoUpd;
86       uint32_t   dl5gtfPdcchSend;
87       uint32_t   dl5gtfPdschCons;
88
89       uint32_t   ul5gtfSrRecv;
90       uint32_t   ul5gtfBsrRecv;
91       uint32_t   ul5gtfUeSchPick;
92       uint32_t   ul5gtfPdcchSchd;
93       uint32_t   ul5gtfAllocAllocated;
94       uint32_t   ul5gtfUeRbAllocDone;
95       uint32_t   ul5gtfUeRmvFnlzZeroBo;
96       uint32_t   ul5gtfUeFnlzReAdd;
97       uint32_t   ul5gtfPdcchSend;
98       uint32_t   ul5gtfRbAllocFail;
99 #endif
100       uint32_t   ulSumCqi;
101       uint32_t   ulNumCqi;
102       uint32_t   ulSumiTbs;
103       uint32_t   ulNumiTbs;
104       uint32_t   dlTtlTpt;
105       uint32_t   ulTtlTpt;
106    }sch;
107    struct rlcCellStats{ 
108       uint32_t   maxRlcSrbRetxFail;
109       uint32_t   maxRlcDrbRetxFail;
110       uint32_t   reOdrTmrExp;
111    }rlc;
112 }TSInfL2CellStats;
113
114 typedef struct tsInfL2UeStats
115 {
116    uint32_t rnti;
117    struct nonPersistentUeStats{
118       struct schUeStats{
119          uint32_t dlTxOccns;
120          uint32_t dlRetxOccns;
121          uint32_t dlPrbUsg;
122          uint32_t dlNackCnt[2]; /* [CW_CNT] */
123          uint32_t dlAckNackCnt[2]; /* [CW_CNT] */
124          uint32_t dlDtxCnt[2]; /* [CW_CNT] */
125          uint32_t dlSumCw0Cqi;
126          uint32_t dlNumCw0Cqi;
127          uint32_t dlSumCw1Cqi;
128          uint32_t dlNumCw1Cqi;
129          uint32_t dlSumCw0iTbs;
130          uint32_t dlNumCw0iTbs;
131          uint32_t dlSumCw1iTbs;
132          uint32_t dlNumCw1iTbs;
133          uint32_t cqiDropCnt;
134          uint32_t dlPdbLvl[5]; /* PDB Levels */ 
135          uint32_t riCnt[4]; /* Rank = 1..4 */
136          uint32_t dlBo;
137          uint32_t dlTpt;
138          uint32_t ulTxOccns;
139          uint32_t ulRetxOccns;
140          uint32_t ulPrbUsg;
141          uint32_t ulAckNackCnt;
142          uint32_t ulNackCnt;
143          uint32_t ulDtxCnt;
144          uint32_t ulSumCqi;
145          uint32_t ulNumCqi;
146          uint32_t ulSumiTbs;
147          uint32_t ulNumiTbs;
148          uint32_t ulTpt;
149       }sch[L2_STATS_MAX_CELLS];
150       struct pdcpUeStats{
151          uint32_t dlPdcpDropCnt;
152          uint32_t dlPdcpAckWaitDropCnt;
153          uint32_t dlFlowCtrlDropCnt;
154       }pdcp;
155       struct rlcUeStats{
156          uint32_t ulReOdrTmrExpCnt;
157          uint32_t dlMaxPktsInSduQ;
158          uint32_t dlMaxWindowSz;
159       }rlc;
160    }nonPersistent;
161    struct persistentUeStats{
162       uint32_t activatedSCells;
163       uint32_t numActivation;
164       uint32_t numDeactivation;
165    }persistent;
166 }TSInfL2UeStats;
167
168 typedef struct tsInfStatsCb
169 {
170    Bool initDone;
171    Bool sockSend;
172    Bool fileSend;
173    Bool consPrint;
174    uint32_t  statsPer;
175    uint32_t  sockPort;
176    Bool startSockSend;
177    uint8_t   cmdForFileStats;
178    char fileName[100];
179    FILE *fptr;
180    uint32_t  enbIp;
181 }TSInfStatsCb;
182
183 typedef Void (*TSInfL2UeStatsInd) ARGS((
184  Pst *, 
185  SuId , 
186  TSInfL2UeStats *
187 ));
188 Void TSInfHdlL2UeStatsInd ARGS((
189  Pst               *pst,
190  SuId              suId,
191  TSInfL2UeStats     *stats 
192 ));
193 Void TSInfUnpkL2UeStats ARGS((
194  TSInfL2UeStatsInd   func,
195  Pst                *pst,
196  Buffer             *mBuf
197 ));
198 typedef Void (*TSInfL2CellStatsInd) ARGS((
199  Pst *, 
200  SuId , 
201  TSInfL2CellStats *
202 ));
203 Void TSInfHdlL2CellStatsInd ARGS((
204  Pst                 *pst,
205  SuId                suId,
206  TSInfL2CellStats    *stats 
207 ));
208 Void TSInfUnpkL2CellStats ARGS((
209  TSInfL2CellStatsInd   func,
210  Pst                  *pst,
211  Buffer               *mBuf
212 ));
213 Void TSInfPkSndL2UeStats ARGS((
214  Pst               *pst,
215  SuId              suId,
216  TSInfL2UeStats     *stats 
217 ));
218 Void TSInfPkSndL2CellStats ARGS((
219  Pst                 *pst,
220  SuId                suId,
221  TSInfL2CellStats     *stats 
222 ));
223 Void TSInfTrigStats ARGS((
224  Region    region,
225  Pool      pool
226 ));
227
228 #ifdef __cplusplus
229 }
230 #endif /* __cplusplus */
231 #endif /* __TENBSTATSINFX__ */
232 #endif /* TENB_STATS */
233
234 /**********************************************************************
235          End of file
236 **********************************************************************/