1b6dcfce2f9ee8edc85ef713857afbcaf267d140
[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 Request from LM to MAC.
546 *
547 * @details
548 *
549 *     Function: cmPkLrgStaReq
550 *
551 *  @param[in]   Pst *  pst
552 *  @param[in]   RgMngmt *  sta
553 *  @return   S16
554 *      -# ROK
555 **/
556 S16 cmPkLrgStaReq
557 (
558 Pst * pst,
559 RgMngmt * sta
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)ELRG019, (ErrVal)0, "Packing failed");
569 #endif
570       return RFAILED;
571    }
572    if (cmPkRgMngmt(pst, sta, EVTLRGSSTAREQ, mBuf) != ROK) {
573 #if (ERRCLASS & ERRCLS_ADD_RES)
574       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
575             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
576             (ErrVal)ELRG020, (ErrVal)0, "Packing failed");
577 #endif
578       SPutMsg(mBuf);
579       return RFAILED;
580    }
581    
582    pst->event = (Event) EVTLRGSSTAREQ;
583    return (SPstTsk(pst,mBuf));
584 }
585
586 \f
587 /**
588 * @brief This API is used to send a 
589 Status Request from LM to MAC.
590 *
591 * @details
592 *
593 *     Function: cmUnpkLrgStaReq
594 *
595 *  @param[in]   Pst *  pst
596 *  @param[in]   RgMngmt *  sta
597 *  @return   S16
598 *      -# ROK
599 **/
600 S16 cmUnpkLrgStaReq
601 (
602 LrgStaReq func,
603 Pst *pst,
604 Buffer *mBuf
605 )
606 {
607    RgMngmt sta;
608    
609    
610    memset(&sta, 0, sizeof(RgMngmt));
611    if (cmUnpkRgMngmt(pst, &sta, EVTLRGSSTAREQ, mBuf) != ROK) {
612 #if (ERRCLASS & ERRCLS_ADD_RES)
613       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
614             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
615             (ErrVal)ELRG021, (ErrVal)0, "Packing failed");
616 #endif
617       SPutMsg(mBuf);
618       return RFAILED;
619    }
620    SPutMsg(mBuf);
621    return ((*func)(pst, &sta));
622 }
623
624 \f
625 /**
626 * @brief This API is used to send a 
627 Status Confirm from MAC to LM.
628 *
629 * @details
630 *
631 *     Function: cmPkLrgStaCfm
632 *
633 *  @param[in]   Pst *  pst
634 *  @param[in]   RgMngmt *  cfm
635 *  @return   S16
636 *      -# ROK
637 **/
638 S16 cmPkLrgStaCfm
639 (
640 Pst * pst,
641 RgMngmt * cfm
642 )
643 {
644    Buffer *mBuf = NULLP;
645
646    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
647 #if (ERRCLASS & ERRCLS_ADD_RES)
648       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
649          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
650          (ErrVal)ELRG022, (ErrVal)0, "Packing failed");
651 #endif
652       return RFAILED;
653    }
654    if (cmPkRgMngmt(pst, cfm, EVTLRGSSTACFM, mBuf) != ROK) {
655 #if (ERRCLASS & ERRCLS_ADD_RES)
656       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
657             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
658             (ErrVal)ELRG023, (ErrVal)0, "Packing failed");
659 #endif
660       SPutMsg(mBuf);
661       return RFAILED;
662    }
663    
664    pst->event = (Event) EVTLRGSSTACFM;
665    return (SPstTsk(pst,mBuf));
666 }
667
668 \f
669 /**
670 * @brief This API is used to send a 
671 Status Confirm from MAC to LM.
672 *
673 * @details
674 *
675 *     Function: cmUnpkLrgStaCfm
676 *
677 *  @param[in]   Pst *  pst
678 *  @param[in]   RgMngmt *  cfm
679 *  @return   S16
680 *      -# ROK
681 **/
682 S16 cmUnpkLrgStaCfm
683 (
684 LrgStaCfm func,
685 Pst *pst,
686 Buffer *mBuf
687 )
688 {
689    RgMngmt cfm;
690    
691   
692    memset(&cfm, 0, sizeof(RgMngmt));
693    if (cmUnpkRgMngmt(pst, &cfm, EVTLRGSSTACFM, mBuf) != ROK) {
694 #if (ERRCLASS & ERRCLS_ADD_RES)
695       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
696             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
697             (ErrVal)ELRG024, (ErrVal)0, "Packing failed");
698 #endif
699       SPutMsg(mBuf);
700       return RFAILED;
701    }
702    SPutMsg(mBuf);
703    return ((*func)(pst, &cfm));
704 }
705
706 \f
707 /**
708 * @brief This API is used to send a 
709 Status Indication from MAC to LM.
710 *
711 * @details
712 *
713 *     Function: cmPkLrgStaInd
714 *
715 *  @param[in]   Pst *  pst
716 *  @param[in]   RgMngmt *  usta
717 *  @return   S16
718 *      -# ROK
719 **/
720 S16 cmPkLrgStaInd
721 (
722 Pst * pst,
723 RgMngmt * usta
724 )
725 {
726    Buffer *mBuf = NULLP;
727
728    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
729 #if (ERRCLASS & ERRCLS_ADD_RES)
730       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
731          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
732          (ErrVal)ELRG025, (ErrVal)0, "Packing failed");
733 #endif
734       return RFAILED;
735    }
736    if (pst->selector == ODU_SELECTOR_LC) {
737       if (cmPkRgMngmt(pst, usta, EVTLRGUSTAIND, mBuf) != ROK) {
738 #if (ERRCLASS & ERRCLS_ADD_RES)
739          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
740             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
741             (ErrVal)ELRG026, (ErrVal)0, "Packing failed");
742 #endif
743          SPutMsg(mBuf);
744          return RFAILED;
745       }
746    }
747    
748    pst->event = (Event) EVTLRGUSTAIND;
749    return (SPstTsk(pst,mBuf));
750 }
751
752 \f
753 /**
754 * @brief This API is used to send a 
755 Status Indication from MAC to LM.
756 *
757 * @details
758 *
759 *     Function: cmUnpkLrgStaInd
760 *
761 *  @param[in]   Pst *  pst
762 *  @param[in]   RgMngmt *  usta
763 *  @return   S16
764 *      -# ROK
765 **/
766 S16 cmUnpkLrgStaInd
767 (
768 LrgStaInd func,
769 Pst *pst,
770 Buffer *mBuf
771 )
772 {
773    RgMngmt usta;
774    
775
776    if (cmUnpkRgMngmt(pst, &usta, EVTLRGUSTAIND, mBuf) != ROK) {
777       SPutMsg(mBuf);
778 #if (ERRCLASS & ERRCLS_ADD_RES)
779       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
780             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
781             (ErrVal)ELRG027, (ErrVal)0, "Packing failed");
782 #endif
783       return RFAILED;
784    }
785    SPutMsg(mBuf);
786    return ((*func)(pst, &usta));
787 }
788
789 \f
790 /**
791 * @brief This API is used to send a 
792 Status Indication from SCH to LM.
793 *
794 * @details
795 *
796 *     Function: cmPkLrgSchStaInd
797 *
798 *  @param[in]   Pst *  pst
799 *  @param[in]   RgMngmt *  sta
800 *  @return   S16
801 *      -# ROK
802 **/
803 S16 cmPkLrgSchStaInd
804 (
805 Pst * pst,
806 RgMngmt * sta
807 )
808 {
809    Buffer *mBuf = NULLP;
810
811    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
812 #if (ERRCLASS & ERRCLS_ADD_RES)
813       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
814          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
815          (ErrVal)ELRG028, (ErrVal)0, "Packing failed");
816 #endif
817       return RFAILED;
818    }
819    if (pst->selector == ODU_SELECTOR_LC) {
820       if (cmPkRgMngmt(pst, sta, EVTLRGSCHSTAIND, mBuf) != ROK) {
821 #if (ERRCLASS & ERRCLS_ADD_RES)
822          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
823             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
824             (ErrVal)ELRG029, (ErrVal)0, "Packing failed");
825 #endif
826          SPutMsg(mBuf);
827          return RFAILED;
828       }
829    }
830    
831    pst->event = (Event) EVTLRGSCHSTAIND;
832    return (SPstTsk(pst,mBuf));
833 }
834
835 \f
836 /**
837 * @brief This API is used to send a 
838 Status Indication from SCH to LM.
839 *
840 * @details
841 *
842 *     Function: cmUnpkLrgSchStaInd
843 *
844 *  @param[in]   Pst *  pst
845 *  @param[in]   RgMngmt *  sta
846 *  @return   S16
847 *      -# ROK
848 **/
849 S16 cmUnpkLrgSchStaInd
850 (
851 LrgSchStaInd func,
852 Pst *pst,
853 Buffer *mBuf
854 )
855 {
856    RgMngmt sta;
857    
858
859    if (cmUnpkRgMngmt(pst, &sta, EVTLRGSCHSTAIND, mBuf) != ROK) {
860       SPutMsg(mBuf);
861 #if (ERRCLASS & ERRCLS_ADD_RES)
862       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
863             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
864             (ErrVal)ELRG030, (ErrVal)0, "Packing failed");
865 #endif
866       return RFAILED;
867    }
868    SPutMsg(mBuf);
869    return ((*func)(pst, &sta));
870 }
871
872 \f
873 /**
874 * @brief This API is used to send a 
875 Control Request from LM to MAC.
876 *
877 * @details
878 *
879 *     Function: cmPkLrgCntrlReq
880 *
881 *  @param[in]   Pst *  pst
882 *  @param[in]   RgMngmt *  cntrl
883 *  @return   S16
884 *      -# ROK
885 **/
886 S16 cmPkLrgCntrlReq
887 (
888 Pst * pst,
889 RgMngmt * cntrl
890 )
891 {
892    Buffer *mBuf = NULLP;
893
894    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
895 #if (ERRCLASS & ERRCLS_ADD_RES)
896       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
897          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
898          (ErrVal)ELRG031, (ErrVal)0, "Packing failed");
899 #endif
900       return RFAILED;
901    }
902    if (pst->selector == ODU_SELECTOR_LC) {
903       if (cmPkRgMngmt(pst, cntrl, EVTLRGCNTRLREQ, mBuf) != ROK) {
904 #if (ERRCLASS & ERRCLS_ADD_RES)
905          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
906             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
907             (ErrVal)ELRG032, (ErrVal)0, "Packing failed");
908 #endif
909          SPutMsg(mBuf);
910          return RFAILED;
911       }
912    }
913    
914    pst->event = (Event) EVTLRGCNTRLREQ;
915    return (SPstTsk(pst,mBuf));
916 }
917
918 \f
919 /**
920 * @brief This API is used to send a 
921 Control Request from LM to MAC.
922 *
923 * @details
924 *
925 *     Function: cmUnpkLrgCntrlReq
926 *
927 *  @param[in]   Pst *  pst
928 *  @param[in]   RgMngmt *  cntrl
929 *  @return   S16
930 *      -# ROK
931 **/
932 S16 cmUnpkLrgCntrlReq
933 (
934 LrgCntrlReq func,
935 Pst *pst,
936 Buffer *mBuf
937 )
938 {
939    RgMngmt cntrl;
940    
941
942    if (cmUnpkRgMngmt(pst, &cntrl, EVTLRGCNTRLREQ, mBuf) != ROK) {
943       SPutMsg(mBuf);
944 #if (ERRCLASS & ERRCLS_ADD_RES)
945       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
946             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
947             (ErrVal)ELRG033, (ErrVal)0, "Packing failed");
948 #endif
949       return RFAILED;
950    }
951    SPutMsg(mBuf);
952    return ((*func)(pst, &cntrl));
953 }
954
955 \f
956 /**
957 * @brief This API is used to send a 
958 Control Request from LM to SCH.
959 *
960 * @details
961 *
962 *     Function: cmPkLrgSchCntrlReq
963 *
964 *  @param[in]   Pst *  pst
965 *  @param[in]   RgMngmt *  cntrl
966 *  @return   S16
967 *      -# ROK
968 **/
969 S16 cmPkLrgSchCntrlReq
970 (
971 Pst * pst,
972 RgMngmt * cntrl
973 )
974 {
975    Buffer *mBuf = NULLP;
976
977    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
978 #if (ERRCLASS & ERRCLS_ADD_RES)
979       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
980          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
981          (ErrVal)ELRG034, (ErrVal)0, "Packing failed");
982 #endif
983       return RFAILED;
984    }
985    if (pst->selector == ODU_SELECTOR_LC) {
986       if (cmPkRgMngmt(pst, cntrl, EVTLRGSCHCNTRLREQ, mBuf) != ROK) {
987 #if (ERRCLASS & ERRCLS_ADD_RES)
988          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
989             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
990             (ErrVal)ELRG035, (ErrVal)0, "Packing failed");
991 #endif
992          SPutMsg(mBuf);
993          return RFAILED;
994       }
995    }
996    
997    pst->event = (Event) EVTLRGSCHCNTRLREQ;
998    return (SPstTsk(pst,mBuf));
999 }
1000
1001 \f
1002 /**
1003 * @brief This API is used to send a 
1004 Control Request from LM to SCH.
1005 *
1006 * @details
1007 *
1008 *     Function: cmUnpkLrgSchCntrlReq
1009 *
1010 *  @param[in]   Pst *  pst
1011 *  @param[in]   RgMngmt *  cntrl
1012 *  @return   S16
1013 *      -# ROK
1014 **/
1015 S16 cmUnpkLrgSchCntrlReq
1016 (
1017 LrgSchCntrlReq func,
1018 Pst *pst,
1019 Buffer *mBuf
1020 )
1021 {
1022    RgMngmt cntrl;
1023    
1024
1025    if (cmUnpkRgMngmt(pst, &cntrl, EVTLRGSCHCNTRLREQ, mBuf) != ROK) {
1026       SPutMsg(mBuf);
1027 #if (ERRCLASS & ERRCLS_ADD_RES)
1028       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1029             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1030             (ErrVal)ELRG036, (ErrVal)0, "Packing failed");
1031 #endif
1032       return RFAILED;
1033    }
1034    SPutMsg(mBuf);
1035    return ((*func)(pst, &cntrl));
1036 }
1037
1038 \f
1039 /**
1040 * @brief This API is used to send a 
1041 Control Confirm from MAC to LM.
1042 *
1043 * @details
1044 *
1045 *     Function: cmPkLrgCntrlCfm
1046 *
1047 *  @param[in]   Pst *  pst
1048 *  @param[in]   RgMngmt *  cfm
1049 *  @return   S16
1050 *      -# ROK
1051 **/
1052 S16 cmPkLrgCntrlCfm
1053 (
1054 Pst * pst,
1055 RgMngmt * cfm
1056 )
1057 {
1058    Buffer *mBuf = NULLP;
1059
1060    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1061 #if (ERRCLASS & ERRCLS_ADD_RES)
1062       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1063          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1064          (ErrVal)ELRG037, (ErrVal)0, "Packing failed");
1065 #endif
1066       return RFAILED;
1067    }
1068    if (pst->selector == ODU_SELECTOR_LC) {
1069       if (cmPkRgMngmt(pst, cfm, EVTLRGCNTRLCFM, mBuf) != ROK) {
1070 #if (ERRCLASS & ERRCLS_ADD_RES)
1071          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1072             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1073             (ErrVal)ELRG038, (ErrVal)0, "Packing failed");
1074 #endif
1075          SPutMsg(mBuf);
1076          return RFAILED;
1077       }
1078    }
1079    
1080    pst->event = (Event) EVTLRGCNTRLCFM;
1081    return (SPstTsk(pst,mBuf));
1082 }
1083
1084 \f
1085 /**
1086 * @brief This API is used to send a 
1087 Control Confirm from MAC to LM.
1088 *
1089 * @details
1090 *
1091 *     Function: cmUnpkLrgCntrlCfm
1092 *
1093 *  @param[in]   Pst *  pst
1094 *  @param[in]   RgMngmt *  cfm
1095 *  @return   S16
1096 *      -# ROK
1097 **/
1098 S16 cmUnpkLrgCntrlCfm
1099 (
1100 LrgCntrlCfm func,
1101 Pst *pst,
1102 Buffer *mBuf
1103 )
1104 {
1105    RgMngmt cfm;
1106    
1107
1108    if (cmUnpkRgMngmt(pst, &cfm, EVTLRGCNTRLCFM, mBuf) != ROK) {
1109       SPutMsg(mBuf);
1110 #if (ERRCLASS & ERRCLS_ADD_RES)
1111       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1112             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1113             (ErrVal)ELRG039, (ErrVal)0, "Packing failed");
1114 #endif
1115       return RFAILED;
1116    }
1117    SPutMsg(mBuf);
1118    return ((*func)(pst, &cfm));
1119 }
1120
1121 \f
1122 /**
1123 * @brief This API is used to send a 
1124 Control Confirm from SCH to LM.
1125 *
1126 * @details
1127 *
1128 *     Function: cmPkLrgSchCntrlCfm
1129 *
1130 *  @param[in]   Pst *  pst
1131 *  @param[in]   RgMngmt *  cntrl
1132 *  @return   S16
1133 *      -# ROK
1134 **/
1135 S16 cmPkLrgSchCntrlCfm
1136 (
1137 Pst * pst,
1138 RgMngmt * cntrl
1139 )
1140 {
1141    Buffer *mBuf = NULLP;
1142
1143    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1144 #if (ERRCLASS & ERRCLS_ADD_RES)
1145       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1146          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1147          (ErrVal)ELRG040, (ErrVal)0, "Packing failed");
1148 #endif
1149       return RFAILED;
1150    }
1151    if (pst->selector == ODU_SELECTOR_LC) {
1152       if (cmPkRgMngmt(pst, cntrl, EVTLRGSCHCNTRLCFM, mBuf) != ROK) {
1153 #if (ERRCLASS & ERRCLS_ADD_RES)
1154          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1155             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1156             (ErrVal)ELRG041, (ErrVal)0, "Packing failed");
1157 #endif
1158          SPutMsg(mBuf);
1159          return RFAILED;
1160       }
1161    }
1162    
1163    pst->event = (Event) EVTLRGSCHCNTRLCFM;
1164    return (SPstTsk(pst,mBuf));
1165 }
1166
1167 \f
1168 /**
1169 * @brief This API is used to send a 
1170 Control Confirm from SCH to LM.
1171 *
1172 * @details
1173 *
1174 *     Function: cmUnpkLrgSchCntrlCfm
1175 *
1176 *  @param[in]   Pst *  pst
1177 *  @param[in]   RgMngmt *  cntrl
1178 *  @return   S16
1179 *      -# ROK
1180 **/
1181 S16 cmUnpkLrgSchCntrlCfm
1182 (
1183 LrgSchCntrlCfm func,
1184 Pst *pst,
1185 Buffer *mBuf
1186 )
1187 {
1188    RgMngmt cntrl;
1189    
1190
1191    if (cmUnpkRgMngmt(pst, &cntrl, EVTLRGSCHCNTRLCFM, mBuf) != ROK) {
1192       SPutMsg(mBuf);
1193 #if (ERRCLASS & ERRCLS_ADD_RES)
1194       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1195             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1196             (ErrVal)ELRG042, (ErrVal)0, "Packing failed");
1197 #endif
1198       return RFAILED;
1199    }
1200    SPutMsg(mBuf);
1201    return ((*func)(pst, &cntrl));
1202 }
1203
1204 \f
1205 /**
1206 * @brief This API is used to send a 
1207 Trace Indication from MAC to LM.
1208 *
1209 * @details
1210 *
1211 *     Function: cmPkLrgTrcInd
1212 *
1213 *  @param[in]   Pst *  pst
1214 *  @param[in]   RgMngmt *  trc
1215 *  @param[in]   Buffer *  trcBuf
1216 *  @return   S16
1217 *      -# ROK
1218 **/
1219 S16 cmPkLrgTrcInd
1220 (
1221 Pst * pst,
1222 RgMngmt * trc,
1223 Buffer * trcBuf
1224 )
1225 {
1226    Buffer *mBuf = NULLP;
1227
1228    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1229 #if (ERRCLASS & ERRCLS_ADD_RES)
1230       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1231          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1232          (ErrVal)ELRG043, (ErrVal)0, "Packing failed");
1233 #endif
1234       SPutMsg(trcBuf);
1235       return RFAILED;
1236    }
1237    if (pst->selector == ODU_SELECTOR_LC) {
1238       MsgLen msgLen;
1239       if (SFndLenMsg(trcBuf, &msgLen) != ROK) {
1240 #if (ERRCLASS & ERRCLS_ADD_RES)
1241          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1242             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1243             (ErrVal)ELRG044, (ErrVal)0, "Packing failed");
1244 #endif
1245          SPutMsg(trcBuf);
1246          return RFAILED;
1247       }
1248       if (SCatMsg(mBuf, trcBuf, M1M2) != ROK) {
1249 #if (ERRCLASS & ERRCLS_ADD_RES)
1250          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1251             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1252             (ErrVal)ELRG045, (ErrVal)0, "Packing failed");
1253 #endif
1254          SPutMsg(trcBuf);
1255          return RFAILED;
1256       }
1257       SPutMsg(trcBuf);
1258       CMCHKPK(cmPkMsgLen, msgLen, mBuf);
1259    }
1260    if (cmPkRgMngmt(pst, trc, EVTLRGTRCIND, mBuf) != ROK) {
1261 #if (ERRCLASS & ERRCLS_ADD_RES)
1262       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1263             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1264             (ErrVal)ELRG046, (ErrVal)0, "Packing failed");
1265 #endif
1266       SPutMsg(trcBuf);
1267       SPutMsg(mBuf);
1268       return RFAILED;
1269    }
1270    
1271    pst->event = (Event) EVTLRGTRCIND;
1272    return (SPstTsk(pst,mBuf));
1273 }
1274
1275 \f
1276 /**
1277 * @brief This API is used to send a 
1278 Trace Indication from MAC to LM.
1279 *
1280 * @details
1281 *
1282 *     Function: cmUnpkLrgTrcInd
1283 *
1284 *  @param[in]   Pst *  pst
1285 *  @param[in]   RgMngmt *  trc
1286 *  @param[in]   Buffer *  trcBuf
1287 *  @return   S16
1288 *      -# ROK
1289 **/
1290 S16 cmUnpkLrgTrcInd
1291 (
1292 LrgTrcInd func,
1293 Pst *pst,
1294 Buffer *mBuf
1295 )
1296 {
1297    RgMngmt trc;
1298   /* lrg_c_001.main_3 - MODIFY -  Modified trcBuf to have it initialized to NULLP */
1299    Buffer *trcBuf = NULLP;
1300    
1301    
1302    if (cmUnpkRgMngmt(pst, &trc, EVTLRGTRCIND, mBuf) != ROK) {
1303       SPutMsg(mBuf);
1304 #if (ERRCLASS & ERRCLS_ADD_RES)
1305       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1306             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1307             (ErrVal)ELRG047, (ErrVal)0, "Packing failed");
1308 #endif
1309       return RFAILED;
1310    }
1311    if (pst->selector == ODU_SELECTOR_LC) {
1312       MsgLen msgLen, totalMsgLen;
1313       CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
1314       if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
1315          return RFAILED;
1316       if (SSegMsg(mBuf, totalMsgLen-msgLen, &trcBuf) != ROK)
1317          return RFAILED;
1318    }
1319    SPutMsg(mBuf);
1320    return ((*func)(pst, &trc, trcBuf));
1321 }
1322
1323 \f
1324 /***********************************************************
1325 *
1326 *     Func : cmPkRgGenCfg
1327 *
1328 *
1329 *     Desc :   This structure holds configuration parameters for MAC General Configuration.
1330 *
1331 *
1332 *     Ret  : S16
1333 *
1334 *     Notes:
1335 *
1336 *     File  : 
1337 *
1338 **********************************************************/
1339 S16 cmPkRgGenCfg
1340 (
1341 RgGenCfg *param,
1342 Buffer *mBuf
1343 )
1344 {
1345
1346
1347 #ifdef LTE_ADV
1348    CMCHKPK(oduUnpackUInt8, param->isSCellActDeactAlgoEnable, mBuf);
1349    CMCHKPK(oduUnpackUInt8, param->forceCntrlSrbBoOnPCel, mBuf);
1350 #endif
1351    CMCHKPK(oduUnpackUInt8, param->startCellId, mBuf);
1352    CMCHKPK(oduUnpackUInt8, param->numRguSaps, mBuf);
1353    CMCHKPK(oduUnpackUInt8, param->tmrRes, mBuf);
1354    CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
1355    CMCHKPK(cmPkPst, &param->lmPst, mBuf);
1356    return ROK;
1357 }
1358
1359
1360 \f
1361 /***********************************************************
1362 *
1363 *     Func : cmUnpkRgGenCfg
1364 *
1365 *
1366 *     Desc :   This structure holds configuration parameters for MAC General Configuration.
1367 *
1368 *
1369 *     Ret  : S16
1370 *
1371 *     Notes:
1372 *
1373 *     File  : 
1374 *
1375 **********************************************************/
1376 S16 cmUnpkRgGenCfg
1377 (
1378 RgGenCfg *param,
1379 Buffer *mBuf
1380 )
1381 {
1382
1383
1384    CMCHKUNPK(cmUnpkPst, &param->lmPst, mBuf);
1385    CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
1386    CMCHKUNPK(oduPackUInt8, &param->tmrRes, mBuf);
1387    CMCHKUNPK(oduPackUInt8, &param->numRguSaps, mBuf);
1388    CMCHKUNPK(oduPackUInt8, &param->startCellId, mBuf);
1389 #ifdef LTE_ADV
1390    CMCHKUNPK(oduPackUInt8, &param->forceCntrlSrbBoOnPCel, mBuf);
1391    CMCHKUNPK(oduPackUInt8, &param->isSCellActDeactAlgoEnable, mBuf);
1392 #endif
1393    return ROK;
1394 }
1395
1396
1397 \f
1398 /***********************************************************
1399 *
1400 *     Func : cmPkRgUpSapCfg
1401 *
1402 *
1403 *     Desc :   This structure holds configuration parameters for MAC Upper SAP Configuration.
1404 *
1405 *
1406 *     Ret  : S16
1407 *
1408 *     Notes:
1409 *
1410 *     File  : 
1411 *
1412 **********************************************************/
1413 S16 cmPkRgUpSapCfg
1414 (
1415 RgUpSapCfg *param,
1416 Buffer *mBuf
1417 )
1418 {
1419
1420
1421    CMCHKPK(SPkS16, param->suId, mBuf);
1422    CMCHKPK(SPkS16, param->spId, mBuf);
1423    CMCHKPK(oduUnpackUInt8, param->route, mBuf);
1424    CMCHKPK(oduUnpackUInt8, param->inst, mBuf);
1425    CMCHKPK(oduUnpackUInt8, param->ent, mBuf);
1426    CMCHKPK(oduUnpackUInt16, param->procId, mBuf);
1427    CMCHKPK(oduUnpackUInt8, param->prior, mBuf);
1428    CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
1429    CMCHKPK(oduUnpackUInt8, param->selector, mBuf);
1430    return ROK;
1431 }
1432
1433
1434 \f
1435 /***********************************************************
1436 *
1437 *     Func : cmUnpkRgUpSapCfg
1438 *
1439 *
1440 *     Desc :   This structure holds configuration parameters for MAC Upper SAP Configuration.
1441 *
1442 *
1443 *     Ret  : S16
1444 *
1445 *     Notes:
1446 *
1447 *     File  : 
1448 *
1449 **********************************************************/
1450 S16 cmUnpkRgUpSapCfg
1451 (
1452 RgUpSapCfg *param,
1453 Buffer *mBuf
1454 )
1455 {
1456
1457
1458    CMCHKUNPK(oduPackUInt8, &param->selector, mBuf);
1459    CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
1460    CMCHKUNPK(oduPackUInt8, &param->prior, mBuf);
1461    CMCHKUNPK(oduPackUInt16, &param->procId, mBuf);
1462    CMCHKUNPK(oduPackUInt8, &param->ent, mBuf);
1463    CMCHKUNPK(oduPackUInt8, &param->inst, mBuf);
1464    CMCHKUNPK(oduPackUInt8, &param->route, mBuf);
1465    CMCHKUNPK(SUnpkS16, &param->spId, mBuf);
1466    CMCHKUNPK(SUnpkS16, &param->suId, mBuf);
1467    return ROK;
1468 }
1469
1470
1471 \f
1472 /***********************************************************
1473 *
1474 *     Func : cmPkRgLowSapCfg
1475 *
1476 *
1477 *     Desc :   This structure holds configuration parameters for MAC Lower SAP Configuration.
1478 *
1479 *
1480 *     Ret  : S16
1481 *
1482 *     Notes:
1483 *
1484 *     File  : 
1485 *
1486 **********************************************************/
1487 S16 cmPkRgLowSapCfg
1488 (
1489 RgLowSapCfg *param,
1490 Buffer *mBuf
1491 )
1492 {
1493
1494
1495    CMCHKPK(cmPkTmrCfg, &param->bndTmr, mBuf);
1496    CMCHKPK(SPkS16, param->suId, mBuf);
1497    CMCHKPK(SPkS16, param->spId, mBuf);
1498    CMCHKPK(oduUnpackUInt8, param->route, mBuf);
1499    CMCHKPK(oduUnpackUInt8, param->inst, mBuf);
1500    CMCHKPK(oduUnpackUInt8, param->ent, mBuf);
1501    CMCHKPK(oduUnpackUInt16, param->procId, mBuf);
1502    CMCHKPK(oduUnpackUInt8, param->prior, mBuf);
1503    CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
1504    CMCHKPK(oduUnpackUInt8, param->selector, mBuf);
1505    return ROK;
1506 }
1507
1508
1509 \f
1510 /***********************************************************
1511 *
1512 *     Func : cmUnpkRgLowSapCfg
1513 *
1514 *
1515 *     Desc :   This structure holds configuration parameters for MAC Lower SAP Configuration.
1516 *
1517 *
1518 *     Ret  : S16
1519 *
1520 *     Notes:
1521 *
1522 *     File  : 
1523 *
1524 **********************************************************/
1525 S16 cmUnpkRgLowSapCfg
1526 (
1527 RgLowSapCfg *param,
1528 Buffer *mBuf
1529 )
1530 {
1531
1532
1533    CMCHKUNPK(oduPackUInt8, &param->selector, mBuf);
1534    CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
1535    CMCHKUNPK(oduPackUInt8, &param->prior, mBuf);
1536    CMCHKUNPK(oduPackUInt16, &param->procId, mBuf);
1537    CMCHKUNPK(oduPackUInt8, &param->ent, mBuf);
1538    CMCHKUNPK(oduPackUInt8, &param->inst, mBuf);
1539    CMCHKUNPK(oduPackUInt8, &param->route, mBuf);
1540    CMCHKUNPK(SUnpkS16, &param->spId, mBuf);
1541    CMCHKUNPK(SUnpkS16, &param->suId, mBuf);
1542    CMCHKUNPK(cmUnpkTmrCfg, &param->bndTmr, mBuf);
1543    return ROK;
1544 }
1545
1546 #ifdef MAC_SCH_STATS
1547
1548 \f
1549 /***********************************************************
1550 *
1551 *     Func : cmPkRgAckNack
1552 *
1553 *
1554 *     Desc :   Ack and Nack statistics
1555 *
1556 *
1557 *     Ret  : S16
1558 *
1559 *     Notes:
1560 *
1561 *     File  : 
1562 *
1563 **********************************************************/
1564 S16 cmPkRgAckNack
1565 (
1566 RgAckNack *param,
1567 Buffer *mBuf
1568 )
1569 {
1570
1571
1572    CMCHKPK(oduUnpackUInt16, param->numOfAcks, mBuf);
1573    CMCHKPK(oduUnpackUInt16, param->numOfNacks, mBuf);
1574    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
1575
1576    return ROK;
1577 } /* cmPkRgAckNack */
1578
1579 \f
1580 /***********************************************************
1581 *
1582 *     Func : cmPkRgSchNackAckStats
1583 *
1584 *
1585 *     Desc :   
1586 *
1587 *
1588 *     Ret  : S16
1589 *
1590 *     Notes:
1591 *
1592 *     File  : 
1593 *
1594 **********************************************************/
1595 S16 cmPkRgSchNackAckStats
1596 (
1597 RgSchNackAckStats *param,
1598 Buffer *mBuf
1599 )
1600 {
1601
1602    S32 i;
1603
1604    for (i=14; i >= 0; i--) {
1605       CMCHKPK(cmPkRgAckNack, &param->ulCqiStat[i], mBuf);
1606    }
1607
1608    for (i=14; i >= 0; i--) {
1609       CMCHKPK(cmPkRgAckNack, &param->dlCqiStat[i], mBuf);
1610    }
1611
1612    return ROK;
1613 }
1614
1615 \f
1616 /***********************************************************
1617 *
1618 *     Func : cmPkRgHqNumRetx
1619 *
1620 *
1621 *     Desc :   Harq Retransmission statistics
1622 *
1623 *
1624 *     Ret  : S16
1625 *
1626 *     Notes:
1627 *
1628 *     File  : 
1629 *
1630 **********************************************************/
1631 S16 cmPkRgHqNumRetx
1632 (
1633 RgSchHqNumRetx *param,
1634 Buffer *mBuf
1635 )
1636 {
1637
1638    CMCHKPK(oduUnpackUInt32, param->totalTx, mBuf);
1639    CMCHKPK(oduUnpackUInt16, param->numOfHQ_4, mBuf);
1640    CMCHKPK(oduUnpackUInt16, param->numOfHQ_3, mBuf);
1641    CMCHKPK(oduUnpackUInt16, param->numOfHQ_2, mBuf);
1642    CMCHKPK(oduUnpackUInt16, param->numOfHQ_1, mBuf);
1643    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
1644
1645    return ROK;
1646 } /* cmPkRgHqNumRetx */
1647
1648 \f
1649 /***********************************************************
1650 *
1651 *     Func : cmPkRgSchHqRetxStats
1652 *
1653 *
1654 *     Desc :   
1655 *
1656 *
1657 *     Ret  : S16
1658 *
1659 *     Notes:
1660 *
1661 *     File  : 
1662 *
1663 **********************************************************/
1664 S16 cmPkRgSchHqRetxStats
1665 (
1666 RgSchHqRetxStats *param,
1667 Buffer *mBuf
1668 )
1669 {
1670
1671    S32 i;
1672
1673    for (i=14; i >= 0; i--) {
1674       CMCHKPK(cmPkRgHqNumRetx, &param->ulCqiStat[i], mBuf);
1675    }
1676
1677    for (i=14; i >= 0; i--) {
1678       CMCHKPK(cmPkRgHqNumRetx, &param->dlCqiStat[i], mBuf);
1679    }
1680
1681    return ROK;
1682 } /* cmPkRgSchHqRetxStats */
1683
1684 /* unpcaking functions */
1685 \f
1686 /***********************************************************
1687 *
1688 *     Func : cmUnpkRgAckNack
1689 *
1690 *
1691 *     Desc :   Ack and Nack statistics
1692 *
1693 *
1694 *     Ret  : S16
1695 *
1696 *     Notes:
1697 *
1698 *     File  : 
1699 *
1700 **********************************************************/
1701 S16 cmUnpkRgAckNack
1702 (
1703 RgAckNack *param,
1704 Buffer *mBuf
1705 )
1706 {
1707
1708
1709    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
1710    CMCHKUNPK(oduPackUInt16, &param->numOfNacks, mBuf);
1711    CMCHKUNPK(oduPackUInt16, &param->numOfAcks, mBuf);
1712
1713    return ROK;
1714 } /* cmUnkRgAckNack */
1715
1716 \f
1717 /***********************************************************
1718 *
1719 *     Func : cmUnpkRgSchNackAckStats
1720 *
1721 *
1722 *     Desc :   
1723 *
1724 *
1725 *     Ret  : S16
1726 *
1727 *     Notes:
1728 *
1729 *     File  : 
1730 *
1731 **********************************************************/
1732 S16 cmUnpkRgSchNackAckStats
1733 (
1734 RgSchNackAckStats *param,
1735 Buffer *mBuf
1736 )
1737 {
1738    S32 i;
1739
1740    for (i=0; i <= 14; i++) {
1741       CMCHKUNPK(cmUnpkRgAckNack, &param->dlCqiStat[i], mBuf);
1742    }
1743
1744    for (i=0; i <= 14; i++) {
1745       CMCHKUNPK(cmUnpkRgAckNack, &param->ulCqiStat[i], mBuf);
1746    }
1747
1748    return ROK;
1749 } /* cmUnpkRgSchNackAckStats */
1750
1751 \f
1752 /***********************************************************
1753 *
1754 *     Func : cmUnpkRgHqNumRetx
1755 *
1756 *
1757 *     Desc :   Harq Retransmission statistics
1758 *
1759 *
1760 *     Ret  : S16
1761 *
1762 *     Notes:
1763 *
1764 *     File  : 
1765 *
1766 **********************************************************/
1767 S16 cmUnpkRgHqNumRetx
1768 (
1769 RgSchHqNumRetx *param,
1770 Buffer *mBuf
1771 )
1772 {
1773
1774    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
1775    CMCHKUNPK(oduPackUInt16, &param->numOfHQ_1, mBuf);
1776    CMCHKUNPK(oduPackUInt16, &param->numOfHQ_2, mBuf);
1777    CMCHKUNPK(oduPackUInt16, &param->numOfHQ_3, mBuf);
1778    CMCHKUNPK(oduPackUInt16, &param->numOfHQ_4, mBuf);
1779    CMCHKUNPK(oduPackUInt32, &param->totalTx, mBuf);
1780
1781    return ROK;
1782 } /* cmUnpkRgHqNumRetx */
1783
1784 \f
1785 /***********************************************************
1786 *
1787 *     Func : cmUnpkRgSchHqRetxStats
1788 *
1789 *
1790 *     Desc :   
1791 *
1792 *
1793 *     Ret  : S16
1794 *
1795 *     Notes:
1796 *
1797 *     File  : 
1798 *
1799 **********************************************************/
1800 S16 cmUnpkRgSchHqRetxStats
1801 (
1802 RgSchHqRetxStats *param,
1803 Buffer *mBuf
1804 )
1805 {
1806    S32 i;
1807
1808    for (i=0; i <= 14; i++) {
1809       CMCHKUNPK(cmUnpkRgHqNumRetx, &param->dlCqiStat[i], mBuf);
1810    }
1811
1812    for (i=0; i <= 14; i++) {
1813       CMCHKUNPK(cmUnpkRgHqNumRetx, &param->ulCqiStat[i], mBuf);
1814    }
1815
1816    return ROK;
1817 } /* cmUnpkRgSchHqRetxStats */
1818
1819 #endif /* MAC_SCH_STATS */
1820
1821 \f
1822 /***********************************************************
1823 *
1824 *     Func : cmPkRgGenSts
1825 *
1826 *
1827 *     Desc :   This structure holds General Statistical information of MAC.
1828 *
1829 *
1830 *     Ret  : S16
1831 *
1832 *     Notes:
1833 *
1834 *     File  : 
1835 *
1836 **********************************************************/
1837 S16 cmPkRgGenSts
1838 (
1839 RgGenSts *param,
1840 Buffer *mBuf
1841 )
1842 {
1843
1844 #ifdef MAC_SCH_STATS
1845    CMCHKPK(cmPkRgSchHqRetxStats, &param->hqRetxStats, mBuf);
1846    CMCHKPK(cmPkRgSchNackAckStats, &param->nackAckStats, mBuf);
1847 #endif /* MAC_SCH_STATS */
1848    CMCHKPK(oduUnpackUInt16, param->numCellCfg, mBuf);
1849    CMCHKPK(oduUnpackUInt32, param->numUeCfg, mBuf);
1850    CMCHKPK(oduUnpackUInt32, param->numHarqFail, mBuf);
1851    return ROK;
1852 }
1853
1854
1855 \f
1856 /***********************************************************
1857 *
1858 *     Func : cmUnpkRgGenSts
1859 *
1860 *
1861 *     Desc :   This structure holds General Statistical information of MAC.
1862 *
1863 *
1864 *     Ret  : S16
1865 *
1866 *     Notes:
1867 *
1868 *     File  : 
1869 *
1870 **********************************************************/
1871 S16 cmUnpkRgGenSts
1872 (
1873 RgGenSts *param,
1874 Buffer *mBuf
1875 )
1876 {
1877
1878    CMCHKUNPK(oduPackUInt32, &param->numHarqFail, mBuf);
1879    CMCHKUNPK(oduPackUInt32, &param->numUeCfg, mBuf);
1880    CMCHKUNPK(oduPackUInt16, &param->numCellCfg, mBuf);
1881 #ifdef MAC_SCH_STATS
1882    CMCHKUNPK(cmUnpkRgSchNackAckStats, &param->nackAckStats, mBuf);
1883    CMCHKUNPK(cmUnpkRgSchHqRetxStats, &param->hqRetxStats, mBuf);
1884 #endif /* MAC_SCH_STATS */
1885    return ROK;
1886 }
1887
1888
1889 \f
1890 /***********************************************************
1891 *
1892 *     Func : cmPkRgSapSts
1893 *
1894 *
1895 *     Desc :   This structure holds Statistical information of a SAP in MAC.
1896 *
1897 *
1898 *     Ret  : S16
1899 *
1900 *     Notes:
1901 *
1902 *     File  : 
1903 *
1904 **********************************************************/
1905 S16 cmPkRgSapSts
1906 (
1907 RgSapSts *param,
1908 Buffer *mBuf
1909 )
1910 {
1911
1912    CMCHKPK(oduUnpackUInt32, param->numPduDrop, mBuf);
1913    CMCHKPK(oduUnpackUInt32, param->numPduTxmit, mBuf);
1914    CMCHKPK(oduUnpackUInt32, param->numPduRcvd, mBuf);
1915    return ROK;
1916 }
1917
1918
1919 \f
1920 /***********************************************************
1921 *
1922 *     Func : cmUnpkRgSapSts
1923 *
1924 *
1925 *     Desc :   This structure holds Statistical information of a SAP in MAC.
1926 *
1927 *
1928 *     Ret  : S16
1929 *
1930 *     Notes:
1931 *
1932 *     File  : 
1933 *
1934 **********************************************************/
1935 S16 cmUnpkRgSapSts
1936 (
1937 RgSapSts *param,
1938 Buffer *mBuf
1939 )
1940 {
1941
1942    CMCHKUNPK(oduPackUInt32, &param->numPduRcvd, mBuf);
1943    CMCHKUNPK(oduPackUInt32, &param->numPduTxmit, mBuf);
1944    CMCHKUNPK(oduPackUInt32, &param->numPduDrop, mBuf);
1945    return ROK;
1946 }
1947
1948
1949 \f
1950 /***********************************************************
1951 *
1952 *     Func : cmPkRgSchInstCfg
1953 *
1954 *
1955 *     Desc : Scheduler Configuration
1956 *
1957 *
1958 *     Ret  : S16
1959 *
1960 *     Notes:
1961 *
1962 *     File  : 
1963 *
1964 **********************************************************/
1965 S16 cmPkRgSchInstCfg
1966 (
1967 RgSchInstCfg *param,
1968 Buffer *mBuf
1969 )
1970 {
1971
1972    S32 i;
1973
1974    for (i=param->numSaps-1; i >= 0; i--) {
1975       CMCHKPK(cmPkRgLowSapCfg, &param->tfuSap[i], mBuf);
1976    }
1977    for (i=param->numSaps-1; i >= 0; i--) {
1978       CMCHKPK(cmPkRgUpSapCfg, &param->rgrSap[i], mBuf);
1979    }
1980    for (i=param->numSaps-1; i >= 0; i--) {
1981       CMCHKPK(cmPkRgUpSapCfg, &param->rgmSap[i], mBuf);
1982    }
1983    CMCHKPK(oduUnpackUInt8, param->numSaps, mBuf);
1984    CMCHKPK(cmPkRgGenCfg, &param->genCfg, mBuf);
1985    CMCHKPK(oduUnpackUInt8, param->instId, mBuf);
1986    return ROK;
1987 }
1988
1989
1990 \f
1991 /***********************************************************
1992 *
1993 *     Func : cmUnpkRgSchInstCfg
1994 *
1995 *
1996 *     Desc : Scheduler Configuration
1997 *
1998 *
1999 *     Ret  : S16
2000 *
2001 *     Notes:
2002 *
2003 *     File  : 
2004 *
2005 **********************************************************/
2006 S16 cmUnpkRgSchInstCfg
2007 (
2008 RgSchInstCfg *param,
2009 Buffer *mBuf
2010 )
2011 {
2012
2013    S32 i;
2014
2015    CMCHKUNPK(oduPackUInt8, &param->instId, mBuf);
2016    CMCHKUNPK(cmUnpkRgGenCfg, &param->genCfg, mBuf);
2017    CMCHKUNPK(oduPackUInt8, &param->numSaps, mBuf);
2018    for (i=0; i<param->numSaps; i++) {
2019       CMCHKUNPK(cmUnpkRgUpSapCfg, &param->rgmSap[i], mBuf);
2020    }
2021    for (i=0; i<param->numSaps; i++) {
2022       CMCHKUNPK(cmUnpkRgUpSapCfg, &param->rgrSap[i], mBuf);
2023    }
2024    for (i=0; i<param->numSaps; i++) {
2025       CMCHKUNPK(cmUnpkRgLowSapCfg, &param->tfuSap[i], mBuf);
2026    }
2027    return ROK;
2028 }
2029
2030
2031 \f
2032 /***********************************************************
2033 *
2034 *     Func : cmPkRgCfg
2035 *
2036 *
2037 *     Desc :   This structure holds Configuration parameters for MAC.
2038 *
2039 *
2040 *     Ret  : S16
2041 *
2042 *     Notes:
2043 *
2044 *     File  : 
2045 *
2046 **********************************************************/
2047 S16 cmPkRgCfg
2048 (
2049 RgCfg *param,
2050 S16 elmnt,
2051 Buffer *mBuf
2052 )
2053 {
2054
2055       switch(elmnt) {
2056          case STSCHINST:
2057             CMCHKPK(cmPkRgSchInstCfg, &param->s.schInstCfg, mBuf);
2058             break;
2059          case STTFUSAP:
2060             CMCHKPK(cmPkRgLowSapCfg, &param->s.tfuSap, mBuf);
2061             break;
2062          case STCRGSAP:
2063             CMCHKPK(cmPkRgUpSapCfg, &param->s.crgSap, mBuf);
2064             break;
2065          case STRGUSAP:
2066             CMCHKPK(cmPkRgUpSapCfg, &param->s.rguSap, mBuf);
2067             break;
2068          case STGEN:
2069             CMCHKPK(cmPkRgGenCfg, &param->s.genCfg, mBuf);
2070             break;
2071          default :
2072             return RFAILED;
2073       }
2074    return ROK;
2075 }
2076
2077
2078 \f
2079 /***********************************************************
2080 *
2081 *     Func : cmUnpkRgCfg
2082 *
2083 *
2084 *     Desc :   This structure holds Configuration parameters for MAC.
2085 *
2086 *
2087 *     Ret  : S16
2088 *
2089 *     Notes:
2090 *
2091 *     File  : 
2092 *
2093 **********************************************************/
2094 S16 cmUnpkRgCfg
2095 (
2096 RgCfg *param,
2097 S16 elmnt,
2098 Buffer *mBuf
2099 )
2100 {
2101
2102       switch(elmnt) {
2103          case STGEN:
2104             CMCHKUNPK(cmUnpkRgGenCfg, &param->s.genCfg, mBuf);
2105             break;
2106          case STRGUSAP:
2107             CMCHKUNPK(cmUnpkRgUpSapCfg, &param->s.rguSap, mBuf);
2108             break;
2109          case STCRGSAP:
2110             CMCHKUNPK(cmUnpkRgUpSapCfg, &param->s.crgSap, mBuf);
2111             break;
2112          case STTFUSAP:
2113             CMCHKUNPK(cmUnpkRgLowSapCfg, &param->s.tfuSap, mBuf);
2114             break;
2115          case STSCHINST:
2116             CMCHKUNPK(cmUnpkRgSchInstCfg, &param->s.schInstCfg, mBuf);
2117             break;
2118          default :
2119             return RFAILED;
2120       }
2121    return ROK;
2122 }
2123
2124
2125 \f
2126 /***********************************************************
2127 *
2128 *     Func : cmPkRgSapSta
2129 *
2130 *
2131 *     Desc :   This structure holds a SAP's status information.
2132 *
2133 *
2134 *     Ret  : S16
2135 *
2136 *     Notes:
2137 *
2138 *     File  : 
2139 *
2140 **********************************************************/
2141 S16 cmPkRgSapSta
2142 (
2143 RgSapSta *param,
2144 Buffer *mBuf
2145 )
2146 {
2147
2148    CMCHKPK(oduUnpackUInt8, param->sapState, mBuf);
2149    return ROK;
2150 }
2151
2152
2153 \f
2154 /***********************************************************
2155 *
2156 *     Func : cmUnpkRgSapSta
2157 *
2158 *
2159 *     Desc :   This structure holds a SAP's status information.
2160 *
2161 *
2162 *     Ret  : S16
2163 *
2164 *     Notes:
2165 *
2166 *     File  : 
2167 *
2168 **********************************************************/
2169 S16 cmUnpkRgSapSta
2170 (
2171 RgSapSta *param,
2172 Buffer *mBuf
2173 )
2174 {
2175
2176    CMCHKUNPK(oduPackUInt8, &param->sapState, mBuf);
2177    return ROK;
2178 }
2179
2180
2181 \f
2182 /***********************************************************
2183 *
2184 *     Func : cmPkRgSts
2185 *
2186 *
2187 *     Desc :   This structure holds MAC's Statistical information.
2188 *
2189 *
2190 *     Ret  : S16
2191 *
2192 *     Notes:
2193 *
2194 *     File  : 
2195 *
2196 **********************************************************/
2197 S16 cmPkRgSts
2198 (
2199 RgSts *param,
2200 S16 elmnt,
2201 Buffer *mBuf
2202 )
2203 {
2204
2205       switch(elmnt) {
2206          case STTFUSAP:
2207             CMCHKPK(cmPkRgSapSts, &param->s.tfuSts, mBuf);
2208             break;
2209          case STRGRSAP:
2210             CMCHKPK(cmPkRgSapSts, &param->s.rgrSts, mBuf);
2211             break;
2212          case STCRGSAP:
2213             CMCHKPK(cmPkRgSapSts, &param->s.crgSts, mBuf);
2214             break;
2215          case STRGUSAP:
2216             CMCHKPK(cmPkRgSapSts, &param->s.rguSts, mBuf);
2217             break;
2218          case STGEN:
2219             CMCHKPK(cmPkRgGenSts, &param->s.genSts, mBuf);
2220             break;
2221          default :
2222             break;
2223       }
2224    CMCHKPK(cmPkAction, param->action, mBuf);
2225    CMCHKPK(oduUnpackUInt8, param->sapInst, mBuf);
2226    CMCHKPK(cmPkDateTime, &param->dt, mBuf);
2227    return ROK;
2228 }
2229
2230
2231 \f
2232 /***********************************************************
2233 *
2234 *     Func : cmUnpkRgSts
2235 *
2236 *
2237 *     Desc :   This structure holds MAC's Statistical information.
2238 *
2239 *
2240 *     Ret  : S16
2241 *
2242 *     Notes:
2243 *
2244 *     File  : 
2245 *
2246 **********************************************************/
2247 S16 cmUnpkRgSts
2248 (
2249 RgSts *param,
2250 S16 elmnt,
2251 Buffer *mBuf
2252 )
2253 {
2254
2255    CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
2256    CMCHKUNPK(oduPackUInt8, &param->sapInst, mBuf);
2257    CMCHKUNPK(cmUnpkAction, &param->action, mBuf);
2258       switch(elmnt) {
2259          case STGEN:
2260             CMCHKUNPK(cmUnpkRgGenSts, &param->s.genSts, mBuf);
2261             break;
2262          case STRGUSAP:
2263             CMCHKUNPK(cmUnpkRgSapSts, &param->s.rguSts, mBuf);
2264             break;
2265          case STCRGSAP:
2266             CMCHKUNPK(cmUnpkRgSapSts, &param->s.crgSts, mBuf);
2267             break;
2268          case STRGRSAP:
2269             CMCHKUNPK(cmUnpkRgSapSts, &param->s.rgrSts, mBuf);
2270             break;
2271          case STTFUSAP:
2272             CMCHKUNPK(cmUnpkRgSapSts, &param->s.tfuSts, mBuf);
2273             break;
2274          default :
2275             break;
2276       }
2277    return ROK;
2278 }
2279
2280
2281 \f
2282 /***********************************************************
2283 *
2284 *     Func : cmPkRgSsta
2285 *
2286 *
2287 *     Desc :   This structure holds MAC's Solicited Status information.
2288 *
2289 *
2290 *     Ret  : S16
2291 *
2292 *     Notes:
2293 *
2294 *     File  : 
2295 *
2296 **********************************************************/
2297 S16 cmPkRgSsta
2298 (
2299 Pst *pst,
2300 RgSsta *param,
2301 S16 elmnt,
2302 #ifdef LRG_V1
2303 uint8_t eventType,
2304 #endif
2305 Buffer *mBuf
2306 )
2307 {
2308
2309       switch(elmnt) {
2310          case STTFUSAP:
2311             CMCHKPK(cmPkRgSapSta, &param->s.tfuSapSta, mBuf);
2312             break;
2313          case STRGRSAP:
2314             CMCHKPK(cmPkRgSapSta, &param->s.rgrSapSta, mBuf);
2315             break;
2316          case STCRGSAP:
2317             CMCHKPK(cmPkRgSapSta, &param->s.crgSapSta, mBuf);
2318             break;
2319          case STRGUSAP:
2320             CMCHKPK(cmPkRgSapSta, &param->s.rguSapSta, mBuf);
2321             break;
2322             /*ccpu00118255 - ADD - Check for eventType before Pack */
2323          case STGEN:
2324 #ifdef LRG_V1 
2325             if (eventType == EVTLRGSSTACFM)
2326             {
2327                CMCHKPK(cmPkSystemId, &param->s.sysId, mBuf);
2328                if (param->s.sysId.ptNmb != NULLP)
2329                {
2330                   SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, 
2331                         (Data *)param->s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
2332                }
2333             }
2334 #else /*LRG_V1 not defined */
2335             if (param->s.sysId.ptNmb != NULLP)
2336             {
2337                  CMCHKPK(cmPkSystemId, &param->s.sysId, mBuf);
2338                  SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)param->s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
2339             }
2340
2341 #endif /*end of LRG_V1 */
2342             break;
2343          default :
2344             break;
2345       }
2346    CMCHKPK(oduUnpackUInt8, param->sapInst, mBuf);
2347    CMCHKPK(cmPkDateTime, &param->dt, mBuf);
2348    return ROK;
2349 }
2350
2351
2352 \f
2353 /***********************************************************
2354 *
2355 *     Func : cmUnpkRgSsta
2356 *
2357 *
2358 *     Desc :   This structure holds MAC's Solicited Status information.
2359 *
2360 *
2361 *     Ret  : S16
2362 *
2363 *     Notes:
2364 *
2365 *     File  : 
2366 *
2367 **********************************************************/
2368 S16 cmUnpkRgSsta
2369 (
2370 Pst    *pst,
2371 RgSsta *param,
2372 S16 elmnt,
2373 Buffer *mBuf
2374 )
2375 {
2376
2377
2378    CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
2379    CMCHKUNPK(oduPackUInt8, &param->sapInst, mBuf);
2380       switch(elmnt) {
2381          case STGEN:
2382             /*ccpu00118255 - ADD - Check for eventType before Unpack */
2383             if (pst->event == EVTLRGSSTACFM)
2384             {
2385                /* After Merging */
2386                if((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&param->s.sysId.ptNmb,
2387                            LRG_MAX_PT_NUM_SIZE)) != ROK){
2388 #if (ERRCLASS & ERRCLS_ADD_RES)
2389                   SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2390                         __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2391                         (ErrVal)ELRG048, (ErrVal)0, "Packing failed");
2392 #endif
2393                   SPutMsg(mBuf);
2394                   return RFAILED;
2395                }
2396                /* KWORK_FIX: Moved the memset under the NULL check */
2397                if (param->s.sysId.ptNmb != NULLP)
2398                {
2399                   memset(param->s.sysId.ptNmb, 0, LRG_MAX_PT_NUM_SIZE);
2400                   CMCHKUNPK(cmUnpkSystemId, &param->s.sysId, mBuf);
2401                }
2402             }
2403             break;
2404          case STRGUSAP:
2405             CMCHKUNPK(cmUnpkRgSapSta, &param->s.rguSapSta, mBuf);
2406             break;
2407          case STCRGSAP:
2408             CMCHKUNPK(cmUnpkRgSapSta, &param->s.crgSapSta, mBuf);
2409             break;
2410          case STRGRSAP:
2411             CMCHKUNPK(cmUnpkRgSapSta, &param->s.rgrSapSta, mBuf);
2412             break;
2413          case STTFUSAP:
2414             CMCHKUNPK(cmUnpkRgSapSta, &param->s.tfuSapSta, mBuf);
2415             break;
2416          default :
2417             break;
2418       }
2419    return ROK;
2420 }
2421
2422
2423 \f
2424 /***********************************************************
2425 *
2426 *     Func : cmPkRgUstaDgn
2427 *
2428 *
2429 *     Desc :   Alarm diagnostics structure.
2430 *
2431 *
2432 *     Ret  : S16
2433 *
2434 *     Notes:
2435 *
2436 *     File  : 
2437 *
2438 **********************************************************/
2439 S16 cmPkRgUstaDgn
2440 (
2441 RgUstaDgn *param,
2442 Buffer *mBuf
2443 )
2444 {
2445
2446       switch(param->type) {
2447          case LRG_USTA_DGNVAL_MEM:
2448             CMCHKPK(cmPkMemoryId, &param->u.mem, mBuf);
2449             break;
2450          default :
2451             break;
2452       }
2453    CMCHKPK(oduUnpackUInt8, param->type, mBuf);
2454    return ROK;
2455 }
2456
2457
2458 \f
2459 /***********************************************************
2460 *
2461 *     Func : cmUnpkRgUstaDgn
2462 *
2463 *
2464 *     Desc :   Alarm diagnostics structure.
2465 *
2466 *
2467 *     Ret  : S16
2468 *
2469 *     Notes:
2470 *
2471 *     File  : 
2472 *
2473 **********************************************************/
2474 S16 cmUnpkRgUstaDgn
2475 (
2476 RgUstaDgn *param,
2477 Buffer *mBuf
2478 )
2479 {
2480
2481
2482    CMCHKUNPK(oduPackUInt8, &param->type, mBuf);
2483    switch(param->type) 
2484    {
2485       case LRG_USTA_DGNVAL_MEM:
2486          CMCHKUNPK(cmUnpkMemoryId, &param->u.mem, mBuf);
2487          break;
2488       default :
2489          break;
2490       }
2491    return ROK;
2492 }
2493
2494
2495 \f
2496 /***********************************************************
2497 *
2498 *     Func : cmPkRgUsta
2499 *
2500 *
2501 *     Desc :   This structure holds MAC's Unsolicited Status information.
2502 *
2503 *
2504 *     Ret  : S16
2505 *
2506 *     Notes:
2507 *
2508 *     File  : 
2509 *
2510 **********************************************************/
2511 S16 cmPkRgUsta
2512 (
2513 RgUsta *param,
2514 Buffer *mBuf
2515 )
2516 {
2517
2518    CMCHKPK(cmPkRgUstaDgn, &param->dgn, mBuf);
2519    CMCHKPK(cmPkCmAlarm, &param->cmAlarm, mBuf);
2520    return ROK;
2521 }
2522
2523
2524 \f
2525 /***********************************************************
2526 *
2527 *     Func : cmUnpkRgUsta
2528 *
2529 *
2530 *     Desc :   This structure holds MAC's Unsolicited Status information.
2531 *
2532 *
2533 *     Ret  : S16
2534 *
2535 *     Notes:
2536 *
2537 *     File  : 
2538 *
2539 **********************************************************/
2540 S16 cmUnpkRgUsta
2541 (
2542 RgUsta *param,
2543 Buffer *mBuf
2544 )
2545 {
2546
2547    CMCHKUNPK(cmUnpkCmAlarm, &param->cmAlarm, mBuf);
2548    CMCHKUNPK(cmUnpkRgUstaDgn, &param->dgn, mBuf);
2549    return ROK;
2550 }
2551
2552
2553 \f
2554 /***********************************************************
2555 *
2556 *     Func : cmPkRgTrc
2557 *
2558 *
2559 *     Desc :   This structure holds MAC's Trace Indication information.
2560 *
2561 *
2562 *     Ret  : S16
2563 *
2564 *     Notes:
2565 *
2566 *     File  : 
2567 *
2568 **********************************************************/
2569 S16 cmPkRgTrc
2570 (
2571 RgTrc *param,
2572 Buffer *mBuf
2573 )
2574 {
2575
2576    CMCHKPK(oduUnpackUInt8, param->evnt, mBuf);
2577    CMCHKPK(cmPkDateTime, &param->dt, mBuf);
2578    return ROK;
2579 }
2580
2581
2582 \f
2583 /***********************************************************
2584 *
2585 *     Func : cmUnpkRgTrc
2586 *
2587 *
2588 *     Desc :   This structure holds MAC's Trace Indication information.
2589 *
2590 *
2591 *     Ret  : S16
2592 *
2593 *     Notes:
2594 *
2595 *     File  : 
2596 *
2597 **********************************************************/
2598 S16 cmUnpkRgTrc
2599 (
2600 RgTrc *param,
2601 Buffer *mBuf
2602 )
2603 {
2604
2605    CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
2606    CMCHKUNPK(oduPackUInt8, &param->evnt, mBuf);
2607    return ROK;
2608 }
2609
2610
2611 \f
2612 /***********************************************************
2613 *
2614 *     Func : cmPkRgDbgCntrl
2615 *
2616 *
2617 *     Desc :   This structure holds MAC's Debug Control information.
2618 *
2619 *
2620 *     Ret  : S16
2621 *
2622 *     Notes:
2623 *
2624 *     File  : 
2625 *
2626 **********************************************************/
2627 S16 cmPkRgDbgCntrl
2628 (
2629 RgDbgCntrl *param,
2630 Buffer *mBuf
2631 )
2632 {
2633
2634    CMCHKPK(oduUnpackUInt32, param->dbgMask, mBuf);
2635    return ROK;
2636 }
2637
2638 #ifdef PHY_ERROR_LOGING
2639 /***********************************************************
2640 *
2641 *     Func : cmPkRgSchUlAllocCntrl
2642 *
2643 *
2644 *     Desc :   This structure holds MAC's Debug Control information.
2645 *
2646 *
2647 *     Ret  : S16
2648 *
2649 *     Notes:
2650 *
2651 *     File  : 
2652 *
2653 **********************************************************/
2654 S16 cmPkRgSchUlAllocCntrl
2655 (
2656 RgSchUlAllocCntrl *param,
2657 Buffer *mBuf
2658 )
2659 {
2660
2661    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
2662    CMCHKPK(oduUnpackUInt16, param->numOfRb, mBuf);
2663    CMCHKPK(oduUnpackUInt16, param->rbStart, mBuf);
2664    CMCHKPK(oduUnpackUInt8, param->testStart, mBuf);
2665    CMCHKPK(oduUnpackUInt8, param->enaLog, mBuf);
2666    CMCHKPK(oduUnpackUInt16, param->logTime, mBuf);
2667
2668    return ROK;
2669 }
2670
2671 /***********************************************************
2672 *
2673 *     Func : cmUnpkRgSchUlAllocCntrl
2674 *
2675 *
2676 *     Desc :   This structure holds MAC's Scheduler Configuration for Ul Allocation.
2677 *
2678 *
2679 *     Ret  : S16
2680 *
2681 *     Notes:
2682 *
2683 *     File  : 
2684 *
2685 **********************************************************/
2686 S16 cmUnpkRgSchUlAllocCntrl
2687 (
2688 RgSchUlAllocCntrl *param,
2689 Buffer *mBuf
2690 )
2691 {
2692
2693    CMCHKUNPK(oduPackUInt16, &param->logTime, mBuf);
2694    CMCHKUNPK(oduPackUInt8, &param->enaLog, mBuf);
2695    CMCHKUNPK(oduPackUInt8, &param->testStart, mBuf);
2696    CMCHKUNPK(oduPackUInt16, &param->rbStart, mBuf);
2697    CMCHKUNPK(oduPackUInt16, &param->numOfRb, mBuf);   
2698    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
2699
2700    return ROK;
2701 }
2702
2703
2704 #endif
2705 \f
2706 /***********************************************************
2707 *
2708 *     Func : cmUnpkRgDbgCntrl
2709 *
2710 *
2711 *     Desc :   This structure holds MAC's Debug Control information.
2712 *
2713 *
2714 *     Ret  : S16
2715 *
2716 *     Notes:
2717 *
2718 *     File  : 
2719 *
2720 **********************************************************/
2721 S16 cmUnpkRgDbgCntrl
2722 (
2723 RgDbgCntrl *param,
2724 Buffer *mBuf
2725 )
2726 {
2727
2728    CMCHKUNPK(oduPackUInt32, &param->dbgMask, mBuf);
2729    return ROK;
2730 }
2731
2732
2733 \f
2734 /***********************************************************
2735 *
2736 *     Func : cmPkRgSapCntrl
2737 *
2738 *
2739 *     Desc :   This structure holds MAC's SAP Control information.
2740 *
2741 *
2742 *     Ret  : S16
2743 *
2744 *     Notes:
2745 *
2746 *     File  : 
2747 *
2748 **********************************************************/
2749 S16 cmPkRgSapCntrl
2750 (
2751 RgSapCntrl *param,
2752 Buffer *mBuf
2753 )
2754 {
2755
2756    CMCHKPK(SPkS16, param->spId, mBuf);
2757    CMCHKPK(SPkS16, param->suId, mBuf);
2758    return ROK;
2759 }
2760
2761
2762 \f
2763 /***********************************************************
2764 *
2765 *     Func : cmUnpkRgSapCntrl
2766 *
2767 *
2768 *     Desc :   This structure holds MAC's SAP Control information.
2769 *
2770 *
2771 *     Ret  : S16
2772 *
2773 *     Notes:
2774 *
2775 *     File  : 
2776 *
2777 **********************************************************/
2778 S16 cmUnpkRgSapCntrl
2779 (
2780 RgSapCntrl *param,
2781 Buffer *mBuf
2782 )
2783 {
2784
2785    CMCHKUNPK(SUnpkS16, &param->suId, mBuf);
2786    CMCHKUNPK(SUnpkS16, &param->spId, mBuf);
2787    return ROK;
2788 }
2789
2790
2791 \f
2792 /***********************************************************
2793 *
2794 *     Func : cmPkRgCntrl
2795 *
2796 *
2797 *     Desc :   This structure holds MAC's Control information.
2798 *
2799 *
2800 *     Ret  : S16
2801 *
2802 *     Notes:
2803 *
2804 *     File  : 
2805 *
2806 **********************************************************/
2807 S16 cmPkRgCntrl
2808 (
2809 RgCntrl *param,
2810 S16 elmnt,
2811 Buffer *mBuf
2812 )
2813 {
2814
2815
2816       switch(elmnt) {
2817          case STTFUSAP:
2818          case STRGUSAP:
2819          case STRGRSAP:
2820          case STCRGSAP:
2821             switch(param->subAction) {
2822                default :
2823                   CMCHKPK(cmPkRgSapCntrl, &param->s.rgSapCntrl, mBuf);
2824                   break;
2825             }
2826          break;
2827          case STGEN:
2828             switch(param->subAction) {
2829                case SATRC:
2830                   CMCHKPK(SPkS16, param->s.trcLen, mBuf);
2831                   break;
2832                case SADBG:
2833                   CMCHKPK(cmPkRgDbgCntrl, &param->s.rgDbgCntrl, mBuf);
2834                   break;
2835                case SAUSTA:
2836                   break;
2837 #ifdef SS_DIAG
2838                case SALOG:
2839                   CMCHKPK(oduUnpackUInt32,  param->s.logMask, mBuf);
2840                   break;
2841 #endif
2842 #ifdef PHY_ERROR_LOGING
2843                case SAELMNT:
2844              CMCHKPK(cmPkRgSchUlAllocCntrl, &param->s.rgSchUlAllocCntrl, mBuf);
2845                   break;
2846 #endif                     
2847                default :
2848                   break;
2849             }
2850             break;
2851          default :
2852             break;
2853       }
2854    CMCHKPK(oduUnpackUInt8, param->subAction, mBuf);
2855    CMCHKPK(oduUnpackUInt8, param->action, mBuf);
2856    CMCHKPK(cmPkDateTime, &param->dt, mBuf);
2857    return ROK;
2858 }
2859
2860
2861 \f
2862 /***********************************************************
2863 *
2864 *     Func : cmUnpkRgCntrl
2865 *
2866 *
2867 *     Desc :   This structure holds MAC's Control information.
2868 *
2869 *
2870 *     Ret  : S16
2871 *
2872 *     Notes:
2873 *
2874 *     File  : 
2875 *
2876 **********************************************************/
2877 S16 cmUnpkRgCntrl
2878 (
2879 RgCntrl *param,
2880 S16 elmnt,
2881 Buffer *mBuf
2882 )
2883 {
2884
2885
2886    CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
2887    CMCHKUNPK(oduPackUInt8, &param->action, mBuf);
2888    CMCHKUNPK(oduPackUInt8, &param->subAction, mBuf);
2889    switch(elmnt) {
2890       case STGEN:
2891          switch(param->subAction) {
2892             case SADBG:
2893                CMCHKUNPK(cmUnpkRgDbgCntrl, &param->s.rgDbgCntrl, mBuf);
2894                break;
2895             case SATRC:
2896                CMCHKUNPK(SUnpkS16, &param->s.trcLen, mBuf);
2897                break;
2898             case SAUSTA:
2899                break;
2900 #ifdef SS_DIAG
2901             case SALOG:
2902                CMCHKUNPK(oduPackUInt32, &param->s.logMask, mBuf);
2903                break;
2904 #endif
2905 #ifdef PHY_ERROR_LOGING
2906             case SAELMNT:
2907                CMCHKUNPK(cmUnpkRgSchUlAllocCntrl, &param->s.rgSchUlAllocCntrl, mBuf);
2908                break;
2909 #endif                     
2910             default :
2911                break;
2912          }
2913          break;
2914       case STTFUSAP:
2915       case STRGUSAP:
2916       case STRGRSAP:
2917       case STCRGSAP:
2918          switch(param->subAction) {
2919             default :
2920                CMCHKUNPK(cmUnpkRgSapCntrl, &param->s.rgSapCntrl, mBuf);
2921                break;
2922          }
2923          break;
2924       default :
2925          break;
2926       }
2927    return ROK;
2928 }
2929
2930
2931 \f
2932 /***********************************************************
2933 *
2934 *     Func : cmPkRgMngmt
2935 *
2936 *
2937 *     Desc :   This structure holds MAC's Configuration and Control Management Information.
2938 *
2939 *
2940 *     Ret  : S16
2941 *
2942 *     Notes:
2943 *
2944 *     File  : 
2945 *
2946 **********************************************************/
2947 S16 cmPkRgMngmt
2948 (
2949 Pst *pst,
2950 RgMngmt *param,
2951 uint8_t eventType,
2952 Buffer *mBuf
2953 )
2954 {
2955
2956
2957       switch(eventType) {
2958          case EVTLRGCNTRLREQ:
2959          case  EVTLRGCNTRLCFM:
2960          case EVTLRGSCHCNTRLREQ:
2961          case  EVTLRGSCHCNTRLCFM:
2962             if(cmPkRgCntrl(&param->t.cntrl, param->hdr.elmId.elmnt, mBuf) != ROK)
2963                return RFAILED;
2964             break;
2965          case EVTLRGTRCIND:
2966             CMCHKPK(cmPkRgTrc, &param->t.trc, mBuf);
2967             break;
2968          case EVTLRGUSTAIND:
2969          case EVTLRGSCHSTAIND:
2970             CMCHKPK(cmPkRgUsta, &param->t.usta, mBuf);
2971             break;
2972          case EVTLRGSSTAREQ:
2973          case  EVTLRGSSTACFM:
2974             /*ccpu00118255 - ADD - eventType param */
2975 #ifdef LRG_V1
2976             if(cmPkRgSsta(pst, &param->t.ssta, param->hdr.elmId.elmnt,
2977                      eventType, mBuf) != ROK)
2978                return RFAILED;
2979 #else /* LRG_V1 is not defined */
2980             if(cmPkRgSsta(pst, &param->t.ssta, param->hdr.elmId.elmnt, mBuf) != ROK)
2981                return RFAILED;
2982 #endif /* end of LRG_V1*/            
2983             break;
2984          case EVTLRGSTSREQ:
2985          case  EVTLRGSTSCFM:
2986             if(cmPkRgSts(&param->t.sts, param->hdr.elmId.elmnt, mBuf)!= ROK)
2987                return RFAILED;
2988             break;
2989          case EVTLRGCFGREQ:
2990          case  EVTLRGCFGCFM:
2991             if(cmPkRgCfg(&param->t.cfg, param->hdr.elmId.elmnt, mBuf) != ROK)
2992                return RFAILED;
2993             break;
2994          case EVTMACSCHGENCFGREQ:
2995          case  EVTMACSCHGENCFGCFM:
2996             if(cmPkRgCfg(&param->t.cfg, param->hdr.elmId.elmnt, mBuf) != ROK)
2997                return RFAILED;
2998             break;
2999          default :
3000             return RFAILED;
3001       }
3002    CMCHKPK(cmPkCmStatus, &param->cfm, mBuf);
3003    CMCHKPK(cmPkHeader, &param->hdr, mBuf);
3004    return ROK;
3005 }
3006
3007
3008 \f
3009 /***********************************************************
3010 *
3011 *     Func : cmUnpkRgMngmt
3012 *
3013 *
3014 *     Desc :   This structure holds MAC's Configuration and Control Management Information.
3015 *
3016 *
3017 *     Ret  : S16
3018 *
3019 *     Notes:
3020 *
3021 *     File  : 
3022 *
3023 **********************************************************/
3024 S16 cmUnpkRgMngmt
3025 (
3026 Pst *pst,
3027 RgMngmt *param,
3028 uint8_t eventType,
3029 Buffer *mBuf
3030 )
3031 {
3032
3033
3034    CMCHKUNPK(cmUnpkHeader, &param->hdr, mBuf);
3035    CMCHKUNPK(cmUnpkCmStatus, &param->cfm, mBuf);
3036    switch(eventType) {
3037       case EVTLRGCFGREQ:
3038       case  EVTLRGCFGCFM:
3039       case EVTMACSCHGENCFGREQ:
3040       case  EVTMACSCHGENCFGCFM:
3041          if(cmUnpkRgCfg(&param->t.cfg, param->hdr.elmId.elmnt, mBuf) != ROK)
3042             return RFAILED;
3043          break;
3044       case EVTLRGSTSREQ:
3045       case  EVTLRGSTSCFM:
3046          if(cmUnpkRgSts(&param->t.sts, param->hdr.elmId.elmnt, mBuf) != ROK)
3047             return RFAILED;
3048          break;
3049       case EVTLRGSSTAREQ:
3050       case  EVTLRGSSTACFM:
3051          if(cmUnpkRgSsta(pst, &param->t.ssta, param->hdr.elmId.elmnt, mBuf) != ROK)
3052             return RFAILED;
3053          break;
3054       case EVTLRGUSTAIND:
3055       case EVTLRGSCHSTAIND:
3056          CMCHKUNPK(cmUnpkRgUsta, &param->t.usta, mBuf);
3057          break;
3058       case EVTLRGTRCIND:
3059          CMCHKUNPK(cmUnpkRgTrc, &param->t.trc, mBuf);
3060          break;
3061       case EVTLRGCNTRLREQ:
3062       case  EVTLRGCNTRLCFM:
3063       case EVTLRGSCHCNTRLREQ:
3064       case  EVTLRGSCHCNTRLCFM:
3065          if(cmUnpkRgCntrl(&param->t.cntrl, param->hdr.elmId.elmnt, mBuf) != ROK)
3066             return RFAILED;
3067          break;
3068       default :
3069          return RFAILED;
3070       }
3071    return ROK;
3072 }
3073
3074 /* lrg_c_001.main_3 - ADD -  Added the functions pertaining to LTE_L2_MEAS  */
3075 #ifdef LTE_L2_MEAS
3076 \f
3077 /**
3078 * @brief This API is used to pack 
3079  LrgNmbActvUeQCI elements
3080 *
3081 * @details
3082 *
3083 *     Function: cmPkNmbActvUeQciReq
3084 *
3085 *  @param[in]   LrgNmbActvUeQCI
3086 *  @param[in]   Buffer   *mBuf
3087 *  @return   S16
3088 *      -# ROK
3089 **/
3090 static S16  cmPkNmbActvUeQciReq
3091 (
3092 LrgNmbActvUeQCI   *nmbActvUeQci, 
3093 Buffer        *mBuf
3094 )
3095 {
3096    uint8_t      idx;
3097
3098    
3099    for(idx = 0; idx < nmbActvUeQci->numQci; idx++)
3100    {
3101        CMCHKPK(oduUnpackUInt8, nmbActvUeQci->qci[idx], mBuf);
3102    }
3103    CMCHKPK(oduUnpackUInt8, nmbActvUeQci->numQci, mBuf);
3104    CMCHKPK(oduUnpackUInt8, nmbActvUeQci->sampPrd, mBuf);
3105    return ROK;
3106 }
3107 \f
3108 /**
3109 * @brief This API is used to pack 
3110  LrgAvgPrbQci elements
3111 *
3112 * @details
3113 *
3114 *     Function: cmPkAvgPrbQciReq
3115 *
3116 *  @param[in]   LrgNmbActvUeQciReq  *avgPrbQciReq
3117 *  @param[in]   Buffer   *mBuf
3118 *  @return   S16
3119 *      -# ROK
3120 **/
3121 static S16  cmPkAvgPrbQciReq
3122 (
3123 LrgAvgPrbQCI  *avgPrbQciReq,
3124 Buffer        *mBuf
3125 )
3126 {
3127    uint8_t      idx;
3128
3129    for(idx = 0; idx < avgPrbQciReq->numQci; idx++)
3130    {
3131        CMCHKPK(oduUnpackUInt8, avgPrbQciReq->qci[idx], mBuf);
3132    }
3133    CMCHKPK(oduUnpackUInt8, avgPrbQciReq->numQci, mBuf);
3134    return ROK;
3135
3136 }
3137 \f
3138 /**
3139 * @brief This API is used to send a 
3140 L2 Measurement Request from LM to MAC.
3141 *
3142 * @details
3143 *
3144 *     Function: cmPkLrgSchL2MeasReq
3145 *
3146 *  @param[in]   Pst *  pst
3147 *  @param[in]   LrgSchMeasReqInfo  *  measInfo
3148 *  @return   S16
3149 *      -# ROK
3150 **/
3151 S16 cmPkLrgSchL2MeasReq
3152 (
3153 Pst * pst,
3154 LrgSchMeasReqInfo  *measInfo
3155 )
3156 {
3157    Buffer *mBuf = NULLP;
3158
3159    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3160 #if (ERRCLASS & ERRCLS_ADD_RES)
3161       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3162          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3163          (ErrVal)ELRG049, (ErrVal)0, "SGetMsg failed");
3164 #endif
3165       return RFAILED;
3166    }
3167    if(measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
3168    {
3169       CMCHKPK(cmPkNmbActvUeQciReq, &measInfo->nmbActvUeQciDl, mBuf);
3170    }
3171    if(measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
3172    {
3173       CMCHKPK(cmPkNmbActvUeQciReq, &measInfo->nmbActvUeQciUl, mBuf);
3174    }
3175    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
3176    {
3177       CMCHKPK(cmPkAvgPrbQciReq, &measInfo->avgPrbQciDl, mBuf);
3178    }
3179    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL)
3180    {
3181       CMCHKPK(cmPkAvgPrbQciReq, &measInfo->avgPrbQciUl, mBuf);
3182    }
3183
3184    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
3185    CMCHKPK(oduUnpackUInt32, measInfo->timePrd, mBuf);
3186    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
3187    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
3188    pst->event = (Event) EVTLRGSCHL2MEASREQ;
3189    return (SPstTsk(pst,mBuf));
3190 }
3191 /**
3192 * @brief This API is used to stop a 
3193 L2 Measurement Request from LM to MAC.
3194 *
3195 * @details
3196 *
3197 *     Function: cmPkLrgSchL2MeasStopReq
3198 *
3199 *  @param[in]   Pst *  pst
3200 *  @param[in]   LrgSchMeasReqInfo  *  measInfo
3201 *  @return   S16
3202 *      -# ROK
3203 **/
3204 S16 cmPkLrgSchL2MeasStopReq
3205 (
3206 Pst * pst,
3207 LrgSchMeasStopReqInfo *measInfo
3208 )
3209 {
3210    Buffer *mBuf = NULLP;
3211
3212  if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3213 #if (ERRCLASS & ERRCLS_ADD_RES)
3214       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3215          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3216          (ErrVal)ELRG049, (ErrVal)0, "SGetMsg failed");
3217 #endif
3218       return RFAILED;
3219    }
3220    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
3221    /*CMCHKPK(oduUnpackUInt16, measInfo->timePrd, mBuf);*/
3222    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
3223    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
3224    pst->event = (Event) EVTLRGSCHL2MEASSTOPREQ;
3225    return (SPstTsk(pst,mBuf));
3226 }/*cmPkLrgSchL2MeasStopReq*/
3227
3228 /**
3229 * @brief This API is used to send a 
3230 L2 Measurement Request from LM to MAC.
3231 *
3232 * @details
3233 *
3234 *     Function: cmPkLrgSchL2MeasSendReq
3235 *
3236 *  @param[in]   Pst *  pst
3237 *  @param[in]   LrgSchMeasReqInfo  *  measInfo
3238 *  @return   S16
3239 *      -# ROK
3240 **/
3241 S16 cmPkLrgSchL2MeasSendReq
3242 (
3243 Pst * pst,
3244 LrgSchMeasSndReqInfo *measInfo
3245 )
3246 {
3247    Buffer *mBuf = NULLP;
3248    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3249 #if (ERRCLASS & ERRCLS_ADD_RES)
3250       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3251          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3252          (ErrVal)ELRG049, (ErrVal)0, "SGetMsg failed");
3253 #endif
3254       return RFAILED;
3255    }
3256    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
3257    CMCHKPK(oduUnpackUInt32, measInfo->timePrd, mBuf);
3258    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
3259    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
3260    pst->event = (Event) EVTLRGSCHL2MEASSENDREQ;
3261    return (SPstTsk(pst,mBuf));
3262 }/*cmPkLrgSchL2MeasSendReq*/
3263 \f
3264 /**
3265 * @brief This API is used to unpack AvgPrbQciReq
3266 *
3267 * @details
3268 *
3269 *     Function: cmUnpkNmbActvUeQciReq
3270 *
3271 *  @param[in]   LrgNmbActvUeQCI     *param
3272 *  @param[in]   Buffer * mBuf
3273 *  @return   S16
3274 *      -# ROK
3275 **/
3276 static S16 cmUnpkNmbActvUeQciReq
3277 (
3278 LrgNmbActvUeQCI  *param,
3279 Buffer           *mBuf
3280 )
3281 {
3282    uint8_t     idx;
3283
3284    CMCHKUNPK(oduPackUInt8, &param->sampPrd, mBuf);
3285    CMCHKUNPK(oduPackUInt8, &param->numQci, mBuf);
3286    for(idx = param->numQci; idx > 0; idx--)
3287    {
3288       CMCHKUNPK(oduPackUInt8, &param->qci[idx - 1], mBuf);
3289    }
3290
3291    return ROK;
3292 }
3293 \f
3294 /**
3295 * @brief This API is used to unpack AvgPrbQciReq
3296 *
3297 * @details
3298 *
3299 *     Function: cmUnpkAvgPrbQciReq
3300 *
3301 *  @param[in]   LrgAvgPrbQCI     *param
3302 *  @param[in]   Buffer * mBuf
3303 *  @return   S16
3304 *      -# ROK
3305 **/
3306 static S16 cmUnpkAvgPrbQciReq
3307 (
3308 LrgAvgPrbQCI     *param,
3309 Buffer           *mBuf
3310 )
3311 {
3312    uint8_t     idx;
3313
3314
3315    CMCHKUNPK(oduPackUInt8, &param->numQci, mBuf);
3316    for(idx = param->numQci; idx > 0; idx--)
3317    {
3318       CMCHKUNPK(oduPackUInt8, &param->qci[idx - 1], mBuf);
3319    }
3320    return ROK;
3321
3322 }
3323 \f
3324 /**
3325 * @brief This API is used to send a 
3326 Measurement  Request from LM to SCH.
3327 *
3328 * @details
3329 *
3330 *     Function: cmUnpkLrgSchL2MeasReq
3331 *
3332 *  @param[in]   LrgSchMeasReq func
3333 *  @param[in]   Pst *  pst
3334 *  @param[in]   Buffer * mBuf
3335 *  @return   S16
3336 *      -# ROK
3337 **/
3338 S16 cmUnpkLrgSchL2MeasReq
3339 (
3340 LrgSchL2MeasReq func,
3341 Pst *pst,
3342 Buffer *mBuf
3343 )
3344 {
3345    LrgSchMeasReqInfo  measInfo;
3346
3347
3348    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
3349    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
3350    CMCHKUNPK(oduPackUInt32, &measInfo.timePrd, mBuf);
3351    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
3352    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL)
3353    {
3354       CMCHKUNPK(cmUnpkAvgPrbQciReq, &measInfo.avgPrbQciUl, mBuf);
3355    }
3356    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
3357    {
3358       CMCHKUNPK(cmUnpkAvgPrbQciReq, &measInfo.avgPrbQciDl, mBuf);
3359    }
3360    if(measInfo.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
3361    {
3362       CMCHKUNPK(cmUnpkNmbActvUeQciReq, &measInfo.nmbActvUeQciUl, mBuf);
3363    }
3364    if(measInfo.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
3365    {
3366       CMCHKUNPK(cmUnpkNmbActvUeQciReq, &measInfo.nmbActvUeQciDl, mBuf);
3367    }
3368    SPutMsg(mBuf);
3369    return ((*func)(pst, &measInfo));
3370 }
3371
3372 /**
3373 * @brief This API is used to stop  a 
3374 Measurement  Request from LM to SCH.
3375 *
3376 * @details
3377 *
3378 *     Function: cmUnpkLrgSchL2MeasStopReq
3379 *
3380 *  @param[in]   LrgSchMeasStopReq func
3381 *  @param[in]   Pst *  pst
3382 *  @param[in]   Buffer * mBuf
3383 *  @return   S16
3384 *      -# ROK
3385 **/
3386 S16 cmUnpkLrgSchL2MeasStopReq
3387 (
3388 LrgSchL2MeasStopReq func,
3389 Pst *pst,
3390 Buffer *mBuf
3391 )
3392 {
3393    LrgSchMeasStopReqInfo measInfo;
3394
3395    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
3396    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
3397    /*CMCHKUNPK(oduPackUInt16, &measInfo.timePrd, mBuf);*/
3398    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
3399    SPutMsg(mBuf);
3400    return ((*func)(pst, &measInfo));
3401 }/*cmUnpkLrgSchL2MeasStopReq*/
3402
3403 /**
3404 * @brief This API is used to send a 
3405 Measurement  Request from LM to SCH.
3406 *
3407 * @details
3408 *
3409 *     Function: cmUnpkLrgSchL2MeasSendReq
3410 *
3411 *  @param[in]   LrgSchMeasSendReq func
3412 *  @param[in]   Pst *  pst
3413 *  @param[in]   Buffer * mBuf
3414 *  @return   S16
3415 *      -# ROK
3416 **/
3417 S16 cmUnpkLrgSchL2MeasSendReq
3418 (
3419 LrgSchL2MeasSendReq func,
3420 Pst *pst,
3421 Buffer *mBuf
3422 )
3423 {
3424    LrgSchMeasSndReqInfo measInfo;
3425    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
3426    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
3427    CMCHKUNPK(oduPackUInt32, &measInfo.timePrd, mBuf);
3428    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
3429    SPutMsg(mBuf);
3430    return ((*func)(pst, &measInfo));
3431 }/*cmUnpkLrgSchL2MeasSendReq*/
3432
3433 /**
3434 * @brief This API is used to stop a 
3435 L2 Measurement confirm from MAC to LM
3436 *
3437 * @details
3438 *
3439 *     Function: cmPkLrgSchL2MeasStopCfm
3440 *
3441 *  @param[in]   Pst *  pst
3442 *  @param[in]   LrgSchMeasCfmInfo  *  measInfo
3443 *  @return   S16
3444 *      -# ROK
3445 **/
3446 S16 cmPkLrgSchL2MeasStopCfm
3447 (
3448 Pst * pst,
3449 LrgSchMeasCfmInfo  *measInfo
3450 )
3451 {
3452    Buffer *mBuf = NULLP;
3453
3454    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3455 #if (ERRCLASS & ERRCLS_ADD_RES)
3456       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3457          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3458          (ErrVal)ELRG050, (ErrVal)0, "SGetMsg failed");
3459 #endif
3460       return RFAILED;
3461    }
3462    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
3463    CMCHKPK(cmPkCmStatus, &measInfo->cfm, mBuf);
3464    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
3465    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
3466    pst->event = (Event) EVTLRGSCHL2MEASSTOPCFM;
3467    return (SPstTsk(pst,mBuf));
3468 }/*cmPkLrgSchL2MeasStopCfm*/
3469 /**
3470 * @brief This API is used to Send a 
3471 Measurement  Confirm from SCH to LM.
3472 *
3473 * @details
3474 *
3475 *     Function: cmUnpkLrgL2SchMeasCfm
3476 *
3477 *  @param[in]   Pst *  pst
3478 *  @param[in]   Buffer * mBuf
3479 *  @return   S16
3480 *      -# ROK
3481 **/
3482 S16 cmUnpkLrgSchL2MeasStopCfm
3483 (
3484 LrgSchL2MeasStopCfm func,
3485 Pst *pst,
3486 Buffer *mBuf
3487 )
3488 {
3489    LrgSchMeasCfmInfo  measInfo;
3490
3491
3492    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
3493    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
3494    CMCHKUNPK(cmUnpkCmStatus, &measInfo.cfm, mBuf);
3495    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
3496
3497    SPutMsg(mBuf);
3498    return ((*func)(pst, &measInfo));
3499 }/*cmUnpkLrgSchL2MeasStopCfm*/
3500 \f
3501 /**
3502 * @brief This API is used to unpack LrgNumActvUeQCICfm structure
3503 *
3504 * @details
3505 *
3506 *     Function: cmPkNumUeQciCfm 
3507 *
3508 *  @param[in]   LrgNumActvUeQCICfm *  param
3509 *  @param[in]   Buffer *  mBuf
3510 *  @return   S16
3511 *      -# ROK
3512 **/
3513 static S16 cmPkNumUeQciCfm
3514 (
3515 LrgNumActvUeQCICfm  *param,
3516 Buffer              *mBuf
3517 )
3518 {
3519    uint8_t         idx;
3520
3521    
3522    for(idx = 0; idx < param->numQci; idx++)
3523    {
3524 /*LRG : Review Tag*/
3525      CMCHKPK(oduUnpackUInt8, param->numActvUeQci[idx].qciValue, mBuf);
3526      CMCHKPK(oduUnpackUInt8, param->numActvUeQci[idx].numActvUeQci, mBuf);
3527 /*LRG : Review Tag*/
3528    }
3529    CMCHKPK(oduUnpackUInt8, param->numQci, mBuf);
3530    return ROK;
3531 }
3532 \f
3533 /**
3534 * @brief This API is used to unpack LrgAvgPrbQCICfm structure
3535 *
3536 * @details
3537 *
3538 *     Function: cmPkAvgPrbQciCfm
3539 *
3540 *  @param[in]   LrgAvgPrbQCICfm *  param
3541 *  @param[in]   Buffer *  mBuf
3542 *  @return   S16
3543 *      -# ROK
3544 **/
3545 static S16 cmPkAvgPrbQciCfm
3546 (
3547 LrgAvgPrbQCICfm    *param,
3548 Buffer             *mBuf
3549 )
3550 {
3551    uint8_t         idx;
3552
3553    for(idx = 0; idx < param->numQci; idx++)
3554    {
3555 /*LRG : Review Tag*/
3556       CMCHKPK(oduUnpackUInt8, param->prbPercQci[idx].qciValue, mBuf);
3557       CMCHKPK(oduUnpackUInt8, param->prbPercQci[idx].prbPercQci, mBuf);
3558 /*LRG : Review Tag*/
3559    } 
3560    CMCHKPK(oduUnpackUInt8, param->numQci, mBuf);
3561    return ROK;
3562 }
3563 \f
3564 /**
3565 * @brief This API is used to unpack raPreamblesCfm structure
3566 *
3567 * @details
3568 *
3569 *     Function: cmPkRaPrmbsCfm
3570 *
3571 *  @param[in]   LrgRaPreamblesCfm *  param
3572 *  @param[in]   Buffer *  mBuf
3573 *  @return   S16
3574 *      -# ROK
3575 **/
3576 static S16 cmPkRaPrmbsCfm
3577 (
3578 LrgRaPreamblesCfm  *param,
3579 Buffer             *mBuf
3580 )
3581 {
3582
3583    CMCHKPK(oduUnpackUInt16, param->randSelPreHighRange, mBuf);
3584    CMCHKPK(oduUnpackUInt16, param->randSelPreLowRange, mBuf);
3585    CMCHKPK(oduUnpackUInt16, param->dedPreambles, mBuf);
3586    return ROK;
3587 }
3588 \f
3589 /**
3590 * @brief This API is used to unpack avgPrbCfm structure
3591 *
3592 * @details
3593 *
3594 *     Function: cmPkAvgPrbCfm
3595 *
3596 *  @param[in]   LrgAvgPrbCfm *  param
3597 *  @param[in]   Buffer *  mBuf
3598 *  @return   S16
3599 *      -# ROK
3600 **/
3601 static S16 cmPkAvgPrbCfm 
3602 (
3603 LrgAvgPrbCfm  *param,
3604 Buffer        *mBuf
3605 )
3606 {
3607
3608    CMCHKPK(oduUnpackUInt8, param->prbPerc, mBuf);
3609    return ROK;
3610 }
3611 \f
3612 /**
3613 * @brief This API is used to send a 
3614 L2 Measurement confirm from MAC to LM
3615 *
3616 * @details
3617 *
3618 *     Function: cmPkLrgSchL2MeasCfm
3619 *
3620 *  @param[in]   Pst *  pst
3621 *  @param[in]   LrgSchMeasCfmInfo  *  measInfo
3622 *  @return   S16
3623 *      -# ROK
3624 **/
3625 S16 cmPkLrgSchL2MeasCfm
3626 (
3627 Pst * pst,
3628 LrgSchMeasCfmInfo  *measInfo
3629 )
3630 {
3631    Buffer *mBuf = NULLP;
3632
3633
3634    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3635 #if (ERRCLASS & ERRCLS_ADD_RES)
3636       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3637          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3638          (ErrVal)ELRG050, (ErrVal)0, "SGetMsg failed");
3639 #endif
3640       return RFAILED;
3641    }
3642    if(measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
3643    {
3644      CMCHKPK(cmPkNumUeQciCfm, &measInfo->numUeQciDlCfm, mBuf);
3645    }
3646    if(measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
3647    {
3648      CMCHKPK(cmPkNumUeQciCfm, &measInfo->numUeQciUlCfm, mBuf);
3649    }
3650    if(measInfo->measType & LRG_L2MEAS_RA_PREAMBLE)
3651    {
3652      CMCHKPK(cmPkRaPrmbsCfm, &measInfo->raPrmbsCfm, mBuf);
3653    }
3654    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
3655    {
3656      CMCHKPK(cmPkAvgPrbQciCfm, &measInfo->avgPrbQciDlCfm, mBuf);
3657    }
3658    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL)
3659    {
3660      CMCHKPK(cmPkAvgPrbQciCfm, &measInfo->avgPrbQciUlCfm, mBuf);
3661    }
3662    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_DL)
3663    {
3664      CMCHKPK(cmPkAvgPrbCfm, &measInfo->avgPrbDl, mBuf);
3665    }
3666    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_UL)
3667    {
3668      CMCHKPK(cmPkAvgPrbCfm, &measInfo->avgPrbUl, mBuf);
3669    }
3670    if(measInfo->measType & LRG_L2MEAS_TB_TRANS_DL_COUNT)
3671    {
3672       CMCHKPK(oduUnpackUInt32, measInfo->tbTransDlTotalCnt, mBuf);
3673    }   
3674    if(measInfo->measType & LRG_L2MEAS_TB_TRANS_DL_FAULTY_COUNT)
3675    {
3676       CMCHKPK(oduUnpackUInt32, measInfo->tbTransDlFaulty, mBuf);
3677    }   
3678    if(measInfo->measType & LRG_L2MEAS_TB_TRANS_UL_COUNT)
3679    {
3680       CMCHKPK(oduUnpackUInt32, measInfo->tbTransUlTotalCnt, mBuf);
3681    }   
3682    if(measInfo->measType & LRG_L2MEAS_TB_TRANS_UL_FAULTY_COUNT)
3683    {
3684       CMCHKPK(oduUnpackUInt32, measInfo->tbTransUlFaulty, mBuf);
3685    }   
3686    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
3687    CMCHKPK(cmPkCmStatus, &measInfo->cfm, mBuf);
3688    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
3689    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
3690    pst->event = (Event) EVTLRGSCHL2MEASCFM;
3691    return (SPstTsk(pst,mBuf));
3692 }
3693 \f
3694 /**
3695 * @brief This API is used to unpack LrgNumActvUeQCICfm
3696 *
3697 * @details
3698 *
3699 *     Function: cmUnpkNumUeQciCfm
3700 *
3701 *  @param[in]   LrgNumActvUeQCICfm *param
3702 *  @param[in]   Buffer * mBuf
3703 *  @return   Void
3704 *      -# ROK
3705 **/
3706 static S16 cmUnpkNumUeQciCfm
3707 (
3708 LrgNumActvUeQCICfm *param,
3709 Buffer          *mBuf
3710 )
3711 {
3712    uint8_t          idx;
3713
3714    CMCHKUNPK(oduPackUInt8, &param->numQci, mBuf);
3715    for(idx = param->numQci; idx > 0; idx--)
3716    {
3717 /*LRG : Review Tag*/
3718        CMCHKUNPK(oduPackUInt8, &param->numActvUeQci[idx - 1].numActvUeQci, mBuf);
3719        CMCHKUNPK(oduPackUInt8, &param->numActvUeQci[idx - 1].qciValue, mBuf);
3720 /*LRG : Review Tag*/
3721    }
3722    return ROK;
3723 }
3724 \f
3725 /**
3726 * @brief This API is used to unpack LrgAvgPrbQCICfm
3727 *
3728 * @details
3729 *
3730 *     Function: cmUnpkAvgPrbQciCfm
3731 *
3732 *  @param[in]   LrgAvgPrbQCICfm *param
3733 *  @param[in]   Buffer * mBuf
3734 *  @return  Void 
3735 *      -# ROK
3736 **/
3737 static S16 cmUnpkAvgPrbQciCfm
3738 (
3739 LrgAvgPrbQCICfm *param,
3740 Buffer          *mBuf
3741 )
3742 {
3743    uint8_t          idx;
3744
3745
3746    CMCHKUNPK(oduPackUInt8, &param->numQci, mBuf);
3747    for(idx = param->numQci; idx > 0; idx--)
3748    {
3749 /*LRG : Review Tag*/
3750       CMCHKUNPK(oduPackUInt8, &param->prbPercQci[idx - 1].prbPercQci, mBuf);
3751       CMCHKUNPK(oduPackUInt8, &param->prbPercQci[idx - 1].qciValue, mBuf);
3752 /*LRG : Review Tag*/
3753    }
3754    return ROK;
3755 }
3756 \f
3757 /**
3758 * @brief This API is used to unpack LrgRaPreamblesCfm
3759 *
3760 * @details
3761 *
3762 *     Function: cmUnpkRaPrmbsCfm
3763 *
3764 *  @param[in]   LrgRaPreamblesCfm *param
3765 *  @param[in]   Buffer * mBuf
3766 *  @return   Void
3767 *      -# ROK
3768 **/
3769 static S16 cmUnpkRaPrmbsCfm
3770 (
3771 LrgRaPreamblesCfm *param,
3772 Buffer         *mBuf
3773 )
3774 {
3775
3776
3777    CMCHKUNPK(oduPackUInt16, &param->dedPreambles, mBuf);
3778    CMCHKUNPK(oduPackUInt16, &param->randSelPreLowRange, mBuf);
3779    CMCHKUNPK(oduPackUInt16, &param->randSelPreHighRange, mBuf);
3780    return ROK;
3781 }
3782 \f
3783 /**
3784 * @brief This API is used to unpack avgPrbCfm
3785 *
3786 * @details
3787 *
3788 *     Function: cmUnpkAvgPrbCfm
3789 *
3790 *  @param[in]   LrgAvgPrbCfm  *param
3791 *  @param[in]   Buffer * mBuf
3792 *  @return   Void
3793 *      -# ROK
3794 **/
3795 static S16 cmUnpkAvgPrbCfm
3796 (
3797 LrgAvgPrbCfm   *param, 
3798 Buffer         *mBuf
3799 )
3800 {
3801
3802
3803    CMCHKUNPK(oduPackUInt8, &param->prbPerc, mBuf);
3804    return ROK;
3805 }
3806 \f
3807 /**
3808 * @brief This API is used to send a 
3809 Measurement  Confirm from LM to SCH.
3810 *
3811 * @details
3812 *
3813 *     Function: cmUnpkLrgL2SchMeasCfm
3814 *
3815 *  @param[in]   Pst *  pst
3816 *  @param[in]   Buffer * mBuf
3817 *  @return   S16
3818 *      -# ROK
3819 **/
3820 S16 cmUnpkLrgSchL2MeasCfm
3821 (
3822 LrgSchL2MeasCfm func,
3823 Pst *pst,
3824 Buffer *mBuf
3825 )
3826 {
3827    LrgSchMeasCfmInfo  measInfo;
3828
3829
3830    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
3831    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
3832    CMCHKUNPK(cmUnpkCmStatus, &measInfo.cfm, mBuf);
3833    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
3834    if(measInfo.measType & LRG_L2MEAS_TB_TRANS_UL_FAULTY_COUNT)
3835    {
3836       CMCHKPK(oduPackUInt32, &measInfo.tbTransUlFaulty, mBuf);
3837    }    
3838    if(measInfo.measType & LRG_L2MEAS_TB_TRANS_UL_COUNT)
3839    {
3840       CMCHKPK(oduPackUInt32, &measInfo.tbTransUlTotalCnt, mBuf);
3841    }   
3842    if(measInfo.measType & LRG_L2MEAS_TB_TRANS_DL_FAULTY_COUNT)
3843    {
3844       CMCHKPK(oduPackUInt32, &measInfo.tbTransDlFaulty, mBuf);
3845    }   
3846    if(measInfo.measType & LRG_L2MEAS_TB_TRANS_DL_COUNT)
3847    {
3848       CMCHKPK(oduPackUInt32, &measInfo.tbTransDlTotalCnt, mBuf);
3849    }   
3850    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_UL)
3851    {
3852      CMCHKUNPK(cmUnpkAvgPrbCfm, &measInfo.avgPrbUl, mBuf);
3853    }
3854    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_DL)
3855    {
3856      CMCHKUNPK(cmUnpkAvgPrbCfm, &measInfo.avgPrbDl, mBuf);
3857    }
3858    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL)
3859    {
3860      CMCHKUNPK(cmUnpkAvgPrbQciCfm, &measInfo.avgPrbQciUlCfm, mBuf);
3861    }
3862    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
3863    {
3864      CMCHKUNPK(cmUnpkAvgPrbQciCfm, &measInfo.avgPrbQciDlCfm, mBuf);
3865    }
3866    if(measInfo.measType & LRG_L2MEAS_RA_PREAMBLE)
3867    {
3868      CMCHKUNPK(cmUnpkRaPrmbsCfm, &measInfo.raPrmbsCfm, mBuf);
3869    }
3870    if(measInfo.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
3871    {
3872      CMCHKUNPK(cmUnpkNumUeQciCfm, &measInfo.numUeQciUlCfm, mBuf);
3873    }
3874    if(measInfo.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
3875    {
3876      CMCHKUNPK(cmUnpkNumUeQciCfm, &measInfo.numUeQciDlCfm, mBuf);
3877    }
3878    SPutMsg(mBuf);
3879    return ((*func)(pst, &measInfo));
3880 }
3881 #endif
3882 #endif
3883 \f
3884
3885 /**********************************************************************
3886          End of file
3887  **********************************************************************/