e310a8bc25ec4898661eda0eeb643fb7892ae0bf
[o-du/l2.git] / src / cm / ctf.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
19 /********************************************************************20**
20  
21      Name:     CTF Interface
22  
23      Type:     C file
24  
25      Desc:     This file contains the packing/unpacking functions
26                for control plane primitives on CTF interface.
27
28      File:     ctf.c
29
30 *********************************************************************21*/
31
32 /* header include files (.h) */
33 #include "common_def.h"
34 #include "ctf.h"           /* CTF interface defines           */
35
36 /* header/extern include files (.x) */
37 #ifdef TENB_AS_SECURITY
38 #include "cm_mblk.x"
39 #endif
40 #include "ctf.x"          
41
42 #ifdef TENB_AS_SECURITY
43 #define cmPkCtfCrnti oduUnpackUInt16
44 #define cmPkCtfCellId oduUnpackUInt16
45 #define cmUnpkCtfCellId oduPackUInt16
46 #define cmUnpkCtfCrnti oduPackUInt16
47 #endif
48
49
50 #if (defined(LCCTF) || defined(LWLCCTF))
51
52 \f
53 /**
54 * @brief Request from RRC to PHY to bind the CTF interface SAP.
55 *
56 * @details
57 *
58 *     Function: cmPkCtfBndReq
59 *
60 *  @param[in]   Pst*  pst
61 *  @param[in]   SuId  suId
62 *  @param[in]   SpId  spId
63 *  @return   S16
64 *      -# ROK
65 **/
66 S16 cmPkCtfBndReq
67 (
68 Pst* pst,
69 SuId suId,
70 SpId spId
71 )
72 {
73    Buffer *mBuf = NULLP;
74
75    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
76 #if (ERRCLASS & ERRCLS_ADD_RES)
77       /* ctf_c_001.main_3 Compilation warning fix with g++ */
78       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
79          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
80          (ErrVal)ECTF001, (ErrVal)0, (Txt*)&"Packing failed");
81 #endif
82       return RFAILED;
83    }
84    if (SPkS16(spId, mBuf) != ROK) {
85 #if (ERRCLASS & ERRCLS_ADD_RES)
86       /* ctf_c_001.main_3 Compilation warning fix with g++ */
87       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
88          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
89          (ErrVal)ECTF002, (ErrVal)0, (Txt*)&"Packing failed");
90 #endif
91       SPutMsg(mBuf);
92       return RFAILED;
93    }
94    if (SPkS16(suId, mBuf) != ROK) {
95 #if (ERRCLASS & ERRCLS_ADD_RES)
96       /* ctf_c_001.main_3 Compilation warning fix with g++ */
97       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
98          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
99          (ErrVal)ECTF003, (ErrVal)0, (Txt*)&"Packing failed");
100 #endif
101       SPutMsg(mBuf);
102       return RFAILED;
103    }
104    pst->event = (Event) EVTCTFBNDREQ;
105    return (SPstTsk(pst,mBuf));
106 }
107
108 \f
109 /**
110 * @brief Request from RRC to PHY to bind the CTF interface SAP.
111 *
112 * @details
113 *
114 *     Function: cmUnpkCtfBndReq
115 *
116 *  @param[in]   Pst*  pst
117 *  @param[in]   SuId  suId
118 *  @param[in]   SpId  spId
119 *  @return   S16
120 *      -# ROK
121 **/
122 S16 cmUnpkCtfBndReq
123 (
124 CtfBndReq func,
125 Pst *pst,
126 Buffer *mBuf
127 )
128 {
129    SuId suId = 0;
130    SpId spId = 0;
131    
132
133    if (SUnpkS16(&suId, mBuf) != ROK) {
134       SPutMsg(mBuf);
135 #if (ERRCLASS & ERRCLS_ADD_RES)
136       /* ctf_c_001.main_3 Compilation warning fix with g++ */
137       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
138          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
139          (ErrVal)ECTF004, (ErrVal)0, (Txt*)&"Packing failed");
140 #endif
141       return RFAILED;
142    }
143    if (SUnpkS16(&spId, mBuf) != ROK) {
144       SPutMsg(mBuf);
145 #if (ERRCLASS & ERRCLS_ADD_RES)
146       /* ctf_c_001.main_3 Compilation warning fix with g++ */
147       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
148          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
149          (ErrVal)ECTF005, (ErrVal)0, (Txt*)&"Packing failed");
150 #endif
151       return RFAILED;
152    }
153    SPutMsg(mBuf);
154    return ((*func)(pst, suId, spId));
155 }
156
157 \f
158 /**
159 * @brief Confirmation from PHY to RRC for the bind 
160  * request for the CTF interface SAP.
161 *
162 * @details
163 *
164 *     Function: cmPkCtfBndCfm
165 *
166 *  @param[in]   Pst*  pst
167 *  @param[in]   SuId  suId
168 *  @param[in]   uint8_t  status
169 *  @return   S16
170 *      -# ROK
171 **/
172 S16 cmPkCtfBndCfm
173 (
174 Pst* pst,
175 SuId suId,
176 uint8_t status
177 )
178 {
179    Buffer *mBuf = NULLP;
180
181    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
182 #if (ERRCLASS & ERRCLS_ADD_RES)
183       /* ctf_c_001.main_3 Compilation warning fix with g++ */
184       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
185          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
186          (ErrVal)ECTF006, (ErrVal)0, (Txt*)&"Packing failed");
187 #endif
188       return RFAILED;
189    }
190    if (oduUnpackUInt8(status, mBuf) != ROK) {
191 #if (ERRCLASS & ERRCLS_ADD_RES)
192       /* ctf_c_001.main_3 Compilation warning fix with g++ */
193       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
194          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
195          (ErrVal)ECTF007, (ErrVal)0, (Txt*)&"Packing failed");
196 #endif
197       SPutMsg(mBuf);
198       return RFAILED;
199    }
200    if (SPkS16(suId, mBuf) != ROK) {
201 #if (ERRCLASS & ERRCLS_ADD_RES)
202       /* ctf_c_001.main_3 Compilation warning fix with g++ */
203       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
204          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
205          (ErrVal)ECTF008, (ErrVal)0, (Txt*)&"Packing failed");
206 #endif
207       SPutMsg(mBuf);
208       return RFAILED;
209    }
210    pst->event = (Event) EVTCTFBNDCFM;
211    return (SPstTsk(pst,mBuf));
212 }
213
214 \f
215 /**
216 * @brief Confirmation from PHY to RRC for the bind 
217  * request for the CTF interface SAP.
218 *
219 * @details
220 *
221 *     Function: cmUnpkCtfBndCfm
222 *
223 *  @param[in]   Pst*  pst
224 *  @param[in]   SuId  suId
225 *  @param[in]   uint8_t  status
226 *  @return   S16
227 *      -# ROK
228 **/
229 S16 cmUnpkCtfBndCfm
230 (
231 CtfBndCfm func,
232 Pst *pst,
233 Buffer *mBuf
234 )
235 {
236    SuId suId = 0;
237    uint8_t status;
238    
239
240    if (SUnpkS16(&suId, mBuf) != ROK) {
241       SPutMsg(mBuf);
242 #if (ERRCLASS & ERRCLS_ADD_RES)
243       /* ctf_c_001.main_3 Compilation warning fix with g++ */
244       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
245          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
246          (ErrVal)ECTF009, (ErrVal)0, (Txt*)&"Packing failed");
247 #endif
248       return RFAILED;
249    }
250    if (oduPackUInt8(&status, mBuf) != ROK) {
251       SPutMsg(mBuf);
252 #if (ERRCLASS & ERRCLS_ADD_RES)
253       /* ctf_c_001.main_3 Compilation warning fix with g++ */
254       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
255          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
256          (ErrVal)ECTF010, (ErrVal)0, (Txt*)&"Packing failed");
257 #endif
258       return RFAILED;
259    }
260    SPutMsg(mBuf);
261    return ((*func)(pst, suId, status));
262 }
263
264 \f
265 /**
266 * @brief Request from RRC to PHY to Unbind the CTF interface SAP.
267 *
268 * @details
269 *
270 *     Function: cmPkCtfUbndReq
271 *
272 *  @param[in]   Pst*  pst
273 *  @param[in]   SpId  spId
274 *  @param[in]   Reason  reason
275 *  @return   S16
276 *      -# ROK
277 **/
278 S16 cmPkCtfUbndReq
279 (
280 Pst* pst,
281 SpId spId,
282 Reason reason
283 )
284 {
285    Buffer *mBuf = NULLP;
286
287    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
288 #if (ERRCLASS & ERRCLS_ADD_RES)
289       /* ctf_c_001.main_3 Compilation warning fix with g++ */
290       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
291          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
292          (ErrVal)ECTF011, (ErrVal)0, (Txt*)&"Packing failed");
293 #endif
294       return RFAILED;
295    }
296    if (SPkS16(reason, mBuf) != ROK) {
297 #if (ERRCLASS & ERRCLS_ADD_RES)
298       /* ctf_c_001.main_3 Compilation warning fix with g++ */
299       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
300          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
301          (ErrVal)ECTF012, (ErrVal)0, (Txt*)&"Packing failed");
302 #endif
303       SPutMsg(mBuf);
304       return RFAILED;
305    }
306    if (SPkS16(spId, mBuf) != ROK) {
307 #if (ERRCLASS & ERRCLS_ADD_RES)
308       /* ctf_c_001.main_3 Compilation warning fix with g++ */
309       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
310          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
311          (ErrVal)ECTF013, (ErrVal)0,(Txt*)&"Packing failed");
312 #endif
313       SPutMsg(mBuf);
314       return RFAILED;
315    }
316    pst->event = (Event) EVTCTFUBNDREQ;
317    return (SPstTsk(pst,mBuf));
318 }
319
320 \f
321 /**
322 * @brief Request from RRC to PHY to Unbind the CTF interface SAP.
323 *
324 * @details
325 *
326 *     Function: cmUnpkCtfUbndReq
327 *
328 *  @param[in]   Pst*  pst
329 *  @param[in]   SpId  spId
330 *  @param[in]   Reason  reason
331 *  @return   S16
332 *      -# ROK
333 **/
334 S16 cmUnpkCtfUbndReq
335 (
336 CtfUbndReq func,
337 Pst *pst,
338 Buffer *mBuf
339 )
340 {
341    SpId spId = 0;
342    Reason reason = 0;
343    
344
345    if (SUnpkS16(&spId, mBuf) != ROK) {
346       SPutMsg(mBuf);
347 #if (ERRCLASS & ERRCLS_ADD_RES)
348       /* ctf_c_001.main_3 Compilation warning fix with g++ */
349       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
350          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
351          (ErrVal)ECTF014, (ErrVal)0, (Txt*)&"Packing failed");
352 #endif
353       return RFAILED;
354    }
355    if (SUnpkS16(&reason, mBuf) != ROK) {
356       SPutMsg(mBuf);
357 #if (ERRCLASS & ERRCLS_ADD_RES)
358       /* ctf_c_001.main_3 Compilation warning fix with g++ */
359       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
360          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
361          (ErrVal)ECTF015, (ErrVal)0, (Txt*)&"Packing failed");
362 #endif
363       return RFAILED;
364    }
365    SPutMsg(mBuf);
366    return ((*func)(pst, spId, reason));
367 }
368
369 \f
370 /***********************************************************
371 *
372 *     Func: cmRelCtfCfgReq
373 *
374 *
375 *     Desc:  This fucntion will release the memory used for ctf cfg req
376 *
377 *     Ret: S16
378 *
379 *     Notes:
380 *
381 *     File: 
382 *
383 **********************************************************/
384 static S16 cmRelCtfCfgReq
385 (
386 Pst  *pst,
387 CtfCfgReqInfo *cfgReqInfo
388 )
389 {
390    /* ctf_c_001.main_4: Added support for vendor specific parameters */
391 #ifdef CTF_VER3
392    if(cfgReqInfo->vendorParams.paramBuffer != NULLP) {
393       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, 
394                    (Data *)cfgReqInfo->vendorParams.paramBuffer,
395                    cfgReqInfo->vendorParams.buffLen);
396    }
397 #endif
398    SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCfgReqInfo)); 
399    return ROK;
400 }
401
402 #ifdef TENB_AS_SECURITY
403 /***********************************************************
404 *
405 *     Func: cmPkCtfNhKeyInfo
406 *
407 *
408 *     Desc:   Pack keNB* input parameter information
409  * @details This is one of the main structure in the KDF request primitive.
410  *    -# This structure contains the configuration information as given by 
411  *       the Application to trigger key derivation at PHY layer for generation of kENB*.
412  *    -# It take Next Hop key, DL Frequency and Physical cell Id as input.
413  *    -# The result of configuration is indicated in KdfCfgCfm.
414 *
415 *
416 *     Ret: S16
417 *
418 *     Notes:
419 *
420 *     File: 
421 *
422 **********************************************************/
423 S16 cmPkCtfNhKeyInfo
424 (
425 CtfNhKeyInfo *param,
426 Buffer *mBuf
427 )
428 {
429
430    S16  idx;
431
432          
433    for(idx=31;idx>=0;idx--)
434    {
435       CMCHKPK(oduUnpackUInt8,param->secKey[idx],mBuf);
436    }
437    CMCHKPK(oduUnpackUInt16, param->physCellId, mBuf);
438    CMCHKPK(oduUnpackUInt16, param->dlCarrFreq, mBuf);
439
440    return ROK;
441 }
442
443 /***********************************************************
444 *
445 *     Func: cmPkCtfKenbStarInfo
446 *
447 *
448 *     Desc:   Pack keNB* input parameter information
449  * @details This is one of the main structure in the KDF request primitive.
450  *    -# This structure contains the configuration information as given by 
451  *       the Application to trigger key derivation at PHY layer for generation of kENB*.
452  *    -# It take existing kENB, DL Frequency and Physical cell Id as input.
453  *    -# The result of configuration is indicated in KdfCfgCfm.
454 *
455 *
456 *     Ret: S16
457 *
458 *     Notes:
459 *
460 *     File: 
461 *
462 **********************************************************/
463 S16 cmPkCtfKenbStarInfo
464 (
465 CtfKenbStarInfo *param,
466 Buffer *mBuf
467 )
468 {
469
470    S16  idx;
471
472          
473    for(idx=31;idx>=0;idx--)
474    {
475       CMCHKPK(oduUnpackUInt8,param->secKey[idx],mBuf);
476    }
477    CMCHKPK(oduUnpackUInt16, param->physCellId, mBuf);
478    CMCHKPK(oduUnpackUInt16, param->dlCarrFreq, mBuf);
479    
480    return ROK;
481 }
482
483
484 /***********************************************************
485 *
486 *     Func: cmPkCtfAskeyInfo
487 *
488 *
489 *     Desc:   Pack AS key generation input parameter information.
490  * @details This is one of the main structure in the KDF request primitive.
491  *    -# This structure contains the configuration information as given by 
492  *       the Application to trigger key derivation at PHY layer for generation of AS Security keys.
493  *    -# It take existing kENB, and integrity/cipherig Algorithm as input.
494  *    -# The result of configuration is indicated in KdfCfgCfm.
495 *
496 *
497 *     Ret: S16
498 *
499 *     Notes:
500 *
501 *     File: 
502 *
503 **********************************************************/
504 S16 cmPkCtfAskeyInfo
505 (
506 CtfAsKeyInfo *param,
507 Buffer *mBuf
508 )
509 {
510    S16  idx;
511          
512    for(idx=31;idx>=0;idx--)
513    {
514       CMCHKPK(oduUnpackUInt8,param->secKey[idx],mBuf);
515    }
516    CMCHKPK(oduUnpackUInt8, param->ciphAlgoType, mBuf);
517    CMCHKPK(oduUnpackUInt8, param->intgAlgoType, mBuf);
518
519    return ROK;
520 }
521
522 /***********************************************************
523 *
524 *     Func: cmPkCtfKdfReqInfo
525 *
526 *
527 *     Desc:   Pack one of the 3 Key Derivation types.
528  * @details This is the encompassing structure in the KDF request primitive.
529  *    -# This structure contains the configuration information as given by 
530  *       the Application to trigger key derivation at PHY layer for generation of keys.
531  *    -# It takes key derivation type as input.
532  *    -# The result of configuration is indicated in KdfCfgCfm.
533 *
534 *
535 *     Ret: S16
536 *
537 *     Notes:
538 *
539 *     File: 
540 *
541 **********************************************************/
542 S16 cmPkCtfKdfReqInfo
543 (
544 CtfKdfReqInfo *param,
545 Buffer *mBuf
546 )
547 {
548
549
550    switch (param->keyDerType)
551     {
552          case CTF_KDF_TYPE1:
553              CMCHKPK(cmPkCtfAskeyInfo, &param->u.kEnbInf, mBuf);
554              break;
555          case CTF_KDF_TYPE2:
556             CMCHKPK(cmPkCtfKenbStarInfo, &param->u.kEnbStarInf, mBuf);
557             break;
558          case CTF_KDF_TYPE3:
559             CMCHKPK(cmPkCtfNhKeyInfo , &param->u.nhKeyInf, mBuf);
560              break;
561          default :
562             return RFAILED;
563     }
564     CMCHKPK(oduUnpackUInt8, param->keyDerType, mBuf);
565
566    return ROK;
567 }
568
569 /**
570 * @brief Primitive Request from Application to PHY for 
571  * security key derivation.
572 *
573 * @details
574 *
575 *     Function: cmPkCtfKdfReq
576 *
577 *  @param[in]   Pst*  pst
578 *  @param[in]   SpId  spId
579 *  @param[in]   CtfCfgTransId  transId
580 *  @param[in]   CtfCfgReqInfo*  cfgReqInfo
581 *  @return   S16
582 *      -# ROK
583 **/
584 S16 cmPkCtfKdfReq
585 (
586 Pst* pst,
587 SpId spId,
588 CtfCfgTransId transId,
589 CtfKdfReqInfo* kdfReqInfo
590 )
591 {
592    Buffer *mBuf = NULLP;
593
594    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
595 #if (ERRCLASS & ERRCLS_ADD_RES)
596       /* ctf_c_001.main_3 Compilation warning fix with g++ */
597       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
598          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
599          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
600 #endif
601       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
602       return RFAILED;
603    }
604    if (pst->selector == ODU_SELECTOR_LC) {
605       if (cmPkCtfKdfReqInfo(kdfReqInfo, mBuf) != ROK) {
606 #if (ERRCLASS & ERRCLS_ADD_RES)
607       /* ctf_c_001.main_3 Compilation warning fix with g++ */
608          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
609             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
610             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
611 #endif
612          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
613          SPutMsg(mBuf);
614          return RFAILED;
615       }
616    }
617    else if (pst->selector == ODU_SELECTOR_LWLC) {
618    }
619    if (cmPkCtfCfgTransId(&transId, mBuf) != ROK) {
620 #if (ERRCLASS & ERRCLS_ADD_RES)
621       /* ctf_c_001.main_3 Compilation warning fix with g++ */
622       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
623          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
624          (ErrVal)ECTF019, (ErrVal)0, (Txt*)&"Packing failed");
625 #endif
626       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
627       SPutMsg(mBuf);
628       return RFAILED;
629    }
630    if (SPkS16(spId, mBuf) != ROK) {
631 #if (ERRCLASS & ERRCLS_ADD_RES)
632       /* ctf_c_001.main_3 Compilation warning fix with g++ */
633       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
634          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
635          (ErrVal)ECTF020, (ErrVal)0, (Txt*)&"Packing failed");
636 #endif
637       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
638       SPutMsg(mBuf);
639       return RFAILED;
640    }
641    if (pst->selector != ODU_SELECTOR_LWLC) {
642       if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo)) != ROK) {
643 #if (ERRCLASS & ERRCLS_ADD_RES)
644       /* ctf_c_001.main_3 Compilation warning fix with g++ */
645       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
646          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
647          (ErrVal)ECTF021, (ErrVal)0, (Txt*)&"Packing failed");
648 #endif
649          SPutMsg(mBuf);
650          return RFAILED;
651       }
652    }
653    pst->event = (Event) EVTCTFKDFREQ;
654    return (SPstTsk(pst,mBuf));
655 }
656 #endif
657
658 /********************************************************************************************************************************/
659                               /*START OF CNM PACK & UNPACK FUNCTIONS*/
660 /********************************************************************************************************************************/
661 S16 cmPkCtfCnmVendorSpecificInfo
662 (
663 CtfCnmVendorSpecificInfo *param,
664 Buffer *mBuf
665 )
666 {
667    S32 i;
668    if(param->numOfVendorSpecifcParam <= CTF_CNM_MAX_VENDOR_PARAMS)
669    {
670       for(i= param->numOfVendorSpecifcParam-1; i >= 0; i--)
671       {
672          CMCHKPK(oduUnpackUInt32,(uint32_t)param->vendorSpecifcParam[i], mBuf);
673       }
674    }
675    CMCHKPK(oduUnpackUInt16, param->numOfVendorSpecifcParam, mBuf);
676    return ROK;
677 }
678
679 S16 cmPkCtfCtfCnmCellSyncReq
680 (
681 CtfCnmCellSyncReq *param,
682 Buffer *mBuf
683 )
684 {
685
686    CMCHKPK(oduUnpackUInt16, param->nbrEarfcn, mBuf);
687    CMCHKPK(oduUnpackUInt16, param->nbrPCellId, mBuf);
688    CMCHKPK(oduUnpackUInt8, param->nbrTxAntCount, mBuf);
689    CMCHKPK(oduUnpackUInt8, param->nbrCellCp, mBuf);
690    CMCHKPK(oduUnpackUInt8, param->nbrCellNRb, mBuf);
691    CMCHKPK(oduUnpackUInt8, param->nbrSpecSfCfg, mBuf);
692    CMCHKPK(cmPkCtfCnmVendorSpecificInfo, &param->ctfCnmVendorSpecificInfo, mBuf);
693    return ROK;
694
695 }
696
697 S16 cmPkCtfcfgReqInfo
698 (
699 CtfCnmInitSyncReq *param,
700 Buffer *mBuf
701 )
702 {
703    S32 i;
704
705    CMCHKPK(oduUnpackUInt8, param->searchType, mBuf);
706    CMCHKPK(oduUnpackUInt8, param->mibRequest, mBuf);
707    CMCHKPK(oduUnpackUInt16, param->earfcn, mBuf);
708    CMCHKPK(oduUnpackUInt8, param->measBandWidth, mBuf);
709    if(param->numOfPciList <= CTF_CNM_MAX_CELL_SEARCH)
710    { 
711       for(i= param->numOfPciList-1; i >= 0; i--)
712       {
713          CMCHKPK(cmPkCtfCtfCnmCellSyncReq, &param->pciList[i], mBuf);
714       }
715    }
716    CMCHKPK(oduUnpackUInt16, param->numOfPciList, mBuf);
717    return ROK;
718
719 }
720 S16 cmUnpkCtfCnmVendorSpecificInfo
721 (
722 CtfCnmVendorSpecificInfo *param,
723 Buffer *mBuf
724 )
725 {
726    S32 i;
727
728    CMCHKUNPK(oduPackUInt16, &param->numOfVendorSpecifcParam, mBuf);
729    for(i=0; (i<param->numOfVendorSpecifcParam)&&(i < CTF_CNM_MAX_VENDOR_PARAMS); i++)
730    {
731       CMCHKUNPK(oduPackUInt32, &param->vendorSpecifcParam[i], mBuf);
732    }
733    return ROK;
734 }
735
736 S16 cmUnpkCtfCtfCnmCellSyncReq
737 (
738 CtfCnmCellSyncReq *param,
739 Buffer *mBuf
740 )
741 {
742
743    CMCHKUNPK(cmUnpkCtfCnmVendorSpecificInfo, &param->ctfCnmVendorSpecificInfo, mBuf);
744    CMCHKUNPK(oduPackUInt8, &param->nbrSpecSfCfg, mBuf);
745    CMCHKUNPK(oduPackUInt8, &param->nbrCellNRb, mBuf);
746    CMCHKUNPK(oduPackUInt8, &param->nbrCellCp, mBuf);
747    CMCHKUNPK(oduPackUInt8, &param->nbrTxAntCount, mBuf);
748    CMCHKUNPK(oduPackUInt16, &param->nbrPCellId, mBuf);
749    CMCHKUNPK(oduPackUInt16, &param->nbrEarfcn, mBuf);
750    return ROK;
751
752 }
753
754 S16 cmUnpkCtfsyncReqInfo
755 (
756 CtfCnmInitSyncReq *param,
757 Buffer *mBuf
758 )
759 {
760    S32 i;
761
762    CMCHKUNPK(oduPackUInt16, &param->numOfPciList, mBuf);
763    for(i=0; (i < param->numOfPciList)&&(i < CTF_CNM_MAX_CELL_SEARCH); i++)
764    {
765       CMCHKUNPK(cmUnpkCtfCtfCnmCellSyncReq, &param->pciList[i], mBuf);
766    }
767
768    CMCHKUNPK(oduPackUInt8, &param->measBandWidth, mBuf);
769    CMCHKUNPK(oduPackUInt16, &param->earfcn, mBuf);
770    CMCHKUNPK(oduPackUInt8, &param->mibRequest, mBuf);
771    CMCHKUNPK(oduPackUInt8, &param->searchType, mBuf);
772    return ROK;
773 }
774 /**
775 * @brief Configuration Request from App to CL for
776  * cnm Cell Sync request.
777 *
778 * @details
779 *
780 *     Function: cmPkCtfCnmCellSyncReq
781 *
782 *  @param[in]   Pst*  pst
783 *  @param[in]   SpId  spId
784 *  @param[in]   CtfCfgTransId  * transId
785 *  @param[in]   CtfCnmCellSyncReq* ctfcnmCellSyncReq
786 *  @return   S16
787 *      -# ROK
788 **/
789 S16 cmPkCtfCnmCellSyncReq
790 (
791 Pst* pst,
792 SpId spId,
793 CtfCfgTransId *transId,
794 CtfCnmCellSyncReq * cfgReqInfo
795 )
796 {
797
798    Buffer *mBuf = NULLP;
799
800    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
801 #if (ERRCLASS & ERRCLS_ADD_RES)
802       /* ctf_c_001.main_3 Compilation warning fix with g++ */
803       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
804          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
805          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
806 #endif
807       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
808       return RFAILED;
809    }
810    if (pst->selector == ODU_SELECTOR_LC) {
811       if (cmPkCtfCtfCnmCellSyncReq(cfgReqInfo, mBuf) != ROK) {
812 #if (ERRCLASS & ERRCLS_ADD_RES)
813       /* ctf_c_001.main_3 Compilation warning fix with g++ */
814          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
815             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
816             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
817 #endif
818          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
819          SPutMsg(mBuf);
820          return RFAILED;
821       }
822    }
823    else if (pst->selector == ODU_SELECTOR_LWLC) {
824
825    if (oduPackPointer((PTR)cfgReqInfo, mBuf) != ROK) {
826 #if (ERRCLASS & ERRCLS_ADD_RES)
827       /* ctf_c_001.main_3 Compilation warning fix with g++ */
828          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
829             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
830             (ErrVal)ECTF018, (ErrVal)0, "Packing failed");
831 #endif
832          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
833          SPutMsg(mBuf);
834          return RFAILED;
835       }
836
837    }
838    if(cmPkCtfCfgTransId(transId, mBuf) != ROK) {
839 #if (ERRCLASS & ERRCLS_ADD_RES)
840       /* ctf_c_001.main_3 Compilation warning fix with g++ */
841       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
842          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
843          (ErrVal)ECTF019, (ErrVal)0, "Packing failed");
844 #endif
845       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
846       SPutMsg(mBuf);
847       return RFAILED;
848    }
849  if (SPkS16(spId, mBuf) != ROK) {
850 #if (ERRCLASS & ERRCLS_ADD_RES)
851       /* ctf_c_001.main_3 Compilation warning fix with g++ */
852       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
853          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
854          (ErrVal)ECTF020, (ErrVal)0, "Packing failed");
855 #endif
856       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
857       SPutMsg(mBuf);
858       return RFAILED;
859    }
860    if (pst->selector != ODU_SELECTOR_LWLC) {
861       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
862    }
863    pst->event = (Event)EVTCTFCNMSYNCREQ;
864    return (SPstTsk(pst,mBuf));
865
866 }
867 /**
868 * @brief Configuration Request from RRC to PHY for
869  * cell or dedicated configuration.
870 *
871 * @details
872 *
873 *     Function: cmUnpkCtfCnmCellSyncReq
874 *
875 *  @param[in]   CtfCnmCellSyncReqMsg func
876 *  @param[in]   Pst*  pst
877 *  @param[in]   Buffer *mBuf
878 *  @return   S16
879 *      -# ROK
880 **/
881 S16 cmUnpkCtfCnmCellSyncReq
882 (
883 CtfCnmCellSyncReqMsg func,
884 Pst *pst,
885 Buffer *mBuf
886 )
887 {
888
889    SpId spId = 0;
890    CtfCfgTransId transId;
891    CtfCnmCellSyncReq *SyncReqMsg = NULLP;
892
893    if (SUnpkS16(&spId, mBuf) != ROK) {
894       SPutMsg(mBuf);
895 #if (ERRCLASS & ERRCLS_ADD_RES)
896       /* ctf_c_001.main_3 Compilation warning fix with g++ */
897       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
898          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
899          (ErrVal)ECTF022, (ErrVal)0, (Txt*)&"Packing failed");
900 #endif
901       return RFAILED;
902    }
903    if (cmUnpkCtfCfgTransId(&transId, mBuf) != ROK) {
904       SPutMsg(mBuf);
905 #if (ERRCLASS & ERRCLS_ADD_RES)
906       /* ctf_c_001.main_3 Compilation warning fix with g++ */
907       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
908          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
909          (ErrVal)ECTF023, (ErrVal)0, (Txt*)&"Packing failed");
910 #endif
911       return RFAILED;
912    }
913    if (pst->selector != ODU_SELECTOR_LWLC) {
914       if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&SyncReqMsg, sizeof(CtfCnmCellSyncReq))) != ROK) {
915 #if (ERRCLASS & ERRCLS_ADD_RES)
916       /* ctf_c_001.main_3 Compilation warning fix with g++ */
917          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
918             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
919             (ErrVal)ECTF024, (ErrVal)0, (Txt*)&"Packing failed");
920 #endif
921          SPutMsg(mBuf);
922          return RFAILED;
923       }
924    }
925    if (pst->selector == ODU_SELECTOR_LWLC) {
926       if (oduUnpackPointer((PTR *)&SyncReqMsg, mBuf) != ROK) {
927          SPutMsg(mBuf);
928          return RFAILED;
929       }
930    }
931   else if (pst->selector == ODU_SELECTOR_LC)
932       if (cmUnpkCtfCtfCnmCellSyncReq(SyncReqMsg, mBuf) != ROK) {
933       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)SyncReqMsg, sizeof(CtfCnmCellSyncReq));
934       SPutMsg(mBuf);
935 #if (ERRCLASS & ERRCLS_ADD_RES)
936       /* ctf_c_001.main_3 Compilation warning fix with g++ */
937       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
938          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
939          (ErrVal)ECTF025, (ErrVal)0, (Txt*)&"Packing failed");
940 #endif
941       return RFAILED;
942    }
943    SPutMsg(mBuf);
944    return ((*func)(pst, spId, &transId, SyncReqMsg));
945
946 }
947 /*-----------------------------------------------------*/
948
949
950 /**
951 * @brief Configuration Request from App to CL for
952  * cnm Init Sync request.
953 *
954 * @details
955 *
956 *     Function: cmPkCtfCnmInitSyncReq
957 *
958 *  @param[in]   Pst*  pst
959 *  @param[in]   SpId  spId
960 *  @param[in]   CtfCfgTransId  * transId
961 *  @param[in]   CtfCnmInitSyncReq* ctfcnmInitSyncReq
962 *  @return   S16
963 *      -# ROK
964 **/
965 S16 cmPkCtfCnmInitSyncReq
966 (
967 Pst* pst,
968 SpId spId,
969 CtfCfgTransId *transId,
970 CtfCnmInitSyncReq * cfgReqInfo
971 )
972 {
973    Buffer *mBuf = NULLP;
974
975
976    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
977 #if (ERRCLASS & ERRCLS_ADD_RES)
978       /* ctf_c_001.main_3 Compilation warning fix with g++ */
979       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
980          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
981          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
982 #endif
983       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
984       return RFAILED;
985    }
986    if (pst->selector == ODU_SELECTOR_LC) {
987       if (cmPkCtfcfgReqInfo(cfgReqInfo, mBuf) != ROK) {
988 #if (ERRCLASS & ERRCLS_ADD_RES)
989       /* ctf_c_001.main_3 Compilation warning fix with g++ */
990          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
991             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
992             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
993 #endif
994          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
995          SPutMsg(mBuf);
996          return RFAILED;
997       }
998    }
999    else if (pst->selector == ODU_SELECTOR_LWLC) {
1000
1001    if (oduPackPointer((PTR)cfgReqInfo, mBuf) != ROK) {
1002 #if (ERRCLASS & ERRCLS_ADD_RES)
1003       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1004          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1005             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1006             (ErrVal)ECTF018, (ErrVal)0, "Packing failed");
1007 #endif
1008          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
1009          SPutMsg(mBuf);
1010          return RFAILED;
1011       }
1012
1013    }
1014    if(cmPkCtfCfgTransId(transId, mBuf) != ROK) {
1015 #if (ERRCLASS & ERRCLS_ADD_RES)
1016       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1017       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1018          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1019          (ErrVal)ECTF019, (ErrVal)0, "Packing failed");
1020 #endif
1021       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
1022       SPutMsg(mBuf);
1023       return RFAILED;
1024    }
1025  if (SPkS16(spId, mBuf) != ROK) {
1026 #if (ERRCLASS & ERRCLS_ADD_RES)
1027       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1028       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1029          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1030          (ErrVal)ECTF020, (ErrVal)0, "Packing failed");
1031 #endif
1032       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
1033       SPutMsg(mBuf);
1034       return RFAILED;
1035    }
1036    if (pst->selector != ODU_SELECTOR_LWLC) {
1037       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
1038    }
1039    pst->event = (Event)EVTCTFCNMINITSYNCREQ;
1040    return (SPstTsk(pst,mBuf));
1041
1042 }
1043 /*-----------------------------------------------------------------*/
1044
1045 /**
1046 * @brief Configuration Request from RRC to PHY for
1047  * cell or dedicated configuration.
1048 *
1049 * @details
1050 *
1051 *     Function: cmUnpkCtfCnmInitSyncReq
1052 *
1053 *  @param[in]   CtfCnmInitSyncReqMsg func
1054 *  @param[in]   Pst*  pst
1055 *  @param[in]   Buffer *mBuf
1056 *  @return   S16
1057 *      -# ROK
1058 **/
1059 S16 cmUnpkCtfCnmInitSyncReq
1060 (
1061 CtfCnmInitSyncReqMsg func,
1062 Pst *pst,
1063 Buffer *mBuf
1064 )
1065 {
1066
1067    SpId spId = 0;
1068    CtfCfgTransId transId;
1069    CtfCnmInitSyncReq *syncReqInfo = NULLP;
1070
1071    if (SUnpkS16(&spId, mBuf) != ROK) {
1072       SPutMsg(mBuf);
1073 #if (ERRCLASS & ERRCLS_ADD_RES)
1074       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1075       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1076          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1077          (ErrVal)ECTF022, (ErrVal)0, (Txt*)&"Packing failed");
1078 #endif
1079       return RFAILED;
1080    }
1081    if (cmUnpkCtfCfgTransId(&transId, mBuf) != ROK) {
1082       SPutMsg(mBuf);
1083 #if (ERRCLASS & ERRCLS_ADD_RES)
1084       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1085       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1086          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1087          (ErrVal)ECTF023, (ErrVal)0, (Txt*)&"Packing failed");
1088 #endif
1089       return RFAILED;
1090    }
1091    if (pst->selector != ODU_SELECTOR_LWLC) {
1092       if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&syncReqInfo, sizeof(CtfCnmInitSyncReq))) != ROK) {
1093 #if (ERRCLASS & ERRCLS_ADD_RES)
1094       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1095          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1096             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1097             (ErrVal)ECTF024, (ErrVal)0, (Txt*)&"Packing failed");
1098 #endif
1099          SPutMsg(mBuf);
1100          return RFAILED;
1101       }
1102    }
1103    if (pst->selector == ODU_SELECTOR_LWLC) {
1104       if (oduUnpackPointer((PTR *)&syncReqInfo, mBuf) != ROK) {
1105          SPutMsg(mBuf);
1106          return RFAILED;
1107       }
1108    }
1109   else if (pst->selector == ODU_SELECTOR_LC)
1110       if (cmUnpkCtfsyncReqInfo(syncReqInfo, mBuf) != ROK) {
1111       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)syncReqInfo, sizeof(CtfCnmInitSyncReq));
1112       SPutMsg(mBuf);
1113 #if (ERRCLASS & ERRCLS_ADD_RES)
1114       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1115       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1116          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1117          (ErrVal)ECTF025, (ErrVal)0, (Txt*)&"Packing failed");
1118 #endif
1119       return RFAILED;
1120    }
1121    SPutMsg(mBuf);
1122    return ((*func)(pst, spId, &transId, syncReqInfo));
1123 }
1124 /*-----------------------------------------------------------------------------*/
1125
1126 S16 cmPkCtfctfCnmMibInfo
1127 (
1128 CtfCnmMibInfo *param,
1129 Buffer *mBuf
1130 )
1131 {
1132
1133    CMCHKPK(oduUnpackUInt16, param->sfn, mBuf);
1134    CMCHKPK(oduUnpackUInt8, param->numTxAntennas, mBuf);
1135    CMCHKPK(oduUnpackUInt8, param->phichDuration, mBuf);
1136    CMCHKPK(oduUnpackUInt8, param->phichResource, mBuf);
1137    CMCHKPK(oduUnpackUInt8, param->dlSystemBandWidht, mBuf);
1138    return ROK;
1139
1140 }
1141
1142 S16 cmPkCtfctfCnmInitSyncInfo
1143 (
1144 CtfCnmInitSyncInfo *param,
1145 Buffer *mBuf
1146 )
1147 {
1148
1149    CMCHKPK(oduUnpackUInt16, param->pci, mBuf);
1150    CMCHKPK(oduUnpackUInt8, param->rsrp, mBuf);
1151    CMCHKPK(oduUnpackUInt8, param->mibValidFlag, mBuf);
1152    CMCHKPK(oduUnpackUInt16, param->localSfn, mBuf);
1153    CMCHKPK(cmPkCtfctfCnmMibInfo, &param->ctfCnmMibInfo, mBuf);
1154    CMCHKPK(cmPkCtfCnmVendorSpecificInfo, &param->ctfCnmVendorSpecificInfo, mBuf);
1155    return ROK;
1156
1157 }
1158
1159 S16 cmPkCtfcfgRspInfo
1160 (
1161 CtfCnmInitSyncRsp *param,
1162 Buffer *mBuf
1163 )
1164 {
1165    S32 i;
1166
1167    CMCHKPK(oduUnpackUInt8, param->status, mBuf);
1168    CMCHKPK(oduUnpackUInt16, param->earfcn, mBuf);
1169    if(param->numOfNeighbourInfo <= CTF_CNM_MAX_CELL_SEARCH)
1170    {
1171       for(i= param->numOfNeighbourInfo-1; i >= 0; i--)
1172       {
1173          CMCHKPK(cmPkCtfctfCnmInitSyncInfo, &param->ctfCnmInitSyncInfo[i], mBuf);
1174       }
1175    }
1176    CMCHKPK(oduUnpackUInt8, param->numOfNeighbourInfo, mBuf);
1177    return ROK;
1178
1179 }
1180
1181 /**
1182 * @brief Configuration Request from App to CL for
1183  * cnm Init Sync responce
1184 *
1185 * @details
1186 *
1187 *     Function: cmPkCtfCnmInitSyncRsp
1188 *
1189 *  @param[in]   Pst*  pst
1190 *  @param[in]   SpId  spId
1191 *  @param[in]   CtfCfgTransId  * transId
1192 *  @param[in]   CtfCnmInitSyncRsp* ctfcnmInitSyncRsp
1193 *  @return   S16
1194 *      -# ROK
1195 **/
1196 S16 cmPkCtfCnmInitSyncRsp
1197 (
1198 Pst* pst,
1199 SpId spId,
1200 CtfCfgTransId *transId,
1201 CtfCnmInitSyncRsp * cfgRspInfo
1202 )
1203 {
1204    Buffer *mBuf = NULLP;
1205
1206    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1207 #if (ERRCLASS & ERRCLS_ADD_RES)
1208       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1209       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1210          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1211          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
1212 #endif
1213       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
1214       return RFAILED;
1215    }
1216    if (pst->selector == ODU_SELECTOR_LC) {
1217       if (cmPkCtfcfgRspInfo(cfgRspInfo, mBuf) != ROK) {
1218 #if (ERRCLASS & ERRCLS_ADD_RES)
1219       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1220          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1221             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1222             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
1223 #endif
1224          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
1225          SPutMsg(mBuf);
1226          return RFAILED;
1227       }
1228    }
1229    else if (pst->selector == ODU_SELECTOR_LWLC) {
1230
1231    if (oduPackPointer((PTR)cfgRspInfo, mBuf) != ROK) {
1232 #if (ERRCLASS & ERRCLS_ADD_RES)
1233       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1234          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1235             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1236             (ErrVal)ECTF018, (ErrVal)0, "Packing failed");
1237 #endif
1238          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
1239          SPutMsg(mBuf);
1240          return RFAILED;
1241       }
1242
1243    }
1244  if(cmPkCtfCfgTransId(transId, mBuf) != ROK) {
1245 #if (ERRCLASS & ERRCLS_ADD_RES)
1246       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1247       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1248          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1249          (ErrVal)ECTF019, (ErrVal)0, "Packing failed");
1250 #endif
1251       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
1252       SPutMsg(mBuf);
1253       return RFAILED;
1254    }
1255  if (SPkS16(spId, mBuf) != ROK) {
1256 #if (ERRCLASS & ERRCLS_ADD_RES)
1257       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1258       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1259          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1260          (ErrVal)ECTF020, (ErrVal)0, "Packing failed");
1261 #endif
1262       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
1263       SPutMsg(mBuf);
1264       return RFAILED;
1265    }
1266    if (pst->selector != ODU_SELECTOR_LWLC) {
1267       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
1268    }
1269    pst->event = (Event)EVTCTFCNMINITSYNCRSP;
1270    return (SPstTsk(pst,mBuf));
1271
1272 }
1273 /*-----------------------------------------------------------------------------*/
1274
1275 S16 cmUnpkCtfctfCnmMibInfo
1276 (
1277 CtfCnmMibInfo *param,
1278 Buffer *mBuf
1279 )
1280 {
1281
1282    CMCHKUNPK(oduPackUInt8, &param->dlSystemBandWidht, mBuf);
1283    CMCHKUNPK(oduPackUInt8, &param->phichResource, mBuf);
1284    CMCHKUNPK(oduPackUInt8, &param->phichDuration, mBuf);
1285    CMCHKUNPK(oduPackUInt8, &param->numTxAntennas, mBuf);
1286    CMCHKUNPK(oduPackUInt16, &param->sfn, mBuf);
1287    return ROK;
1288
1289 }
1290
1291 S16 cmUnpkctfCnmInitSyncInfo
1292 (
1293 CtfCnmInitSyncInfo *param,
1294 Buffer *mBuf
1295 )
1296 {
1297
1298    CMCHKUNPK(cmUnpkCtfCnmVendorSpecificInfo, &param->ctfCnmVendorSpecificInfo, mBuf);
1299    CMCHKUNPK(cmUnpkCtfctfCnmMibInfo, &param->ctfCnmMibInfo, mBuf);
1300    CMCHKUNPK(oduPackUInt16, &param->localSfn, mBuf);
1301    CMCHKUNPK(oduPackUInt8, &param->mibValidFlag, mBuf);
1302    CMCHKUNPK(oduPackUInt8, &param->rsrp, mBuf);
1303    CMCHKUNPK(oduPackUInt16, &param->pci, mBuf);
1304    return ROK;
1305
1306 }
1307
1308 S16 cmUnpkCtfCnmInitSyncRspMsg
1309 (
1310 CtfCnmInitSyncRsp *param,
1311 Buffer *mBuf
1312 )
1313 {
1314     S32 i;
1315
1316     CMCHKUNPK(oduPackUInt8, &param->numOfNeighbourInfo, mBuf);
1317     for(i=0; (i < param->numOfNeighbourInfo)&&(i < CTF_CNM_MAX_CELL_SEARCH); i++)
1318     {
1319          CMCHKUNPK(cmUnpkctfCnmInitSyncInfo, &param->ctfCnmInitSyncInfo[i], mBuf);
1320     }
1321     CMCHKUNPK(oduPackUInt16, &param->earfcn, mBuf);
1322     CMCHKUNPK(oduPackUInt8, &param->status, mBuf);
1323     return ROK;
1324
1325 }
1326 /**
1327 * @brief Configuration Request from RRC to PHY for
1328  * cell or dedicated configuration.
1329 *
1330 * @details
1331 *
1332 *     Function: cmUnpkCtfCnmInitSyncRsp
1333 *
1334 *  @param[in]   CtfCnmInitSyncRspMsg func
1335 *  @param[in]   Pst*  pst
1336 *  @param[in]   Buffer *mBuf
1337 *  @return   S16
1338 *      -# ROK
1339 **/
1340 S16 cmUnpkCtfCnmInitSyncRsp
1341 (
1342 CtfCnmInitSyncRspMsg func,
1343 Pst *pst,
1344 Buffer *mBuf
1345 )
1346 {
1347
1348    SpId spId = 0;
1349    CtfCfgTransId transId;
1350    CtfCnmInitSyncRsp *syncRspInfo = NULLP;
1351
1352    if (SUnpkS16(&spId, mBuf) != ROK) {
1353       SPutMsg(mBuf);
1354 #if (ERRCLASS & ERRCLS_ADD_RES)
1355       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1356       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1357          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1358          (ErrVal)ECTF022, (ErrVal)0, (Txt*)&"Packing failed");
1359 #endif
1360       return RFAILED;
1361    }
1362    if (cmUnpkCtfCfgTransId(&transId, mBuf) != ROK) {
1363       SPutMsg(mBuf);
1364 #if (ERRCLASS & ERRCLS_ADD_RES)
1365       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1366       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1367          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1368          (ErrVal)ECTF023, (ErrVal)0, (Txt*)&"Packing failed");
1369 #endif
1370       return RFAILED;
1371    }
1372    if (pst->selector != ODU_SELECTOR_LWLC) {
1373       if((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&syncRspInfo, sizeof(CtfCnmInitSyncRsp))) != ROK) {
1374 #if (ERRCLASS & ERRCLS_ADD_RES)
1375       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1376          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1377             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1378             (ErrVal)ECTF024, (ErrVal)0, (Txt*)&"Packing failed");
1379 #endif
1380          SPutMsg(mBuf);
1381          return RFAILED;
1382       }
1383    }
1384    if (pst->selector == ODU_SELECTOR_LWLC) {
1385       if(oduUnpackPointer((PTR *)&syncRspInfo, mBuf) != ROK) {
1386          SPutMsg(mBuf);
1387          return RFAILED;
1388       }
1389    }
1390   else if (pst->selector == ODU_SELECTOR_LC)
1391       if(cmUnpkCtfCnmInitSyncRspMsg(syncRspInfo, mBuf) != ROK) {
1392       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)syncRspInfo, sizeof(CtfCnmInitSyncRsp));
1393       SPutMsg(mBuf);
1394 #if (ERRCLASS & ERRCLS_ADD_RES)
1395       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1396       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1397          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1398          (ErrVal)ECTF025, (ErrVal)0, (Txt*)&"Packing failed");
1399 #endif
1400       return RFAILED;
1401    }
1402    SPutMsg(mBuf);
1403    return ((*func)(pst, spId, &transId, syncRspInfo));
1404
1405 }
1406 /*-----------------------------------------------------------------------*/
1407
1408 S16 cmPkCtfCellSyncRsp 
1409 (
1410 CtfCnmCellSyncRsp *param,
1411 Buffer *mBuf
1412 )
1413 {
1414
1415    CMCHKPK(oduUnpackUInt8, param->status, mBuf);
1416    return ROK;
1417
1418 }
1419 /**
1420 * @brief Configuration Request from App to CL for
1421 * cnm Init Sync responce.
1422 *
1423 * @details
1424 *
1425 *     Function: cmPkCtfCnmCellSyncRsp
1426 *
1427 *  @param[in]   Pst*  pst
1428 *  @param[in]   SpId  spId
1429 *  @param[in]   CtfCfgTransId  * transId
1430 *  @param[in]   CtfCnmCellSyncRsp* ctfcnmCellSyncRsp
1431 *  @return   S16
1432 *      -# ROK
1433 **/
1434 S16 cmPkCtfCnmCellSyncRsp
1435 (
1436 Pst* pst,
1437 SpId spId,
1438 CtfCfgTransId *transId,
1439 CtfCnmCellSyncRsp * cfgRspInfo
1440 )
1441 {
1442
1443    Buffer *mBuf = NULLP;
1444
1445    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1446 #if (ERRCLASS & ERRCLS_ADD_RES)
1447       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1448       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1449          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1450          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
1451 #endif
1452       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
1453       return RFAILED;
1454    }
1455    if (pst->selector == ODU_SELECTOR_LC) {
1456       if (cmPkCtfCellSyncRsp(cfgRspInfo, mBuf) != ROK) {
1457 #if (ERRCLASS & ERRCLS_ADD_RES)
1458       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1459          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1460             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1461             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
1462 #endif
1463          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
1464          SPutMsg(mBuf);
1465          return RFAILED;
1466       }
1467    }
1468    else if (pst->selector == ODU_SELECTOR_LWLC) {
1469
1470    if (oduPackPointer((PTR)cfgRspInfo, mBuf) != ROK) {
1471 #if (ERRCLASS & ERRCLS_ADD_RES)
1472       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1473          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1474             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1475             (ErrVal)ECTF018, (ErrVal)0, "Packing failed");
1476 #endif
1477          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
1478          SPutMsg(mBuf);
1479          return RFAILED;
1480       }
1481
1482    }
1483  if(cmPkCtfCfgTransId(transId, mBuf) != ROK) {
1484 #if (ERRCLASS & ERRCLS_ADD_RES)
1485       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1486       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1487          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1488          (ErrVal)ECTF019, (ErrVal)0, "Packing failed");
1489 #endif
1490       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
1491       SPutMsg(mBuf);
1492       return RFAILED;
1493    }
1494  if (SPkS16(spId, mBuf) != ROK) {
1495 #if (ERRCLASS & ERRCLS_ADD_RES)
1496       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1497       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1498          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1499          (ErrVal)ECTF020, (ErrVal)0, "Packing failed");
1500 #endif
1501       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
1502       SPutMsg(mBuf);
1503       return RFAILED;
1504    }
1505    if (pst->selector != ODU_SELECTOR_LWLC) {
1506       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
1507    }
1508    pst->event = (Event)EVTCTFCNMSYNCRSP;
1509    return (SPstTsk(pst,mBuf));
1510
1511
1512 }
1513 /*------------------------------------------------------------*/
1514
1515 S16 cmUnpkCtfCnmSyncRspMsg
1516 (
1517 CtfCnmCellSyncRsp *param,
1518 Buffer *mBuf
1519 )
1520 {
1521
1522    CMCHKUNPK(oduPackUInt8, &param->status, mBuf);
1523    return ROK;
1524
1525 }
1526 /**
1527 * @brief Configuration Request from RRC to PHY for
1528  * cell or dedicated configuration.
1529 *
1530 * @details
1531 *
1532 *     Function: cmUnpkCtfCnmCellSyncRsp
1533 *
1534 *  @param[in]   CtfCnmCellSyncRspMsg func
1535 *  @param[in]   Pst*  pst
1536 *  @param[in]   Buffer *mBuf
1537 *  @return   S16
1538 *      -# ROK
1539 **/
1540 S16 cmUnpkCtfCnmCellSyncRsp
1541 (
1542 CtfCnmCellSyncRspMsg func,
1543 Pst *pst,
1544 Buffer *mBuf
1545 )
1546 {
1547
1548    SpId spId = 0;
1549    CtfCfgTransId transId;
1550    CtfCnmCellSyncRsp *syncRspMsg = NULLP;
1551
1552    if (SUnpkS16(&spId, mBuf) != ROK) {
1553       SPutMsg(mBuf);
1554 #if (ERRCLASS & ERRCLS_ADD_RES)
1555       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1556       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1557          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1558          (ErrVal)ECTF022, (ErrVal)0, (Txt*)&"Packing failed");
1559 #endif
1560       return RFAILED;
1561    }
1562    if (cmUnpkCtfCfgTransId(&transId, mBuf) != ROK) {
1563       SPutMsg(mBuf);
1564 #if (ERRCLASS & ERRCLS_ADD_RES)
1565       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1566       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1567          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1568          (ErrVal)ECTF023, (ErrVal)0, (Txt*)&"Packing failed");
1569 #endif
1570       return RFAILED;
1571    }
1572    if (pst->selector != ODU_SELECTOR_LWLC) {
1573       if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&syncRspMsg, sizeof(CtfCnmCellSyncRsp))) != ROK) {
1574 #if (ERRCLASS & ERRCLS_ADD_RES)
1575       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1576          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1577             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1578             (ErrVal)ECTF024, (ErrVal)0, (Txt*)&"Packing failed");
1579 #endif
1580          SPutMsg(mBuf);
1581          return RFAILED;
1582       }
1583    }
1584    if (pst->selector == ODU_SELECTOR_LWLC) {
1585       if (oduUnpackPointer((PTR *)&syncRspMsg, mBuf) != ROK) {
1586          SPutMsg(mBuf);
1587          return RFAILED;
1588       }
1589    }
1590   else if (pst->selector == ODU_SELECTOR_LC)
1591       if (cmUnpkCtfCnmSyncRspMsg(syncRspMsg, mBuf) != ROK) {
1592       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)syncRspMsg, sizeof(CtfCnmCellSyncRsp));
1593       SPutMsg(mBuf);
1594 #if (ERRCLASS & ERRCLS_ADD_RES)
1595       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1596       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1597          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1598          (ErrVal)ECTF025, (ErrVal)0, (Txt*)&"Packing failed");
1599 #endif
1600       return RFAILED;
1601    }
1602    SPutMsg(mBuf);
1603    return ((*func)(pst, spId, &transId, syncRspMsg));
1604
1605 }
1606 /*---------------------------------------------------------------*/
1607
1608 S16 cmPkCtfcfgIndInfo
1609 (
1610 CtfCnmCellSyncInd *param,
1611 Buffer *mBuf
1612 )
1613 {
1614
1615    CMCHKPK(oduUnpackUInt8, param->status, mBuf);
1616    CMCHKPK(cmPkCtfCnmVendorSpecificInfo, &param->ctfCnmVendorSpecificInfo, mBuf);
1617    return ROK;
1618
1619 }
1620 /**
1621 * @brief Configuration Request from App to CL for
1622 * cnm Init Sync responce.
1623 *
1624 * @details
1625 *
1626 *     Function: cmPkCtfCnmCellSyncInd
1627 *
1628 *  @param[in]   Pst*  pst
1629 *  @param[in]   SpId  spId
1630 *  @param[in]   CtfCfgTransId  * transId
1631 *  @param[in]   CtfCnmCellSyncInd* ctfcnmCellSyncInd
1632 *  @return   S16
1633 *      -# ROK
1634 **/
1635 S16 cmPkCtfCnmCellSyncInd
1636 (
1637 Pst* pst,
1638 SpId spId,
1639 CtfCfgTransId *transId,
1640 CtfCnmCellSyncInd * cfgIndInfo
1641 )
1642 {
1643    
1644    Buffer *mBuf = NULLP;
1645
1646    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1647 #if (ERRCLASS & ERRCLS_ADD_RES)
1648       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1649       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1650          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1651          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
1652 #endif
1653       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
1654       return RFAILED;
1655    }
1656    if (pst->selector == ODU_SELECTOR_LC) {
1657       if (cmPkCtfcfgIndInfo(cfgIndInfo, mBuf) != ROK) {
1658 #if (ERRCLASS & ERRCLS_ADD_RES)
1659       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1660          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1661             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1662             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
1663 #endif
1664          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
1665          SPutMsg(mBuf);
1666          return RFAILED;
1667       }
1668    }
1669    else if (pst->selector == ODU_SELECTOR_LWLC) {
1670
1671    if (oduPackPointer((PTR)cfgIndInfo, mBuf) != ROK) {
1672 #if (ERRCLASS & ERRCLS_ADD_RES)
1673       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1674          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1675             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1676             (ErrVal)ECTF018, (ErrVal)0, "Packing failed");
1677 #endif
1678          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
1679          SPutMsg(mBuf);
1680          return RFAILED;
1681       }
1682
1683    }
1684  if(cmPkCtfCfgTransId(transId, mBuf) != ROK) {
1685 #if (ERRCLASS & ERRCLS_ADD_RES)
1686       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1687       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1688          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1689          (ErrVal)ECTF019, (ErrVal)0, "Packing failed");
1690 #endif
1691       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
1692       SPutMsg(mBuf);
1693       return RFAILED;
1694    }
1695  if (SPkS16(spId, mBuf) != ROK) {
1696 #if (ERRCLASS & ERRCLS_ADD_RES)
1697       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1698       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1699          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1700          (ErrVal)ECTF020, (ErrVal)0, "Packing failed");
1701 #endif
1702       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
1703       SPutMsg(mBuf);
1704       return RFAILED;
1705    }
1706    if (pst->selector != ODU_SELECTOR_LWLC) {
1707       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
1708    }
1709    pst->event = (Event)EVTCTFCNMSYNCIND;
1710    return (SPstTsk(pst,mBuf));
1711
1712 }
1713
1714 /*---------------------------------------------------------------*/
1715
1716 S16 cmUnpkCtfCnmSyncIndMsg
1717 (
1718 CtfCnmCellSyncInd *param,
1719 Buffer *mBuf
1720 )
1721 {
1722
1723    CMCHKUNPK(cmUnpkCtfCnmVendorSpecificInfo, &param->ctfCnmVendorSpecificInfo, mBuf);
1724    CMCHKUNPK(oduPackUInt8, &param->status, mBuf);
1725    return ROK;
1726
1727 }
1728 /**
1729 * @brief Configuration Request from RRC to PHY for
1730  * cell or dedicated configuration.
1731 *
1732 * @details
1733 *
1734 *     Function: cmUnpkCtfCnmCellSyncInd
1735 *
1736 *  @param[in]   CtfCnmCellSyncIndMsg func
1737 *  @param[in]   Pst*  pst
1738 *  @param[in]   Buffer *mBuf
1739 *  @return   S16
1740 *      -# ROK
1741 **/
1742 S16 cmUnpkCtfCnmCellSyncInd
1743 (
1744 CtfCnmCellSyncIndMsg func,
1745 Pst *pst,
1746 Buffer *mBuf
1747 )
1748 {
1749
1750    SpId spId = 0;
1751    CtfCfgTransId transId;
1752    CtfCnmCellSyncInd *syncIndMsg = NULLP;
1753
1754    if (SUnpkS16(&spId, mBuf) != ROK) {
1755       SPutMsg(mBuf);
1756 #if (ERRCLASS & ERRCLS_ADD_RES)
1757       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1758       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1759          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1760          (ErrVal)ECTF022, (ErrVal)0, (Txt*)&"Packing failed");
1761 #endif
1762       return RFAILED;
1763    }
1764    if (cmUnpkCtfCfgTransId(&transId, mBuf) != ROK) {
1765       SPutMsg(mBuf);
1766 #if (ERRCLASS & ERRCLS_ADD_RES)
1767       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1768       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1769          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1770          (ErrVal)ECTF023, (ErrVal)0, (Txt*)&"Packing failed");
1771 #endif
1772       return RFAILED;
1773    }
1774    if (pst->selector != ODU_SELECTOR_LWLC) {
1775       if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&syncIndMsg, sizeof(CtfCnmCellSyncInd))) != ROK) {
1776 #if (ERRCLASS & ERRCLS_ADD_RES)
1777       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1778          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1779             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1780             (ErrVal)ECTF024, (ErrVal)0, (Txt*)&"Packing failed");
1781 #endif
1782          SPutMsg(mBuf);
1783          return RFAILED;
1784       }
1785    }
1786    if (pst->selector == ODU_SELECTOR_LWLC) {
1787       if (oduUnpackPointer((PTR *)&syncIndMsg, mBuf) != ROK) {
1788          SPutMsg(mBuf);
1789          return RFAILED;
1790       }
1791    }
1792   else if (pst->selector == ODU_SELECTOR_LC)
1793       if (cmUnpkCtfCnmSyncIndMsg(syncIndMsg, mBuf) != ROK) {
1794       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)syncIndMsg, sizeof(CtfCnmCellSyncInd));
1795       SPutMsg(mBuf);
1796 #if (ERRCLASS & ERRCLS_ADD_RES)
1797       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1798       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1799          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1800          (ErrVal)ECTF025, (ErrVal)0, (Txt*)&"Packing failed");
1801 #endif
1802       return RFAILED;
1803    }
1804    SPutMsg(mBuf);
1805    return ((*func)(pst, spId, &transId, syncIndMsg));
1806
1807 }
1808
1809 /********************************************************************************************************************************/
1810                               /*END OF CNM PACK & UNPACK FUNCTIONS*/
1811 /********************************************************************************************************************************/
1812
1813
1814
1815 \f
1816 /**
1817 * @brief Configuration Request from RRC to PHY for 
1818  * cell or dedicated configuration.
1819 *
1820 * @details
1821 *
1822 *     Function: cmPkCtfCfgReq
1823 *
1824 *  @param[in]   Pst*  pst
1825 *  @param[in]   SpId  spId
1826 *  @param[in]   CtfCfgTransId  transId
1827 *  @param[in]   CtfCfgReqInfo*  cfgReqInfo
1828 *  @return   S16
1829 *      -# ROK
1830 **/
1831 S16 cmPkCtfCfgReq
1832 (
1833 Pst* pst,
1834 SpId spId,
1835 CtfCfgTransId transId,
1836 CtfCfgReqInfo* cfgReqInfo
1837 )
1838 {
1839    Buffer *mBuf = NULLP;
1840
1841    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1842 #if (ERRCLASS & ERRCLS_ADD_RES)
1843       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1844       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1845          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1846          (ErrVal)ECTF016, (ErrVal)0, "Packing failed");
1847 #endif
1848       cmRelCtfCfgReq(pst, cfgReqInfo);     
1849       return RFAILED;
1850    }
1851    if (pst->selector == ODU_SELECTOR_LC) {
1852       if (cmPkCtfCfgReqInfo(cfgReqInfo, mBuf) != ROK) {
1853 #if (ERRCLASS & ERRCLS_ADD_RES)
1854       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1855          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1856             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1857             (ErrVal)ECTF017, (ErrVal)0, "Packing failed");
1858 #endif
1859          cmRelCtfCfgReq(pst, cfgReqInfo);     
1860          SPutMsg(mBuf);
1861          return RFAILED;
1862       }
1863    }
1864    else if (pst->selector == ODU_SELECTOR_LWLC) {
1865       if (oduPackPointer((PTR)cfgReqInfo, mBuf) != ROK) {
1866 #if (ERRCLASS & ERRCLS_ADD_RES)
1867       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1868          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1869             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1870             (ErrVal)ECTF018, (ErrVal)0, "Packing failed");
1871 #endif
1872          cmRelCtfCfgReq(pst, cfgReqInfo);     
1873          SPutMsg(mBuf);
1874          return RFAILED;
1875       }
1876    }
1877    if (cmPkCtfCfgTransId(&transId, mBuf) != ROK) {
1878 #if (ERRCLASS & ERRCLS_ADD_RES)
1879       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1880       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1881          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1882          (ErrVal)ECTF019, (ErrVal)0, "Packing failed");
1883 #endif
1884       cmRelCtfCfgReq(pst, cfgReqInfo);     
1885       SPutMsg(mBuf);
1886       return RFAILED;
1887    }
1888    if (SPkS16(spId, mBuf) != ROK) {
1889 #if (ERRCLASS & ERRCLS_ADD_RES)
1890       /* ctf_c_001.main_3 Compilation warning fix with g++ */
1891       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1892          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1893          (ErrVal)ECTF020, (ErrVal)0, "Packing failed");
1894 #endif
1895       cmRelCtfCfgReq(pst, cfgReqInfo);     
1896       SPutMsg(mBuf);
1897       return RFAILED;
1898    }
1899    if (pst->selector != ODU_SELECTOR_LWLC) {
1900          cmRelCtfCfgReq(pst, cfgReqInfo); 
1901    }
1902    pst->event = (Event) EVTCTFCFGREQ;
1903    return (SPstTsk(pst,mBuf));
1904 }
1905
1906 #ifdef TENB_AS_SECURITY
1907 /***********************************************************
1908 *
1909 *     Func: cmPkCtfKenbCfgInfo
1910 *
1911 *
1912 *     Desc:   Key derivation funtion Input Information
1913  * @details This funtion packs the the CtfKenbCfgInfo structure
1914  *           which contains the eNodeB key and Algorithm Type for
1915  *           deriving AS security keys.
1916  *
1917  *
1918  *     Ret : S16
1919  *
1920  *     Notes:
1921  *
1922  *     File:
1923  *
1924  **********************************************************/
1925 S16 cmUnpkCtfNhKeyInfo
1926 (
1927 CtfNhKeyInfo *param,
1928 Buffer *mBuf
1929 )
1930 {
1931
1932    uint8_t  idx;
1933         
1934    CMCHKUNPK(oduPackUInt16, &param->dlCarrFreq, mBuf);
1935    CMCHKUNPK(oduPackUInt16, &param->physCellId, mBuf);
1936    for(idx=0;idx<32;idx++)
1937    {
1938       CMCHKUNPK(oduPackUInt8,&param->secKey[idx],mBuf);
1939    }
1940    return ROK;
1941 }
1942
1943 /***********************************************************
1944 *
1945 *     Func: cmPkCtfKenbCfgInfo
1946 *
1947 *
1948 *     Desc:   Key derivation funtion Input Information
1949  * @details This funtion packs the the CtfKenbCfgInfo structure
1950  *           which contains the eNodeB key and Algorithm Type for
1951  *           deriving AS security keys.
1952  *
1953  *
1954  *     Ret : S16
1955  *
1956  *     Notes:
1957  *
1958  *     File:
1959  *
1960  **********************************************************/
1961 S16 cmUnpkCtfKenbStarInfo
1962 (
1963 CtfKenbStarInfo *param,
1964 Buffer *mBuf
1965 )
1966 {
1967
1968    uint8_t  idx;
1969
1970    CMCHKUNPK(oduPackUInt16, &param->dlCarrFreq, mBuf);
1971    CMCHKUNPK(oduPackUInt16, &param->physCellId, mBuf);
1972    for(idx=0;idx<32;idx++)
1973    {
1974       CMCHKUNPK(oduPackUInt8,&param->secKey[idx],mBuf);
1975    }
1976    return ROK;
1977 }
1978
1979
1980 /***********************************************************
1981 *
1982 *     Func: cmPkCtfKenbCfgInfo
1983 *
1984 *
1985 *     Desc:   Key derivation funtion Input Information
1986  * @details This funtion packs the the CtfKenbCfgInfo structure
1987  *           which contains the eNodeB key and Algorithm Type for
1988  *           deriving AS security keys.
1989  *
1990  *
1991  *     Ret : S16
1992  *
1993  *     Notes:
1994  *
1995  *     File:
1996  *
1997  **********************************************************/
1998 S16 cmUnpkCtfAskeyInfo
1999 (
2000 CtfAsKeyInfo *param,
2001 Buffer *mBuf
2002 )
2003 {
2004    uint8_t  idx;
2005
2006    CMCHKUNPK(oduPackUInt8, &param->intgAlgoType, mBuf);
2007    CMCHKUNPK(oduPackUInt8, &param->ciphAlgoType, mBuf);
2008    for(idx=0;idx<32;idx++)
2009    {
2010       CMCHKUNPK(oduPackUInt8,&param->secKey[idx],mBuf);
2011    }
2012    return ROK;
2013 }
2014
2015 /***********************************************************
2016  *
2017  *    Func: cmPkCtfKenbCfgInfo
2018  *
2019  *
2020  *    Desc:   Key derivation funtion Input Information
2021  * @details This funtion packs the the CtfKenbCfgInfo structure
2022  *           which contains the eNodeB key and Algorithm Type for
2023  *           deriving AS security keys.
2024  *
2025  *
2026  *     Ret : S16
2027  *
2028  *     Notes:
2029  *
2030  *     File:
2031  *
2032  *  **********************************************************/
2033 S16 cmUnpkCtfKdfReqInfo
2034 (
2035 CtfKdfReqInfo *param,
2036 Buffer *mBuf
2037 )
2038 {
2039
2040     CMCHKUNPK(oduPackUInt8, &param->keyDerType, mBuf);
2041      switch (param->keyDerType)
2042     {
2043        case CTF_KDF_TYPE1:
2044            CMCHKUNPK(cmUnpkCtfAskeyInfo, &param->u.kEnbInf, mBuf);
2045            break;
2046        case CTF_KDF_TYPE2:
2047           CMCHKUNPK(cmUnpkCtfKenbStarInfo, &param->u.kEnbStarInf, mBuf);
2048           break;
2049        case CTF_KDF_TYPE3:
2050           CMCHKUNPK(cmUnpkCtfNhKeyInfo, &param->u.nhKeyInf, mBuf);
2051            break;
2052        default :
2053           return RFAILED;
2054     }
2055    return ROK;
2056 }
2057
2058 /**
2059 * @brief Configuration Request from RRC to PHY for 
2060  * cell or dedicated configuration.
2061 *
2062 * @details
2063 *
2064 *     Function: cmUnpkCtfCfgReq
2065 *
2066 *  @param[in]   Pst*  pst
2067 *  @param[in]   SpId  spId
2068 *  @param[in]   CtfCfgTransId  transId
2069 *  @param[in]   CtfCfgReqInfo*  cfgReqInfo
2070 *  @return   S16
2071 *      -# ROK
2072 **/
2073 S16 cmUnpkCtfKdfReq
2074 (
2075 CtfKdfReq func,
2076 Pst *pst,
2077 Buffer *mBuf
2078 )
2079 {
2080    SpId spId = 0;
2081    CtfCfgTransId transId;
2082    CtfKdfReqInfo *kdfReqInfo = NULLP;
2083    
2084
2085    if (SUnpkS16(&spId, mBuf) != ROK) {
2086       SPutMsg(mBuf);
2087 #if (ERRCLASS & ERRCLS_ADD_RES)
2088       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2089       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2090          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2091          (ErrVal)ECTF022, (ErrVal)0, (Txt*)&"Packing failed");
2092 #endif
2093       return RFAILED;
2094    }
2095    
2096    if (cmUnpkCtfCfgTransId(&transId, mBuf) != ROK) {
2097       SPutMsg(mBuf);
2098 #if (ERRCLASS & ERRCLS_ADD_RES)
2099       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2100       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2101          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2102          (ErrVal)ECTF023, (ErrVal)0, (Txt*)&"Packing failed");
2103 #endif
2104       return RFAILED;
2105    }
2106    
2107    if (pst->selector != ODU_SELECTOR_LWLC) {
2108       if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&kdfReqInfo, sizeof(CtfKdfReqInfo))) != ROK) {
2109 #if (ERRCLASS & ERRCLS_ADD_RES)
2110       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2111          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2112             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2113             (ErrVal)ECTF024, (ErrVal)0, (Txt*)&"Packing failed");
2114 #endif
2115          SPutMsg(mBuf);
2116          return RFAILED;
2117       }
2118           
2119    }
2120    
2121    if (pst->selector == ODU_SELECTOR_LWLC) {
2122       /*if (oduUnpackPointer((PTR *)&cfgReqInfo, mBuf) != ROK) {
2123          SPutMsg(mBuf);
2124          return RFAILED;
2125       }*/
2126    }
2127    else if (pst->selector == ODU_SELECTOR_LC) 
2128       if (cmUnpkCtfKdfReqInfo(kdfReqInfo, mBuf) != ROK) {
2129       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
2130       SPutMsg(mBuf);
2131           #if (ERRCLASS & ERRCLS_ADD_RES)
2132       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2133       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2134          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2135          (ErrVal)ECTF025, (ErrVal)0, (Txt*)&"Packing failed");
2136 #endif
2137       return RFAILED;
2138    }
2139            SPutMsg(mBuf);
2140    return ((*func)(pst, spId, transId, kdfReqInfo));
2141 }
2142 #endif
2143
2144
2145 \f
2146 /**
2147 * @brief Configuration Request from RRC to PHY for 
2148  * cell or dedicated configuration.
2149 *
2150 * @details
2151 *
2152 *     Function: cmUnpkCtfCfgReq
2153 *
2154 *  @param[in]   Pst*  pst
2155 *  @param[in]   SpId  spId
2156 *  @param[in]   CtfCfgTransId  transId
2157 *  @param[in]   CtfCfgReqInfo*  cfgReqInfo
2158 *  @return   S16
2159 *      -# ROK
2160 **/
2161 S16 cmUnpkCtfCfgReq
2162 (
2163 CtfCfgReq func,
2164 Pst *pst,
2165 Buffer *mBuf
2166 )
2167 {
2168    SpId spId = 0;
2169    CtfCfgTransId transId;
2170    CtfCfgReqInfo *cfgReqInfo = NULLP;
2171    
2172
2173    if (SUnpkS16(&spId, mBuf) != ROK) {
2174       SPutMsg(mBuf);
2175 #if (ERRCLASS & ERRCLS_ADD_RES)
2176       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2177       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2178          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2179          (ErrVal)ECTF022, (ErrVal)0, (Txt*)&"Packing failed");
2180 #endif
2181       return RFAILED;
2182    }
2183    if (cmUnpkCtfCfgTransId(&transId, mBuf) != ROK) {
2184       SPutMsg(mBuf);
2185 #if (ERRCLASS & ERRCLS_ADD_RES)
2186       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2187       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2188          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2189          (ErrVal)ECTF023, (ErrVal)0, (Txt*)&"Packing failed");
2190 #endif
2191       return RFAILED;
2192    }
2193    if (pst->selector != ODU_SELECTOR_LWLC) {
2194       if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&cfgReqInfo, sizeof(CtfCfgReqInfo))) != ROK) {
2195 #if (ERRCLASS & ERRCLS_ADD_RES)
2196       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2197          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2198             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2199             (ErrVal)ECTF024, (ErrVal)0, (Txt*)&"Packing failed");
2200 #endif
2201          SPutMsg(mBuf);
2202          return RFAILED;
2203       }
2204    }
2205    if (pst->selector == ODU_SELECTOR_LWLC) {
2206       if (oduUnpackPointer((PTR *)&cfgReqInfo, mBuf) != ROK) {
2207          SPutMsg(mBuf);
2208          return RFAILED;
2209       }
2210    }
2211    else if (pst->selector == ODU_SELECTOR_LC) 
2212       if (cmUnpkCtfCfgReqInfo(pst,cfgReqInfo, mBuf) != ROK) {
2213       cmRelCtfCfgReq(pst, cfgReqInfo);
2214       SPutMsg(mBuf);
2215 #if (ERRCLASS & ERRCLS_ADD_RES)
2216       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2217       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2218          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2219          (ErrVal)ECTF025, (ErrVal)0, (Txt*)&"Packing failed");
2220 #endif
2221       return RFAILED;
2222    }
2223    SPutMsg(mBuf);
2224    return ((*func)(pst, spId, transId, cfgReqInfo));
2225 }
2226
2227 #ifdef TENB_AS_SECURITY
2228 /***********************************************************
2229 *
2230 *     Func: cmPkCtfKenbCfgInfo
2231 *
2232 *
2233 *     Desc:   Key derivation funtion Input Information
2234  * @details This funtion packs the the CtfKenbCfgInfo structure
2235  *           which contains the eNodeB key and Algorithm Type for
2236  *           deriving AS security keys.
2237  *
2238  *
2239  *     Ret : S16
2240  *
2241  *     Notes:
2242  *
2243  *     File:
2244  *
2245  **********************************************************/
2246 S16 cmPkCtfNhKeyCfmInfo
2247 (
2248 CtfNhKeyCfmInfo *param,
2249 Buffer *mBuf
2250 )
2251 {
2252
2253    S16  idx;
2254          
2255    for(idx=31;idx>=0;idx--)
2256    {
2257       CMCHKPK(oduUnpackUInt8,param->secKey[idx],mBuf);
2258    }
2259    return ROK;
2260 }
2261
2262 /***********************************************************
2263 *
2264 *     Func: cmPkCtfKenbCfgInfo
2265 *
2266 *
2267 *     Desc:   Key derivation funtion Input Information
2268  * @details This funtion packs the the CtfKenbCfgInfo structure
2269  *           which contains the eNodeB key and Algorithm Type for
2270  *           deriving AS security keys.
2271  *
2272  *
2273  *     Ret : S16
2274  *
2275  *     Notes:
2276  *
2277  *     File:
2278  *
2279  **********************************************************/
2280 S16 cmPkCtfKenbStarCfmInfo
2281 (
2282 CtfKenbStarCfmInfo *param,
2283 Buffer *mBuf
2284 )
2285 {
2286
2287    S16  idx;
2288
2289          
2290    for(idx=31;idx>=0;idx--)
2291    {
2292       CMCHKPK(oduUnpackUInt8,param->secKey[idx],mBuf);
2293    }
2294    return ROK;
2295 }
2296
2297
2298 /***********************************************************
2299 *
2300 *     Func: cmPkCtfKenbCfgInfo
2301 *
2302 *
2303 *     Desc:   Key derivation funtion Input Information
2304  * @details This funtion packs the the CtfKenbCfgInfo structure
2305  *           which contains the eNodeB key and Algorithm Type for
2306  *           deriving AS security keys.
2307  *
2308  *
2309  *     Ret : S16
2310  *
2311  *     Notes:
2312  *
2313  *     File:
2314  *
2315  **********************************************************/
2316 S16 cmPkCtfAskeyCfmInfo
2317 (
2318 CtfAskeyCfmInfo *param,
2319 Buffer *mBuf
2320 )
2321 {
2322
2323    S16  idx;
2324
2325    for(idx=15;idx>=0;idx--)
2326    {
2327       CMCHKPK(oduUnpackUInt8,param->cpCiphKey[idx],mBuf);
2328    }
2329    for(idx=15;idx>=0;idx--)
2330    {
2331       CMCHKPK(oduUnpackUInt8,param->upCiphKey[idx],mBuf);
2332    }
2333    for(idx=15;idx>=0;idx--)
2334    {
2335       CMCHKPK(oduUnpackUInt8,param->intKey[idx],mBuf);
2336    }
2337    return ROK;
2338 }
2339
2340 /***********************************************************
2341  *
2342  *    Func: cmPkCtfKenbCfgInfo
2343  *
2344  *
2345  *    Desc:   Key derivation funtion Input Information
2346  * @details This funtion packs the the CtfKenbCfgInfo structure
2347  *           which contains the eNodeB key and Algorithm Type for
2348  *           deriving AS security keys.
2349  *
2350  *
2351  *     Ret : S16
2352  *
2353  *     Notes:
2354  *
2355  *     File:
2356  *
2357  *  **********************************************************/
2358 S16 cmPkCtfKdfCfmInfo
2359 (
2360 CtfKdfCfmInfo *param,
2361 Buffer *mBuf
2362 )
2363 {
2364
2365    switch (param->keyDerType)
2366    {
2367          case CTF_KDF_TYPE1:
2368              CMCHKPK(cmPkCtfAskeyCfmInfo, &param->u.kEnbInf, mBuf);
2369              break;
2370          case CTF_KDF_TYPE2:
2371             CMCHKPK(cmPkCtfKenbStarCfmInfo, &param->u.kEnbStarInf, mBuf);
2372             break;
2373          case CTF_KDF_TYPE3:
2374             CMCHKPK(cmPkCtfNhKeyCfmInfo, &param->u.nhKeyInf, mBuf);
2375              break;
2376          default :
2377             return RFAILED;
2378     }
2379     CMCHKPK(oduUnpackUInt8, param->keyDerType, mBuf);
2380    return ROK;
2381 }
2382
2383 /**
2384 * @brief Configuration Confirm from PHY to RRC.
2385 *
2386 * @details
2387 *
2388 *     Function: cmPkCtfCfgCfm
2389 *
2390 *  @param[in]   Pst*  pst
2391 *  @param[in]   SuId  suId
2392 *  @param[in]   CtfCfgTransId  transId
2393 *  @param[in]   uint8_t  status
2394 *  @return   S16
2395 *      -# ROK
2396 **/
2397 S16 cmPkCtfKdfCfm
2398 (
2399 Pst* pst,
2400 SuId suId,
2401 CtfCfgTransId transId,
2402 CtfKdfCfmInfo *kdfCfmInfo,
2403 uint8_t status
2404 )
2405 {
2406    Buffer *mBuf = NULLP;
2407
2408    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2409 #if (ERRCLASS & ERRCLS_ADD_RES)
2410       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2411       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2412          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2413          (ErrVal)ECTF026, (ErrVal)0, (Txt*)&"Packing failed");
2414 #endif
2415       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
2416       return RFAILED;
2417    }
2418
2419    if (oduUnpackUInt8(status, mBuf) != ROK) {
2420 #if (ERRCLASS & ERRCLS_ADD_RES)
2421       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2422       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2423          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2424          (ErrVal)ECTF027, (ErrVal)0, (Txt*)&"Packing failed");
2425 #endif
2426       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
2427       SPutMsg(mBuf);
2428       return RFAILED;
2429    }
2430
2431    if (cmPkCtfKdfCfmInfo(kdfCfmInfo, mBuf) != ROK) {
2432 #if (ERRCLASS & ERRCLS_ADD_RES)
2433       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2434       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2435          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2436          (ErrVal)ECTF028, (ErrVal)0, (Txt*)&"Packing failed");
2437 #endif
2438       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
2439       SPutMsg(mBuf);
2440       return RFAILED;
2441    }
2442
2443    if (cmPkCtfCfgTransId(&transId, mBuf) != ROK) {
2444 #if (ERRCLASS & ERRCLS_ADD_RES)
2445       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2446       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2447          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2448          (ErrVal)ECTF028, (ErrVal)0, (Txt*)&"Packing failed");
2449 #endif
2450       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
2451       SPutMsg(mBuf);
2452       return RFAILED;
2453    }
2454
2455    if (SPkS16(suId, mBuf) != ROK) {
2456 #if (ERRCLASS & ERRCLS_ADD_RES)
2457       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2458       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2459          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2460          (ErrVal)ECTF029, (ErrVal)0, (Txt*)&"Packing failed");
2461 #endif
2462       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
2463       SPutMsg(mBuf);
2464       return RFAILED;
2465    }
2466
2467    if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo)) != ROK) 
2468    {
2469 #if (ERRCLASS & ERRCLS_ADD_RES)
2470    /* ctf_c_001.main_3 Compilation warning fix with g++ */
2471    SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2472       (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2473       (ErrVal)ECTF021, (ErrVal)0, (Txt*)&"Packing failed");
2474 #endif
2475      SPutMsg(mBuf);
2476      return RFAILED;
2477    }
2478
2479    pst->event = (Event) EVTCTFKDFCFM;
2480    return (SPstTsk(pst,mBuf));
2481 }
2482 #endif
2483 \f
2484 /**
2485 * @brief Configuration Confirm from PHY to RRC.
2486 *
2487 * @details
2488 *
2489 *     Function: cmPkCtfCfgCfm
2490 *
2491 *  @param[in]   Pst*  pst
2492 *  @param[in]   SuId  suId
2493 *  @param[in]   CtfCfgTransId  transId
2494 *  @param[in]   uint8_t  status
2495 *  @return   S16
2496 *      -# ROK
2497 **/
2498 S16 cmPkCtfCfgCfm
2499 (
2500 Pst* pst,
2501 SuId suId,
2502 CtfCfgTransId transId,
2503 uint8_t status
2504 )
2505 {
2506    Buffer *mBuf = NULLP;
2507
2508    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2509 #if (ERRCLASS & ERRCLS_ADD_RES)
2510       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2511       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2512          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2513          (ErrVal)ECTF026, (ErrVal)0, (Txt*)&"Packing failed");
2514 #endif
2515       return RFAILED;
2516    }
2517    if (oduUnpackUInt8(status, mBuf) != ROK) {
2518 #if (ERRCLASS & ERRCLS_ADD_RES)
2519       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2520       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2521          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2522          (ErrVal)ECTF027, (ErrVal)0, (Txt*)&"Packing failed");
2523 #endif
2524       SPutMsg(mBuf);
2525       return RFAILED;
2526    }
2527    if (cmPkCtfCfgTransId(&transId, mBuf) != ROK) {
2528 #if (ERRCLASS & ERRCLS_ADD_RES)
2529       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2530       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2531          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2532          (ErrVal)ECTF028, (ErrVal)0, (Txt*)&"Packing failed");
2533 #endif
2534       SPutMsg(mBuf);
2535       return RFAILED;
2536    }
2537    if (SPkS16(suId, mBuf) != ROK) {
2538 #if (ERRCLASS & ERRCLS_ADD_RES)
2539       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2540       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2541          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2542          (ErrVal)ECTF029, (ErrVal)0, (Txt*)&"Packing failed");
2543 #endif
2544       SPutMsg(mBuf);
2545       return RFAILED;
2546    }
2547    pst->event = (Event) EVTCTFCFGCFM;
2548    return (SPstTsk(pst,mBuf));
2549 }
2550
2551 /**
2552 * @brief ENB STOP Indication from PHY to ENB-APP.
2553 *
2554 * @details
2555 *
2556 *     Function: cmPkCtfEnbStopInd
2557 *
2558 *  @param[in]   Pst*  pst
2559 *  @param[in]   SuId  suId
2560 *  @param[in]   CtfCfgTransId  transId
2561 *  @return   S16
2562 *      -# ROK
2563 **/
2564 S16 cmPkCtfEnbStopInd
2565 (
2566 Pst* pst,
2567 SuId suId,
2568 CtfCfgTransId transId
2569 )
2570 {
2571    Buffer *mBuf = NULLP;
2572
2573    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2574 #if (ERRCLASS & ERRCLS_ADD_RES)
2575       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2576       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2577          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2578          (ErrVal)ECTF026, (ErrVal)0, (Txt*)&"Packing failed");
2579 #endif
2580       return RFAILED;
2581    }
2582    if (cmPkCtfCfgTransId(&transId, mBuf) != ROK) {
2583 #if (ERRCLASS & ERRCLS_ADD_RES)
2584       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2585       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2586          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2587          (ErrVal)ECTF028, (ErrVal)0, (Txt*)&"Packing failed");
2588 #endif
2589       SPutMsg(mBuf);
2590       return RFAILED;
2591    }
2592    if (SPkS16(suId, mBuf) != ROK) {
2593 #if (ERRCLASS & ERRCLS_ADD_RES)
2594       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2595       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2596          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2597          (ErrVal)ECTF029, (ErrVal)0, (Txt*)&"Packing failed");
2598 #endif
2599       SPutMsg(mBuf);
2600       return RFAILED;
2601    }
2602    pst->event = (Event) EVTCTFENBSTOPIND;
2603    return (SPstTsk(pst,mBuf));
2604 }
2605
2606 #ifdef TENB_AS_SECURITY
2607 /***********************************************************
2608 *
2609 *     Func: cmPkCtfKenbCfgInfo
2610 *
2611 *
2612 *     Desc:   Key derivation funtion Input Information
2613  * @details This funtion packs the the CtfKenbCfgInfo structure
2614  *           which contains the eNodeB key and Algorithm Type for
2615  *           deriving AS security keys.
2616  *
2617  *
2618  *     Ret : S16
2619  *
2620  *     Notes:
2621  *
2622  *     File:
2623  *
2624  **********************************************************/
2625 S16 cmUnpkCtfNhKeyCfmInfo
2626 (
2627 CtfNhKeyCfmInfo *param,
2628 Buffer *mBuf
2629 )
2630 {
2631
2632    uint8_t  idx;
2633
2634    for(idx=0;idx<32;idx++)
2635    {
2636       CMCHKUNPK(oduPackUInt8,&param->secKey[idx],mBuf);
2637    }
2638    return ROK;
2639 }
2640
2641 /***********************************************************
2642 *
2643 *     Func: cmPkCtfKenbCfgInfo
2644 *
2645 *
2646 *     Desc:   Key derivation funtion Input Information
2647  * @details This funtion packs the the CtfKenbCfgInfo structure
2648  *           which contains the eNodeB key and Algorithm Type for
2649  *           deriving AS security keys.
2650  *
2651  *
2652  *     Ret : S16
2653  *
2654  *     Notes:
2655  *
2656  *     File:
2657  *
2658  **********************************************************/
2659 S16 cmUnpkCtfKenbStarCfmInfo
2660 (
2661 CtfKenbStarCfmInfo *param,
2662 Buffer *mBuf
2663 )
2664 {
2665
2666    uint8_t  idx;
2667          
2668    for(idx=0;idx<32;idx++)
2669    {
2670       CMCHKUNPK(oduPackUInt8,&param->secKey[idx],mBuf);
2671    }
2672    return ROK;
2673 }
2674
2675
2676 /***********************************************************
2677 *
2678 *     Func: cmPkCtfKenbCfgInfo
2679 *
2680 *
2681 *     Desc:   Key derivation funtion Input Information
2682  * @details This funtion packs the the CtfKenbCfgInfo structure
2683  *           which contains the eNodeB key and Algorithm Type for
2684  *           deriving AS security keys.
2685  *
2686  *
2687  *     Ret : S16
2688  *
2689  *     Notes:
2690  *
2691  *     File:
2692  *
2693  **********************************************************/
2694 S16 cmUnpkCtfAskeyCfmInfo
2695 (
2696 CtfAskeyCfmInfo *param,
2697 Buffer *mBuf
2698 )
2699 {
2700
2701    uint8_t  idx;
2702
2703          
2704    for(idx=0;idx<16;idx++)
2705    {
2706       CMCHKUNPK(oduPackUInt8,&param->intKey[idx],mBuf);
2707    }
2708    for(idx=0;idx<16;idx++)
2709    {
2710       CMCHKUNPK(oduPackUInt8,&param->upCiphKey[idx],mBuf);
2711    }
2712    for(idx=0;idx<16;idx++)
2713    {
2714       CMCHKUNPK(oduPackUInt8,&param->cpCiphKey[idx],mBuf);
2715    }
2716    return ROK;
2717 }
2718
2719 /***********************************************************
2720  *
2721  *    Func: cmPkCtfKenbCfgInfo
2722  *
2723  *
2724  *    Desc:   Key derivation funtion Input Information
2725  * @details This funtion packs the the CtfKenbCfgInfo structure
2726  *           which contains the eNodeB key and Algorithm Type for
2727  *           deriving AS security keys.
2728  *
2729  *
2730  *     Ret : S16
2731  *
2732  *     Notes:
2733  *
2734  *     File:
2735  *
2736  *  **********************************************************/
2737 S16 cmUnpkCtfKdfCfmInfo
2738 (
2739 CtfKdfCfmInfo *param,
2740 Buffer *mBuf
2741 )
2742 {
2743
2744
2745     CMCHKUNPK(oduPackUInt8, &param->keyDerType, mBuf);
2746    switch (param->keyDerType)
2747     {
2748          case CTF_KDF_TYPE1:
2749              CMCHKUNPK(cmUnpkCtfAskeyCfmInfo, &param->u.kEnbInf, mBuf);
2750              break;
2751          case CTF_KDF_TYPE2:
2752             CMCHKUNPK(cmUnpkCtfKenbStarCfmInfo, &param->u.kEnbStarInf, mBuf);
2753             break;
2754          case CTF_KDF_TYPE3:
2755             CMCHKUNPK(cmUnpkCtfNhKeyCfmInfo, &param->u.nhKeyInf, mBuf);
2756              break;
2757          default :
2758             return RFAILED;
2759     }
2760    return ROK;
2761 }
2762
2763 /**
2764 * @brief Configuration Confirm from PHY to RRC.
2765 *
2766 * @details
2767 *
2768 *     Function: cmUnpkCtfCfgCfm
2769 *
2770 *  @param[in]   Pst*  pst
2771 *  @param[in]   SuId  suId
2772 *  @param[in]   CtfCfgTransId  transId
2773 *  @param[in]   uint8_t  status
2774 *  @return   S16
2775 *      -# ROK
2776 **/
2777 S16 cmUnpkCtfKdfCfm
2778 (
2779 CtfKdfCfm func,
2780 Pst *pst,
2781 Buffer *mBuf
2782 )
2783 {
2784    SuId suId = 0;
2785    CtfCfgTransId transId;
2786    uint8_t status;
2787    CtfKdfCfmInfo kdfCfmInfo;
2788    
2789
2790    if (SUnpkS16(&suId, mBuf) != ROK) {
2791       SPutMsg(mBuf);
2792 #if (ERRCLASS & ERRCLS_ADD_RES)
2793       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2794       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2795          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2796          (ErrVal)ECTF030, (ErrVal)0, (Txt*)&"Packing failed");
2797 #endif
2798       return RFAILED;
2799    }
2800    if (cmUnpkCtfCfgTransId(&transId, mBuf) != ROK) {
2801       SPutMsg(mBuf);
2802 #if (ERRCLASS & ERRCLS_ADD_RES)
2803       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2804       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2805          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2806          (ErrVal)ECTF031, (ErrVal)0, (Txt*)&"Packing failed");
2807 #endif
2808       return RFAILED;
2809    }
2810    if (cmUnpkCtfKdfCfmInfo(&kdfCfmInfo, mBuf) != ROK) {
2811       SPutMsg(mBuf);
2812 #if (ERRCLASS & ERRCLS_ADD_RES)
2813       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2814       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2815          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2816          (ErrVal)ECTF031, (ErrVal)0, (Txt*)&"Packing failed");
2817 #endif
2818       return RFAILED;
2819    }
2820
2821    if (oduPackUInt8(&status, mBuf) != ROK) {
2822       SPutMsg(mBuf);
2823 #if (ERRCLASS & ERRCLS_ADD_RES)
2824       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2825       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2826          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2827          (ErrVal)ECTF032, (ErrVal)0, (Txt*)&"Packing failed");
2828 #endif
2829       return RFAILED;
2830    }
2831    SPutMsg(mBuf);
2832    return ((*func)(pst, suId, transId,&kdfCfmInfo, status));
2833 }
2834 #endif
2835
2836 \f
2837 /**
2838 * @brief Configuration Confirm from PHY to RRC.
2839 *
2840 * @details
2841 *
2842 *     Function: cmUnpkCtfCfgCfm
2843 *
2844 *  @param[in]   Pst*  pst
2845 *  @param[in]   SuId  suId
2846 *  @param[in]   CtfCfgTransId  transId
2847 *  @param[in]   uint8_t  status
2848 *  @return   S16
2849 *      -# ROK
2850 **/
2851 S16 cmUnpkCtfCfgCfm
2852 (
2853 CtfCfgCfm func,
2854 Pst *pst,
2855 Buffer *mBuf
2856 )
2857 {
2858    SuId suId = 0;
2859    CtfCfgTransId transId;
2860    uint8_t status;
2861    
2862
2863    if (SUnpkS16(&suId, mBuf) != ROK) {
2864       SPutMsg(mBuf);
2865 #if (ERRCLASS & ERRCLS_ADD_RES)
2866       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2867       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2868          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2869          (ErrVal)ECTF030, (ErrVal)0, (Txt*)&"Packing failed");
2870 #endif
2871       return RFAILED;
2872    }
2873    if (cmUnpkCtfCfgTransId(&transId, mBuf) != ROK) {
2874       SPutMsg(mBuf);
2875 #if (ERRCLASS & ERRCLS_ADD_RES)
2876       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2877       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2878          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2879          (ErrVal)ECTF031, (ErrVal)0, (Txt*)&"Packing failed");
2880 #endif
2881       return RFAILED;
2882    }
2883    if (oduPackUInt8(&status, mBuf) != ROK) {
2884       SPutMsg(mBuf);
2885 #if (ERRCLASS & ERRCLS_ADD_RES)
2886       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2887       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2888          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2889          (ErrVal)ECTF032, (ErrVal)0, (Txt*)&"Packing failed");
2890 #endif
2891       return RFAILED;
2892    }
2893    SPutMsg(mBuf);
2894    return ((*func)(pst, suId, transId, status));
2895 }
2896
2897 /**
2898 * @brief ENB STOP Indication from PHY to ENB-APP
2899 *
2900 * @details
2901 *
2902 *     Function: cmUnpkCtfEnbStopInd
2903 *
2904 *  @param[in]   Pst*  pst
2905 *  @param[in]   SuId  suId
2906 *  @param[in]   CtfCfgTransId  transId
2907 *  @return   S16
2908 *      -# ROK
2909 **/
2910 S16 cmUnpkCtfEnbStopInd
2911 (
2912 CtfEnbStopInd func,
2913 Pst *pst,
2914 Buffer *mBuf
2915 )
2916 {
2917    SuId suId = 0;
2918    CtfCfgTransId transId;
2919
2920    if (SUnpkS16(&suId, mBuf) != ROK) {
2921       SPutMsg(mBuf);
2922 #if (ERRCLASS & ERRCLS_ADD_RES)
2923       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2924       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2925          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2926          (ErrVal)ECTF030, (ErrVal)0, (Txt*)&"Packing failed");
2927 #endif
2928       return RFAILED;
2929    }
2930    if (cmUnpkCtfCfgTransId(&transId, mBuf) != ROK) {
2931       SPutMsg(mBuf);
2932 #if (ERRCLASS & ERRCLS_ADD_RES)
2933       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2934       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2935          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2936          (ErrVal)ECTF031, (ErrVal)0, (Txt*)&"Packing failed");
2937 #endif
2938       return RFAILED;
2939    }
2940    SPutMsg(mBuf);
2941    return ((*func)(pst, suId, transId));
2942 }
2943
2944 \f
2945 /**
2946 * @brief UE ID Change Request from RRC to PHY.
2947 *
2948 * @details
2949 *
2950 *     Function: cmPkCtfUeIdChgReq
2951 *
2952 *  @param[in]   Pst*  pst
2953 *  @param[in]   SpId  spId
2954 *  @param[in]   CtfCfgTransId  transId
2955 *  @param[in]   CtfUeInfo *  ueInfo
2956 *  @param[in]   CtfUeInfo *  newUeInfo
2957 *  @return   S16
2958 *      -# ROK
2959 **/
2960 S16 cmPkCtfUeIdChgReq
2961 (
2962 Pst* pst,
2963 SpId spId,
2964 CtfCfgTransId transId,
2965 CtfUeInfo * ueInfo,
2966 CtfUeInfo * newUeInfo
2967 )
2968 {
2969    Buffer *mBuf = NULLP;
2970
2971    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2972 #if (ERRCLASS & ERRCLS_ADD_RES)
2973       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2974       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2975          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2976          (ErrVal)ECTF033, (ErrVal)0, (Txt*)&"Packing failed");
2977 #endif
2978       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
2979       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
2980       return RFAILED;
2981    }
2982    if (pst->selector == ODU_SELECTOR_LC) {
2983       if (cmPkCtfUeInfo(newUeInfo, mBuf) != ROK) {
2984 #if (ERRCLASS & ERRCLS_ADD_RES)
2985       /* ctf_c_001.main_3 Compilation warning fix with g++ */
2986          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2987             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2988             (ErrVal)ECTF034, (ErrVal)0, (Txt*)&"Packing failed");
2989 #endif
2990          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
2991          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
2992          SPutMsg(mBuf);
2993          return RFAILED;
2994       }
2995    }
2996    else if (pst->selector == ODU_SELECTOR_LWLC) {
2997       if (oduPackPointer((PTR)newUeInfo, mBuf) != ROK) {
2998 #if (ERRCLASS & ERRCLS_ADD_RES)
2999       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3000          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3001             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3002             (ErrVal)ECTF035, (ErrVal)0, (Txt*)&"Packing failed");
3003 #endif
3004          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3005          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
3006          SPutMsg(mBuf);
3007          return RFAILED;
3008       }
3009    }
3010    if (pst->selector == ODU_SELECTOR_LC) {
3011       if (cmPkCtfUeInfo(ueInfo, mBuf) != ROK) {
3012 #if (ERRCLASS & ERRCLS_ADD_RES)
3013       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3014          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3015             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3016             (ErrVal)ECTF036, (ErrVal)0, (Txt*)&"Packing failed");
3017 #endif
3018          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3019          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
3020          SPutMsg(mBuf);
3021          return RFAILED;
3022       }
3023    }
3024    else if (pst->selector == ODU_SELECTOR_LWLC) {
3025       if (oduPackPointer((PTR)ueInfo, mBuf) != ROK) {
3026 #if (ERRCLASS & ERRCLS_ADD_RES)
3027       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3028          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3029             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3030             (ErrVal)ECTF037, (ErrVal)0, (Txt*)&"Packing failed");
3031 #endif
3032          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3033          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
3034          SPutMsg(mBuf);
3035          return RFAILED;
3036       }
3037    }
3038    if (cmPkCtfCfgTransId(&transId, mBuf) != ROK) {
3039 #if (ERRCLASS & ERRCLS_ADD_RES)
3040       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3041       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3042          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3043          (ErrVal)ECTF038, (ErrVal)0, (Txt*)&"Packing failed");
3044 #endif
3045       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3046       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
3047       SPutMsg(mBuf);
3048       return RFAILED;
3049    }
3050    if (SPkS16(spId, mBuf) != ROK) {
3051 #if (ERRCLASS & ERRCLS_ADD_RES)
3052       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3053       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3054          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3055          (ErrVal)ECTF039, (ErrVal)0, (Txt*)&"Packing failed");
3056 #endif
3057       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3058       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
3059       SPutMsg(mBuf);
3060       return RFAILED;
3061    }
3062    if (pst->selector != ODU_SELECTOR_LWLC) {
3063       if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo)) != ROK) {
3064 #if (ERRCLASS & ERRCLS_ADD_RES)
3065       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3066       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3067          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3068          (ErrVal)ECTF040, (ErrVal)0, (Txt*)&"Packing failed");
3069 #endif
3070          SPutMsg(mBuf);
3071          return RFAILED;
3072       }
3073       if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo)) != ROK) {
3074 #if (ERRCLASS & ERRCLS_ADD_RES)
3075       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3076       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3077          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3078          (ErrVal)ECTF041, (ErrVal)0, (Txt*)&"Packing failed");
3079 #endif
3080          SPutMsg(mBuf);
3081          return RFAILED;
3082       }
3083    }
3084    pst->event = (Event) EVTCTFUEIDCHGREQ;
3085    return (SPstTsk(pst,mBuf));
3086 }
3087
3088 \f
3089 /**
3090 * @brief UE ID Change Request from RRC to PHY.
3091 *
3092 * @details
3093 *
3094 *     Function: cmUnpkCtfUeIdChgReq
3095 *
3096 *  @param[in]   Pst*  pst
3097 *  @param[in]   SpId  spId
3098 *  @param[in]   CtfCfgTransId  transId
3099 *  @param[in]   CtfUeInfo *  ueInfo
3100 *  @param[in]   CtfUeInfo *  newUeInfo
3101 *  @return   S16
3102 *      -# ROK
3103 **/
3104 S16 cmUnpkCtfUeIdChgReq
3105 (
3106 CtfUeIdChgReq func,
3107 Pst *pst,
3108 Buffer *mBuf
3109 )
3110 {
3111    SpId spId = 0;
3112    CtfCfgTransId transId;
3113    CtfUeInfo *ueInfo = NULLP;
3114    CtfUeInfo *newUeInfo = NULLP;
3115    
3116
3117    if (SUnpkS16(&spId, mBuf) != ROK) {
3118       SPutMsg(mBuf);
3119 #if (ERRCLASS & ERRCLS_ADD_RES)
3120       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3121       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3122         (Txt*)& __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3123          (ErrVal)ECTF042, (ErrVal)0, (Txt*)&"Packing failed");
3124 #endif
3125       return RFAILED;
3126    }
3127    if (cmUnpkCtfCfgTransId(&transId, mBuf) != ROK) {
3128       SPutMsg(mBuf);
3129 #if (ERRCLASS & ERRCLS_ADD_RES)
3130       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3131       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3132          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3133          (ErrVal)ECTF043, (ErrVal)0, (Txt*)&"Packing failed");
3134 #endif
3135       return RFAILED;
3136    }
3137    if (pst->selector != ODU_SELECTOR_LWLC) {
3138       if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&ueInfo, sizeof(CtfUeInfo))) != ROK) {
3139 #if (ERRCLASS & ERRCLS_ADD_RES)
3140       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3141          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3142             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3143             (ErrVal)ECTF044, (ErrVal)0, (Txt*)&"Packing failed");
3144 #endif
3145          SPutMsg(mBuf);
3146          return RFAILED;
3147       }
3148    }
3149    if (pst->selector == ODU_SELECTOR_LWLC) {
3150       if (oduUnpackPointer((PTR *)&ueInfo, mBuf) != ROK) {
3151          SPutMsg(mBuf);
3152          return RFAILED;
3153       }
3154    }
3155    else if (pst->selector == ODU_SELECTOR_LC) 
3156       if (cmUnpkCtfUeInfo(ueInfo, mBuf) != ROK) {
3157       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3158       SPutMsg(mBuf);
3159 #if (ERRCLASS & ERRCLS_ADD_RES)
3160       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3161       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3162          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3163          (ErrVal)ECTF045, (ErrVal)0, (Txt*)&"Packing failed");
3164 #endif
3165       return RFAILED;
3166    }
3167    if (pst->selector != ODU_SELECTOR_LWLC) {
3168       if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&newUeInfo, sizeof(CtfUeInfo))) != ROK) {
3169 #if (ERRCLASS & ERRCLS_ADD_RES)
3170       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3171          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3172             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3173             (ErrVal)ECTF046, (ErrVal)0, (Txt*)&"Packing failed");
3174 #endif
3175          SPutMsg(mBuf);
3176          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3177          return RFAILED;
3178       }
3179    }
3180    if (pst->selector == ODU_SELECTOR_LWLC) {
3181       if (oduUnpackPointer((PTR *)&newUeInfo, mBuf) != ROK) {
3182          SPutMsg(mBuf);
3183          return RFAILED;
3184       }
3185    }
3186    else if (pst->selector == ODU_SELECTOR_LC) 
3187       if (cmUnpkCtfUeInfo(newUeInfo, mBuf) != ROK) {
3188       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3189       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
3190       SPutMsg(mBuf);
3191 #if (ERRCLASS & ERRCLS_ADD_RES)
3192       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3193       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3194          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3195          (ErrVal)ECTF047, (ErrVal)0, (Txt*)&"Packing failed");
3196 #endif
3197       return RFAILED;
3198    }
3199    SPutMsg(mBuf);
3200    return ((*func)(pst, spId, transId, ueInfo, newUeInfo));
3201 }
3202
3203 \f
3204 /**
3205 * @brief UE ID Change Confirm from PHY to RRC.
3206 *
3207 * @details
3208 *
3209 *     Function: cmPkCtfUeIdChgCfm
3210 *
3211 *  @param[in]   Pst*  pst
3212 *  @param[in]   SuId  suId
3213 *  @param[in]   CtfCfgTransId  transId
3214 *  @param[in]   CtfUeInfo *  ueInfo
3215 *  @param[in]   uint8_t  status
3216 *  @return   S16
3217 *      -# ROK
3218 **/
3219 S16 cmPkCtfUeIdChgCfm
3220 (
3221 Pst* pst,
3222 SuId suId,
3223 CtfCfgTransId transId,
3224 CtfUeInfo * ueInfo,
3225 CmStatus status
3226 )
3227 {
3228    Buffer *mBuf = NULLP;
3229
3230    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3231 #if (ERRCLASS & ERRCLS_ADD_RES)
3232       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3233       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3234          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3235          (ErrVal)ECTF048, (ErrVal)0, (Txt*)&"Packing failed");
3236 #endif
3237       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3238       return RFAILED;
3239    }
3240    if (cmPkCmStatus(&status, mBuf) != ROK) {
3241 #if (ERRCLASS & ERRCLS_ADD_RES)
3242       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3243       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3244          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3245          (ErrVal)ECTF049, (ErrVal)0, (Txt*)&"Packing failed");
3246 #endif
3247       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3248       SPutMsg(mBuf);
3249       return RFAILED;
3250    }
3251    if (pst->selector == ODU_SELECTOR_LC) {
3252       if (cmPkCtfUeInfo(ueInfo, mBuf) != ROK) {
3253 #if (ERRCLASS & ERRCLS_ADD_RES)
3254       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3255          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3256             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3257             (ErrVal)ECTF050, (ErrVal)0, (Txt*)&"Packing failed");
3258 #endif
3259          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3260          SPutMsg(mBuf);
3261          return RFAILED;
3262       }
3263    }
3264    else if (pst->selector == ODU_SELECTOR_LWLC) {
3265       if (oduPackPointer((PTR)ueInfo, mBuf) != ROK) {
3266 #if (ERRCLASS & ERRCLS_ADD_RES)
3267       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3268          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3269             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3270             (ErrVal)ECTF051, (ErrVal)0, (Txt*)&"Packing failed");
3271 #endif
3272          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3273          SPutMsg(mBuf);
3274          return RFAILED;
3275       }
3276    }
3277    if (cmPkCtfCfgTransId(&transId, mBuf) != ROK) {
3278 #if (ERRCLASS & ERRCLS_ADD_RES)
3279       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3280       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3281          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3282          (ErrVal)ECTF052, (ErrVal)0, (Txt*)&"Packing failed");
3283 #endif
3284       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3285       SPutMsg(mBuf);
3286       return RFAILED;
3287    }
3288    if (SPkS16(suId, mBuf) != ROK) {
3289 #if (ERRCLASS & ERRCLS_ADD_RES)
3290       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3291       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3292          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3293          (ErrVal)ECTF053, (ErrVal)0, (Txt*)&"Packing failed");
3294 #endif
3295       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3296       SPutMsg(mBuf);
3297       return RFAILED;
3298    }
3299    if (pst->selector != ODU_SELECTOR_LWLC) {
3300       if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo)) != ROK) {
3301 #if (ERRCLASS & ERRCLS_ADD_RES)
3302       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3303       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3304          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3305          (ErrVal)ECTF054, (ErrVal)0, (Txt*)&"Packing failed");
3306 #endif
3307          SPutMsg(mBuf);
3308          return RFAILED;
3309       }
3310    }
3311    pst->event = (Event) EVTCTFUEIDCHGCFM;
3312    return (SPstTsk(pst,mBuf));
3313 }
3314
3315 \f
3316 /**
3317 * @brief UE ID Change Confirm from PHY to RRC.
3318 *
3319 * @details
3320 *
3321 *     Function: cmUnpkCtfUeIdChgCfm
3322 *
3323 *  @param[in]   Pst*  pst
3324 *  @param[in]   SuId  suId
3325 *  @param[in]   CtfCfgTransId  transId
3326 *  @param[in]   CtfUeInfo *  ueInfo
3327 *  @param[in]   uint8_t  status
3328 *  @return   S16
3329 *      -# ROK
3330 **/
3331 S16 cmUnpkCtfUeIdChgCfm
3332 (
3333 CtfUeIdChgCfm func,
3334 Pst *pst,
3335 Buffer *mBuf
3336 )
3337 {
3338    SuId suId = 0;
3339    CtfCfgTransId transId;
3340    CtfUeInfo *ueInfo = NULLP;
3341    CmStatus status;
3342    
3343
3344    if (SUnpkS16(&suId, mBuf) != ROK) {
3345       SPutMsg(mBuf);
3346 #if (ERRCLASS & ERRCLS_ADD_RES)
3347       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3348       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3349          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3350          (ErrVal)ECTF055, (ErrVal)0, (Txt*)&"Packing failed");
3351 #endif
3352       return RFAILED;
3353    }
3354    if (cmUnpkCtfCfgTransId(&transId, mBuf) != ROK) {
3355       SPutMsg(mBuf);
3356 #if (ERRCLASS & ERRCLS_ADD_RES)
3357       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3358       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3359          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3360          (ErrVal)ECTF056, (ErrVal)0, (Txt*)&"Packing failed");
3361 #endif
3362       return RFAILED;
3363    }
3364    if (pst->selector != ODU_SELECTOR_LWLC) {
3365       if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&ueInfo, sizeof(CtfUeInfo))) != ROK) {
3366 #if (ERRCLASS & ERRCLS_ADD_RES)
3367       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3368          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3369             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3370             (ErrVal)ECTF057, (ErrVal)0, (Txt*)&"Packing failed");
3371 #endif
3372          SPutMsg(mBuf);
3373          return RFAILED;
3374       }
3375    }
3376    if (pst->selector == ODU_SELECTOR_LWLC) {
3377       if (oduUnpackPointer((PTR *)&ueInfo, mBuf) != ROK) {
3378          SPutMsg(mBuf);
3379          return RFAILED;
3380       }
3381    }
3382    else if (pst->selector == ODU_SELECTOR_LC) 
3383       if (cmUnpkCtfUeInfo(ueInfo, mBuf) != ROK) {
3384       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3385       SPutMsg(mBuf);
3386 #if (ERRCLASS & ERRCLS_ADD_RES)
3387       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3388       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3389          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3390          (ErrVal)ECTF058, (ErrVal)0, (Txt*)&"Packing failed");
3391 #endif
3392       return RFAILED;
3393    }
3394    if (cmUnpkCmStatus(&status, mBuf) != ROK) {
3395       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
3396       SPutMsg(mBuf);
3397 #if (ERRCLASS & ERRCLS_ADD_RES)
3398       /* ctf_c_001.main_3 Compilation warning fix with g++ */
3399       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3400          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3401          (ErrVal)ECTF059, (ErrVal)0, (Txt*)&"Packing failed");
3402 #endif
3403       return RFAILED;
3404    }
3405    SPutMsg(mBuf);
3406    return ((*func)(pst, suId, transId, ueInfo, status));
3407 }
3408
3409 \f
3410 /***********************************************************
3411 *
3412 *     Func: cmPkCtfCfgTransId
3413 *
3414 *
3415 *     Desc: Transaction ID between CTF and RRC.
3416 *
3417 *
3418 *     Ret: S16
3419 *
3420 *     Notes:
3421 *
3422 *     File: 
3423 *
3424 **********************************************************/
3425 S16 cmPkCtfCfgTransId
3426 (
3427 CtfCfgTransId *param,
3428 Buffer *mBuf
3429 )
3430 {
3431
3432    S32 i;
3433    for (i=CTF_CFG_TRANSID_SIZE-1; i >= 0; i--) {
3434       CMCHKPK(oduUnpackUInt8, param->trans[i], mBuf);
3435    }
3436    return ROK;
3437 }
3438
3439
3440 \f
3441 /***********************************************************
3442 *
3443 *     Func: cmUnpkCtfCfgTransId
3444 *
3445 *
3446 *     Desc: Transaction ID between CTF and RRC.
3447 *
3448 *
3449 *     Ret: S16
3450 *
3451 *     Notes:
3452 *
3453 *     File: 
3454 *
3455 **********************************************************/
3456 S16 cmUnpkCtfCfgTransId
3457 (
3458 CtfCfgTransId *param,
3459 Buffer *mBuf
3460 )
3461 {
3462
3463    S32 i;
3464
3465    for (i=0; i<CTF_CFG_TRANSID_SIZE; i++) {
3466       CMCHKUNPK(oduPackUInt8, &param->trans[i], mBuf);
3467    }
3468    return ROK;
3469 }
3470
3471
3472 \f
3473 /***********************************************************
3474 *
3475 *     Func: cmPkCtfUeInfo
3476 *
3477 *
3478 *     Desc: *  UE ID information
3479 *
3480 *
3481 *     Ret: S16
3482 *
3483 *     Notes:
3484 *
3485 *     File: 
3486 *
3487 **********************************************************/
3488 S16 cmPkCtfUeInfo
3489 (
3490 CtfUeInfo *param,
3491 Buffer *mBuf
3492 )
3493 {
3494
3495    CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
3496    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
3497    return ROK;
3498 }
3499
3500
3501 \f
3502 /***********************************************************
3503 *
3504 *     Func: cmUnpkCtfUeInfo
3505 *
3506 *
3507 *     Desc: *  UE ID information
3508 *
3509 *
3510 *     Ret: S16
3511 *
3512 *     Notes:
3513 *
3514 *     File: 
3515 *
3516 **********************************************************/
3517 S16 cmUnpkCtfUeInfo
3518 (
3519 CtfUeInfo *param,
3520 Buffer *mBuf
3521 )
3522 {
3523
3524    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
3525    CMCHKUNPK(cmUnpkLteRnti, &param->ueId, mBuf);
3526    return ROK;
3527 }
3528
3529
3530 \f
3531 /***********************************************************
3532 *
3533 *     Func: cmPkCtfBwCfgInfo
3534 *
3535 *
3536 *     Desc:   Bandwidth Configuration
3537  * @details This structure contains the uplink and downlink bandwidth 
3538  *          information for configuration at PHY.
3539 *
3540 *
3541 *     Ret: S16
3542 *
3543 *     Notes:
3544 *
3545 *     File: 
3546 *
3547 **********************************************************/
3548 S16 cmPkCtfBwCfgInfo
3549 (
3550 CtfBwCfgInfo *param,
3551 Buffer *mBuf
3552 )
3553 {
3554
3555
3556    CMCHKPK(oduUnpackUInt8, param->eUtraBand, mBuf);
3557    CMCHKPK(oduUnpackUInt32, param->ulBw, mBuf);
3558    CMCHKPK(oduUnpackUInt32, param->dlBw, mBuf);
3559    /* ctf_c_001.main_4: Removed packing of param->pres */
3560    return ROK;
3561 }
3562
3563
3564 \f
3565 /***********************************************************
3566 *
3567 *     Func: cmUnpkCtfBwCfgInfo
3568 *
3569 *
3570 *     Desc:   Bandwidth Configuration
3571  * @details This structure contains the uplink and downlink bandwidth 
3572  *          information for configuration at PHY.
3573 *
3574 *
3575 *     Ret: S16
3576 *
3577 *     Notes:
3578 *
3579 *     File: 
3580 *
3581 **********************************************************/
3582 S16 cmUnpkCtfBwCfgInfo
3583 (
3584 CtfBwCfgInfo *param,
3585 Buffer *mBuf
3586 )
3587 {
3588
3589    uint32_t tmpEnum;
3590
3591    /* ctf_c_001.main_4: Removed UnPacking of param->pres */
3592    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
3593    param->dlBw = (CtfBandwidth)tmpEnum;
3594    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
3595    param->ulBw = (CtfBandwidth)tmpEnum;
3596    CMCHKUNPK(oduPackUInt8, &param->eUtraBand, mBuf);
3597    return ROK;
3598 }
3599
3600
3601 \f
3602 /***********************************************************
3603 *
3604 *     Func: cmPkCtfTxSchemeCfg
3605 *
3606 *
3607 *     Desc:   Transmission Scheme Configuration
3608  * @details This structure contains the transmission scheme related information.
3609 *
3610 *
3611 *     Ret: S16
3612 *
3613 *     Notes:
3614 *
3615 *     File: 
3616 *
3617 **********************************************************/
3618 S16 cmPkCtfTxSchemeCfg
3619 (
3620 CtfTxSchemeCfg *param,
3621 Buffer *mBuf
3622 )
3623 {
3624
3625    CMCHKPK(oduUnpackUInt32, param->cycPfx, mBuf);
3626    CMCHKPK(oduUnpackUInt32, param->scSpacing, mBuf);
3627    CMCHKPK(oduUnpackUInt32, param->duplexMode, mBuf);
3628    /* ctf_c_001.main_4: Removed packing of param->pres */
3629    return ROK;
3630 }
3631
3632
3633 \f
3634 /***********************************************************
3635 *
3636 *     Func: cmUnpkCtfTxSchemeCfg
3637 *
3638 *
3639 *     Desc:   Transmission Scheme Configuration
3640  * @details This structure contains the transmission scheme related information.
3641 *
3642 *
3643 *     Ret: S16
3644 *
3645 *     Notes:
3646 *
3647 *     File: 
3648 *
3649 **********************************************************/
3650 S16 cmUnpkCtfTxSchemeCfg
3651 (
3652 CtfTxSchemeCfg *param,
3653 Buffer *mBuf
3654 )
3655 {
3656    uint32_t tmpEnum;
3657
3658
3659    /* ctf_c_001.main_4: Removed UnPacking of param->pres */
3660    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
3661    param->duplexMode = (CtfDuplexMode)tmpEnum;
3662    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
3663    param->scSpacing = (CtfSCSpacing)tmpEnum;
3664    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
3665    param->cycPfx = (CtfCPCfg)tmpEnum;
3666    return ROK;
3667 }
3668
3669
3670 \f
3671 /***********************************************************
3672 *
3673 *     Func: cmPkCtfAntennaCfgInfo
3674 *
3675 *
3676 *     Desc:   Antenna Ports configuration
3677  * @details This structure contains the antenna configuration information for 
3678  *          configuration at PHY.
3679 *
3680 *
3681 *     Ret: S16
3682 *
3683 *     Notes:
3684 *
3685 *     File: 
3686 *
3687 **********************************************************/
3688 S16 cmPkCtfAntennaCfgInfo
3689 (
3690 CtfAntennaCfgInfo *param,
3691 Buffer *mBuf
3692 )
3693 {
3694
3695    CMCHKPK(oduUnpackUInt32, param->antPortsCnt, mBuf);
3696    return ROK;
3697 }
3698
3699
3700 \f
3701 /***********************************************************
3702 *
3703 *     Func: cmUnpkCtfAntennaCfgInfo
3704 *
3705 *
3706 *     Desc:   Antenna Ports configuration
3707  * @details This structure contains the antenna configuration information for 
3708  *          configuration at PHY.
3709 *
3710 *
3711 *     Ret: S16
3712 *
3713 *     Notes:
3714 *
3715 *     File: 
3716 *
3717 **********************************************************/
3718 S16 cmUnpkCtfAntennaCfgInfo
3719 (
3720 CtfAntennaCfgInfo *param,
3721 Buffer *mBuf
3722 )
3723 {
3724    uint32_t tmpEnum;
3725
3726    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
3727    param->antPortsCnt = (CtfAntennaPortsCount)tmpEnum;
3728    return ROK;
3729 }
3730
3731
3732 \f
3733 /***********************************************************
3734 *
3735 *     Func: cmPkCtfPrachCfgInfo
3736 *
3737 *
3738 *     Desc:   PRACH configuration
3739  * @details This structure contains the configuration information for PRACH at PHY.
3740  *          -# PRACH preamble sequences are generated by PHY using Zadoff-Chu 
3741  *             sequences.[Ref: 36.211, 5.7.2]
3742  *          -# PRACH preamble format is derived from PRACH Configuration Index.
3743  *             [Ref: 36.211, Table 5.7.1-2]
3744  *          -# PrachFreqOffset is the first physical resource block allocated to 
3745  *             the PRACH opportunity considered for preamble format 0, 1, 2, and 3.
3746  *             [Ref: 36.211, 5.7.1]
3747 *
3748 *
3749 *     Ret: S16
3750 *
3751 *     Notes:
3752 *
3753 *     File: 
3754 *
3755 **********************************************************/
3756 S16 cmPkCtfPrachCfgInfo
3757 (
3758 CtfPrachCfgInfo *param,
3759 Buffer *mBuf
3760 )
3761 {
3762
3763    /*ctf_c_001.main_1*/
3764    if(param->pres != FALSE)
3765    {
3766       CMCHKPK(oduUnpackUInt8, param->prachFreqOffset, mBuf);
3767       CMCHKPK(oduUnpackUInt8, param->highSpeedFlag, mBuf);
3768       CMCHKPK(oduUnpackUInt8, param->zeroCorrelationZoneCfg, mBuf);
3769       CMCHKPK(oduUnpackUInt8, param->prachCfgIndex, mBuf);
3770       CMCHKPK(oduUnpackUInt16, param->rootSequenceIndex, mBuf);
3771    }
3772    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
3773    return ROK;
3774 }
3775
3776
3777 \f
3778 /***********************************************************
3779 *
3780 *     Func: cmUnpkCtfPrachCfgInfo
3781 *
3782 *
3783 *     Desc:   PRACH configuration
3784  * @details This structure contains the configuration information for PRACH at PHY.
3785  *          -# PRACH preamble sequences are generated by PHY using Zadoff-Chu 
3786  *             sequences.[Ref: 36.211, 5.7.2]
3787  *          -# PRACH preamble format is derived from PRACH Configuration Index.
3788  *             [Ref: 36.211, Table 5.7.1-2]
3789  *          -# PrachFreqOffset is the first physical resource block allocated to 
3790  *             the PRACH opportunity considered for preamble format 0, 1, 2, and 3.
3791  *             [Ref: 36.211, 5.7.1]
3792 *
3793 *
3794 *     Ret: S16
3795 *
3796 *     Notes:
3797 *
3798 *     File: 
3799 *
3800 **********************************************************/
3801 S16 cmUnpkCtfPrachCfgInfo
3802 (
3803 CtfPrachCfgInfo *param,
3804 Buffer *mBuf
3805 )
3806 {
3807
3808    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
3809 /*ctf_c_001.main_1*/
3810    if(param->pres != FALSE)
3811    {
3812       CMCHKUNPK(oduPackUInt16, &param->rootSequenceIndex, mBuf);
3813       CMCHKUNPK(oduPackUInt8, &param->prachCfgIndex, mBuf);
3814       CMCHKUNPK(oduPackUInt8, &param->zeroCorrelationZoneCfg, mBuf);
3815       CMCHKUNPK(oduPackUInt8, &param->highSpeedFlag, mBuf);
3816       CMCHKUNPK(oduPackUInt8, &param->prachFreqOffset, mBuf);
3817    }
3818    return ROK;
3819 }
3820
3821
3822 \f
3823 /***********************************************************
3824 *
3825 *     Func: cmPkCtfPdschCfgInfo
3826 *
3827 *
3828 *     Desc:   PDSCH configuration
3829  * @details This structure contains the PDSCH configuration information for 
3830  *          configuration at PHY.
3831 *
3832 *
3833 *     Ret: S16
3834 *
3835 *     Notes:
3836 *
3837 *     File: 
3838 *
3839 **********************************************************/
3840 S16 cmPkCtfPdschCfgInfo
3841 (
3842 CtfPdschCfgInfo *param,
3843 Buffer *mBuf
3844 )
3845 {
3846
3847 /*ctf_c_001.main_1*/
3848    if(param->pres != FALSE)
3849    {
3850       CMCHKPK(oduUnpackUInt8, param->p_b, mBuf);
3851       CMCHKPK(SPkS16, param->refSigPwr, mBuf);
3852    }
3853    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
3854    return ROK;
3855 }
3856
3857
3858 \f
3859 /***********************************************************
3860 *
3861 *     Func: cmUnpkCtfPdschCfgInfo
3862 *
3863 *
3864 *     Desc:   PDSCH configuration
3865  * @details This structure contains the PDSCH configuration information for 
3866  *          configuration at PHY.
3867 *
3868 *
3869 *     Ret: S16
3870 *
3871 *     Notes:
3872 *
3873 *     File: 
3874 *
3875 **********************************************************/
3876 S16 cmUnpkCtfPdschCfgInfo
3877 (
3878 CtfPdschCfgInfo *param,
3879 Buffer *mBuf
3880 )
3881 {
3882
3883    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
3884 /*ctf_c_001.main_1*/
3885    if(param->pres != FALSE)
3886    {
3887      CMCHKUNPK(SUnpkS16, &param->refSigPwr, mBuf);
3888      CMCHKUNPK(oduPackUInt8, &param->p_b, mBuf);
3889    }
3890    return ROK;
3891 }
3892
3893
3894 \f
3895 /***********************************************************
3896 *
3897 *     Func: cmPkCtfPuschCfgBasic
3898 *
3899 *
3900 *     Desc:   Basic PUSCH configuration
3901  * @details This structure contains the basic PUSCH configuration information for 
3902  *          configuration at PHY.
3903 *
3904 *
3905 *     Ret: S16
3906 *
3907 *     Notes:
3908 *
3909 *     File: 
3910 *
3911 **********************************************************/
3912 S16 cmPkCtfPuschCfgBasic
3913 (
3914 CtfPuschCfgBasic *param,
3915 Buffer *mBuf
3916 )
3917 {
3918
3919    CMCHKPK(oduUnpackUInt8, param->enable64QAM, mBuf);
3920    CMCHKPK(oduUnpackUInt8, param->hoppingOffset, mBuf);
3921    CMCHKPK(oduUnpackUInt32, param->hoppingMode, mBuf);
3922    CMCHKPK(oduUnpackUInt8, param->noOfsubBands, mBuf);
3923    return ROK;
3924 }
3925
3926
3927 \f
3928 /***********************************************************
3929 *
3930 *     Func: cmUnpkCtfPuschCfgBasic
3931 *
3932 *
3933 *     Desc:   Basic PUSCH configuration
3934  * @details This structure contains the basic PUSCH configuration information for 
3935  *          configuration at PHY.
3936 *
3937 *
3938 *     Ret: S16
3939 *
3940 *     Notes:
3941 *
3942 *     File: 
3943 *
3944 **********************************************************/
3945 S16 cmUnpkCtfPuschCfgBasic
3946 (
3947 CtfPuschCfgBasic *param,
3948 Buffer *mBuf
3949 )
3950 {
3951    uint32_t tmpEnum;
3952
3953    CMCHKUNPK(oduPackUInt8, &param->noOfsubBands, mBuf);
3954    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
3955    param->hoppingMode = (CtfPuschHoppingMode)tmpEnum;
3956    CMCHKUNPK(oduPackUInt8, &param->hoppingOffset, mBuf);
3957    CMCHKUNPK(oduPackUInt8, &param->enable64QAM, mBuf);
3958    return ROK;
3959 }
3960
3961
3962 \f
3963 /***********************************************************
3964 *
3965 *     Func: cmPkCtfPuschUlRS
3966 *
3967 *
3968 *     Desc:   PUSCH Uplink Reference Signals configuration
3969  * @details This structure contains the PUSCH configuration information for 
3970  *          uplink reference signals configuration at PHY.
3971 *
3972 *
3973 *     Ret: S16
3974 *
3975 *     Notes:
3976 *
3977 *     File: 
3978 *
3979 **********************************************************/
3980 S16 cmPkCtfPuschUlRS
3981 (
3982 CtfPuschUlRS *param,
3983 Buffer *mBuf
3984 )
3985 {
3986
3987    CMCHKPK(oduUnpackUInt8, param->cycShift, mBuf);
3988    CMCHKPK(oduUnpackUInt8, param->grpNum, mBuf);
3989    CMCHKPK(oduUnpackUInt8, param->seqHopEnabled, mBuf);
3990    CMCHKPK(oduUnpackUInt8, param->grpHopEnabled, mBuf);
3991    return ROK;
3992 }
3993
3994
3995 \f
3996 /***********************************************************
3997 *
3998 *     Func: cmUnpkCtfPuschUlRS
3999 *
4000 *
4001 *     Desc:   PUSCH Uplink Reference Signals configuration
4002  * @details This structure contains the PUSCH configuration information for 
4003  *          uplink reference signals configuration at PHY.
4004 *
4005 *
4006 *     Ret: S16
4007 *
4008 *     Notes:
4009 *
4010 *     File: 
4011 *
4012 **********************************************************/
4013 S16 cmUnpkCtfPuschUlRS
4014 (
4015 CtfPuschUlRS *param,
4016 Buffer *mBuf
4017 )
4018 {
4019
4020
4021    CMCHKUNPK(oduPackUInt8, &param->grpHopEnabled, mBuf);
4022    CMCHKUNPK(oduPackUInt8, &param->seqHopEnabled, mBuf);
4023    CMCHKUNPK(oduPackUInt8, &param->grpNum, mBuf);
4024    CMCHKUNPK(oduPackUInt8, &param->cycShift, mBuf);
4025    return ROK;
4026 }
4027
4028
4029 \f
4030 /***********************************************************
4031 *
4032 *     Func: cmPkCtfPuschCfgInfo
4033 *
4034 *
4035 *     Desc:   PUSCH configuration
4036  * @details This structure contains the information for PUSCH 
4037  *          configuration at PHY.
4038 *
4039 *
4040 *     Ret: S16
4041 *
4042 *     Notes:
4043 *
4044 *     File: 
4045 *
4046 **********************************************************/
4047 S16 cmPkCtfPuschCfgInfo
4048 (
4049 CtfPuschCfgInfo *param,
4050 Buffer *mBuf
4051 )
4052 {
4053
4054 /*ctf_c_001.main_1*/
4055    if(param->pres != FALSE)
4056    {
4057      CMCHKPK(cmPkCtfPuschUlRS, &param->puschUlRS, mBuf);
4058      CMCHKPK(cmPkCtfPuschCfgBasic, &param->puschBasicCfg, mBuf);
4059    }
4060    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
4061    return ROK;
4062 }
4063
4064
4065 \f
4066 /***********************************************************
4067 *
4068 *     Func: cmUnpkCtfPuschCfgInfo
4069 *
4070 *
4071 *     Desc:   PUSCH configuration
4072  * @details This structure contains the information for PUSCH 
4073  *          configuration at PHY.
4074 *
4075 *
4076 *     Ret: S16
4077 *
4078 *     Notes:
4079 *
4080 *     File: 
4081 *
4082 **********************************************************/
4083 S16 cmUnpkCtfPuschCfgInfo
4084 (
4085 CtfPuschCfgInfo *param,
4086 Buffer *mBuf
4087 )
4088 {
4089
4090    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
4091 /*ctf_c_001.main_1*/
4092    if(param->pres != FALSE)
4093    {
4094      CMCHKUNPK(cmUnpkCtfPuschCfgBasic, &param->puschBasicCfg, mBuf);
4095      CMCHKUNPK(cmUnpkCtfPuschUlRS, &param->puschUlRS, mBuf);
4096    }
4097    return ROK;
4098 }
4099
4100
4101 \f
4102 /***********************************************************
4103 *
4104 *     Func: cmPkCtfPhichCfgInfo
4105 *
4106 *
4107 *     Desc:   PHICH configuration
4108  * @details This structure contains the duration and resource information for
4109  *          PHICH configuration at PHY.
4110 *
4111 *
4112 *     Ret: S16
4113 *
4114 *     Notes:
4115 *
4116 *     File: 
4117 *
4118 **********************************************************/
4119 S16 cmPkCtfPhichCfgInfo
4120 (
4121 CtfPhichCfgInfo *param,
4122 Buffer *mBuf
4123 )
4124 {
4125
4126 /*ctf_c_001.main_1*/
4127    if(param->pres != FALSE)
4128    {
4129       CMCHKPK(oduUnpackUInt32, param->resource, mBuf);
4130       CMCHKPK(oduUnpackUInt32, param->duration, mBuf);
4131    }
4132    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
4133    return ROK;
4134 }
4135
4136
4137 \f
4138 /***********************************************************
4139 *
4140 *     Func: cmUnpkCtfPhichCfgInfo
4141 *
4142 *
4143 *     Desc:   PHICH configuration
4144  * @details This structure contains the duration and resource information for
4145  *          PHICH configuration at PHY.
4146 *
4147 *
4148 *     Ret: S16
4149 *
4150 *     Notes:
4151 *
4152 *     File: 
4153 *
4154 **********************************************************/
4155 S16 cmUnpkCtfPhichCfgInfo
4156 (
4157 CtfPhichCfgInfo *param,
4158 Buffer *mBuf
4159 )
4160 {
4161    uint32_t tmpEnum;
4162
4163    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
4164 /*ctf_c_001.main_1*/
4165    if(param->pres != FALSE)
4166    {
4167      CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
4168      param->duration = (CtfPhichDuration)tmpEnum;
4169      CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
4170      param->resource = (CtfPhichResource)tmpEnum;
4171    }
4172    return ROK;
4173 }
4174
4175
4176 \f
4177 /***********************************************************
4178 *
4179 *     Func: cmPkCtfPucchCfgInfo
4180 *
4181 *
4182 *     Desc:   PUCCH configuration
4183  * @details This structure contains the information for PUCCH
4184  *          configuration at PHY.
4185 *
4186 *
4187 *     Ret: S16
4188 *
4189 *     Notes:
4190 *
4191 *     File: 
4192 *
4193 **********************************************************/
4194 S16 cmPkCtfPucchCfgInfo
4195 (
4196 CtfPucchCfgInfo *param,
4197 Buffer *mBuf
4198 )
4199 {
4200
4201
4202 /*ctf_c_001.main_1*/
4203    if(param->pres != FALSE)
4204    {
4205       CMCHKPK(oduUnpackUInt32, param->deltaShift, mBuf);
4206       CMCHKPK(oduUnpackUInt16, param->n1PUCCH, mBuf);
4207       CMCHKPK(oduUnpackUInt8, param->nCS, mBuf);
4208       CMCHKPK(oduUnpackUInt8, param->nRB, mBuf);
4209    }
4210    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
4211    return ROK;
4212 }
4213
4214
4215 \f
4216 /***********************************************************
4217 *
4218 *     Func: cmUnpkCtfPucchCfgInfo
4219 *
4220 *
4221 *     Desc:   PUCCH configuration
4222  * @details This structure contains the information for PUCCH
4223  *          configuration at PHY.
4224 *
4225 *
4226 *     Ret: S16
4227 *
4228 *     Notes:
4229 *
4230 *     File: 
4231 *
4232 **********************************************************/
4233 S16 cmUnpkCtfPucchCfgInfo
4234 (
4235 CtfPucchCfgInfo *param,
4236 Buffer *mBuf
4237 )
4238 {
4239    uint32_t tmpEnum;
4240
4241    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
4242 /*ctf_c_001.main_1*/
4243    if(param->pres != FALSE)
4244    {
4245       CMCHKUNPK(oduPackUInt8, &param->nRB, mBuf);
4246       CMCHKUNPK(oduPackUInt8, &param->nCS, mBuf);
4247       CMCHKUNPK(oduPackUInt16, &param->n1PUCCH, mBuf);
4248       CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
4249       param->deltaShift = (CtfPucchDeltaShift)tmpEnum;
4250    }
4251    return ROK;
4252 }
4253
4254
4255 \f
4256 /***********************************************************
4257 *
4258 *     Func: cmPkCtfSrsUlCfgInfo
4259 *
4260 *
4261 *     Desc:   SRS uplink configuration
4262  * @details This structure contains the information for setting-up/release
4263  *          of uplink SRS configuration at PHY.
4264 *
4265 *
4266 *     Ret: S16
4267 *
4268 *     Notes:
4269 *
4270 *     File: 
4271 *
4272 **********************************************************/
4273 S16 cmPkCtfSrsUlCfgInfo
4274 (
4275 CtfSrsUlCfgInfo *param,
4276 Buffer *mBuf
4277 )
4278 {
4279
4280 /*ctf_c_001.main_1*/
4281    if(param->pres != FALSE)
4282    {
4283       CMCHKPK(oduUnpackUInt8, param->srsSetup.srsMaxUpPts, mBuf);
4284       CMCHKPK(oduUnpackUInt8, param->srsSetup.srsANSimultTx, mBuf);
4285       CMCHKPK(oduUnpackUInt8, param->srsSetup.sfCfg, mBuf);
4286       CMCHKPK(oduUnpackUInt8, param->srsSetup.srsBw, mBuf);
4287       CMCHKPK(oduUnpackUInt8, param->srsCfgType, mBuf);
4288    }
4289    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
4290    return ROK;
4291 }
4292
4293
4294 \f
4295 /***********************************************************
4296 *
4297 *     Func: cmUnpkCtfSrsUlCfgInfo
4298 *
4299 *
4300 *     Desc:   SRS uplink configuration
4301  * @details This structure contains the information for setting-up/release
4302  *          of uplink SRS configuration at PHY.
4303 *
4304 *
4305 *     Ret: S16
4306 *
4307 *     Notes:
4308 *
4309 *     File: 
4310 *
4311 **********************************************************/
4312 S16 cmUnpkCtfSrsUlCfgInfo
4313 (
4314 CtfSrsUlCfgInfo *param,
4315 Buffer *mBuf
4316 )
4317 {
4318
4319    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
4320 /*ctf_c_001.main_1*/
4321    if(param->pres != FALSE)
4322    {
4323       CMCHKUNPK(oduPackUInt8, &param->srsCfgType, mBuf);
4324       CMCHKUNPK(oduPackUInt8, &param->srsSetup.srsBw, mBuf);
4325       CMCHKUNPK(oduPackUInt8, &param->srsSetup.sfCfg, mBuf);
4326       CMCHKUNPK(oduPackUInt8, &param->srsSetup.srsANSimultTx, mBuf);
4327       CMCHKUNPK(oduPackUInt8, &param->srsSetup.srsMaxUpPts, mBuf);
4328    }
4329    return ROK;
4330 }
4331
4332
4333 \f
4334 /***********************************************************
4335 *
4336 *     Func: cmPkCtfTddSfCfgInfo
4337 *
4338 *
4339 *     Desc:   Subframe Configuration for TDD mode.
4340  * @details This structure contains the information for setting-up
4341  *          the subframe for TDD mode at PHY.
4342 *
4343 *
4344 *     Ret: S16
4345 *
4346 *     Notes:
4347 *
4348 *     File: 
4349 *
4350 **********************************************************/
4351 S16 cmPkCtfTddSfCfgInfo
4352 (
4353 CtfTddSfCfgInfo *param,
4354 Buffer *mBuf
4355 )
4356 {
4357
4358 /*ctf_c_001.main_1*/
4359    if(param->pres != FALSE)
4360    {
4361       CMCHKPK(oduUnpackUInt8, param->spclSfPatterns, mBuf);
4362       CMCHKPK(oduUnpackUInt8, param->sfAssignment, mBuf);
4363    }
4364    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
4365    return ROK;
4366 }
4367
4368 /* ctf_c_001.main_4: Added support for vendor specific parameters */
4369 #ifdef CTF_VER3
4370 /***********************************************************
4371 *
4372 *     Func: cmPkCtfVendorSpecParams
4373 *
4374 *
4375 *     Desc: Vendor Specific Parameter configuration 
4376 *   @details This structure contains the Parameters which is spaciftc to
4377 *            Vendor.
4378 *
4379 *
4380 *     Ret: S16
4381 *
4382 *     Notes:
4383 *
4384 *     File: 
4385 *
4386 **********************************************************/
4387 S16 cmPkCtfVendorSpecParams
4388 (
4389 CtfVendorSpecific *param,
4390 Buffer *mBuf
4391 )
4392 {
4393
4394    if( param->buffLen != 0) {
4395      SAddPreMsgMultInOrder(param->paramBuffer,param->buffLen,mBuf);   
4396    }
4397    CMCHKPK(oduUnpackUInt16,param->buffLen,mBuf);
4398
4399    return ROK;
4400 }
4401 \f
4402 /***********************************************************
4403 *
4404 *     Func: cmUnpkCtfVendorSpecParams
4405 *
4406 *
4407 *     Desc: Vendor Specific Parameter configuration  
4408 * @details  This structure contains the Parameters which is spaciftc to
4409 *           Vendor.
4410 *
4411 *
4412 *     Ret: S16
4413 *
4414 *     Notes:
4415 *
4416 *     File: 
4417 *
4418 **********************************************************/
4419 S16 cmUnpkCtfVendorSpecParams
4420 (
4421 Pst *pst,
4422 CtfVendorSpecific *param,
4423 Buffer *mBuf
4424 )
4425 {
4426
4427    CMCHKUNPK(oduPackUInt16, &param->buffLen, mBuf);
4428
4429    if(param->buffLen != 0) {
4430       if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&param->paramBuffer, param->buffLen)) != ROK) {
4431 #if (ERRCLASS & ERRCLS_ADD_RES)
4432          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
4433                (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
4434                (ErrVal)ECTF060, (ErrVal)0, (Txt*)&"Unpacking failed");
4435 #endif
4436          return RFAILED ;
4437       }
4438       SRemPreMsgMult(param->paramBuffer, param->buffLen,mBuf) ;   
4439    }
4440    else {
4441       param->paramBuffer = NULLP ;
4442    }
4443
4444    return ROK;
4445 }
4446 #endif
4447 \f
4448 /***********************************************************
4449 *
4450 *     Func: cmUnpkCtfTddSfCfgInfo
4451 *
4452 *
4453 *     Desc:   Subframe Configuration for TDD mode.
4454  * @details This structure contains the information for setting-up
4455  *          the subframe for TDD mode at PHY.
4456 *
4457 *
4458 *     Ret: S16
4459 *
4460 *     Notes:
4461 *
4462 *     File: 
4463 *
4464 **********************************************************/
4465 S16 cmUnpkCtfTddSfCfgInfo
4466 (
4467 CtfTddSfCfgInfo *param,
4468 Buffer *mBuf
4469 )
4470 {
4471
4472    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
4473 /*ctf_c_001.main_1*/
4474    if(param->pres != FALSE)
4475    {
4476       CMCHKUNPK(oduPackUInt8, &param->sfAssignment, mBuf);
4477       CMCHKUNPK(oduPackUInt8, &param->spclSfPatterns, mBuf);
4478    }
4479    return ROK;
4480 }
4481 /***********************************************************
4482 *
4483 *     Func: cmPkCtfUnLicnsdCellParam
4484 *
4485 *
4486 *     Desc:   Packing unlicensed SDL cell specific parameter
4487 *
4488 *
4489 *     Ret: S16
4490 *
4491 *     Notes:
4492 *
4493 *     File: 
4494 *
4495 **********************************************************/
4496 static S16 cmPkCtfUnLicnsdCellParam
4497 (
4498 CtfUnLicnsdCfgInfo *param,
4499 Buffer *mBuf
4500 )
4501 {
4502    uint8_t  idx;
4503
4504
4505    CMCHKPK(SPkS32, param->txPowerLimit, mBuf);
4506    CMCHKPK(oduUnpackUInt8, param->coExistMethod, mBuf);
4507    CMCHKPK(oduUnpackUInt8, param->lteOnPeriod, mBuf);
4508    CMCHKPK(oduUnpackUInt8, param->ccaMethod, mBuf);
4509    CMCHKPK(oduUnpackUInt8, param->adaptiveTx, mBuf);
4510    CMCHKPK(oduUnpackUInt16, param->transPeriod, mBuf);
4511    CMCHKPK(oduUnpackUInt16, param->listenPrd, mBuf);
4512    CMCHKPK(SPkS16, param->energyTh, mBuf);
4513    CMCHKPK(oduUnpackUInt16, param->scanTimePrd, mBuf);
4514    CMCHKPK(oduUnpackUInt16, param->activityTh, mBuf);
4515
4516    for(idx = 0; idx < param->numFreq; idx++)
4517    {
4518       CMCHKPK(oduUnpackUInt32, param->earfcn[idx], mBuf);
4519    }   
4520
4521    CMCHKPK(oduUnpackUInt8, param->numFreq, mBuf);
4522
4523    return ROK;
4524
4525 \f
4526 /***********************************************************
4527 *
4528 *     Func: cmPkCtfCellCfgInfo
4529 *
4530 *
4531 *     Desc:   Cell Configuration Information
4532  * @details This structure contains the information for setting-up
4533  *          of a cell and its associated resources at PHY.
4534 *
4535 *
4536 *     Ret: S16
4537 *
4538 *     Notes:
4539 *
4540 *     File: 
4541 *
4542 **********************************************************/
4543 S16 cmPkCtfCellCfgInfo
4544 (
4545 CtfCellCfgInfo *param,
4546 Buffer *mBuf
4547 )
4548 {
4549 #ifdef EMTC_ENABLE
4550    S32 i;
4551 #endif
4552
4553 #ifdef EMTC_ENABLE
4554    for (i = CTF_MAX_CE_LEVEL-1; i >= 0; i--) {
4555       CMCHKPK(oduUnpackUInt8, param->ceLevelInfo[i].emtcNumRepPerPreambleAtt, mBuf);
4556       CMCHKPK(oduUnpackUInt8, param->ceLevelInfo[i].lastPreamble, mBuf);
4557       CMCHKPK(oduUnpackUInt8, param->ceLevelInfo[i].firstPreamble, mBuf);
4558    }
4559    CMCHKPK(oduUnpackUInt8, param->mPdcchStart, mBuf);
4560    CMCHKPK(oduUnpackUInt8, param->catMenabled, mBuf);
4561 #endif
4562    if(param->unLicnsdCfgPres)
4563    {   
4564       DU_LOG("\nDEBUG  -->  pverma param->unLicnsdCfgPres cm/ctf -->%d\n",param->unLicnsdCfgPres);
4565       CMCHKPK(cmPkCtfUnLicnsdCellParam, &param->lteUCfg, mBuf);
4566    }
4567    CMCHKPK(oduUnpackUInt8, param->unLicnsdCfgPres, mBuf);
4568    /*Added for rgu dynamic delta*/
4569    CMCHKPK(oduUnpackUInt8, param->numDlUePerTti, mBuf);
4570    CMCHKPK(SPkS16, param->pilotSigPwr, mBuf);
4571    CMCHKPK(oduUnpackUInt16, param->ulEarfcn, mBuf);
4572    CMCHKPK(oduUnpackUInt16, param->dlEarfcn, mBuf);
4573    CMCHKPK(SPkS16, param->priSigPwr, mBuf);
4574    CMCHKPK(SPkS16, param->secSigPwr, mBuf);
4575    /* Packing PHY configuration parameters */
4576    CMCHKPK(oduUnpackUInt32, param->period, mBuf);
4577    CMCHKPK(oduUnpackUInt32, param->counter, mBuf);
4578    CMCHKPK(oduUnpackUInt16, param->opMode, mBuf);
4579
4580    /* ctf_c_001.main_3: Added the pack for newly added fileds inside the CFG structure*/
4581    CMCHKPK(oduUnpackUInt8, param->rachSrRepModePres, mBuf);
4582    CMCHKPK(oduUnpackUInt16, param->rachSrRepMode, mBuf);
4583
4584    CMCHKPK(oduUnpackUInt8, param->dataRepModePres, mBuf);
4585    CMCHKPK(oduUnpackUInt16, param->dataRepMode, mBuf);
4586
4587    CMCHKPK(oduUnpackUInt8, param->phySyncModePres, mBuf);
4588    CMCHKPK(oduUnpackUInt16, param->phySyncMode, mBuf);
4589
4590    CMCHKPK(oduUnpackUInt8, param->rxAntennaPortsPres, mBuf);
4591    CMCHKPK(oduUnpackUInt16, param->rxAntennaPorts, mBuf);
4592
4593    CMCHKPK(oduUnpackUInt8, param->txAntennaPortsPres, mBuf);
4594    CMCHKPK(oduUnpackUInt16, param->txAntennaPorts, mBuf);
4595
4596    CMCHKPK(oduUnpackUInt8, param->pucchProbDtxAckPres, mBuf);
4597    CMCHKPK(oduUnpackUInt16, param->pucchProbDtxAck, mBuf);
4598
4599    CMCHKPK(oduUnpackUInt8, param->puschProbDtxAckPres, mBuf);
4600    CMCHKPK(oduUnpackUInt16, param->puschProbDtxAck, mBuf);
4601   
4602    CMCHKPK(oduUnpackUInt8, param->srsDopEstFactorPres, mBuf);
4603    CMCHKPK(oduUnpackUInt16, param->srsDopEstFactor, mBuf);
4604   
4605    CMCHKPK(oduUnpackUInt8, param->prachPkRatio0Pres, mBuf);
4606    CMCHKPK(oduUnpackUInt16, param->prachPkRatio0, mBuf);
4607   
4608    CMCHKPK(oduUnpackUInt8, param->prachPkRatio4Pres, mBuf);
4609    CMCHKPK(oduUnpackUInt16, param->prachPkRatio4, mBuf);
4610   
4611    CMCHKPK(oduUnpackUInt8, param->pucchNoiseGammaPres, mBuf);
4612    CMCHKPK(oduUnpackUInt16, param->pucchNoiseGamma, mBuf);
4613   
4614    CMCHKPK(oduUnpackUInt8, param->extWinMarginPres, mBuf);
4615    CMCHKPK(oduUnpackUInt16, param->extWinMargin, mBuf);
4616   
4617    CMCHKPK(oduUnpackUInt8, param->dciPowOsPres, mBuf);
4618    CMCHKPK(oduUnpackUInt16, param->dciPowOs, mBuf);
4619   
4620    CMCHKPK(oduUnpackUInt8, param->cfiPowOsPres, mBuf);
4621    CMCHKPK(oduUnpackUInt16, param->cfiPowOs, mBuf);
4622   
4623    CMCHKPK(oduUnpackUInt8, param->syncSigPowOsPres, mBuf);
4624    CMCHKPK(oduUnpackUInt16, param->syncSigPowOs, mBuf);
4625  
4626    CMCHKPK(cmPkCtfTddSfCfgInfo, &param->tddSfCfg, mBuf);
4627    CMCHKPK(cmPkCtfSrsUlCfgInfo, &param->srsUlCfg, mBuf);
4628    CMCHKPK(cmPkCtfPucchCfgInfo, &param->pucchCfg, mBuf);
4629    CMCHKPK(cmPkCtfPhichCfgInfo, &param->phichCfg, mBuf);
4630    CMCHKPK(cmPkCtfPuschCfgInfo, &param->puschCfg, mBuf);
4631    CMCHKPK(cmPkCtfPdschCfgInfo, &param->pdschCfg, mBuf);
4632    CMCHKPK(cmPkCtfPrachCfgInfo, &param->prachCfg, mBuf);
4633    CMCHKPK(cmPkCtfAntennaCfgInfo, &param->antennaCfg, mBuf);
4634    CMCHKPK(cmPkCtfTxSchemeCfg, &param->txCfg, mBuf);
4635    CMCHKPK(cmPkCtfBwCfgInfo, &param->bwCfg, mBuf);
4636    CMCHKPK(oduUnpackUInt8, param->physCellId, mBuf);
4637    CMCHKPK(oduUnpackUInt8, param->physCellIdPres, mBuf);
4638    
4639    CMCHKPK(SPkS16, param->macSapId, mBuf);
4640    CMCHKPK(SPkS16, param->schSapId, mBuf);
4641
4642    CMCHKPK(oduUnpackUInt8, param->cellIdGrpId, mBuf);
4643    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
4644    return ROK;
4645 }
4646 /***********************************************************
4647 *
4648 *     Func: cmUnpkCtfUnLicnsdCellParam
4649 *
4650 *
4651 *     Desc:   Unpacking unLicensed SDL cell specific parameter
4652 *
4653 *
4654 *     Ret: S16
4655 *
4656 *     Notes:
4657 *
4658 *     File: 
4659 *
4660 **********************************************************/
4661 static S16 cmUnpkCtfUnLicnsdCellParam
4662 (
4663 CtfUnLicnsdCfgInfo *param,
4664 Buffer *mBuf
4665 )
4666 {
4667    uint8_t  idx;
4668
4669    CMCHKUNPK(oduPackUInt8, &param->numFreq, mBuf);
4670
4671    for(idx = 0; idx < param->numFreq; idx++)
4672    {
4673       CMCHKUNPK(oduPackUInt32, &param->earfcn[idx], mBuf);
4674    }  
4675
4676    CMCHKUNPK(oduPackUInt16, &param->activityTh, mBuf);
4677    CMCHKUNPK(oduPackUInt16, &param->scanTimePrd, mBuf);
4678    CMCHKUNPK(SUnpkS16, &param->energyTh, mBuf);
4679    CMCHKUNPK(oduPackUInt16, &param->listenPrd, mBuf);
4680    CMCHKUNPK(oduPackUInt16, &param->transPeriod, mBuf);
4681    CMCHKUNPK(oduPackUInt8, &param->adaptiveTx, mBuf);
4682    CMCHKUNPK(oduPackUInt8, &param->ccaMethod, mBuf);
4683    CMCHKUNPK(oduPackUInt8, &param->lteOnPeriod, mBuf);
4684    CMCHKUNPK(oduPackUInt8, &param->coExistMethod, mBuf);
4685    CMCHKUNPK(SUnpkS32, &param->txPowerLimit, mBuf);
4686
4687    return ROK;
4688 }   
4689
4690 \f
4691 /***********************************************************
4692 *
4693 *     Func: cmUnpkCtfCellCfgInfo
4694 *
4695 *
4696 *     Desc:   Cell Configuration Information
4697  * @details This structure contains the information for setting-up
4698  *          of a cell and its associated resources at PHY.
4699 *
4700 *
4701 *     Ret: S16
4702 *
4703 *     Notes:
4704 *
4705 *     File: 
4706 *
4707 **********************************************************/
4708 S16 cmUnpkCtfCellCfgInfo
4709 (
4710 CtfCellCfgInfo *param,
4711 Buffer *mBuf
4712 )
4713 {
4714 #ifdef EMTC_ENABLE
4715    S32 i;
4716 #endif
4717
4718    /* ctf_c_001.main_3: Added the unpack for newly added fileds inside the CFG structure*/
4719    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
4720    CMCHKUNPK(oduPackUInt8, &param->cellIdGrpId, mBuf);
4721
4722    CMCHKUNPK(SUnpkS16, &param->schSapId, mBuf);
4723    CMCHKUNPK(SUnpkS16, &param->macSapId, mBuf);
4724
4725    CMCHKUNPK(oduPackUInt8, &param->physCellIdPres, mBuf);
4726    CMCHKUNPK(oduPackUInt8, &param->physCellId, mBuf);
4727    CMCHKUNPK(cmUnpkCtfBwCfgInfo, &param->bwCfg, mBuf);
4728    CMCHKUNPK(cmUnpkCtfTxSchemeCfg, &param->txCfg, mBuf);
4729    CMCHKUNPK(cmUnpkCtfAntennaCfgInfo, &param->antennaCfg, mBuf);
4730    CMCHKUNPK(cmUnpkCtfPrachCfgInfo, &param->prachCfg, mBuf);
4731    CMCHKUNPK(cmUnpkCtfPdschCfgInfo, &param->pdschCfg, mBuf);
4732    CMCHKUNPK(cmUnpkCtfPuschCfgInfo, &param->puschCfg, mBuf);
4733    CMCHKUNPK(cmUnpkCtfPhichCfgInfo, &param->phichCfg, mBuf);
4734    CMCHKUNPK(cmUnpkCtfPucchCfgInfo, &param->pucchCfg, mBuf);
4735    CMCHKUNPK(cmUnpkCtfSrsUlCfgInfo, &param->srsUlCfg, mBuf);
4736    CMCHKUNPK(cmUnpkCtfTddSfCfgInfo, &param->tddSfCfg, mBuf);
4737
4738    CMCHKUNPK(oduPackUInt16, &param->syncSigPowOs, mBuf);
4739    CMCHKUNPK(oduPackUInt8, &param->syncSigPowOsPres, mBuf);
4740
4741    CMCHKUNPK(oduPackUInt16, &param->cfiPowOs, mBuf);
4742    CMCHKUNPK(oduPackUInt8, &param->cfiPowOsPres, mBuf);
4743
4744    CMCHKUNPK(oduPackUInt16, &param->dciPowOs, mBuf);
4745    CMCHKUNPK(oduPackUInt8, &param->dciPowOsPres, mBuf);
4746
4747    CMCHKUNPK(oduPackUInt16, &param->extWinMargin, mBuf);
4748    CMCHKUNPK(oduPackUInt8, &param->extWinMarginPres, mBuf);
4749
4750    CMCHKUNPK(oduPackUInt16, &param->pucchNoiseGamma, mBuf);
4751    CMCHKUNPK(oduPackUInt8, &param->pucchNoiseGammaPres, mBuf);
4752
4753    CMCHKUNPK(oduPackUInt16, &param->prachPkRatio4, mBuf);
4754    CMCHKUNPK(oduPackUInt8, &param->prachPkRatio4Pres, mBuf);
4755
4756    CMCHKUNPK(oduPackUInt16, &param->prachPkRatio0, mBuf);
4757    CMCHKUNPK(oduPackUInt8, &param->prachPkRatio0Pres, mBuf);
4758
4759    CMCHKUNPK(oduPackUInt16, &param->srsDopEstFactor, mBuf);
4760    CMCHKUNPK(oduPackUInt8, &param->srsDopEstFactorPres, mBuf);
4761
4762    CMCHKUNPK(oduPackUInt16, &param->puschProbDtxAck, mBuf);
4763    CMCHKUNPK(oduPackUInt8, &param->puschProbDtxAckPres, mBuf);
4764
4765    CMCHKUNPK(oduPackUInt16, &param->pucchProbDtxAck, mBuf);
4766    CMCHKUNPK(oduPackUInt8, &param->pucchProbDtxAckPres, mBuf);
4767
4768    CMCHKUNPK(oduPackUInt16, &param->txAntennaPorts, mBuf);
4769    CMCHKUNPK(oduPackUInt8, &param->txAntennaPortsPres, mBuf);
4770
4771    CMCHKUNPK(oduPackUInt16, &param->rxAntennaPorts, mBuf);
4772    CMCHKUNPK(oduPackUInt8, &param->rxAntennaPortsPres, mBuf);
4773
4774    CMCHKUNPK(oduPackUInt16, &param->phySyncMode, mBuf);
4775    CMCHKUNPK(oduPackUInt8, &param->phySyncModePres, mBuf);
4776
4777    CMCHKUNPK(oduPackUInt16, &param->dataRepMode, mBuf);
4778    CMCHKUNPK(oduPackUInt8, &param->dataRepModePres, mBuf);
4779
4780    CMCHKUNPK(oduPackUInt16, &param->rachSrRepMode, mBuf);
4781    CMCHKUNPK(oduPackUInt8, &param->rachSrRepModePres, mBuf);
4782
4783    /* UnPacking PHY configuration parameters */
4784    CMCHKUNPK(oduPackUInt16, &param->opMode, mBuf);
4785    CMCHKUNPK(oduPackUInt32, &param->counter, mBuf);
4786    CMCHKUNPK(oduPackUInt32, &param->period, mBuf);
4787    CMCHKUNPK(SUnpkS16, &param->priSigPwr, mBuf);
4788    CMCHKUNPK(SUnpkS16, &param->secSigPwr, mBuf);
4789    CMCHKUNPK(oduPackUInt16, &param->dlEarfcn, mBuf);
4790    CMCHKUNPK(oduPackUInt16, &param->ulEarfcn, mBuf);
4791    CMCHKUNPK(SUnpkS16, &param->pilotSigPwr, mBuf);
4792    /* Added for rgu dynamic delta change*/
4793    CMCHKUNPK(oduPackUInt8, &param->numDlUePerTti, mBuf);
4794    CMCHKUNPK(oduPackUInt8, &param->unLicnsdCfgPres, mBuf);
4795
4796    if(param->unLicnsdCfgPres)
4797    {
4798       DU_LOG("\nDEBUG  -->  pverma param->unLicnsdCfgPres 2 -->%d \n",param->unLicnsdCfgPres);
4799       CMCHKUNPK(cmUnpkCtfUnLicnsdCellParam, &param->lteUCfg, mBuf);
4800    }   
4801 #ifdef EMTC_ENABLE
4802    CMCHKUNPK(oduPackUInt8, &param->catMenabled, mBuf);
4803    CMCHKUNPK(oduPackUInt8, &param->mPdcchStart, mBuf);
4804    
4805    for (i = 0; i < CTF_MAX_CE_LEVEL; i++) {
4806       CMCHKUNPK(oduPackUInt8, &param->ceLevelInfo[i].firstPreamble, mBuf);
4807       CMCHKUNPK(oduPackUInt8, &param->ceLevelInfo[i].lastPreamble, mBuf);
4808       CMCHKUNPK(oduPackUInt8, &param->ceLevelInfo[i].emtcNumRepPerPreambleAtt, mBuf);
4809    }
4810 #endif 
4811    return ROK;
4812 }
4813
4814
4815 \f
4816 /* ctf_c_001.main_4: Modified cmPkCtfCellRecfgInfo() to Add support for
4817  * vendor specific parameters */
4818 /***********************************************************
4819 *
4820 *     Func: cmPkCtfCellRecfgInfo
4821 *
4822 *
4823 *     Desc:   Cell Re-configuration Information
4824  * @details This structure contains the information for reconfiguration
4825  *          of a cell and its associated resources at PHY.
4826 *
4827 *
4828 *     Ret: S16
4829 *
4830 *     Notes:
4831 *
4832 *     File: 
4833 *
4834 **********************************************************/
4835 S16 cmPkCtfCellRecfgInfo
4836 (
4837 CtfCellRecfgInfo *param,
4838 Buffer *mBuf
4839 )
4840 {
4841
4842
4843 #ifdef ENABLE_API_LOG
4844    CMCHKPK(oduUnpackUInt8, param->enableAPILog, mBuf);
4845 #endif /* ENABLE_API_LOG */
4846    /* ctf_c_001.main_3: Added the pack for newly added fileds inside the CFG structure*/
4847    CMCHKPK(SPkS16, param->secSigPwr, mBuf);
4848    CMCHKPK(SPkS16, param->priSigPwr, mBuf);
4849    CMCHKPK(SPkS16, param->pilotSigPwr, mBuf);
4850    CMCHKPK(oduUnpackUInt8, param->rachSrRepModePres, mBuf);
4851    CMCHKPK(oduUnpackUInt16, param->rachSrRepMode, mBuf);
4852
4853    CMCHKPK(oduUnpackUInt8, param->dataRepModePres, mBuf);
4854    CMCHKPK(oduUnpackUInt16, param->dataRepMode, mBuf);
4855
4856    CMCHKPK(oduUnpackUInt8, param->phySyncModePres, mBuf);
4857    CMCHKPK(oduUnpackUInt16, param->phySyncMode, mBuf);
4858
4859    CMCHKPK(oduUnpackUInt8, param->rxAntennaPortsPres, mBuf);
4860    CMCHKPK(oduUnpackUInt16, param->rxAntennaPorts, mBuf);
4861
4862    CMCHKPK(oduUnpackUInt8, param->txAntennaPortsPres, mBuf);
4863    CMCHKPK(oduUnpackUInt16, param->txAntennaPorts, mBuf);
4864
4865    CMCHKPK(oduUnpackUInt8, param->pucchProbDtxAckPres, mBuf);
4866    CMCHKPK(oduUnpackUInt16, param->pucchProbDtxAck, mBuf);
4867
4868
4869    CMCHKPK(oduUnpackUInt8, param->puschProbDtxAckPres, mBuf);
4870    CMCHKPK(oduUnpackUInt16, param->puschProbDtxAck, mBuf);
4871
4872    CMCHKPK(oduUnpackUInt8, param->srsDopEstFactorPres, mBuf);
4873    CMCHKPK(oduUnpackUInt16, param->srsDopEstFactor, mBuf);
4874
4875    CMCHKPK(oduUnpackUInt8, param->prachPkRatio0Pres, mBuf);
4876    CMCHKPK(oduUnpackUInt16, param->prachPkRatio0, mBuf);
4877
4878    CMCHKPK(oduUnpackUInt8, param->prachPkRatio4Pres, mBuf);
4879    CMCHKPK(oduUnpackUInt16, param->prachPkRatio4, mBuf);
4880
4881    CMCHKPK(oduUnpackUInt8, param->pucchNoiseGammaPres, mBuf);
4882    CMCHKPK(oduUnpackUInt16, param->pucchNoiseGamma, mBuf);
4883
4884    CMCHKPK(oduUnpackUInt8, param->extWinMarginPres, mBuf);
4885    CMCHKPK(oduUnpackUInt16, param->extWinMargin, mBuf);
4886
4887    CMCHKPK(oduUnpackUInt8, param->dciPowOsPres, mBuf);
4888    CMCHKPK(oduUnpackUInt16, param->dciPowOs, mBuf);
4889
4890    CMCHKPK(oduUnpackUInt8, param->cfiPowOsPres, mBuf);
4891    CMCHKPK(oduUnpackUInt16, param->cfiPowOs, mBuf);
4892
4893    CMCHKPK(oduUnpackUInt8, param->syncSigPowOsPres, mBuf);
4894    CMCHKPK(oduUnpackUInt16, param->syncSigPowOs, mBuf);
4895
4896    CMCHKPK(cmPkCtfTddSfCfgInfo, &param->tddSfCfg, mBuf);
4897    CMCHKPK(cmPkCtfSrsUlCfgInfo, &param->srsUlCfg, mBuf);
4898    CMCHKPK(cmPkCtfPucchCfgInfo, &param->pucchCfg, mBuf);
4899    CMCHKPK(cmPkCtfPhichCfgInfo, &param->phichCfg, mBuf);
4900    CMCHKPK(cmPkCtfPuschCfgInfo, &param->puschCfg, mBuf);
4901    CMCHKPK(cmPkCtfPdschCfgInfo, &param->pdschCfg, mBuf);
4902    CMCHKPK(cmPkCtfPrachCfgInfo, &param->prachCfg, mBuf);
4903    CMCHKPK(cmPkLteTimingInfo, &param->actvnTime, mBuf);
4904    
4905    CMCHKPK(cmPkCtfAntennaCfgInfo, &param->antennaCfg, mBuf);
4906    CMCHKPK(cmPkCtfTxSchemeCfg, &param->txCfg, mBuf);
4907    CMCHKPK(cmPkCtfBwCfgInfo, &param->bwCfg, mBuf);
4908    CMCHKPK(oduUnpackUInt8, param->physCellId, mBuf);
4909    CMCHKPK(oduUnpackUInt8, param->physCellIdPres, mBuf);
4910    CMCHKPK(oduUnpackUInt8, param->cellIdGrpId, mBuf);
4911    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
4912    CMCHKPK(oduUnpackUInt32, param->ctfReCfgType, mBuf);
4913    return ROK;
4914 }
4915
4916
4917 \f
4918 /***********************************************************
4919 *
4920 *     Func: cmUnpkCtfCellRecfgInfo
4921 *
4922 *
4923 *     Desc:   Cell Re-configuration Information
4924  * @details This structure contains the information for reconfiguration
4925  *          of a cell and its associated resources at PHY.
4926 *
4927 *
4928 *     Ret: S16
4929 *
4930 *     Notes:
4931 *
4932 *     File: 
4933 *
4934 **********************************************************/
4935 S16 cmUnpkCtfCellRecfgInfo
4936 (
4937 CtfCellRecfgInfo *param,
4938 Buffer *mBuf
4939 )
4940 {
4941
4942    uint32_t tmpEnum;
4943    
4944    /* ctf_c_001.main_3: Added the unpack for newly added fileds inside the CFG structure*/
4945    CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
4946    param->ctfReCfgType = (CtfReCfgType)tmpEnum;
4947    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
4948    CMCHKUNPK(oduPackUInt8, &param->cellIdGrpId, mBuf);   
4949    CMCHKUNPK(oduPackUInt8, &param->physCellIdPres, mBuf);
4950    CMCHKUNPK(oduPackUInt8, &param->physCellId, mBuf);
4951    CMCHKUNPK(cmUnpkCtfBwCfgInfo, &param->bwCfg, mBuf);
4952    CMCHKUNPK(cmUnpkCtfTxSchemeCfg, &param->txCfg, mBuf);
4953    CMCHKUNPK(cmUnpkCtfAntennaCfgInfo, &param->antennaCfg, mBuf);
4954
4955    CMCHKUNPK(cmUnpkLteTimingInfo, &param->actvnTime, mBuf);
4956    CMCHKUNPK(cmUnpkCtfPrachCfgInfo, &param->prachCfg, mBuf);
4957    CMCHKUNPK(cmUnpkCtfPdschCfgInfo, &param->pdschCfg, mBuf);
4958    CMCHKUNPK(cmUnpkCtfPuschCfgInfo, &param->puschCfg, mBuf);
4959    CMCHKUNPK(cmUnpkCtfPhichCfgInfo, &param->phichCfg, mBuf);
4960    CMCHKUNPK(cmUnpkCtfPucchCfgInfo, &param->pucchCfg, mBuf);
4961    CMCHKUNPK(cmUnpkCtfSrsUlCfgInfo, &param->srsUlCfg, mBuf);
4962    CMCHKUNPK(cmUnpkCtfTddSfCfgInfo, &param->tddSfCfg, mBuf);
4963
4964    CMCHKUNPK(oduPackUInt16, &param->syncSigPowOs, mBuf);
4965    CMCHKUNPK(oduPackUInt8, &param->syncSigPowOsPres, mBuf);
4966
4967    CMCHKUNPK(oduPackUInt16, &param->cfiPowOs, mBuf);
4968    CMCHKUNPK(oduPackUInt8, &param->cfiPowOsPres, mBuf);
4969
4970    CMCHKUNPK(oduPackUInt16, &param->dciPowOs, mBuf);
4971    CMCHKUNPK(oduPackUInt8, &param->dciPowOsPres, mBuf);
4972
4973    CMCHKUNPK(oduPackUInt16, &param->extWinMargin, mBuf);
4974    CMCHKUNPK(oduPackUInt8, &param->extWinMarginPres, mBuf);
4975
4976    CMCHKUNPK(oduPackUInt16, &param->pucchNoiseGamma, mBuf);
4977    CMCHKUNPK(oduPackUInt8, &param->pucchNoiseGammaPres, mBuf);
4978
4979    CMCHKUNPK(oduPackUInt16, &param->prachPkRatio4, mBuf);
4980    CMCHKUNPK(oduPackUInt8, &param->prachPkRatio4Pres, mBuf);
4981
4982    CMCHKUNPK(oduPackUInt16, &param->prachPkRatio0, mBuf);
4983    CMCHKUNPK(oduPackUInt8, &param->prachPkRatio0Pres, mBuf);
4984
4985    CMCHKUNPK(oduPackUInt16, &param->srsDopEstFactor, mBuf);
4986    CMCHKUNPK(oduPackUInt8, &param->srsDopEstFactorPres, mBuf);
4987
4988    CMCHKUNPK(oduPackUInt16, &param->puschProbDtxAck, mBuf);
4989    CMCHKUNPK(oduPackUInt8, &param->puschProbDtxAckPres, mBuf);
4990
4991    CMCHKUNPK(oduPackUInt16, &param->pucchProbDtxAck, mBuf);
4992    CMCHKUNPK(oduPackUInt8, &param->pucchProbDtxAckPres, mBuf);
4993
4994    CMCHKUNPK(oduPackUInt16, &param->txAntennaPorts, mBuf);
4995    CMCHKUNPK(oduPackUInt8, &param->txAntennaPortsPres, mBuf);
4996
4997    CMCHKUNPK(oduPackUInt16, &param->rxAntennaPorts, mBuf);
4998    CMCHKUNPK(oduPackUInt8, &param->rxAntennaPortsPres, mBuf);
4999
5000    CMCHKUNPK(oduPackUInt16, &param->phySyncMode, mBuf);
5001    CMCHKUNPK(oduPackUInt8, &param->phySyncModePres, mBuf);
5002
5003    CMCHKUNPK(oduPackUInt16, &param->dataRepMode, mBuf);
5004    CMCHKUNPK(oduPackUInt8, &param->dataRepModePres, mBuf);
5005
5006    CMCHKUNPK(oduPackUInt16, &param->rachSrRepMode, mBuf);
5007    CMCHKUNPK(oduPackUInt8, &param->rachSrRepModePres, mBuf);
5008
5009    CMCHKUNPK(SUnpkS16, &param->pilotSigPwr, mBuf);
5010    CMCHKUNPK(SUnpkS16, &param->priSigPwr, mBuf);
5011    CMCHKUNPK(SUnpkS16, &param->secSigPwr, mBuf);
5012    DU_LOG("\nDEBUG  -->  param->pilotSigPwr = %d\nparam->priSigPwr = %d\n param->secSigPwr = %d\n",param->pilotSigPwr,param->priSigPwr,param->secSigPwr); 
5013 #ifdef ENABLE_API_LOG
5014    CMCHKUNPK(oduPackUInt8, &param->enableAPILog, mBuf);
5015 #endif /* ENABLE_API_LOG */
5016    return ROK;
5017 }
5018
5019
5020 \f
5021 /***********************************************************
5022 *
5023 *     Func: cmPkCtfDedPdschCfgInfo
5024 *
5025 *
5026 *     Desc:   Dedicated PDSCH Configuration
5027  * @details This structure contains the information for PDSCH configuration
5028  *          specific to an UE.
5029 *
5030 *
5031 *     Ret: S16
5032 *
5033 *     Notes:
5034 *
5035 *     File: 
5036 *
5037 **********************************************************/
5038 S16 cmPkCtfDedPdschCfgInfo
5039 (
5040 CtfDedPdschCfgInfo *param,
5041 Buffer *mBuf
5042 )
5043 {
5044
5045 /*ctf_c_001.main_1*/
5046    if(param->pres != FALSE)
5047       CMCHKPK(oduUnpackUInt32, param->pA, mBuf);
5048    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
5049    return ROK;
5050 }
5051
5052
5053 \f
5054 /***********************************************************
5055 *
5056 *     Func: cmUnpkCtfDedPdschCfgInfo
5057 *
5058 *
5059 *     Desc:   Dedicated PDSCH Configuration
5060  * @details This structure contains the information for PDSCH configuration
5061  *          specific to an UE.
5062 *
5063 *
5064 *     Ret: S16
5065 *
5066 *     Notes:
5067 *
5068 *     File: 
5069 *
5070 **********************************************************/
5071 S16 cmUnpkCtfDedPdschCfgInfo
5072 (
5073 CtfDedPdschCfgInfo *param,
5074 Buffer *mBuf
5075 )
5076 {
5077    uint32_t tmpEnum;
5078
5079    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
5080 /*ctf_c_001.main_1*/
5081    if(param->pres != FALSE)
5082    {
5083       CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
5084       param->pA = (CtfPdschPaParam)tmpEnum;
5085    }
5086    return ROK;
5087 }
5088
5089
5090 \f
5091 /***********************************************************
5092 *
5093 *     Func: cmPkCtfDedPucchCfgInfo
5094 *
5095 *
5096 *     Desc:   Dedicated PUCCH Configuration
5097  * @details This structure contains the information for setting-up/release 
5098  *          PUCCH configuration specific to an UE.
5099 *
5100 *
5101 *     Ret: S16
5102 *
5103 *     Notes:
5104 *
5105 *     File: 
5106 *
5107 **********************************************************/
5108 S16 cmPkCtfDedPucchCfgInfo
5109 (
5110 CtfDedPucchCfgInfo *param,
5111 Buffer *mBuf
5112 )
5113 {
5114
5115
5116 /*ctf_c_001.main_1*/
5117   if(param->pres != FALSE)
5118   {
5119 #ifdef CTF_VER3
5120      /*ctf_c_001.main_4:115549: packing tddAckNackFBMode and tddAckNackCfgPres */
5121        if (param->tddAckNackCfgPres != FALSE)
5122        {
5123           CMCHKPK(oduUnpackUInt32, param->tddAckNackFBMode, mBuf);
5124        }
5125  
5126        CMCHKPK(oduUnpackUInt8, param->tddAckNackCfgPres, mBuf);
5127 #endif /* CTF_VER3 */
5128       CMCHKPK(oduUnpackUInt16, param->pucchSetup.n1PUCCHRep, mBuf);
5129 #ifdef CTF_VER3
5130       /*ctf_c_001.main_4:115549: packing pucchSetup.repFactPres */
5131        if (param->pucchSetup.repFactPres)
5132        {
5133           CMCHKPK(oduUnpackUInt32, param->pucchSetup.repFact, mBuf);
5134        }
5135  
5136        CMCHKPK(oduUnpackUInt8, param->pucchSetup.repFactPres, mBuf);
5137 #else
5138         CMCHKPK(oduUnpackUInt32, param->pucchSetup.repFact, mBuf);
5139 #endif /* CTF_VER3 */
5140       CMCHKPK(oduUnpackUInt8, param->dedPucchCfgType, mBuf);
5141   }
5142   CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
5143   return ROK;
5144 }
5145
5146
5147 \f
5148 /***********************************************************
5149 *
5150 *     Func: cmUnpkCtfDedPucchCfgInfo
5151 *
5152 *
5153 *     Desc:   Dedicated PUCCH Configuration
5154  * @details This structure contains the information for setting-up/release 
5155  *          PUCCH configuration specific to an UE.
5156 *
5157 *
5158 *     Ret: S16
5159 *
5160 *     Notes:
5161 *
5162 *     File: 
5163 *
5164 **********************************************************/
5165 S16 cmUnpkCtfDedPucchCfgInfo
5166 (
5167 CtfDedPucchCfgInfo *param,
5168 Buffer *mBuf
5169 )
5170 {
5171
5172
5173    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
5174 /*ctf_c_001.main_1*/
5175    if(param->pres != FALSE)
5176    {
5177       CMCHKUNPK(oduPackUInt8, &param->dedPucchCfgType, mBuf);
5178 #ifdef CTF_VER3
5179       /* ctf_c_001.main_4:115549: unpacking pucchSetup.repFactPres */
5180        CMCHKUNPK(oduPackUInt8, &param->pucchSetup.repFactPres, mBuf);
5181  
5182        if (param->pucchSetup.repFactPres)
5183        {
5184           CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->pucchSetup.repFact, mBuf);
5185        }
5186 #else
5187         CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->pucchSetup.repFact, mBuf);
5188 #endif /*CTF_VER3 */
5189       CMCHKUNPK(oduPackUInt16, &param->pucchSetup.n1PUCCHRep, mBuf);
5190 #ifdef CTF_VER3
5191       /*ctf_c_001.main_4:115549: unpacking tddAckNackCfgPres and tddAckNackFBMode */
5192       CMCHKUNPK(oduPackUInt8, &param->tddAckNackCfgPres, mBuf);
5193
5194       if (param->tddAckNackCfgPres != FALSE)
5195       {
5196          CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->tddAckNackFBMode, mBuf);
5197       }
5198 #endif /* CTF_VER3 */
5199    }
5200    return ROK;
5201 }
5202
5203
5204 \f
5205 /***********************************************************
5206 *
5207 *     Func: cmPkCtfDedPuschCfgInfo
5208 *
5209 *
5210 *     Desc:   Dedicated PUSCH Configuration
5211  * @details This structure contains the information for PUCCH 
5212  *          configuration specific to an UE.
5213 *
5214 *
5215 *     Ret: S16
5216 *
5217 *     Notes:
5218 *
5219 *     File: 
5220 *
5221 **********************************************************/
5222 S16 cmPkCtfDedPuschCfgInfo
5223 (
5224 CtfDedPuschCfgInfo *param,
5225 Buffer *mBuf
5226 )
5227 {
5228
5229 /*ctf_c_001.main_1*/
5230    if(param->pres != FALSE)
5231    {
5232       CMCHKPK(oduUnpackUInt8, param->betaOffsetCqiIdx, mBuf);
5233       CMCHKPK(oduUnpackUInt8, param->betaOffsetRiIdx, mBuf);
5234       CMCHKPK(oduUnpackUInt8, param->betaOffsetAckIdx, mBuf);
5235    }
5236    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
5237    return ROK;
5238 }
5239
5240
5241 \f
5242 /***********************************************************
5243 *
5244 *     Func: cmUnpkCtfDedPuschCfgInfo
5245 *
5246 *
5247 *     Desc:   Dedicated PUSCH Configuration
5248  * @details This structure contains the information for PUCCH 
5249  *          configuration specific to an UE.
5250 *
5251 *
5252 *     Ret: S16
5253 *
5254 *     Notes:
5255 *
5256 *     File: 
5257 *
5258 **********************************************************/
5259 S16 cmUnpkCtfDedPuschCfgInfo
5260 (
5261 CtfDedPuschCfgInfo *param,
5262 Buffer *mBuf
5263 )
5264 {
5265
5266    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
5267 /*ctf_c_001.main_1*/
5268    if(param->pres != FALSE)
5269    {
5270       CMCHKUNPK(oduPackUInt8, &param->betaOffsetAckIdx, mBuf);
5271       CMCHKUNPK(oduPackUInt8, &param->betaOffsetRiIdx, mBuf);
5272       CMCHKUNPK(oduPackUInt8, &param->betaOffsetCqiIdx, mBuf);
5273    }
5274    return ROK;
5275 }
5276
5277
5278 #ifndef TFU_UPGRADE
5279 \f
5280 /***********************************************************
5281 *
5282 *     Func: cmPkCtfCqiRptModePeriodic
5283 *
5284 *
5285 *     Desc:   Periodic CQI Report Configuration
5286  * @details This structure contains the information for periodic CQI report
5287  *          related configuration specific to an UE.
5288 *
5289 *
5290 *     Ret: S16
5291 *
5292 *     Notes:
5293 *
5294 *     File: 
5295 *
5296 **********************************************************/
5297 S16 cmPkCtfCqiRptModePeriodic
5298 (
5299 CtfCqiRptModePeriodic *param,
5300 Buffer *mBuf
5301 )
5302 {
5303
5304 /* ctf_c_001.main_2: added packning for cqiMask*/
5305 #ifdef CTF_VER1
5306       CMCHKPK(oduUnpackUInt32, (uint32_t )param->cqiSetup.cqiMask.cqiMaskSetup, mBuf);
5307       CMCHKPK(oduUnpackUInt8, param->cqiSetup.cqiMask.pres, mBuf);
5308 #endif /* CTF_VER1 */
5309       CMCHKPK(oduUnpackUInt8, param->cqiSetup.simultaneousAckNack, mBuf);
5310       CMCHKPK(oduUnpackUInt16, param->cqiSetup.riCfgIndx, mBuf);
5311       CMCHKPK(oduUnpackUInt8, param->cqiSetup.riCfgPres, mBuf);
5312       CMCHKPK(oduUnpackUInt8, param->cqiSetup.subbandCqi.k, mBuf);
5313       CMCHKPK(oduUnpackUInt8, param->cqiSetup.formatIndicator, mBuf);
5314       CMCHKPK(oduUnpackUInt16, param->cqiSetup.cqiPmiCfgIndx, mBuf);
5315       CMCHKPK(oduUnpackUInt16, param->cqiSetup.cqiPUCCHRsrcIndx, mBuf);
5316    CMCHKPK(oduUnpackUInt8, param->cqiPeriodicCfgType, mBuf);
5317    return ROK;
5318 }
5319
5320
5321 \f
5322 /***********************************************************
5323 *
5324 *     Func: cmUnpkCtfCqiRptModePeriodic
5325 *
5326 *
5327 *     Desc:   Periodic CQI Report Configuration
5328  * @details This structure contains the information for periodic CQI report
5329  *          related configuration specific to an UE.
5330 *
5331 *
5332 *     Ret: S16
5333 *
5334 *     Notes:
5335 *
5336 *     File: 
5337 *
5338 **********************************************************/
5339 S16 cmUnpkCtfCqiRptModePeriodic
5340 (
5341 CtfCqiRptModePeriodic *param,
5342 Buffer *mBuf
5343 )
5344 {
5345 #ifdef CTF_VER1    
5346    uint32_t tmpEnum;
5347 #endif   
5348
5349    CMCHKUNPK(oduPackUInt8, &param->cqiPeriodicCfgType, mBuf);
5350       CMCHKUNPK(oduPackUInt16, &param->cqiSetup.cqiPUCCHRsrcIndx, mBuf);
5351       CMCHKUNPK(oduPackUInt16, &param->cqiSetup.cqiPmiCfgIndx, mBuf);
5352       CMCHKUNPK(oduPackUInt8, &param->cqiSetup.formatIndicator, mBuf);
5353          CMCHKUNPK(oduPackUInt8, &param->cqiSetup.subbandCqi.k, mBuf);
5354       CMCHKUNPK(oduPackUInt8, &param->cqiSetup.riCfgPres, mBuf);
5355       CMCHKUNPK(oduPackUInt16, &param->cqiSetup.riCfgIndx, mBuf);
5356       CMCHKUNPK(oduPackUInt8, &param->cqiSetup.simultaneousAckNack, mBuf);
5357 /* ctf_c_001.main_2: added Unpackning for cqiMask*/
5358 #ifdef CTF_VER1
5359       CMCHKUNPK(oduPackUInt8, &param->cqiSetup.cqiMask.pres, mBuf);
5360       CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
5361       param->cqiSetup.cqiMask.cqiMaskSetup = tmpEnum;
5362 #endif /* CTF_VER1 */
5363    return ROK;
5364 }
5365
5366
5367 \f
5368 /***********************************************************
5369 *
5370 *     Func: cmPkCtfCqiReportCfgInfo
5371 *
5372 *
5373 *     Desc:   CQI Report Configuration
5374  * @details This structure contains the information for CQI report
5375  *          related configuration specific to an UE.
5376 *
5377 *
5378 *     Ret: S16
5379 *
5380 *     Notes:
5381 *
5382 *     File: 
5383 *
5384 **********************************************************/
5385 S16 cmPkCtfCqiReportCfgInfo
5386 (
5387 CtfCqiReportCfgInfo *param,
5388 Buffer *mBuf
5389 )
5390 {
5391
5392 /*ctf_c_001.main_1*/
5393    if(param->pres != FALSE)
5394    {
5395 #ifdef CTF_VER2
5396       /* 
5397        * ctf_c_001.main_2: Added provision to send Periodic and aPeriodic CQI
5398        *report configuration in the same message
5399        */
5400        if(param->reportMode.aPeriodicRpt.pres != FALSE)
5401        {
5402            CMCHKPK(oduUnpackUInt32, param->reportMode.aPeriodicRpt.aPeriodicRptMode, mBuf);
5403        }
5404        CMCHKPK(oduUnpackUInt8, param->reportMode.aPeriodicRpt.pres, mBuf);
5405
5406        if(param->reportMode.periodicRpt.pres != FALSE)
5407        {
5408            CMCHKPK(cmPkCtfCqiRptModePeriodic, &param->reportMode.periodicRpt, mBuf);
5409        }
5410        CMCHKPK(oduUnpackUInt8, param->reportMode.periodicRpt.pres, mBuf);
5411
5412 #else /* CTF_VER2 */
5413
5414       switch(param->reportingMode) {
5415          case CTF_CQI_RPTMODE_PRDIOC:
5416             CMCHKPK(cmPkCtfCqiRptModePeriodic, &param->reportMode.periodicRpt, mBuf);
5417             break;
5418          case CTF_CQI_RPTMODE_APRDIOC:
5419             CMCHKPK(oduUnpackUInt32, param->reportMode.aPeriodicRpt, mBuf);
5420             break;
5421          default :
5422             return RFAILED;
5423       }
5424       CMCHKPK(oduUnpackUInt8, param->reportingMode, mBuf);
5425 #endif /* CTF_VER2 */
5426
5427 /* ctf_c_001.main_2: added packning for pmiRiRpt*/
5428 #ifdef CTF_VER1
5429        CMCHKPK(oduUnpackUInt32, param->pmiRiRpt.pmiRiRptSetup, mBuf);
5430        CMCHKPK(oduUnpackUInt8, param->pmiRiRpt.pres, mBuf);
5431 #endif /* CTF_VER1 */
5432    }
5433
5434    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
5435    return ROK;
5436 }
5437
5438
5439 \f
5440 /***********************************************************
5441 *
5442 *     Func: cmUnpkCtfCqiReportCfgInfo
5443 *
5444 *
5445 *     Desc:   CQI Report Configuration
5446  * @details This structure contains the information for CQI report
5447  *          related configuration specific to an UE.
5448 *
5449 *
5450 *     Ret: S16
5451 *
5452 *     Notes:
5453 *
5454 *     File: 
5455 *
5456 **********************************************************/
5457 S16 cmUnpkCtfCqiReportCfgInfo
5458 (
5459 CtfCqiReportCfgInfo *param,
5460 Buffer *mBuf
5461 )
5462 {
5463 #if defined (CTF_VER1) || defined (CTF_VER2)
5464    uint32_t tmpEnum;
5465 #endif
5466
5467    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
5468 /*ctf_c_001.main_1*/
5469    if(param->pres != FALSE)
5470    {
5471 /* ctf_c_001.main_2: added Unpackning for cqiMask*/
5472 #ifdef CTF_VER1
5473       CMCHKUNPK(oduPackUInt8, &param->pmiRiRpt.pres, mBuf);
5474       CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
5475       param->pmiRiRpt.pmiRiRptSetup = tmpEnum;
5476 #endif /* CTF_VER1 */
5477
5478 #ifdef CTF_VER2
5479       /* 
5480        *ctf_c_001.main_2: Added provision to send Periodic and aPeriodic CQI
5481        *report configuration in the same message
5482        */
5483       CMCHKUNPK(oduPackUInt8, &param->reportMode.periodicRpt.pres, mBuf)
5484       if(param->reportMode.periodicRpt.pres != FALSE)
5485       {
5486          CMCHKUNPK(cmUnpkCtfCqiRptModePeriodic, &param->reportMode.periodicRpt, mBuf);
5487       }
5488        
5489       CMCHKUNPK(oduPackUInt8, &param->reportMode.aPeriodicRpt.pres, mBuf)
5490       if(param->reportMode.aPeriodicRpt.pres != FALSE)
5491       {
5492          CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
5493          param->reportMode.aPeriodicRpt.aPeriodicRptMode =
5494             (CtfCqiRptModeAperiodic)tmpEnum;
5495       }
5496
5497 #else /* CTF_VER2 */
5498
5499       CMCHKUNPK(oduPackUInt8, &param->reportingMode, mBuf);
5500       switch(param->reportingMode) {
5501          case CTF_CQI_RPTMODE_APRDIOC:
5502             CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->reportMode.aPeriodicRpt, mBuf);
5503             break;
5504          case CTF_CQI_RPTMODE_PRDIOC:
5505             CMCHKUNPK(cmUnpkCtfCqiRptModePeriodic, &param->reportMode.periodicRpt, mBuf);
5506             break;
5507          default :
5508             return RFAILED;
5509       }
5510 #endif /* CTF_VER2 */
5511    }
5512    return ROK;
5513 }
5514
5515
5516 \f
5517 /***********************************************************
5518 *
5519 *     Func: cmPkCtfDedSrsUlCfgInfo
5520 *
5521 *
5522 *     Desc:   Dedicated Uplink SRS Configuration
5523  * @details This structure contains the information for setting-up/release
5524  *          UL SRS configuration specific to an UE.
5525 *
5526 *
5527 *     Ret: S16
5528 *
5529 *     Notes:
5530 *
5531 *     File: 
5532 *
5533 **********************************************************/
5534 S16 cmPkCtfDedSrsUlCfgInfo
5535 (
5536 CtfDedSrsUlCfgInfo *param,
5537 Buffer *mBuf
5538 )
5539 {
5540
5541 /*ctf_c_001.main_1*/
5542    if(param->pres != FALSE)
5543    {
5544       CMCHKPK(oduUnpackUInt8, param->dedSrsSetup.cyclicShift, mBuf);
5545       CMCHKPK(oduUnpackUInt8, param->dedSrsSetup.txComb, mBuf);
5546       CMCHKPK(oduUnpackUInt16, param->dedSrsSetup.srsCfgIdx, mBuf);
5547       CMCHKPK(oduUnpackUInt8, param->dedSrsSetup.duration, mBuf);
5548       CMCHKPK(oduUnpackUInt8, param->dedSrsSetup.freqDmnPos, mBuf);
5549       CMCHKPK(oduUnpackUInt8, param->dedSrsSetup.srsHopngBw, mBuf);
5550       CMCHKPK(oduUnpackUInt8, param->dedSrsSetup.srsBw, mBuf);
5551       CMCHKPK(oduUnpackUInt8, param->dedSrsUlCfgType, mBuf);
5552    }
5553    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
5554    return ROK;
5555 }
5556
5557
5558 \f
5559 /***********************************************************
5560 *
5561 *     Func: cmUnpkCtfDedSrsUlCfgInfo
5562 *
5563 *
5564 *     Desc:   Dedicated Uplink SRS Configuration
5565  * @details This structure contains the information for setting-up/release
5566  *          UL SRS configuration specific to an UE.
5567 *
5568 *
5569 *     Ret: S16
5570 *
5571 *     Notes:
5572 *
5573 *     File: 
5574 *
5575 **********************************************************/
5576 S16 cmUnpkCtfDedSrsUlCfgInfo
5577 (
5578 CtfDedSrsUlCfgInfo *param,
5579 Buffer *mBuf
5580 )
5581 {
5582
5583    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
5584 /*ctf_c_001.main_1*/
5585    if(param->pres != FALSE)
5586    {
5587       CMCHKUNPK(oduPackUInt8, &param->dedSrsUlCfgType, mBuf);
5588       CMCHKUNPK(oduPackUInt8, &param->dedSrsSetup.srsBw, mBuf);
5589       CMCHKUNPK(oduPackUInt8, &param->dedSrsSetup.srsHopngBw, mBuf);
5590       CMCHKUNPK(oduPackUInt8, &param->dedSrsSetup.freqDmnPos, mBuf);
5591       CMCHKUNPK(oduPackUInt8, &param->dedSrsSetup.duration, mBuf);
5592       CMCHKUNPK(oduPackUInt16, &param->dedSrsSetup.srsCfgIdx, mBuf);
5593       CMCHKUNPK(oduPackUInt8, &param->dedSrsSetup.txComb, mBuf);
5594       CMCHKUNPK(oduPackUInt8, &param->dedSrsSetup.cyclicShift, mBuf);
5595    }
5596    return ROK;
5597 }
5598
5599
5600 \f
5601 /***********************************************************
5602 *
5603 *     Func: cmPkCtfDedSRCfgInfo
5604 *
5605 *
5606 *     Desc:   Dedicated SR Configuration
5607  * @details This structure contains the information for setting-up/release
5608  *          SR configuration specific to an UE at PHY.
5609 *
5610 *
5611 *     Ret: S16
5612 *
5613 *     Notes:
5614 *
5615 *     File: 
5616 *
5617 **********************************************************/
5618 S16 cmPkCtfDedSRCfgInfo
5619 (
5620 CtfDedSRCfgInfo *param,
5621 Buffer *mBuf
5622 )
5623 {
5624
5625 /*ctf_c_001.main_1*/
5626   if(param->pres != FALSE)
5627   {
5628      CMCHKPK(oduUnpackUInt8, param->dedSrSetup.srCfgIdx, mBuf);
5629      CMCHKPK(oduUnpackUInt16, param->dedSrSetup.srPUCCHRi, mBuf);
5630      CMCHKPK(oduUnpackUInt8, param->dedSRCfgType, mBuf);
5631   }
5632   CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
5633   return ROK;
5634 }
5635
5636
5637 \f
5638 /***********************************************************
5639 *
5640 *     Func: cmUnpkCtfDedSRCfgInfo
5641 *
5642 *
5643 *     Desc:   Dedicated SR Configuration
5644  * @details This structure contains the information for setting-up/release
5645  *          SR configuration specific to an UE at PHY.
5646 *
5647 *
5648 *     Ret: S16
5649 *
5650 *     Notes:
5651 *
5652 *     File: 
5653 *
5654 **********************************************************/
5655 S16 cmUnpkCtfDedSRCfgInfo
5656 (
5657 CtfDedSRCfgInfo *param,
5658 Buffer *mBuf
5659 )
5660 {
5661
5662
5663    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
5664 /*ctf_c_001.main_1*/
5665    if(param->pres != FALSE)
5666    {
5667       CMCHKUNPK(oduPackUInt8, &param->dedSRCfgType, mBuf);
5668       CMCHKUNPK(oduPackUInt16, &param->dedSrSetup.srPUCCHRi, mBuf);
5669       CMCHKUNPK(oduPackUInt8, &param->dedSrSetup.srCfgIdx, mBuf);
5670    }
5671    return ROK;
5672 }
5673
5674 #endif /* TFU_UPGRADE */
5675
5676 \f
5677 /***********************************************************
5678 *
5679 *     Func: cmPkCtfDedAntCfgInfo
5680 *
5681 *
5682 *     Desc:   Dedicated Antenna Configuration
5683  * @details This structure contains the information for antenna related
5684  *          configuration specific to an UE at PHY.
5685 *
5686 *
5687 *     Ret : S16
5688 *
5689 *     Notes:
5690 *
5691 *     File: 
5692 *
5693 **********************************************************/
5694 S16 cmPkCtfDedAntCfgInfo
5695 (
5696 CtfDedAntCfgInfo *param,
5697 Buffer *mBuf
5698 )
5699 {
5700    
5701 #ifdef CTF_VER2
5702    uint8_t  idx;
5703 #endif  /* CTF_VER2 */
5704
5705
5706 /*ctf_c_001.main_1*/
5707    if(param->pres != FALSE)
5708    {
5709       CMCHKPK(oduUnpackUInt32, param->ueTxAntSelection.txAntSelect, mBuf);
5710       CMCHKPK(oduUnpackUInt8, param->ueTxAntSelection.cfgType, mBuf);
5711      /* ctf_c_001.main_3 txMode is of type enum and is 32bit length */
5712       CMCHKPK(oduUnpackUInt32, (uint32_t)param->txMode, mBuf);
5713 #ifdef CTF_VER2
5714       /* 
5715        *ctf_c_001.main_2: Added Packing of CodeBookSubsetRestriction parameter
5716        */
5717       switch(param->codeBookSubsetRes.ctfCdBkRestType)
5718       {
5719           case N2TX_ANT_TM3:
5720               CMCHKPK(oduUnpackUInt8, param->codeBookSubsetRes.codeBookSubsetRestn.
5721                              n2TxAntTm3, mBuf);
5722               break;
5723
5724           case N4TX_ANT_TM3:
5725               CMCHKPK(oduUnpackUInt8, param->codeBookSubsetRes.codeBookSubsetRestn.
5726                              n4TxAntTm3, mBuf);
5727               break;
5728
5729           case N2TX_ANT_TM4:
5730               CMCHKPK(oduUnpackUInt8, param->codeBookSubsetRes.codeBookSubsetRestn.
5731                              n2TxAntTm4, mBuf);
5732               break;
5733
5734           case N4TX_ANT_TM4:
5735               for(idx = 0; idx < 8; idx++)
5736                   CMCHKPK(oduUnpackUInt8, param->codeBookSubsetRes.codeBookSubsetRestn.
5737                                  n4TxAntTm4[idx], mBuf);
5738               break;
5739
5740           case N2TX_ANT_TM5:
5741               CMCHKPK(oduUnpackUInt8, param->codeBookSubsetRes.codeBookSubsetRestn.
5742                              n2TxAntTm5, mBuf);
5743               break;
5744
5745           case N4TX_ANT_TM5:
5746               CMCHKPK(oduUnpackUInt16, param->codeBookSubsetRes.codeBookSubsetRestn.
5747                               n4TxAntTm5, mBuf);
5748               break;
5749
5750           case N2TX_ANT_TM6:
5751               CMCHKPK(oduUnpackUInt8, param->codeBookSubsetRes.codeBookSubsetRestn.
5752                              n2TxAntTm6, mBuf);
5753               break;
5754
5755           case N4TX_ANT_TM6:
5756               CMCHKPK(oduUnpackUInt16, param->codeBookSubsetRes.codeBookSubsetRestn.
5757                               n4TxAntTm6, mBuf);
5758               break;
5759           default :
5760               break;
5761
5762       }
5763       CMCHKPK(oduUnpackUInt32, param->codeBookSubsetRes.ctfCdBkRestType, mBuf);
5764 #endif /* CTF_VER2 */
5765    }
5766    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
5767    return ROK;
5768 }
5769
5770
5771 \f
5772 /***********************************************************
5773 *
5774 *     Func: cmUnpkCtfDedAntCfgInfo
5775 *
5776 *
5777 *     Desc:   Dedicated Antenna Configuration
5778  * @details This structure contains the information for antenna related
5779  *          configuration specific to an UE at PHY.
5780 *
5781 *
5782 *     Ret: S16
5783 *
5784 *     Notes:
5785 *
5786 *     File: 
5787 *
5788 **********************************************************/
5789 S16 cmUnpkCtfDedAntCfgInfo
5790 (
5791 CtfDedAntCfgInfo *param,
5792 Buffer *mBuf
5793 )
5794 {
5795 #ifdef CTF_VER2
5796    S16  idx;
5797 #endif /* CTF_VER2 */
5798    
5799    uint32_t tmpEnum;
5800
5801
5802    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
5803 /*ctf_c_001.main_1*/
5804    if(param->pres != FALSE)
5805    {
5806 #ifdef CTF_VER2
5807       /* 
5808        * Added Unpacking for CodeBookSubsetRestriction parameter
5809        */
5810       CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
5811       param->codeBookSubsetRes.ctfCdBkRestType = (CtfCdBkSubsetRestnType)tmpEnum;
5812       switch(param->codeBookSubsetRes.ctfCdBkRestType)
5813       {
5814           case N2TX_ANT_TM3:
5815               CMCHKUNPK(oduPackUInt8, &param->codeBookSubsetRes.codeBookSubsetRestn.
5816                              n2TxAntTm3, mBuf);
5817               break;
5818
5819           case N4TX_ANT_TM3:
5820               CMCHKUNPK(oduPackUInt8, &param->codeBookSubsetRes.codeBookSubsetRestn.
5821                              n4TxAntTm3, mBuf);
5822               break;
5823
5824           case N2TX_ANT_TM4:
5825               CMCHKUNPK(oduPackUInt8, &param->codeBookSubsetRes.codeBookSubsetRestn.
5826                              n2TxAntTm4, mBuf);
5827               break;
5828
5829           case N4TX_ANT_TM4:
5830               for(idx = 7; idx >= 0; idx--)
5831               {
5832                  CMCHKUNPK(oduPackUInt8, &(param->codeBookSubsetRes.codeBookSubsetRestn.
5833                        n4TxAntTm4[idx]), mBuf);
5834               }
5835               break;
5836
5837           case N2TX_ANT_TM5:
5838               CMCHKUNPK(oduPackUInt8, &param->codeBookSubsetRes.codeBookSubsetRestn.
5839                              n2TxAntTm5, mBuf);
5840               break;
5841
5842           case N4TX_ANT_TM5:
5843               CMCHKUNPK(oduPackUInt16, &param->codeBookSubsetRes.codeBookSubsetRestn.
5844                               n4TxAntTm5, mBuf);
5845               break;
5846
5847           case N2TX_ANT_TM6:
5848               CMCHKUNPK(oduPackUInt8, &param->codeBookSubsetRes.codeBookSubsetRestn.
5849                              n2TxAntTm6, mBuf);
5850               break;
5851
5852           case N4TX_ANT_TM6:
5853               CMCHKUNPK(oduPackUInt16, &param->codeBookSubsetRes.codeBookSubsetRestn.
5854                               n4TxAntTm6, mBuf);
5855               break;
5856           default :
5857               break;
5858       }
5859 #endif /* CTF_VER2 */
5860       /* ctf_c_001.main_3 Enum is 32bit length */
5861       CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
5862       param->txMode = (CtfUeTxAntMode)tmpEnum;
5863       CMCHKUNPK(oduPackUInt8, &param->ueTxAntSelection.cfgType, mBuf);
5864       CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
5865       param->ueTxAntSelection.txAntSelect = (CtfUeTxAntSelectType)tmpEnum;
5866    }
5867    return ROK;
5868 }
5869
5870 \f
5871 /***********************************************************
5872 *
5873 *     Func: cmPkCtfUeSecCellCfgInfo
5874 *
5875 *
5876 *     Desc:   Secondary Cell Configuration for a UE
5877  * @details This structure contains the information for 
5878 *           secondary cells for the UE
5879 *
5880 *     Ret: S16
5881 *
5882 *     Notes:
5883 *
5884 *     File: 
5885 *
5886 **********************************************************/
5887 S16 cmPkCtfUeSecCellCfgInfo
5888 (
5889 CtfUeSecCellCfgInfo *param,
5890 Buffer *mBuf
5891 )
5892 {
5893    CMCHKPK(oduUnpackUInt16, param->sCellId, mBuf);
5894    CMCHKPK(oduUnpackUInt8, param->sCellIdx, mBuf);
5895
5896    return ROK;
5897 }
5898 /***********************************************************
5899 *
5900 *     Func: cmPkCtfSecCellCfgInfo
5901 *
5902 *
5903 *     Desc:   Secondary Cell Configuration for a UE
5904  * @details This structure contains the information for 
5905 *           secondary cells for the UE
5906 *
5907 *     Ret: S16
5908 *
5909 *     Notes:
5910 *
5911 *     File: 
5912 *
5913 **********************************************************/
5914 S16 cmPkCtfSecCellCfgInfo
5915 (
5916 CtfSecCellCfgInfo *param,
5917 Buffer *mBuf
5918 )
5919 {
5920    S8 idx;
5921
5922    for(idx = param->numSCells - 1; idx >= 0; idx--)
5923    {
5924       CMCHKPK(cmPkCtfUeSecCellCfgInfo, &param->ueSCellDedCfg[(uint8_t)idx], mBuf);
5925    }
5926    CMCHKPK(oduUnpackUInt32, param->sCellAction, mBuf);
5927    CMCHKPK(oduUnpackUInt8, param->numSCells, mBuf);
5928
5929    return ROK;
5930 }
5931
5932 /***********************************************************
5933 *
5934 *     Func: cmUnpkCtfUeSecCellCfgInfo
5935 *
5936 *
5937 *     Desc:   Secondary Cell Configuration for a UE
5938  * @details This structure contains the information for 
5939 *           secondary cells for the UE
5940 *
5941 *     Ret: S16
5942 *
5943 *     Notes:
5944 *
5945 *     File: 
5946 *
5947 **********************************************************/
5948 S16 cmUnpkCtfUeSecCellCfgInfo
5949 (
5950 CtfUeSecCellCfgInfo *param,
5951 Buffer *mBuf
5952 )
5953 {
5954    CMCHKUNPK(oduPackUInt8, &param->sCellIdx, mBuf);
5955    CMCHKUNPK(oduPackUInt16, &param->sCellId, mBuf);
5956
5957    return ROK;
5958 }
5959 \f
5960 /***********************************************************
5961 *
5962 *     Func: cmUnpkCtfSecCellCfgInfo
5963 *
5964 *
5965 *     Desc:   Secondary Cell Configuration for a UE
5966  * @details This structure contains the information for 
5967 *           secondary cells for the UE
5968 *
5969 *     Ret: S16
5970 *
5971 *     Notes:
5972 *
5973 *     File: 
5974 *
5975 **********************************************************/
5976
5977 S16 cmUnpkCtfSecCellCfgInfo
5978 (
5979 CtfSecCellCfgInfo *param,
5980 Buffer *mBuf
5981 )
5982 {
5983    uint8_t idx;
5984
5985    CMCHKUNPK(oduPackUInt8, &param->numSCells, mBuf);
5986    CMCHKUNPK(oduPackUInt32, (uint32_t*)&param->sCellAction, mBuf);
5987    for(idx = 0 ; idx < param->numSCells; idx++)
5988    {
5989       CMCHKUNPK(cmUnpkCtfUeSecCellCfgInfo, &param->ueSCellDedCfg[idx], mBuf);
5990    }
5991
5992    return ROK;
5993 }
5994
5995 \f
5996 /***********************************************************
5997 *
5998 *     Func: cmPkCtfUeCatCfgInfo
5999 *
6000 *
6001 *     Desc:   UE Category Configuration
6002  * @details This structure contains the information for configuring
6003  *          the UE category at PHY.
6004 *
6005 *
6006 *     Ret : S16
6007 *
6008 *     Notes:
6009 *
6010 *     File: 
6011 *
6012 **********************************************************/
6013 S16 cmPkCtfUeCatCfgInfo
6014 (
6015 CtfUeCatCfgInfo *param,
6016 Buffer *mBuf
6017 )
6018 {
6019
6020
6021 /*ctf_c_001.main_1*/
6022    if(param->pres != FALSE)
6023       CMCHKPK(oduUnpackUInt32, param->ueCategory, mBuf);
6024    CMCHKPK(oduUnpackUInt8, param->pres, mBuf);
6025    return ROK;
6026 }
6027
6028
6029 \f
6030 /***********************************************************
6031 *
6032 *     Func: cmUnpkCtfUeCatCfgInfo
6033 *
6034 *
6035 *     Desc:   UE Category Configuration
6036  * @details This structure contains the information for configuring
6037  *          the UE category at PHY.
6038 *
6039 *
6040 *     Ret: S16
6041 *
6042 *     Notes:
6043 *
6044 *     File: 
6045 *
6046 **********************************************************/
6047 S16 cmUnpkCtfUeCatCfgInfo
6048 (
6049 CtfUeCatCfgInfo *param,
6050 Buffer *mBuf
6051 )
6052 {
6053
6054
6055    CMCHKUNPK(oduPackUInt8, &param->pres, mBuf);
6056 /*ctf_c_001.main_1*/
6057    if(param->pres != FALSE)
6058       CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->ueCategory, mBuf);
6059    return ROK;
6060 }
6061
6062
6063 \f
6064 /***********************************************************
6065 *
6066 *     Func: cmPkCtfDedCfgInfo
6067 *
6068 *
6069 *     Desc:   Dedicated Configuration Information
6070  * @details This structure contains the information for configuration 
6071  *          of UE-specific physical channel resources at PHY.
6072 *
6073 *
6074 *     Ret: S16
6075 *
6076 *     Notes:
6077 *
6078 *     File: 
6079 *
6080 **********************************************************/
6081 S16 cmPkCtfDedCfgInfo
6082 (
6083 CtfDedCfgInfo *param,
6084 Buffer *mBuf
6085 )
6086 {
6087
6088 #ifdef EMTC_ENABLE
6089    CMCHKPK(oduUnpackUInt8, param->isEmtcUe, mBuf);
6090 #endif
6091    CMCHKPK(cmPkCtfDedAntCfgInfo, &param->antInfo, mBuf);
6092 #ifndef TFU_UPGRADE
6093    CMCHKPK(cmPkCtfDedSRCfgInfo, &param->dedSRCfg, mBuf);
6094    CMCHKPK(cmPkCtfDedSrsUlCfgInfo, &param->srsUlCfg, mBuf);
6095    CMCHKPK(cmPkCtfCqiReportCfgInfo, &param->cqiRptCfg, mBuf);
6096 #endif /* TFU_UPGRADE */
6097    CMCHKPK(cmPkCtfDedPuschCfgInfo, &param->puschCfg, mBuf);
6098    CMCHKPK(cmPkCtfDedPucchCfgInfo, &param->pucchCfg, mBuf);
6099    CMCHKPK(cmPkCtfDedPdschCfgInfo, &param->pdschCfg, mBuf);
6100    CMCHKPK(cmPkCtfUeCatCfgInfo, &param->ueCatCfg, mBuf);
6101    CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
6102    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
6103    return ROK;
6104 }
6105
6106
6107 \f
6108 /***********************************************************
6109 *
6110 *     Func: cmUnpkCtfDedCfgInfo
6111 *
6112 *
6113 *     Desc:   Dedicated Configuration Information
6114  * @details This structure contains the information for configuration 
6115  *          of UE-specific physical channel resources at PHY.
6116 *
6117 *
6118 *     Ret: S16
6119 *
6120 *     Notes:
6121 *
6122 *     File: 
6123 *
6124 **********************************************************/
6125 S16 cmUnpkCtfDedCfgInfo
6126 (
6127 CtfDedCfgInfo *param,
6128 Buffer *mBuf
6129 )
6130 {
6131
6132    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
6133    CMCHKUNPK(cmUnpkLteRnti, &param->ueId, mBuf);
6134    CMCHKUNPK(cmUnpkCtfUeCatCfgInfo, &param->ueCatCfg, mBuf);
6135    CMCHKUNPK(cmUnpkCtfDedPdschCfgInfo, &param->pdschCfg, mBuf);
6136    CMCHKUNPK(cmUnpkCtfDedPucchCfgInfo, &param->pucchCfg, mBuf);
6137    CMCHKUNPK(cmUnpkCtfDedPuschCfgInfo, &param->puschCfg, mBuf);
6138 #ifndef TFU_UPGRADE
6139    CMCHKUNPK(cmUnpkCtfCqiReportCfgInfo, &param->cqiRptCfg, mBuf);
6140    CMCHKUNPK(cmUnpkCtfDedSrsUlCfgInfo, &param->srsUlCfg, mBuf);
6141    CMCHKUNPK(cmUnpkCtfDedSRCfgInfo, &param->dedSRCfg, mBuf);
6142 #endif /* TFU_UPGRADE */
6143    CMCHKUNPK(cmUnpkCtfDedAntCfgInfo, &param->antInfo, mBuf);
6144 #ifdef EMTC_ENABLE
6145    CMCHKUNPK(oduPackUInt8, &param->isEmtcUe, mBuf);
6146 #endif
6147    return ROK;
6148 }
6149
6150
6151 \f
6152 /***********************************************************
6153 *
6154 *     Func: cmPkCtfDedRecfgInfo
6155 *
6156 *
6157 *     Desc:   Dedicated Re-configuration Information
6158  * @details This structure contains the information for re-configuration 
6159  *          of UE-specific physical channel resources at PHY.
6160 *
6161 *
6162 *     Ret: S16
6163 *
6164 *     Notes:
6165 *
6166 *     File: 
6167 *
6168 **********************************************************/
6169 S16 cmPkCtfDedRecfgInfo
6170 (
6171 CtfDedRecfgInfo *param,
6172 Buffer *mBuf
6173 )
6174 {
6175
6176    CMCHKPK(cmPkCtfSecCellCfgInfo, &param->sCellInfo,mBuf);
6177    /*ctf_c_001.main_1*/
6178    CMCHKPK(cmPkCtfDedAntCfgInfo, &param->antInfo, mBuf);
6179 #ifndef TFU_UPGRADE
6180    CMCHKPK(cmPkCtfCqiReportCfgInfo, &param->cqiRptCfg, mBuf);
6181    CMCHKPK(cmPkCtfDedSRCfgInfo, &param->dedSRCfg, mBuf);
6182    CMCHKPK(cmPkCtfDedSrsUlCfgInfo, &param->srsUlCfg, mBuf);
6183 #endif /* TFU_UPGRADE */
6184    CMCHKPK(cmPkCtfDedPuschCfgInfo, &param->puschCfg, mBuf);
6185    CMCHKPK(cmPkCtfDedPucchCfgInfo, &param->pucchCfg, mBuf);
6186    CMCHKPK(cmPkCtfDedPdschCfgInfo, &param->pdschCfg, mBuf);
6187    CMCHKPK(cmPkCtfUeCatCfgInfo, &param->ueCatCfg, mBuf);
6188    /* ctf_c_001.main_4: ReEst Fix */
6189 #ifdef CTF_VER3
6190    CMCHKPK(cmPkLteRnti, param->newUeId, mBuf);
6191 #else
6192    CMCHKPK(cmPkLteRnti, param->newUeId, mBuf);
6193 #endif
6194    CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
6195    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
6196    return ROK;
6197 }
6198
6199
6200 \f
6201 /***********************************************************
6202 *
6203 *     Func: cmUnpkCtfDedRecfgInfo
6204 *
6205 *
6206 *     Desc:   Dedicated Re-configuration Information
6207  * @details This structure contains the information for re-configuration 
6208  *          of UE-specific physical channel resources at PHY.
6209 *
6210 *
6211 *     Ret: S16
6212 *
6213 *     Notes:
6214 *
6215 *     File: 
6216 *
6217 **********************************************************/
6218 S16 cmUnpkCtfDedRecfgInfo
6219 (
6220 CtfDedRecfgInfo *param,
6221 Buffer *mBuf
6222 )
6223 {
6224
6225    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
6226    CMCHKUNPK(cmUnpkLteRnti, &param->ueId, mBuf);
6227    /* ctf_c_001.main_4: ReEst Fix */
6228 #ifdef CTF_VER3
6229    CMCHKUNPK(cmUnpkLteRnti, &param->newUeId, mBuf);
6230 #else
6231    CMCHKUNPK(cmUnpkLteRnti, &param->newUeId, mBuf);
6232 #endif
6233    CMCHKUNPK(cmUnpkCtfUeCatCfgInfo, &param->ueCatCfg, mBuf);
6234    CMCHKUNPK(cmUnpkCtfDedPdschCfgInfo, &param->pdschCfg, mBuf);
6235    CMCHKUNPK(cmUnpkCtfDedPucchCfgInfo, &param->pucchCfg, mBuf);
6236    CMCHKUNPK(cmUnpkCtfDedPuschCfgInfo, &param->puschCfg, mBuf);
6237 #ifndef TFU_UPGRADE
6238    CMCHKUNPK(cmUnpkCtfDedSrsUlCfgInfo, &param->srsUlCfg, mBuf);
6239    CMCHKUNPK(cmUnpkCtfDedSRCfgInfo, &param->dedSRCfg, mBuf);
6240    /*ctf_c_001.main_1*/
6241    CMCHKUNPK(cmUnpkCtfCqiReportCfgInfo, &param->cqiRptCfg, mBuf);
6242 #endif /* TFU_UPGRADE */
6243    CMCHKUNPK(cmUnpkCtfDedAntCfgInfo, &param->antInfo, mBuf);
6244
6245    CMCHKUNPK(cmUnpkCtfSecCellCfgInfo, &param->sCellInfo,mBuf);
6246
6247    return ROK;
6248 }
6249
6250
6251 \f
6252 /***********************************************************
6253 *
6254 *     Func: cmPkCtfCellReleaseInfo
6255 *
6256 *
6257 *     Desc:   Cell Release Information
6258  * @details This structure contains the information for release/removal 
6259  *          of a cell and its assocated resources at PHY.
6260 *
6261 *
6262 *     Ret: S16
6263 *
6264 *     Notes:
6265 *
6266 *     File: 
6267 *
6268 **********************************************************/
6269 S16 cmPkCtfCellReleaseInfo
6270 (
6271 CtfCellReleaseInfo *param,
6272 Buffer *mBuf
6273 )
6274 {
6275
6276    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
6277    return ROK;
6278 }
6279
6280
6281 \f
6282 /***********************************************************
6283 *
6284 *     Func: cmUnpkCtfCellReleaseInfo
6285 *
6286 *
6287 *     Desc:   Cell Release Information
6288  * @details This structure contains the information for release/removal 
6289  *          of a cell and its assocated resources at PHY.
6290 *
6291 *
6292 *     Ret: S16
6293 *
6294 *     Notes:
6295 *
6296 *     File: 
6297 *
6298 **********************************************************/
6299 S16 cmUnpkCtfCellReleaseInfo
6300 (
6301 CtfCellReleaseInfo *param,
6302 Buffer *mBuf
6303 )
6304 {
6305
6306    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
6307    return ROK;
6308 }
6309
6310
6311 \f
6312 /***********************************************************
6313 *
6314 *     Func: cmPkCtfDedReleaseInfo
6315 *
6316 *
6317 *     Desc:   Dedicated Release Information
6318  * @details This structure contains the information for release/removal 
6319  *          of dedicated/UE-specific configuration at PHY.
6320 *
6321 *
6322 *     Ret: S16
6323 *
6324 *     Notes:
6325 *
6326 *     File: 
6327 *
6328 **********************************************************/
6329 S16 cmPkCtfDedReleaseInfo
6330 (
6331 CtfDedReleaseInfo *param,
6332 Buffer *mBuf
6333 )
6334 {
6335
6336    CMCHKPK(cmPkCtfSecCellCfgInfo, &param->sCellInfo,mBuf);
6337    CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
6338    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
6339    return ROK;
6340 }
6341
6342
6343 \f
6344 /***********************************************************
6345 *
6346 *     Func: cmUnpkCtfDedReleaseInfo
6347 *
6348 *
6349 *     Desc:   Dedicated Release Information
6350  * @details This structure contains the information for release/removal 
6351  *          of dedicated/UE-specific configuration at PHY.
6352 *
6353 *
6354 *     Ret: S16
6355 *
6356 *     Notes:
6357 *
6358 *     File: 
6359 *
6360 **********************************************************/
6361 S16 cmUnpkCtfDedReleaseInfo
6362 (
6363 CtfDedReleaseInfo *param,
6364 Buffer *mBuf
6365 )
6366 {
6367
6368    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
6369    CMCHKUNPK(cmUnpkLteRnti, &param->ueId, mBuf);
6370    CMCHKUNPK(cmUnpkCtfSecCellCfgInfo, &param->sCellInfo,mBuf);
6371    return ROK;
6372 }
6373
6374
6375 \f
6376 /***********************************************************
6377 *
6378 *     Func: cmPkCtfCfgInfo
6379 *
6380 *
6381 *     Desc:   Configuration Information
6382  * @details This structure contains the information for setting-up 
6383  *          cell or UE-specific configuration at PHY.
6384 *
6385 *
6386 *     Ret: S16
6387 *
6388 *     Notes:
6389 *
6390 *     File: 
6391 *
6392 **********************************************************/
6393 S16 cmPkCtfCfgInfo
6394 (
6395 CtfCfgInfo *param,
6396 Buffer *mBuf
6397 )
6398 {
6399
6400       switch(param->cfgElem) {
6401          case CTF_UE_CFG:
6402             CMCHKPK(cmPkCtfDedCfgInfo, &param->u.dedCfg, mBuf);
6403             break;
6404          case CTF_CELL_CFG:
6405             CMCHKPK(cmPkCtfCellCfgInfo, &param->u.cellCfg, mBuf);
6406             break;
6407          default :
6408             return RFAILED;
6409       }
6410    CMCHKPK(oduUnpackUInt8, param->cfgElem, mBuf);
6411    return ROK;
6412 }
6413
6414
6415 \f
6416 /***********************************************************
6417 *
6418 *     Func: cmUnpkCtfCfgInfo
6419 *
6420 *
6421 *     Desc:   Configuration Information
6422  * @details This structure contains the information for setting-up 
6423  *          cell or UE-specific configuration at PHY.
6424 *
6425 *
6426 *     Ret: S16
6427 *
6428 *     Notes:
6429 *
6430 *     File: 
6431 *
6432 **********************************************************/
6433 S16 cmUnpkCtfCfgInfo
6434 (
6435 CtfCfgInfo *param,
6436 Buffer *mBuf
6437 )
6438 {
6439
6440
6441    CMCHKUNPK(oduPackUInt8, &param->cfgElem, mBuf);
6442       switch(param->cfgElem) {
6443          case CTF_CELL_CFG:
6444             CMCHKUNPK(cmUnpkCtfCellCfgInfo, &param->u.cellCfg, mBuf);
6445             break;
6446          case CTF_UE_CFG:
6447             CMCHKUNPK(cmUnpkCtfDedCfgInfo, &param->u.dedCfg, mBuf);
6448             break;
6449          default :
6450             return RFAILED;
6451       }
6452    return ROK;
6453 }
6454
6455
6456 \f
6457 /***********************************************************
6458 *
6459 *     Func: cmPkCtfReCfgInfo
6460 *
6461 *
6462 *     Desc:   Re-configuration Information
6463  * @details This structure contains the information for re-configuring 
6464  *          cell or UE-specific configuration at PHY.
6465 *
6466 *
6467 *     Ret: S16
6468 *
6469 *     Notes:
6470 *
6471 *     File: 
6472 *
6473 **********************************************************/
6474 S16 cmPkCtfReCfgInfo
6475 (
6476 CtfReCfgInfo *param,
6477 Buffer *mBuf
6478 )
6479 {
6480
6481
6482       switch(param->cfgElem) {
6483          case CTF_UE_CFG:
6484             CMCHKPK(cmPkCtfDedRecfgInfo, &param->u.dedRecfg, mBuf);
6485             break;
6486          case CTF_CELL_CFG:
6487             CMCHKPK(cmPkCtfCellRecfgInfo, &param->u.cellRecfg, mBuf);
6488             break;
6489          /* Starts - Fix for CR ccpu00123185 */
6490          case CTF_TX_PWR_CFG:
6491             CMCHKPK(cmPkCtfCellPwrcfgInfo, &param->u.cellRecfg, mBuf);
6492             break;
6493          /* ends - Fix for CR ccpu00123185 */
6494          case CTF_CELL_STOP:
6495             CMCHKPK(cmPkCtfCellStop, &param->u.cellRecfg, mBuf);
6496             break;
6497              
6498          default :
6499             return RFAILED;
6500       }
6501    CMCHKPK(oduUnpackUInt8, param->cfgElem, mBuf);
6502    return ROK;
6503 }
6504
6505
6506 \f
6507 /***********************************************************
6508 *
6509 *     Func: cmUnpkCtfReCfgInfo
6510 *
6511 *
6512 *     Desc:   Re-configuration Information
6513  * @details This structure contains the information for re-configuring 
6514  *          cell or UE-specific configuration at PHY.
6515 *
6516 *
6517 *     Ret: S16
6518 *
6519 *     Notes:
6520 *
6521 *     File: 
6522 *
6523 **********************************************************/
6524 S16 cmUnpkCtfReCfgInfo
6525 (
6526 CtfReCfgInfo *param,
6527 Buffer *mBuf
6528 )
6529 {
6530
6531
6532    CMCHKUNPK(oduPackUInt8, &param->cfgElem, mBuf);
6533       switch(param->cfgElem) {
6534          case CTF_CELL_CFG:
6535             CMCHKUNPK(cmUnpkCtfCellRecfgInfo, &param->u.cellRecfg, mBuf);
6536             break;
6537          case CTF_UE_CFG:
6538             CMCHKUNPK(cmUnpkCtfDedRecfgInfo, &param->u.dedRecfg, mBuf);
6539             break;
6540          /* Starts - Fix for CR ccpu00123185 */
6541          case CTF_TX_PWR_CFG:
6542             CMCHKUNPK(cmUnpkCtfCellPwrcfgInfo, &param->u.cellRecfg, mBuf);
6543             break;
6544          /* ends - Fix for CR ccpu00123185 */
6545          case CTF_CELL_STOP:
6546             CMCHKUNPK(cmUnpkCtfCellStop, &param->u.cellRecfg, mBuf);
6547             break;
6548          default :
6549             return RFAILED;
6550       }
6551    return ROK;
6552 }
6553
6554
6555 \f
6556 /***********************************************************
6557 *
6558 *     Func: cmPkCtfReleaseInfo
6559 *
6560 *
6561 *     Desc:   Release configuration Information
6562  * @details This structure contains the information for releasing 
6563  *          cell or UE-specific configuration at PHY.
6564 *
6565 *
6566 *     Ret: S16
6567 *
6568 *     Notes:
6569 *
6570 *     File: 
6571 *
6572 **********************************************************/
6573 S16 cmPkCtfReleaseInfo
6574 (
6575 CtfReleaseInfo *param,
6576 Buffer *mBuf
6577 )
6578 {
6579
6580
6581       switch(param->cfgElem) {
6582          case CTF_UE_CFG:
6583             CMCHKPK(cmPkCtfDedReleaseInfo, &param->u.dedRel, mBuf);
6584             break;
6585          case CTF_CELL_CFG:
6586             CMCHKPK(cmPkCtfCellReleaseInfo, &param->u.cellRel, mBuf);
6587             break;
6588          default :
6589             return RFAILED;
6590       }
6591    CMCHKPK(oduUnpackUInt8, param->cfgElem, mBuf);
6592    return ROK;
6593 }
6594
6595
6596 \f
6597 /***********************************************************
6598 *
6599 *     Func: cmUnpkCtfReleaseInfo
6600 *
6601 *
6602 *     Desc:   Release configuration Information
6603  * @details This structure contains the information for releasing 
6604  *          cell or UE-specific configuration at PHY.
6605 *
6606 *
6607 *     Ret: S16
6608 *
6609 *     Notes:
6610 *
6611 *     File: 
6612 *
6613 **********************************************************/
6614 S16 cmUnpkCtfReleaseInfo
6615 (
6616 CtfReleaseInfo *param,
6617 Buffer *mBuf
6618 )
6619 {
6620
6621
6622    CMCHKUNPK(oduPackUInt8, &param->cfgElem, mBuf);
6623       switch(param->cfgElem) {
6624          case CTF_CELL_CFG:
6625             CMCHKUNPK(cmUnpkCtfCellReleaseInfo, &param->u.cellRel, mBuf);
6626             break;
6627          case CTF_UE_CFG:
6628             CMCHKUNPK(cmUnpkCtfDedReleaseInfo, &param->u.dedRel, mBuf);
6629             break;
6630          default :
6631             return RFAILED;
6632       }
6633    return ROK;
6634 }
6635
6636
6637 \f
6638 /***********************************************************
6639 *
6640 *     Func: cmPkCtfCfgReqInfo
6641 *
6642 *
6643 *     Desc:   Configuration Request information
6644  * @details This is the main structure in the Configuration request primitive.
6645  *    -# This structure contains the configuration information as given by 
6646  *       the RRC to configure PHY layer for common/dedicated resources.
6647  *    -# It can contain Config/Reconfig/Release.
6648  *    -# The result of configuration is indicated in TfUiCtfCfgCfm.
6649 *
6650 *
6651 *     Ret: S16
6652 *
6653 *     Notes:
6654 *
6655 *     File: 
6656 *
6657 **********************************************************/
6658 S16 cmPkCtfCfgReqInfo
6659 (
6660 CtfCfgReqInfo *param,
6661 Buffer *mBuf
6662 )
6663 {
6664
6665    /* ctf_c_001.main_4: Added support for vendor specific parameters */
6666 #ifdef CTF_VER3
6667    CMCHKPK(cmPkCtfVendorSpecParams, &param->vendorParams, mBuf);
6668 #endif    
6669       switch(param->cfgType) {
6670          case CTF_DELETE:
6671             CMCHKPK(cmPkCtfReleaseInfo, &param->u.release, mBuf);
6672             break;
6673          case CTF_RECONFIG:
6674             CMCHKPK(cmPkCtfReCfgInfo, &param->u.reCfg, mBuf);
6675             break;
6676          case CTF_CONFIG:
6677             CMCHKPK(cmPkCtfCfgInfo, &param->u.cfg, mBuf);
6678             break;
6679          default :
6680             return RFAILED;
6681       }
6682    CMCHKPK(oduUnpackUInt8, param->cfgType, mBuf);
6683    return ROK;
6684 }
6685
6686
6687 \f
6688    /* ctf_c_001.main_4: Modified cmUnpkCtfCfgReqInfo() to add support
6689     * for vendor specific parameters */
6690 /***********************************************************
6691 *
6692 *     Func: cmUnpkCtfCfgReqInfo
6693 *
6694 *
6695 *     Desc:   Configuration Request information
6696  * @details This is the main structure in the Configuration request primitive.
6697  *    -# This structure contains the configuration information as given by 
6698  *       the RRC to configure PHY layer for common/dedicated resources.
6699  *    -# It can contain Config/Reconfig/Release.
6700  *    -# The result of configuration is indicated in TfUiCtfCfgCfm.
6701 *
6702 *
6703 *     Ret: S16
6704 *
6705 *     Notes:
6706 *
6707 *     File: 
6708 *
6709 **********************************************************/
6710 S16 cmUnpkCtfCfgReqInfo
6711 (
6712 Pst  *pst,
6713 CtfCfgReqInfo *param,
6714 Buffer *mBuf
6715 )
6716 {
6717
6718 #ifdef CTF_VER3
6719    S16 retVal;
6720 #endif
6721
6722
6723    CMCHKUNPK(oduPackUInt8, &param->cfgType, mBuf);
6724       switch(param->cfgType) {
6725          case CTF_CONFIG:
6726             CMCHKUNPK(cmUnpkCtfCfgInfo, &param->u.cfg, mBuf);
6727             break;
6728          case CTF_RECONFIG:
6729             CMCHKUNPK(cmUnpkCtfReCfgInfo, &param->u.reCfg, mBuf);
6730             break;
6731          case CTF_DELETE:
6732             CMCHKUNPK(cmUnpkCtfReleaseInfo, &param->u.release, mBuf);
6733             break;
6734          default :
6735             return RFAILED;
6736       }
6737 #ifdef CTF_VER3
6738     if((retVal = cmUnpkCtfVendorSpecParams(pst, &param->vendorParams, mBuf)) != ROK)
6739         return (retVal);
6740 #endif
6741    return ROK;
6742 }
6743
6744          /* Starts - Fix for CR ccpu00123185 */
6745 /***********************************************************
6746 *
6747 *     Func: cmPkCtfCellPwrcfgInfo
6748 *
6749 *
6750 *     Desc:   Cell Re-configuration Information
6751  * @details This structure contains the information for reconfiguration of Reference Signal Power
6752  *          of a cell and its associated resources at PHY.
6753 *
6754 *
6755 *     Ret: S16
6756 *
6757 *     Notes:
6758 *
6759 *     File: 
6760 *
6761 **********************************************************/
6762 S16 cmPkCtfCellPwrcfgInfo
6763 (
6764 CtfCellRecfgInfo *param,
6765 Buffer *mBuf
6766 )
6767 {
6768
6769    /* Added the pack for newly added reference signal Power*/
6770    CMCHKPK(oduUnpackUInt32, (uint32_t)param->ctfCellStatus, mBuf);
6771    CMCHKPK(SPkS16, param->pilotSigPwr, mBuf);
6772    CMCHKPK(SPkS16, param->priSigPwr, mBuf);
6773    CMCHKPK(SPkS16, param->secSigPwr, mBuf);
6774    
6775    CMCHKPK(SPkS16, param->pdschCfg.refSigPwr, mBuf);
6776    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
6777    return ROK;
6778 }
6779
6780
6781 \f
6782 /***********************************************************
6783 *
6784 *     Func: cmUnpkCtfCellPwrcfgInfo
6785 *
6786 *
6787 *     Desc:   Cell Re-configuration Information
6788  * @details This structure contains the information for reconfiguration
6789  *          of a cell and its associated resources at PHY.
6790 *
6791 *
6792 *     Ret: S16
6793 *
6794 *     Notes:
6795 *
6796 *     File: 
6797 *
6798 **********************************************************/
6799 S16 cmUnpkCtfCellPwrcfgInfo
6800 (
6801 CtfCellRecfgInfo *param,
6802 Buffer *mBuf
6803 )
6804 {
6805    
6806    /* ctf_c_001.main_3: Added the unpack for newly added fileds inside the CFG structure*/
6807    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
6808
6809    CMCHKUNPK(SUnpkS16, &param->pdschCfg.refSigPwr, mBuf);
6810    CMCHKUNPK(SUnpkS16, &param->secSigPwr, mBuf);
6811    CMCHKUNPK(SUnpkS16, &param->priSigPwr, mBuf);
6812    CMCHKUNPK(SUnpkS16, &param->pilotSigPwr, mBuf);
6813    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->ctfCellStatus, mBuf);
6814
6815    return ROK;
6816 }
6817
6818 /***********************************************************
6819 *
6820 *     Func: cmPkCtfCellStop
6821 *
6822 *
6823 *     Desc:   Cell Re-configuration Information
6824  * @details This structure contains the information for reconfiguration of Reference Signal Power
6825  *          of a cell and its associated resources at PHY.
6826 *
6827 *
6828 *     Ret: S16
6829 *
6830 *     Notes:
6831 *
6832 *     File: 
6833 *
6834 **********************************************************/
6835 S16 cmPkCtfCellStop
6836 (
6837 CtfCellRecfgInfo *param,
6838 Buffer *mBuf
6839 )
6840 {
6841
6842    /* Added the pack for newly added reference signal Power*/
6843    CMCHKPK(oduUnpackUInt32, (uint32_t)param->ctfCellStatus, mBuf);
6844    CMCHKPK(SPkS16, param->pilotSigPwr, mBuf);
6845    CMCHKPK(SPkS16, param->priSigPwr, mBuf);
6846    CMCHKPK(SPkS16, param->secSigPwr, mBuf);
6847    
6848    CMCHKPK(SPkS16, param->pdschCfg.refSigPwr, mBuf);
6849    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
6850    return ROK;
6851 }
6852
6853 /***********************************************************
6854 *
6855 *     Func: cmUnpkCtfCellStop
6856 *
6857 *
6858 *     Desc:   Cell Re-configuration Information
6859  * @details This structure contains the information for reconfiguration
6860  *          of a cell and its associated resources at PHY.
6861 *
6862 *
6863 *     Ret: S16
6864 *
6865 *     Notes:
6866 *
6867 *     File: 
6868 *
6869 **********************************************************/
6870 S16 cmUnpkCtfCellStop
6871 (
6872 CtfCellRecfgInfo *param,
6873 Buffer *mBuf
6874 )
6875 {
6876    
6877    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
6878
6879    CMCHKUNPK(SUnpkS16, &param->pdschCfg.refSigPwr, mBuf);
6880    CMCHKUNPK(SUnpkS16, &param->secSigPwr, mBuf);
6881    CMCHKUNPK(SUnpkS16, &param->priSigPwr, mBuf);
6882    CMCHKUNPK(SUnpkS16, &param->pilotSigPwr, mBuf);
6883    CMCHKUNPK(oduPackUInt32, (uint32_t *)&param->ctfCellStatus, mBuf);
6884
6885    return ROK;
6886 }
6887
6888 /* Periodic REM Scan for TPM */
6889 /***********************************************************
6890 *
6891 *     Func: cmPkPerRemScanCellInfo
6892 *
6893 *
6894 *     Desc: Periodic REM cell search response
6895 *     @details This Message contains cell search results. 
6896 *
6897 *
6898 *     Ret: S16
6899 *
6900 *     Notes:
6901 *
6902 *     File: 
6903 *
6904 **********************************************************/
6905 S16 cmPkPerRemScanCellInfo
6906 (
6907 CtfPeriodicRemCellInfo *param,
6908 Buffer *mBuf
6909 )
6910 {
6911
6912    CMCHKPK(oduUnpackUInt16,param->pci, mBuf);
6913    CMCHKPK(oduUnpackUInt8, param->rsrp, mBuf);
6914    CMCHKPK(oduUnpackUInt8, param->dlBw, mBuf);
6915    CMCHKPK(oduUnpackUInt8, param->numTx, mBuf);
6916    return ROK;
6917 }
6918
6919
6920 /***********************************************************
6921 *
6922 *     Func: cmPkCtfPeriodicCellSearchRsp
6923 *
6924 *
6925 *     Desc: Periodic REM cell search response
6926 *     @details This Message contains Periodic REM scan results. 
6927 *
6928 *
6929 *     Ret: S16
6930 *
6931 *     Notes:
6932 *
6933 *     File: 
6934 *
6935 **********************************************************/
6936 S16 cmPkCtfPeriodicCellSearchRsp
6937 (
6938 CtfPeriodicRemCellSearchRsp *param,
6939 Buffer *mBuf
6940 )
6941 {
6942    S16 idx;
6943
6944    for(idx = param->numCells - 1; idx >=0; idx--)
6945    {
6946       CMCHKPK(cmPkPerRemScanCellInfo, &param->cellInfo[idx], mBuf);
6947    }
6948    CMCHKPK(oduUnpackUInt8, param->numCells, mBuf);
6949   
6950    return ROK;
6951 }
6952
6953 /**
6954 * @brief Configuration Request from App to CL for
6955  * cnm Init Sync responce
6956 *
6957 * @details
6958 *
6959 *     Function: cmPkCtfPeriodicRemCellSearchRsp
6960 *
6961 *  @param[in]   Pst*  pst
6962 *  @param[in]   SpId  spId
6963 *  @param[in]   CtfCfgTransId  * transId
6964 *  @param[in]   CtfCnmInitSyncRsp* ctfcnmInitSyncRsp
6965 *  @return   S16
6966 *      -# ROK
6967 **/
6968 S16 cmPkCtfPeriodicRemCellSearchRsp
6969 (
6970 Pst* pst,
6971 SpId spId,
6972 CtfCfgTransId *transId,
6973 CtfPeriodicRemCellSearchRsp *CellCfgRsp
6974 )
6975 {
6976    Buffer *mBuf = NULLP;
6977
6978    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
6979 #if (ERRCLASS & ERRCLS_ADD_RES)
6980       /* ctf_c_001.main_3 Compilation warning fix with g++ */
6981       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
6982          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
6983          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
6984 #endif
6985       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellCfgRsp,
6986             sizeof(CtfPeriodicRemCellSearchRsp));
6987       return RFAILED;
6988    }
6989    if (pst->selector == ODU_SELECTOR_LC) {
6990       if (cmPkCtfPeriodicCellSearchRsp(CellCfgRsp, mBuf) != ROK) {
6991 #if (ERRCLASS & ERRCLS_ADD_RES)
6992       /* ctf_c_001.main_3 Compilation warning fix with g++ */
6993          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
6994             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
6995             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
6996 #endif
6997          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellCfgRsp,
6998                sizeof(CtfPeriodicRemCellSearchRsp));
6999          SPutMsg(mBuf);
7000          return RFAILED;
7001       }
7002    }
7003    else if (pst->selector == ODU_SELECTOR_LWLC) {
7004
7005    if (oduPackPointer((PTR)CellCfgRsp, mBuf) != ROK) {
7006 #if (ERRCLASS & ERRCLS_ADD_RES)
7007       /* ctf_c_001.main_3 Compilation warning fix with g++ */
7008          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7009             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7010             (ErrVal)ECTF018, (ErrVal)0, "Packing failed");
7011 #endif
7012          SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellCfgRsp,
7013                sizeof(CtfPeriodicRemCellSearchRsp));
7014          SPutMsg(mBuf);
7015          return RFAILED;
7016       }
7017
7018    }
7019  if(cmPkCtfCfgTransId(transId, mBuf) != ROK) {
7020 #if (ERRCLASS & ERRCLS_ADD_RES)
7021       /* ctf_c_001.main_3 Compilation warning fix with g++ */
7022       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7023          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7024          (ErrVal)ECTF019, (ErrVal)0, "Packing failed");
7025 #endif
7026       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellCfgRsp,
7027             sizeof(CtfPeriodicRemCellSearchRsp));
7028       SPutMsg(mBuf);
7029       return RFAILED;
7030    }
7031  if (SPkS16(spId, mBuf) != ROK) {
7032 #if (ERRCLASS & ERRCLS_ADD_RES)
7033       /* ctf_c_001.main_3 Compilation warning fix with g++ */
7034       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7035          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7036          (ErrVal)ECTF020, (ErrVal)0, "Packing failed");
7037 #endif
7038       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellCfgRsp,
7039             sizeof(CtfPeriodicRemCellSearchRsp));
7040       SPutMsg(mBuf);
7041       return RFAILED;
7042    }
7043    if (pst->selector != ODU_SELECTOR_LWLC) {
7044       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellCfgRsp,
7045             sizeof(CtfPeriodicRemCellSearchRsp));
7046    }
7047    pst->event = (Event)EVTCTFPREMCELLSRCHRSP;
7048    return (SPstTsk(pst,mBuf));
7049 }
7050
7051 S16 cmUnpkCtfPerRemScanCellInfo
7052 (
7053 CtfPeriodicRemCellInfo *param,
7054 Buffer *mBuf
7055 )
7056 {
7057
7058    CMCHKUNPK(oduPackUInt8, &param->numTx, mBuf);
7059    CMCHKUNPK(oduPackUInt8, &param->dlBw, mBuf);
7060    CMCHKUNPK(oduPackUInt8, &param->rsrp, mBuf);
7061    CMCHKUNPK(oduPackUInt16, &param->pci, mBuf);
7062    return ROK;
7063 }
7064
7065 S16 cmUnpkCtfPerRemCellSrch
7066 (
7067 CtfPeriodicRemCellSearchRsp *param,
7068 Buffer *mBuf
7069 )
7070 {
7071    S16 idx;
7072
7073    CMCHKUNPK(oduPackUInt8, &param->numCells, mBuf);
7074    for(idx = 0; idx < (param->numCells); idx++)
7075    {
7076       CMCHKUNPK(cmUnpkCtfPerRemScanCellInfo, &param->cellInfo[idx], mBuf);
7077    }
7078
7079    return ROK;
7080 }
7081
7082 /**
7083 * @brief ENB STOP Indication from PHY to ENB-APP
7084 *
7085 * @details
7086 *
7087 *     Function: cmUnpkPerRemCellSrchRsp
7088 *
7089 *  @param[in]   Pst*  pst
7090 *  @param[in]   SuId  suId
7091 *  @param[in]   CtfCfgTransId  transId
7092 *  @return   S16
7093 *      -# ROK
7094 **/
7095 S16 cmUnpkPerRemCellSrchRsp
7096 (
7097 CtfPerRemCellSrchRsp func,
7098 Pst *pst,
7099 Buffer *mBuf
7100 )
7101 {
7102    SuId suId = 0;
7103    CtfCfgTransId transId;
7104    CtfPeriodicRemCellSearchRsp *CellSrchRsp = NULLP;  
7105
7106    if (SUnpkS16(&suId, mBuf) != ROK) {
7107       SPutMsg(mBuf);
7108 #if (ERRCLASS & ERRCLS_ADD_RES)
7109       /* ctf_c_001.main_3 Compilation warning fix with g++ */
7110       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7111          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7112          (ErrVal)ECTF030, (ErrVal)0, (Txt*)&"Packing failed");
7113 #endif
7114       return RFAILED;
7115    }
7116    if (cmUnpkCtfCfgTransId(&transId, mBuf) != ROK) {
7117       SPutMsg(mBuf);
7118 #if (ERRCLASS & ERRCLS_ADD_RES)
7119       /* ctf_c_001.main_3 Compilation warning fix with g++ */
7120       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7121          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7122          (ErrVal)ECTF031, (ErrVal)0, (Txt*)&"Packing failed");
7123 #endif
7124       return RFAILED;
7125    }
7126    if (pst->selector != ODU_SELECTOR_LWLC) {
7127       if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&CellSrchRsp,
7128                   sizeof(CtfPeriodicRemCellSearchRsp))) != ROK) {
7129 #if (ERRCLASS & ERRCLS_ADD_RES)
7130       /* ctf_c_001.main_3 Compilation warning fix with g++ */
7131          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7132             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7133             (ErrVal)ECTF024, (ErrVal)0, (Txt*)&"Packing failed");
7134 #endif
7135          SPutMsg(mBuf);
7136          return RFAILED;
7137       }
7138    }
7139    if (pst->selector == ODU_SELECTOR_LWLC) {
7140       if (oduUnpackPointer((PTR *)&CellSrchRsp, mBuf) != ROK) {
7141          SPutMsg(mBuf);
7142          return RFAILED;
7143       }
7144    }
7145   else if (pst->selector == ODU_SELECTOR_LC)
7146       if (cmUnpkCtfPerRemCellSrch(CellSrchRsp, mBuf) != ROK) {
7147       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellSrchRsp,
7148             sizeof(CtfPeriodicRemCellSearchRsp));
7149       SPutMsg(mBuf);
7150 #if (ERRCLASS & ERRCLS_ADD_RES)
7151       /* ctf_c_001.main_3 Compilation warning fix with g++ */
7152       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
7153          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
7154          (ErrVal)ECTF025, (ErrVal)0, (Txt*)&"Packing failed");
7155 #endif
7156       return RFAILED;
7157    }
7158
7159    SPutMsg(mBuf);
7160    return ((*func)(pst, suId, &transId, CellSrchRsp));
7161 }
7162 /* Periodic REM Scan for TPM End */
7163
7164 /* ends - Fix for CR ccpu00123185 */
7165 #endif
7166
7167 /**********************************************************************
7168          End of file
7169 **********************************************************************/