b176d641b8ad1da78b1f716d7289cd8370ecb000
[o-du/l2.git] / src / cm / rgr.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 RGR interface primitives. 
27   
28      File:     rgr.c 
29  
30 **********************************************************************/
31
32 /** @file rgr.c
33 @brief This file contains the packing/unpacking code for the RGR interface 
34        primitives.
35 */
36 /* LTE_ADV_FLAG_REMOVED_END */
37 #include "common_def.h"
38 #include "rgr.h"           /* RGR Interface defines */
39 /* LTE_ADV_FLAG_REMOVED_END */
40 #include "rgr.x"           /* RGR Interface includes */
41
42 #if defined(LCRGR)
43
44 \f
45 /***********************************************************
46 *
47 *     Func : cmPkRgrBndReq
48 *
49 *
50 *     Desc : Request from RRM to MAC to bind the interface saps
51 *
52 *
53 *     Ret  : S16
54 *
55 *     Notes:
56 *
57 *     File  : 
58 *
59 **********************************************************/
60 S16 cmPkRgrBndReq
61 (
62 Pst* pst,
63 SuId suId,
64 SpId spId
65 )
66 {
67    Buffer *mBuf = NULLP;
68
69    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
70 #if (ERRCLASS & ERRCLS_ADD_RES)
71       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
72          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
73          (ErrVal)ERGR001, (ErrVal)0, "Packing failed");
74 #endif
75       return RFAILED;
76    }
77    if (SPkS16(spId, mBuf) != ROK) {
78 #if (ERRCLASS & ERRCLS_ADD_RES)
79       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
80          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
81          (ErrVal)ERGR002, (ErrVal)0, "Packing failed");
82 #endif
83       SPutMsg(mBuf);
84       return RFAILED;
85    }
86    if (SPkS16(suId, mBuf) != ROK) {
87 #if (ERRCLASS & ERRCLS_ADD_RES)
88       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
89          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
90          (ErrVal)ERGR003, (ErrVal)0, "Packing failed");
91 #endif
92       SPutMsg(mBuf);
93       return RFAILED;
94    }
95    pst->event = (Event) EVTRGRBNDREQ;
96    return (SPstTsk(pst,mBuf));
97 }
98
99 \f
100 /***********************************************************
101 *
102 *     Func : cmUnpkRgrBndReq
103 *
104 *
105 *     Desc : Request from RRM to MAC to bind the interface saps
106 *
107 *
108 *     Ret  : S16
109 *
110 *     Notes:
111 *
112 *     File  : 
113 *
114 **********************************************************/
115 S16 cmUnpkRgrBndReq
116 (
117 RgrBndReq func,
118 Pst *pst,
119 Buffer *mBuf
120 )
121 {
122    SuId suId;
123    SpId spId;
124    
125
126    if (SUnpkS16(&suId, mBuf) != ROK) {
127       SPutMsg(mBuf);
128 #if (ERRCLASS & ERRCLS_ADD_RES)
129       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
130          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
131          (ErrVal)ERGR004, (ErrVal)0, "Packing failed");
132 #endif
133       return RFAILED;
134    }
135    if (SUnpkS16(&spId, mBuf) != ROK) {
136       SPutMsg(mBuf);
137 #if (ERRCLASS & ERRCLS_ADD_RES)
138       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
139          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
140          (ErrVal)ERGR005, (ErrVal)0, "Packing failed");
141 #endif
142       return RFAILED;
143    }
144    SPutMsg(mBuf);
145    return ((*func)(pst, suId, spId));
146 }
147
148 \f
149 /***********************************************************
150 *
151 *     Func : cmPkRgrBndCfm
152 *
153 *
154 *     Desc : Confirmation from MAC to RRM for the bind/Unbind 
155  * request for the interface saps
156 *
157 *
158 *     Ret  : S16
159 *
160 *     Notes:
161 *
162 *     File  : 
163 *
164 **********************************************************/
165 S16 cmPkRgrBndCfm
166 (
167 Pst* pst,
168 SuId suId,
169 uint8_t status
170 )
171 {
172    Buffer *mBuf = NULLP;
173
174    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
175 #if (ERRCLASS & ERRCLS_ADD_RES)
176       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
177          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
178          (ErrVal)ERGR006, (ErrVal)0, "Packing failed");
179 #endif
180       return RFAILED;
181    }
182    if (oduUnpackUInt8(status, mBuf) != ROK) {
183 #if (ERRCLASS & ERRCLS_ADD_RES)
184       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
185          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
186          (ErrVal)ERGR007, (ErrVal)0, "Packing failed");
187 #endif
188       SPutMsg(mBuf);
189       return RFAILED;
190    }
191    if (SPkS16(suId, mBuf) != ROK) {
192 #if (ERRCLASS & ERRCLS_ADD_RES)
193       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
194          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
195          (ErrVal)ERGR008, (ErrVal)0, "Packing failed");
196 #endif
197       SPutMsg(mBuf);
198       return RFAILED;
199    }
200    pst->event = (Event) EVTRGRBNDCFM;
201    return (SPstTsk(pst,mBuf));
202 }
203
204 \f
205 /***********************************************************
206 *
207 *     Func : cmUnpkRgrBndCfm
208 *
209 *
210 *     Desc : Confirmation from MAC to RRM for the bind/Unbind 
211  * request for the interface saps
212 *
213 *
214 *     Ret  : S16
215 *
216 *     Notes:
217 *
218 *     File  : 
219 *
220 **********************************************************/
221 S16 cmUnpkRgrBndCfm
222 (
223 RgrBndCfm func,
224 Pst *pst,
225 Buffer *mBuf
226 )
227 {
228    SuId suId;
229    uint8_t status;
230    
231
232    if (SUnpkS16(&suId, mBuf) != ROK) {
233       SPutMsg(mBuf);
234 #if (ERRCLASS & ERRCLS_ADD_RES)
235       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
236          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
237          (ErrVal)ERGR009, (ErrVal)0, "Packing failed");
238 #endif
239       return RFAILED;
240    }
241    if (oduPackUInt8(&status, mBuf) != ROK) {
242       SPutMsg(mBuf);
243 #if (ERRCLASS & ERRCLS_ADD_RES)
244       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
245          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
246          (ErrVal)ERGR010, (ErrVal)0, "Packing failed");
247 #endif
248       return RFAILED;
249    }
250    SPutMsg(mBuf);
251    return ((*func)(pst, suId, status));
252 }
253
254 \f
255 /***********************************************************
256 *
257 *     Func : cmPkRgrUbndReq
258 *
259 *
260 *     Desc : Request from RRM to MAC to Unbind the interface saps
261 *
262 *
263 *     Ret  : S16
264 *
265 *     Notes:
266 *
267 *     File  : 
268 *
269 **********************************************************/
270 S16 cmPkRgrUbndReq
271 (
272 Pst* pst,
273 SpId spId,
274 Reason reason
275 )
276 {
277    Buffer *mBuf = NULLP;
278
279    if (SGetMsg(pst->region, pst->pool, &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)ERGR011, (ErrVal)0, "Packing failed");
284 #endif
285       return RFAILED;
286    }
287    if (SPkS16(reason, mBuf) != ROK) {
288 #if (ERRCLASS & ERRCLS_ADD_RES)
289       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
290          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
291          (ErrVal)ERGR012, (ErrVal)0, "Packing failed");
292 #endif
293       SPutMsg(mBuf);
294       return RFAILED;
295    }
296    if (SPkS16(spId, mBuf) != ROK) {
297 #if (ERRCLASS & ERRCLS_ADD_RES)
298       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
299          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
300          (ErrVal)ERGR013, (ErrVal)0, "Packing failed");
301 #endif
302       SPutMsg(mBuf);
303       return RFAILED;
304    }
305    pst->event = (Event) EVTRGRUBNDREQ;
306    return (SPstTsk(pst,mBuf));
307 }
308
309 \f
310 /***********************************************************
311 *
312 *     Func : cmUnpkRgrUbndReq
313 *
314 *
315 *     Desc : Request from RRM to MAC to Unbind the interface saps
316 *
317 *
318 *     Ret  : S16
319 *
320 *     Notes:
321 *
322 *     File  : 
323 *
324 **********************************************************/
325 S16 cmUnpkRgrUbndReq
326 (
327 RgrUbndReq func,
328 Pst *pst,
329 Buffer *mBuf
330 )
331 {
332    SpId spId;
333    Reason reason;
334    
335
336    if (SUnpkS16(&spId, mBuf) != ROK) {
337       SPutMsg(mBuf);
338 #if (ERRCLASS & ERRCLS_ADD_RES)
339       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
340          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
341          (ErrVal)ERGR014, (ErrVal)0, "Packing failed");
342 #endif
343       return RFAILED;
344    }
345    if (SUnpkS16(&reason, mBuf) != ROK) {
346       SPutMsg(mBuf);
347 #if (ERRCLASS & ERRCLS_ADD_RES)
348       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
349          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
350          (ErrVal)ERGR015, (ErrVal)0, "Packing failed");
351 #endif
352       return RFAILED;
353    }
354    SPutMsg(mBuf);
355    return ((*func)(pst, spId, reason));
356 }
357
358 \f
359 /***********************************************************
360 *
361 *     Func : cmUnpkRgrCfgReq
362 *
363 *
364 *     Desc : Configuration Request from RRM to MAC for 
365  * configuring Cell/Ue/Lc
366 *
367 *
368 *     Ret  : S16
369 *
370 *     Notes:
371 *
372 *     File  : 
373 *
374 **********************************************************/
375 S16 cmUnpkRgrCfgReq
376 (
377 RgrCfgReq func,
378 Pst *pst,
379 Buffer *mBuf
380 )
381 {
382    RgrCfgTransId transId;
383    RgrCfgReqInfo *cfgReqInfo;
384    
385 #if 0
386    if (SUnpkS16(&spId, mBuf) != ROK) {
387       SPutMsg(mBuf);
388 #if (ERRCLASS & ERRCLS_ADD_RES)
389       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
390          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
391          (ErrVal)ERGR021, (ErrVal)0, "Packing failed");
392 #endif
393       return RFAILED;
394    }
395 #endif
396
397    if (cmUnpkRgrCfgTransId(&transId, mBuf) != ROK) {
398       SPutMsg(mBuf);
399 #if (ERRCLASS & ERRCLS_ADD_RES)
400       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
401          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
402          (ErrVal)ERGR022, (ErrVal)0, "Packing failed");
403 #endif
404       return RFAILED;
405    }
406    if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&cfgReqInfo,sizeof(RgrCfgReqInfo))) != ROK) {
407 #if (ERRCLASS & ERRCLS_ADD_RES)
408       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
409             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
410             (ErrVal)ERGR023, (ErrVal)0, "Packing failed");
411 #endif
412       SPutMsg(mBuf);
413       return RFAILED;
414    }
415    memset(cfgReqInfo, 0, sizeof(RgrCfgReqInfo));
416    if (pst->selector == ODU_SELECTOR_LC) 
417       if (cmUnpkRgrCfgReqInfo(cfgReqInfo, mBuf) != ROK) {
418          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(RgrCfgReqInfo));
419          SPutMsg(mBuf);
420 #if (ERRCLASS & ERRCLS_ADD_RES)
421          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
422                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
423                (ErrVal)ERGR024, (ErrVal)0, "Packing failed");
424 #endif
425          return RFAILED;
426       }
427    SPutMsg(mBuf);
428    return ((*func)(pst, transId, cfgReqInfo));
429 }
430
431 /* rgr_c_001.main_3: Added TTI indication from MAC to RGR user */
432 \f
433 /***********************************************************
434 *
435 *     Func : cmPkRgrTtiIndInfo
436 *
437 *
438 *     Desc : Packs the TTI indication information.
439 *
440 *
441 *     Ret  : S16
442 *
443 *     Notes:
444 *
445 *     File  : 
446 *
447 **********************************************************/
448 S16 cmPkRgrTtiIndInfo
449 (
450 RgrTtiIndInfo *param,
451 Buffer        *mBuf
452 )
453 {
454    CMCHKPK(oduUnpackUInt16, param->sfn, mBuf);
455    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
456    return ROK;
457 }
458 \f
459 /***********************************************************
460 *
461 *     Func : cmUnpkRgrTtiIndInfo
462 *
463 *
464 *     Desc : Unpacking for RgrTtiIndInfo
465 *
466 *     Ret  : S16
467 *
468 *     Notes:
469 *
470 *     File  : 
471 *
472 **********************************************************/
473 S16 cmUnpkRgrTtiIndInfo
474 (
475 RgrTtiIndInfo *param,
476 Buffer *mBuf
477 )
478 {
479
480    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
481    CMCHKUNPK(oduPackUInt16, &param->sfn, mBuf);
482    return ROK;
483 }
484
485 \f
486 /***********************************************************
487 *
488 *     Func : cmPkRgrTtiInd
489 *
490 *
491 *     Desc : TTI indication  from MAC to RRM
492 *
493 *
494 *     Ret  : S16
495 *
496 *     Notes:
497 *
498 *     File  : 
499 *
500 **********************************************************/
501 S16 cmPkRgrTtiInd
502 (
503 Pst* pst,
504 SuId suId,
505 RgrTtiIndInfo *ttiInd
506 )
507 {
508    Buffer *mBuf = NULLP;
509
510    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
511 #if (ERRCLASS & ERRCLS_ADD_RES)
512       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
513          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
514          (ErrVal)ERGR025, (ErrVal)0, "Packing failed");
515 #endif
516       return RFAILED;
517    }
518    if (cmPkRgrTtiIndInfo(ttiInd, mBuf) != ROK) {
519 #if (ERRCLASS & ERRCLS_ADD_RES)
520       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
521          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
522          (ErrVal)ERGR026, (ErrVal)0, "Packing failed");
523 #endif
524       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ttiInd, sizeof(RgrTtiIndInfo));
525       SPutMsg(mBuf);
526       return RFAILED;
527    }
528    if (SPkS16(suId, mBuf) != ROK) {
529 #if (ERRCLASS & ERRCLS_ADD_RES)
530       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
531          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
532          (ErrVal)ERGR027, (ErrVal)0, "Packing failed");
533 #endif
534       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ttiInd, sizeof(RgrTtiIndInfo));
535       SPutMsg(mBuf);
536       return RFAILED;
537    }
538    SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ttiInd, sizeof(RgrTtiIndInfo));
539    pst->event = (Event) EVTRGRTTIIND;
540    return (SPstTsk(pst,mBuf));
541 }
542
543 \f
544 /***********************************************************
545 *
546 *     Func : cmUnpkRgrTtiInd
547 *
548 *
549 *     Desc : TTI indication from MAC to RRM
550 *
551 *
552 *     Ret  : S16
553 *
554 *     Notes:
555 *
556 *     File  : 
557 *
558 **********************************************************/
559 S16 cmUnpkRgrTtiInd
560 (
561 RgrTtiInd func,
562 Pst *pst,
563 Buffer *mBuf
564 )
565 {
566    SuId suId;
567    RgrTtiIndInfo *ttiInd;
568    
569
570    if (SUnpkS16(&suId, mBuf) != ROK) {
571       SPutMsg(mBuf);
572 #if (ERRCLASS & ERRCLS_ADD_RES)
573       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
574          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
575          (ErrVal)ERGR028, (ErrVal)0, "Packing failed");
576 #endif
577       return RFAILED;
578    }
579    if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&ttiInd, sizeof(RgrTtiIndInfo))) != ROK) 
580    {
581 #if (ERRCLASS & ERRCLS_ADD_RES)      
582       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
583           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
584           (ErrVal)ERGR029, (ErrVal)0, "UnPacking failed");
585 #endif      
586       SPutMsg(mBuf);
587       return RFAILED;
588    }
589  
590    if (cmUnpkRgrTtiIndInfo(ttiInd, mBuf) != ROK) {
591       /*ccpu00114888- Memory Leak issue- Start*/
592       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ttiInd, 
593             sizeof(RgrTtiIndInfo));
594       /*ccpu00114888- Memory Leak issue- End*/
595       SPutMsg(mBuf);
596 #if (ERRCLASS & ERRCLS_ADD_RES)
597       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
598          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
599          (ErrVal)ERGR030, (ErrVal)0, "Packing failed");
600 #endif
601       return RFAILED;
602    }
603    SPutMsg(mBuf);
604    return ((*func)(pst, suId, ttiInd));
605 }
606
607 \f
608 /***********************************************************
609 *
610 *     Func : cmPkRgrCfgCfm
611 *
612 *
613 *     Desc : Configuration Confirm from MAC to RRM
614 *
615 *
616 *     Ret  : S16
617 *
618 *     Notes:
619 *
620 *     File  : 
621 *
622 **********************************************************/
623 S16 cmPkRgrCfgCfm
624 (
625 Pst* pst,
626 RgrCfgTransId transId,
627 uint8_t status
628 )
629 {
630    Buffer *mBuf = NULLP;
631
632    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
633 #if (ERRCLASS & ERRCLS_ADD_RES)
634       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
635          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
636          (ErrVal)ERGR031, (ErrVal)0, "Packing failed");
637 #endif
638       return RFAILED;
639    }
640    if (oduUnpackUInt8(status, mBuf) != ROK) {
641 #if (ERRCLASS & ERRCLS_ADD_RES)
642       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
643          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
644          (ErrVal)ERGR032, (ErrVal)0, "Packing failed");
645 #endif
646       SPutMsg(mBuf);
647       return RFAILED;
648    }
649    if (cmPkRgrCfgTransId(&transId, mBuf) != ROK) {
650 #if (ERRCLASS & ERRCLS_ADD_RES)
651       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
652          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
653          (ErrVal)ERGR033, (ErrVal)0, "Packing failed");
654 #endif
655       SPutMsg(mBuf);
656       return RFAILED;
657    }
658    pst->event = (Event) EVTMACSCHCFGCFM;
659    return (SPstTsk(pst,mBuf));
660 }
661
662 \f
663 /***********************************************************
664 *
665 *     Func : cmUnpkRgrCfgCfm
666 *
667 *
668 *     Desc : Configuration Confirm from MAC to RRM
669 *
670 *
671 *     Ret  : S16
672 *
673 *     Notes:
674 *
675 *     File  : 
676 *
677 **********************************************************/
678 S16 cmUnpkRgrCfgCfm
679 (
680 RgrCfgCfm func,
681 Pst *pst,
682 Buffer *mBuf
683 )
684 {
685    RgrCfgTransId transId;
686    uint8_t status;
687    
688
689    if (cmUnpkRgrCfgTransId(&transId, mBuf) != ROK) {
690       SPutMsg(mBuf);
691 #if (ERRCLASS & ERRCLS_ADD_RES)
692       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
693          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
694          (ErrVal)ERGR036, (ErrVal)0, "Packing failed");
695 #endif
696       return RFAILED;
697    }
698    if (oduPackUInt8(&status, mBuf) != ROK) {
699       SPutMsg(mBuf);
700 #if (ERRCLASS & ERRCLS_ADD_RES)
701       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
702          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
703          (ErrVal)ERGR037, (ErrVal)0, "Packing failed");
704 #endif
705       return RFAILED;
706    }
707    SPutMsg(mBuf);
708    return ((*func)(pst, transId, status));
709 }
710
711 /* rgr_c_001.main_4: ADD-Added for SI Enhancement. */
712 #ifdef RGR_SI_SCH
713 /***********************************************************
714 *
715 *     Func : cmPkRgrSiCfgCfm
716 *
717 *
718 *     Desc : SI Configuration Confirm from MAC to RRM
719 *
720 *
721 *     Ret  : S16
722 *
723 *     Notes:
724 *
725 *     File  : 
726 *
727 **********************************************************/
728 S16 cmPkRgrSiCfgCfm
729 (
730 Pst* pst,
731 SuId suId,
732 RgrCfgTransId transId,
733 uint8_t status
734 )
735 {
736    Buffer *mBuf = NULLP;
737
738
739    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
740 #if (ERRCLASS & ERRCLS_ADD_RES)
741       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
742          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
743          (ErrVal)ERGR038, (ErrVal)0, "Packing failed");
744 #endif
745       return RFAILED;
746    }
747    if (oduUnpackUInt8(status, mBuf) != ROK) {
748 #if (ERRCLASS & ERRCLS_ADD_RES)
749       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
750          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
751          (ErrVal)ERGR039, (ErrVal)0, "Packing failed");
752 #endif
753       SPutMsg(mBuf);
754       return RFAILED;
755    }
756    if (cmPkRgrCfgTransId(&transId, mBuf) != ROK) {
757 #if (ERRCLASS & ERRCLS_ADD_RES)
758       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
759          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
760          (ErrVal)ERGR040, (ErrVal)0, "Packing failed");
761 #endif
762       SPutMsg(mBuf);
763       return RFAILED;
764    }
765    if (SPkS16(suId, mBuf) != ROK) {
766 #if (ERRCLASS & ERRCLS_ADD_RES)
767       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
768          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
769          (ErrVal)ERGR041, (ErrVal)0, "Packing failed");
770 #endif
771       SPutMsg(mBuf);
772       return RFAILED;
773    }
774
775    pst->event = (Event) EVTRGRSICFGCFM;
776    return (SPstTsk(pst,mBuf));
777 }
778
779 \f
780 /***********************************************************
781 *
782 *     Func : cmUnpkRgrSiCfgCfm
783 *
784 *
785 *     Desc : Configuration Confirm from MAC to RRM
786 *
787 *
788 *     Ret  : S16
789 *
790 *     Notes:
791 *
792 *     File  : 
793 *
794 **********************************************************/
795 S16 cmUnpkRgrSiCfgCfm
796 (
797 RgrSiCfgCfm func,
798 Pst *pst,
799 Buffer *mBuf
800 )
801 {
802    SuId suId;
803    RgrCfgTransId transId;
804    uint8_t status;
805    
806
807    if (SUnpkS16(&suId, mBuf) != ROK) {
808       SPutMsg(mBuf);
809 #if (ERRCLASS & ERRCLS_ADD_RES)
810       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
811          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
812          (ErrVal)ERGR042, (ErrVal)0, "Packing failed");
813 #endif
814       return RFAILED;
815    }
816    if (cmUnpkRgrCfgTransId(&transId, mBuf) != ROK) {
817       SPutMsg(mBuf);
818 #if (ERRCLASS & ERRCLS_ADD_RES)
819       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
820          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
821          (ErrVal)ERGR043, (ErrVal)0, "Packing failed");
822 #endif
823       return RFAILED;
824    }
825    if (oduPackUInt8(&status, mBuf) != ROK) {
826       SPutMsg(mBuf);
827 #if (ERRCLASS & ERRCLS_ADD_RES)
828       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
829          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
830          (ErrVal)ERGR044, (ErrVal)0, "Packing failed");
831 #endif
832       return RFAILED;
833    }
834    SPutMsg(mBuf);
835    return ((*func)(pst, suId, transId, status));
836 }
837 #endif/*RGR_SI_SCH*/
838
839 \f
840 /***********************************************************
841 *
842 *     Func : cmPkRgrCfgTransId
843 *
844 *
845 *     Desc : Transaction ID between MAC and RRM
846 *
847 *
848 *     Ret  : S16
849 *
850 *     Notes:
851 *
852 *     File  : 
853 *
854 **********************************************************/
855 S16 cmPkRgrCfgTransId
856 (
857 RgrCfgTransId *param,
858 Buffer *mBuf
859 )
860 {
861
862    S32 i;
863
864    for (i=RGR_CFG_TRANSID_SIZE-1; i >= 0; i--) {
865       CMCHKPK(oduUnpackUInt8, param->trans[i], mBuf);
866    }
867    return ROK;
868 }
869
870
871 \f
872 /***********************************************************
873 *
874 *     Func : cmUnpkRgrCfgTransId
875 *
876 *
877 *     Desc : Transaction ID between MAC and RRM
878 *
879 *
880 *     Ret  : S16
881 *
882 *     Notes:
883 *
884 *     File  : 
885 *
886 **********************************************************/
887 S16 cmUnpkRgrCfgTransId
888 (
889 RgrCfgTransId *param,
890 Buffer *mBuf
891 )
892 {
893
894    S32 i;
895
896    for (i=0; i<RGR_CFG_TRANSID_SIZE; i++) {
897       CMCHKUNPK(oduPackUInt8, &param->trans[i], mBuf);
898    }
899    return ROK;
900 }
901
902
903 \f
904 /***********************************************************
905 *
906 *     Func : cmPkRgrDlHqCfg
907 *
908 *
909 *     Desc :  Downlink HARQ configuration per Cell
910 *
911 *
912 *     Ret  : S16
913 *
914 *     Notes:
915 *
916 *     File  : 
917 *
918 **********************************************************/
919 S16 cmPkRgrDlHqCfg
920 (
921 RgrDlHqCfg *param,
922 Buffer *mBuf
923 )
924 {
925
926
927    CMCHKPK(oduUnpackUInt8, param->maxMsg4HqTx, mBuf);
928    CMCHKPK(oduUnpackUInt8, param->maxDlHqTx, mBuf);
929    return ROK;
930 }
931
932
933 \f
934 /***********************************************************
935 *
936 *     Func : cmUnpkRgrDlHqCfg
937 *
938 *
939 *     Desc :  Downlink HARQ configuration per Cell
940 *
941 *
942 *     Ret  : S16
943 *
944 *     Notes:
945 *
946 *     File  : 
947 *
948 **********************************************************/
949 S16 cmUnpkRgrDlHqCfg
950 (
951 RgrDlHqCfg *param,
952 Buffer *mBuf
953 )
954 {
955
956
957    CMCHKUNPK(oduPackUInt8, &param->maxDlHqTx, mBuf);
958    CMCHKUNPK(oduPackUInt8, &param->maxMsg4HqTx, mBuf);
959    return ROK;
960 }
961
962
963 \f
964 /***********************************************************
965 *
966 *     Func : cmPkRgrRntiCfg
967 *
968 *
969 *     Desc : Range of RNTIs managed by MAC
970 *
971 *
972 *     Ret  : S16
973 *
974 *     Notes:
975 *
976 *     File  : 
977 *
978 **********************************************************/
979 S16 cmPkRgrRntiCfg
980 (
981 RgrRntiCfg *param,
982 Buffer *mBuf
983 )
984 {
985
986    CMCHKPK(oduUnpackUInt16, param->size, mBuf);
987    CMCHKPK(cmPkLteRnti, param->startRnti, mBuf);
988    return ROK;
989 }
990
991
992 \f
993 /***********************************************************
994 *
995 *     Func : cmUnpkRgrRntiCfg
996 *
997 *
998 *     Desc : Range of RNTIs managed by MAC
999 *
1000 *
1001 *     Ret  : S16
1002 *
1003 *     Notes:
1004 *
1005 *     File  : 
1006 *
1007 **********************************************************/
1008 S16 cmUnpkRgrRntiCfg
1009 (
1010 RgrRntiCfg *param,
1011 Buffer *mBuf
1012 )
1013 {
1014
1015
1016    CMCHKUNPK(cmUnpkLteRnti, &param->startRnti, mBuf);
1017    CMCHKUNPK(oduPackUInt16, &param->size, mBuf);
1018    return ROK;
1019 }
1020
1021 #ifdef EMTC_ENABLE
1022 /***********************************************************
1023 *
1024 *     Func : cmPkRgrEmtcRntiCfg
1025 *
1026 *
1027 *     Desc : Range of Emtc RNTIs managed by MAC
1028 *
1029 *
1030 *     Ret  : S16
1031 *
1032 *     Notes:
1033 *
1034 *     File  : 
1035 *
1036 **********************************************************/
1037 S16 cmPkRgrEmtcRntiCfg
1038 (
1039 RgrEmtcRntiCfg *param,
1040 Buffer *mBuf
1041 )
1042 {
1043
1044
1045    CMCHKPK(oduUnpackUInt16, param->size, mBuf);
1046    CMCHKPK(cmPkLteRnti, param->rntiCeModeBRange, mBuf);
1047    CMCHKPK(cmPkLteRnti, param->rntiCeModeBStart, mBuf);
1048    CMCHKPK(cmPkLteRnti, param->rntiCeModeARange, mBuf);
1049    CMCHKPK(cmPkLteRnti, param->rntiCeModeAStart, mBuf);
1050    return ROK;
1051 }
1052
1053
1054 \f
1055 /***********************************************************
1056 *
1057 *     Func : cmUnpkRgrEmtcRntiCfg
1058 *
1059 *
1060 *     Desc : Range of Emtc RNTIs managed by MAC
1061 *
1062 *
1063 *     Ret  : S16
1064 *
1065 *     Notes:
1066 *
1067 *     File  : 
1068 *
1069 **********************************************************/
1070 S16 cmUnpkRgrEmtcRntiCfg
1071 (
1072 RgrEmtcRntiCfg *param,
1073 Buffer *mBuf
1074 )
1075 {
1076
1077
1078    CMCHKUNPK(cmUnpkLteRnti, &param->rntiCeModeAStart, mBuf);
1079    CMCHKUNPK(cmUnpkLteRnti, &param->rntiCeModeARange, mBuf);
1080    CMCHKUNPK(cmUnpkLteRnti, &param->rntiCeModeBStart, mBuf);
1081    CMCHKUNPK(cmUnpkLteRnti, &param->rntiCeModeBRange, mBuf);
1082    CMCHKUNPK(oduPackUInt16, &param->size, mBuf);
1083
1084    return ROK;
1085 }
1086 #endif
1087
1088 \f
1089 /***********************************************************
1090 *
1091 *     Func : cmPkRgrDlCmnCodeRateCfg
1092 *
1093 *
1094 *     Desc : Downlink common channel code rate configuration per cell
1095 *
1096 *
1097 *     Ret  : S16
1098 *
1099 *     Notes:
1100 *
1101 *     File  : 
1102 *
1103 **********************************************************/
1104 S16 cmPkRgrDlCmnCodeRateCfg
1105 (
1106 RgrDlCmnCodeRateCfg *param,
1107 Buffer *mBuf
1108 )
1109 {
1110
1111    CMCHKPK(oduUnpackUInt8, param->ccchCqi, mBuf);
1112    CMCHKPK(oduUnpackUInt16, param->pdcchCodeRate, mBuf);
1113    CMCHKPK(oduUnpackUInt16, param->bcchPchRaCodeRate, mBuf);
1114    return ROK;
1115 }
1116
1117
1118 \f
1119 /***********************************************************
1120 *
1121 *     Func : cmUnpkRgrDlCmnCodeRateCfg
1122 *
1123 *
1124 *     Desc : Downlink common channel code rate configuration per cell
1125 *
1126 *
1127 *     Ret  : S16
1128 *
1129 *     Notes:
1130 *
1131 *     File  : 
1132 *
1133 **********************************************************/
1134 S16 cmUnpkRgrDlCmnCodeRateCfg
1135 (
1136 RgrDlCmnCodeRateCfg *param,
1137 Buffer *mBuf
1138 )
1139 {
1140
1141    CMCHKUNPK(oduPackUInt16, &param->bcchPchRaCodeRate, mBuf);
1142    CMCHKUNPK(oduPackUInt16, &param->pdcchCodeRate, mBuf);
1143    CMCHKUNPK(oduPackUInt8, &param->ccchCqi, mBuf);
1144    return ROK;
1145 }
1146
1147
1148 \f
1149 /***********************************************************
1150 *
1151 *     Func : cmPkRgrCfiCfg
1152 *
1153 *
1154 *     Desc : Control Format Indicator (CFI) configuration per cell
1155 *
1156 *
1157 *     Ret  : S16
1158 *
1159 *     Notes:
1160 *
1161 *     File  : 
1162 *
1163 **********************************************************/
1164 S16 cmPkRgrCfiCfg
1165 (
1166 RgrCfiCfg *param,
1167 Buffer *mBuf
1168 )
1169 {
1170    CMCHKPK(oduUnpackUInt8, param->cfi, mBuf);
1171    return ROK;
1172 }
1173
1174
1175 \f
1176 /***********************************************************
1177 *
1178 *     Func : cmUnpkRgrCfiCfg
1179 *
1180 *
1181 *     Desc : Control Format Indicator (CFI) configuration per cell
1182 *
1183 *
1184 *     Ret  : S16
1185 *
1186 *     Notes:
1187 *
1188 *     File  : 
1189 *
1190 **********************************************************/
1191 S16 cmUnpkRgrCfiCfg
1192 (
1193 RgrCfiCfg *param,
1194 Buffer *mBuf
1195 )
1196 {
1197
1198    CMCHKUNPK(oduPackUInt8, &param->cfi, mBuf);
1199    return ROK;
1200 }
1201
1202
1203 \f
1204 /***********************************************************
1205 *
1206 *     Func : cmPkRgrPuschSubBandCfg
1207 *
1208 *
1209 *     Desc : PUSCH sub-band configuration per cell
1210 *
1211 *
1212 *     Ret  : S16
1213 *
1214 *     Notes:
1215 *
1216 *     File  : 
1217 *
1218 **********************************************************/
1219 S16 cmPkRgrPuschSubBandCfg
1220 (
1221 RgrPuschSubBandCfg *param,
1222 Buffer *mBuf
1223 )
1224 {
1225
1226    S32 i;
1227
1228    for (i=param->numSubbands-1; i >= 0; i--) {
1229       CMCHKPK(oduUnpackUInt8, param->dmrs[i], mBuf);
1230    }
1231    CMCHKPK(oduUnpackUInt8, param->size, mBuf);
1232    CMCHKPK(oduUnpackUInt8, param->numSubbands, mBuf);
1233    CMCHKPK(oduUnpackUInt8, param->subbandStart, mBuf);
1234    return ROK;
1235 }
1236
1237
1238 \f
1239 /***********************************************************
1240 *
1241 *     Func : cmUnpkRgrPuschSubBandCfg
1242 *
1243 *
1244 *     Desc : PUSCH sub-band configuration per cell
1245 *
1246 *
1247 *     Ret  : S16
1248 *
1249 *     Notes:
1250 *
1251 *     File  : 
1252 *
1253 **********************************************************/
1254 S16 cmUnpkRgrPuschSubBandCfg
1255 (
1256 RgrPuschSubBandCfg *param,
1257 Buffer *mBuf
1258 )
1259 {
1260
1261    S32 i;
1262    CMCHKUNPK(oduPackUInt8, &param->subbandStart, mBuf);
1263    CMCHKUNPK(oduPackUInt8, &param->numSubbands, mBuf);
1264    CMCHKUNPK(oduPackUInt8, &param->size, mBuf);
1265    for (i=0; i<param->numSubbands; i++) {
1266       CMCHKUNPK(oduPackUInt8, &param->dmrs[i], mBuf);
1267    }
1268    return ROK;
1269 }
1270
1271
1272 \f
1273 /***********************************************************
1274 *
1275 *     Func : cmPkRgrUlCmnCodeRateCfg
1276 *
1277 *
1278 *     Desc : Uplink common channel code rate configuration per cell
1279 *
1280 *
1281 *     Ret  : S16
1282 *
1283 *     Notes:
1284 *
1285 *     File  : 
1286 *
1287 **********************************************************/
1288 S16 cmPkRgrUlCmnCodeRateCfg
1289 (
1290 RgrUlCmnCodeRateCfg *param,
1291 Buffer *mBuf
1292 )
1293 {
1294    CMCHKPK(oduUnpackUInt8, param->ccchCqi, mBuf);
1295    return ROK;
1296 }
1297
1298
1299 \f
1300 /***********************************************************
1301 *
1302 *     Func : cmUnpkRgrUlCmnCodeRateCfg
1303 *
1304 *
1305 *     Desc : Uplink common channel code rate configuration per cell
1306 *
1307 *
1308 *     Ret  : S16
1309 *
1310 *     Notes:
1311 *
1312 *     File  : 
1313 *
1314 **********************************************************/
1315 S16 cmUnpkRgrUlCmnCodeRateCfg
1316 (
1317 RgrUlCmnCodeRateCfg *param,
1318 Buffer *mBuf
1319 )
1320 {
1321
1322    CMCHKUNPK(oduPackUInt8, &param->ccchCqi, mBuf);
1323    return ROK;
1324 }
1325
1326
1327 \f
1328 /***********************************************************
1329 *
1330 *     Func : cmPkRgrUlTrgCqiCfg
1331 *
1332 *
1333 *     Desc : Target Uplink CQI to achieve through group power control configured per cell
1334 *
1335 *
1336 *     Ret  : S16
1337 *
1338 *     Notes:
1339 *
1340 *     File  : 
1341 *
1342 **********************************************************/
1343 S16 cmPkRgrUlTrgCqiCfg
1344 (
1345 RgrUlTrgCqiCfg *param,
1346 Buffer *mBuf
1347 )
1348 {
1349    CMCHKPK(oduUnpackUInt8, param->trgCqi, mBuf);
1350    return ROK;
1351 }
1352
1353
1354 \f
1355 /***********************************************************
1356 *
1357 *     Func : cmUnpkRgrUlTrgCqiCfg
1358 *
1359 *
1360 *     Desc : Target Uplink CQI to achieve through group power control configured per cell
1361 *
1362 *
1363 *     Ret  : S16
1364 *
1365 *     Notes:
1366 *
1367 *     File  : 
1368 *
1369 **********************************************************/
1370 S16 cmUnpkRgrUlTrgCqiCfg
1371 (
1372 RgrUlTrgCqiCfg *param,
1373 Buffer *mBuf
1374 )
1375 {
1376
1377    CMCHKUNPK(oduPackUInt8, &param->trgCqi, mBuf);
1378    return ROK;
1379 }
1380
1381
1382 \f
1383 /***********************************************************
1384 *
1385 *     Func : cmPkRgrBwCfg
1386 *
1387 *
1388 *     Desc : Bandwidth configuration per cell
1389 *
1390 *
1391 *     Ret  : S16
1392 *
1393 *     Notes:
1394 *
1395 *     File  : 
1396 *
1397 **********************************************************/
1398 S16 cmPkRgrBwCfg
1399 (
1400 RgrBwCfg *param,
1401 Buffer *mBuf
1402 )
1403 {
1404
1405    CMCHKPK(oduUnpackUInt8, param->ulTotalBw, mBuf);
1406    CMCHKPK(oduUnpackUInt8, param->dlTotalBw, mBuf);
1407    return ROK;
1408 }
1409
1410
1411 #ifdef EMTC_ENABLE 
1412 /* EMTC related pack changes start*/
1413
1414 S16 cmPkRgrEmtcSiCfg
1415 (
1416 RgrEmtcSiCfg *param,
1417 Buffer *mBuf
1418 )
1419 {
1420
1421    S32 i;
1422         
1423    CMCHKPK(oduUnpackUInt8, param->siHoppingEnable, mBuf);
1424    CMCHKPK(oduUnpackUInt32, param->modPrd, mBuf);
1425    CMCHKPK(oduUnpackUInt8, param->siWinSizeBr, mBuf);
1426    CMCHKPK(oduUnpackUInt8, param->sib1Repetition, mBuf);
1427    CMCHKPK(oduUnpackUInt8, param->siRepetition, mBuf);
1428    
1429    CMCHKPK(oduUnpackUInt16, param->startSymbolLc, mBuf);
1430    //CMCHKPK(oduUnpackUInt8, param->fddDLOrTddSfBitmapLC.sfnPtnChoice, mBuf);
1431    /*Changes by SIMRAN*/
1432     if(!(param->fddDLOrTddSfBitmapLC.sfnPtnChoice))
1433     {
1434       CMCHKPK(oduUnpackUInt16, param->fddDLOrTddSfBitmapLC.u.ptn10, mBuf);
1435     }
1436     else
1437    {
1438       //CMCHKPK(SPkU64,param->fddDLOrTddSfBitmapLC.u.ptn40, mBuf);
1439       for (i=0; i<2; i++) {
1440          CMCHKPK(oduUnpackUInt32, param->fddDLOrTddSfBitmapLC.u.ptn40[i], mBuf);
1441       }
1442
1443    }
1444    CMCHKPK(oduUnpackUInt8, param->fddDLOrTddSfBitmapLC.sfnPtnChoice, mBuf);
1445    //CMCHKPK(oduUnpackUInt16, param->fddDlOrTddSfBitmapBR, mBuf);
1446    
1447      for (i= (param->numSi-1); i >= 0; i--) {
1448                  CMCHKPK(oduUnpackUInt8, param->schdInfo[i].emtcSiNarrowBand, mBuf);
1449                  CMCHKPK(oduUnpackUInt16, param->schdInfo[i].emtcSiTbs, mBuf);
1450      }
1451
1452      for (i= (param->numSi-1); i >= 0; i--) {
1453           CMCHKPK(oduUnpackUInt32, param->siPeriodicity[i], mBuf);
1454         }
1455    
1456      CMCHKPK(oduUnpackUInt8, param->numSi, mBuf);  
1457
1458  return ROK;
1459 }
1460
1461
1462
1463
1464 S16 cmPkRgrEmtcRachCfg
1465 (
1466 RgrEmtcRachCfg *param,
1467 Buffer *mBuf
1468 )
1469 {
1470
1471    S32 i;
1472         
1473    CMCHKPK(oduUnpackUInt8, param->emtcCeLvlSupported, mBuf);
1474
1475    for (i=RGR_MAX_CE_LEVEL-1; i >= 0; i--) {
1476           CMCHKPK(oduUnpackUInt8, param->ceLevelInfo[i].emtcRarHopping, mBuf);
1477           CMCHKPK(oduUnpackUInt16, param->ceLevelInfo[i].raEmtcWinSize, mBuf);
1478           CMCHKPK(oduUnpackUInt16, param->ceLevelInfo[i].raEmtcContResTmr, mBuf);
1479           CMCHKPK(oduUnpackUInt16, param->ceLevelInfo[i].emtcPreambleTransMax, mBuf);
1480           CMCHKPK(oduUnpackUInt8, param->ceLevelInfo[i].emtcPreambleMap.firstPreamble, mBuf);
1481           CMCHKPK(oduUnpackUInt8, param->ceLevelInfo[i].emtcPreambleMap.lastPreamble, mBuf);
1482         }
1483    
1484  return ROK;
1485 }
1486
1487
1488 S16 cmPkRgrEmtcPdschCfg
1489 (
1490 RgrEmtcPdschCfg*param,
1491 Buffer *mBuf
1492 )
1493 {
1494
1495    CMCHKPK(oduUnpackUInt16, param->emtcMaxRepCeModeA, mBuf);
1496    CMCHKPK(oduUnpackUInt16, param->emtcMaxRepCeModeB, mBuf);
1497    
1498  return ROK;
1499 }
1500
1501 S16 cmPkRgrEmtcPuschCfg
1502 (
1503 RgrEmtcPuschCfg*param,
1504 Buffer *mBuf
1505 )
1506 {
1507    CMCHKPK(oduUnpackUInt16, param->emtcMaxRepCeModeA, mBuf);
1508    CMCHKPK(oduUnpackUInt16, param->emtcMaxRepCeModeB, mBuf);
1509    CMCHKPK(oduUnpackUInt8,  param->emtcHoppingOffset, mBuf);
1510    return ROK;
1511 }
1512
1513
1514
1515 S16 cmPkRgrEmtcPucchCfg
1516 (
1517 RgrEmtcPucchCfg *param,
1518 Buffer *mBuf
1519 )
1520 {
1521
1522    S32 i;
1523    for (i=RGR_MAX_CE_LEVEL-1; i >= 0; i--) 
1524    {
1525           CMCHKPK(oduUnpackUInt16, param->emtcN1pucchAnInfoLst[i], mBuf);
1526    }
1527
1528         CMCHKPK(oduUnpackUInt8, param->emtcPucchNumRepCEMsg4Lvl0, mBuf);
1529         CMCHKPK(oduUnpackUInt8, param->emtcPucchNumRepCEMsg4Lvl1, mBuf);
1530         CMCHKPK(oduUnpackUInt8, param->emtcPucchNumRepCEMsg4Lvl2, mBuf);
1531         CMCHKPK(oduUnpackUInt8, param->emtcPucchNumRepCEMsg4Lvl3, mBuf);        
1532    
1533  return ROK;
1534 }
1535
1536
1537 S16 cmPkRgrEmtcPrachCeParamCfg
1538 (
1539 RgrEmtcPrachCEParamLst *param,
1540 Buffer *mBuf
1541 )
1542 {
1543    CMCHKPK(oduUnpackUInt8, param->emtcPrachCfgIdx, mBuf);
1544    CMCHKPK(oduUnpackUInt8, param->emtcPrachFreqOffset, mBuf);
1545    CMCHKPK(oduUnpackUInt16,  param->emtcPrachStartSubFrame, mBuf);
1546    CMCHKPK(oduUnpackUInt8, param->emtcMaxPremAttemptCE, mBuf);
1547    CMCHKPK(oduUnpackUInt8, param->emtcNumRepPerPreambleAtt, mBuf);
1548    CMCHKPK(oduUnpackUInt8,  param->emtcNumMpdcchNBtoMonitor, mBuf);
1549    CMCHKPK(oduUnpackUInt8, param->emtcMpdcchNBtoMonitor[0], mBuf);
1550    CMCHKPK(oduUnpackUInt8,  param->emtcMpdcchNBtoMonitor[1], mBuf);
1551    CMCHKPK(oduUnpackUInt16, param->emtcMpdcchNumRep, mBuf);
1552    CMCHKPK(oduUnpackUInt8,  param->emtcPrachHoppingCfg, mBuf);   
1553    return ROK;
1554 }
1555
1556
1557
1558 S16 cmPkRgrEmtcPrachCfg
1559 (
1560 RgrEmtcPrachCfg *param,
1561 Buffer *mBuf
1562 )
1563 {
1564
1565    S32 i;
1566         CMCHKPK(oduUnpackUInt8, param->emtcMpdcchStartSFCssRaFdd, mBuf);
1567         CMCHKPK(oduUnpackUInt8, param->emtcPrachHopingOffset, mBuf);
1568         CMCHKPK(oduUnpackUInt8, param->emtcInitialCElevel, mBuf);
1569    for (i=RGR_MAX_CE_LEVEL-1; i >= 0; i--) {    
1570         CMCHKPK(cmPkRgrEmtcPrachCeParamCfg, &param->emtcPrachCEparmLst[i], mBuf);
1571         }
1572    
1573  return ROK;
1574 }
1575
1576
1577
1578
1579 S16 cmPkRgrEmtcCfg
1580 (
1581 RgrEmtcCellCfg *param,
1582 Buffer *mBuf
1583 )
1584 {
1585    CMCHKPK(oduUnpackUInt16, param->pci, mBuf);
1586    CMCHKPK(oduUnpackUInt32, param->emtcT300Tmr, mBuf);
1587    CMCHKPK(oduUnpackUInt32, param->emtcT301Tmr, mBuf);
1588    CMCHKPK(cmPkRgrEmtcSiCfg, &param->emtcSiCfg, mBuf);
1589    CMCHKPK(cmPkRgrEmtcRachCfg, &param->emtcRachCfg, mBuf);
1590    CMCHKPK(cmPkRgrEmtcPdschCfg, &param->emtcPdschCfg, mBuf);
1591    CMCHKPK(cmPkRgrEmtcPuschCfg, &param->emtcPuschCfg, mBuf);
1592    CMCHKPK(cmPkRgrEmtcPrachCfg, &param->emtcPrachCfg, mBuf);
1593    CMCHKPK(cmPkRgrEmtcPucchCfg, &param->emtcPucchCfg, mBuf);
1594    CMCHKPK(cmPkRgrEmtcRntiCfg, &param->emtcMacRnti, mBuf);
1595    CMCHKPK(oduUnpackUInt8, param->emtcPdschNbIdx, mBuf);
1596    CMCHKPK(oduUnpackUInt8, param->emtcMpdcchNbIdx, mBuf);
1597    CMCHKPK(oduUnpackUInt8, param->emtcPuschNbIdx, mBuf);
1598    
1599    return ROK;
1600 }
1601
1602 /* EMTC related pack changes end*/
1603
1604 /* EMTC related unpack changes start*/
1605
1606 S16 cmUnpkRgrEmtcSiCfg
1607 (
1608 RgrEmtcSiCfg *param,
1609 Buffer *mBuf
1610 )
1611 {
1612
1613      S32 i;
1614      uint32_t tmpEnum; 
1615      CMCHKUNPK(oduPackUInt8, &param->numSi, mBuf); 
1616
1617      for (i=0; i < param->numSi ; i++) 
1618      {
1619          CMCHKUNPK(oduPackUInt32,(uint32_t*)&tmpEnum,mBuf);
1620          param->siPeriodicity[i] = (RgrSiPeriodicity) tmpEnum;
1621      }   
1622
1623      for (i=0; i < param->numSi ; i++)
1624      {
1625          CMCHKUNPK(oduPackUInt16, &param->schdInfo[i].emtcSiTbs, mBuf);
1626          CMCHKUNPK(oduPackUInt8, &param->schdInfo[i].emtcSiNarrowBand, mBuf);
1627      }
1628      //CMCHKUNPK(oduPackUInt16, &param->fddDlOrTddSfBitmapBR, mBuf);
1629      CMCHKUNPK(oduPackUInt8, &param->fddDLOrTddSfBitmapLC.sfnPtnChoice, mBuf);
1630      /*Changes by SIMRAN*/
1631        if(!(param->fddDLOrTddSfBitmapLC.sfnPtnChoice))
1632        {
1633         CMCHKUNPK(oduPackUInt16, &param->fddDLOrTddSfBitmapLC.u.ptn10, mBuf);
1634        }
1635        else
1636        {
1637           for (i=1; i>=0; i--) {
1638             CMCHKUNPK(oduPackUInt32, &param->fddDLOrTddSfBitmapLC.u.ptn40[i], mBuf);
1639             }
1640      }
1641
1642      CMCHKUNPK(oduPackUInt16, &param->startSymbolLc, mBuf);
1643      CMCHKUNPK(oduPackUInt8, &param->siRepetition, mBuf);
1644      CMCHKUNPK(oduPackUInt8, &param->sib1Repetition, mBuf);
1645      CMCHKUNPK(oduPackUInt8, &param->siWinSizeBr, mBuf);
1646      CMCHKUNPK(oduPackUInt32, (uint32_t*)&tmpEnum, mBuf);
1647      param->modPrd = (RgrModPeriodicity) tmpEnum;
1648      CMCHKUNPK(oduPackUInt8, &param->siHoppingEnable, mBuf);
1649
1650           return ROK;
1651 }
1652
1653
1654
1655
1656 S16 cmUnpkRgrEmtcRachCfg
1657 (
1658 RgrEmtcRachCfg *param,
1659 Buffer *mBuf
1660 )
1661 {
1662
1663    S32 i;
1664    for (i=0; i < RGR_MAX_CE_LEVEL; i++) {
1665           CMCHKUNPK(oduPackUInt8, &(param->ceLevelInfo[i].emtcPreambleMap.lastPreamble), mBuf);
1666           CMCHKUNPK(oduPackUInt8, &(param->ceLevelInfo[i].emtcPreambleMap.firstPreamble), mBuf);
1667           CMCHKUNPK(oduPackUInt16, &(param->ceLevelInfo[i].emtcPreambleTransMax), mBuf);
1668           CMCHKUNPK(oduPackUInt16, &(param->ceLevelInfo[i].raEmtcContResTmr), mBuf);
1669           CMCHKUNPK(oduPackUInt16, &(param->ceLevelInfo[i].raEmtcWinSize), mBuf);
1670           CMCHKUNPK(oduPackUInt8,&(param->ceLevelInfo[i].emtcRarHopping), mBuf);
1671         }
1672     CMCHKUNPK(oduPackUInt8, &param->emtcCeLvlSupported, mBuf);   
1673  return ROK;
1674 }
1675
1676
1677 S16 cmUnpkRgrEmtcPdschCfg
1678 (
1679 RgrEmtcPdschCfg*param,
1680 Buffer *mBuf
1681 )
1682 {
1683
1684    CMCHKUNPK(oduPackUInt16, &param->emtcMaxRepCeModeB, mBuf);
1685    CMCHKUNPK(oduPackUInt16, &param->emtcMaxRepCeModeA, mBuf);
1686  return ROK;
1687 }
1688
1689 S16 cmUnpkRgrEmtcPuschCfg
1690 (
1691 RgrEmtcPuschCfg*param,
1692 Buffer *mBuf
1693 )
1694 {
1695    CMCHKUNPK(oduPackUInt8,  &param->emtcHoppingOffset, mBuf);
1696    CMCHKUNPK(oduPackUInt16, &param->emtcMaxRepCeModeB, mBuf);
1697    CMCHKUNPK(oduPackUInt16, &param->emtcMaxRepCeModeA, mBuf);
1698    return ROK;
1699 }
1700
1701
1702
1703 S16 cmUnpkRgrEmtcPucchCfg
1704 (
1705 RgrEmtcPucchCfg *param,
1706 Buffer *mBuf
1707 )
1708 {
1709
1710    S32 i;
1711
1712
1713         CMCHKUNPK(oduPackUInt8, &param->emtcPucchNumRepCEMsg4Lvl3, mBuf);
1714         CMCHKUNPK(oduPackUInt8, &param->emtcPucchNumRepCEMsg4Lvl2, mBuf);
1715         CMCHKUNPK(oduPackUInt8, &param->emtcPucchNumRepCEMsg4Lvl1, mBuf);
1716         CMCHKUNPK(oduPackUInt8, &param->emtcPucchNumRepCEMsg4Lvl0, mBuf);       
1717  
1718    for (i=0; i <  RGR_MAX_CE_LEVEL ; i++) {
1719           CMCHKUNPK(oduPackUInt16, &param->emtcN1pucchAnInfoLst[i], mBuf);
1720         }   
1721  return ROK;
1722 }
1723
1724
1725 S16 cmUnpkRgrEmtcPrachCeParamCfg
1726 (
1727 RgrEmtcPrachCEParamLst *param,
1728 Buffer *mBuf
1729 )
1730 {
1731    CMCHKUNPK(oduPackUInt8,  &param->emtcPrachHoppingCfg, mBuf);  
1732    CMCHKUNPK(oduPackUInt16, &param->emtcMpdcchNumRep, mBuf);
1733    CMCHKUNPK(oduPackUInt8,  &param->emtcMpdcchNBtoMonitor[1], mBuf);
1734    CMCHKUNPK(oduPackUInt8, &param->emtcMpdcchNBtoMonitor[0], mBuf);
1735    CMCHKUNPK(oduPackUInt8,  &param->emtcNumMpdcchNBtoMonitor, mBuf);
1736    CMCHKUNPK(oduPackUInt8, &param->emtcNumRepPerPreambleAtt, mBuf);
1737    CMCHKUNPK(oduPackUInt8, &param->emtcMaxPremAttemptCE, mBuf);
1738    CMCHKUNPK(oduPackUInt16,  &param->emtcPrachStartSubFrame, mBuf);
1739    CMCHKUNPK(oduPackUInt8, &param->emtcPrachFreqOffset, mBuf);
1740    CMCHKUNPK(oduPackUInt8, &param->emtcPrachCfgIdx, mBuf); 
1741    return ROK;
1742 }
1743
1744
1745
1746 S16 cmUnpkRgrEmtcPrachCfg
1747 (
1748 RgrEmtcPrachCfg *param,
1749 Buffer *mBuf
1750 )
1751 {
1752
1753    S32 i;
1754    for (i=0; i < RGR_MAX_CE_LEVEL; i++) {       
1755         CMCHKUNPK(cmUnpkRgrEmtcPrachCeParamCfg, &param->emtcPrachCEparmLst[i], mBuf);
1756         }
1757         CMCHKUNPK(oduPackUInt8, &param->emtcInitialCElevel, mBuf);
1758         CMCHKUNPK(oduPackUInt8, &param->emtcPrachHopingOffset, mBuf);
1759         CMCHKUNPK(oduPackUInt8, &param->emtcMpdcchStartSFCssRaFdd, mBuf);
1760
1761  return ROK;
1762 }
1763
1764 S16 cmUnpkRgrEmtcCfg
1765 (
1766 RgrEmtcCellCfg *param,
1767 Buffer *mBuf
1768 )
1769 {
1770
1771    CMCHKUNPK(oduPackUInt8, &param->emtcPuschNbIdx, mBuf);
1772    CMCHKUNPK(oduPackUInt8, &param->emtcMpdcchNbIdx, mBuf);
1773    CMCHKUNPK(oduPackUInt8, &param->emtcPdschNbIdx, mBuf);
1774    CMCHKUNPK(cmUnpkRgrEmtcRntiCfg, &param->emtcMacRnti, mBuf);
1775    CMCHKUNPK(cmUnpkRgrEmtcPucchCfg, &param->emtcPucchCfg, mBuf);
1776    CMCHKUNPK(cmUnpkRgrEmtcPrachCfg, &param->emtcPrachCfg, mBuf);
1777    CMCHKUNPK(cmUnpkRgrEmtcPuschCfg, &param->emtcPuschCfg, mBuf);
1778    CMCHKUNPK(cmUnpkRgrEmtcPdschCfg, &param->emtcPdschCfg, mBuf);
1779    CMCHKUNPK(cmUnpkRgrEmtcRachCfg, &param->emtcRachCfg, mBuf);
1780    CMCHKUNPK(cmUnpkRgrEmtcSiCfg, &param->emtcSiCfg, mBuf);
1781    CMCHKUNPK(oduPackUInt32,&param->emtcT301Tmr, mBuf);
1782    CMCHKUNPK(oduPackUInt32, &param->emtcT300Tmr, mBuf);
1783    CMCHKUNPK(oduPackUInt16, &param->pci, mBuf);
1784
1785
1786
1787
1788
1789    return ROK;
1790 }
1791
1792 /* EMTC related unpack changes end*/
1793
1794
1795 #endif
1796
1797 \f
1798 /***********************************************************
1799 *
1800 *     Func : cmUnpkRgrBwCfg
1801 *
1802 *
1803 *     Desc : Bandwidth configuration per cell
1804 *
1805 *
1806 *     Ret  : S16
1807 *
1808 *     Notes:
1809 *
1810 *     File  : 
1811 *
1812 **********************************************************/
1813 S16 cmUnpkRgrBwCfg
1814 (
1815 RgrBwCfg *param,
1816 Buffer *mBuf
1817 )
1818 {
1819
1820    CMCHKUNPK(oduPackUInt8, &param->dlTotalBw, mBuf);
1821    CMCHKUNPK(oduPackUInt8, &param->ulTotalBw, mBuf);
1822    return ROK;
1823 }
1824
1825
1826 \f
1827 /***********************************************************
1828 *
1829 *     Func : cmPkRgrPhichCfg
1830 *
1831 *
1832 *     Desc : PHICH configuration per cell
1833 *
1834 *
1835 *     Ret  : S16
1836 *
1837 *     Notes:
1838 *
1839 *     File  : 
1840 *
1841 **********************************************************/
1842 S16 cmPkRgrPhichCfg
1843 (
1844 RgrPhichCfg *param,
1845 Buffer *mBuf
1846 )
1847 {
1848
1849    CMCHKPK(oduUnpackUInt8, param->isDurExtend, mBuf);
1850    CMCHKPK(oduUnpackUInt32, param->ngEnum, mBuf);
1851    return ROK;
1852 }
1853
1854
1855 \f
1856 /***********************************************************
1857 *
1858 *     Func : cmUnpkRgrPhichCfg
1859 *
1860 *
1861 *     Desc : PHICH configuration per cell
1862 *
1863 *
1864 *     Ret  : S16
1865 *
1866 *     Notes:
1867 *
1868 *     File  : 
1869 *
1870 **********************************************************/
1871 S16 cmUnpkRgrPhichCfg
1872 (
1873 RgrPhichCfg *param,
1874 Buffer *mBuf
1875 )
1876 {
1877    uint32_t tmpEnum;
1878
1879
1880    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
1881    param->ngEnum = (RgrPhichNg) tmpEnum;
1882    CMCHKUNPK(oduPackUInt8, &param->isDurExtend, mBuf);
1883    return ROK;
1884 }
1885
1886
1887 \f
1888 /***********************************************************
1889 *
1890 *     Func : cmPkRgrPucchCfg
1891 *
1892 *
1893 *     Desc : PUCCH configuration per cell
1894 *
1895 *
1896 *     Ret  : S16
1897 *
1898 *     Notes:
1899 *
1900 *     File  : 
1901 *
1902 **********************************************************/
1903 S16 cmPkRgrPucchCfg
1904 (
1905 RgrPucchCfg *param,
1906 Buffer *mBuf
1907 )
1908 {
1909
1910    CMCHKPK(oduUnpackUInt8, param->maxPucchRb, mBuf);
1911    CMCHKPK(oduUnpackUInt8, param->cyclicShift, mBuf);
1912    CMCHKPK(oduUnpackUInt8, param->deltaShift, mBuf);
1913    CMCHKPK(oduUnpackUInt16, param->n1PucchAn, mBuf);
1914    CMCHKPK(oduUnpackUInt8, param->resourceSize, mBuf);
1915
1916    return ROK;
1917 }
1918
1919
1920 \f
1921 /***********************************************************
1922 *
1923 *     Func : cmUnpkRgrPucchCfg
1924 *
1925 *
1926 *     Desc : PUCCH configuration per cell
1927 *
1928 *
1929 *     Ret  : S16
1930 *
1931 *     Notes:
1932 *
1933 *     File  : 
1934 *
1935 **********************************************************/
1936 S16 cmUnpkRgrPucchCfg
1937 (
1938 RgrPucchCfg *param,
1939 Buffer *mBuf
1940 )
1941 {
1942
1943    CMCHKUNPK(oduPackUInt8, &param->resourceSize, mBuf);
1944    CMCHKUNPK(oduPackUInt16, &param->n1PucchAn, mBuf);
1945    CMCHKUNPK(oduPackUInt8, &param->deltaShift, mBuf);
1946    CMCHKUNPK(oduPackUInt8, &param->cyclicShift, mBuf);
1947    CMCHKUNPK(oduPackUInt8, &param->maxPucchRb, mBuf);
1948
1949    return ROK;
1950 }
1951
1952
1953 \f
1954 /***********************************************************
1955 *
1956 *     Func : cmPkRgrSrsCfg
1957 *
1958 *
1959 *     Desc : SRS configuration per cell
1960 *
1961 *
1962 *     Ret  : S16
1963 *
1964 *     Notes:
1965 *
1966 *     File  : 
1967 *
1968 **********************************************************/
1969 S16 cmPkRgrSrsCfg
1970 (
1971 RgrSrsCfg *param,
1972 Buffer *mBuf
1973 )
1974 {
1975
1976
1977    CMCHKPK(oduUnpackUInt8, param->srsSubFrameCfg, mBuf);
1978    CMCHKPK(oduUnpackUInt32, param->srsBwEnum, mBuf);
1979    CMCHKPK(oduUnpackUInt32, param->srsCfgPrdEnum, mBuf);
1980    CMCHKPK(oduUnpackUInt8, param->isSrsCfgSetup, mBuf);
1981    return ROK;
1982 }
1983
1984
1985 \f
1986 /***********************************************************
1987 *
1988 *     Func : cmUnpkRgrSrsCfg
1989 *
1990 *
1991 *     Desc : SRS configuration per cell
1992 *
1993 *
1994 *     Ret  : S16
1995 *
1996 *     Notes:
1997 *
1998 *     File  : 
1999 *
2000 **********************************************************/
2001 S16 cmUnpkRgrSrsCfg
2002 (
2003 RgrSrsCfg *param,
2004 Buffer *mBuf
2005 )
2006 {
2007    uint32_t tmpEnum;
2008
2009    CMCHKUNPK(oduPackUInt8, &param->isSrsCfgSetup, mBuf);
2010    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
2011    param->srsCfgPrdEnum = (RgrSrsCfgPrd) tmpEnum;
2012    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
2013    param->srsBwEnum = (RgrSrsBwCfg) tmpEnum;
2014    CMCHKUNPK(oduPackUInt8, &param->srsSubFrameCfg, mBuf);
2015    return ROK;
2016 }
2017
2018
2019 \f
2020 /***********************************************************
2021 *
2022 *     Func : cmPkRgrRachCfg
2023 *
2024 *
2025 *     Desc : RACH configuration per cell
2026 *
2027 *
2028 *     Ret  : S16
2029 *
2030 *     Notes:
2031 *
2032 *     File  : 
2033 *
2034 **********************************************************/
2035 S16 cmPkRgrRachCfg
2036 (
2037 RgrRachCfg *param,
2038 Buffer *mBuf
2039 )
2040 {
2041
2042    S32 i;
2043
2044    CMCHKPK(oduUnpackUInt8, param->prachResource, mBuf);
2045    CMCHKPK(oduUnpackUInt16, param->msgSizeGrpA, mBuf);
2046    CMCHKPK(oduUnpackUInt8, param->sizeRaPreambleGrpA, mBuf);
2047    CMCHKPK(oduUnpackUInt8, param->numRaPreamble, mBuf);
2048    CMCHKPK(oduUnpackUInt8, param->maxMsg3Tx, mBuf);
2049       for (i=param->raOccasion.size-1; i >= 0; i--) {
2050          CMCHKPK(oduUnpackUInt8, param->raOccasion.subFrameNum[i], mBuf);
2051       }
2052       CMCHKPK(oduUnpackUInt32, param->raOccasion.sfnEnum, mBuf);
2053       CMCHKPK(oduUnpackUInt8, param->raOccasion.size, mBuf);
2054    CMCHKPK(oduUnpackUInt8, param->raWinSize, mBuf);
2055    CMCHKPK(oduUnpackUInt8, param->preambleFormat, mBuf);
2056 #ifdef RGR_V1
2057    /* rgr_c_001.main_5: cccpu00112372: Added contention resolution 
2058     * timer configuration */
2059    CMCHKPK(oduUnpackUInt8, param->contResTmr, mBuf);
2060 #endif
2061    return ROK;
2062 }
2063
2064
2065 \f
2066 /***********************************************************
2067 *
2068 *     Func : cmUnpkRgrRachCfg
2069 *
2070 *
2071 *     Desc : RACH configuration per cell
2072 *
2073 *
2074 *     Ret  : S16
2075 *
2076 *     Notes:
2077 *
2078 *     File  : 
2079 *
2080 **********************************************************/
2081 S16 cmUnpkRgrRachCfg
2082 (
2083 RgrRachCfg *param,
2084 Buffer *mBuf
2085 )
2086 {
2087    uint32_t tmpEnum;
2088
2089    S32 i;
2090 #ifdef RGR_V1 
2091    /* rgr_c_001.main_5: cccpu00112372: Added contention resolution 
2092     * timer configuration */
2093    CMCHKUNPK(oduPackUInt8, &param->contResTmr, mBuf);
2094 #endif
2095    CMCHKUNPK(oduPackUInt8, &param->preambleFormat, mBuf);
2096    CMCHKUNPK(oduPackUInt8, &param->raWinSize, mBuf);
2097       CMCHKUNPK(oduPackUInt8, &param->raOccasion.size, mBuf);
2098    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
2099    param->raOccasion.sfnEnum = (RgrRaSfn) tmpEnum;
2100       for (i=0; i<param->raOccasion.size; i++) {
2101          CMCHKUNPK(oduPackUInt8, &param->raOccasion.subFrameNum[i], mBuf);
2102       }
2103    CMCHKUNPK(oduPackUInt8, &param->maxMsg3Tx, mBuf);
2104    CMCHKUNPK(oduPackUInt8, &param->numRaPreamble, mBuf);
2105    CMCHKUNPK(oduPackUInt8, &param->sizeRaPreambleGrpA, mBuf);
2106    CMCHKUNPK(oduPackUInt16, &param->msgSizeGrpA, mBuf);
2107    CMCHKUNPK(oduPackUInt8, &param->prachResource, mBuf);
2108    return ROK;
2109 }
2110
2111
2112 \f
2113 /***********************************************************
2114 *
2115 *     Func : cmPkRgrSiCfg
2116 *
2117 *
2118 *     Desc : SI Configuration per cell
2119 *
2120 *
2121 *     Ret  : S16
2122 *
2123 *     Notes:
2124 *
2125 *     File  : 
2126 *
2127 **********************************************************/
2128 S16 cmPkRgrSiCfg
2129 (
2130 RgrSiCfg *param,
2131 Buffer *mBuf
2132 )
2133 {
2134    /* rgr_c_001.main_4:MOD-Modified for SI Enhancement. */
2135 #ifdef RGR_SI_SCH
2136    S16 idx;
2137 #endif/*RGR_SI_SCH*/
2138
2139
2140 #ifdef RGR_SI_SCH
2141    if(param->numSi > sizeof(param->siPeriodicity)/
2142                        sizeof(param->siPeriodicity[0]))
2143       param->numSi = sizeof(param->siPeriodicity)/
2144                        sizeof(param->siPeriodicity[0]);
2145
2146    for (idx=param->numSi-1; idx >= 0; idx--) {
2147    /* Enum to be packed/unpacked as uint32_t instead of S32 */
2148       CMCHKPK(oduUnpackUInt32, param->siPeriodicity[idx], mBuf);
2149    }
2150    CMCHKPK(oduUnpackUInt8, param->numSi, mBuf);
2151    /*rgr_c_001.main_9 ccpu00115364 MOD changed modPrd to enum*/
2152    CMCHKPK(oduUnpackUInt32, (uint32_t)param->modPrd, mBuf);
2153 #endif/*RGR_SI_SCH*/
2154    CMCHKPK(oduUnpackUInt8, param->retxCnt, mBuf);
2155    CMCHKPK(oduUnpackUInt8, param->siWinSize, mBuf);
2156    return ROK;
2157 }
2158
2159
2160 \f
2161 /***********************************************************
2162 *
2163 *     Func : cmUnpkRgrSiCfg
2164 *
2165 *
2166 *     Desc : SI Configuration per cell
2167 *
2168 *
2169 *     Ret  : S16
2170 *
2171 *     Notes:
2172 *
2173 *     File  : 
2174 *
2175 **********************************************************/
2176 S16 cmUnpkRgrSiCfg
2177 (
2178 RgrSiCfg *param,
2179 Buffer *mBuf
2180 )
2181 {
2182    uint32_t tmpEnum;
2183    /* rgr_c_001.main_4:MOD-Modified for SI Enhancement. */
2184 #ifdef RGR_SI_SCH
2185    S16 idx;
2186 #endif/*RGR_SI_SCH*/
2187
2188
2189    CMCHKUNPK(oduPackUInt8, &param->siWinSize, mBuf);
2190    CMCHKUNPK(oduPackUInt8, &param->retxCnt, mBuf);
2191 #ifdef RGR_SI_SCH
2192    /*rgr_c_001.main_9 ccpu00115364 MOD changed modPrd to enum*/
2193    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
2194    param->modPrd = (RgrModPeriodicity) tmpEnum;
2195    CMCHKUNPK(oduPackUInt8, &param->numSi, mBuf);
2196
2197    if(param->numSi > sizeof(param->siPeriodicity)/
2198                        sizeof(param->siPeriodicity[0]))
2199       param->numSi = sizeof(param->siPeriodicity)/
2200                        sizeof(param->siPeriodicity[0]);
2201
2202    /* Enum to be packed/unpacked as uint32_t instead of S32 */
2203    for (idx=0; idx < param->numSi; idx++) {
2204       CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
2205       param->siPeriodicity[idx] = (RgrSiPeriodicity) tmpEnum;
2206    }
2207 #endif/*RGR_SI_SCH*/
2208
2209    return ROK;
2210 }
2211
2212
2213 \f
2214 /***********************************************************
2215 *
2216 *     Func : cmPkRgrTpcRntiCfg
2217 *
2218 *
2219 *     Desc : TPC RNTI Range
2220 *
2221 *
2222 *     Ret  : S16
2223 *
2224 *     Notes:
2225 *
2226 *     File  : 
2227 *
2228 **********************************************************/
2229 S16 cmPkRgrTpcRntiCfg
2230 (
2231 RgrTpcRntiCfg *param,
2232 Buffer *mBuf
2233 )
2234 {
2235
2236
2237    CMCHKPK(oduUnpackUInt16, param->size, mBuf);
2238    CMCHKPK(cmPkLteRnti, param->startTpcRnti, mBuf);
2239    return ROK;
2240 }
2241
2242
2243 \f
2244 /***********************************************************
2245 *
2246 *     Func : cmUnpkRgrTpcRntiCfg
2247 *
2248 *
2249 *     Desc : TPC RNTI Range
2250 *
2251 *
2252 *     Ret  : S16
2253 *
2254 *     Notes:
2255 *
2256 *     File  : 
2257 *
2258 **********************************************************/
2259 S16 cmUnpkRgrTpcRntiCfg
2260 (
2261 RgrTpcRntiCfg *param,
2262 Buffer *mBuf
2263 )
2264 {
2265
2266
2267    CMCHKUNPK(cmUnpkLteRnti, &param->startTpcRnti, mBuf);
2268    CMCHKUNPK(oduPackUInt16, &param->size, mBuf);
2269    return ROK;
2270 }
2271
2272
2273 \f
2274 /***********************************************************
2275 *
2276 *     Func : cmPkRgrUlPwrCfg
2277 *
2278 *
2279 *     Desc : Cell specific power configuration
2280 *
2281 *
2282 *     Ret  : S16
2283 *
2284 *     Notes:
2285 *
2286 *     File  : 
2287 *
2288 **********************************************************/
2289 S16 cmPkRgrUlPwrCfg
2290 (
2291 RgrUlPwrCfg *param,
2292 Buffer *mBuf
2293 )
2294 {
2295
2296    CMCHKPK(cmPkRgrTpcRntiCfg, &param->puschPwrFmt3a, mBuf);
2297    CMCHKPK(cmPkRgrTpcRntiCfg, &param->puschPwrFmt3, mBuf);
2298    CMCHKPK(cmPkRgrTpcRntiCfg, &param->pucchPwrFmt3a, mBuf);
2299    CMCHKPK(cmPkRgrTpcRntiCfg, &param->pucchPwrFmt3, mBuf);
2300    CMCHKPK(SPkS8, param->deltaPreambleMsg3, mBuf);
2301    CMCHKPK(SPkS8, param->p0NominalPucch, mBuf);
2302    CMCHKPK(oduUnpackUInt32, param->alpha, mBuf);
2303    CMCHKPK(SPkS8, param->p0NominalPusch, mBuf);
2304    return ROK;
2305 }
2306
2307
2308 \f
2309 /***********************************************************
2310 *
2311 *     Func : cmUnpkRgrUlPwrCfg
2312 *
2313 *
2314 *     Desc : Cell specific power configuration
2315 *
2316 *
2317 *     Ret  : S16
2318 *
2319 *     Notes:
2320 *
2321 *     File  : 
2322 *
2323 **********************************************************/
2324 S16 cmUnpkRgrUlPwrCfg
2325 (
2326 RgrUlPwrCfg *param,
2327 Buffer *mBuf
2328 )
2329 {
2330    uint32_t tmpEnum;
2331
2332
2333    CMCHKUNPK(SUnpkS8, &param->p0NominalPusch, mBuf);
2334    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
2335    param->alpha = (RgrPwrAlpha) tmpEnum;
2336    CMCHKUNPK(SUnpkS8, &param->p0NominalPucch, mBuf);
2337    CMCHKUNPK(SUnpkS8, &param->deltaPreambleMsg3, mBuf);
2338    CMCHKUNPK(cmUnpkRgrTpcRntiCfg, &param->pucchPwrFmt3, mBuf);
2339    CMCHKUNPK(cmUnpkRgrTpcRntiCfg, &param->pucchPwrFmt3a, mBuf);
2340    CMCHKUNPK(cmUnpkRgrTpcRntiCfg, &param->puschPwrFmt3, mBuf);
2341    CMCHKUNPK(cmUnpkRgrTpcRntiCfg, &param->puschPwrFmt3a, mBuf);
2342    return ROK;
2343 }
2344
2345
2346 \f
2347 /***********************************************************
2348 *
2349 *     Func : cmPkRgrPuschCfg
2350 *
2351 *
2352 *     Desc : brief cell specific hopping configuration
2353 *
2354 *
2355 *     Ret  : S16
2356 *
2357 *     Notes:
2358 *
2359 *     File  : 
2360 *
2361 **********************************************************/
2362 S16 cmPkRgrPuschCfg
2363 (
2364 RgrPuschCfg *param,
2365 Buffer *mBuf
2366 )
2367 {
2368
2369
2370    CMCHKPK(oduUnpackUInt8, param->hopOffst, mBuf);
2371    CMCHKPK(oduUnpackUInt8, param->isIntraHop, mBuf);
2372    CMCHKPK(oduUnpackUInt8, param->numSubBands, mBuf);
2373    return ROK;
2374 }
2375
2376
2377 \f
2378 /***********************************************************
2379 *
2380 *     Func : cmUnpkRgrPuschCfg
2381 *
2382 *
2383 *     Desc : brief cell specific hopping configuration
2384 *
2385 *
2386 *     Ret  : S16
2387 *
2388 *     Notes:
2389 *
2390 *     File  : 
2391 *
2392 **********************************************************/
2393 S16 cmUnpkRgrPuschCfg
2394 (
2395 RgrPuschCfg *param,
2396 Buffer *mBuf
2397 )
2398 {
2399
2400
2401    CMCHKUNPK(oduPackUInt8, &param->numSubBands, mBuf);
2402    CMCHKUNPK(oduPackUInt8, &param->isIntraHop, mBuf);
2403    CMCHKUNPK(oduPackUInt8, &param->hopOffst, mBuf);
2404    return ROK;
2405 }
2406
2407
2408 \f
2409 /***********************************************************
2410 *
2411 *     Func : cmPkRgrCodeBookRstCfg
2412 *
2413 *
2414 *     Desc : Number of bits in code book for different transmission modes
2415 *
2416 *
2417 *     Ret  : S16
2418 *
2419 *     Notes:
2420 *
2421 *     File  : 
2422 *
2423 **********************************************************/
2424 S16 cmPkRgrCodeBookRstCfg
2425 (
2426 RgrCodeBookRstCfg *param,
2427 Buffer *mBuf
2428 )
2429 {
2430
2431    S32 i;
2432
2433    for (i=1-1; i >= 0; i--) {
2434       CMCHKPK(oduUnpackUInt32, param->pmiBitMap[i], mBuf);
2435    }
2436    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
2437    return ROK;
2438 }
2439
2440
2441 \f
2442 /***********************************************************
2443 *
2444 *     Func : cmUnpkRgrCodeBookRstCfg
2445 *
2446 *
2447 *     Desc : Number of bits in code book for different transmission modes
2448 *
2449 *
2450 *     Ret  : S16
2451 *
2452 *     Notes:
2453 *
2454 *     File  : 
2455 *
2456 **********************************************************/
2457 S16 cmUnpkRgrCodeBookRstCfg
2458 (
2459 RgrCodeBookRstCfg *param,
2460 Buffer *mBuf
2461 )
2462 {
2463
2464    S32 i;
2465
2466    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
2467    for (i=0; i<1; i++) {
2468       CMCHKUNPK(oduPackUInt32, &param->pmiBitMap[i], mBuf);
2469    }
2470    return ROK;
2471 }
2472
2473
2474 \f
2475 /***********************************************************
2476 *
2477 *     Func : cmPkRgrPreambleSetCfg
2478 *
2479 *
2480 *     Desc : Range of PDCCH Order Preamble Set managed by MAC
2481 *
2482 *
2483 *     Ret  : S16
2484 *
2485 *     Notes:
2486 *
2487 *     File  : 
2488 *
2489 **********************************************************/
2490 S16 cmPkRgrPreambleSetCfg
2491 (
2492 RgrPreambleSetCfg *param,
2493 Buffer *mBuf
2494 )
2495 {
2496
2497
2498    CMCHKPK(oduUnpackUInt8, param->size, mBuf);
2499    CMCHKPK(oduUnpackUInt8, param->start, mBuf);
2500    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
2501    return ROK;
2502 }
2503
2504
2505 \f
2506 /***********************************************************
2507 *
2508 *     Func : cmUnpkRgrPreambleSetCfg
2509 *
2510 *
2511 *     Desc : Range of PDCCH Order Preamble Set managed by MAC
2512 *
2513 *
2514 *     Ret  : S16
2515 *
2516 *     Notes:
2517 *
2518 *     File  : 
2519 *
2520 **********************************************************/
2521 S16 cmUnpkRgrPreambleSetCfg
2522 (
2523 RgrPreambleSetCfg *param,
2524 Buffer *mBuf
2525 )
2526 {
2527
2528
2529    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
2530    CMCHKUNPK(oduPackUInt8, &param->start, mBuf);
2531    CMCHKUNPK(oduPackUInt8, &param->size, mBuf);
2532    return ROK;
2533 }
2534
2535
2536 \f
2537 /***********************************************************
2538 *
2539 *     Func : cmPkRgrCmnLchCfg
2540 *
2541 *
2542 *     Desc : Logical channel configuration info for common channels
2543 *
2544 *
2545 *     Ret  : S16
2546 *
2547 *     Notes:
2548 *
2549 *     File  : 
2550 *
2551 **********************************************************/
2552 S16 cmPkRgrCmnLchCfg
2553 (
2554 RgrCmnLchCfg *param,
2555 Buffer *mBuf
2556 )
2557 {
2558
2559    CMCHKPK(oduUnpackUInt8, param->ulTrchType, mBuf);
2560    CMCHKPK(oduUnpackUInt8, param->dlTrchType, mBuf);
2561    CMCHKPK(oduUnpackUInt8, param->dir, mBuf);
2562    CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
2563    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
2564    return ROK;
2565 }
2566
2567
2568 \f
2569 /***********************************************************
2570 *
2571 *     Func : cmUnpkRgrCmnLchCfg
2572 *
2573 *
2574 *     Desc : Logical channel configuration info for common channels
2575 *
2576 *
2577 *     Ret  : S16
2578 *
2579 *     Notes:
2580 *
2581 *     File  : 
2582 *
2583 **********************************************************/
2584 S16 cmUnpkRgrCmnLchCfg
2585 (
2586 RgrCmnLchCfg *param,
2587 Buffer *mBuf
2588 )
2589 {
2590
2591
2592    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
2593    CMCHKUNPK(cmUnpkLteLcType, &param->lcType, mBuf);
2594    CMCHKUNPK(oduPackUInt8, &param->dir, mBuf);
2595    CMCHKUNPK(oduPackUInt8, &param->dlTrchType, mBuf);
2596    CMCHKUNPK(oduPackUInt8, &param->ulTrchType, mBuf);
2597    return ROK;
2598 }
2599
2600
2601 \f
2602 /***********************************************************
2603 *
2604 *     Func : cmPkRgrDlfsCfg
2605 *
2606 *
2607 *     Desc : RGR configuration for DLFS scheduler
2608 *
2609 *
2610 *     Ret  : S16
2611 *
2612 *     Notes:
2613 *
2614 *     File  : 
2615 *
2616 **********************************************************/
2617 S16 cmPkRgrDlfsCfg
2618 (
2619 RgrDlfsCfg *param,
2620 Buffer *mBuf
2621 )
2622 {
2623
2624
2625    CMCHKPK(oduUnpackUInt8, param->thresholdCqi, mBuf);
2626    CMCHKPK(oduUnpackUInt8, param->isDlFreqSel, mBuf);
2627    return ROK;
2628 }
2629
2630
2631 \f
2632 /***********************************************************
2633 *
2634 *     Func : cmUnpkRgrDlfsCfg
2635 *
2636 *
2637 *     Desc : RGR configuration for DLFS scheduler
2638 *
2639 *
2640 *     Ret  : S16
2641 *
2642 *     Notes:
2643 *
2644 *     File  : 
2645 *
2646 **********************************************************/
2647 S16 cmUnpkRgrDlfsCfg
2648 (
2649 RgrDlfsCfg *param,
2650 Buffer *mBuf
2651 )
2652 {
2653
2654
2655    CMCHKUNPK(oduPackUInt8, &param->isDlFreqSel, mBuf);
2656    CMCHKUNPK(oduPackUInt8, &param->thresholdCqi, mBuf);
2657    return ROK;
2658 }
2659
2660
2661 #ifdef LTE_TDD
2662
2663 #ifdef LTE_TDD
2664
2665 \f
2666 /***********************************************************
2667 *
2668 *     Func : cmPkRgrTddPrachInfo
2669 *
2670 *
2671 *     Desc : PRACH resource information for TDD
2672 *
2673 *
2674 *     Ret  : S16
2675 *
2676 *     Notes:
2677 *
2678 *     File  : 
2679 *
2680 **********************************************************/
2681 S16 cmPkRgrTddPrachInfo
2682 (
2683 RgrTddPrachInfo *param,
2684 Buffer *mBuf
2685 )
2686 {
2687
2688
2689    CMCHKPK(oduUnpackUInt8, param->ulStartSfIdx, mBuf);
2690    CMCHKPK(oduUnpackUInt8, param->halfFrm, mBuf);
2691    CMCHKPK(oduUnpackUInt32, param->sfn, mBuf);
2692    CMCHKPK(oduUnpackUInt8, param->freqIdx, mBuf);
2693    return ROK;
2694 }
2695
2696
2697 \f
2698 /***********************************************************
2699 *
2700 *     Func : cmUnpkRgrTddPrachInfo
2701 *
2702 *
2703 *     Desc : PRACH resource information for TDD
2704 *
2705 *
2706 *     Ret  : S16
2707 *
2708 *     Notes:
2709 *
2710 *     File  : 
2711 *
2712 **********************************************************/
2713 S16 cmUnpkRgrTddPrachInfo
2714 (
2715 RgrTddPrachInfo *param,
2716 Buffer *mBuf
2717 )
2718 {
2719    uint32_t tmpEnum;
2720
2721
2722    CMCHKUNPK(oduPackUInt8, &param->freqIdx, mBuf);
2723    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
2724    param->sfn = tmpEnum;
2725    CMCHKUNPK(oduPackUInt8, &param->halfFrm, mBuf);
2726    CMCHKUNPK(oduPackUInt8, &param->ulStartSfIdx, mBuf);
2727    return ROK;
2728 }
2729
2730
2731 \f
2732 /***********************************************************
2733 *
2734 *     Func : cmPkRgrTddPrachRscInfo
2735 *
2736 *
2737 *     Desc : Set of PRACH Information for TDD
2738 *
2739 *
2740 *     Ret  : S16
2741 *
2742 *     Notes:
2743 *
2744 *     File  : 
2745 *
2746 **********************************************************/
2747 S16 cmPkRgrTddPrachRscInfo
2748 (
2749 RgrTddPrachRscInfo *param,
2750 Buffer *mBuf
2751 )
2752 {
2753
2754    S32 i;
2755
2756    for (i=param->numRsc-1; i >= 0; i--) {
2757       CMCHKPK(cmPkRgrTddPrachInfo, &param->prachInfo[i], mBuf);
2758    }
2759    CMCHKPK(oduUnpackUInt8, param->numRsc, mBuf);
2760    return ROK;
2761 }
2762
2763
2764 \f
2765 /***********************************************************
2766 *
2767 *     Func : cmUnpkRgrTddPrachRscInfo
2768 *
2769 *
2770 *     Desc : Set of PRACH Information for TDD
2771 *
2772 *
2773 *     Ret  : S16
2774 *
2775 *     Notes:
2776 *
2777 *     File  : 
2778 *
2779 **********************************************************/
2780 S16 cmUnpkRgrTddPrachRscInfo
2781 (
2782 RgrTddPrachRscInfo *param,
2783 Buffer *mBuf
2784 )
2785 {
2786
2787    S32 i;
2788
2789    CMCHKUNPK(oduPackUInt8, &param->numRsc, mBuf);
2790    for (i=0; i<param->numRsc; i++) {
2791       CMCHKUNPK(cmUnpkRgrTddPrachInfo, &param->prachInfo[i], mBuf);
2792    }
2793    return ROK;
2794 }
2795
2796
2797 #endif
2798
2799 #endif
2800
2801 \f
2802 /***********************************************************
2803 *
2804 *     Func : cmPkRgrEnbPfs
2805 *
2806 *
2807 *     Desc : PFS Configuration
2808 *
2809 *
2810 *     Ret  : S16
2811 *
2812 *     Notes:
2813 *
2814 *     File  : 
2815 *
2816 **********************************************************/
2817 S16 cmPkRgrEnbPfs
2818 (
2819 RgrEnbPfs  *param,
2820 Buffer    *mBuf
2821 )
2822 {
2823    S32 idx;
2824    for(idx = RGR_MAX_NUM_QCI-1; idx >= 0; idx--)
2825    {
2826       CMCHKPK(oduUnpackUInt32, param->qciWgt[idx], mBuf);
2827    }   
2828    CMCHKPK(oduUnpackUInt8, param->fairCoeffi, mBuf);
2829    CMCHKPK(oduUnpackUInt8, param->tptCoeffi, mBuf);
2830
2831    return ROK;
2832 }
2833
2834
2835 \f
2836 /***********************************************************
2837 *
2838 *     Func : cmUnpkRgrEnbPfs
2839 *
2840 *
2841 *     Desc : PFS Configuration
2842 *
2843 *
2844 *     Ret  : S16
2845 *
2846 *     Notes:
2847 *
2848 *     File  : 
2849 *
2850 **********************************************************/
2851 S16 cmUnpkRgrEnbPfs
2852 (
2853 RgrEnbPfs *param,
2854 Buffer   *mBuf
2855 )
2856 {
2857    S32 idx;
2858
2859    CMCHKUNPK(oduPackUInt8, &param->tptCoeffi, mBuf);
2860    CMCHKUNPK(oduPackUInt8, &param->fairCoeffi, mBuf);
2861    for(idx = 0; idx < RGR_MAX_NUM_QCI; idx++)
2862    {
2863       CMCHKUNPK(oduPackUInt32, &param->qciWgt[idx], mBuf);
2864    }   
2865    return ROK;
2866 }
2867
2868 /*rgr_c_001.main_7 - Added support for SPS*/
2869 \f
2870 /***********************************************************
2871 *
2872 *     Func : cmPkRgrSpsCellCfg
2873 *
2874 *
2875 *     Desc : DL SPS configuration parameters per UE 
2876 TODO: Check if this is to be added to re-configuration as well
2877 *
2878 *
2879 *     Ret  : S16
2880 *
2881 *     Notes:
2882 *
2883 *     File  : 
2884 *
2885 **********************************************************/
2886 S16 cmPkRgrSpsCellCfg
2887 (
2888 RgrSpsCellCfg *param,
2889 Buffer *mBuf
2890 )
2891 {
2892
2893    CMCHKPK(oduUnpackUInt16, param->maxSpsUePerUlSf, mBuf);
2894    CMCHKPK(oduUnpackUInt16, param->maxSpsUePerDlSf, mBuf);
2895    CMCHKPK(oduUnpackUInt8, param->maxSpsDlBw, mBuf);
2896
2897    return ROK;
2898 }
2899
2900
2901 \f
2902 /***********************************************************
2903 *
2904 *     Func : cmUnpkRgrSpsDlCellCfg
2905 *
2906 *
2907 *     Desc : DL SPS configuration parameters per UE 
2908 TODO: Check if this is to be added to re-configuration as well
2909 *
2910 *
2911 *     Ret  : S16
2912 *
2913 *     Notes:
2914 *
2915 *     File  : 
2916 *
2917 **********************************************************/
2918 S16 cmUnpkRgrSpsDlCellCfg
2919 (
2920 RgrSpsCellCfg *param,
2921 Buffer *mBuf
2922 )
2923 {
2924
2925
2926    CMCHKUNPK(oduPackUInt8, &param->maxSpsDlBw, mBuf);
2927    CMCHKUNPK(oduPackUInt16, &param->maxSpsUePerDlSf, mBuf);
2928    CMCHKUNPK(oduPackUInt16, &param->maxSpsUePerUlSf, mBuf);
2929    
2930    return ROK;
2931 }
2932
2933 #ifdef RG_5GTF
2934 S16 cmPkRgr5gtfCellCfg
2935 (
2936 Rgr5gtfCellCfg   *param,
2937 Buffer           *mBuf
2938 )
2939 {
2940    S8 idx = 0;      
2941    for (idx = MAX_5GTF_SUBFRAME_INFO - 1; idx >= 0 ;--idx)
2942    {
2943
2944       CMCHKPK(oduUnpackUInt32, param->dynConfig[(uint8_t)idx], mBuf);
2945    }
2946    CMCHKPK(oduUnpackUInt8, param->uePerGrp, mBuf);
2947    CMCHKPK(oduUnpackUInt8, param->ueGrpPerTti, mBuf);
2948    CMCHKPK(oduUnpackUInt8, param->numUes, mBuf);
2949    CMCHKPK(oduUnpackUInt8, param->numOfCC, mBuf);
2950    CMCHKPK(oduUnpackUInt8, param->bwPerCC, mBuf);
2951    CMCHKPK(oduUnpackUInt8, param->cfi, mBuf);
2952    return ROK;
2953 }
2954
2955 S16 cmUnPkRgr5gtfCellCfg
2956 (
2957 Rgr5gtfCellCfg   *param,
2958 Buffer           *mBuf
2959 )
2960 {
2961    S8 idx = 0;      
2962    
2963    CMCHKUNPK(oduPackUInt8, &param->cfi, mBuf);
2964    CMCHKUNPK(oduPackUInt8, &param->bwPerCC, mBuf);
2965    CMCHKUNPK(oduPackUInt8, &param->numOfCC, mBuf);
2966    CMCHKUNPK(oduPackUInt8, &param->numUes, mBuf);
2967    CMCHKUNPK(oduPackUInt8, &param->ueGrpPerTti, mBuf);
2968    CMCHKUNPK(oduPackUInt8, &param->uePerGrp, mBuf);
2969    for (idx = 0; idx < MAX_5GTF_SUBFRAME_INFO ; ++idx)
2970    {
2971
2972       CMCHKUNPK(oduPackUInt32, &param->dynConfig[(uint8_t)idx], mBuf);
2973    }
2974    return ROK;
2975 }
2976 #endif
2977
2978
2979 /*LAA : functions to pack and unpack LAA params*/
2980 /***********************************************************
2981 *
2982 *     Func : cmPkRgrLteUCellCfg
2983 *
2984 *
2985 *     Desc : LAA configuration for the Cell 
2986 *
2987 *
2988 *     Ret  : S16
2989 *
2990 *     Notes:
2991 *
2992 *     File  : 
2993 *
2994 **********************************************************/
2995 static S16 cmPkRgrLteUCellCfg
2996 (
2997 RgrLteUCfg *param,
2998 Buffer *mBuf
2999 )
3000 {
3001
3002    CMCHKPK(oduUnpackUInt8, param->isLaaCell, mBuf);
3003
3004    return ROK;
3005 }
3006
3007 /***********************************************************
3008 *
3009 *     Func : cmUnpkRgrLteUCellCfg
3010 *
3011 *
3012 *     Desc : LAA configuration for the cell 
3013 *
3014 *
3015 *     Ret  : S16
3016 *
3017 *     Notes:
3018 *
3019 *     File  : 
3020 *
3021 **********************************************************/
3022 static S16 cmUnpkRgrLteUCellCfg
3023 (
3024 RgrLteUCfg *param,
3025 Buffer *mBuf
3026 )
3027 {
3028
3029
3030    CMCHKUNPK(oduPackUInt8, &param->isLaaCell, mBuf);
3031    
3032    return ROK;
3033 }
3034
3035 /* LTE_ADV_FLAG_REMOVED_START */
3036 /***********************************************************
3037  *
3038  *     Func : cmPkRgrLteAdvancedUeConfig
3039  *
3040  *
3041  *     Desc : PAcks LteAdvancedUeConfig
3042  *
3043  *
3044  *     Ret  : S16
3045  *
3046  *     Notes:
3047  *
3048  *     File  : 
3049  *
3050  **********************************************************/
3051 S16 cmPkRgrLteAdvancedUeConfig
3052 (
3053 RgrLteAdvancedUeConfig *param,
3054 Buffer *mBuf
3055 )
3056 {
3057
3058    CMCHKPK(oduUnpackUInt8, param->isUeCellEdge, mBuf);
3059    CMCHKPK(oduUnpackUInt8, param->isAbsUe, mBuf);
3060    CMCHKPK(oduUnpackUInt32, param->pres, mBuf);
3061    return ROK;
3062 }
3063
3064 /***********************************************************
3065  *
3066  *     Func : cmUnpkRgrLteAdvancedUeConfig
3067  *
3068  *
3069  *     Desc : unpacks LteAdvancedUeConfig
3070  *
3071  *
3072  *     Ret  : S16
3073  *
3074  *     Notes:
3075  *
3076  *     File  : 
3077  *
3078  **********************************************************/
3079 S16 cmUnpkRgrLteAdvancedUeConfig
3080 (
3081 RgrLteAdvancedUeConfig *param,
3082 Buffer *mBuf
3083 )
3084 {
3085
3086    CMCHKUNPK(oduPackUInt32, &param->pres, mBuf);
3087    CMCHKUNPK(oduPackUInt8, &param->isAbsUe, mBuf);
3088    CMCHKUNPK(oduPackUInt8, &param->isUeCellEdge, mBuf);
3089    return ROK;
3090 }
3091
3092 /***********************************************************
3093  *
3094  *     Func : cmPkRgrAbsConfig
3095  *
3096  *
3097  *     Desc : Packs RgrAbsConfig
3098  *
3099  *
3100  *     Ret  : S16
3101  *
3102  *     Notes:
3103  *
3104  *     File  : 
3105  *
3106  **********************************************************/
3107 S16 cmPkRgrAbsConfig
3108 (
3109 RgrAbsConfig *param,
3110 Buffer *mBuf
3111 )
3112 {
3113    S8   indx = 0;
3114
3115    CMCHKPK(oduUnpackUInt32, (uint32_t)param->status, mBuf);
3116    for (indx = RGR_ABS_PATTERN_LEN-1; indx >= 0; indx--) 
3117    {
3118       CMCHKPK(oduUnpackUInt8, param->absPattern[(uint8_t)indx], mBuf);
3119    }
3120
3121    CMCHKPK(oduUnpackUInt32, param->absPatternType, mBuf);
3122    CMCHKPK(oduUnpackUInt32, param->absLoadPeriodicity, mBuf);
3123
3124    return ROK;
3125
3126 }
3127 /***********************************************************
3128  *
3129  *     Func : cmPkRgrSfrConfig
3130  *
3131  *
3132  *     Desc : Packs RgrSfrConfig
3133  *
3134  *
3135  *     Ret  : S16
3136  *
3137  *     Notes:
3138  *
3139  *     File  : 
3140  *
3141  **********************************************************/
3142 S16 cmPkRgrSfrConfig
3143 (
3144 RgrSfrConfig *param,
3145 Buffer *mBuf
3146 )
3147 {
3148
3149    CMCHKPK(oduUnpackUInt32, (uint32_t)param->status, mBuf);
3150 #ifdef TFU_UPGRADE   
3151    CMCHKPK(oduUnpackUInt32, param->pwrThreshold.pHigh, mBuf);
3152    CMCHKPK(oduUnpackUInt32, param->pwrThreshold.pLow, mBuf);
3153 #endif   
3154    CMCHKPK(oduUnpackUInt8, param->cellEdgeRbRange.endRb, mBuf);
3155    CMCHKPK(oduUnpackUInt8, param->cellEdgeRbRange.startRb, mBuf);
3156
3157    return ROK;
3158
3159 }
3160
3161
3162 /***********************************************************
3163  *
3164  *     Func : cmPkRgrDsfrConfig
3165  *
3166  *
3167  *     Desc : Packs RgrDsfrConfig
3168  *
3169  *
3170  *     Ret  : S16
3171  *
3172  *     Notes:  AIRSPAN_LTE_ADV_DSFR
3173  *
3174  *     File  : 
3175  *
3176  **********************************************************/
3177 S16 cmPkRgrDsfrConfig
3178 (
3179 RgrDsfrConfig *param,
3180 Buffer *mBuf
3181 )
3182 {
3183
3184    CMCHKPK(oduUnpackUInt32, (uint32_t)param->status, mBuf);
3185
3186    return ROK;
3187
3188 }
3189
3190
3191 /***********************************************************
3192  *
3193  *     Func : cmUnpkRgrDsfrConfig
3194  *
3195  *
3196  *     Desc : UnPacks RgrDsfrConfig
3197  *
3198  *
3199  *     Ret  : S16
3200  *
3201  *     Notes:  AIRSPAN_LTE_ADV_DSFR
3202  *
3203  *     File  : 
3204  *
3205  **********************************************************/
3206 S16 cmUnpkRgrDsfrConfig
3207 (
3208 RgrDsfrConfig *param,
3209 Buffer *mBuf
3210 )
3211 {
3212
3213    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->status, mBuf);
3214    return ROK;
3215
3216 }
3217
3218
3219 /***********************************************************
3220  *
3221  *     Func : cmPkRgrCellLteAdvancedFeatureCfg
3222  *
3223  *
3224  *     Desc : Cell LteAdvancedFeatureCfg
3225  *
3226  *
3227  *     Ret  : S16
3228  *
3229  *     Notes:
3230  *
3231  *     File  : 
3232  *
3233  **********************************************************/
3234
3235 S16 cmPkRgrCellLteAdvancedFeatureCfg
3236 (
3237 RgrLteAdvancedCellConfig *param,
3238 Buffer *mBuf
3239 )
3240 {
3241
3242    CMCHKPK(oduUnpackUInt32, param->pres, mBuf);
3243    CMCHKPK(cmPkRgrDsfrConfig, &param->dsfrCfg, mBuf); /*AIRSPAN_LTE_ADV_DSFR*/
3244    CMCHKPK(cmPkRgrSfrConfig,  &param->sfrCfg, mBuf);
3245    CMCHKPK(cmPkRgrAbsConfig,  &param->absCfg, mBuf);
3246
3247    return ROK;
3248
3249 }   
3250
3251
3252 /***********************************************************
3253  *
3254  *     Func : cmUnpkRgrAbsConfig
3255  *
3256  *
3257  *     Desc : Unpacks AbsConfig
3258  *
3259  *
3260  *     Ret  : S16
3261  *
3262  *     Notes:
3263  *
3264  *     File  : 
3265  *
3266  **********************************************************/
3267 S16 cmUnpkRgrAbsConfig
3268 (
3269 RgrAbsConfig *param,
3270 Buffer *mBuf
3271 )
3272 {
3273
3274    S8 indx = 0;
3275
3276    CMCHKUNPK(oduPackUInt32, &param->absLoadPeriodicity, mBuf);
3277    CMCHKUNPK(oduPackUInt32, &param->absPatternType, mBuf);
3278    for (indx = 0; indx <RGR_ABS_PATTERN_LEN; indx++) 
3279    {
3280       CMCHKUNPK(oduPackUInt8, &param->absPattern[(uint8_t)indx], mBuf);
3281    }
3282    CMCHKUNPK(oduPackUInt32, (uint32_t*)&param->status, mBuf);
3283
3284    return ROK;
3285
3286 }
3287
3288 /***********************************************************
3289  *
3290  *     Func : cmUnpkRgrSfrConfig
3291  *
3292  *
3293  *     Desc : Unpacks SfrConfig
3294  *
3295  *
3296  *     Ret  : S16
3297  *
3298  *     Notes:
3299  *
3300  *     File  : 
3301  *
3302  **********************************************************/
3303 S16 cmUnpkRgrSfrConfig
3304 (
3305 RgrSfrConfig *param,
3306 Buffer *mBuf
3307 )
3308 {
3309
3310
3311    CMCHKUNPK(oduPackUInt8, &param->cellEdgeRbRange.startRb, mBuf);
3312    CMCHKUNPK(oduPackUInt8, &param->cellEdgeRbRange.endRb, mBuf);
3313 #ifdef TFU_UPGRADE   
3314    CMCHKUNPK(oduPackUInt32, (uint32_t*)&param->pwrThreshold.pLow, mBuf);
3315    CMCHKUNPK(oduPackUInt32, (uint32_t*)&param->pwrThreshold.pHigh, mBuf);
3316 #endif   
3317    CMCHKUNPK(oduPackUInt32, (uint32_t*)&param->status, mBuf);
3318
3319    return ROK;
3320 }
3321
3322 /***********************************************************
3323  *
3324  *     Func : cmUnpkRgrCellLteAdvancedFeatureCfg
3325  *
3326  *
3327  *     Desc : unpacks LteAdvancedFeatureCfg per cell
3328  *
3329  *
3330  *     Ret  : S16
3331  *
3332  *     Notes:
3333  *
3334  *     File  : 
3335  *
3336  **********************************************************/
3337 S16 cmUnpkRgrCellLteAdvancedFeatureCfg
3338 (
3339 RgrLteAdvancedCellConfig *param,
3340 Buffer *mBuf
3341 )
3342 {
3343
3344    CMCHKUNPK(cmUnpkRgrAbsConfig, &param->absCfg, mBuf);
3345    CMCHKUNPK(cmUnpkRgrSfrConfig, &param->sfrCfg, mBuf);   
3346    CMCHKUNPK(cmUnpkRgrDsfrConfig, &param->dsfrCfg, mBuf); /*AIRSPAN_LTE_ADV_DSFR*/
3347    CMCHKUNPK(oduPackUInt32, &param->pres, mBuf);
3348
3349    return ROK;
3350 }
3351
3352 /* LTE_ADV_FLAG_REMOVED_END */
3353
3354 /***********************************************************
3355 *
3356 *     Func : cmPkMacSchedGnbCfg
3357 *
3358 *     Desc : SCH GNB Configurations 
3359 *
3360 *     Ret  : S16
3361 *
3362 *     Notes:
3363 *
3364 *     File  : 
3365 *
3366 **********************************************************/
3367 S16 cmPkMacSchedGnbCfg
3368 (
3369 MacSchedGnbCfg *param,
3370 Buffer         *mBuf
3371 )
3372 {
3373
3374    CMCHKPK(oduUnpackUInt8, param->maxDlUePerTti, mBuf);
3375    CMCHKPK(oduUnpackUInt8, param->maxUlUePerTti, mBuf);
3376    CMCHKPK(oduUnpackUInt8, param->numCells, mBuf);
3377    CMCHKPK(oduUnpackUInt8, param->dlSchdType, mBuf);
3378    CMCHKPK(oduUnpackUInt8, param->ulSchdType, mBuf);
3379    CMCHKPK(oduUnpackUInt8, param->numTxAntPorts, mBuf);
3380    return ROK;
3381 } /* cmPkRgrSchedEnbCfg */
3382
3383 /***********************************************************
3384 *
3385 *     Func : cmUnpkMacSchedGnbCfg
3386 *
3387 *
3388 *     Desc : SCH Gnodeb Configuration to SCH
3389 *
3390 *
3391 *     Ret  : S16
3392 *
3393 *     Notes:
3394 *
3395 *     File  : 
3396 *
3397 **********************************************************/
3398 S16 cmUnpkMacSchedGnbCfg
3399 (
3400 MacSchedGnbCfg *param,
3401 Buffer         *mBuf
3402 )
3403 {
3404
3405
3406    CMCHKUNPK(oduPackUInt8, &param->numTxAntPorts, mBuf);
3407    CMCHKUNPK(oduPackUInt8, &param->ulSchdType, mBuf);
3408    CMCHKUNPK(oduPackUInt8, &param->dlSchdType, mBuf);
3409    CMCHKUNPK(oduPackUInt8, &param->numCells, mBuf);
3410    CMCHKUNPK(oduPackUInt8, &param->maxUlUePerTti, mBuf);
3411    CMCHKUNPK(oduPackUInt8, &param->maxDlUePerTti, mBuf);
3412    return ROK;
3413 } /* cmUnpkMacSchedGnbCfg */
3414
3415 \f
3416 /***********************************************************
3417 *
3418 *     Func : cmPkRgrCellCfg
3419 *
3420 *
3421 *     Desc : Cell Configuration at RRM
3422 *
3423 *
3424 *     Ret  : S16
3425 *
3426 *     Notes:
3427 *
3428 *     File  : 
3429 *
3430 **********************************************************/
3431 S16 cmPkRgrCellCfg
3432 (
3433 RgrCellCfg *param,
3434 Buffer *mBuf
3435 )
3436 {
3437
3438    S32 i;
3439
3440 #ifdef EMTC_ENABLE 
3441 /* EMTC related changes start*/
3442
3443      
3444 /* EMTC related changes ends*/
3445 #endif
3446
3447 #ifdef RG_5GTF
3448    CMCHKPK(cmPkRgr5gtfCellCfg, &param->Cell5gtfCfg, mBuf);
3449 #endif
3450 #ifdef LTE_ADV
3451    CMCHKPK(oduUnpackUInt8, param->isPucchFormat3Sptd, mBuf);
3452 #endif
3453 /*LAA: Pack LAA params*/
3454    CMCHKPK(cmPkRgrLteUCellCfg, &param->lteUCfg, mBuf);
3455    CMCHKPK(oduUnpackUInt32, param->msg4pAVal, mBuf);
3456    CMCHKPK(oduUnpackUInt8, param->isAutoCfgModeEnb, mBuf);
3457    CMCHKPK(oduUnpackUInt8, param->isDynCfiEnb, mBuf);
3458    CMCHKPK(oduUnpackUInt16, param->phichTxPwrOffset, mBuf);
3459    CMCHKPK(oduUnpackUInt16, param->rarTxPwrOffset, mBuf);
3460    CMCHKPK(oduUnpackUInt16, param->pcchTxPwrOffset, mBuf);
3461    CMCHKPK(oduUnpackUInt16, param->bcchTxPwrOffset, mBuf);
3462
3463    CMCHKPK(oduUnpackUInt16, param->t300TmrVal, mBuf);
3464 /*rgr_c_001.main_7 - Added support for SPS*/
3465    CMCHKPK(cmPkRgrSpsCellCfg, &param->spsCfg, mBuf);
3466
3467 /* rgr_c_001.main_3: Added TTI indication from MAC to RGR user */
3468    CMCHKPK(oduUnpackUInt8, param->rrmTtiIndPrd, mBuf);
3469 #ifdef LTE_TDD
3470    CMCHKPK(cmPkRgrTddPrachRscInfo, &param->prachRscInfo, mBuf);
3471    CMCHKPK(oduUnpackUInt8, param->spclSfCfgIdx, mBuf);
3472    CMCHKPK(oduUnpackUInt8, param->ulDlCfgIdx, mBuf);
3473
3474 #endif
3475    CMCHKPK(cmPkRgrCellCsgParamCfg, &param->csgParamCfg, mBuf);
3476    for (i=param->numCmnLcs-1; i >= 0; i--) {
3477       CMCHKPK(cmPkRgrCmnLchCfg, &param->cmnLcCfg[i], mBuf);
3478    }
3479    CMCHKPK(oduUnpackUInt8, param->numCmnLcs, mBuf);
3480    CMCHKPK(cmPkRgrPreambleSetCfg, &param->macPreambleSet, mBuf);
3481    CMCHKPK(cmPkRgrPuschCfg, &param->puschCfg, mBuf);
3482    CMCHKPK(cmPkRgrUlPwrCfg, &param->pwrCfg, mBuf);
3483    CMCHKPK(cmPkRgrSiCfg, &param->siCfg, mBuf);
3484    CMCHKPK(cmPkRgrRachCfg, &param->rachCfg, mBuf);
3485    CMCHKPK(cmPkRgrSrsCfg, &param->srsCfg, mBuf);
3486    CMCHKPK(cmPkRgrPucchCfg, &param->pucchCfg, mBuf);
3487    CMCHKPK(cmPkRgrPhichCfg, &param->phichCfg, mBuf);
3488    /* LTE_ADV_FLAG_REMOVED_START */
3489    CMCHKPK(cmPkRgrCellLteAdvancedFeatureCfg, &param->rgrLteAdvCfg, mBuf);
3490    /* LTE_ADV_FLAG_REMOVED_END */
3491    CMCHKPK(cmPkRgrBwCfg, &param->bwCfg, mBuf);
3492    CMCHKPK(cmPkRgrDlfsCfg, &param->dlfsCfg, mBuf);
3493    CMCHKPK(cmPkRgrUlCmnCodeRateCfg, &param->ulCmnCodeRate, mBuf);
3494    CMCHKPK(cmPkRgrPuschSubBandCfg, &param->puschSubBand, mBuf);
3495    CMCHKPK(cmPkRgrDlCmnCodeRateCfg, &param->dlCmnCodeRate, mBuf);
3496    CMCHKPK(cmPkRgrUlTrgCqiCfg, &param->trgUlCqi, mBuf);
3497    CMCHKPK(cmPkRgrCfiCfg, &param->cfiCfg, mBuf);
3498    CMCHKPK(cmPkRgrRntiCfg, &param->macRnti, mBuf);
3499    CMCHKPK(cmPkRgrDlHqCfg, &param->dlHqCfg, mBuf);
3500    CMCHKPK(oduUnpackUInt8, param->dlfsSchdType, mBuf);
3501
3502    CMCHKPK(SPkS8, param->pMax, mBuf);
3503    CMCHKPK(oduUnpackUInt8, param->cellModSchm, mBuf);
3504    CMCHKPK(oduUnpackUInt8, param->isCpDlExtend, mBuf);
3505    CMCHKPK(oduUnpackUInt8, param->isCpUlExtend, mBuf);
3506    CMCHKPK(oduUnpackUInt8, param->maxUlUeNewTxPerTti, mBuf);
3507    CMCHKPK(oduUnpackUInt8, param->maxDlUeNewTxPerTti, mBuf);
3508    CMCHKPK(oduUnpackUInt8, param->maxDlRetxBw, mBuf);
3509    CMCHKPK(oduUnpackUInt8, param->maxDlBwPerUe, mBuf);
3510    CMCHKPK(oduUnpackUInt8, param->maxUlBwPerUe, mBuf);
3511    CMCHKPK(oduUnpackUInt8, param->maxCcchPerDlSf, mBuf);
3512    CMCHKPK(oduUnpackUInt8, param->maxUePerDlSf, mBuf);
3513    CMCHKPK(oduUnpackUInt8, param->maxUePerUlSf, mBuf);
3514 #ifdef RGR_V1
3515    /* rgr_x_001.main_7: [ccpu00112789] Added configuration for maximum number
3516       of  MSG3s */
3517    CMCHKPK(oduUnpackUInt8, param->maxMsg3PerUlSf, mBuf);
3518 #endif
3519    CMCHKPK(oduUnpackUInt8, param->macInst, mBuf);
3520    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
3521
3522 #ifdef EMTC_ENABLE 
3523 /* EMTC related changes start*/
3524    CMCHKPK(oduUnpackUInt8, param->emtcEnable, mBuf);
3525    CMCHKPK(cmPkRgrEmtcCfg, &param->emtcCellCfg, mBuf);
3526 /* EMTC related changes ends*/
3527 #endif
3528
3529    return ROK;
3530 }
3531
3532
3533 \f
3534 /***********************************************************
3535 *
3536 *     Func : cmUnpkRgrCellCfg
3537 *
3538 *
3539 *     Desc : Cell Configuration at RRM
3540 *
3541 *
3542 *     Ret  : S16
3543 *
3544 *     Notes:
3545 *
3546 *     File  : 
3547 *
3548 **********************************************************/
3549 S16 cmUnpkRgrCellCfg
3550 (
3551 RgrCellCfg *param,
3552 Buffer *mBuf
3553 )
3554 {
3555
3556    S32 i;
3557
3558 #ifdef EMTC_ENABLE      
3559 /* EMTC related changes start*/
3560    CMCHKUNPK(cmUnpkRgrEmtcCfg, &param->emtcCellCfg, mBuf);
3561    CMCHKUNPK(oduPackUInt8, &param->emtcEnable, mBuf);
3562 /* EMTC related changes ends*/
3563 #endif
3564
3565    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
3566    CMCHKUNPK(oduPackUInt8, &param->macInst, mBuf);
3567 #ifdef RGR_V1
3568    /* rgr_x_001.main_7: [ccpu00112789] Added configuration for maximum number
3569       of  MSG3s */
3570    CMCHKUNPK(oduPackUInt8, &param->maxMsg3PerUlSf, mBuf);
3571 #endif
3572    CMCHKUNPK(oduPackUInt8, &param->maxUePerUlSf, mBuf);
3573    CMCHKUNPK(oduPackUInt8, &param->maxUePerDlSf, mBuf);
3574    CMCHKUNPK(oduPackUInt8, &param->maxCcchPerDlSf, mBuf);
3575    CMCHKUNPK(oduPackUInt8, &param->maxUlBwPerUe, mBuf);
3576    CMCHKUNPK(oduPackUInt8, &param->maxDlBwPerUe, mBuf);
3577    CMCHKUNPK(oduPackUInt8, &param->maxDlRetxBw, mBuf);
3578    CMCHKUNPK(oduPackUInt8, &param->maxDlUeNewTxPerTti, mBuf);
3579    CMCHKUNPK(oduPackUInt8, &param->maxUlUeNewTxPerTti, mBuf);
3580    CMCHKUNPK(oduPackUInt8, &param->isCpUlExtend, mBuf);
3581    CMCHKUNPK(oduPackUInt8, &param->isCpDlExtend, mBuf);
3582    CMCHKUNPK(oduPackUInt8, &param->cellModSchm, mBuf);
3583    CMCHKUNPK(SUnpkS8, &param->pMax, mBuf);
3584    CMCHKUNPK(oduPackUInt8, &param->dlfsSchdType, mBuf);
3585    CMCHKUNPK(cmUnpkRgrDlHqCfg, &param->dlHqCfg, mBuf);
3586    CMCHKUNPK(cmUnpkRgrRntiCfg, &param->macRnti, mBuf);
3587    CMCHKUNPK(cmUnpkRgrCfiCfg, &param->cfiCfg, mBuf);
3588    CMCHKUNPK(cmUnpkRgrUlTrgCqiCfg, &param->trgUlCqi, mBuf);
3589    CMCHKUNPK(cmUnpkRgrDlCmnCodeRateCfg, &param->dlCmnCodeRate, mBuf);
3590    CMCHKUNPK(cmUnpkRgrPuschSubBandCfg, &param->puschSubBand, mBuf);
3591    CMCHKUNPK(cmUnpkRgrUlCmnCodeRateCfg, &param->ulCmnCodeRate, mBuf);
3592    CMCHKUNPK(cmUnpkRgrDlfsCfg, &param->dlfsCfg, mBuf);
3593    CMCHKUNPK(cmUnpkRgrBwCfg, &param->bwCfg, mBuf);
3594    /* LTE_ADV_FLAG_REMOVED_START */
3595    CMCHKUNPK(cmUnpkRgrCellLteAdvancedFeatureCfg, &param->rgrLteAdvCfg, mBuf);
3596    /* LTE_ADV_FLAG_REMOVED_END */
3597    CMCHKUNPK(cmUnpkRgrPhichCfg, &param->phichCfg, mBuf);
3598    CMCHKUNPK(cmUnpkRgrPucchCfg, &param->pucchCfg, mBuf);
3599    CMCHKUNPK(cmUnpkRgrSrsCfg, &param->srsCfg, mBuf);
3600    CMCHKUNPK(cmUnpkRgrRachCfg, &param->rachCfg, mBuf);
3601    CMCHKUNPK(cmUnpkRgrSiCfg, &param->siCfg, mBuf);
3602    CMCHKUNPK(cmUnpkRgrUlPwrCfg, &param->pwrCfg, mBuf);
3603    CMCHKUNPK(cmUnpkRgrPuschCfg, &param->puschCfg, mBuf);
3604    CMCHKUNPK(cmUnpkRgrPreambleSetCfg, &param->macPreambleSet, mBuf);
3605    CMCHKUNPK(oduPackUInt8, &param->numCmnLcs, mBuf);
3606    for (i=0; i<param->numCmnLcs; i++) {
3607       CMCHKUNPK(cmUnpkRgrCmnLchCfg, &param->cmnLcCfg[i], mBuf);
3608    }
3609    CMCHKUNPK(cmUnpkRgrCellCsgParamCfg, &param->csgParamCfg, mBuf);
3610
3611 #ifdef LTE_TDD
3612    CMCHKUNPK(oduPackUInt8, &param->ulDlCfgIdx, mBuf);
3613    CMCHKUNPK(oduPackUInt8, &param->spclSfCfgIdx, mBuf);
3614    CMCHKUNPK(cmUnpkRgrTddPrachRscInfo, &param->prachRscInfo, mBuf);
3615
3616 #endif
3617 /* rgr_c_001.main_3: Added TTI indication from MAC to RGR user */
3618    CMCHKUNPK(oduPackUInt8, &param->rrmTtiIndPrd, mBuf);
3619    /*rgr_c_001.main_7 - Added support for SPS*/
3620    CMCHKUNPK(cmUnpkRgrSpsDlCellCfg, &param->spsCfg, mBuf);
3621
3622    CMCHKUNPK(oduPackUInt16, &param->t300TmrVal, mBuf);
3623    CMCHKPK(oduPackUInt16, &param->bcchTxPwrOffset, mBuf);
3624    CMCHKPK(oduPackUInt16, &param->pcchTxPwrOffset, mBuf);
3625    CMCHKPK(oduPackUInt16, &param->rarTxPwrOffset, mBuf);
3626    CMCHKPK(oduPackUInt16, &param->phichTxPwrOffset, mBuf);
3627    CMCHKUNPK(oduPackUInt8, &param->isDynCfiEnb, mBuf);
3628    CMCHKUNPK(oduPackUInt8, &param->isAutoCfgModeEnb, mBuf);
3629    CMCHKPK(oduPackUInt32, (uint32_t*)&param->msg4pAVal, mBuf);
3630    /*LAA: Unpack LAA Cell params*/
3631    CMCHKUNPK(cmUnpkRgrLteUCellCfg, &param->lteUCfg, mBuf);
3632    #ifdef LTE_ADV
3633    CMCHKUNPK(oduPackUInt8, &param->isPucchFormat3Sptd, mBuf);
3634 #endif
3635 #ifdef RG_5GTF
3636    CMCHKUNPK(cmUnPkRgr5gtfCellCfg, &param->Cell5gtfCfg, mBuf);
3637 #endif
3638    return ROK;
3639 }
3640
3641
3642 \f
3643 /***********************************************************
3644 *
3645 *     Func : cmPkRgrUeAprdDlCqiCfg
3646 *
3647 *
3648 *     Desc : Downlink Aperiodic CQI reporting related configuration per UE
3649 *
3650 *
3651 *     Ret  : S16
3652 *
3653 *     Notes:
3654 *
3655 *     File  : 
3656 *
3657 **********************************************************/
3658 S16 cmPkRgrUeAprdDlCqiCfg
3659 (
3660 RgrUeAprdDlCqiCfg *param,
3661 Buffer *mBuf
3662 )
3663 {
3664
3665    /*Pack Aperiodic Trigger List only for Pcell */
3666 #ifdef LTE_ADV
3667    CMCHKPK(oduUnpackUInt8, param->triggerSet2, mBuf);
3668    CMCHKPK(oduUnpackUInt8, param->triggerSet1, mBuf);
3669 #endif
3670
3671    CMCHKPK(oduUnpackUInt32, param->aprdModeEnum, mBuf);
3672    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
3673    return ROK;
3674 }
3675
3676
3677 \f
3678 /***********************************************************
3679 *
3680 *     Func : cmUnpkRgrUeAprdDlCqiCfg
3681 *
3682 *
3683 *     Desc : Downlink Aperiodic CQI reporting related configuration per UE
3684 *
3685 *
3686 *     Ret  : S16
3687 *
3688 *     Notes:
3689 *
3690 *     File  : 
3691 *
3692 **********************************************************/
3693 S16 cmUnpkRgrUeAprdDlCqiCfg
3694 (
3695 RgrUeAprdDlCqiCfg *param,
3696 Buffer *mBuf
3697 )
3698 {
3699    uint32_t tmpEnum;
3700
3701
3702    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
3703    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
3704    param->aprdModeEnum = (RgrAprdCqiMode) tmpEnum;
3705
3706 #ifdef LTE_ADV
3707    CMCHKUNPK(oduPackUInt8, &param->triggerSet1, mBuf);
3708    CMCHKUNPK(oduPackUInt8, &param->triggerSet2, mBuf);
3709 #endif
3710
3711    return ROK;
3712 }
3713
3714
3715 /* rgr_c_001.main_8. Added changes of TFU_UPGRADE */
3716 #ifndef TFU_UPGRADE
3717
3718 \f
3719 /***********************************************************
3720 *
3721 *     Func : cmPkRgrUePrdDlCqiCfg
3722 *
3723 *
3724 *     Desc : Downlink Periodic CQI reporting related configuration per UE
3725 *
3726 *
3727 *     Ret  : S16
3728 *
3729 *     Notes:
3730 *
3731 *     File  : 
3732 *
3733 **********************************************************/
3734 S16 cmPkRgrUePrdDlCqiCfg
3735 (
3736 RgrUePrdDlCqiCfg *param,
3737 Buffer *mBuf
3738 )
3739 {
3740
3741
3742    CMCHKPK(oduUnpackUInt16, param->cqiPmiCfgIdx, mBuf);
3743    CMCHKPK(oduUnpackUInt8, param->k, mBuf);
3744    CMCHKPK(SPkS8, param->cqiOffst, mBuf);
3745    CMCHKPK(oduUnpackUInt8, param->subframeOffst, mBuf);
3746    CMCHKPK(oduUnpackUInt32, param->prdicityEnum, mBuf);
3747    CMCHKPK(oduUnpackUInt32, param->prdModeEnum, mBuf);
3748    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
3749    return ROK;
3750 }
3751
3752
3753 \f
3754 /***********************************************************
3755 *
3756 *     Func : cmUnpkRgrUePrdDlCqiCfg
3757 *
3758 *
3759 *     Desc : Downlink Periodic CQI reporting related configuration per UE
3760 *
3761 *
3762 *     Ret  : S16
3763 *
3764 *     Notes:
3765 *
3766 *     File  : 
3767 *
3768 **********************************************************/
3769 S16 cmUnpkRgrUePrdDlCqiCfg
3770 (
3771 RgrUePrdDlCqiCfg *param,
3772 Buffer *mBuf
3773 )
3774 {
3775    uint32_t tmpEnum;
3776
3777
3778    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
3779    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
3780    param->prdModeEnum = tmpEnum;
3781    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
3782    param->prdicityEnum = tmpEnum;
3783    CMCHKUNPK(oduPackUInt8, &param->subframeOffst, mBuf);
3784    CMCHKUNPK(SUnpkS8, &param->cqiOffst, mBuf);
3785    CMCHKUNPK(oduPackUInt8, &param->k, mBuf);
3786    CMCHKUNPK(oduPackUInt16, &param->cqiPmiCfgIdx, mBuf);
3787    return ROK;
3788 }
3789
3790
3791 #endif
3792
3793 /* rgr_c_001.main_8. Added changes of TFU_UPGRADE */
3794 #ifdef TFU_UPGRADE
3795 /***********************************************************
3796 *
3797 *     Func : cmPkRgrUeDlPCqiSetup
3798 *
3799 *
3800 *     Desc : Periodic CQI Setup configuration parameters information
3801 *
3802 *
3803 *     Ret  : S16
3804 *
3805 *     Notes:
3806 *
3807 *     File  : 
3808 *
3809 **********************************************************/
3810 S16 cmPkRgrUeDlPCqiSetup
3811 (
3812 RgrUeDlPCqiSetup *param,
3813 Buffer *mBuf
3814 )
3815 {
3816
3817
3818    CMCHKPK(oduUnpackUInt32, param->prdModeEnum, mBuf);
3819    CMCHKPK(oduUnpackUInt8, param->sANCQI, mBuf);
3820    /*rgr_c_001.main_9 DEL removed unwanted comments*/
3821    CMCHKPK(oduUnpackUInt16, param->riCfgIdx, mBuf);
3822    CMCHKPK(oduUnpackUInt8, param->riEna, mBuf);
3823    CMCHKPK(oduUnpackUInt8, param->k, mBuf);
3824    CMCHKPK(oduUnpackUInt8, param->cqiRepType, mBuf);
3825    CMCHKPK(oduUnpackUInt16, param->cqiPCfgIdx, mBuf);
3826    CMCHKPK(oduUnpackUInt16, param->cqiPResIdx, mBuf);
3827    return ROK;
3828 }
3829
3830
3831 \f
3832 /***********************************************************
3833 *
3834 *     Func : cmUnpkRgrUeDlPCqiSetup
3835 *
3836 *
3837 *     Desc : Periodic CQI Setup configuration parameters information
3838 *
3839 *
3840 *     Ret  : S16
3841 *
3842 *     Notes:
3843 *
3844 *     File  : 
3845 *
3846 **********************************************************/
3847 S16 cmUnpkRgrUeDlPCqiSetup
3848 (
3849 RgrUeDlPCqiSetup *param,
3850 Buffer *mBuf
3851 )
3852 {
3853    uint32_t tmpEnum;
3854
3855
3856    CMCHKUNPK(oduPackUInt16, &param->cqiPResIdx, mBuf);
3857    CMCHKUNPK(oduPackUInt16, &param->cqiPCfgIdx, mBuf);
3858    CMCHKUNPK(oduPackUInt8, &param->cqiRepType, mBuf);
3859    CMCHKUNPK(oduPackUInt8, &param->k, mBuf);
3860    CMCHKUNPK(oduPackUInt8, &param->riEna, mBuf);
3861    /*rgr_c_001.main_9 DEL removed unwanted comments*/
3862    CMCHKUNPK(oduPackUInt16, &param->riCfgIdx, mBuf); 
3863    CMCHKUNPK(oduPackUInt8, &param->sANCQI, mBuf);
3864    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
3865    param->prdModeEnum = (RgrPrdCqiMode) tmpEnum;
3866    return ROK;
3867 }
3868
3869
3870 \f
3871 /***********************************************************
3872 *
3873 *     Func : cmPkRgrUePrdDlCqiCfg
3874 *
3875 *
3876 *     Desc : Periodic CQI/PMI/RI configuration parameters information
3877 *
3878 *
3879 *     Ret  : S16
3880 *
3881 *     Notes:
3882 *
3883 *     File  : 
3884 *
3885 **********************************************************/
3886 S16 cmPkRgrUePrdDlCqiCfg
3887 (
3888 RgrUePrdDlCqiCfg *param,
3889 Buffer *mBuf
3890 )
3891 {
3892
3893
3894    CMCHKPK(cmPkRgrUeDlPCqiSetup, &param->cqiSetup, mBuf);
3895    CMCHKPK(oduUnpackUInt8, param->type, mBuf);
3896    return ROK;
3897 }
3898
3899
3900 \f
3901 /***********************************************************
3902 *
3903 *     Func : cmUnpkRgrUePrdDlCqiCfg
3904 *
3905 *
3906 *     Desc : Periodic CQI/PMI/RI configuration parameters information
3907 *
3908 *
3909 *     Ret  : S16
3910 *
3911 *     Notes:
3912 *
3913 *     File  : 
3914 *
3915 **********************************************************/
3916 S16 cmUnpkRgrUePrdDlCqiCfg
3917 (
3918 RgrUePrdDlCqiCfg *param,
3919 Buffer *mBuf
3920 )
3921 {
3922
3923
3924    CMCHKUNPK(oduPackUInt8, &param->type, mBuf);
3925    CMCHKUNPK(cmUnpkRgrUeDlPCqiSetup, &param->cqiSetup, mBuf);
3926    return ROK;
3927 }
3928
3929
3930 \f
3931 /***********************************************************
3932 *
3933 *     Func : cmPkRgrUeUlSrsSetupCfg
3934 *
3935 *
3936 *     Desc : SRS configuration setup parameters information. 
3937    Reference 36.313 SoundingRS-UL-Config
3938 *
3939 *
3940 *     Ret  : S16
3941 *
3942 *     Notes:
3943 *
3944 *     File  : 
3945 *
3946 **********************************************************/
3947 S16 cmPkRgrUeUlSrsSetupCfg
3948 (
3949 RgrUeUlSrsSetupCfg *param,
3950 Buffer *mBuf
3951 )
3952 {
3953
3954
3955    CMCHKPK(oduUnpackUInt8, param->fDomPosi, mBuf);
3956    CMCHKPK(oduUnpackUInt8, param->txComb, mBuf);
3957    CMCHKPK(oduUnpackUInt8, param->sANSrs, mBuf);
3958    CMCHKPK(oduUnpackUInt8, param->duration, mBuf);
3959    CMCHKPK(oduUnpackUInt32, param->cycShift, mBuf);
3960    CMCHKPK(oduUnpackUInt32, param->srsHopBw, mBuf);
3961    CMCHKPK(oduUnpackUInt32, param->srsBw, mBuf);
3962    /*rgr_c_001.main_9 DEL removed unwanted comments*/
3963    CMCHKPK(oduUnpackUInt16, param->srsCfgIdx, mBuf);
3964    return ROK;
3965 }
3966
3967
3968 \f
3969 /***********************************************************
3970 *
3971 *     Func : cmUnpkRgrUeUlSrsSetupCfg
3972 *
3973 *
3974 *     Desc : SRS configuration setup parameters information. 
3975    Reference 36.313 SoundingRS-UL-Config
3976 *
3977 *
3978 *     Ret  : S16
3979 *
3980 *     Notes:
3981 *
3982 *     File  : 
3983 *
3984 **********************************************************/
3985 S16 cmUnpkRgrUeUlSrsSetupCfg
3986 (
3987 RgrUeUlSrsSetupCfg *param,
3988 Buffer *mBuf
3989 )
3990 {
3991    uint32_t tmpEnum;
3992
3993
3994    /*rgr_c_001.main_9 DEL removed unwanted comments*/
3995    CMCHKUNPK(oduPackUInt16, &param->srsCfgIdx, mBuf); 
3996    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
3997    param->srsBw = (RgrUlSrsBwInfo) tmpEnum;
3998    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
3999    param->srsHopBw = (RgrUlSrsHoBwInfo) tmpEnum;
4000    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
4001    param->cycShift = (RgrUlSrsCycShiftInfo) tmpEnum;
4002    CMCHKUNPK(oduPackUInt8, &param->duration, mBuf);
4003    CMCHKUNPK(oduPackUInt8, &param->sANSrs, mBuf);
4004    CMCHKUNPK(oduPackUInt8, &param->txComb, mBuf);
4005    CMCHKUNPK(oduPackUInt8, &param->fDomPosi, mBuf);
4006    return ROK;
4007 }
4008
4009
4010 \f
4011 /***********************************************************
4012 *
4013 *     Func : cmPkRgrUeSrSetupCfg
4014 *
4015 *
4016 *     Desc : SR Setup configuration parameters information
4017 *
4018 *
4019 *     Ret  : S16
4020 *
4021 *     Notes:
4022 *
4023 *     File  : 
4024 *
4025 **********************************************************/
4026 S16 cmPkRgrUeSrSetupCfg
4027 (
4028 RgrUeSrSetupCfg *param,
4029 Buffer *mBuf
4030 )
4031 {
4032
4033
4034    /* ccpu00131601:DEL - dTMax Packing removed since this param will not 
4035     * be required by Scheduler*/
4036    CMCHKPK(oduUnpackUInt8, param->srCfgIdx, mBuf);
4037    CMCHKPK(oduUnpackUInt16, param->srResIdx, mBuf);
4038    return ROK;
4039 }
4040
4041
4042 \f
4043 /***********************************************************
4044 *
4045 *     Func : cmUnpkRgrUeSrSetupCfg
4046 *
4047 *
4048 *     Desc : SR Setup configuration parameters information
4049 *
4050 *
4051 *     Ret  : S16
4052 *
4053 *     Notes:
4054 *
4055 *     File  : 
4056 *
4057 **********************************************************/
4058 S16 cmUnpkRgrUeSrSetupCfg
4059 (
4060 RgrUeSrSetupCfg *param,
4061 Buffer *mBuf
4062 )
4063 {
4064
4065    CMCHKUNPK(oduPackUInt16, &param->srResIdx, mBuf);
4066    CMCHKUNPK(oduPackUInt8, &param->srCfgIdx, mBuf);
4067    /* ccpu00131601:DEL - dTMax UnPacking removed since this param will not 
4068     * be required by Scheduler*/
4069    return ROK;
4070 }
4071
4072
4073 \f
4074 /***********************************************************
4075 *
4076 *     Func : cmPkRgrUeSrCfg
4077 *
4078 *
4079 *     Desc : SR configuration parameters information
4080 *
4081 *
4082 *     Ret  : S16
4083 *
4084 *     Notes:
4085 *
4086 *     File  : 
4087 *
4088 **********************************************************/
4089 S16 cmPkRgrUeSrCfg
4090 (
4091 RgrUeSrCfg *param,
4092 Buffer *mBuf
4093 )
4094 {
4095
4096
4097    CMCHKPK(cmPkRgrUeSrSetupCfg, &param->srSetup, mBuf);
4098    CMCHKPK(oduUnpackUInt8, param->type, mBuf);
4099    return ROK;
4100 }
4101
4102
4103 \f
4104 /***********************************************************
4105 *
4106 *     Func : cmUnpkRgrUeSrCfg
4107 *
4108 *
4109 *     Desc : SR configuration parameters information
4110 *
4111 *
4112 *     Ret  : S16
4113 *
4114 *     Notes:
4115 *
4116 *     File  : 
4117 *
4118 **********************************************************/
4119 S16 cmUnpkRgrUeSrCfg
4120 (
4121 RgrUeSrCfg *param,
4122 Buffer *mBuf
4123 )
4124 {
4125
4126
4127    CMCHKUNPK(oduPackUInt8, &param->type, mBuf);
4128    CMCHKUNPK(cmUnpkRgrUeSrSetupCfg, &param->srSetup, mBuf);
4129    return ROK;
4130 }
4131
4132
4133 \f
4134 /***********************************************************
4135 *
4136 *     Func : cmPkRgrUeUlSrsCfg
4137 *
4138 *
4139 *     Desc : SRS configuration parameters information.  
4140   Reference 36.313 SoundingRS-UL-Config
4141 *
4142 *
4143 *     Ret  : S16
4144 *
4145 *     Notes:
4146 *
4147 *     File  : 
4148 *
4149 **********************************************************/
4150 S16 cmPkRgrUeUlSrsCfg
4151 (
4152 RgrUeUlSrsCfg *param,
4153 Buffer *mBuf
4154 )
4155 {
4156
4157
4158    /*rgr_c_001.main_9 DEL removed unwanted comments*/
4159    CMCHKPK(cmPkRgrUeUlSrsSetupCfg, &param->srsSetup, mBuf);  
4160    CMCHKPK(oduUnpackUInt8, param->type, mBuf);
4161    return ROK;
4162 }
4163
4164
4165 \f
4166 /***********************************************************
4167 *
4168 *     Func : cmUnpkRgrUeUlSrsCfg
4169 *
4170 *
4171 *     Desc : SRS configuration parameters information.  
4172   Reference 36.313 SoundingRS-UL-Config
4173 *
4174 *
4175 *     Ret  : S16
4176 *
4177 *     Notes:
4178 *
4179 *     File  : 
4180 *
4181 **********************************************************/
4182 S16 cmUnpkRgrUeUlSrsCfg
4183 (
4184 RgrUeUlSrsCfg *param,
4185 Buffer *mBuf
4186 )
4187 {
4188
4189
4190    CMCHKUNPK(oduPackUInt8, &param->type, mBuf);
4191    /*rgr_c_001.main_9 DEL removed unwanted comments*/
4192    CMCHKUNPK(cmUnpkRgrUeUlSrsSetupCfg, &param->srsSetup, mBuf);  
4193    return ROK;
4194 }
4195
4196
4197 #endif /*TFU_UPGRADE */
4198
4199 \f
4200 /***********************************************************
4201 *
4202 *     Func : cmPkRgrUeDlCqiCfg
4203 *
4204 *
4205 *     Desc : Downlink CQI reporting related configuration per UE
4206 *
4207 *
4208 *     Ret  : S16
4209 *
4210 *     Notes:
4211 *
4212 *     File  : 
4213 *
4214 **********************************************************/
4215 S16 cmPkRgrUeDlCqiCfg
4216 (
4217 RgrUeDlCqiCfg *param,
4218 Buffer *mBuf
4219 )
4220 {
4221
4222
4223
4224 /* rgr_c_001.main_8. Added changes of TFU_UPGRADE */
4225 #ifdef TFU_UPGRADE
4226    CMCHKPK(cmPkRgrUePrdDlCqiCfg, &param->prdCqiCfg, mBuf);
4227 #endif
4228
4229 /* rgr_c_001.main_8. Added changes of TFU_UPGRADE */
4230 #ifndef TFU_UPGRADE
4231    CMCHKPK(cmPkRgrUePrdDlCqiCfg, &param->prdCqiCfg, mBuf);
4232 #endif
4233    CMCHKPK(cmPkRgrUeAprdDlCqiCfg, &param->aprdCqiCfg, mBuf);
4234    return ROK;
4235 }
4236
4237
4238 \f
4239 /***********************************************************
4240 *
4241 *     Func : cmUnpkRgrUeDlCqiCfg
4242 *
4243 *
4244 *     Desc : Downlink CQI reporting related configuration per UE
4245 *
4246 *
4247 *     Ret  : S16
4248 *
4249 *     Notes:
4250 *
4251 *     File  : 
4252 *
4253 **********************************************************/
4254 S16 cmUnpkRgrUeDlCqiCfg
4255 (
4256 RgrUeDlCqiCfg *param,
4257 Buffer *mBuf
4258 )
4259 {
4260
4261
4262    CMCHKUNPK(cmUnpkRgrUeAprdDlCqiCfg, &param->aprdCqiCfg, mBuf);
4263    CMCHKUNPK(cmUnpkRgrUePrdDlCqiCfg, &param->prdCqiCfg, mBuf);
4264    return ROK;
4265 }
4266
4267
4268 \f
4269 /***********************************************************
4270 *
4271 *     Func : cmPkRgrUeMeasGapCfg
4272 *
4273 *
4274 *     Desc : Measurement gap configuration for UE
4275 *
4276 *
4277 *     Ret  : S16
4278 *
4279 *     Notes:
4280 *
4281 *     File  : 
4282 *
4283 **********************************************************/
4284 S16 cmPkRgrUeMeasGapCfg
4285 (
4286 RgrUeMeasGapCfg *param,
4287 Buffer *mBuf
4288 )
4289 {
4290
4291
4292    CMCHKPK(oduUnpackUInt8, param->gapOffst, mBuf);
4293    CMCHKPK(oduUnpackUInt8, param->gapPrd, mBuf);
4294    CMCHKPK(oduUnpackUInt8, param->isMesGapEnabled, mBuf);
4295    return ROK;
4296 }
4297
4298
4299 \f
4300 /***********************************************************
4301 *
4302 *     Func : cmUnpkRgrUeMeasGapCfg
4303 *
4304 *
4305 *     Desc : Measurement gap configuration for UE
4306 *
4307 *
4308 *     Ret  : S16
4309 *
4310 *     Notes:
4311 *
4312 *     File  : 
4313 *
4314 **********************************************************/
4315 S16 cmUnpkRgrUeMeasGapCfg
4316 (
4317 RgrUeMeasGapCfg *param,
4318 Buffer *mBuf
4319 )
4320 {
4321
4322
4323    CMCHKUNPK(oduPackUInt8, &param->isMesGapEnabled, mBuf);
4324    CMCHKUNPK(oduPackUInt8, &param->gapPrd, mBuf);
4325    CMCHKUNPK(oduPackUInt8, &param->gapOffst, mBuf);
4326    return ROK;
4327 }
4328
4329 /*rgr_c_001.main_9 ADD DRX functionality under flag*/
4330 \f
4331 /***********************************************************
4332 *
4333 *     Func : cmPkRgrDrxLongCycleOffst
4334 *
4335 *
4336 *     Desc : DRX Long Cycle Offset
4337 *
4338 *
4339 *     Ret  : S16
4340 *
4341 *     Notes:
4342 *
4343 *     File  : 
4344 *
4345 **********************************************************/
4346 S16 cmPkRgrDrxLongCycleOffst
4347 (
4348 RgrDrxLongCycleOffst *param,
4349 Buffer *mBuf
4350 )
4351 {
4352
4353
4354    CMCHKPK(oduUnpackUInt16, param->drxStartOffst, mBuf);
4355    CMCHKPK(oduUnpackUInt16, param->longDrxCycle, mBuf);
4356    return ROK;
4357 }
4358
4359
4360 \f
4361 /***********************************************************
4362 *
4363 *     Func : cmUnpkRgrDrxLongCycleOffst
4364 *
4365 *
4366 *     Desc : DRX Long Cycle Offset
4367 *
4368 *
4369 *     Ret  : S16
4370 *
4371 *     Notes:
4372 *
4373 *     File  : 
4374 *
4375 **********************************************************/
4376 S16 cmUnpkRgrDrxLongCycleOffst
4377 (
4378 RgrDrxLongCycleOffst *param,
4379 Buffer *mBuf
4380 )
4381 {
4382
4383
4384    CMCHKUNPK(oduPackUInt16, &param->longDrxCycle, mBuf);
4385    CMCHKUNPK(oduPackUInt16, &param->drxStartOffst, mBuf);
4386    return ROK;
4387 }
4388
4389
4390 \f
4391 /***********************************************************
4392 *
4393 *     Func : cmPkRgrDrxShortDrx
4394 *
4395 *
4396 *     Desc : DRX Short Cycle Offset
4397 *
4398 *
4399 *     Ret  : S16
4400 *
4401 *     Notes:
4402 *
4403 *     File  : 
4404 *
4405 **********************************************************/
4406 S16 cmPkRgrDrxShortDrx
4407 (
4408 RgrDrxShortDrx *param,
4409 Buffer *mBuf
4410 )
4411 {
4412
4413
4414    CMCHKPK(oduUnpackUInt8, param->drxShortCycleTmr, mBuf);
4415    CMCHKPK(oduUnpackUInt16, param->shortDrxCycle, mBuf);
4416    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
4417    return ROK;
4418 }
4419
4420
4421 \f
4422 /***********************************************************
4423 *
4424 *     Func : cmUnpkRgrDrxShortDrx
4425 *
4426 *
4427 *     Desc : DRX Short Cycle Offset
4428 *
4429 *
4430 *     Ret  : S16
4431 *
4432 *     Notes:
4433 *
4434 *     File  : 
4435 *
4436 **********************************************************/
4437 S16 cmUnpkRgrDrxShortDrx
4438 (
4439 RgrDrxShortDrx *param,
4440 Buffer *mBuf
4441 )
4442 {
4443
4444
4445    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
4446    CMCHKUNPK(oduPackUInt16, &param->shortDrxCycle, mBuf);
4447    CMCHKUNPK(oduPackUInt8, &param->drxShortCycleTmr, mBuf);
4448    return ROK;
4449 }
4450 \f
4451 /***********************************************************
4452 *
4453 *     Func : cmPkRgrUeDrxCfg
4454 *
4455 *
4456 *     Desc : DRX configuration for UE
4457 *
4458 *
4459 *     Ret  : S16
4460 *
4461 *     Notes:
4462 *
4463 *     File  : 
4464 *
4465 **********************************************************/
4466 S16 cmPkRgrUeDrxCfg
4467 (
4468 RgrUeDrxCfg *param,
4469 Buffer *mBuf
4470 )
4471 {
4472
4473
4474    CMCHKPK(cmPkRgrDrxShortDrx, &param->drxShortDrx, mBuf);
4475    CMCHKPK(cmPkRgrDrxLongCycleOffst, &param->drxLongCycleOffst, mBuf);
4476    CMCHKPK(oduUnpackUInt16, param->drxRetxTmr, mBuf);
4477 #ifdef EMTC_ENABLE
4478    CMCHKPK(oduUnpackUInt8,  param->drxRetxTmrR13Pres, mBuf);
4479    CMCHKPK(oduUnpackUInt8,  param->drxOnDurTmrR13Pres, mBuf);
4480    CMCHKPK(oduUnpackUInt16, param->emtcDrxUlRetxTmr, mBuf);
4481    CMCHKPK(oduUnpackUInt8,  param->isEmtcUe, mBuf); 
4482 #endif
4483    CMCHKPK(oduUnpackUInt16, param->drxInactvTmr, mBuf);
4484    CMCHKPK(oduUnpackUInt16, param->drxOnDurTmr, mBuf);
4485 /*rgr_c_001.main_9 ADD added changes for R9*/
4486 #ifdef LTEMAC_R9
4487    CMCHKPK(cmPkTknS32, &param->cqiMask, mBuf);
4488 #endif
4489    return ROK;
4490 }
4491
4492
4493 \f
4494 /***********************************************************
4495 *
4496 *     Func : cmUnpkRgrUeDrxCfg
4497 *
4498 *
4499 *     Desc : DRX configuration for UE
4500 *
4501 *
4502 *     Ret  : S16
4503 *
4504 *     Notes:
4505 *
4506 *     File  : 
4507 *
4508 **********************************************************/
4509 S16 cmUnpkRgrUeDrxCfg
4510 (
4511 RgrUeDrxCfg *param,
4512 Buffer *mBuf
4513 )
4514 {
4515
4516
4517 /*rgr_c_001.main_9 ADD added changes for R9*/
4518 #ifdef LTEMAC_R9
4519    CMCHKUNPK(cmUnpkTknS32, &param->cqiMask, mBuf);
4520 #endif
4521    CMCHKUNPK(oduPackUInt16, &param->drxOnDurTmr, mBuf);
4522    CMCHKUNPK(oduPackUInt16, &param->drxInactvTmr, mBuf);
4523 #ifdef EMTC_ENABLE
4524    CMCHKUNPK(oduPackUInt8, &param->isEmtcUe, mBuf); 
4525    CMCHKUNPK(oduPackUInt16,&param->emtcDrxUlRetxTmr, mBuf);
4526    CMCHKUNPK(oduPackUInt8, &param->drxOnDurTmrR13Pres, mBuf);
4527    CMCHKUNPK(oduPackUInt8, &param->drxRetxTmrR13Pres, mBuf);
4528 #endif
4529    CMCHKUNPK(oduPackUInt16, &param->drxRetxTmr, mBuf);
4530    CMCHKUNPK(cmUnpkRgrDrxLongCycleOffst, &param->drxLongCycleOffst, mBuf);
4531    CMCHKUNPK(cmUnpkRgrDrxShortDrx, &param->drxShortDrx, mBuf);
4532    return ROK;
4533 }
4534
4535 /*rgr_c_001.main_9 ADD added DRX changes under DRX*/
4536 \f
4537 /***********************************************************
4538 *
4539 *     Func : cmPkRgrUeCapCfg
4540 *
4541 *
4542 *     Desc : RgrUeCapCfg
4543 *
4544 *
4545 *     Ret  : S16
4546 *
4547 *     Notes:
4548 *
4549 *     File  : 
4550 *
4551 **********************************************************/
4552 S16 cmPkRgrUeCapCfg
4553 (
4554 RgrUeCapCfg *param,
4555 Buffer *mBuf
4556 )
4557 {
4558
4559
4560    CMCHKPK(oduUnpackUInt8, param->txAntSel, mBuf);
4561    CMCHKPK(oduUnpackUInt8, param->simCqiAckNack, mBuf);
4562    CMCHKPK(oduUnpackUInt8, param->resAloocType1, mBuf);
4563    CMCHKPK(oduUnpackUInt8, param->intraSfFeqHop, mBuf);
4564    CMCHKPK(oduUnpackUInt8, param->pwrClass, mBuf);
4565    return ROK;
4566 }
4567
4568
4569 \f
4570 /***********************************************************
4571 *
4572 *     Func : cmUnpkRgrUeCapCfg
4573 *
4574 *
4575 *     Desc : RgrUeCapCfg
4576 *
4577 *
4578 *     Ret  : S16
4579 *
4580 *     Notes:
4581 *
4582 *     File  : 
4583 *
4584 **********************************************************/
4585 S16 cmUnpkRgrUeCapCfg
4586 (
4587 RgrUeCapCfg *param,
4588 Buffer *mBuf
4589 )
4590 {
4591
4592
4593    CMCHKUNPK(oduPackUInt8, &param->pwrClass, mBuf);
4594    CMCHKUNPK(oduPackUInt8, &param->intraSfFeqHop, mBuf);
4595    CMCHKUNPK(oduPackUInt8, &param->resAloocType1, mBuf);
4596    CMCHKUNPK(oduPackUInt8, &param->simCqiAckNack, mBuf);
4597    CMCHKUNPK(oduPackUInt8, &param->txAntSel, mBuf);
4598    
4599    return ROK;
4600 }
4601
4602 \f
4603 /***********************************************************
4604 *
4605 *     Func : cmPkRgrUeAckNackRepCfg
4606 *
4607 *
4608 *     Desc : rgrUeAckNackRepCfg
4609 *
4610 *
4611 *     Ret  : S16
4612 *
4613 *     Notes:
4614 *
4615 *     File  : 
4616 *
4617 **********************************************************/
4618 S16 cmPkRgrUeAckNackRepCfg
4619 (
4620 RgrUeAckNackRepCfg *param,
4621 Buffer *mBuf
4622 )
4623 {
4624
4625
4626    CMCHKPK(oduUnpackUInt32, param->ackNackRepFactor, mBuf);
4627    CMCHKPK(oduUnpackUInt16, param->pucchAckNackRep, mBuf);
4628    CMCHKPK(oduUnpackUInt8, param->isAckNackEnabled, mBuf);
4629    return ROK;
4630 }
4631
4632
4633 \f
4634 /***********************************************************
4635 *
4636 *     Func : cmUnpkRgrUeAckNackRepCfg
4637 *
4638 *
4639 *     Desc : rgrUeAckNackRepCfg
4640 *
4641 *
4642 *     Ret  : S16
4643 *
4644 *     Notes:
4645 *
4646 *     File  : 
4647 *
4648 **********************************************************/
4649 S16 cmUnpkRgrUeAckNackRepCfg
4650 (
4651 RgrUeAckNackRepCfg *param,
4652 Buffer *mBuf
4653 )
4654 {
4655    uint32_t tmpEnum;
4656
4657
4658    CMCHKUNPK(oduPackUInt8, &param->isAckNackEnabled, mBuf);
4659    CMCHKUNPK(oduPackUInt16, &param->pucchAckNackRep, mBuf);
4660    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
4661    param->ackNackRepFactor = (RgrAckNackRepFactor) tmpEnum;
4662    return ROK;
4663 }
4664
4665
4666 \f
4667 /***********************************************************
4668 *
4669 *     Func : cmPkRgrUeTxModeCfg
4670 *
4671 *
4672 *     Desc : Transmission mode configuration per UE
4673 *
4674 *
4675 *     Ret  : S16
4676 *
4677 *     Notes:
4678 *
4679 *     File  : 
4680 *
4681 **********************************************************/
4682 S16 cmPkRgrUeTxModeCfg
4683 (
4684 RgrUeTxModeCfg *param,
4685 Buffer *mBuf
4686 )
4687 {
4688
4689
4690    CMCHKPK(oduUnpackUInt32, param->txModeEnum, mBuf);
4691    CMCHKPK(oduUnpackUInt32, param->tmTrnstnState, mBuf);
4692    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
4693    
4694    return ROK;
4695 }
4696
4697
4698 \f
4699 /***********************************************************
4700 *
4701 *     Func : cmUnpkRgrUeTxModeCfg
4702 *
4703 *
4704 *     Desc : Transmission mode configuration per UE
4705 *
4706 *
4707 *     Ret  : S16
4708 *
4709 *     Notes:
4710 *
4711 *     File  : 
4712 *
4713 **********************************************************/
4714 S16 cmUnpkRgrUeTxModeCfg
4715 (
4716 RgrUeTxModeCfg *param,
4717 Buffer *mBuf
4718 )
4719 {
4720    uint32_t tmpEnum;
4721
4722
4723    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
4724    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
4725    param->tmTrnstnState = (RgrTxModeTrnstn) tmpEnum;
4726
4727    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
4728    param->txModeEnum = (RgrTxMode) tmpEnum;
4729    return ROK;
4730 }
4731
4732
4733 \f
4734 /***********************************************************
4735 *
4736 *     Func : cmPkRgrUeUlHqCfg
4737 *
4738 *
4739 *     Desc : Uplink HARQ configuration per UE
4740 *
4741 *
4742 *     Ret  : S16
4743 *
4744 *     Notes:
4745 *
4746 *     File  : 
4747 *
4748 **********************************************************/
4749 S16 cmPkRgrUeUlHqCfg
4750 (
4751 RgrUeUlHqCfg *param,
4752 Buffer *mBuf
4753 )
4754 {
4755
4756
4757    CMCHKPK(oduUnpackUInt8, param->deltaHqOffst, mBuf);
4758    CMCHKPK(oduUnpackUInt8, param->maxUlHqTx, mBuf);
4759    return ROK;
4760 }
4761
4762
4763 \f
4764 /***********************************************************
4765 *
4766 *     Func : cmUnpkRgrUeUlHqCfg
4767 *
4768 *
4769 *     Desc : Uplink HARQ configuration per UE
4770 *
4771 *
4772 *     Ret  : S16
4773 *
4774 *     Notes:
4775 *
4776 *     File  : 
4777 *
4778 **********************************************************/
4779 S16 cmUnpkRgrUeUlHqCfg
4780 (
4781 RgrUeUlHqCfg *param,
4782 Buffer *mBuf
4783 )
4784 {
4785
4786
4787    CMCHKUNPK(oduPackUInt8, &param->maxUlHqTx, mBuf);
4788    CMCHKUNPK(oduPackUInt8, &param->deltaHqOffst, mBuf);
4789    return ROK;
4790 }
4791
4792
4793 \f
4794 /***********************************************************
4795 *
4796 *     Func : cmPkRgrUeGrpPwrCfg
4797 *
4798 *
4799 *     Desc : Group power configuration per UE for PUCCH and PUSCH group power control
4800 *
4801 *
4802 *     Ret  : S16
4803 *
4804 *     Notes:
4805 *
4806 *     File  : 
4807 *
4808 **********************************************************/
4809 S16 cmPkRgrUeGrpPwrCfg
4810 (
4811 RgrUeGrpPwrCfg *param,
4812 Buffer *mBuf
4813 )
4814 {
4815
4816
4817    CMCHKPK(oduUnpackUInt8, param->idx, mBuf);
4818    CMCHKPK(cmPkLteRnti, param->tpcRnti, mBuf);
4819    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
4820    return ROK;
4821 }
4822
4823
4824 \f
4825 /***********************************************************
4826 *
4827 *     Func : cmUnpkRgrUeGrpPwrCfg
4828 *
4829 *
4830 *     Desc : Group power configuration per UE for PUCCH and PUSCH group power control
4831 *
4832 *
4833 *     Ret  : S16
4834 *
4835 *     Notes:
4836 *
4837 *     File  : 
4838 *
4839 **********************************************************/
4840 S16 cmUnpkRgrUeGrpPwrCfg
4841 (
4842 RgrUeGrpPwrCfg *param,
4843 Buffer *mBuf
4844 )
4845 {
4846
4847
4848    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
4849    CMCHKUNPK(cmUnpkLteRnti, &param->tpcRnti, mBuf);
4850    CMCHKUNPK(oduPackUInt8, &param->idx, mBuf);
4851    return ROK;
4852 }
4853
4854 /*rgr_c_001.main_7 - Added support for SPS*/
4855
4856 \f
4857 /***********************************************************
4858 *
4859 *     Func : cmPkRgrUeSpsDlCfg
4860 *
4861 *
4862 *     Desc : DL SPS configuration parameters per UE
4863 *
4864 *
4865 *     Ret  : S16
4866 *
4867 *     Notes:
4868 *
4869 *     File  : 
4870 *
4871 **********************************************************/
4872 S16 cmPkRgrUeSpsDlCfg
4873 (
4874 RgrUeSpsDlCfg *param,
4875 Buffer *mBuf
4876 )
4877 {
4878
4879    S32 i;
4880    CMCHKPK(oduUnpackUInt16, param->explicitRelCnt, mBuf);
4881    CMCHKPK(oduUnpackUInt32, param->dlSpsPrdctyEnum, mBuf);
4882    for (i=param->numPucchVal-1; i >= 0; i--) {
4883       CMCHKPK(oduUnpackUInt32, param->n1PucchVal[i], mBuf);
4884    }
4885    CMCHKPK(oduUnpackUInt8, param->numPucchVal, mBuf);
4886    CMCHKPK(oduUnpackUInt8, param->numSpsHqProc, mBuf);
4887    CMCHKPK(oduUnpackUInt8, param->isDlSpsEnabled, mBuf);
4888    return ROK;
4889 }
4890
4891
4892 \f
4893 /***********************************************************
4894 *
4895 *     Func : cmUnpkRgrUeSpsDlCfg
4896 *
4897 *
4898 *     Desc : DL SPS configuration parameters per UE
4899 *
4900 *
4901 *     Ret  : S16
4902 *
4903 *     Notes:
4904 *
4905 *     File  : 
4906 *
4907 **********************************************************/
4908 S16 cmUnpkRgrUeSpsDlCfg
4909 (
4910 RgrUeSpsDlCfg *param,
4911 Buffer *mBuf
4912 )
4913 {
4914    uint32_t tmpEnum;
4915
4916    S32 i;
4917
4918    CMCHKUNPK(oduPackUInt8, &param->isDlSpsEnabled, mBuf);
4919    CMCHKUNPK(oduPackUInt8, &param->numSpsHqProc, mBuf);
4920    CMCHKUNPK(oduPackUInt8, &param->numPucchVal, mBuf);
4921    for (i=0; i<param->numPucchVal; i++) {
4922       CMCHKUNPK(oduPackUInt32, &param->n1PucchVal[i], mBuf);
4923    }
4924    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
4925    param->dlSpsPrdctyEnum = tmpEnum;
4926    CMCHKUNPK(oduPackUInt16, &param->explicitRelCnt, mBuf);
4927    return ROK;
4928 }
4929
4930
4931 \f
4932 /***********************************************************
4933 *
4934 *     Func : cmPkRgrUeSpsUlCfg
4935 *
4936 *
4937 *     Desc : UL SPS configuration parameters per UE
4938 *
4939 *
4940 *     Ret  : S16
4941 *
4942 *     Notes:
4943 *
4944 *     File  : 
4945 *
4946 **********************************************************/
4947 S16 cmPkRgrUeSpsUlCfg
4948 (
4949 RgrUeSpsUlCfg *param,
4950 Buffer *mBuf
4951 )
4952 {
4953
4954    S32 i;
4955
4956    CMCHKPK(oduUnpackUInt8, param->isLcSRMaskEnab, mBuf);
4957    for (i=param->lcCnt-1; i >= 0; i--) {
4958       /* SPS Changes starts */
4959       CMCHKPK(oduUnpackUInt8, param->spsLcInfo[i].isSpsEnabled, mBuf);
4960       CMCHKPK(oduUnpackUInt8, param->spsLcInfo[i].lcId, mBuf);
4961       /* SPS Changes ends */
4962    }
4963    CMCHKPK(oduUnpackUInt8, param->lcCnt, mBuf);
4964    CMCHKPK(oduUnpackUInt32, param->ulSpsPrdctyEnum, mBuf);
4965       CMCHKPK(SPkS8, param->pwrCfg.p0UePuschVal, mBuf);
4966       CMCHKPK(SPkS8, param->pwrCfg.p0NominalPuschVal, mBuf);
4967    CMCHKPK(oduUnpackUInt8, param->pwrCfgPres, mBuf);
4968
4969 #ifdef LTE_TDD
4970    CMCHKPK(oduUnpackUInt8, param->twoIntervalCfg, mBuf);
4971
4972 #endif
4973    CMCHKPK(oduUnpackUInt32, param->implicitRelCnt, mBuf);
4974    CMCHKPK(oduUnpackUInt8, param->isUlSpsEnabled, mBuf);
4975    return ROK;
4976 }
4977
4978
4979 \f
4980 /***********************************************************
4981 *
4982 *     Func : cmUnpkRgrUeSpsUlCfg
4983 *
4984 *
4985 *     Desc : UL SPS configuration parameters per UE
4986 *
4987 *
4988 *     Ret  : S16
4989 *
4990 *     Notes:
4991 *
4992 *     File  : 
4993 *
4994 **********************************************************/
4995 S16 cmUnpkRgrUeSpsUlCfg
4996 (
4997 RgrUeSpsUlCfg *param,
4998 Buffer *mBuf
4999 )
5000 {
5001    uint32_t tmpEnum;
5002
5003    S32 i;
5004
5005    CMCHKUNPK(oduPackUInt8, &param->isUlSpsEnabled, mBuf);
5006    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
5007    param->implicitRelCnt = tmpEnum;
5008
5009 #ifdef LTE_TDD
5010    CMCHKUNPK(oduPackUInt8, &param->twoIntervalCfg, mBuf);
5011
5012 #endif
5013    CMCHKUNPK(oduPackUInt8, &param->pwrCfgPres, mBuf);
5014       CMCHKUNPK(SUnpkS8, &param->pwrCfg.p0NominalPuschVal, mBuf);
5015       CMCHKUNPK(SUnpkS8, &param->pwrCfg.p0UePuschVal, mBuf);
5016    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
5017    param->ulSpsPrdctyEnum = tmpEnum;
5018    CMCHKUNPK(oduPackUInt8, &param->lcCnt, mBuf); 
5019    for (i=0; i<param->lcCnt; i++) {
5020       CMCHKUNPK(oduPackUInt8, &param->spsLcInfo[i].lcId, mBuf);
5021       CMCHKUNPK(oduPackUInt8, &param->spsLcInfo[i].isSpsEnabled, mBuf);
5022    }
5023    CMCHKUNPK(oduPackUInt8, &param->isLcSRMaskEnab, mBuf);
5024    return ROK;
5025 }
5026
5027
5028 \f
5029 /***********************************************************
5030 *
5031 *     Func : cmPkRgrUeSpsCfg
5032 *
5033 *
5034 *     Desc : SPS configuration parameters per UE
5035 *
5036 *
5037 *     Ret  : S16
5038 *
5039 *     Notes:
5040 *
5041 *     File  : 
5042 *
5043 **********************************************************/
5044 S16 cmPkRgrUeSpsCfg
5045 (
5046 RgrUeSpsCfg *param,
5047 Buffer *mBuf
5048 )
5049 {
5050
5051
5052    CMCHKPK(cmPkRgrUeSpsUlCfg, &param->ulSpsCfg, mBuf);
5053    CMCHKPK(cmPkRgrUeSpsDlCfg, &param->dlSpsCfg, mBuf);
5054    CMCHKPK(cmPkLteRnti, param->spsRnti, mBuf);
5055    return ROK;
5056 }
5057
5058
5059 \f
5060 /***********************************************************
5061 *
5062 *     Func : cmUnpkRgrUeSpsCfg
5063 *
5064 *
5065 *     Desc : SPS configuration parameters per UE
5066 *
5067 *
5068 *     Ret  : S16
5069 *
5070 *     Notes:
5071 *
5072 *     File  : 
5073 *
5074 **********************************************************/
5075 S16 cmUnpkRgrUeSpsCfg
5076 (
5077 RgrUeSpsCfg *param,
5078 Buffer *mBuf
5079 )
5080 {
5081
5082
5083    CMCHKUNPK(cmUnpkLteRnti, &param->spsRnti, mBuf);
5084    CMCHKUNPK(cmUnpkRgrUeSpsDlCfg, &param->dlSpsCfg, mBuf);
5085    CMCHKUNPK(cmUnpkRgrUeSpsUlCfg, &param->ulSpsCfg, mBuf);
5086    return ROK;
5087 }
5088
5089
5090 /***********************************************************
5091 *
5092 *     Func : cmPkRgrUeUlPwrCfg
5093 *
5094 *
5095 *     Desc : Uplink power configuration per UE
5096 *
5097 *
5098 *     Ret  : S16
5099 *
5100 *     Notes:
5101 *
5102 *     File  : 
5103 *
5104 **********************************************************/
5105 S16 cmPkRgrUeUlPwrCfg
5106 (
5107 RgrUeUlPwrCfg *param,
5108 Buffer *mBuf
5109 )
5110 {
5111
5112
5113    CMCHKPK(oduUnpackUInt8, param->trgCqi, mBuf);
5114    CMCHKPK(oduUnpackUInt8, param->pSRSOffset, mBuf);
5115    CMCHKPK(SPkS8, param->p0UePucch, mBuf);
5116    CMCHKPK(SPkS8, param->p0UePusch, mBuf);
5117    CMCHKPK(oduUnpackUInt8, param->isDeltaMCSEnabled, mBuf);
5118    CMCHKPK(oduUnpackUInt8, param->isAccumulated, mBuf);
5119    CMCHKPK(cmPkRgrUeGrpPwrCfg, &param->uePucchPwr, mBuf);
5120    CMCHKPK(cmPkRgrUeGrpPwrCfg, &param->uePuschPwr, mBuf);
5121    return ROK;
5122 }
5123
5124
5125 \f
5126 /***********************************************************
5127 *
5128 *     Func : cmUnpkRgrUeUlPwrCfg
5129 *
5130 *
5131 *     Desc : Uplink power configuration per UE
5132 *
5133 *
5134 *     Ret  : S16
5135 *
5136 *     Notes:
5137 *
5138 *     File  : 
5139 *
5140 **********************************************************/
5141 S16 cmUnpkRgrUeUlPwrCfg
5142 (
5143 RgrUeUlPwrCfg *param,
5144 Buffer *mBuf
5145 )
5146 {
5147
5148
5149    CMCHKUNPK(cmUnpkRgrUeGrpPwrCfg, &param->uePuschPwr, mBuf);
5150    CMCHKUNPK(cmUnpkRgrUeGrpPwrCfg, &param->uePucchPwr, mBuf);
5151    CMCHKUNPK(oduPackUInt8, &param->isAccumulated, mBuf);
5152    CMCHKUNPK(oduPackUInt8, &param->isDeltaMCSEnabled, mBuf);
5153    CMCHKUNPK(SUnpkS8, &param->p0UePusch, mBuf);
5154    CMCHKUNPK(SUnpkS8, &param->p0UePucch, mBuf);
5155    CMCHKUNPK(oduPackUInt8, &param->pSRSOffset, mBuf);
5156    CMCHKUNPK(oduPackUInt8, &param->trgCqi, mBuf);
5157    return ROK;
5158 }
5159
5160
5161 \f
5162 /***********************************************************
5163 *
5164 *     Func : cmPkRgrUeQosCfg
5165 *
5166 *
5167 *     Desc : Downlink/Uplink QoS configuration per UE
5168 *
5169 *
5170 *     Ret  : S16
5171 *
5172 *     Notes:
5173 *
5174 *     File  : 
5175 *
5176 **********************************************************/
5177 S16 cmPkRgrUeQosCfg
5178 (
5179 RgrUeQosCfg *param,
5180 Buffer *mBuf
5181 )
5182 {
5183
5184
5185    CMCHKPK(oduUnpackUInt32, param->ueBr, mBuf);
5186    CMCHKPK(oduUnpackUInt32, param->dlAmbr, mBuf);
5187    CMCHKPK(oduUnpackUInt8, param->ambrPres, mBuf);
5188    return ROK;
5189 }
5190
5191
5192 \f
5193 /***********************************************************
5194 *
5195 *     Func : cmUnpkRgrUeQosCfg
5196 *
5197 *
5198 *     Desc : Downlink/Uplink QoS configuration per UE
5199 *
5200 *
5201 *     Ret  : S16
5202 *
5203 *     Notes:
5204 *
5205 *     File  : 
5206 *
5207 **********************************************************/
5208 S16 cmUnpkRgrUeQosCfg
5209 (
5210 RgrUeQosCfg *param,
5211 Buffer *mBuf
5212 )
5213 {
5214
5215
5216    CMCHKUNPK(oduPackUInt8, &param->ambrPres, mBuf);
5217    CMCHKUNPK(oduPackUInt32, &param->dlAmbr, mBuf);
5218    CMCHKUNPK(oduPackUInt32, &param->ueBr, mBuf);
5219    return ROK;
5220 }
5221
5222 /*********************************************************** 
5223
5224 *     Func : cmPkRgrUePuschDedCfg 
5225
5226
5227 *     Desc : PUSCH Config Dedication for UE 
5228
5229
5230 *     Ret  : S16 
5231
5232 *     Notes: 
5233
5234 *     File  :  
5235
5236 **********************************************************/ 
5237 S16 cmPkRgrUePuschDedCfg 
5238
5239 RgrUePuschDedCfg *param, 
5240 Buffer *mBuf 
5241
5242
5243  
5244  
5245    CMCHKPK(oduUnpackUInt8, param->bCQIIdx, mBuf);
5246    CMCHKPK(oduUnpackUInt8, param->bRIIdx, mBuf);
5247    CMCHKPK(oduUnpackUInt8, param->bACKIdx, mBuf);
5248    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
5249    return ROK;
5250 }
5251
5252
5253 /***********************************************************
5254 *
5255 *     Func : cmUnpkRgrUePuschDedCfg
5256 *
5257 *
5258 *     Desc : PUSCH Config Dedication for UE
5259
5260 *
5261 *
5262 *     Ret  : S16
5263 *
5264 *     Notes:
5265 *
5266 *     File  : 
5267 *
5268 **********************************************************/
5269 S16 cmUnpkRgrUePuschDedCfg
5270 (
5271 RgrUePuschDedCfg *param,
5272 Buffer *mBuf
5273 )
5274 {
5275
5276
5277    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
5278    CMCHKUNPK(oduPackUInt8, &param->bACKIdx, mBuf);
5279    CMCHKUNPK(oduPackUInt8, &param->bRIIdx, mBuf);
5280    CMCHKUNPK(oduPackUInt8, &param->bCQIIdx, mBuf);
5281    return ROK;
5282 }
5283
5284 /***********************************************************
5285 *
5286 *     Func : cmPkRgrUeTxAntSelCfg
5287 *
5288 *
5289 *     Desc : UE Transmit Antenna selection related configuration
5290 *
5291 *
5292 *     Ret  : S16
5293 *
5294 *     Notes:
5295 *
5296 *     File  : 
5297 *
5298 **********************************************************/
5299 S16 cmPkRgrUeTxAntSelCfg
5300 (
5301 RgrUeTxAntSelCfg *param,
5302 Buffer *mBuf
5303 )
5304 {
5305
5306
5307    CMCHKPK(oduUnpackUInt32, param->selType, mBuf);
5308    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
5309    return ROK;
5310 }
5311
5312
5313 \f
5314 /***********************************************************
5315 *
5316 *     Func : cmUnpkRgrUeTxAntSelCfg
5317 *
5318 *
5319 *     Desc : UE Transmit Antenna selection related configuration
5320 *
5321 *
5322 *     Ret  : S16
5323 *
5324 *     Notes:
5325 *
5326 *     File  : 
5327 *
5328 **********************************************************/
5329 S16 cmUnpkRgrUeTxAntSelCfg
5330 (
5331 RgrUeTxAntSelCfg *param,
5332 Buffer *mBuf
5333 )
5334 {
5335    uint32_t tmpEnum;
5336
5337
5338    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
5339    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
5340    param->selType = (RgrUeTxAntSelType) tmpEnum;
5341    return ROK;
5342 }
5343
5344
5345 /***********************************************************
5346 *
5347 *     Func : cmPkRgrUeTaTmrCfg
5348 *
5349 *
5350 *     Desc : Time Alignment timer configuration per UE
5351 *
5352 *
5353 *     Ret  : S16
5354 *
5355 *     Notes:
5356 *
5357 *     File  : 
5358 *
5359 **********************************************************/
5360 S16 cmPkRgrUeTaTmrCfg
5361 (
5362 RgrUeTaTmrCfg *param,
5363 Buffer *mBuf
5364 )
5365 {
5366
5367
5368    CMCHKPK(oduUnpackUInt16, param->taTmr, mBuf);
5369    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
5370    return ROK;
5371 }
5372
5373
5374 \f
5375 /***********************************************************
5376 *
5377 *     Func : cmUnpkRgrUeTaTmrCfg
5378 *
5379 *
5380 *     Desc : Time Alignment timer configuration per UE
5381 *
5382 *
5383 *     Ret  : S16
5384 *
5385 *     Notes:
5386 *
5387 *     File  : 
5388 *
5389 **********************************************************/
5390 S16 cmUnpkRgrUeTaTmrCfg
5391 (
5392 RgrUeTaTmrCfg *param,
5393 Buffer *mBuf
5394 )
5395 {
5396
5397
5398    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
5399    CMCHKUNPK(oduPackUInt16, &param->taTmr, mBuf);
5400    return ROK;
5401 }
5402
5403
5404 #ifdef EMTC_ENABLE
5405 S16 cmUnpkRgrEmtcUeCfg
5406 (
5407 RgrUeEmtcCfg *param,
5408 Buffer *mBuf
5409 )
5410 {
5411    S32 indx=0;
5412    S32 idx=0;
5413    RgrEpdcchConfigRel11 *emtcEpdcchCfg = &(param->emtcEpdcchCfg);
5414    RgrPucchRepCfgRel13 *emtcPucchRepCfg = &(param->emtcPucchRepCfg);
5415    RgrEpdcchAddModLst *epdcchAddModLst;
5416
5417    CMCHKUNPK(oduPackUInt8,&param->pdschReptLevModeA,mBuf);
5418    /*UnPacking PUCCH Rep */
5419    CMCHKUNPK(oduPackUInt8,&(emtcPucchRepCfg->modeANumPucchRepFormat2),mBuf);
5420    CMCHKUNPK(oduPackUInt8,&(emtcPucchRepCfg->modeANumPucchRepFormat1),mBuf);
5421    CMCHKUNPK(oduPackUInt8,&(emtcPucchRepCfg->isPucchRepPres),mBuf);
5422    
5423    
5424    
5425    for(indx = 0; indx < RGR_MAX_EPDCCH_SET; indx++)
5426    {
5427       epdcchAddModLst =  &(emtcEpdcchCfg->epdcchAddModLst[indx]);
5428       CMCHKUNPK(oduPackUInt32,&(epdcchAddModLst->extaddgrp2.mpddchNB),mBuf);
5429       CMCHKUNPK(oduPackUInt16,&(epdcchAddModLst->extaddgrp2.mpdcchNumRep),mBuf);
5430       CMCHKUNPK(oduPackUInt8,&(epdcchAddModLst->extaddgrp2.mpdcchStartUESSFDD),mBuf);
5431       CMCHKUNPK(oduPackUInt8,&(epdcchAddModLst->extaddgrp2.mpddchPdschHop),mBuf);
5432       CMCHKUNPK(oduPackUInt8,&(epdcchAddModLst->extaddgrp2.csiNumRep),mBuf);
5433       CMCHKUNPK(oduPackUInt8,&(epdcchAddModLst->extaddgrp2.pres),mBuf);
5434       CMCHKUNPK(cmUnpkTknUInt8,&(epdcchAddModLst->mpdcchNumPRBpair),mBuf);
5435       CMCHKUNPK(cmUnpkTknUInt32,&(epdcchAddModLst->pdschRemapQLcfgId),mBuf);
5436       CMCHKUNPK(oduPackUInt32,&(epdcchAddModLst->pucchResStartoffset),mBuf);
5437       CMCHKUNPK(oduPackUInt32,&(epdcchAddModLst->dmrsScrambSeq),mBuf);
5438       for(idx = 0; idx < 5; idx++)
5439       {
5440          CMCHKUNPK(oduPackUInt8,&(epdcchAddModLst->resBlkAssignment.rbAssignment[idx]),mBuf);
5441       }
5442
5443       CMCHKUNPK(oduPackUInt8,&(epdcchAddModLst->resBlkAssignment.numPRBpairs),mBuf);
5444       CMCHKUNPK(oduPackUInt8,&(epdcchAddModLst->transmissionType),mBuf);
5445       CMCHKUNPK(oduPackUInt8,&(epdcchAddModLst->setConfigId),mBuf);
5446
5447    }
5448    CMCHKUNPK(cmUnpkTknUInt32,&(emtcEpdcchCfg->startSymbolr11),mBuf);
5449    for(indx = 0; indx < 5; indx++)
5450    {
5451       CMCHKUNPK(oduPackUInt8,&(emtcEpdcchCfg->sfPtn.measSfPatFDD[indx]),mBuf);
5452    }
5453    CMCHKUNPK(oduPackUInt8, &(emtcEpdcchCfg->sfPtn.pres), mBuf);
5454    CMCHKUNPK(oduPackUInt8, &(param->pres), mBuf);
5455    CMCHKUNPK(oduPackUInt8, &(param->isHdFddEnbld), mBuf);
5456
5457 #ifdef EMTC_DEBUG_CONSOLE_PRINTS 
5458    printf("\n EMTC RGR UE unpack\n");
5459    printf("\nemtcEpdcchCfg->sfPtn.pres %d ",emtcEpdcchCfg->sfPtn.pres);
5460
5461    for(indx = 0; indx < 5; indx++)
5462    {
5463       printf("\nemtcEpdcchCfg->sfPtn.measSfPatFDD[%d] %d ",indx,emtcEpdcchCfg->sfPtn.measSfPatFDD[indx]);
5464    }
5465    printf("\nemtcEpdcchCfg->startSymbolr11 %d ",emtcEpdcchCfg->startSymbolr11.pres);
5466    printf("\nemtcEpdcchCfg->startSymbolr11 %d ",emtcEpdcchCfg->startSymbolr11.val);
5467
5468    for(indx = 0 ; indx < RGR_MAX_EPDCCH_SET; indx++)
5469    {
5470       epdcchAddModLst =  &(emtcEpdcchCfg->epdcchAddModLst[indx]);
5471       printf("\nemtcEpdcchCfg->epdcchRelLst[indx].setCfgId %d %d ", indx,emtcEpdcchCfg->epdcchRelLst[indx].setCfgId.pres);
5472       printf("\nemtcEpdcchCfg->epdcchRelLst[indx].setCfgId %d %d ", indx,emtcEpdcchCfg->epdcchRelLst[indx].setCfgId.val);
5473       printf("\nepdcchAddModLst->setConfigId %d ", epdcchAddModLst->setConfigId);
5474       printf("\nepdcchAddModLst->transmissionType %d ",epdcchAddModLst->transmissionType);
5475       printf("\nepdcchAddModLst->resBlkAssignment.numPRBpairs %d ",epdcchAddModLst->resBlkAssignment.numPRBpairs);
5476       for(idx = 0; idx < 5 ; idx++)
5477       {
5478          printf("\nepdcchAddModLst->resBlkAssignment.rbAssignment[idx] %d ",epdcchAddModLst->resBlkAssignment.rbAssignment[idx]);
5479       }
5480       printf("\nepdcchAddModLst->dmrsScrambSeq %d ",epdcchAddModLst->dmrsScrambSeq);
5481       printf("\nepdcchAddModLst->pucchResStartoffset %d ",epdcchAddModLst->pucchResStartoffset);
5482       printf("\nepdcchAddModLst->pdschRemapQLcfgId.pres %d ",epdcchAddModLst->pdschRemapQLcfgId.pres);
5483       printf("\nepdcchAddModLst->pdschRemapQLcfgId.val %d ", epdcchAddModLst->pdschRemapQLcfgId.val);
5484       printf("\nepdcchAddModLst->mpdcchNumPRBpair.pres %d ",  epdcchAddModLst->mpdcchNumPRBpair.pres);
5485       printf("\nepdcchAddModLst->mpdcchNumPRBpair.val %d ",  epdcchAddModLst->mpdcchNumPRBpair.val);
5486       printf("\nepdcchAddModLst->extaddgrp2.pres %d ",       epdcchAddModLst->extaddgrp2.pres);
5487       printf("\nepdcchAddModLst->extaddgrp2.csiNumRep %d ",   epdcchAddModLst->extaddgrp2.csiNumRep);
5488       printf("\nepdcchAddModLst->extaddgrp2.mpddchPdschHop %d ", epdcchAddModLst->extaddgrp2.mpddchPdschHop);
5489       printf("\nepdcchAddModLst->extaddgrp2.mpdcchStartUESSFDD %d ",epdcchAddModLst->extaddgrp2.mpdcchStartUESSFDD);
5490       printf("\nepdcchAddModLst->extaddgrp2.mpdcchNumRep %d ", epdcchAddModLst->extaddgrp2.mpdcchNumRep);
5491       printf("\nepdcchAddModLst->extaddgrp2.mpddchNB %d ",  epdcchAddModLst->extaddgrp2.mpddchNB);
5492    }
5493
5494 #endif
5495
5496    return ROK;
5497 }
5498
5499
5500
5501 S16 cmPkRgrEmtcUeCfg
5502 (
5503  RgrUeEmtcCfg *param,
5504  Buffer *mBuf
5505  )
5506 {
5507    S32 indx=0;
5508    S32 idx=0;
5509    RgrEpdcchConfigRel11 *emtcEpdcchCfg = &(param->emtcEpdcchCfg);
5510    RgrPucchRepCfgRel13 *emtcPucchRepCfg = &(param->emtcPucchRepCfg);
5511    RgrEpdcchAddModLst *epdcchAddModLst;
5512
5513    CMCHKPK(oduUnpackUInt8, param->isHdFddEnbld, mBuf);
5514    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
5515    CMCHKPK(oduUnpackUInt8, emtcEpdcchCfg->sfPtn.pres, mBuf);
5516    for(indx = 4; indx >=0; indx--)
5517    {
5518       CMCHKPK(oduUnpackUInt8,emtcEpdcchCfg->sfPtn.measSfPatFDD[indx],mBuf);
5519    }
5520    CMCHKPK(cmPkTknUInt32,&emtcEpdcchCfg->startSymbolr11,mBuf);
5521    for(indx = RGR_MAX_EPDCCH_SET-1 ; indx >= 0; indx--)
5522    {
5523       epdcchAddModLst =  &(emtcEpdcchCfg->epdcchAddModLst[indx]);
5524
5525       CMCHKPK(oduUnpackUInt8,epdcchAddModLst->setConfigId,mBuf);
5526       CMCHKPK(oduUnpackUInt8,epdcchAddModLst->transmissionType,mBuf);
5527       CMCHKPK(oduUnpackUInt8,epdcchAddModLst->resBlkAssignment.numPRBpairs,mBuf);
5528       for(idx = 4; idx >= 0; idx--)
5529       {
5530          CMCHKPK(oduUnpackUInt8,epdcchAddModLst->resBlkAssignment.rbAssignment[idx],mBuf);
5531       }
5532       CMCHKPK(oduUnpackUInt32,epdcchAddModLst->dmrsScrambSeq,mBuf);
5533       CMCHKPK(oduUnpackUInt32,epdcchAddModLst->pucchResStartoffset,mBuf);
5534       CMCHKPK(cmPkTknUInt32,&(epdcchAddModLst->pdschRemapQLcfgId),mBuf);
5535       CMCHKPK(cmPkTknUInt8,&(epdcchAddModLst->mpdcchNumPRBpair),mBuf);
5536       CMCHKPK(oduUnpackUInt8,epdcchAddModLst->extaddgrp2.pres,mBuf);
5537       CMCHKPK(oduUnpackUInt8,epdcchAddModLst->extaddgrp2.csiNumRep,mBuf);
5538       CMCHKPK(oduUnpackUInt8,epdcchAddModLst->extaddgrp2.mpddchPdschHop,mBuf);
5539       CMCHKPK(oduUnpackUInt8,epdcchAddModLst->extaddgrp2.mpdcchStartUESSFDD,mBuf);
5540       CMCHKPK(oduUnpackUInt16,epdcchAddModLst->extaddgrp2.mpdcchNumRep,mBuf);
5541       CMCHKPK(oduUnpackUInt32,epdcchAddModLst->extaddgrp2.mpddchNB,mBuf);
5542    }
5543    
5544 /*Packing PUCCH Rep */
5545    CMCHKPK(oduUnpackUInt8,emtcPucchRepCfg->isPucchRepPres, mBuf);
5546    CMCHKPK(oduUnpackUInt8,emtcPucchRepCfg->modeANumPucchRepFormat1,mBuf);
5547    CMCHKPK(oduUnpackUInt8,emtcPucchRepCfg->modeANumPucchRepFormat2,mBuf);
5548    CMCHKPK(oduUnpackUInt8,param->pdschReptLevModeA,mBuf);
5549    
5550 #ifdef EMTC_DEBUG_CONSOLE_PRINTS 
5551    printf("\n EMTC RGR UE pack\n");
5552    printf("\nemtcEpdcchCfg->sfPtn.pres %d ",emtcEpdcchCfg->sfPtn.pres);
5553
5554    for(indx = 0; indx < 5; indx++)
5555    {
5556       printf("\nemtcEpdcchCfg->sfPtn.measSfPatFDD[%d] %d ",indx,emtcEpdcchCfg->sfPtn.measSfPatFDD[indx]);
5557    }
5558    printf("\nemtcEpdcchCfg->startSymbolr11 %d ",emtcEpdcchCfg->startSymbolr11.pres);
5559    printf("\nemtcEpdcchCfg->startSymbolr11 %d ",emtcEpdcchCfg->startSymbolr11.val);
5560
5561    for(indx = 0 ; indx < RGR_MAX_EPDCCH_SET; indx++)
5562    {
5563       epdcchAddModLst =  &(emtcEpdcchCfg->epdcchAddModLst[indx]);
5564      /* printf("\nemtcEpdcchCfg->epdcchRelLst[indx].setCfgId %d %d ", indx,emtcEpdcchCfg->epdcchRelLst[indx].setCfgId.pres);
5565       printf("\nemtcEpdcchCfg->epdcchRelLst[indx].setCfgId %d %d ", indx,emtcEpdcchCfg->epdcchRelLst[indx].setCfgId.val);*/
5566       printf("\nepdcchAddModLst->setConfigId %d ", epdcchAddModLst->setConfigId);
5567       printf("\nepdcchAddModLst->transmissionType %d ",epdcchAddModLst->transmissionType);
5568       printf("\nepdcchAddModLst->resBlkAssignment.numPRBpairs %d ",epdcchAddModLst->resBlkAssignment.numPRBpairs);
5569       for(idx = 0; idx < 5 ; idx++)
5570       {
5571          printf("\nepdcchAddModLst->resBlkAssignment.rbAssignment[idx] %d ",epdcchAddModLst->resBlkAssignment.rbAssignment[idx]);
5572       }
5573       printf("\nepdcchAddModLst->dmrsScrambSeq %d ",epdcchAddModLst->dmrsScrambSeq);
5574       printf("\nepdcchAddModLst->pucchResStartoffset %d ",epdcchAddModLst->pucchResStartoffset);
5575       printf("\nepdcchAddModLst->pdschRemapQLcfgId.pres %d ",epdcchAddModLst->pdschRemapQLcfgId.pres);
5576       printf("\nepdcchAddModLst->pdschRemapQLcfgId.val %d ", epdcchAddModLst->pdschRemapQLcfgId.val);
5577       printf("\nepdcchAddModLst->mpdcchNumPRBpair.pres %d ",  epdcchAddModLst->mpdcchNumPRBpair.pres);
5578       printf("\nepdcchAddModLst->mpdcchNumPRBpair.val %d ",  epdcchAddModLst->mpdcchNumPRBpair.val);
5579       printf("\nepdcchAddModLst->extaddgrp2.pres %d ",       epdcchAddModLst->extaddgrp2.pres);
5580       printf("\nepdcchAddModLst->extaddgrp2.csiNumRep %d ",   epdcchAddModLst->extaddgrp2.csiNumRep);
5581       printf("\nepdcchAddModLst->extaddgrp2.mpddchPdschHop %d ", epdcchAddModLst->extaddgrp2.mpddchPdschHop);
5582       printf("\nepdcchAddModLst->extaddgrp2.mpdcchStartUESSFDD %d ",epdcchAddModLst->extaddgrp2.mpdcchStartUESSFDD);
5583       printf("\nepdcchAddModLst->extaddgrp2.mpdcchNumRep %d ", epdcchAddModLst->extaddgrp2.mpdcchNumRep);
5584       printf("\nepdcchAddModLst->extaddgrp2.mpddchNB %d ",  epdcchAddModLst->extaddgrp2.mpddchNB);
5585    }
5586
5587 #endif
5588
5589
5590
5591    return ROK;
5592 }
5593 #endif
5594
5595 #ifdef RG_5GTF
5596 S16 cmUnpkRgr5gtfUeCfg
5597 (
5598  RgrUe5gtfCfg *param,
5599  Buffer       *mBuf
5600 )
5601 {
5602    CMCHKUNPK(oduPackUInt8, &param->grpId, mBuf);
5603    CMCHKUNPK(oduPackUInt8, &param->BeamId, mBuf);
5604    CMCHKUNPK(oduPackUInt8, &param->numCC, mBuf);
5605    CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
5606    CMCHKUNPK(oduPackUInt8, &param->maxPrb, mBuf);
5607    return ROK;
5608 }
5609
5610 S16 cmPkRgr5gtfUeCfg
5611 (
5612  RgrUe5gtfCfg *param,
5613  Buffer       *mBuf
5614 )
5615 {
5616    CMCHKPK(oduUnpackUInt8, param->maxPrb, mBuf);
5617    CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
5618    CMCHKPK(oduUnpackUInt8, param->numCC, mBuf);
5619    CMCHKPK(oduUnpackUInt8, param->BeamId, mBuf);
5620    CMCHKPK(oduUnpackUInt8, param->grpId, mBuf);
5621    return ROK;
5622 }
5623 #endif
5624
5625 \f
5626 /***********************************************************
5627 *
5628 *     Func : cmPkRgrUeCfg
5629 *
5630 *
5631 *     Desc : UE configuration
5632 *
5633 *
5634 *     Ret  : S16
5635 *
5636 *     Notes:
5637 *
5638 *     File  : 
5639 *
5640 **********************************************************/
5641 S16 cmPkRgrUeCfg
5642 (
5643 RgrUeCfg *param,
5644 Buffer *mBuf
5645 )
5646 {
5647
5648 #ifdef RG_5GTF
5649    CMCHKPK(cmPkRgr5gtfUeCfg, &param->ue5gtfCfg, mBuf);
5650 #endif
5651 #ifdef EMTC_ENABLE
5652  CMCHKPK(cmPkRgrEmtcUeCfg, &param->emtcUeCfg, mBuf);
5653 #endif
5654    CMCHKPK(oduUnpackUInt8, param->csgMmbrSta, mBuf);
5655
5656    CMCHKPK(oduUnpackUInt32, param->accessStratumRls, mBuf);
5657    /* LTE_ADV_FLAG_REMOVED_START */
5658    CMCHKPK(cmPkRgrLteAdvancedUeConfig, &param->ueLteAdvCfg, mBuf);
5659    /* LTE_ADV_FLAG_REMOVED_END */
5660 #ifdef TFU_UPGRADE
5661 /*rgr_c_001.main_9 ADD PDSCH ded cfg*/
5662    CMCHKPK(cmPkRgrUePdschDedCfg, &param->uePdschDedCfg, mBuf);
5663 #endif
5664    /*rgr_c_001.main_9 ccpu00117452 - MOD - Changed macro name from
5665    RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
5666 #ifdef RGR_CQI_REPT
5667    CMCHKPK(cmPkRgrUeCqiReptCfg, &param->ueCqiReptCfg, mBuf);
5668 #endif
5669    CMCHKPK(cmPkRgrUeTxAntSelCfg, &param->ulTxAntSel, mBuf);
5670
5671 /* rgr_c_001.main_8. Added changes of TFU_UPGRADE */
5672    CMCHKPK(cmPkRgrUePuschDedCfg, &param->puschDedCfg, mBuf);
5673
5674 /*rgr_c_001.main_9 ADD added changes for HDFDD*/
5675 #ifdef LTEMAC_HDFDD
5676    CMCHKPK(oduUnpackUInt8, param->isHdFddEnbld, mBuf);
5677 #endif
5678
5679 #ifdef TFU_UPGRADE
5680    CMCHKPK(cmPkRgrUeSrCfg, &param->srCfg, mBuf);
5681    CMCHKPK(cmPkRgrUeUlSrsCfg, &param->srsCfg, mBuf);
5682 #endif
5683
5684
5685
5686    CMCHKPK(cmPkRgrUeSpsCfg, &param->ueSpsCfg, mBuf);
5687
5688 #ifdef LTE_TDD
5689    CMCHKPK(oduUnpackUInt32, param->ackNackModeEnum, mBuf);
5690
5691 #endif
5692    CMCHKPK(cmPkTknUInt8, &param->dedPreambleId, mBuf);
5693    CMCHKPK(cmPkRgrCodeBookRstCfg, &param->ueCodeBookRstCfg, mBuf);
5694    CMCHKPK(cmPkRgrUeCapCfg, &param->ueCapCfg, mBuf);
5695    CMCHKPK(cmPkRgrUeMeasGapCfg, &param->ueMesGapCfg, mBuf);
5696    CMCHKPK(cmPkRgrUeAckNackRepCfg, &param->ueAckNackCfg, mBuf);
5697    CMCHKPK(oduUnpackUInt8, param->isTtiBundlEnabled, mBuf);
5698 /*rgr_c_001.main_9 ADD added changes for DRX*/
5699    
5700    /* Anshika - Pack only if DRX is enabled */
5701    if(TRUE == param->ueDrxCfg.isDrxEnabled)
5702    {   
5703     CMCHKPK(cmPkRgrUeDrxCfg, &param->ueDrxCfg, mBuf);
5704    }
5705    CMCHKPK(oduUnpackUInt8, param->ueDrxCfg.isDrxEnabled, mBuf); /* This has to be packed even if
5706                                                  DRX is disabled */
5707    CMCHKPK(oduUnpackUInt32, param->ueCatEnum, mBuf);
5708 #ifdef RGR_V1
5709    /* rgr_c_001.main_5: ccpu00112398: Added periodicBSR-timer and
5710     * retxBSR-timer */
5711    CMCHKPK(cmPkRgrUeBsrTmrCfg, &param->ueBsrTmrCfg, mBuf);
5712 #endif
5713    CMCHKPK(cmPkRgrUeTaTmrCfg, &param->ueTaTmrCfg, mBuf);
5714    CMCHKPK(cmPkRgrUeQosCfg, &param->ueQosCfg, mBuf);
5715    CMCHKPK(cmPkRgrUeUlPwrCfg, &param->ueUlPwrCfg, mBuf);
5716    CMCHKPK(cmPkRgrUeUlHqCfg, &param->ueUlHqCfg, mBuf);
5717    CMCHKPK(cmPkRgrUeDlCqiCfg, &param->ueDlCqiCfg, mBuf);
5718    CMCHKPK(cmPkRgrUeTxModeCfg, &param->txMode, mBuf);
5719    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
5720    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
5721    return ROK;
5722 }
5723
5724
5725 \f
5726 /***********************************************************
5727 *
5728 *     Func : cmUnpkRgrUeCfg
5729 *
5730 *
5731 *     Desc : UE configuration
5732 *
5733 *
5734 *     Ret  : S16
5735 *
5736 *     Notes:
5737 *
5738 *     File  : 
5739 *
5740 **********************************************************/
5741 S16 cmUnpkRgrUeCfg
5742 (
5743 RgrUeCfg *param,
5744 Buffer *mBuf
5745 )
5746 {
5747    uint32_t tmpEnum;
5748
5749
5750    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
5751    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
5752    CMCHKUNPK(cmUnpkRgrUeTxModeCfg, &param->txMode, mBuf);
5753    CMCHKUNPK(cmUnpkRgrUeDlCqiCfg, &param->ueDlCqiCfg, mBuf);
5754    CMCHKUNPK(cmUnpkRgrUeUlHqCfg, &param->ueUlHqCfg, mBuf);
5755    CMCHKUNPK(cmUnpkRgrUeUlPwrCfg, &param->ueUlPwrCfg, mBuf);
5756    CMCHKUNPK(cmUnpkRgrUeQosCfg, &param->ueQosCfg, mBuf);
5757    CMCHKUNPK(cmUnpkRgrUeTaTmrCfg, &param->ueTaTmrCfg, mBuf);
5758 #ifdef RGR_V1
5759    /* rgr_c_001.main_5: ccpu00112398: Added periodicBSR-timer and
5760     * retxBSR-timer */
5761    CMCHKUNPK(cmUnpkRgrUeBsrTmrCfg, &param->ueBsrTmrCfg, mBuf);
5762 #endif
5763    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
5764    param->ueCatEnum = (CmLteUeCategory) tmpEnum;
5765 /*rgr_c_001.main_9 ADD added changes for DRX*/
5766    
5767    /* Anshika - Unpack only if DRX is enabled */
5768    CMCHKUNPK(oduPackUInt8, &param->ueDrxCfg.isDrxEnabled, mBuf);
5769    if(TRUE == param->ueDrxCfg.isDrxEnabled)
5770    {
5771       CMCHKUNPK(cmUnpkRgrUeDrxCfg, &param->ueDrxCfg, mBuf);
5772    }
5773    CMCHKUNPK(oduPackUInt8, &param->isTtiBundlEnabled, mBuf);
5774    CMCHKUNPK(cmUnpkRgrUeAckNackRepCfg, &param->ueAckNackCfg, mBuf);
5775    CMCHKUNPK(cmUnpkRgrUeMeasGapCfg, &param->ueMesGapCfg, mBuf);
5776    CMCHKUNPK(cmUnpkRgrUeCapCfg, &param->ueCapCfg, mBuf);
5777    CMCHKUNPK(cmUnpkRgrCodeBookRstCfg, &param->ueCodeBookRstCfg, mBuf);
5778    CMCHKUNPK(cmUnpkTknUInt8, &param->dedPreambleId, mBuf);
5779
5780 #ifdef LTE_TDD
5781    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
5782    param->ackNackModeEnum = tmpEnum;
5783
5784 #endif
5785    /*rgr_c_001.main_7 - Added support for SPS*/
5786    CMCHKUNPK(cmUnpkRgrUeSpsCfg, &param->ueSpsCfg, mBuf);
5787
5788 /* rgr_c_001.main_8. Added changes of TFU_UPGRADE */
5789 #ifdef TFU_UPGRADE
5790    CMCHKUNPK(cmUnpkRgrUeUlSrsCfg, &param->srsCfg, mBuf);
5791    CMCHKUNPK(cmUnpkRgrUeSrCfg, &param->srCfg, mBuf);
5792 #endif
5793 /*rgr_c_001.main_9 ADD added changes for HDFDD*/
5794 #ifdef LTEMAC_HDFDD
5795    CMCHKUNPK(oduPackUInt8, &param->isHdFddEnbld, mBuf);
5796 #endif
5797    CMCHKUNPK(cmUnpkRgrUePuschDedCfg, &param->puschDedCfg, mBuf);
5798    CMCHKUNPK(cmUnpkRgrUeTxAntSelCfg, &param->ulTxAntSel, mBuf);
5799 /* rgr_c_001.main_9 ccpu00117452 - MOD - Changed macro name from
5800    RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
5801 #ifdef RGR_CQI_REPT
5802    CMCHKUNPK(cmUnpkRgrUeCqiReptCfg, &param->ueCqiReptCfg, mBuf);
5803 #endif
5804 #ifdef TFU_UPGRADE
5805    CMCHKUNPK(cmUnpkRgrUePdschDedCfg, &param->uePdschDedCfg, mBuf);
5806 #endif
5807    /* LTE_ADV_FLAG_REMOVED_START */
5808    CMCHKUNPK(cmUnpkRgrLteAdvancedUeConfig, &param->ueLteAdvCfg, mBuf);
5809    /* LTE_ADV_FLAG_REMOVED_END */
5810    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->accessStratumRls, mBuf);
5811    CMCHKUNPK(oduPackUInt8, &param->csgMmbrSta, mBuf);
5812
5813 #ifdef EMTC_ENABLE
5814  CMCHKUNPK(cmUnpkRgrEmtcUeCfg, &param->emtcUeCfg, mBuf);
5815 #endif
5816
5817 #ifdef RG_5GTF
5818  CMCHKUNPK(cmUnpkRgr5gtfUeCfg, &param->ue5gtfCfg, mBuf);
5819 #endif
5820
5821    return ROK;
5822 }
5823
5824
5825 \f
5826 /***********************************************************
5827 *
5828 *     Func : cmPkRgrLchQosCfg
5829 *
5830 *
5831 *     Desc : QCI, GBR and MBR configuration for dedicated logical channels
5832 *
5833 *
5834 *     Ret  : S16
5835 *
5836 *     Notes:
5837 *
5838 *     File  : 
5839 *
5840 **********************************************************/
5841 S16 cmPkRgrLchQosCfg
5842 (
5843 RgrLchQosCfg *param,
5844 Buffer *mBuf
5845 )
5846 {
5847
5848
5849    CMCHKPK(oduUnpackUInt32, param->mbr, mBuf);
5850    CMCHKPK(oduUnpackUInt32, param->gbr, mBuf);
5851    CMCHKPK(oduUnpackUInt8, param->qci, mBuf);
5852    return ROK;
5853 }
5854
5855
5856 \f
5857 /***********************************************************
5858 *
5859 *     Func : cmUnpkRgrLchQosCfg
5860 *
5861 *
5862 *     Desc : QCI, GBR and MBR configuration for dedicated logical channels
5863 *
5864 *
5865 *     Ret  : S16
5866 *
5867 *     Notes:
5868 *
5869 *     File  : 
5870 *
5871 **********************************************************/
5872 S16 cmUnpkRgrLchQosCfg
5873 (
5874 RgrLchQosCfg *param,
5875 Buffer *mBuf
5876 )
5877 {
5878
5879
5880    CMCHKUNPK(oduPackUInt8, &param->qci, mBuf);
5881    CMCHKUNPK(oduPackUInt32, &param->gbr, mBuf);
5882    CMCHKUNPK(oduPackUInt32, &param->mbr, mBuf);
5883    return ROK;
5884 }
5885 /*rgr_c_001.main_7 - Added support for SPS*/
5886
5887 \f
5888 /***********************************************************
5889 *
5890 *     Func : cmPkRgrLchSpsCfg
5891 *
5892 *
5893 *     Desc : SPS related configuration for logical channels
5894 *
5895 *
5896 *     Ret  : S16
5897 *
5898 *     Notes:
5899 *
5900 *     File  : 
5901 *
5902 **********************************************************/
5903 S16 cmPkRgrLchSpsCfg
5904 (
5905 RgrLchSpsCfg *param,
5906 Buffer *mBuf
5907 )
5908 {
5909
5910
5911    /* SPS_DEV */
5912    CMCHKPK(oduUnpackUInt8, param->isSpsEnabled, mBuf);
5913    return ROK;
5914 }
5915
5916
5917 \f
5918 /***********************************************************
5919 *
5920 *     Func : cmUnpkRgrLchSpsCfg
5921 *
5922 *
5923 *     Desc : SPS related configuration for logical channels
5924 *
5925 *
5926 *     Ret  : S16
5927 *
5928 *     Notes:
5929 *
5930 *     File  : 
5931 *
5932 **********************************************************/
5933 S16 cmUnpkRgrLchSpsCfg
5934 (
5935 RgrLchSpsCfg *param,
5936 Buffer *mBuf
5937 )
5938 {
5939
5940
5941    CMCHKUNPK(oduPackUInt8, &param->isSpsEnabled, mBuf);
5942    
5943    return ROK;
5944 }
5945
5946
5947 /***********************************************************
5948 *
5949 *     Func : cmPkRgrDlLchCfg
5950 *
5951 *
5952 *     Desc : Logical channel configuration info for downlink logical channels
5953 *
5954 *
5955 *     Ret  : S16
5956 *
5957 *     Notes:
5958 *
5959 *     File  : 
5960 *
5961 **********************************************************/
5962 S16 cmPkRgrDlLchCfg
5963 (
5964 RgrDlLchCfg *param,
5965 Buffer *mBuf
5966 )
5967 {
5968
5969 /*rgr_c_001.main_7 - Added support for SPS*/
5970
5971    CMCHKPK(oduUnpackUInt8, param->rlcReorderTmr, mBuf);
5972    CMCHKPK(cmPkRgrLchSpsCfg, &param->dlSpsCfg, mBuf);
5973    CMCHKPK(cmPkRgrLchQosCfg, &param->dlQos, mBuf);
5974    CMCHKPK(oduUnpackUInt8, param->dlTrchType, mBuf);
5975    return ROK;
5976 }
5977
5978
5979 \f
5980 /***********************************************************
5981 *
5982 *     Func : cmUnpkRgrDlLchCfg
5983 *
5984 *
5985 *     Desc : Logical channel configuration info for downlink logical channels
5986 *
5987 *
5988 *     Ret  : S16
5989 *
5990 *     Notes:
5991 *
5992 *     File  : 
5993 *
5994 **********************************************************/
5995 S16 cmUnpkRgrDlLchCfg
5996 (
5997 RgrDlLchCfg *param,
5998 Buffer *mBuf
5999 )
6000 {
6001
6002
6003    CMCHKUNPK(oduPackUInt8, &param->dlTrchType, mBuf);
6004    CMCHKUNPK(cmUnpkRgrLchQosCfg, &param->dlQos, mBuf);
6005    /*rgr_c_001.main_7 - Added support for SPs*/
6006    CMCHKUNPK(cmUnpkRgrLchSpsCfg, &param->dlSpsCfg, mBuf);
6007    CMCHKUNPK(oduPackUInt8, &param->rlcReorderTmr, mBuf);
6008
6009    return ROK;
6010 }
6011
6012
6013 /*rgr_c_001.main_9 ADD added changes for L2 measurements*/
6014 #ifdef LTE_L2_MEAS
6015
6016 \f
6017 /***********************************************************
6018 *
6019 *     Func : cmPkRgrUlLchCfg
6020 *
6021 *
6022 *     Desc : Logical channel configuration information for uplink logical channels
6023 *
6024 *
6025 *     Ret  : S16
6026 *
6027 *     Notes:
6028 *
6029 *     File  : 
6030 *
6031 **********************************************************/
6032 S16 cmPkRgrUlLchCfg
6033 (
6034 RgrUlLchCfg *param,
6035 Buffer *mBuf
6036 )
6037 {
6038
6039
6040    CMCHKPK(oduUnpackUInt8, param->qci, mBuf);
6041    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
6042    return ROK;
6043 }
6044
6045
6046 \f
6047 /*rgr_c_001.main_9 ADD added changes for L2 measurements*/
6048 /***********************************************************
6049 *
6050 *     Func : cmUnpkRgrUlLchCfg
6051 *
6052 *
6053 *     Desc : Logical channel configuration information for uplink logical channels
6054 *
6055 *
6056 *     Ret  : S16
6057 *
6058 *     Notes:
6059 *
6060 *     File  : 
6061 *
6062 **********************************************************/
6063 S16 cmUnpkRgrUlLchCfg
6064 (
6065 RgrUlLchCfg *param,
6066 Buffer *mBuf
6067 )
6068 {
6069
6070
6071    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
6072    CMCHKUNPK(oduPackUInt8, &param->qci, mBuf);
6073    return ROK;
6074 }
6075
6076
6077 #endif
6078 \f
6079 /***********************************************************
6080 *
6081 *     Func : cmPkRgrUlLcgCfg
6082 *
6083 *
6084 *     Desc : Logical channel configuration info for uplink logical channels
6085 *
6086 *
6087 *     Ret  : S16
6088 *
6089 *     Notes:
6090 *
6091 *     File  : 
6092 *
6093 **********************************************************/
6094 S16 cmPkRgrUlLcgCfg
6095 (
6096 RgrUlLcgCfg *param,
6097 Buffer *mBuf
6098 )
6099 {
6100
6101 /*rgr_c_001.main_9 ADD added changes for L2 measurements*/
6102 #ifdef LTE_L2_MEAS
6103    S32 i;
6104 #endif
6105    CMCHKPK(oduUnpackUInt32, param->mbr, mBuf);
6106    CMCHKPK(oduUnpackUInt32, param->gbr, mBuf);
6107
6108 /*rgr_c_001.main_9 ADD added changes for L2 measurements*/
6109 #ifdef LTE_L2_MEAS
6110    for (i = param->numLch - 1; i >= 0; i--)
6111    {
6112       CMCHKPK(cmPkRgrUlLchCfg, &param->lchUlCfg[i], mBuf);
6113    }
6114    CMCHKPK(oduUnpackUInt8, param->numLch, mBuf);
6115 #endif
6116    CMCHKPK(oduUnpackUInt8, param->lcgId, mBuf);
6117    return ROK;
6118 }
6119
6120
6121 \f
6122 /***********************************************************
6123 *
6124 *     Func : cmUnpkRgrUlLcgCfg
6125 *
6126 *
6127 *     Desc : Logical channel configuration info for uplink logical channels
6128 *
6129 *
6130 *     Ret  : S16
6131 *
6132 *     Notes:
6133 *
6134 *     File  : 
6135 *
6136 **********************************************************/
6137 S16 cmUnpkRgrUlLcgCfg
6138 (
6139 RgrUlLcgCfg *param,
6140 Buffer *mBuf
6141 )
6142 {
6143
6144 /*rgr_c_001.main_9 ADD added changes for L2 measurements*/
6145 #ifdef LTE_L2_MEAS
6146    S32 i;
6147 #endif
6148
6149    CMCHKUNPK(oduPackUInt8, &param->lcgId, mBuf);
6150 /*rgr_c_001.main_9 ADD added changes for L2 measurements*/
6151 #ifdef LTE_L2_MEAS
6152    CMCHKUNPK(oduPackUInt8, &param->numLch, mBuf);
6153    for (i = 0; i< param->numLch; i++)
6154    {
6155       CMCHKUNPK(cmUnpkRgrUlLchCfg, &param->lchUlCfg[i], mBuf);
6156    }
6157
6158 #endif
6159    CMCHKUNPK(oduPackUInt32, &param->gbr, mBuf);
6160    CMCHKUNPK(oduPackUInt32, &param->mbr, mBuf);
6161    return ROK;
6162 }
6163
6164 S16 cmPkRgrUlLchQciCfg
6165 (
6166 RgrUlLchQciCfg *param,
6167 Buffer *mBuf
6168 )
6169 {
6170    CMCHKPK(oduUnpackUInt8, param->lcId, mBuf);
6171    CMCHKPK(oduUnpackUInt8, param->qci, mBuf);
6172    CMCHKPK(oduUnpackUInt8, param->lcgId, mBuf);
6173    return ROK;
6174 }
6175 S16 cmUnpkRgrUlLchQciCfg
6176 (
6177 RgrUlLchQciCfg *param,
6178 Buffer *mBuf
6179 )
6180 {
6181    CMCHKUNPK(oduPackUInt8, &param->lcgId, mBuf);
6182    CMCHKUNPK(oduPackUInt8, &param->qci, mBuf);
6183    CMCHKUNPK(oduPackUInt8, &param->lcId, mBuf);
6184    return ROK;
6185 }
6186
6187 \f
6188 /***********************************************************
6189 *
6190 *     Func : cmPkRgrLchCfg
6191 *
6192 *
6193 *     Desc : Logical channel configuration info for dedicated channels
6194 *
6195 *
6196 *     Ret  : S16
6197 *
6198 *     Notes:
6199 *
6200 *     File  : 
6201 *
6202 **********************************************************/
6203 S16 cmPkRgrLchCfg
6204 (
6205 RgrLchCfg *param,
6206 Buffer *mBuf
6207 )
6208 {
6209
6210    CMCHKPK(oduUnpackUInt8, param->lcgId, mBuf);
6211    CMCHKPK(cmPkRgrUlLchQciCfg, &param->ulLchQciInfo, mBuf);
6212    CMCHKPK(cmPkRgrDlLchCfg, &param->dlInfo, mBuf);
6213    CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
6214    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
6215    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
6216    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
6217    return ROK;
6218 }
6219
6220
6221 \f
6222 /***********************************************************
6223 *
6224 *     Func : cmUnpkRgrLchCfg
6225 *
6226 *
6227 *     Desc : Logical channel configuration info for dedicated channels
6228 *
6229 *
6230 *     Ret  : S16
6231 *
6232 *     Notes:
6233 *
6234 *     File  : 
6235 *
6236 **********************************************************/
6237 S16 cmUnpkRgrLchCfg
6238 (
6239 RgrLchCfg *param,
6240 Buffer *mBuf
6241 )
6242 {
6243
6244
6245    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
6246    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
6247    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
6248    CMCHKUNPK(cmUnpkLteLcType, &param->lcType, mBuf);
6249    CMCHKUNPK(cmUnpkRgrDlLchCfg, &param->dlInfo, mBuf);
6250    CMCHKUNPK(cmUnpkRgrUlLchQciCfg, &param->ulLchQciInfo, mBuf);
6251    CMCHKUNPK(oduPackUInt8, &param->lcgId, mBuf);
6252    return ROK;
6253 }
6254
6255
6256 S16 cmPkRgrLcgCfg
6257 (
6258 RgrLcgCfg *param,
6259 Buffer *mBuf
6260 )
6261 {
6262
6263
6264    CMCHKPK(cmPkRgrUlLcgCfg, &param->ulInfo, mBuf);
6265    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
6266    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
6267    return ROK;
6268 }
6269
6270
6271 S16 cmUnpkRgrLcgCfg
6272 (
6273 RgrLcgCfg *param,
6274 Buffer *mBuf
6275 )
6276 {
6277
6278
6279    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
6280    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
6281    CMCHKUNPK(cmUnpkRgrUlLcgCfg, &param->ulInfo, mBuf);
6282    return ROK;
6283 }
6284
6285
6286 \f
6287 /***********************************************************
6288 *
6289 *     Func : cmPkRgrCfg
6290 *
6291 *
6292 *     Desc : Basic Configuration structure at RRM
6293 *
6294 *
6295 *     Ret  : S16
6296 *
6297 *     Notes:
6298 *
6299 *     File  : 
6300 *
6301 **********************************************************/
6302 S16 cmPkRgrCfg
6303 (
6304 RgrCfg *param,
6305 Buffer *mBuf
6306 )
6307 {
6308
6309
6310       switch(param->cfgType) {
6311          case RGR_LCG_CFG:
6312             CMCHKPK(cmPkRgrLcgCfg, &param->u.lcgCfg, mBuf);
6313             break;
6314          case RGR_LCH_CFG:
6315             CMCHKPK(cmPkRgrLchCfg, &param->u.lchCfg, mBuf);
6316             break;
6317          case RGR_UE_CFG:
6318             CMCHKPK(cmPkRgrUeCfg, &param->u.ueCfg, mBuf);
6319             break;
6320          case RGR_CELL_CFG:
6321             CMCHKPK(cmPkRgrCellCfg, &param->u.cellCfg, mBuf);
6322             break;
6323          case MAC_GNB_CFG:
6324             CMCHKPK(cmPkMacSchedGnbCfg, &param->u.schedGnbCfg, mBuf);
6325             break;
6326          default :
6327             return RFAILED;
6328       }
6329    CMCHKPK(oduUnpackUInt8, param->cfgType, mBuf);
6330    return ROK;
6331 }
6332
6333
6334 \f
6335 /***********************************************************
6336 *
6337 *     Func : cmUnpkRgrCfg
6338 *
6339 *
6340 *     Desc : Basic Configuration structure at RRM
6341 *
6342 *
6343 *     Ret  : S16
6344 *
6345 *     Notes:
6346 *
6347 *     File  : 
6348 *
6349 **********************************************************/
6350 S16 cmUnpkRgrCfg
6351 (
6352 RgrCfg *param,
6353 Buffer *mBuf
6354 )
6355 {
6356
6357
6358    CMCHKUNPK(oduPackUInt8, &param->cfgType, mBuf);
6359       switch(param->cfgType) {
6360          case MAC_GNB_CFG:
6361             CMCHKUNPK(cmUnpkMacSchedGnbCfg, &param->u.schedGnbCfg, mBuf);
6362             break;
6363          case RGR_CELL_CFG:
6364             CMCHKUNPK(cmUnpkRgrCellCfg, &param->u.cellCfg, mBuf);
6365             break;
6366          case RGR_UE_CFG:
6367             CMCHKUNPK(cmUnpkRgrUeCfg, &param->u.ueCfg, mBuf);
6368             break;
6369          case RGR_LCH_CFG:
6370             CMCHKUNPK(cmUnpkRgrLchCfg, &param->u.lchCfg, mBuf);
6371             break;
6372          case RGR_LCG_CFG:
6373             CMCHKUNPK(cmUnpkRgrLcgCfg, &param->u.lcgCfg, mBuf);
6374             break;
6375          default :
6376             return RFAILED;
6377       }
6378    return ROK;
6379 }
6380
6381
6382 \f
6383 /***********************************************************
6384 *
6385 *     Func : cmPkRgrActvTime
6386 *
6387 *
6388 *     Desc : Activation time information
6389 *
6390 *
6391 *     Ret  : S16
6392 *
6393 *     Notes:
6394 *
6395 *     File  : 
6396 *
6397 **********************************************************/
6398 S16 cmPkRgrActvTime
6399 (
6400 RgrActvTime *param,
6401 Buffer *mBuf
6402 )
6403 {
6404
6405
6406    CMCHKPK(cmPkLteTimingInfo, &param->actvTime, mBuf);
6407    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
6408    return ROK;
6409 }
6410
6411
6412 \f
6413 /***********************************************************
6414 *
6415 *     Func : cmUnpkRgrActvTime
6416 *
6417 *
6418 *     Desc : Activation time information
6419 *
6420 *
6421 *     Ret  : S16
6422 *
6423 *     Notes:
6424 *
6425 *     File  : 
6426 *
6427 **********************************************************/
6428 S16 cmUnpkRgrActvTime
6429 (
6430 RgrActvTime *param,
6431 Buffer *mBuf
6432 )
6433 {
6434
6435
6436    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
6437    CMCHKUNPK(cmUnpkLteTimingInfo, &param->actvTime, mBuf);
6438    return ROK;
6439 }
6440
6441
6442 \f
6443 /***********************************************************
6444 *
6445 *     Func : cmPkRgrCellRecfg
6446 *
6447 *
6448 *     Desc : Cell reconfiguration structure at RRM
6449 *
6450 *
6451 *     Ret  : S16
6452 *
6453 *     Notes:
6454 *
6455 *     File  : 
6456 *
6457 **********************************************************/
6458 S16 cmPkRgrCellRecfg
6459 (
6460 RgrCellRecfg *param,
6461 Buffer *mBuf
6462 )
6463 {
6464
6465    CMCHKPK(cmPkRgrCellCntrlCmdCfg, &param->cntrlCmdCfg, mBuf);
6466    CMCHKPK(cmPkRgrCellCsgParamCfg, &param->csgParamCfg, mBuf);
6467    CMCHKPK(oduUnpackUInt8, param->isDynCfiEnb, mBuf);
6468    CMCHKPK(oduUnpackUInt8, param->isAutoCfgModeEnb, mBuf);
6469    /* LTE_ADV_FLAG_REMOVED_START */
6470    CMCHKPK(cmPkRgrCellLteAdvancedFeatureCfg, &param->rgrLteAdvCfg, mBuf);
6471    /* LTE_ADV_FLAG_REMOVED_END */
6472    CMCHKPK(oduUnpackUInt16, param->t300TmrVal, mBuf);
6473    /* rgr_c_001.main_4:MOD-Modified for SI Enhancement. */
6474 #ifdef RGR_SI_SCH
6475    CMCHKPK(cmPkRgrSiCfg, &param->siReCfg, mBuf);
6476 #endif /* RGR_SI_SCH */
6477    CMCHKPK(cmPkRgrDlfsCfg, &param->dlfsRecfg, mBuf);
6478    CMCHKPK(cmPkRgrRachCfg, &param->rachRecfg, mBuf);
6479    CMCHKPK(cmPkRgrSrsCfg, &param->srsRecfg, mBuf);
6480    CMCHKPK(cmPkRgrPucchCfg, &param->pucchRecfg, mBuf);
6481    CMCHKPK(cmPkRgrUlCmnCodeRateCfg, &param->ulCmnCodeRate, mBuf);
6482    CMCHKPK(cmPkRgrPuschSubBandCfg, &param->puschSubBand, mBuf);
6483    CMCHKPK(cmPkRgrDlCmnCodeRateCfg, &param->dlCmnCodeRate, mBuf);
6484    CMCHKPK(cmPkRgrUlTrgCqiCfg, &param->trgUlCqi, mBuf);
6485    CMCHKPK(cmPkRgrCfiCfg, &param->cfiRecfg, mBuf);
6486    CMCHKPK(cmPkRgrDlHqCfg, &param->dlHqRecfg, mBuf);
6487    CMCHKPK(cmPkRgrActvTime, &param->recfgActvTime, mBuf);
6488    CMCHKPK(oduUnpackUInt32, param->recfgTypes, mBuf);
6489    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
6490    return ROK;
6491 }
6492
6493
6494 \f
6495 /***********************************************************
6496 *
6497 *     Func : cmUnpkRgrCellRecfg
6498 *
6499 *
6500 *     Desc : Cell reconfiguration structure at RRM
6501 *
6502 *
6503 *     Ret  : S16
6504 *
6505 *     Notes:
6506 *
6507 *     File  : 
6508 *
6509 **********************************************************/
6510 S16 cmUnpkRgrCellRecfg
6511 (
6512 RgrCellRecfg *param,
6513 Buffer *mBuf
6514 )
6515 {
6516
6517
6518    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
6519    CMCHKUNPK(oduPackUInt32, &param->recfgTypes, mBuf);
6520    CMCHKUNPK(cmUnpkRgrActvTime, &param->recfgActvTime, mBuf);
6521    CMCHKUNPK(cmUnpkRgrDlHqCfg, &param->dlHqRecfg, mBuf);
6522    CMCHKUNPK(cmUnpkRgrCfiCfg, &param->cfiRecfg, mBuf);
6523    CMCHKUNPK(cmUnpkRgrUlTrgCqiCfg, &param->trgUlCqi, mBuf);
6524    CMCHKUNPK(cmUnpkRgrDlCmnCodeRateCfg, &param->dlCmnCodeRate, mBuf);
6525    CMCHKUNPK(cmUnpkRgrPuschSubBandCfg, &param->puschSubBand, mBuf);
6526    CMCHKUNPK(cmUnpkRgrUlCmnCodeRateCfg, &param->ulCmnCodeRate, mBuf);
6527    CMCHKUNPK(cmUnpkRgrPucchCfg, &param->pucchRecfg, mBuf);
6528    CMCHKUNPK(cmUnpkRgrSrsCfg, &param->srsRecfg, mBuf);
6529    CMCHKUNPK(cmUnpkRgrRachCfg, &param->rachRecfg, mBuf);
6530    CMCHKUNPK(cmUnpkRgrDlfsCfg, &param->dlfsRecfg, mBuf);
6531    /* rgr_c_001.main_4-MOD-Modified for SI Enhancement. */
6532 #ifdef RGR_SI_SCH
6533    CMCHKUNPK(cmUnpkRgrSiCfg, &param->siReCfg, mBuf);
6534 #endif /* RGR_SI_SCH */
6535    CMCHKUNPK(oduPackUInt16, &param->t300TmrVal, mBuf);
6536    /* LTE_ADV_FLAG_REMOVED_START */
6537    CMCHKUNPK(cmUnpkRgrCellLteAdvancedFeatureCfg, &param->rgrLteAdvCfg, mBuf);
6538    /* LTE_ADV_FLAG_REMOVED_END */
6539    CMCHKUNPK(oduPackUInt8, &param->isAutoCfgModeEnb, mBuf);
6540    CMCHKUNPK(oduPackUInt8, &param->isDynCfiEnb, mBuf);
6541    CMCHKUNPK(cmUnpkRgrCellCsgParamCfg, &param->csgParamCfg, mBuf);
6542    CMCHKUNPK(cmUnpkRgrCellCntrlCmdCfg, &param->cntrlCmdCfg, mBuf);
6543
6544    return ROK;
6545 }
6546
6547
6548 \f
6549 /***********************************************************
6550 *
6551 *     Func : cmPkRgrUeRecfg
6552 *
6553 *
6554 *     Desc : UE reconfiguration info
6555 *
6556 *
6557 *     Ret  : S16
6558 *
6559 *     Notes:
6560 *
6561 *     File  : 
6562 *
6563 **********************************************************/
6564 S16 cmPkRgrUeRecfg
6565 (
6566 RgrUeRecfg *param,
6567 Buffer *mBuf
6568 )
6569 {
6570
6571 #ifdef EMTC_ENABLE
6572    /* Note: As we add more members to emtcUeRecfg, 
6573       create a new function for pkUnpk */
6574    CMCHKPK(oduUnpackUInt8, param->emtcUeRecfg.isHdFddEnbld, mBuf);
6575 #endif
6576    CMCHKPK(oduUnpackUInt8, param->csgMmbrSta, mBuf);
6577   
6578    CMCHKPK(oduUnpackUInt32, param->accessStratumRls, mBuf);
6579 #ifdef LTE_ADV 
6580    CMCHKPK(oduUnpackUInt8, param->simulAckNackCQIFormat3, mBuf);
6581    CMCHKPK(cmPkRgrUeSCellAckPucchCfg, &param->sCellAckN1ResCfg,mBuf);
6582    CMCHKPK(cmPkRgrUeSecCellInfo, &param->ueSCellCfgInfo,mBuf);
6583 #endif
6584    /* LTE_ADV_FLAG_REMOVED_START */
6585    CMCHKPK(oduUnpackUInt8, param->ueLteAdvCfg.isUeCellEdge, mBuf);
6586    CMCHKPK(oduUnpackUInt8, param->ueLteAdvCfg.isAbsUe, mBuf);
6587    CMCHKPK(oduUnpackUInt32, param->ueLteAdvCfg.pres, mBuf);
6588    /* LTE_ADV_FLAG_REMOVED_END */
6589    /*ccpu00130497: Removed the duplicate packing*/
6590 #ifdef TFU_UPGRADE
6591    CMCHKPK(cmPkRgrUePdschDedCfg, &param->uePdschDedCfg, mBuf);
6592 #endif
6593    /* rgr_c_001.main_9 ccpu00117452 - MOD - Changed macro name from
6594    RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
6595 #ifdef RGR_CQI_REPT
6596    CMCHKPK(cmPkRgrUeCqiReptCfg, &param->ueCqiReptCfg, mBuf);
6597 #endif
6598
6599 /* rgr_c_001.main_8. Added changes of TFU_UPGRADE */
6600    CMCHKPK(cmPkRgrUePuschDedCfg, &param->puschDedCfg, mBuf);
6601
6602 /*rgr_c_001.main_9 ADD added changes for HDFDD*/
6603 #ifdef LTEMAC_HDFDD
6604    CMCHKPK(oduUnpackUInt8, param->isHdFddEnbld, mBuf);
6605 #endif
6606
6607 #ifdef TFU_UPGRADE
6608    CMCHKPK(cmPkRgrUeSrCfg, &param->srCfg, mBuf);
6609    CMCHKPK(cmPkRgrUeUlSrsCfg, &param->srsCfg, mBuf);
6610    CMCHKPK(cmPkRgrUePrdDlCqiCfg, &param->cqiCfg, mBuf);
6611 #endif 
6612
6613    /*rgr_c_001.main_7 - Added support for SPS*/
6614    CMCHKPK(cmPkRgrUeSpsCfg, &param->ueSpsRecfg, mBuf);
6615    CMCHKPK(cmPkRgrUeTxAntSelCfg, &param->ulTxAntSel, mBuf);
6616
6617    /* rgr_c_001.main_7 - Changes for UE category Reconfiguration */
6618    CMCHKPK(oduUnpackUInt32, param->ueCatEnum, mBuf);
6619
6620    CMCHKPK(cmPkRgrCodeBookRstCfg, &param->ueCodeBookRstRecfg, mBuf);
6621    CMCHKPK(cmPkRgrUeMeasGapCfg, &param->ueMeasGapRecfg, mBuf);
6622    CMCHKPK(cmPkRgrUeCapCfg, &param->ueCapRecfg, mBuf);
6623    CMCHKPK(cmPkRgrUeAckNackRepCfg, &param->ueAckNackRecfg, mBuf);
6624    CMCHKPK(oduUnpackUInt8, param->isTtiBundlEnabled, mBuf);
6625 /*rgr_c_001.main_9 ADD added changes for DRX*/
6626    
6627    /* Anshika - Pack only if DRX is enabled */
6628    if(TRUE == param->ueDrxRecfg.isDrxEnabled)
6629    {
6630       CMCHKPK(cmPkRgrUeDrxCfg, &param->ueDrxRecfg, mBuf);
6631    }
6632    CMCHKPK(oduUnpackUInt8, param->ueDrxRecfg.isDrxEnabled, mBuf); /* This has to be packed even if
6633                                                  DRX is disabled */
6634    CMCHKPK(cmPkRgrUeUlPwrCfg, &param->ueUlPwrRecfg, mBuf);
6635 #ifdef RGR_V1
6636    /* rgr_c_001.main_5: ccpu00112398: Added periodicBSR-timer and
6637     * retxBSR-timer */
6638    CMCHKPK(cmPkRgrUeBsrTmrCfg, &param->ueBsrTmrRecfg, mBuf);
6639 #endif
6640    CMCHKPK(cmPkRgrUeTaTmrCfg, &param->ueTaTmrRecfg, mBuf);
6641    CMCHKPK(cmPkRgrUeQosCfg, &param->ueQosRecfg, mBuf);
6642    CMCHKPK(cmPkRgrUeUlHqCfg, &param->ueUlHqRecfg, mBuf);
6643
6644 #ifndef TFU_UPGRADE
6645    CMCHKPK(cmPkRgrUePrdDlCqiCfg, &param->prdDlCqiRecfg, mBuf);
6646 #endif
6647
6648    CMCHKPK(cmPkRgrUeAprdDlCqiCfg, &param->aprdDlCqiRecfg, mBuf);
6649    CMCHKPK(cmPkRgrUeTxModeCfg, &param->txMode, mBuf);
6650    /*rgr_c_001.main_9: changing ueRecfgTypes to uint32_t */
6651    /* LTE_ADV_FLAG_REMOVED_START */
6652    /* KW fix for LTE_ADV */
6653    CMCHKPK(oduUnpackUInt32, param->ueRecfgTypes, mBuf);
6654    /* LTE_ADV_FLAG_REMOVED_END */
6655    CMCHKPK(cmPkLteRnti, param->newCrnti, mBuf);
6656    CMCHKPK(cmPkLteRnti, param->oldCrnti, mBuf);
6657    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
6658    return ROK;
6659 }
6660
6661
6662 \f
6663 /***********************************************************
6664 *
6665 *     Func : cmUnpkRgrUeRecfg
6666 *
6667 *
6668 *     Desc : UE reconfiguration info
6669 *
6670 *
6671 *     Ret  : S16
6672 *
6673 *     Notes:
6674 *
6675 *     File  : 
6676 *
6677 **********************************************************/
6678 S16 cmUnpkRgrUeRecfg
6679 (
6680 RgrUeRecfg *param,
6681 Buffer *mBuf
6682 )
6683 {
6684    uint32_t tmpEnum;
6685
6686
6687    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
6688    CMCHKUNPK(cmUnpkLteRnti, &param->oldCrnti, mBuf);
6689    CMCHKUNPK(cmUnpkLteRnti, &param->newCrnti, mBuf);
6690    /* LTE_ADV_FLAG_REMOVED_START */
6691    /*rgr_c_001.main_9: changing ueRecfgTypes to uint32_t */
6692    /* KW fix for LTE_ADV */
6693    CMCHKUNPK(oduPackUInt32, &param->ueRecfgTypes, mBuf);
6694    /* LTE_ADV_FLAG_REMOVED_END */
6695    CMCHKUNPK(cmUnpkRgrUeTxModeCfg, &param->txMode, mBuf);
6696
6697    CMCHKUNPK(cmUnpkRgrUeAprdDlCqiCfg, &param->aprdDlCqiRecfg, mBuf);
6698
6699 #ifndef TFU_UPGRADE
6700    CMCHKUNPK(cmUnpkRgrUePrdDlCqiCfg, &param->prdDlCqiRecfg, mBuf);
6701 #endif
6702
6703    CMCHKUNPK(cmUnpkRgrUeUlHqCfg, &param->ueUlHqRecfg, mBuf);
6704    CMCHKUNPK(cmUnpkRgrUeQosCfg, &param->ueQosRecfg, mBuf);
6705    CMCHKUNPK(cmUnpkRgrUeTaTmrCfg, &param->ueTaTmrRecfg, mBuf);
6706 #ifdef RGR_V1
6707    /* rgr_c_001.main_5: ccpu00112398: Added periodicBSR-timer and
6708     * retxBSR-timer */
6709    CMCHKUNPK(cmUnpkRgrUeBsrTmrCfg, &param->ueBsrTmrRecfg, mBuf);
6710 #endif
6711    CMCHKUNPK(cmUnpkRgrUeUlPwrCfg, &param->ueUlPwrRecfg, mBuf);
6712 /*rgr_c_001.main_9 ADD added changes for DRX*/
6713    
6714    /* Anshika - Unpack only if DRX is enabled */
6715    CMCHKUNPK(oduPackUInt8, &param->ueDrxRecfg.isDrxEnabled, mBuf);
6716    if(TRUE == param->ueDrxRecfg.isDrxEnabled)
6717    {
6718       CMCHKUNPK(cmUnpkRgrUeDrxCfg, &param->ueDrxRecfg, mBuf);
6719    }
6720    CMCHKUNPK(oduPackUInt8, &param->isTtiBundlEnabled, mBuf);
6721    CMCHKUNPK(cmUnpkRgrUeAckNackRepCfg, &param->ueAckNackRecfg, mBuf);
6722    CMCHKUNPK(cmUnpkRgrUeCapCfg, &param->ueCapRecfg, mBuf);
6723    CMCHKUNPK(cmUnpkRgrUeMeasGapCfg, &param->ueMeasGapRecfg, mBuf);
6724    CMCHKUNPK(cmUnpkRgrCodeBookRstCfg, &param->ueCodeBookRstRecfg, mBuf);
6725 /* rgr_c_001.main_7 - Changes for UE category Reconfiguration */
6726    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
6727    param->ueCatEnum = (CmLteUeCategory) tmpEnum;
6728    CMCHKUNPK(cmUnpkRgrUeTxAntSelCfg, &param->ulTxAntSel, mBuf);
6729    /*rgr_c_001.main_7 - Added support for SPS*/
6730    CMCHKUNPK(cmUnpkRgrUeSpsCfg, &param->ueSpsRecfg, mBuf);
6731
6732 /* rgr_c_001.main_8. Added changes of TFU_UPGRADE */
6733 #ifdef TFU_UPGRADE
6734    CMCHKUNPK(cmUnpkRgrUePrdDlCqiCfg, &param->cqiCfg, mBuf);
6735    CMCHKUNPK(cmUnpkRgrUeUlSrsCfg, &param->srsCfg, mBuf);
6736    CMCHKUNPK(cmUnpkRgrUeSrCfg, &param->srCfg, mBuf);
6737 #endif
6738
6739 /*rgr_c_001.main_9 ADD added changes for HDFDD*/
6740 #ifdef LTEMAC_HDFDD
6741    CMCHKUNPK(oduPackUInt8, &param->isHdFddEnbld, mBuf);
6742 #endif
6743
6744    CMCHKUNPK(cmUnpkRgrUePuschDedCfg, &param->puschDedCfg, mBuf);
6745
6746 /* rgr_c_001.main_9 ccpu00117452 - MOD - Changed macro name from
6747    RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
6748 #ifdef RGR_CQI_REPT
6749    CMCHKUNPK(cmUnpkRgrUeCqiReptCfg, &param->ueCqiReptCfg, mBuf);
6750 #endif
6751 #ifdef TFU_UPGRADE
6752    CMCHKUNPK(cmUnpkRgrUePdschDedCfg, &param->uePdschDedCfg, mBuf);
6753 #endif
6754
6755    /* LTE_ADV_FLAG_REMOVED_START */
6756    CMCHKUNPK(oduPackUInt32, &param->ueLteAdvCfg.pres, mBuf);
6757    CMCHKUNPK(oduPackUInt8, &param->ueLteAdvCfg.isAbsUe, mBuf);
6758    CMCHKUNPK(oduPackUInt8, &param->ueLteAdvCfg.isUeCellEdge, mBuf);
6759    /* LTE_ADV_FLAG_REMOVED_END */
6760 #ifdef LTE_ADV 
6761    CMCHKUNPK(cmUnpkRgrUeSecCellInfo, &param->ueSCellCfgInfo,mBuf);
6762    CMCHKUNPK(cmUnpkRgrUeSCellAckPucchCfg, &param->sCellAckN1ResCfg,mBuf);
6763    CMCHKUNPK(oduPackUInt8, &param->simulAckNackCQIFormat3, mBuf);
6764 #endif
6765    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->accessStratumRls, mBuf);
6766
6767    CMCHKUNPK(oduPackUInt8, &param->csgMmbrSta, mBuf);
6768 #ifdef EMTC_ENABLE
6769    CMCHKPK(oduPackUInt8, &param->emtcUeRecfg.isHdFddEnbld, mBuf);
6770 #endif
6771
6772    return ROK;
6773 }
6774
6775
6776 \f
6777 /***********************************************************
6778 *
6779 *     Func : cmPkRgrLchRecfg
6780 *
6781 *
6782 *     Desc : Logical channel reconfiguration info for dedicated channels only
6783 *
6784 *
6785 *     Ret  : S16
6786 *
6787 *     Notes:
6788 *
6789 *     File  : 
6790 *
6791 **********************************************************/
6792 S16 cmPkRgrLchRecfg
6793 (
6794 RgrLchRecfg *param,
6795 Buffer *mBuf
6796 )
6797 {
6798
6799 /*rgr_c_001.main_7 - Added support for SPS*/
6800    CMCHKPK(oduUnpackUInt8, param->lcgId, mBuf);
6801    
6802    CMCHKPK(cmPkRgrUlLchQciCfg, &param->ulLchQciInfo, mBuf);
6803    CMCHKPK(cmPkRgrLchSpsCfg, &param->dlRecfg.dlSpsRecfg, mBuf);
6804    
6805    CMCHKPK(cmPkRgrLchQosCfg, &param->dlRecfg.dlQos, mBuf);
6806    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
6807    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
6808    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
6809    return ROK;
6810 }
6811
6812
6813 \f
6814 /***********************************************************
6815 *
6816 *     Func : cmUnpkRgrLchRecfg
6817 *
6818 *
6819 *     Desc : Logical channel reconfiguration info for dedicated channels only
6820 *
6821 *
6822 *     Ret  : S16
6823 *
6824 *     Notes:
6825 *
6826 *     File  : 
6827 *
6828 **********************************************************/
6829 S16 cmUnpkRgrLchRecfg
6830 (
6831 RgrLchRecfg *param,
6832 Buffer *mBuf
6833 )
6834 {
6835
6836
6837    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
6838    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
6839    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
6840    CMCHKUNPK(cmUnpkRgrLchQosCfg, &param->dlRecfg.dlQos, mBuf);
6841       /*rgr_c_001.main_7 - Added support for SPs*/
6842    CMCHKUNPK(cmUnpkRgrLchSpsCfg, &param->dlRecfg.dlSpsRecfg, mBuf);
6843
6844    CMCHKUNPK(cmUnpkRgrUlLchQciCfg, &param->ulLchQciInfo, mBuf);   
6845    CMCHKUNPK(oduPackUInt8, &param->lcgId, mBuf);
6846    return ROK;
6847 }
6848
6849
6850 S16 cmPkRgrLcgRecfg
6851 (
6852 RgrLcgRecfg *param,
6853 Buffer *mBuf
6854 )
6855 {
6856 #ifdef RG_UNUSED
6857    S32 i;
6858 #endif
6859
6860    CMCHKPK(oduUnpackUInt32, param->ulRecfg.mbr, mBuf);
6861    CMCHKPK(oduUnpackUInt32, param->ulRecfg.gbr, mBuf);
6862 #ifdef RG_UNUSED
6863    for (i = param->ulRecfg.numLch - 1; i >= 0; i--)
6864    {
6865       CMCHKPK(cmPkRgrUlLchCfg, &param->ulRecfg.lchUlCfg[i], mBuf);
6866    }
6867    CMCHKPK(oduUnpackUInt8, param->ulRecfg.numLch, mBuf);
6868 #endif
6869    CMCHKPK(oduUnpackUInt8, param->ulRecfg.lcgId, mBuf);
6870    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
6871    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
6872    return ROK;
6873 }
6874
6875
6876 S16 cmUnpkRgrLcgRecfg
6877 (
6878 RgrLcgRecfg *param,
6879 Buffer *mBuf
6880 )
6881 {
6882 #ifdef RG_UNUSED
6883    S32 i;
6884 #endif
6885
6886    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
6887    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
6888    CMCHKUNPK(oduPackUInt8, &param->ulRecfg.lcgId, mBuf);
6889
6890 #ifdef RG_UNUSED
6891    CMCHKUNPK(oduPackUInt8, &param->ulRecfg.numLch, mBuf);
6892    for (i = 0; i < param->ulRecfg.numLch; i++)
6893    {
6894       CMCHKUNPK(cmUnpkRgrUlLchCfg, &param->ulRecfg.lchUlCfg[i], mBuf);
6895    }
6896 #endif
6897    CMCHKUNPK(oduPackUInt32, &param->ulRecfg.gbr, mBuf);
6898    CMCHKUNPK(oduPackUInt32, &param->ulRecfg.mbr, mBuf);
6899
6900    return ROK;
6901 }
6902
6903
6904 \f
6905 /***********************************************************
6906 *
6907 *     Func : cmPkRgrRecfg
6908 *
6909 *
6910 *     Desc : Basic reconfiguration structure at RRM
6911 *
6912 *
6913 *     Ret  : S16
6914 *
6915 *     Notes:
6916 *
6917 *     File  : 
6918 *
6919 **********************************************************/
6920 S16 cmPkRgrRecfg
6921 (
6922 RgrRecfg *param,
6923 Buffer *mBuf
6924 )
6925 {
6926
6927
6928       switch(param->recfgType) {
6929          case RGR_LCG_CFG:
6930             CMCHKPK(cmPkRgrLcgRecfg, &param->u.lcgRecfg, mBuf);
6931             break;
6932          case RGR_LCH_CFG:
6933             CMCHKPK(cmPkRgrLchRecfg, &param->u.lchRecfg, mBuf);
6934             break;
6935          case RGR_UE_CFG:
6936             CMCHKPK(cmPkRgrUeRecfg, &param->u.ueRecfg, mBuf);
6937             break;
6938          case RGR_CELL_CFG:
6939             CMCHKPK(cmPkRgrCellRecfg, &param->u.cellRecfg, mBuf);
6940             break;
6941          default :
6942             return RFAILED;
6943       }
6944    CMCHKPK(oduUnpackUInt8, param->recfgType, mBuf);
6945    return ROK;
6946 }
6947
6948
6949 \f
6950 /***********************************************************
6951 *
6952 *     Func : cmUnpkRgrRecfg
6953 *
6954 *
6955 *     Desc : Basic reconfiguration structure at RRM
6956 *
6957 *
6958 *     Ret  : S16
6959 *
6960 *     Notes:
6961 *
6962 *     File  : 
6963 *
6964 **********************************************************/
6965 S16 cmUnpkRgrRecfg
6966 (
6967 RgrRecfg *param,
6968 Buffer *mBuf
6969 )
6970 {
6971
6972
6973    CMCHKUNPK(oduPackUInt8, &param->recfgType, mBuf);
6974       switch(param->recfgType) {
6975          case RGR_CELL_CFG:
6976             CMCHKUNPK(cmUnpkRgrCellRecfg, &param->u.cellRecfg, mBuf);
6977             break;
6978          case RGR_UE_CFG:
6979             CMCHKUNPK(cmUnpkRgrUeRecfg, &param->u.ueRecfg, mBuf);
6980             break;
6981          case RGR_LCH_CFG:
6982             CMCHKUNPK(cmUnpkRgrLchRecfg, &param->u.lchRecfg, mBuf);
6983             break;
6984          case RGR_LCG_CFG:
6985             CMCHKUNPK(cmUnpkRgrLcgRecfg, &param->u.lcgRecfg, mBuf);
6986             break;
6987          default :
6988             return RFAILED;
6989       }
6990    return ROK;
6991 }
6992
6993 #ifdef LTE_ADV
6994 /***********************************************************
6995 *
6996 *     Func : cmPkRgrUeDlSecCellRelInfo
6997 *
6998 *
6999 *     Desc : DL Secondary Cell information of the UE
7000 *
7001 *
7002 *     Ret  : S16
7003 *
7004 *     Notes:
7005 *
7006 *     File  : 
7007 *
7008 **********************************************************/
7009 S16 cmPkRgrUeDlSecCellRelInfo
7010 (
7011 RgrUeDlSecCellRelInfo *param,
7012 Buffer *mBuf
7013 )
7014 {
7015    CMCHKPK(oduUnpackUInt16, param->sCellId, mBuf);
7016    CMCHKPK(oduUnpackUInt8, param->sCellIdx, mBuf);
7017    return ROK;
7018 }
7019 \f
7020 /***********************************************************
7021 *
7022 *     Func : cmPkRgrUeSecCellRelInfo
7023 *
7024 *
7025 *     Desc : Secondary Cell Delete information of the UE
7026 *
7027 *
7028 *     Ret  : S16
7029 *
7030 *     Notes:
7031 *
7032 *     File  : 
7033 *
7034 **********************************************************/
7035 S16 cmPkRgrUeSecCellRelInfo
7036 (
7037 RgrUeSecCellRelInfo *param,
7038 Buffer *mBuf
7039 )
7040 {
7041    S8 idx;
7042    for(idx = param->numSCells - 1; idx >= 0; idx--)
7043    {
7044       CMCHKPK(cmPkRgrUeDlSecCellRelInfo, &param->ueSCellRelDedCfg[(uint8_t)idx],mBuf);
7045    }
7046    CMCHKPK(oduUnpackUInt8, param->numSCells, mBuf);
7047
7048    return ROK;
7049 }
7050 #endif
7051
7052 \f
7053 /***********************************************************
7054 *
7055 *     Func : cmPkRgrDel
7056 *
7057 *
7058 *     Desc : Basic Delete info for MAC
7059 *
7060 *
7061 *     Ret  : S16
7062 *
7063 *     Notes:
7064 *
7065 *     File  : 
7066 *
7067 **********************************************************/
7068 S16 cmPkRgrDel
7069 (
7070 RgrDel *param,
7071 Buffer *mBuf
7072 )
7073 {
7074
7075
7076       switch(param->delType) {
7077          case RGR_LCG_CFG:
7078             CMCHKPK(oduUnpackUInt8, param->u.lcgDel.lcgId, mBuf);
7079             CMCHKPK(cmPkLteRnti, param->u.lcgDel.crnti, mBuf);
7080             CMCHKPK(cmPkLteCellId, param->u.lcgDel.cellId, mBuf);
7081          break;
7082          case RGR_LCH_CFG:
7083             CMCHKPK(oduUnpackUInt8, param->u.lchDel.lcgId, mBuf);
7084             CMCHKPK(cmPkLteLcId, param->u.lchDel.lcId, mBuf);
7085             CMCHKPK(cmPkLteRnti, param->u.lchDel.crnti, mBuf);
7086             CMCHKPK(cmPkLteCellId, param->u.lchDel.cellId, mBuf);
7087          break;
7088          case RGR_UE_CFG:
7089             CMCHKPK(cmPkLteRnti, param->u.ueDel.crnti, mBuf);
7090             CMCHKPK(cmPkLteCellId, param->u.ueDel.cellId, mBuf);
7091          break;
7092          case RGR_CELL_CFG:
7093             CMCHKPK(cmPkLteCellId, param->u.cellDel.cellId, mBuf);
7094          break;
7095 #ifdef LTE_ADV
7096          case RGR_SCELL_UE_CFG:
7097             CMCHKPK(cmPkRgrUeSecCellRelInfo, &param->u.ueScellRel.ueSCellRelCfgInfo, mBuf);
7098             CMCHKPK(oduUnpackUInt32, param->u.ueScellRel.ueDelTypes, mBuf);
7099             CMCHKPK(cmPkLteRnti, param->u.ueScellRel.crnti, mBuf);
7100             CMCHKPK(cmPkLteCellId, param->u.ueScellRel.cellId, mBuf);
7101          break;
7102 #endif
7103          default :
7104             return RFAILED;
7105       }
7106    CMCHKPK(oduUnpackUInt8, param->delType, mBuf);
7107    return ROK;
7108 }
7109
7110
7111 #ifdef LTE_ADV
7112 \f
7113 /***********************************************************
7114 *
7115 *     Func : cmUnpkRgrUeDlSecCellRelInfo
7116 *
7117 *
7118 *     Desc : DL Secondary Cell information of the UE
7119 *
7120 *
7121 *     Ret  : S16
7122 *
7123 *     Notes:
7124 *
7125 *     File  : 
7126 *
7127 **********************************************************/
7128 S16 cmUnpkRgrUeDlSecCellRelInfo
7129 (
7130 RgrUeDlSecCellRelInfo *param,
7131 Buffer *mBuf
7132 )
7133 {
7134    CMCHKUNPK(oduPackUInt8, &param->sCellIdx, mBuf);
7135    CMCHKUNPK(oduPackUInt16, &param->sCellId, mBuf);
7136    return ROK;
7137 }
7138
7139 \f
7140 /***********************************************************
7141 *
7142 *     Func : cmUnpkRgrUeSecCellRelInfo
7143 *
7144 *
7145 *     Desc : Secondary Cell information of the UE
7146 *
7147 *
7148 *     Ret  : S16
7149 *
7150 *     Notes:
7151 *
7152 *     File  : 
7153 *
7154 **********************************************************/
7155 S16 cmUnpkRgrUeSecCellRelInfo
7156 (
7157 RgrUeSecCellRelInfo *param,
7158 Buffer *mBuf
7159 )
7160 {
7161    uint8_t idx;
7162
7163    CMCHKUNPK(oduPackUInt8, &param->numSCells, mBuf);
7164
7165    for(idx = 0; idx < param->numSCells;idx++)
7166    {
7167       CMCHKUNPK(cmUnpkRgrUeDlSecCellRelInfo, &param->ueSCellRelDedCfg[idx],mBuf);
7168    }
7169    return ROK;
7170 }
7171 #endif
7172 \f
7173 /***********************************************************
7174 *
7175 *     Func : cmUnpkRgrDel
7176 *
7177 *
7178 *     Desc : Basic Delete info for MAC
7179 *
7180 *
7181 *     Ret  : S16
7182 *
7183 *     Notes:
7184 *
7185 *     File  : 
7186 *
7187 **********************************************************/
7188 S16 cmUnpkRgrDel
7189 (
7190 RgrDel *param,
7191 Buffer *mBuf
7192 )
7193 {
7194
7195
7196    CMCHKUNPK(oduPackUInt8, &param->delType, mBuf);
7197       switch(param->delType) {
7198          case RGR_CELL_CFG:
7199             CMCHKUNPK(cmUnpkLteCellId, &param->u.cellDel.cellId, mBuf);
7200          break;
7201          case RGR_UE_CFG:
7202             CMCHKUNPK(cmUnpkLteCellId, &param->u.ueDel.cellId, mBuf);
7203             CMCHKUNPK(cmUnpkLteRnti, &param->u.ueDel.crnti, mBuf);
7204          break;
7205          case RGR_LCH_CFG:
7206             CMCHKUNPK(cmUnpkLteCellId, &param->u.lchDel.cellId, mBuf);
7207             CMCHKUNPK(cmUnpkLteRnti, &param->u.lchDel.crnti, mBuf);
7208             CMCHKUNPK(cmUnpkLteLcId, &param->u.lchDel.lcId, mBuf);
7209             CMCHKUNPK(oduPackUInt8, &param->u.lchDel.lcgId, mBuf);
7210          break;
7211          case RGR_LCG_CFG:
7212             CMCHKUNPK(cmUnpkLteCellId, &param->u.lcgDel.cellId, mBuf);
7213             CMCHKUNPK(cmUnpkLteRnti, &param->u.lcgDel.crnti, mBuf);
7214             CMCHKUNPK(oduPackUInt8, &param->u.lcgDel.lcgId, mBuf);
7215          break;
7216 #ifdef LTE_ADV
7217          case RGR_SCELL_UE_CFG:
7218             CMCHKUNPK(cmUnpkLteCellId, &param->u.ueScellRel.cellId, mBuf);
7219             CMCHKUNPK(cmUnpkLteRnti, &param->u.ueScellRel.crnti, mBuf);
7220             CMCHKUNPK(oduPackUInt32, &param->u.ueScellRel.ueDelTypes, mBuf);
7221             CMCHKUNPK(cmUnpkRgrUeSecCellRelInfo, &param->u.ueScellRel.ueSCellRelCfgInfo, mBuf);
7222          break;
7223 #endif
7224          default :
7225             return RFAILED;
7226       }
7227    return ROK;
7228 }
7229 /***********************************************************
7230 *
7231 *     Func : cmPkRgrSonPrbCfg
7232 *
7233 *
7234 *     Desc : SON PRB Configuration info for MAC
7235 *
7236 *
7237 *     Ret  : S16
7238 *
7239 *     Notes:
7240 *
7241 *     File  :
7242 *
7243 **********************************************************/
7244 S16 cmPkRgrSonPrbCfg
7245 (
7246 RgrPrbCfg *param,
7247 Buffer *mBuf
7248 )
7249 {
7250    S32 count;
7251    for(count = RGR_SCH_MAX_PA_PER_PRB - 1; count >= 0; count --)
7252    {
7253       CMCHKPK(oduUnpackUInt32, param->paLevelPerPrb[count], mBuf);
7254    }
7255    for(count = param->numCellCentreUEs - 1; count >= 0; count --)
7256    {
7257       CMCHKPK(cmPkLteRnti, param->cellCentreUe[count], mBuf);
7258    } 
7259    for(count = param->numCellEdgeUEs - 1; count >= 0; count --)
7260    {
7261       CMCHKPK(cmPkLteRnti, param->cellEdgeUe[count], mBuf);
7262    }
7263    CMCHKPK(oduUnpackUInt8, param->numCellCentreUEs, mBuf);
7264    CMCHKPK(oduUnpackUInt8, param->numCellEdgeUEs, mBuf);
7265    CMCHKPK(oduUnpackUInt8, param->isSonIcicEnable, mBuf);
7266    return ROK;
7267 }
7268
7269 /***********************************************************
7270 *
7271 *     Func : cmUnpkRgrSon
7272 *
7273 *
7274 *     Desc : SON configuration info for MAC
7275 *
7276 *
7277 *     Ret  : S16
7278 *
7279 *     Notes:
7280 *
7281 *     File  :
7282 *
7283 **********************************************************/
7284 S16 cmUnpkRgrSonPrbCfg
7285 (
7286 RgrPrbCfg   *param,
7287 Buffer      *mBuf
7288 )
7289 {
7290    S32   count;
7291    CMCHKUNPK(oduPackUInt8, &param->isSonIcicEnable, mBuf);
7292    CMCHKUNPK(oduPackUInt8, &param->numCellEdgeUEs, mBuf);
7293    CMCHKUNPK(oduPackUInt8, &param->numCellCentreUEs, mBuf);
7294    for (count = 0; count < param->numCellEdgeUEs; count++)
7295    {
7296       CMCHKUNPK(cmUnpkLteRnti, &param->cellEdgeUe[count], mBuf);
7297    }
7298    for (count = 0; count < param->numCellCentreUEs; count++)
7299    {
7300       CMCHKUNPK(cmUnpkLteRnti, &param->cellCentreUe[count], mBuf);
7301    }
7302    for(count = 0; count < RGR_SCH_MAX_PA_PER_PRB; count ++)
7303    {
7304       CMCHKUNPK(oduPackUInt32,(uint32_t *) &param->paLevelPerPrb[count], mBuf);
7305    }
7306    return ROK;
7307 }
7308 /***********************************************************
7309 *
7310 *     Func : cmPkRgrSonCfg
7311 *
7312 *
7313 *     Desc : SON Configuration info for MAC
7314 *
7315 *
7316 *     Ret  : S16
7317 *
7318 *     Notes:
7319 *
7320 *     File  :
7321 *
7322 **********************************************************/
7323 S16 cmPkRgrSonCfg
7324 (
7325 RgrSonCfg *param,
7326 Buffer *mBuf
7327 )
7328 {
7329
7330    switch(param->cfgType)
7331    {
7332       case RGR_SON_PRB_CFG :
7333       CMCHKPK(cmPkRgrSonPrbCfg, &param->u.prbCfg, mBuf);
7334       break;
7335       default :
7336       return RFAILED;
7337    }
7338    CMCHKPK(oduUnpackUInt32, param->cfgType, mBuf);
7339    return ROK;
7340 }
7341
7342 /***********************************************************
7343 *
7344 *     Func : cmUnpkRgrSon
7345 *
7346 *
7347 *     Desc : SON configuration info for MAC
7348 *
7349 *
7350 *     Ret  : S16
7351 *
7352 *     Notes:
7353 *
7354 *     File  :
7355 *
7356 **********************************************************/
7357 S16 cmUnpkRgrSonCfg
7358 (
7359 RgrSonCfg   *param,
7360 Buffer      *mBuf
7361 )
7362 {
7363
7364    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->cfgType, mBuf);
7365    switch(param->cfgType)
7366    {
7367       case RGR_SON_PRB_CFG :
7368       {
7369          CMCHKUNPK(cmUnpkRgrSonPrbCfg, &param->u.prbCfg, mBuf);
7370          break;
7371          default :
7372          return RFAILED;
7373       }
7374    }
7375    return ROK;
7376 }
7377
7378 \f
7379 /***********************************************************
7380 *
7381 *     Func : cmPkRgrRst
7382 *
7383 *
7384 *     Desc : UE RESET info for MAC
7385 *
7386 *
7387 *     Ret  : S16
7388 *
7389 *     Notes:
7390 *
7391 *     File  : 
7392 *
7393 **********************************************************/
7394 S16 cmPkRgrRst
7395 (
7396 RgrRst *param,
7397 Buffer *mBuf
7398 )
7399 {
7400
7401
7402    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
7403    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
7404    return ROK;
7405 }
7406
7407
7408 \f
7409 /***********************************************************
7410 *
7411 *     Func : cmUnpkRgrRst
7412 *
7413 *
7414 *     Desc : UE RESET info for MAC
7415 *
7416 *
7417 *     Ret  : S16
7418 *
7419 *     Notes:
7420 *
7421 *     File  : 
7422 *
7423 **********************************************************/
7424 S16 cmUnpkRgrRst
7425 (
7426 RgrRst *param,
7427 Buffer *mBuf
7428 )
7429 {
7430
7431
7432    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
7433    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
7434    return ROK;
7435 }
7436 #ifdef LTE_ADV
7437 /***********************************************************
7438 *
7439 *     Func : cmUnPkRgrSCellActDeactInfo
7440 *
7441 *
7442 *     Desc : SCell Activation information of the UE
7443 *
7444 *
7445 *     Ret  : S16
7446 *
7447 *     Notes:
7448 *
7449 *     File  : 
7450 *
7451 **********************************************************/
7452 static S16 cmUnPkRgrSCellActDeactInfo
7453 (
7454 RgrSCellActDeactInfo *param,
7455 Buffer *mBuf
7456 )
7457 {
7458
7459    CMCHKUNPK(oduPackUInt8, &param->sCellIdx, mBuf);
7460    return ROK;
7461 }
7462
7463 /***********************************************************
7464 *
7465 *     Func : cmUnPkRgrSCellActDeactEvnt
7466 *
7467 *
7468 *     Desc : SCell Activation Configuration structure to SCH
7469 *
7470 *
7471 *     Ret  : S16
7472 *
7473 *     Notes:
7474 *
7475 *     File  : 
7476 *
7477 **********************************************************/
7478 S16 cmUnPkRgrSCellActDeactEvnt
7479 (
7480 RgrSCellActDeactEvnt *param,
7481 Buffer *mBuf
7482 )
7483 {
7484
7485    uint8_t idx;
7486
7487    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
7488    CMCHKUNPK(oduPackUInt8, &param->numOfSCells, mBuf);
7489
7490    for(idx = 0; idx < param->numOfSCells;idx++)
7491    {
7492       CMCHKUNPK(cmUnPkRgrSCellActDeactInfo, &param->sCellActDeactInfo[idx],mBuf);
7493    }
7494
7495    return ROK;
7496 }
7497
7498
7499 /***********************************************************
7500 *
7501 *     Func : cmPkRgrSCellActInfo
7502 *
7503 *
7504 *     Desc : SCell Activation information of the UE
7505 *
7506 *
7507 *     Ret  : S16
7508 *
7509 *     Notes:
7510 *
7511 *     File  : 
7512 *
7513 **********************************************************/
7514 static S16 cmPkRgrSCellActDeactInfo
7515 (
7516 RgrSCellActDeactInfo *param,
7517 Buffer *mBuf
7518 )
7519 {
7520
7521    CMCHKPK(oduUnpackUInt8, param->sCellIdx, mBuf);
7522
7523    return ROK;
7524 }
7525
7526 /***********************************************************
7527 *
7528 *     Func : cmPkRgrSCellActDeactEvnt
7529 *
7530 *
7531 *     Desc : Basic Configuration structure at SCH
7532 *
7533 *
7534 *     Ret  : S16
7535 *
7536 *     Notes:
7537 *
7538 *     File  : 
7539 *
7540 **********************************************************/
7541 S16 cmPkRgrSCellActDeactEvnt
7542 (
7543 RgrSCellActDeactEvnt *param,
7544 Buffer *mBuf
7545 )
7546 {
7547
7548
7549    S8 idx;
7550    for(idx = param->numOfSCells - 1; idx >= 0; idx--)
7551    {
7552       CMCHKPK(cmPkRgrSCellActDeactInfo, &param->sCellActDeactInfo[(uint8_t)idx], mBuf);
7553    }
7554
7555    CMCHKPK(oduUnpackUInt8, param->numOfSCells, mBuf);
7556    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
7557
7558    return ROK;
7559 }
7560
7561
7562 #endif /* LTE_ADV */
7563 \f
7564 /***********************************************************
7565 *
7566 *     Func : cmPkRgrCfgReqInfo
7567 *
7568 *
7569 *     Desc : Basic RGR configuration/reconfiguration info at RRM
7570 *
7571 *
7572 *     Ret  : S16
7573 *
7574 *     Notes:
7575 *
7576 *     File  : 
7577 *
7578 **********************************************************/
7579 S16 cmPkRgrCfgReqInfo
7580 (
7581 RgrCfgReqInfo *param,
7582 Buffer *mBuf
7583 )
7584 {
7585
7586
7587       switch(param->action) {
7588          case RGR_SON_CFG:
7589             CMCHKPK(cmPkRgrSonCfg, &param->u.sonCfg, mBuf);
7590             break;
7591          case RGR_RESET:
7592             CMCHKPK(cmPkRgrRst, &param->u.rstInfo, mBuf);
7593             break;
7594          case RGR_DELETE:
7595             CMCHKPK(cmPkRgrDel, &param->u.delInfo, mBuf);
7596             break;
7597          case RGR_RECONFIG:
7598             CMCHKPK(cmPkRgrRecfg, &param->u.recfgInfo, mBuf);
7599             break;
7600          case SCH_CONFIG:
7601             CMCHKPK(cmPkRgrCfg, &param->u.cfgInfo, mBuf);
7602             break;
7603 #ifdef LTE_ADV
7604          case RGR_SCELL_ACT:
7605          case RGR_SCELL_DEACT:
7606          case RGR_SCELL_READY:
7607             CMCHKPK(cmPkRgrSCellActDeactEvnt, &param->u.sCellActDeactEvnt, mBuf);
7608             break;
7609 #endif
7610          default :
7611             return RFAILED;
7612       }
7613    CMCHKPK(oduUnpackUInt8, param->action, mBuf);
7614    return ROK;
7615 }
7616
7617
7618 \f
7619 /***********************************************************
7620 *
7621 *     Func : cmUnpkRgrCfgReqInfo
7622 *
7623 *
7624 *     Desc : Basic RGR configuration/reconfiguration info at RRM
7625 *
7626 *
7627 *     Ret  : S16
7628 *
7629 *     Notes:
7630 *
7631 *     File  : 
7632 *
7633 **********************************************************/
7634 S16 cmUnpkRgrCfgReqInfo
7635 (
7636 RgrCfgReqInfo *param,
7637 Buffer *mBuf
7638 )
7639 {
7640
7641
7642    CMCHKUNPK(oduPackUInt8, &param->action, mBuf);
7643       switch(param->action) {
7644          case SCH_CONFIG:
7645             CMCHKUNPK(cmUnpkRgrCfg, &param->u.cfgInfo, mBuf);
7646             break;
7647          case RGR_RECONFIG:
7648             CMCHKUNPK(cmUnpkRgrRecfg, &param->u.recfgInfo, mBuf);
7649             break;
7650          case RGR_DELETE:
7651             CMCHKUNPK(cmUnpkRgrDel, &param->u.delInfo, mBuf);
7652             break;
7653          case RGR_RESET:
7654             CMCHKUNPK(cmUnpkRgrRst, &param->u.rstInfo, mBuf);
7655             break;
7656          case RGR_SON_CFG:
7657             CMCHKUNPK(cmUnpkRgrSonCfg, &param->u.sonCfg, mBuf);
7658             break;
7659 #ifdef LTE_ADV
7660          case RGR_SCELL_ACT:
7661          case RGR_SCELL_DEACT:
7662          case RGR_SCELL_READY:
7663             CMCHKUNPK(cmUnPkRgrSCellActDeactEvnt, &param->u.sCellActDeactEvnt, mBuf);
7664             break;
7665 #endif /* LTE_ADV */
7666          default :
7667             return RFAILED;
7668       }
7669    return ROK;
7670 }
7671 #ifdef RGR_V1
7672 /* rgr_c_001.main_5: ccpu00112398: Added periodicBSR-timer and
7673  * retxBSR-timer */
7674 /***********************************************************
7675 *
7676 *     Func : cmPkRgrUeBsrTmrCfg
7677 *
7678 *
7679 *     Desc : BSR timer configuration per UE
7680 *
7681 *
7682 *     Ret  : S16
7683 *
7684 *     Notes:
7685 *
7686 *     File  : 
7687 *
7688 **********************************************************/
7689 S16 cmPkRgrUeBsrTmrCfg
7690 (
7691 RgrUeBsrTmrCfg *param,
7692 Buffer *mBuf
7693 )
7694 {
7695
7696
7697    CMCHKPK(oduUnpackUInt16, param->prdBsrTmr, mBuf);
7698    CMCHKPK(oduUnpackUInt16, param->retxBsrTmr, mBuf);
7699    CMCHKPK(oduUnpackUInt8, param->isPrdBsrTmrPres, mBuf);
7700    return ROK;
7701 }
7702
7703 /***********************************************************
7704 *
7705 *     Func : cmUnpkRgrUeBsrTmrCfg
7706 *
7707 *
7708 *     Desc : BSR timer configuration per UE
7709 *
7710 *
7711 *     Ret  : S16
7712 *
7713 *     Notes:
7714 *
7715 *     File  : 
7716 *
7717 **********************************************************/
7718 S16 cmUnpkRgrUeBsrTmrCfg
7719 (
7720 RgrUeBsrTmrCfg *param,
7721 Buffer *mBuf
7722 )
7723 {
7724
7725
7726    CMCHKUNPK(oduPackUInt8, &param->isPrdBsrTmrPres, mBuf);
7727    CMCHKUNPK(oduPackUInt16, &param->retxBsrTmr, mBuf);
7728    CMCHKUNPK(oduPackUInt16, &param->prdBsrTmr, mBuf);
7729    return ROK;
7730 }
7731 #endif /* RGR_V1 */
7732 /* rgr_c_001.main_4-ADD-Added for SI Enhancement. */
7733 #ifdef RGR_SI_SCH
7734 /***********************************************************
7735 *
7736 *     Func : cmPkRgrSiCfgReq
7737 *
7738 *
7739 *     Desc : SI Configuration Request from RRM to MAC for 
7740 *            configuring SI
7741 *
7742 *
7743 *     Ret  : S16
7744 *
7745 *     Notes:
7746 *
7747 *     File  : 
7748 *
7749 **********************************************************/
7750 S16 cmPkRgrSiCfgReq
7751 (
7752 Pst* pst,
7753 SpId spId,
7754 RgrCfgTransId transId,
7755 RgrSiCfgReqInfo * cfgReqInfo
7756 )
7757 {
7758    Buffer *mBuf = NULLP;
7759
7760
7761    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
7762    {
7763 #if (ERRCLASS & ERRCLS_ADD_RES)
7764       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7765          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7766          (ErrVal)ERGR045, (ErrVal)0, "Packing failed");
7767 #endif
7768       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, 
7769                  sizeof(RgrSiCfgReqInfo));
7770       return RFAILED;
7771    }
7772    if (cmPkRgrSiCfgReqInfo(cfgReqInfo, mBuf) != ROK) {
7773 #if (ERRCLASS & ERRCLS_ADD_RES)
7774       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7775             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7776             (ErrVal)ERGR046, (ErrVal)0, "Packing failed");
7777 #endif
7778       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, 
7779                 sizeof(RgrSiCfgReqInfo));
7780       SPutMsg(mBuf);
7781       return RFAILED;
7782    }
7783    if (cmPkRgrCfgTransId(&transId, mBuf) != ROK) {
7784 #if (ERRCLASS & ERRCLS_ADD_RES)
7785       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7786          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7787          (ErrVal)ERGR047, (ErrVal)0, "Packing failed");
7788 #endif
7789       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, 
7790                sizeof(RgrSiCfgReqInfo));
7791       SPutMsg(mBuf);
7792       return RFAILED;
7793    }
7794    if (SPkS16(spId, mBuf) != ROK) {
7795 #if (ERRCLASS & ERRCLS_ADD_RES)
7796       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7797          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7798          (ErrVal)ERGR048, (ErrVal)0, "Packing failed");
7799 #endif
7800       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, 
7801                sizeof(RgrSiCfgReqInfo));
7802       SPutMsg(mBuf);
7803       return RFAILED;
7804    }
7805    if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, 
7806                sizeof(RgrSiCfgReqInfo)) != ROK) {
7807 #if (ERRCLASS & ERRCLS_ADD_RES)
7808       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7809             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7810             (ErrVal)ERGR049, (ErrVal)0, "Packing failed");
7811 #endif
7812       SPutMsg(mBuf);
7813       return RFAILED;
7814    }
7815
7816    pst->event = (Event) EVTRGRSICFGREQ;
7817    return (SPstTsk(pst,mBuf));
7818 }
7819 \f
7820 /***********************************************************
7821 *
7822 *     Func : cmUnpkRgrSiCfgReq
7823 *
7824 *
7825 *     Desc : SI Configuration Request from RRM to MAC for 
7826 *     configuring SI
7827 *
7828 *
7829 *     Ret  : S16
7830 *
7831 *     Notes:
7832 *
7833 *     File  : 
7834 *
7835 **********************************************************/
7836 S16 cmUnpkRgrSiCfgReq
7837 (
7838 RgrSiCfgReq func,
7839 Pst *pst,
7840 Buffer *mBuf
7841 )
7842 {
7843    SpId spId;
7844    RgrCfgTransId transId;
7845    RgrSiCfgReqInfo *cfgReqInfo;
7846    
7847
7848    if (SUnpkS16(&spId, mBuf) != ROK) {
7849       SPutMsg(mBuf);
7850 #if (ERRCLASS & ERRCLS_ADD_RES)
7851       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7852          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7853          (ErrVal)ERGR050, (ErrVal)0, "Packing failed");
7854 #endif
7855       return RFAILED;
7856    }
7857    if (cmUnpkRgrCfgTransId(&transId, mBuf) != ROK) {
7858       SPutMsg(mBuf);
7859 #if (ERRCLASS & ERRCLS_ADD_RES)
7860       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7861          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7862          (ErrVal)ERGR051, (ErrVal)0, "Packing failed");
7863 #endif
7864       return RFAILED;
7865    }
7866    if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&cfgReqInfo,
7867             sizeof(RgrSiCfgReqInfo))) != ROK) {
7868 #if (ERRCLASS & ERRCLS_ADD_RES)
7869       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7870             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7871             (ErrVal)ERGR052, (ErrVal)0, "Packing failed");
7872 #endif
7873       SPutMsg(mBuf);
7874       return RFAILED;
7875    }
7876    memset(cfgReqInfo, 0, sizeof(RgrSiCfgReqInfo));
7877    if (pst->selector == ODU_SELECTOR_LC) 
7878       if (cmUnpkRgrSiCfgReqInfo(cfgReqInfo, mBuf) != ROK) {
7879          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, 
7880                           sizeof(RgrSiCfgReqInfo));
7881          SPutMsg(mBuf);
7882 #if (ERRCLASS & ERRCLS_ADD_RES)
7883          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7884                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7885                (ErrVal)ERGR053, (ErrVal)0, "Packing failed");
7886 #endif
7887          return RFAILED;
7888       }
7889    SPutMsg(mBuf);
7890
7891    return ((*func)(pst, spId, transId, cfgReqInfo));
7892 }
7893
7894 /***********************************************************
7895 *
7896 *     Func : cmPkRgrSiCfgReqInfo
7897 *
7898 *
7899 *     Desc : Basic SI configuration/reconfiguration info at RRM
7900 *
7901 *
7902 *     Ret  : S16
7903 *
7904 *     Notes:
7905 *
7906 *     File  : 
7907 *
7908 **********************************************************/
7909 S16 cmPkRgrSiCfgReqInfo
7910 (
7911 RgrSiCfgReqInfo *param,
7912 Buffer *mBuf
7913 )
7914 {
7915   /* ccpu00111328: S16 is renamed as MsgLen */
7916    MsgLen msgLen;
7917
7918
7919    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
7920    CMCHKPK(SPkS32, param->cfgType, mBuf);
7921    CMCHKPK(oduUnpackUInt8, param->siId, mBuf);
7922
7923    if(NULLP != param->pdu)
7924    {
7925       if (SFndLenMsg(param->pdu, &msgLen) != ROK)
7926          return RFAILED;
7927       if (SCatMsg(mBuf, param->pdu, M1M2) != ROK)
7928          return RFAILED;
7929       SPutMsg(param->pdu);
7930       CMCHKPK(cmPkMsgLen, msgLen, mBuf);
7931    }
7932    /*ccpu00140789*/
7933    else
7934    {
7935       CMCHKPK(cmPkMsgLen, 0, mBuf);
7936    }
7937
7938    return ROK;
7939 }
7940 \f
7941 /***********************************************************
7942 *
7943 *     Func : cmUnpkRgrSiCfgReqInfo
7944 *
7945 *
7946 *     Desc : Basic SI configuration/reconfiguration info at RRM
7947 *
7948 *
7949 *     Ret  : S16
7950 *
7951 *     Notes:
7952 *
7953 *     File  : 
7954 *
7955 **********************************************************/
7956 S16 cmUnpkRgrSiCfgReqInfo
7957 (
7958 RgrSiCfgReqInfo *param,
7959 Buffer *mBuf
7960 )
7961 {
7962    MsgLen  msgLen, totalMsgLen;
7963    /*Merge from Mohit Changes*/
7964    S32    cfgType;
7965
7966
7967    SFndLenMsg(mBuf, &msgLen);
7968    if(msgLen > 0)
7969    {
7970       CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
7971       /*ccpu00140789*/
7972       if(msgLen > 0)
7973       {
7974          if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
7975             return RFAILED;
7976          if (SSegMsg(mBuf, totalMsgLen-msgLen, &param->pdu) != ROK)
7977             return RFAILED;
7978       }
7979       else
7980       {
7981          param->pdu = NULLP;
7982       }
7983    }
7984
7985    CMCHKUNPK(oduPackUInt8, &param->siId, mBuf);
7986    /*CMCHKUNPK(SUnpkS32, (S32 *)&param->cfgType, mBuf);*/
7987    /*Merge from Mohit Changes*/
7988    CMCHKUNPK(SUnpkS32,(S32 *)&cfgType, mBuf);
7989    param->cfgType = (RgrSiCfgType) cfgType;
7990    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
7991
7992    return ROK;
7993 }
7994
7995
7996 \f
7997 /***********************************************************
7998 *
7999 *     Func : cmPkRgrWarningSiCfgReq
8000 *
8001 *
8002 *     Desc : SI Configuration Request from RRM to MAC for 
8003 *            configuring warning SI
8004 *
8005 *
8006 *     Ret  : S16
8007 *
8008 *     Notes:
8009 *
8010 *     File  : 
8011 *
8012 **********************************************************/
8013 S16 cmPkRgrWarningSiCfgReq
8014 (
8015 Pst* pst,
8016 SpId spId,
8017 RgrCfgTransId transId,
8018 RgrWarningSiCfgReqInfo * warningSiCfgReqInfo
8019 )
8020 {
8021    Buffer *mBuf = NULLP;
8022
8023
8024    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
8025    {
8026 #if (ERRCLASS & ERRCLS_ADD_RES)
8027       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8028          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8029          (ErrVal)ERGR061, (ErrVal)0, "Packing failed");
8030 #endif
8031       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
8032                  sizeof(RgrWarningSiCfgReqInfo));
8033       return RFAILED;
8034    }
8035
8036    if (cmPkRgrWarningSiCfgReqInfo(pst, warningSiCfgReqInfo, mBuf) != ROK) 
8037    {
8038 #if (ERRCLASS & ERRCLS_ADD_RES)
8039       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8040             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8041             (ErrVal)ERGR062, (ErrVal)0, "Packing failed");
8042 #endif
8043       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
8044                 sizeof(RgrWarningSiCfgReqInfo));
8045       SPutMsg(mBuf);
8046       return RFAILED;
8047    }
8048
8049    if (cmPkRgrCfgTransId(&transId, mBuf) != ROK) 
8050    {
8051 #if (ERRCLASS & ERRCLS_ADD_RES)
8052       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8053          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8054          (ErrVal)ERGR063, (ErrVal)0, "Packing failed");
8055 #endif
8056       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
8057                sizeof(RgrWarningSiCfgReqInfo));
8058       SPutMsg(mBuf);
8059       return RFAILED;
8060    }
8061
8062    if (SPkS16(spId, mBuf) != ROK) 
8063    {
8064 #if (ERRCLASS & ERRCLS_ADD_RES)
8065       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8066          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8067          (ErrVal)ERGR064, (ErrVal)0, "Packing failed");
8068 #endif
8069       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
8070                sizeof(RgrWarningSiCfgReqInfo));
8071       SPutMsg(mBuf);
8072       return RFAILED;
8073    }
8074
8075    /* if the application wants to retain this structure, the below 
8076     * code should be removed */
8077    if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
8078                sizeof(RgrWarningSiCfgReqInfo)) != ROK) 
8079    {
8080 #if (ERRCLASS & ERRCLS_ADD_RES)
8081       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8082             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8083             (ErrVal)ERGR065, (ErrVal)0, "Packing failed");
8084 #endif
8085       SPutMsg(mBuf);
8086       return RFAILED;
8087    }
8088
8089    pst->event = (Event) EVTRGRWARNINGSICFGREQ;
8090    return (SPstTsk(pst,mBuf));
8091 }/*cmPkRgrWarningSiCfgReq*/
8092
8093 \f
8094 /***********************************************************
8095 *
8096 *     Func : cmUnpkRgrWarningSiCfgReq
8097 *
8098 *
8099 *     Desc : SI Configuration Request from RRM to MAC for  
8100 *            configuring warning SI
8101 *
8102 *
8103 *     Ret  : S16
8104 *
8105 *     Notes:
8106 *
8107 *     File  : 
8108 *
8109 **********************************************************/
8110 S16 cmUnpkRgrWarningSiCfgReq
8111 (
8112 RgrWarningSiCfgReq func,
8113 Pst *pst,
8114 Buffer *mBuf
8115 )
8116 {
8117    SpId spId;
8118    RgrCfgTransId transId;
8119    RgrWarningSiCfgReqInfo *warningSiCfgReqInfo;
8120    
8121
8122    if (SUnpkS16(&spId, mBuf) != ROK) 
8123    {
8124       SPutMsg(mBuf);
8125 #if (ERRCLASS & ERRCLS_ADD_RES)
8126       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8127          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8128          (ErrVal)ERGR066, (ErrVal)0, "Packing failed");
8129 #endif
8130       return RFAILED;
8131    }
8132
8133    if (cmUnpkRgrCfgTransId(&transId, mBuf) != ROK) 
8134    {
8135       SPutMsg(mBuf);
8136 #if (ERRCLASS & ERRCLS_ADD_RES)
8137       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8138          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8139          (ErrVal)ERGR067, (ErrVal)0, "Packing failed");
8140 #endif
8141       return RFAILED;
8142    }
8143
8144    if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&warningSiCfgReqInfo,
8145             sizeof(RgrWarningSiCfgReqInfo))) != ROK) 
8146    {
8147 #if (ERRCLASS & ERRCLS_ADD_RES)
8148       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8149             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8150             (ErrVal)ERGR068, (ErrVal)0, "Packing failed");
8151 #endif
8152       SPutMsg(mBuf);
8153       return RFAILED;
8154    }
8155
8156
8157    if (pst->selector == ODU_SELECTOR_LC)
8158    {
8159       if (cmUnpkRgrWarningSiCfgReqInfo(pst, warningSiCfgReqInfo, mBuf) != ROK) 
8160       {
8161          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
8162                           sizeof(RgrWarningSiCfgReqInfo));
8163          SPutMsg(mBuf);
8164 #if (ERRCLASS & ERRCLS_ADD_RES)
8165          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8166                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8167                (ErrVal)ERGR069, (ErrVal)0, "Packing failed");
8168 #endif
8169          return RFAILED;
8170       }
8171    }
8172    SPutMsg(mBuf);
8173
8174    return ((*func)(pst, spId, transId, warningSiCfgReqInfo));
8175 } /* cmUnpkRgrWarningSiCfgReq */
8176
8177 \f
8178 /***********************************************************
8179 *
8180 *     Func : cmPkRgrWarningSiCfgReqInfo
8181 *
8182 *
8183 *     Desc : Basic warning SI configuration/reconfiguration 
8184 *            info at RRM
8185 *
8186 *
8187 *     Ret  : S16
8188 *
8189 *     Notes:
8190 *
8191 *     File  : 
8192 *
8193 **********************************************************/
8194 S16 cmPkRgrWarningSiCfgReqInfo
8195 (
8196 Pst *pst,
8197 RgrWarningSiCfgReqInfo *param,
8198 Buffer *mBuf
8199 )
8200 {
8201    MsgLen   msgLen;
8202    uint32_t      count;
8203    CmLList  *node, *prevNode;
8204    RgrSegmentInfo   *pdu;
8205  
8206
8207    CMCHKPK(oduUnpackUInt8, param->emtcEnable, mBuf);
8208
8209    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
8210    CMCHKPK(oduUnpackUInt8, param->siId, mBuf);
8211
8212    count = param->siPduLst.count;
8213    node = param->siPduLst.last;
8214    while (node) 
8215    {
8216       pdu = (RgrSegmentInfo *)node->node;
8217       prevNode= node->prev;
8218       if(NULLP != pdu)
8219       {
8220          if (SFndLenMsg(pdu->pdu, &msgLen) != ROK)
8221             return RFAILED;
8222          if (SCatMsg(mBuf, pdu->pdu, M1M2) != ROK)
8223             return RFAILED;
8224          /* The PDU is not Released. This has to be done by 
8225           * the caller of the packing function  */
8226          CMCHKPK(cmPkMsgLen, msgLen, mBuf);
8227          SPutMsg(pdu->pdu);
8228       }
8229       cmLListDelFrm(&param->siPduLst, node);
8230       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)node, sizeof(RgrSegmentInfo));
8231       node= prevNode;
8232    }
8233    CMCHKPK(oduUnpackUInt32, count, mBuf);
8234    return ROK;
8235 }
8236
8237 \f
8238 /***********************************************************
8239 *
8240 *     Func : cmUnpkRgrWarningSiCfgReqInfo
8241 *
8242 *
8243 *     Desc : Unpack warning SI configuration info at SCH 
8244 *
8245 *
8246 *     Ret  : S16
8247 *
8248 *     Notes:
8249 *
8250 *     File  : 
8251 *
8252 **********************************************************/
8253 S16 cmUnpkRgrWarningSiCfgReqInfo
8254 (
8255 Pst *pst,
8256 RgrWarningSiCfgReqInfo *param,
8257 Buffer *mBuf
8258 )
8259 {
8260    MsgLen   msgLen, totalMsgLen;
8261    uint32_t      count, loopCnt;
8262    Buffer   *pdu;
8263    CmLList  *node;
8264
8265
8266    cmLListInit(&param->siPduLst);
8267    CMCHKUNPK(oduPackUInt32, &count, mBuf);
8268    for (loopCnt=0; loopCnt<count; loopCnt++) 
8269    {
8270       if(SFndLenMsg(mBuf, &msgLen) != ROK)
8271       {
8272          return RFAILED;
8273       } 
8274
8275       if(msgLen > 0)
8276       { 
8277          CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
8278          if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
8279          { 
8280             return RFAILED;
8281          }   
8282          if (SSegMsg(mBuf, totalMsgLen-msgLen, &pdu) != ROK)
8283          {               
8284             return RFAILED;
8285          }   
8286       }
8287       else
8288       {
8289          return RFAILED;
8290       }
8291       if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&node,
8292                   sizeof(CmLList))) != ROK)
8293          return RFAILED;
8294       node->node = (PTR)pdu;
8295       cmLListAdd2Tail(&param->siPduLst, node);
8296    }
8297
8298    CMCHKUNPK(oduPackUInt8, &param->siId, mBuf);
8299    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
8300    CMCHKPK(oduPackUInt8, &param->emtcEnable, mBuf);
8301
8302    return ROK;
8303 }
8304
8305 \f
8306 /***********************************************************
8307 *
8308 *    Func : cmPkRgrWarningSiStopReq
8309 *
8310 *    Desc : To stop the broadcast for SIB10, SIB11 and SIB12.
8311 *
8312 *     Ret  : S16
8313 *
8314 *     Notes:
8315 *
8316 *     File  : 
8317 **********************************************************/
8318 S16 cmPkRgrWarningSiStopReq
8319 (
8320 Pst           *pst,
8321 SpId          spId,
8322 RgrCfgTransId transId,
8323 uint8_t            siId
8324 )
8325 {
8326    Buffer *mBuf = NULLP;
8327
8328
8329    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
8330    {
8331 #if (ERRCLASS & ERRCLS_ADD_RES)
8332       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8333             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8334             (ErrVal)ERGR070, (ErrVal)0, "Packing failed");
8335 #endif
8336       return RFAILED;
8337    }
8338
8339    CMCHKPK(oduUnpackUInt8, siId, mBuf);
8340
8341  
8342    if (cmPkRgrCfgTransId(&transId, mBuf) != ROK) 
8343    {
8344 #if (ERRCLASS & ERRCLS_ADD_RES)
8345       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8346          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8347          (ErrVal)ERGR082, (ErrVal)0, "Packing failed");
8348 #endif
8349       SPutMsg(mBuf);
8350       return RFAILED;
8351    }
8352
8353
8354    if (SPkS16(spId, mBuf) != ROK) 
8355    {
8356 #if (ERRCLASS & ERRCLS_ADD_RES)
8357       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8358             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8359             (ErrVal)ERGR071, (ErrVal)0, "Packing failed");
8360 #endif
8361       SPutMsg(mBuf);
8362       return RFAILED;
8363    }
8364
8365    pst->event = (Event) EVTRGRWARNINGSISTOPREQ;
8366    return (SPstTsk(pst,mBuf));
8367 }/*cmPkRgrWarningSiStopReq */
8368
8369 \f
8370 /***********************************************************
8371 *
8372 *    Func : cmUnpkRgrWarningSiStopReq
8373 *
8374 *    Desc : To stop the broadcast for SIB10, SIB11 and SIB12.
8375 *
8376 *     Ret  : S16
8377 *
8378 *     Notes:
8379 *
8380 *     File  : 
8381 **********************************************************/
8382 S16 cmUnpkRgrWarningSiStopReq
8383 (
8384 RgrWarningSiStopReq func,
8385 Pst *pst,
8386 Buffer *mBuf
8387 )
8388 {
8389    SpId          spId;
8390    uint8_t            siId;
8391    RgrCfgTransId transId;
8392
8393
8394   if (SUnpkS16(&spId, mBuf) != ROK)
8395   {
8396      SPutMsg(mBuf);
8397 #if (ERRCLASS & ERRCLS_ADD_RES)
8398      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8399            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8400            (ErrVal)ERGR072, (ErrVal)0, "Packing failed");
8401 #endif
8402      return RFAILED;
8403   }
8404
8405     if (cmUnpkRgrCfgTransId(&transId, mBuf) != ROK) 
8406    {
8407       SPutMsg(mBuf);
8408 #if (ERRCLASS & ERRCLS_ADD_RES)
8409       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8410          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8411          (ErrVal)ERGR083, (ErrVal)0, "Packing failed");
8412 #endif
8413       return RFAILED;
8414    }
8415  
8416    CMCHKUNPK(oduPackUInt8, &siId, mBuf);
8417
8418    SPutMsg(mBuf);
8419
8420    return ((*func)(pst, spId, transId, siId));
8421 } /*cmUnpkRgrWarningSiStopReq */
8422
8423 \f
8424 /***********************************************************
8425 *
8426 *     Func : cmPkRgrWarningSiCfgCfm
8427 *
8428 *
8429 *     Desc : Warning SI Configuration Confirm from MAC to RRM
8430 *
8431 *
8432 *     Ret  : S16
8433 *
8434 *     Notes:
8435 *
8436 *     File  : 
8437 *
8438 **********************************************************/
8439 S16 cmPkRgrWarningSiCfgCfm
8440 (
8441 Pst*          pst,
8442 SuId          suId,
8443 RgrCfgTransId transId,
8444 uint8_t            siId,
8445 uint8_t            status
8446 )
8447 {
8448    Buffer *mBuf = NULLP;
8449
8450
8451    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
8452    {
8453 #if (ERRCLASS & ERRCLS_ADD_RES)
8454       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8455          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8456          (ErrVal)ERGR073, (ErrVal)0, "Packing failed");
8457 #endif
8458       return RFAILED;
8459    }
8460
8461    if (oduUnpackUInt8(status, mBuf) != ROK)
8462    {
8463 #if (ERRCLASS & ERRCLS_ADD_RES)
8464       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8465          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8466          (ErrVal)ERGR074, (ErrVal)0, "Packing failed");
8467 #endif
8468       SPutMsg(mBuf);
8469       return RFAILED;
8470    }
8471
8472    if (oduUnpackUInt8(siId, mBuf) != ROK)
8473    {
8474 #if (ERRCLASS & ERRCLS_ADD_RES)
8475       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8476          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8477          (ErrVal)ERGR075, (ErrVal)0, "Packing failed");
8478 #endif
8479       SPutMsg(mBuf);
8480       return RFAILED;
8481    }
8482
8483    if (cmPkRgrCfgTransId(&transId, mBuf) != ROK) 
8484    {
8485 #if (ERRCLASS & ERRCLS_ADD_RES)
8486       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8487          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8488          (ErrVal)ERGR076, (ErrVal)0, "Packing failed");
8489 #endif
8490       SPutMsg(mBuf);
8491       return RFAILED;
8492    }
8493
8494    if (SPkS16(suId, mBuf) != ROK)
8495    {
8496 #if (ERRCLASS & ERRCLS_ADD_RES)
8497       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8498          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8499          (ErrVal)ERGR077, (ErrVal)0, "Packing failed");
8500 #endif
8501       SPutMsg(mBuf);
8502       return RFAILED;
8503    }
8504
8505    pst->event = (Event) EVTRGRWARNINGSICFGCFM;
8506    return (SPstTsk(pst,mBuf));
8507 } /* cmPkRgrWarningSiCfgCfm */
8508
8509 \f
8510 /***********************************************************
8511 *
8512 *     Func : cmUnpkRgrwarningSiCfgCfm
8513 *
8514 *
8515 *     Desc : Warning SI Configuration Confirm from MAC to RRM
8516 *
8517 *
8518 *     Ret  : S16
8519 *
8520 *     Notes:
8521 *
8522 *     File  : 
8523 *
8524 **********************************************************/
8525 S16 cmUnpkRgrWarningSiCfgCfm
8526 (
8527 RgrWarningSiCfgCfm func,
8528 Pst *pst,
8529 Buffer *mBuf
8530 )
8531 {
8532    SuId          suId;
8533    uint8_t            siId;
8534    RgrCfgTransId transId;
8535    uint8_t            status;
8536
8537
8538    if (SUnpkS16(&suId, mBuf) != ROK) 
8539    {
8540       SPutMsg(mBuf);
8541 #if (ERRCLASS & ERRCLS_ADD_RES)
8542       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8543             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8544             (ErrVal)ERGR078, (ErrVal)0, "Packing failed");
8545 #endif
8546       return RFAILED;
8547    }
8548
8549    if (cmUnpkRgrCfgTransId(&transId, mBuf) != ROK) 
8550    {
8551       SPutMsg(mBuf);
8552 #if (ERRCLASS & ERRCLS_ADD_RES)
8553       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8554             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8555             (ErrVal)ERGR079, (ErrVal)0, "Packing failed");
8556 #endif
8557       return RFAILED;
8558    }
8559
8560    if (oduPackUInt8(&siId, mBuf) != ROK) 
8561    {
8562       SPutMsg(mBuf);
8563 #if (ERRCLASS & ERRCLS_ADD_RES)
8564       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8565             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8566             (ErrVal)ERGR080, (ErrVal)0, "Packing failed");
8567 #endif
8568       return RFAILED;
8569    }
8570
8571    if (oduPackUInt8(&status, mBuf) != ROK) 
8572    {
8573       SPutMsg(mBuf);
8574 #if (ERRCLASS & ERRCLS_ADD_RES)
8575       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8576             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8577             (ErrVal)ERGR081, (ErrVal)0, "Packing failed");
8578 #endif
8579       return RFAILED;
8580    }
8581    SPutMsg(mBuf);
8582    return ((*func)(pst, suId, transId, siId, status));
8583 }/* cmUnpkRgrwarningSiCfgCfm */
8584 #endif/*RGR_SI_SCH*/
8585
8586 /* LTE_ADV_FLAG_REMOVED_START */
8587 /***********************************************************
8588 *
8589 *     Func : cmPkRgrLoadInfReq
8590 *
8591 *
8592 *     Desc : LOAD INF Configuration Request from RRM to MAC for
8593 *            configuring RNTP, ABS etc
8594 *
8595 *
8596 *     Ret  : S16
8597 *
8598 *     Notes:
8599 *
8600 *     File  :
8601 *
8602 **********************************************************/
8603 S16 cmPkRgrLoadInfReq
8604 (
8605 Pst* pst,
8606 SpId spId,
8607 RgrCfgTransId transId,
8608 RgrLoadInfReqInfo * loadInfReq
8609 )
8610 {
8611    Buffer *mBuf = NULLP;
8612
8613
8614    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
8615    {
8616 #if (ERRCLASS & ERRCLS_ADD_RES)
8617       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8618          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8619          (ErrVal)ERGR045, (ErrVal)0, "Packing failed");
8620 #endif
8621       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfReq, 
8622                  sizeof(RgrLoadInfReqInfo));
8623       return RFAILED;
8624    }
8625    if (cmPkRgrLoadInfReqInfo(loadInfReq, mBuf) != ROK) {
8626 #if (ERRCLASS & ERRCLS_ADD_RES)
8627       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8628             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8629             (ErrVal)ERGR046, (ErrVal)0, "Packing failed");
8630 #endif
8631       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfReq, 
8632                 sizeof(RgrLoadInfReqInfo));
8633       SPutMsg(mBuf);
8634       return RFAILED;
8635    }
8636    if (cmPkRgrCfgTransId(&transId, mBuf) != ROK) {
8637 #if (ERRCLASS & ERRCLS_ADD_RES)
8638       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8639          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8640          (ErrVal)ERGR047, (ErrVal)0, "Packing failed");
8641 #endif
8642       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfReq, 
8643                sizeof(RgrLoadInfReqInfo));
8644       SPutMsg(mBuf);
8645       return RFAILED;
8646    }
8647    if (SPkS16(spId, mBuf) != ROK) {
8648 #if (ERRCLASS & ERRCLS_ADD_RES)
8649       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8650          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8651          (ErrVal)ERGR048, (ErrVal)0, "Packing failed");
8652 #endif
8653       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfReq, 
8654                sizeof(RgrLoadInfReqInfo));
8655       SPutMsg(mBuf);
8656       return RFAILED;
8657    }
8658    if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfReq, 
8659                sizeof(RgrLoadInfReqInfo)) != ROK) {
8660 #if (ERRCLASS & ERRCLS_ADD_RES)
8661       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8662             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8663             (ErrVal)ERGR049, (ErrVal)0, "Packing failed");
8664 #endif
8665       SPutMsg(mBuf);
8666       return RFAILED;
8667    }
8668
8669    pst->event = (Event) EVTRGRLOADINFREQ;
8670    return (SPstTsk(pst,mBuf));
8671 }
8672 \f
8673 /***********************************************************
8674 *
8675 *     Func : cmUnpkRgrLoadInfReq
8676 *
8677 *
8678 *     Desc : LOAD INF Configuration Request from RRM to MAC for 
8679 *     configuring RNTP, ABS etc
8680 *
8681 *
8682 *     Ret  : S16
8683 *
8684 *     Notes:
8685 *
8686 *     File  : 
8687 *
8688 **********************************************************/
8689 S16 cmUnpkRgrLoadInfReq
8690 (
8691 RgrLoadInfReq func,
8692 Pst *pst,
8693 Buffer *mBuf
8694 )
8695 {
8696    SpId spId;
8697    RgrCfgTransId transId;
8698    RgrLoadInfReqInfo *loadInfReq;
8699    
8700
8701    if (SUnpkS16(&spId, mBuf) != ROK) {
8702       SPutMsg(mBuf);
8703 #if (ERRCLASS & ERRCLS_ADD_RES)
8704       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8705          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8706          (ErrVal)ERGR050, (ErrVal)0, "Packing failed");
8707 #endif
8708       return RFAILED;
8709    }
8710
8711    if (cmUnpkRgrCfgTransId(&transId, mBuf) != ROK) {
8712       SPutMsg(mBuf);
8713 #if (ERRCLASS & ERRCLS_ADD_RES)
8714       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8715          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8716          (ErrVal)ERGR051, (ErrVal)0, "Packing failed");
8717 #endif
8718       return RFAILED;
8719    }
8720
8721    if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&loadInfReq,
8722             sizeof(RgrLoadInfReqInfo))) != ROK) {
8723 #if (ERRCLASS & ERRCLS_ADD_RES)
8724       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8725             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8726             (ErrVal)ERGR052, (ErrVal)0, "Packing failed");
8727 #endif
8728       SPutMsg(mBuf);
8729       return RFAILED;
8730    }
8731
8732    memset(loadInfReq, 0, sizeof(RgrLoadInfReqInfo));
8733
8734    if (pst->selector == ODU_SELECTOR_LC) 
8735       if (cmUnpkRgrLoadInfReqInfo(loadInfReq, mBuf) != ROK) {
8736          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfReq, 
8737                           sizeof(RgrLoadInfReqInfo));
8738          SPutMsg(mBuf);
8739 #if (ERRCLASS & ERRCLS_ADD_RES)
8740          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8741                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8742                (ErrVal)ERGR053, (ErrVal)0, "Packing failed");
8743 #endif
8744          return RFAILED;
8745       }
8746    SPutMsg(mBuf);
8747
8748    return ((*func)(pst, spId, transId, loadInfReq));
8749 }
8750
8751 /***********************************************************
8752 *
8753 *     Func : cmPkRgrLoadInfReqInfo
8754 *
8755 *
8756 *     Desc : Basic LOAD INF configuration/reconfiguration info at RRM
8757 *
8758 *
8759 *     Ret  : S16
8760 *
8761 *     Notes:
8762 *
8763 *     File  : 
8764 *
8765 **********************************************************/
8766 S16 cmPkRgrLoadInfReqInfo
8767 (
8768 RgrLoadInfReqInfo *param,
8769 Buffer *mBuf
8770 )
8771 {
8772
8773    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
8774    CMCHKPK(oduUnpackUInt8, param->rgrCcPHighStartRb, mBuf);
8775    CMCHKPK(oduUnpackUInt8, param->rgrCcPHighEndRb, mBuf);
8776
8777    return ROK;
8778 }
8779 \f
8780 /***********************************************************
8781 *
8782 *     Func : cmUnpkRgrLoadInfReqInfo
8783 *
8784 *
8785 *     Desc : Basic LOAD INF configuration/reconfiguration info at RRM
8786 *
8787 *
8788 *     Ret  : S16
8789 *
8790 *     Notes:
8791 *
8792 *     File  : 
8793 *
8794 **********************************************************/
8795 S16 cmUnpkRgrLoadInfReqInfo
8796 (
8797 RgrLoadInfReqInfo *param,
8798 Buffer *mBuf
8799 )
8800 {
8801
8802    CMCHKUNPK(oduPackUInt8, &param->rgrCcPHighEndRb, mBuf);
8803    CMCHKUNPK(oduPackUInt8, &param->rgrCcPHighStartRb, mBuf);
8804    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
8805
8806    return ROK;
8807 }
8808 /* LTE_ADV_FLAG_REMOVED_END */
8809
8810 /*rgr_c_001.main_9 ccpu00117452 - MOD - Changed macro name from
8811    RGR_RRM_DLPWR_CNTRL to RGR_CQI_REPT */
8812 #ifdef RGR_CQI_REPT
8813 \f
8814 /***********************************************************
8815 *
8816 *     Func : cmPkRgrUeCqiReptCfg
8817 *
8818 *
8819 *     Desc : Transaction ID between MAC and RRM
8820 *
8821 *
8822 *     Ret  : S16
8823 *
8824 *     Notes:
8825 *
8826 *     File  : 
8827 *
8828 **********************************************************/
8829 S16 cmPkRgrUeCqiReptCfg
8830 (
8831 RgrUeCqiReptCfg *param,
8832 Buffer *mBuf
8833 )
8834 {
8835
8836    CMCHKPK(oduUnpackUInt8, param->numColltdCqiRept, mBuf);
8837
8838    return ROK;
8839 }
8840
8841 \f
8842 /*rgr_c_001.main_9 ADD added changes for CQI management*/
8843 /***********************************************************
8844 *
8845 *     Func : cmUnpkRgrUeCqiReptCfg
8846 *
8847 *
8848 *     Desc : Transaction ID between MAC and RRM
8849 *
8850 *
8851 *     Ret  : S16
8852 *
8853 *     Notes:
8854 *
8855 *     File  : 
8856 *
8857 **********************************************************/
8858 S16 cmUnpkRgrUeCqiReptCfg
8859 (
8860 RgrUeCqiReptCfg *param,
8861 Buffer *mBuf
8862 )
8863 {
8864
8865    CMCHKUNPK(oduPackUInt8, &param->numColltdCqiRept, mBuf);
8866
8867    return ROK;
8868 }
8869
8870 \f
8871 /*rgr_c_001.main_9 ADD added changes for CQI management*/
8872 /***********************************************************
8873 *
8874 *     Func : cmPkRgrStaInd
8875 *
8876 *
8877 *     Desc : Packing Sta Indication sent to RRM
8878 *
8879 *
8880 *     Ret  : S16
8881 *
8882 *     Notes:
8883 *
8884 *     File  : 
8885 *
8886 **********************************************************/
8887 S16 cmPkRgrStaInd
8888 (
8889 Pst* pst,
8890 SuId suId,
8891 RgrStaIndInfo* staInd
8892 )
8893 {
8894    Buffer *mBuf = NULLP;
8895
8896    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
8897    {
8898 #if (ERRCLASS & ERRCLS_ADD_RES)
8899       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8900          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8901          (ErrVal)ERGR054, (ErrVal)0, "Packing failed");
8902 #endif
8903       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)staInd, 
8904                sizeof(RgrStaIndInfo));
8905       return RFAILED;
8906    }
8907
8908    if (cmPkRgrStaIndInfo(staInd, mBuf) != ROK) 
8909    {
8910 #if (ERRCLASS & ERRCLS_ADD_RES)
8911       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8912             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8913             (ErrVal)ERGR055, (ErrVal)0, "Packing failed");
8914 #endif
8915       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)staInd, sizeof(RgrStaIndInfo));
8916       SPutMsg(mBuf);
8917       return RFAILED;
8918    }
8919    
8920    if (SPkS16(suId, mBuf) != ROK) 
8921    {
8922 #if (ERRCLASS & ERRCLS_ADD_RES)
8923       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8924          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8925          (ErrVal)ERGR056, (ErrVal)0, "Packing failed");
8926 #endif
8927       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)staInd, 
8928                   sizeof(RgrStaIndInfo));
8929       SPutMsg(mBuf);
8930       return RFAILED;
8931    }
8932
8933    if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)staInd, 
8934                   sizeof(RgrStaIndInfo)) != ROK) 
8935    {
8936 #if (ERRCLASS & ERRCLS_ADD_RES)
8937       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8938          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8939          (ErrVal)ERGR057, (ErrVal)0, "Packing failed");
8940 #endif
8941       SPutMsg(mBuf);
8942       return RFAILED;
8943    }
8944
8945    pst->event = (Event) EVTRGRSTAIND;
8946    return (SPstTsk(pst,mBuf));
8947 }
8948
8949 /*rgr_c_001.main_9 ADD added changes for CQI management*/
8950 /***********************************************************
8951 *
8952 *     Func : cmUnpkRgrStaInd
8953 *
8954 *
8955 *     Desc : Unpacking Sta Indication sent to RRM
8956 *
8957 *     Ret  : S16
8958 *
8959 *     Notes:
8960 *
8961 *     File  : 
8962 *
8963 **********************************************************/
8964 S16 cmUnpkRgrStaInd
8965 (
8966 RgrStaInd func,
8967 Pst *pst,
8968 Buffer *mBuf
8969 )
8970 {
8971    SuId suId;
8972    RgrStaIndInfo *staInd;
8973
8974
8975    if (SUnpkS16(&suId, mBuf) != ROK)
8976    {
8977       SPutMsg(mBuf);
8978 #if (ERRCLASS & ERRCLS_ADD_RES)
8979       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8980          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8981          (ErrVal)ERGR058, (ErrVal)0, "Packing failed");
8982 #endif
8983       return RFAILED;
8984    }
8985
8986    if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&staInd,
8987                  sizeof(RgrStaIndInfo))) != ROK)
8988    {
8989 #if (ERRCLASS & ERRCLS_ADD_RES)
8990          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
8991             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
8992             (ErrVal)ERGR059, (ErrVal)0, "Packing failed");
8993 #endif
8994          SPutMsg(mBuf);
8995          return RFAILED;
8996    }
8997
8998    if (cmUnpkRgrStaIndInfo(staInd, mBuf) != ROK)
8999    {
9000       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)staInd,
9001              sizeof(RgrStaIndInfo));
9002       SPutMsg(mBuf);
9003 #if (ERRCLASS & ERRCLS_ADD_RES)
9004       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
9005          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
9006          (ErrVal)ERGR060, (ErrVal)0, "Packing failed");
9007 #endif
9008       return RFAILED;
9009    }
9010
9011    SPutMsg(mBuf);
9012    return ((*func)(pst, suId, staInd));
9013 }
9014 \f
9015 /*rgr_c_001.main_9 ADD added changes for CQI management*/
9016 /***********************************************************
9017 *
9018 *     Func : cmPkRgrStaIndInfo
9019 *
9020 *
9021 *     Desc : Packing of StaIndInfo structure 
9022 *
9023 *     Ret  : S16
9024 *
9025 *     Notes:
9026 *
9027 *     File  : 
9028 *
9029 **********************************************************/
9030 S16 cmPkRgrStaIndInfo
9031 (
9032 RgrStaIndInfo *param,
9033 Buffer *mBuf
9034 )
9035 {
9036
9037
9038    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
9039    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
9040    CMCHKPK(cmPkRgrUeCqiInfo, &param->ueCqiInfo, mBuf);
9041
9042    return ROK;
9043 }
9044 /*rgr_c_001.main_9 ADD added changes for CQI management*/
9045 /***********************************************************
9046 *
9047 *     Func : cmUnpkRgrStaIndInfo
9048 *
9049 *
9050 *     Desc : Unpacking of StaIndInfo structure 
9051 *
9052 *     Ret  : S16
9053 *
9054 *     Notes:
9055 *
9056 *     File  : 
9057 *
9058 **********************************************************/
9059 S16 cmUnpkRgrStaIndInfo
9060 (
9061 RgrStaIndInfo *param,
9062 Buffer *mBuf
9063 )
9064 {
9065
9066
9067    CMCHKUNPK(cmUnpkRgrUeCqiInfo, &param->ueCqiInfo, mBuf);
9068    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
9069    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
9070
9071    return ROK;
9072 }
9073 /*rgr_c_001.main_9 ADD added changes for CQI management*/
9074 /***********************************************************
9075 *
9076 *     Func : cmPkRgrUeCqiInfo
9077 *
9078 *
9079 *     Desc : Packing of StaIndInfo structure 
9080 *
9081 *     Ret  : S16
9082 *
9083 *     Notes:
9084 *
9085 *     File  : 
9086 *
9087 **********************************************************/
9088 S16 cmPkRgrUeCqiInfo
9089 (
9090 RgrUeCqiInfo *param,
9091 Buffer *mBuf
9092 )
9093 {
9094
9095    S16 idx;
9096
9097    for (idx = param->numCqiRept - 1; idx >= 0; idx--)
9098    {
9099       CMCHKPK(cmPkRgrUeCqiRept, &param->cqiRept[idx], mBuf);
9100    }
9101    CMCHKPK(oduUnpackUInt8, param->numCqiRept, mBuf);
9102
9103    return ROK;
9104 } /* cmPkRgrUeCqiInfo */
9105
9106 /*rgr_c_001.main_9 ADD added changes for CQI management*/
9107 /***********************************************************
9108 *
9109 *     Func : cmUnpkRgrUeCqiInfo
9110 *
9111 *
9112 *     Desc : Packing of StaIndInfo structure 
9113 *
9114 *     Ret  : S16
9115 *
9116 *     Notes:
9117 *
9118 *     File  : 
9119 *
9120 **********************************************************/
9121 S16 cmUnpkRgrUeCqiInfo
9122 (
9123 RgrUeCqiInfo *param,
9124 Buffer *mBuf
9125 )
9126 {
9127
9128    uint8_t  idx;
9129
9130    CMCHKUNPK(oduPackUInt8, &param->numCqiRept, mBuf);
9131    for (idx = 0; idx < param->numCqiRept; idx++)
9132    {
9133       CMCHKUNPK(cmUnpkRgrUeCqiRept, &param->cqiRept[idx], mBuf);
9134    }
9135
9136    return ROK;
9137 } /* cmUnpkRgrUeCqiInfo */
9138
9139 /***********************************************************
9140 *
9141 *     Func : cmPkRgrSubBandCqiInfo 
9142 *
9143 *
9144 *     Desc : Packing ofcmPkRgrSubBandCqiInfo structure 
9145 *
9146 *     Ret  : S16
9147 *
9148 *     Notes:
9149 *
9150 *     File  : 
9151 *
9152 **********************************************************/
9153 S16 cmPkRgrSubBandCqiInfo 
9154 (
9155 RgrSubBandCqiInfo *param,
9156 Buffer *mBuf
9157 )
9158 {
9159
9160
9161    CMCHKPK(oduUnpackUInt8, param->cqi[0], mBuf);
9162    CMCHKPK(oduUnpackUInt8, param->cqi[1], mBuf);
9163    CMCHKPK(oduUnpackUInt8, param->subBandIdx, mBuf);
9164
9165    return ROK;
9166 } /* cmPkRgrSubBandCqiInfo */
9167
9168 /*rgr_c_001.main_9 ADD added changes for CQI management*/
9169 /***********************************************************
9170 *
9171 *     Func : cmPkRgrUeCqiRept
9172 *
9173 *
9174 *     Desc : Packing of StaIndInfo structure 
9175 *
9176 *     Ret  : S16
9177 *
9178 *     Notes:
9179 *
9180 *     File  : 
9181 *
9182 **********************************************************/
9183 S16 cmPkRgrUeCqiRept
9184 (
9185 RgrUeCqiRept *param,
9186 Buffer *mBuf
9187 )
9188 {
9189    S8 idx;
9190    uint8_t count;
9191
9192
9193    CMCHKPK(oduUnpackUInt8, param->cqi[0], mBuf);
9194    CMCHKPK(oduUnpackUInt8, param->cqi[1], mBuf);
9195    CMCHKPK(oduUnpackUInt8, param->cqiMode, mBuf);
9196    for (idx = param->numSubBand - 1; idx >= 0; idx--)
9197    {
9198       count = idx;
9199       CMCHKPK(cmPkRgrSubBandCqiInfo, &param->sbCqiInfo[count], mBuf);
9200    }
9201    CMCHKPK(oduUnpackUInt8, param->numSubBand, mBuf);
9202    return ROK;
9203 } /* cmPkRgrUeCqiRept */
9204
9205 /***********************************************************
9206 *
9207 *     Func :cmUnpkRgrSubBandCqiInfo 
9208 *
9209 *
9210 *     Desc : Packing of cmUnpkRgrSubBandCqiInfo structure 
9211 *
9212 *     Ret  : S16
9213 *
9214 *     Notes:
9215 *
9216 *     File  : 
9217 *
9218 **********************************************************/
9219 S16 cmUnpkRgrSubBandCqiInfo 
9220 (
9221 RgrSubBandCqiInfo *param,
9222 Buffer *mBuf
9223 )
9224 {
9225
9226
9227    CMCHKUNPK(oduPackUInt8, &param->subBandIdx, mBuf);
9228    CMCHKUNPK(oduPackUInt8, &param->cqi[1], mBuf);
9229    CMCHKUNPK(oduPackUInt8, &param->cqi[0], mBuf);
9230
9231    return ROK;
9232 } /* cmUnpkRgrSubBandCqiInfo*/
9233
9234 /*rgr_c_001.main_9 ADD added changes for CQI management*/
9235 /***********************************************************
9236 *
9237 *     Func : cmUnpkRgrUeCqiRept
9238 *
9239 *
9240 *     Desc : Packing of StaIndInfo structure 
9241 *
9242 *     Ret  : S16
9243 *
9244 *     Notes:
9245 *
9246 *     File  : 
9247 *
9248 **********************************************************/
9249 S16 cmUnpkRgrUeCqiRept
9250 (
9251 RgrUeCqiRept *param,
9252 Buffer *mBuf
9253 )
9254 {
9255    uint8_t idx;
9256
9257    CMCHKUNPK(oduPackUInt8, &param->numSubBand, mBuf);
9258    for (idx = 0; idx < param->numSubBand; idx++)
9259    {
9260       CMCHKUNPK(cmUnpkRgrSubBandCqiInfo, &param->sbCqiInfo[idx], mBuf);
9261    }
9262    CMCHKUNPK(oduPackUInt8, &param->cqiMode, mBuf);
9263    CMCHKUNPK(oduPackUInt8, &param->cqi[1], mBuf);
9264    CMCHKUNPK(oduPackUInt8, &param->cqi[0], mBuf);
9265
9266    return ROK;
9267 } /* cmUnpkRgrUeCqiRept */
9268 #endif /* End of ifdef RGR_CQI_REPT */
9269
9270 /* LTE_ADV_FLAG_REMOVED_START */
9271 /***********************************************************
9272 *
9273 *     Func : cmPkRgrLoadInfInd
9274 *
9275 *
9276 *     Desc : Packing LOAD INFORMATION Indication sent to RRM
9277 *
9278 *
9279 *     Ret  : S16
9280 *
9281 *     Notes:
9282 *
9283 *     File  :
9284 *
9285 **********************************************************/
9286 S16 cmPkRgrLoadInfInd
9287 (
9288 Pst* pst,
9289 SuId suId,
9290 RgrLoadInfIndInfo* loadInfInd
9291 )
9292 {
9293    Buffer *mBuf = NULLP;
9294
9295    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
9296    {
9297 #if (ERRCLASS & ERRCLS_ADD_RES)
9298       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
9299             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
9300             (ErrVal)ERGR054, (ErrVal)0, "Packing failed");
9301 #endif
9302       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfInd,
9303             sizeof(RgrLoadInfIndInfo));
9304       return RFAILED;
9305    }
9306
9307    if (cmPkRgrLoadInfIndInfo(loadInfInd, mBuf) != ROK)
9308    {
9309 #if (ERRCLASS & ERRCLS_ADD_RES)
9310       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
9311             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
9312             (ErrVal)ERGR055, (ErrVal)0, "Packing failed");
9313 #endif
9314       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfInd,
9315             sizeof(RgrLoadInfIndInfo));
9316       SPutMsg(mBuf);
9317
9318       return RFAILED;
9319    }
9320
9321    if (SPkS16(suId, mBuf) != ROK)
9322    {
9323 #if (ERRCLASS & ERRCLS_ADD_RES)
9324       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
9325             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
9326             (ErrVal)ERGR056, (ErrVal)0, "Packing failed");
9327 #endif
9328       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfInd,
9329             sizeof(RgrLoadInfIndInfo));
9330       SPutMsg(mBuf);
9331       return RFAILED;
9332    }
9333
9334    if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfInd,
9335                   sizeof(RgrLoadInfIndInfo)) != ROK)
9336    {
9337 #if (ERRCLASS & ERRCLS_ADD_RES)
9338       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
9339             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
9340             (ErrVal)ERGR057, (ErrVal)0, "Packing failed");
9341 #endif
9342       SPutMsg(mBuf);
9343       return RFAILED;
9344    }
9345
9346    pst->event = (Event) EVTRGRLOADINFIND;
9347    return (SPstTsk(pst,mBuf));
9348 }
9349
9350 /***********************************************************
9351 *
9352 *     Func : cmUnpkRgrLoadInfInd
9353 *
9354 *
9355 *     Desc : Unpacking LOAD INFORMATION Indication sent to RRM
9356 *
9357 *     Ret  : S16
9358 *
9359 *     Notes:
9360 *
9361 *     File  :
9362 *
9363 **********************************************************/
9364 S16 cmUnpkRgrLoadInfInd
9365 (
9366 RgrLoadInfInd func,
9367 Pst *pst,
9368 Buffer *mBuf
9369 )
9370 {
9371    SuId suId;
9372    RgrLoadInfIndInfo *loadInfInd = NULLP; /* dsfr_pal_fixes ** 21-March-2013 ** SKS */
9373
9374
9375    if (SUnpkS16(&suId, mBuf) != ROK)
9376    {
9377       SPutMsg(mBuf);
9378 #if (ERRCLASS & ERRCLS_ADD_RES)
9379       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
9380          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
9381          (ErrVal)ERGR058, (ErrVal)0, "Packing failed");
9382 #endif
9383       return RFAILED;
9384    }
9385
9386    if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&loadInfInd,
9387                  sizeof(RgrLoadInfIndInfo))) != ROK)
9388    {
9389 #if (ERRCLASS & ERRCLS_ADD_RES)
9390          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
9391             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
9392             (ErrVal)ERGR059, (ErrVal)0, "Packing failed");
9393 #endif
9394          SPutMsg(mBuf);
9395          return RFAILED;
9396    }
9397
9398    /* dsfr_pal_fixes ** 22-March-2013 ** SKS */
9399    if (cmUnpkRgrLoadInfIndInfo(loadInfInd, pst, mBuf) != ROK)
9400    {
9401       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfInd,
9402              sizeof(RgrLoadInfIndInfo));
9403       SPutMsg(mBuf);
9404 #if (ERRCLASS & ERRCLS_ADD_RES)
9405       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
9406          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
9407          (ErrVal)ERGR060, (ErrVal)0, "Packing failed");
9408 #endif
9409       return RFAILED;
9410    }
9411
9412    SPutMsg(mBuf);
9413    return ((*func)(pst, suId, loadInfInd));
9414 }
9415 \f
9416
9417 /***********************************************************
9418 *
9419 *     Func : cmPkRgrLoadInfIndInfo
9420 *
9421 *
9422 *     Desc : Packing of LoadInfIndInfo structure
9423 *
9424 *     Ret  : S16
9425 *
9426 *     Notes:
9427 *
9428 *     File  : 
9429 *
9430 **********************************************************/
9431 S16 cmPkRgrLoadInfIndInfo
9432 (
9433 RgrLoadInfIndInfo *param,
9434 Buffer *mBuf
9435 )
9436 {
9437    uint8_t                     idx;
9438
9439    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
9440    CMCHKPK(oduUnpackUInt16, param->bw, mBuf);
9441    if(RGR_ABS == param->type)
9442    {
9443       for(idx = 0; idx < RGR_ABS_PATTERN_LEN; idx++)
9444       {
9445          CMCHKPK(oduUnpackUInt32, param->u.absLoadInfo[idx], mBuf);
9446       }
9447    }
9448    else
9449    {
9450       CMCHKPK(cmPkTknStrOSXL, &param->u.rntpInfo, mBuf);
9451    }
9452
9453    CMCHKPK(oduUnpackUInt32, param->type, mBuf);
9454
9455    return ROK;
9456 }
9457
9458 /***********************************************************
9459 *
9460 *     Func : cmUnpkRgrLoadInfIndInfo
9461 *
9462 *
9463 *     Desc : Unpacking of LoadInfIndInfo structure
9464 *
9465 *     Ret  : S16
9466 *
9467 *     Notes:
9468 *
9469 *     File  :
9470 *
9471 **********************************************************/
9472 S16 cmUnpkRgrLoadInfIndInfo
9473 (
9474 RgrLoadInfIndInfo *param,
9475 Pst *pst,
9476 Buffer *mBuf
9477 )
9478 {
9479    S8          idx;
9480
9481    /* dsfr_pal_fixes ** 21-March-2013 ** SKS */
9482    TknStrOSXL  *tknStr;
9483    uint16_t         ndx;
9484
9485
9486    CMCHKUNPK(oduPackUInt32, &param->type, mBuf);
9487    if(RGR_ABS == param->type)
9488    {
9489       for(idx = RGR_ABS_PATTERN_LEN -1 ; idx >= 0; idx--)
9490       {
9491          CMCHKUNPK(oduPackUInt32, &param->u.absLoadInfo[(uint8_t)idx], mBuf);
9492       }
9493    }
9494    else
9495    {
9496
9497       /* dsfr_pal_fixes ** 21-March-2013 ** SKS ** Start */
9498       tknStr = &param->u.rntpInfo;
9499
9500       CMCHKUNPK(oduPackUInt8, &tknStr->pres, mBuf);
9501
9502       if(tknStr->pres)
9503       {
9504          /* Length */
9505          CMCHKUNPK(oduPackUInt16, &tknStr->len, mBuf);
9506
9507          if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&tknStr->val,tknStr->len)) != ROK) {
9508 #if (ERRCLASS & ERRCLS_ADD_RES)
9509             SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
9510                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
9511                (ErrVal)ERGR052, (ErrVal)0, "Packing failed");
9512 #endif
9513             SPutMsg(mBuf);
9514             return RFAILED;
9515          }
9516
9517          /* Value */
9518          for (ndx = 1; ndx <= tknStr->len; ndx++)
9519          {
9520             CMCHKUNPK(oduPackUInt8, &tknStr->val[tknStr->len - ndx], mBuf);
9521          }
9522       }
9523    }
9524    /* dsfr_pal_fixes ** 21-March-2013 ** SKS ** End */
9525
9526    /* dsfr_pal_fixes ** 22-March-2013 ** SKS */
9527    CMCHKUNPK(oduPackUInt16, &param->bw, mBuf);
9528
9529    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
9530
9531    return ROK;
9532 }
9533 /* LTE_ADV_FLAG_REMOVED_END */
9534
9535 #ifdef TFU_UPGRADE 
9536 /*rgr_c_001.main_9 ADD added changes for CQI management*/
9537 /***********************************************************
9538 *
9539 *     Func : cmPkRgrUepACfg
9540 *
9541 *
9542 *     Desc : Transaction ID between MAC and RRM
9543 *
9544 *
9545 *     Ret  : S16
9546 *
9547 *     Notes:
9548 *
9549 *     File  : 
9550 *
9551 **********************************************************/
9552 S16 cmPkRgrUepACfg
9553 (
9554 RgrUepACfg *param,
9555 Buffer *mBuf
9556 )
9557 {
9558
9559    if(param->pAPrsnt)
9560    {
9561       CMCHKPK(oduUnpackUInt32, param->pA, mBuf);
9562    }
9563    CMCHKPK(oduUnpackUInt8, param->pAPrsnt, mBuf);
9564
9565    return ROK;
9566 }
9567
9568 \f
9569 /*rgr_c_001.main_9 ADD added changes for CQI management*/
9570 /***********************************************************
9571 *
9572 *     Func : cmUnpkRgrUepACfg
9573 *
9574 *
9575 *     Desc : Transaction ID between MAC and RRM
9576 *
9577 *
9578 *     Ret  : S16
9579 *
9580 *     Notes:
9581 *
9582 *     File  : 
9583 *
9584 **********************************************************/
9585 S16 cmUnpkRgrUepACfg
9586 (
9587 RgrUepACfg *param,
9588 Buffer *mBuf
9589 )
9590 {
9591    uint32_t tmpEnum;
9592
9593    CMCHKUNPK(oduPackUInt8, (uint8_t *)&param->pAPrsnt, mBuf);
9594    if (param->pAPrsnt)
9595    {
9596       CMCHKUNPK(oduPackUInt32, (uint32_t*)&tmpEnum, mBuf);
9597       param->pA = (RgrUeDlPwrCntrlPaCfg) tmpEnum;
9598    }
9599
9600    return ROK;
9601 }
9602 \f
9603 /*rgr_c_001.main_9 ADD PDSCH ded cfg*/
9604 /***********************************************************
9605 *
9606 *     Func : cmPkRgrUePdschDedCfg
9607 *
9608 *
9609 *     Desc : Transaction ID between MAC and RRM
9610 *
9611 *
9612 *     Ret  : S16
9613 *
9614 *     Notes:
9615 *
9616 *     File  : 
9617 *
9618 **********************************************************/
9619 S16 cmPkRgrUePdschDedCfg
9620 (
9621 RgrUePdschDedCfg *param,
9622 Buffer *mBuf
9623 )
9624 {
9625
9626    CMCHKPK(cmPkRgrUepACfg, &param->uepACfg, mBuf);
9627
9628    return ROK;
9629 }
9630
9631 \f
9632 /*rgr_c_001.main_9 ADD PDSCH ded cfg*/
9633 /***********************************************************
9634 *
9635 *     Func : cmUnpkRgrUePdschDedCfg
9636 *
9637 *
9638 *     Desc : Transaction ID between MAC and RRM
9639 *
9640 *
9641 *     Ret  : S16
9642 *
9643 *     Notes:
9644 *
9645 *     File  : 
9646 *
9647 **********************************************************/
9648 S16 cmUnpkRgrUePdschDedCfg
9649 (
9650 RgrUePdschDedCfg *param,
9651 Buffer *mBuf
9652 )
9653 {
9654
9655    CMCHKUNPK(cmUnpkRgrUepACfg, &param->uepACfg, mBuf);
9656
9657    return ROK;
9658 }
9659 #endif
9660 \f
9661
9662 #ifdef LTE_ADV 
9663
9664 /***********************************************************
9665 *
9666 *     Func : cmPkRgrUeUlPwrDedSCellCfg
9667 *
9668 *
9669 *     Desc : DL Secondary Cell UL PC Info
9670 *
9671 *
9672 *     Ret  : S16
9673 *
9674 *     Notes:
9675 *
9676 *     File  : 
9677 *
9678 **********************************************************/
9679 static S16 cmPkRgrUeUlPwrDedSCellCfg
9680 (
9681 RgrUeUlPwrDedSCellCfg *param,
9682 Buffer *mBuf
9683 )
9684 {
9685    CMCHKPK(oduUnpackUInt8, param->pSRSOffset, mBuf);
9686    CMCHKPK(SPkS8, param->p0UePusch, mBuf);
9687    CMCHKPK(oduUnpackUInt8, param->isDeltaMCSEnabled, mBuf);
9688    CMCHKPK(oduUnpackUInt8, param->isAccumulated, mBuf);
9689
9690    return ROK;
9691 }
9692
9693 /***********************************************************
9694 *
9695 *     Func : cmUnpkRgrUeUlPwrDedSCellCfg
9696 *
9697 *
9698 *     Desc : Uplink power configuration per UE
9699 *
9700 *
9701 *     Ret  : S16
9702 *
9703 *     Notes:
9704 *
9705 *     File  : 
9706 *
9707 **********************************************************/
9708 static S16 cmUnpkRgrUeUlPwrDedSCellCfg
9709 (
9710 RgrUeUlPwrDedSCellCfg *param,
9711 Buffer *mBuf
9712 )
9713 {
9714
9715
9716    CMCHKUNPK(oduPackUInt8, &param->isAccumulated, mBuf);
9717    CMCHKUNPK(oduPackUInt8, &param->isDeltaMCSEnabled, mBuf);
9718    CMCHKUNPK(SUnpkS8, &param->p0UePusch, mBuf);
9719    CMCHKUNPK(oduPackUInt8, &param->pSRSOffset, mBuf);
9720    return ROK;
9721 }
9722
9723
9724
9725
9726 /***********************************************************
9727 *
9728 *     Func : cmPkRgrUeSecCellCfg
9729 *
9730 *
9731 *     Desc : DL Secondary Cell information of the UE
9732 *
9733 *
9734 *     Ret  : S16
9735 *
9736 *     Notes:
9737 *
9738 *     File  : 
9739 *
9740 **********************************************************/
9741 static S16 cmPkRgrUeSecCellCfg
9742 (
9743 RgrUeSecCellCfg *param,
9744 Buffer *mBuf
9745 )
9746 {
9747    CMCHKPK(cmPkRgrUeUlPwrDedSCellCfg,&param->ueSCellUlDedPwrCfg, mBuf);
9748    CMCHKPK(oduUnpackUInt8, param->isUlCaEnabled, mBuf);
9749    CMCHKPK(cmPkRgrUeTxModeCfg, &param->txMode, mBuf);
9750 #ifdef TFU_UPGRADE
9751 /*rgr_c_001.main_9 ADD PDSCH ded cfg*/
9752    CMCHKPK(cmPkRgrUePdschDedCfg, &param->uePdschDedCfg, mBuf);
9753 #endif
9754    CMCHKPK(cmPkRgrUeDlCqiCfg,&param->ueSCellDlCqiCfg, mBuf);
9755    CMCHKPK(cmPkTknUInt32, &param->sCellDeActTmr, mBuf);
9756    CMCHKPK(oduUnpackUInt16, param->sCellId, mBuf);
9757    CMCHKPK(oduUnpackUInt8, param->sCellIdx, mBuf);
9758
9759    return ROK;
9760 }
9761
9762
9763 \f
9764 /***********************************************************
9765 *
9766 *     Func : cmPkRgrUeSecCellInfo
9767 *
9768 *
9769 *     Desc : Secondary Cell information of the UE
9770 *
9771 *
9772 *     Ret  : S16
9773 *
9774 *     Notes:
9775 *
9776 *     File  : 
9777 *
9778 **********************************************************/
9779 S16 cmPkRgrUeSecCellInfo
9780 (
9781 RgrUeSecCellInfo *param,
9782 Buffer *mBuf
9783 )
9784 {
9785    S8 idx;
9786    for(idx = param->numSCells - 1; idx >= 0; idx--)
9787    {
9788       CMCHKPK(cmPkRgrUeSecCellCfg, &param->ueSCellDedCfg[(uint8_t)idx],mBuf);
9789    }
9790
9791    CMCHKPK(oduUnpackUInt8, param->numSCells, mBuf);
9792
9793    CMCHKPK(oduUnpackUInt8, param->useExtBSRSizes, mBuf);
9794
9795    return ROK;
9796 }
9797
9798 \f
9799 /***********************************************************
9800 *
9801 *     Func : cmUnpkRgrUeSecCellCfg
9802 *
9803 *
9804 *     Desc : DL Secondary Cell information of the UE
9805 *
9806 *
9807 *     Ret  : S16
9808 *
9809 *     Notes:
9810 *
9811 *     File  : 
9812 *
9813 **********************************************************/
9814 static S16 cmUnpkRgrUeSecCellCfg
9815 (
9816 RgrUeSecCellCfg *param,
9817 Buffer *mBuf
9818 )
9819 {
9820    CMCHKUNPK(oduPackUInt8, &param->sCellIdx, mBuf);
9821    CMCHKUNPK(oduPackUInt16, &param->sCellId, mBuf);
9822    CMCHKUNPK(cmUnpkTknUInt32, &param->sCellDeActTmr, mBuf);
9823    CMCHKUNPK(cmUnpkRgrUeDlCqiCfg, &param->ueSCellDlCqiCfg, mBuf);
9824 #ifdef TFU_UPGRADE
9825    CMCHKUNPK(cmUnpkRgrUePdschDedCfg, &param->uePdschDedCfg, mBuf);
9826 #endif
9827    CMCHKUNPK(cmUnpkRgrUeTxModeCfg, &param->txMode, mBuf);
9828    CMCHKUNPK(oduPackUInt8, &param->isUlCaEnabled, mBuf);
9829    CMCHKUNPK(cmUnpkRgrUeUlPwrDedSCellCfg, &param->ueSCellUlDedPwrCfg, mBuf);
9830
9831    return ROK;
9832 }
9833
9834
9835
9836 \f
9837 /***********************************************************
9838 *
9839 *     Func : cmUnpkRgrUeSecCellInfo
9840 *
9841 *
9842 *     Desc : Secondary Cell information of the UE
9843 *
9844 *
9845 *     Ret  : S16
9846 *
9847 *     Notes:
9848 *
9849 *     File  : 
9850 *
9851 **********************************************************/
9852 S16 cmUnpkRgrUeSecCellInfo
9853 (
9854 RgrUeSecCellInfo *param,
9855 Buffer *mBuf
9856 )
9857 {
9858    uint8_t idx;
9859
9860    CMCHKUNPK(oduPackUInt8, &param->useExtBSRSizes, mBuf);
9861    CMCHKUNPK(oduPackUInt8, &param->numSCells, mBuf);
9862
9863    for(idx = 0; idx < param->numSCells;idx++)
9864    {
9865       CMCHKUNPK(cmUnpkRgrUeSecCellCfg, &param->ueSCellDedCfg[idx],mBuf);
9866    }
9867
9868    return ROK;
9869 }
9870 /* Sprint 3 */
9871 /***********************************************************
9872 *
9873 *     Func : cmPkRgrUeSCellAckPucchCfg
9874 *
9875 *
9876 *     Desc : PUCCH Configuration information of the UE
9877 *
9878 *
9879 *     Ret  : S16
9880 *
9881 *     Notes:
9882 *
9883 *     File  : 
9884 *
9885 **********************************************************/
9886 S16 cmPkRgrUeSCellAckPucchCfg
9887 (
9888 RgrUeSCellAckPucchCfg *param,
9889 Buffer *mBuf
9890 )
9891 {
9892    S8 idx;
9893
9894    if (param->pucchFormatType == RG_SCH_UCI_FORMAT1B_CS || param->pucchFormatType == RG_SCH_UCI_FORMAT1A_1B)
9895    { 
9896       for(idx = param->u.format1Bcs.sCellAckN1ResTb2Count - 1; idx >=0 ;idx--)
9897       {
9898          CMCHKPK(oduUnpackUInt16, param->u.format1Bcs.sCellAckN1ResTb2[(uint8_t)idx], mBuf);
9899       }
9900
9901       CMCHKPK(oduUnpackUInt8, param->u.format1Bcs.sCellAckN1ResTb2Count, mBuf);
9902
9903       for(idx = param->u.format1Bcs.sCellAckN1ResTb1Count - 1; idx >=0 ;idx--)
9904       {
9905          CMCHKPK(oduUnpackUInt16, param->u.format1Bcs.sCellAckN1ResTb1[(uint8_t)idx], mBuf);
9906       }
9907
9908       CMCHKPK(oduUnpackUInt8, param->u.format1Bcs.sCellAckN1ResTb1Count, mBuf);
9909    }
9910    else
9911    {
9912       for(idx = param->u.format3.sCellAckN3ResAntP1Count - 1; idx >=0 ;idx--)
9913       {
9914          CMCHKPK(oduUnpackUInt16, param->u.format3.sCellAckN3ResAntP1[(uint8_t)idx], mBuf);
9915       }
9916
9917       CMCHKPK(oduUnpackUInt8, param->u.format3.sCellAckN3ResAntP1Count, mBuf);
9918
9919       for(idx = param->u.format3.sCellAckN3ResAntP0Count- 1; idx >=0 ;idx--)
9920       {
9921          CMCHKPK(oduUnpackUInt16, param->u.format3.sCellAckN3ResAntP0[(uint8_t)idx], mBuf);
9922       }
9923
9924       CMCHKPK(oduUnpackUInt8, param->u.format3.sCellAckN3ResAntP0Count, mBuf);
9925    }
9926    CMCHKPK(oduUnpackUInt32, param->pucchFormatType, mBuf);
9927
9928    return ROK;
9929 }
9930
9931 /***********************************************************
9932 *
9933 *     Func : cmUnpkRgrUeSCellAckPucchCfg
9934 *
9935 *
9936 *     Desc : PUCCH Configuration information of the UE
9937 *
9938 *
9939 *     Ret  : S16
9940 *
9941 *     Notes:
9942 *
9943 *     File  : 
9944 *
9945 **********************************************************/
9946 S16 cmUnpkRgrUeSCellAckPucchCfg
9947 (
9948 RgrUeSCellAckPucchCfg *param,
9949 Buffer *mBuf
9950 )
9951 {
9952    uint8_t idx;
9953
9954
9955    CMCHKUNPK(oduPackUInt32, (uint32_t*)&param->pucchFormatType, mBuf);
9956    //if (param->pucchFormatType == RG_SCH_UCI_FORMAT1B_CS)
9957    if (param->pucchFormatType == RG_SCH_UCI_FORMAT1B_CS || param->pucchFormatType == RG_SCH_UCI_FORMAT1A_1B)
9958    {
9959       CMCHKUNPK(oduPackUInt8, &param->u.format1Bcs.sCellAckN1ResTb1Count, mBuf);
9960
9961       for(idx = 0; idx < param->u.format1Bcs.sCellAckN1ResTb1Count; idx++)
9962       {
9963          CMCHKUNPK(oduPackUInt16, &param->u.format1Bcs.sCellAckN1ResTb1[idx], mBuf);
9964       }
9965
9966       CMCHKUNPK(oduPackUInt8, &param->u.format1Bcs.sCellAckN1ResTb2Count, mBuf);
9967
9968       for(idx = 0; idx < param->u.format1Bcs.sCellAckN1ResTb2Count; idx++)
9969       {
9970          CMCHKUNPK(oduPackUInt16, &param->u.format1Bcs.sCellAckN1ResTb2[idx], mBuf);
9971       }
9972    }
9973    else
9974    {
9975       CMCHKUNPK(oduPackUInt8, &param->u.format3.sCellAckN3ResAntP0Count, mBuf);
9976
9977       for(idx = 0; idx < param->u.format3.sCellAckN3ResAntP0Count; idx++)
9978       {
9979          CMCHKUNPK(oduPackUInt16, &param->u.format3.sCellAckN3ResAntP0[idx], mBuf);
9980       }
9981
9982       CMCHKUNPK(oduPackUInt8, &param->u.format3.sCellAckN3ResAntP1Count, mBuf);
9983
9984       for(idx = 0; idx < param->u.format3.sCellAckN3ResAntP1Count; idx++)
9985       {
9986          CMCHKUNPK(oduPackUInt16, &param->u.format3.sCellAckN3ResAntP1[idx], mBuf);
9987       }
9988
9989    }
9990    return ROK;
9991 }
9992
9993
9994
9995
9996 #endif
9997
9998 \f
9999 /***********************************************************
10000 *
10001 *     Func : cmPkRgrUeStaInd
10002 *
10003 *
10004 *     Desc : Packing Ue Sta Indication sent to RRM
10005 *
10006 *
10007 *     Ret  : S16
10008 *
10009 *     Notes:
10010 *
10011 *     File  : 
10012 *
10013 **********************************************************/
10014 S16 cmPkRgrUeStaInd
10015 (
10016 Pst* pst,
10017 SuId suId,
10018 RgrUeStaIndInfo* ueStaInd
10019 )
10020 {
10021    Buffer *mBuf = NULLP;
10022    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
10023    {
10024 #if (ERRCLASS & ERRCLS_ADD_RES)
10025       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
10026          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
10027          (ErrVal)ERGR054, (ErrVal)0, "Packing failed");
10028 #endif
10029       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueStaInd, 
10030                sizeof(RgrUeStaIndInfo));
10031       return RFAILED;
10032    }
10033
10034    if (cmPkRgrUeStaIndInfo(ueStaInd, mBuf) != ROK) 
10035    {
10036 #if (ERRCLASS & ERRCLS_ADD_RES)
10037       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
10038             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
10039             (ErrVal)ERGR055, (ErrVal)0, "Packing failed");
10040 #endif
10041       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueStaInd, 
10042                sizeof(RgrUeStaIndInfo));
10043       SPutMsg(mBuf);
10044       return RFAILED;
10045    }
10046    
10047    if (SPkS16(suId, mBuf) != ROK) 
10048    {
10049 #if (ERRCLASS & ERRCLS_ADD_RES)
10050       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
10051          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
10052          (ErrVal)ERGR056, (ErrVal)0, "Packing failed");
10053 #endif
10054       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueStaInd, 
10055                   sizeof(RgrUeStaIndInfo));
10056       SPutMsg(mBuf);
10057       return RFAILED;
10058    }
10059
10060    if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueStaInd, 
10061                   sizeof(RgrUeStaIndInfo)) != ROK) 
10062    {
10063 #if (ERRCLASS & ERRCLS_ADD_RES)
10064       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
10065          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
10066          (ErrVal)ERGR057, (ErrVal)0, "Packing failed");
10067 #endif
10068       SPutMsg(mBuf);
10069       return RFAILED;
10070    }
10071
10072    pst->event = (Event) EVTRGRUESTAIND;
10073    return (SPstTsk(pst,mBuf));
10074 }
10075
10076 /*rgr_c_001.main_9 ADD added changes for CQI management*/
10077 /***********************************************************
10078 *
10079 *     Func : cmUnpkRgrUeStaInd
10080 *
10081 *
10082 *     Desc : Unpacking Sta Indication sent to RRM
10083 *
10084 *     Ret  : S16
10085 *
10086 *     Notes:
10087 *
10088 *     File  : 
10089 *
10090 **********************************************************/
10091 S16 cmUnpkRgrUeStaInd
10092 (
10093 RgrUeStaInd  func,
10094 Pst *pst,
10095 Buffer *mBuf
10096 )
10097 {
10098    SuId suId;
10099    RgrUeStaIndInfo *ueStaInd;
10100
10101
10102    if (SUnpkS16(&suId, mBuf) != ROK)
10103    {
10104       SPutMsg(mBuf);
10105 #if (ERRCLASS & ERRCLS_ADD_RES)
10106       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
10107          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
10108          (ErrVal)ERGR058, (ErrVal)0, "Packing failed");
10109 #endif
10110       return RFAILED;
10111    }
10112
10113    if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&ueStaInd,
10114                  sizeof(RgrUeStaIndInfo))) != ROK)
10115    {
10116 #if (ERRCLASS & ERRCLS_ADD_RES)
10117          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
10118             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
10119             (ErrVal)ERGR059, (ErrVal)0, "Packing failed");
10120 #endif
10121          SPutMsg(mBuf);
10122          return RFAILED;
10123    }
10124
10125    if (cmUnpkRgrUeStaIndInfo(ueStaInd, mBuf) != ROK)
10126    {
10127       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueStaInd,
10128              sizeof(RgrUeStaIndInfo));
10129       SPutMsg(mBuf);
10130 #if (ERRCLASS & ERRCLS_ADD_RES)
10131       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
10132          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
10133          (ErrVal)ERGR060, (ErrVal)0, "Packing failed");
10134 #endif
10135       return RFAILED;
10136    }
10137
10138    SPutMsg(mBuf);
10139    return ((*func)(pst, suId, ueStaInd));
10140 }
10141 \f
10142 /***********************************************************
10143 *
10144 *     Func : cmPkRgrUeStaIndInfo
10145 *
10146 *
10147 *     Desc : Packing of UeStaIndInfo structure 
10148 *
10149 *     Ret  : S16
10150 *
10151 *     Notes:
10152 *
10153 *     File  : 
10154 *
10155 **********************************************************/
10156 S16 cmPkRgrUeStaIndInfo
10157 (
10158 RgrUeStaIndInfo *param,
10159 Buffer *mBuf
10160 )
10161 {
10162
10163
10164    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10165    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
10166    CMCHKPK(oduUnpackUInt8, param->status, mBuf);
10167
10168    return ROK;
10169 }
10170 /***********************************************************
10171 *
10172 *     Func : cmUnpkRgrUeStaIndInfo
10173 *
10174 *
10175 *     Desc : Unpacking of UeStaIndInfo structure 
10176 *
10177 *     Ret  : S16
10178 *
10179 *     Notes:
10180 *
10181 *     File  : 
10182 *
10183 **********************************************************/
10184 S16 cmUnpkRgrUeStaIndInfo
10185 (
10186 RgrUeStaIndInfo *param,
10187 Buffer *mBuf
10188 )
10189 {
10190
10191
10192    CMCHKUNPK(oduPackUInt8, &param->status, mBuf);
10193    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
10194    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10195
10196    return ROK;
10197 }
10198
10199 \f
10200 /***********************************************************
10201 *
10202 *     Func : cmPkRgrCellCsgParamCfg 
10203 *
10204 *
10205 *     Desc : CSG Parameter configuration
10206 *
10207 *
10208 *     Ret  : S16
10209 *
10210 *     Notes:
10211 *
10212 *     File  : 
10213 *
10214 **********************************************************/
10215 S16 cmPkRgrCellCsgParamCfg 
10216 (
10217 RgrCellCsgParamCfg *param,
10218 Buffer *mBuf
10219 )
10220 {
10221
10222
10223    CMCHKPK(oduUnpackUInt8, param->minUlResNonCsg, mBuf);
10224    CMCHKPK(oduUnpackUInt8, param->minDlResNonCsg, mBuf);
10225
10226    return ROK;
10227 }
10228
10229 /***********************************************************
10230 *
10231 *     Func : cmUnpkRgrCellCsgParamCfg
10232 *
10233 *
10234 *     Desc : Unpacking of RgrCellCsgParamCfg structure 
10235 *
10236 *     Ret  : S16
10237 *
10238 *     Notes:
10239 *
10240 *     File  : 
10241 *
10242 **********************************************************/
10243 S16 cmUnpkRgrCellCsgParamCfg
10244 (
10245 RgrCellCsgParamCfg *param,
10246 Buffer *mBuf
10247 )
10248 {
10249
10250
10251    CMCHKUNPK(oduPackUInt8, &param->minDlResNonCsg, mBuf);
10252    CMCHKUNPK(oduPackUInt8, &param->minUlResNonCsg, mBuf);
10253
10254    return ROK;
10255 }
10256
10257 /***********************************************************
10258 *
10259 *     Func : cmPkRgrCellCntrlCmdCfg
10260 *
10261 *
10262 *     Desc : Packing of RgrCellCntrlCmdCfg structure 
10263 *
10264 *     Ret  : S16
10265 *
10266 *     Notes:
10267 *
10268 *     File  : 
10269 *
10270 **********************************************************/
10271 S16 cmPkRgrCellCntrlCmdCfg
10272 (
10273 RgrCellCntrlCmdCfg *param,
10274 Buffer *mBuf
10275 )
10276 {
10277
10278    switch(param->cmdType)
10279    {
10280       case RGR_CNTRL_CMD_RACH_OVRLD:
10281          CMCHKUNPK(oduUnpackUInt8, param->cmdDesc.rachOvrLd.backOffVal, mBuf);
10282          CMCHKUNPK(oduUnpackUInt8, param->cmdDesc.rachOvrLd.backOffEnb, mBuf);
10283          break;
10284       case RGR_CNTRL_CMD_CPU_OVRLD:
10285          CMCHKUNPK(oduUnpackUInt8, param->cmdDesc.cpuOvrLd.instruction, mBuf);
10286          break;
10287       default:
10288          break;
10289    }
10290    CMCHKUNPK(oduUnpackUInt32, param->cmdType, mBuf);
10291
10292    return ROK;
10293 }
10294 /***********************************************************
10295 *
10296 *     Func : cmUnpkRgrCellCntrlCmdCfg
10297 *
10298 *
10299 *     Desc : Unpacking of RgrCellCntrlCmdCfg structure 
10300 *
10301 *     Ret  : S16
10302 *
10303 *     Notes:
10304 *
10305 *     File  : 
10306 *
10307 **********************************************************/
10308 S16 cmUnpkRgrCellCntrlCmdCfg
10309 (
10310 RgrCellCntrlCmdCfg *param,
10311 Buffer *mBuf
10312 )
10313 {
10314    uint32_t tmpEnum;
10315
10316
10317    CMCHKUNPK(oduPackUInt32, &tmpEnum, mBuf);
10318    param->cmdType = (RgrCellCntrlCmdType) tmpEnum;
10319    switch(param->cmdType)
10320    {
10321       case RGR_CNTRL_CMD_RACH_OVRLD:
10322          CMCHKUNPK(oduPackUInt8, &param->cmdDesc.rachOvrLd.backOffEnb, mBuf);
10323          CMCHKUNPK(oduPackUInt8, &param->cmdDesc.rachOvrLd.backOffVal, mBuf);
10324          break;
10325       case RGR_CNTRL_CMD_CPU_OVRLD:
10326          CMCHKUNPK(oduPackUInt8, &param->cmdDesc.cpuOvrLd.instruction, mBuf);
10327          break;
10328       default:
10329          break;
10330    }
10331
10332    return ROK;
10333 }
10334 #endif /* End of if defined(LCRGR) */
10335
10336 /**********************************************************************
10337          End of file
10338 **********************************************************************/