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