Replaced old SSI function with new macros jira id - ODUHIGH-212
[o-du/l2.git] / src / cm / ckw.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:    CKW RRC Control Interface
22     
23         Type:    C file
24   
25         Desc:    This file Contains the packing and unpacking functions for
26                  CKW Interface
27  
28         File:    ckw.c
29
30 *********************************************************************21*/
31
32 #include "common_def.h"
33 #include "ckw.h"
34 #include "ckw.x"
35
36 /* extern (.x) include files */
37
38 \f
39 #ifdef __cplusplus
40 EXTERN "C" {
41 #endif  /*for extern "C"*/
42
43 #ifdef LCCKW
44 /*
45 *
46 *    Fun:    cmPkCkwBndReq
47 *
48 *    Desc:    pack the primitive CkwBndReq
49 *
50 *    Ret:    ROK  -ok
51 *
52 *    Notes:    None
53 *
54 *    File:     ckw.c
55 *
56 */
57 #ifdef ANSI
58 PUBLIC S16 cmPkCkwBndReq
59 (
60 Pst *pst,
61 SuId suId,
62 SpId spId
63 )
64 #else
65 PUBLIC S16 cmPkCkwBndReq(pst, suId, spId)
66 Pst *pst;
67 SuId suId;
68 SpId spId;
69 #endif
70 {
71     S16 ret1;
72     Buffer *mBuf;
73     mBuf = NULLP;
74     TRC3(cmPkCkwBndReq)
75
76     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
77     {
78 #if (ERRCLASS & ERRCLS_ADD_RES)
79        if(ret1 != ROK)
80        {
81           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
82                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
83                (ErrVal)ECKW001, (ErrVal)0, "SGetMsg() failed");
84        }
85 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
86        return (ret1);
87     }
88     CMCHKPKLOG(SPkS16, spId, mBuf, ECKW002, pst);
89     CMCHKPKLOG(SPkS16, suId, mBuf, ECKW003, pst);
90     pst->event = (Event) CKW_EVT_BND_REQ;
91
92     return (SPstTsk(pst,mBuf));
93 } /*end of function cmPkCkwBndReq*/
94 \f
95 /*
96 *
97 *    Fun:    cmPkCkwUbndReq
98 *
99 *    Desc:    pack the primitive CkwUbndReq
100 *
101 *    Ret:    ROK  -ok
102 *
103 *    Notes:    None
104 *
105 *    File:     ckw.c
106 *
107 */
108 #ifdef ANSI
109 PUBLIC S16 cmPkCkwUbndReq
110 (
111 Pst *pst,
112 SpId spId,
113 Reason reason
114 )
115 #else
116 PUBLIC S16 cmPkCkwUbndReq(pst, spId, reason)
117 Pst *pst;
118 SpId spId;
119 Reason reason;
120 #endif
121 {
122     S16 ret1;
123     Buffer *mBuf;
124     mBuf = NULLP;
125     TRC3(cmPkCkwUbndReq)
126
127     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
128     {
129 #if (ERRCLASS & ERRCLS_ADD_RES)
130        if(ret1 != ROK)
131        {
132           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
133                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
134                (ErrVal)ECKW004, (ErrVal)0, "SGetMsg() failed");
135        }
136 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
137        return (ret1);
138     }
139     CMCHKPKLOG(SPkS16, reason, mBuf, ECKW005, pst);
140     CMCHKPKLOG(SPkS16, spId, mBuf, ECKW006, pst);
141     pst->event = (Event) CKW_EVT_UBND_REQ;
142
143     return (SPstTsk(pst,mBuf));
144 } /*end of function cmPkCkwUbndReq*/
145 \f
146 /*
147 *
148 *    Fun:    cmPkCkwBndCfm
149 *
150 *    Desc:    pack the primitive CkwBndCfm
151 *
152 *    Ret:    ROK  -ok
153 *
154 *    Notes:    None
155 *
156 *    File:     ckw.c
157 *
158 */
159 #ifdef ANSI
160 PUBLIC S16 cmPkCkwBndCfm
161 (
162 Pst *pst,
163 SuId suId,
164 U8 status
165 )
166 #else
167 PUBLIC S16 cmPkCkwBndCfm(pst, suId, status)
168 Pst *pst;
169 SuId suId;
170 U8 status;
171 #endif
172 {
173     S16 ret1;
174     Buffer *mBuf;
175     mBuf = NULLP;
176     TRC3(cmPkCkwBndCfm)
177
178     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
179     {
180 #if (ERRCLASS & ERRCLS_ADD_RES)
181        if(ret1 != ROK)
182        {
183           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
184                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
185                (ErrVal)ECKW007, (ErrVal)0, "SGetMsg() failed");
186        }
187
188 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
189        return (ret1);
190     }
191     CMCHKPKLOG(oduUnpackUInt8, status, mBuf, ECKW008, pst);
192     CMCHKPKLOG(SPkS16, suId, mBuf, ECKW009, pst);
193     pst->event = (Event) CKW_EVT_BND_CFM;
194
195     return (SPstTsk(pst,mBuf));
196 } /*end of function cmPkCkwBndCfm*/
197
198 \f
199 /*
200 *
201 *    Fun:    cmPkRlcTmInfo
202 *
203 *    Desc:    pack the structure RlcTmInfo
204 *
205 *    Ret:    ROK  -ok
206 *
207 *    Notes:    None
208 *
209 *    File:     ckw.c
210 *
211 */
212 #ifdef ANSI
213 PUBLIC S16 cmPkRlcTmInfo
214 (
215 RlcTmInfo      *param,
216 Buffer         *mBuf
217 )
218 #else
219 PUBLIC S16 cmPkRlcTmInfo(param, mBuf)
220 RlcTmInfo      *param;
221 Buffer         *mBuf;
222 #endif
223 {
224     TRC3(cmPkRlcTmInfo)
225
226     CMCHKPK(oduUnpackUInt32, param->dl.buffSize, mBuf);
227
228     return ROK;
229 } /* cmPkRlcTmInfo */
230
231 \f
232 /*
233 *
234 *    Fun:    cmPkRlcUmInfo
235 *
236 *    Desc:    pack the structure RlcUmInfo
237 *
238 *    Ret:    ROK  -ok
239 *
240 *    Notes:    None
241 *
242 *    File:     ckw.c
243 *
244 */
245 #ifdef ANSI
246 PUBLIC S16 cmPkRlcUmInfo
247 (
248 RlcEntCfgInfo  *param,
249 Buffer         *mBuf
250 )
251 #else
252 PUBLIC S16 cmPkRlcUmInfo(param, mBuf)
253 RlcEntCfgInfo  *param;
254 Buffer         *mBuf;
255 #endif
256 {
257     TRC3(cmPkRlcUmInfo)
258
259     switch(param->dir)
260     {
261        case CKW_CFG_DIR_DL:
262           {
263              CMCHKPK(oduUnpackUInt8, param->m.umInfo.dl.snLen, mBuf);
264              break;
265           }
266        case CKW_CFG_DIR_UL:
267           {
268              CMCHKPK(oduUnpackUInt8, param->m.umInfo.ul.reOrdTmr, mBuf);
269              CMCHKPK(oduUnpackUInt8, param->m.umInfo.ul.snLen, mBuf);
270              break;
271           }
272        /* Patch ckw_c_001.main_3 */
273        case CKW_CFG_DIR_BOTH:
274           {
275              CMCHKPK(oduUnpackUInt8, param->m.umInfo.dl.snLen, mBuf);
276              CMCHKPK(oduUnpackUInt8, param->m.umInfo.ul.reOrdTmr, mBuf);
277              CMCHKPK(oduUnpackUInt8, param->m.umInfo.ul.snLen, mBuf);
278              break;
279           }
280     }
281
282     return ROK;
283 } /* cmPkRlcUmInfo */
284
285 \f
286 /*
287 *
288 *    Fun:    cmPkRlcAmInfo
289 *
290 *    Desc:    pack the structure RlcAmInfo
291 *
292 *    Ret:    ROK  -ok
293 *
294 *    Notes:    None
295 *
296 *    File:     ckw.c
297 *
298 */
299 #ifdef ANSI
300 PUBLIC S16 cmPkRlcAmInfo
301 (
302 RlcAmInfo      *param,
303 Buffer         *mBuf
304 )
305 #else
306 PUBLIC S16 cmPkRlcAmInfo(param, mBuf)
307 RlcAmInfo      *param;
308 Buffer         *mBuf;
309 #endif
310 {
311     TRC3(cmPkRlcAmInfo)
312
313     /* UP LINK */
314     CMCHKPK(oduUnpackUInt8, param->ul.reOrdTmr, mBuf);
315     CMCHKPK(oduUnpackUInt16, param->ul.staProhTmr, mBuf);
316     CMCHKPK(oduUnpackUInt8, param->ul.snLen, mBuf);
317
318     /* DOWN LINK */
319     CMCHKPK(oduUnpackUInt8, param->dl.maxRetx, mBuf);
320     CMCHKPK(SPkS32, param->dl.pollByte, mBuf);
321     CMCHKPK(SPkS16, param->dl.pollPdu, mBuf);
322     CMCHKPK(oduUnpackUInt16, param->dl.pollRetxTmr, mBuf);
323     CMCHKPK(oduUnpackUInt8, param->dl.snLen, mBuf);
324
325     return ROK;
326 } /* cmPkRlcAmInfo */
327
328 \f
329 /*
330 *
331 *    Fun:    cmPkCkwLInfo
332 *
333 *    Desc:    pack the structure CkwLChInfo
334 *
335 *    Ret:    ROK  -ok
336 *
337 *    Notes:    None
338 *
339 *    File:     ckw.c
340 *
341 */
342 #ifdef ANSI
343 PUBLIC S16 cmPkCkwLChInfo
344 (
345 CkwLChInfo     *param,
346 Buffer         *mBuf
347 )
348 #else
349 PUBLIC S16 cmPkCkwLChInfo(param, mBuf)
350 CkwLChInfo     *param;
351 Buffer         *mBuf;
352 #endif
353 {
354     TRC3(cmPkCkwLChInfo)
355
356     CMCHKPK(oduUnpackUInt8, param->type, mBuf);
357     CMCHKPK(oduUnpackUInt8, param->lChId, mBuf);
358
359     return ROK;
360 } /* cmPkCkwLChInfo */
361
362 \f
363 /*
364 *
365 *    Fun:    cmPkRlcEntCfgInfo
366 *
367 *    Desc:    pack the structure RlcEntCfgInfo
368 *
369 *    Ret:    ROK  -ok
370 *
371 *    Notes:    None
372 *
373 *    File:     ckw.c
374 *
375 */
376 #ifdef ANSI
377 PUBLIC S16 cmPkRlcEntCfgInfo
378 (
379 RlcEntCfgInfo  *param,
380 Buffer         *mBuf
381 )
382 #else
383 PUBLIC S16 cmPkRlcEntCfgInfo(param, mBuf)
384 RlcEntCfgInfo  *param;
385 Buffer         *mBuf;
386 #endif
387 {
388     TRC3(cmPkRlcEntCfgInfo)
389
390     switch(param->entMode)
391     {
392        case CM_LTE_MODE_TM:
393           {
394              CMCHKPK(cmPkRlcTmInfo, &(param->m.tmInfo), mBuf);
395              break;
396           }
397        case CM_LTE_MODE_UM:
398           {
399              CMCHKPK(cmPkRlcUmInfo, param, mBuf);
400              break;
401           }
402        case CM_LTE_MODE_AM:
403           {
404              CMCHKPK(cmPkRlcAmInfo, &(param->m.amInfo), mBuf);
405              break;
406           }
407     }
408
409     /* Logical Channel Information */
410     switch(param->entMode)
411     {
412        case CM_LTE_MODE_TM:
413           {
414              CMCHKPK(cmPkCkwLChInfo, &(param->lCh[0]), mBuf);
415              break;
416           }
417        /* ccpu00128195: Packing lCh[0] and lCh[1] for UM bearer as well */
418        case CM_LTE_MODE_UM:
419        case CM_LTE_MODE_AM:
420           {
421              CMCHKPK(cmPkCkwLChInfo, &(param->lCh[1]), mBuf);
422              CMCHKPK(cmPkCkwLChInfo, &(param->lCh[0]), mBuf);
423              break;
424           }
425     }
426
427 #ifdef TENB_MULT_CELL_SUPPRT
428     CMCHKPK(SPkS16, param->rguSapId, mBuf);
429 #endif
430     CMCHKPK(SPkS16, param->discardTmr, mBuf);
431     CMCHKPK(oduUnpackUInt8, param->dir, mBuf);
432     CMCHKPK(cmPkLteRlcMode, param->entMode, mBuf);
433     CMCHKPK(oduUnpackUInt8, param->qci, mBuf);
434     CMCHKPK(oduUnpackUInt8, param->rbType, mBuf);
435     CMCHKPK(oduUnpackUInt8, param->rbId, mBuf);
436     CMCHKPK(oduUnpackUInt8, param->cfgType, mBuf);
437
438     return ROK;
439 } /* cmPkRlcEntCfgInfo */
440
441 \f
442 /*
443 *
444 *    Fun:    cmPkRlcCfgInfo
445 *
446 *    Desc:    pack the structure RlcCfgInfo
447 *
448 *    Ret:    ROK  -ok
449 *
450 *    Notes:    None
451 *
452 *    File:     ckw.c
453 *
454 */
455 #ifdef ANSI
456 PUBLIC S16 cmPkRlcCfgInfo
457 (
458 RlcCfgInfo     *param,
459 Pst            *pst,
460 Buffer         *mBuf
461 )
462 #else
463 PUBLIC S16 cmPkRlcCfgInfo(param, pst, mBuf)
464 RlcCfgInfo     *param;
465 Pst            *pst;
466 Buffer         *mBuf;
467 #endif
468 {
469    S16 idx;
470
471    TRC3(cmPkRlcCfgInfo)
472
473     for (idx = param->numEnt-1; idx >= 0; idx--)
474     {
475        CMCHKPK(cmPkRlcEntCfgInfo, &(param->entCfg[idx]), mBuf);
476     }
477
478     CMCHKPK(oduUnpackUInt8, param->numEnt, mBuf);
479     CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
480     CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
481     CMCHKPKLOG(oduUnpackUInt32, param->transId, mBuf, ECKW010, pst);
482
483     return ROK;
484 } /* cmPkRlcCfgInfo */
485
486 \f
487 /*
488 *
489 *    Fun:    cmPkRlcEntCfgCfmInfo
490 *
491 *    Desc:    pack the structure RlcEntCfgInfo
492 *
493 *    Ret:    ROK  -ok
494 *
495 *    Notes:    None
496 *
497 *    File:     ckw.c
498 *
499 */
500 #ifdef ANSI
501 PUBLIC S16 cmPkRlcEntCfgCfmInfo
502 (
503 RlcEntCfgCfmInfo  *param,
504 Buffer            *mBuf
505 )
506 #else
507 PUBLIC S16 cmPkRlcEntCfgCfmInfo(param, mBuf)
508 RlcEntCfgCfmInfo  *param;
509 Buffer            *mBuf;
510 #endif
511 {
512     TRC3(cmPkRlcEntCfgCfmInfo)
513
514     CMCHKPK(cmPkCmStatus, &(param->status), mBuf);
515     CMCHKPK(oduUnpackUInt8, param->rbType, mBuf);
516     CMCHKPK(oduUnpackUInt8, param->rbId, mBuf);
517
518     return ROK;
519 } /* cmPkRlcEntCfgCfmInfo */
520
521 \f
522 /*
523 *
524 *    Fun:    cmPkRlcCfgCfmInfo
525 *
526 *    Desc:    pack the structure RlcCfgCfmInfo
527 *
528 *    Ret:    ROK  -ok
529 *
530 *    Notes:    None
531 *
532 *    File:     ckw.c
533 *
534 */
535 #ifdef ANSI
536 PUBLIC S16 cmPkRlcCfgCfmInfo
537 (
538 RlcCfgCfmInfo  *param,
539 Pst            *pst,
540 Buffer         *mBuf
541 )
542 #else
543 PUBLIC S16 cmPkRlcCfgCfmInfo(param, pst, mBuf)
544 RlcCfgCfmInfo  *param;
545 Pst            *pst;
546 Buffer         *mBuf;
547 #endif
548 {
549     S16         idx;
550
551     TRC3(cmPkRlcCfgCfmInfo)
552
553     for (idx = param->numEnt-1; idx >= 0; idx--)
554     {
555        CMCHKPK(cmPkRlcEntCfgCfmInfo, &(param->entCfgCfm[(U8)idx]), mBuf);
556     }
557
558     CMCHKPK(oduUnpackUInt8, param->numEnt, mBuf);
559     CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
560     CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
561     CMCHKPKLOG(oduUnpackUInt32, param->transId, mBuf, ECKW014, pst);
562
563     return ROK;
564 } /* cmPkRlcCfgCfmInfo */
565
566 \f
567 /*
568 *
569 *    Fun:    cmPkRlcCfgCfm
570 *
571 *    Desc:    pack the primitive KwUiRlcCfgCfm
572 *
573 *    Ret:    ROK  -ok
574 *
575 *    Notes:    None
576 *
577 *    File:     ckw.c
578 *
579 */
580 #ifdef ANSI
581 PUBLIC S16 cmPkRlcCfgCfm
582 (
583 Pst               *pst,
584 SuId              suId,
585 RlcCfgCfmInfo     *cfgCfmInfo
586 )
587 #else
588 PUBLIC S16 cmPkRlcCfgCfm(pst, suId, cfgCfmInfo)
589 Pst               *pst;
590 SuId              suId;
591 RlcCfgCfmInfo     *cfgCfmInfo;
592 #endif
593 {
594     S16 ret1;
595     Buffer *mBuf;
596     mBuf = NULLP;
597     TRC3(cmPkRlcCfgCfm)
598
599     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
600     {
601 #if (ERRCLASS & ERRCLS_ADD_RES)
602        if(ret1 != ROK)
603        {
604           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
605                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
606                (ErrVal)ECKW015, (ErrVal)0, "SGetMsg() failed");
607        }
608 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
609        return (ret1);
610     }
611
612     switch(pst->selector)
613     {
614 #ifdef LCCKW
615        case ODU_SELECTOR_LC:
616           {
617              ret1 = cmPkRlcCfgCfmInfo( (cfgCfmInfo), pst, mBuf);
618 #if (ERRCLASS & ERRCLS_ADD_RES)
619              if(ret1 != ROK)
620              {
621                 SPutMsg(mBuf);
622                 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
623                       __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
624                       (ErrVal)ECKW016, (ErrVal)ret1, "Packing failure");
625                 return ( ret1 );
626              }
627 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
628              if (SPutSBuf(pst->region, pst->pool, (Data *)cfgCfmInfo,
629                       sizeof(RlcCfgCfmInfo)) != ROK)
630              {
631                 SPutMsg(mBuf);
632                 return RFAILED;
633              }
634
635              break;
636           }
637 #endif /* LCCKW */
638     }
639
640     CMCHKPKLOG(SPkS16, suId, mBuf, ECKW017, pst);
641     pst->event = (Event) CKW_EVT_CFG_CFM;
642
643     return (SPstTsk(pst,mBuf));
644 } /* cmPkRlcCfgCfm */
645
646 /*
647 *
648 *    Fun:    cmPkCkwUeInfo
649 *
650 *    Desc:   pack the primitive KwUiCkwUeInfo
651 *
652 *    Ret:    ROK  -ok
653 *
654 *    Notes:  None
655 *
656 *    File:   ckw.c
657 *
658 */
659 #ifdef ANSI
660 PUBLIC S16 cmPkCkwUeInfo
661 (
662 CkwUeInfo *param,
663 Buffer    *mBuf
664 )
665 #else
666 PUBLIC S16 cmPkCkwUeInfo(param, mBuf)
667 CkwUeInfo *param;
668 Buffer    *mBuf;
669 #endif
670 {
671    TRC2(cmPkCkwUeInfo)
672
673    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
674    CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
675
676    return ROK;
677 }
678
679 /*
680 *
681 *    Fun:    cmPkCkwUeIdChgReq
682 *
683 *    Desc:   pack the primitive KwUiCkwUeIdChgReq
684 *
685 *    Ret:    ROK  -ok
686 *
687 *    Notes:  None
688 *
689 *    File:   ckw.c
690 *
691 */
692 #ifdef ANSI
693 PUBLIC S16 cmPkCkwUeIdChgReq
694 (
695 Pst               *pst,
696 SpId              spId,
697 U32               transId,
698 CkwUeInfo         *ueInfo,
699 CkwUeInfo         *newUeInfo
700 )
701 #else
702 PUBLIC S16 cmPkCkwUeIdChgReq(pst, spId, transId, ueInfo, newUeInfo)
703 Pst               *pst;
704 SpId              spId;
705 U32               transId;
706 CkwUeInfo         *ueInfo;
707 CkwUeInfo         *newUeInfo;
708 #endif
709 {
710     S16    ret1;
711     Buffer *mBuf = NULLP;
712
713     TRC3(cmPkCkwUeIdChgReq)
714
715     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
716     {
717 #if (ERRCLASS & ERRCLS_ADD_RES)
718        if(ret1 != ROK)
719        {
720           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
721                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
722                (ErrVal)ECKW018, (ErrVal)0, "SGetMsg() failed");
723        }
724 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
725
726        return (ret1);
727     }
728
729     CMCHKPK(cmPkCkwUeInfo, newUeInfo, mBuf);
730     if (SPutSBuf(pst->region, pst->pool, (Data *)newUeInfo,
731              sizeof(CkwUeInfo)) != ROK)
732     {
733        SPutMsg(mBuf);
734        return RFAILED;
735     }
736     CMCHKPK(cmPkCkwUeInfo, ueInfo, mBuf);
737     if (SPutSBuf(pst->region, pst->pool, (Data *)ueInfo,
738              sizeof(CkwUeInfo)) != ROK)
739     {
740        SPutMsg(mBuf);
741        return RFAILED;
742     }
743     CMCHKPKLOG(oduUnpackUInt32, transId, mBuf, ECKW019, pst);
744     CMCHKPKLOG(SPkS16, spId, mBuf, ECKW020, pst);
745     pst->event = (Event) CKW_EVT_UEIDCHG_REQ;
746
747     return (SPstTsk(pst, mBuf));
748
749 } /* cmPkCkwUeIdChgReq */
750
751 /*
752 *
753 *    Fun:    cmPkCkwUeIdChgCfm
754 *
755 *    Desc:   pack the primitive KwUiCkwUeIdChgCfm
756 *
757 *    Ret:    ROK  -ok
758 *
759 *    Notes:  None
760 *
761 *    File:   ckw.c
762 *
763 */
764 #ifdef ANSI
765 PUBLIC S16 cmPkCkwUeIdChgCfm
766 (
767 Pst               *pst,
768 SuId              suId,
769 U32               transId,
770 CkwUeInfo         *ueInfo,
771 CmStatus          status
772 )
773 #else
774 PUBLIC S16 cmPkCkwUeIdChgCfm(pst, suId, transId, ueInfo, status)
775 Pst               *pst;
776 SuId              suId;
777 U32               transId;
778 CkwUeInfo         *ueInfo;
779 CmStatus          status;
780 #endif
781 {
782     S16    ret1;
783     Buffer *mBuf = NULLP;
784
785     TRC3(cmPkCkwUeIdChgCfm)
786
787     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
788     {
789 #if (ERRCLASS & ERRCLS_ADD_RES)
790        if(ret1 != ROK)
791        {
792           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
793                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
794                (ErrVal)ECKW021, (ErrVal)0, "SGetMsg() failed");
795        }
796 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
797
798        return (ret1);
799     }
800     
801     CMCHKPK(cmPkCmStatus, &status, mBuf); 
802     CMCHKPK(cmPkCkwUeInfo, ueInfo, mBuf);
803     if (SPutSBuf(pst->region, pst->pool, (Data *)ueInfo,
804              sizeof(CkwUeInfo)) != ROK)
805     {
806        SPutMsg(mBuf);
807        return RFAILED;
808     }
809     CMCHKPKLOG(oduUnpackUInt32, transId, mBuf, ECKW022, pst);
810     CMCHKPKLOG(SPkS16, suId, mBuf, ECKW023, pst);
811     pst->event = (Event) CKW_EVT_UEIDCHG_CFM;
812
813     return (SPstTsk(pst, mBuf));
814
815 } /* cmPkCkwUeIdChgCfm */
816
817
818 /******************************************************************************
819  *                            UNPACK FUNCTIONS
820  *****************************************************************************/
821 \f
822 /*
823 *
824 *    Fun:    cmUnpkCkwBndReq
825 *
826 *    Desc:    unpack the primitive CkwBndReq
827 *
828 *    Ret:    ROK  -ok
829 *
830 *    Notes:    None
831 *
832 *    File:     ckw.c
833 *
834 */
835 #ifdef ANSI
836 PUBLIC S16 cmUnpkCkwBndReq
837 (
838 CkwBndReq      func,
839 Pst            *pst,
840 Buffer         *mBuf
841 )
842 #else
843 PUBLIC S16 cmUnpkCkwBndReq(func, pst, mBuf)
844 CkwBndReq      func;
845 Pst            *pst;
846 Buffer         *mBuf;
847 #endif
848 {
849     SuId       suId = 0;
850     SpId       spId = 0;
851     
852     TRC3(cmUnpkCkwBndReq)
853
854     CMCHKUNPKLOG(SUnpkS16, &suId, mBuf, ECKW024, pst);
855     CMCHKUNPKLOG(SUnpkS16, &spId, mBuf, ECKW025, pst);
856     SPutMsg(mBuf);
857
858     return ((*func)(pst, suId, spId));
859 } /*end of function cmUnpkCkwBndReq*/
860 \f
861 /*
862 *
863 *    Fun:    cmUnpkCkwUbndReq
864 *
865 *    Desc:    unpack the primitive CkwUbndReq
866 *
867 *    Ret:    ROK  -ok
868 *
869 *    Notes:    None
870 *
871 *    File:     ckw.c
872 *
873 */
874 #ifdef ANSI
875 PUBLIC S16 cmUnpkCkwUbndReq
876 (
877 CkwUbndReq     func,
878 Pst            *pst,
879 Buffer         *mBuf
880 )
881 #else
882 PUBLIC S16 cmUnpkCkwUbndReq(func, pst, mBuf)
883 CkwUbndReq     func;
884 Pst            *pst;
885 Buffer         *mBuf;
886 #endif
887 {
888     SpId       spId = 0;
889     Reason     reason = 0;
890     
891     TRC3(cmUnpkCkwUbndReq)
892
893     CMCHKUNPKLOG(SUnpkS16, &spId, mBuf, ECKW026, pst);
894     CMCHKUNPKLOG(SUnpkS16, &reason, mBuf, ECKW027, pst);
895     SPutMsg(mBuf);
896     return ((*func)(pst, spId, reason));
897 } /*end of function cmUnpkCkwUbndReq*/
898 \f
899 /*
900 *
901 *    Fun:    cmUnpkCkwBndCfm
902 *
903 *    Desc:    unpack the primitive CkwBndCfm
904 *
905 *    Ret:    ROK  -ok
906 *
907 *    Notes:    None
908 *
909 *    File:     ckw.c
910 *
911 */
912 #ifdef ANSI
913 PUBLIC S16 cmUnpkCkwBndCfm
914 (
915 CkwBndCfm      func,
916 Pst            *pst,
917 Buffer         *mBuf
918 )
919 #else
920 PUBLIC S16 cmUnpkCkwBndCfm(func, pst, mBuf)
921 CkwBndCfm      func;
922 Pst            *pst;
923 Buffer         *mBuf;
924 #endif
925 {
926     SuId       suId = 0;
927     U8         status = 0;
928     
929     TRC3(cmUnpkCkwBndCfm)
930
931     CMCHKUNPKLOG(SUnpkS16, &suId, mBuf, ECKW028, pst);
932     CMCHKUNPKLOG(oduPackUInt8, &status, mBuf, ECKW029, pst);
933     SPutMsg(mBuf);
934
935     return ((*func)(pst, suId, status));
936 } /*end of function cmUnpkCkwBndCfm*/
937
938 \f
939 /*
940 *
941 *    Fun:    cmUnpkRlcTmInfo
942 *
943 *    Desc:    pack the structure RlcTmInfo
944 *
945 *    Ret:    ROK  -ok
946 *
947 *    Notes:    None
948 *
949 *    File:     ckw.c
950 *
951 */
952 #ifdef ANSI
953 PUBLIC S16 cmUnpkRlcTmInfo
954 (
955 RlcTmInfo      *param,
956 Buffer         *mBuf
957 )
958 #else
959 PUBLIC S16 cmUnpkRlcTmInfo(param, mBuf)
960 RlcTmInfo      *param;
961 Buffer         *mBuf;
962 #endif
963 {
964     TRC3(cmUnpkRlcTmInfo)
965
966     CMCHKUNPK(oduPackUInt32, &(param->dl.buffSize), mBuf);
967
968     return ROK;
969 } /* cmUnpkRlcTmInfo */
970
971 \f
972 /*
973 *
974 *    Fun:    cmUnpkRlcUmInfo
975 *
976 *    Desc:    pack the structure RlcUmInfo
977 *
978 *    Ret:    ROK  -ok
979 *
980 *    Notes:    None
981 *
982 *    File:     ckw.c
983 *
984 */
985 #ifdef ANSI
986 PUBLIC S16 cmUnpkRlcUmInfo
987 (
988 RlcEntCfgInfo  *param,
989 Buffer         *mBuf
990 )
991 #else
992 PUBLIC S16 cmUnpkRlcUmInfo(param, mBuf)
993 RlcEntCfgInfo  *param;
994 Buffer         *mBuf;
995 #endif
996 {
997     TRC3(cmUnpkRlcUmInfo)
998
999     switch(param->dir)
1000     {
1001        case CKW_CFG_DIR_DL:
1002           {
1003              CMCHKUNPK(oduPackUInt8, &(param->m.umInfo.dl.snLen), mBuf);
1004              break;
1005           }
1006        case CKW_CFG_DIR_UL:
1007           {
1008              CMCHKUNPK(oduPackUInt8, &(param->m.umInfo.ul.snLen), mBuf);
1009              CMCHKUNPK(oduPackUInt8, &(param->m.umInfo.ul.reOrdTmr), mBuf);
1010              break;
1011           }
1012        /* Patch ckw_c_001.main_3 */
1013        case CKW_CFG_DIR_BOTH:
1014           {
1015              CMCHKUNPK(oduPackUInt8, &(param->m.umInfo.ul.snLen), mBuf);
1016              CMCHKUNPK(oduPackUInt8, &(param->m.umInfo.ul.reOrdTmr), mBuf);
1017              CMCHKUNPK(oduPackUInt8, &(param->m.umInfo.dl.snLen), mBuf);
1018              break;
1019           }
1020     }
1021
1022     return ROK;
1023 } /* cmUnpkRlcUmInfo */
1024
1025 \f
1026 /*
1027 *
1028 *    Fun:    cmUnpkRlcAmInfo
1029 *
1030 *    Desc:    pack the structure RlcAmInfo
1031 *
1032 *    Ret:    ROK  -ok
1033 *
1034 *    Notes:    None
1035 *
1036 *    File:     ckw.c
1037 *
1038 */
1039 #ifdef ANSI
1040 PUBLIC S16 cmUnpkRlcAmInfo
1041 (
1042 RlcAmInfo      *param,
1043 Buffer         *mBuf
1044 )
1045 #else
1046 PUBLIC S16 cmUnpkRlcAmInfo(param, mBuf)
1047 RlcAmInfo      *param;
1048 Buffer         *mBuf;
1049 #endif
1050 {
1051     TRC3(cmUnpkRlcAmInfo)
1052
1053     /* DOWN LINK */
1054     CMCHKUNPK(oduPackUInt8, &(param->dl.snLen), mBuf);
1055     CMCHKUNPK(oduPackUInt16, &(param->dl.pollRetxTmr), mBuf);
1056     CMCHKUNPK(SUnpkS16, &(param->dl.pollPdu), mBuf);
1057     CMCHKUNPK(SUnpkS32, &(param->dl.pollByte), mBuf);
1058     CMCHKUNPK(oduPackUInt8, &(param->dl.maxRetx), mBuf);
1059
1060     /* UP LINK */
1061     CMCHKUNPK(oduPackUInt8, &(param->ul.snLen), mBuf);
1062     CMCHKUNPK(oduPackUInt16, &(param->ul.staProhTmr), mBuf);
1063     CMCHKUNPK(oduPackUInt8, &(param->ul.reOrdTmr), mBuf);
1064
1065     return ROK;
1066 } /* cmUnpkRlcAmInfo */
1067
1068 \f
1069 /*
1070 *
1071 *    Fun:    cmUnpkCkwLChInfo
1072 *
1073 *    Desc:    pack the structure CkwLChInfo
1074 *
1075 *    Ret:    ROK  -ok
1076 *
1077 *    Notes:    None
1078 *
1079 *    File:     ckw.c
1080 *
1081 */
1082 #ifdef ANSI
1083 PUBLIC S16 cmUnpkCkwLChInfo
1084 (
1085 CkwLChInfo     *param,
1086 Buffer         *mBuf
1087 )
1088 #else
1089 PUBLIC S16 cmUnpkCkwLChInfo(param, mBuf)
1090 CkwLChInfo     *param;
1091 Buffer         *mBuf;
1092 #endif
1093 {
1094     TRC3(cmUnpkCkwLChInfo)
1095
1096     CMCHKUNPK(oduPackUInt8, &(param->lChId), mBuf);
1097     CMCHKUNPK(oduPackUInt8, &(param->type), mBuf);
1098
1099     return ROK;
1100 } /* cmUnpkCkwLChInfo */
1101
1102 \f
1103 /*
1104 *
1105 *    Fun:    cmUnpkRlcEntCfgCfmInfo
1106 *
1107 *    Desc:    unpack the structure RlcEntCfgInfo
1108 *
1109 *    Ret:    ROK  -ok
1110 *
1111 *    Notes:    None
1112 *
1113 *    File:     ckw.c
1114 *
1115 */
1116 #ifdef ANSI
1117 PUBLIC S16 cmUnpkRlcEntCfgCfmInfo
1118 (
1119 RlcEntCfgCfmInfo  *param,
1120 Buffer            *mBuf
1121 )
1122 #else
1123 PUBLIC S16 cmUnpkRlcEntCfgCfmInfo(param, mBuf)
1124 RlcEntCfgCfmInfo  *param;
1125 Buffer            *mBuf;
1126 #endif
1127 {
1128     TRC3(cmUnpkRlcEntCfgCfmInfo)
1129
1130     CMCHKUNPK(oduPackUInt8, &(param->rbId), mBuf);
1131     CMCHKUNPK(oduPackUInt8, &(param->rbType), mBuf);
1132     CMCHKUNPK(cmUnpkCmStatus, &(param->status), mBuf);
1133
1134     return ROK;
1135 } /* cmUnpkRlcEntCfgCfmInfo */
1136
1137 \f
1138 /*
1139 *
1140 *    Fun:    cmUnpkRlcCfgCfmInfo
1141 *
1142 *    Desc:    pack the structure RlcCfgCfmInfo
1143 *
1144 *    Ret:    ROK  -ok
1145 *
1146 *    Notes:    None
1147 *
1148 *    File:     ckw.c
1149 *
1150 */
1151 #ifdef ANSI
1152 PUBLIC S16 cmUnpkRlcCfgCfmInfo
1153 (
1154 RlcCfgCfmInfo  *param,
1155 Pst            *pst,
1156 Buffer         *mBuf
1157 )
1158 #else
1159 PUBLIC S16 cmUnpkRlcCfgCfmInfo(param, pst, mBuf)
1160 RlcCfgCfmInfo  *param;
1161 Pst            *pst;
1162 Buffer         *mBuf;
1163 #endif
1164 {
1165     U8         idx;
1166
1167     TRC3(cmUnpkRlcCfgCfmInfo)
1168
1169     CMCHKUNPKLOG(oduPackUInt32, &(param->transId), mBuf, ECKW030, pst);
1170     CMCHKUNPK(cmUnpkLteRnti, &(param->ueId), mBuf);
1171     CMCHKUNPK(cmUnpkLteCellId, &(param->cellId), mBuf);
1172     CMCHKUNPK(oduPackUInt8, &(param->numEnt), mBuf);
1173
1174     for (idx = 0; idx < param->numEnt; idx++)
1175     {
1176        CMCHKUNPK(cmUnpkRlcEntCfgCfmInfo, &(param->entCfgCfm[idx]), mBuf);
1177     }
1178
1179     return ROK;
1180 } /* cmUnpkRlcCfgCfmInfo */
1181
1182 \f
1183 /*
1184 *
1185 *    Fun:    cmUnpkRlcEntCfgInfo
1186 *
1187 *    Desc:    pack the structure RlcEntCfgCfmInfo
1188 *
1189 *    Ret:    ROK  -ok
1190 *
1191 *    Notes:    None
1192 *
1193 *    File:     ckw.c
1194 *
1195 */
1196 #ifdef ANSI
1197 PUBLIC S16 cmUnpkRlcEntCfgInfo
1198 (
1199 RlcEntCfgInfo  *param,
1200 Buffer         *mBuf
1201 )
1202 #else
1203 PUBLIC S16 cmUnpkRlcEntCfgInfo(param, mBuf)
1204 RlcEntCfgInfo  *param;
1205 Buffer         *mBuf;
1206 #endif
1207 {
1208     TRC3(cmUnpkRlcEntCfgInfo)
1209
1210     CMCHKUNPK(oduPackUInt8, &(param->cfgType), mBuf);
1211     CMCHKUNPK(oduPackUInt8, &(param->rbId), mBuf);
1212     CMCHKUNPK(oduPackUInt8, &(param->rbType), mBuf);
1213     CMCHKUNPK(oduPackUInt8, &(param->qci), mBuf);
1214     CMCHKUNPK(cmUnpkLteRlcMode, &(param->entMode), mBuf);
1215     CMCHKUNPK(oduPackUInt8, &(param->dir), mBuf);
1216     CMCHKUNPK(SUnpkS16, &(param->discardTmr), mBuf);
1217 #ifdef TENB_MULT_CELL_SUPPRT
1218     CMCHKUNPK(SUnpkS16, &(param->rguSapId), mBuf);
1219 #endif
1220
1221     /* Logical Channel Information */
1222     switch(param->entMode)
1223     {
1224        case CM_LTE_MODE_TM:
1225           {
1226              CMCHKUNPK(cmUnpkCkwLChInfo, &(param->lCh[0]), mBuf);
1227              break;
1228           }
1229        /* ccpu00128195: Unpacking lCh[0] and lCh[1] for UM bearer as well */
1230        case CM_LTE_MODE_UM:
1231        case CM_LTE_MODE_AM:
1232           {
1233              CMCHKUNPK(cmUnpkCkwLChInfo, &(param->lCh[0]), mBuf);
1234              CMCHKUNPK(cmUnpkCkwLChInfo, &(param->lCh[1]), mBuf);
1235              break;
1236           }
1237     }
1238
1239     /* TM/UM/AM Info */
1240     switch(param->entMode)
1241     {
1242        case CM_LTE_MODE_TM:
1243           {
1244              CMCHKUNPK(cmUnpkRlcTmInfo, &(param->m.tmInfo), mBuf);
1245              break;
1246           }
1247        case CM_LTE_MODE_UM:
1248           {
1249              CMCHKUNPK(cmUnpkRlcUmInfo, param, mBuf);
1250              break;
1251           }
1252        case CM_LTE_MODE_AM:
1253           {
1254              CMCHKUNPK(cmUnpkRlcAmInfo, &(param->m.amInfo), mBuf);
1255              break;
1256           }
1257     }
1258
1259     return ROK;
1260 } /* cmUnpkRlcEntCfgInfo */
1261
1262 \f
1263 /*
1264 *
1265 *    Fun:    cmUnpkRlcCfgInfo
1266 *
1267 *    Desc:    unpack the structure RlcCfgInfo
1268 *
1269 *    Ret:    ROK  -ok
1270 *
1271 *    Notes:    None
1272 *
1273 *    File:     ckw.c
1274 *
1275 */
1276 #ifdef ANSI
1277 PUBLIC S16 cmUnpkRlcCfgInfo
1278 (
1279 RlcCfgInfo     *param,
1280 Pst            *pst,
1281 Buffer         *mBuf
1282 )
1283 #else
1284 PUBLIC S16 cmUnpkRlcCfgInfo(param, pst, mBuf)
1285 RlcCfgInfo     *param;
1286 Pst            *pst;
1287 Buffer         *mBuf;
1288 #endif
1289 {
1290     U8         idx;
1291
1292     TRC3(cmUnpkRlcCfgInfo)
1293
1294     CMCHKUNPKLOG(oduPackUInt32, &(param->transId), mBuf, ECKW031, pst);
1295     CMCHKUNPK(cmUnpkLteRnti, &(param->ueId), mBuf);
1296     CMCHKUNPK(cmUnpkLteCellId, &(param->cellId), mBuf);
1297     CMCHKUNPK(oduPackUInt8, &(param->numEnt), mBuf);
1298
1299     for (idx = 0; idx < param->numEnt; idx++)
1300     {
1301        CMCHKUNPKLOG(cmUnpkRlcEntCfgInfo,&(param->entCfg[idx]), mBuf, ECKW032, pst);
1302     }
1303
1304     return ROK;
1305 } /* cmUnpkRlcCfgInfo */
1306
1307 \f
1308 /*
1309 *
1310 *    Fun:    cmUnpkRlcCfgCfm
1311 *
1312 *    Desc:    unpack the primitive KwUiRlcCfgCfm
1313 *
1314 *    Ret:    ROK  -ok
1315 *
1316 *    Notes:    None
1317 *
1318 *    File:     ckw.c
1319 *
1320 */
1321 #ifdef ANSI
1322 PUBLIC S16 cmUnpkRlcCfgCfm
1323 (
1324 RlcCfgCfm         func,
1325 Pst               *pst,
1326 Buffer            *mBuf
1327 )
1328 #else
1329 PUBLIC S16 cmUnpkRlcCfgCfm(func, pst, mBuf)
1330 RlcCfgCfm         func;
1331 Pst               *pst;
1332 Buffer            *mBuf;
1333 #endif
1334 {
1335     S16 ret1;
1336     SuId             suId = 0;
1337     RlcCfgCfmInfo    *cfgCfmInfo = NULLP;
1338     
1339     TRC3(cmUnpkRlcCfgCfm)
1340
1341     if((ret1 = SGetSBuf(pst->region, pst->pool, (Data **)&cfgCfmInfo,\
1342                 sizeof(RlcCfgCfmInfo))) != ROK)
1343     {
1344 #if (ERRCLASS & ERRCLS_ADD_RES)
1345        if(ret1 != ROK)
1346        {
1347           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1348                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1349                (ErrVal)ECKW035, (ErrVal)0, "SGetMsg() failed");
1350        }
1351 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1352        return (ret1);
1353     }
1354
1355     cmMemset((U8 *)cfgCfmInfo, 0, sizeof(RlcCfgCfmInfo));
1356
1357     CMCHKUNPK(SUnpkS16, &suId, mBuf);
1358
1359     switch(pst->selector)
1360     {
1361 #ifdef LCCKW
1362        case ODU_SELECTOR_LC:
1363        {
1364           ret1 = cmUnpkRlcCfgCfmInfo( (cfgCfmInfo), pst, mBuf);
1365 #if(ERRCLASS & ERRCLS_DEBUG)
1366           if(ret1 != ROK)
1367           {
1368              SPutMsg(mBuf);
1369              SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1370                    __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1371                   (ErrVal)ECKW036, (ErrVal)ret1, "Unpacking failure");
1372              return ( ret1 );
1373           }
1374 #endif /* ERRCLASS & ERRCLS_DEBUG */
1375           break;
1376        }
1377 #endif /* LCCKW */
1378     }
1379     SPutMsg(mBuf);
1380
1381     return ((*func)(pst, suId, cfgCfmInfo));
1382 } /* cmUnpkRlcCfgCfm */
1383
1384 /*
1385 *
1386 *    Fun:    cmUnpkCkwUeInfo
1387 *
1388 *    Desc:   Unpack the primitive KwUiCkwUeInfo
1389 *
1390 *    Ret:    ROK  -ok
1391 *
1392 *    Notes:  None
1393 *
1394 *    File:   ckw.c
1395 *
1396 */
1397 #ifdef ANSI
1398 PUBLIC S16 cmUnpkCkwUeInfo
1399 (
1400 CkwUeInfo *param,
1401 Buffer    *mBuf
1402 )
1403 #else
1404 PUBLIC S16 cmUnpkCkwUeInfo(param, mBuf)
1405 CkwUeInfo *param;
1406 Buffer    *mBuf;
1407 #endif
1408 {
1409    TRC2(cmUnpkCkwUeInfo)
1410
1411    CMCHKUNPK(cmUnpkLteRnti, &(param->ueId), mBuf);
1412    CMCHKUNPK(cmUnpkLteCellId, &(param->cellId), mBuf);
1413
1414    return ROK;
1415 }
1416
1417 /*
1418 *
1419 *    Fun:    cmUnpkCkwUeIdChgReq
1420 *
1421 *    Desc:    unpack the primitive KwUiCkwUeIdChgReq
1422 *
1423 *    Ret:    ROK  -ok
1424 *
1425 *    Notes:    None
1426 *
1427 *    File:     ckw.c
1428 *
1429 */
1430 #ifdef ANSI
1431 PUBLIC S16 cmUnpkCkwUeIdChgReq
1432 (
1433 CkwUeIdChgReq     func,
1434 Pst               *pst,
1435 Buffer            *mBuf
1436 )
1437 #else
1438 PUBLIC S16 cmUnpkCkwUeIdChgReq(func, pst, mBuf)
1439 CkwUeIdChgReq     func;
1440 Pst               *pst;
1441 Buffer            *mBuf;
1442 #endif
1443 {
1444     S16       ret1;
1445     SpId      spId = 0;
1446     U32       transId = 0;
1447     CkwUeInfo *ueInfo = NULLP;
1448     CkwUeInfo *newUeInfo = NULLP;
1449     
1450     TRC3(cmUnpkCkwUeIdChgReq)
1451
1452
1453     CMCHKUNPK(SUnpkS16, &(spId), mBuf);
1454     CMCHKUNPKLOG(oduPackUInt32, &transId, mBuf, ECKW037, pst);
1455
1456     if((ret1 = SGetSBuf(pst->region, pst->pool, (Data **)&ueInfo,\
1457                 sizeof(CkwUeInfo))) != ROK)
1458     {
1459 #if (ERRCLASS & ERRCLS_ADD_RES)
1460       /*MBUF_FIXX*/
1461           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1462                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1463                (ErrVal)ECKW038, (ErrVal)0, "SGetMsg() failed");
1464       
1465 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1466        return (ret1);
1467     }
1468
1469     cmMemset((U8 *)ueInfo, 0, sizeof(CkwUeInfo));
1470
1471     ret1 = cmUnpkCkwUeInfo((ueInfo), mBuf);
1472 #if(ERRCLASS & ERRCLS_DEBUG)
1473     if(ret1 != ROK)
1474     {
1475        SPutMsg(mBuf);
1476        SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1477              __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1478              (ErrVal)ECKW039, (ErrVal)ret1, "Unpacking failure");
1479        return ( ret1 );
1480     }
1481 #endif /* ERRCLASS & ERRCLS_DEBUG */
1482
1483     if((ret1 = SGetSBuf(pst->region, pst->pool, (Data **)&newUeInfo,\
1484                 sizeof(CkwUeInfo))) != ROK)
1485     {
1486 #if (ERRCLASS & ERRCLS_ADD_RES)
1487        /*MBUF_FIXX*/
1488           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1489                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1490                (ErrVal)ECKW040, (ErrVal)0, "SGetMsg() failed");
1491        
1492 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1493        return (ret1);
1494     }
1495
1496     cmMemset((U8 *)newUeInfo, 0, sizeof(CkwUeInfo));
1497
1498     ret1 = cmUnpkCkwUeInfo((newUeInfo), mBuf);
1499 #if(ERRCLASS & ERRCLS_DEBUG)
1500     if(ret1 != ROK)
1501     {
1502        SPutMsg(mBuf);
1503        SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1504              __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1505              (ErrVal)ECKW041, (ErrVal)ret1, "Unpacking failure");
1506        return ( ret1 );
1507     }
1508 #endif /* ERRCLASS & ERRCLS_DEBUG */
1509
1510     SPutMsg(mBuf);
1511
1512     return ((*func)(pst, spId, transId, ueInfo, newUeInfo));
1513
1514 } /* cmUnpkCkwUeIdChgReq */
1515
1516 /*
1517 *
1518 *    Fun:     cmUnpkCkwUeIdChgCfm
1519 *
1520 *    Desc:    unpack the primitive KwUiCkwUeIdChgCfm
1521 *
1522 *    Ret:     ROK  -ok
1523 *
1524 *    Notes:   None
1525 *
1526 *    File:    ckw.c
1527 *
1528 */
1529 #ifdef ANSI
1530 PUBLIC S16 cmUnpkCkwUeIdChgCfm
1531 (
1532 CkwUeIdChgCfm     func,
1533 Pst               *pst,
1534 Buffer            *mBuf
1535 )
1536 #else
1537 PUBLIC S16 cmUnpkCkwUeIdChgCfm(func, pst, mBuf)
1538 CkwUeIdChgCfm     func;
1539 Pst               *pst;
1540 Buffer            *mBuf;
1541 #endif
1542 {
1543     S16       ret1;
1544     SuId      suId = 0;
1545     U32       transId = 0;
1546     CkwUeInfo *ueInfo = NULLP;
1547     CmStatus  status;
1548     
1549     TRC3(cmUnpkCkwUeIdChgCfm)
1550
1551     cmMemset((U8 *)&status, (U8)0, (PTR)sizeof(CmStatus));
1552
1553     CMCHKUNPK(SUnpkS16, &suId, mBuf);
1554     CMCHKUNPKLOG(oduPackUInt32, &transId, mBuf, ECKW042, pst);
1555
1556     if((ret1 = SGetSBuf(pst->region, pst->pool, (Data **)&ueInfo,\
1557                 sizeof(CkwUeInfo))) != ROK)
1558     {
1559 #if (ERRCLASS & ERRCLS_ADD_RES)
1560        if(ret1 != ROK)
1561        {
1562           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1563                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1564                (ErrVal)ECKW043, (ErrVal)0, "SGetMsg() failed");
1565        }
1566 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1567        return (ret1);
1568     }
1569
1570     cmMemset((U8 *)ueInfo, 0, sizeof(CkwUeInfo));
1571
1572     ret1 = cmUnpkCkwUeInfo((ueInfo), mBuf);
1573 #if(ERRCLASS & ERRCLS_DEBUG)
1574     if(ret1 != ROK)
1575     {
1576        SPutMsg(mBuf);
1577        SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1578              __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1579              (ErrVal)ECKW044, (ErrVal)ret1, "Unpacking failure");
1580        return ( ret1 );
1581     }
1582 #endif /* ERRCLASS & ERRCLS_DEBUG */
1583
1584     CMCHKUNPK(cmUnpkCmStatus, &status, mBuf);
1585
1586     SPutMsg(mBuf);
1587
1588     return ((*func)(pst, suId, transId, ueInfo, status));
1589
1590 } /* cmUnpkCkwUeIdChgCfm */
1591
1592 #endif /* LCCKW */
1593 #ifdef __cplusplus
1594 }
1595 #endif /* __cplusplus */
1596
1597 \f  
1598 /**********************************************************************
1599          End of file
1600 **********************************************************************/