244bff9cffb67ae9ee5b182cc53c6e2548766f9f
[o-du/l2.git] / src / cm / cm_tenb_stats.c
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:   C include file
24  
25     Desc:   
26  
27     File:  cm_tenb_stats.c
28  
29 **********************************************************************/
30  
31 /** @file cm_tenb_stats.c
32 @brief This file contains 
33 */
34
35 /*
36 *     The defines in this file correspond to structures and variables 
37 *     used by the following TRILLIUM software:
38 *
39 *     part no.             description
40 *     --------     ----------------------------------------------
41 *
42 */
43 /* header include files (.h) */
44   
45 #include "envopt.h"             /* Environment options */  
46 #include "envdep.h"             /* Environment dependent */
47 #include "envind.h"             /* Environment independent */
48 #include "gen.h"                /* General */
49 #include "ssi.h"                /* System services interface */
50 #include "cm_lte.h"             /* Common LTE header file */
51 #include "cm_llist.h"           /* Linked list header file */
52 #include "cm_tkns.h"            /* Common tokens header file */
53 #include "du_log.h"
54
55 /* header/extern include files (.x) */
56
57 #include "gen.x"                /* General */
58 #include "ssi.x"                /* System services interface */
59 #include "cm_lib.x"             /* Common lib header file */
60 #include "cm_llist.x"           /* Linked list header file */
61 #include "cm_tkns.x"            /* Common tokens header file */
62 #include "cm_lte.x"             /* Common LTE header file */
63
64 #include "ss_queue.h"
65 #include "ss_queue.x"
66 #include "ss_task.x"
67 #include "ss_msg.x"
68 #include "cm_tenb_stats.x"    /* Total EnodeB Stats declarations */
69
70 #ifdef TENB_STATS
71 static Void TSInfUtlPackUeInfo ARGS((
72  Buffer            *mBuf,
73  TSInfL2UeStats     *stats 
74 ));
75 static Void TSInfUtlPackCellInfo ARGS((
76  Buffer              *mBuf,
77  TSInfL2CellStats     *stats 
78 ));
79 static Void TSInfUtlUnpkUeInfo ARGS((
80  Buffer            *mBuf,
81  TSInfL2UeStats     *stats 
82 ));
83 static Void TSInfUtlUnpkCellInfo ARGS((
84  Buffer              *mBuf,
85  TSInfL2CellStats     *stats
86 ));
87 static Buffer* TSInfUtlAllocMsg ARGS((
88  Pst   *pst
89 ));
90  
91 /*
92 *
93 *       Fun:   TSInfTrigL2Stats 
94 *
95 *       Desc:  Indicate PDCP UL to initiate Stats procedure 
96 *
97 *       Ret:   
98 *
99 *       Notes: None
100 *
101 *
102 */
103 static Void TSInfTrigL2Stats(Region region,Pool pool)
104 {
105    Buffer* pBuf;
106    Pst pst = {0};
107
108
109    SGetMsg(region, pool, &pBuf);
110 //#if defined(SCH_STATS) || defined(TENB_STATS)
111    pst.dstEnt = STATS_DSTENT;
112    pst.dstInst = STATS_DSTINST;
113    pst.selector = CL_DSTENT_SELECTOR;
114
115    pst.srcProcId = STATS_SRCPROCID;
116    pst.dstProcId = STATS_DSTPROCID;
117    pst.srcEnt = STATS_SRCENT;
118    pst.event = TENBSTATSINIT; 
119    SPstTsk(&pst, pBuf);
120
121    return;
122 }
123
124 /*
125 *
126 *       Fun:   TSInfTrigStats
127 *
128 *       Desc:  Trigger Sending L2 Stats
129 *
130 *       Ret:   
131 *
132 *       Notes: None
133 *
134 *
135 */
136 Void TSInfTrigStats(Region region,Pool pool)
137 {
138 //TODO
139    TSInfTrigL2Stats(region, pool);
140
141    return;
142 }
143
144          
145 static Buffer* TSInfUtlAllocMsg(Pst   *pst)
146 {
147    Buffer *mBuf; 
148
149
150    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
151       DU_LOG("\nERROR  -->  RLC : MBuf Allocation failed\n");
152    }
153    return (mBuf);
154 }
155
156 static Void TSInfUtlPackUeInfo(Buffer *mBuf,TSInfL2UeStats *stats)
157 {
158    S32 i;
159    uint32_t k;
160
161
162    CMCHKPK(oduUnpackUInt32, stats->persistent.numDeactivation, mBuf);
163    CMCHKPK(oduUnpackUInt32, stats->persistent.numActivation, mBuf);
164    CMCHKPK(oduUnpackUInt32, stats->persistent.activatedSCells, mBuf);
165
166    CMCHKPK(oduUnpackUInt32, stats->nonPersistent.rlc.dlMaxWindowSz, mBuf);
167    CMCHKPK(oduUnpackUInt32, stats->nonPersistent.rlc.dlMaxPktsInSduQ, mBuf);
168    CMCHKPK(oduUnpackUInt32, stats->nonPersistent.rlc.ulReOdrTmrExpCnt, mBuf);
169
170    CMCHKPK(oduUnpackUInt32, stats->nonPersistent.pdcp.dlFlowCtrlDropCnt, mBuf);
171    CMCHKPK(oduUnpackUInt32, stats->nonPersistent.pdcp.dlPdcpAckWaitDropCnt, mBuf);
172    CMCHKPK(oduUnpackUInt32, stats->nonPersistent.pdcp.dlPdcpDropCnt, mBuf);
173
174
175    for (k = 0; k < L2_STATS_MAX_CELLS; k++)
176    {
177       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].ulTpt, mBuf);
178       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].ulNumiTbs, mBuf);
179       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].ulSumiTbs, mBuf);
180       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].ulNumCqi, mBuf);
181       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].ulSumCqi, mBuf);
182       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].ulDtxCnt, mBuf);
183       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].ulNackCnt, mBuf);
184       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].ulAckNackCnt, mBuf);
185       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].ulPrbUsg, mBuf);
186       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].ulRetxOccns, mBuf);
187       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].ulTxOccns, mBuf);
188       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlTpt, mBuf);
189       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlBo, mBuf);
190       for (i=0; i<4; i++)
191       {
192          CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].riCnt[i], mBuf);
193       }
194       for (i=0; i<5; i++)
195       {
196          CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlPdbLvl[i], mBuf);
197       }
198       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].cqiDropCnt, mBuf);
199       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlNumCw1iTbs, mBuf);
200       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlSumCw1iTbs, mBuf);
201       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlNumCw0iTbs, mBuf);
202       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlSumCw0iTbs, mBuf);
203       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlNumCw1Cqi, mBuf);
204       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlSumCw1Cqi, mBuf);
205       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlNumCw0Cqi, mBuf);
206       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlSumCw0Cqi, mBuf);
207       for (i=0; i<2; i++)
208       {
209          CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlDtxCnt[i], mBuf);
210       }
211       for (i=0; i<2; i++)
212       {
213          CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlAckNackCnt[i], mBuf);
214       }
215       for (i=0; i<2; i++)
216       {
217          CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlNackCnt[i], mBuf);
218       }
219       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlPrbUsg, mBuf);
220       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlRetxOccns, mBuf);
221       CMCHKPK(oduUnpackUInt32, stats->nonPersistent.sch[k].dlTxOccns, mBuf);
222    }
223    CMCHKPK(oduUnpackUInt32, stats->rnti, mBuf);
224    return;
225 }
226
227 static Void TSInfUtlPackCellInfo(Buffer *mBuf,TSInfL2CellStats *stats  )
228 {
229    S32 i,j;
230
231
232    CMCHKPK(oduUnpackUInt32, stats->rlc.reOdrTmrExp, mBuf);
233    CMCHKPK(oduUnpackUInt32, stats->rlc.maxRlcDrbRetxFail, mBuf);
234    CMCHKPK(oduUnpackUInt32, stats->rlc.maxRlcSrbRetxFail, mBuf);
235
236    CMCHKPK(oduUnpackUInt32, stats->sch.ulNumiTbs, mBuf);
237    CMCHKPK(oduUnpackUInt32, stats->sch.ulSumiTbs, mBuf);
238    CMCHKPK(oduUnpackUInt32, stats->sch.ulNumCqi, mBuf);
239    CMCHKPK(oduUnpackUInt32, stats->sch.ulSumCqi, mBuf);
240 #ifdef RG_5GTF
241    CMCHKPK(oduUnpackUInt32, stats->sch.ul5gtfRbAllocFail, mBuf);
242    CMCHKPK(oduUnpackUInt32, stats->sch.ul5gtfPdcchSend, mBuf);
243    CMCHKPK(oduUnpackUInt32, stats->sch.ul5gtfUeFnlzReAdd, mBuf);
244    CMCHKPK(oduUnpackUInt32, stats->sch.ul5gtfUeRmvFnlzZeroBo, mBuf);
245    CMCHKPK(oduUnpackUInt32, stats->sch.ul5gtfUeRbAllocDone, mBuf);
246    CMCHKPK(oduUnpackUInt32, stats->sch.ul5gtfAllocAllocated, mBuf);
247    CMCHKPK(oduUnpackUInt32, stats->sch.ul5gtfPdcchSchd, mBuf);
248    CMCHKPK(oduUnpackUInt32, stats->sch.ul5gtfUeSchPick, mBuf);
249    CMCHKPK(oduUnpackUInt32, stats->sch.ul5gtfBsrRecv, mBuf);
250    CMCHKPK(oduUnpackUInt32, stats->sch.ul5gtfSrRecv, mBuf);
251
252    CMCHKPK(oduUnpackUInt32, stats->sch.dl5gtfPdschCons, mBuf);
253    CMCHKPK(oduUnpackUInt32, stats->sch.dl5gtfPdcchSend, mBuf);
254    CMCHKPK(oduUnpackUInt32, stats->sch.dl5gtfBoUpd, mBuf);
255    CMCHKPK(oduUnpackUInt32, stats->sch.dl5gtfFnlzFail, mBuf);
256    CMCHKPK(oduUnpackUInt32, stats->sch.dl5gtfFnlzPass, mBuf);
257    CMCHKPK(oduUnpackUInt32, stats->sch.dl5gtfRbAllocFail, mBuf);
258    CMCHKPK(oduUnpackUInt32, stats->sch.dl5gtfRbAllocPass, mBuf);
259    CMCHKPK(oduUnpackUInt32, stats->sch.dl5gtfUePick, mBuf);
260 #endif
261    CMCHKPK(oduUnpackUInt32, stats->sch.cntTtiProcTime500, mBuf);
262    CMCHKPK(oduUnpackUInt32, stats->sch.cntTtiProcTime600, mBuf);
263    CMCHKPK(oduUnpackUInt32, stats->sch.cntTtiProcTime700, mBuf);
264    CMCHKPK(oduUnpackUInt32, stats->sch.cntTtiProcTime800, mBuf);
265    CMCHKPK(oduUnpackUInt32, stats->sch.cntTtiProcTime900, mBuf);
266    CMCHKPK(oduUnpackUInt32, stats->sch.cntTtiProcTime1000, mBuf);
267    CMCHKPK(oduUnpackUInt32, stats->sch.avgTtiProcTime, mBuf);
268    for (i=9; i>=0; i--)
269    {
270       CMCHKPK(oduUnpackUInt32, stats->sch.dlPdbRatio[i], mBuf);
271    }
272    for (i=9; i>=0; i--)
273    {
274       CMCHKPK(oduUnpackUInt32, stats->sch.ulPrbUsage[i], mBuf);
275    }
276    for (i=9; i>=0; i--)
277    {
278       CMCHKPK(oduUnpackUInt32, stats->sch.dlPrbUsage[i], mBuf);
279    }
280    for (i=3; i>=0; i--)
281    {
282       CMCHKPK(oduUnpackUInt32, stats->sch.ulDtx[i], mBuf);
283    }
284    for (i=3; i>=0; i--)
285    {
286       CMCHKPK(oduUnpackUInt32, stats->sch.ulAckNack[i], mBuf);
287    }
288    for (i=3; i>=0; i--)
289    {
290       CMCHKPK(oduUnpackUInt32, stats->sch.ulNack[i], mBuf);
291    }
292    for (i=1; i>=0; i--)
293    {
294       for (j=3; j>=0; j--)
295       {
296          CMCHKPK(oduUnpackUInt32, stats->sch.dlDtx[i][j], mBuf);
297       }
298    }
299    for (i=1; i>=0; i--)
300    {
301       for (j=3; j>=0; j--)
302       {
303          CMCHKPK(oduUnpackUInt32, stats->sch.dlAckNack[i][j], mBuf);
304       }
305    }
306    for (i=1; i>=0; i--)
307    {
308       for (j=3; j>=0; j--)
309       {
310          CMCHKPK(oduUnpackUInt32, stats->sch.dlNack[i][j], mBuf);
311       }
312    }
313    for (i=3; i>=0; i--)
314    {
315       CMCHKPK(oduUnpackUInt32, stats->sch.riCnt[i], mBuf);
316    }
317    CMCHKPK(oduUnpackUInt32, stats->sch.dlNumCw1iTbs, mBuf);
318    CMCHKPK(oduUnpackUInt32, stats->sch.dlSumCw1iTbs, mBuf);
319    CMCHKPK(oduUnpackUInt32, stats->sch.dlNumCw0iTbs, mBuf);
320    CMCHKPK(oduUnpackUInt32, stats->sch.dlSumCw0iTbs, mBuf);
321    CMCHKPK(oduUnpackUInt32, stats->sch.dlNumCw1Cqi, mBuf);
322    CMCHKPK(oduUnpackUInt32, stats->sch.dlSumCw1Cqi, mBuf);
323    CMCHKPK(oduUnpackUInt32, stats->sch.dlNumCw0Cqi, mBuf);
324    CMCHKPK(oduUnpackUInt32, stats->sch.dlSumCw0Cqi, mBuf);
325    CMCHKPK(oduUnpackUInt32, stats->sch.msg3Fail, mBuf);
326    CMCHKPK(oduUnpackUInt32, stats->sch.msg4Fail, mBuf);
327
328    CMCHKPK(oduUnpackUInt32, stats->cellId, mBuf);
329
330    return;
331 }
332
333 static Void TSInfUtlUnpkUeInfo(Buffer *mBuf, TSInfL2UeStats *stats )
334 {
335    S32 i;
336    uint32_t k;
337
338
339    CMCHKUNPK(oduPackUInt32, &stats->rnti, mBuf);
340
341    for (k = L2_STATS_MAX_CELLS; k > 0; k--)
342    {
343       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlTxOccns, mBuf);
344       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlRetxOccns, mBuf);
345       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlPrbUsg, mBuf);
346       for (i=1; i>=0; i--)
347       {
348          CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlNackCnt[i], mBuf);
349       }
350       for (i=1; i>=0; i--)
351       {
352          CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlAckNackCnt[i], mBuf);
353       }
354       for (i=1; i>=0; i--)
355       {
356          CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlDtxCnt[i], mBuf);
357       }
358       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlSumCw0Cqi, mBuf);
359       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlNumCw0Cqi, mBuf);
360       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlSumCw1Cqi, mBuf);
361       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlNumCw1Cqi, mBuf);
362       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlSumCw0iTbs, mBuf);
363       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlNumCw0iTbs, mBuf);
364       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlSumCw1iTbs, mBuf);
365       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlNumCw1iTbs, mBuf);
366       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].cqiDropCnt, mBuf);
367       for (i=4; i>=0; i--)
368       {
369          CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlPdbLvl[i], mBuf);
370       }
371       for (i=3; i>=0; i--)
372       {
373          CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].riCnt[i], mBuf);
374       }
375       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlBo, mBuf);
376       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].dlTpt, mBuf);
377       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].ulTxOccns, mBuf);
378       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].ulRetxOccns, mBuf);
379       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].ulPrbUsg, mBuf);
380       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].ulAckNackCnt, mBuf);
381       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].ulNackCnt, mBuf);
382       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].ulDtxCnt, mBuf);
383       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].ulSumCqi, mBuf);
384       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].ulNumCqi, mBuf);
385       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].ulSumiTbs, mBuf);
386       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].ulNumiTbs, mBuf);
387       CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.sch[k-1].ulTpt, mBuf);
388    }
389
390    CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.pdcp.dlPdcpDropCnt, mBuf);
391    CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.pdcp.dlPdcpAckWaitDropCnt, mBuf);
392    CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.pdcp.dlFlowCtrlDropCnt, mBuf);
393
394    CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.rlc.ulReOdrTmrExpCnt, mBuf);
395    CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.rlc.dlMaxPktsInSduQ, mBuf);
396    CMCHKUNPK(oduPackUInt32, &stats->nonPersistent.rlc.dlMaxWindowSz, mBuf);
397
398    CMCHKUNPK(oduPackUInt32, &stats->persistent.activatedSCells, mBuf);
399    CMCHKUNPK(oduPackUInt32, &stats->persistent.numActivation, mBuf);
400    CMCHKUNPK(oduPackUInt32, &stats->persistent.numDeactivation, mBuf);
401
402    return;
403 }
404
405 static Void TSInfUtlUnpkCellInfo(Buffer *mBuf,TSInfL2CellStats *stats )
406 {
407    S32 i,j;
408
409
410       CMCHKUNPK(oduPackUInt32, &stats->cellId, mBuf);
411
412    CMCHKUNPK(oduPackUInt32, &stats->sch.msg4Fail, mBuf);
413    CMCHKUNPK(oduPackUInt32, &stats->sch.msg3Fail, mBuf);
414    CMCHKUNPK(oduPackUInt32, &stats->sch.dlSumCw0Cqi, mBuf);
415    CMCHKUNPK(oduPackUInt32, &stats->sch.dlNumCw0Cqi, mBuf);
416    CMCHKUNPK(oduPackUInt32, &stats->sch.dlSumCw1Cqi, mBuf);
417    CMCHKUNPK(oduPackUInt32, &stats->sch.dlNumCw1Cqi, mBuf);
418    CMCHKUNPK(oduPackUInt32, &stats->sch.dlSumCw0iTbs, mBuf);
419    CMCHKUNPK(oduPackUInt32, &stats->sch.dlNumCw0iTbs, mBuf);
420    CMCHKUNPK(oduPackUInt32, &stats->sch.dlSumCw1iTbs, mBuf);
421    CMCHKUNPK(oduPackUInt32, &stats->sch.dlNumCw1iTbs, mBuf);
422    for (i=0; i<4; i++)
423    {
424       CMCHKUNPK(oduPackUInt32, &stats->sch.riCnt[i], mBuf);
425    }
426    for (i=0; i<2; i++)
427    {
428       for (j=0; j<4; j++)
429       {
430          CMCHKUNPK(oduPackUInt32, &stats->sch.dlNack[i][j], mBuf);
431       }
432    }
433    for (i=0; i<2; i++)
434    {
435       for (j=0; j<4; j++)
436       {
437          CMCHKUNPK(oduPackUInt32, &stats->sch.dlAckNack[i][j], mBuf);
438       }
439    }
440    for (i=0; i<2; i++)
441    {
442       for (j=0; j<4; j++)
443       {
444          CMCHKUNPK(oduPackUInt32, &stats->sch.dlDtx[i][j], mBuf);
445       }
446    }
447    for (i=0; i<4; i++)
448    {
449       CMCHKUNPK(oduPackUInt32, &stats->sch.ulNack[i], mBuf);
450    }
451    for (i=0; i<4; i++)
452    {
453       CMCHKUNPK(oduPackUInt32, &stats->sch.ulAckNack[i], mBuf);
454    }
455    for (i=0; i<4; i++)
456    {
457       CMCHKUNPK(oduPackUInt32, &stats->sch.ulDtx[i], mBuf);
458    }
459    for (i=0; i<10; i++)
460    {
461       CMCHKUNPK(oduPackUInt32, &stats->sch.dlPrbUsage[i], mBuf);
462    }
463    for (i=0; i<10; i++)
464    {
465       CMCHKUNPK(oduPackUInt32, &stats->sch.ulPrbUsage[i], mBuf);
466    }
467    for (i=0; i<10; i++)
468    {
469       CMCHKUNPK(oduPackUInt32, &stats->sch.dlPdbRatio[i], mBuf);
470    }
471    CMCHKUNPK(oduPackUInt32, &stats->sch.avgTtiProcTime, mBuf);
472    CMCHKUNPK(oduPackUInt32, &stats->sch.cntTtiProcTime1000, mBuf);
473    CMCHKUNPK(oduPackUInt32, &stats->sch.cntTtiProcTime900, mBuf);
474    CMCHKUNPK(oduPackUInt32, &stats->sch.cntTtiProcTime800, mBuf);
475    CMCHKUNPK(oduPackUInt32, &stats->sch.cntTtiProcTime700, mBuf);
476    CMCHKUNPK(oduPackUInt32, &stats->sch.cntTtiProcTime600, mBuf);
477    CMCHKUNPK(oduPackUInt32, &stats->sch.cntTtiProcTime500, mBuf);
478 #ifdef RG_5GTF
479    CMCHKUNPK(oduPackUInt32, &stats->sch.dl5gtfUePick, mBuf);
480    CMCHKUNPK(oduPackUInt32, &stats->sch.dl5gtfRbAllocPass, mBuf);
481    CMCHKUNPK(oduPackUInt32, &stats->sch.dl5gtfRbAllocFail, mBuf);
482    CMCHKUNPK(oduPackUInt32, &stats->sch.dl5gtfFnlzPass, mBuf);
483    CMCHKUNPK(oduPackUInt32, &stats->sch.dl5gtfFnlzFail, mBuf);
484    CMCHKUNPK(oduPackUInt32, &stats->sch.dl5gtfBoUpd, mBuf);
485    CMCHKUNPK(oduPackUInt32, &stats->sch.dl5gtfPdcchSend, mBuf);
486    CMCHKUNPK(oduPackUInt32, &stats->sch.dl5gtfPdschCons, mBuf);
487
488    CMCHKUNPK(oduPackUInt32, &stats->sch.ul5gtfSrRecv, mBuf);
489    CMCHKUNPK(oduPackUInt32, &stats->sch.ul5gtfBsrRecv, mBuf);
490    CMCHKUNPK(oduPackUInt32, &stats->sch.ul5gtfUeSchPick, mBuf);
491    CMCHKUNPK(oduPackUInt32, &stats->sch.ul5gtfPdcchSchd, mBuf);
492    CMCHKUNPK(oduPackUInt32, &stats->sch.ul5gtfAllocAllocated, mBuf);
493    CMCHKUNPK(oduPackUInt32, &stats->sch.ul5gtfUeRbAllocDone, mBuf);
494    CMCHKUNPK(oduPackUInt32, &stats->sch.ul5gtfUeRmvFnlzZeroBo, mBuf);
495    CMCHKUNPK(oduPackUInt32, &stats->sch.ul5gtfUeFnlzReAdd, mBuf);
496    CMCHKUNPK(oduPackUInt32, &stats->sch.ul5gtfPdcchSend, mBuf);
497    CMCHKUNPK(oduPackUInt32, &stats->sch.ul5gtfRbAllocFail, mBuf);
498 #endif
499    CMCHKUNPK(oduPackUInt32, &stats->sch.ulSumCqi, mBuf);
500    CMCHKUNPK(oduPackUInt32, &stats->sch.ulNumCqi, mBuf);
501    CMCHKUNPK(oduPackUInt32, &stats->sch.ulSumiTbs, mBuf);
502    CMCHKUNPK(oduPackUInt32, &stats->sch.ulNumiTbs, mBuf);
503
504    CMCHKUNPK(oduPackUInt32, &stats->rlc.maxRlcSrbRetxFail, mBuf);
505    CMCHKUNPK(oduPackUInt32, &stats->rlc.maxRlcDrbRetxFail, mBuf);
506    CMCHKUNPK(oduPackUInt32, &stats->rlc.reOdrTmrExp, mBuf);
507
508    return;
509 }
510
511 Void TSInfPkSndL2UeStats(Pst  *pst,SuId suId,TSInfL2UeStats *stats)
512 {
513    Buffer *mBuf;
514
515
516    mBuf = TSInfUtlAllocMsg(pst);
517    TSInfUtlPackUeInfo(mBuf, stats);
518    SPkS16(suId, mBuf);
519    pst->event = (Event) EVTTENBL2UESTATS;
520    SPstTsk(pst, mBuf);
521    return;
522 }
523
524 Void TSInfUnpkL2UeStats(TSInfL2UeStatsInd func, Pst  *pst,Buffer *mBuf)
525 {
526    SuId              suId;
527    TSInfL2UeStats     stats; 
528
529    SUnpkS16(&suId, mBuf);
530    TSInfUtlUnpkUeInfo(mBuf, &stats);
531    SPutMsg(mBuf);
532    (*func)(pst, suId, &stats);
533    return;
534 }
535
536 Void TSInfPkSndL2CellStats(Pst *pst,SuId suId,TSInfL2CellStats   *stats )
537 {
538    Buffer *mBuf;
539
540    mBuf = TSInfUtlAllocMsg(pst);
541    TSInfUtlPackCellInfo(mBuf, stats);
542    SPkS16(suId, mBuf);
543    pst->event = (Event) EVTTENBL2CELLSTATS;
544    SPstTsk(pst, mBuf);
545    return;
546 }
547
548 Void TSInfUnpkL2CellStats(TSInfL2CellStatsInd func,Pst  *pst,Buffer *mBuf)
549 {
550    SuId                suId;
551    TSInfL2CellStats    stats; 
552
553
554    SUnpkS16(&suId, mBuf);
555    TSInfUtlUnpkCellInfo(mBuf, &stats);
556    SPutMsg(mBuf);
557    (*func)(pst, suId, &stats);
558    return;
559 }
560 #endif /* TENB_STATS */
561
562 /**********************************************************************
563          End of file
564  **********************************************************************/