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