RLC BO, BO response and DL Data handling. [Issue-ID: ODUHIGH-181]
[o-du/l2.git] / src / cm / lkw.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 \f
19 /********************************************************************20**
20   
21         Name:     LTE-RLC Layer 
22     
23         Type:     C source file
24   
25         Desc:     C Source code for common packing and unpacking functions
26                   for RLC Layer Manager Interfaces.  It contains the 
27                   following function definitions
28
29                      -- packRlcConfigReq
30                      -- cmPkLkwCntrlReq
31                      -- cmPkLkwCntrlCfm 
32                      -- packRlcConfigCfm
33                      -- cmPkLkwStaInd
34
35                      -- unpackRlcConfigReq 
36                      -- cmUnpkLkwCntrlReq
37                      -- cmUnpkLkwCntrlCfm
38                      -- unpackRlcConfigCfm 
39                      -- cmUnpkLkwStaInd
40  
41         File:     lkw.c
42
43 *********************************************************************21*/
44  
45 \f  
46 /* header include files (.h) */
47 #include "common_def.h"
48 #include "lkw.h"                /* Layer manager */
49
50 /* header/extern include files (.x) */
51
52 #include "lkw.x"                /* layer manager */
53
54 #ifdef LCLKW
55
56 Txt ptNmb[LKW_PART_NUM_STR_LEN];         /* Part number */
57
58 \f  
59 /* forward references */
60
61 PRIVATE S16 cmPkRlcMngmt ARGS ((RlcMngmt *param ,Event eventType, 
62                                Buffer *mBuf));
63 PRIVATE S16 cmPkRlcCfg ARGS ((RlcMngmt *param ,Elmnt elmnt, Buffer *mBuf));
64 PRIVATE S16 cmPkRlcCntrl ARGS ((RlcMngmt *cntrl, Elmnt elmnt, Buffer *mBuf));
65 PRIVATE S16 cmPkRlcUsta ARGS ((RlcMngmt *usta, Elmnt elmnt, Buffer *mBuf));
66 PRIVATE S16 cmPkRlcSsta ARGS ((RlcMngmt *ssta, Elmnt etmnt, Event eventType,
67                               Buffer *mBuf));
68 PRIVATE S16 cmPkRlcSts ARGS ((RlcMngmt *sts, Elmnt elmnt, Buffer *mBuf));
69 PRIVATE S16 cmPkGenSts ARGS ((RlcGenSts *gen, Buffer *mBuf));
70 PRIVATE S16 cmPkCkwSapSts ARGS ((RlcCkwCntSts *rcSap, Buffer *mBuf));
71 PRIVATE S16 cmPkKwuSapSts ARGS ((RlcKwuSapSts *ruSap, Buffer *mBuf));
72 /* lkw_c_001.main_2 removed support of RGU sap statistics as it is reflecting
73  * in general statstics.
74  * */
75 PRIVATE S16 cmPkRlcTrc ARGS ((RlcMngmt *trc, Buffer *mBuf));
76
77 PRIVATE S16 cmUnpkRlcMngmt ARGS ((RlcMngmt *param, Event eventType,
78                                  Buffer * mBuf));
79 PRIVATE S16 cmUnpkRlcCfg ARGS ((RlcMngmt *cfg, Elmnt elmnt, Buffer *mBuf));
80 PRIVATE S16 cmUnpkRlcCntrl ARGS ((RlcMngmt *param, Elmnt elmnt, Buffer *mBuf));
81 PRIVATE S16 cmUnpkRlcUsta ARGS ((RlcMngmt *usta, Elmnt elmnt, Buffer *mBuf));
82 PRIVATE S16 cmUnpkRlcSsta ARGS ((RlcMngmt *ssta, Elmnt elmnt, Event eventType,
83                                 Buffer *mBuf));
84 PRIVATE S16 cmUnpkRlcSts ARGS ((RlcMngmt *sts, Elmnt elmnt, Buffer *mBuf));
85 PRIVATE S16 cmUnpkGenSts ARGS ((RlcGenSts *gen, Buffer *mBuf));
86 PRIVATE S16 cmUnpkCkwSapSts ARGS ((RlcCkwCntSts *rcSap, Buffer *mBuf));
87 PRIVATE S16 cmUnpkKwuSapSts ARGS ((RlcKwuSapSts *ruSap, Buffer *mBuf));
88 /* lkw_c_001.main_2 removed support of RGU sap statistics as it is reflecting
89  * in general statstics.
90  * */
91 PRIVATE S16 cmUnpkRlcTrc ARGS ((RlcMngmt *trc, Buffer *mBuf));
92
93
94 PRIVATE S16 cmPkCkwSapSta ARGS ((RlcCkwCntSapSta *rcSap, Buffer *mBuf));
95 PRIVATE S16 cmUnpkCkwSapSta ARGS ((RlcCkwCntSapSta *rcSap, Buffer *mBuf));
96
97 PRIVATE S16 cmPkKwuSapSta ARGS ((RlcKwuSapSta *rlSap, Buffer *mBuf));
98 PRIVATE S16 cmUnpkKwuSapSta ARGS ((RlcKwuSapSta *rlSap, Buffer *mBuf));
99
100 PRIVATE S16 cmPkRguSapSta ARGS ((RlcRguSapSta *mkSap, Buffer *mBuf));
101 PRIVATE S16 cmUnpkRguSapSta ARGS ((RlcRguSapSta *mkSap, Buffer *mBuf));
102
103 /**
104  * @brief
105      Pack Config Request
106  *
107  * @param[in] pst  : post structure 
108  * @param[in] cfg  : RLC LM structure 
109  *  @return  S16
110  *      -# Success : ROK 
111  *      -# Failure : RFAILED 
112  */
113
114 #ifdef ANSI
115 S16 packRlcConfigReq
116 (
117 Pst *pst,                    /* post structure */
118 RlcMngmt *cfg                 /* RLC LM structure */
119 )
120 #else
121 S16 packRlcConfigReq(pst, cfg)
122 Pst *pst;                    /* post structure */
123 RlcMngmt *cfg;                /* RLC LM structure */
124 #endif
125 {
126    Buffer *mBuf;             /* message buffer */
127    S16 ret1;                 /* return value */
128
129    TRC3(packRlcConfigReq)
130
131    ret1 = SGetMsg(pst->region, pst->pool, &mBuf);
132    if (ret1 != ROK)
133    {
134 #if (ERRCLASS & ERRCLS_ADD_RES)
135        if(ret1 != ROK)
136        {
137           LKWLOGERROR(pst, ERRCLS_ADD_RES, ELKW001, (ErrVal) ret1,
138              "SGetMsg failed ...!\n");
139        }
140 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
141       return (ret1);
142    }
143
144    ret1 = cmPkRlcMngmt(cfg, LKW_EVT_CFG_REQ, mBuf);
145
146    if(ret1 != ROK)
147    {
148       SPutMsg(mBuf);
149 #if (ERRCLASS & ERRCLS_ADD_RES)
150        if(ret1 != ROK)
151        {
152           LKWLOGERROR(pst, ERRCLS_ADD_RES, ELKW002, (ErrVal) ret1,
153                "cmPkRlcMngmt failure ......!");
154        }
155 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
156       return RFAILED;
157    }
158
159    pst->event = (Event) LKW_EVT_CFG_REQ;   /* event */
160    SPstTsk(pst, mBuf);
161
162    return ROK;
163
164 }  /* end of packRlcConfigReq */
165
166 /**
167  * @brief
168      Unpack Config Request
169  *
170  * @param[in] func  : primitive to call
171  * @param[in] pst   : post structure
172  * @param[in] mBuf  : message buffer
173  *  @return  S16
174  *      -# Success : ROK
175  *      -# Failure : RFAILED
176  */
177  
178 #ifdef ANSI
179 uint8_t unpackRlcConfigReq
180 (
181 RlcConfigReq func,              /* primitive to call */
182 Pst *pst,                    /* post structure */
183 Buffer *mBuf                 /* message buffer */
184 )
185 #else
186 uint8_t unpackRlcConfigReq(func, pst, mBuf)
187 RlcConfigReq func;              /* primitive to call */
188 Pst *pst;                    /* post structure */
189 Buffer *mBuf;                /* message buffer */
190 #endif
191 {
192    S16 ret1;                 /* Return value */
193    RlcMngmt cfg;              /* RLC LM structure */
194
195    TRC3(unpackRlcConfigReq)
196
197    cmMemset((U8 *) &cfg, (U8) 0, (S16) sizeof(RlcMngmt));
198    ret1 = cmUnpkRlcMngmt(&cfg, LKW_EVT_CFG_REQ, mBuf);
199
200     if(ret1 != ROK)
201     {
202        SPutMsg(mBuf);
203 #if (ERRCLASS & ERRCLS_DEBUG)
204       /*MBUF_FIXX*/
205           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW003, (ErrVal) ret1,
206                "cmUnpkRlcMngmt failure ......!");
207       
208 #endif /*  ERRCLASS & ERRCLS_DEBUG  */
209        return RFAILED;
210     }
211
212    SPutMsg(mBuf);
213    (Void) (*func)(pst, &cfg);
214
215    return ROK;
216
217 } /* end of unpackRlcConfigReq */
218
219
220
221 /**
222  * @brief
223      Pack Control Request
224  *
225  * @param[in] pst  : post structure
226  * @param[in] cntrl  : RLC LM structure
227  *  @return  S16
228  *      -# Success : ROK
229  *      -# Failure : RFAILED
230  */
231
232 #ifdef ANSI
233 S16 cmPkLkwCntrlReq
234 (
235 Pst *pst,                    /* post structure */
236 RlcMngmt *cntrl               /* RLC LM structure */  
237 )
238 #else
239 S16 cmPkLkwCntrlReq(pst,cntrl)
240 Pst *pst;                    /* post structure */
241 RlcMngmt *cntrl;              /* RLC LM structure */
242 #endif
243 {
244    Buffer *mBuf;             /* message buffer */
245    S16 ret1;                 /* return value */
246
247    TRC3(cmPkLkwCntrlReq)
248
249    ret1 = SGetMsg(pst->region, pst->pool, &mBuf);
250    if (ret1 != ROK)
251    {
252 #if (ERRCLASS & ERRCLS_ADD_RES)
253        if(ret1 != ROK)
254        {
255           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW004, (ErrVal) ret1,
256                "SGetMsg failure ......!");
257        }
258 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
259       return (ret1);
260    }
261
262    ret1 = cmPkRlcMngmt(cntrl, LKW_EVT_CNTRL_REQ, mBuf);
263
264    if(ret1 != ROK)
265    {
266       SPutMsg(mBuf);
267 #if (ERRCLASS & ERRCLS_ADD_RES)
268        if(ret1 != ROK)
269        {
270           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW005, (ErrVal) ret1,
271                "cmPkRlcMngmt failure ......!");
272        }
273 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
274       return (ret1);
275    }
276
277    pst->event = (Event) LKW_EVT_CNTRL_REQ;   /* event */
278    SPstTsk(pst, mBuf);
279
280    return ROK;
281
282 }  /* end of cmPkLkwCntrlReq */
283
284 /**
285  * @brief
286      Unpack Control Request
287  *
288  * @param[in] func  : primitive to call
289  * @param[in] pst   : post structure
290  * @param[in] mBuf  : message buffer
291  *  @return  S16
292  *      -# Success : ROK
293  *      -# Failure : RFAILED
294  */
295
296 #ifdef ANSI
297 S16 cmUnpkLkwCntrlReq
298 (
299 LkwCntrlReq func,            /* primitive to call */
300 Pst *pst,                    /* post structure */
301 Buffer *mBuf                 /* message buffer */
302 )
303 #else
304 S16 cmUnpkLkwCntrlReq(func, pst, mBuf)
305 LkwCntrlReq func;            /* primitive to call */
306 Pst *pst;                    /* post structure */
307 Buffer *mBuf;                /* message buffer */
308 #endif
309 {
310    S16 ret1;                 /* return value */
311    RlcMngmt cfm;              /* Confirmation */
312
313    TRC3(cmUnpkLkwCntrlReq)
314
315    ret1 = cmUnpkRlcMngmt(&cfm, LKW_EVT_CNTRL_REQ, mBuf);
316
317     if(ret1 != ROK)
318     {
319        SPutMsg(mBuf);
320 #if (ERRCLASS & ERRCLS_DEBUG)
321       /*MBUF_FIXX*/
322           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW006, (ErrVal) ret1,
323                "cmUnpkRlcMngmt failure ......!");
324      
325 #endif /*  ERRCLASS & ERRCLS_DEBUG  */
326        return RFAILED;
327     }
328
329    SPutMsg(mBuf);
330    return ((*func)(pst, &cfm));
331
332 } /* end of cmUnpkLkwCntrlReq */
333
334 /**
335  * @brief
336      Pack Control Confirm
337  *
338  * @param[in] pst  : post structure
339  * @param[in] cfg  : RLC LM structure
340  *  @return  S16
341  *      -# Success : ROK
342  *      -# Failure : RFAILED
343  */
344
345 #ifdef ANSI
346 uint8_t cmPkLkwCntrlCfm
347 (
348 Pst *pst,                    /* post structure */
349 RlcMngmt *cfm                 /* RLC LM structure */
350 )
351 #else
352 uint8_t cmPkLkwCntrlCfm(pst, cfm)
353 Pst *pst;                    /* post structure */
354 RlcMngmt *cfm;                /* RLC LM structure */
355 #endif
356 {
357    Buffer *mBuf;             /* message buffer */
358    S16 ret1;                 /* return value */
359
360    TRC3(cmPkLkwCntrlCfm)
361
362    ret1 = SGetMsg(pst->region, pst->pool, &mBuf);
363    if (ret1 != ROK)
364    {
365 #if (ERRCLASS & ERRCLS_ADD_RES)
366        if(ret1 != ROK)
367        {
368           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW007, (ErrVal) ret1,
369                "SGetMsg failure ......!");
370        }
371 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
372       return (ret1);
373    }
374
375    ret1 = cmPkRlcMngmt(cfm, LKW_EVT_CNTRL_CFM, mBuf);
376
377    if(ret1 != ROK)
378    {
379       SPutMsg(mBuf);
380 #if (ERRCLASS & ERRCLS_ADD_RES)
381        if(ret1 != ROK)
382        {
383           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW008, (ErrVal) ret1,
384                "Packing failure ......!");
385        }
386 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
387       return RFAILED;
388    }
389
390    pst->event = (Event) LKW_EVT_CNTRL_CFM;   /* event */
391    SPstTsk(pst, mBuf);
392
393    return ROK;
394
395 }  /* end of cmPkLkwCntrlCfm */
396
397
398 /**
399  * @brief
400      Unpack Control confirm
401  *
402  * @param[in] func  : primitive to call
403  * @param[in] pst   : post structure
404  * @param[in] mBuf  : message buffer
405  *  @return  S16
406  *      -# Success : ROK
407  *      -# Failure : RFAILED
408  */
409
410 #ifdef ANSI
411 S16 cmUnpkLkwCntrlCfm
412 (
413 LkwCntrlCfm func,            /* primitive to call */
414 Pst *pst,                    /* post structure */
415 Buffer *mBuf                 /* message buffer */
416 )
417 #else
418 S16 cmUnpkLkwCntrlCfm(func, pst, mBuf)
419 LkwCntrlCfm func;            /* primitive to call */
420 Pst *pst;                    /* post structure */
421 Buffer *mBuf;                /* message buffer */
422 #endif
423 {
424    RlcMngmt cfm;              /* RLC LM structure */
425    S16 ret1;                 /* return value */
426
427    TRC3(cmUnpkLkwCntrlCfm)
428
429    ret1 = cmUnpkRlcMngmt(&cfm, LKW_EVT_CNTRL_CFM, mBuf);
430
431    if(ret1 != ROK)
432    {
433       SPutMsg(mBuf);
434 #if (ERRCLASS & ERRCLS_DEBUG)
435        if(ret1 != ROK)
436        {
437           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW009, (ErrVal) ret1,
438                "cmUnpkRlcMngmt failure ......!");
439        }
440 #endif /*  ERRCLASS & ERRCLS_DEBUG  */
441       return RFAILED;
442    }
443       
444    SPutMsg(mBuf); 
445
446    return ((*func)(pst, &cfm));
447
448 } /* end of cmUnpkLkwCntrlCfm */
449
450 /**
451  * @brief
452      Unpack statistics Confirm
453  *
454  * @param[in] func  : primitive to call
455  * @param[in] pst   : post structure
456  * @param[in] mBuf  : message buffer
457  *  @return  S16
458  *      -# Success : ROK
459  *      -# Failure : RFAILED
460  */
461 #ifdef ANSI
462 S16 cmUnpkLkwStsCfm
463 (
464 LkwStsCfm func,              /* primitive to call */
465 Pst *pst,                    /* post structure */
466 Buffer *mBuf                 /* message buffer */
467 )
468 #else
469 S16 cmUnpkLkwStsCfm(func, pst, mBuf)
470 LkwStsCfm func;              /* primitive to call */
471 Pst *pst;                    /* post structure */
472 Buffer *mBuf;                /* message buffer */
473 #endif
474 {
475    RlcMngmt cfm;              /* RLC LM structure */
476    S16 ret1;                 /* return value */
477
478    TRC3(cmUnpkLkwStsCfm)
479
480    ret1 = cmUnpkRlcMngmt(&cfm, LKW_EVT_STS_CFM, mBuf);
481
482    if(ret1 != ROK)
483    {
484       SPutMsg(mBuf);
485 #if (ERRCLASS & ERRCLS_DEBUG)
486        if(ret1 != ROK)
487        {
488           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW010, (ErrVal) ret1,
489                "SPutMsg failure ......!");
490        }
491 #endif /*  ERRCLASS & ERRCLS_DEBUG  */
492       return RFAILED;
493    }
494      
495    SPutMsg(mBuf);
496
497    return ((*func)(pst, 0, &cfm));
498
499 } /* end of cmUnpkLkwStsCfm */
500
501 /**
502  * @brief
503      Pack Config Confirm 
504  *
505  * @param[in] pst  : post structure
506  * @param[in] cfg  : RLC LM structure
507  *  @return  S16
508  *      -# Success : ROK
509  *      -# Failure : RFAILED
510  */
511
512
513 #ifdef ANSI
514 uint8_t packRlcConfigCfm
515 (
516 Pst *pst,                    /* post structure */
517 RlcMngmt *cfm                 /* RLC LM structure */
518 )
519 #else
520 uint8_t packRlcConfigCfm(pst,cfm)
521 Pst *pst;                    /* post structure */
522 RlcMngmt *cfm;                /* RLC LM structure */
523 #endif
524 {
525    Buffer *mBuf;             /* message buffer */
526    S16 ret1;                 /* return value */
527
528    TRC3(packRlcConfigCfm)
529
530    ret1 = SGetMsg(pst->region, pst->pool, &mBuf);
531    if (ret1 != ROK)
532    {
533 #if (ERRCLASS & ERRCLS_ADD_RES)
534        if(ret1 != ROK)
535        {
536           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW011, (ErrVal) ret1,
537                "SGetMsg failure ......!");
538        }
539 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
540       return (ret1);
541    }
542
543    ret1 = cmPkRlcMngmt(cfm, LKW_EVT_CFG_CFM, mBuf);
544
545    if(ret1 != ROK)
546    {
547       SPutMsg(mBuf);
548 #if (ERRCLASS & ERRCLS_ADD_RES)
549        if(ret1 != ROK)
550        {
551           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW012, (ErrVal) ret1,
552                "SPutMsg failure ......!");
553        }
554 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
555       return RFAILED;
556    }
557
558    pst->event = (Event) LKW_EVT_CFG_CFM;   /* event */
559    SPstTsk(pst, mBuf);
560
561    return ROK;
562
563 }  /* end of packRlcConfigCfm */
564
565
566 /**
567  * @brief
568      Unpack Config Confirm 
569  *
570  * @param[in] func  : primitive to call
571  * @param[in] pst   : post structure
572  * @param[in] mBuf  : message buffer
573  *  @return  S16
574  *      -# Success : ROK
575  *      -# Failure : RFAILED
576  */
577 #ifdef ANSI
578 uint8_t unpackRlcConfigCfm
579 (
580 RlcConfigCfm func,              /* primitive to call */
581 Pst *pst,                    /* post structure */
582 Buffer *mBuf                 /* message buffer */
583 )
584 #else
585 uint8_t unpackRlcConfigCfm(func, pst, mBuf)
586 RlcConfigCfm func;              /* primitive to call */
587 Pst *pst;                    /* post structure */
588 Buffer *mBuf;                /* message buffer */
589 #endif
590 {
591    S16 ret1;                 /* return value */
592    RlcMngmt cfm;              /* RLC LM structure */
593
594    TRC3(unpackRlcConfigCfm)
595
596    ret1 = cmUnpkRlcMngmt(&cfm, LKW_EVT_CFG_CFM, mBuf);
597
598    if(ret1 != ROK)
599    {
600       SPutMsg(mBuf);
601 #if (ERRCLASS & ERRCLS_DEBUG)
602        if(ret1 != ROK)
603        {
604           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW013, (ErrVal) ret1,
605                "SPutMsg failure ......!");
606        }
607 #endif /*  ERRCLASS & ERRCLS_DEBUG  */
608       return RFAILED;
609    }
610
611    SPutMsg(mBuf);
612    return ((*func)(pst, &cfm));
613
614 } /* end of unpackRlcConfigCfm */
615
616
617
618 /**
619  * @brief
620      Pack Status Indication 
621  *
622  * @param[in] pst  : post structure
623  * @param[in] usta  : RLC LM structure
624  *  @return  S16
625  *      -# Success : ROK
626  *      -# Failure : RFAILED
627  */
628
629 #ifdef ANSI
630 S16 cmPkLkwStaInd
631 (
632 Pst *pst,                    /* post structure */
633 RlcMngmt *usta                /* RLC LM structure */
634 )
635 #else
636 S16 cmPkLkwStaInd(pst,usta)
637 Pst *pst;                    /* post structure */
638 RlcMngmt *usta;               /* RLC LM structure */
639 #endif
640 {
641    Buffer *mBuf;             /* message buffer */
642    S16 ret1;                 /* return value */
643
644    TRC3(cmPkLkwStaInd)
645
646    ret1 = SGetMsg(pst->region, pst->pool, &mBuf);
647    if (ret1 != ROK)
648    {
649 #if (ERRCLASS & ERRCLS_ADD_RES)
650        if(ret1 != ROK)
651        {
652           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW014, (ErrVal) ret1,
653                "SGetMsg() failed");
654        }
655 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
656       return (ret1);
657    }
658
659    ret1 = cmPkRlcMngmt(usta, LKW_EVT_STA_IND, mBuf);
660
661    if(ret1 != ROK)
662    {
663       SPutMsg(mBuf);
664 #if (ERRCLASS & ERRCLS_ADD_RES)
665        if(ret1 != ROK)
666        {
667           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW015, (ErrVal) ret1,
668                "cmPkRlcMngmt failure ......!");
669        }
670 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
671       return (ret1);
672    }
673
674    pst->event = (Event) LKW_EVT_STA_IND;   /* event */
675    SPstTsk(pst, mBuf);
676
677    return ROK;
678
679 }  /* end of cmPkLkwStaInd */
680
681
682 /**
683  * @brief
684      Unpack Unsolicited Status indication 
685  *
686  * @param[in] func  : primitive to call
687  * @param[in] pst   : post structure
688  * @param[in] mBuf  : message buffer
689  *  @return  S16
690  *      -# Success : ROK
691  *      -# Failure : RFAILED
692  */
693
694 #ifdef ANSI
695 S16 cmUnpkLkwStaInd
696 (
697 LkwStaInd func,             /* primitive pointer */
698 Pst *pst,                   /* post structure */
699 Buffer *mBuf                /* message buffer */
700 )
701 #else
702 S16 cmUnpkLkwStaInd(func, pst, mBuf)
703 LkwStaInd func;             /* primitive pointer */
704 Pst *pst;                   /* post structure */
705 Buffer *mBuf;               /* message buffer */
706 #endif
707 {
708    RlcMngmt usta;            /* RLC LM structure */
709    S16 ret1;                /* return value */
710
711    TRC3(cmUnpkLkwStaInd)
712    
713    ret1 = cmUnpkRlcMngmt(&usta, LKW_EVT_STA_IND, mBuf);
714
715    if(ret1 != ROK)
716    {
717       SPutMsg(mBuf);
718 #if (ERRCLASS & ERRCLS_DEBUG)
719        if(ret1 != ROK)
720        {
721           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW016, (ErrVal) ret1,
722                "cmUnpkRlcMngmt failure ......!");
723        }
724 #endif /*  ERRCLASS & ERRCLS_DEBUG  */
725       return RFAILED;
726    }
727
728    SPutMsg(mBuf);
729
730    return ((*func)(pst, &usta));
731 } /* end of cmUnpkLsnStaInd */
732
733 /**
734  * @brief
735      Pack Status Request
736  *
737  * @param[in] pst  : post structure
738  * @param[in] sta : RLC LM structure
739  *  @return  S16
740  *      -# Success : ROK
741  *      -# Failure : RFAILED
742  */
743
744 #ifdef ANSI
745 S16 cmPkLkwStaReq
746 (
747 Pst *pst,                    /* post structure */
748 RlcMngmt *sta                 /* status */
749 )
750 #else
751 S16 cmPkLkwStaReq(pst,sta)
752 Pst *pst;                    /* post structure */
753 RlcMngmt *sta;                /* status */
754 #endif
755 {
756    Buffer *mBuf;             /* message buffer */
757    S16 ret1;                 /* return value */
758
759    TRC3(cmPkLkwStaReq)
760
761    ret1 = SGetMsg(pst->region, pst->pool, &mBuf);
762    if (ret1 != ROK)
763    {
764 #if (ERRCLASS & ERRCLS_ADD_RES)
765        if(ret1 != ROK)
766        {
767           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW017, (ErrVal) ret1,
768                "SGetMsg failure ......!");
769        }
770 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
771       return RFAILED;
772    }
773  
774    ret1 = cmPkRlcMngmt(sta, LKW_EVT_STA_REQ, mBuf);
775
776    if(ret1 != ROK)
777    {
778       SPutMsg(mBuf);
779 #if (ERRCLASS & ERRCLS_ADD_RES)
780        if(ret1 != ROK)
781        {
782           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW018, (ErrVal) ret1,
783                "SGetMsg() failure ......!");
784        }
785 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
786       return RFAILED;
787    }
788
789    pst->event = (Event) LKW_EVT_STA_REQ;   /* event */
790    SPstTsk(pst, mBuf);
791
792    return ROK;
793
794 }  /* end of cmPkLkwStaReq */
795
796 /**
797  * @brief
798      Unpack status confirmation 
799  *
800  * @param[in] func  : primitive to call
801  * @param[in] pst   : post structure
802  * @param[in] mBuf  : message buffer
803  *  @return  S16
804  *      -# Success : ROK
805  *      -# Failure : RFAILED
806  */
807 #ifdef ANSI
808 S16 cmUnpkLkwStaCfm
809 (
810 LkwStaReq func,              /* primitive pointer */
811 Pst *pst,                    /* post structure */
812 Buffer *mBuf                 /* message buffer */
813 )
814 #else
815 S16 cmUnpkLkwStaCfm(func, pst, mBuf)
816 LkwStaReq func;              /* primitive pointer */
817 Pst *pst;                    /* post structure */
818 Buffer *mBuf;                /* message buffer */
819 #endif
820 {
821    RlcMngmt cfm;              /* RLC LM structure */
822    S16 ret1;                 /* return value */
823
824    TRC3(cmUnpkLkwStaReq)
825
826    ret1 = cmUnpkRlcMngmt(&cfm, LKW_EVT_STA_CFM, mBuf);
827
828     if(ret1 != ROK)
829     {
830        SPutMsg(mBuf);
831 #if (ERRCLASS & ERRCLS_DEBUG)
832        if(ret1 != ROK)
833        {
834           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW019, (ErrVal) ret1,
835                "Unpacking failure ......!");
836        }
837 #endif /*  ERRCLASS & ERRCLS_DEBUG  */
838        return RFAILED;
839     }
840
841    SPutMsg(mBuf);
842   
843    return ((*func)(pst, &cfm));
844
845 } /* end of function cmUnpkLkwStaCfm */
846
847 /**
848  * @brief
849      Unpack Status request 
850  *
851  * @param[in] func  : primitive to call
852  * @param[in] pst   : post structure
853  * @param[in] mBuf  : message buffer
854  *  @return  S16
855  *      -# Success : ROK
856  *      -# Failure : RFAILED
857  */
858 #ifdef ANSI
859 S16 cmUnpkLkwStsReq
860 (
861 LkwStsReq func,              /* primitive pointer */
862 Pst *pst,                    /* post structure */
863 Buffer *mBuf                 /* message buffer */
864 )
865 #else
866 S16 cmUnpkLkwStsReq(func, pst, mBuf)
867 LkwStsReq func;              /* primitive pointer */
868 Pst *pst;                    /* post structure */
869 Buffer *mBuf;                /* message buffer */
870 #endif
871 {
872    RlcMngmt sts;              /* RLC LM structure */
873    S16 ret1;                 /* return value */
874    Action action;            /* Action */
875
876    TRC3(cmUnpkLkwStsReq)
877
878    CMCHKUNPK(SUnpkS16, &action, mBuf);
879
880    ret1 = cmUnpkRlcMngmt(&sts, LKW_EVT_STS_REQ, mBuf);
881
882     if(ret1 != ROK)
883     {
884        SPutMsg(mBuf);
885 #if (ERRCLASS & ERRCLS_DEBUG)
886        /*MBUF_FIXX*/
887           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW020, (ErrVal) ret1,
888                "Unpacking failure ......!");
889       
890 #endif /*  ERRCLASS & ERRCLS_DEBUG  */
891        return RFAILED;
892     }
893
894    SPutMsg(mBuf);
895
896    return ((*func)(pst, action, &sts));
897
898 } /* end of function cmUnpkLkwStsReq */
899
900
901 /**
902  * @brief
903      Unpack ssta 
904  *
905  * @param[in] func  : primitive to call
906  * @param[in] pst   : post structure
907  * @param[in] mBuf  : message buffer
908  *  @return  S16
909  *      -# Success : ROK
910  *      -# Failure : RFAILED
911  */
912 #ifdef ANSI
913 S16 cmUnpkLkwStaReq
914 (
915 LkwStaReq func,              /* primitive pointer */
916 Pst *pst,                    /* post structure */
917 Buffer *mBuf                 /* message buffer */
918 )
919 #else
920 S16 cmUnpkLkwStaReq(func, pst, mBuf)
921 LkwStaReq func;              /* primitive pointer */
922 Pst *pst;                    /* post structure */
923 Buffer *mBuf;                /* message buffer */
924 #endif
925 {
926    RlcMngmt sta;              /* RLC LM structure */
927    S16 ret1;                 /* return value */
928
929    TRC3(cmUnpkLkwStaReq)
930
931    ret1 = cmUnpkRlcMngmt(&sta, LKW_EVT_STA_REQ, mBuf);
932
933     if(ret1 != ROK)
934     {
935        SPutMsg(mBuf);
936 #if (ERRCLASS & ERRCLS_DEBUG)
937       /*MBUF_FIXX*/
938           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW021, (ErrVal) ret1,
939                "Unpacking failure ......!");
940       
941 #endif /*  ERRCLASS & ERRCLS_DEBUG  */
942        return RFAILED;
943     }
944
945    SPutMsg(mBuf);
946
947    return ((*func)(pst, &sta));
948
949 } /* end of function cmUnpkLkwStaReq */
950
951
952 /**
953  * @brief
954      Unpack Trace Indication 
955  *
956  * @param[in] func  : primitive to call
957  * @param[in] pst   : post structure
958  * @param[in] mBuf  : message buffer
959  *  @return  S16
960  *      -# Success : ROK
961  *      -# Failure : RFAILED
962  */
963
964 #ifdef ANSI
965 S16 cmUnpkLkwTrcInd
966 (
967 LkwTrcInd func,              /* primitive to call */
968 Pst *pst,                    /* post structure */
969 Buffer *mBuf                 /* message buffer */
970 )
971 #else
972 S16 cmUnpkLkwTrcInd(func, pst, mBuf)
973 LkwTrcInd func;              /* primitive to call */
974 Pst *pst;                    /* post structure */
975 Buffer *mBuf;                /* message buffer */
976 #endif
977 {
978    S16 ret1;                 /* return value */
979    RlcMngmt trc;              /* RLC LM structure */
980
981    TRC3(cmUnpkLkwTrcInd)
982
983    ret1 = cmUnpkRlcMngmt(&trc, LKW_EVT_TRC_IND, mBuf);
984
985     if(ret1 != ROK)
986     {
987        SPutMsg(mBuf);
988 #if (ERRCLASS & ERRCLS_DEBUG)
989        if(ret1 != ROK)
990        {
991           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW022, (ErrVal) ret1,
992                "Unpacking failure ......!");
993        }
994 #endif /*  ERRCLASS & ERRCLS_DEBUG  */
995        return RFAILED;
996     }
997
998    (Void) (*func)(pst, &trc, mBuf);
999
1000    return ROK;
1001
1002 } /* end of cmUnpkLkwTrcInd */
1003
1004
1005 /**
1006  * @brief
1007      Pack Config Request
1008  *
1009  * @param[in] pst  : post structure
1010  * @param[in] cfg  : RLC LM structure
1011  *  @return  S16
1012  *      -# Success : ROK
1013  *      -# Failure : RFAILED
1014  */
1015
1016 #ifdef ANSI
1017 PRIVATE S16 cmPkCkwSapSta 
1018
1019 RlcCkwCntSapSta *rcSap,         /* SAP statistics */      
1020 Buffer *mBuf                 /* Message buffer */
1021 )
1022 #else
1023 PRIVATE S16 cmPkCkwSapSta(rcSap, mBuf)
1024 RlcCkwCntSapSta *rcSap;         /* SAP statistics */
1025 Buffer *mBuf;                /* Message buffer */
1026 #endif
1027 {
1028    TRC3(cmPkCkwSapSta)
1029
1030    CMCHKPK(cmPkState, rcSap->state, mBuf);
1031    CMCHKPK(SPkS16, rcSap->spId, mBuf);   
1032
1033    return ROK;
1034
1035 } /* end of cmPkCkwSapSta */
1036
1037 /**
1038  * @brief
1039      Unpack CKW sap Sta 
1040  *
1041  * @param[out] rcSap: RLC LM structure 
1042  * @param[in] buffer: Buffer
1043  *  @return  S16
1044  *      -# Success : ROK
1045  *      -# Failure : RFAILED
1046  */
1047 #ifdef ANSI
1048 PRIVATE S16 cmUnpkCkwSapSta 
1049 (
1050 RlcCkwCntSapSta *rcSap,         /* SAP statistics */ 
1051 Buffer *mBuf                 /* Message buffer */
1052 )
1053 #else
1054 PRIVATE S16 cmUnpkCkwSapSta(rcSap, mBuf)
1055 RlcCkwCntSapSta *rcSap;         /* SAP statistics */ 
1056 Buffer *mBuf;                /* Message buffer */
1057 #endif
1058 {
1059    TRC3(cmUnpkCkwSapSta)
1060
1061    CMCHKUNPK(SUnpkS16, &rcSap->spId, mBuf);
1062    CMCHKUNPK(cmUnpkState, &rcSap->state, mBuf);
1063   
1064    return ROK;
1065 } /* end of function cmUnpkCkwSapSta */
1066
1067 /**
1068  * @brief
1069      Pack Config Request
1070  *
1071  * @param[in] pst  : post structure
1072  * @param[in] cfg  : RLC LM structure
1073  *  @return  S16
1074  *      -# Success : ROK
1075  *      -# Failure : RFAILED
1076  */
1077 #ifdef ANSI
1078 PRIVATE S16 cmPkKwuSapSta
1079 (
1080 RlcKwuSapSta *rlSap,           /* SAP statistics */       
1081 Buffer *mBuf                 /* Message buffer */
1082 )
1083 #else
1084 PRIVATE S16 cmPkKwuSapSta(rlSap, mBuf)
1085 RlcKwuSapSta *rlSap;           /* SAP statistics */
1086 Buffer *mBuf;                /* Message buffer */
1087 #endif
1088 {
1089    TRC3(cmPkKwuSapSta)
1090
1091    CMCHKPK(cmPkState, rlSap->state, mBuf);
1092    CMCHKPK(SPkS16, rlSap->spId, mBuf);
1093
1094    return ROK;
1095
1096 } /* end of cmPkKwuSapSta */
1097
1098 /**
1099  * @brief
1100      Unpack Kwu Sap Sta 
1101  *
1102  * @param[out] rlSap  : KwRLSapSta structure 
1103  * @param[in] mBuf  : message buffer
1104  *  @return  S16
1105  *      -# Success : ROK
1106  *      -# Failure : RFAILED
1107  */
1108 #ifdef ANSI
1109 PRIVATE S16 cmUnpkKwuSapSta
1110 (
1111 RlcKwuSapSta *rlSap,           /* SAP statistics */                   
1112 Buffer *mBuf                 /* Message buffer */
1113 )
1114 #else
1115 PRIVATE S16 cmUnpkKwuSapSta(rlSap, mBuf)
1116 RlcKwuSapSta *rlSap;           /* SAP statistics */
1117 Buffer *mBuf;                /* Message buffer */
1118 #endif
1119 {
1120    TRC3(cmUnpkKwuSapSta)
1121
1122    CMCHKUNPK(SUnpkS16, &rlSap->spId, mBuf);
1123    CMCHKUNPK(cmUnpkState, &rlSap->state, mBuf);
1124
1125    return ROK;
1126  
1127 } /* end of function cmUnpkKwuSapSta */
1128
1129 /**
1130  * @brief
1131      Pack 
1132  *
1133  * @param[in] pst  : post structure
1134  * @param[in] cfg  : RLC LM structure
1135  *  @return  S16
1136  *      -# Success : ROK
1137  *      -# Failure : RFAILED
1138  */
1139 #ifdef ANSI
1140 PRIVATE S16 cmPkRguSapSta
1141 (
1142 RlcRguSapSta *mkSap,           /* SAP statistics */             
1143 Buffer *mBuf                 /* Message buffer */
1144 )
1145 #else
1146 PRIVATE S16 cmPkRguSapSta(mkSap, mBuf)
1147 RlcRguSapSta *mkSap;           /* SAP statistics */
1148 Buffer *mBuf;                /* Message buffer */
1149 #endif
1150 {
1151    TRC3(cmPkRguSapSta)
1152
1153    CMCHKPK(cmPkState, mkSap->state, mBuf);
1154    CMCHKPK(cmPkSuId, mkSap->suId, mBuf);
1155
1156    return ROK;
1157
1158 } /* end of cmPkRguSapSta */
1159
1160 /**
1161  * @brief
1162      Unpack Rgu Sap Sta 
1163  *
1164  * @param[out] mkSap: RlcRguSapSta structure 
1165  * @param[in] mBuf  : message buffer
1166  *  @return  S16
1167  *      -# Success : ROK
1168  *      -# Failure : RFAILED
1169  */
1170 #ifdef ANSI
1171 PRIVATE S16 cmUnpkRguSapSta
1172 (
1173 RlcRguSapSta *mkSap,           /* SAP statistics */              
1174 Buffer *mBuf                 /* Message buffer */
1175 )
1176 #else
1177 PRIVATE S16 cmUnpkRguSapSta(mkSap, mBuf)
1178 RlcRguSapSta *mkSap;           /* SAP statistics */
1179 Buffer *mBuf;                /* Message buffer */
1180 #endif
1181 {
1182    TRC3(cmUnpkRguSapSta)
1183
1184    CMCHKUNPK(cmUnpkSuId, &mkSap->suId, mBuf);
1185    CMCHKUNPK(cmUnpkState, &mkSap->state, mBuf);
1186
1187    return ROK;
1188
1189 } /* end of function cmUnpkRguSapSta */
1190
1191 /**
1192  * @brief
1193      Pack 
1194  *
1195  * @param[in] pst  : post structure
1196  * @param[in] cfg  : RLC LM structure
1197  *  @return  S16
1198  *      -# Success : ROK
1199  *      -# Failure : RFAILED
1200  */
1201 #ifdef ANSI
1202 S16 cmPkLkwStaCfm
1203 (
1204 Pst *pst,                    /* post structure */
1205 RlcMngmt *cfm                 /* solicited status confirm */
1206 )
1207 #else
1208 S16 cmPkLkwStaCfm(pst, cfm)
1209 Pst *pst;                    /* post structure */
1210 RlcMngmt *cfm;                /* solicited status confirm */
1211 #endif
1212 {
1213    Buffer *mBuf;             /* message buffer */
1214    S16 ret1;                 /* return value */
1215
1216    TRC3(cmPkLkwStaCfm);
1217
1218    ret1 = SGetMsg(pst->region, pst->pool, &mBuf);
1219    if (ret1 != ROK)
1220    {
1221 #if (ERRCLASS & ERRCLS_ADD_RES)
1222        if(ret1 != ROK)
1223        {
1224           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW023, (ErrVal) ret1,
1225                "SGetMsg() failure ......!");
1226        }
1227 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1228       return RFAILED;
1229    }
1230
1231    ret1 = cmPkRlcMngmt(cfm, LKW_EVT_STA_CFM, mBuf);
1232
1233    if(ret1 != ROK)
1234    {
1235       SPutMsg(mBuf);
1236 #if (ERRCLASS & ERRCLS_ADD_RES)
1237        if(ret1 != ROK)
1238        {
1239           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW024, (ErrVal) ret1,
1240                "packing failure ......!");
1241        }
1242 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1243       return RFAILED;
1244    }
1245
1246    pst->event = (Event) LKW_EVT_STA_CFM;   /* event */
1247    SPstTsk(pst, mBuf);
1248
1249    return ROK;
1250 } /* end of cmPkLkwStaCfm */
1251
1252
1253 /**
1254  * @brief
1255      Pack 
1256  *
1257  * @param[in] pst  : post structure
1258  * @param[in] cfg  : RLC LM structure
1259  *  @return  S16
1260  *      -# Success : ROK
1261  *      -# Failure : RFAILED
1262  */
1263 #ifdef ANSI
1264 S16 cmPkLkwTrcInd
1265 (
1266 Pst *pst,                    /* post structure */
1267 RlcMngmt *trc,                /* trace */
1268 Buffer *trcBuf                 /* trace buffer */
1269 )
1270 #else
1271 S16 cmPkLkwTrcInd(pst, trc, trcBuf)
1272 Pst *pst;                     /* post structure */
1273 RlcMngmt *trc;                 /* trace */
1274 Buffer *trcBuf;               /* trace buffer */
1275 #endif
1276 {
1277    S16      ret1 = ROK;       /* return value */
1278    Buffer   *mBuf = NULLP;    /* Buffer to trace */
1279
1280    TRC3(cmPkLkwTrcInd);
1281
1282    ret1 = SGetMsg(pst->region, pst->pool, &mBuf);
1283    if (ret1 != ROK)
1284    {
1285 #if (ERRCLASS & ERRCLS_ADD_RES)
1286       if(ret1 != ROK)
1287       {
1288          LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW025, (ErrVal) ret1,
1289                "SGetMsg() failure ......!");
1290       }
1291 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1292       return RFAILED;
1293    }
1294
1295    if (trcBuf)
1296    {
1297       ret1 = SCatMsg(mBuf, trcBuf, M1M2);
1298       if (ret1 != ROK)
1299       {
1300          SPutMsg(mBuf);
1301          SPutMsg(trcBuf);
1302 #if (ERRCLASS & ERRCLS_ADD_RES)
1303          if(ret1 != ROK)
1304          {
1305             LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW026, (ErrVal) ret1,
1306                   "SGetMsg() failure ......!");
1307          }
1308 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1309          return RFAILED;
1310       }
1311
1312       SPutMsg(trcBuf);
1313    }
1314
1315    ret1 = cmPkRlcMngmt(trc, LKW_EVT_TRC_IND, mBuf);
1316
1317    if(ret1 != ROK)
1318    {
1319       SPutMsg(mBuf);
1320 #if (ERRCLASS & ERRCLS_ADD_RES)
1321       if(ret1 != ROK)
1322       {
1323          LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW027, (ErrVal) ret1,
1324                "packing failure ......!");
1325       }
1326 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1327       /* log error */
1328       return RFAILED;
1329    }
1330
1331    pst->event = (Event) LKW_EVT_TRC_IND;   /* event */
1332    SPstTsk(pst, mBuf);
1333
1334    return ROK;
1335
1336 } /* end of cmPkLkwTrcInd */
1337
1338
1339 /**
1340  * @brief
1341      Pack 
1342  *
1343  * @param[in] pst  : post structure
1344  * @param[in] cfg  : RLC LM structure
1345  *  @return  S16
1346  *      -# Success : ROK
1347  *      -# Failure : RFAILED
1348  */
1349 #ifdef ANSI
1350 S16 cmPkLkwStsReq
1351 (
1352 Pst *pst,                    /* post structure */
1353 Action action,               /* action */
1354 RlcMngmt *sts                 /* statistics request */
1355 )
1356 #else
1357 S16 cmPkLkwStsReq(pst, action, sts)
1358 Pst *pst;                    /* post structure */
1359 Action action;               /* action */
1360 RlcMngmt *sts;                /* statistics request */
1361 #endif
1362 {
1363
1364    Buffer *mBuf;             /* message buffer */
1365    S16 ret1;                 /* return value */
1366
1367    TRC3(cmPkLkwStsReq)
1368
1369    ret1 = SGetMsg(pst->region, pst->pool, &mBuf);
1370    if (ret1 != ROK)
1371    {
1372 #if (ERRCLASS & ERRCLS_ADD_RES)
1373        if(ret1 != ROK)
1374        {
1375           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW028, (ErrVal) ret1,
1376                "SGetMsg() failure ......!");
1377        }
1378 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1379       return RFAILED;
1380    }
1381
1382    ret1 = cmPkRlcMngmt(sts, LKW_EVT_STS_REQ, mBuf);
1383
1384    if(ret1 != ROK)
1385    {
1386       SPutMsg(mBuf);
1387 #if (ERRCLASS & ERRCLS_ADD_RES)
1388        if(ret1 != ROK)
1389        {
1390           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW029, (ErrVal) ret1,
1391                "Packing failure ......!");
1392        }
1393 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1394       return RFAILED;
1395    }
1396
1397    CMCHKPK(SPkS16, action, mBuf); 
1398    pst->event = (Event) LKW_EVT_STS_REQ;   /* event */
1399    SPstTsk(pst, mBuf);
1400
1401    return ROK;
1402
1403 } /* end of cmPkLkwStsReq */
1404
1405
1406 /**
1407  * @brief
1408      Pack 
1409  *
1410  * @param[in] pst  : post structure
1411  * @param[in] cfg  : RLC LM structure
1412  *  @return  S16
1413  *      -# Success : ROK
1414  *      -# Failure : RFAILED
1415  */
1416 #ifdef ANSI
1417 S16 cmPkLkwStsCfm
1418 (
1419 Pst *pst,                    /* post structure */
1420 Action action,               /* action */
1421 RlcMngmt *cfm                 /* statistics confirmation */
1422 )
1423 #else
1424 S16 cmPkLkwStsCfm(pst, action, cfm)
1425 Pst *pst;                    /* post structure */
1426 Action action;               /* action */
1427 RlcMngmt *cfm;                /* statistics confirmation */
1428 #endif
1429 {
1430    Buffer *mBuf;             /* message buffer */
1431    S16 ret1;                 /* return value */
1432
1433    TRC3(cmPkLkwStsCfm);
1434    /* lkw_c_001.main_2 removed warning */
1435    UNUSED(action);
1436    ret1 = SGetMsg(pst->region, pst->pool, &mBuf);
1437    if (ret1 != ROK)
1438    {
1439 #if (ERRCLASS & ERRCLS_ADD_RES)
1440        if(ret1 != ROK)
1441        {
1442           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW030, (ErrVal) ret1,
1443                "SGetMsg() failure ......!");
1444        }
1445 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1446       return RFAILED;
1447    }
1448
1449    ret1 = cmPkRlcMngmt(cfm, LKW_EVT_STS_CFM, mBuf);
1450
1451    if(ret1 != ROK)
1452    {
1453       SPutMsg(mBuf);
1454 #if (ERRCLASS & ERRCLS_ADD_RES)
1455        if(ret1 != ROK)
1456        {
1457           LKWLOGERROR(pst, ERRCLS_INT_PAR, ELKW031, (ErrVal) ret1,
1458                "Packing  failure ......!");
1459        }
1460 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
1461       return RFAILED;
1462    }
1463
1464    pst->event = (Event) LKW_EVT_STS_CFM;   /* event */
1465    SPstTsk(pst, mBuf);
1466
1467    return ROK;
1468 } /* end of cmPkLkwStsCfm */
1469
1470
1471 /**
1472  * @brief
1473      Pack  
1474  *
1475  * @param[in] pst  : post structure
1476  * @param[in] cfg  : RLC LM structure
1477  *  @return  S16
1478  *      -# Success : ROK
1479  *      -# Failure : RFAILED
1480  */
1481
1482 #ifdef ANSI
1483 PRIVATE S16 cmPkRlcMngmt
1484 (
1485 RlcMngmt *param,              /* Managment */             
1486 Event eventType,             /* Event type */
1487 Buffer *mBuf                 /* Message Buffer */
1488 )
1489 #else
1490 PRIVATE S16 cmPkRlcMngmt(param ,eventType, mBuf)
1491 RlcMngmt *param;              /* Managment */
1492 Event eventType;             /* Event type */
1493 Buffer *mBuf;                /* Message Buffer */
1494 #endif
1495 {
1496     S16 ret1;                /* return value */
1497
1498     TRC3(cmPkRlcMngmt)
1499
1500     switch( eventType )
1501     {
1502        case LKW_EVT_CFG_REQ:
1503           ret1 = cmPkRlcCfg(param, param->hdr.elmId.elmnt ,mBuf);
1504           if (ret1 != ROK)
1505           {
1506              return RFAILED;
1507           }
1508           break;
1509
1510        case LKW_EVT_CNTRL_REQ:
1511          ret1 = cmPkRlcCntrl(param, param->hdr.elmId.elmnt ,mBuf);
1512           if (ret1 != ROK)
1513           {
1514              return RFAILED;
1515           }
1516           break;
1517
1518        case LKW_EVT_STA_IND:
1519           ret1 = cmPkRlcUsta(param, param->hdr.elmId.elmnt ,mBuf);
1520           if (ret1 != ROK)
1521           {
1522              return RFAILED;
1523           }
1524           break;
1525
1526        case LKW_EVT_STA_REQ:
1527        case LKW_EVT_STA_CFM:
1528           ret1 = cmPkRlcSsta(param, param->hdr.elmId.elmnt , eventType, mBuf);
1529           if (ret1 != ROK)
1530           {
1531              return RFAILED;
1532           }
1533           break;
1534
1535        case LKW_EVT_STS_REQ:
1536        case LKW_EVT_STS_CFM:
1537           ret1 = cmPkRlcSts(param, param->hdr.elmId.elmnt ,mBuf);
1538           if (ret1 != ROK)
1539           {
1540              return RFAILED;
1541           }
1542           break;
1543        case LKW_EVT_TRC_IND:
1544           ret1 = cmPkRlcTrc(param, mBuf);
1545           if (ret1 != ROK)
1546           {
1547              return RFAILED;
1548           }
1549           break;
1550        case LKW_EVT_CNTRL_CFM:
1551        case LKW_EVT_CFG_CFM:
1552           break;
1553     }
1554
1555    CMCHKPK(cmPkCmStatus, &param->cfm, mBuf);
1556    CMCHKPK(cmPkHeader, &param->hdr, mBuf);
1557
1558    return ROK;
1559 } /* end of function cmPkRlcMngmt */
1560
1561
1562 /**
1563  * @brief
1564      Pack 
1565  *
1566  * @param[in] pst  : post structure
1567  * @param[in] cfg  : RLC LM structure
1568  *  @return  S16
1569  *      -# Success : ROK
1570  *      -# Failure : RFAILED
1571  */
1572 #ifdef ANSI
1573 PRIVATE S16 cmPkRlcCfg
1574 (
1575 RlcMngmt *cfg,
1576 Elmnt elmnt,
1577 Buffer *mBuf
1578 )
1579 #else
1580 PRIVATE S16 cmPkRlcCfg(cfg, elmnt, mBuf)
1581 RlcMngmt *cfg;
1582 Elmnt elmnt;
1583 Buffer *mBuf;
1584 #endif
1585 {
1586     TRC3(cmPkRlcCfg)
1587
1588     switch( elmnt )
1589     {
1590       case STGEN:
1591       {
1592          CMCHKPK(oduUnpackUInt16, cfg->t.cfg.s.gen.maxRguSaps, mBuf);
1593          CMCHKPK(oduUnpackUInt8, cfg->t.cfg.s.gen.rlcMode, mBuf);
1594          CMCHKPK(oduUnpackUInt32, cfg->t.cfg.s.gen.timeRes, mBuf);
1595          CMCHKPK(oduUnpackUInt16, cfg->t.cfg.s.gen.maxUdxSaps, mBuf);
1596          CMCHKPK(oduUnpackUInt16, cfg->t.cfg.s.gen.maxKwuSaps, mBuf);
1597          CMCHKPK(oduUnpackUInt32, cfg->t.cfg.s.gen.maxUe, mBuf);
1598          CMCHKPK(cmPkPst, &cfg->t.cfg.s.gen.lmPst,mBuf);
1599
1600          break;
1601       }
1602       case STCKWSAP:
1603       case STKWUSAP:
1604       case STUDXSAP:
1605       case STRGUSAP:
1606       {
1607          CMCHKPK(oduUnpackUInt8, cfg->t.cfg.s.sap.route,mBuf);
1608          CMCHKPK(oduUnpackUInt8, cfg->t.cfg.s.sap.priority,mBuf);
1609          CMCHKPK(oduUnpackUInt16, cfg->t.cfg.s.sap.bndTmrIntvl, mBuf);
1610          CMCHKPK(SPkS16, cfg->t.cfg.s.sap.sapId, mBuf);
1611          CMCHKPK(oduUnpackUInt8, cfg->t.cfg.s.sap.inst, mBuf);
1612          CMCHKPK(oduUnpackUInt8, cfg->t.cfg.s.sap.ent, mBuf);
1613          CMCHKPK(oduUnpackUInt16, cfg->t.cfg.s.sap.procId, mBuf);
1614          CMCHKPK(oduUnpackUInt8, cfg->t.cfg.s.sap.mem.pool, mBuf);
1615          CMCHKPK(oduUnpackUInt8, cfg->t.cfg.s.sap.mem.region, mBuf);
1616          CMCHKPK(oduUnpackUInt8, cfg->t.cfg.s.sap.selector, mBuf);
1617          break;
1618       }
1619        default:
1620           return RFAILED;
1621     }
1622     return ROK;
1623 } /*end of function cmPkRlcCfg*/
1624
1625
1626 /**
1627  * @brief
1628      Pack kw control request
1629  *
1630  * @param[in] cntrl  : LM management structure
1631  * @param[in] elmnt  : element 
1632  * @param[in] mBuf   : Buffer 
1633  *  @return  S16
1634  *      -# Success : ROK
1635  *      -# Failure : RFAILED
1636  */
1637 #ifdef ANSI
1638 PRIVATE S16 cmPkRlcCntrl
1639 (
1640 RlcMngmt *cntrl,
1641 Elmnt elmnt,
1642 Buffer *mBuf
1643 )
1644 #else
1645 PRIVATE S16 cmPkRlcCntrl(cntrl, elmnt, mBuf)
1646 RlcMngmt *cntrl;
1647 Elmnt elmnt;
1648 Buffer *mBuf;
1649 #endif
1650 {
1651     U8 subAction;            /* sub action */     
1652
1653     TRC3(cmPkRlcCntrl)
1654
1655     switch( elmnt )
1656     {
1657       case STGEN:
1658          {
1659             subAction = cntrl->t.cntrl.subAction;
1660             switch(subAction)
1661             {
1662                case SAUSTA:
1663                   break;
1664                case SADBG:
1665                   {
1666                       CMCHKPK(oduUnpackUInt32, cntrl->t.cntrl.s.dbgCntrl.dbgMask,
1667                                                            mBuf);
1668                   }
1669                   break;
1670                case SATRC:
1671                   {
1672                      CMCHKPK(SPkS16, cntrl->t.cntrl.s.trcCntrl.trcLen, 
1673                                                            mBuf);
1674                      CMCHKPK(oduUnpackUInt8, cntrl->t.cntrl.s.trcCntrl.trcMask,
1675                                                            mBuf);
1676                   }
1677                   break;
1678 #ifdef SS_DIAG
1679                case SALOG:
1680                   {
1681                       CMCHKPK(oduUnpackUInt32, cntrl->t.cntrl.s.logMask,  mBuf);
1682                   }
1683                   break;
1684 #endif
1685                default:
1686                   break;
1687             }
1688             break;
1689          }
1690       case STRGUSAP:
1691       case STUDXSAP:
1692          CMCHKPK(SPkS16, cntrl->t.cntrl.s.sapCntrl.spId, mBuf);
1693          CMCHKPK(SPkS16, cntrl->t.cntrl.s.sapCntrl.suId, mBuf);
1694          break;
1695       default:
1696          break;
1697    }
1698
1699    CMCHKPK(oduUnpackUInt8, cntrl->t.cntrl.action, mBuf);
1700    CMCHKPK(oduUnpackUInt8, cntrl->t.cntrl.subAction, mBuf);
1701    CMCHKPK(cmPkDateTime, &cntrl->t.cntrl.dt, mBuf);
1702
1703    return ROK;
1704 } /*end of function cmPkRlcCntrl */
1705
1706 /**
1707  * @brief
1708      Pack unsolicit status  
1709  *
1710  * @param[in] usta  : RLC LM structure 
1711  * @param[in] elmnt : element
1712  * @param[in] mBuf  : Buffer 
1713  *  @return  S16
1714  *      -# Success : ROK
1715  *      -# Failure : RFAILED
1716  */
1717 #ifdef ANSI
1718 PRIVATE S16 cmPkRlcUsta
1719 (
1720 RlcMngmt *usta,
1721 Elmnt elmnt,
1722 Buffer *mBuf
1723 )
1724 #else
1725 PRIVATE S16 cmPkRlcUsta(usta, elmnt, mBuf)
1726 RlcMngmt *usta;
1727 Elmnt elmnt;
1728 Buffer *mBuf;
1729 #endif
1730 {
1731    TRC3(cmPkRlcUsta)
1732
1733    /* lkw_c_001.main_2 removed warning */
1734    UNUSED(elmnt);
1735    /* lkw_c_001.main_2 added support for L2 Measurement */
1736 #ifdef LTE_L2_MEAS
1737    CMCHKPK(oduUnpackUInt8, usta->t.usta.qci, mBuf);
1738 #endif
1739    CMCHKPK(oduUnpackUInt32, usta->t.usta.ueId, mBuf);
1740    CMCHKPK(SPkS16, usta->t.usta.suId, mBuf);
1741    CMCHKPK(cmPkCmAlarm, &usta->t.usta.alarm,mBuf);
1742    CMCHKPK(cmPkDateTime, &usta->t.usta.dt, mBuf);
1743
1744    return ROK;
1745
1746 } /* end of cmPkRlcUsta */
1747
1748
1749 /**
1750  * @brief
1751      Pack 
1752  *
1753  * @param[in] pst  : post structure
1754  * @param[in] cfg  : RLC LM structure
1755  *  @return  S16
1756  *      -# Success : ROK
1757  *      -# Failure : RFAILED
1758  */
1759 #ifdef ANSI
1760 PRIVATE S16 cmPkRlcSsta
1761 (
1762 RlcMngmt *ssta,
1763 Elmnt elmnt,
1764 Event eventType,
1765 Buffer *mBuf
1766 )
1767 #else
1768 PRIVATE S16 cmPkRlcSsta(ssta, elmnt, eventType, mBuf)
1769 RlcMngmt *ssta;
1770 Elmnt elmnt;
1771 Event eventType;
1772 Buffer *mBuf;
1773 #endif
1774 {
1775    S16 ret1;
1776    TRC3(cmPkRlcSsta)
1777
1778    ret1 = RFAILED;
1779    switch(elmnt)
1780    {
1781       case STSID:
1782          ret1 = ROK;
1783          if(eventType == LKW_EVT_STA_CFM)
1784          {
1785             CMCHKPK(cmPkSystemId, &ssta->t.ssta.s.sysId,mBuf);
1786          }
1787          break;
1788       case STCKWSAP:
1789          ret1 = cmPkCkwSapSta(&ssta->t.ssta.s.ckwSap, mBuf);
1790          break;
1791       case STKWUSAP:
1792          ret1 = cmPkKwuSapSta(&ssta->t.ssta.s.rlckwuSap, mBuf);
1793          break;
1794       case STRGUSAP:
1795       case STUDXSAP:
1796          ret1 = cmPkRguSapSta(&ssta->t.ssta.s.rguSap, mBuf);
1797          break;
1798       default:
1799          ret1 = RFAILED;
1800         break;
1801    }
1802
1803    if(ret1 != ROK)
1804    {
1805       return RFAILED;
1806    }
1807
1808    CMCHKPK(cmPkDateTime, &ssta->t.ssta.dt, mBuf);
1809
1810    return ROK;
1811
1812 } /* end of cmPkRlcSsta */
1813
1814 /**
1815  * @brief
1816      Pack Trace Indication
1817  *
1818  * @param[in] trc  : RLC LM structure 
1819  * @param[in] mBuf : Buffer 
1820  *  @return  S16
1821  *      -# Success : ROK
1822  *      -# Failure : RFAILED
1823  */
1824 #ifdef ANSI
1825 PRIVATE S16 cmPkRlcTrc
1826 (
1827 RlcMngmt *trc,                /* trace */                 
1828 Buffer *mBuf                 /* data buffer */
1829 )
1830 #else
1831 PRIVATE S16 cmPkRlcTrc(trc, mBuf)
1832 RlcMngmt *trc;                /* trace */
1833 Buffer *mBuf;                /* data buffer */
1834 #endif
1835 {
1836    TRC3(cmPkRlcTrc)
1837
1838    CMCHKPK(oduUnpackUInt16, trc->t.trc.event, mBuf); 
1839    CMCHKPK(cmPkDateTime, &trc->t.trc.dt, mBuf);
1840
1841    return ROK;
1842 } /* end of cmPkRlcTrc */
1843
1844
1845 /**
1846  * @brief
1847      Pack Statistics request 
1848  *
1849  * @param[in] pst  : post structure
1850  * @param[in] cfg  : RLC LM structure
1851  *  @return  S16
1852  *      -# Success : ROK
1853  *      -# Failure : RFAILED
1854  */
1855
1856 #ifdef ANSI
1857 PRIVATE S16 cmPkRlcSts
1858 (
1859 RlcMngmt *sts,
1860 Elmnt elmnt,
1861 Buffer *mBuf
1862 )
1863 #else
1864 PRIVATE S16 cmPkRlcSts(sts, elmnt, mBuf)
1865 RlcMngmt *sts;
1866 Elmnt elmnt;
1867 Buffer *mBuf;
1868 #endif
1869 {
1870    S16 ret1;
1871    TRC3(cmPkRlcSts)
1872
1873    ret1 = RFAILED;
1874    switch(elmnt)
1875    {
1876       case STGEN:
1877          ret1 = cmPkGenSts(&sts->t.sts.s.gen, mBuf); 
1878          break;
1879       case STCKWSAP:
1880          ret1 = cmPkCkwSapSts(&sts->t.sts.s.ckwSap, mBuf);
1881          break;
1882       case STKWUSAP:
1883          ret1 = cmPkKwuSapSts(&sts->t.sts.s.rlckwuSap, mBuf);
1884          break;
1885 /* lkw_c_001.main_2 removed support of RGU sap statistics as it is reflecting
1886  * in general statstics.
1887  * */
1888       default:
1889          ret1 = RFAILED;
1890         break;
1891    } /* end of switch */
1892
1893    if(ret1 != ROK)
1894    {
1895       return RFAILED;
1896    }
1897
1898    CMCHKPK(cmPkDateTime, &sts->t.sts.dt, mBuf);
1899
1900    return ROK;
1901 } /* end of cmPkRlcSts */
1902
1903
1904
1905 /**
1906  * @brief
1907      Pack general statistics 
1908  *
1909  * @param[in] gen  : RlcGenSts structure 
1910  * @param[in] mBuf : Buffer 
1911  *  @return  S16
1912  *      -# Success : ROK
1913  *      -# Failure : RFAILED
1914  */
1915 #ifdef ANSI
1916 PRIVATE S16 cmPkGenSts
1917 (
1918 RlcGenSts *gen,
1919 Buffer *mBuf
1920 )
1921 #else
1922 PRIVATE S16 cmPkGenSts(gen, mBuf)
1923 RlcGenSts *gen;
1924 Buffer *mBuf;
1925 #endif
1926 {
1927    TRC3(cmPkGenSts)
1928
1929    CMCHKPK(oduUnpackUInt32, gen->numSduDisc, mBuf);
1930    CMCHKPK(oduUnpackUInt32, gen->numOfRb, mBuf);
1931    CMCHKPK(oduUnpackUInt32, gen->protTimeOut, mBuf);
1932    CMCHKPK(oduUnpackUInt32, gen->errorPdusRecv, mBuf);
1933    CMCHKPK(oduUnpackUInt32, gen->unexpPdusRecv, mBuf);
1934    CMCHKPK(oduUnpackUInt32, gen->bytesSent, mBuf);
1935    CMCHKPK(oduUnpackUInt32, gen->bytesRecv, mBuf);
1936    CMCHKPK(oduUnpackUInt32, gen->pdusRetx, mBuf);
1937    CMCHKPK(oduUnpackUInt32, gen->pdusSent, mBuf);
1938    CMCHKPK(oduUnpackUInt32, gen->pdusRecv, mBuf);
1939    CMCHKPK(oduUnpackUInt32, gen->numUe, mBuf);
1940
1941    return ROK;
1942
1943 } /* end of cmPkGenSts */
1944
1945 /**
1946  * @brief
1947      Pack CKW statistics
1948  *
1949  * @param[in] pst  : post structure
1950  * @param[in] cfg  : RLC LM structure
1951  *  @return  S16
1952  *      -# Success : ROK
1953  *      -# Failure : RFAILED
1954  */
1955 #ifdef ANSI
1956 PRIVATE S16 cmPkCkwSapSts
1957 (
1958 RlcCkwCntSts *rcSap,
1959 Buffer *mBuf
1960 )
1961 #else
1962 PRIVATE S16 cmPkCkwSapSts(rcSap, mBuf)
1963 RlcCkwCntSts *rcSap;
1964 Buffer *mBuf;
1965 #endif
1966 {
1967    TRC3(cmPkCkwSapSts)
1968
1969    CMCHKPK(oduUnpackUInt32, rcSap->statMsgs, mBuf);
1970
1971    return ROK;
1972 } /* end of cmPkCkwSapSts */
1973
1974 /**
1975  * @brief
1976      Pack Config Request
1977  *
1978  * @param[in] pst  : post structure
1979  * @param[in] cfg  : RLC LM structure
1980  *  @return  S16
1981  *      -# Success : ROK
1982  *      -# Failure : RFAILED
1983  */
1984 #ifdef ANSI
1985 PRIVATE S16 cmPkKwuSapSts
1986 (
1987 RlcKwuSapSts *ruSap,
1988 Buffer *mBuf
1989 )
1990 #else
1991 PRIVATE S16 cmPkKwuSapSts(ruSap, mBuf)
1992 RlcKwuSapSts *ruSap;
1993 Buffer *mBuf;
1994 #endif
1995 {
1996    TRC3(cmPkCkwSapSts)
1997
1998    CMCHKPK(oduUnpackUInt32, ruSap->sduTx, mBuf);
1999    CMCHKPK(oduUnpackUInt32, ruSap->sduRx, mBuf);
2000    /* lkw_c_001.main_2 changed from suId to spId */
2001    CMCHKPK(cmPkSuId, ruSap->spId, mBuf);
2002
2003    return ROK;
2004 } /* end of cmPkCkwSapSts */
2005
2006 /* lkw_c_001.main_2 removed support of RGU sap statistics as it is reflecting
2007  * in general statstics.
2008  * */
2009
2010 /**
2011  * @brief
2012      Unpack RLC Layer Management structure 
2013  *
2014  * @param[in] param  : RLC LM structure
2015  * @param[in] eventType   : event type 
2016  * @param[in] mBuf  : message buffer
2017  *  @return  S16
2018  *      -# Success : ROK
2019  *      -# Failure : RFAILED
2020  */
2021 #ifdef ANSI
2022 PRIVATE S16 cmUnpkRlcMngmt
2023 (
2024 RlcMngmt *param,
2025 Event eventType,
2026 Buffer *mBuf
2027 )
2028 #else
2029 PRIVATE S16 cmUnpkRlcMngmt(param ,eventType, mBuf)
2030 RlcMngmt *param;
2031 Event eventType;
2032 Buffer *mBuf;
2033 #endif
2034 {
2035     S16 ret1;
2036     TRC3(cmUnpkRlcMngmt)
2037
2038    cmMemset((U8 *) param, (U8) 0, (S16) sizeof(RlcMngmt));
2039
2040    CMCHKUNPK(cmUnpkHeader, &param->hdr, mBuf);
2041    CMCHKUNPK(cmUnpkCmStatus, &param->cfm, mBuf);
2042
2043     switch( eventType )
2044     {
2045        case  LKW_EVT_CFG_REQ:
2046           ret1 = cmUnpkRlcCfg(param, param->hdr.elmId.elmnt ,mBuf);
2047           if (ret1 != ROK)
2048           {
2049              return RFAILED;
2050           }
2051           break;
2052        case LKW_EVT_CNTRL_REQ:
2053           ret1 = cmUnpkRlcCntrl(param, param->hdr.elmId.elmnt ,mBuf);
2054           if (ret1 != ROK)
2055           {
2056              return RFAILED;
2057           }
2058           break;
2059
2060        case LKW_EVT_STA_IND:
2061           ret1 = cmUnpkRlcUsta(param, param->hdr.elmId.elmnt ,mBuf);
2062           if (ret1 != ROK)
2063           {
2064              return RFAILED;
2065           }
2066           break;
2067
2068        case LKW_EVT_STA_REQ:
2069        case LKW_EVT_STA_CFM:
2070           ret1 = cmUnpkRlcSsta(param, param->hdr.elmId.elmnt, eventType,mBuf);
2071           if (ret1 != ROK)
2072           {
2073              return RFAILED;
2074           }
2075           break;
2076
2077        case LKW_EVT_STS_REQ:
2078        case LKW_EVT_STS_CFM:
2079           
2080           ret1 = cmUnpkRlcSts(param, param->hdr.elmId.elmnt ,mBuf);
2081           if (ret1 != ROK)
2082           {
2083              return RFAILED;
2084           }
2085           break;
2086        case LKW_EVT_TRC_IND:
2087           ret1 = cmUnpkRlcTrc(param, mBuf);
2088           if (ret1 != ROK)
2089           {
2090              return RFAILED;
2091           }
2092           break;
2093
2094        case LKW_EVT_CNTRL_CFM:
2095        case LKW_EVT_CFG_CFM:
2096        break;
2097
2098        default:
2099           break;
2100     }
2101     return ROK;
2102 } /*end of function cmUnpkRlcMngmt*/
2103
2104 /**
2105  * @brief
2106      Unpack Kw configuration structure 
2107  *
2108  * @param[out] cfg  : RLC LM structure 
2109  * @param[in] elmnt  : element 
2110  * @param[in] mBuf  : message buffer
2111  *  @return  S16
2112  *      -# Success : ROK
2113  *      -# Failure : RFAILED
2114  */
2115 #ifdef ANSI
2116 PRIVATE S16 cmUnpkRlcCfg
2117 (
2118 RlcMngmt *cfg,
2119 Elmnt elmnt,
2120 Buffer *mBuf
2121 )
2122 #else
2123 PRIVATE S16 cmUnpkRlcCfg(cfg ,elmnt, mBuf)
2124 RlcMngmt *cfg;
2125 Elmnt elmnt;
2126 Buffer *mBuf;
2127 #endif
2128 {
2129    TRC3(cmUnpkRlcCfg)
2130
2131    switch(elmnt)
2132    {
2133       case STGEN:
2134       {
2135          CMCHKUNPK(cmUnpkPst, &cfg->t.cfg.s.gen.lmPst,mBuf);
2136          CMCHKUNPK(oduPackUInt32, &cfg->t.cfg.s.gen.maxUe, mBuf);
2137          CMCHKUNPK(oduPackUInt16, &cfg->t.cfg.s.gen.maxKwuSaps, mBuf);
2138          CMCHKUNPK(oduPackUInt16, &cfg->t.cfg.s.gen.maxUdxSaps, mBuf);
2139          CMCHKUNPK(oduPackUInt32, &cfg->t.cfg.s.gen.timeRes, mBuf);
2140          CMCHKUNPK(oduPackUInt8, &cfg->t.cfg.s.gen.rlcMode, mBuf);
2141          CMCHKUNPK(oduPackUInt16, &cfg->t.cfg.s.gen.maxRguSaps, mBuf);
2142       }
2143       break;
2144
2145       case STCKWSAP:
2146       case STKWUSAP:
2147       case STRGUSAP:
2148       case STUDXSAP:
2149       {
2150          CMCHKUNPK(oduPackUInt8, &cfg->t.cfg.s.sap.selector, mBuf);
2151          CMCHKUNPK(oduPackUInt8, &cfg->t.cfg.s.sap.mem.region, mBuf);
2152          CMCHKUNPK(oduPackUInt8, &cfg->t.cfg.s.sap.mem.pool, mBuf);
2153          CMCHKUNPK(oduPackUInt16, &cfg->t.cfg.s.sap.procId, mBuf);
2154          CMCHKUNPK(oduPackUInt8, &cfg->t.cfg.s.sap.ent, mBuf);
2155          CMCHKUNPK(oduPackUInt8, &cfg->t.cfg.s.sap.inst, mBuf);
2156          CMCHKUNPK(SUnpkS16, &cfg->t.cfg.s.sap.sapId, mBuf);
2157          CMCHKUNPK(oduPackUInt16, &cfg->t.cfg.s.sap.bndTmrIntvl, mBuf);
2158          CMCHKUNPK(oduPackUInt8, &cfg->t.cfg.s.sap.priority,mBuf);
2159          CMCHKUNPK(oduPackUInt8, &cfg->t.cfg.s.sap.route,mBuf);
2160       }
2161       break;
2162       default:
2163         return RFAILED;
2164    } /* end of switch */     
2165
2166    return ROK;
2167 } /* end of cmUnpkRlcCfg */
2168
2169 /**
2170  * @brief
2171      Unpack Control Structure 
2172  *
2173  * @param[in] cfm   : RLC LM structure 
2174  * @param[in] elmnt : element 
2175  * @param[in] mBuf  : message buffer
2176  *  @return  S16
2177  *      -# Success : ROK
2178  *      -# Failure : RFAILED
2179  */
2180 #ifdef ANSI
2181 PRIVATE S16 cmUnpkRlcCntrl
2182 (
2183 RlcMngmt *cfm,
2184 Elmnt elmnt,
2185 Buffer *mBuf
2186 )
2187 #else
2188 PRIVATE S16 cmUnpkRlcCntrl(cfm, elmnt, mBuf)
2189 RlcMngmt *cfm;
2190 Elmnt elmnt;
2191 Buffer *mBuf;
2192 #endif
2193 {
2194    U8 subAction;
2195    RlcDbgCntrl *dbgCntrl;
2196    RlcTrcCntrl *trcCntrl;
2197
2198    TRC3(cmUnpkRlcCntrl);
2199    
2200    /* lkw_c_001.main_2 removed warning */
2201    UNUSED(elmnt);
2202
2203    CMCHKUNPK(cmUnpkDateTime, &cfm->t.cntrl.dt, mBuf);
2204    CMCHKUNPK(oduPackUInt8, &cfm->t.cntrl.subAction, mBuf);
2205    CMCHKUNPK(oduPackUInt8, &cfm->t.cntrl.action, mBuf);
2206
2207    subAction = cfm->t.cntrl.subAction;
2208
2209    switch(cfm->hdr.elmId.elmnt)
2210    {
2211       case STGEN:
2212          {
2213             switch(subAction)
2214             {
2215                case SAUSTA:
2216                   break;
2217                case SADBG:
2218                   {
2219                      dbgCntrl = &cfm->t.cntrl.s.dbgCntrl;
2220                      CMCHKUNPK(oduPackUInt32, &dbgCntrl->dbgMask, mBuf);
2221                   }
2222                   break;
2223                case SATRC:
2224                   {
2225                     trcCntrl = &cfm->t.cntrl.s.trcCntrl; 
2226                     CMCHKUNPK(oduPackUInt8, &trcCntrl->trcMask, mBuf);
2227                     CMCHKUNPK(SUnpkS16,&trcCntrl->trcLen, mBuf);
2228                   }
2229                   break;
2230 #ifdef SS_DIAG
2231                case SALOG:
2232                   {
2233                       CMCHKUNPK(oduPackUInt32, &cfm->t.cntrl.s.logMask, mBuf);
2234                   }
2235                   break;
2236 #endif
2237                default:
2238                   break;
2239             }
2240             break;
2241          }
2242       case STRGUSAP:
2243       case STUDXSAP:
2244            CMCHKUNPK(SUnpkS16, &cfm->t.cntrl.s.sapCntrl.suId, mBuf);
2245            CMCHKUNPK(SUnpkS16, &cfm->t.cntrl.s.sapCntrl.spId, mBuf);
2246            break;
2247       default:
2248            break;
2249    }
2250
2251    return ROK;
2252
2253 } /* end of cmUnpkRlcCntrl */
2254
2255
2256 /**
2257  * @brief
2258      Unpack USta 
2259  *
2260  * @param[in] usta  : RLC LM Structure
2261  * @param[in] elmnt : element
2262  * @param[out] mBuf  : message buffer
2263  *  @return  S16
2264  *      -# Success : ROK
2265  *      -# Failure : RFAILED
2266  */
2267 #ifdef ANSI
2268 PRIVATE S16 cmUnpkRlcUsta
2269 (
2270 RlcMngmt *usta,
2271 Elmnt elmnt,
2272 Buffer *mBuf
2273 )
2274 #else
2275 PRIVATE S16 cmUnpkRlcUsta(usta ,elmnt, mBuf)
2276 RlcMngmt *usta;
2277 Elmnt elmnt;
2278 Buffer *mBuf;
2279 #endif
2280 {
2281    TRC3(cmUnpkRlcUsta);
2282
2283    /* lkw_c_001.main_2 removed warning */
2284    UNUSED(elmnt);
2285
2286    CMCHKUNPK(cmUnpkDateTime, &usta->t.usta.dt, mBuf);
2287    CMCHKUNPK(cmUnpkCmAlarm, &usta->t.usta.alarm,mBuf);
2288    CMCHKUNPK(SUnpkS16, &usta->t.usta.suId, mBuf);
2289    CMCHKUNPK(oduPackUInt32, &usta->t.usta.ueId, mBuf);
2290    /* lkw_c_001.main_2 added support for L2 Measurement */
2291 #ifdef LTE_L2_MEAS
2292    CMCHKUNPK(oduPackUInt8, &usta->t.usta.qci, mBuf);
2293 #endif
2294    return ROK;
2295 }
2296
2297 /**
2298  * @brief
2299      Unpack SSta 
2300  *
2301  * @param[out] ssta: RLC LM structure 
2302  * @param[in] elmnt  : element 
2303  * @param[in] mBuf  : message buffer
2304  *  @return  S16
2305  *      -# Success : ROK
2306  *      -# Failure : RFAILED
2307  */
2308 #ifdef ANSI
2309 PRIVATE S16 cmUnpkRlcSsta
2310 (
2311 RlcMngmt *ssta,
2312 Elmnt elmnt,
2313 Event eventType,
2314 Buffer *mBuf
2315 )
2316 #else
2317 PRIVATE S16 cmUnpkRlcSsta(ssta ,elmnt, eventType, mBuf)
2318 RlcMngmt *ssta;
2319 Elmnt elmnt;
2320 Event eventType;
2321 Buffer *mBuf;
2322 #endif
2323 {
2324    S16 ret1;           /* return value */
2325    TRC3(cmUnpkRlcSsta);
2326
2327    CMCHKUNPK(cmUnpkDateTime, &ssta->t.ssta.dt, mBuf);
2328    switch(elmnt)
2329    {
2330       case STSID:
2331          ret1 = ROK;
2332          if(eventType == LKW_EVT_STA_CFM)
2333          {
2334             cmMemset((U8 *) ptNmb, (U8) 0, LKW_PART_NUM_STR_LEN);
2335             ssta->t.ssta.s.sysId.ptNmb = ptNmb;
2336             CMCHKUNPK(cmUnpkSystemId, &ssta->t.ssta.s.sysId,mBuf);
2337          }
2338          break;
2339       case STCKWSAP:
2340          ret1 = cmUnpkCkwSapSta(&ssta->t.ssta.s.ckwSap, mBuf);
2341          break;
2342       case STKWUSAP:
2343          ret1 = cmUnpkKwuSapSta(&ssta->t.ssta.s.rlckwuSap, mBuf);
2344          break;
2345       case STRGUSAP:
2346       case STUDXSAP:
2347          ret1 = cmUnpkRguSapSta(&ssta->t.ssta.s.rguSap, mBuf);
2348          break;
2349       default:
2350          ret1 = RFAILED;
2351         break;
2352    }
2353
2354    if(ret1 != ROK)
2355    {
2356       return RFAILED;
2357    }
2358
2359    return ROK;
2360 }
2361
2362
2363 /**
2364  * @brief
2365      Unpack trace Indication 
2366  *
2367  * @param[out] trc   : RLC LM Structure 
2368  * @param[in] mBuf  : message buffer
2369  *  @return  S16
2370  *      -# Success : ROK
2371  *      -# Failure : RFAILED
2372  */
2373 #ifdef ANSI
2374 PRIVATE S16 cmUnpkRlcTrc
2375 (
2376 RlcMngmt *trc,
2377 Buffer *mBuf
2378 )
2379 #else
2380 PRIVATE S16 cmUnpkRlcTrc(trc, mBuf)
2381 RlcMngmt *trc;
2382 Buffer *mBuf;
2383 #endif
2384 {
2385    TRC3(cmUnpkRlcTrc);
2386
2387    CMCHKUNPK(cmUnpkDateTime, &trc->t.trc.dt, mBuf);
2388    CMCHKUNPK(oduPackUInt16, &trc->t.trc.event, mBuf);
2389
2390    return ROK;
2391 } /* end of cmUnpkRlcTrc */
2392
2393
2394 /**
2395  * @brief
2396      Unpack Statistics 
2397  *
2398  * @param[out] sts  : RLC LM structure 
2399  * @param[in] elmnt : element 
2400  * @param[in] mBuf  : message buffer
2401  *  @return  S16
2402  *      -# Success : ROK
2403  *      -# Failure : RFAILED
2404  */
2405 #ifdef ANSI
2406 PRIVATE S16 cmUnpkRlcSts
2407 (
2408 RlcMngmt *sts,
2409 Elmnt elmnt,
2410 Buffer *mBuf
2411 )
2412 #else
2413 PRIVATE S16 cmUnpkRlcSts(sts ,elmnt, mBuf)
2414 RlcMngmt *sts;
2415 Elmnt elmnt;
2416 Buffer *mBuf;
2417 #endif
2418 {
2419    S16 ret1;           /* return value */
2420    TRC3(cmUnpkRlcSts);
2421
2422    CMCHKUNPK(cmUnpkDateTime, &sts->t.sts.dt, mBuf);
2423
2424    switch(elmnt)
2425    {
2426       case STGEN:
2427          ret1 = cmUnpkGenSts(&sts->t.sts.s.gen, mBuf);
2428          break;
2429       case STCKWSAP:
2430          ret1 = cmUnpkCkwSapSts(&sts->t.sts.s.ckwSap, mBuf);
2431          break;
2432       case STKWUSAP:
2433          ret1 = cmUnpkKwuSapSts(&sts->t.sts.s.rlckwuSap, mBuf);
2434          break;
2435 /* lkw_c_001.main_2 removed support of RGU sap statistics as it is reflecting
2436  * in general statstics.
2437  * */
2438       default:
2439          ret1 = RFAILED;
2440         break;
2441    } /* end of switch */
2442
2443    if(ret1 != ROK)
2444    {
2445       return RFAILED;
2446    }
2447
2448    return ROK;
2449 } /* end of cmUnpkRlcSts */
2450
2451
2452 /**
2453  * @brief
2454      Unpack General statistics 
2455  *
2456  * @param[out] gen  : RlcGenSts structure 
2457  * @param[in] mBuf  : message buffer
2458  *  @return  S16
2459  *      -# Success : ROK
2460  *      -# Failure : RFAILED
2461  */
2462 #ifdef ANSI
2463 PRIVATE S16 cmUnpkGenSts
2464 (
2465 RlcGenSts *gen,
2466 Buffer *mBuf
2467 )
2468 #else
2469 PRIVATE S16 cmUnpkGenSts(gen, mBuf)
2470 RlcGenSts *gen;
2471 Buffer *mBuf;
2472 #endif
2473 {
2474    TRC3(cmUnpkGenSts);
2475
2476    CMCHKUNPK(oduPackUInt32, &gen->numUe, mBuf);
2477    CMCHKUNPK(oduPackUInt32, &gen->pdusRecv, mBuf);
2478    CMCHKUNPK(oduPackUInt32, &gen->pdusSent, mBuf);
2479    CMCHKUNPK(oduPackUInt32, &gen->pdusRetx, mBuf);
2480    CMCHKUNPK(oduPackUInt32, &gen->bytesRecv, mBuf);
2481    CMCHKUNPK(oduPackUInt32, &gen->bytesSent, mBuf);
2482    CMCHKUNPK(oduPackUInt32, &gen->unexpPdusRecv, mBuf);
2483    CMCHKUNPK(oduPackUInt32, &gen->errorPdusRecv, mBuf);
2484    CMCHKUNPK(oduPackUInt32, &gen->protTimeOut, mBuf);
2485    CMCHKUNPK(oduPackUInt32, &gen->numOfRb, mBuf);
2486    CMCHKUNPK(oduPackUInt32, &gen->numSduDisc, mBuf);
2487
2488    return ROK;
2489 } /* end of cmUnpkGenSts */
2490
2491 /**
2492  * @brief
2493      Unpack Ckw Sap Statistics 
2494  *
2495  * @param[out] rcSap  : RlcCkwCntSts structure
2496  * @param[in] mBuf  : message buffer
2497  *  @return  S16
2498  *      -# Success : ROK
2499  *      -# Failure : RFAILED
2500  */
2501 #ifdef ANSI
2502 PRIVATE S16 cmUnpkCkwSapSts
2503 (
2504 RlcCkwCntSts *rcSap,
2505 Buffer *mBuf
2506 )
2507 #else
2508 PRIVATE S16 cmUnpkCkwSapSts(rcSap ,mBuf)
2509 RlcCkwCntSts *rcSap;
2510 Buffer *mBuf;
2511 #endif
2512 {
2513
2514    TRC3(cmUnpkCkwSapSts);
2515
2516    CMCHKUNPK(oduPackUInt32, &rcSap->statMsgs, mBuf); 
2517
2518    return ROK;
2519
2520 } /* end of cmUnpkCkwSapSts */
2521
2522 /**
2523  * @brief
2524      Unpack Kwu Sap statistics
2525  *
2526  * @param[out]       : RlcKwuSapSts structure
2527  * @param[in] mBuf  : message buffer
2528  *  @return  S16
2529  *      -# Success : ROK
2530  *      -# Failure : RFAILED
2531  */
2532 #ifdef ANSI
2533 PRIVATE S16 cmUnpkKwuSapSts
2534 (
2535 RlcKwuSapSts *ruSap,
2536 Buffer *mBuf
2537 )
2538 #else
2539 PRIVATE S16 cmUnpkKwuSapSts(ruSap, mBuf)
2540 RlcKwuSapSts *ruSap;
2541 Buffer *mBuf;
2542 #endif
2543 {
2544    TRC3(cmUnpkKwuSapSts)
2545
2546    /* lkw_c_001.main_2 changed from suId to spId */
2547    CMCHKUNPK(cmUnpkSuId, &ruSap->spId, mBuf);
2548    CMCHKUNPK(oduPackUInt32, &ruSap->sduRx, mBuf);
2549    CMCHKUNPK(oduPackUInt32, &ruSap->sduTx, mBuf);
2550
2551    return ROK;
2552
2553 } /* end of cmUnpkKwuSapSts */
2554
2555 /* lkw_c_001.main_2 added support for L2 Measurement */
2556 #ifdef LTE_L2_MEAS
2557 #ifdef ANSI
2558 S16 cmPkLkwL2MeasReq
2559 (
2560 Pst * pst,
2561 RlcL2MeasReqEvt *measReqEvt
2562 )
2563 #else
2564 S16 cmPkLkwL2MeasReq(pst, measReqEvt)
2565 Pst * pst;
2566 RlcL2MeasReqEvt *measReqEvt;
2567 #endif
2568 {
2569    Buffer *mBuf = NULLP;
2570    TRC3(cmPkLkwL2MeasReq)
2571
2572    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2573 #if (ERRCLASS & ERRCLS_ADD_RES)
2574       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2575             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2576             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2577 #endif
2578       SPutSBuf(pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
2579       return RFAILED;
2580    }       
2581    if (cmPkRlcL2MeasReqInfo(&measReqEvt->measReq, mBuf) != ROK) {
2582 #if (ERRCLASS & ERRCLS_ADD_RES)
2583       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2584             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2585             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2586 #endif
2587       SPutSBuf(pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
2588       SPutMsg(mBuf);
2589       return RFAILED;
2590    }
2591    if (oduUnpackUInt16(measReqEvt->measPeriod, mBuf) != ROK) {
2592 #if (ERRCLASS & ERRCLS_ADD_RES)
2593       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2594             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2595             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2596 #endif
2597       SPutSBuf(pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
2598       SPutMsg(mBuf);
2599       return RFAILED;
2600    }
2601    if (oduUnpackUInt32(measReqEvt->transId, mBuf) != ROK) {
2602 #if (ERRCLASS & ERRCLS_ADD_RES)
2603       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2604             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2605             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2606 #endif
2607       SPutSBuf(pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
2608       SPutMsg(mBuf);
2609       return RFAILED;
2610    }
2611
2612    pst->event = (Event) LKW_EVT_L2MEAS_REQ;
2613    return (SPstTsk(pst,mBuf));
2614 }
2615
2616 #ifdef ANSI
2617 S16 cmPkRlcL2MeasReqInfo
2618 (
2619 RlcL2MeasReqInfo *param,
2620 Buffer *mBuf
2621 )
2622 #else
2623 S16 cmPkRlcL2MeasReqInfo(param, mBuf)
2624 RlcL2MeasReqInfo *param;
2625 Buffer *mBuf;
2626 #endif
2627 {
2628    U8 idx;
2629    U16 idx1;
2630
2631    TRC3(cmPkRlcL2MeasReqInfo)
2632
2633    if((param->measType & LKW_L2MEAS_DL_IP) ||
2634          (param->measType & LKW_L2MEAS_UL_IP))
2635    {
2636       for(idx1 = 0;idx1 < param->val.ipThMeas.numUes;idx1++)
2637       {
2638
2639          CMCHKPK(cmPkLteCellId, param->val.ipThMeas.ueInfoLst[idx1].cellId, mBuf);
2640          CMCHKPK(cmPkLteRnti,   param->val.ipThMeas.ueInfoLst[idx1].ueId, mBuf);
2641          for(idx = 0; idx < param->val.ipThMeas.ueInfoLst[idx1].numQci; idx++)
2642          {
2643             CMCHKPK(oduUnpackUInt8, param->val.ipThMeas.ueInfoLst[idx1].qci[idx], mBuf);
2644          }
2645          CMCHKPK(oduUnpackUInt8, param->val.ipThMeas.ueInfoLst[idx1].numQci, mBuf);
2646       }
2647       CMCHKPK(oduUnpackUInt16, param->val.ipThMeas.numUes, mBuf);
2648       CMCHKPK(oduUnpackUInt8, param->measType, mBuf);
2649       return ROK;
2650    }
2651    else
2652    {
2653       for(idx = 0; idx < param->val.nonIpThMeas.numQci; idx++)
2654       {
2655          CMCHKPK(oduUnpackUInt8, param->val.nonIpThMeas.qci[idx], mBuf);
2656       }
2657       CMCHKPK(oduUnpackUInt8, param->val.nonIpThMeas.numQci, mBuf);
2658       CMCHKPK(oduUnpackUInt16, param->val.nonIpThMeas.numSamples, mBuf);
2659    }
2660    CMCHKPK(oduUnpackUInt8, param->measType, mBuf);
2661    return ROK;
2662 }
2663
2664 #ifdef ANSI
2665 S16 cmPkLkwL2MeasStopReq
2666 (
2667 Pst *pst,
2668 U8  measType
2669 )
2670 #else
2671 S16 cmPkLkwL2MeasStopReq(pst, measType)
2672 Pst *pst;
2673 U8 measType;
2674 #endif
2675 {
2676    Buffer *mBuf = NULLP;
2677
2678    TRC3(cmPkLkwL2MeasStopReq)
2679    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2680 #if (ERRCLASS & ERRCLS_ADD_RES)
2681       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2682             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2683             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2684 #endif
2685       return RFAILED;
2686    }
2687    CMCHKPK(oduUnpackUInt8, measType, mBuf);
2688    pst->event = (Event) LKW_EVT_L2MEAS_STOP_REQ;
2689    return (SPstTsk(pst,mBuf));
2690 }
2691
2692 #ifdef ANSI
2693 S16 cmPkLkwL2MeasSendReq
2694 (
2695 Pst *pst,
2696 U8  measType
2697 )
2698 #else
2699 S16 cmPkLkwL2MeasSendReq(pst, measType)
2700 Pst *pst;
2701 U8 measType;
2702 #endif
2703 {
2704    Buffer *mBuf = NULLP;
2705
2706    TRC3(cmPkLkwL2MeasSendReq)
2707    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2708 #if (ERRCLASS & ERRCLS_ADD_RES)
2709       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2710             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2711             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2712 #endif
2713       return RFAILED;
2714    }
2715    CMCHKPK(oduUnpackUInt8, measType, mBuf);
2716    pst->event = (Event) LKW_EVT_L2MEAS_SEND_REQ;
2717    return (SPstTsk(pst,mBuf));
2718 }
2719 #ifdef TENB_SPLIT_ARCH
2720 #ifdef ANSI
2721 S16 cmUnpkLkwL2MeasReq
2722 (
2723 LkwL2MeasReq func,
2724 Pst *pst,
2725 Buffer *mBuf
2726 )
2727 #else
2728 S16 cmUnpkLkwL2MeasReq(func, pst, mBuf)
2729 LkwL2MeasReq func;
2730 Pst *pst;
2731 Buffer *mBuf;
2732 #endif
2733 {
2734    RlcL2MeasReqEvt measReqEvt;
2735    
2736    TRC3(cmUnpkLkwL2MeasReq)
2737
2738    if (oduPackUInt32(&measReqEvt.transId, mBuf) != ROK) {
2739       SPutMsg(mBuf);
2740 #if (ERRCLASS & ERRCLS_ADD_RES)
2741       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2742          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2743          (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2744 #endif
2745       return RFAILED;
2746    }
2747    if (oduPackUInt16(&measReqEvt.measPeriod, mBuf) != ROK) {
2748       SPutMsg(mBuf);
2749 #if (ERRCLASS & ERRCLS_ADD_RES)
2750       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2751          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2752          (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2753 #endif
2754       return RFAILED;
2755    }
2756    if (cmUnpkRlcL2MeasReqInfo(&measReqEvt.measReq, mBuf) != ROK) 
2757    {
2758       /*SPutSBuf(pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));*/
2759       SPutMsg(mBuf);
2760 #if (ERRCLASS & ERRCLS_ADD_RES)
2761       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2762            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2763            (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2764 #endif
2765       return RFAILED;
2766    }
2767    SPutMsg(mBuf);
2768    return ((*func)(pst, &measReqEvt));
2769 }
2770 #else
2771 #ifdef ANSI
2772 S16 cmUnpkLkwL2MeasReq
2773 (
2774 LkwL2MeasReq func,
2775 Pst *pst,
2776 Buffer *mBuf
2777 )
2778 #else
2779 S16 cmUnpkLkwL2MeasReq(func, pst, mBuf)
2780 LkwL2MeasReq func;
2781 Pst *pst;
2782 Buffer *mBuf;
2783 #endif
2784 {
2785    S16   ret;
2786    RlcL2MeasReqEvt *measReqEvt;
2787
2788    TRC3(cmUnpkLkwL2MeasReq)
2789
2790
2791    if((ret = SGetSBuf(pst->region, pst->pool, (Data **)&measReqEvt,\
2792                sizeof(RlcL2MeasReqEvt))) != ROK)
2793    {
2794 #if (ERRCLASS & ERRCLS_ADD_RES)
2795       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2796             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2797             (ErrVal)ERRLKW, (ErrVal)0, "SGetMsg() failed");
2798 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
2799       return (ret);
2800    }
2801
2802    if (oduPackUInt32(&measReqEvt->transId, mBuf) != ROK) {
2803       SPutMsg(mBuf);
2804 #if (ERRCLASS & ERRCLS_ADD_RES)
2805       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2806             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2807             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2808 #endif
2809       return RFAILED;
2810    }
2811    if (oduPackUInt16(&measReqEvt->measPeriod, mBuf) != ROK) {
2812       SPutMsg(mBuf);
2813 #if (ERRCLASS & ERRCLS_ADD_RES)
2814       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2815             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2816             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2817 #endif
2818       return RFAILED;
2819    }
2820    if (cmUnpkRlcL2MeasReqInfo(&measReqEvt->measReq, mBuf) != ROK) 
2821    {
2822       SPutSBuf(pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
2823       SPutMsg(mBuf);
2824 #if (ERRCLASS & ERRCLS_ADD_RES)
2825       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2826             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2827             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2828 #endif
2829       return RFAILED;
2830    }
2831    SPutMsg(mBuf);
2832    return ((*func)(pst, measReqEvt));
2833 }
2834 #endif
2835
2836 #ifdef ANSI
2837 S16 cmUnpkRlcL2MeasReqInfo
2838 (
2839 RlcL2MeasReqInfo *param,
2840 Buffer *mBuf
2841 )
2842 #else
2843 S16 cmUnpkRlcL2MeasReqInfo(param, mBuf)
2844 RlcL2MeasReqInfo *param;
2845 Buffer *mBuf;
2846 #endif
2847 {
2848    U8 idx;
2849    U16 idx1; 
2850
2851    TRC3(cmUnpkRlcL2MeasReqInfo)
2852
2853    CMCHKUNPK(oduPackUInt8, &param->measType, mBuf);
2854
2855    if((param->measType & LKW_L2MEAS_DL_IP) ||
2856          (param->measType & LKW_L2MEAS_UL_IP))
2857    {
2858       CMCHKUNPK(oduPackUInt16, &param->val.ipThMeas.numUes, mBuf);
2859       for(idx1 = 0;idx1 < param->val.ipThMeas.numUes;idx1++)
2860       {
2861          CMCHKUNPK(oduPackUInt8, &param->val.ipThMeas.ueInfoLst[idx1].numQci, mBuf);
2862          for(idx = param->val.ipThMeas.ueInfoLst[idx1].numQci; idx > 0; idx--)
2863          {
2864             CMCHKUNPK(oduPackUInt8, &param->val.ipThMeas.ueInfoLst[idx1].\
2865                   qci[idx - 1], mBuf);
2866          }
2867          CMCHKUNPK(cmUnpkLteRnti, &param->val.ipThMeas.ueInfoLst[idx1].\
2868                ueId, mBuf);
2869          CMCHKUNPK(cmUnpkLteCellId, &param->val.ipThMeas.\
2870                ueInfoLst[idx1].cellId, mBuf);
2871       }
2872       return ROK;
2873    }
2874    else
2875    {
2876       CMCHKUNPK(oduPackUInt16, &param->val.nonIpThMeas.numSamples, mBuf);
2877       CMCHKUNPK(oduPackUInt8, &param->val.nonIpThMeas.numQci, mBuf);
2878       for(idx = param->val.nonIpThMeas.numQci; idx > 0; idx--)
2879       {
2880          CMCHKUNPK(oduPackUInt8, &param->val.nonIpThMeas.qci[idx - 1], mBuf);
2881       }
2882    }
2883    return ROK;
2884 }
2885
2886 #ifdef ANSI
2887 S16 cmUnpkLkwL2MeasStopReq
2888 (
2889 LkwL2MeasStopReq func,
2890 Pst *pst,
2891 Buffer *mBuf
2892 )
2893 #else
2894 S16 cmUnpkLkwL2MeasStopReq(func, pst, mBuf)
2895 LkwL2MeasStopReq func;
2896 Pst *pst;
2897 Buffer *mBuf;
2898 #endif
2899 {
2900    U8 measType;
2901    TRC3(cmUnpkLkwL2MeasReq)
2902
2903    CMCHKUNPK(oduPackUInt8, &measType, mBuf);
2904    SPutMsg(mBuf);
2905    return ((*func)(pst, measType));
2906 }
2907
2908 #ifdef ANSI
2909 S16 cmUnpkLkwL2MeasSendReq
2910 (
2911 LkwL2MeasSendReq func,
2912 Pst *pst,
2913 Buffer *mBuf
2914 )
2915 #else
2916 S16 cmUnpkLkwL2MeasSendReq(func, pst, mBuf)
2917 LkwL2MeasSendReq func;
2918 Pst *pst;
2919 Buffer *mBuf;
2920 #endif
2921 {
2922    U8    measType;
2923
2924    TRC3(cmUnpkLkwL2MeasSendReq)
2925
2926    CMCHKUNPK(oduPackUInt8, &measType, mBuf); 
2927    SPutMsg(mBuf);
2928    return ((*func)(pst, measType));
2929 }
2930
2931 #ifdef ANSI
2932 S16 cmPkLkwL2MeasCfm
2933 (
2934 Pst * pst,
2935 RlcL2MeasCfmEvt *measCfmEvt
2936 )
2937 #else
2938 S16 cmPkLkwL2MeasCfm(pst, measCfmEvt)
2939 Pst * pst;
2940 RlcL2MeasCfmEvt *measCfmEvt;
2941 #endif
2942 {
2943    Buffer *mBuf = NULLP;
2944    U8 idx;
2945    U8 idx1;
2946
2947    TRC3(cmPkLkwL2MeasCfm)
2948
2949    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2950 #if (ERRCLASS & ERRCLS_ADD_RES)
2951       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2952             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2953             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2954 #endif
2955       SPutSBuf(pst->region, pst->pool, (Data *)measCfmEvt, sizeof(RlcL2MeasCfmEvt));
2956       return RFAILED;
2957    }
2958
2959    if((measCfmEvt->measType & LKW_L2MEAS_ACT_UE) || \
2960          (measCfmEvt->measType & LKW_L2MEAS_UU_LOSS) || \
2961          (measCfmEvt->measType & LKW_L2MEAS_DL_DISC) ||  \
2962          (measCfmEvt->measType & LKW_L2MEAS_DL_DELAY)) 
2963    {
2964       for(idx = 0; idx < measCfmEvt->val.nonIpThMeas.numCfm; idx++)
2965       {
2966          if (cmPkRlcL2MeasCfmInfo(&measCfmEvt->val.nonIpThMeas.measCfm[idx], \
2967                   mBuf, measCfmEvt->measType) != ROK) {
2968 #if (ERRCLASS & ERRCLS_ADD_RES)
2969             SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2970                   __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2971                   (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2972 #endif
2973             SPutMsg(mBuf);
2974             return RFAILED;
2975          }
2976       }
2977
2978       if (oduUnpackUInt16(measCfmEvt->val.nonIpThMeas.numCfm, mBuf) != ROK) {
2979 #if (ERRCLASS & ERRCLS_ADD_RES)
2980          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2981                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2982                (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
2983 #endif
2984          SPutMsg(mBuf);
2985          return RFAILED;
2986       }
2987    }
2988    else
2989    {
2990       for(idx1 =0 ;idx1< measCfmEvt->val.ipThMeas.numUes;idx1++)
2991       {
2992
2993          for(idx = 0; idx < measCfmEvt->val.ipThMeas.ueInfoLst[idx1].numCfm; idx++)
2994          {
2995             if (cmPkRlcL2MeasCfmInfo(&measCfmEvt->val.ipThMeas.ueInfoLst[idx1].\
2996                      measCfm[idx], mBuf, measCfmEvt->measType) != ROK) {
2997 #if (ERRCLASS & ERRCLS_ADD_RES)
2998                SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2999                      __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3000                      (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
3001 #endif
3002                SPutMsg(mBuf);
3003                return RFAILED;
3004             }
3005          }
3006
3007          if (oduUnpackUInt16(measCfmEvt->val.ipThMeas.ueInfoLst[idx1].numCfm, mBuf) != ROK) {
3008 #if (ERRCLASS & ERRCLS_ADD_RES)
3009             SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3010                   __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3011                   (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
3012 #endif
3013             SPutMsg(mBuf);
3014             return RFAILED;
3015          }
3016
3017          CMCHKPK(cmPkLteCellId, measCfmEvt->val.ipThMeas.ueInfoLst[idx1].cellId, mBuf);
3018          CMCHKPK(cmPkLteRnti,   measCfmEvt->val.ipThMeas.ueInfoLst[idx1].ueId, mBuf);
3019       }
3020       oduUnpackUInt16(measCfmEvt->val.ipThMeas.numUes, mBuf);
3021    }
3022
3023    CMCHKPK(oduUnpackUInt8, measCfmEvt->measType, mBuf);
3024    CMCHKPK(cmPkCmStatus, &measCfmEvt->status, mBuf);
3025    if (oduUnpackUInt32(measCfmEvt->transId, mBuf) != ROK) {
3026 #if (ERRCLASS & ERRCLS_ADD_RES)
3027       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3028             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3029             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
3030 #endif
3031       SPutMsg(mBuf);
3032       return RFAILED;
3033    }
3034    pst->event = (Event) LKW_EVT_L2MEAS_CFM;
3035    return (SPstTsk(pst,mBuf));
3036 }
3037
3038 #ifdef ANSI
3039 S16 cmPkRlcL2MeasCfmInfo
3040 (
3041 RlcL2MeasCfmInfo *param,
3042 Buffer *mBuf,
3043 U8 measType
3044 )
3045 #else
3046 S16 cmPkRlcL2MeasCfmInfo(param, mBuf, measType)
3047 RlcL2MeasCfmInfo *param;
3048 Buffer *mBuf;
3049 U8 measType;
3050 #endif
3051 {
3052    TRC3(cmPkRlcL2MeasCfmInfo)
3053
3054    if((measType & LKW_L2MEAS_DL_IP) ||
3055          (measType & LKW_L2MEAS_UL_IP))
3056    {
3057       CMCHKPK(SPkF32, param->val.ipThrput.ulIpThPut, mBuf);
3058       CMCHKPK(SPkF32, param->val.ipThrput.dlIpThPut, mBuf);
3059       CMCHKPK(oduUnpackUInt8, param->qci, mBuf);
3060       return ROK;
3061    }
3062    else  
3063    {
3064       CMCHKPK(oduUnpackUInt32, param->val.nonIpThrput.dlDiscRate, mBuf);
3065       CMCHKPK(oduUnpackUInt32, param->val.nonIpThrput.uuLoss, mBuf);
3066       CMCHKPK(oduUnpackUInt32, param->val.nonIpThrput.numActUe, mBuf);
3067       CMCHKPK(oduUnpackUInt32, param->val.nonIpThrput.dlSduDelay, mBuf);
3068       CMCHKPK(oduUnpackUInt8,  param->qci, mBuf);
3069    } 
3070    return ROK;
3071 }
3072
3073 #ifdef ANSI
3074 S16 cmUnpkLkwL2MeasCfm
3075 (
3076 LkwL2MeasCfm func,
3077 Pst *pst,
3078 Buffer *mBuf
3079 )
3080 #else
3081 S16 cmUnpkLkwL2MeasCfm(func, pst, mBuf)
3082 LkwL2MeasCfm func;
3083 Pst *pst;
3084 Buffer *mBuf;
3085 #endif
3086 {
3087    U8 idx;
3088    U16 idx1;
3089    RlcL2MeasCfmEvt measCfmEvt;
3090
3091    TRC3(cmUnpkLkwL2MeasCfm)
3092
3093    cmMemset((U8 *)&measCfmEvt, 0 , sizeof(RlcL2MeasCfmEvt));
3094
3095    if (oduPackUInt32(&measCfmEvt.transId, mBuf) != ROK) {
3096       SPutMsg(mBuf);
3097 #if (ERRCLASS & ERRCLS_ADD_RES)
3098       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3099             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3100             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
3101 #endif
3102       return RFAILED;
3103    }
3104    CMCHKUNPK(cmUnpkCmStatus, &measCfmEvt.status, mBuf);
3105    CMCHKUNPK(oduPackUInt8, &measCfmEvt.measType, mBuf);  
3106
3107    if(measCfmEvt.measType & LKW_L2MEAS_DL_IP || measCfmEvt.measType & LKW_L2MEAS_UL_IP)
3108    { 
3109       CMCHKUNPK(oduPackUInt16, &measCfmEvt.val.ipThMeas.numUes, mBuf);
3110       for(idx1 = 0;idx1<measCfmEvt.val.ipThMeas.numUes;idx1++)
3111       {
3112          CMCHKUNPK(cmUnpkLteRnti, &measCfmEvt.val.ipThMeas.\
3113                ueInfoLst[idx1].ueId, mBuf);
3114          CMCHKUNPK(cmUnpkLteCellId, &measCfmEvt.val.ipThMeas.\
3115                ueInfoLst[idx1].cellId, mBuf);
3116          if (oduPackUInt16(&measCfmEvt.val.ipThMeas.ueInfoLst[idx1].\
3117                   numCfm, mBuf) != ROK) {
3118             SPutMsg(mBuf);
3119 #if (ERRCLASS & ERRCLS_ADD_RES)
3120             SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3121                   __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3122                   (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
3123 #endif
3124             return RFAILED;
3125          }
3126          for(idx = measCfmEvt.val.ipThMeas.ueInfoLst[idx1].numCfm; idx > 0; idx--)
3127          {
3128             if (cmUnpkRlcL2MeasCfmInfo(&measCfmEvt.val.ipThMeas.ueInfoLst[idx1].\
3129                      measCfm[idx - 1], mBuf, measCfmEvt.measType) != ROK) {
3130                SPutMsg(mBuf);
3131 #if (ERRCLASS & ERRCLS_ADD_RES)
3132                SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3133                      __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3134                      (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
3135 #endif
3136                return RFAILED;
3137             }
3138          }
3139       }
3140    }
3141    else
3142    {
3143       if (oduPackUInt16(&measCfmEvt.val.nonIpThMeas.numCfm, mBuf) != ROK) {
3144          SPutMsg(mBuf);
3145 #if (ERRCLASS & ERRCLS_ADD_RES)
3146          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3147                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3148                (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
3149 #endif
3150          return RFAILED;
3151       }
3152       for(idx = measCfmEvt.val.nonIpThMeas.numCfm; idx > 0; idx--)
3153       {
3154          if (cmUnpkRlcL2MeasCfmInfo(&measCfmEvt.val.nonIpThMeas.measCfm[idx - 1], \
3155                   mBuf, measCfmEvt.measType) != ROK) {
3156             SPutMsg(mBuf);
3157 #if (ERRCLASS & ERRCLS_ADD_RES)
3158             SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3159                   __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3160                   (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
3161 #endif
3162             return RFAILED;
3163          }
3164       }
3165    }
3166    SPutMsg(mBuf);
3167    return ((*func)(pst, &measCfmEvt));
3168 }
3169
3170 #ifdef ANSI
3171 S16 cmUnpkRlcL2MeasCfmInfo
3172 (
3173 RlcL2MeasCfmInfo *param,
3174 Buffer *mBuf,
3175 U8 measType
3176 )
3177 #else
3178 S16 cmUnpkRlcL2MeasCfmInfo(param, mBuf, measType)
3179 RlcL2MeasCfmInfo *param;
3180 Buffer *mBuf;
3181 U8 measType;
3182 #endif
3183 {
3184    TRC3(cmUnpkRlcL2MeasCfmInfo)
3185
3186    if((measType & LKW_L2MEAS_DL_IP) ||
3187          (measType & LKW_L2MEAS_UL_IP))
3188    {
3189       CMCHKUNPK(oduPackUInt8,  &param->qci, mBuf);
3190       CMCHKUNPK(SUnpkF32, &param->val.ipThrput.dlIpThPut, mBuf);
3191       CMCHKUNPK(SUnpkF32, &param->val.ipThrput.ulIpThPut, mBuf);
3192    }
3193    else
3194
3195    {
3196       CMCHKUNPK(oduPackUInt8,  &param->qci, mBuf);
3197       CMCHKUNPK(oduPackUInt32, &param->val.nonIpThrput.dlSduDelay, mBuf);
3198       CMCHKUNPK(oduPackUInt32, &param->val.nonIpThrput.numActUe, mBuf);
3199       CMCHKUNPK(oduPackUInt32, &param->val.nonIpThrput.uuLoss, mBuf);
3200       CMCHKUNPK(oduPackUInt32, &param->val.nonIpThrput.dlDiscRate, mBuf);
3201    }
3202    return ROK;
3203 }
3204
3205
3206 #ifdef ANSI
3207 S16 cmPkLkwL2MeasStopCfm
3208 (
3209 Pst * pst,
3210 U8 measType,
3211 U8 status
3212 )
3213 #else
3214 S16 cmPkLkwL2MeasStopCfm(pst, measType,status)
3215 Pst * pst;
3216 U8  measType;
3217 U8  status
3218 #endif
3219 {
3220    Buffer *mBuf = NULLP;
3221    TRC3(cmPkLkwL2MeasStopCfm)
3222
3223    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3224 #if (ERRCLASS & ERRCLS_ADD_RES)
3225       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3226             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3227             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
3228 #endif
3229       return RFAILED;
3230    }
3231    CMCHKPK(oduUnpackUInt8, status, mBuf);
3232    CMCHKPK(oduUnpackUInt8, measType, mBuf);
3233    pst->event = (Event) LKW_EVT_L2MEAS_STOP_CFM;
3234    return (SPstTsk(pst,mBuf));
3235 }
3236
3237 #ifdef ANSI
3238 S16 cmUnpkLkwL2MeasStopCfm
3239 (
3240 LkwL2MeasStopCfm func,
3241 Pst *pst,
3242 Buffer *mBuf
3243 )
3244 #else
3245 S16 cmUnpkLkwL2MeasStopCfm(func, pst, mBuf)
3246 LkwL2MeasStopCfm func;
3247 Pst *pst;
3248 Buffer *mBuf;
3249 #endif
3250 {
3251    U8 measType;
3252    U8 status;
3253    TRC3(cmUnpkLkwL2MeasCfm)
3254    CMCHKUNPK(oduPackUInt8,  &measType, mBuf);
3255    CMCHKUNPK(oduPackUInt8,  &status, mBuf);
3256    SPutMsg(mBuf);
3257    return ((*func)(pst, measType,status));
3258 }
3259 #endif /* LTE_L2_MEAS */
3260 #endif /* LCLKW */
3261
3262 \f  
3263 /**********************************************************************
3264          End of file
3265  **********************************************************************/