U8, U16, U32 data type changes
[o-du/l2.git] / src / 5gnrrlc / kw_udx.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:    UDX RRC Control Interface
22     
23         Type:    C file
24   
25         Desc:    This file Contains the packing and unpacking functions for
26                  UDX Interface
27  
28         File:    kw_udx.c
29   
30 *********************************************************************21*/
31 #include "common_def.h"
32 #include "lkw.h"
33 #include "kw_udx.h"           /* UDX defines */
34 #include "kw.h"
35
36 /* extern (.x) include files */
37 #include "lkw.x"
38 #include "kw_udx.x"
39 \f
40
41 #ifdef LCUDX
42
43 /*
44 *
45 *    Fun:    cmPkUdxBndReq
46 *
47 *    Desc:    pack the primitive UdxBndReq
48 *
49 *    Ret:    ROK  -ok
50 *
51 *    Notes:    None
52 *
53 *    File:     ckw.c
54 *
55 */
56 #ifdef ANSI
57 PRIVATE S16 cmUnpkUdxStruct
58 (
59 Buffer    *srcMBuf,
60 uint32_t  offset,
61 uint8_t   *dstBuf,
62 uint32_t  size
63 )
64 #else
65 PRIVATE S16 cmUnpkUdxStruct(dstMBuf,srcBuf,size)
66 Buffer    *srcMBuf;
67 uint32_t  offset;
68 uint8_t   *dstBuf;
69 MsgLen    size;
70 #endif
71 {
72     MsgLen tmpLen;
73
74     return (SCpyMsgFix(srcMBuf,offset,size,dstBuf,&tmpLen));
75
76 } /*end of function cmPkUdxBndReq*/
77
78 /*
79 *
80 *    Fun:    cmPkUdxBndReq
81 *
82 *    Desc:    pack the primitive UdxBndReq
83 *
84 *    Ret:    ROK  -ok
85 *
86 *    Notes:    None
87 *
88 *    File:     ckw.c
89 *
90 */
91 #ifdef ANSI
92 PRIVATE S16 cmPkUdxStruct
93 (
94 uint8_t  *srcBuf,
95 MsgLen   size,
96 Buffer   *dstMBuf
97 )
98 #else
99 PRIVATE S16 cmPkUdxStruct(dstMBuf,srcBuf,size)
100 uint8_t *srcBuf;
101 MsgLen  size;
102 Buffer  *dstMBuf;
103 #endif
104 {
105
106     return (SAddPstMsgMult(srcBuf,size,dstMBuf));
107
108 } /*end of function cmPkUdxBndReq*/
109 /*
110 *
111 *    Fun:    cmPkUdxBndReq
112 *
113 *    Desc:    pack the primitive UdxBndReq
114 *
115 *    Ret:    ROK  -ok
116 *
117 *    Notes:    None
118 *
119 *    File:     ckw.c
120 *
121 */
122 #ifdef ANSI
123 S16 cmPkUdxBndReq
124 (
125 Pst *pst,
126 SuId suId,
127 SpId spId
128 )
129 #else
130 S16 cmPkUdxBndReq(pst, suId, spId)
131 Pst *pst;
132 SuId suId;
133 SpId spId;
134 #endif
135 {
136     S16 ret1;
137     Buffer *mBuf;
138     mBuf = NULLP;
139
140     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
141     {
142 #if (ERRCLASS & ERRCLS_ADD_RES)
143        if(ret1 != ROK)
144        {
145           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
146                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
147                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
148        }
149 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
150        return (ret1);
151     }
152     CMCHKPKLOG(SPkS16, spId, mBuf, EUDXXXX, pst);
153     CMCHKPKLOG(SPkS16, suId, mBuf, EUDXXXX, pst);
154     pst->event = (Event) UDX_EVT_BND_REQ;
155
156     return (SPstTsk(pst,mBuf));
157 } /*end of function cmPkUdxBndReq*/
158 \f
159 /*
160 *
161 *    Fun:    cmPkUdxUbndReq
162 *
163 *    Desc:    pack the primitive UdxUbndReq
164 *
165 *    Ret:    ROK  -ok
166 *
167 *    Notes:    None
168 *
169 *    File:     ckw.c
170 *
171 */
172 #ifdef ANSI
173 S16 cmPkUdxUbndReq
174 (
175 Pst *pst,
176 SpId spId,
177 Reason reason
178 )
179 #else
180 S16 cmPkUdxUbndReq(pst, spId, reason)
181 Pst *pst;
182 SpId spId;
183 Reason reason;
184 #endif
185 {
186     S16 ret1;
187     Buffer *mBuf;
188     mBuf = NULLP;
189
190     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
191     {
192 #if (ERRCLASS & ERRCLS_ADD_RES)
193        if(ret1 != ROK)
194        {
195           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
196                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
197                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
198        }
199 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
200        return (ret1);
201     }
202     CMCHKPKLOG(SPkS16, reason, mBuf, EUDXXXX, pst);
203     CMCHKPKLOG(SPkS16, spId, mBuf, EUDXXXX, pst);
204     pst->event = (Event) UDX_EVT_UBND_REQ;
205
206     return (SPstTsk(pst,mBuf));
207 } /*end of function cmPkUdxUbndReq*/
208 \f
209 /*
210 *
211 *    Fun:    cmPkUdxBndCfm
212 *
213 *    Desc:    pack the primitive UdxBndCfm
214 *
215 *    Ret:    ROK  -ok
216 *
217 *    Notes:    None
218 *
219 *    File:     ckw.c
220 *
221 */
222 #ifdef ANSI
223 S16 cmPkUdxBndCfm
224 (
225 Pst *pst,
226 SuId suId,
227 uint8_t status
228 )
229 #else
230 S16 cmPkUdxBndCfm(pst, suId, status)
231 Pst *pst;
232 SuId suId;
233 uint8_t status;
234 #endif
235 {
236     S16 ret1;
237     Buffer *mBuf;
238     mBuf = NULLP;
239
240     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
241     {
242 #if (ERRCLASS & ERRCLS_ADD_RES)
243        if(ret1 != ROK)
244        {
245           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
246                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
247                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
248        }
249
250 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
251        return (ret1);
252     }
253     CMCHKPKLOG(oduUnpackUInt8, status, mBuf, EUDXXXX, pst);
254     CMCHKPKLOG(SPkS16, suId, mBuf, EUDXXXX, pst);
255     pst->event = (Event) UDX_EVT_BND_CFM;
256
257     return (SPstTsk(pst,mBuf));
258 } /*end of function cmPkUdxBndCfm*/
259
260 \f
261 /*
262 *
263 *    Fun:    cmPkUdxCfgReq
264 *
265 *    Desc:    pack the primitive KwUiUdxCfgReq
266 *
267 *    Ret:    ROK  -ok
268 *
269 *    Notes:    None
270 *
271 *    File:     ckw.c
272 *
273 */
274 #ifdef ANSI
275 S16 cmPkUdxCfgReq
276 (
277 Pst               *pst,
278 SpId              spId,
279 RlcCfgInfo        *cfgInfo
280 )
281 #else
282 S16 cmPkUdxCfgReq(pst, spId, cfgInfo)
283 Pst               *pst;
284 SpId              spId;
285 RlcCfgInfo        *cfgInfo;
286 #endif
287 {
288     S16 ret1;
289     Buffer *mBuf;
290     mBuf = NULLP;
291
292     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
293     {
294 #if (ERRCLASS & ERRCLS_ADD_RES)
295        if(ret1 != ROK)
296        {
297           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
298                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
299                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
300        }
301 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
302        return (ret1);
303     }
304
305     switch(pst->selector)
306     {
307 #ifdef LCUDX
308        case UDX_SEL_LC:
309           {
310              cmPkUdxStruct((uint8_t *)cfgInfo, sizeof(RlcCfgInfo),mBuf);
311              /* Need Not free CfgInfo here as it is stored 
312                 in UL */
313              break;
314           }
315         case UDX_SEL_LWLC:
316           {
317              CMCHKPKLOG(oduPackPointer,(PTR)cfgInfo,mBuf,EUDXXXX,pst);
318              break;
319           }
320 #endif /* LCUDX */
321     }
322
323     CMCHKPKLOG(SPkS16, spId, mBuf, EUDXXXX, pst);
324     pst->event = (Event) UDX_EVT_CFG_REQ;
325
326     return (SPstTsk(pst,mBuf));
327 } /* cmPkUdxCfgReq */
328
329 \f
330 /*
331 *
332 *    Fun:    cmPkUdxCfgCfm
333 *
334 *    Desc:    pack the primitive KwUiUdxCfgCfm
335 *
336 *    Ret:    ROK  -ok
337 *
338 *    Notes:    None
339 *
340 *    File:     ckw.c
341 *
342 */
343 #ifdef ANSI
344 S16 cmPkUdxCfgCfm
345 (
346 Pst               *pst,
347 SuId              suId,
348 RlcCfgCfmInfo     *cfgCfmInfo
349 )
350 #else
351 S16 cmPkUdxCfgCfm(pst, suId, cfgCfmInfo)
352 Pst               *pst;
353 SuId              suId;
354 RlcCfgCfmInfo     *cfgCfmInfo;
355 #endif
356 {
357     S16 ret1;
358     Buffer *mBuf;
359     mBuf = NULLP;
360
361     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
362     {
363 #if (ERRCLASS & ERRCLS_ADD_RES)
364        if(ret1 != ROK)
365        {
366           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
367                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
368                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
369        }
370 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
371        return (ret1);
372     }
373
374     switch(pst->selector)
375     {
376 #ifdef LCUDX
377        case UDX_SEL_LC:
378           {
379              cmPkUdxStruct((uint8_t *)cfgCfmInfo, sizeof(RlcCfgCfmInfo),mBuf);
380              /* Need to free the cfgCfmInfo here as it is allocated 
381                                         buffer call SPutStaticBuffer */
382              SPutStaticBuffer(pst->region,pst->pool,(Data *) cfgCfmInfo,
383                           sizeof(RlcCfgCfmInfo),0);
384              break;
385           }
386         case UDX_SEL_LWLC:
387           {
388              CMCHKPKLOG(oduPackPointer,(PTR)cfgCfmInfo,mBuf,EUDXXXX,pst);
389              break;
390           }
391 #endif /* LCUDX */
392     }
393
394     CMCHKPKLOG(SPkS16, suId, mBuf, EUDXXXX, pst);
395     pst->event = (Event) UDX_EVT_CFG_CFM;
396
397     return (SPstTsk(pst,mBuf));
398 } /* cmPkUdxCfgCfm */
399
400
401 /*
402 *
403 *    Fun:    cmPkUdxUeIdChgReq
404 *
405 *    Desc:   pack the primitive KwUiUdxUeIdChgReq
406 *
407 *    Ret:    ROK  -ok
408 *
409 *    Notes:  None
410 *
411 *    File:   ckw.c
412 *
413 */
414 #ifdef ANSI
415 S16 cmPkUdxUeIdChgReq
416 (
417 Pst               *pst,
418 SpId              spId,
419 uint32_t          transId,
420 CkwUeInfo         *ueInfo,
421 CkwUeInfo         *newUeInfo
422 )
423 #else
424 S16 cmPkUdxUeIdChgReq(pst, spId, transId, ueInfo, newUeInfo)
425 Pst               *pst;
426 SpId              spId;
427 uint32_t          transId;
428 CkwUeInfo         *ueInfo;
429 CkwUeInfo         *newUeInfo;
430 #endif
431 {
432     S16    ret1;
433     Buffer *mBuf = NULLP;
434
435
436     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
437     {
438 #if (ERRCLASS & ERRCLS_ADD_RES)
439        if(ret1 != ROK)
440        {
441           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
442                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
443                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
444        }
445 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
446
447        return (ret1);
448     }
449
450     switch(pst->selector)
451     {
452 #ifdef LCUDX
453        case UDX_SEL_LC:
454        {
455             cmPkUdxStruct((uint8_t *)newUeInfo, sizeof(CkwUeInfo),mBuf);
456             cmPkUdxStruct((uint8_t *)ueInfo, sizeof(CkwUeInfo),mBuf);
457             /* No need to free ueInfo here as it is stored */
458             break;
459        }
460        case UDX_SEL_LWLC:
461           {
462              CMCHKPKLOG(oduPackPointer,(PTR)newUeInfo,mBuf,EUDXXXX,pst);
463              CMCHKPKLOG(oduPackPointer,(PTR)ueInfo,mBuf,EUDXXXX,pst);
464              break;
465           }
466        default:
467        {
468           printf("cmPkUdxUeIdChgReq()- selector =%d not supported \n", pst->selector);
469           exit(1);
470        }
471 #endif
472     }
473     CMCHKPKLOG(oduUnpackUInt32, transId, mBuf, EUDXXXX, pst);
474     CMCHKPKLOG(SPkS16, spId, mBuf, EUDXXXX, pst);
475     pst->event = (Event) UDX_EVT_UEIDCHG_REQ;
476
477     return (SPstTsk(pst, mBuf));
478
479 } /* cmPkUdxUeIdChgReq */
480
481 /*
482 *
483 *    Fun:    cmPkUdxUeIdChgCfm
484 *
485 *    Desc:   pack the primitive KwUiUdxUeIdChgCfm
486 *
487 *    Ret:    ROK  -ok
488 *
489 *    Notes:  None
490 *
491 *    File:   ckw.c
492 *
493 */
494 #ifdef ANSI
495 S16 cmPkUdxUeIdChgCfm
496 (
497 Pst               *pst,
498 SuId              suId,
499 uint32_t               transId,
500 CmStatus          status
501 )
502 #else
503 S16 cmPkUdxUeIdChgCfm(pst, suId, transId, status)
504 Pst               *pst;
505 SuId              suId;
506 uint32_t               transId;
507 CmStatus          status;
508 #endif
509 {
510     S16    ret1;
511     Buffer *mBuf = NULLP;
512
513     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
514     {
515 #if (ERRCLASS & ERRCLS_ADD_RES)
516        if(ret1 != ROK)
517        {
518           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
519                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
520                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
521        }
522 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
523
524        return (ret1);
525     }
526     
527     CMCHKPK(cmPkCmStatus, &status, mBuf); 
528     CMCHKPKLOG(oduUnpackUInt32, transId, mBuf, EUDXXXX, pst);
529     CMCHKPKLOG(SPkS16, suId, mBuf, EUDXXXX, pst);
530     pst->event = (Event) UDX_EVT_UEIDCHG_CFM;
531
532     return (SPstTsk(pst, mBuf));
533
534 } /* cmPkUdxUeIdChgCfm */
535
536 /*
537 *
538 *    Fun:    cmPkUdxStaUpdCfm
539 *
540 *    Desc:   pack the primitive KwUiUdxUeIdChgCfm
541 *
542 *    Ret:    ROK  -ok
543 *
544 *    Notes:  None
545 *
546 *    File:   ckw.c
547 *
548 */
549 #ifdef ANSI
550 S16 cmPkUdxStaUpdCfm
551 (
552 Pst               *pst,
553 SuId              suId,
554 CmLteRlcId        *rlcId,
555 RlcUdxBufLst       *pStaPdu
556 )
557 #else
558 S16 cmPkUdxStaUpdCfm(pst, suId, rlcId,pStaPdu)
559 Pst               *pst;
560 SuId              suId;
561 CmLteRlcId        *rlcId;
562 RlcUdxBufLst       *pStaPdu;
563 #endif
564 {
565     S16    ret1;
566     Buffer *mBuf = NULLP;
567
568     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
569     {
570 #if (ERRCLASS & ERRCLS_ADD_RES)
571        if(ret1 != ROK)
572        {
573           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
574                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
575                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
576        }
577 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
578
579        return (ret1);
580     }
581     
582     switch (pst->selector)
583     {
584        case UDX_SEL_LC:
585        {
586          cmPkUdxStruct((uint8_t *)pStaPdu, sizeof(RlcUdxBufLst),mBuf);
587          cmPkUdxStruct((uint8_t *)rlcId, sizeof(CmLteRlcId),mBuf);
588          break;
589        }
590        case UDX_SEL_LWLC:
591        {
592          CMCHKPK(oduPackPointer,(PTR) pStaPdu, mBuf);
593          CMCHKPK(oduPackPointer,(PTR) rlcId, mBuf); 
594          break;
595        }
596     }
597     CMCHKPKLOG(SPkS16, suId, mBuf, EUDXXXX, pst);
598     pst->event = (Event) UDX_EVT_STA_UPD_CFM;
599
600     return (SPstTsk(pst, mBuf));
601
602 } /* cmPkUdxStaUpdCfm */
603
604 /*
605 *
606 *    Fun:    cmPkUdxStaProhTmrStart
607 *
608 *    Desc:   pack the primitive
609 *
610 *    Ret:    ROK  -ok
611 *
612 *    Notes:  None
613 *
614 *    File:   Kw_udx.c
615 *
616 */
617 #ifdef ANSI
618 S16 cmPkUdxStaProhTmrStart
619 (
620 Pst               *pst,
621 SpId              spId,
622 CmLteRlcId        *rlcId
623 )
624 #else
625 S16 cmPkUdxStaProhTmrStart(pst, suId, rlcId)
626 Pst               *pst;
627 SpId              spId;
628 CmLteRlcId        *rlcId;
629 #endif
630 {
631     S16    ret1;
632     Buffer *mBuf = NULLP;
633
634     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
635     {
636 #if (ERRCLASS & ERRCLS_ADD_RES)
637        if(ret1 != ROK)
638        {
639           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
640                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
641                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
642        }
643 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
644
645        return (ret1);
646     }
647     
648     switch (pst->selector)
649     {
650        case UDX_SEL_LC:
651        {
652          cmPkUdxStruct((uint8_t *)rlcId, sizeof(CmLteRlcId),mBuf);
653          break;
654        }
655        case UDX_SEL_LWLC:
656        {
657          CMCHKPK(oduPackPointer,(PTR) rlcId, mBuf); 
658          break;
659        }
660     }
661     CMCHKPKLOG(SPkS16, spId, mBuf, EUDXXXX, pst);
662     pst->event = (Event) UDX_EVT_STA_PHBT_TMR_START;
663
664     return (SPstTsk(pst, mBuf));
665
666 } /* cmPkUdxStaProhTmrStart */
667
668 /*
669 *
670 *    Fun:    cmPkUdxStaUpdReq
671 *
672 *    Desc:   pack the primitive KwUiUdxUeIdChgCfm
673 *
674 *    Ret:    ROK  -ok
675 *
676 *    Notes:  None
677 *
678 *    File:   ckw.c
679 *
680 */
681 #ifdef ANSI
682 S16 cmPkUdxStaUpdReq
683 (
684 Pst               *pst,
685 SpId              spId,
686 CmLteRlcId        *rlcId,
687 RlcUdxStaPdu      *pStaPdu
688 )
689 #else
690 S16 cmPkUdxStaUpdReq(pst, suId, rlcId,pStaPdu)
691 Pst               *pst;
692 SpId              spId;
693 CmLteRlcId        *rlcId;
694 RlcUdxStaPdu       *pStaPdu;
695 #endif
696 {
697     S16    ret1;
698     Buffer *mBuf = NULLP;
699
700     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
701     {
702 #if (ERRCLASS & ERRCLS_ADD_RES)
703        if(ret1 != ROK)
704        {
705           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
706                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
707                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
708        }
709 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
710
711        return (ret1);
712     }
713     
714     switch (pst->selector)
715     {
716        case UDX_SEL_LC:
717        {
718          cmPkUdxStruct((uint8_t *)pStaPdu, sizeof(RlcUdxStaPdu),mBuf);
719          cmPkUdxStruct((uint8_t *)rlcId, sizeof(CmLteRlcId),mBuf);
720          SPutStaticBuffer(pst->region,pst->pool,(Data *) pStaPdu,
721                           sizeof(RlcUdxStaPdu),0);
722
723          break;
724        }
725        case UDX_SEL_LWLC:
726        {
727          CMCHKPK(oduPackPointer,(PTR) pStaPdu, mBuf);
728          CMCHKPK(oduPackPointer,(PTR) rlcId, mBuf); 
729          break;
730        }
731     }
732     CMCHKPKLOG(SPkS16, spId, mBuf, EUDXXXX, pst);
733     pst->event = (Event) UDX_EVT_STA_UPD_REQ;
734
735     return (SPstTsk(pst, mBuf));
736
737 } /* cmPkUdxStaUpdReq */
738
739 /*
740 *
741 *    Fun:    cmPkUdxStaPduReq
742 *
743 *    Desc:   pack the primitive KwUiUdxUeIdChgCfm
744 *
745 *    Ret:    ROK  -ok
746 *
747 *    Notes:  None
748 *
749 *    File:   ckw.c
750 *
751 */
752 #ifdef ANSI
753 S16 cmPkUdxStaPduReq
754 (
755 Pst               *pst,
756 SpId              spId,
757 CmLteRlcId        *rlcId,
758 RlcUdxDlStaPdu     *pStaPdu
759 )
760 #else
761 S16 cmPkUdxStaPduReq(pst, suId, rlcId,pStaPdu)
762 Pst               *pst;
763 SpId              spId;
764 CmLteRlcId        *rlcId;
765 RlcUdxDlStaPdu     *pStaPdu;
766 #endif
767 {
768     S16    ret1;
769     Buffer *mBuf = NULLP;
770
771     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
772     {
773 #if (ERRCLASS & ERRCLS_ADD_RES)
774        if(ret1 != ROK)
775        {
776           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
777                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
778                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
779        }
780 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
781
782        return (ret1);
783     }
784     
785     switch (pst->selector)
786     {
787        case UDX_SEL_LC:
788        {
789          cmPkUdxStruct((uint8_t *)pStaPdu, sizeof(RlcUdxDlStaPdu),mBuf);
790          cmPkUdxStruct((uint8_t *)rlcId, sizeof(CmLteRlcId),mBuf);
791          /* Free status Pdu here for LC */
792          SPutStaticBuffer(pst->region,pst->pool,(Data *) pStaPdu,
793                           sizeof(RlcUdxDlStaPdu),0);
794          break;
795        }
796        case UDX_SEL_LWLC:
797        {
798          CMCHKPK(oduPackPointer,(PTR) pStaPdu, mBuf);
799          CMCHKPK(oduPackPointer,(PTR) rlcId, mBuf); 
800          break;
801        }
802     }
803     CMCHKPKLOG(SPkS16, spId, mBuf, EUDXXXX, pst);
804     pst->event = (Event) UDX_EVT_STA_PDU_REQ;
805
806     return (SPstTsk(pst, mBuf));
807
808 } /* cmPkUdxStaUpdReq */
809
810 #ifdef LTE_L2_MEAS
811 /*
812 *
813 *    Fun:    cmPkUdxL2MeasReq
814 *
815 *    Ret:    ROK  -ok
816 *
817 *    Notes:  None
818 *
819 *
820 */
821 #ifdef ANSI
822 S16 cmPkUdxL2MeasReq
823 (
824 Pst               *pst,
825 RlcL2MeasReqEvt    *measReqEvt 
826 )
827 #else
828 S16 cmPkUdxL2MeasReq(pst, measReqEvt)
829 Pst               *pst;
830 RlcL2MeasReqEvt    *measReqEvt; 
831 #endif
832 {
833     S16    ret1;
834     Buffer *mBuf = NULLP;
835
836     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
837     {
838 #if (ERRCLASS & ERRCLS_ADD_RES)
839        if(ret1 != ROK)
840        {
841           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
842                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
843                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
844        }
845 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
846
847        return (ret1);
848     }
849     
850     switch (pst->selector)
851     {
852        case UDX_SEL_LC:
853        {
854          cmPkUdxStruct((uint8_t *)measReqEvt, sizeof(RlcL2MeasReqEvt),mBuf);
855          break;
856        }
857        case UDX_SEL_LWLC:
858        {
859          CMCHKPK(oduPackPointer,(PTR) measReqEvt, mBuf);
860          break;
861        }
862     }
863     pst->event = (Event) UDX_EVT_L2MEAS_REQ;
864
865     return (SPstTsk(pst, mBuf));
866
867 } /* cmPkUdxStaUpdReq */
868
869 /*
870 *
871 *    Fun:    cmPkUdxL2MeasReq
872 *
873 *    Ret:    ROK  -ok
874 *
875 *    Notes:  None
876 *
877 *
878 */
879 #ifdef ANSI
880 S16 cmPkUdxL2MeasSendReq
881 (
882 Pst              *pst,
883 uint8_t          measType
884 )
885 #else
886 S16 cmPkUdxL2MeasSendReq(pst, measReqEvt)
887 Pst               *pst;
888 uint8_t           measType
889 #endif
890 {
891     S16    ret1;
892     Buffer *mBuf = NULLP;
893
894     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
895     {
896 #if (ERRCLASS & ERRCLS_ADD_RES)
897        if(ret1 != ROK)
898        {
899           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
900                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
901                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
902        }
903 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
904
905        return (ret1);
906     }
907     
908     switch (pst->selector)
909     {
910        case UDX_SEL_LC:
911        case UDX_SEL_LWLC:
912        {
913           CMCHKPKLOG(oduUnpackUInt8, measType, mBuf, EUDXXXX, pst);
914           break;
915        }
916     }
917     pst->event = (Event) UDX_EVT_L2MEAS_SEND_REQ;
918
919     return (SPstTsk(pst, mBuf));
920
921
922
923 /*
924 *
925 *    Fun:    cmPkUdxL2MeasStopReq
926 *
927 *    Ret:    ROK  -ok
928 *
929 *    Notes:  None
930 *
931 *
932 */
933 #ifdef ANSI
934 S16 cmPkUdxL2MeasStopReq
935 (
936 Pst              *pst,
937 uint8_t          measType
938 )
939 #else
940 S16 cmPkUdxL2MeasStopReq(pst, measType)
941 Pst               *pst;
942 uint8_t           measType
943 #endif
944 {
945     S16    ret1;
946     Buffer *mBuf = NULLP;
947
948     if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
949     {
950 #if (ERRCLASS & ERRCLS_ADD_RES)
951        if(ret1 != ROK)
952        {
953           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
954                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
955                (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
956        }
957 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
958
959        return (ret1);
960     }
961     
962     switch (pst->selector)
963     {
964        case UDX_SEL_LC:
965        case UDX_SEL_LWLC:
966        {
967           CMCHKPKLOG(oduUnpackUInt8, measType, mBuf, EUDXXXX, pst);
968           break;
969        }
970     }
971     pst->event = (Event) UDX_EVT_L2MEAS_STOP_REQ;
972
973     return (SPstTsk(pst, mBuf));
974
975
976 #endif
977 /******************************************************************************
978  *                            UNPACK FUNCTIONS
979  *****************************************************************************/
980 \f
981 /*
982 *
983 *    Fun:    cmUnpkUdxBndReq
984 *
985 *    Desc:    unpack the primitive UdxBndReq
986 *
987 *    Ret:    ROK  -ok
988 *
989 *    Notes:    None
990 *
991 *    File:     ckw.c
992 *
993 */
994 #ifdef ANSI
995 S16 cmUnpkUdxBndReq
996 (
997 UdxBndReq      func,
998 Pst            *pst,
999 Buffer         *mBuf
1000 )
1001 #else
1002 S16 cmUnpkUdxBndReq(func, pst, mBuf)
1003 UdxBndReq      func;
1004 Pst            *pst;
1005 Buffer         *mBuf;
1006 #endif
1007 {
1008     SuId       suId = 0;
1009     SpId       spId = 0;
1010     
1011     CMCHKUNPKLOG(SUnpkS16, &suId, mBuf, EUDXXXX, pst);
1012     CMCHKUNPKLOG(SUnpkS16, &spId, mBuf, EUDXXXX, pst);
1013     SPutMsg(mBuf);
1014
1015     return ((*func)(pst, suId, spId));
1016 } /*end of function cmUnpkUdxBndReq*/
1017 \f
1018 /*
1019 *
1020 *    Fun:    cmUnpkUdxUbndReq
1021 *
1022 *    Desc:    unpack the primitive UdxUbndReq
1023 *
1024 *    Ret:    ROK  -ok
1025 *
1026 *    Notes:    None
1027 *
1028 *    File:     ckw.c
1029 *
1030 */
1031 #ifdef ANSI
1032 S16 cmUnpkUdxUbndReq
1033 (
1034 UdxUbndReq     func,
1035 Pst            *pst,
1036 Buffer         *mBuf
1037 )
1038 #else
1039 S16 cmUnpkUdxUbndReq(func, pst, mBuf)
1040 UdxUbndReq     func;
1041 Pst            *pst;
1042 Buffer         *mBuf;
1043 #endif
1044 {
1045     SpId       spId = 0;
1046     Reason     reason = 0;
1047     
1048     CMCHKUNPKLOG(SUnpkS16, &spId, mBuf, EUDXXXX, pst);
1049     CMCHKUNPKLOG(SUnpkS16, &reason, mBuf, EUDXXXX, pst);
1050     SPutMsg(mBuf);
1051     return ((*func)(pst, spId, reason));
1052 } /*end of function cmUnpkUdxUbndReq*/
1053 \f
1054 /*
1055 *
1056 *    Fun:    cmUnpkUdxBndCfm
1057 *
1058 *    Desc:    unpack the primitive UdxBndCfm
1059 *
1060 *    Ret:    ROK  -ok
1061 *
1062 *    Notes:    None
1063 *
1064 *    File:     ckw.c
1065 *
1066 */
1067 #ifdef ANSI
1068 S16 cmUnpkUdxBndCfm
1069 (
1070 UdxBndCfm      func,
1071 Pst            *pst,
1072 Buffer         *mBuf
1073 )
1074 #else
1075 S16 cmUnpkUdxBndCfm(func, pst, mBuf)
1076 UdxBndCfm      func;
1077 Pst            *pst;
1078 Buffer         *mBuf;
1079 #endif
1080 {
1081     SuId       suId = 0;
1082     uint8_t         status = 0;
1083     
1084     CMCHKUNPKLOG(SUnpkS16, &suId, mBuf, EUDXXXX, pst);
1085     CMCHKUNPKLOG(oduPackUInt8, &status, mBuf, EUDXXXX, pst);
1086     SPutMsg(mBuf);
1087
1088     return ((*func)(pst, suId, status));
1089 } /*end of function cmUnpkUdxBndCfm*/
1090
1091 \f
1092 /*
1093 *
1094 *    Fun:    cmUnpkUdxCfgReq
1095 *
1096 *    Desc:    unpack the primitive KwUiUdxCfgReq
1097 *
1098 *    Ret:    ROK  -ok
1099 *
1100 *    Notes:    None
1101 *
1102 *    File:     ckw.c
1103 *
1104 */
1105 #ifdef ANSI
1106 S16 cmUnpkUdxCfgReq
1107 (
1108 UdxCfgReq         func,
1109 Pst               *pst,
1110 Buffer            *mBuf
1111 )
1112 #else
1113 S16 cmUnpkUdxCfgReq(func, pst, mBuf)
1114 UdxCfgReq         func;
1115 Pst               *pst;
1116 Buffer            *mBuf;
1117 #endif
1118 {
1119 #if(ERRCLASS & ERRCLS_DEBUG)
1120     S16           ret1;
1121 #endif /* ERRCLASS & ERRCLS_DEBUG */
1122     SpId          spId = 0;
1123     RlcCfgInfo     tmpCfgInfo;
1124     RlcCfgInfo    *cfgInfo; /*stack Variable because it is not freed */
1125     
1126     CMCHKUNPK(SUnpkS16, &(spId), mBuf);
1127     switch(pst->selector)
1128     {
1129 #ifdef LCUDX
1130        case UDX_SEL_LC:
1131        {
1132 #if(ERRCLASS & ERRCLS_DEBUG)
1133           ret1 = cmUnpkUdxStruct(mBuf,0,(uint8_t *)&tmpCfgInfo,sizeof(RlcCfgInfo));
1134           if(ret1 != ROK)
1135           {
1136              SPutMsg(mBuf);
1137              SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1138                    __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1139                   (ErrVal)EUDXXXX, (ErrVal)ret1, "Unpacking failure");
1140              return ( ret1 );
1141           }
1142 #else
1143          cmUnpkUdxStruct(mBuf,0,(uint8_t *)&tmpCfgInfo,sizeof(RlcCfgInfo));
1144 #endif /* ERRCLASS & ERRCLS_DEBUG */
1145           cfgInfo = &tmpCfgInfo;
1146           break;
1147        }
1148        case UDX_SEL_LWLC:
1149        {
1150           CMCHKUNPK(oduUnpackPointer,(PTR *) &cfgInfo, mBuf);
1151           break;
1152        }
1153 #endif /* LCUDX */
1154     }
1155     SPutMsg(mBuf);
1156
1157     return ((*func)(pst, spId, cfgInfo));
1158 } /* cmUnpkUdxCfgReq */
1159
1160 \f
1161 /*
1162 *
1163 *    Fun:    cmUnpkUdxCfgCfm
1164 *
1165 *    Desc:    unpack the primitive KwUiUdxCfgCfm
1166 *
1167 *    Ret:    ROK  -ok
1168 *
1169 *    Notes:    None
1170 *
1171 *    File:     ckw.c
1172 *
1173 */
1174 #ifdef ANSI
1175 S16 cmUnpkUdxCfgCfm
1176 (
1177 UdxCfgCfm         func,
1178 Pst               *pst,
1179 Buffer            *mBuf
1180 )
1181 #else
1182 S16 cmUnpkUdxCfgCfm(func, pst, mBuf)
1183 UdxCfgCfm         func;
1184 Pst               *pst;
1185 Buffer            *mBuf;
1186 #endif
1187 {
1188     S16 ret1;
1189     SuId             suId = 0;
1190     RlcCfgCfmInfo    *cfgCfmInfo = NULLP;
1191     
1192     CMCHKUNPK(SUnpkS16, &suId, mBuf);
1193
1194     switch(pst->selector)
1195     {
1196 #ifdef LCUDX
1197        case UDX_SEL_LC:
1198        {
1199            if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&cfgCfmInfo,\
1200                        sizeof(RlcCfgCfmInfo),0)) != ROK)
1201            {
1202 #if (ERRCLASS & ERRCLS_ADD_RES)
1203               if(ret1 != ROK)
1204               {
1205                  SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1206                        __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1207                       (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
1208               }
1209 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1210               return (ret1);
1211            }
1212
1213           ret1 = cmUnpkUdxStruct(mBuf,0,(uint8_t *)cfgCfmInfo, sizeof(RlcCfgCfmInfo));
1214 #if(ERRCLASS & ERRCLS_DEBUG)
1215           if(ret1 != ROK)
1216           {
1217              SPutMsg(mBuf);
1218              SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1219                    __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1220                   (ErrVal)EUDXXXX, (ErrVal)ret1, "Unpacking failure");
1221              return ( ret1 );
1222           }
1223 #endif /* ERRCLASS & ERRCLS_DEBUG */
1224           break;
1225        }
1226        case UDX_SEL_LWLC:
1227        {
1228           CMCHKUNPK(oduUnpackPointer,(PTR *) &cfgCfmInfo, mBuf);
1229           break;
1230        }
1231 #endif /* LCUDX */
1232     }
1233     SPutMsg(mBuf);
1234
1235     return ((*func)(pst, suId, cfgCfmInfo));
1236 } /* cmUnpkUdxCfgCfm */
1237
1238 /*
1239 *
1240 *    Fun:    cmUnpkUdxUeIdChgReq
1241 *
1242 *    Desc:    unpack the primitive KwUiUdxUeIdChgReq
1243 *
1244 *    Ret:    ROK  -ok
1245 *
1246 *    Notes:    None
1247 *
1248 *    File:     ckw.c
1249 *
1250 */
1251 #ifdef ANSI
1252 S16 cmUnpkUdxUeIdChgReq
1253 (
1254 UdxUeIdChgReq     func,
1255 Pst               *pst,
1256 Buffer            *mBuf
1257 )
1258 #else
1259 S16 cmUnpkUdxUeIdChgReq(func, pst, mBuf)
1260 UdxUeIdChgReq     func;
1261 Pst               *pst;
1262 Buffer            *mBuf;
1263 #endif
1264 {
1265     SpId      spId = 0;
1266     uint32_t  transId = 0;
1267     CkwUeInfo tmpUeInfo;
1268     CkwUeInfo tmpNewUeInfo;
1269     CkwUeInfo *ueInfo;
1270     CkwUeInfo *newUeInfo;
1271     
1272     CMCHKUNPK(SUnpkS16, &(spId), mBuf);
1273     CMCHKUNPKLOG(oduPackUInt32, &transId, mBuf, EUDXXXX, pst);
1274
1275     switch(pst->selector)
1276     {
1277 #ifdef LCUDX
1278        case UDX_SEL_LC:
1279        {
1280           cmUnpkUdxStruct(mBuf,0,(uint8_t *)&tmpNewUeInfo, sizeof(CkwUeInfo));
1281           cmUnpkUdxStruct(mBuf,sizeof(CkwUeInfo),(uint8_t *)&tmpUeInfo, sizeof(CkwUeInfo));
1282
1283           ueInfo =  &tmpUeInfo;
1284           newUeInfo =  &tmpNewUeInfo;
1285           break;
1286        }
1287        case UDX_SEL_LWLC:
1288        {
1289           CMCHKUNPK(oduUnpackPointer,(PTR *) &ueInfo, mBuf);
1290           CMCHKUNPK(oduUnpackPointer,(PTR *) &newUeInfo, mBuf);
1291           break;
1292        }
1293        default:
1294        {
1295           printf("cmUnpkUdxUeIdChgReq()- selector =%d not supported \n", pst->selector);
1296           exit(1);
1297        }
1298
1299 #endif /* LCUDX */
1300     }
1301     SPutMsg(mBuf);
1302
1303     return ((*func)(pst, spId, transId, ueInfo, newUeInfo));
1304
1305 } /* cmUnpkUdxUeIdChgReq */
1306
1307 /*
1308 *
1309 *    Fun:     cmUnpkUdxUeIdChgCfm
1310 *
1311 *    Desc:    unpack the primitive KwUiUdxUeIdChgCfm
1312 *
1313 *    Ret:     ROK  -ok
1314 *
1315 *    Notes:   None
1316 *
1317 *    File:    ckw.c
1318 *
1319 */
1320 #ifdef ANSI
1321 S16 cmUnpkUdxUeIdChgCfm
1322 (
1323 UdxUeIdChgCfm     func,
1324 Pst               *pst,
1325 Buffer            *mBuf
1326 )
1327 #else
1328 S16 cmUnpkUdxUeIdChgCfm(func, pst, mBuf)
1329 UdxUeIdChgCfm     func;
1330 Pst               *pst;
1331 Buffer            *mBuf;
1332 #endif
1333 {
1334     SuId      suId = 0;
1335     uint32_t  transId = 0;
1336     CmStatus  status;
1337     
1338     memset(&status, 0, sizeof(CmStatus));
1339
1340     CMCHKUNPK(SUnpkS16, &suId, mBuf);
1341     CMCHKUNPKLOG(oduPackUInt32, &transId, mBuf, EUDXXXX, pst);
1342
1343     CMCHKUNPK(cmUnpkCmStatus, &status, mBuf);
1344
1345     SPutMsg(mBuf);
1346
1347     return ((*func)(pst, suId, transId, status));
1348
1349 } /* cmUnpkUdxUeIdChgCfm */
1350
1351 /*
1352 *
1353 *    Fun:     cmUnpkUdxStaUpdCfm
1354 *
1355 *    Desc:    unpack the primitive KwUiUdxUeIdChgCfm
1356 *
1357 *    Ret:     ROK  -ok
1358 *
1359 *    Notes:   None
1360 *
1361 *    File:    ckw.c
1362 *
1363 */
1364 #ifdef ANSI
1365 S16 cmUnpkUdxStaUpdCfm
1366 (
1367 UdxStaUpdCfm     func,
1368 Pst               *pst,
1369 Buffer            *mBuf
1370 )
1371 #else
1372 S16 cmUnpkUdxStaUpdCfm(func, pst, mBuf)
1373 UdxStaUpdCfm     func;
1374 Pst               *pst;
1375 Buffer            *mBuf;
1376 #endif
1377 {
1378     SuId      suId = 0;
1379     CmLteRlcId *rlcId = NULLP;  /* KW_FIX */
1380     RlcUdxBufLst *pBufLst = NULLP; /* KW_FIX*/
1381     
1382     CMCHKUNPK(SUnpkS16, &suId, mBuf);
1383     switch (pst->selector)
1384     {
1385        case UDX_SEL_LC:
1386        {
1387           break;
1388        }
1389        case UDX_SEL_LWLC:
1390        {
1391           CMCHKUNPK(oduUnpackPointer, (PTR *)&rlcId,mBuf);
1392           CMCHKUNPK(oduUnpackPointer, (PTR *)&pBufLst,mBuf);
1393           break;
1394        }
1395     } 
1396
1397     SPutMsg(mBuf);
1398
1399     return ((*func)(pst, suId, rlcId, pBufLst));
1400
1401 } /* cmUnpkUdxUeIdChgCfm */
1402
1403 /*
1404 *
1405 *    Fun:     cmUnpkUdxStaUpdReq
1406 *
1407 *    Desc:    unpack the primitive KwUiUdxUeIdChgCfm
1408 *
1409 *    Ret:     ROK  -ok
1410 *
1411 *    Notes:   None
1412 *
1413 *    File:    ckw.c
1414 *
1415 */
1416 #ifdef ANSI
1417 S16 cmUnpkUdxStaUpdReq
1418 (
1419 UdxStaUpdReq     func,
1420 Pst               *pst,
1421 Buffer            *mBuf
1422 )
1423 #else
1424 S16 cmUnpkUdxStaUpdReq(func, pst, mBuf)
1425 UdxStaUpdReq     func;
1426 Pst               *pst;
1427 Buffer            *mBuf;
1428 #endif
1429 {
1430     SpId      spId = 0;
1431     CmLteRlcId *rlcId = NULLP; /* KW_FIX */ 
1432     RlcUdxStaPdu *pStaPdu = NULLP; /* KW_FIX */
1433     S16 ret1;
1434     CmLteRlcId tmpRlcId;
1435     
1436     CMCHKUNPK(SUnpkS16, &spId, mBuf);
1437     switch (pst->selector)
1438     {
1439        case UDX_SEL_LC:
1440        {
1441            if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&pStaPdu,
1442                        sizeof(RlcUdxStaPdu),0)) != ROK)
1443            {
1444 #if (ERRCLASS & ERRCLS_ADD_RES)
1445               if(ret1 != ROK)
1446               {
1447                  SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1448                        __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1449                       (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
1450               }
1451 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1452               return (ret1);
1453            }
1454           ret1 = cmUnpkUdxStruct(mBuf,0,(uint8_t *)pStaPdu, sizeof(RlcUdxStaPdu));
1455           ret1 = cmUnpkUdxStruct(mBuf,sizeof(RlcUdxStaPdu),(uint8_t *)&tmpRlcId,sizeof(CmLteRlcId));
1456           rlcId = &tmpRlcId; 
1457           break;
1458        }
1459        case UDX_SEL_LWLC:
1460        {
1461           CMCHKUNPK(oduUnpackPointer, (PTR *)&rlcId,mBuf);
1462           CMCHKUNPK(oduUnpackPointer, (PTR *)&pStaPdu,mBuf);
1463           break;
1464        }
1465     } 
1466
1467     SPutMsg(mBuf);
1468
1469     return ((*func)(pst, spId, rlcId, pStaPdu));
1470
1471 } /* cmUnpkUdxUeIdChgCfm */
1472
1473 /*
1474 *
1475 *    Fun:     cmUnpkUdxStaPduReq
1476 *
1477 *    Desc:    unpack the primitive KwUiUdxUeIdChgCfm
1478 *
1479 *    Ret:     ROK  -ok
1480 *
1481 *    Notes:   None
1482 *
1483 *    File:    ckw.c
1484 *
1485 */
1486 #ifdef ANSI
1487 S16 cmUnpkUdxStaPduReq
1488 (
1489 UdxStaPduReq     func,
1490 Pst               *pst,
1491 Buffer            *mBuf
1492 )
1493 #else
1494 S16 cmUnpkUdxStaPduReq(func, pst, mBuf)
1495 UdxStaPduReq     func;
1496 Pst               *pst;
1497 Buffer            *mBuf;
1498 #endif
1499 {
1500     S16       ret1;
1501     SpId      spId = 0;
1502     CmLteRlcId tmpRlcId;
1503     CmLteRlcId *rlcId = NULLP;  /* KW_FIX */
1504     RlcUdxDlStaPdu *pStaPdu = NULLP; /* KW_FIX */
1505     
1506     CMCHKUNPK(SUnpkS16, &spId, mBuf);
1507     switch (pst->selector)
1508     {
1509        case UDX_SEL_LC:
1510        {
1511            if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&pStaPdu,
1512                        sizeof(RlcUdxDlStaPdu),0)) != ROK)
1513            {
1514 #if (ERRCLASS & ERRCLS_ADD_RES)
1515               if(ret1 != ROK)
1516               {
1517                  SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1518                        __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1519                       (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
1520               }
1521 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1522               return (ret1);
1523            }
1524           ret1 = cmUnpkUdxStruct(mBuf,0, (uint8_t *)pStaPdu, sizeof(RlcUdxDlStaPdu));
1525           ret1 = cmUnpkUdxStruct(mBuf,sizeof(RlcUdxDlStaPdu),(uint8_t *)&tmpRlcId,sizeof(CmLteRlcId));
1526           rlcId = &tmpRlcId; 
1527            break;
1528        }
1529        case UDX_SEL_LWLC:
1530        {
1531           CMCHKUNPK(oduUnpackPointer, (PTR *)&rlcId,mBuf);
1532           CMCHKUNPK(oduUnpackPointer, (PTR *)&pStaPdu,mBuf);
1533           break;
1534        }
1535     } 
1536
1537     SPutMsg(mBuf);
1538     return ((*func)(pst, spId, rlcId, pStaPdu));
1539
1540 } /* cmUnpkUdxUeIdChgCfm */
1541
1542 /*
1543 *
1544 *    Fun:     cmUnpkUdxStaProhTmrStart
1545 *
1546 *    Desc:    unpack the Status prohibit timer start Msg
1547 *
1548 *    Ret:     ROK  -ok
1549 *
1550 *    Notes:   None
1551 *
1552 *    File:    kw_udx.c
1553 *
1554 */
1555 #ifdef ANSI
1556 S16 cmUnpkUdxStaProhTmrStart
1557 (
1558 UdxStaProhTmrStart     func,
1559 Pst               *pst,
1560 Buffer            *mBuf
1561 )
1562 #else
1563 S16 cmUnpkUdxStaProhTmrStart(func, pst, mBuf)
1564 UdxStaProhTmrStart     func;
1565 Pst               *pst;
1566 Buffer            *mBuf;
1567 #endif
1568 {
1569     SpId      spId = 0;
1570     CmLteRlcId tmpRlcId;
1571     CmLteRlcId *rlcId = NULLP; /* KW_FIX */
1572     
1573     CMCHKUNPK(SUnpkS16, &spId, mBuf);
1574     switch (pst->selector)
1575     {
1576        case UDX_SEL_LC:
1577        {
1578           cmUnpkUdxStruct(mBuf,0,(uint8_t *)&tmpRlcId,sizeof(CmLteRlcId));
1579           rlcId = &tmpRlcId;
1580           break;
1581        }
1582        case UDX_SEL_LWLC:
1583        {
1584           CMCHKUNPK(oduUnpackPointer, (PTR *)&rlcId,mBuf);
1585           break;
1586        }
1587     } 
1588
1589     SPutMsg(mBuf);
1590
1591     return ((*func)(pst, spId, rlcId));
1592
1593 } /* cmUnpkUdxStaProhTmrStart */
1594
1595 #ifdef LTE_L2_MEAS
1596 /*
1597
1598  
1599 *    Fun:    cmUnpkUdxL2MeasReq
1600 *
1601 *    Ret:    ROK  -ok
1602 *
1603 *    Notes:  None
1604 *
1605 *
1606 */
1607 #ifdef ANSI
1608 S16 cmUnpkUdxL2MeasReq
1609 (
1610 UdxL2MeasReq     func,
1611 Pst              *pst,
1612 Buffer           *mBuf
1613 )
1614 #else
1615 S16 cmUnpkUdxL2MeasReq(func, pst, mBuf)
1616 UdxL2MeasReq     func;
1617 Pst              *pst;
1618 Buffer           *mBuf;
1619 #endif
1620 {
1621     RlcL2MeasReqEvt    tmpMeasReqEvt;
1622     RlcL2MeasReqEvt    *measReqEvt = NULLP;  /* KW_FIX */
1623
1624     switch (pst->selector)
1625     {
1626        case UDX_SEL_LC:
1627        {
1628           cmUnpkUdxStruct(mBuf,0,(uint8_t *)&tmpMeasReqEvt,sizeof(RlcL2MeasReqEvt));
1629           measReqEvt = &tmpMeasReqEvt;
1630           break;
1631        }
1632        case UDX_SEL_LWLC:
1633        {
1634          CMCHKUNPK(oduUnpackPointer, (PTR *)&measReqEvt,mBuf);
1635          break;
1636        }
1637     }
1638
1639     SPutMsg(mBuf);
1640
1641     return ((*func)(pst, measReqEvt));
1642 } /* cmUnpkUdxL2MeasReq */
1643
1644 /*
1645 *
1646 *    Fun:    cmUnpkUdxL2MeasSendReq
1647 *
1648 *    Ret:    ROK  -ok
1649 *
1650 *    Notes:  None
1651 *
1652 *
1653 */
1654 #ifdef ANSI
1655 S16 cmUnpkUdxL2MeasSendReq
1656 (
1657 UdxL2MeasSendReq   func,
1658 Pst                *pst,
1659 Buffer             *mBuf
1660 )
1661 #else
1662 S16 cmUnpkUdxL2MeasSendReq(func, pst, mBuf)
1663 UdxL2MeasSendReq   func;
1664 Pst                *pst;
1665 Buffer             *mBuf;
1666 #endif
1667 {
1668     uint8_t     measType = 0;  /* KW_FIX */
1669
1670     switch (pst->selector)
1671     {
1672        case UDX_SEL_LC:
1673        case UDX_SEL_LWLC:
1674        {
1675           CMCHKUNPK(oduPackUInt8, &measType, mBuf);
1676          break;
1677        }
1678     }
1679
1680     SPutMsg(mBuf);
1681
1682     return ((*func)(pst, measType));
1683 } /* cmUnpkUdxL2MeasReq */
1684
1685 /*
1686 *
1687 *    Fun:    cmUnpkUdxL2MeasStopReq
1688 *
1689 *    Ret:    ROK  -ok
1690 *
1691 *    Notes:  None
1692 *
1693 *
1694 */
1695 #ifdef ANSI
1696 S16 cmUnpkUdxL2MeasStopReq
1697 (
1698 UdxL2MeasStopReq   func,
1699 Pst                *pst,
1700 Buffer             *mBuf
1701 )
1702 #else
1703 S16 cmUnpkUdxL2MeasStopReq(func, pst, mBuf)
1704 UdxL2MeasSendReq     func;
1705 Pst                  *pst;
1706 Buffer               *mBuf;
1707 #endif
1708 {
1709     uint8_t     measType = 0; /* KW_FIX */
1710
1711     switch (pst->selector)
1712     {
1713        case UDX_SEL_LC:
1714        case UDX_SEL_LWLC:
1715        {
1716           CMCHKUNPK(oduPackUInt8, &measType, mBuf);
1717          break;
1718        }
1719     }
1720
1721     SPutMsg(mBuf);
1722
1723     return ((*func)(pst, measType));
1724 } /* cmUnpkUdxL2MeasStopReq */
1725 #endif
1726 #endif /* LCUDX */
1727
1728 \f  
1729 /********************************************************************30**
1730          End of file
1731 **********************************************************************/