U8, U16, U32 data type changes
[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 #ifdef ANSI
60 S16 cmPkLrgCfgReq
61 (
62 Pst * pst,
63 RgMngmt * cfg
64 )
65 #else
66 S16 cmPkLrgCfgReq(pst, cfg)
67 Pst * pst;
68 RgMngmt * cfg;
69 #endif
70 {
71    Buffer *mBuf = NULLP;
72
73    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
74 #if (ERRCLASS & ERRCLS_ADD_RES)
75       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
76          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
77          (ErrVal)ELRG001, (ErrVal)0, "Packing failed");
78 #endif
79       return RFAILED;
80    }
81    if (pst->selector == ODU_SELECTOR_LC) {
82       if (cmPkRgMngmt(pst, cfg, EVTLRGCFGREQ, mBuf) != ROK) {
83 #if (ERRCLASS & ERRCLS_ADD_RES)
84          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
85             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
86             (ErrVal)ELRG002, (ErrVal)0, "Packing failed");
87 #endif
88          SPutMsg(mBuf);
89          return RFAILED;
90       }
91    }
92    pst->event = (Event) EVTLRGCFGREQ;
93    return (SPstTsk(pst,mBuf));
94 }
95
96 \f
97 /**
98 * @brief This API is used to send a 
99 Configuration Request from LM to MAC.
100 *
101 * @details
102 *
103 *     Function: cmUnpkLrgCfgReq
104 *
105 *  @param[in]   Pst *  pst
106 *  @param[in]   RgMngmt *  cfg
107 *  @return   S16
108 *      -# ROK
109 **/
110 #ifdef ANSI
111 S16 cmUnpkLrgCfgReq
112 (
113 LrgCfgReq func,
114 Pst *pst,
115 Buffer *mBuf
116 )
117 #else
118 S16 cmUnpkLrgCfgReq(func, pst, mBuf)
119 LrgCfgReq func;
120 Pst *pst;
121 Buffer *mBuf;
122 #endif
123 {
124    /* lrg_c_001.main_2: Changed Pointer across Interface */
125    RgMngmt cfg;
126    
127    
128    if (cmUnpkRgMngmt(pst, &cfg, EVTLRGCFGREQ, mBuf) != ROK) {
129       SPutMsg(mBuf);
130 #if (ERRCLASS & ERRCLS_ADD_RES)
131       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
132             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
133             (ErrVal)ELRG003, (ErrVal)0, "Packing failed");
134 #endif
135       return RFAILED;
136    }
137    SPutMsg(mBuf);
138    return ((*func)(pst, &cfg));
139 }
140
141 \f
142 /**
143 * @brief This API is used to send a 
144 Configuration Request from LM to SCH.
145 *
146 * @details
147 *
148 *     Function: cmPkLrgSchCfgReq
149 *
150 *  @param[in]   Pst *  pst
151 *  @param[in]   RgMngmt *  cfg
152 *  @return   S16
153 *      -# ROK
154 **/
155 #ifdef ANSI
156 S16 cmPkLrgSchCfgReq
157 (
158 Pst * pst,
159 RgMngmt * cfg
160 )
161 #else
162 S16 cmPkLrgSchCfgReq(pst, cfg)
163 Pst * pst;
164 RgMngmt * cfg;
165 #endif
166 {
167    Buffer *mBuf = NULLP;
168
169    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
170 #if (ERRCLASS & ERRCLS_ADD_RES)
171       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
172          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
173          (ErrVal)ELRG004, (ErrVal)0, "Packing failed");
174 #endif
175       return RFAILED;
176    }
177    if (pst->selector == ODU_SELECTOR_LC) {
178       if (cmPkRgMngmt(pst, cfg, EVTMACSCHGENCFGREQ, mBuf) != ROK) {
179 #if (ERRCLASS & ERRCLS_ADD_RES)
180          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
181             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
182             (ErrVal)ELRG005, (ErrVal)0, "Packing failed");
183 #endif
184          SPutMsg(mBuf);
185          return RFAILED;
186       }
187    }
188    
189    return (SPstTsk(pst,mBuf));
190 }
191
192 \f
193 /**
194 * @brief This API is used to send a 
195 Configuration Request from LM to SCH.
196 *
197 * @details
198 *
199 *     Function: cmUnpkLrgSchCfgReq
200 *
201 *  @param[in]   Pst *  pst
202 *  @param[in]   RgMngmt *  cfg
203 *  @return   S16
204 *      -# ROK
205 **/
206 #ifdef ANSI
207 S16 cmUnpkLrgSchCfgReq
208 (
209 LrgSchCfgReq func,
210 Pst *pst,
211 Buffer *mBuf
212 )
213 #else
214 S16 cmUnpkLrgSchCfgReq(func, pst, mBuf)
215 LrgSchCfgReq func;
216 Pst *pst;
217 Buffer *mBuf;
218 #endif
219 {
220    /* lrg_c_001.main_2: Changed Pointer across Interface */
221    RgMngmt cfg;
222    
223
224    if (cmUnpkRgMngmt(pst, &cfg, EVTMACSCHGENCFGREQ, mBuf) != ROK) {
225       SPutMsg(mBuf);
226 #if (ERRCLASS & ERRCLS_ADD_RES)
227       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
228             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
229             (ErrVal)ELRG006, (ErrVal)0, "Packing failed");
230 #endif
231       return RFAILED;
232    }
233    SPutMsg(mBuf);
234    return ((*func)(pst, &cfg));
235 }
236
237 \f
238 /**
239 * @brief This API is used to send a 
240 Configuration Confirm from MAC to LM.
241 *
242 * @details
243 *
244 *     Function: cmPkLrgCfgCfm
245 *
246 *  @param[in]   Pst *  pst
247 *  @param[in]   RgMngmt *  cfm
248 *  @return   S16
249 *      -# ROK
250 **/
251 #ifdef ANSI
252 uint8_t cmPkLrgCfgCfm
253 (
254 Pst * pst,
255 RgMngmt * cfm
256 )
257 #else
258 uint8_t cmPkLrgCfgCfm(pst, cfm)
259 Pst * pst;
260 RgMngmt * cfm;
261 #endif
262 {
263    Buffer *mBuf = NULLP;
264
265    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
266 #if (ERRCLASS & ERRCLS_ADD_RES)
267       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
268          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
269          (ErrVal)ELRG007, (ErrVal)0, "Packing failed");
270 #endif
271       return RFAILED;
272    }
273    if (pst->selector == ODU_SELECTOR_LC) {
274       if (cmPkRgMngmt(pst, cfm, EVTLRGCFGCFM, mBuf) != ROK) {
275 #if (ERRCLASS & ERRCLS_ADD_RES)
276          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
277             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
278             (ErrVal)ELRG008, (ErrVal)0, "Packing failed");
279 #endif
280          SPutMsg(mBuf);
281          return RFAILED;
282       }
283    }
284    
285    pst->event = (Event) EVTLRGCFGCFM;
286    return (SPstTsk(pst,mBuf));
287 }
288
289 \f
290 /**
291 * @brief This API is used to send a 
292 Configuration Confirm from MAC to LM.
293 *
294 * @details
295 *
296 *     Function: cmUnpkLrgCfgCfm
297 *
298 *  @param[in]   Pst *  pst
299 *  @param[in]   RgMngmt *  cfm
300 *  @return   S16
301 *      -# ROK
302 **/
303 #ifdef ANSI
304 S16 cmUnpkLrgCfgCfm
305 (
306 LrgCfgCfm func,
307 Pst *pst,
308 Buffer *mBuf
309 )
310 #else
311 S16 cmUnpkLrgCfgCfm(func, pst, mBuf)
312 LrgCfgCfm func;
313 Pst *pst;
314 Buffer *mBuf;
315 #endif
316 {
317    RgMngmt cfm;
318    
319
320    if (cmUnpkRgMngmt(pst, &cfm, EVTLRGCFGCFM, mBuf) != ROK) {
321       SPutMsg(mBuf);
322 #if (ERRCLASS & ERRCLS_ADD_RES)
323       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
324             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
325             (ErrVal)ELRG009, (ErrVal)0, "Packing failed");
326 #endif
327       return RFAILED;
328    }
329    SPutMsg(mBuf);
330    return ((*func)(pst, &cfm));
331 }
332
333 \f
334 /**
335 * @brief This API is used to send a 
336 Configuration Confirm from SCH to LM.
337 *
338 * @details
339 *
340 *     Function: cmPkLrgSchCfgCfm
341 *
342 *  @param[in]   Pst *  pst
343 *  @param[in]   RgMngmt *  cfg
344 *  @return   S16
345 *      -# ROK
346 **/
347 #ifdef ANSI
348 uint8_t cmPkLrgSchCfgCfm
349 (
350 Pst * pst,
351 RgMngmt * cfg
352 )
353 #else
354 uint8_t cmPkLrgSchCfgCfm(pst, cfg)
355 Pst * pst;
356 RgMngmt * cfg;
357 #endif
358 {
359    Buffer *mBuf = NULLP;
360
361    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
362 #if (ERRCLASS & ERRCLS_ADD_RES)
363       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
364          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
365          (ErrVal)ELRG010, (ErrVal)0, "Packing failed");
366 #endif
367       return RFAILED;
368    }
369    if (pst->selector == ODU_SELECTOR_LC) {
370       if (cmPkRgMngmt(pst, cfg, EVTMACSCHGENCFGCFM, mBuf) != ROK) {
371 #if (ERRCLASS & ERRCLS_ADD_RES)
372          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
373             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
374             (ErrVal)ELRG011, (ErrVal)0, "Packing failed");
375 #endif
376          SPutMsg(mBuf);
377          return RFAILED;
378       }
379    }
380    
381    pst->event = (Event) EVTMACSCHGENCFGCFM;
382    return (SPstTsk(pst,mBuf));
383 }
384
385 \f
386 /**
387 * @brief This API is used to send a 
388 Configuration Confirm from SCH to LM.
389 *
390 * @details
391 *
392 *     Function: cmUnpkLrgSchCfgCfm
393 *
394 *  @param[in]   Pst *  pst
395 *  @param[in]   RgMngmt *  cfg
396 *  @return   S16
397 *      -# ROK
398 **/
399 #ifdef ANSI
400 S16 cmUnpkLrgSchCfgCfm
401 (
402 LrgSchCfgCfm func,
403 Pst *pst,
404 Buffer *mBuf
405 )
406 #else
407 S16 cmUnpkLrgSchCfgCfm(func, pst, mBuf)
408 LrgSchCfgCfm func;
409 Pst *pst;
410 Buffer *mBuf;
411 #endif
412 {
413    RgMngmt cfg;
414    
415    if (cmUnpkRgMngmt(pst, &cfg, EVTMACSCHGENCFGCFM, mBuf) != ROK) {
416       SPutMsg(mBuf);
417 #if (ERRCLASS & ERRCLS_ADD_RES)
418       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
419             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
420             (ErrVal)ELRG012, (ErrVal)0, "Packing failed");
421 #endif
422       return RFAILED;
423    }
424    SPutMsg(mBuf);
425    return ((*func)(pst, &cfg));
426 }
427
428 \f
429 /**
430 * @brief This API is used to send a 
431 Statistics Request from LM to MAC.
432 *
433 * @details
434 *
435 *     Function: cmPkLrgStsReq
436 *
437 *  @param[in]   Pst *  pst
438 *  @param[in]   RgMngmt *  sts
439 *  @return   S16
440 *      -# ROK
441 **/
442 #ifdef ANSI
443 S16 cmPkLrgStsReq
444 (
445 Pst * pst,
446 RgMngmt * sts
447 )
448 #else
449 S16 cmPkLrgStsReq(pst, sts)
450 Pst * pst;
451 RgMngmt * sts;
452 #endif
453 {
454    Buffer *mBuf = NULLP;
455
456    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
457 #if (ERRCLASS & ERRCLS_ADD_RES)
458       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
459          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
460          (ErrVal)ELRG013, (ErrVal)0, "Packing failed");
461 #endif
462       return RFAILED;
463    }
464    if (pst->selector == ODU_SELECTOR_LC) {
465       if (cmPkRgMngmt(pst, sts, EVTLRGSTSREQ, mBuf) != ROK) {
466 #if (ERRCLASS & ERRCLS_ADD_RES)
467          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
468             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
469             (ErrVal)ELRG014, (ErrVal)0, "Packing failed");
470 #endif
471          SPutMsg(mBuf);
472          return RFAILED;
473       }
474    }
475    
476    pst->event = (Event) EVTLRGSTSREQ;
477    return (SPstTsk(pst,mBuf));
478 }
479
480 \f
481 /**
482 * @brief This API is used to send a 
483 Statistics Request from LM to MAC.
484 *
485 * @details
486 *
487 *     Function: cmUnpkLrgStsReq
488 *
489 *  @param[in]   Pst *  pst
490 *  @param[in]   RgMngmt *  sts
491 *  @return   S16
492 *      -# ROK
493 **/
494 #ifdef ANSI
495 S16 cmUnpkLrgStsReq
496 (
497 LrgStsReq func,
498 Pst *pst,
499 Buffer *mBuf
500 )
501 #else
502 S16 cmUnpkLrgStsReq(func, pst, mBuf)
503 LrgStsReq func;
504 Pst *pst;
505 Buffer *mBuf;
506 #endif
507 {
508    RgMngmt sts;
509    
510
511    if (cmUnpkRgMngmt(pst, &sts, EVTLRGSTSREQ, mBuf) != ROK) {
512       SPutMsg(mBuf);
513 #if (ERRCLASS & ERRCLS_ADD_RES)
514       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
515             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
516             (ErrVal)ELRG015, (ErrVal)0, "Packing failed");
517 #endif
518       return RFAILED;
519    }
520    SPutMsg(mBuf);
521    return ((*func)(pst, &sts));
522 }
523
524 \f
525 /**
526 * @brief This API is used to send a 
527 Statistics Confirm from MAC to LM.
528 *
529 * @details
530 *
531 *     Function: cmPkLrgStsCfm
532 *
533 *  @param[in]   Pst *  pst
534 *  @param[in]   RgMngmt *  cfm
535 *  @return   S16
536 *      -# ROK
537 **/
538 #ifdef ANSI
539 S16 cmPkLrgStsCfm
540 (
541 Pst * pst,
542 RgMngmt * cfm
543 )
544 #else
545 S16 cmPkLrgStsCfm(pst, cfm)
546 Pst * pst;
547 RgMngmt * cfm;
548 #endif
549 {
550    Buffer *mBuf = NULLP;
551
552    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
553 #if (ERRCLASS & ERRCLS_ADD_RES)
554       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
555          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
556          (ErrVal)ELRG016, (ErrVal)0, "Packing failed");
557 #endif
558       return RFAILED;
559    }
560    if (pst->selector == ODU_SELECTOR_LC) {
561       if (cmPkRgMngmt(pst, cfm, EVTLRGSTSCFM, mBuf) != ROK) {
562 #if (ERRCLASS & ERRCLS_ADD_RES)
563          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
564             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
565             (ErrVal)ELRG017, (ErrVal)0, "Packing failed");
566 #endif
567          SPutMsg(mBuf);
568          return RFAILED;
569       }
570    }
571    
572    pst->event = (Event) EVTLRGSTSCFM;
573    return (SPstTsk(pst,mBuf));
574 }
575
576 \f
577 /**
578 * @brief This API is used to send a 
579 Statistics Confirm from MAC to LM.
580 *
581 * @details
582 *
583 *     Function: cmUnpkLrgStsCfm
584 *
585 *  @param[in]   Pst *  pst
586 *  @param[in]   RgMngmt *  cfm
587 *  @return   S16
588 *      -# ROK
589 **/
590 #ifdef ANSI
591 S16 cmUnpkLrgStsCfm
592 (
593 LrgStsCfm func,
594 Pst *pst,
595 Buffer *mBuf
596 )
597 #else
598 S16 cmUnpkLrgStsCfm(func, pst, mBuf)
599 LrgStsCfm func;
600 Pst *pst;
601 Buffer *mBuf;
602 #endif
603 {
604    RgMngmt cfm;
605    
606
607    if (cmUnpkRgMngmt(pst, &cfm, EVTLRGSTSCFM, mBuf) != ROK) {
608       SPutMsg(mBuf);
609 #if (ERRCLASS & ERRCLS_ADD_RES)
610       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
611             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
612             (ErrVal)ELRG018, (ErrVal)0, "Packing failed");
613 #endif
614       return RFAILED;
615    }
616    SPutMsg(mBuf);
617    return ((*func)(pst, &cfm));
618 }
619
620 \f
621 /**
622 * @brief This API is used to send a 
623 Status Request from LM to MAC.
624 *
625 * @details
626 *
627 *     Function: cmPkLrgStaReq
628 *
629 *  @param[in]   Pst *  pst
630 *  @param[in]   RgMngmt *  sta
631 *  @return   S16
632 *      -# ROK
633 **/
634 #ifdef ANSI
635 S16 cmPkLrgStaReq
636 (
637 Pst * pst,
638 RgMngmt * sta
639 )
640 #else
641 S16 cmPkLrgStaReq(pst, sta)
642 Pst * pst;
643 RgMngmt * sta;
644 #endif
645 {
646    Buffer *mBuf = NULLP;
647
648    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
649 #if (ERRCLASS & ERRCLS_ADD_RES)
650       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
651          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
652          (ErrVal)ELRG019, (ErrVal)0, "Packing failed");
653 #endif
654       return RFAILED;
655    }
656    if (cmPkRgMngmt(pst, sta, EVTLRGSSTAREQ, mBuf) != ROK) {
657 #if (ERRCLASS & ERRCLS_ADD_RES)
658       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
659             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
660             (ErrVal)ELRG020, (ErrVal)0, "Packing failed");
661 #endif
662       SPutMsg(mBuf);
663       return RFAILED;
664    }
665    
666    pst->event = (Event) EVTLRGSSTAREQ;
667    return (SPstTsk(pst,mBuf));
668 }
669
670 \f
671 /**
672 * @brief This API is used to send a 
673 Status Request from LM to MAC.
674 *
675 * @details
676 *
677 *     Function: cmUnpkLrgStaReq
678 *
679 *  @param[in]   Pst *  pst
680 *  @param[in]   RgMngmt *  sta
681 *  @return   S16
682 *      -# ROK
683 **/
684 #ifdef ANSI
685 S16 cmUnpkLrgStaReq
686 (
687 LrgStaReq func,
688 Pst *pst,
689 Buffer *mBuf
690 )
691 #else
692 S16 cmUnpkLrgStaReq(func, pst, mBuf)
693 LrgStaReq func;
694 Pst *pst;
695 Buffer *mBuf;
696 #endif
697 {
698    RgMngmt sta;
699    
700    
701    memset(&sta, 0, sizeof(RgMngmt));
702    if (cmUnpkRgMngmt(pst, &sta, EVTLRGSSTAREQ, mBuf) != ROK) {
703 #if (ERRCLASS & ERRCLS_ADD_RES)
704       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
705             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
706             (ErrVal)ELRG021, (ErrVal)0, "Packing failed");
707 #endif
708       SPutMsg(mBuf);
709       return RFAILED;
710    }
711    SPutMsg(mBuf);
712    return ((*func)(pst, &sta));
713 }
714
715 \f
716 /**
717 * @brief This API is used to send a 
718 Status Confirm from MAC to LM.
719 *
720 * @details
721 *
722 *     Function: cmPkLrgStaCfm
723 *
724 *  @param[in]   Pst *  pst
725 *  @param[in]   RgMngmt *  cfm
726 *  @return   S16
727 *      -# ROK
728 **/
729 #ifdef ANSI
730 S16 cmPkLrgStaCfm
731 (
732 Pst * pst,
733 RgMngmt * cfm
734 )
735 #else
736 S16 cmPkLrgStaCfm(pst, cfm)
737 Pst * pst;
738 RgMngmt * cfm;
739 #endif
740 {
741    Buffer *mBuf = NULLP;
742
743    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
744 #if (ERRCLASS & ERRCLS_ADD_RES)
745       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
746          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
747          (ErrVal)ELRG022, (ErrVal)0, "Packing failed");
748 #endif
749       return RFAILED;
750    }
751    if (cmPkRgMngmt(pst, cfm, EVTLRGSSTACFM, mBuf) != ROK) {
752 #if (ERRCLASS & ERRCLS_ADD_RES)
753       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
754             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
755             (ErrVal)ELRG023, (ErrVal)0, "Packing failed");
756 #endif
757       SPutMsg(mBuf);
758       return RFAILED;
759    }
760    
761    pst->event = (Event) EVTLRGSSTACFM;
762    return (SPstTsk(pst,mBuf));
763 }
764
765 \f
766 /**
767 * @brief This API is used to send a 
768 Status Confirm from MAC to LM.
769 *
770 * @details
771 *
772 *     Function: cmUnpkLrgStaCfm
773 *
774 *  @param[in]   Pst *  pst
775 *  @param[in]   RgMngmt *  cfm
776 *  @return   S16
777 *      -# ROK
778 **/
779 #ifdef ANSI
780 S16 cmUnpkLrgStaCfm
781 (
782 LrgStaCfm func,
783 Pst *pst,
784 Buffer *mBuf
785 )
786 #else
787 S16 cmUnpkLrgStaCfm(func, pst, mBuf)
788 LrgStaCfm func;
789 Pst *pst;
790 Buffer *mBuf;
791 #endif
792 {
793    RgMngmt cfm;
794    
795   
796    memset(&cfm, 0, sizeof(RgMngmt));
797    if (cmUnpkRgMngmt(pst, &cfm, EVTLRGSSTACFM, mBuf) != ROK) {
798 #if (ERRCLASS & ERRCLS_ADD_RES)
799       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
800             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
801             (ErrVal)ELRG024, (ErrVal)0, "Packing failed");
802 #endif
803       SPutMsg(mBuf);
804       return RFAILED;
805    }
806    SPutMsg(mBuf);
807    return ((*func)(pst, &cfm));
808 }
809
810 \f
811 /**
812 * @brief This API is used to send a 
813 Status Indication from MAC to LM.
814 *
815 * @details
816 *
817 *     Function: cmPkLrgStaInd
818 *
819 *  @param[in]   Pst *  pst
820 *  @param[in]   RgMngmt *  usta
821 *  @return   S16
822 *      -# ROK
823 **/
824 #ifdef ANSI
825 S16 cmPkLrgStaInd
826 (
827 Pst * pst,
828 RgMngmt * usta
829 )
830 #else
831 S16 cmPkLrgStaInd(pst, usta)
832 Pst * pst;
833 RgMngmt * usta;
834 #endif
835 {
836    Buffer *mBuf = NULLP;
837
838    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
839 #if (ERRCLASS & ERRCLS_ADD_RES)
840       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
841          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
842          (ErrVal)ELRG025, (ErrVal)0, "Packing failed");
843 #endif
844       return RFAILED;
845    }
846    if (pst->selector == ODU_SELECTOR_LC) {
847       if (cmPkRgMngmt(pst, usta, EVTLRGUSTAIND, mBuf) != ROK) {
848 #if (ERRCLASS & ERRCLS_ADD_RES)
849          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
850             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
851             (ErrVal)ELRG026, (ErrVal)0, "Packing failed");
852 #endif
853          SPutMsg(mBuf);
854          return RFAILED;
855       }
856    }
857    
858    pst->event = (Event) EVTLRGUSTAIND;
859    return (SPstTsk(pst,mBuf));
860 }
861
862 \f
863 /**
864 * @brief This API is used to send a 
865 Status Indication from MAC to LM.
866 *
867 * @details
868 *
869 *     Function: cmUnpkLrgStaInd
870 *
871 *  @param[in]   Pst *  pst
872 *  @param[in]   RgMngmt *  usta
873 *  @return   S16
874 *      -# ROK
875 **/
876 #ifdef ANSI
877 S16 cmUnpkLrgStaInd
878 (
879 LrgStaInd func,
880 Pst *pst,
881 Buffer *mBuf
882 )
883 #else
884 S16 cmUnpkLrgStaInd(func, pst, mBuf)
885 LrgStaInd func;
886 Pst *pst;
887 Buffer *mBuf;
888 #endif
889 {
890    RgMngmt usta;
891    
892
893    if (cmUnpkRgMngmt(pst, &usta, EVTLRGUSTAIND, mBuf) != ROK) {
894       SPutMsg(mBuf);
895 #if (ERRCLASS & ERRCLS_ADD_RES)
896       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
897             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
898             (ErrVal)ELRG027, (ErrVal)0, "Packing failed");
899 #endif
900       return RFAILED;
901    }
902    SPutMsg(mBuf);
903    return ((*func)(pst, &usta));
904 }
905
906 \f
907 /**
908 * @brief This API is used to send a 
909 Status Indication from SCH to LM.
910 *
911 * @details
912 *
913 *     Function: cmPkLrgSchStaInd
914 *
915 *  @param[in]   Pst *  pst
916 *  @param[in]   RgMngmt *  sta
917 *  @return   S16
918 *      -# ROK
919 **/
920 #ifdef ANSI
921 S16 cmPkLrgSchStaInd
922 (
923 Pst * pst,
924 RgMngmt * sta
925 )
926 #else
927 S16 cmPkLrgSchStaInd(pst, sta)
928 Pst * pst;
929 RgMngmt * sta;
930 #endif
931 {
932    Buffer *mBuf = NULLP;
933
934    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
935 #if (ERRCLASS & ERRCLS_ADD_RES)
936       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
937          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
938          (ErrVal)ELRG028, (ErrVal)0, "Packing failed");
939 #endif
940       return RFAILED;
941    }
942    if (pst->selector == ODU_SELECTOR_LC) {
943       if (cmPkRgMngmt(pst, sta, EVTLRGSCHSTAIND, mBuf) != ROK) {
944 #if (ERRCLASS & ERRCLS_ADD_RES)
945          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
946             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
947             (ErrVal)ELRG029, (ErrVal)0, "Packing failed");
948 #endif
949          SPutMsg(mBuf);
950          return RFAILED;
951       }
952    }
953    
954    pst->event = (Event) EVTLRGSCHSTAIND;
955    return (SPstTsk(pst,mBuf));
956 }
957
958 \f
959 /**
960 * @brief This API is used to send a 
961 Status Indication from SCH to LM.
962 *
963 * @details
964 *
965 *     Function: cmUnpkLrgSchStaInd
966 *
967 *  @param[in]   Pst *  pst
968 *  @param[in]   RgMngmt *  sta
969 *  @return   S16
970 *      -# ROK
971 **/
972 #ifdef ANSI
973 S16 cmUnpkLrgSchStaInd
974 (
975 LrgSchStaInd func,
976 Pst *pst,
977 Buffer *mBuf
978 )
979 #else
980 S16 cmUnpkLrgSchStaInd(func, pst, mBuf)
981 LrgSchStaInd func;
982 Pst *pst;
983 Buffer *mBuf;
984 #endif
985 {
986    RgMngmt sta;
987    
988
989    if (cmUnpkRgMngmt(pst, &sta, EVTLRGSCHSTAIND, mBuf) != ROK) {
990       SPutMsg(mBuf);
991 #if (ERRCLASS & ERRCLS_ADD_RES)
992       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
993             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
994             (ErrVal)ELRG030, (ErrVal)0, "Packing failed");
995 #endif
996       return RFAILED;
997    }
998    SPutMsg(mBuf);
999    return ((*func)(pst, &sta));
1000 }
1001
1002 \f
1003 /**
1004 * @brief This API is used to send a 
1005 Control Request from LM to MAC.
1006 *
1007 * @details
1008 *
1009 *     Function: cmPkLrgCntrlReq
1010 *
1011 *  @param[in]   Pst *  pst
1012 *  @param[in]   RgMngmt *  cntrl
1013 *  @return   S16
1014 *      -# ROK
1015 **/
1016 #ifdef ANSI
1017 S16 cmPkLrgCntrlReq
1018 (
1019 Pst * pst,
1020 RgMngmt * cntrl
1021 )
1022 #else
1023 S16 cmPkLrgCntrlReq(pst, cntrl)
1024 Pst * pst;
1025 RgMngmt * cntrl;
1026 #endif
1027 {
1028    Buffer *mBuf = NULLP;
1029
1030    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1031 #if (ERRCLASS & ERRCLS_ADD_RES)
1032       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1033          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1034          (ErrVal)ELRG031, (ErrVal)0, "Packing failed");
1035 #endif
1036       return RFAILED;
1037    }
1038    if (pst->selector == ODU_SELECTOR_LC) {
1039       if (cmPkRgMngmt(pst, cntrl, EVTLRGCNTRLREQ, mBuf) != ROK) {
1040 #if (ERRCLASS & ERRCLS_ADD_RES)
1041          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1042             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1043             (ErrVal)ELRG032, (ErrVal)0, "Packing failed");
1044 #endif
1045          SPutMsg(mBuf);
1046          return RFAILED;
1047       }
1048    }
1049    
1050    pst->event = (Event) EVTLRGCNTRLREQ;
1051    return (SPstTsk(pst,mBuf));
1052 }
1053
1054 \f
1055 /**
1056 * @brief This API is used to send a 
1057 Control Request from LM to MAC.
1058 *
1059 * @details
1060 *
1061 *     Function: cmUnpkLrgCntrlReq
1062 *
1063 *  @param[in]   Pst *  pst
1064 *  @param[in]   RgMngmt *  cntrl
1065 *  @return   S16
1066 *      -# ROK
1067 **/
1068 #ifdef ANSI
1069 S16 cmUnpkLrgCntrlReq
1070 (
1071 LrgCntrlReq func,
1072 Pst *pst,
1073 Buffer *mBuf
1074 )
1075 #else
1076 S16 cmUnpkLrgCntrlReq(func, pst, mBuf)
1077 LrgCntrlReq func;
1078 Pst *pst;
1079 Buffer *mBuf;
1080 #endif
1081 {
1082    RgMngmt cntrl;
1083    
1084
1085    if (cmUnpkRgMngmt(pst, &cntrl, EVTLRGCNTRLREQ, mBuf) != ROK) {
1086       SPutMsg(mBuf);
1087 #if (ERRCLASS & ERRCLS_ADD_RES)
1088       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1089             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1090             (ErrVal)ELRG033, (ErrVal)0, "Packing failed");
1091 #endif
1092       return RFAILED;
1093    }
1094    SPutMsg(mBuf);
1095    return ((*func)(pst, &cntrl));
1096 }
1097
1098 \f
1099 /**
1100 * @brief This API is used to send a 
1101 Control Request from LM to SCH.
1102 *
1103 * @details
1104 *
1105 *     Function: cmPkLrgSchCntrlReq
1106 *
1107 *  @param[in]   Pst *  pst
1108 *  @param[in]   RgMngmt *  cntrl
1109 *  @return   S16
1110 *      -# ROK
1111 **/
1112 #ifdef ANSI
1113 S16 cmPkLrgSchCntrlReq
1114 (
1115 Pst * pst,
1116 RgMngmt * cntrl
1117 )
1118 #else
1119 S16 cmPkLrgSchCntrlReq(pst, cntrl)
1120 Pst * pst;
1121 RgMngmt * cntrl;
1122 #endif
1123 {
1124    Buffer *mBuf = NULLP;
1125
1126    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1127 #if (ERRCLASS & ERRCLS_ADD_RES)
1128       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1129          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1130          (ErrVal)ELRG034, (ErrVal)0, "Packing failed");
1131 #endif
1132       return RFAILED;
1133    }
1134    if (pst->selector == ODU_SELECTOR_LC) {
1135       if (cmPkRgMngmt(pst, cntrl, EVTLRGSCHCNTRLREQ, mBuf) != ROK) {
1136 #if (ERRCLASS & ERRCLS_ADD_RES)
1137          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1138             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1139             (ErrVal)ELRG035, (ErrVal)0, "Packing failed");
1140 #endif
1141          SPutMsg(mBuf);
1142          return RFAILED;
1143       }
1144    }
1145    
1146    pst->event = (Event) EVTLRGSCHCNTRLREQ;
1147    return (SPstTsk(pst,mBuf));
1148 }
1149
1150 \f
1151 /**
1152 * @brief This API is used to send a 
1153 Control Request from LM to SCH.
1154 *
1155 * @details
1156 *
1157 *     Function: cmUnpkLrgSchCntrlReq
1158 *
1159 *  @param[in]   Pst *  pst
1160 *  @param[in]   RgMngmt *  cntrl
1161 *  @return   S16
1162 *      -# ROK
1163 **/
1164 #ifdef ANSI
1165 S16 cmUnpkLrgSchCntrlReq
1166 (
1167 LrgSchCntrlReq func,
1168 Pst *pst,
1169 Buffer *mBuf
1170 )
1171 #else
1172 S16 cmUnpkLrgSchCntrlReq(func, pst, mBuf)
1173 LrgSchCntrlReq func;
1174 Pst *pst;
1175 Buffer *mBuf;
1176 #endif
1177 {
1178    RgMngmt cntrl;
1179    
1180
1181    if (cmUnpkRgMngmt(pst, &cntrl, EVTLRGSCHCNTRLREQ, mBuf) != ROK) {
1182       SPutMsg(mBuf);
1183 #if (ERRCLASS & ERRCLS_ADD_RES)
1184       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1185             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1186             (ErrVal)ELRG036, (ErrVal)0, "Packing failed");
1187 #endif
1188       return RFAILED;
1189    }
1190    SPutMsg(mBuf);
1191    return ((*func)(pst, &cntrl));
1192 }
1193
1194 \f
1195 /**
1196 * @brief This API is used to send a 
1197 Control Confirm from MAC to LM.
1198 *
1199 * @details
1200 *
1201 *     Function: cmPkLrgCntrlCfm
1202 *
1203 *  @param[in]   Pst *  pst
1204 *  @param[in]   RgMngmt *  cfm
1205 *  @return   S16
1206 *      -# ROK
1207 **/
1208 #ifdef ANSI
1209 S16 cmPkLrgCntrlCfm
1210 (
1211 Pst * pst,
1212 RgMngmt * cfm
1213 )
1214 #else
1215 S16 cmPkLrgCntrlCfm(pst, cfm)
1216 Pst * pst;
1217 RgMngmt * cfm;
1218 #endif
1219 {
1220    Buffer *mBuf = NULLP;
1221
1222    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1223 #if (ERRCLASS & ERRCLS_ADD_RES)
1224       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1225          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1226          (ErrVal)ELRG037, (ErrVal)0, "Packing failed");
1227 #endif
1228       return RFAILED;
1229    }
1230    if (pst->selector == ODU_SELECTOR_LC) {
1231       if (cmPkRgMngmt(pst, cfm, EVTLRGCNTRLCFM, mBuf) != ROK) {
1232 #if (ERRCLASS & ERRCLS_ADD_RES)
1233          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1234             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1235             (ErrVal)ELRG038, (ErrVal)0, "Packing failed");
1236 #endif
1237          SPutMsg(mBuf);
1238          return RFAILED;
1239       }
1240    }
1241    
1242    pst->event = (Event) EVTLRGCNTRLCFM;
1243    return (SPstTsk(pst,mBuf));
1244 }
1245
1246 \f
1247 /**
1248 * @brief This API is used to send a 
1249 Control Confirm from MAC to LM.
1250 *
1251 * @details
1252 *
1253 *     Function: cmUnpkLrgCntrlCfm
1254 *
1255 *  @param[in]   Pst *  pst
1256 *  @param[in]   RgMngmt *  cfm
1257 *  @return   S16
1258 *      -# ROK
1259 **/
1260 #ifdef ANSI
1261 S16 cmUnpkLrgCntrlCfm
1262 (
1263 LrgCntrlCfm func,
1264 Pst *pst,
1265 Buffer *mBuf
1266 )
1267 #else
1268 S16 cmUnpkLrgCntrlCfm(func, pst, mBuf)
1269 LrgCntrlCfm func;
1270 Pst *pst;
1271 Buffer *mBuf;
1272 #endif
1273 {
1274    RgMngmt cfm;
1275    
1276
1277    if (cmUnpkRgMngmt(pst, &cfm, EVTLRGCNTRLCFM, mBuf) != ROK) {
1278       SPutMsg(mBuf);
1279 #if (ERRCLASS & ERRCLS_ADD_RES)
1280       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1281             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1282             (ErrVal)ELRG039, (ErrVal)0, "Packing failed");
1283 #endif
1284       return RFAILED;
1285    }
1286    SPutMsg(mBuf);
1287    return ((*func)(pst, &cfm));
1288 }
1289
1290 \f
1291 /**
1292 * @brief This API is used to send a 
1293 Control Confirm from SCH to LM.
1294 *
1295 * @details
1296 *
1297 *     Function: cmPkLrgSchCntrlCfm
1298 *
1299 *  @param[in]   Pst *  pst
1300 *  @param[in]   RgMngmt *  cntrl
1301 *  @return   S16
1302 *      -# ROK
1303 **/
1304 #ifdef ANSI
1305 S16 cmPkLrgSchCntrlCfm
1306 (
1307 Pst * pst,
1308 RgMngmt * cntrl
1309 )
1310 #else
1311 S16 cmPkLrgSchCntrlCfm(pst, cntrl)
1312 Pst * pst;
1313 RgMngmt * cntrl;
1314 #endif
1315 {
1316    Buffer *mBuf = NULLP;
1317
1318    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1319 #if (ERRCLASS & ERRCLS_ADD_RES)
1320       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1321          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1322          (ErrVal)ELRG040, (ErrVal)0, "Packing failed");
1323 #endif
1324       return RFAILED;
1325    }
1326    if (pst->selector == ODU_SELECTOR_LC) {
1327       if (cmPkRgMngmt(pst, cntrl, EVTLRGSCHCNTRLCFM, mBuf) != ROK) {
1328 #if (ERRCLASS & ERRCLS_ADD_RES)
1329          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1330             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1331             (ErrVal)ELRG041, (ErrVal)0, "Packing failed");
1332 #endif
1333          SPutMsg(mBuf);
1334          return RFAILED;
1335       }
1336    }
1337    
1338    pst->event = (Event) EVTLRGSCHCNTRLCFM;
1339    return (SPstTsk(pst,mBuf));
1340 }
1341
1342 \f
1343 /**
1344 * @brief This API is used to send a 
1345 Control Confirm from SCH to LM.
1346 *
1347 * @details
1348 *
1349 *     Function: cmUnpkLrgSchCntrlCfm
1350 *
1351 *  @param[in]   Pst *  pst
1352 *  @param[in]   RgMngmt *  cntrl
1353 *  @return   S16
1354 *      -# ROK
1355 **/
1356 #ifdef ANSI
1357 S16 cmUnpkLrgSchCntrlCfm
1358 (
1359 LrgSchCntrlCfm func,
1360 Pst *pst,
1361 Buffer *mBuf
1362 )
1363 #else
1364 S16 cmUnpkLrgSchCntrlCfm(func, pst, mBuf)
1365 LrgSchCntrlCfm func;
1366 Pst *pst;
1367 Buffer *mBuf;
1368 #endif
1369 {
1370    RgMngmt cntrl;
1371    
1372
1373    if (cmUnpkRgMngmt(pst, &cntrl, EVTLRGSCHCNTRLCFM, mBuf) != ROK) {
1374       SPutMsg(mBuf);
1375 #if (ERRCLASS & ERRCLS_ADD_RES)
1376       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1377             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1378             (ErrVal)ELRG042, (ErrVal)0, "Packing failed");
1379 #endif
1380       return RFAILED;
1381    }
1382    SPutMsg(mBuf);
1383    return ((*func)(pst, &cntrl));
1384 }
1385
1386 \f
1387 /**
1388 * @brief This API is used to send a 
1389 Trace Indication from MAC to LM.
1390 *
1391 * @details
1392 *
1393 *     Function: cmPkLrgTrcInd
1394 *
1395 *  @param[in]   Pst *  pst
1396 *  @param[in]   RgMngmt *  trc
1397 *  @param[in]   Buffer *  trcBuf
1398 *  @return   S16
1399 *      -# ROK
1400 **/
1401 #ifdef ANSI
1402 S16 cmPkLrgTrcInd
1403 (
1404 Pst * pst,
1405 RgMngmt * trc,
1406 Buffer * trcBuf
1407 )
1408 #else
1409 S16 cmPkLrgTrcInd(pst, trc, trcBuf)
1410 Pst * pst;
1411 RgMngmt * trc;
1412 Buffer * trcBuf;
1413 #endif
1414 {
1415    Buffer *mBuf = NULLP;
1416
1417    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1418 #if (ERRCLASS & ERRCLS_ADD_RES)
1419       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1420          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1421          (ErrVal)ELRG043, (ErrVal)0, "Packing failed");
1422 #endif
1423       SPutMsg(trcBuf);
1424       return RFAILED;
1425    }
1426    if (pst->selector == ODU_SELECTOR_LC) {
1427       MsgLen msgLen;
1428       if (SFndLenMsg(trcBuf, &msgLen) != ROK) {
1429 #if (ERRCLASS & ERRCLS_ADD_RES)
1430          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1431             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1432             (ErrVal)ELRG044, (ErrVal)0, "Packing failed");
1433 #endif
1434          SPutMsg(trcBuf);
1435          return RFAILED;
1436       }
1437       if (SCatMsg(mBuf, trcBuf, M1M2) != ROK) {
1438 #if (ERRCLASS & ERRCLS_ADD_RES)
1439          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1440             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1441             (ErrVal)ELRG045, (ErrVal)0, "Packing failed");
1442 #endif
1443          SPutMsg(trcBuf);
1444          return RFAILED;
1445       }
1446       SPutMsg(trcBuf);
1447       CMCHKPK(cmPkMsgLen, msgLen, mBuf);
1448    }
1449    if (cmPkRgMngmt(pst, trc, EVTLRGTRCIND, mBuf) != ROK) {
1450 #if (ERRCLASS & ERRCLS_ADD_RES)
1451       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1452             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1453             (ErrVal)ELRG046, (ErrVal)0, "Packing failed");
1454 #endif
1455       SPutMsg(trcBuf);
1456       SPutMsg(mBuf);
1457       return RFAILED;
1458    }
1459    
1460    pst->event = (Event) EVTLRGTRCIND;
1461    return (SPstTsk(pst,mBuf));
1462 }
1463
1464 \f
1465 /**
1466 * @brief This API is used to send a 
1467 Trace Indication from MAC to LM.
1468 *
1469 * @details
1470 *
1471 *     Function: cmUnpkLrgTrcInd
1472 *
1473 *  @param[in]   Pst *  pst
1474 *  @param[in]   RgMngmt *  trc
1475 *  @param[in]   Buffer *  trcBuf
1476 *  @return   S16
1477 *      -# ROK
1478 **/
1479 #ifdef ANSI
1480 S16 cmUnpkLrgTrcInd
1481 (
1482 LrgTrcInd func,
1483 Pst *pst,
1484 Buffer *mBuf
1485 )
1486 #else
1487 S16 cmUnpkLrgTrcInd(func, pst, mBuf)
1488 LrgTrcInd func;
1489 Pst *pst;
1490 Buffer *mBuf;
1491 #endif
1492 {
1493    RgMngmt trc;
1494   /* lrg_c_001.main_3 - MODIFY -  Modified trcBuf to have it initialized to NULLP */
1495    Buffer *trcBuf = NULLP;
1496    
1497    
1498    if (cmUnpkRgMngmt(pst, &trc, EVTLRGTRCIND, mBuf) != ROK) {
1499       SPutMsg(mBuf);
1500 #if (ERRCLASS & ERRCLS_ADD_RES)
1501       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1502             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1503             (ErrVal)ELRG047, (ErrVal)0, "Packing failed");
1504 #endif
1505       return RFAILED;
1506    }
1507    if (pst->selector == ODU_SELECTOR_LC) {
1508       MsgLen msgLen, totalMsgLen;
1509       CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
1510       if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
1511          return RFAILED;
1512       if (SSegMsg(mBuf, totalMsgLen-msgLen, &trcBuf) != ROK)
1513          return RFAILED;
1514    }
1515    SPutMsg(mBuf);
1516    return ((*func)(pst, &trc, trcBuf));
1517 }
1518
1519 \f
1520 /***********************************************************
1521 *
1522 *     Func : cmPkRgGenCfg
1523 *
1524 *
1525 *     Desc :   This structure holds configuration parameters for MAC General Configuration.
1526 *
1527 *
1528 *     Ret  : S16
1529 *
1530 *     Notes:
1531 *
1532 *     File  : 
1533 *
1534 **********************************************************/
1535 #ifdef ANSI
1536 S16 cmPkRgGenCfg
1537 (
1538 RgGenCfg *param,
1539 Buffer *mBuf
1540 )
1541 #else
1542 S16 cmPkRgGenCfg(param, mBuf)
1543 RgGenCfg *param;
1544 Buffer *mBuf;
1545 #endif
1546 {
1547
1548
1549 #ifdef LTE_ADV
1550    CMCHKPK(oduUnpackUInt8, param->isSCellActDeactAlgoEnable, mBuf);
1551    CMCHKPK(oduUnpackUInt8, param->forceCntrlSrbBoOnPCel, mBuf);
1552 #endif
1553    CMCHKPK(oduUnpackUInt8, param->startCellId, mBuf);
1554    CMCHKPK(oduUnpackUInt8, param->numRguSaps, mBuf);
1555    CMCHKPK(oduUnpackUInt8, param->tmrRes, mBuf);
1556    CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
1557    CMCHKPK(cmPkPst, &param->lmPst, mBuf);
1558    return ROK;
1559 }
1560
1561
1562 \f
1563 /***********************************************************
1564 *
1565 *     Func : cmUnpkRgGenCfg
1566 *
1567 *
1568 *     Desc :   This structure holds configuration parameters for MAC General Configuration.
1569 *
1570 *
1571 *     Ret  : S16
1572 *
1573 *     Notes:
1574 *
1575 *     File  : 
1576 *
1577 **********************************************************/
1578 #ifdef ANSI
1579 S16 cmUnpkRgGenCfg
1580 (
1581 RgGenCfg *param,
1582 Buffer *mBuf
1583 )
1584 #else
1585 S16 cmUnpkRgGenCfg(param, mBuf)
1586 RgGenCfg *param;
1587 Buffer *mBuf;
1588 #endif
1589 {
1590
1591
1592    CMCHKUNPK(cmUnpkPst, &param->lmPst, mBuf);
1593    CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
1594    CMCHKUNPK(oduPackUInt8, &param->tmrRes, mBuf);
1595    CMCHKUNPK(oduPackUInt8, &param->numRguSaps, mBuf);
1596    CMCHKUNPK(oduPackUInt8, &param->startCellId, mBuf);
1597 #ifdef LTE_ADV
1598    CMCHKUNPK(oduPackUInt8, &param->forceCntrlSrbBoOnPCel, mBuf);
1599    CMCHKUNPK(oduPackUInt8, &param->isSCellActDeactAlgoEnable, mBuf);
1600 #endif
1601    return ROK;
1602 }
1603
1604
1605 \f
1606 /***********************************************************
1607 *
1608 *     Func : cmPkRgUpSapCfg
1609 *
1610 *
1611 *     Desc :   This structure holds configuration parameters for MAC Upper SAP Configuration.
1612 *
1613 *
1614 *     Ret  : S16
1615 *
1616 *     Notes:
1617 *
1618 *     File  : 
1619 *
1620 **********************************************************/
1621 #ifdef ANSI
1622 S16 cmPkRgUpSapCfg
1623 (
1624 RgUpSapCfg *param,
1625 Buffer *mBuf
1626 )
1627 #else
1628 S16 cmPkRgUpSapCfg(param, mBuf)
1629 RgUpSapCfg *param;
1630 Buffer *mBuf;
1631 #endif
1632 {
1633
1634
1635    CMCHKPK(SPkS16, param->suId, mBuf);
1636    CMCHKPK(SPkS16, param->spId, mBuf);
1637    CMCHKPK(oduUnpackUInt8, param->route, mBuf);
1638    CMCHKPK(oduUnpackUInt8, param->inst, mBuf);
1639    CMCHKPK(oduUnpackUInt8, param->ent, mBuf);
1640    CMCHKPK(oduUnpackUInt16, param->procId, mBuf);
1641    CMCHKPK(oduUnpackUInt8, param->prior, mBuf);
1642    CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
1643    CMCHKPK(oduUnpackUInt8, param->selector, mBuf);
1644    return ROK;
1645 }
1646
1647
1648 \f
1649 /***********************************************************
1650 *
1651 *     Func : cmUnpkRgUpSapCfg
1652 *
1653 *
1654 *     Desc :   This structure holds configuration parameters for MAC Upper SAP Configuration.
1655 *
1656 *
1657 *     Ret  : S16
1658 *
1659 *     Notes:
1660 *
1661 *     File  : 
1662 *
1663 **********************************************************/
1664 #ifdef ANSI
1665 S16 cmUnpkRgUpSapCfg
1666 (
1667 RgUpSapCfg *param,
1668 Buffer *mBuf
1669 )
1670 #else
1671 S16 cmUnpkRgUpSapCfg(param, mBuf)
1672 RgUpSapCfg *param;
1673 Buffer *mBuf;
1674 #endif
1675 {
1676
1677
1678    CMCHKUNPK(oduPackUInt8, &param->selector, mBuf);
1679    CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
1680    CMCHKUNPK(oduPackUInt8, &param->prior, mBuf);
1681    CMCHKUNPK(oduPackUInt16, &param->procId, mBuf);
1682    CMCHKUNPK(oduPackUInt8, &param->ent, mBuf);
1683    CMCHKUNPK(oduPackUInt8, &param->inst, mBuf);
1684    CMCHKUNPK(oduPackUInt8, &param->route, mBuf);
1685    CMCHKUNPK(SUnpkS16, &param->spId, mBuf);
1686    CMCHKUNPK(SUnpkS16, &param->suId, mBuf);
1687    return ROK;
1688 }
1689
1690
1691 \f
1692 /***********************************************************
1693 *
1694 *     Func : cmPkRgLowSapCfg
1695 *
1696 *
1697 *     Desc :   This structure holds configuration parameters for MAC Lower SAP Configuration.
1698 *
1699 *
1700 *     Ret  : S16
1701 *
1702 *     Notes:
1703 *
1704 *     File  : 
1705 *
1706 **********************************************************/
1707 #ifdef ANSI
1708 S16 cmPkRgLowSapCfg
1709 (
1710 RgLowSapCfg *param,
1711 Buffer *mBuf
1712 )
1713 #else
1714 S16 cmPkRgLowSapCfg(param, mBuf)
1715 RgLowSapCfg *param;
1716 Buffer *mBuf;
1717 #endif
1718 {
1719
1720
1721    CMCHKPK(cmPkTmrCfg, &param->bndTmr, mBuf);
1722    CMCHKPK(SPkS16, param->suId, mBuf);
1723    CMCHKPK(SPkS16, param->spId, mBuf);
1724    CMCHKPK(oduUnpackUInt8, param->route, mBuf);
1725    CMCHKPK(oduUnpackUInt8, param->inst, mBuf);
1726    CMCHKPK(oduUnpackUInt8, param->ent, mBuf);
1727    CMCHKPK(oduUnpackUInt16, param->procId, mBuf);
1728    CMCHKPK(oduUnpackUInt8, param->prior, mBuf);
1729    CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
1730    CMCHKPK(oduUnpackUInt8, param->selector, mBuf);
1731    return ROK;
1732 }
1733
1734
1735 \f
1736 /***********************************************************
1737 *
1738 *     Func : cmUnpkRgLowSapCfg
1739 *
1740 *
1741 *     Desc :   This structure holds configuration parameters for MAC Lower SAP Configuration.
1742 *
1743 *
1744 *     Ret  : S16
1745 *
1746 *     Notes:
1747 *
1748 *     File  : 
1749 *
1750 **********************************************************/
1751 #ifdef ANSI
1752 S16 cmUnpkRgLowSapCfg
1753 (
1754 RgLowSapCfg *param,
1755 Buffer *mBuf
1756 )
1757 #else
1758 S16 cmUnpkRgLowSapCfg(param, mBuf)
1759 RgLowSapCfg *param;
1760 Buffer *mBuf;
1761 #endif
1762 {
1763
1764
1765    CMCHKUNPK(oduPackUInt8, &param->selector, mBuf);
1766    CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
1767    CMCHKUNPK(oduPackUInt8, &param->prior, mBuf);
1768    CMCHKUNPK(oduPackUInt16, &param->procId, mBuf);
1769    CMCHKUNPK(oduPackUInt8, &param->ent, mBuf);
1770    CMCHKUNPK(oduPackUInt8, &param->inst, mBuf);
1771    CMCHKUNPK(oduPackUInt8, &param->route, mBuf);
1772    CMCHKUNPK(SUnpkS16, &param->spId, mBuf);
1773    CMCHKUNPK(SUnpkS16, &param->suId, mBuf);
1774    CMCHKUNPK(cmUnpkTmrCfg, &param->bndTmr, mBuf);
1775    return ROK;
1776 }
1777
1778 #ifdef MAC_SCH_STATS
1779
1780 \f
1781 /***********************************************************
1782 *
1783 *     Func : cmPkRgAckNack
1784 *
1785 *
1786 *     Desc :   Ack and Nack statistics
1787 *
1788 *
1789 *     Ret  : S16
1790 *
1791 *     Notes:
1792 *
1793 *     File  : 
1794 *
1795 **********************************************************/
1796 #ifdef ANSI
1797 S16 cmPkRgAckNack
1798 (
1799 RgAckNack *param,
1800 Buffer *mBuf
1801 )
1802 #else
1803 S16 cmPkRgAckNack (param, mBuf)
1804 RgAckNack *param;
1805 Buffer *mBuf;
1806 #endif
1807 {
1808
1809
1810    CMCHKPK(oduUnpackUInt16, param->numOfAcks, mBuf);
1811    CMCHKPK(oduUnpackUInt16, param->numOfNacks, mBuf);
1812    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
1813
1814    return ROK;
1815 } /* cmPkRgAckNack */
1816
1817 \f
1818 /***********************************************************
1819 *
1820 *     Func : cmPkRgSchNackAckStats
1821 *
1822 *
1823 *     Desc :   
1824 *
1825 *
1826 *     Ret  : S16
1827 *
1828 *     Notes:
1829 *
1830 *     File  : 
1831 *
1832 **********************************************************/
1833 #ifdef ANSI
1834 S16 cmPkRgSchNackAckStats
1835 (
1836 RgSchNackAckStats *param,
1837 Buffer *mBuf
1838 )
1839 #else
1840 S16 cmPkRgSchNackAckStats (param, mBuf)
1841 RgSchNackAckStats *param;
1842 Buffer *mBuf;
1843 #endif
1844 {
1845
1846    S32 i;
1847
1848    for (i=14; i >= 0; i--) {
1849       CMCHKPK(cmPkRgAckNack, &param->ulCqiStat[i], mBuf);
1850    }
1851
1852    for (i=14; i >= 0; i--) {
1853       CMCHKPK(cmPkRgAckNack, &param->dlCqiStat[i], mBuf);
1854    }
1855
1856    return ROK;
1857 }
1858
1859 \f
1860 /***********************************************************
1861 *
1862 *     Func : cmPkRgHqNumRetx
1863 *
1864 *
1865 *     Desc :   Harq Retransmission statistics
1866 *
1867 *
1868 *     Ret  : S16
1869 *
1870 *     Notes:
1871 *
1872 *     File  : 
1873 *
1874 **********************************************************/
1875 #ifdef ANSI
1876 S16 cmPkRgHqNumRetx
1877 (
1878 RgSchHqNumRetx *param,
1879 Buffer *mBuf
1880 )
1881 #else
1882 S16 cmPkRgHqNumRetx (param, mBuf)
1883 RgSchHqNumRetx *param;
1884 Buffer *mBuf;
1885 #endif
1886 {
1887
1888    CMCHKPK(oduUnpackUInt32, param->totalTx, mBuf);
1889    CMCHKPK(oduUnpackUInt16, param->numOfHQ_4, mBuf);
1890    CMCHKPK(oduUnpackUInt16, param->numOfHQ_3, mBuf);
1891    CMCHKPK(oduUnpackUInt16, param->numOfHQ_2, mBuf);
1892    CMCHKPK(oduUnpackUInt16, param->numOfHQ_1, mBuf);
1893    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
1894
1895    return ROK;
1896 } /* cmPkRgHqNumRetx */
1897
1898 \f
1899 /***********************************************************
1900 *
1901 *     Func : cmPkRgSchHqRetxStats
1902 *
1903 *
1904 *     Desc :   
1905 *
1906 *
1907 *     Ret  : S16
1908 *
1909 *     Notes:
1910 *
1911 *     File  : 
1912 *
1913 **********************************************************/
1914 #ifdef ANSI
1915 S16 cmPkRgSchHqRetxStats
1916 (
1917 RgSchHqRetxStats *param,
1918 Buffer *mBuf
1919 )
1920 #else
1921 S16 cmPkRgSchHqRetxStats (param, mBuf)
1922 RgSchHqRetxStats *param;
1923 Buffer *mBuf;
1924 #endif
1925 {
1926
1927    S32 i;
1928
1929    for (i=14; i >= 0; i--) {
1930       CMCHKPK(cmPkRgHqNumRetx, &param->ulCqiStat[i], mBuf);
1931    }
1932
1933    for (i=14; i >= 0; i--) {
1934       CMCHKPK(cmPkRgHqNumRetx, &param->dlCqiStat[i], mBuf);
1935    }
1936
1937    return ROK;
1938 } /* cmPkRgSchHqRetxStats */
1939
1940 /* unpcaking functions */
1941 \f
1942 /***********************************************************
1943 *
1944 *     Func : cmUnpkRgAckNack
1945 *
1946 *
1947 *     Desc :   Ack and Nack statistics
1948 *
1949 *
1950 *     Ret  : S16
1951 *
1952 *     Notes:
1953 *
1954 *     File  : 
1955 *
1956 **********************************************************/
1957 #ifdef ANSI
1958 S16 cmUnpkRgAckNack
1959 (
1960 RgAckNack *param,
1961 Buffer *mBuf
1962 )
1963 #else
1964 S16 cmUnpkRgAckNack (param, mBuf)
1965 RgAckNack *param;
1966 Buffer *mBuf;
1967 #endif
1968 {
1969
1970
1971    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
1972    CMCHKUNPK(oduPackUInt16, &param->numOfNacks, mBuf);
1973    CMCHKUNPK(oduPackUInt16, &param->numOfAcks, mBuf);
1974
1975    return ROK;
1976 } /* cmUnkRgAckNack */
1977
1978 \f
1979 /***********************************************************
1980 *
1981 *     Func : cmUnpkRgSchNackAckStats
1982 *
1983 *
1984 *     Desc :   
1985 *
1986 *
1987 *     Ret  : S16
1988 *
1989 *     Notes:
1990 *
1991 *     File  : 
1992 *
1993 **********************************************************/
1994 #ifdef ANSI
1995 S16 cmUnpkRgSchNackAckStats
1996 (
1997 RgSchNackAckStats *param,
1998 Buffer *mBuf
1999 )
2000 #else
2001 S16 cmUnpkRgSchNackAckStats (param, mBuf)
2002 RgSchNackAckStats *param;
2003 Buffer *mBuf;
2004 #endif
2005 {
2006    S32 i;
2007
2008    for (i=0; i <= 14; i++) {
2009       CMCHKUNPK(cmUnpkRgAckNack, &param->dlCqiStat[i], mBuf);
2010    }
2011
2012    for (i=0; i <= 14; i++) {
2013       CMCHKUNPK(cmUnpkRgAckNack, &param->ulCqiStat[i], mBuf);
2014    }
2015
2016    return ROK;
2017 } /* cmUnpkRgSchNackAckStats */
2018
2019 \f
2020 /***********************************************************
2021 *
2022 *     Func : cmUnpkRgHqNumRetx
2023 *
2024 *
2025 *     Desc :   Harq Retransmission statistics
2026 *
2027 *
2028 *     Ret  : S16
2029 *
2030 *     Notes:
2031 *
2032 *     File  : 
2033 *
2034 **********************************************************/
2035 #ifdef ANSI
2036 S16 cmUnpkRgHqNumRetx
2037 (
2038 RgSchHqNumRetx *param,
2039 Buffer *mBuf
2040 )
2041 #else
2042 S16 cmUnpkRgHqNumRetx (param, mBuf)
2043 RgSchHqNumRetx *param;
2044 Buffer *mBuf;
2045 #endif
2046 {
2047
2048    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
2049    CMCHKUNPK(oduPackUInt16, &param->numOfHQ_1, mBuf);
2050    CMCHKUNPK(oduPackUInt16, &param->numOfHQ_2, mBuf);
2051    CMCHKUNPK(oduPackUInt16, &param->numOfHQ_3, mBuf);
2052    CMCHKUNPK(oduPackUInt16, &param->numOfHQ_4, mBuf);
2053    CMCHKUNPK(oduPackUInt32, &param->totalTx, mBuf);
2054
2055    return ROK;
2056 } /* cmUnpkRgHqNumRetx */
2057
2058 \f
2059 /***********************************************************
2060 *
2061 *     Func : cmUnpkRgSchHqRetxStats
2062 *
2063 *
2064 *     Desc :   
2065 *
2066 *
2067 *     Ret  : S16
2068 *
2069 *     Notes:
2070 *
2071 *     File  : 
2072 *
2073 **********************************************************/
2074 #ifdef ANSI
2075 S16 cmUnpkRgSchHqRetxStats
2076 (
2077 RgSchHqRetxStats *param,
2078 Buffer *mBuf
2079 )
2080 #else
2081 S16 cmUnpkRgSchHqRetxStats (param, mBuf)
2082 RgSchHqRetxStats *param;
2083 Buffer *mBuf;
2084 #endif
2085 {
2086    S32 i;
2087
2088    for (i=0; i <= 14; i++) {
2089       CMCHKUNPK(cmUnpkRgHqNumRetx, &param->dlCqiStat[i], mBuf);
2090    }
2091
2092    for (i=0; i <= 14; i++) {
2093       CMCHKUNPK(cmUnpkRgHqNumRetx, &param->ulCqiStat[i], mBuf);
2094    }
2095
2096    return ROK;
2097 } /* cmUnpkRgSchHqRetxStats */
2098
2099 #endif /* MAC_SCH_STATS */
2100
2101 \f
2102 /***********************************************************
2103 *
2104 *     Func : cmPkRgGenSts
2105 *
2106 *
2107 *     Desc :   This structure holds General Statistical information of MAC.
2108 *
2109 *
2110 *     Ret  : S16
2111 *
2112 *     Notes:
2113 *
2114 *     File  : 
2115 *
2116 **********************************************************/
2117 #ifdef ANSI
2118 S16 cmPkRgGenSts
2119 (
2120 RgGenSts *param,
2121 Buffer *mBuf
2122 )
2123 #else
2124 S16 cmPkRgGenSts(param, mBuf)
2125 RgGenSts *param;
2126 Buffer *mBuf;
2127 #endif
2128 {
2129
2130
2131 #ifdef MAC_SCH_STATS
2132    CMCHKPK(cmPkRgSchHqRetxStats, &param->hqRetxStats, mBuf);
2133    CMCHKPK(cmPkRgSchNackAckStats, &param->nackAckStats, mBuf);
2134 #endif /* MAC_SCH_STATS */
2135    CMCHKPK(oduUnpackUInt16, param->numCellCfg, mBuf);
2136    CMCHKPK(oduUnpackUInt32, param->numUeCfg, mBuf);
2137    CMCHKPK(oduUnpackUInt32, param->numHarqFail, mBuf);
2138    return ROK;
2139 }
2140
2141
2142 \f
2143 /***********************************************************
2144 *
2145 *     Func : cmUnpkRgGenSts
2146 *
2147 *
2148 *     Desc :   This structure holds General Statistical information of MAC.
2149 *
2150 *
2151 *     Ret  : S16
2152 *
2153 *     Notes:
2154 *
2155 *     File  : 
2156 *
2157 **********************************************************/
2158 #ifdef ANSI
2159 S16 cmUnpkRgGenSts
2160 (
2161 RgGenSts *param,
2162 Buffer *mBuf
2163 )
2164 #else
2165 S16 cmUnpkRgGenSts(param, mBuf)
2166 RgGenSts *param;
2167 Buffer *mBuf;
2168 #endif
2169 {
2170
2171
2172    CMCHKUNPK(oduPackUInt32, &param->numHarqFail, mBuf);
2173    CMCHKUNPK(oduPackUInt32, &param->numUeCfg, mBuf);
2174    CMCHKUNPK(oduPackUInt16, &param->numCellCfg, mBuf);
2175 #ifdef MAC_SCH_STATS
2176    CMCHKUNPK(cmUnpkRgSchNackAckStats, &param->nackAckStats, mBuf);
2177    CMCHKUNPK(cmUnpkRgSchHqRetxStats, &param->hqRetxStats, mBuf);
2178 #endif /* MAC_SCH_STATS */
2179    return ROK;
2180 }
2181
2182
2183 \f
2184 /***********************************************************
2185 *
2186 *     Func : cmPkRgSapSts
2187 *
2188 *
2189 *     Desc :   This structure holds Statistical information of a SAP in MAC.
2190 *
2191 *
2192 *     Ret  : S16
2193 *
2194 *     Notes:
2195 *
2196 *     File  : 
2197 *
2198 **********************************************************/
2199 #ifdef ANSI
2200 S16 cmPkRgSapSts
2201 (
2202 RgSapSts *param,
2203 Buffer *mBuf
2204 )
2205 #else
2206 S16 cmPkRgSapSts(param, mBuf)
2207 RgSapSts *param;
2208 Buffer *mBuf;
2209 #endif
2210 {
2211
2212
2213    CMCHKPK(oduUnpackUInt32, param->numPduDrop, mBuf);
2214    CMCHKPK(oduUnpackUInt32, param->numPduTxmit, mBuf);
2215    CMCHKPK(oduUnpackUInt32, param->numPduRcvd, mBuf);
2216    return ROK;
2217 }
2218
2219
2220 \f
2221 /***********************************************************
2222 *
2223 *     Func : cmUnpkRgSapSts
2224 *
2225 *
2226 *     Desc :   This structure holds Statistical information of a SAP in MAC.
2227 *
2228 *
2229 *     Ret  : S16
2230 *
2231 *     Notes:
2232 *
2233 *     File  : 
2234 *
2235 **********************************************************/
2236 #ifdef ANSI
2237 S16 cmUnpkRgSapSts
2238 (
2239 RgSapSts *param,
2240 Buffer *mBuf
2241 )
2242 #else
2243 S16 cmUnpkRgSapSts(param, mBuf)
2244 RgSapSts *param;
2245 Buffer *mBuf;
2246 #endif
2247 {
2248
2249
2250    CMCHKUNPK(oduPackUInt32, &param->numPduRcvd, mBuf);
2251    CMCHKUNPK(oduPackUInt32, &param->numPduTxmit, mBuf);
2252    CMCHKUNPK(oduPackUInt32, &param->numPduDrop, mBuf);
2253    return ROK;
2254 }
2255
2256
2257 \f
2258 /***********************************************************
2259 *
2260 *     Func : cmPkRgSchInstCfg
2261 *
2262 *
2263 *     Desc : Scheduler Configuration
2264 *
2265 *
2266 *     Ret  : S16
2267 *
2268 *     Notes:
2269 *
2270 *     File  : 
2271 *
2272 **********************************************************/
2273 #ifdef ANSI
2274 S16 cmPkRgSchInstCfg
2275 (
2276 RgSchInstCfg *param,
2277 Buffer *mBuf
2278 )
2279 #else
2280 S16 cmPkRgSchInstCfg(param, mBuf)
2281 RgSchInstCfg *param;
2282 Buffer *mBuf;
2283 #endif
2284 {
2285
2286    S32 i;
2287
2288    for (i=param->numSaps-1; i >= 0; i--) {
2289       CMCHKPK(cmPkRgLowSapCfg, &param->tfuSap[i], mBuf);
2290    }
2291    for (i=param->numSaps-1; i >= 0; i--) {
2292       CMCHKPK(cmPkRgUpSapCfg, &param->rgrSap[i], mBuf);
2293    }
2294    for (i=param->numSaps-1; i >= 0; i--) {
2295       CMCHKPK(cmPkRgUpSapCfg, &param->rgmSap[i], mBuf);
2296    }
2297    CMCHKPK(oduUnpackUInt8, param->numSaps, mBuf);
2298    CMCHKPK(cmPkRgGenCfg, &param->genCfg, mBuf);
2299    CMCHKPK(oduUnpackUInt8, param->instId, mBuf);
2300    return ROK;
2301 }
2302
2303
2304 \f
2305 /***********************************************************
2306 *
2307 *     Func : cmUnpkRgSchInstCfg
2308 *
2309 *
2310 *     Desc : Scheduler Configuration
2311 *
2312 *
2313 *     Ret  : S16
2314 *
2315 *     Notes:
2316 *
2317 *     File  : 
2318 *
2319 **********************************************************/
2320 #ifdef ANSI
2321 S16 cmUnpkRgSchInstCfg
2322 (
2323 RgSchInstCfg *param,
2324 Buffer *mBuf
2325 )
2326 #else
2327 S16 cmUnpkRgSchInstCfg(param, mBuf)
2328 RgSchInstCfg *param;
2329 Buffer *mBuf;
2330 #endif
2331 {
2332
2333    S32 i;
2334
2335    CMCHKUNPK(oduPackUInt8, &param->instId, mBuf);
2336    CMCHKUNPK(cmUnpkRgGenCfg, &param->genCfg, mBuf);
2337    CMCHKUNPK(oduPackUInt8, &param->numSaps, mBuf);
2338    for (i=0; i<param->numSaps; i++) {
2339       CMCHKUNPK(cmUnpkRgUpSapCfg, &param->rgmSap[i], mBuf);
2340    }
2341    for (i=0; i<param->numSaps; i++) {
2342       CMCHKUNPK(cmUnpkRgUpSapCfg, &param->rgrSap[i], mBuf);
2343    }
2344    for (i=0; i<param->numSaps; i++) {
2345       CMCHKUNPK(cmUnpkRgLowSapCfg, &param->tfuSap[i], mBuf);
2346    }
2347    return ROK;
2348 }
2349
2350
2351 \f
2352 /***********************************************************
2353 *
2354 *     Func : cmPkRgCfg
2355 *
2356 *
2357 *     Desc :   This structure holds Configuration parameters for MAC.
2358 *
2359 *
2360 *     Ret  : S16
2361 *
2362 *     Notes:
2363 *
2364 *     File  : 
2365 *
2366 **********************************************************/
2367 #ifdef ANSI
2368 S16 cmPkRgCfg
2369 (
2370 RgCfg *param,
2371 S16 elmnt,
2372 Buffer *mBuf
2373 )
2374 #else
2375 S16 cmPkRgCfg(param, elmnt, mBuf)
2376 RgCfg *param;
2377 S16 elmnt;
2378 Buffer *mBuf;
2379 #endif
2380 {
2381
2382
2383       switch(elmnt) {
2384          case STSCHINST:
2385             CMCHKPK(cmPkRgSchInstCfg, &param->s.schInstCfg, mBuf);
2386             break;
2387          case STTFUSAP:
2388             CMCHKPK(cmPkRgLowSapCfg, &param->s.tfuSap, mBuf);
2389             break;
2390          case STCRGSAP:
2391             CMCHKPK(cmPkRgUpSapCfg, &param->s.crgSap, mBuf);
2392             break;
2393          case STRGUSAP:
2394             CMCHKPK(cmPkRgUpSapCfg, &param->s.rguSap, mBuf);
2395             break;
2396          case STGEN:
2397             CMCHKPK(cmPkRgGenCfg, &param->s.genCfg, mBuf);
2398             break;
2399          default :
2400             return RFAILED;
2401       }
2402    return ROK;
2403 }
2404
2405
2406 \f
2407 /***********************************************************
2408 *
2409 *     Func : cmUnpkRgCfg
2410 *
2411 *
2412 *     Desc :   This structure holds Configuration parameters for MAC.
2413 *
2414 *
2415 *     Ret  : S16
2416 *
2417 *     Notes:
2418 *
2419 *     File  : 
2420 *
2421 **********************************************************/
2422 #ifdef ANSI
2423 S16 cmUnpkRgCfg
2424 (
2425 RgCfg *param,
2426 S16 elmnt,
2427 Buffer *mBuf
2428 )
2429 #else
2430 S16 cmUnpkRgCfg(param, elmnt, mBuf)
2431 RgCfg *param;
2432 S16 elmnt;
2433 Buffer *mBuf;
2434 #endif
2435 {
2436
2437
2438       switch(elmnt) {
2439          case STGEN:
2440             CMCHKUNPK(cmUnpkRgGenCfg, &param->s.genCfg, mBuf);
2441             break;
2442          case STRGUSAP:
2443             CMCHKUNPK(cmUnpkRgUpSapCfg, &param->s.rguSap, mBuf);
2444             break;
2445          case STCRGSAP:
2446             CMCHKUNPK(cmUnpkRgUpSapCfg, &param->s.crgSap, mBuf);
2447             break;
2448          case STTFUSAP:
2449             CMCHKUNPK(cmUnpkRgLowSapCfg, &param->s.tfuSap, mBuf);
2450             break;
2451          case STSCHINST:
2452             CMCHKUNPK(cmUnpkRgSchInstCfg, &param->s.schInstCfg, mBuf);
2453             break;
2454          default :
2455             return RFAILED;
2456       }
2457    return ROK;
2458 }
2459
2460
2461 \f
2462 /***********************************************************
2463 *
2464 *     Func : cmPkRgSapSta
2465 *
2466 *
2467 *     Desc :   This structure holds a SAP's status information.
2468 *
2469 *
2470 *     Ret  : S16
2471 *
2472 *     Notes:
2473 *
2474 *     File  : 
2475 *
2476 **********************************************************/
2477 #ifdef ANSI
2478 S16 cmPkRgSapSta
2479 (
2480 RgSapSta *param,
2481 Buffer *mBuf
2482 )
2483 #else
2484 S16 cmPkRgSapSta(param, mBuf)
2485 RgSapSta *param;
2486 Buffer *mBuf;
2487 #endif
2488 {
2489
2490
2491    CMCHKPK(oduUnpackUInt8, param->sapState, mBuf);
2492    return ROK;
2493 }
2494
2495
2496 \f
2497 /***********************************************************
2498 *
2499 *     Func : cmUnpkRgSapSta
2500 *
2501 *
2502 *     Desc :   This structure holds a SAP's status information.
2503 *
2504 *
2505 *     Ret  : S16
2506 *
2507 *     Notes:
2508 *
2509 *     File  : 
2510 *
2511 **********************************************************/
2512 #ifdef ANSI
2513 S16 cmUnpkRgSapSta
2514 (
2515 RgSapSta *param,
2516 Buffer *mBuf
2517 )
2518 #else
2519 S16 cmUnpkRgSapSta(param, mBuf)
2520 RgSapSta *param;
2521 Buffer *mBuf;
2522 #endif
2523 {
2524
2525
2526    CMCHKUNPK(oduPackUInt8, &param->sapState, mBuf);
2527    return ROK;
2528 }
2529
2530
2531 \f
2532 /***********************************************************
2533 *
2534 *     Func : cmPkRgSts
2535 *
2536 *
2537 *     Desc :   This structure holds MAC's Statistical information.
2538 *
2539 *
2540 *     Ret  : S16
2541 *
2542 *     Notes:
2543 *
2544 *     File  : 
2545 *
2546 **********************************************************/
2547 #ifdef ANSI
2548 S16 cmPkRgSts
2549 (
2550 RgSts *param,
2551 S16 elmnt,
2552 Buffer *mBuf
2553 )
2554 #else
2555 S16 cmPkRgSts(param, elmnt, mBuf)
2556 RgSts *param;
2557 S16 elmnt;
2558 Buffer *mBuf;
2559 #endif
2560 {
2561
2562
2563       switch(elmnt) {
2564          case STTFUSAP:
2565             CMCHKPK(cmPkRgSapSts, &param->s.tfuSts, mBuf);
2566             break;
2567          case STRGRSAP:
2568             CMCHKPK(cmPkRgSapSts, &param->s.rgrSts, mBuf);
2569             break;
2570          case STCRGSAP:
2571             CMCHKPK(cmPkRgSapSts, &param->s.crgSts, mBuf);
2572             break;
2573          case STRGUSAP:
2574             CMCHKPK(cmPkRgSapSts, &param->s.rguSts, mBuf);
2575             break;
2576          case STGEN:
2577             CMCHKPK(cmPkRgGenSts, &param->s.genSts, mBuf);
2578             break;
2579          default :
2580             break;
2581       }
2582    CMCHKPK(cmPkAction, param->action, mBuf);
2583    CMCHKPK(oduUnpackUInt8, param->sapInst, mBuf);
2584    CMCHKPK(cmPkDateTime, &param->dt, mBuf);
2585    return ROK;
2586 }
2587
2588
2589 \f
2590 /***********************************************************
2591 *
2592 *     Func : cmUnpkRgSts
2593 *
2594 *
2595 *     Desc :   This structure holds MAC's Statistical information.
2596 *
2597 *
2598 *     Ret  : S16
2599 *
2600 *     Notes:
2601 *
2602 *     File  : 
2603 *
2604 **********************************************************/
2605 #ifdef ANSI
2606 S16 cmUnpkRgSts
2607 (
2608 RgSts *param,
2609 S16 elmnt,
2610 Buffer *mBuf
2611 )
2612 #else
2613 S16 cmUnpkRgSts(param, elmnt, mBuf)
2614 RgSts *param;
2615 S16 elmnt;
2616 Buffer *mBuf;
2617 #endif
2618 {
2619
2620
2621    CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
2622    CMCHKUNPK(oduPackUInt8, &param->sapInst, mBuf);
2623    CMCHKUNPK(cmUnpkAction, &param->action, mBuf);
2624       switch(elmnt) {
2625          case STGEN:
2626             CMCHKUNPK(cmUnpkRgGenSts, &param->s.genSts, mBuf);
2627             break;
2628          case STRGUSAP:
2629             CMCHKUNPK(cmUnpkRgSapSts, &param->s.rguSts, mBuf);
2630             break;
2631          case STCRGSAP:
2632             CMCHKUNPK(cmUnpkRgSapSts, &param->s.crgSts, mBuf);
2633             break;
2634          case STRGRSAP:
2635             CMCHKUNPK(cmUnpkRgSapSts, &param->s.rgrSts, mBuf);
2636             break;
2637          case STTFUSAP:
2638             CMCHKUNPK(cmUnpkRgSapSts, &param->s.tfuSts, mBuf);
2639             break;
2640          default :
2641             break;
2642       }
2643    return ROK;
2644 }
2645
2646
2647 \f
2648 /***********************************************************
2649 *
2650 *     Func : cmPkRgSsta
2651 *
2652 *
2653 *     Desc :   This structure holds MAC's Solicited Status information.
2654 *
2655 *
2656 *     Ret  : S16
2657 *
2658 *     Notes:
2659 *
2660 *     File  : 
2661 *
2662 **********************************************************/
2663 #ifdef ANSI
2664 S16 cmPkRgSsta
2665 (
2666 Pst *pst,
2667 RgSsta *param,
2668 S16 elmnt,
2669 #ifdef LRG_V1
2670 uint8_t eventType,
2671 #endif
2672 Buffer *mBuf
2673 )
2674 #else
2675 S16 cmPkRgSsta(pst, param, elmnt, eventType, mBuf)
2676 Pst *pst;
2677 RgSsta *param;
2678 S16 elmnt;
2679 /* lrg_c_001.main_3 - ADD -  Added the extra parameter eventType  to the function  */
2680 #ifdef LRG_V1
2681 uint8_t eventType;
2682 #endif
2683 Buffer *mBuf;
2684 #endif
2685 {
2686
2687
2688       switch(elmnt) {
2689          case STTFUSAP:
2690             CMCHKPK(cmPkRgSapSta, &param->s.tfuSapSta, mBuf);
2691             break;
2692          case STRGRSAP:
2693             CMCHKPK(cmPkRgSapSta, &param->s.rgrSapSta, mBuf);
2694             break;
2695          case STCRGSAP:
2696             CMCHKPK(cmPkRgSapSta, &param->s.crgSapSta, mBuf);
2697             break;
2698          case STRGUSAP:
2699             CMCHKPK(cmPkRgSapSta, &param->s.rguSapSta, mBuf);
2700             break;
2701             /*ccpu00118255 - ADD - Check for eventType before Pack */
2702          case STGEN:
2703 #ifdef LRG_V1 
2704             if (eventType == EVTLRGSSTACFM)
2705             {
2706                CMCHKPK(cmPkSystemId, &param->s.sysId, mBuf);
2707                if (param->s.sysId.ptNmb != NULLP)
2708                {
2709                   SPutSBuf(pst->region, pst->pool, 
2710                         (Data *)param->s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
2711                }
2712             }
2713 #else /*LRG_V1 not defined */
2714             if (param->s.sysId.ptNmb != NULLP)
2715             {
2716                  CMCHKPK(cmPkSystemId, &param->s.sysId, mBuf);
2717                  SPutSBuf(pst->region, pst->pool, (Data *)param->s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
2718             }
2719
2720 #endif /*end of LRG_V1 */
2721             break;
2722          default :
2723             break;
2724       }
2725    CMCHKPK(oduUnpackUInt8, param->sapInst, mBuf);
2726    CMCHKPK(cmPkDateTime, &param->dt, mBuf);
2727    return ROK;
2728 }
2729
2730
2731 \f
2732 /***********************************************************
2733 *
2734 *     Func : cmUnpkRgSsta
2735 *
2736 *
2737 *     Desc :   This structure holds MAC's Solicited Status information.
2738 *
2739 *
2740 *     Ret  : S16
2741 *
2742 *     Notes:
2743 *
2744 *     File  : 
2745 *
2746 **********************************************************/
2747 #ifdef ANSI
2748 S16 cmUnpkRgSsta
2749 (
2750 Pst    *pst,
2751 RgSsta *param,
2752 S16 elmnt,
2753 Buffer *mBuf
2754 )
2755 #else
2756 S16 cmUnpkRgSsta(pst, param, elmnt, mBuf)
2757 Pst    *pst;
2758 RgSsta *param;
2759 S16 elmnt;
2760 Buffer *mBuf;
2761 #endif
2762 {
2763
2764
2765    CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
2766    CMCHKUNPK(oduPackUInt8, &param->sapInst, mBuf);
2767       switch(elmnt) {
2768          case STGEN:
2769             /*ccpu00118255 - ADD - Check for eventType before Unpack */
2770             if (pst->event == EVTLRGSSTACFM)
2771             {
2772                /* After Merging */
2773                if((SGetSBuf(pst->region, pst->pool, (Data **)&param->s.sysId.ptNmb,
2774                            LRG_MAX_PT_NUM_SIZE)) != ROK){
2775 #if (ERRCLASS & ERRCLS_ADD_RES)
2776                   SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2777                         __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2778                         (ErrVal)ELRG048, (ErrVal)0, "Packing failed");
2779 #endif
2780                   SPutMsg(mBuf);
2781                   return RFAILED;
2782                }
2783                /* KWORK_FIX: Moved the memset under the NULL check */
2784                if (param->s.sysId.ptNmb != NULLP)
2785                {
2786                   memset(param->s.sysId.ptNmb, 0, LRG_MAX_PT_NUM_SIZE);
2787                   CMCHKUNPK(cmUnpkSystemId, &param->s.sysId, mBuf);
2788                }
2789             }
2790             break;
2791          case STRGUSAP:
2792             CMCHKUNPK(cmUnpkRgSapSta, &param->s.rguSapSta, mBuf);
2793             break;
2794          case STCRGSAP:
2795             CMCHKUNPK(cmUnpkRgSapSta, &param->s.crgSapSta, mBuf);
2796             break;
2797          case STRGRSAP:
2798             CMCHKUNPK(cmUnpkRgSapSta, &param->s.rgrSapSta, mBuf);
2799             break;
2800          case STTFUSAP:
2801             CMCHKUNPK(cmUnpkRgSapSta, &param->s.tfuSapSta, mBuf);
2802             break;
2803          default :
2804             break;
2805       }
2806    return ROK;
2807 }
2808
2809
2810 \f
2811 /***********************************************************
2812 *
2813 *     Func : cmPkRgUstaDgn
2814 *
2815 *
2816 *     Desc :   Alarm diagnostics structure.
2817 *
2818 *
2819 *     Ret  : S16
2820 *
2821 *     Notes:
2822 *
2823 *     File  : 
2824 *
2825 **********************************************************/
2826 #ifdef ANSI
2827 S16 cmPkRgUstaDgn
2828 (
2829 RgUstaDgn *param,
2830 Buffer *mBuf
2831 )
2832 #else
2833 S16 cmPkRgUstaDgn(param, mBuf)
2834 RgUstaDgn *param;
2835 Buffer *mBuf;
2836 #endif
2837 {
2838
2839
2840       switch(param->type) {
2841          case LRG_USTA_DGNVAL_MEM:
2842             CMCHKPK(cmPkMemoryId, &param->u.mem, mBuf);
2843             break;
2844          default :
2845             break;
2846       }
2847    CMCHKPK(oduUnpackUInt8, param->type, mBuf);
2848    return ROK;
2849 }
2850
2851
2852 \f
2853 /***********************************************************
2854 *
2855 *     Func : cmUnpkRgUstaDgn
2856 *
2857 *
2858 *     Desc :   Alarm diagnostics structure.
2859 *
2860 *
2861 *     Ret  : S16
2862 *
2863 *     Notes:
2864 *
2865 *     File  : 
2866 *
2867 **********************************************************/
2868 #ifdef ANSI
2869 S16 cmUnpkRgUstaDgn
2870 (
2871 RgUstaDgn *param,
2872 Buffer *mBuf
2873 )
2874 #else
2875 S16 cmUnpkRgUstaDgn(param, mBuf)
2876 RgUstaDgn *param;
2877 Buffer *mBuf;
2878 #endif
2879 {
2880
2881
2882    CMCHKUNPK(oduPackUInt8, &param->type, mBuf);
2883       switch(param->type) {
2884          case LRG_USTA_DGNVAL_MEM:
2885             CMCHKUNPK(cmUnpkMemoryId, &param->u.mem, mBuf);
2886             break;
2887          default :
2888             break;
2889       }
2890    return ROK;
2891 }
2892
2893
2894 \f
2895 /***********************************************************
2896 *
2897 *     Func : cmPkRgUsta
2898 *
2899 *
2900 *     Desc :   This structure holds MAC's Unsolicited Status information.
2901 *
2902 *
2903 *     Ret  : S16
2904 *
2905 *     Notes:
2906 *
2907 *     File  : 
2908 *
2909 **********************************************************/
2910 #ifdef ANSI
2911 S16 cmPkRgUsta
2912 (
2913 RgUsta *param,
2914 Buffer *mBuf
2915 )
2916 #else
2917 S16 cmPkRgUsta(param, mBuf)
2918 RgUsta *param;
2919 Buffer *mBuf;
2920 #endif
2921 {
2922
2923
2924    CMCHKPK(cmPkRgUstaDgn, &param->dgn, mBuf);
2925    CMCHKPK(cmPkCmAlarm, &param->cmAlarm, mBuf);
2926    return ROK;
2927 }
2928
2929
2930 \f
2931 /***********************************************************
2932 *
2933 *     Func : cmUnpkRgUsta
2934 *
2935 *
2936 *     Desc :   This structure holds MAC's Unsolicited Status information.
2937 *
2938 *
2939 *     Ret  : S16
2940 *
2941 *     Notes:
2942 *
2943 *     File  : 
2944 *
2945 **********************************************************/
2946 #ifdef ANSI
2947 S16 cmUnpkRgUsta
2948 (
2949 RgUsta *param,
2950 Buffer *mBuf
2951 )
2952 #else
2953 S16 cmUnpkRgUsta(param, mBuf)
2954 RgUsta *param;
2955 Buffer *mBuf;
2956 #endif
2957 {
2958
2959
2960    CMCHKUNPK(cmUnpkCmAlarm, &param->cmAlarm, mBuf);
2961    CMCHKUNPK(cmUnpkRgUstaDgn, &param->dgn, mBuf);
2962    return ROK;
2963 }
2964
2965
2966 \f
2967 /***********************************************************
2968 *
2969 *     Func : cmPkRgTrc
2970 *
2971 *
2972 *     Desc :   This structure holds MAC's Trace Indication information.
2973 *
2974 *
2975 *     Ret  : S16
2976 *
2977 *     Notes:
2978 *
2979 *     File  : 
2980 *
2981 **********************************************************/
2982 #ifdef ANSI
2983 S16 cmPkRgTrc
2984 (
2985 RgTrc *param,
2986 Buffer *mBuf
2987 )
2988 #else
2989 S16 cmPkRgTrc(param, mBuf)
2990 RgTrc *param;
2991 Buffer *mBuf;
2992 #endif
2993 {
2994
2995
2996    CMCHKPK(oduUnpackUInt8, param->evnt, mBuf);
2997    CMCHKPK(cmPkDateTime, &param->dt, mBuf);
2998    return ROK;
2999 }
3000
3001
3002 \f
3003 /***********************************************************
3004 *
3005 *     Func : cmUnpkRgTrc
3006 *
3007 *
3008 *     Desc :   This structure holds MAC's Trace Indication information.
3009 *
3010 *
3011 *     Ret  : S16
3012 *
3013 *     Notes:
3014 *
3015 *     File  : 
3016 *
3017 **********************************************************/
3018 #ifdef ANSI
3019 S16 cmUnpkRgTrc
3020 (
3021 RgTrc *param,
3022 Buffer *mBuf
3023 )
3024 #else
3025 S16 cmUnpkRgTrc(param, mBuf)
3026 RgTrc *param;
3027 Buffer *mBuf;
3028 #endif
3029 {
3030
3031
3032    CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
3033    CMCHKUNPK(oduPackUInt8, &param->evnt, mBuf);
3034    return ROK;
3035 }
3036
3037
3038 \f
3039 /***********************************************************
3040 *
3041 *     Func : cmPkRgDbgCntrl
3042 *
3043 *
3044 *     Desc :   This structure holds MAC's Debug Control information.
3045 *
3046 *
3047 *     Ret  : S16
3048 *
3049 *     Notes:
3050 *
3051 *     File  : 
3052 *
3053 **********************************************************/
3054 #ifdef ANSI
3055 S16 cmPkRgDbgCntrl
3056 (
3057 RgDbgCntrl *param,
3058 Buffer *mBuf
3059 )
3060 #else
3061 S16 cmPkRgDbgCntrl(param, mBuf)
3062 RgDbgCntrl *param;
3063 Buffer *mBuf;
3064 #endif
3065 {
3066
3067
3068    CMCHKPK(oduUnpackUInt32, param->dbgMask, mBuf);
3069    return ROK;
3070 }
3071
3072 #ifdef PHY_ERROR_LOGING
3073 /***********************************************************
3074 *
3075 *     Func : cmPkRgSchUlAllocCntrl
3076 *
3077 *
3078 *     Desc :   This structure holds MAC's Debug Control information.
3079 *
3080 *
3081 *     Ret  : S16
3082 *
3083 *     Notes:
3084 *
3085 *     File  : 
3086 *
3087 **********************************************************/
3088 #ifdef ANSI
3089 S16 cmPkRgSchUlAllocCntrl
3090 (
3091 RgSchUlAllocCntrl *param,
3092 Buffer *mBuf
3093 )
3094 #else
3095 S16 cmPkRgSchUlAllocCntrl(param, mBuf)
3096 RgSchUlAllocCntrl *param;
3097 Buffer *mBuf;
3098 #endif
3099 {
3100
3101    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
3102    CMCHKPK(oduUnpackUInt16, param->numOfRb, mBuf);
3103    CMCHKPK(oduUnpackUInt16, param->rbStart, mBuf);
3104    CMCHKPK(oduUnpackUInt8, param->testStart, mBuf);
3105    CMCHKPK(oduUnpackUInt8, param->enaLog, mBuf);
3106    CMCHKPK(oduUnpackUInt16, param->logTime, mBuf);
3107
3108    return ROK;
3109 }
3110
3111 /***********************************************************
3112 *
3113 *     Func : cmUnpkRgSchUlAllocCntrl
3114 *
3115 *
3116 *     Desc :   This structure holds MAC's Scheduler Configuration for Ul Allocation.
3117 *
3118 *
3119 *     Ret  : S16
3120 *
3121 *     Notes:
3122 *
3123 *     File  : 
3124 *
3125 **********************************************************/
3126 #ifdef ANSI
3127 S16 cmUnpkRgSchUlAllocCntrl
3128 (
3129 RgSchUlAllocCntrl *param,
3130 Buffer *mBuf
3131 )
3132 #else
3133 S16 cmUnpkRgSchUlAllocCntrl(param, mBuf)
3134 RgSchUlAllocCntrl *param;
3135 Buffer *mBuf;
3136 #endif
3137 {
3138
3139    CMCHKUNPK(oduPackUInt16, &param->logTime, mBuf);
3140    CMCHKUNPK(oduPackUInt8, &param->enaLog, mBuf);
3141    CMCHKUNPK(oduPackUInt8, &param->testStart, mBuf);
3142    CMCHKUNPK(oduPackUInt16, &param->rbStart, mBuf);
3143    CMCHKUNPK(oduPackUInt16, &param->numOfRb, mBuf);   
3144    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
3145
3146    return ROK;
3147 }
3148
3149
3150 #endif
3151 \f
3152 /***********************************************************
3153 *
3154 *     Func : cmUnpkRgDbgCntrl
3155 *
3156 *
3157 *     Desc :   This structure holds MAC's Debug Control information.
3158 *
3159 *
3160 *     Ret  : S16
3161 *
3162 *     Notes:
3163 *
3164 *     File  : 
3165 *
3166 **********************************************************/
3167 #ifdef ANSI
3168 S16 cmUnpkRgDbgCntrl
3169 (
3170 RgDbgCntrl *param,
3171 Buffer *mBuf
3172 )
3173 #else
3174 S16 cmUnpkRgDbgCntrl(param, mBuf)
3175 RgDbgCntrl *param;
3176 Buffer *mBuf;
3177 #endif
3178 {
3179
3180
3181    CMCHKUNPK(oduPackUInt32, &param->dbgMask, mBuf);
3182    return ROK;
3183 }
3184
3185
3186 \f
3187 /***********************************************************
3188 *
3189 *     Func : cmPkRgSapCntrl
3190 *
3191 *
3192 *     Desc :   This structure holds MAC's SAP Control information.
3193 *
3194 *
3195 *     Ret  : S16
3196 *
3197 *     Notes:
3198 *
3199 *     File  : 
3200 *
3201 **********************************************************/
3202 #ifdef ANSI
3203 S16 cmPkRgSapCntrl
3204 (
3205 RgSapCntrl *param,
3206 Buffer *mBuf
3207 )
3208 #else
3209 S16 cmPkRgSapCntrl(param, mBuf)
3210 RgSapCntrl *param;
3211 Buffer *mBuf;
3212 #endif
3213 {
3214
3215
3216    CMCHKPK(SPkS16, param->spId, mBuf);
3217    CMCHKPK(SPkS16, param->suId, mBuf);
3218    return ROK;
3219 }
3220
3221
3222 \f
3223 /***********************************************************
3224 *
3225 *     Func : cmUnpkRgSapCntrl
3226 *
3227 *
3228 *     Desc :   This structure holds MAC's SAP Control information.
3229 *
3230 *
3231 *     Ret  : S16
3232 *
3233 *     Notes:
3234 *
3235 *     File  : 
3236 *
3237 **********************************************************/
3238 #ifdef ANSI
3239 S16 cmUnpkRgSapCntrl
3240 (
3241 RgSapCntrl *param,
3242 Buffer *mBuf
3243 )
3244 #else
3245 S16 cmUnpkRgSapCntrl(param, mBuf)
3246 RgSapCntrl *param;
3247 Buffer *mBuf;
3248 #endif
3249 {
3250
3251
3252    CMCHKUNPK(SUnpkS16, &param->suId, mBuf);
3253    CMCHKUNPK(SUnpkS16, &param->spId, mBuf);
3254    return ROK;
3255 }
3256
3257
3258 \f
3259 /***********************************************************
3260 *
3261 *     Func : cmPkRgCntrl
3262 *
3263 *
3264 *     Desc :   This structure holds MAC's Control information.
3265 *
3266 *
3267 *     Ret  : S16
3268 *
3269 *     Notes:
3270 *
3271 *     File  : 
3272 *
3273 **********************************************************/
3274 #ifdef ANSI
3275 S16 cmPkRgCntrl
3276 (
3277 RgCntrl *param,
3278 S16 elmnt,
3279 Buffer *mBuf
3280 )
3281 #else
3282 S16 cmPkRgCntrl(param, elmnt, mBuf)
3283 RgCntrl *param;
3284 S16 elmnt;
3285 Buffer *mBuf;
3286 #endif
3287 {
3288
3289
3290       switch(elmnt) {
3291          case STTFUSAP:
3292          case STRGUSAP:
3293          case STRGRSAP:
3294          case STCRGSAP:
3295             switch(param->subAction) {
3296                default :
3297                   CMCHKPK(cmPkRgSapCntrl, &param->s.rgSapCntrl, mBuf);
3298                   break;
3299             }
3300          break;
3301          case STGEN:
3302             switch(param->subAction) {
3303                case SATRC:
3304                   CMCHKPK(SPkS16, param->s.trcLen, mBuf);
3305                   break;
3306                case SADBG:
3307                   CMCHKPK(cmPkRgDbgCntrl, &param->s.rgDbgCntrl, mBuf);
3308                   break;
3309                case SAUSTA:
3310                   break;
3311 #ifdef SS_DIAG
3312                case SALOG:
3313                   CMCHKPK(oduUnpackUInt32,  param->s.logMask, mBuf);
3314                   break;
3315 #endif
3316 #ifdef PHY_ERROR_LOGING
3317                case SAELMNT:
3318              CMCHKPK(cmPkRgSchUlAllocCntrl, &param->s.rgSchUlAllocCntrl, mBuf);
3319                   break;
3320 #endif                     
3321                default :
3322                   break;
3323             }
3324             break;
3325          default :
3326             break;
3327       }
3328    CMCHKPK(oduUnpackUInt8, param->subAction, mBuf);
3329    CMCHKPK(oduUnpackUInt8, param->action, mBuf);
3330    CMCHKPK(cmPkDateTime, &param->dt, mBuf);
3331    return ROK;
3332 }
3333
3334
3335 \f
3336 /***********************************************************
3337 *
3338 *     Func : cmUnpkRgCntrl
3339 *
3340 *
3341 *     Desc :   This structure holds MAC's Control information.
3342 *
3343 *
3344 *     Ret  : S16
3345 *
3346 *     Notes:
3347 *
3348 *     File  : 
3349 *
3350 **********************************************************/
3351 #ifdef ANSI
3352 S16 cmUnpkRgCntrl
3353 (
3354 RgCntrl *param,
3355 S16 elmnt,
3356 Buffer *mBuf
3357 )
3358 #else
3359 S16 cmUnpkRgCntrl(param, elmnt, mBuf)
3360 RgCntrl *param;
3361 S16 elmnt;
3362 Buffer *mBuf;
3363 #endif
3364 {
3365
3366
3367    CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
3368    CMCHKUNPK(oduPackUInt8, &param->action, mBuf);
3369    CMCHKUNPK(oduPackUInt8, &param->subAction, mBuf);
3370       switch(elmnt) {
3371          case STGEN:
3372             switch(param->subAction) {
3373                case SADBG:
3374                   CMCHKUNPK(cmUnpkRgDbgCntrl, &param->s.rgDbgCntrl, mBuf);
3375                   break;
3376                case SATRC:
3377                   CMCHKUNPK(SUnpkS16, &param->s.trcLen, mBuf);
3378                   break;
3379                case SAUSTA:
3380                   break;
3381 #ifdef SS_DIAG
3382                case SALOG:
3383                   CMCHKUNPK(oduPackUInt32, &param->s.logMask, mBuf);
3384                   break;
3385 #endif
3386 #ifdef PHY_ERROR_LOGING
3387                case SAELMNT:
3388                               CMCHKUNPK(cmUnpkRgSchUlAllocCntrl, &param->s.rgSchUlAllocCntrl, mBuf);
3389                               break;
3390 #endif                     
3391                default :
3392                   break;
3393             }
3394          break;
3395          case STTFUSAP:
3396          case STRGUSAP:
3397          case STRGRSAP:
3398          case STCRGSAP:
3399             switch(param->subAction) {
3400                default :
3401                   CMCHKUNPK(cmUnpkRgSapCntrl, &param->s.rgSapCntrl, mBuf);
3402                   break;
3403             }
3404             break;
3405          default :
3406             break;
3407       }
3408    return ROK;
3409 }
3410
3411
3412 \f
3413 /***********************************************************
3414 *
3415 *     Func : cmPkRgMngmt
3416 *
3417 *
3418 *     Desc :   This structure holds MAC's Configuration and Control Management Information.
3419 *
3420 *
3421 *     Ret  : S16
3422 *
3423 *     Notes:
3424 *
3425 *     File  : 
3426 *
3427 **********************************************************/
3428 #ifdef ANSI
3429 S16 cmPkRgMngmt
3430 (
3431 Pst *pst,
3432 RgMngmt *param,
3433 uint8_t eventType,
3434 Buffer *mBuf
3435 )
3436 #else
3437 S16 cmPkRgMngmt(pst, param, eventType, mBuf)
3438 Pst *pst;
3439 RgMngmt *param;
3440 uint8_t eventType;
3441 Buffer *mBuf;
3442 #endif
3443 {
3444
3445
3446       switch(eventType) {
3447          case EVTLRGCNTRLREQ:
3448          case  EVTLRGCNTRLCFM:
3449          case EVTLRGSCHCNTRLREQ:
3450          case  EVTLRGSCHCNTRLCFM:
3451             if(cmPkRgCntrl(&param->t.cntrl, param->hdr.elmId.elmnt, mBuf) != ROK)
3452                return RFAILED;
3453             break;
3454          case EVTLRGTRCIND:
3455             CMCHKPK(cmPkRgTrc, &param->t.trc, mBuf);
3456             break;
3457          case EVTLRGUSTAIND:
3458          case EVTLRGSCHSTAIND:
3459             CMCHKPK(cmPkRgUsta, &param->t.usta, mBuf);
3460             break;
3461          case EVTLRGSSTAREQ:
3462          case  EVTLRGSSTACFM:
3463             /*ccpu00118255 - ADD - eventType param */
3464 #ifdef LRG_V1
3465             if(cmPkRgSsta(pst, &param->t.ssta, param->hdr.elmId.elmnt,
3466                      eventType, mBuf) != ROK)
3467                return RFAILED;
3468 #else /* LRG_V1 is not defined */
3469             if(cmPkRgSsta(pst, &param->t.ssta, param->hdr.elmId.elmnt, mBuf) != ROK)
3470                return RFAILED;
3471 #endif /* end of LRG_V1*/            
3472             break;
3473          case EVTLRGSTSREQ:
3474          case  EVTLRGSTSCFM:
3475             if(cmPkRgSts(&param->t.sts, param->hdr.elmId.elmnt, mBuf)!= ROK)
3476                return RFAILED;
3477             break;
3478          case EVTLRGCFGREQ:
3479          case  EVTLRGCFGCFM:
3480             if(cmPkRgCfg(&param->t.cfg, param->hdr.elmId.elmnt, mBuf) != ROK)
3481                return RFAILED;
3482             break;
3483          case EVTMACSCHGENCFGREQ:
3484          case  EVTMACSCHGENCFGCFM:
3485             if(cmPkRgCfg(&param->t.cfg, param->hdr.elmId.elmnt, mBuf) != ROK)
3486                return RFAILED;
3487             break;
3488          default :
3489             return RFAILED;
3490       }
3491    CMCHKPK(cmPkCmStatus, &param->cfm, mBuf);
3492    CMCHKPK(cmPkHeader, &param->hdr, mBuf);
3493    return ROK;
3494 }
3495
3496
3497 \f
3498 /***********************************************************
3499 *
3500 *     Func : cmUnpkRgMngmt
3501 *
3502 *
3503 *     Desc :   This structure holds MAC's Configuration and Control Management Information.
3504 *
3505 *
3506 *     Ret  : S16
3507 *
3508 *     Notes:
3509 *
3510 *     File  : 
3511 *
3512 **********************************************************/
3513 #ifdef ANSI
3514 S16 cmUnpkRgMngmt
3515 (
3516 Pst *pst,
3517 RgMngmt *param,
3518 uint8_t eventType,
3519 Buffer *mBuf
3520 )
3521 #else
3522 S16 cmUnpkRgMngmt(pst, param, eventType, mBuf)
3523 Pst *pst;
3524 RgMngmt *param;
3525 uint8_t eventType;
3526 Buffer *mBuf;
3527 #endif
3528 {
3529
3530
3531    CMCHKUNPK(cmUnpkHeader, &param->hdr, mBuf);
3532    CMCHKUNPK(cmUnpkCmStatus, &param->cfm, mBuf);
3533       switch(eventType) {
3534          case EVTLRGCFGREQ:
3535          case  EVTLRGCFGCFM:
3536          case EVTMACSCHGENCFGREQ:
3537          case  EVTMACSCHGENCFGCFM:
3538             if(cmUnpkRgCfg(&param->t.cfg, param->hdr.elmId.elmnt, mBuf) != ROK)
3539                return RFAILED;
3540             break;
3541          case EVTLRGSTSREQ:
3542          case  EVTLRGSTSCFM:
3543             if(cmUnpkRgSts(&param->t.sts, param->hdr.elmId.elmnt, mBuf) != ROK)
3544                return RFAILED;
3545             break;
3546          case EVTLRGSSTAREQ:
3547          case  EVTLRGSSTACFM:
3548             if(cmUnpkRgSsta(pst, &param->t.ssta, param->hdr.elmId.elmnt, mBuf) != ROK)
3549                return RFAILED;
3550             break;
3551          case EVTLRGUSTAIND:
3552          case EVTLRGSCHSTAIND:
3553             CMCHKUNPK(cmUnpkRgUsta, &param->t.usta, mBuf);
3554             break;
3555          case EVTLRGTRCIND:
3556             CMCHKUNPK(cmUnpkRgTrc, &param->t.trc, mBuf);
3557             break;
3558          case EVTLRGCNTRLREQ:
3559          case  EVTLRGCNTRLCFM:
3560          case EVTLRGSCHCNTRLREQ:
3561          case  EVTLRGSCHCNTRLCFM:
3562             if(cmUnpkRgCntrl(&param->t.cntrl, param->hdr.elmId.elmnt, mBuf) != ROK)
3563                return RFAILED;
3564             break;
3565          default :
3566             return RFAILED;
3567       }
3568    return ROK;
3569 }
3570
3571 /* lrg_c_001.main_3 - ADD -  Added the functions pertaining to LTE_L2_MEAS  */
3572 #ifdef LTE_L2_MEAS
3573 \f
3574 /**
3575 * @brief This API is used to pack 
3576  LrgNmbActvUeQCI elements
3577 *
3578 * @details
3579 *
3580 *     Function: cmPkNmbActvUeQciReq
3581 *
3582 *  @param[in]   LrgNmbActvUeQCI
3583 *  @param[in]   Buffer   *mBuf
3584 *  @return   S16
3585 *      -# ROK
3586 **/
3587 #ifdef ANSI
3588 PRIVATE S16  cmPkNmbActvUeQciReq
3589 (
3590 LrgNmbActvUeQCI   *nmbActvUeQci, 
3591 Buffer        *mBuf
3592 )
3593 #else
3594 PRIVATE S16 cmPkNmbActvUeQciReq(nmbActvUeQci, mBuf)
3595 LrgNmbActvUeQCI   *nmbActvUeQci;
3596 Buffer        *mBuf;
3597 #endif
3598 {
3599    uint8_t      idx;
3600
3601    
3602    for(idx = 0; idx < nmbActvUeQci->numQci; idx++)
3603    {
3604        CMCHKPK(oduUnpackUInt8, nmbActvUeQci->qci[idx], mBuf);
3605    }
3606    CMCHKPK(oduUnpackUInt8, nmbActvUeQci->numQci, mBuf);
3607    CMCHKPK(oduUnpackUInt8, nmbActvUeQci->sampPrd, mBuf);
3608    return ROK;
3609 }
3610 \f
3611 /**
3612 * @brief This API is used to pack 
3613  LrgAvgPrbQci elements
3614 *
3615 * @details
3616 *
3617 *     Function: cmPkAvgPrbQciReq
3618 *
3619 *  @param[in]   LrgNmbActvUeQciReq  *avgPrbQciReq
3620 *  @param[in]   Buffer   *mBuf
3621 *  @return   S16
3622 *      -# ROK
3623 **/
3624 #ifdef ANSI
3625 PRIVATE S16  cmPkAvgPrbQciReq
3626 (
3627 LrgAvgPrbQCI  *avgPrbQciReq,
3628 Buffer        *mBuf
3629 )
3630 #else
3631 PRIVATE S16 cmPkAvgPrbQciReq(avgPrbQciReq, mBuf)
3632 LrgAvgPrbQCI  *avgPrbQciReq;
3633 Buffer        *mBuf;
3634 #endif
3635 {
3636    uint8_t      idx;
3637
3638    for(idx = 0; idx < avgPrbQciReq->numQci; idx++)
3639    {
3640        CMCHKPK(oduUnpackUInt8, avgPrbQciReq->qci[idx], mBuf);
3641    }
3642    CMCHKPK(oduUnpackUInt8, avgPrbQciReq->numQci, mBuf);
3643    return ROK;
3644
3645 }
3646 \f
3647 /**
3648 * @brief This API is used to send a 
3649 L2 Measurement Request from LM to MAC.
3650 *
3651 * @details
3652 *
3653 *     Function: cmPkLrgSchL2MeasReq
3654 *
3655 *  @param[in]   Pst *  pst
3656 *  @param[in]   LrgSchMeasReqInfo  *  measInfo
3657 *  @return   S16
3658 *      -# ROK
3659 **/
3660 #ifdef ANSI
3661 S16 cmPkLrgSchL2MeasReq
3662 (
3663 Pst * pst,
3664 LrgSchMeasReqInfo  *measInfo
3665 )
3666 #else
3667 S16 cmPkLrgSchL2MeasReq(pst, measInfo)
3668 Pst * pst;
3669 LrgSchMeasReqInfo  *measInfo;
3670 #endif
3671 {
3672    Buffer *mBuf = NULLP;
3673
3674    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3675 #if (ERRCLASS & ERRCLS_ADD_RES)
3676       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3677          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3678          (ErrVal)ELRG049, (ErrVal)0, "SGetMsg failed");
3679 #endif
3680       return RFAILED;
3681    }
3682    if(measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
3683    {
3684       CMCHKPK(cmPkNmbActvUeQciReq, &measInfo->nmbActvUeQciDl, mBuf);
3685    }
3686    if(measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
3687    {
3688       CMCHKPK(cmPkNmbActvUeQciReq, &measInfo->nmbActvUeQciUl, mBuf);
3689    }
3690    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
3691    {
3692       CMCHKPK(cmPkAvgPrbQciReq, &measInfo->avgPrbQciDl, mBuf);
3693    }
3694    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL)
3695    {
3696       CMCHKPK(cmPkAvgPrbQciReq, &measInfo->avgPrbQciUl, mBuf);
3697    }
3698
3699    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
3700    CMCHKPK(oduUnpackUInt32, measInfo->timePrd, mBuf);
3701    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
3702    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
3703    pst->event = (Event) EVTLRGSCHL2MEASREQ;
3704    return (SPstTsk(pst,mBuf));
3705 }
3706 /**
3707 * @brief This API is used to stop a 
3708 L2 Measurement Request from LM to MAC.
3709 *
3710 * @details
3711 *
3712 *     Function: cmPkLrgSchL2MeasStopReq
3713 *
3714 *  @param[in]   Pst *  pst
3715 *  @param[in]   LrgSchMeasReqInfo  *  measInfo
3716 *  @return   S16
3717 *      -# ROK
3718 **/
3719 #ifdef ANSI
3720 S16 cmPkLrgSchL2MeasStopReq
3721 (
3722 Pst * pst,
3723 LrgSchMeasStopReqInfo *measInfo
3724 )
3725 #else
3726 S16 cmPkLrgSchL2MeasStopReq(pst, measInfo)
3727 Pst * pst;
3728 LrgSchMeasStopReqInfo *measInfo;
3729 #endif
3730 {
3731    Buffer *mBuf = NULLP;
3732
3733  if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3734 #if (ERRCLASS & ERRCLS_ADD_RES)
3735       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3736          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3737          (ErrVal)ELRG049, (ErrVal)0, "SGetMsg failed");
3738 #endif
3739       return RFAILED;
3740    }
3741    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
3742    /*CMCHKPK(oduUnpackUInt16, measInfo->timePrd, mBuf);*/
3743    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
3744    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
3745    pst->event = (Event) EVTLRGSCHL2MEASSTOPREQ;
3746    return (SPstTsk(pst,mBuf));
3747 }/*cmPkLrgSchL2MeasStopReq*/
3748
3749 /**
3750 * @brief This API is used to send a 
3751 L2 Measurement Request from LM to MAC.
3752 *
3753 * @details
3754 *
3755 *     Function: cmPkLrgSchL2MeasSendReq
3756 *
3757 *  @param[in]   Pst *  pst
3758 *  @param[in]   LrgSchMeasReqInfo  *  measInfo
3759 *  @return   S16
3760 *      -# ROK
3761 **/
3762 #ifdef ANSI
3763 S16 cmPkLrgSchL2MeasSendReq
3764 (
3765 Pst * pst,
3766 LrgSchMeasSndReqInfo *measInfo
3767 )
3768 #else
3769 S16 cmPkLrgSchL2MeasSendReq(pst, measInfo)
3770 Pst * pst;
3771 LrgSchMeasSndReqInfo *measInfo;
3772 #endif
3773 {
3774    Buffer *mBuf = NULLP;
3775  if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3776 #if (ERRCLASS & ERRCLS_ADD_RES)
3777       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3778          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3779          (ErrVal)ELRG049, (ErrVal)0, "SGetMsg failed");
3780 #endif
3781       return RFAILED;
3782    }
3783    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
3784    CMCHKPK(oduUnpackUInt32, measInfo->timePrd, mBuf);
3785    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
3786    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
3787    pst->event = (Event) EVTLRGSCHL2MEASSENDREQ;
3788    return (SPstTsk(pst,mBuf));
3789 }/*cmPkLrgSchL2MeasSendReq*/
3790 \f
3791 /**
3792 * @brief This API is used to unpack AvgPrbQciReq
3793 *
3794 * @details
3795 *
3796 *     Function: cmUnpkNmbActvUeQciReq
3797 *
3798 *  @param[in]   LrgNmbActvUeQCI     *param
3799 *  @param[in]   Buffer * mBuf
3800 *  @return   S16
3801 *      -# ROK
3802 **/
3803 #ifdef ANSI
3804 PRIVATE S16 cmUnpkNmbActvUeQciReq
3805 (
3806 LrgNmbActvUeQCI  *param,
3807 Buffer           *mBuf
3808 )
3809 #else
3810 PRIVATE S16 cmUnpkNmbActvUeQciReq(param, mBuf)
3811 LrgNmbActvUeQCI  *param;
3812 Buffer           *mBuf;
3813 #endif
3814 {
3815    uint8_t     idx;
3816
3817    CMCHKUNPK(oduPackUInt8, &param->sampPrd, mBuf);
3818    CMCHKUNPK(oduPackUInt8, &param->numQci, mBuf);
3819    for(idx = param->numQci; idx > 0; idx--)
3820    {
3821       CMCHKUNPK(oduPackUInt8, &param->qci[idx - 1], mBuf);
3822    }
3823
3824    return ROK;
3825 }
3826 \f
3827 /**
3828 * @brief This API is used to unpack AvgPrbQciReq
3829 *
3830 * @details
3831 *
3832 *     Function: cmUnpkAvgPrbQciReq
3833 *
3834 *  @param[in]   LrgAvgPrbQCI     *param
3835 *  @param[in]   Buffer * mBuf
3836 *  @return   S16
3837 *      -# ROK
3838 **/
3839 #ifdef ANSI
3840 PRIVATE S16 cmUnpkAvgPrbQciReq
3841 (
3842 LrgAvgPrbQCI     *param,
3843 Buffer           *mBuf
3844 )
3845 #else
3846 PRIVATE S16 cmUnpkAvgPrbQciReq (param, mBuf)
3847 LrgAvgPrbQCI     *param;
3848 Buffer           *mBuf;
3849 #endif
3850 {
3851    uint8_t     idx;
3852
3853
3854    CMCHKUNPK(oduPackUInt8, &param->numQci, mBuf);
3855    for(idx = param->numQci; idx > 0; idx--)
3856    {
3857       CMCHKUNPK(oduPackUInt8, &param->qci[idx - 1], mBuf);
3858    }
3859    return ROK;
3860
3861 }
3862 \f
3863 /**
3864 * @brief This API is used to send a 
3865 Measurement  Request from LM to SCH.
3866 *
3867 * @details
3868 *
3869 *     Function: cmUnpkLrgSchL2MeasReq
3870 *
3871 *  @param[in]   LrgSchMeasReq func
3872 *  @param[in]   Pst *  pst
3873 *  @param[in]   Buffer * mBuf
3874 *  @return   S16
3875 *      -# ROK
3876 **/
3877 #ifdef ANSI
3878 S16 cmUnpkLrgSchL2MeasReq
3879 (
3880 LrgSchL2MeasReq func,
3881 Pst *pst,
3882 Buffer *mBuf
3883 )
3884 #else
3885 S16 cmUnpkLrgSchL2MeasReq(func, pst, mBuf)
3886 LrgSchL2MeasReq func;
3887 Pst *pst;
3888 Buffer *mBuf;
3889 #endif
3890 {
3891    LrgSchMeasReqInfo  measInfo;
3892
3893
3894    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
3895    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
3896    CMCHKUNPK(oduPackUInt32, &measInfo.timePrd, mBuf);
3897    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
3898    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL)
3899    {
3900       CMCHKUNPK(cmUnpkAvgPrbQciReq, &measInfo.avgPrbQciUl, mBuf);
3901    }
3902    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
3903    {
3904       CMCHKUNPK(cmUnpkAvgPrbQciReq, &measInfo.avgPrbQciDl, mBuf);
3905    }
3906    if(measInfo.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
3907    {
3908       CMCHKUNPK(cmUnpkNmbActvUeQciReq, &measInfo.nmbActvUeQciUl, mBuf);
3909    }
3910    if(measInfo.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
3911    {
3912       CMCHKUNPK(cmUnpkNmbActvUeQciReq, &measInfo.nmbActvUeQciDl, mBuf);
3913    }
3914    SPutMsg(mBuf);
3915    return ((*func)(pst, &measInfo));
3916 }
3917
3918 /**
3919 * @brief This API is used to stop  a 
3920 Measurement  Request from LM to SCH.
3921 *
3922 * @details
3923 *
3924 *     Function: cmUnpkLrgSchL2MeasStopReq
3925 *
3926 *  @param[in]   LrgSchMeasStopReq func
3927 *  @param[in]   Pst *  pst
3928 *  @param[in]   Buffer * mBuf
3929 *  @return   S16
3930 *      -# ROK
3931 **/
3932 #ifdef ANSI
3933 S16 cmUnpkLrgSchL2MeasStopReq
3934 (
3935 LrgSchL2MeasStopReq func,
3936 Pst *pst,
3937 Buffer *mBuf
3938 )
3939 #else
3940 S16 cmUnpkLrgSchL2MeasStopReq(func, pst, mBuf)
3941 LrgSchL2MeasStopReq func;
3942 Pst *pst;
3943 Buffer *mBuf;
3944 #endif
3945 {
3946    LrgSchMeasStopReqInfo measInfo;
3947
3948    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
3949    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
3950    /*CMCHKUNPK(oduPackUInt16, &measInfo.timePrd, mBuf);*/
3951    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
3952    SPutMsg(mBuf);
3953    return ((*func)(pst, &measInfo));
3954 }/*cmUnpkLrgSchL2MeasStopReq*/
3955
3956 /**
3957 * @brief This API is used to send a 
3958 Measurement  Request from LM to SCH.
3959 *
3960 * @details
3961 *
3962 *     Function: cmUnpkLrgSchL2MeasSendReq
3963 *
3964 *  @param[in]   LrgSchMeasSendReq func
3965 *  @param[in]   Pst *  pst
3966 *  @param[in]   Buffer * mBuf
3967 *  @return   S16
3968 *      -# ROK
3969 **/
3970 #ifdef ANSI
3971 S16 cmUnpkLrgSchL2MeasSendReq
3972 (
3973 LrgSchL2MeasSendReq func,
3974 Pst *pst,
3975 Buffer *mBuf
3976 )
3977 #else
3978 S16 cmUnpkLrgSchL2MeasSendReq(func, pst, mBuf)
3979 LrgSchL2MeasSendReq func;
3980 Pst *pst;
3981 Buffer *mBuf;
3982 #endif
3983 {
3984    LrgSchMeasSndReqInfo measInfo;
3985    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
3986    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
3987    CMCHKUNPK(oduPackUInt32, &measInfo.timePrd, mBuf);
3988    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
3989    SPutMsg(mBuf);
3990    return ((*func)(pst, &measInfo));
3991 }/*cmUnpkLrgSchL2MeasSendReq*/
3992
3993 /**
3994 * @brief This API is used to stop a 
3995 L2 Measurement confirm from MAC to LM
3996 *
3997 * @details
3998 *
3999 *     Function: cmPkLrgSchL2MeasStopCfm
4000 *
4001 *  @param[in]   Pst *  pst
4002 *  @param[in]   LrgSchMeasCfmInfo  *  measInfo
4003 *  @return   S16
4004 *      -# ROK
4005 **/
4006 #ifdef ANSI
4007 S16 cmPkLrgSchL2MeasStopCfm
4008 (
4009 Pst * pst,
4010 LrgSchMeasCfmInfo  *measInfo
4011 )
4012 #else
4013 S16 cmPkLrgSchL2MeasStopCfm(pst, measInfo)
4014 Pst * pst;
4015 LrgSchMeasCfmInfo  *measInfo;
4016 #endif
4017 {
4018    Buffer *mBuf = NULLP;
4019
4020  if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
4021 #if (ERRCLASS & ERRCLS_ADD_RES)
4022       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
4023          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
4024          (ErrVal)ELRG050, (ErrVal)0, "SGetMsg failed");
4025 #endif
4026       return RFAILED;
4027    }
4028    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
4029    CMCHKPK(cmPkCmStatus, &measInfo->cfm, mBuf);
4030    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
4031    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
4032    pst->event = (Event) EVTLRGSCHL2MEASSTOPCFM;
4033    return (SPstTsk(pst,mBuf));
4034 }/*cmPkLrgSchL2MeasStopCfm*/
4035 /**
4036 * @brief This API is used to Send a 
4037 Measurement  Confirm from SCH to LM.
4038 *
4039 * @details
4040 *
4041 *     Function: cmUnpkLrgL2SchMeasCfm
4042 *
4043 *  @param[in]   Pst *  pst
4044 *  @param[in]   Buffer * mBuf
4045 *  @return   S16
4046 *      -# ROK
4047 **/
4048 #ifdef ANSI
4049 S16 cmUnpkLrgSchL2MeasStopCfm
4050 (
4051 LrgSchL2MeasStopCfm func,
4052 Pst *pst,
4053 Buffer *mBuf
4054 )
4055 #else
4056 S16 cmUnpkLrgSchL2MeasStopCfm(func, pst, mBuf)
4057 LrgSchL2MeasStopCfm func;
4058 Pst *pst;
4059 Buffer *mBuf;
4060 #endif
4061 {
4062    LrgSchMeasCfmInfo  measInfo;
4063
4064
4065    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
4066    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
4067    CMCHKUNPK(cmUnpkCmStatus, &measInfo.cfm, mBuf);
4068    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
4069
4070    SPutMsg(mBuf);
4071    return ((*func)(pst, &measInfo));
4072 }/*cmUnpkLrgSchL2MeasStopCfm*/
4073 \f
4074 /**
4075 * @brief This API is used to unpack LrgNumActvUeQCICfm structure
4076 *
4077 * @details
4078 *
4079 *     Function: cmPkNumUeQciCfm 
4080 *
4081 *  @param[in]   LrgNumActvUeQCICfm *  param
4082 *  @param[in]   Buffer *  mBuf
4083 *  @return   S16
4084 *      -# ROK
4085 **/
4086 #ifdef ANSI
4087 PRIVATE S16 cmPkNumUeQciCfm
4088 (
4089 LrgNumActvUeQCICfm  *param,
4090 Buffer              *mBuf
4091 )
4092 #else
4093 PRIVATE S16 cmPkNumUeQciCfm(param, mBuf)
4094 LrgNumActvUeQCICfm *param;
4095 Buffer             *mBuf;
4096 #endif
4097 {
4098    uint8_t         idx;
4099
4100    
4101    for(idx = 0; idx < param->numQci; idx++)
4102    {
4103 /*LRG : Review Tag*/
4104      CMCHKPK(oduUnpackUInt8, param->numActvUeQci[idx].qciValue, mBuf);
4105      CMCHKPK(oduUnpackUInt8, param->numActvUeQci[idx].numActvUeQci, mBuf);
4106 /*LRG : Review Tag*/
4107    }
4108    CMCHKPK(oduUnpackUInt8, param->numQci, mBuf);
4109    return ROK;
4110 }
4111 \f
4112 /**
4113 * @brief This API is used to unpack LrgAvgPrbQCICfm structure
4114 *
4115 * @details
4116 *
4117 *     Function: cmPkAvgPrbQciCfm
4118 *
4119 *  @param[in]   LrgAvgPrbQCICfm *  param
4120 *  @param[in]   Buffer *  mBuf
4121 *  @return   S16
4122 *      -# ROK
4123 **/
4124 #ifdef ANSI
4125 PRIVATE S16 cmPkAvgPrbQciCfm
4126 (
4127 LrgAvgPrbQCICfm    *param,
4128 Buffer             *mBuf
4129 )
4130 #else
4131 PRIVATE S16  cmPkAvgPrbQciCfm(param, mBuf)
4132 LrgAvgPrbQCICfm    *param;
4133 Buffer             *mBuf;
4134 #endif
4135 {
4136    uint8_t         idx;
4137
4138    for(idx = 0; idx < param->numQci; idx++)
4139    {
4140 /*LRG : Review Tag*/
4141       CMCHKPK(oduUnpackUInt8, param->prbPercQci[idx].qciValue, mBuf);
4142       CMCHKPK(oduUnpackUInt8, param->prbPercQci[idx].prbPercQci, mBuf);
4143 /*LRG : Review Tag*/
4144    } 
4145    CMCHKPK(oduUnpackUInt8, param->numQci, mBuf);
4146    return ROK;
4147 }
4148 \f
4149 /**
4150 * @brief This API is used to unpack raPreamblesCfm structure
4151 *
4152 * @details
4153 *
4154 *     Function: cmPkRaPrmbsCfm
4155 *
4156 *  @param[in]   LrgRaPreamblesCfm *  param
4157 *  @param[in]   Buffer *  mBuf
4158 *  @return   S16
4159 *      -# ROK
4160 **/
4161 #ifdef ANSI
4162 PRIVATE S16 cmPkRaPrmbsCfm
4163 (
4164 LrgRaPreamblesCfm  *param,
4165 Buffer             *mBuf
4166 )
4167 #else
4168 PRIVATE S16 cmPkRaPrmbsCfm(param, mBuf)
4169 LrgRaPreamblesCfm  *param;
4170 Buffer             *mBuf;
4171 #endif
4172 {
4173
4174    CMCHKPK(oduUnpackUInt16, param->randSelPreHighRange, mBuf);
4175    CMCHKPK(oduUnpackUInt16, param->randSelPreLowRange, mBuf);
4176    CMCHKPK(oduUnpackUInt16, param->dedPreambles, mBuf);
4177    return ROK;
4178 }
4179 \f
4180 /**
4181 * @brief This API is used to unpack avgPrbCfm structure
4182 *
4183 * @details
4184 *
4185 *     Function: cmPkAvgPrbCfm
4186 *
4187 *  @param[in]   LrgAvgPrbCfm *  param
4188 *  @param[in]   Buffer *  mBuf
4189 *  @return   S16
4190 *      -# ROK
4191 **/
4192 #ifdef ANSI
4193 PRIVATE S16 cmPkAvgPrbCfm 
4194 (
4195 LrgAvgPrbCfm  *param,
4196 Buffer        *mBuf
4197 )
4198 #else
4199 PRIVATE S16 cmPkAvgPrbCfm(param, mBuf)
4200 LrgAvgPrbCfm  *param;
4201 Buffer        *mBuf;
4202 #endif
4203 {
4204
4205    CMCHKPK(oduUnpackUInt8, param->prbPerc, mBuf);
4206    return ROK;
4207 }
4208 \f
4209 /**
4210 * @brief This API is used to send a 
4211 L2 Measurement confirm from MAC to LM
4212 *
4213 * @details
4214 *
4215 *     Function: cmPkLrgSchL2MeasCfm
4216 *
4217 *  @param[in]   Pst *  pst
4218 *  @param[in]   LrgSchMeasCfmInfo  *  measInfo
4219 *  @return   S16
4220 *      -# ROK
4221 **/
4222 #ifdef ANSI
4223 S16 cmPkLrgSchL2MeasCfm
4224 (
4225 Pst * pst,
4226 LrgSchMeasCfmInfo  *measInfo
4227 )
4228 #else
4229 S16 cmPkLrgSchL2MeasCfm(pst, measInfo)
4230 Pst * pst;
4231 LrgSchMeasCfmInfo  *measInfo;
4232 #endif
4233 {
4234    Buffer *mBuf = NULLP;
4235
4236
4237    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
4238 #if (ERRCLASS & ERRCLS_ADD_RES)
4239       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
4240          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
4241          (ErrVal)ELRG050, (ErrVal)0, "SGetMsg failed");
4242 #endif
4243       return RFAILED;
4244    }
4245    if(measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
4246    {
4247      CMCHKPK(cmPkNumUeQciCfm, &measInfo->numUeQciDlCfm, mBuf);
4248    }
4249    if(measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
4250    {
4251      CMCHKPK(cmPkNumUeQciCfm, &measInfo->numUeQciUlCfm, mBuf);
4252    }
4253    if(measInfo->measType & LRG_L2MEAS_RA_PREAMBLE)
4254    {
4255      CMCHKPK(cmPkRaPrmbsCfm, &measInfo->raPrmbsCfm, mBuf);
4256    }
4257    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
4258    {
4259      CMCHKPK(cmPkAvgPrbQciCfm, &measInfo->avgPrbQciDlCfm, mBuf);
4260    }
4261    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL)
4262    {
4263      CMCHKPK(cmPkAvgPrbQciCfm, &measInfo->avgPrbQciUlCfm, mBuf);
4264    }
4265    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_DL)
4266    {
4267      CMCHKPK(cmPkAvgPrbCfm, &measInfo->avgPrbDl, mBuf);
4268    }
4269    if(measInfo->measType & LRG_L2MEAS_AVG_PRB_UL)
4270    {
4271      CMCHKPK(cmPkAvgPrbCfm, &measInfo->avgPrbUl, mBuf);
4272    }
4273    if(measInfo->measType & LRG_L2MEAS_TB_TRANS_DL_COUNT)
4274    {
4275       CMCHKPK(oduUnpackUInt32, measInfo->tbTransDlTotalCnt, mBuf);
4276    }   
4277    if(measInfo->measType & LRG_L2MEAS_TB_TRANS_DL_FAULTY_COUNT)
4278    {
4279       CMCHKPK(oduUnpackUInt32, measInfo->tbTransDlFaulty, mBuf);
4280    }   
4281    if(measInfo->measType & LRG_L2MEAS_TB_TRANS_UL_COUNT)
4282    {
4283       CMCHKPK(oduUnpackUInt32, measInfo->tbTransUlTotalCnt, mBuf);
4284    }   
4285    if(measInfo->measType & LRG_L2MEAS_TB_TRANS_UL_FAULTY_COUNT)
4286    {
4287       CMCHKPK(oduUnpackUInt32, measInfo->tbTransUlFaulty, mBuf);
4288    }   
4289    CMCHKPK(cmPkLteCellId, measInfo->cellId, mBuf);
4290    CMCHKPK(cmPkCmStatus, &measInfo->cfm, mBuf);
4291    CMCHKPK(oduUnpackUInt16, measInfo->measType, mBuf);
4292    CMCHKPK(cmPkHeader, &measInfo->hdr, mBuf);
4293    pst->event = (Event) EVTLRGSCHL2MEASCFM;
4294    return (SPstTsk(pst,mBuf));
4295 }
4296 \f
4297 /**
4298 * @brief This API is used to unpack LrgNumActvUeQCICfm
4299 *
4300 * @details
4301 *
4302 *     Function: cmUnpkNumUeQciCfm
4303 *
4304 *  @param[in]   LrgNumActvUeQCICfm *param
4305 *  @param[in]   Buffer * mBuf
4306 *  @return   Void
4307 *      -# ROK
4308 **/
4309 #ifdef ANSI
4310 PRIVATE S16 cmUnpkNumUeQciCfm
4311 (
4312 LrgNumActvUeQCICfm *param,
4313 Buffer          *mBuf
4314 )
4315 #else
4316 PRIVATE S16 cmUnpkNumUeQciCfm(param, mBuf)
4317 LrgNumActvUeQCICfm *param; 
4318 Buffer          *mBuf;
4319 #endif
4320 {
4321    uint8_t          idx;
4322
4323    CMCHKUNPK(oduPackUInt8, &param->numQci, mBuf);
4324    for(idx = param->numQci; idx > 0; idx--)
4325    {
4326 /*LRG : Review Tag*/
4327        CMCHKUNPK(oduPackUInt8, &param->numActvUeQci[idx - 1].numActvUeQci, mBuf);
4328        CMCHKUNPK(oduPackUInt8, &param->numActvUeQci[idx - 1].qciValue, mBuf);
4329 /*LRG : Review Tag*/
4330    }
4331    return ROK;
4332 }
4333 \f
4334 /**
4335 * @brief This API is used to unpack LrgAvgPrbQCICfm
4336 *
4337 * @details
4338 *
4339 *     Function: cmUnpkAvgPrbQciCfm
4340 *
4341 *  @param[in]   LrgAvgPrbQCICfm *param
4342 *  @param[in]   Buffer * mBuf
4343 *  @return  Void 
4344 *      -# ROK
4345 **/
4346 #ifdef ANSI
4347 PRIVATE S16 cmUnpkAvgPrbQciCfm
4348 (
4349 LrgAvgPrbQCICfm *param,
4350 Buffer          *mBuf
4351 )
4352 #else
4353 PRIVATE S16 cmUnpkAvgPrbQciCfm(param, mBuf)
4354 LrgAvgPrbQCICfm *param; 
4355 Buffer          *mBuf;
4356 #endif
4357 {
4358    uint8_t          idx;
4359
4360
4361    CMCHKUNPK(oduPackUInt8, &param->numQci, mBuf);
4362    for(idx = param->numQci; idx > 0; idx--)
4363    {
4364 /*LRG : Review Tag*/
4365       CMCHKUNPK(oduPackUInt8, &param->prbPercQci[idx - 1].prbPercQci, mBuf);
4366       CMCHKUNPK(oduPackUInt8, &param->prbPercQci[idx - 1].qciValue, mBuf);
4367 /*LRG : Review Tag*/
4368    }
4369    return ROK;
4370 }
4371 \f
4372 /**
4373 * @brief This API is used to unpack LrgRaPreamblesCfm
4374 *
4375 * @details
4376 *
4377 *     Function: cmUnpkRaPrmbsCfm
4378 *
4379 *  @param[in]   LrgRaPreamblesCfm *param
4380 *  @param[in]   Buffer * mBuf
4381 *  @return   Void
4382 *      -# ROK
4383 **/
4384 #ifdef ANSI
4385 PRIVATE S16 cmUnpkRaPrmbsCfm
4386 (
4387 LrgRaPreamblesCfm *param,
4388 Buffer         *mBuf
4389 )
4390 #else
4391 PRIVATE S16 cmUnpkRaPrmbsCfm(param, mBuf)
4392 LrgRaPreamblesCfm *param; 
4393 Buffer         *mBuf;
4394 #endif
4395 {
4396
4397
4398    CMCHKUNPK(oduPackUInt16, &param->dedPreambles, mBuf);
4399    CMCHKUNPK(oduPackUInt16, &param->randSelPreLowRange, mBuf);
4400    CMCHKUNPK(oduPackUInt16, &param->randSelPreHighRange, mBuf);
4401    return ROK;
4402 }
4403 \f
4404 /**
4405 * @brief This API is used to unpack avgPrbCfm
4406 *
4407 * @details
4408 *
4409 *     Function: cmUnpkAvgPrbCfm
4410 *
4411 *  @param[in]   LrgAvgPrbCfm  *param
4412 *  @param[in]   Buffer * mBuf
4413 *  @return   Void
4414 *      -# ROK
4415 **/
4416 #ifdef ANSI
4417 PRIVATE S16 cmUnpkAvgPrbCfm
4418 (
4419 LrgAvgPrbCfm   *param, 
4420 Buffer         *mBuf
4421 )
4422 #else
4423 PRIVATE S16  cmUnpkAvgPrbCfm(param, mBuf)
4424 LrgAvgPrbCfm   *param; 
4425 Buffer         *mBuf;
4426 #endif
4427 {
4428
4429
4430    CMCHKUNPK(oduPackUInt8, &param->prbPerc, mBuf);
4431    return ROK;
4432 }
4433 \f
4434 /**
4435 * @brief This API is used to send a 
4436 Measurement  Confirm from LM to SCH.
4437 *
4438 * @details
4439 *
4440 *     Function: cmUnpkLrgL2SchMeasCfm
4441 *
4442 *  @param[in]   Pst *  pst
4443 *  @param[in]   Buffer * mBuf
4444 *  @return   S16
4445 *      -# ROK
4446 **/
4447 #ifdef ANSI
4448 S16 cmUnpkLrgSchL2MeasCfm
4449 (
4450 LrgSchL2MeasCfm func,
4451 Pst *pst,
4452 Buffer *mBuf
4453 )
4454 #else
4455 S16 cmUnpkLrgSchL2MeasCfm(func, pst, mBuf)
4456 LrgSchL2MeasCfm func;
4457 Pst *pst;
4458 Buffer *mBuf;
4459 #endif
4460 {
4461    LrgSchMeasCfmInfo  measInfo;
4462
4463
4464    CMCHKUNPK(cmUnpkHeader, &measInfo.hdr, mBuf);
4465    CMCHKUNPK(oduPackUInt16, &measInfo.measType, mBuf);
4466    CMCHKUNPK(cmUnpkCmStatus, &measInfo.cfm, mBuf);
4467    CMCHKUNPK(cmUnpkLteCellId, &measInfo.cellId, mBuf);
4468    if(measInfo.measType & LRG_L2MEAS_TB_TRANS_UL_FAULTY_COUNT)
4469    {
4470       CMCHKPK(oduPackUInt32, &measInfo.tbTransUlFaulty, mBuf);
4471    }    
4472    if(measInfo.measType & LRG_L2MEAS_TB_TRANS_UL_COUNT)
4473    {
4474       CMCHKPK(oduPackUInt32, &measInfo.tbTransUlTotalCnt, mBuf);
4475    }   
4476    if(measInfo.measType & LRG_L2MEAS_TB_TRANS_DL_FAULTY_COUNT)
4477    {
4478       CMCHKPK(oduPackUInt32, &measInfo.tbTransDlFaulty, mBuf);
4479    }   
4480    if(measInfo.measType & LRG_L2MEAS_TB_TRANS_DL_COUNT)
4481    {
4482       CMCHKPK(oduPackUInt32, &measInfo.tbTransDlTotalCnt, mBuf);
4483    }   
4484    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_UL)
4485    {
4486      CMCHKUNPK(cmUnpkAvgPrbCfm, &measInfo.avgPrbUl, mBuf);
4487    }
4488    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_DL)
4489    {
4490      CMCHKUNPK(cmUnpkAvgPrbCfm, &measInfo.avgPrbDl, mBuf);
4491    }
4492    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL)
4493    {
4494      CMCHKUNPK(cmUnpkAvgPrbQciCfm, &measInfo.avgPrbQciUlCfm, mBuf);
4495    }
4496    if(measInfo.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
4497    {
4498      CMCHKUNPK(cmUnpkAvgPrbQciCfm, &measInfo.avgPrbQciDlCfm, mBuf);
4499    }
4500    if(measInfo.measType & LRG_L2MEAS_RA_PREAMBLE)
4501    {
4502      CMCHKUNPK(cmUnpkRaPrmbsCfm, &measInfo.raPrmbsCfm, mBuf);
4503    }
4504    if(measInfo.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
4505    {
4506      CMCHKUNPK(cmUnpkNumUeQciCfm, &measInfo.numUeQciUlCfm, mBuf);
4507    }
4508    if(measInfo.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
4509    {
4510      CMCHKUNPK(cmUnpkNumUeQciCfm, &measInfo.numUeQciDlCfm, mBuf);
4511    }
4512    SPutMsg(mBuf);
4513    return ((*func)(pst, &measInfo));
4514 }
4515 #endif
4516 #endif
4517 \f
4518
4519 /**********************************************************************
4520          End of file
4521  **********************************************************************/