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