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