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