[Epic-ID: ODUHIGH-461][Task-ID: ODUHIGH-468]Unused files and functions removed/disabled
[o-du/l2.git] / src / cm / lrg.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 \f
19
20 /************************************************************************
21  
22      Name:     LTE-MAC layer
23   
24      Type:     C source file
25   
26      Desc:     C source code for pack/unpack of LRG interface primitives. 
27   
28      File:     lrg.c 
29   
30 **********************************************************************/
31
32 /** @file lrg.c
33 @brief This file contains the packing/unpacking code for the LRG interface 
34        primitives.
35 */
36
37 /* header include files (.h) */
38 #include "common_def.h"
39 #include "lrg.h"           /* LRG Interface Defines */
40 /* header/extern include files (.x) */
41 #include "lrg.x"           /* LRG Interface includes */
42
43 #if (defined(LCLRG))
44
45 \f
46 /**
47 * @brief This API is used to send a 
48 Configuration Request from LM to MAC.
49 *
50 * @details
51 *
52 *     Function: cmPkLrgCfgReq
53 *
54 *  @param[in]   Pst *  pst
55 *  @param[in]   RgMngmt *  cfg
56 *  @return   S16
57 *      -# ROK
58 **/
59 S16 cmPkLrgCfgReq
60 (
61 Pst * pst,
62 RgMngmt * cfg
63 )
64 {
65    Buffer *mBuf = NULLP;
66
67    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
68 #if (ERRCLASS & ERRCLS_ADD_RES)
69       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
70          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
71          (ErrVal)ELRG001, (ErrVal)0, "Packing failed");
72 #endif
73       return RFAILED;
74    }
75    if (pst->selector == ODU_SELECTOR_LC) {
76       if (cmPkRgMngmt(pst, cfg, EVTLRGCFGREQ, mBuf) != ROK) {
77 #if (ERRCLASS & ERRCLS_ADD_RES)
78          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
79             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
80             (ErrVal)ELRG002, (ErrVal)0, "Packing failed");
81 #endif
82          SPutMsg(mBuf);
83          return RFAILED;
84       }
85    }
86    pst->event = (Event) EVTLRGCFGREQ;
87    return (SPstTsk(pst,mBuf));
88 }
89
90 \f
91 /**
92 * @brief This API is used to send a 
93 Configuration Request from LM to MAC.
94 *
95 * @details
96 *
97 *     Function: cmUnpkLrgCfgReq
98 *
99 *  @param[in]   Pst *  pst
100 *  @param[in]   RgMngmt *  cfg
101 *  @return   S16
102 *      -# ROK
103 **/
104 S16 cmUnpkLrgCfgReq
105 (
106 LrgCfgReq func,
107 Pst *pst,
108 Buffer *mBuf
109 )
110 {
111    /* lrg_c_001.main_2: Changed Pointer across Interface */
112    RgMngmt cfg;
113    
114    
115    if (cmUnpkRgMngmt(pst, &cfg, EVTLRGCFGREQ, mBuf) != ROK) {
116       SPutMsg(mBuf);
117 #if (ERRCLASS & ERRCLS_ADD_RES)
118       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
119             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
120             (ErrVal)ELRG003, (ErrVal)0, "Packing failed");
121 #endif
122       return RFAILED;
123    }
124    SPutMsg(mBuf);
125    return ((*func)(pst, &cfg));
126 }
127
128 \f
129 /**
130 * @brief This API is used to send a 
131 Configuration Request from LM to SCH.
132 *
133 * @details
134 *
135 *     Function: cmPkLrgSchCfgReq
136 *
137 *  @param[in]   Pst *  pst
138 *  @param[in]   RgMngmt *  cfg
139 *  @return   S16
140 *      -# ROK
141 **/
142 S16 cmPkLrgSchCfgReq
143 (
144 Pst * pst,
145 RgMngmt * cfg
146 )
147 {
148    Buffer *mBuf = NULLP;
149
150    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
151 #if (ERRCLASS & ERRCLS_ADD_RES)
152       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
153          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
154          (ErrVal)ELRG004, (ErrVal)0, "Packing failed");
155 #endif
156       return RFAILED;
157    }
158    if (pst->selector == ODU_SELECTOR_LC) {
159       if (cmPkRgMngmt(pst, cfg, EVTMACSCHGENCFGREQ, mBuf) != ROK) {
160 #if (ERRCLASS & ERRCLS_ADD_RES)
161          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
162             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
163             (ErrVal)ELRG005, (ErrVal)0, "Packing failed");
164 #endif
165          SPutMsg(mBuf);
166          return RFAILED;
167       }
168    }
169    
170    return (SPstTsk(pst,mBuf));
171 }
172
173 \f
174 /**
175 * @brief This API is used to send a 
176 Configuration Request from LM to SCH.
177 *
178 * @details
179 *
180 *     Function: cmUnpkLrgSchCfgReq
181 *
182 *  @param[in]   Pst *  pst
183 *  @param[in]   RgMngmt *  cfg
184 *  @return   S16
185 *      -# ROK
186 **/
187 S16 cmUnpkLrgSchCfgReq
188 (
189 LrgSchCfgReq func,
190 Pst *pst,
191 Buffer *mBuf
192 )
193 {
194    /* lrg_c_001.main_2: Changed Pointer across Interface */
195    RgMngmt cfg;
196    
197
198    if (cmUnpkRgMngmt(pst, &cfg, EVTMACSCHGENCFGREQ, mBuf) != ROK) {
199       SPutMsg(mBuf);
200 #if (ERRCLASS & ERRCLS_ADD_RES)
201       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
202             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
203             (ErrVal)ELRG006, (ErrVal)0, "Packing failed");
204 #endif
205       return RFAILED;
206    }
207    SPutMsg(mBuf);
208    return ((*func)(pst, &cfg));
209 }
210
211 \f
212 /**
213 * @brief This API is used to send a 
214 Configuration Confirm from MAC to LM.
215 *
216 * @details
217 *
218 *     Function: cmPkLrgCfgCfm
219 *
220 *  @param[in]   Pst *  pst
221 *  @param[in]   RgMngmt *  cfm
222 *  @return   S16
223 *      -# ROK
224 **/
225 uint8_t cmPkLrgCfgCfm
226 (
227 Pst * pst,
228 RgMngmt * cfm
229 )
230 {
231    Buffer *mBuf = NULLP;
232
233    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
234 #if (ERRCLASS & ERRCLS_ADD_RES)
235       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
236          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
237          (ErrVal)ELRG007, (ErrVal)0, "Packing failed");
238 #endif
239       return RFAILED;
240    }
241    if (pst->selector == ODU_SELECTOR_LC) {
242       if (cmPkRgMngmt(pst, cfm, EVTLRGCFGCFM, mBuf) != ROK) {
243 #if (ERRCLASS & ERRCLS_ADD_RES)
244          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
245             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
246             (ErrVal)ELRG008, (ErrVal)0, "Packing failed");
247 #endif
248          SPutMsg(mBuf);
249          return RFAILED;
250       }
251    }
252    
253    pst->event = (Event) EVTLRGCFGCFM;
254    return (SPstTsk(pst,mBuf));
255 }
256
257 \f
258 /**
259 * @brief This API is used to send a 
260 Configuration Confirm from MAC to LM.
261 *
262 * @details
263 *
264 *     Function: cmUnpkLrgCfgCfm
265 *
266 *  @param[in]   Pst *  pst
267 *  @param[in]   RgMngmt *  cfm
268 *  @return   S16
269 *      -# ROK
270 **/
271 S16 cmUnpkLrgCfgCfm
272 (
273 LrgCfgCfm func,
274 Pst *pst,
275 Buffer *mBuf
276 )
277 {
278    RgMngmt cfm;
279    
280
281    if (cmUnpkRgMngmt(pst, &cfm, EVTLRGCFGCFM, mBuf) != ROK) {
282       SPutMsg(mBuf);
283 #if (ERRCLASS & ERRCLS_ADD_RES)
284       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
285             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
286             (ErrVal)ELRG009, (ErrVal)0, "Packing failed");
287 #endif
288       return RFAILED;
289    }
290    SPutMsg(mBuf);
291    return ((*func)(pst, &cfm));
292 }
293
294 \f
295 /**
296 * @brief This API is used to send a 
297 Configuration Confirm from SCH to LM.
298 *
299 * @details
300 *
301 *     Function: cmPkLrgSchCfgCfm
302 *
303 *  @param[in]   Pst *  pst
304 *  @param[in]   RgMngmt *  cfg
305 *  @return   S16
306 *      -# ROK
307 **/
308 uint8_t cmPkLrgSchCfgCfm
309 (
310 Pst * pst,
311 RgMngmt * cfg
312 )
313 {
314    Buffer *mBuf = NULLP;
315
316    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
317 #if (ERRCLASS & ERRCLS_ADD_RES)
318       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
319          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
320          (ErrVal)ELRG010, (ErrVal)0, "Packing failed");
321 #endif
322       return RFAILED;
323    }
324    if (pst->selector == ODU_SELECTOR_LC) {
325       if (cmPkRgMngmt(pst, cfg, EVTMACSCHGENCFGCFM, mBuf) != ROK) {
326 #if (ERRCLASS & ERRCLS_ADD_RES)
327          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
328             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
329             (ErrVal)ELRG011, (ErrVal)0, "Packing failed");
330 #endif
331          SPutMsg(mBuf);
332          return RFAILED;
333       }
334    }
335    
336    pst->event = (Event) EVTMACSCHGENCFGCFM;
337    return (SPstTsk(pst,mBuf));
338 }
339
340 \f
341 /**
342 * @brief This API is used to send a 
343 Configuration Confirm from SCH to LM.
344 *
345 * @details
346 *
347 *     Function: cmUnpkLrgSchCfgCfm
348 *
349 *  @param[in]   Pst *  pst
350 *  @param[in]   RgMngmt *  cfg
351 *  @return   S16
352 *      -# ROK
353 **/
354 S16 cmUnpkLrgSchCfgCfm
355 (
356 LrgSchCfgCfm func,
357 Pst *pst,
358 Buffer *mBuf
359 )
360 {
361    RgMngmt cfg;
362    
363    if (cmUnpkRgMngmt(pst, &cfg, EVTMACSCHGENCFGCFM, mBuf) != ROK) {
364       SPutMsg(mBuf);
365 #if (ERRCLASS & ERRCLS_ADD_RES)
366       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
367             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
368             (ErrVal)ELRG012, (ErrVal)0, "Packing failed");
369 #endif
370       return RFAILED;
371    }
372    SPutMsg(mBuf);
373    return ((*func)(pst, &cfg));
374 }
375
376 \f
377 /**
378 * @brief This API is used to send a 
379 Statistics Request from LM to MAC.
380 *
381 * @details
382 *
383 *     Function: cmPkLrgStsReq
384 *
385 *  @param[in]   Pst *  pst
386 *  @param[in]   RgMngmt *  sts
387 *  @return   S16
388 *      -# ROK
389 **/
390 S16 cmPkLrgStsReq
391 (
392 Pst * pst,
393 RgMngmt * sts
394 )
395 {
396    Buffer *mBuf = NULLP;
397
398    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
399 #if (ERRCLASS & ERRCLS_ADD_RES)
400       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
401          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
402          (ErrVal)ELRG013, (ErrVal)0, "Packing failed");
403 #endif
404       return RFAILED;
405    }
406    if (pst->selector == ODU_SELECTOR_LC) {
407       if (cmPkRgMngmt(pst, sts, EVTLRGSTSREQ, mBuf) != ROK) {
408 #if (ERRCLASS & ERRCLS_ADD_RES)
409          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
410             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
411             (ErrVal)ELRG014, (ErrVal)0, "Packing failed");
412 #endif
413          SPutMsg(mBuf);
414          return RFAILED;
415       }
416    }
417    
418    pst->event = (Event) EVTLRGSTSREQ;
419    return (SPstTsk(pst,mBuf));
420 }
421
422 \f
423 /**
424 * @brief This API is used to send a 
425 Statistics Request from LM to MAC.
426 *
427 * @details
428 *
429 *     Function: cmUnpkLrgStsReq
430 *
431 *  @param[in]   Pst *  pst
432 *  @param[in]   RgMngmt *  sts
433 *  @return   S16
434 *      -# ROK
435 **/
436 S16 cmUnpkLrgStsReq
437 (
438 LrgStsReq func,
439 Pst *pst,
440 Buffer *mBuf
441 )
442 {
443    RgMngmt sts;
444    
445
446    if (cmUnpkRgMngmt(pst, &sts, EVTLRGSTSREQ, mBuf) != ROK) {
447       SPutMsg(mBuf);
448 #if (ERRCLASS & ERRCLS_ADD_RES)
449       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
450             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
451             (ErrVal)ELRG015, (ErrVal)0, "Packing failed");
452 #endif
453       return RFAILED;
454    }
455    SPutMsg(mBuf);
456    return ((*func)(pst, &sts));
457 }
458
459 \f
460 /**
461 * @brief This API is used to send a 
462 Statistics Confirm from MAC to LM.
463 *
464 * @details
465 *
466 *     Function: cmPkLrgStsCfm
467 *
468 *  @param[in]   Pst *  pst
469 *  @param[in]   RgMngmt *  cfm
470 *  @return   S16
471 *      -# ROK
472 **/
473 S16 cmPkLrgStsCfm
474 (
475 Pst * pst,
476 RgMngmt * cfm
477 )
478 {
479    Buffer *mBuf = NULLP;
480
481    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
482 #if (ERRCLASS & ERRCLS_ADD_RES)
483       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
484          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
485          (ErrVal)ELRG016, (ErrVal)0, "Packing failed");
486 #endif
487       return RFAILED;
488    }
489    if (pst->selector == ODU_SELECTOR_LC) {
490       if (cmPkRgMngmt(pst, cfm, EVTLRGSTSCFM, mBuf) != ROK) {
491 #if (ERRCLASS & ERRCLS_ADD_RES)
492          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
493             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
494             (ErrVal)ELRG017, (ErrVal)0, "Packing failed");
495 #endif
496          SPutMsg(mBuf);
497          return RFAILED;
498       }
499    }
500    
501    pst->event = (Event) EVTLRGSTSCFM;
502    return (SPstTsk(pst,mBuf));
503 }
504
505 \f
506 /**
507  * * @brief This API is used to send a 
508  * Statistics Confirm from MAC to LM.
509  * *
510  * * @details
511  * *
512  * *     Function: cmUnpkLrgStsCfm
513  * *
514  * *  @param[in]   Pst *  pst
515  * *  @param[in]   RgMngmt *  cfm
516  * *  @return   S16
517  * *      -# ROK
518  * **/
519 S16 cmUnpkLrgStsCfm
520 (
521 LrgStsCfm func,
522 Pst *pst,
523 Buffer *mBuf
524 )
525 {
526    RgMngmt cfm;
527
528
529    if (cmUnpkRgMngmt(pst, &cfm, EVTLRGSTSCFM, mBuf) != ROK) {
530       SPutMsg(mBuf);
531 #if (ERRCLASS & ERRCLS_ADD_RES)
532       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
533             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
534             (ErrVal)ELRG018, (ErrVal)0, "Packing failed");
535 #endif
536       return RFAILED;
537    }
538    SPutMsg(mBuf);
539    return ((*func)(pst, &cfm));
540 }
541
542 \f
543 /**
544 * @brief This API is used to send a 
545 Status Indication from MAC to LM.
546 *
547 * @details
548 *
549 *     Function: cmPkLrgStaInd
550 *
551 *  @param[in]   Pst *  pst
552 *  @param[in]   RgMngmt *  usta
553 *  @return   S16
554 *      -# ROK
555 **/
556 S16 cmPkLrgStaInd
557 (
558 Pst * pst,
559 RgMngmt * usta
560 )
561 {
562    Buffer *mBuf = NULLP;
563
564    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
565 #if (ERRCLASS & ERRCLS_ADD_RES)
566       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
567          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
568          (ErrVal)ELRG025, (ErrVal)0, "Packing failed");
569 #endif
570       return RFAILED;
571    }
572    if (pst->selector == ODU_SELECTOR_LC) {
573       if (cmPkRgMngmt(pst, usta, EVTLRGUSTAIND, mBuf) != ROK) {
574 #if (ERRCLASS & ERRCLS_ADD_RES)
575          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
576             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
577             (ErrVal)ELRG026, (ErrVal)0, "Packing failed");
578 #endif
579          SPutMsg(mBuf);
580          return RFAILED;
581       }
582    }
583    
584    pst->event = (Event) EVTLRGUSTAIND;
585    return (SPstTsk(pst,mBuf));
586 }
587
588 \f
589 /**
590 * @brief This API is used to send a 
591 Status Indication from MAC to LM.
592 *
593 * @details
594 *
595 *     Function: cmUnpkLrgStaInd
596 *
597 *  @param[in]   Pst *  pst
598 *  @param[in]   RgMngmt *  usta
599 *  @return   S16
600 *      -# ROK
601 **/
602 S16 cmUnpkLrgStaInd
603 (
604 LrgStaInd func,
605 Pst *pst,
606 Buffer *mBuf
607 )
608 {
609    RgMngmt usta;
610    
611
612    if (cmUnpkRgMngmt(pst, &usta, EVTLRGUSTAIND, mBuf) != ROK) {
613       SPutMsg(mBuf);
614 #if (ERRCLASS & ERRCLS_ADD_RES)
615       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
616             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
617             (ErrVal)ELRG027, (ErrVal)0, "Packing failed");
618 #endif
619       return RFAILED;
620    }
621    SPutMsg(mBuf);
622    return ((*func)(pst, &usta));
623 }
624
625 \f
626 /**
627 * @brief This API is used to send a 
628 Status Indication from SCH to LM.
629 *
630 * @details
631 *
632 *     Function: cmPkLrgSchStaInd
633 *
634 *  @param[in]   Pst *  pst
635 *  @param[in]   RgMngmt *  sta
636 *  @return   S16
637 *      -# ROK
638 **/
639 S16 cmPkLrgSchStaInd
640 (
641 Pst * pst,
642 RgMngmt * sta
643 )
644 {
645    Buffer *mBuf = NULLP;
646
647    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
648 #if (ERRCLASS & ERRCLS_ADD_RES)
649       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
650          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
651          (ErrVal)ELRG028, (ErrVal)0, "Packing failed");
652 #endif
653       return RFAILED;
654    }
655    if (pst->selector == ODU_SELECTOR_LC) {
656       if (cmPkRgMngmt(pst, sta, EVTLRGSCHSTAIND, mBuf) != ROK) {
657 #if (ERRCLASS & ERRCLS_ADD_RES)
658          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
659             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
660             (ErrVal)ELRG029, (ErrVal)0, "Packing failed");
661 #endif
662          SPutMsg(mBuf);
663          return RFAILED;
664       }
665    }
666    
667    pst->event = (Event) EVTLRGSCHSTAIND;
668    return (SPstTsk(pst,mBuf));
669 }
670
671 \f
672 /**
673 * @brief This API is used to send a 
674 Status Indication from SCH to LM.
675 *
676 * @details
677 *
678 *     Function: cmUnpkLrgSchStaInd
679 *
680 *  @param[in]   Pst *  pst
681 *  @param[in]   RgMngmt *  sta
682 *  @return   S16
683 *      -# ROK
684 **/
685 S16 cmUnpkLrgSchStaInd
686 (
687 LrgSchStaInd func,
688 Pst *pst,
689 Buffer *mBuf
690 )
691 {
692    RgMngmt sta;
693    
694
695    if (cmUnpkRgMngmt(pst, &sta, EVTLRGSCHSTAIND, mBuf) != ROK) {
696       SPutMsg(mBuf);
697 #if (ERRCLASS & ERRCLS_ADD_RES)
698       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
699             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
700             (ErrVal)ELRG030, (ErrVal)0, "Packing failed");
701 #endif
702       return RFAILED;
703    }
704    SPutMsg(mBuf);
705    return ((*func)(pst, &sta));
706 }
707
708 \f
709 /***********************************************************
710 *
711 *     Func : cmPkRgGenCfg
712 *
713 *
714 *     Desc :   This structure holds configuration parameters for MAC General Configuration.
715 *
716 *
717 *     Ret  : S16
718 *
719 *     Notes:
720 *
721 *     File  : 
722 *
723 **********************************************************/
724 S16 cmPkRgGenCfg
725 (
726 RgGenCfg *param,
727 Buffer *mBuf
728 )
729 {
730
731
732 #ifdef LTE_ADV
733    CMCHKPK(oduUnpackUInt8, param->isSCellActDeactAlgoEnable, mBuf);
734    CMCHKPK(oduUnpackUInt8, param->forceCntrlSrbBoOnPCel, mBuf);
735 #endif
736    CMCHKPK(oduUnpackUInt8, param->startCellId, mBuf);
737    CMCHKPK(oduUnpackUInt8, param->numRguSaps, mBuf);
738    CMCHKPK(oduUnpackUInt8, param->tmrRes, mBuf);
739    CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
740    CMCHKPK(cmPkPst, &param->lmPst, mBuf);
741    return ROK;
742 }
743
744
745 \f
746 /***********************************************************
747 *
748 *     Func : cmUnpkRgGenCfg
749 *
750 *
751 *     Desc :   This structure holds configuration parameters for MAC General Configuration.
752 *
753 *
754 *     Ret  : S16
755 *
756 *     Notes:
757 *
758 *     File  : 
759 *
760 **********************************************************/
761 S16 cmUnpkRgGenCfg
762 (
763 RgGenCfg *param,
764 Buffer *mBuf
765 )
766 {
767
768
769    CMCHKUNPK(cmUnpkPst, &param->lmPst, mBuf);
770    CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
771    CMCHKUNPK(oduPackUInt8, &param->tmrRes, mBuf);
772    CMCHKUNPK(oduPackUInt8, &param->numRguSaps, mBuf);
773    CMCHKUNPK(oduPackUInt8, &param->startCellId, mBuf);
774 #ifdef LTE_ADV
775    CMCHKUNPK(oduPackUInt8, &param->forceCntrlSrbBoOnPCel, mBuf);
776    CMCHKUNPK(oduPackUInt8, &param->isSCellActDeactAlgoEnable, mBuf);
777 #endif
778    return ROK;
779 }
780
781
782 \f
783 /***********************************************************
784 *
785 *     Func : cmPkRgUpSapCfg
786 *
787 *
788 *     Desc :   This structure holds configuration parameters for MAC Upper SAP Configuration.
789 *
790 *
791 *     Ret  : S16
792 *
793 *     Notes:
794 *
795 *     File  : 
796 *
797 **********************************************************/
798 S16 cmPkRgUpSapCfg
799 (
800 RgUpSapCfg *param,
801 Buffer *mBuf
802 )
803 {
804
805
806    CMCHKPK(SPkS16, param->suId, mBuf);
807    CMCHKPK(SPkS16, param->spId, mBuf);
808    CMCHKPK(oduUnpackUInt8, param->route, mBuf);
809    CMCHKPK(oduUnpackUInt8, param->inst, mBuf);
810    CMCHKPK(oduUnpackUInt8, param->ent, mBuf);
811    CMCHKPK(oduUnpackUInt16, param->procId, mBuf);
812    CMCHKPK(oduUnpackUInt8, param->prior, mBuf);
813    CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
814    CMCHKPK(oduUnpackUInt8, param->selector, mBuf);
815    return ROK;
816 }
817
818
819 \f
820 /***********************************************************
821 *
822 *     Func : cmUnpkRgUpSapCfg
823 *
824 *
825 *     Desc :   This structure holds configuration parameters for MAC Upper SAP Configuration.
826 *
827 *
828 *     Ret  : S16
829 *
830 *     Notes:
831 *
832 *     File  : 
833 *
834 **********************************************************/
835 S16 cmUnpkRgUpSapCfg
836 (
837 RgUpSapCfg *param,
838 Buffer *mBuf
839 )
840 {
841
842
843    CMCHKUNPK(oduPackUInt8, &param->selector, mBuf);
844    CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
845    CMCHKUNPK(oduPackUInt8, &param->prior, mBuf);
846    CMCHKUNPK(oduPackUInt16, &param->procId, mBuf);
847    CMCHKUNPK(oduPackUInt8, &param->ent, mBuf);
848    CMCHKUNPK(oduPackUInt8, &param->inst, mBuf);
849    CMCHKUNPK(oduPackUInt8, &param->route, mBuf);
850    CMCHKUNPK(SUnpkS16, &param->spId, mBuf);
851    CMCHKUNPK(SUnpkS16, &param->suId, mBuf);
852    return ROK;
853 }
854
855
856 \f
857 /***********************************************************
858 *
859 *     Func : cmPkRgLowSapCfg
860 *
861 *
862 *     Desc :   This structure holds configuration parameters for MAC Lower SAP Configuration.
863 *
864 *
865 *     Ret  : S16
866 *
867 *     Notes:
868 *
869 *     File  : 
870 *
871 **********************************************************/
872 S16 cmPkRgLowSapCfg
873 (
874 RgLowSapCfg *param,
875 Buffer *mBuf
876 )
877 {
878
879
880    CMCHKPK(cmPkTmrCfg, &param->bndTmr, mBuf);
881    CMCHKPK(SPkS16, param->suId, mBuf);
882    CMCHKPK(SPkS16, param->spId, mBuf);
883    CMCHKPK(oduUnpackUInt8, param->route, mBuf);
884    CMCHKPK(oduUnpackUInt8, param->inst, mBuf);
885    CMCHKPK(oduUnpackUInt8, param->ent, mBuf);
886    CMCHKPK(oduUnpackUInt16, param->procId, mBuf);
887    CMCHKPK(oduUnpackUInt8, param->prior, mBuf);
888    CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
889    CMCHKPK(oduUnpackUInt8, param->selector, mBuf);
890    return ROK;
891 }
892
893
894 \f
895 /***********************************************************
896 *
897 *     Func : cmUnpkRgLowSapCfg
898 *
899 *
900 *     Desc :   This structure holds configuration parameters for MAC Lower SAP Configuration.
901 *
902 *
903 *     Ret  : S16
904 *
905 *     Notes:
906 *
907 *     File  : 
908 *
909 **********************************************************/
910 S16 cmUnpkRgLowSapCfg
911 (
912 RgLowSapCfg *param,
913 Buffer *mBuf
914 )
915 {
916
917
918    CMCHKUNPK(oduPackUInt8, &param->selector, mBuf);
919    CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
920    CMCHKUNPK(oduPackUInt8, &param->prior, mBuf);
921    CMCHKUNPK(oduPackUInt16, &param->procId, mBuf);
922    CMCHKUNPK(oduPackUInt8, &param->ent, mBuf);
923    CMCHKUNPK(oduPackUInt8, &param->inst, mBuf);
924    CMCHKUNPK(oduPackUInt8, &param->route, mBuf);
925    CMCHKUNPK(SUnpkS16, &param->spId, mBuf);
926    CMCHKUNPK(SUnpkS16, &param->suId, mBuf);
927    CMCHKUNPK(cmUnpkTmrCfg, &param->bndTmr, mBuf);
928    return ROK;
929 }
930
931 #ifdef MAC_SCH_STATS
932
933 \f
934 /***********************************************************
935 *
936 *     Func : cmPkRgAckNack
937 *
938 *
939 *     Desc :   Ack and Nack statistics
940 *
941 *
942 *     Ret  : S16
943 *
944 *     Notes:
945 *
946 *     File  : 
947 *
948 **********************************************************/
949 S16 cmPkRgAckNack
950 (
951 RgAckNack *param,
952 Buffer *mBuf
953 )
954 {
955
956
957    CMCHKPK(oduUnpackUInt16, param->numOfAcks, mBuf);
958    CMCHKPK(oduUnpackUInt16, param->numOfNacks, mBuf);
959    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
960
961    return ROK;
962 } /* cmPkRgAckNack */
963
964 \f
965 /***********************************************************
966 *
967 *     Func : cmPkRgSchNackAckStats
968 *
969 *
970 *     Desc :   
971 *
972 *
973 *     Ret  : S16
974 *
975 *     Notes:
976 *
977 *     File  : 
978 *
979 **********************************************************/
980 S16 cmPkRgSchNackAckStats
981 (
982 RgSchNackAckStats *param,
983 Buffer *mBuf
984 )
985 {
986
987    S32 i;
988
989    for (i=14; i >= 0; i--) {
990       CMCHKPK(cmPkRgAckNack, &param->ulCqiStat[i], mBuf);
991    }
992
993    for (i=14; i >= 0; i--) {
994       CMCHKPK(cmPkRgAckNack, &param->dlCqiStat[i], mBuf);
995    }
996
997    return ROK;
998 }
999
1000 \f
1001 /***********************************************************
1002 *
1003 *     Func : cmPkRgHqNumRetx
1004 *
1005 *
1006 *     Desc :   Harq Retransmission statistics
1007 *
1008 *
1009 *     Ret  : S16
1010 *
1011 *     Notes:
1012 *
1013 *     File  : 
1014 *
1015 **********************************************************/
1016 S16 cmPkRgHqNumRetx
1017 (
1018 RgSchHqNumRetx *param,
1019 Buffer *mBuf
1020 )
1021 {
1022
1023    CMCHKPK(oduUnpackUInt32, param->totalTx, mBuf);
1024    CMCHKPK(oduUnpackUInt16, param->numOfHQ_4, mBuf);
1025    CMCHKPK(oduUnpackUInt16, param->numOfHQ_3, mBuf);
1026    CMCHKPK(oduUnpackUInt16, param->numOfHQ_2, mBuf);
1027    CMCHKPK(oduUnpackUInt16, param->numOfHQ_1, mBuf);
1028    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
1029
1030    return ROK;
1031 } /* cmPkRgHqNumRetx */
1032
1033 \f
1034 /***********************************************************
1035 *
1036 *     Func : cmPkRgSchHqRetxStats
1037 *
1038 *
1039 *     Desc :   
1040 *
1041 *
1042 *     Ret  : S16
1043 *
1044 *     Notes:
1045 *
1046 *     File  : 
1047 *
1048 **********************************************************/
1049 S16 cmPkRgSchHqRetxStats
1050 (
1051 RgSchHqRetxStats *param,
1052 Buffer *mBuf
1053 )
1054 {
1055
1056    S32 i;
1057
1058    for (i=14; i >= 0; i--) {
1059       CMCHKPK(cmPkRgHqNumRetx, &param->ulCqiStat[i], mBuf);
1060    }
1061
1062    for (i=14; i >= 0; i--) {
1063       CMCHKPK(cmPkRgHqNumRetx, &param->dlCqiStat[i], mBuf);
1064    }
1065
1066    return ROK;
1067 } /* cmPkRgSchHqRetxStats */
1068
1069 /* unpcaking functions */
1070 \f
1071 /***********************************************************
1072 *
1073 *     Func : cmUnpkRgAckNack
1074 *
1075 *
1076 *     Desc :   Ack and Nack statistics
1077 *
1078 *
1079 *     Ret  : S16
1080 *
1081 *     Notes:
1082 *
1083 *     File  : 
1084 *
1085 **********************************************************/
1086 S16 cmUnpkRgAckNack
1087 (
1088 RgAckNack *param,
1089 Buffer *mBuf
1090 )
1091 {
1092
1093
1094    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
1095    CMCHKUNPK(oduPackUInt16, &param->numOfNacks, mBuf);
1096    CMCHKUNPK(oduPackUInt16, &param->numOfAcks, mBuf);
1097
1098    return ROK;
1099 } /* cmUnkRgAckNack */
1100
1101 \f
1102 /***********************************************************
1103 *
1104 *     Func : cmUnpkRgSchNackAckStats
1105 *
1106 *
1107 *     Desc :   
1108 *
1109 *
1110 *     Ret  : S16
1111 *
1112 *     Notes:
1113 *
1114 *     File  : 
1115 *
1116 **********************************************************/
1117 S16 cmUnpkRgSchNackAckStats
1118 (
1119 RgSchNackAckStats *param,
1120 Buffer *mBuf
1121 )
1122 {
1123    S32 i;
1124
1125    for (i=0; i <= 14; i++) {
1126       CMCHKUNPK(cmUnpkRgAckNack, &param->dlCqiStat[i], mBuf);
1127    }
1128
1129    for (i=0; i <= 14; i++) {
1130       CMCHKUNPK(cmUnpkRgAckNack, &param->ulCqiStat[i], mBuf);
1131    }
1132
1133    return ROK;
1134 } /* cmUnpkRgSchNackAckStats */
1135
1136 \f
1137 /***********************************************************
1138 *
1139 *     Func : cmUnpkRgHqNumRetx
1140 *
1141 *
1142 *     Desc :   Harq Retransmission statistics
1143 *
1144 *
1145 *     Ret  : S16
1146 *
1147 *     Notes:
1148 *
1149 *     File  : 
1150 *
1151 **********************************************************/
1152 S16 cmUnpkRgHqNumRetx
1153 (
1154 RgSchHqNumRetx *param,
1155 Buffer *mBuf
1156 )
1157 {
1158
1159    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
1160    CMCHKUNPK(oduPackUInt16, &param->numOfHQ_1, mBuf);
1161    CMCHKUNPK(oduPackUInt16, &param->numOfHQ_2, mBuf);
1162    CMCHKUNPK(oduPackUInt16, &param->numOfHQ_3, mBuf);
1163    CMCHKUNPK(oduPackUInt16, &param->numOfHQ_4, mBuf);
1164    CMCHKUNPK(oduPackUInt32, &param->totalTx, mBuf);
1165
1166    return ROK;
1167 } /* cmUnpkRgHqNumRetx */
1168
1169 \f
1170 /***********************************************************
1171 *
1172 *     Func : cmUnpkRgSchHqRetxStats
1173 *
1174 *
1175 *     Desc :   
1176 *
1177 *
1178 *     Ret  : S16
1179 *
1180 *     Notes:
1181 *
1182 *     File  : 
1183 *
1184 **********************************************************/
1185 S16 cmUnpkRgSchHqRetxStats
1186 (
1187 RgSchHqRetxStats *param,
1188 Buffer *mBuf
1189 )
1190 {
1191    S32 i;
1192
1193    for (i=0; i <= 14; i++) {
1194       CMCHKUNPK(cmUnpkRgHqNumRetx, &param->dlCqiStat[i], mBuf);
1195    }
1196
1197    for (i=0; i <= 14; i++) {
1198       CMCHKUNPK(cmUnpkRgHqNumRetx, &param->ulCqiStat[i], mBuf);
1199    }
1200
1201    return ROK;
1202 } /* cmUnpkRgSchHqRetxStats */
1203
1204 #endif /* MAC_SCH_STATS */
1205
1206 \f
1207 /***********************************************************
1208 *
1209 *     Func : cmPkRgGenSts
1210 *
1211 *
1212 *     Desc :   This structure holds General Statistical information of MAC.
1213 *
1214 *
1215 *     Ret  : S16
1216 *
1217 *     Notes:
1218 *
1219 *     File  : 
1220 *
1221 **********************************************************/
1222 S16 cmPkRgGenSts
1223 (
1224 RgGenSts *param,
1225 Buffer *mBuf
1226 )
1227 {
1228
1229 #ifdef MAC_SCH_STATS
1230    CMCHKPK(cmPkRgSchHqRetxStats, &param->hqRetxStats, mBuf);
1231    CMCHKPK(cmPkRgSchNackAckStats, &param->nackAckStats, mBuf);
1232 #endif /* MAC_SCH_STATS */
1233    CMCHKPK(oduUnpackUInt16, param->numCellCfg, mBuf);
1234    CMCHKPK(oduUnpackUInt32, param->numUeCfg, mBuf);
1235    CMCHKPK(oduUnpackUInt32, param->numHarqFail, mBuf);
1236    return ROK;
1237 }
1238
1239
1240 \f
1241 /***********************************************************
1242 *
1243 *     Func : cmUnpkRgGenSts
1244 *
1245 *
1246 *     Desc :   This structure holds General Statistical information of MAC.
1247 *
1248 *
1249 *     Ret  : S16
1250 *
1251 *     Notes:
1252 *
1253 *     File  : 
1254 *
1255 **********************************************************/
1256 S16 cmUnpkRgGenSts
1257 (
1258 RgGenSts *param,
1259 Buffer *mBuf
1260 )
1261 {
1262
1263    CMCHKUNPK(oduPackUInt32, &param->numHarqFail, mBuf);
1264    CMCHKUNPK(oduPackUInt32, &param->numUeCfg, mBuf);
1265    CMCHKUNPK(oduPackUInt16, &param->numCellCfg, mBuf);
1266 #ifdef MAC_SCH_STATS
1267    CMCHKUNPK(cmUnpkRgSchNackAckStats, &param->nackAckStats, mBuf);
1268    CMCHKUNPK(cmUnpkRgSchHqRetxStats, &param->hqRetxStats, mBuf);
1269 #endif /* MAC_SCH_STATS */
1270    return ROK;
1271 }
1272
1273
1274 \f
1275 /***********************************************************
1276 *
1277 *     Func : cmPkRgSapSts
1278 *
1279 *
1280 *     Desc :   This structure holds Statistical information of a SAP in MAC.
1281 *
1282 *
1283 *     Ret  : S16
1284 *
1285 *     Notes:
1286 *
1287 *     File  : 
1288 *
1289 **********************************************************/
1290 S16 cmPkRgSapSts
1291 (
1292 RgSapSts *param,
1293 Buffer *mBuf
1294 )
1295 {
1296
1297    CMCHKPK(oduUnpackUInt32, param->numPduDrop, mBuf);
1298    CMCHKPK(oduUnpackUInt32, param->numPduTxmit, mBuf);
1299    CMCHKPK(oduUnpackUInt32, param->numPduRcvd, mBuf);
1300    return ROK;
1301 }
1302
1303
1304 \f
1305 /***********************************************************
1306 *
1307 *     Func : cmUnpkRgSapSts
1308 *
1309 *
1310 *     Desc :   This structure holds Statistical information of a SAP in MAC.
1311 *
1312 *
1313 *     Ret  : S16
1314 *
1315 *     Notes:
1316 *
1317 *     File  : 
1318 *
1319 **********************************************************/
1320 S16 cmUnpkRgSapSts
1321 (
1322 RgSapSts *param,
1323 Buffer *mBuf
1324 )
1325 {
1326
1327    CMCHKUNPK(oduPackUInt32, &param->numPduRcvd, mBuf);
1328    CMCHKUNPK(oduPackUInt32, &param->numPduTxmit, mBuf);
1329    CMCHKUNPK(oduPackUInt32, &param->numPduDrop, mBuf);
1330    return ROK;
1331 }
1332
1333
1334 \f
1335 /***********************************************************
1336 *
1337 *     Func : cmPkRgSchInstCfg
1338 *
1339 *
1340 *     Desc : Scheduler Configuration
1341 *
1342 *
1343 *     Ret  : S16
1344 *
1345 *     Notes:
1346 *
1347 *     File  : 
1348 *
1349 **********************************************************/
1350 S16 cmPkRgSchInstCfg
1351 (
1352 RgSchInstCfg *param,
1353 Buffer *mBuf
1354 )
1355 {
1356
1357    S32 i;
1358
1359    for (i=param->numSaps-1; i >= 0; i--) {
1360       CMCHKPK(cmPkRgLowSapCfg, &param->tfuSap[i], mBuf);
1361    }
1362    for (i=param->numSaps-1; i >= 0; i--) {
1363       CMCHKPK(cmPkRgUpSapCfg, &param->rgrSap[i], mBuf);
1364    }
1365    for (i=param->numSaps-1; i >= 0; i--) {
1366       CMCHKPK(cmPkRgUpSapCfg, &param->rgmSap[i], mBuf);
1367    }
1368    CMCHKPK(oduUnpackUInt8, param->numSaps, mBuf);
1369    CMCHKPK(cmPkRgGenCfg, &param->genCfg, mBuf);
1370    CMCHKPK(oduUnpackUInt8, param->instId, mBuf);
1371    return ROK;
1372 }
1373
1374
1375 \f
1376 /***********************************************************
1377 *
1378 *     Func : cmUnpkRgSchInstCfg
1379 *
1380 *
1381 *     Desc : Scheduler Configuration
1382 *
1383 *
1384 *     Ret  : S16
1385 *
1386 *     Notes:
1387 *
1388 *     File  : 
1389 *
1390 **********************************************************/
1391 S16 cmUnpkRgSchInstCfg
1392 (
1393 RgSchInstCfg *param,
1394 Buffer *mBuf
1395 )
1396 {
1397
1398    S32 i;
1399
1400    CMCHKUNPK(oduPackUInt8, &param->instId, mBuf);
1401    CMCHKUNPK(cmUnpkRgGenCfg, &param->genCfg, mBuf);
1402    CMCHKUNPK(oduPackUInt8, &param->numSaps, mBuf);
1403    for (i=0; i<param->numSaps; i++) {
1404       CMCHKUNPK(cmUnpkRgUpSapCfg, &param->rgmSap[i], mBuf);
1405    }
1406    for (i=0; i<param->numSaps; i++) {
1407       CMCHKUNPK(cmUnpkRgUpSapCfg, &param->rgrSap[i], mBuf);
1408    }
1409    for (i=0; i<param->numSaps; i++) {
1410       CMCHKUNPK(cmUnpkRgLowSapCfg, &param->tfuSap[i], mBuf);
1411    }
1412    return ROK;
1413 }
1414
1415
1416 \f
1417 /***********************************************************
1418 *
1419 *     Func : cmPkRgCfg
1420 *
1421 *
1422 *     Desc :   This structure holds Configuration parameters for MAC.
1423 *
1424 *
1425 *     Ret  : S16
1426 *
1427 *     Notes:
1428 *
1429 *     File  : 
1430 *
1431 **********************************************************/
1432 S16 cmPkRgCfg
1433 (
1434 RgCfg *param,
1435 S16 elmnt,
1436 Buffer *mBuf
1437 )
1438 {
1439
1440       switch(elmnt) {
1441          case STSCHINST:
1442             CMCHKPK(cmPkRgSchInstCfg, &param->s.schInstCfg, mBuf);
1443             break;
1444          case STTFUSAP:
1445             CMCHKPK(cmPkRgLowSapCfg, &param->s.tfuSap, mBuf);
1446             break;
1447          case STCRGSAP:
1448             CMCHKPK(cmPkRgUpSapCfg, &param->s.crgSap, mBuf);
1449             break;
1450          case STRGUSAP:
1451             CMCHKPK(cmPkRgUpSapCfg, &param->s.rguSap, mBuf);
1452             break;
1453          case STGEN:
1454             CMCHKPK(cmPkRgGenCfg, &param->s.genCfg, mBuf);
1455             break;
1456          default :
1457             return RFAILED;
1458       }
1459    return ROK;
1460 }
1461
1462
1463 \f
1464 /***********************************************************
1465 *
1466 *     Func : cmUnpkRgCfg
1467 *
1468 *
1469 *     Desc :   This structure holds Configuration parameters for MAC.
1470 *
1471 *
1472 *     Ret  : S16
1473 *
1474 *     Notes:
1475 *
1476 *     File  : 
1477 *
1478 **********************************************************/
1479 S16 cmUnpkRgCfg
1480 (
1481 RgCfg *param,
1482 S16 elmnt,
1483 Buffer *mBuf
1484 )
1485 {
1486
1487       switch(elmnt) {
1488          case STGEN:
1489             CMCHKUNPK(cmUnpkRgGenCfg, &param->s.genCfg, mBuf);
1490             break;
1491          case STRGUSAP:
1492             CMCHKUNPK(cmUnpkRgUpSapCfg, &param->s.rguSap, mBuf);
1493             break;
1494          case STCRGSAP:
1495             CMCHKUNPK(cmUnpkRgUpSapCfg, &param->s.crgSap, mBuf);
1496             break;
1497          case STTFUSAP:
1498             CMCHKUNPK(cmUnpkRgLowSapCfg, &param->s.tfuSap, mBuf);
1499             break;
1500          case STSCHINST:
1501             CMCHKUNPK(cmUnpkRgSchInstCfg, &param->s.schInstCfg, mBuf);
1502             break;
1503          default :
1504             return RFAILED;
1505       }
1506    return ROK;
1507 }
1508
1509
1510 \f
1511 /***********************************************************
1512 *
1513 *     Func : cmPkRgSapSta
1514 *
1515 *
1516 *     Desc :   This structure holds a SAP's status information.
1517 *
1518 *
1519 *     Ret  : S16
1520 *
1521 *     Notes:
1522 *
1523 *     File  : 
1524 *
1525 **********************************************************/
1526 S16 cmPkRgSapSta
1527 (
1528 RgSapSta *param,
1529 Buffer *mBuf
1530 )
1531 {
1532
1533    CMCHKPK(oduUnpackUInt8, param->sapState, mBuf);
1534    return ROK;
1535 }
1536
1537
1538 \f
1539 /***********************************************************
1540 *
1541 *     Func : cmUnpkRgSapSta
1542 *
1543 *
1544 *     Desc :   This structure holds a SAP's status information.
1545 *
1546 *
1547 *     Ret  : S16
1548 *
1549 *     Notes:
1550 *
1551 *     File  : 
1552 *
1553 **********************************************************/
1554 S16 cmUnpkRgSapSta
1555 (
1556 RgSapSta *param,
1557 Buffer *mBuf
1558 )
1559 {
1560
1561    CMCHKUNPK(oduPackUInt8, &param->sapState, mBuf);
1562    return ROK;
1563 }
1564
1565
1566 \f
1567 /***********************************************************
1568 *
1569 *     Func : cmPkRgSts
1570 *
1571 *
1572 *     Desc :   This structure holds MAC's Statistical information.
1573 *
1574 *
1575 *     Ret  : S16
1576 *
1577 *     Notes:
1578 *
1579 *     File  : 
1580 *
1581 **********************************************************/
1582 S16 cmPkRgSts
1583 (
1584 RgSts *param,
1585 S16 elmnt,
1586 Buffer *mBuf
1587 )
1588 {
1589
1590       switch(elmnt) {
1591          case STTFUSAP:
1592             CMCHKPK(cmPkRgSapSts, &param->s.tfuSts, mBuf);
1593             break;
1594          case STRGRSAP:
1595             CMCHKPK(cmPkRgSapSts, &param->s.rgrSts, mBuf);
1596             break;
1597          case STCRGSAP:
1598             CMCHKPK(cmPkRgSapSts, &param->s.crgSts, mBuf);
1599             break;
1600          case STRGUSAP:
1601             CMCHKPK(cmPkRgSapSts, &param->s.rguSts, mBuf);
1602             break;
1603          case STGEN:
1604             CMCHKPK(cmPkRgGenSts, &param->s.genSts, mBuf);
1605             break;
1606          default :
1607             break;
1608       }
1609    CMCHKPK(cmPkAction, param->action, mBuf);
1610    CMCHKPK(oduUnpackUInt8, param->sapInst, mBuf);
1611    CMCHKPK(cmPkDateTime, &param->dt, mBuf);
1612    return ROK;
1613 }
1614
1615
1616 \f
1617 /***********************************************************
1618 *
1619 *     Func : cmUnpkRgSts
1620 *
1621 *
1622 *     Desc :   This structure holds MAC's Statistical information.
1623 *
1624 *
1625 *     Ret  : S16
1626 *
1627 *     Notes:
1628 *
1629 *     File  : 
1630 *
1631 **********************************************************/
1632 S16 cmUnpkRgSts
1633 (
1634 RgSts *param,
1635 S16 elmnt,
1636 Buffer *mBuf
1637 )
1638 {
1639
1640    CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
1641    CMCHKUNPK(oduPackUInt8, &param->sapInst, mBuf);
1642    CMCHKUNPK(cmUnpkAction, &param->action, mBuf);
1643       switch(elmnt) {
1644          case STGEN:
1645             CMCHKUNPK(cmUnpkRgGenSts, &param->s.genSts, mBuf);
1646             break;
1647          case STRGUSAP:
1648             CMCHKUNPK(cmUnpkRgSapSts, &param->s.rguSts, mBuf);
1649             break;
1650          case STCRGSAP:
1651             CMCHKUNPK(cmUnpkRgSapSts, &param->s.crgSts, mBuf);
1652             break;
1653          case STRGRSAP:
1654             CMCHKUNPK(cmUnpkRgSapSts, &param->s.rgrSts, mBuf);
1655             break;
1656          case STTFUSAP:
1657             CMCHKUNPK(cmUnpkRgSapSts, &param->s.tfuSts, mBuf);
1658             break;
1659          default :
1660             break;
1661       }
1662    return ROK;
1663 }
1664
1665 \f
1666 /***********************************************************
1667 *
1668 *     Func : cmPkRgUstaDgn
1669 *
1670 *
1671 *     Desc :   Alarm diagnostics structure.
1672 *
1673 *
1674 *     Ret  : S16
1675 *
1676 *     Notes:
1677 *
1678 *     File  : 
1679 *
1680 **********************************************************/
1681 S16 cmPkRgUstaDgn
1682 (
1683 RgUstaDgn *param,
1684 Buffer *mBuf
1685 )
1686 {
1687
1688       switch(param->type) {
1689          case LRG_USTA_DGNVAL_MEM:
1690             CMCHKPK(cmPkMemoryId, &param->u.mem, mBuf);
1691             break;
1692          default :
1693             break;
1694       }
1695    CMCHKPK(oduUnpackUInt8, param->type, mBuf);
1696    return ROK;
1697 }
1698
1699
1700 \f
1701 /***********************************************************
1702 *
1703 *     Func : cmUnpkRgUstaDgn
1704 *
1705 *
1706 *     Desc :   Alarm diagnostics structure.
1707 *
1708 *
1709 *     Ret  : S16
1710 *
1711 *     Notes:
1712 *
1713 *     File  : 
1714 *
1715 **********************************************************/
1716 S16 cmUnpkRgUstaDgn
1717 (
1718 RgUstaDgn *param,
1719 Buffer *mBuf
1720 )
1721 {
1722
1723
1724    CMCHKUNPK(oduPackUInt8, &param->type, mBuf);
1725    switch(param->type) 
1726    {
1727       case LRG_USTA_DGNVAL_MEM:
1728          CMCHKUNPK(cmUnpkMemoryId, &param->u.mem, mBuf);
1729          break;
1730       default :
1731          break;
1732       }
1733    return ROK;
1734 }
1735
1736
1737 \f
1738 /***********************************************************
1739 *
1740 *     Func : cmPkRgUsta
1741 *
1742 *
1743 *     Desc :   This structure holds MAC's Unsolicited Status information.
1744 *
1745 *
1746 *     Ret  : S16
1747 *
1748 *     Notes:
1749 *
1750 *     File  : 
1751 *
1752 **********************************************************/
1753 S16 cmPkRgUsta
1754 (
1755 RgUsta *param,
1756 Buffer *mBuf
1757 )
1758 {
1759
1760    CMCHKPK(cmPkRgUstaDgn, &param->dgn, mBuf);
1761    CMCHKPK(cmPkCmAlarm, &param->cmAlarm, mBuf);
1762    return ROK;
1763 }
1764
1765
1766 \f
1767 /***********************************************************
1768 *
1769 *     Func : cmUnpkRgUsta
1770 *
1771 *
1772 *     Desc :   This structure holds MAC's Unsolicited Status information.
1773 *
1774 *
1775 *     Ret  : S16
1776 *
1777 *     Notes:
1778 *
1779 *     File  : 
1780 *
1781 **********************************************************/
1782 S16 cmUnpkRgUsta
1783 (
1784 RgUsta *param,
1785 Buffer *mBuf
1786 )
1787 {
1788
1789    CMCHKUNPK(cmUnpkCmAlarm, &param->cmAlarm, mBuf);
1790    CMCHKUNPK(cmUnpkRgUstaDgn, &param->dgn, mBuf);
1791    return ROK;
1792 }
1793
1794 \f
1795 /***********************************************************
1796 *
1797 *     Func : cmPkRgMngmt
1798 *
1799 *
1800 *     Desc :   This structure holds MAC's Configuration and Control Management Information.
1801 *
1802 *
1803 *     Ret  : S16
1804 *
1805 *     Notes:
1806 *
1807 *     File  : 
1808 *
1809 **********************************************************/
1810 S16 cmPkRgMngmt
1811 (
1812 Pst *pst,
1813 RgMngmt *param,
1814 uint8_t eventType,
1815 Buffer *mBuf
1816 )
1817 {
1818
1819
1820       switch(eventType) {
1821          case EVTLRGUSTAIND:
1822          case EVTLRGSCHSTAIND:
1823             CMCHKPK(cmPkRgUsta, &param->t.usta, mBuf);
1824             break;
1825          case EVTLRGSTSREQ:
1826          case  EVTLRGSTSCFM:
1827             if(cmPkRgSts(&param->t.sts, param->hdr.elmId.elmnt, mBuf)!= ROK)
1828                return RFAILED;
1829             break;
1830          case EVTLRGCFGREQ:
1831          case  EVTLRGCFGCFM:
1832             if(cmPkRgCfg(&param->t.cfg, param->hdr.elmId.elmnt, mBuf) != ROK)
1833                return RFAILED;
1834             break;
1835          case EVTMACSCHGENCFGREQ:
1836          case  EVTMACSCHGENCFGCFM:
1837             if(cmPkRgCfg(&param->t.cfg, param->hdr.elmId.elmnt, mBuf) != ROK)
1838                return RFAILED;
1839             break;
1840          default :
1841             return RFAILED;
1842       }
1843    CMCHKPK(cmPkCmStatus, &param->cfm, mBuf);
1844    CMCHKPK(cmPkHeader, &param->hdr, mBuf);
1845    return ROK;
1846 }
1847
1848
1849 \f
1850 /***********************************************************
1851 *
1852 *     Func : cmUnpkRgMngmt
1853 *
1854 *
1855 *     Desc :   This structure holds MAC's Configuration and Control Management Information.
1856 *
1857 *
1858 *     Ret  : S16
1859 *
1860 *     Notes:
1861 *
1862 *     File  : 
1863 *
1864 **********************************************************/
1865 S16 cmUnpkRgMngmt
1866 (
1867 Pst *pst,
1868 RgMngmt *param,
1869 uint8_t eventType,
1870 Buffer *mBuf
1871 )
1872 {
1873
1874
1875    CMCHKUNPK(cmUnpkHeader, &param->hdr, mBuf);
1876    CMCHKUNPK(cmUnpkCmStatus, &param->cfm, mBuf);
1877    switch(eventType) {
1878       case EVTLRGCFGREQ:
1879       case  EVTLRGCFGCFM:
1880       case EVTMACSCHGENCFGREQ:
1881       case  EVTMACSCHGENCFGCFM:
1882          if(cmUnpkRgCfg(&param->t.cfg, param->hdr.elmId.elmnt, mBuf) != ROK)
1883             return RFAILED;
1884          break;
1885       case EVTLRGSTSREQ:
1886       case  EVTLRGSTSCFM:
1887          if(cmUnpkRgSts(&param->t.sts, param->hdr.elmId.elmnt, mBuf) != ROK)
1888             return RFAILED;
1889          break;
1890       case EVTLRGUSTAIND:
1891       case EVTLRGSCHSTAIND:
1892          CMCHKUNPK(cmUnpkRgUsta, &param->t.usta, mBuf);
1893          break;
1894       default :
1895          return RFAILED;
1896       }
1897    return ROK;
1898 }
1899
1900 /* lrg_c_001.main_3 - ADD -  Added the functions pertaining to LTE_L2_MEAS  */
1901 #ifdef LTE_L2_MEAS
1902 \f
1903 /**
1904 * @brief This API is used to pack 
1905  LrgNmbActvUeQCI elements
1906 *
1907 * @details
1908 *
1909 *     Function: cmPkNmbActvUeQciReq
1910 *
1911 *  @param[in]   LrgNmbActvUeQCI
1912 *  @param[in]   Buffer   *mBuf
1913 *  @return   S16
1914 *      -# ROK
1915 **/
1916 static S16  cmPkNmbActvUeQciReq
1917 (
1918 LrgNmbActvUeQCI   *nmbActvUeQci, 
1919 Buffer        *mBuf
1920 )
1921 {
1922    uint8_t      idx;
1923
1924    
1925    for(idx = 0; idx < nmbActvUeQci->numQci; idx++)
1926    {
1927        CMCHKPK(oduUnpackUInt8, nmbActvUeQci->qci[idx], mBuf);
1928    }
1929    CMCHKPK(oduUnpackUInt8, nmbActvUeQci->numQci, mBuf);
1930    CMCHKPK(oduUnpackUInt8, nmbActvUeQci->sampPrd, mBuf);
1931    return ROK;
1932 }
1933 \f
1934 /**
1935 * @brief This API is used to pack 
1936  LrgAvgPrbQci elements
1937 *
1938 * @details
1939 *
1940 *     Function: cmPkAvgPrbQciReq
1941 *
1942 *  @param[in]   LrgNmbActvUeQciReq  *avgPrbQciReq
1943 *  @param[in]   Buffer   *mBuf
1944 *  @return   S16
1945 *      -# ROK
1946 **/
1947 static S16  cmPkAvgPrbQciReq
1948 (
1949 LrgAvgPrbQCI  *avgPrbQciReq,
1950 Buffer        *mBuf
1951 )
1952 {
1953    uint8_t      idx;
1954
1955    for(idx = 0; idx < avgPrbQciReq->numQci; idx++)
1956    {
1957        CMCHKPK(oduUnpackUInt8, avgPrbQciReq->qci[idx], mBuf);
1958    }
1959    CMCHKPK(oduUnpackUInt8, avgPrbQciReq->numQci, mBuf);
1960    return ROK;
1961
1962 }
1963 \f
1964 /**
1965 * @brief This API is used to send a 
1966 L2 Measurement Request from LM to MAC.
1967 *
1968 * @details
1969 *
1970 *     Function: cmPkLrgSchL2MeasReq
1971 *
1972 *  @param[in]   Pst *  pst
1973 *  @param[in]   LrgSchMeasReqInfo  *  measInfo
1974 *  @return   S16
1975 *      -# ROK
1976 **/
1977 S16 cmPkLrgSchL2MeasReq
1978 (
1979 Pst * pst,
1980 LrgSchMeasReqInfo  *measInfo
1981 )
1982 {
1983    Buffer *mBuf = NULLP;
1984
1985    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1986 #if (ERRCLASS & ERRCLS_ADD_RES)
1987       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1988          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1989          (ErrVal)ELRG049, (ErrVal)0, "SGetMsg failed");
1990 #endif
1991       return RFAILED;
1992    }
1993    if(measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
1994    {
1995       CMCHKPK(cmPkNmbActvUeQciReq, &measInfo->nmbActvUeQciDl, mBuf);
1996    }
1997    if(measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
1998    {
1999       CMCHKPK(cmPkNmbActvUeQciReq, &measInfo->nmbActvUeQciUl, mBuf);
2000    }
2001    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
2002    {
2003       CMCHKPK(cmPkAvgPrbQciReq, &measInfo->avgPrbQciDl, mBuf);
2004    }
2005    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL)
2006    {
2007       CMCHKPK(cmPkAvgPrbQciReq, &measInfo->avgPrbQciUl, mBuf);
2008    }
2009
2010    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
2011    CMCHKPK(oduUnpackUInt32, measInfo->timePrd, mBuf);
2012    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
2013    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
2014    pst->event = (Event) EVTLRGSCHL2MEASREQ;
2015    return (SPstTsk(pst,mBuf));
2016 }
2017 /**
2018 * @brief This API is used to stop a 
2019 L2 Measurement Request from LM to MAC.
2020 *
2021 * @details
2022 *
2023 *     Function: cmPkLrgSchL2MeasStopReq
2024 *
2025 *  @param[in]   Pst *  pst
2026 *  @param[in]   LrgSchMeasReqInfo  *  measInfo
2027 *  @return   S16
2028 *      -# ROK
2029 **/
2030 S16 cmPkLrgSchL2MeasStopReq
2031 (
2032 Pst * pst,
2033 LrgSchMeasStopReqInfo *measInfo
2034 )
2035 {
2036    Buffer *mBuf = NULLP;
2037
2038  if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2039 #if (ERRCLASS & ERRCLS_ADD_RES)
2040       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2041          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2042          (ErrVal)ELRG049, (ErrVal)0, "SGetMsg failed");
2043 #endif
2044       return RFAILED;
2045    }
2046    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
2047    /*CMCHKPK(oduUnpackUInt16, measInfo->timePrd, mBuf);*/
2048    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
2049    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
2050    pst->event = (Event) EVTLRGSCHL2MEASSTOPREQ;
2051    return (SPstTsk(pst,mBuf));
2052 }/*cmPkLrgSchL2MeasStopReq*/
2053
2054 /**
2055 * @brief This API is used to send a 
2056 L2 Measurement Request from LM to MAC.
2057 *
2058 * @details
2059 *
2060 *     Function: cmPkLrgSchL2MeasSendReq
2061 *
2062 *  @param[in]   Pst *  pst
2063 *  @param[in]   LrgSchMeasReqInfo  *  measInfo
2064 *  @return   S16
2065 *      -# ROK
2066 **/
2067 S16 cmPkLrgSchL2MeasSendReq
2068 (
2069 Pst * pst,
2070 LrgSchMeasSndReqInfo *measInfo
2071 )
2072 {
2073    Buffer *mBuf = NULLP;
2074    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2075 #if (ERRCLASS & ERRCLS_ADD_RES)
2076       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2077          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2078          (ErrVal)ELRG049, (ErrVal)0, "SGetMsg failed");
2079 #endif
2080       return RFAILED;
2081    }
2082    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
2083    CMCHKPK(oduUnpackUInt32, measInfo->timePrd, mBuf);
2084    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
2085    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
2086    pst->event = (Event) EVTLRGSCHL2MEASSENDREQ;
2087    return (SPstTsk(pst,mBuf));
2088 }/*cmPkLrgSchL2MeasSendReq*/
2089 \f
2090 /**
2091 * @brief This API is used to unpack AvgPrbQciReq
2092 *
2093 * @details
2094 *
2095 *     Function: cmUnpkNmbActvUeQciReq
2096 *
2097 *  @param[in]   LrgNmbActvUeQCI     *param
2098 *  @param[in]   Buffer * mBuf
2099 *  @return   S16
2100 *      -# ROK
2101 **/
2102 static S16 cmUnpkNmbActvUeQciReq
2103 (
2104 LrgNmbActvUeQCI  *param,
2105 Buffer           *mBuf
2106 )
2107 {
2108    uint8_t     idx;
2109
2110    CMCHKUNPK(oduPackUInt8, &param->sampPrd, mBuf);
2111    CMCHKUNPK(oduPackUInt8, &param->numQci, mBuf);
2112    for(idx = param->numQci; idx > 0; idx--)
2113    {
2114       CMCHKUNPK(oduPackUInt8, &param->qci[idx - 1], mBuf);
2115    }
2116
2117    return ROK;
2118 }
2119 \f
2120 /**
2121 * @brief This API is used to unpack AvgPrbQciReq
2122 *
2123 * @details
2124 *
2125 *     Function: cmUnpkAvgPrbQciReq
2126 *
2127 *  @param[in]   LrgAvgPrbQCI     *param
2128 *  @param[in]   Buffer * mBuf
2129 *  @return   S16
2130 *      -# ROK
2131 **/
2132 static S16 cmUnpkAvgPrbQciReq
2133 (
2134 LrgAvgPrbQCI     *param,
2135 Buffer           *mBuf
2136 )
2137 {
2138    uint8_t     idx;
2139
2140
2141    CMCHKUNPK(oduPackUInt8, &param->numQci, mBuf);
2142    for(idx = param->numQci; idx > 0; idx--)
2143    {
2144       CMCHKUNPK(oduPackUInt8, &param->qci[idx - 1], mBuf);
2145    }
2146    return ROK;
2147
2148 }
2149 \f
2150 /**
2151 * @brief This API is used to send a 
2152 Measurement  Request from LM to SCH.
2153 *
2154 * @details
2155 *
2156 *     Function: cmUnpkLrgSchL2MeasReq
2157 *
2158 *  @param[in]   LrgSchMeasReq func
2159 *  @param[in]   Pst *  pst
2160 *  @param[in]   Buffer * mBuf
2161 *  @return   S16
2162 *      -# ROK
2163 **/
2164 S16 cmUnpkLrgSchL2MeasReq
2165 (
2166 LrgSchL2MeasReq func,
2167 Pst *pst,
2168 Buffer *mBuf
2169 )
2170 {
2171    LrgSchMeasReqInfo  measInfo;
2172
2173
2174    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
2175    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
2176    CMCHKUNPK(oduPackUInt32, &measInfo.timePrd, mBuf);
2177    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
2178    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL)
2179    {
2180       CMCHKUNPK(cmUnpkAvgPrbQciReq, &measInfo.avgPrbQciUl, mBuf);
2181    }
2182    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
2183    {
2184       CMCHKUNPK(cmUnpkAvgPrbQciReq, &measInfo.avgPrbQciDl, mBuf);
2185    }
2186    if(measInfo.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
2187    {
2188       CMCHKUNPK(cmUnpkNmbActvUeQciReq, &measInfo.nmbActvUeQciUl, mBuf);
2189    }
2190    if(measInfo.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
2191    {
2192       CMCHKUNPK(cmUnpkNmbActvUeQciReq, &measInfo.nmbActvUeQciDl, mBuf);
2193    }
2194    SPutMsg(mBuf);
2195    return ((*func)(pst, &measInfo));
2196 }
2197
2198 /**
2199 * @brief This API is used to stop  a 
2200 Measurement  Request from LM to SCH.
2201 *
2202 * @details
2203 *
2204 *     Function: cmUnpkLrgSchL2MeasStopReq
2205 *
2206 *  @param[in]   LrgSchMeasStopReq func
2207 *  @param[in]   Pst *  pst
2208 *  @param[in]   Buffer * mBuf
2209 *  @return   S16
2210 *      -# ROK
2211 **/
2212 S16 cmUnpkLrgSchL2MeasStopReq
2213 (
2214 LrgSchL2MeasStopReq func,
2215 Pst *pst,
2216 Buffer *mBuf
2217 )
2218 {
2219    LrgSchMeasStopReqInfo measInfo;
2220
2221    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
2222    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
2223    /*CMCHKUNPK(oduPackUInt16, &measInfo.timePrd, mBuf);*/
2224    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
2225    SPutMsg(mBuf);
2226    return ((*func)(pst, &measInfo));
2227 }/*cmUnpkLrgSchL2MeasStopReq*/
2228
2229 /**
2230 * @brief This API is used to send a 
2231 Measurement  Request from LM to SCH.
2232 *
2233 * @details
2234 *
2235 *     Function: cmUnpkLrgSchL2MeasSendReq
2236 *
2237 *  @param[in]   LrgSchMeasSendReq func
2238 *  @param[in]   Pst *  pst
2239 *  @param[in]   Buffer * mBuf
2240 *  @return   S16
2241 *      -# ROK
2242 **/
2243 S16 cmUnpkLrgSchL2MeasSendReq
2244 (
2245 LrgSchL2MeasSendReq func,
2246 Pst *pst,
2247 Buffer *mBuf
2248 )
2249 {
2250    LrgSchMeasSndReqInfo measInfo;
2251    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
2252    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
2253    CMCHKUNPK(oduPackUInt32, &measInfo.timePrd, mBuf);
2254    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
2255    SPutMsg(mBuf);
2256    return ((*func)(pst, &measInfo));
2257 }/*cmUnpkLrgSchL2MeasSendReq*/
2258
2259 /**
2260 * @brief This API is used to stop a 
2261 L2 Measurement confirm from MAC to LM
2262 *
2263 * @details
2264 *
2265 *     Function: cmPkLrgSchL2MeasStopCfm
2266 *
2267 *  @param[in]   Pst *  pst
2268 *  @param[in]   LrgSchMeasCfmInfo  *  measInfo
2269 *  @return   S16
2270 *      -# ROK
2271 **/
2272 S16 cmPkLrgSchL2MeasStopCfm
2273 (
2274 Pst * pst,
2275 LrgSchMeasCfmInfo  *measInfo
2276 )
2277 {
2278    Buffer *mBuf = NULLP;
2279
2280    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2281 #if (ERRCLASS & ERRCLS_ADD_RES)
2282       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2283          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2284          (ErrVal)ELRG050, (ErrVal)0, "SGetMsg failed");
2285 #endif
2286       return RFAILED;
2287    }
2288    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
2289    CMCHKPK(cmPkCmStatus, &measInfo->cfm, mBuf);
2290    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
2291    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
2292    pst->event = (Event) EVTLRGSCHL2MEASSTOPCFM;
2293    return (SPstTsk(pst,mBuf));
2294 }/*cmPkLrgSchL2MeasStopCfm*/
2295 /**
2296 * @brief This API is used to Send a 
2297 Measurement  Confirm from SCH to LM.
2298 *
2299 * @details
2300 *
2301 *     Function: cmUnpkLrgL2SchMeasCfm
2302 *
2303 *  @param[in]   Pst *  pst
2304 *  @param[in]   Buffer * mBuf
2305 *  @return   S16
2306 *      -# ROK
2307 **/
2308 S16 cmUnpkLrgSchL2MeasStopCfm
2309 (
2310 LrgSchL2MeasStopCfm func,
2311 Pst *pst,
2312 Buffer *mBuf
2313 )
2314 {
2315    LrgSchMeasCfmInfo  measInfo;
2316
2317
2318    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
2319    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
2320    CMCHKUNPK(cmUnpkCmStatus, &measInfo.cfm, mBuf);
2321    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
2322
2323    SPutMsg(mBuf);
2324    return ((*func)(pst, &measInfo));
2325 }/*cmUnpkLrgSchL2MeasStopCfm*/
2326 \f
2327 /**
2328 * @brief This API is used to unpack LrgNumActvUeQCICfm structure
2329 *
2330 * @details
2331 *
2332 *     Function: cmPkNumUeQciCfm 
2333 *
2334 *  @param[in]   LrgNumActvUeQCICfm *  param
2335 *  @param[in]   Buffer *  mBuf
2336 *  @return   S16
2337 *      -# ROK
2338 **/
2339 static S16 cmPkNumUeQciCfm
2340 (
2341 LrgNumActvUeQCICfm  *param,
2342 Buffer              *mBuf
2343 )
2344 {
2345    uint8_t         idx;
2346
2347    
2348    for(idx = 0; idx < param->numQci; idx++)
2349    {
2350 /*LRG : Review Tag*/
2351      CMCHKPK(oduUnpackUInt8, param->numActvUeQci[idx].qciValue, mBuf);
2352      CMCHKPK(oduUnpackUInt8, param->numActvUeQci[idx].numActvUeQci, mBuf);
2353 /*LRG : Review Tag*/
2354    }
2355    CMCHKPK(oduUnpackUInt8, param->numQci, mBuf);
2356    return ROK;
2357 }
2358 \f
2359 /**
2360 * @brief This API is used to unpack LrgAvgPrbQCICfm structure
2361 *
2362 * @details
2363 *
2364 *     Function: cmPkAvgPrbQciCfm
2365 *
2366 *  @param[in]   LrgAvgPrbQCICfm *  param
2367 *  @param[in]   Buffer *  mBuf
2368 *  @return   S16
2369 *      -# ROK
2370 **/
2371 static S16 cmPkAvgPrbQciCfm
2372 (
2373 LrgAvgPrbQCICfm    *param,
2374 Buffer             *mBuf
2375 )
2376 {
2377    uint8_t         idx;
2378
2379    for(idx = 0; idx < param->numQci; idx++)
2380    {
2381 /*LRG : Review Tag*/
2382       CMCHKPK(oduUnpackUInt8, param->prbPercQci[idx].qciValue, mBuf);
2383       CMCHKPK(oduUnpackUInt8, param->prbPercQci[idx].prbPercQci, mBuf);
2384 /*LRG : Review Tag*/
2385    } 
2386    CMCHKPK(oduUnpackUInt8, param->numQci, mBuf);
2387    return ROK;
2388 }
2389 \f
2390 /**
2391 * @brief This API is used to unpack raPreamblesCfm structure
2392 *
2393 * @details
2394 *
2395 *     Function: cmPkRaPrmbsCfm
2396 *
2397 *  @param[in]   LrgRaPreamblesCfm *  param
2398 *  @param[in]   Buffer *  mBuf
2399 *  @return   S16
2400 *      -# ROK
2401 **/
2402 static S16 cmPkRaPrmbsCfm
2403 (
2404 LrgRaPreamblesCfm  *param,
2405 Buffer             *mBuf
2406 )
2407 {
2408
2409    CMCHKPK(oduUnpackUInt16, param->randSelPreHighRange, mBuf);
2410    CMCHKPK(oduUnpackUInt16, param->randSelPreLowRange, mBuf);
2411    CMCHKPK(oduUnpackUInt16, param->dedPreambles, mBuf);
2412    return ROK;
2413 }
2414 \f
2415 /**
2416 * @brief This API is used to unpack avgPrbCfm structure
2417 *
2418 * @details
2419 *
2420 *     Function: cmPkAvgPrbCfm
2421 *
2422 *  @param[in]   LrgAvgPrbCfm *  param
2423 *  @param[in]   Buffer *  mBuf
2424 *  @return   S16
2425 *      -# ROK
2426 **/
2427 static S16 cmPkAvgPrbCfm 
2428 (
2429 LrgAvgPrbCfm  *param,
2430 Buffer        *mBuf
2431 )
2432 {
2433
2434    CMCHKPK(oduUnpackUInt8, param->prbPerc, mBuf);
2435    return ROK;
2436 }
2437 \f
2438 /**
2439 * @brief This API is used to send a 
2440 L2 Measurement confirm from MAC to LM
2441 *
2442 * @details
2443 *
2444 *     Function: cmPkLrgSchL2MeasCfm
2445 *
2446 *  @param[in]   Pst *  pst
2447 *  @param[in]   LrgSchMeasCfmInfo  *  measInfo
2448 *  @return   S16
2449 *      -# ROK
2450 **/
2451 S16 cmPkLrgSchL2MeasCfm
2452 (
2453 Pst * pst,
2454 LrgSchMeasCfmInfo  *measInfo
2455 )
2456 {
2457    Buffer *mBuf = NULLP;
2458
2459
2460    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2461 #if (ERRCLASS & ERRCLS_ADD_RES)
2462       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2463          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2464          (ErrVal)ELRG050, (ErrVal)0, "SGetMsg failed");
2465 #endif
2466       return RFAILED;
2467    }
2468    if(measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
2469    {
2470      CMCHKPK(cmPkNumUeQciCfm, &measInfo->numUeQciDlCfm, mBuf);
2471    }
2472    if(measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
2473    {
2474      CMCHKPK(cmPkNumUeQciCfm, &measInfo->numUeQciUlCfm, mBuf);
2475    }
2476    if(measInfo->measType & LRG_L2MEAS_RA_PREAMBLE)
2477    {
2478      CMCHKPK(cmPkRaPrmbsCfm, &measInfo->raPrmbsCfm, mBuf);
2479    }
2480    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
2481    {
2482      CMCHKPK(cmPkAvgPrbQciCfm, &measInfo->avgPrbQciDlCfm, mBuf);
2483    }
2484    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL)
2485    {
2486      CMCHKPK(cmPkAvgPrbQciCfm, &measInfo->avgPrbQciUlCfm, mBuf);
2487    }
2488    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_DL)
2489    {
2490      CMCHKPK(cmPkAvgPrbCfm, &measInfo->avgPrbDl, mBuf);
2491    }
2492    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_UL)
2493    {
2494      CMCHKPK(cmPkAvgPrbCfm, &measInfo->avgPrbUl, mBuf);
2495    }
2496    if(measInfo->measType & LRG_L2MEAS_TB_TRANS_DL_COUNT)
2497    {
2498       CMCHKPK(oduUnpackUInt32, measInfo->tbTransDlTotalCnt, mBuf);
2499    }   
2500    if(measInfo->measType & LRG_L2MEAS_TB_TRANS_DL_FAULTY_COUNT)
2501    {
2502       CMCHKPK(oduUnpackUInt32, measInfo->tbTransDlFaulty, mBuf);
2503    }   
2504    if(measInfo->measType & LRG_L2MEAS_TB_TRANS_UL_COUNT)
2505    {
2506       CMCHKPK(oduUnpackUInt32, measInfo->tbTransUlTotalCnt, mBuf);
2507    }   
2508    if(measInfo->measType & LRG_L2MEAS_TB_TRANS_UL_FAULTY_COUNT)
2509    {
2510       CMCHKPK(oduUnpackUInt32, measInfo->tbTransUlFaulty, mBuf);
2511    }   
2512    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
2513    CMCHKPK(cmPkCmStatus, &measInfo->cfm, mBuf);
2514    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
2515    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
2516    pst->event = (Event) EVTLRGSCHL2MEASCFM;
2517    return (SPstTsk(pst,mBuf));
2518 }
2519 \f
2520 /**
2521 * @brief This API is used to unpack LrgNumActvUeQCICfm
2522 *
2523 * @details
2524 *
2525 *     Function: cmUnpkNumUeQciCfm
2526 *
2527 *  @param[in]   LrgNumActvUeQCICfm *param
2528 *  @param[in]   Buffer * mBuf
2529 *  @return   Void
2530 *      -# ROK
2531 **/
2532 static S16 cmUnpkNumUeQciCfm
2533 (
2534 LrgNumActvUeQCICfm *param,
2535 Buffer          *mBuf
2536 )
2537 {
2538    uint8_t          idx;
2539
2540    CMCHKUNPK(oduPackUInt8, &param->numQci, mBuf);
2541    for(idx = param->numQci; idx > 0; idx--)
2542    {
2543 /*LRG : Review Tag*/
2544        CMCHKUNPK(oduPackUInt8, &param->numActvUeQci[idx - 1].numActvUeQci, mBuf);
2545        CMCHKUNPK(oduPackUInt8, &param->numActvUeQci[idx - 1].qciValue, mBuf);
2546 /*LRG : Review Tag*/
2547    }
2548    return ROK;
2549 }
2550 \f
2551 /**
2552 * @brief This API is used to unpack LrgAvgPrbQCICfm
2553 *
2554 * @details
2555 *
2556 *     Function: cmUnpkAvgPrbQciCfm
2557 *
2558 *  @param[in]   LrgAvgPrbQCICfm *param
2559 *  @param[in]   Buffer * mBuf
2560 *  @return  Void 
2561 *      -# ROK
2562 **/
2563 static S16 cmUnpkAvgPrbQciCfm
2564 (
2565 LrgAvgPrbQCICfm *param,
2566 Buffer          *mBuf
2567 )
2568 {
2569    uint8_t          idx;
2570
2571
2572    CMCHKUNPK(oduPackUInt8, &param->numQci, mBuf);
2573    for(idx = param->numQci; idx > 0; idx--)
2574    {
2575 /*LRG : Review Tag*/
2576       CMCHKUNPK(oduPackUInt8, &param->prbPercQci[idx - 1].prbPercQci, mBuf);
2577       CMCHKUNPK(oduPackUInt8, &param->prbPercQci[idx - 1].qciValue, mBuf);
2578 /*LRG : Review Tag*/
2579    }
2580    return ROK;
2581 }
2582 \f
2583 /**
2584 * @brief This API is used to unpack LrgRaPreamblesCfm
2585 *
2586 * @details
2587 *
2588 *     Function: cmUnpkRaPrmbsCfm
2589 *
2590 *  @param[in]   LrgRaPreamblesCfm *param
2591 *  @param[in]   Buffer * mBuf
2592 *  @return   Void
2593 *      -# ROK
2594 **/
2595 static S16 cmUnpkRaPrmbsCfm
2596 (
2597 LrgRaPreamblesCfm *param,
2598 Buffer         *mBuf
2599 )
2600 {
2601
2602
2603    CMCHKUNPK(oduPackUInt16, &param->dedPreambles, mBuf);
2604    CMCHKUNPK(oduPackUInt16, &param->randSelPreLowRange, mBuf);
2605    CMCHKUNPK(oduPackUInt16, &param->randSelPreHighRange, mBuf);
2606    return ROK;
2607 }
2608 \f
2609 /**
2610 * @brief This API is used to unpack avgPrbCfm
2611 *
2612 * @details
2613 *
2614 *     Function: cmUnpkAvgPrbCfm
2615 *
2616 *  @param[in]   LrgAvgPrbCfm  *param
2617 *  @param[in]   Buffer * mBuf
2618 *  @return   Void
2619 *      -# ROK
2620 **/
2621 static S16 cmUnpkAvgPrbCfm
2622 (
2623 LrgAvgPrbCfm   *param, 
2624 Buffer         *mBuf
2625 )
2626 {
2627
2628
2629    CMCHKUNPK(oduPackUInt8, &param->prbPerc, mBuf);
2630    return ROK;
2631 }
2632 \f
2633 /**
2634 * @brief This API is used to send a 
2635 Measurement  Confirm from LM to SCH.
2636 *
2637 * @details
2638 *
2639 *     Function: cmUnpkLrgL2SchMeasCfm
2640 *
2641 *  @param[in]   Pst *  pst
2642 *  @param[in]   Buffer * mBuf
2643 *  @return   S16
2644 *      -# ROK
2645 **/
2646 S16 cmUnpkLrgSchL2MeasCfm
2647 (
2648 LrgSchL2MeasCfm func,
2649 Pst *pst,
2650 Buffer *mBuf
2651 )
2652 {
2653    LrgSchMeasCfmInfo  measInfo;
2654
2655
2656    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
2657    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
2658    CMCHKUNPK(cmUnpkCmStatus, &measInfo.cfm, mBuf);
2659    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
2660    if(measInfo.measType & LRG_L2MEAS_TB_TRANS_UL_FAULTY_COUNT)
2661    {
2662       CMCHKPK(oduPackUInt32, &measInfo.tbTransUlFaulty, mBuf);
2663    }    
2664    if(measInfo.measType & LRG_L2MEAS_TB_TRANS_UL_COUNT)
2665    {
2666       CMCHKPK(oduPackUInt32, &measInfo.tbTransUlTotalCnt, mBuf);
2667    }   
2668    if(measInfo.measType & LRG_L2MEAS_TB_TRANS_DL_FAULTY_COUNT)
2669    {
2670       CMCHKPK(oduPackUInt32, &measInfo.tbTransDlFaulty, mBuf);
2671    }   
2672    if(measInfo.measType & LRG_L2MEAS_TB_TRANS_DL_COUNT)
2673    {
2674       CMCHKPK(oduPackUInt32, &measInfo.tbTransDlTotalCnt, mBuf);
2675    }   
2676    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_UL)
2677    {
2678      CMCHKUNPK(cmUnpkAvgPrbCfm, &measInfo.avgPrbUl, mBuf);
2679    }
2680    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_DL)
2681    {
2682      CMCHKUNPK(cmUnpkAvgPrbCfm, &measInfo.avgPrbDl, mBuf);
2683    }
2684    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL)
2685    {
2686      CMCHKUNPK(cmUnpkAvgPrbQciCfm, &measInfo.avgPrbQciUlCfm, mBuf);
2687    }
2688    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
2689    {
2690      CMCHKUNPK(cmUnpkAvgPrbQciCfm, &measInfo.avgPrbQciDlCfm, mBuf);
2691    }
2692    if(measInfo.measType & LRG_L2MEAS_RA_PREAMBLE)
2693    {
2694      CMCHKUNPK(cmUnpkRaPrmbsCfm, &measInfo.raPrmbsCfm, mBuf);
2695    }
2696    if(measInfo.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
2697    {
2698      CMCHKUNPK(cmUnpkNumUeQciCfm, &measInfo.numUeQciUlCfm, mBuf);
2699    }
2700    if(measInfo.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
2701    {
2702      CMCHKUNPK(cmUnpkNumUeQciCfm, &measInfo.numUeQciDlCfm, mBuf);
2703    }
2704    SPutMsg(mBuf);
2705    return ((*func)(pst, &measInfo));
2706 }
2707 #endif
2708 #endif
2709 \f
2710
2711 /**********************************************************************
2712          End of file
2713  **********************************************************************/