Docs and build updates along with prachCfgTableIdx completion
[o-du/l2.git] / src / cm / kwu.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:    KWU Interface
22     
23         Type:    C file
24   
25         Desc:    This file Contains the packing and unpacking functions for
26                  KWU Interface
27  
28         File:    kwu.c
29   
30 *********************************************************************21*/
31 \f
32 /* header include files (.h) */
33 #include "envopt.h"        /* environment options */
34 #include "envdep.h"        /* environment dependent */
35 #include "envind.h"        /* environment independent */
36
37 #include "gen.h"           /* general */
38 #include "ssi.h"           /* system services */
39 #include "cm5.h"           /* common timer defines */
40 #include "cm_tkns.h"       /* common tokens defines */
41 #include "cm_mblk.h"       /* common memory allocation library defines */
42 #include "cm_llist.h"      /* common link list  defines  */
43 #include "cm_hash.h"       /* common hash list  defines */
44 #include "cm_lte.h"        /* common LTE defines */
45 #ifdef TENB_SPLIT_ARCH
46 #include "ss_queue.h"
47 #include "ss_task.h"
48 #include "ss_msg.h"
49 #endif
50 #include "kwu.h"           /* KWU defines */
51
52 /* extern (.x) include files */
53 #include "gen.x"           /* general */
54 #include "ssi.x"           /* system services */
55
56 #include "cm5.x"           /* common timer library */
57 #include "cm_tkns.x"       /* common tokens */
58 #include "cm_mblk.x"       /* common memory allocation */
59 #include "cm_llist.x"      /* common link list */
60 #include "cm_hash.x"       /* common hash list */
61 #include "cm_lte.x"        /* common LTE includes */
62 #include "cm_lib.x"        /* common memory allocation library */
63 #ifdef TENB_SPLIT_ARCH
64 #include "ss_queue.x"
65 #include "ss_task.x"
66 #include "ss_msg.x"
67 #endif
68 #ifdef SS_RBUF
69 #include "ss_rbuf.h"
70 #include "ss_rbuf.x"
71 #endif /*SS_RBUF*/
72 #include "kwu.x"           /* KWU */
73
74 #ifdef LCKWU
75 \f
76 /****************************************************************************
77  *                      Packing Functions
78  ***************************************************************************/
79 #ifdef ANSI
80 PUBLIC S16 cmPkKwuBndReq
81 (
82 Pst * pst,
83 SuId suId,
84 SpId spId
85 )
86 #else
87 PUBLIC S16 cmPkKwuBndReq(pst, suId, spId)
88 Pst * pst;
89 SuId suId;
90 SpId spId;
91 #endif
92 {
93    S16    ret1;
94    Buffer *mBuf;
95
96    TRC3(cmPkKwuBndReq)
97
98    mBuf = NULLP;
99
100    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
101    {
102 #if (ERRCLASS & ERRCLS_ADD_RES)
103       if(ret1 != ROK)
104       {
105          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
106                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
107                (ErrVal)EKWU001, (ErrVal)0, "SGetMsg() failed");
108       }
109 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
110       RETVALUE(ret1);
111    }
112    CMCHKPKLOG(SPkS16, spId, mBuf, EKWU002, pst);
113    CMCHKPKLOG(SPkS16, suId, mBuf, EKWU003, pst);
114    pst->event = (Event) KWU_EVT_BND_REQ;
115    RETVALUE(SPstTsk(pst,mBuf));
116 }
117
118 \f
119 #ifdef ANSI
120 PUBLIC S16 cmPkKwuBndCfm
121 (
122 Pst * pst,
123 SuId suId,
124 U8 status
125 )
126 #else
127 PUBLIC S16 cmPkKwuBndCfm(pst, suId, status)
128 Pst * pst;
129 SuId suId;
130 U8 status;
131 #endif
132 {
133    S16    ret1;
134    Buffer *mBuf;
135
136    TRC3(cmPkKwuBndCfm)
137
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)EKWU004, (ErrVal)0, "SGetMsg() failed");
148       }
149 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
150       RETVALUE(ret1);
151    }
152
153    CMCHKPKLOG(SPkU8, status, mBuf, EKWU005, pst);
154    CMCHKPKLOG(SPkS16, suId, mBuf, EKWU006, pst);
155    pst->event = (Event) KWU_EVT_BND_CFM;
156    RETVALUE(SPstTsk(pst,mBuf));
157 }
158
159 \f
160 #ifdef ANSI
161 PUBLIC S16 cmPkKwuUbndReq
162 (
163 Pst * pst,
164 SuId suId,
165 Reason reason
166 )
167 #else
168 PUBLIC S16 cmPkKwuUbndReq(pst, suId, reason)
169 Pst * pst;
170 SuId suId;
171 Reason reason;
172 #endif
173 {
174    S16 ret1;
175    Buffer *mBuf;
176
177    TRC3(cmPkKwuUbndReq)
178
179    mBuf = NULLP;
180
181    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
182    {
183 #if (ERRCLASS & ERRCLS_ADD_RES)
184       if(ret1 != ROK)
185       {
186          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
187                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
188                (ErrVal)EKWU007, (ErrVal)0, "SGetMsg() failed");
189       }
190 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
191       RETVALUE(ret1);
192    }
193    CMCHKPKLOG(SPkS16, reason, mBuf, EKWU008, pst);
194    CMCHKPKLOG(SPkS16, suId, mBuf, EKWU009, pst);
195
196    pst->event = (Event) KWU_EVT_UBND_REQ;
197    RETVALUE(SPstTsk(pst,mBuf));
198 } /* cmPkKwuUbndReq */
199
200 #ifdef ANSI
201 PUBLIC S16 cmPkKwuDatReqInfo
202 (
203 KwuDatReqInfo *param,
204 Buffer *mBuf
205 )
206 #else
207 PUBLIC S16 cmPkKwuDatReqInfo(param, mBuf)
208 KwuDatReqInfo *param;
209 Buffer *mBuf;
210 #endif
211 {
212
213    TRC3(cmPkKwuDatReqInfo);
214
215 #ifdef CCPU_OPT
216    switch(param->lcType) {
217       case CM_LTE_LCH_CCCH:
218          CMCHKPK(cmPkLteRnti, param->tm.rnti, mBuf);
219          break;
220       case CM_LTE_LCH_BCCH:
221       case  CM_LTE_LCH_PCCH:
222          CMCHKPK(cmPkLteTimingInfo, &param->tm.tmg, mBuf);
223 #ifdef EMTC_ENABLE
224          CMCHKPK(SPkU8, param->emtcDiReason,mBuf);
225          CMCHKPK(SPkU8, param->pnb,mBuf);
226 #endif
227          break;
228       case CM_LTE_LCH_DTCH:
229       case CM_LTE_LCH_DCCH:
230          break;
231       default :
232          RETVALUE(RFAILED);
233    }
234    CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
235
236 #endif
237    CMCHKPK(SPkU32, param->sduId, mBuf);
238    CMCHKPK(cmPkLteRlcId, &param->rlcId, mBuf);
239    RETVALUE(ROK);
240 } /* cmPkKwuDatReqInfo */
241
242 \f
243 #ifdef ANSI
244 PUBLIC S16 cmPkKwuDatReq
245 (
246 Pst * pst,
247 KwuDatReqInfo* datReq,
248 Buffer * mBuf
249 )
250 #else
251 PUBLIC S16 cmPkKwuDatReq(pst, datReq, mBuf)
252 Pst * pst;
253 KwuDatReqInfo* datReq;
254 Buffer * mBuf;
255 #endif
256 {
257 #ifdef LCKWU
258 #if (ERRCLASS & ERRCLS_ADD_RES)
259 #endif
260 #endif /* LCKWU */
261    S16 ret1 = ROK;
262 #ifndef SS_RBUF
263    KwuDatReqInfo* datReqInfo;
264 #endif
265     TRC3(cmPkKwuDatReq)
266 #ifndef SS_RBUF
267    switch(pst->selector)
268    {
269      case KWU_SEL_LWLC:
270         {
271            if(pst->srcEnt == ENTDUAPP)
272            {
273              /* When the Selector is LWLC, we need to allocate memory, copy
274               * the contents and pass the pointer of the allocated memory. The
275               * subsequent free would be done during the Unpack function of the
276               * primitive. */
277             if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datReqInfo,
278                         sizeof(KwuDatReqInfo),SS_SHARABLE_MEMORY)) != ROK)
279             {
280 #if (ERRCLASS & ERRCLS_ADD_RES)
281                if(ret1 != ROK)
282                {
283                   SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
284                         __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
285                         (ErrVal)EKWU028, (ErrVal)0, "SGetMsg() failed");
286                }
287 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
288                RETVALUE(ret1);
289             }
290             cmMemcpy((U8*)datReqInfo,(U8*)datReq,sizeof(KwuDatReqInfo));
291             CMCHKPK(cmPkPtr,(PTR)datReqInfo, mBuf);
292            }
293            else
294            {
295             CMCHKPK(cmPkPtr,(PTR)datReq, mBuf);
296            }
297         }
298         break;
299      case KWU_SEL_LC:
300         {
301 #if (ERRCLASS & ERRCLS_ADD_RES)
302            ret1 = cmPkKwuDatReqInfo( (datReq), mBuf);
303            if(ret1 != ROK)
304            {
305               SPutMsg(mBuf);
306               SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
307                     __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
308                     (ErrVal)EKWU010, (ErrVal)ret1, "Packing failure");
309               RETVALUE( ret1 );
310            }
311 #else
312            cmPkKwuDatReqInfo( (datReq), mBuf);
313 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
314            if(pst->srcEnt == ENTNH)
315            {
316               if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq,
317                        sizeof(KwuDatReqInfo),SS_SHARABLE_MEMORY) != ROK)
318               {
319                  SPutMsg(mBuf);
320                  RETVALUE(RFAILED);
321               }
322            }
323         }
324         break;
325      default:
326           SPutMsg(mBuf);
327 #if (ERRCLASS & ERRCLS_ADD_RES)
328           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
329                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
330                (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
331 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
332           RETVALUE(RFAILED);
333    }
334
335 #ifdef L2_L3_SPLIT
336     if(datReq->rlcId.rbType == CM_LTE_SRB)
337     {
338        pst->event = (Event) KWU_EVT_CPLANE_DAT_REQ;
339     }
340     else
341     {
342        pst->event = (Event) KWU_EVT_UPLANE_DAT_REQ;
343     }
344 #else
345     pst->event = (Event) KWU_EVT_DAT_REQ;
346 #endif
347     RETVALUE(SPstTsk(pst,mBuf));
348 #else
349    if (pst->srcEnt == ENTPJ)
350    {
351       Void *elem = NULLP;
352       KwuDatReqDetl *kwuDatReqDetl = NULLP;
353       elem = SRngGetWIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
354       if (NULLP != elem)
355       {
356          kwuDatReqDetl = (KwuDatReqDetl *) elem;
357          kwuDatReqDetl->spId = spId;
358          kwuDatReqDetl->lcType = datReq->lcType;
359          kwuDatReqDetl->sduId = datReq->sduId;
360          kwuDatReqDetl->rlcId = datReq->rlcId;
361          kwuDatReqDetl->mBuf = mBuf;
362          SRngIncrWIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
363          SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].pktRate++;
364          ret1 = ROK;
365       }
366       else
367       {
368          SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].pktDrop++;
369          SPutMsg(mBuf);
370          ret1 = RFAILED;
371       }
372    }
373    else
374    {
375       switch(pst->selector)
376       {
377 #ifdef LCKWU
378          case KWU_SEL_LC:
379             {
380                ret1 = cmPkKwuDatReqInfo( (datReq), mBuf);
381 #if (ERRCLASS & ERRCLS_ADD_RES)
382                if(ret1 != ROK)
383                {
384                   SPutMsg(mBuf);
385                   SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
386                         __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
387                         (ErrVal)EKWU010, (ErrVal)ret1, "Packing failure");
388                   RETVALUE( ret1 );
389                }
390 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
391             }
392             break;
393          case KWU_SEL_LWLC:
394             {
395                CMCHKPK(cmPkPtr,(PTR)datReq, mBuf);
396             }
397             break;
398 #endif /* LCKWU */
399       }
400
401       CMCHKPKLOG(SPkS16, spId, mBuf, EKWU011, pst);
402       pst->event = (Event) KWU_EVT_DAT_REQ;
403       ret1 = SPstTsk(pst,mBuf);
404       if(pst->selector == KWU_SEL_LC)
405       {
406          if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq,
407                   sizeof(KwuDatReqInfo),SS_SHARABLE_MEMORY) != ROK)
408          {
409             SPutMsg(mBuf);
410             RETVALUE(RFAILED);
411          }
412       }
413    }
414    RETVALUE(ret1);
415 #endif
416 } /* cmPkKwuDatReq */
417
418 \f
419 #ifdef ANSI
420 PUBLIC S16 cmPkKwuDatIndInfo
421 (
422 KwuDatIndInfo *param,
423 Buffer *mBuf
424 )
425 #else
426 PUBLIC S16 cmPkKwuDatIndInfo(param, mBuf)
427 KwuDatIndInfo *param;
428 Buffer *mBuf;
429 #endif
430 {
431    TRC3(cmPkKwuDatIndInfo);
432
433    CMCHKPK(SPkU8, param->isOutOfSeq, mBuf);
434 #ifdef CCPU_OPT
435    CMCHKPK(cmPkLteRnti, param->tCrnti, mBuf);
436 #endif
437    CMCHKPK(cmPkLteRlcId, &param->rlcId, mBuf);
438    RETVALUE(ROK);
439 }
440
441 \f
442 #ifdef ANSI
443 PUBLIC S16 cmPkKwuDatInd
444 (
445 Pst * pst,
446 KwuDatIndInfo* datInd,
447 Buffer * mBuf
448 )
449 #else
450 PUBLIC S16 cmPkKwuDatInd(pst, datInd, mBuf)
451 Pst * pst;
452 KwuDatIndInfo* datInd;
453 Buffer * mBuf;
454 #endif
455 {
456 #ifdef LCKWU
457     S16 ret1 = ROK;
458 #endif /* LCKWU */
459 #ifdef TENB_SPLIT_ARCH
460 #ifdef SS_LOCKLESS_MEMORY
461     SsMsgInfo   *mInfo; 
462 #endif
463 #endif
464     KwuDatIndInfo *datIndInfo = NULLP;
465
466     TRC3(cmPkKwuDatInd)
467
468 #ifdef TENB_SPLIT_ARCH
469     /* SSI_CHANGES: */
470 #ifdef SS_LOCKLESS_MEMORY
471     mInfo = (SsMsgInfo *)mBuf->b_rptr;
472     mInfo->region = pst->region;
473 #endif /* SS_LOCKLESS_MEMORY */
474 #endif
475
476     switch(pst->selector)
477     {
478        case KWU_SEL_LWLC:
479           {
480              /* When the Selector is LWLC, we need to allocate memory, copy
481               * the contents and pass the pointer of the allocated memory. The
482               * subsequent free would be done during the Unpack function of the
483               * primitive. */
484             if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datIndInfo,
485                         sizeof(KwuDatIndInfo),SS_SHARABLE_MEMORY)) != ROK)
486             {
487 #if (ERRCLASS & ERRCLS_ADD_RES)
488                if(ret1 != ROK)
489                {
490                   SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
491                         __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
492                         (ErrVal)EKWU028, (ErrVal)0, "SGetMsg() failed");
493                }
494 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
495                RETVALUE(ret1);
496             }
497
498             cmMemcpy((U8*)datIndInfo,(U8*)datInd,sizeof(KwuDatIndInfo));
499             CMCHKPK(cmPkPtr,(PTR)datIndInfo, mBuf);
500           }
501           break;
502        case KWU_SEL_LC:
503           {
504 #if (ERRCLASS & ERRCLS_ADD_RES)
505              ret1 = cmPkKwuDatIndInfo( (datInd), mBuf);
506              if(ret1 != ROK)
507              {
508                 SPutMsg(mBuf);
509                 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
510                       __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
511                       (ErrVal)EKWU012, (ErrVal)ret1, "Packing failure");
512                 RETVALUE( ret1 );
513              }
514 #else
515              cmPkKwuDatIndInfo( (datInd), mBuf);
516 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
517           }
518           break;
519        default:
520           SPutMsg(mBuf);
521 #if (ERRCLASS & ERRCLS_ADD_RES)
522           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
523                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
524                (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
525 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
526           RETVALUE(RFAILED);
527     }
528
529     pst->event = (Event) KWU_EVT_DAT_IND;
530
531     RETVALUE(SPstTsk(pst,mBuf));
532 } /* cmPkKwuDatInd */
533
534 \f
535 #ifdef ANSI
536 PUBLIC S16 cmPkKwuDatCfmInfo
537 (
538 KwuDatCfmInfo *param,
539 Buffer *mBuf
540 )
541 #else
542 PUBLIC S16 cmPkKwuDatCfmInfo(param, mBuf)
543 KwuDatCfmInfo *param;
544 Buffer *mBuf;
545 #endif
546 {
547    register U32 iter;
548
549    TRC3(cmPkKwuDatCfmInfo);
550    for(iter = 0; iter < param->numSduIds; iter++)
551    {
552       CMCHKPK(SPkU32, param->sduIds[iter], mBuf);
553    }
554    CMCHKPK(SPkU32, param->numSduIds, mBuf);
555    CMCHKPK(cmPkLteRlcId, &param->rlcId, mBuf);
556    RETVALUE(ROK);
557 } /* cmPkKwuDatCfmInfo */
558
559 \f
560 #ifdef ANSI
561 PUBLIC S16 cmPkKwuDatCfm
562 (
563 Pst * pst,
564 SuId suId,
565 KwuDatCfmInfo* datCfm
566 )
567 #else
568 PUBLIC S16 cmPkKwuDatCfm(pst, suId, datCfm)
569 Pst * pst;
570 SuId suId;
571 KwuDatCfmInfo* datCfm;
572 #endif
573 {
574 #if (ERRCLASS & ERRCLS_ADD_RES)
575    S16 ret1= ROK;
576 #endif 
577    Buffer *mBuf;
578
579    TRC3(cmPkKwuDatCfm)
580
581    mBuf = NULLP;
582
583    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
584       RETVALUE(RFAILED);
585    }
586
587    switch(pst->selector)
588    {
589       case KWU_SEL_LWLC:
590          {
591             CMCHKPK(cmPkPtr,(PTR)datCfm, mBuf);
592          }
593          break;
594       case KWU_SEL_LC:
595          {
596 #if (ERRCLASS & ERRCLS_ADD_RES)
597             ret1 = cmPkKwuDatCfmInfo( (datCfm), mBuf);
598             if(ret1 != ROK)
599             {
600                SPutMsg(mBuf);
601                SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
602                      __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
603                      (ErrVal)EKWU014, (ErrVal)ret1, "Packing failure");
604                RETVALUE( ret1 );
605             }
606 #else
607             cmPkKwuDatCfmInfo( (datCfm), mBuf);
608 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
609             if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datCfm,
610                      sizeof(KwuDatCfmInfo),SS_SHARABLE_MEMORY) != ROK)
611             {
612                SPutMsg(mBuf);
613                RETVALUE(RFAILED);
614             }
615          }
616          break;
617       default:
618           SPutMsg(mBuf);
619 #if (ERRCLASS & ERRCLS_ADD_RES)
620           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
621                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
622                (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
623 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
624           RETVALUE(RFAILED);
625    }
626
627     CMCHKPKLOG(SPkS16, suId, mBuf, EKWU015, pst);
628     pst->event = (Event) KWU_EVT_DAT_CFM;
629
630     RETVALUE(SPstTsk(pst,mBuf));
631 } /* cmPkKwuDatCfm */
632
633 \f
634 #ifdef ANSI
635 PUBLIC S16 cmPkKwuDiscSduReq
636 (
637 Pst * pst,
638 SpId spId,
639 KwuDiscSduInfo* discSdu
640 )
641 #else
642 PUBLIC S16 cmPkKwuDiscSduReq(pst, spId, discSdu)
643 Pst * pst;
644 SpId spId;
645 KwuDiscSduInfo* discSdu;
646 #endif
647 {
648 #ifdef LCKWU
649    S16 ret1;
650 #endif /* LCKWU */
651    Buffer *mBuf;
652    KwuDiscSduInfo* discSduInfo = NULLP;
653
654    TRC3(cmPkKwuDiscSduReq)
655    mBuf = NULLP;
656
657    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
658       RETVALUE(RFAILED);
659    }
660
661    switch(pst->selector)
662    {
663       case KWU_SEL_LWLC:
664          {
665             /* When the Selector is LWLC, we need to allocate memory, copy
666              * the contents and pass the pointer of the allocated memory. The
667              * subsequent free would be done during the Unpack function of the
668              * primitive. */
669            if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&discSduInfo,
670                        sizeof(KwuDiscSduInfo),SS_SHARABLE_MEMORY)) != ROK)
671            {
672 #if (ERRCLASS & ERRCLS_ADD_RES)
673               if(ret1 != ROK)
674               {
675                  SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
676                        __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
677                         (ErrVal)EKWU028, (ErrVal)0, "SGetMsg() failed");
678               }
679 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
680               RETVALUE(ret1);
681            }
682             
683            cmMemcpy((U8*)discSduInfo,(U8*)discSdu,sizeof(KwuDiscSduInfo));
684            CMCHKPK(cmPkPtr,(PTR)discSduInfo, mBuf);
685          }
686          break;
687       case KWU_SEL_LC:
688          {
689 #if (ERRCLASS & ERRCLS_ADD_RES)
690             ret1 = cmPkKwuDiscSduInfo( (discSdu), mBuf);
691             if(ret1 != ROK)
692             {
693                SPutMsg(mBuf);
694                SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
695                      __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
696                      (ErrVal)EKWU016, (ErrVal)ret1, "Packing failure");
697                RETVALUE( ret1 );
698             }
699 #else
700             cmPkKwuDiscSduInfo( (discSdu), mBuf);
701 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
702              break;
703           }
704     }
705
706     CMCHKPKLOG(SPkS16, spId, mBuf, EKWU017, pst);
707     pst->event = (Event) KWU_EVT_DISC_SDU_REQ;
708
709     RETVALUE(SPstTsk(pst,mBuf));
710 } /* cmPkKwuDiscSduReq */
711
712 \f
713 #ifdef ANSI
714 PUBLIC S16 cmPkKwuStaIndInfo
715 (
716 KwuStaIndInfo *param,
717 Buffer *mBuf
718 )
719 #else
720 PUBLIC S16 cmPkKwuStaIndInfo(param, mBuf)
721 KwuStaIndInfo *param;
722 Buffer *mBuf;
723 #endif
724 {
725    S16 i;
726
727    TRC3(cmPkKwuStaIndInfo);
728
729    for (i = (param->numSdu - 1); i >= 0; i--)
730    {
731       CMCHKPK(SPkU32, param->sduId[(U16)i], mBuf);
732    }
733    CMCHKPK(SPkU32, param->numSdu, mBuf);
734    CMCHKPK(cmPkLteRlcId, &param->rlcId, mBuf);
735    RETVALUE(ROK);
736 }
737
738 #ifdef ANSI
739 PUBLIC S16 cmPkKwuFlowCntrlIndInfo
740 (
741 KwuFlowCntrlIndInfo *param,
742 Buffer              *mBuf
743 )
744 #else
745 PUBLIC S16 cmPkKwuFlowCntrlIndInfo(param, mBuf)
746 KwuFlowCntrlIndInfo  *param;
747 Buffer               *mBuf;
748 #endif
749 {
750    TRC3(cmPkKwuFlowCntrlIndInfo);
751
752    CMCHKPK(SPkU32, param->pktAdmitCnt, mBuf);   
753    CMCHKPK(cmPkLteRlcId, &param->rlcId, mBuf);
754
755    RETVALUE(ROK);
756 } /* cmPkKwuFlowCntrlIndInfo */
757
758 #ifdef ANSI
759 PUBLIC S16 cmUnpkKwuFlowCntrlIndInfo
760 (
761 KwuFlowCntrlIndInfo *param,
762 Buffer              *mBuf
763 )
764 #else
765 PUBLIC S16 cmUnpkKwuFlowCntrlIndInfo(param, mBuf)
766 KwuFlowCntrlIndInfo  *param;
767 Buffer               *mBuf;
768 #endif
769 {
770    TRC3(cmUnpkKwuFlowCntrlIndInfo);
771    
772    CMCHKUNPK(cmUnpkLteRlcId, &param->rlcId, mBuf);
773    CMCHKUNPK(SUnpkU32, &param->pktAdmitCnt, mBuf);
774   
775    RETVALUE(ROK);
776 } /* cmUnpkKwuFlowCntrlIndInfo */
777
778 \f
779 #ifdef ANSI
780 PUBLIC S16 cmPkKwuStaInd
781 (
782 Pst * pst,
783 SuId suId,
784 KwuStaIndInfo* staInd
785 )
786 #else
787 PUBLIC S16 cmPkKwuStaInd(pst, suId, staInd)
788 Pst * pst;
789 SuId suId;
790 KwuStaIndInfo* staInd;
791 #endif
792 {
793 #ifdef LCKWU
794 #if (ERRCLASS & ERRCLS_ADD_RES)
795    S16 ret1 = ROK;
796 #endif
797 #endif /* LCKWU */
798    Buffer *mBuf;
799
800    TRC3(cmPkKwuStaInd)
801
802    mBuf = NULLP;
803
804    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
805       RETVALUE(RFAILED);
806    }
807
808     switch(pst->selector)
809     {
810        case KWU_SEL_LWLC:
811           {
812              CMCHKPK(cmPkPtr,(PTR) staInd, mBuf);
813           }
814           break;
815        case KWU_SEL_LC:
816           {
817 #if (ERRCLASS & ERRCLS_ADD_RES)
818              ret1 = cmPkKwuStaIndInfo( (staInd), mBuf);
819              if(ret1 != ROK)
820              {
821                 SPutMsg(mBuf);
822                 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
823                       __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
824                       (ErrVal)EKWU018, (ErrVal)ret1, "Packing failure");
825                 RETVALUE( ret1 );
826              }
827 #else
828              cmPkKwuStaIndInfo( (staInd), mBuf);
829 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
830              if (SPutStaticBuffer(pst->region, pst->pool, (Data *)staInd,
831                       sizeof(KwuStaIndInfo),SS_SHARABLE_MEMORY) != ROK)
832              {
833                 SPutMsg(mBuf);
834                 RETVALUE(RFAILED);
835              }
836           }
837           break;
838        default:
839           SPutMsg(mBuf);
840 #if (ERRCLASS & ERRCLS_ADD_RES)
841           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
842                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
843                (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
844 #endif
845           RETVALUE(RFAILED);
846     }
847
848     CMCHKPKLOG(SPkS16, suId, mBuf, EKWU019, pst);
849     pst->event = (Event) KWU_EVT_STA_IND;
850
851     RETVALUE(SPstTsk(pst,mBuf));
852 } /* cmPkKwuStaInd */
853
854 \f
855 #ifdef ANSI
856 PUBLIC S16 cmPkKwuReEstCmpInd
857 (
858 Pst * pst,
859 SuId suId,
860 CmLteRlcId rlcId
861 )
862 #else
863 PUBLIC S16 cmPkKwuReEstCmpInd(pst, suId, rlcId)
864 Pst * pst;
865 SuId suId;
866 CmLteRlcId rlcId;
867 #endif
868 {
869 #ifdef LCKWU
870 #if (ERRCLASS & ERRCLS_ADD_RES)
871    S16 ret1;
872 #endif
873 #endif /* LCKWU */
874    Buffer *mBuf;
875
876    TRC3(cmPkKwuReEstCmpInd)
877
878    mBuf = NULLP;
879
880    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
881       RETVALUE(RFAILED);
882    }
883
884     switch(pst->selector)
885     {
886 #ifdef LCKWU
887        case KWU_SEL_LC:
888           {
889 #if (ERRCLASS & ERRCLS_ADD_RES)
890              ret1 = cmPkLteRlcId( &rlcId, mBuf);
891              if(ret1 != ROK)
892              {
893                 SPutMsg(mBuf);
894                 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
895                       __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
896                       (ErrVal)EKWU018, (ErrVal)ret1, "Packing failure");
897                 RETVALUE( ret1 );
898              }
899 #else
900              cmPkLteRlcId( &rlcId, mBuf);
901 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
902              break;
903           }
904 #endif /* LCKWU */
905     }
906
907     CMCHKPKLOG(SPkS16, suId, mBuf, EKWU019, pst);
908     pst->event = (Event) KWU_EVT_REEST_CMP_IND;
909
910     RETVALUE(SPstTsk(pst,mBuf));
911 } /* cmPkKwuReEstCmpInd */
912
913 /* kwu_c_001.main_3 added support for L2 Measurement */
914 #ifdef ANSI
915 PUBLIC S16 cmPkKwuDiscSduCfm
916 (
917 Pst            *pst,
918 SpId           spId,
919 KwuDiscSduInfo *discCfmSdu
920 )
921 #else
922 PUBLIC S16 cmPkKwuDiscSduCfm(pst, spId, discCfmSdu)
923 Pst            *pst;
924 SpId           spId;
925 KwuDiscSduInfo *discCfmSdu;
926 #endif
927 {
928 #if (ERRCLASS & ERRCLS_ADD_RES)
929    S16 ret1 = ROK;
930 #endif
931    Buffer *mBuf;
932
933    TRC3(cmPkKwuDiscSduCfm)
934
935    mBuf = NULLP;
936
937    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
938       RETVALUE(RFAILED);
939    }
940
941    switch(pst->selector)
942    {
943       case KWU_SEL_LWLC:
944          {
945             CMCHKPK(cmPkPtr,(PTR)discCfmSdu, mBuf);
946          }
947          break;
948       case KWU_SEL_LC:
949          {
950 #if (ERRCLASS & ERRCLS_ADD_RES)
951             ret1 = cmPkKwuDiscSduInfo((discCfmSdu), mBuf);
952             if(ret1 != ROK)
953             {
954                SPutMsg(mBuf);
955                SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
956                      __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
957                      (ErrVal)ERRKWU, (ErrVal)ret1, "Packing failure");
958                RETVALUE( ret1 );
959             }
960 #else
961             cmPkKwuDiscSduInfo((discCfmSdu), mBuf);
962 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
963             if (SPutStaticBuffer(pst->region, pst->pool, (Data *)discCfmSdu,
964                      sizeof(KwuDiscSduInfo),SS_SHARABLE_MEMORY) != ROK)
965             {
966                SPutMsg(mBuf);
967                RETVALUE(RFAILED);
968             }
969          }
970          break;
971       default:
972          SPutMsg(mBuf);
973 #if (ERRCLASS & ERRCLS_ADD_RES)
974          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
975                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
976                (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
977 #endif
978           RETVALUE(RFAILED);
979    }
980
981    CMCHKPKLOG(SPkS16, spId, mBuf, ERRKWU, pst);
982    pst->event = (Event) KWU_EVT_DISC_SDU_CFM;
983
984    RETVALUE(SPstTsk(pst,mBuf));
985 } /* cmPkKwuDiscSduCfm */
986 \f
987 #ifdef ANSI
988 PUBLIC S16 cmPkKwuFlowCntrlInd
989 (
990 Pst            *pst,
991 SuId           suId,
992 KwuFlowCntrlIndInfo *flowCntrlIndInfo
993 )
994 #else
995 PUBLIC S16 cmPkKwuFlowCntrlInd(pst, suId, flowCntrlIndInfo)
996 Pst            *pst;
997 SuId           suId;
998 KwuFlowCntrlIndInfo *flowCntrlIndInfo;
999 #endif
1000 {
1001    Buffer *mBuf;
1002
1003    TRC3(cmPkKwuFlowCntrlInd)
1004
1005    mBuf = NULLP;
1006
1007    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
1008    {
1009       SPutStaticBuffer(pst->region, 
1010                pst->pool, 
1011                (Data *)flowCntrlIndInfo,
1012                sizeof(KwuFlowCntrlIndInfo),0);
1013       RETVALUE(RFAILED);
1014    }
1015 #ifdef LCKWU
1016    switch(pst->selector)
1017    {
1018       case KWU_SEL_LC:
1019       {
1020          cmPkKwuFlowCntrlIndInfo((flowCntrlIndInfo), mBuf);
1021
1022          if (SPutStaticBuffer(pst->region, 
1023                       pst->pool, 
1024                       (Data *)flowCntrlIndInfo,
1025                       sizeof(KwuFlowCntrlIndInfo),0) != ROK)
1026          {
1027             SPutMsg(mBuf);
1028             RETVALUE(RFAILED);
1029          }
1030       }
1031       break;
1032       
1033       case KWU_SEL_LWLC:
1034       {
1035          CMCHKPK(cmPkPtr,(PTR) flowCntrlIndInfo, mBuf);
1036       }
1037       break;
1038    }
1039 #endif
1040
1041    CMCHKPKLOG(SPkS16, suId, mBuf, ERRKWU, pst);
1042    pst->event = (Event) KWU_EVT_FLOW_CNTRL_IND;
1043
1044    RETVALUE(SPstTsk(pst,mBuf));
1045 } /* cmPkKwuFlowCntrlInd */
1046
1047 #ifdef LTE_L2_MEAS
1048 #ifdef ANSI
1049 PUBLIC S16 cmPkKwuDatAckInfo
1050 (
1051 KwuDatAckInfo *param,
1052 Buffer *mBuf
1053 )
1054 #else
1055 PUBLIC S16 cmPkKwuDatAckInfo(param, mBuf)
1056 KwuDatAckInfo *param;
1057 Buffer *mBuf;
1058 #endif
1059 {
1060    TRC3(cmPkKwuDatAckIndInfo);
1061
1062    CMCHKPK(cmPkLteRlcId, &param->rlcId, mBuf);
1063    CMCHKPK(SPkU32, param->sduId, mBuf);
1064    RETVALUE(ROK);
1065 }
1066
1067 #ifdef ANSI
1068 PUBLIC S16 cmPkKwuDatAckInd
1069 (
1070 Pst * pst,
1071 SuId suId,
1072 KwuDatAckInfo* datInd
1073 )
1074 #else
1075 PUBLIC S16 cmPkKwuDatAckInd(pst, suId, datInd)
1076 Pst * pst;
1077 SuId suId;
1078 KwuDatAckInfo* datInd;
1079 #endif
1080 {
1081     S16 ret1;
1082
1083    Buffer *mBuf;
1084
1085    TRC3(cmPkKwuDatAckInd);
1086
1087    mBuf = NULLP;
1088
1089    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1090       RETVALUE(RFAILED);
1091    }
1092
1093    ret1 = cmPkKwuDatAckInfo( (datInd), mBuf);
1094 #if (ERRCLASS & ERRCLS_ADD_RES)
1095    if(ret1 != ROK)
1096    {
1097       SPutMsg(mBuf);
1098       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1099             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1100             (ErrVal)ERRKWU, (ErrVal)ret1, "Packing failure");
1101       RETVALUE( ret1 );
1102    }
1103 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1104    if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd,
1105             sizeof(KwuDatAckInfo),SS_SHARABLE_MEMORY) != ROK)
1106    {
1107       SPutMsg(mBuf);
1108       RETVALUE(RFAILED);
1109    }
1110
1111    CMCHKPKLOG(SPkS16, suId, mBuf, ERRKWU, pst);
1112    pst->event = (Event) KWU_EVT_DAT_ACK_IND;
1113
1114    RETVALUE(SPstTsk(pst,mBuf));
1115 } /* cmPkKwuDatAckInd */
1116 #endif /* LTE_L2_MEAS */
1117
1118 \f
1119 #ifdef ANSI
1120 PUBLIC S16 cmUnpkKwuBndReq
1121 (
1122 KwuBndReq func,
1123 Pst *pst,
1124 Buffer *mBuf
1125 )
1126 #else
1127 PUBLIC S16 cmUnpkKwuBndReq(func, pst, mBuf)
1128 KwuBndReq func;
1129 Pst *pst;
1130 Buffer *mBuf;
1131 #endif
1132 {
1133    SuId suId = 0;
1134    SpId spId = 0;
1135
1136    TRC3(cmUnpkKwuBndReq)
1137
1138    CMCHKUNPKLOG(SUnpkS16, &suId, mBuf, EKWU020, pst);
1139    CMCHKUNPKLOG(SUnpkS16, &spId, mBuf, EKWU021, pst);
1140    SPutMsg(mBuf);
1141
1142    RETVALUE((*func)(pst, suId, spId));
1143 }
1144
1145 \f
1146 #ifdef ANSI
1147 PUBLIC S16 cmUnpkKwuBndCfm
1148 (
1149 KwuBndCfm func,
1150 Pst *pst,
1151 Buffer *mBuf
1152 )
1153 #else
1154 PUBLIC S16 cmUnpkKwuBndCfm(func, pst, mBuf)
1155 KwuBndCfm func;
1156 Pst *pst;
1157 Buffer *mBuf;
1158 #endif
1159 {
1160    SuId suId = 0;
1161    U8 status = 0;
1162
1163    TRC3(cmUnpkKwuBndCfm)
1164
1165    CMCHKUNPKLOG(SUnpkS16, &suId, mBuf, EKWU022, pst);
1166    CMCHKUNPKLOG(SUnpkU8, &status, mBuf, EKWU023, pst);
1167    SPutMsg(mBuf);
1168
1169    RETVALUE((*func)(pst, suId, status));
1170 }
1171
1172 \f
1173 #ifdef ANSI
1174 PUBLIC S16 cmUnpkKwuUbndReq
1175 (
1176 KwuUbndReq func,
1177 Pst *pst,
1178 Buffer *mBuf
1179 )
1180 #else
1181 PUBLIC S16 cmUnpkKwuUbndReq(func, pst, mBuf)
1182 KwuUbndReq func;
1183 Pst *pst;
1184 Buffer *mBuf;
1185 #endif
1186 {
1187    SpId spId = 0;
1188    Reason reason = 0;
1189    
1190    TRC3(cmUnpkKwuUbndReq)
1191
1192    CMCHKUNPKLOG(SUnpkS16, &spId, mBuf, EKWU024, pst);
1193    CMCHKUNPKLOG(SUnpkS16, &reason, mBuf, EKWU025, pst);
1194    SPutMsg(mBuf);
1195
1196    RETVALUE((*func)(pst, spId, reason));
1197 } /* cmUnpkKwuUbndReq */
1198
1199 \f
1200 #ifdef ANSI
1201 PUBLIC S16 cmUnpkKwuDatReqInfo
1202 (
1203 KwuDatReqInfo *param,
1204 Buffer *mBuf
1205 )
1206 #else
1207 PUBLIC S16 cmUnpkKwuDatReqInfo(param, mBuf)
1208 KwuDatReqInfo *param;
1209 Buffer *mBuf;
1210 #endif
1211 {
1212
1213    TRC3(cmUnpkKwuDatReqInfo);
1214
1215    CMCHKUNPK(cmUnpkLteRlcId, &param->rlcId, mBuf);
1216    CMCHKUNPK(SUnpkU32, &param->sduId, mBuf);
1217
1218 #ifdef CCPU_OPT
1219    CMCHKUNPK(cmUnpkLteLcType, &param->lcType, mBuf);
1220    switch(param->lcType) {
1221       case CM_LTE_LCH_BCCH:
1222       case  CM_LTE_LCH_PCCH:
1223 #ifdef EMTC_ENABLE
1224          CMCHKUNPK(SUnpkU8,&param->pnb , mBuf);
1225          CMCHKUNPK(SUnpkU8,&param->emtcDiReason , mBuf);
1226 #endif         
1227          CMCHKUNPK(cmUnpkLteTimingInfo, &param->tm.tmg, mBuf);
1228
1229          break;
1230       case CM_LTE_LCH_CCCH:
1231          CMCHKUNPK(cmUnpkLteRnti, &param->tm.rnti, mBuf);
1232          break;
1233       case CM_LTE_LCH_DTCH:
1234       case CM_LTE_LCH_DCCH:
1235          break;
1236       default :
1237          RETVALUE(RFAILED);
1238    }
1239 #endif
1240    RETVALUE(ROK);
1241 }
1242
1243 \f
1244 #ifdef ANSI
1245 PUBLIC S16 cmUnpkKwuDatReq
1246 (
1247 KwuDatReq func,
1248 Pst *pst,
1249 Buffer *mBuf
1250 )
1251 #else
1252 PUBLIC S16 cmUnpkKwuDatReq(func, pst, mBuf)
1253 KwuDatReq func;
1254 Pst *pst;
1255 Buffer *mBuf;
1256 #endif
1257 {
1258 #if(ERRCLASS & ERRCLS_DEBUG)
1259    S16 ret1 = ROK; 
1260 #endif
1261    S16 retVal;
1262    KwuDatReqInfo *datReq = NULLP;
1263    KwuDatReqInfo datReqTmp;
1264
1265    TRC3(cmUnpkKwuDatReq)
1266
1267    switch(pst->selector)
1268    {
1269       case KWU_SEL_LWLC:
1270          {
1271             CMCHKUNPK(cmUnpkPtr,(PTR *) &datReq, mBuf);
1272          }
1273          break;
1274       case KWU_SEL_LC:
1275          {
1276             /* Allocate the memory statically  as there is no free 
1277              * in RLC */
1278             datReq = &datReqTmp;
1279             cmMemset((U8 *)datReq, 0, sizeof(KwuDatReqInfo));
1280 #if(ERRCLASS & ERRCLS_DEBUG)
1281             ret1 = cmUnpkKwuDatReqInfo( (datReq), mBuf);
1282             if(ret1 != ROK)
1283             {
1284                SPutMsg(mBuf);
1285                SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1286                      __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1287                      (ErrVal)EKWU027, (ErrVal)ret1, "Unpacking failure");
1288                RETVALUE( ret1 );
1289             }
1290 #else
1291             cmUnpkKwuDatReqInfo( (datReq), mBuf);
1292 #endif /* ERRCLASS & ERRCLS_DEBUG */
1293          }
1294          break;
1295       default:
1296          SPutMsg(mBuf);
1297 #if (ERRCLASS & ERRCLS_ADD_RES)
1298          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1299                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1300                (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
1301 #endif
1302          RETVALUE(RFAILED);
1303    }
1304
1305    retVal = (*func)(pst, datReq, mBuf);
1306    /* If LWLC is configured, we need to
1307     * free the memory here. */
1308    if(pst->selector == KWU_SEL_LWLC)
1309    {
1310       retVal = SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq,
1311             sizeof(KwuDatReqInfo),SS_SHARABLE_MEMORY);
1312    }
1313    RETVALUE(retVal);
1314 } /* cmUnpkKwuDatReq */
1315
1316 \f
1317 #ifdef ANSI
1318 PUBLIC S16 cmUnpkKwuDatIndInfo
1319 (
1320 KwuDatIndInfo *param,
1321 Buffer *mBuf
1322 )
1323 #else
1324 PUBLIC S16 cmUnpkKwuDatIndInfo(param, mBuf)
1325 KwuDatIndInfo *param;
1326 Buffer *mBuf;
1327 #endif
1328 {
1329    TRC3(cmUnpkKwuDatIndInfo);
1330
1331    CMCHKUNPK(cmUnpkLteRlcId, &param->rlcId, mBuf);
1332
1333 #ifdef CCPU_OPT
1334    CMCHKUNPK(cmUnpkLteRnti, &param->tCrnti, mBuf);
1335 #endif
1336    CMCHKUNPK(SUnpkU8, &param->isOutOfSeq, mBuf);
1337    RETVALUE(ROK);
1338 }
1339
1340 \f
1341 #ifdef ANSI
1342 PUBLIC S16 cmUnpkKwuDatInd
1343 (
1344 KwuDatInd func,
1345 Pst *pst,
1346 Buffer *mBuf
1347 )
1348 #else
1349 PUBLIC S16 cmUnpkKwuDatInd(func, pst, mBuf)
1350 KwuDatInd func;
1351 Pst *pst;
1352 Buffer *mBuf;
1353 #endif
1354 {
1355     S16 ret1 = ROK, retVal;
1356     KwuDatIndInfo *datInd = NULLP;
1357     KwuDatIndInfo datIndTmp;
1358     
1359     TRC3(cmUnpkKwuDatInd)
1360
1361     switch(pst->selector)
1362     {
1363       case KWU_SEL_LWLC:
1364          {
1365             CMCHKUNPK(cmUnpkPtr,(PTR *) &datInd, mBuf);
1366          }
1367          break;
1368       case KWU_SEL_LC:
1369          {
1370             /*SGetStaticBuffer used as RRC has an equivalent free but PDCP
1371              * doesn't free any memory */
1372             if(pst->dstEnt != ENTPJ)
1373             {
1374                if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datInd,
1375                            sizeof(KwuDatIndInfo),SS_SHARABLE_MEMORY)) != ROK)
1376                {
1377 #if (ERRCLASS & ERRCLS_ADD_RES)
1378        if(ret1 != ROK)
1379        {
1380           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1381                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1382                (ErrVal)EKWU028, (ErrVal)0, "SGetMsg() failed");
1383        }
1384 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1385                   RETVALUE(ret1);
1386                }
1387             }
1388             else
1389             {
1390                datInd = &datIndTmp;
1391             }
1392
1393             ret1 = cmUnpkKwuDatIndInfo( (datInd), mBuf);
1394 #if(ERRCLASS & ERRCLS_DEBUG)
1395           if(ret1 != ROK)
1396           {
1397              SPutMsg(mBuf);
1398              SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1399                    __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1400                   (ErrVal)EKWU029, (ErrVal)ret1, "Unpacking failure");
1401              RETVALUE( ret1 );
1402           }
1403 #endif /* ERRCLASS & ERRCLS_DEBUG */
1404          }
1405          break;
1406       default:
1407          SPutMsg(mBuf);
1408          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1409                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1410                (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
1411          RETVALUE(RFAILED);
1412     }
1413     retVal = (*func)(pst, datInd, mBuf);
1414     /* If LWLC is configured and the destination entity is PDCP, we need to
1415      * free the memory here. */
1416     if((pst->selector == KWU_SEL_LWLC) && (pst->dstEnt == ENTPJ))
1417     {
1418        retVal = SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd,
1419                 sizeof(KwuDatIndInfo),SS_SHARABLE_MEMORY);
1420     }
1421     RETVALUE(retVal);
1422 } /* cmUnpkKwuDatInd */
1423
1424 \f
1425 #ifdef ANSI
1426 PUBLIC S16 cmUnpkKwuDatCfmInfo
1427 (
1428 KwuDatCfmInfo *param,
1429 Buffer *mBuf
1430 )
1431 #else
1432 PUBLIC S16 cmUnpkKwuDatCfmInfo(param, mBuf)
1433 KwuDatCfmInfo *param;
1434 Buffer *mBuf;
1435 #endif
1436 {
1437    register S32 iter;
1438    TRC3(cmUnpkKwuDatCfmInfo);
1439
1440    CMCHKUNPK(cmUnpkLteRlcId, &param->rlcId, mBuf);
1441    CMCHKUNPK(SUnpkU32, &param->numSduIds, mBuf);
1442
1443 #ifdef L2_L3_SPLIT /*Work Around */
1444    if (param->numSduIds >= KWU_MAX_DAT_CFM)
1445       param->numSduIds = KWU_MAX_DAT_CFM;
1446 #endif
1447    for(iter = param->numSduIds -1; iter >= 0 ; iter--)
1448    {
1449       CMCHKUNPK(SUnpkU32, &param->sduIds[iter], mBuf);
1450    }
1451    RETVALUE(ROK);
1452 }
1453
1454 #ifdef ANSI
1455 PUBLIC S16 cmUnpkKwuDatCfm
1456 (
1457 KwuDatCfm func,
1458 Pst *pst,
1459 Buffer *mBuf
1460 )
1461 #else
1462 PUBLIC S16 cmUnpkKwuDatCfm(func, pst, mBuf)
1463 KwuDatCfm func;
1464 Pst *pst;
1465 Buffer *mBuf;
1466 #endif
1467 {
1468    S16 ret1 = ROK;
1469    SuId          suId = 0;
1470    KwuDatCfmInfo *datCfm = NULLP;
1471
1472    TRC3(cmUnpkKwuDatCfm)
1473
1474    CMCHKUNPK(SUnpkS16, &(suId), mBuf);
1475
1476    switch(pst->selector)
1477    {
1478       case KWU_SEL_LWLC:
1479          {
1480             CMCHKUNPK(cmUnpkPtr,(PTR *) &datCfm, mBuf);
1481          }
1482          break;
1483       case KWU_SEL_LC:
1484          {
1485             if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datCfm,\
1486                         sizeof(KwuDatCfmInfo),SS_SHARABLE_MEMORY)) != ROK)
1487             {
1488 #if (ERRCLASS & ERRCLS_ADD_RES)
1489        if(ret1 != ROK)
1490        {
1491           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1492                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1493                (ErrVal)EKWU030, (ErrVal)0, "SGetMsg() failed");
1494        }
1495 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1496                RETVALUE(ret1);
1497             }
1498
1499             cmMemset((U8 *)datCfm, 0, sizeof(KwuDatCfmInfo));
1500             ret1 = cmUnpkKwuDatCfmInfo( (datCfm), mBuf);
1501 #if(ERRCLASS & ERRCLS_DEBUG)
1502           if(ret1 != ROK)
1503           {
1504              SPutMsg(mBuf);
1505              SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1506                    __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1507                   (ErrVal)EKWU031, (ErrVal)ret1, "Unpacking failure");
1508              RETVALUE( ret1 );
1509           }
1510 #endif /* ERRCLASS & ERRCLS_DEBUG */
1511          }
1512          break;
1513       default:
1514 #if (ERRCLASS & ERRCLS_ADD_RES)
1515           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1516                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1517                (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
1518 #endif
1519           SPutMsg(mBuf);
1520           RETVALUE(RFAILED);
1521    }
1522
1523    SPutMsg(mBuf);
1524
1525    RETVALUE((*func)(pst, suId, datCfm));
1526 } /* cmUnpkKwuDatCfm */
1527
1528 \f
1529 #ifdef ANSI
1530 PUBLIC S16 cmUnpkKwuDiscSduReq
1531 (
1532 KwuDiscSduReq func,
1533 Pst *pst,
1534 Buffer *mBuf
1535 )
1536 #else
1537 PUBLIC S16 cmUnpkKwuDiscSduReq(func, pst, mBuf)
1538 KwuDiscSduReq func;
1539 Pst *pst;
1540 Buffer *mBuf;
1541 #endif
1542 {
1543    S16 ret1 = ROK;
1544    SpId          spId = 0;
1545    KwuDiscSduInfo *discSdu = NULLP;
1546
1547
1548    CMCHKUNPK(SUnpkS16, &(spId), mBuf);
1549    switch(pst->selector)
1550    {
1551       case KWU_SEL_LWLC:
1552          {
1553             CMCHKUNPK(cmUnpkPtr,(PTR *) &discSdu, mBuf);
1554          }
1555          break;
1556       case KWU_SEL_LC:
1557          {
1558             if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&discSdu,\
1559                         sizeof(KwuDiscSduInfo),SS_SHARABLE_MEMORY)) != ROK)
1560             {
1561 #if (ERRCLASS & ERRCLS_ADD_RES)
1562                /*MBUF_FIXX*/
1563                SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1564                      __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1565                      (ErrVal)EKWU032, (ErrVal)0, "SGetMsg() failed");
1566
1567 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1568                RETVALUE(ret1);
1569             }
1570
1571             cmMemset((U8 *)discSdu, 0, sizeof(KwuDiscSduInfo));
1572             ret1 = cmUnpkKwuDiscSduInfo( (discSdu), 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)EKWU033, (ErrVal)ret1, "Unpacking failure");
1580                RETVALUE( ret1 );
1581             }
1582 #endif /* ERRCLASS & ERRCLS_DEBUG */
1583             break;
1584          }
1585       default:
1586 #if (ERRCLASS & ERRCLS_ADD_RES)
1587           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1588                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1589                (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
1590 #endif
1591           SPutMsg(mBuf);
1592           RETVALUE(RFAILED);
1593    }
1594    SPutMsg(mBuf);
1595
1596    RETVALUE((*func)(pst, spId, discSdu));
1597 } /* cmUnpkKwuDiscSduReq */
1598
1599 \f
1600 #ifdef ANSI
1601 PUBLIC S16 cmUnpkKwuStaIndInfo
1602 (
1603 KwuStaIndInfo *param,
1604 Buffer *mBuf
1605 )
1606 #else
1607 PUBLIC S16 cmUnpkKwuStaIndInfo(param, mBuf)
1608 KwuStaIndInfo *param;
1609 Buffer *mBuf;
1610 #endif
1611 {
1612    U32 i;
1613
1614    TRC3(cmUnpkKwuStaIndInfo);
1615
1616    CMCHKUNPK(cmUnpkLteRlcId, &param->rlcId, mBuf);
1617    CMCHKUNPK(SUnpkU32, &param->numSdu, mBuf);
1618    for (i = 0; i < param->numSdu; i++)
1619    {
1620       CMCHKUNPK(SUnpkU32, &param->sduId[i], mBuf);
1621    }
1622
1623    RETVALUE(ROK);
1624 } /* cmUnpkKwuStaIndInfo */
1625
1626 \f
1627 #ifdef ANSI
1628 PUBLIC S16 cmUnpkKwuStaInd
1629 (
1630 KwuStaInd func,
1631 Pst *pst,
1632 Buffer *mBuf
1633 )
1634 #else
1635 PUBLIC S16 cmUnpkKwuStaInd(func, pst, mBuf)
1636 KwuStaInd func;
1637 Pst *pst;
1638 Buffer *mBuf;
1639 #endif
1640 {
1641    S16 ret1 = ROK;
1642    SuId          suId = 0;
1643    KwuStaIndInfo *staInd = NULLP;
1644
1645    TRC3(cmUnpkKwuStaInd)
1646
1647    CMCHKUNPK(SUnpkS16, &(suId), mBuf);
1648    
1649    switch(pst->selector)
1650    {
1651       case KWU_SEL_LWLC:
1652          {
1653             CMCHKUNPK(cmUnpkPtr,(PTR *)&staInd, mBuf);
1654          }
1655          break;
1656       case KWU_SEL_LC:
1657          {
1658             if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&staInd,\
1659                         sizeof(KwuStaIndInfo),SS_SHARABLE_MEMORY)) != ROK)
1660             {
1661 #if (ERRCLASS & ERRCLS_ADD_RES)
1662                if(ret1 != ROK)
1663                {
1664                   SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1665                         __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1666                         (ErrVal)EKWU034, (ErrVal)0, "SGetMsg() failed");
1667                }
1668 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1669                RETVALUE(ret1);
1670             }
1671
1672             cmMemset((U8 *)staInd, 0, sizeof(KwuStaIndInfo));
1673
1674             ret1 = cmUnpkKwuStaIndInfo( (staInd), mBuf);
1675 #if(ERRCLASS & ERRCLS_DEBUG)
1676             if(ret1 != ROK)
1677             {
1678                SPutMsg(mBuf);
1679                SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1680                      __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1681                      (ErrVal)EKWU035, (ErrVal)ret1, "Unpacking failure");
1682                RETVALUE( ret1 );
1683             }
1684 #endif /* ERRCLASS & ERRCLS_DEBUG */
1685          }
1686          break;
1687       default:
1688           SPutMsg(mBuf);
1689 #if(ERRCLASS & ERRCLS_DEBUG)
1690           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1691                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1692                (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
1693 #endif
1694           RETVALUE(RFAILED);
1695    }
1696    SPutMsg(mBuf);
1697
1698    RETVALUE((*func)(pst, suId, staInd));
1699 } /* cmUnpkKwuStaInd */
1700
1701 \f
1702 #ifdef ANSI
1703 PUBLIC S16 cmUnpkKwuReEstCmpInd
1704 (
1705 KwuReEstCmpInd func,
1706 Pst *pst,
1707 Buffer *mBuf
1708 )
1709 #else
1710 PUBLIC S16 cmUnpkKwuReEstCmpInd(func, pst, mBuf)
1711 KwuReEstCmpInd func;
1712 Pst *pst;
1713 Buffer *mBuf;
1714 #endif
1715 {
1716 #if(ERRCLASS & ERRCLS_DEBUG)
1717    S16 ret1;
1718 #endif
1719    SuId          suId = 0;
1720    CmLteRlcId    rlcId;
1721
1722    TRC3(cmUnpkKwuReEstCmpInd)
1723
1724    cmMemset((U8 *)&rlcId, 0, sizeof(CmLteRlcId));
1725
1726    CMCHKUNPK(SUnpkS16, &(suId), mBuf);
1727    switch(pst->selector)
1728    {
1729 #ifdef LCKWU
1730       case KWU_SEL_LC:
1731          {
1732 #if(ERRCLASS & ERRCLS_DEBUG)
1733             ret1 = cmUnpkLteRlcId( &rlcId, mBuf);
1734             if(ret1 != ROK)
1735             {
1736                SPutMsg(mBuf);
1737                SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1738                      __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1739                      (ErrVal)EKWU035, (ErrVal)ret1, "Unpacking failure");
1740                RETVALUE( ret1 );
1741             }
1742 #else
1743             cmUnpkLteRlcId( &rlcId, mBuf);
1744 #endif /* ERRCLASS & ERRCLS_DEBUG */
1745             break;
1746          }
1747 #endif /* LCKWU */
1748    }
1749    SPutMsg(mBuf);
1750
1751    RETVALUE((*func)(pst, suId, rlcId));
1752 } /* cmUnpkKwuReEstCmpInd */
1753
1754 /* kwu_c_001.main_3 added support for L2 Measurement */
1755 #ifdef ANSI
1756 PUBLIC S16 cmUnpkKwuDiscSduCfm
1757 (
1758 KwuDiscSduCfm  func,
1759 Pst            *pst,
1760 Buffer         *mBuf
1761 )
1762 #else
1763 PUBLIC S16 cmUnpkKwuDiscSduCfm(func, pst, mBuf)
1764 KwuDiscSduCfm  func;
1765 Pst            *pst;
1766 Buffer         *mBuf;
1767 #endif
1768 {
1769    S16 ret1 = ROK;
1770    SpId          spId = 0;
1771    KwuDiscSduInfo *discSdu = NULLP;
1772
1773    TRC3(cmUnpkKwuDiscSduCfm);
1774
1775    CMCHKUNPK(SUnpkS16, &(spId), mBuf);
1776
1777    switch(pst->selector)
1778    {
1779       case KWU_SEL_LWLC:
1780          {
1781             CMCHKUNPK(cmUnpkPtr,(PTR *) &discSdu, mBuf);
1782          }
1783          break;
1784       case KWU_SEL_LC:
1785          {
1786             if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&discSdu,\
1787                         sizeof(KwuDiscSduInfo),SS_SHARABLE_MEMORY)) != ROK)
1788             {
1789 #if (ERRCLASS & ERRCLS_ADD_RES)
1790       if(ret1 != ROK)
1791       {
1792          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1793                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1794                (ErrVal)ERRKWU, (ErrVal)0, "SGetMsg() failed");
1795       }
1796 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1797                RETVALUE(ret1);
1798             }
1799             cmMemset((U8 *)discSdu, 0, sizeof(KwuDiscSduInfo));
1800
1801    ret1 = cmUnpkKwuDiscSduInfo( (discSdu), mBuf);
1802 #if(ERRCLASS & ERRCLS_DEBUG)
1803             if(ret1 != ROK)
1804             {
1805                SPutMsg(mBuf);
1806                SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1807                      __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1808                      (ErrVal)ERRKWU, (ErrVal)0, "SGetMsg() failed");
1809             }
1810 #endif /* ERRCLASS & ERRCLS_DEBUG */
1811          }
1812          break;
1813       default:
1814           SPutMsg(mBuf);
1815 #if(ERRCLASS & ERRCLS_DEBUG)
1816           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1817                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1818                (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
1819 #endif
1820           RETVALUE(RFAILED);
1821    }
1822    SPutMsg(mBuf);
1823
1824    RETVALUE((*func)(pst, spId, discSdu));
1825 } /* cmUnpkKwuDiscSduCfm */
1826 #ifdef ANSI
1827 PUBLIC S16 cmUnpkKwuFlowCntrlInd
1828 (
1829 KwuFlowCntrlInd  func,
1830 Pst            *pst,
1831 Buffer         *mBuf
1832 )
1833 #else
1834 PUBLIC S16 cmUnpkKwuFlowCntrlInd(func, pst, mBuf)
1835 KwuFlowCntrlInd  func;
1836 Pst            *pst;
1837 Buffer         *mBuf;
1838 #endif
1839 {
1840    SuId   suId;
1841    KwuFlowCntrlIndInfo *flowCntrlInfo = NULLP;
1842
1843    TRC3(cmUnpkKwuFlowCntrlInd);
1844    
1845    CMCHKUNPK(SUnpkS16, &(suId), mBuf);
1846    switch(pst->selector)
1847    {
1848 #ifdef LCKWU
1849       case KWU_SEL_LC:
1850       {
1851          if(SGetStaticBuffer(pst->region, 
1852                      pst->pool, 
1853                      (Data **)&flowCntrlInfo,
1854                      sizeof(KwuFlowCntrlIndInfo),0) != ROK)
1855          {
1856             SPutMsg(mBuf);
1857             RETVALUE(RFAILED);
1858          }
1859
1860          cmUnpkKwuFlowCntrlIndInfo(flowCntrlInfo, mBuf);
1861       }
1862       break;
1863
1864       case KWU_SEL_LWLC:
1865       {
1866          CMCHKUNPK(cmUnpkPtr,(PTR *) &flowCntrlInfo, mBuf);
1867       }
1868       break;
1869 #endif
1870    }
1871
1872    SPutMsg(mBuf);
1873
1874    RETVALUE((*func)(pst, suId, flowCntrlInfo));
1875 } /* cmUnpkKwuFlowCntrlInd */
1876 #ifdef LTE_L2_MEAS
1877 \f
1878 #ifdef ANSI
1879 PUBLIC S16 cmUnpkKwuDatAckInfo
1880 (
1881 KwuDatAckInfo *param,
1882 Buffer *mBuf
1883 )
1884 #else
1885 PUBLIC S16 cmUnpkKwuDatAckInfo(param, mBuf)
1886 KwuDatAckInfo *param;
1887 Buffer *mBuf;
1888 #endif
1889 {
1890    TRC3(cmUnpkKwuDatAckInfo);
1891
1892    CMCHKUNPK(SUnpkU32, &param->sduId, mBuf);
1893    CMCHKUNPK(cmUnpkLteRlcId, &param->rlcId, mBuf);
1894
1895    RETVALUE(ROK);
1896 }
1897
1898 \f
1899 #ifdef ANSI
1900 PUBLIC S16 cmUnpkKwuDatAckInd
1901 (
1902 KwuDatAckInd func,
1903 Pst *pst,
1904 Buffer *mBuf
1905 )
1906 #else
1907 PUBLIC S16 cmUnpkKwuDatAckInd(func, pst, mBuf)
1908 KwuDatAckInd func;
1909 Pst *pst;
1910 Buffer *mBuf;
1911 #endif
1912 {
1913     S16 ret1;
1914     SuId          suId = 0;
1915     KwuDatAckInfo *datInd = NULLP;
1916     
1917     TRC3(cmUnpkKwuDatAckInd);
1918
1919     if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datInd,\
1920                 sizeof(KwuDatAckInfo),SS_SHARABLE_MEMORY)) != ROK)
1921     {
1922 #if (ERRCLASS & ERRCLS_ADD_RES)
1923        if(ret1 != ROK)
1924        {
1925           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1926                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1927                 (ErrVal)ERRKWU, (ErrVal)0, "SGetMsg() failed");
1928        }
1929 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1930        RETVALUE(ret1);
1931     }
1932
1933     cmMemset((U8 *)datInd, 0, sizeof(KwuDatAckInfo));
1934
1935     CMCHKUNPK(SUnpkS16, &(suId), mBuf);
1936     ret1 = cmUnpkKwuDatAckInfo( (datInd), mBuf);
1937 #if(ERRCLASS & ERRCLS_DEBUG)
1938     if(ret1 != ROK)
1939     {
1940        SPutMsg(mBuf);
1941        SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1942              __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1943              (ErrVal)ERRKWU, (ErrVal)ret1, "Unpacking failure");
1944        RETVALUE( ret1 );
1945     }
1946 #endif /* ERRCLASS & ERRCLS_DEBUG */
1947
1948     RETVALUE((*func)(pst, suId, datInd));
1949 } /* cmUnpkKwuDatAckInd */
1950 #endif /* LTE_L2_MEAS */
1951 #endif /* LCKWU */
1952
1953 /**********************************************************************
1954          End of file
1955  **********************************************************************/