Initial commit for Bronze release
[o-du/l2.git] / src / cm / rgu.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18
19 /************************************************************************
20  
21      Name:     LTE-MAC layer
22   
23      Type:     C source file
24   
25      Desc:     C source code for packing/unpacking of RGU interface
26                primitives.
27   
28      File:     rgu.c 
29   
30 **********************************************************************/
31
32 /** @file rgu.c
33 @brief This file contains the packing/unpacking code for the RGU interface 
34        primitives.
35 */
36
37 /* header include files (.h) */
38 #include "envopt.h"        /* environment options */
39 #include "envdep.h"        /* environment dependent */
40 #include "envind.h"        /* environment independent */
41 #include "gen.h"           /* general */
42 #include "ssi.h"           /* system services */
43 #include "cm_tkns.h"       /* Common Token Defines */
44 #include "cm_llist.h"      /* Common Link List Defines */
45 #include "cm_hash.h"       /* Common Hash List Defines */
46 #include "cm_lte.h"        /* Common LTE Defines */
47 #include "rgu.h"           /* RGU Interface defines */
48
49 /* header/extern include files (.x) */
50 #include "gen.x"           /* general */
51 #include "ssi.x"           /* system services */
52 #include "cm_tkns.x"       /* Common Token Definitions */
53 #include "cm_llist.x"      /* Common Link List Definitions */
54 #include "cm_lib.x"        /* Common Library Definitions */
55 #include "cm_hash.x"       /* Common Hash List Definitions */
56 #include "cm_lte.x"        /* Common LTE Defines */
57 #include "rgu.x"           /* RGU Interface includes */
58
59 #ifdef SS_RBUF
60 #include "ss_rbuf.h"
61 #include "ss_rbuf.x"
62 #endif
63
64 #ifdef LCRGU
65
66 \f
67 /**
68 * @brief Request from RLC to MAC to bind the interface saps
69 *
70 * @details
71 *
72 *     Function : cmPkRguBndReq
73 *
74 *  @param[in]   Pst*  pst
75 *  @param[in]   SuId  suId
76 *  @param[in]   SpId  spId
77 *  @return   S16
78 *      -# ROK
79 **/
80 #ifdef ANSI
81 PUBLIC S16 cmPkRguBndReq
82 (
83 Pst* pst,
84 SuId suId,
85 SpId spId
86 )
87 #else
88 PUBLIC S16 cmPkRguBndReq(pst, suId, spId)
89 Pst* pst;
90 SuId suId;
91 SpId spId;
92 #endif
93 {
94    Buffer *mBuf = NULLP;
95    TRC3(cmPkRguBndReq)
96
97    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
98 #if (ERRCLASS & ERRCLS_ADD_RES)      
99       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
100           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
101           (ErrVal)ERGU001, (ErrVal)0, "Packing failed");
102 #endif      
103       RETVALUE(RFAILED);
104    }
105    if (SPkS16(spId, mBuf) != ROK) {
106 #if (ERRCLASS & ERRCLS_ADD_RES)      
107       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
108           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
109           (ErrVal)ERGU002, (ErrVal)0, "Packing failed");
110 #endif      
111       SPutMsg(mBuf);
112       RETVALUE(RFAILED);
113    }
114    if (SPkS16(suId, mBuf) != ROK) {
115 #if (ERRCLASS & ERRCLS_ADD_RES)      
116       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
117           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
118           (ErrVal)ERGU003, (ErrVal)0, "Packing failed");
119 #endif      
120       SPutMsg(mBuf);
121       RETVALUE(RFAILED);
122    }
123    pst->event = (Event) EVTRGUBNDREQ;
124    RETVALUE(SPstTsk(pst,mBuf));
125 }
126
127 \f
128 /**
129 * @brief Request from RLC to MAC to bind the interface saps
130 *
131 * @details
132 *
133 *     Function : cmUnpkRguBndReq
134 *
135 *  @param[in]   Pst*  pst
136 *  @param[in]   SuId  suId
137 *  @param[in]   SpId  spId
138 *  @return   S16
139 *      -# ROK
140 **/
141 #ifdef ANSI
142 PUBLIC S16 cmUnpkRguBndReq
143 (
144 RguBndReq func,
145 Pst *pst,
146 Buffer *mBuf
147 )
148 #else
149 PUBLIC S16 cmUnpkRguBndReq(func, pst, mBuf)
150 RguBndReq func;
151 Pst *pst;
152 Buffer *mBuf;
153 #endif
154 {
155    SuId suId;
156    SpId spId;
157    
158    TRC3(cmUnpkRguBndReq)
159
160    if (SUnpkS16(&suId, mBuf) != ROK) {
161 #if (ERRCLASS & ERRCLS_ADD_RES)      
162       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
163           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
164           (ErrVal)ERGU004, (ErrVal)0, "UnPacking failed");
165 #endif      
166       SPutMsg(mBuf);
167       RETVALUE(RFAILED);
168    }
169    if (SUnpkS16(&spId, mBuf) != ROK) {
170 #if (ERRCLASS & ERRCLS_ADD_RES)      
171       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
172           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
173           (ErrVal)ERGU005, (ErrVal)0, "UnPacking failed");
174 #endif      
175       SPutMsg(mBuf);
176       RETVALUE(RFAILED);
177    }
178    SPutMsg(mBuf);
179    RETVALUE((*func)(pst, suId, spId));
180 }
181
182 \f
183 /**
184 * @brief Request from RLC to MAC to Unbind the interface saps
185 *
186 * @details
187 *
188 *     Function : cmPkRguUbndReq
189 *
190 *  @param[in]   Pst*  pst
191 *  @param[in]   SpId  spId
192 *  @param[in]   Reason  reason
193 *  @return   S16
194 *      -# ROK
195 **/
196 #ifdef ANSI
197 PUBLIC S16 cmPkRguUbndReq
198 (
199 Pst* pst,
200 SpId spId,
201 Reason reason
202 )
203 #else
204 PUBLIC S16 cmPkRguUbndReq(pst, spId, reason)
205 Pst* pst;
206 SpId spId;
207 Reason reason;
208 #endif
209 {
210    Buffer *mBuf = NULLP;
211    TRC3(cmPkRguUbndReq)
212
213    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
214 #if (ERRCLASS & ERRCLS_ADD_RES)      
215       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
216           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
217           (ErrVal)ERGU006, (ErrVal)0, "Packing failed");
218 #endif      
219       RETVALUE(RFAILED);
220    }
221    if (SPkS16(reason, mBuf) != ROK) {
222 #if (ERRCLASS & ERRCLS_ADD_RES)      
223       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
224           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
225           (ErrVal)ERGU007, (ErrVal)0, "Packing failed");
226 #endif      
227       SPutMsg(mBuf);
228       RETVALUE(RFAILED);
229    }
230    if (SPkS16(spId, mBuf) != ROK) {
231 #if (ERRCLASS & ERRCLS_ADD_RES)      
232       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
233           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
234           (ErrVal)ERGU008, (ErrVal)0, "Packing failed");
235 #endif      
236       SPutMsg(mBuf);
237       RETVALUE(RFAILED);
238    }
239    pst->event = (Event) EVTRGUUBNDREQ;
240    RETVALUE(SPstTsk(pst,mBuf));
241 }
242
243 \f
244 /**
245 * @brief Request from RLC to MAC to Unbind the interface saps
246 *
247 * @details
248 *
249 *     Function : cmUnpkRguUbndReq
250 *
251 *  @param[in]   Pst*  pst
252 *  @param[in]   SpId  spId
253 *  @param[in]   Reason  reason
254 *  @return   S16
255 *      -# ROK
256 **/
257 #ifdef ANSI
258 PUBLIC S16 cmUnpkRguUbndReq
259 (
260 RguUbndReq func,
261 Pst *pst,
262 Buffer *mBuf
263 )
264 #else
265 PUBLIC S16 cmUnpkRguUbndReq(func, pst, mBuf)
266 RguUbndReq func;
267 Pst *pst;
268 Buffer *mBuf;
269 #endif
270 {
271    SpId spId;
272    Reason reason;
273    
274    TRC3(cmUnpkRguUbndReq)
275
276    if (SUnpkS16(&spId, mBuf) != ROK) {
277 #if (ERRCLASS & ERRCLS_ADD_RES)      
278       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
279           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
280           (ErrVal)ERGU009, (ErrVal)0, "UnPacking failed");
281 #endif      
282       SPutMsg(mBuf);
283       RETVALUE(RFAILED);
284    }
285    if (SUnpkS16(&reason, mBuf) != ROK) {
286 #if (ERRCLASS & ERRCLS_ADD_RES)      
287       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
288           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
289           (ErrVal)ERGU010, (ErrVal)0, "UnPacking failed");
290 #endif      
291       SPutMsg(mBuf);
292       RETVALUE(RFAILED);
293    }
294    SPutMsg(mBuf);
295    RETVALUE((*func)(pst, spId, reason));
296 }
297
298 \f
299 /**
300 * @brief Confirmation from MAC to RLC for the bind/Unbind 
301  * request for the interface saps
302 *
303 * @details
304 *
305 *     Function : cmPkRguBndCfm
306 *
307 *  @param[in]   Pst*  pst
308 *  @param[in]   SuId  suId
309 *  @param[in]   U8  status
310 *  @return   S16
311 *      -# ROK
312 **/
313 #ifdef ANSI
314 PUBLIC S16 cmPkRguBndCfm
315 (
316 Pst* pst,
317 SuId suId,
318 U8 status
319 )
320 #else
321 PUBLIC S16 cmPkRguBndCfm(pst, suId, status)
322 Pst* pst;
323 SuId suId;
324 U8 status;
325 #endif
326 {
327    Buffer *mBuf = NULLP;
328    TRC3(cmPkRguBndCfm)
329
330    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
331 #if (ERRCLASS & ERRCLS_ADD_RES)      
332       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
333           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
334           (ErrVal)ERGU011, (ErrVal)0, "Packing failed");
335 #endif      
336       RETVALUE(RFAILED);
337    }
338    if (SPkU8(status, mBuf) != ROK) {
339 #if (ERRCLASS & ERRCLS_ADD_RES)      
340       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
341           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
342           (ErrVal)ERGU012, (ErrVal)0, "Packing failed");
343 #endif      
344       SPutMsg(mBuf);
345       RETVALUE(RFAILED);
346    }
347    if (SPkS16(suId, mBuf) != ROK) {
348 #if (ERRCLASS & ERRCLS_ADD_RES)      
349       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
350           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
351           (ErrVal)ERGU013, (ErrVal)0, "Packing failed");
352 #endif      
353       SPutMsg(mBuf);
354       RETVALUE(RFAILED);
355    }
356    pst->event = (Event) EVTRGUBNDCFM;
357    RETVALUE(SPstTsk(pst,mBuf));
358 }
359
360 \f
361 /**
362 * @brief Confirmation from MAC to RLC for the bind/Unbind 
363  * request for the interface saps
364 *
365 * @details
366 *
367 *     Function : cmUnpkRguBndCfm
368 *
369 *  @param[in]   Pst*  pst
370 *  @param[in]   SuId  suId
371 *  @param[in]   U8  status
372 *  @return   S16
373 *      -# ROK
374 **/
375 #ifdef ANSI
376 PUBLIC S16 cmUnpkRguBndCfm
377 (
378 RguBndCfm func,
379 Pst *pst,
380 Buffer *mBuf
381 )
382 #else
383 PUBLIC S16 cmUnpkRguBndCfm(func, pst, mBuf)
384 RguBndCfm func;
385 Pst *pst;
386 Buffer *mBuf;
387 #endif
388 {
389    SuId suId;
390    U8 status;
391    
392    TRC3(cmUnpkRguBndCfm)
393
394    if (SUnpkS16(&suId, mBuf) != ROK) {
395 #if (ERRCLASS & ERRCLS_ADD_RES)      
396       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
397           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
398           (ErrVal)ERGU014, (ErrVal)0, "UnPacking failed");
399 #endif      
400       SPutMsg(mBuf);
401       RETVALUE(RFAILED);
402    }
403    if (SUnpkU8(&status, mBuf) != ROK) {
404 #if (ERRCLASS & ERRCLS_ADD_RES)      
405       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
406           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
407           (ErrVal)ERGU015, (ErrVal)0, "UnPacking failed");
408 #endif      
409       SPutMsg(mBuf);
410       RETVALUE(RFAILED);
411    }
412    SPutMsg(mBuf);
413    RETVALUE((*func)(pst, suId, status));
414 }
415
416 \f
417 /**
418 * @brief Request from RLC to MAC for forwarding SDUs on common
419  * channel for transmission
420 *
421 * @details
422 *
423 *     Function : cmPkRguCDatReq
424 *
425 *  @param[in]   Pst*  pst
426 *  @param[in]   SpId  spId
427 *  @param[in]   RguCDatReqInfo  *  datReq
428 *  @return   S16
429 *      -# ROK
430 **/
431 #ifdef ANSI
432 PUBLIC S16 cmPkRguCDatReq
433 (
434 Pst* pst,
435 SpId spId,
436 RguCDatReqInfo  * datReq
437 )
438 #else
439 PUBLIC S16 cmPkRguCDatReq(pst, spId, datReq)
440 Pst* pst;
441 SpId spId;
442 RguCDatReqInfo  * datReq;
443 #endif
444 {
445    Buffer *mBuf = NULLP;
446    TRC3(cmPkRguCDatReq)
447
448    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
449 #if (ERRCLASS & ERRCLS_ADD_RES)      
450       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
451           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
452           (ErrVal)ERGU016, (ErrVal)0, "Packing failed");
453 #endif      
454       SPutSBuf(pst->region, pst->pool, (Data *)datReq, sizeof(RguCDatReqInfo));
455       RETVALUE(RFAILED);
456    }
457    if (pst->selector == RGU_SEL_LWLC)
458    {
459       CMCHKPK(cmPkPtr,(PTR) datReq, mBuf);
460    }
461    else
462    {
463       if (cmPkRguCDatReqInfo(datReq, mBuf) != ROK) {
464 #if (ERRCLASS & ERRCLS_ADD_RES)      
465          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
466           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
467           (ErrVal)ERGU017, (ErrVal)0, "Packing failed");
468 #endif      
469          SPutSBuf(pst->region, pst->pool, 
470                   (Data *)datReq, sizeof(RguCDatReqInfo));
471          SPutMsg(mBuf);
472          RETVALUE(RFAILED);
473       }
474       if (SPutSBuf(pst->region, pst->pool, 
475                    (Data *)datReq, sizeof(RguCDatReqInfo)) != ROK) {
476 #if (ERRCLASS & ERRCLS_ADD_RES)      
477          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
478              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
479              (ErrVal)ERGU019, (ErrVal)0, "Packing failed");
480 #endif      
481          SPutMsg(mBuf);
482          RETVALUE(RFAILED);
483       }
484       datReq = NULLP;
485    }
486
487    if (SPkS16(spId, mBuf) != ROK) {
488 #if (ERRCLASS & ERRCLS_ADD_RES)      
489       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
490           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
491           (ErrVal)ERGU018, (ErrVal)0, "Packing failed");
492 #endif      
493
494       if (datReq != NULLP)
495       {
496          SPutSBuf(pst->region, pst->pool, 
497                    (Data *)datReq, sizeof(RguCDatReqInfo));
498       }
499
500       SPutMsg(mBuf);
501       RETVALUE(RFAILED);
502    }
503
504    pst->event = (Event) EVTRGUCDATREQ;
505    RETVALUE(SPstTsk(pst,mBuf));
506 }
507
508 \f
509 /**
510 * @brief Request from RLC to MAC for forwarding SDUs on common
511  * channel for transmission
512 *
513 * @details
514 *
515 *     Function : cmUnpkRguCDatReq
516 *
517 *  @param[in]   Pst*  pst
518 *  @param[in]   SpId  spId
519 *  @param[in]   RguCDatReqInfo  *  datReq
520 *  @return   S16
521 *      -# ROK
522 **/
523 #ifdef ANSI
524 PUBLIC S16 cmUnpkRguCDatReq
525 (
526 RguCDatReq func,
527 Pst *pst,
528 Buffer *mBuf
529 )
530 #else
531 PUBLIC S16 cmUnpkRguCDatReq(func, pst, mBuf)
532 RguCDatReq func;
533 Pst *pst;
534 Buffer *mBuf;
535 #endif
536 {
537    SpId spId;
538    RguCDatReqInfo *datReq;
539    
540    TRC3(cmUnpkRguCDatReq)
541
542    if (SUnpkS16(&spId, mBuf) != ROK) {
543       SPutMsg(mBuf);
544       RETVALUE(RFAILED);
545    }
546    if (pst->selector == RGU_SEL_LWLC)
547    {
548       CMCHKUNPK(cmUnpkPtr,(PTR *) &datReq, mBuf);
549    }
550    else 
551    {
552       if ((SGetSBuf(pst->region, pst->pool, 
553                    (Data **)&datReq, sizeof(RguCDatReqInfo))) != ROK) {
554 #if (ERRCLASS & ERRCLS_ADD_RES)      
555          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
556              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
557              (ErrVal)ERGU020, (ErrVal)0, "UnPacking failed");
558 #endif      
559          SPutMsg(mBuf);
560          RETVALUE(RFAILED);
561      }
562      cmMemset((U8*)datReq, (U8)0, sizeof(RguCDatReqInfo));
563      if (cmUnpkRguCDatReqInfo(datReq, mBuf) != ROK) {
564 #if (ERRCLASS & ERRCLS_ADD_RES)      
565          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
566              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
567              (ErrVal)ERGU021, (ErrVal)0, "UnPacking failed");
568 #endif      
569          SPutMsg(mBuf);
570          SPutSBuf(pst->region, pst->pool, 
571                   (Data *)datReq, sizeof(RguCDatReqInfo));
572          RETVALUE(RFAILED);
573       }
574    }
575    SPutMsg(mBuf);
576    RETVALUE((*func)(pst, spId, datReq));
577 }
578
579 \f
580 /**
581 * @brief Request from RLC to MAC for forwarding SDUs on 
582  * dedicated channel for transmission
583 *
584 * @details
585 *
586 *     Function : cmPkRguDDatReq
587 *
588 *  @param[in]   Pst*  pst
589 *  @param[in]   SpId  spId
590 *  @param[in]   RguDDatReqInfo  *  datReq
591 *  @return   S16
592 *      -# ROK
593 **/
594 #ifdef ANSI
595 PUBLIC S16 cmPkRguDDatReq
596 (
597 Pst* pst,
598 SpId spId,
599 RguDDatReqInfo  * datReq
600 )
601 #else
602 PUBLIC S16 cmPkRguDDatReq(pst, spId, datReq)
603 Pst* pst;
604 SpId spId;
605 RguDDatReqInfo  * datReq;
606 #endif
607 {
608    Buffer *mBuf = NULLP;
609    TRC3(cmPkRguDDatReq)
610
611    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
612 #if (ERRCLASS & ERRCLS_ADD_RES)      
613       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
614           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
615           (ErrVal)ERGU022, (ErrVal)0, "Packing failed");
616 #endif      
617       SPutSBuf(pst->region, pst->pool, (Data *)datReq, sizeof(RguDDatReqInfo));
618       RETVALUE(RFAILED);
619    }
620
621    if (pst->selector == RGU_SEL_LWLC)
622    {
623       CMCHKPK(cmPkPtr,(PTR) datReq, mBuf);
624    }
625    else
626    {
627       /*rgu_c_001.main_5 - ADD - L2M Support */
628 #ifdef LTE_L2_MEAS
629       if (cmPkRguDDatReqInfo(pst, datReq, mBuf) != ROK)
630 #else
631       if (cmPkRguDDatReqInfo(datReq, mBuf) != ROK) 
632 #endif
633       {
634 #if (ERRCLASS & ERRCLS_ADD_RES)      
635          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
636           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
637           (ErrVal)ERGU023, (ErrVal)0, "Packing failed");
638 #endif      
639          SPutSBuf(pst->region, pst->pool, (Data *)datReq,
640                                        sizeof(RguDDatReqInfo));
641          SPutMsg(mBuf);
642          RETVALUE(RFAILED);
643       }
644
645       if (SPutSBuf(pst->region, pst->pool, 
646                    (Data *)datReq, sizeof(RguDDatReqInfo)) != ROK) {
647 #if (ERRCLASS & ERRCLS_ADD_RES)      
648          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
649               __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
650              (ErrVal)ERGU025, (ErrVal)0, "Packing failed");
651 #endif      
652          SPutMsg(mBuf);
653          RETVALUE(RFAILED);
654       }
655       datReq = NULLP;
656    }
657    if (SPkS16(spId, mBuf) != ROK) {
658 #if (ERRCLASS & ERRCLS_ADD_RES)      
659       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
660           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
661           (ErrVal)ERGU024, (ErrVal)0, "Packing failed");
662 #endif      
663       if (datReq != NULLP);
664       {
665          SPutSBuf(pst->region, pst->pool, 
666                   (Data *)datReq, sizeof(RguDDatReqInfo));
667       }
668       SPutMsg(mBuf);
669       RETVALUE(RFAILED);
670    }
671    pst->event = (Event) EVTRGUDDATREQ;
672    RETVALUE(SPstTsk(pst,mBuf));
673 }
674
675 \f
676 /**
677 * @brief Request from RLC to MAC for forwarding SDUs on 
678  * dedicated channel for transmission
679 *
680 * @details
681 *
682 *     Function : cmUnpkRguDDatReq
683 *
684 *  @param[in]   Pst*  pst
685 *  @param[in]   SpId  spId
686 *  @param[in]   RguDDatReqInfo  *  datReq
687 *  @return   S16
688 *      -# ROK
689 **/
690 #ifdef ANSI
691 PUBLIC S16 cmUnpkRguDDatReq
692 (
693 RguDDatReq func,
694 Pst *pst,
695 Buffer *mBuf
696 )
697 #else
698 PUBLIC S16 cmUnpkRguDDatReq(func, pst, mBuf)
699 RguDDatReq func;
700 Pst *pst;
701 Buffer *mBuf;
702 #endif
703 {
704    SpId spId;
705    RguDDatReqInfo *datReq;
706    
707    TRC3(cmUnpkRguDDatReq)
708
709    if (SUnpkS16(&spId, mBuf) != ROK) {
710       SPutMsg(mBuf);
711       RETVALUE(RFAILED);
712    }
713
714    if (pst->selector == RGU_SEL_LWLC)
715    {
716       CMCHKUNPK(cmUnpkPtr,(PTR *) &datReq, mBuf);
717    }
718    else 
719    {
720       if ((SGetSBuf(pst->region, pst->pool, 
721                      (Data **)&datReq, sizeof(RguDDatReqInfo))) != ROK) {
722 #if (ERRCLASS & ERRCLS_ADD_RES)      
723          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
724              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
725              (ErrVal)ERGU026, (ErrVal)0, "UnPacking failed");
726 #endif      
727          SPutMsg(mBuf);
728          RETVALUE(RFAILED);
729       }
730       cmMemset((U8*)datReq, (U8)0, sizeof(RguDDatReqInfo));
731   /*rgu_c_001.main_5 - ADD - L2M Support */
732 #ifdef LTE_L2_MEAS
733       if (cmUnpkRguDDatReqInfo(pst,datReq, mBuf) != ROK)
734 #else
735       if (cmUnpkRguDDatReqInfo(datReq, mBuf) != ROK) 
736 #endif
737       {
738 #if (ERRCLASS & ERRCLS_ADD_RES)      
739          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
740              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
741              (ErrVal)ERGU027, (ErrVal)0, "UnPacking failed");
742 #endif      
743          SPutMsg(mBuf);
744          SPutSBuf(pst->region, pst->pool, (Data *)datReq,
745                                      sizeof(RguDDatReqInfo));
746          RETVALUE(RFAILED);
747       }
748    }
749    SPutMsg(mBuf);
750    RETVALUE((*func)(pst, spId, datReq));
751 }
752
753 \f
754 /**
755 * @brief Data Indication from MAC to RLC to 
756  * forward the data received for common channels
757 *
758 * @details
759 *
760 *     Function : cmPkRguCDatInd
761 *
762 *  @param[in]   Pst*  pst
763 *  @param[in]   SuId  suId
764 *  @param[in]   RguCDatIndInfo  *  datInd
765 *  @return   S16
766 *      -# ROK
767 **/
768 #ifdef ANSI
769 PUBLIC S16 cmPkRguCDatInd
770 (
771 Pst* pst,
772 SuId suId,
773 RguCDatIndInfo  * datInd
774 )
775 #else
776 PUBLIC S16 cmPkRguCDatInd(pst, suId, datInd)
777 Pst* pst;
778 SuId suId;
779 RguCDatIndInfo  * datInd;
780 #endif
781 {
782    Buffer *mBuf = NULLP;
783    TRC3(cmPkRguCDatInd)
784
785    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
786 #if (ERRCLASS & ERRCLS_ADD_RES)      
787       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
788           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
789           (ErrVal)ERGU028, (ErrVal)0, "Packing failed");
790 #endif      
791       SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, sizeof(RguCDatIndInfo),0);
792       RETVALUE(RFAILED);
793    }
794    if (pst->selector == RGU_SEL_LWLC)
795    {
796       CMCHKPK(cmPkPtr,(PTR) datInd, mBuf);
797    }
798    else
799    {
800       if (cmPkRguCDatIndInfo(datInd, mBuf) != ROK) {
801 #if (ERRCLASS & ERRCLS_ADD_RES)      
802         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
803             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
804             (ErrVal)ERGU029, (ErrVal)0, "Packing failed");
805 #endif      
806         SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd,
807                                     sizeof(RguCDatIndInfo),0);
808         SPutMsg(mBuf);
809         RETVALUE(RFAILED);
810      }
811      if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, 
812                                sizeof(RguCDatIndInfo),0) != ROK) {
813 #if (ERRCLASS & ERRCLS_ADD_RES)      
814         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
815             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
816             (ErrVal)ERGU031, (ErrVal)0, "Packing failed");
817 #endif      
818         SPutMsg(mBuf);
819         RETVALUE(RFAILED);
820      }
821      datInd = NULLP;
822   }
823    if (SPkS16(suId, mBuf) != ROK) {
824 #if (ERRCLASS & ERRCLS_ADD_RES)      
825       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
826           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
827           (ErrVal)ERGU030, (ErrVal)0, "Packing failed");
828 #endif      
829       SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, sizeof(RguCDatIndInfo),0);
830       SPutMsg(mBuf);
831       RETVALUE(RFAILED);
832    }
833
834    pst->event = (Event) EVTRGUCDATIND;
835    RETVALUE(SPstTsk(pst,mBuf));
836 }
837
838 \f
839 /**
840 * @brief Data Indication from MAC to RLC to 
841  * forward the data received for common channels
842 *
843 * @details
844 *
845 *     Function : cmUnpkRguCDatInd
846 *
847 *  @param[in]   Pst*  pst
848 *  @param[in]   SuId  suId
849 *  @param[in]   RguCDatIndInfo  *  datInd
850 *  @return   S16
851 *      -# ROK
852 **/
853 #ifdef ANSI
854 PUBLIC S16 cmUnpkRguCDatInd
855 (
856 RguCDatInd func,
857 Pst *pst,
858 Buffer *mBuf
859 )
860 #else
861 PUBLIC S16 cmUnpkRguCDatInd(func, pst, mBuf)
862 RguCDatInd func;
863 Pst *pst;
864 Buffer *mBuf;
865 #endif
866 {
867    SuId suId;
868    RguCDatIndInfo *datInd;
869    
870    TRC3(cmUnpkRguCDatInd)
871
872    if (SUnpkS16(&suId, mBuf) != ROK) {
873 #if (ERRCLASS & ERRCLS_ADD_RES)      
874       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
875           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
876           (ErrVal)ERGU032, (ErrVal)0, "UnPacking failed");
877 #endif      
878       SPutMsg(mBuf);
879       RETVALUE(RFAILED);
880    }
881
882    if (pst->selector == RGU_SEL_LWLC)
883    {
884       CMCHKUNPK(cmUnpkPtr,(PTR *) &datInd, mBuf);
885    }
886    else 
887    {
888       if ((SGetStaticBuffer(pst->region, pst->pool, 
889                     (Data **)&datInd, sizeof(RguCDatIndInfo),0)) != ROK) {
890 #if (ERRCLASS & ERRCLS_ADD_RES)      
891          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
892              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
893              (ErrVal)ERGU033, (ErrVal)0, "UnPacking failed");
894 #endif      
895          SPutMsg(mBuf);
896          RETVALUE(RFAILED);
897       }
898       if (cmUnpkRguCDatIndInfo(datInd, mBuf) != ROK) {
899 #if (ERRCLASS & ERRCLS_ADD_RES)      
900          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
901              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
902              (ErrVal)ERGU034, (ErrVal)0, "UnPacking failed");
903 #endif      
904          SPutMsg(mBuf);
905          SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, 
906                                        sizeof(RguCDatIndInfo),0);
907          RETVALUE(RFAILED);
908       }
909    }
910    SPutMsg(mBuf);
911    RETVALUE((*func)(pst, suId, datInd));
912 }
913
914 \f
915 /**
916 * @brief Data Indication from MAC to RLC to 
917  * forward the data received for dedicated channels
918 *
919 * @details
920 *
921 *     Function : cmPkRguDDatInd
922 *
923 *  @param[in]   Pst*  pst
924 *  @param[in]   SuId  suId
925 *  @param[in]   RguDDatIndInfo  *  datInd
926 *  @return   S16
927 *      -# ROK
928 **/
929 #ifdef ANSI
930 PUBLIC S16 cmPkRguDDatInd
931 (
932 Pst* pst,
933 SuId suId,
934 RguDDatIndInfo  * datInd
935 )
936 #else
937 PUBLIC S16 cmPkRguDDatInd(pst, suId, datInd)
938 Pst* pst;
939 SuId suId;
940 RguDDatIndInfo  * datInd;
941 #endif
942 {
943    Buffer *mBuf = NULLP;
944    TRC3(cmPkRguDDatInd)
945
946    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
947 #if (ERRCLASS & ERRCLS_ADD_RES)      
948       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
949           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
950           (ErrVal)ERGU035, (ErrVal)0, "Packing failed");
951 #endif      
952       SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, sizeof(RguDDatIndInfo),0);
953       RETVALUE(RFAILED);
954    }
955
956    if (pst->selector == RGU_SEL_LWLC)
957    {
958       CMCHKPK(cmPkPtr,(PTR) datInd, mBuf);
959    }
960    else
961    {
962       if (cmPkRguDDatIndInfo(datInd, mBuf) != ROK) {
963 #if (ERRCLASS & ERRCLS_ADD_RES)      
964             SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
965                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
966                 (ErrVal)ERGU036, (ErrVal)0, "Packing failed");
967 #endif            
968          SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, sizeof(RguDDatIndInfo),0);
969          SPutMsg(mBuf);
970          RETVALUE(RFAILED);
971       }
972
973       if (SPutStaticBuffer(pst->region, pst->pool, 
974                       (Data *)datInd, sizeof(RguDDatIndInfo),0) != ROK) {
975 #if (ERRCLASS & ERRCLS_ADD_RES)      
976          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
977              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
978              (ErrVal)ERGU038, (ErrVal)0, "Packing failed");
979 #endif      
980          SPutMsg(mBuf);
981          RETVALUE(RFAILED);
982       }
983       datInd = NULLP;
984    }
985    if (SPkS16(suId, mBuf) != ROK) {
986 #if (ERRCLASS & ERRCLS_ADD_RES)      
987       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
988           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
989           (ErrVal)ERGU037, (ErrVal)0, "Packing failed");
990 #endif      
991       SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, sizeof(RguDDatIndInfo),0);
992       SPutMsg(mBuf);
993       RETVALUE(RFAILED);
994    }
995
996    pst->event = (Event) EVTRGUDDATIND;
997    RETVALUE(SPstTsk(pst,mBuf));
998 }
999
1000 \f
1001 /**
1002 * @brief Data Indication from MAC to RLC to 
1003  * forward the data received for dedicated channels
1004 *
1005 * @details
1006 *
1007 *     Function : cmUnpkRguDDatInd
1008 *
1009 *  @param[in]   Pst*  pst
1010 *  @param[in]   SuId  suId
1011 *  @param[in]   RguDDatIndInfo  *  datInd
1012 *  @return   S16
1013 *      -# ROK
1014 **/
1015 #ifdef ANSI
1016 PUBLIC S16 cmUnpkRguDDatInd
1017 (
1018 RguDDatInd func,
1019 Pst *pst,
1020 Buffer *mBuf
1021 )
1022 #else
1023 PUBLIC S16 cmUnpkRguDDatInd(func, pst, mBuf)
1024 RguDDatInd func;
1025 Pst *pst;
1026 Buffer *mBuf;
1027 #endif
1028 {
1029    SuId suId;
1030    RguDDatIndInfo *datInd;
1031    
1032    TRC3(cmUnpkRguDDatInd)
1033
1034    if (SUnpkS16(&suId, mBuf) != ROK) {
1035 #if (ERRCLASS & ERRCLS_ADD_RES)      
1036       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1037           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1038           (ErrVal)ERGU039, (ErrVal)0, "UnPacking failed");
1039 #endif      
1040       SPutMsg(mBuf);
1041       RETVALUE(RFAILED);
1042    }
1043
1044    if (pst->selector == RGU_SEL_LWLC)
1045    {
1046       CMCHKUNPK(cmUnpkPtr,(PTR *) &datInd, mBuf);
1047    }
1048    else 
1049    {
1050        if ((SGetStaticBuffer(pst->region, pst->pool, 
1051                     (Data **)&datInd, sizeof(RguDDatIndInfo),0)) != ROK) {
1052 #if (ERRCLASS & ERRCLS_ADD_RES)      
1053          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1054              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1055              (ErrVal)ERGU040, (ErrVal)0, "UnPacking failed");
1056 #endif      
1057          SPutMsg(mBuf);
1058          RETVALUE(RFAILED);
1059       }
1060       if (cmUnpkRguDDatIndInfo(datInd, mBuf) != ROK) {
1061 #if (ERRCLASS & ERRCLS_ADD_RES)      
1062          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1063              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1064              (ErrVal)ERGU041, (ErrVal)0, "UnPacking failed");
1065 #endif      
1066          SPutMsg(mBuf);
1067          SPutStaticBuffer(pst->region, pst->pool, 
1068                     (Data *)datInd, sizeof(RguDDatIndInfo),0);
1069          RETVALUE(RFAILED);
1070       }
1071    }
1072    SPutMsg(mBuf);
1073    RETVALUE((*func)(pst, suId, datInd));
1074 }
1075
1076 \f
1077 /**
1078 * @brief Primitive invoked from RLC to MAC to 
1079  * inform the BO report for common channels
1080 *
1081 * @details
1082 *
1083 *     Function : cmPkRguCStaRsp
1084 *
1085 *  @param[in]   Pst*  pst
1086 *  @param[in]   SpId  spId
1087 *  @param[in]   RguCStaRspInfo  *  staRsp
1088 *  @return   S16
1089 *      -# ROK
1090 **/
1091 #ifdef ANSI
1092 PUBLIC S16 cmPkRguCStaRsp
1093 (
1094 Pst* pst,
1095 SpId spId,
1096 RguCStaRspInfo  * staRsp
1097 )
1098 #else
1099 PUBLIC S16 cmPkRguCStaRsp(pst, spId, staRsp)
1100 Pst* pst;
1101 SpId spId;
1102 RguCStaRspInfo  * staRsp;
1103 #endif
1104 {
1105    Buffer *mBuf = NULLP;
1106    TRC3(cmPkRguCStaRsp)
1107
1108    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1109 #if (ERRCLASS & ERRCLS_ADD_RES)      
1110       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1111           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1112           (ErrVal)ERGU042, (ErrVal)0, "Packing failed");
1113 #endif      
1114       SPutSBuf(pst->region, pst->pool, (Data *)staRsp, sizeof(RguCStaRspInfo));
1115       RETVALUE(RFAILED);
1116    }
1117    if (pst->selector == RGU_SEL_LWLC)
1118    {
1119       CMCHKPK(cmPkPtr,(PTR) staRsp, mBuf);
1120    }
1121    else
1122    {
1123       if (cmPkRguCStaRspInfo(staRsp, mBuf) != ROK) {
1124 #if (ERRCLASS & ERRCLS_ADD_RES)      
1125          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1126              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1127              (ErrVal)ERGU043, (ErrVal)0, "Packing failed");
1128 #endif      
1129          SPutSBuf(pst->region, pst->pool, (Data *)staRsp, 
1130                                      sizeof(RguCStaRspInfo));
1131          SPutMsg(mBuf);
1132          RETVALUE(RFAILED);
1133       }
1134
1135       if (SPutSBuf(pst->region, pst->pool, (Data *)staRsp, 
1136                                      sizeof(RguCStaRspInfo)) != ROK) {
1137 #if (ERRCLASS & ERRCLS_ADD_RES)      
1138       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1139           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1140           (ErrVal)ERGU045, (ErrVal)0, "Packing failed");
1141 #endif      
1142          SPutMsg(mBuf);
1143          RETVALUE(RFAILED);
1144       }
1145       staRsp = NULLP;
1146    }
1147    if (SPkS16(spId, mBuf) != ROK) {
1148 #if (ERRCLASS & ERRCLS_ADD_RES)      
1149       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1150           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1151           (ErrVal)ERGU044, (ErrVal)0, "Packing failed");
1152 #endif      
1153       if (staRsp != NULLP)
1154       {
1155          SPutSBuf(pst->region, pst->pool, 
1156                        (Data *)staRsp, sizeof(RguCStaRspInfo));
1157       }
1158       SPutMsg(mBuf);
1159       RETVALUE(RFAILED);
1160    }
1161
1162    pst->event = (Event) EVTRGUCSTARSP;
1163    RETVALUE(SPstTsk(pst,mBuf));
1164 }
1165
1166 \f
1167 /**
1168 * @brief Primitive invoked from RLC to MAC to 
1169  * inform the BO report for common channels
1170 *
1171 * @details
1172 *
1173 *     Function : cmUnpkRguCStaRsp
1174 *
1175 *  @param[in]   Pst*  pst
1176 *  @param[in]   SpId  spId
1177 *  @param[in]   RguCStaRspInfo  *  staRsp
1178 *  @return   S16
1179 *      -# ROK
1180 **/
1181 #ifdef ANSI
1182 PUBLIC S16 cmUnpkRguCStaRsp
1183 (
1184 RguCStaRsp func,
1185 Pst *pst,
1186 Buffer *mBuf
1187 )
1188 #else
1189 PUBLIC S16 cmUnpkRguCStaRsp(func, pst, mBuf)
1190 RguCStaRsp func;
1191 Pst *pst;
1192 Buffer *mBuf;
1193 #endif
1194 {
1195    SpId spId;
1196    RguCStaRspInfo *staRsp;
1197    
1198    TRC3(cmUnpkRguCStaRsp)
1199
1200    if (SUnpkS16(&spId, mBuf) != ROK) {
1201 #if (ERRCLASS & ERRCLS_ADD_RES)      
1202       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1203           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1204           (ErrVal)ERGU046, (ErrVal)0, "UnPacking failed");
1205 #endif      
1206       SPutMsg(mBuf);
1207       RETVALUE(RFAILED);
1208    }
1209    if (pst->selector == RGU_SEL_LWLC)
1210    {
1211       CMCHKUNPK(cmUnpkPtr,(PTR *) &staRsp, mBuf);
1212    }
1213    else 
1214    {
1215       if ((SGetSBuf(pst->region, pst->pool, (Data **)&staRsp, 
1216                                     sizeof(RguCStaRspInfo))) != ROK) {
1217 #if (ERRCLASS & ERRCLS_ADD_RES)      
1218          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1219              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1220              (ErrVal)ERGU047, (ErrVal)0, "UnPacking failed");
1221 #endif      
1222          SPutMsg(mBuf);
1223          RETVALUE(RFAILED);
1224       }
1225       if (cmUnpkRguCStaRspInfo(staRsp, mBuf) != ROK) {
1226 #if (ERRCLASS & ERRCLS_ADD_RES)      
1227          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1228              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1229              (ErrVal)ERGU048, (ErrVal)0, "UnPacking failed");
1230 #endif      
1231          SPutMsg(mBuf);
1232          SPutSBuf(pst->region, pst->pool, (Data *)staRsp, 
1233                                           sizeof(RguCStaRspInfo));
1234          RETVALUE(RFAILED);
1235       }
1236    }
1237    SPutMsg(mBuf);
1238    RETVALUE((*func)(pst, spId, staRsp));
1239 }
1240
1241 /*rgu_c_001.main_5 - ADD - L2M & R9 Support */
1242 #ifdef LTE_L2_MEAS
1243
1244 /***********************************************************
1245 *
1246 *     Func :cmPkRguL2MUlThrpMeasReqInfo 
1247 *
1248 *
1249 * Status Response from RLC to MAC on UL dedicated logical channel for Uplink
1250 * Scheduled throughput measurement
1251 *
1252 *
1253 *     Ret  : S16
1254 *
1255 *     Notes:
1256 *
1257 *     File  : 
1258 *
1259 **********************************************************/
1260 #ifdef ANSI
1261 PUBLIC S16 cmPkRguL2MUlThrpMeasReqInfo 
1262 (
1263 RguL2MUlThrpMeasReqInfo* param,
1264 Buffer *mBuf
1265 )
1266 #else
1267 PUBLIC S16 cmPkRguL2MUlThrpMeasReqInfo(param, mBuf)
1268 RguL2MUlThrpMeasReqInfo* param;
1269 Buffer *mBuf;
1270 #endif
1271 {
1272    S32 loop;
1273    TRC3(cmPkRguL2MUlThrpMeasReqInfo);
1274
1275    CMCHKPK(SPkU8, param->enbMeas, mBuf);
1276    for (loop=param->numLcId-1; loop >= 0; loop--)
1277    {
1278       CMCHKPK(SPkU8, param->lcId[loop], mBuf);
1279    }
1280    CMCHKPK(cmPkLteLcId, param->numLcId, mBuf);
1281    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
1282    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1283    RETVALUE(ROK);
1284 }
1285
1286
1287 \f
1288 /***********************************************************
1289 *
1290 *     Func :cmUnpkRguL2MUlThrpMeasReqInfo 
1291 *
1292 *
1293 * Status Response from RLC to MAC on UL dedicated logical channel for Uplink
1294 * Scheduled throughput measurement
1295 *
1296 *
1297 *     Ret  : S16
1298 *
1299 *     Notes:
1300 *
1301 *     File  : 
1302 *
1303 **********************************************************/
1304 #ifdef ANSI
1305 PUBLIC S16 cmUnpkRguL2MUlThrpMeasReqInfo 
1306 (
1307 RguL2MUlThrpMeasReqInfo *param,
1308 Buffer *mBuf
1309 )
1310 #else
1311 PUBLIC S16 cmUnpkRguL2MUlThrpMeasReqInfo(param, mBuf)
1312 RguL2MUlThrpMeasReqInfo *param;
1313 Buffer *mBuf;
1314 #endif
1315 {
1316    U8 loop;
1317    TRC3(cmUnpkRguL2MUlThrpMeasReqInfo);
1318
1319    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
1320    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
1321    CMCHKUNPK(cmUnpkLteLcId, &param->numLcId, mBuf);
1322    for (loop=0; loop<param->numLcId; loop++)
1323    {
1324       CMCHKUNPK(SUnpkU8, &param->lcId[loop], mBuf);
1325    }
1326    CMCHKUNPK(SUnpkU8, &param->enbMeas, mBuf);
1327    RETVALUE(ROK);
1328 }
1329
1330 /**
1331 * @brief Primitive invoked from RLC to MAC to 
1332 * inform the On/Off status for Scheduled UL throughput 
1333 * measurment for dedicated channels
1334 *
1335 * @details
1336 *
1337 *     Function :cmPkRguL2MUlThrpMeasReq 
1338 *
1339 *  @param[in]   Pst*  pst
1340 *  @param[in]   SpId  spId
1341 *  @param[in]   RguL2MUlThrpMeasReqInfo*  measReq
1342 *  @return   S16
1343 *      -# ROK
1344 **/
1345 #ifdef ANSI
1346 PUBLIC S16 cmPkRguL2MUlThrpMeasReq 
1347 (
1348 Pst* pst,
1349 SpId spId,
1350 RguL2MUlThrpMeasReqInfo* measReq
1351 )
1352 #else
1353 PUBLIC S16 cmPkRguL2MUlThrpMeasReq(pst, spId, measReq)
1354 Pst* pst;
1355 SpId spId;
1356 RguL2MUlThrpMeasReqInfo* measReq;
1357 #endif
1358 {
1359    Buffer *mBuf = NULLP;
1360    TRC3(cmPkRguL2MUlThrpMeasReq)
1361
1362    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1363 #if (ERRCLASS & ERRCLS_ADD_RES)      
1364       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1365           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1366           (ErrVal)ERGU049, (ErrVal)0, "Packing failed");
1367 #endif      
1368       SPutSBuf(pst->region, pst->pool, (Data *)measReq, sizeof(RguL2MUlThrpMeasReqInfo));
1369       RETVALUE(RFAILED);
1370    }
1371    if (pst->selector == RGU_SEL_LWLC)
1372    {
1373       CMCHKPK(cmPkPtr,(PTR) measReq, mBuf);
1374    }
1375    else
1376    {
1377       if (cmPkRguL2MUlThrpMeasReqInfo(measReq, mBuf) != ROK) {
1378 #if (ERRCLASS & ERRCLS_ADD_RES)      
1379          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1380              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1381              (ErrVal)ERGU050, (ErrVal)0, "Packing failed");
1382 #endif      
1383          SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
1384                                     sizeof(RguL2MUlThrpMeasReqInfo));
1385          SPutMsg(mBuf);
1386          RETVALUE(RFAILED);
1387       }
1388       if (SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
1389                            sizeof(RguL2MUlThrpMeasReqInfo)) != ROK) {
1390 #if (ERRCLASS & ERRCLS_ADD_RES)      
1391          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1392             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1393              (ErrVal)ERGU052, (ErrVal)0, "Packing failed");
1394 #endif      
1395          SPutMsg(mBuf);
1396          RETVALUE(RFAILED);
1397       }
1398       measReq = NULLP;
1399    }
1400
1401    if (SPkS16(spId, mBuf) != ROK) {
1402 #if (ERRCLASS & ERRCLS_ADD_RES)      
1403       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1404           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1405           (ErrVal)ERGU051, (ErrVal)0, "Packing failed");
1406 #endif      
1407       if (measReq != NULLP)
1408       {
1409          SPutSBuf(pst->region, pst->pool, (Data *)measReq,
1410                              sizeof(RguL2MUlThrpMeasReqInfo));
1411       }
1412       SPutMsg(mBuf);
1413       RETVALUE(RFAILED);
1414    }
1415
1416    pst->event = (Event) EVTRGUL2MULTHRPMEASREQ;
1417    RETVALUE(SPstTsk(pst,mBuf));
1418 }
1419
1420 \f
1421 /**
1422 * @brief Primitive invoked from RLC to MAC to 
1423 * inform the On/Off status for Scheduled UL throughput 
1424 * measurment for dedicated channels
1425 *
1426 * @details
1427 *
1428 *     Function :cmUnpkRguL2MUlThrpMeasReq 
1429 *
1430 *  @param[in]   Pst*  pst
1431 *  @param[in]   SpId  spId
1432 *  @param[in]   RguL2MUlThrpMeasReqInfo  * measReq 
1433 *  @return   S16
1434 *      -# ROK
1435 **/
1436 #ifdef ANSI
1437 PUBLIC S16 cmUnpkRguL2MUlThrpMeasReq 
1438 (
1439 RguL2MUlThrpMeasReq func,
1440 Pst *pst,
1441 Buffer *mBuf
1442 )
1443 #else
1444 PUBLIC S16 cmUnpkRguL2MUlThrpMeasReq(func, pst, mBuf)
1445 RguL2MUlThrpMeasReq func;
1446 Pst *pst;
1447 Buffer *mBuf;
1448 #endif
1449 {
1450    SpId spId;
1451    RguL2MUlThrpMeasReqInfo* measReq;
1452    
1453    TRC3(cmUnpkRguL2MUlThrpMeasReq)
1454
1455    if (SUnpkS16(&spId, mBuf) != ROK) {
1456 #if (ERRCLASS & ERRCLS_ADD_RES)      
1457       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1458           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1459           (ErrVal)ERGU053, (ErrVal)0, "UnPacking failed");
1460 #endif      
1461       SPutMsg(mBuf);
1462       RETVALUE(RFAILED);
1463    }
1464    if (pst->selector == RGU_SEL_LWLC)
1465    {
1466       CMCHKUNPK(cmUnpkPtr,(PTR *) &measReq, mBuf);
1467    }
1468    else 
1469    {
1470       if ((SGetSBuf(pst->region, pst->pool, (Data **)&measReq,
1471                               sizeof(RguL2MUlThrpMeasReqInfo))) != ROK) {
1472 #if (ERRCLASS & ERRCLS_ADD_RES)      
1473          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1474              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1475              (ErrVal)ERGU054, (ErrVal)0, "UnPacking failed");
1476 #endif      
1477          SPutMsg(mBuf);
1478          RETVALUE(RFAILED);
1479       }
1480       if (cmUnpkRguL2MUlThrpMeasReqInfo(measReq, mBuf) != ROK) {
1481 #if (ERRCLASS & ERRCLS_ADD_RES)      
1482          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1483              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1484              (ErrVal)ERGU055, (ErrVal)0, "UnPacking failed");
1485 #endif      
1486          SPutMsg(mBuf);
1487          SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
1488                                 sizeof(RguL2MUlThrpMeasReqInfo));
1489          RETVALUE(RFAILED);
1490       }
1491    }
1492    SPutMsg(mBuf);
1493    RETVALUE((*func)(pst, spId, measReq));
1494 }
1495
1496 #endif
1497
1498
1499
1500 \f
1501 /**
1502 * @brief Primitive invoked from RLC to MAC to 
1503  * inform the BO report for dedicated channels
1504 *
1505 * @details
1506 *
1507 *     Function : cmPkRguDStaRsp
1508 *
1509 *  @param[in]   Pst*  pst
1510 *  @param[in]   SpId  spId
1511 *  @param[in]   RguDStaRspInfo  *  staRsp
1512 *  @return   S16
1513 *      -# ROK
1514 **/
1515 #ifdef ANSI
1516 PUBLIC S16 cmPkRguDStaRsp
1517 (
1518 Pst* pst,
1519 SpId spId,
1520 RguDStaRspInfo  *staRsp
1521 )
1522 #else
1523 PUBLIC S16 cmPkRguDStaRsp(pst, spId, staRsp)
1524 Pst* pst;
1525 SpId spId;
1526 RguDStaRspInfo  *staRsp;
1527 #endif
1528 {
1529
1530    RguDStaRspInfo  *staRspInfo = NULL;
1531    Buffer *mBuf = NULLP;
1532
1533    if(SGetSBuf(pst->region, pst->pool, (Data **)&staRspInfo, sizeof(RguDStaRspInfo)) != ROK)
1534    {
1535 #if (ERRCLASS & ERRCLS_ADD_RES)      
1536       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1537             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1538             (ErrVal)ERGU056, (ErrVal)0, "Packing failed");
1539 #endif      
1540       RETVALUE(RFAILED);
1541    }
1542 #ifdef ERRCLS_KW
1543    /* staRspInfo cant be NULL here */
1544    if (staRspInfo == NULLP)
1545    {
1546       RETVALUE(RFAILED);
1547    }
1548 #endif
1549    cmMemcpy((U8 *)staRspInfo, (U8 *)staRsp, sizeof(RguDStaRspInfo)); 
1550    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1551 #if (ERRCLASS & ERRCLS_ADD_RES)      
1552       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1553           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1554           (ErrVal)ERGU056, (ErrVal)0, "Packing failed");
1555 #endif      
1556          SPutSBuf(pst->region, pst->pool, (Data *)staRspInfo, sizeof(RguDStaRspInfo));
1557
1558       RETVALUE(RFAILED);
1559    }
1560    if (pst->selector == RGU_SEL_LWLC)
1561    {
1562       CMCHKPK(cmPkPtr,(PTR) staRspInfo, mBuf);
1563    }
1564    else
1565    {
1566       if (cmPkRguDStaRspInfo(staRsp, mBuf) != ROK) {
1567 #if (ERRCLASS & ERRCLS_ADD_RES)      
1568         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1569             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1570             (ErrVal)ERGU057, (ErrVal)0, "Packing failed");
1571 #endif      
1572         SPutMsg(mBuf);
1573         RETVALUE(RFAILED);
1574      }
1575    }
1576    if (SPkS16(spId, mBuf) != ROK) {
1577 #if (ERRCLASS & ERRCLS_ADD_RES)      
1578       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1579           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1580           (ErrVal)ERGU058, (ErrVal)0, "Packing failed");
1581 #endif      
1582       if (staRspInfo != NULLP)
1583       {
1584          SPutSBuf(pst->region, pst->pool, (Data *)staRspInfo, sizeof(RguDStaRspInfo));
1585       }
1586       SPutMsg(mBuf);
1587       RETVALUE(RFAILED);
1588    }
1589
1590    pst->event = (Event) EVTRGUDSTARSP;
1591    RETVALUE(SPstTsk(pst,mBuf));
1592    SPutMsg(mBuf);
1593 }
1594
1595 \f
1596 /**
1597 * @brief Primitive invoked from RLC to MAC to 
1598  * inform the BO report for dedicated channels
1599 *
1600 * @details
1601 *
1602 *     Function : cmUnpkRguDStaRsp
1603 *
1604 *  @param[in]   Pst*  pst
1605 *  @param[in]   SpId  spId
1606 *  @param[in]   RguDStaRspInfo  *  staRsp
1607 *  @return   S16
1608 *      -# ROK
1609 **/
1610 #ifdef ANSI
1611 PUBLIC S16 cmUnpkRguDStaRsp
1612 (
1613 RguDStaRsp func,
1614 Pst *pst,
1615 Buffer *mBuf
1616 )
1617 #else
1618 PUBLIC S16 cmUnpkRguDStaRsp(func, pst, mBuf)
1619 RguDStaRsp func;
1620 Pst *pst;
1621 Buffer *mBuf;
1622 #endif
1623 {
1624    SpId spId;
1625    RguDStaRspInfo *staRsp;
1626    
1627    TRC3(cmUnpkRguDStaRsp)
1628
1629    if (SUnpkS16(&spId, mBuf) != ROK) {
1630 #if (ERRCLASS & ERRCLS_ADD_RES)      
1631       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1632           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1633           (ErrVal)ERGU060, (ErrVal)0, "UnPacking failed");
1634 #endif      
1635       SPutMsg(mBuf);
1636       RETVALUE(RFAILED);
1637    }
1638
1639    if (pst->selector == RGU_SEL_LWLC)
1640    {
1641       CMCHKUNPK(cmUnpkPtr,(PTR *) &staRsp, mBuf);
1642    }
1643    else
1644    {
1645       if ((SGetSBuf(pst->region, pst->pool, (Data **)&staRsp, 
1646                                  sizeof(RguDStaRspInfo))) != ROK) {
1647 #if (ERRCLASS & ERRCLS_ADD_RES)      
1648          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1649              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1650              (ErrVal)ERGU061, (ErrVal)0, "UnPacking failed");
1651 #endif      
1652          SPutMsg(mBuf);
1653          RETVALUE(RFAILED);
1654       }
1655       if (cmUnpkRguDStaRspInfo(staRsp, mBuf) != ROK) {
1656 #if (ERRCLASS & ERRCLS_ADD_RES)      
1657          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1658              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1659              (ErrVal)ERGU062, (ErrVal)0, "UnPacking failed");
1660 #endif      
1661          SPutMsg(mBuf);
1662          SPutSBuf(pst->region, pst->pool, (Data *)staRsp, sizeof(RguDStaRspInfo));
1663          RETVALUE(RFAILED);
1664       }
1665    }
1666    SPutMsg(mBuf);
1667    (*func)(pst, spId, staRsp);
1668    SPutSBuf(pst->region, pst->pool, (Data *)staRsp, sizeof(RguDStaRspInfo));
1669    RETVALUE(ROK);
1670 }
1671
1672 \f
1673 /**
1674 * @brief Status Indication from MAC to RLC  
1675  * as a response to the staRsp primitive from RLC.
1676  * Informs RLC of the totalBufferSize and Timing Info 
1677  * for the transmission on common channels.
1678 *
1679 * @details
1680 *
1681 *     Function : cmPkRguCStaInd
1682 *
1683 *  @param[in]   Pst*  pst
1684 *  @param[in]   SuId  suId
1685 *  @param[in]   RguCStaIndInfo  *  staInd
1686 *  @return   S16
1687 *      -# ROK
1688 **/
1689 #ifdef ANSI
1690 PUBLIC S16 cmPkRguCStaInd
1691 (
1692 Pst* pst,
1693 SuId suId,
1694 RguCStaIndInfo  * staInd
1695 )
1696 #else
1697 PUBLIC S16 cmPkRguCStaInd(pst, suId, staInd)
1698 Pst* pst;
1699 SuId suId;
1700 RguCStaIndInfo  * staInd;
1701 #endif
1702 {
1703    Buffer *mBuf = NULLP;
1704    TRC3(cmPkRguCStaInd)
1705
1706    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1707 #if (ERRCLASS & ERRCLS_ADD_RES)      
1708       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1709           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1710           (ErrVal)ERGU063, (ErrVal)0, "Packing failed");
1711 #endif      
1712       SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguCStaIndInfo));
1713       RETVALUE(RFAILED);
1714    }
1715       if (pst->selector == RGU_SEL_LWLC)
1716    {
1717       CMCHKPK(cmPkPtr,(PTR) staInd, mBuf);
1718    }
1719    else
1720    {
1721       if (cmPkRguCStaIndInfo(staInd, mBuf) != ROK) {
1722 #if (ERRCLASS & ERRCLS_ADD_RES)      
1723             SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1724                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1725                 (ErrVal)ERGU064, (ErrVal)0, "Packing failed");
1726 #endif      
1727          SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguCStaIndInfo));
1728          SPutMsg(mBuf);
1729          RETVALUE(RFAILED);
1730       }
1731       if (SPutSBuf(pst->region, pst->pool, 
1732                     (Data *)staInd, sizeof(RguCStaIndInfo)) != ROK) {
1733 #if (ERRCLASS & ERRCLS_ADD_RES)      
1734          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1735              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1736              (ErrVal)ERGU066, (ErrVal)0, "Packing failed");
1737 #endif      
1738          SPutMsg(mBuf);
1739          RETVALUE(RFAILED);
1740       }
1741       staInd = NULLP;
1742   }
1743   if (SPkS16(suId,mBuf) != ROK) {
1744 #if (ERRCLASS & ERRCLS_ADD_RES)      
1745       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1746           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1747           (ErrVal)ERGU065, (ErrVal)0, "Packing failed");
1748 #endif      
1749       if (staInd != NULLP)
1750       {
1751          SPutSBuf(pst->region, pst->pool, (Data *)staInd,
1752                                      sizeof(RguCStaIndInfo));
1753       }
1754       SPutMsg(mBuf);
1755       RETVALUE(RFAILED);
1756    }
1757    pst->event = (Event) EVTRGUCSTAIND;
1758    RETVALUE(SPstTsk(pst,mBuf));
1759 }
1760
1761 \f
1762 /**
1763 * @brief Status Indication from MAC to RLC  
1764  * as a response to the staRsp primitive from RLC.
1765  * Informs RLC of the totalBufferSize and Timing Info 
1766  * for the transmission on common channels.
1767 *
1768 * @details
1769 *
1770 *     Function : cmUnpkRguCStaInd
1771 *
1772 *  @param[in]   Pst*  pst
1773 *  @param[in]   SuId  suId
1774 *  @param[in]   RguCStaIndInfo  *  staInd
1775 *  @return   S16
1776 *      -# ROK
1777 **/
1778 #ifdef ANSI
1779 PUBLIC S16 cmUnpkRguCStaInd
1780 (
1781 RguCStaInd func,
1782 Pst *pst,
1783 Buffer *mBuf
1784 )
1785 #else
1786 PUBLIC S16 cmUnpkRguCStaInd(func, pst, mBuf)
1787 RguCStaInd func;
1788 Pst *pst;
1789 Buffer *mBuf;
1790 #endif
1791 {
1792    SuId suId;
1793    RguCStaIndInfo *staInd;
1794    
1795    TRC3(cmUnpkRguCStaInd)
1796
1797    if (SUnpkS16(&suId, mBuf) != ROK) {
1798 #if (ERRCLASS & ERRCLS_ADD_RES)      
1799       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1800           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1801           (ErrVal)ERGU067, (ErrVal)0, "UnPacking failed");
1802 #endif      
1803       SPutMsg(mBuf);
1804       RETVALUE(RFAILED);
1805    }
1806
1807    if (pst->selector == RGU_SEL_LWLC)
1808    {
1809       CMCHKUNPK(cmUnpkPtr,(PTR *) &staInd, mBuf);
1810    }
1811    else
1812    {
1813       if ((SGetSBuf(pst->region, pst->pool, (Data **)&staInd, sizeof(RguCStaIndInfo))) != ROK) {
1814 #if (ERRCLASS & ERRCLS_ADD_RES)      
1815            SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1816                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1817                (ErrVal)ERGU068, (ErrVal)0, "UnPacking failed");
1818 #endif      
1819          SPutMsg(mBuf);
1820          RETVALUE(RFAILED);
1821       }
1822       if (cmUnpkRguCStaIndInfo(staInd, mBuf) != ROK) {
1823 #if (ERRCLASS & ERRCLS_ADD_RES)      
1824          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1825              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1826              (ErrVal)ERGU069, (ErrVal)0, "UnPacking failed");
1827 #endif      
1828          SPutMsg(mBuf);
1829          SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguCStaIndInfo));
1830          RETVALUE(RFAILED);
1831       }
1832    }
1833    SPutMsg(mBuf);
1834    RETVALUE((*func)(pst, suId, staInd));
1835 }
1836
1837    /*rgu_c_001.main_5 - ADD - L2M Support */
1838 #ifdef LTE_L2_MEAS
1839 \f
1840 /**
1841 * @brief Harq Status Indication from MAC to RLC  
1842 *
1843 * @details
1844 *
1845 *     Function : cmPkRguHqStaInd
1846 *
1847 *  @param[in]   Pst*  pst
1848 *  @param[in]   SuId  suId
1849 *  @param[in]   RguHarqStatusInd  *harqStatusInd
1850 *  @return   S16
1851 *      -# ROK
1852 **/
1853 #ifdef ANSI
1854 PUBLIC S16 cmPkRguHqStaInd
1855 (
1856 Pst* pst,
1857 SuId suId,
1858 RguHarqStatusInd  *harqStatusInd
1859 )
1860 #else
1861 PUBLIC S16 cmPkRguHqStaInd(pst, suId, harqStatusInd)
1862 Pst* pst;
1863 SuId suId;
1864 RguHarqStatusInd  *harqStatusInd;
1865 #endif
1866 {
1867
1868    Buffer   *mBuf;
1869    U8       idx;
1870    RguHarqStatusInd *harqStaInd = NULL;
1871
1872    TRC3(cmPkRguHqStaInd)
1873 #ifdef XEON_SPECIFIC_CHANGES
1874    if (SGetSBuf(pst->region, pst->pool, (Data **)&harqStaInd, sizeof(RguHarqStatusInd)) != ROK)
1875 #else      
1876    if ((SGetStaticBuffer(pst->region, pst->pool, 
1877                (Data **)&harqStaInd, sizeof(RguHarqStatusInd),0)) != ROK)
1878 #endif      
1879    {
1880 #if (ERRCLASS & ERRCLS_ADD_RES)      
1881       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1882             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1883             (ErrVal)ERGU070, (ErrVal)0, "Packing failed");
1884 #endif      
1885       RETVALUE(RFAILED);
1886    }
1887
1888    cmMemcpy((U8 *)harqStaInd, (U8 *)harqStatusInd, sizeof(RguHarqStatusInd));
1889
1890    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1891 #if (ERRCLASS & ERRCLS_ADD_RES)      
1892       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1893             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1894             (ErrVal)ERGU070, (ErrVal)0, "Packing failed");
1895 #endif
1896 #ifdef XEON_SPECIFIC_CHANGES
1897       SPutSBuf(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd));
1898 #else      
1899       SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd), 0);
1900 #endif      
1901       RETVALUE(RFAILED);
1902    }
1903
1904    if (pst->selector == RGU_SEL_LWLC)
1905    {
1906       CMCHKPK(cmPkPtr,(PTR) harqStaInd, mBuf); 
1907    }
1908    else
1909    {
1910       for(idx = 0; idx < harqStaInd->numTbs; idx++)
1911       {
1912          CMCHKPK(SPkU16, harqStaInd->status[idx], mBuf);
1913       }
1914       for(idx = 0; idx < harqStaInd->numTbs; idx++)
1915       {
1916          CMCHKPK(SPkU32, harqStaInd->tbId[idx], mBuf);
1917       }
1918       CMCHKPK(SPkU8, harqStaInd->numTbs, mBuf);
1919       CMCHKPK(cmPkLteRnti, harqStaInd->ueId, mBuf);
1920       CMCHKPK(cmPkLteCellId, harqStaInd->cellId, mBuf);
1921    }
1922    if (SPkS16(suId, mBuf) != ROK) {
1923 #if (ERRCLASS & ERRCLS_ADD_RES)      
1924       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1925           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1926           (ErrVal)ERGU071, (ErrVal)0, "Packing failed");
1927 #endif
1928 #ifdef XEON_SPECIFIC_CHANGES
1929       SPutSBuf(pst->region, pst->pool, (Data *)harqStaInd,
1930               sizeof(RguHarqStatusInd));
1931 #else      
1932       SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd), 0);
1933 #endif      
1934       SPutMsg(mBuf);
1935       RETVALUE(RFAILED);
1936    }
1937 #ifdef XEON_SPECIFIC_CHANGES
1938    if (SPutSBuf(pst->region, pst->pool, (Data *)harqStaInd,
1939             sizeof(RguHarqStatusInd)) != ROK) {
1940 #else   
1941    if (pst->selector != RGU_SEL_LWLC)
1942    {
1943       if(SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, 
1944                sizeof(RguHarqStatusInd), 0) != ROK)
1945       {
1946 #endif         
1947 #if (ERRCLASS & ERRCLS_ADD_RES)      
1948          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1949                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1950                (ErrVal)ERGU072, (ErrVal)0, "Packing failed");
1951 #endif      
1952          SPutMsg(mBuf);
1953          RETVALUE(RFAILED);
1954       }
1955 #ifndef XEON_SPECIFIC_CHANGES      
1956    }
1957 #endif   
1958
1959    pst->event = (Event) EVTRGUHQSTAIND;
1960    RETVALUE(SPstTsk(pst,mBuf));
1961 }
1962 \f
1963
1964 /**
1965 * @brief Harq Status Indication from MAC to RLC  
1966 *
1967 * @details
1968 *
1969 *     Function : cmUnpkRguHqStaInd
1970 *
1971 *  @param[in]  RguHqStaInd   func
1972 *  @param[in]  Pst           *pst
1973 *  @param[in]  Buffer        *mBuf
1974 *  @return   S16
1975 *      -# ROK
1976 **/
1977 #ifdef ANSI
1978 PUBLIC S16 cmUnpkRguHqStaInd
1979 (
1980 RguHqStaInd  func,
1981 Pst *pst,
1982 Buffer *mBuf
1983 )
1984 #else
1985 PUBLIC S16 cmUnpkRguHqStaInd(func, pst, mBuf)
1986 RguHqStaInd   func;
1987 Pst *pst;
1988 Buffer *mBuf;
1989 #endif
1990 {
1991    RguHarqStatusInd    *hqStaInd;  
1992    SuId                suId;
1993    U8                  idx;
1994
1995    TRC3(cmUnpkRguHqStaInd)
1996
1997    if (SUnpkS16(&suId, mBuf) != ROK) {
1998 #if (ERRCLASS & ERRCLS_ADD_RES)      
1999       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2000           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2001           (ErrVal)ERGU073, (ErrVal)0, "UnPacking failed");
2002 #endif      
2003       SPutMsg(mBuf);
2004       RETVALUE(RFAILED);
2005    }
2006 #ifdef XEON_SPECIFIC_CHANGES
2007    if ((SGetSBuf(pst->region, pst->pool, (Data **)&hqStaInd, 
2008         sizeof(RguHarqStatusInd))) != ROK) {
2009 #else   
2010    if (pst->selector == RGU_SEL_LWLC)
2011    {
2012       CMCHKUNPK(cmUnpkPtr,(PTR *) &hqStaInd, mBuf);
2013    }  
2014    else
2015    {   
2016       if ((SGetStaticBuffer(pst->region, pst->pool, 
2017                   (Data **)&hqStaInd, sizeof(RguHarqStatusInd),0)) != ROK)
2018       {
2019 #endif         
2020 #if (ERRCLASS & ERRCLS_ADD_RES)      
2021          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2022                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2023                (ErrVal)ERGU074, (ErrVal)0, "UnPacking failed");
2024 #endif      
2025          SPutMsg(mBuf);
2026          RETVALUE(RFAILED);
2027       }
2028       CMCHKUNPK(cmUnpkLteCellId, &hqStaInd->cellId, mBuf);
2029       CMCHKUNPK(cmUnpkLteRnti, &hqStaInd->ueId, mBuf);
2030       CMCHKUNPK(SUnpkU8, &hqStaInd->numTbs, mBuf);
2031       for(idx = hqStaInd->numTbs; idx > 0; idx--)
2032       {
2033          CMCHKUNPK(SUnpkU32, &hqStaInd->tbId[idx - 1], mBuf);
2034       }
2035       for(idx = hqStaInd->numTbs; idx > 0; idx--)
2036       {
2037          CMCHKUNPK(SUnpkU16, &hqStaInd->status[idx - 1], mBuf);
2038       }
2039 #ifndef XEON_SPECIFIC_CHANGES      
2040    }
2041 #endif   
2042    SPutMsg(mBuf);
2043    (*func)(pst, suId, hqStaInd);
2044 #ifdef XEON_SPECIFIC_CHANGES
2045    SPutSBuf(pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd));
2046 #else   
2047    SPutStaticBuffer(pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd), 0);
2048 #endif   
2049    RETVALUE(ROK);
2050 }
2051 #endif /* LTE_L2_MEAS */
2052
2053 \f
2054 /**
2055 * @brief Status Indication from MAC to RLC  
2056  * as a response to the staRsp primitive from RLC.
2057  * Informs RLC of the totalBufferSize and Timing Info 
2058  * for the transmission on dedicated channels.
2059 *
2060 * @details
2061 *
2062 *     Function : cmPkRguDStaInd
2063 *
2064 *  @param[in]   Pst*  pst
2065 *  @param[in]   SuId  suId
2066 *  @param[in]   RguDStaIndInfo  *  staInd
2067 *  @return   S16
2068 *      -# ROK
2069 **/
2070 #ifdef ANSI
2071 PUBLIC S16 cmPkRguDStaInd
2072 (
2073 Pst* pst,
2074 SuId suId,
2075 RguDStaIndInfo  * staInd
2076 )
2077 #else
2078 PUBLIC S16 cmPkRguDStaInd(pst, suId, staInd)
2079 Pst* pst;
2080 SuId suId;
2081 RguDStaIndInfo  * staInd;
2082 #endif
2083 {
2084    Buffer *mBuf = NULLP;
2085    TRC3(cmPkRguDStaInd)
2086
2087    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2088 #if (ERRCLASS & ERRCLS_ADD_RES)      
2089       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2090           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2091           (ErrVal)ERGU076, (ErrVal)0, "Packing failed");
2092 #endif      
2093       SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguDStaIndInfo));
2094       RETVALUE(RFAILED);
2095    }
2096    if (pst->selector == RGU_SEL_LWLC)
2097    {
2098       CMCHKPK(cmPkPtr,(PTR) staInd, mBuf);
2099    }
2100    else
2101    {
2102       if (cmPkRguDStaIndInfo(staInd, mBuf) != ROK) {
2103 #if (ERRCLASS & ERRCLS_ADD_RES)      
2104            SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2105                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2106                (ErrVal)ERGU077, (ErrVal)0, "Packing failed");
2107 #endif      
2108         SPutSBuf(pst->region, pst->pool, (Data *)staInd, 
2109                                          sizeof(RguDStaIndInfo));
2110          SPutMsg(mBuf);
2111          RETVALUE(RFAILED);
2112       } 
2113       if (SPutSBuf(pst->region, pst->pool, (Data *)staInd,
2114                                   sizeof(RguDStaIndInfo)) != ROK) {
2115 #if (ERRCLASS & ERRCLS_ADD_RES)      
2116          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2117              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2118              (ErrVal)ERGU079, (ErrVal)0, "Packing failed");
2119 #endif      
2120          SPutMsg(mBuf);
2121          RETVALUE(RFAILED);
2122       }
2123       staInd = NULLP;
2124    }
2125    if (SPkS16(suId, mBuf) != ROK) {
2126 #if (ERRCLASS & ERRCLS_ADD_RES)      
2127       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2128           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2129           (ErrVal)ERGU078, (ErrVal)0, "Packing failed");
2130 #endif      
2131       if (staInd != NULLP)
2132       {
2133          SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguDStaIndInfo));
2134       }
2135       SPutMsg(mBuf);
2136       RETVALUE(RFAILED);
2137    }
2138
2139    pst->event = (Event) EVTRGUDSTAIND;
2140    RETVALUE(SPstTsk(pst,mBuf));
2141 }
2142
2143 \f
2144 /**
2145 * @brief Status Indication from MAC to RLC  
2146  * as a response to the staRsp primitive from RLC.
2147  * Informs RLC of the totalBufferSize and Timing Info 
2148  * for the transmission on dedicated channels.
2149 *
2150 * @details
2151 *
2152 *     Function : cmUnpkRguDStaInd
2153 *
2154 *  @param[in]   Pst*  pst
2155 *  @param[in]   SuId  suId
2156 *  @param[in]   RguDStaIndInfo  *  staInd
2157 *  @return   S16
2158 *      -# ROK
2159 **/
2160 #ifdef ANSI
2161 PUBLIC S16 cmUnpkRguDStaInd
2162 (
2163 RguDStaInd func,
2164 Pst *pst,
2165 Buffer *mBuf
2166 )
2167 #else
2168 PUBLIC S16 cmUnpkRguDStaInd(func, pst, mBuf)
2169 RguDStaInd func;
2170 Pst *pst;
2171 Buffer *mBuf;
2172 #endif
2173 {
2174    SuId suId;
2175    RguDStaIndInfo *staInd;
2176    
2177    TRC3(cmUnpkRguDStaInd)
2178
2179    if (SUnpkS16(&suId, mBuf) != ROK) {
2180 #if (ERRCLASS & ERRCLS_ADD_RES)      
2181       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2182           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2183           (ErrVal)ERGU080, (ErrVal)0, "UnPacking failed");
2184 #endif      
2185       SPutMsg(mBuf);
2186       RETVALUE(RFAILED);
2187    }
2188    if (pst->selector == RGU_SEL_LWLC)
2189    {
2190       CMCHKUNPK(cmUnpkPtr,(PTR *) &staInd, mBuf);
2191    }
2192    else 
2193    {
2194       if ((SGetSBuf(pst->region, pst->pool, (Data **)&staInd, sizeof(RguDStaIndInfo))) != ROK) {
2195 #if (ERRCLASS & ERRCLS_ADD_RES)      
2196          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2197          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2198          (ErrVal)ERGU081, (ErrVal)0, "UnPacking failed");
2199 #endif      
2200          SPutMsg(mBuf);
2201          RETVALUE(RFAILED);
2202       }
2203       if (cmUnpkRguDStaIndInfo(staInd, mBuf) != ROK) {
2204 #if (ERRCLASS & ERRCLS_ADD_RES)      
2205          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2206              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2207              (ErrVal)ERGU082, (ErrVal)0, "UnPacking failed");
2208 #endif      
2209          SPutMsg(mBuf);
2210          SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguDStaIndInfo));
2211          RETVALUE(RFAILED);
2212       }
2213    }
2214    SPutMsg(mBuf);
2215    RETVALUE((*func)(pst, suId, staInd));
2216 }
2217
2218 #ifdef ANSI
2219 PUBLIC S16 cmPkRguLcFlowCntrlInfo
2220 (
2221 RguLcFlowCntrlInfo *param,
2222 Buffer             *mBuf
2223 )
2224 #else
2225 PUBLIC S16 cmPkRguLcFlowCntrlInfo (param,mBuf)
2226 RguLcFlowCntrlInfo *param;
2227 Buffer             *mBuf;
2228 #endif
2229 {
2230   TRC3(cmPkRguLcFlowCntrlInfo);
2231   CMCHKPK(SPkU32, param->maxBo4FlowCtrl, mBuf);
2232   CMCHKPK(SPkU32, param->pktAdmitCnt, mBuf);
2233   CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
2234
2235   RETVALUE(ROK);
2236 }
2237
2238 #ifdef ANSI
2239 PUBLIC S16 cmPkRguUeFlowCntrlInfo
2240 (
2241 RguUeFlowCntrlInfo *param,
2242 Buffer             *mBuf
2243 )
2244 #else
2245 PUBLIC S16 cmPkRguUeFlowCntrlInfo (param,mBuf)
2246 RguUeFlowCntrlInfo *param;
2247 Buffer             *mBuf;
2248 #endif
2249 {
2250   U32 idx;
2251
2252   TRC3(cmPkRguUeFlowCntrlInfo);
2253
2254   for(idx=(param->numLcs - 1); idx >= 0; idx--)
2255   {
2256     cmPkRguLcFlowCntrlInfo(&param->lcInfo[idx],mBuf);
2257   }
2258   CMCHKPK(SPkU32, param->numLcs, mBuf);
2259   CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
2260   RETVALUE(ROK);
2261 }
2262
2263 #ifdef ANSI
2264 PUBLIC S16 cmPkRguFlowCntrlInfo
2265 (
2266 RguFlowCntrlInd *param, 
2267 Buffer          *mBuf
2268 )
2269 #else
2270 PUBLIC S16 cmPkRguFlowCntrlInfo(flowCntrlInd, mBuf)
2271 RguFlowCntrlInd *param;
2272 Buffer          *mBuf;
2273 #endif
2274 {
2275   U32 idx;
2276
2277   TRC3(cmPkRguFlowCntrlInfo);
2278
2279   for (idx=(param->numUes - 1); idx >= 0; idx--)
2280   {
2281     cmPkRguUeFlowCntrlInfo(&param->ueFlowCntrlInfo[idx],mBuf);
2282   }
2283   CMCHKPK(SPkU32, param->numUes, mBuf);
2284   CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
2285   RETVALUE(ROK);
2286 }
2287 \f
2288 /**
2289 * @brief Flow Cntrl Indication from MAC to RLC  
2290  * Informs RLC of the LCs on which flow control
2291  * to be performed.
2292 *
2293 * @details
2294 *
2295 *     Function : cmPkRguFlowCntrlInd
2296 *
2297 *  @param[in]   Pst*  pst
2298 *  @param[in]   SuId  suId
2299 *  @param[in]   RguFlowCntrlInd *staInd
2300 *  @return   S16
2301 *      -# ROK
2302 **/
2303 #ifdef ANSI
2304 PUBLIC S16 cmPkRguFlowCntrlInd
2305 (
2306 Pst* pst,
2307 SuId suId,
2308 RguFlowCntrlInd  *flowCntrlInd
2309 )
2310 #else
2311 PUBLIC S16 cmPkRguFlowCntrlInd(pst, suId, flowCntrlInd)
2312 Pst* pst;
2313 SuId suId;
2314 RguFlowCntrlInd   *flowCntrlInd;
2315 #endif
2316 {
2317    Buffer *mBuf = NULLP;
2318
2319    TRC3(cmPkRguFlowCntrlInd);
2320    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2321 #if (ERRCLASS & ERRCLS_ADD_RES)      
2322       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2323           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2324           (ErrVal)ERGU076, (ErrVal)0, "Packing failed");
2325 #endif      
2326       RETVALUE(RFAILED);
2327    }
2328    if (pst->selector == RGU_SEL_LWLC)
2329    {
2330       CMCHKPK(cmPkPtr,(PTR) flowCntrlInd, mBuf);
2331    }
2332    else
2333    {
2334       if (cmPkRguFlowCntrlInfo(flowCntrlInd, mBuf) != ROK) {
2335 #if (ERRCLASS & ERRCLS_ADD_RES)      
2336            SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2337                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2338                (ErrVal)ERGU077, (ErrVal)0, "Packing failed");
2339 #endif      
2340          SPutMsg(mBuf);
2341          RETVALUE(RFAILED);
2342       } 
2343    }
2344    if (SPkS16(suId, mBuf) != ROK) {
2345 #if (ERRCLASS & ERRCLS_ADD_RES)      
2346       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2347           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2348           (ErrVal)ERGU078, (ErrVal)0, "Packing failed");
2349 #endif      
2350       SPutMsg(mBuf);
2351       RETVALUE(RFAILED);
2352    }
2353    
2354    pst->event = (Event) EVTRGUFLOWCNTRLIND;
2355    RETVALUE(SPstTsk(pst,mBuf));
2356 }
2357
2358 #ifdef ANSI
2359 PUBLIC S16 cmUnpkRguLcFlowCntrlInfo
2360 (
2361 RguLcFlowCntrlInfo *param,
2362 Buffer           *mBuf
2363 )
2364 #else
2365 PUBLIC S16 cmUnpkRguLcFlowCntrlInfo (param,mBuf)
2366 RguLcFlowCntrlInfo *param;
2367 Buffer           *mBuf;
2368 #endif
2369 {
2370   TRC3(cmUnpkRguLcFlowCntrlInfo);
2371
2372   CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
2373   CMCHKUNPK(SUnpkU32, &param->pktAdmitCnt, mBuf);
2374   CMCHKUNPK(SUnpkU32, &param->maxBo4FlowCtrl, mBuf);
2375   
2376   RETVALUE(ROK);
2377 }
2378 #ifdef ANSI
2379 PUBLIC S16 cmUnpkRguUeFlowCntrlInfo
2380 (
2381 RguUeFlowCntrlInfo *param,
2382 Buffer           *mBuf
2383 )
2384 #else
2385 PUBLIC S16 cmUnpkRguUeFlowCntrlInfo (param,mBuf)
2386 RguUeFlowCntrlInfo *param;
2387 Buffer           *mBuf;
2388 #endif
2389 {
2390   U32 idx;
2391   TRC3(cmUnpkRguUeFlowCntrlInfo);
2392   CMCHKUNPK(cmUnpkLteRnti, &param->ueId, mBuf);
2393   CMCHKUNPK(SUnpkU32, &param->numLcs, mBuf);
2394   for(idx=0; idx < param->numLcs; idx++)
2395   {
2396     cmUnpkRguLcFlowCntrlInfo(&param->lcInfo[idx],mBuf);
2397   }
2398   RETVALUE(ROK);
2399 }
2400
2401 #ifdef ANSI
2402 PUBLIC S16 cmUnpkRguFlowCntrlInfo
2403 (
2404 RguFlowCntrlInd *param, 
2405 Buffer           *mBuf
2406 )
2407 #else
2408 PUBLIC S16 cmUnpkRguFlowCntrlInfo(flowCntrlInfo, mBuf)
2409 RguFlowCntrlInd *param;
2410 Buffer           *mBuf;
2411 #endif
2412 {
2413   U32 idx; 
2414   
2415   TRC3(cmUnpkRguFlowCntrlInfo);
2416
2417   CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
2418   CMCHKUNPK(SUnpkU32, &param->numUes, mBuf);
2419   for (idx=0; idx < param->numUes; idx++)
2420   {
2421     cmUnpkRguUeFlowCntrlInfo(&param->ueFlowCntrlInfo[idx],mBuf);
2422   }
2423   RETVALUE(ROK);
2424 }
2425
2426 /**
2427 * @brief Flow control indication from MAC to RLC  
2428 * Informs RLC of the LCs on which flow control to  
2429 * be started
2430 *
2431 * @details
2432 *
2433 *     Function : cmUnpkRguFlowCntrlInd
2434 *
2435 *  @param[in]   RguFlowCntrlInd func
2436 *  @param[in]   Pst    *pst
2437 *  @param[in]   Buffer *mBuf
2438 *  @return   S16
2439 *      -# ROK
2440 **/
2441 #ifdef ANSI
2442 PUBLIC S16 cmUnpkRguFlowCntrlInd
2443 (
2444 RguFlowCntrlIndInfo func,
2445 Pst *pst,
2446 Buffer *mBuf
2447 )
2448 #else
2449 PUBLIC S16 cmUnpkRguFlowCntrlInd(func, pst, mBuf)
2450 RguFlowCntrlIndInfo func;
2451 Pst *pst;
2452 Buffer *mBuf;
2453 #endif
2454 {
2455    SuId suId;
2456    RguFlowCntrlInd *flowCntrlInd;
2457    
2458    TRC3(cmUnpkRguFlowCntrlInd)
2459
2460    if (SUnpkS16(&suId, mBuf) != ROK) {
2461 #if (ERRCLASS & ERRCLS_ADD_RES)      
2462       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2463           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2464           (ErrVal)ERGU080, (ErrVal)0, "UnPacking failed");
2465 #endif      
2466       SPutMsg(mBuf);
2467       RETVALUE(RFAILED);
2468    }
2469    if (pst->selector == RGU_SEL_LWLC)
2470    {
2471       CMCHKUNPK(cmUnpkPtr,(PTR *) &flowCntrlInd, mBuf);
2472    }
2473    else 
2474    {
2475       if ((SGetSBuf(pst->region, pst->pool, (Data **)&flowCntrlInd, sizeof(RguFlowCntrlInd))) != ROK) {
2476 #if (ERRCLASS & ERRCLS_ADD_RES)      
2477          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2478          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2479          (ErrVal)ERGU081, (ErrVal)0, "UnPacking failed");
2480 #endif      
2481          SPutMsg(mBuf);
2482          RETVALUE(RFAILED);
2483       }
2484       if (cmUnpkRguFlowCntrlInfo(flowCntrlInd, mBuf) != ROK) {
2485 #if (ERRCLASS & ERRCLS_ADD_RES)      
2486          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2487              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2488              (ErrVal)ERGU082, (ErrVal)0, "UnPacking failed");
2489 #endif      
2490          SPutMsg(mBuf);
2491          SPutSBuf(pst->region, pst->pool, (Data *)flowCntrlInd, sizeof(RguFlowCntrlInd));
2492          RETVALUE(RFAILED);
2493       }
2494    }
2495    SPutMsg(mBuf);
2496    RETVALUE((*func)(pst, suId, flowCntrlInd));
2497 }
2498
2499 /***********************************************************
2500 *
2501 *     Func : cmPkRguPduInfo
2502 *
2503 *
2504 *     Desc : RguPduInfo
2505  * PDU information given on a logical channel
2506 *
2507 *
2508 *     Ret  : S16
2509 *
2510 *     Notes:
2511 *
2512 *     File  : 
2513 *
2514 **********************************************************/
2515 #ifdef ANSI
2516 PUBLIC S16 cmPkRguPduInfo
2517 (
2518 RguPduInfo *param,
2519 Buffer *mBuf
2520 )
2521 #else
2522 PUBLIC S16 cmPkRguPduInfo(param, mBuf)
2523 RguPduInfo *param;
2524 Buffer *mBuf;
2525 #endif
2526 {
2527    S32 i;
2528
2529    TRC3(cmPkRguPduInfo);
2530
2531    for (i=param->numPdu-1; i >= 0; i--) {
2532      /* rgu_c_001.main_3: ccpu00111328: S16 is renamed as MsgLen */
2533       MsgLen msgLen = 0;
2534       if (SFndLenMsg(param->mBuf[i], &msgLen) != ROK)
2535          RETVALUE(RFAILED);
2536       if (SCatMsg(mBuf, param->mBuf[i], M1M2) != ROK)
2537          RETVALUE(RFAILED);
2538       SPutMsg(param->mBuf[i]);
2539       CMCHKPK(cmPkMsgLen, msgLen, mBuf);
2540    }
2541    CMCHKPK(SPkU8, param->numPdu, mBuf);
2542    RETVALUE(ROK);
2543 }
2544
2545
2546 \f
2547 /***********************************************************
2548 *
2549 *     Func : cmUnpkRguPduInfo
2550 *
2551 *
2552 *     Desc : RguPduInfo
2553  * PDU information given on a logical channel
2554 *
2555 *
2556 *     Ret  : S16
2557 *
2558 *     Notes:
2559 *
2560 *     File  : 
2561 *
2562 **********************************************************/
2563 #ifdef ANSI
2564 PUBLIC S16 cmUnpkRguPduInfo
2565 (
2566 RguPduInfo *param,
2567 Buffer *mBuf
2568 )
2569 #else
2570 PUBLIC S16 cmUnpkRguPduInfo(param, mBuf)
2571 RguPduInfo *param;
2572 Buffer *mBuf;
2573 #endif
2574 {
2575    S32 i;
2576
2577    TRC3(cmUnpkRguPduInfo);
2578
2579    CMCHKUNPK(SUnpkU8, &param->numPdu, mBuf);
2580    for (i=0; i<param->numPdu; i++) {
2581       MsgLen msgLen, totalMsgLen;
2582       CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
2583       if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
2584          RETVALUE(RFAILED);
2585       if (SSegMsg(mBuf, totalMsgLen-msgLen, &param->mBuf[i]) != ROK)
2586          RETVALUE(RFAILED);
2587    }
2588    RETVALUE(ROK);
2589 }
2590
2591
2592 \f
2593 /***********************************************************
2594 *
2595 *     Func : cmPkRguDBoReport
2596 *
2597 *
2598 *     Desc : RguDBoReport
2599  * Buffer Occupancy Report for dedicated logical channel
2600 *
2601 *
2602 *     Ret  : S16
2603 *
2604 *     Notes:
2605 *
2606 *     File  : 
2607 *
2608 **********************************************************/
2609 #ifdef ANSI
2610 PUBLIC S16 cmPkRguDBoReport
2611 (
2612 RguDBoReport *param,
2613 Buffer *mBuf
2614 )
2615 #else
2616 PUBLIC S16 cmPkRguDBoReport(param, mBuf)
2617 RguDBoReport *param;
2618 Buffer *mBuf;
2619 #endif
2620 {
2621
2622    TRC3(cmPkRguDBoReport);
2623
2624    CMCHKPK(SPkU32, param->oldestSduArrTime, mBuf);
2625    CMCHKPK(SPkU32, param->staPduBo, mBuf);
2626 #ifdef CCPU_OPT
2627    CMCHKPK(SPkU8, param->staPduPrsnt, mBuf);
2628    CMCHKPK(SPkU16, param->estRlcHdrSz, mBuf);
2629 #endif
2630    CMCHKPK(SPkS32, param->bo, mBuf);
2631    RETVALUE(ROK);
2632 }
2633
2634
2635 \f
2636 /***********************************************************
2637 *
2638 *     Func : cmUnpkRguDBoReport
2639 *
2640 *
2641 *     Desc : RguDBoReport
2642  * Buffer Occupancy Report for dedicated logical channel
2643 *
2644 *
2645 *     Ret  : S16
2646 *
2647 *     Notes:
2648 *
2649 *     File  : 
2650 *
2651 **********************************************************/
2652 #ifdef ANSI
2653 PUBLIC S16 cmUnpkRguDBoReport
2654 (
2655 RguDBoReport *param,
2656 Buffer *mBuf
2657 )
2658 #else
2659 PUBLIC S16 cmUnpkRguDBoReport(param, mBuf)
2660 RguDBoReport *param;
2661 Buffer *mBuf;
2662 #endif
2663 {
2664
2665    TRC3(cmUnpkRguDBoReport);
2666
2667    CMCHKUNPK(SUnpkS32, &param->bo, mBuf);
2668 #ifdef CCPU_OPT
2669    CMCHKUNPK(SUnpkU16, &param->estRlcHdrSz, mBuf);
2670    CMCHKUNPK(SUnpkU8, &param->staPduPrsnt, mBuf);
2671 #endif
2672    
2673    CMCHKUNPK(SUnpkU32, &param->staPduBo, mBuf);
2674    CMCHKUNPK(SUnpkU32, &param->oldestSduArrTime, mBuf);
2675    RETVALUE(ROK);
2676 }
2677
2678 \f
2679 /***********************************************************
2680 *
2681 *     Func : cmPkRguCDatReqInfo
2682 *
2683 *
2684 *     Desc : RguCDatReqInfo
2685  * DatReq from RLC to MAC for Common Channels(BCCH, PCCH and CCCH)
2686 *
2687 *
2688 *     Ret  : S16
2689 *
2690 *     Notes:
2691 *
2692 *     File  : 
2693 *
2694 **********************************************************/
2695 #ifdef ANSI
2696 PUBLIC S16 cmPkRguCDatReqInfo
2697 (
2698 RguCDatReqInfo *param,
2699 Buffer *mBuf
2700 )
2701 #else
2702 PUBLIC S16 cmPkRguCDatReqInfo(param, mBuf)
2703 RguCDatReqInfo *param;
2704 Buffer *mBuf;
2705 #endif
2706 {
2707    MsgLen msgLen;
2708
2709    TRC3(cmPkRguCDatReqInfo);
2710
2711    if (param->pdu != NULLP)
2712    {
2713       if (SFndLenMsg(param->pdu, &msgLen) != ROK)
2714          RETVALUE(RFAILED);
2715       if (SCatMsg(mBuf, param->pdu, M1M2) != ROK)
2716          RETVALUE(RFAILED);
2717       SPutMsg(param->pdu);
2718       CMCHKPK(cmPkMsgLen, msgLen, mBuf);
2719    }
2720    switch(param->lcType) {
2721       case CM_LTE_LCH_CCCH:
2722          CMCHKPK(cmPkLteRnti, param->u.rnti, mBuf);
2723          break;
2724       case CM_LTE_LCH_BCCH:
2725       case CM_LTE_LCH_PCCH:
2726          CMCHKPK(cmPkLteTimingInfo, &param->u.timeToTx, mBuf);
2727 #ifdef EMTC_ENABLE
2728         CMCHKPK(SPkU8,param->pnb,mBuf);
2729 #endif
2730          break;
2731       default :
2732          RETVALUE(RFAILED);
2733    }
2734    CMCHKPK(SPkU32, param->transId, mBuf);
2735    CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
2736    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
2737    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
2738    RETVALUE(ROK);
2739 }
2740
2741
2742 \f
2743 /***********************************************************
2744 *
2745 *     Func : cmUnpkRguCDatReqInfo
2746 *
2747 *
2748 *     Desc : RguCDatReqInfo
2749  * DatReq from RLC to MAC for Common Channels(BCCH, PCCH and CCCH)
2750 *
2751 *
2752 *     Ret  : S16
2753 *
2754 *     Notes:
2755 *
2756 *     File  : 
2757 *
2758 **********************************************************/
2759 #ifdef ANSI
2760 PUBLIC S16 cmUnpkRguCDatReqInfo
2761 (
2762 RguCDatReqInfo *param,
2763 Buffer *mBuf
2764 )
2765 #else
2766 PUBLIC S16 cmUnpkRguCDatReqInfo(param, mBuf)
2767 RguCDatReqInfo *param;
2768 Buffer *mBuf;
2769 #endif
2770 {
2771    MsgLen msgLen, totalMsgLen;
2772
2773    TRC3(cmUnpkRguCDatReqInfo);
2774
2775    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
2776    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
2777    CMCHKUNPK(cmUnpkLteLcType, &param->lcType, mBuf);
2778    CMCHKUNPK(SUnpkU32, &param->transId, mBuf);
2779    switch(param->lcType) {
2780       case CM_LTE_LCH_BCCH:
2781       case CM_LTE_LCH_PCCH:
2782 #ifdef EMTC_ENABLE
2783          CMCHKUNPK(SUnpkU8,&param->pnb, mBuf);
2784 #endif
2785          CMCHKUNPK(cmUnpkLteTimingInfo, &param->u.timeToTx, mBuf);
2786          break;
2787       case CM_LTE_LCH_CCCH:
2788          CMCHKUNPK(cmUnpkLteRnti, &param->u.rnti, mBuf);
2789          break;
2790       default :
2791          RETVALUE(RFAILED);
2792    }
2793    SFndLenMsg(mBuf, &msgLen);
2794    if (msgLen > 0)
2795    {
2796       CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
2797       if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
2798          RETVALUE(RFAILED);
2799       if (SSegMsg(mBuf, totalMsgLen-msgLen, &param->pdu) != ROK)
2800          RETVALUE(RFAILED);
2801    }
2802    RETVALUE(ROK);
2803 }
2804
2805
2806 \f
2807 /***********************************************************
2808 *
2809 *     Func : cmPkRguLchDatReq
2810 *
2811 *
2812 *     Desc : RguLchDatReq
2813  * DatReq Information of a logical channel
2814 *
2815 *
2816 *     Ret  : S16
2817 *
2818 *     Notes:
2819 *
2820 *     File  : 
2821 *
2822 **********************************************************/
2823 #ifdef ANSI
2824 PUBLIC S16 cmPkRguLchDatReq
2825 (
2826 RguLchDatReq *param,
2827 Buffer *mBuf
2828 )
2829 #else
2830 PUBLIC S16 cmPkRguLchDatReq(param, mBuf)
2831 RguLchDatReq *param;
2832 Buffer *mBuf;
2833 #endif
2834 {
2835
2836    TRC3(cmPkRguLchDatReq);
2837
2838 #ifdef L2_OPTMZ
2839    CMCHKPK(SPkU8, param->freeBuff, mBuf);
2840 #endif
2841    CMCHKPK(SPkU8, param->setMaxUlPrio, mBuf);
2842    CMCHKPK(cmPkRguPduInfo, &param->pdu, mBuf);
2843    CMCHKPK(cmPkRguDBoReport, &param->boReport, mBuf);
2844    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
2845    RETVALUE(ROK);
2846 }
2847
2848
2849 \f
2850 /***********************************************************
2851 *
2852 *     Func : cmUnpkRguLchDatReq
2853 *
2854 *
2855 *     Desc : RguLchDatReq
2856  * DatReq Information of a logical channel
2857 *
2858 *
2859 *     Ret  : S16
2860 *
2861 *     Notes:
2862 *
2863 *     File  : 
2864 *
2865 **********************************************************/
2866 #ifdef ANSI
2867 PUBLIC S16 cmUnpkRguLchDatReq
2868 (
2869 RguLchDatReq *param,
2870 Buffer *mBuf
2871 )
2872 #else
2873 PUBLIC S16 cmUnpkRguLchDatReq(param, mBuf)
2874 RguLchDatReq *param;
2875 Buffer *mBuf;
2876 #endif
2877 {
2878
2879    TRC3(cmUnpkRguLchDatReq);
2880
2881    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
2882    CMCHKUNPK(cmUnpkRguDBoReport, &param->boReport, mBuf);
2883    CMCHKUNPK(cmUnpkRguPduInfo, &param->pdu, mBuf);
2884    CMCHKUNPK(SUnpkU8, &param->setMaxUlPrio, mBuf);
2885 #ifdef L2_OPTMZ
2886    CMCHKUNPK(SUnpkU8, &param->freeBuff, mBuf);
2887 #endif
2888    RETVALUE(ROK);
2889 }
2890
2891 \f
2892 /***********************************************************
2893 *
2894 *     Func : cmPkRguDatReqTb
2895 *
2896 *
2897 *     Desc : RguDatReqTb
2898 * DatReq from RLC to MAC for dedicated channels of a UE
2899 *
2900 *
2901 *     Ret  : S16
2902 *
2903 *     Notes:
2904 *
2905 *     File  : 
2906 *
2907 **********************************************************/
2908 #ifdef ANSI
2909 PUBLIC S16 cmPkRguDatReqTb
2910 (
2911 RguDatReqTb *param,
2912 Buffer *mBuf
2913 )
2914 #else
2915 PUBLIC S16 cmPkRguDatReqTb(param, mBuf)
2916 RguDatReqTb *param;
2917 Buffer *mBuf;
2918 #endif
2919 {
2920    S32 i;
2921
2922    TRC3(cmPkRguDatReqTb);
2923    /*rgu_c_001.main_5 - ADD - L2M Support */
2924 #ifdef LTE_L2_MEAS
2925    CMCHKPK(SPkU32, param->tbId, mBuf);
2926 #endif
2927    for (i=param->nmbLch-1; i >= 0; i--) {
2928       CMCHKPK(cmPkRguLchDatReq, &param->lchData[i], mBuf);
2929    }
2930    CMCHKPK(SPkU8, param->nmbLch, mBuf);
2931    RETVALUE(ROK);
2932 }
2933
2934
2935 \f
2936 /***********************************************************
2937 *
2938 *     Func : cmUnpkRguDatReqTb
2939 *
2940 *
2941 *     Desc : RguDatReqTb
2942  * DatReq from RLC to MAC for dedicated channels of a UE
2943 *
2944 *
2945 *     Ret  : S16
2946 *
2947 *     Notes:
2948 *
2949 *     File  : 
2950 *
2951 **********************************************************/
2952 #ifdef LTE_L2_MEAS
2953 #ifdef ANSI
2954 PUBLIC S16 cmUnpkRguDatReqTb
2955 (
2956 Pst         *pst, 
2957 RguDatReqTb *param,
2958 Buffer *mBuf
2959 )
2960 #else
2961 PUBLIC S16 cmUnpkRguDatReqTb(pst, param, mBuf)
2962 Pst         *pst;   
2963 RguDatReqTb *param;
2964 Buffer *mBuf;
2965 #endif
2966 #else
2967 #ifdef ANSI
2968 PUBLIC S16 cmUnpkRguDatReqTb
2969 (
2970 RguDatReqTb *param,
2971 Buffer *mBuf
2972 )
2973 #else
2974 PUBLIC S16 cmUnpkRguDatReqTb(param, mBuf)
2975 RguDatReqTb *param;
2976 Buffer *mBuf;
2977 #endif
2978 #endif
2979 {
2980    S32 i;
2981
2982    TRC3(cmUnpkRguDatReqTb);
2983
2984    CMCHKUNPK(SUnpkU8, &param->nmbLch, mBuf);
2985    for (i=0; i<param->nmbLch; i++) {
2986       CMCHKUNPK(cmUnpkRguLchDatReq, &param->lchData[i], mBuf);
2987    }
2988    /*rgu_c_001.main_5 - ADD - L2M Support */
2989 #ifdef LTE_L2_MEAS
2990    CMCHKUNPK(SUnpkU32, &param->tbId, mBuf);
2991 #endif
2992    RETVALUE(ROK);
2993 }
2994
2995 \f
2996 /***********************************************************
2997 *
2998 *     Func : cmPkRguDDatReqInfo
2999 *
3000 *
3001 *     Desc : RguDDatReqInfo
3002  * DatReq from RLC to MAC for dedicated channels of a UE
3003 *
3004 *
3005 *     Ret  : S16
3006 *
3007 *     Notes:
3008 *
3009 *     File  : 
3010 *
3011 **********************************************************/
3012    /*rgu_c_001.main_5 - ADD - L2M Support */
3013 #ifdef LTE_L2_MEAS
3014 #ifdef ANSI
3015 PUBLIC S16 cmPkRguDDatReqInfo
3016 (
3017 Pst            *pst,
3018 RguDDatReqInfo *param,
3019 Buffer *mBuf
3020 )
3021 #else
3022 PUBLIC S16 cmPkRguDDatReqInfo(pst, param, mBuf)
3023 Pst            *pst;
3024 RguDDatReqInfo *param;
3025 Buffer *mBuf;
3026 #endif
3027 #else
3028 #ifdef ANSI
3029 PUBLIC S16 cmPkRguDDatReqInfo
3030 (
3031 RguDDatReqInfo *param,
3032 Buffer *mBuf
3033 )
3034 #else
3035 PUBLIC S16 cmPkRguDDatReqInfo(param, mBuf)
3036 RguDDatReqInfo *param;
3037 Buffer *mBuf;
3038 #endif
3039 #endif
3040 {
3041    S32 i;
3042    S32 idx;
3043
3044    TRC3(cmPkRguDDatReqInfo);
3045
3046    for(idx = (param->nmbOfUeGrantPerTti-1); idx >= 0; idx--)
3047    {
3048       RguDDatReqPerUe *datReq = &param->datReq[idx];
3049       for (i=RGU_MAX_TB-1; i >= 0; i--) 
3050       {
3051          CMCHKPK(cmPkRguDatReqTb, &datReq->datReqTb[i], mBuf);
3052       }
3053       CMCHKPK(SPkU8, datReq->nmbOfTbs, mBuf);
3054       CMCHKPK(SPkU32, datReq->transId, mBuf);
3055       CMCHKPK(cmPkLteRnti, datReq->rnti, mBuf);
3056    }
3057    CMCHKPK(SPkU8, param->nmbOfUeGrantPerTti, mBuf);
3058    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
3059    RETVALUE(ROK);
3060 }
3061
3062
3063 \f
3064 /***********************************************************
3065 *
3066 *     Func : cmUnpkRguDDatReqInfo
3067 *
3068 *
3069 *     Desc : RguDDatReqInfo
3070  * DatReq from RLC to MAC for dedicated channels of a UE
3071 *
3072 *
3073 *     Ret  : S16
3074 *
3075 *     Notes:
3076 *
3077 *     File  : 
3078 *
3079 **********************************************************/
3080 #ifdef LTE_L2_MEAS
3081 #ifdef ANSI
3082 PUBLIC S16 cmUnpkRguDDatReqInfo
3083 (
3084 Pst            *pst, 
3085 RguDDatReqInfo *param,
3086 Buffer *mBuf
3087 )
3088 #else
3089 PUBLIC S16 cmUnpkRguDDatReqInfo(pst, param, mBuf)
3090 Pst            *pst;
3091 RguDDatReqInfo *param;
3092 Buffer *mBuf;
3093 #endif
3094 #else
3095 #ifdef ANSI
3096 PUBLIC S16 cmUnpkRguDDatReqInfo
3097 (
3098 RguDDatReqInfo *param,
3099 Buffer *mBuf
3100 )
3101 #else
3102 PUBLIC S16 cmUnpkRguDDatReqInfo(param, mBuf)
3103 RguDDatReqInfo *param;
3104 Buffer *mBuf;
3105 #endif
3106 #endif
3107 {
3108    S32 i;
3109   /* After Merging from 2.1 to 2.2 */
3110    /*rgu_c_001.main_5 - ADD - L2M Support */
3111 #ifdef LTE_L2_MEAS
3112    S16 retVal;
3113 #endif
3114    S32 idx;
3115
3116    TRC3(cmUnpkRguDDatReqInfo);
3117
3118   /* After Merging from 2.1 to 2.2 */
3119    /*rgu_c_001.main_5 - ADD - L2M Support */
3120 #ifdef LTE_L2_MEAS
3121    retVal = ROK;
3122 #endif
3123    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
3124    CMCHKUNPK(SUnpkU8, &param->nmbOfUeGrantPerTti, mBuf);
3125    for(idx = 0; idx < param->nmbOfUeGrantPerTti; idx++)
3126    { 
3127       RguDDatReqPerUe *datReq = &param->datReq[idx];
3128       CMCHKUNPK(cmUnpkLteRnti, &datReq->rnti, mBuf);
3129       CMCHKUNPK(SUnpkU32, &datReq->transId, mBuf);
3130       CMCHKUNPK(SUnpkU8, &datReq->nmbOfTbs, mBuf);
3131       /* rgu_c_001.main_4 - Changes for MIMO feature addition */
3132       for (i=0; i<RGU_MAX_TB; i++) 
3133       {
3134          /*rgu_c_001.main_5 - ADD - L2M Support */
3135 #ifdef LTE_L2_MEAS
3136          /* After Merging from 2.1 to 2.2 */
3137          retVal = cmUnpkRguDatReqTb(pst, &datReq->datReqTb[i], mBuf);
3138          if(retVal != ROK)
3139          {
3140             RETVALUE(RFAILED);
3141          }
3142 #else
3143          CMCHKUNPK(cmUnpkRguDatReqTb, &datReq->datReqTb[i], mBuf);
3144 #endif
3145       }
3146    }
3147    RETVALUE(ROK);
3148 }
3149
3150
3151 \f
3152 /***********************************************************
3153 *
3154 *     Func : cmPkRguCDatIndInfo
3155 *
3156 *
3157 *     Desc : RguCDatIndInfo
3158  * DatInd from MAC to RLC on CCCH
3159 *
3160 *
3161 *     Ret  : S16
3162 *
3163 *     Notes:
3164 *
3165 *     File  : 
3166 *
3167 **********************************************************/
3168 #ifdef ANSI
3169 PUBLIC S16 cmPkRguCDatIndInfo
3170 (
3171 RguCDatIndInfo *param,
3172 Buffer *mBuf
3173 )
3174 #else
3175 PUBLIC S16 cmPkRguCDatIndInfo(param, mBuf)
3176 RguCDatIndInfo *param;
3177 Buffer *mBuf;
3178 #endif
3179 {
3180    MsgLen msgLen;
3181
3182    TRC3(cmPkRguCDatIndInfo);
3183
3184    if (SFndLenMsg(param->pdu, &msgLen) != ROK)
3185       RETVALUE(RFAILED);
3186    if (SCatMsg(mBuf, param->pdu, M1M2) != ROK)
3187       RETVALUE(RFAILED);
3188    SPutMsg(param->pdu);
3189    CMCHKPK(cmPkMsgLen, msgLen, mBuf);
3190    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
3191    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
3192    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
3193    RETVALUE(ROK);
3194 }
3195
3196
3197 \f
3198 /***********************************************************
3199 *
3200 *     Func : cmUnpkRguCDatIndInfo
3201 *
3202 *
3203 *     Desc : RguCDatIndInfo
3204  * DatInd from MAC to RLC on CCCH
3205 *
3206 *
3207 *     Ret  : S16
3208 *
3209 *     Notes:
3210 *
3211 *     File  : 
3212 *
3213 **********************************************************/
3214 #ifdef ANSI
3215 PUBLIC S16 cmUnpkRguCDatIndInfo
3216 (
3217 RguCDatIndInfo *param,
3218 Buffer *mBuf
3219 )
3220 #else
3221 PUBLIC S16 cmUnpkRguCDatIndInfo(param, mBuf)
3222 RguCDatIndInfo *param;
3223 Buffer *mBuf;
3224 #endif
3225 {
3226    MsgLen msgLen, totalMsgLen;
3227
3228    TRC3(cmUnpkRguCDatIndInfo);
3229
3230    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
3231    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
3232    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
3233    CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
3234    if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
3235       RETVALUE(RFAILED);
3236    if (SSegMsg(mBuf, totalMsgLen-msgLen, &param->pdu) != ROK)
3237       RETVALUE(RFAILED);
3238    RETVALUE(ROK);
3239 }
3240
3241
3242 \f
3243 /***********************************************************
3244 *
3245 *     Func : cmPkRguLchDatInd
3246 *
3247 *
3248 *     Desc : RguLchDatInd
3249  * DatInd Information for a logical channel
3250 *
3251 *
3252 *     Ret  : S16
3253 *
3254 *     Notes:
3255 *
3256 *     File  : 
3257 *
3258 **********************************************************/
3259 #ifdef ANSI
3260 PUBLIC S16 cmPkRguLchDatInd
3261 (
3262 RguLchDatInd *param,
3263 Buffer *mBuf
3264 )
3265 #else
3266 PUBLIC S16 cmPkRguLchDatInd(param, mBuf)
3267 RguLchDatInd *param;
3268 Buffer *mBuf;
3269 #endif
3270 {
3271    TRC3(cmPkRguLchDatInd);
3272
3273       CMCHKPK(cmPkRguPduInfo, &param->pdu, mBuf);
3274    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
3275    RETVALUE(ROK);
3276 }
3277
3278
3279 \f
3280 /***********************************************************
3281 *
3282 *     Func : cmUnpkRguLchDatInd
3283 *
3284 *
3285 *     Desc : RguLchDatInd
3286  * DatInd Information for a logical channel
3287 *
3288 *
3289 *     Ret  : S16
3290 *
3291 *     Notes:
3292 *
3293 *     File  : 
3294 *
3295 **********************************************************/
3296 #ifdef ANSI
3297 PUBLIC S16 cmUnpkRguLchDatInd
3298 (
3299 RguLchDatInd *param,
3300 Buffer *mBuf
3301 )
3302 #else
3303 PUBLIC S16 cmUnpkRguLchDatInd(param, mBuf)
3304 RguLchDatInd *param;
3305 Buffer *mBuf;
3306 #endif
3307 {
3308    TRC3(cmUnpkRguLchDatInd);
3309
3310    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
3311    CMCHKUNPK(cmUnpkRguPduInfo, &param->pdu, mBuf);
3312    RETVALUE(ROK);
3313 }
3314
3315
3316 \f
3317 /***********************************************************
3318 *
3319 *     Func : cmPkRguDDatIndInfo
3320 *
3321 *
3322 *     Desc : RguDDatIndInfo
3323  * Data Indication from MAC to RLC for dedicated channels of a UE
3324 *
3325 *
3326 *     Ret  : S16
3327 *
3328 *     Notes:
3329 *
3330 *     File  : 
3331 *
3332 **********************************************************/
3333 #ifdef ANSI
3334 PUBLIC S16 cmPkRguDDatIndInfo
3335 (
3336 RguDDatIndInfo *param,
3337 Buffer *mBuf
3338 )
3339 #else
3340 PUBLIC S16 cmPkRguDDatIndInfo(param, mBuf)
3341 RguDDatIndInfo *param;
3342 Buffer *mBuf;
3343 #endif
3344 {
3345    S32 i;
3346
3347    TRC3(cmPkRguDDatIndInfo);
3348
3349 #ifdef LTE_L2_MEAS
3350    CMCHKPK(SPkU8, param->burstInd, mBuf);
3351    CMCHKPK(SPkU32, param->ttiCnt, mBuf);
3352 #endif
3353    for (i=param->numLch-1; i >= 0; i--) {
3354       CMCHKPK(cmPkRguLchDatInd, &param->lchData[i], mBuf);
3355    }
3356    CMCHKPK(SPkU8, param->numLch, mBuf);
3357    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
3358    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
3359    RETVALUE(ROK);
3360 }
3361
3362
3363 \f
3364 /***********************************************************
3365 *
3366 *     Func : cmUnpkRguDDatIndInfo
3367 *
3368 *
3369 *     Desc : RguDDatIndInfo
3370  * Data Indication from MAC to RLC for dedicated channels of a UE
3371 *
3372 *
3373 *     Ret  : S16
3374 *
3375 *     Notes:
3376 *
3377 *     File  : 
3378 *
3379 **********************************************************/
3380 #ifdef ANSI
3381 PUBLIC S16 cmUnpkRguDDatIndInfo
3382 (
3383 RguDDatIndInfo *param,
3384 Buffer *mBuf
3385 )
3386 #else
3387 PUBLIC S16 cmUnpkRguDDatIndInfo(param, mBuf)
3388 RguDDatIndInfo *param;
3389 Buffer *mBuf;
3390 #endif
3391 {
3392    S32 i;
3393
3394    TRC3(cmUnpkRguDDatIndInfo);
3395
3396    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
3397    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
3398    CMCHKUNPK(SUnpkU8, &param->numLch, mBuf);
3399    for (i=0; i<param->numLch; i++) {
3400       CMCHKUNPK(cmUnpkRguLchDatInd, &param->lchData[i], mBuf);
3401    }
3402 #ifdef LTE_L2_MEAS
3403    CMCHKUNPK(SUnpkU32, &param->ttiCnt, mBuf);
3404    CMCHKUNPK(SUnpkU8, &param->burstInd, mBuf);
3405 #endif
3406    RETVALUE(ROK);
3407 }
3408
3409 \f
3410 /***********************************************************
3411 *
3412 *     Func : cmPkRguCStaRspInfo
3413 *
3414 *
3415 *     Desc : RguCStaRspInfo
3416  * Status Response from RLC to MAC  for common logical channel
3417 *
3418 *
3419 *     Ret  : S16
3420 *
3421 *     Notes:
3422 *
3423 *     File  : 
3424 *
3425 **********************************************************/
3426 #ifdef ANSI
3427 PUBLIC S16 cmPkRguCStaRspInfo
3428 (
3429 RguCStaRspInfo *param,
3430 Buffer *mBuf
3431 )
3432 #else
3433 PUBLIC S16 cmPkRguCStaRspInfo(param, mBuf)
3434 RguCStaRspInfo *param;
3435 Buffer *mBuf;
3436 #endif
3437 {
3438
3439    TRC3(cmPkRguCStaRspInfo);
3440
3441    switch(param->lcType) {
3442       case CM_LTE_LCH_CCCH:
3443          CMCHKPK(cmPkLteRnti, param->u.rnti, mBuf);
3444          break;
3445       case CM_LTE_LCH_BCCH:
3446       case CM_LTE_LCH_PCCH:
3447          CMCHKPK(cmPkLteTimingInfo, &param->u.timeToTx, mBuf);
3448 #ifdef EMTC_ENABLE
3449          CMCHKPK(SPkU8,param->pnb,mBuf);
3450          CMCHKPK(SPkU8,param->emtcDiReason,mBuf);
3451 #endif
3452          break;
3453       default :
3454          RETVALUE(RFAILED);
3455    }
3456    CMCHKPK(SPkS32, param->bo, mBuf);
3457    CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
3458    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
3459    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
3460    RETVALUE(ROK);
3461 }
3462
3463
3464 \f
3465 /***********************************************************
3466 *
3467 *     Func : cmUnpkRguCStaRspInfo
3468 *
3469 *
3470 *     Desc : RguCStaRspInfo
3471  * Status Response from RLC to MAC  for common logical channel
3472 *
3473 *
3474 *     Ret  : S16
3475 *
3476 *     Notes:
3477 *
3478 *     File  : 
3479 *
3480 **********************************************************/
3481 #ifdef ANSI
3482 PUBLIC S16 cmUnpkRguCStaRspInfo
3483 (
3484 RguCStaRspInfo *param,
3485 Buffer *mBuf
3486 )
3487 #else
3488 PUBLIC S16 cmUnpkRguCStaRspInfo(param, mBuf)
3489 RguCStaRspInfo *param;
3490 Buffer *mBuf;
3491 #endif
3492 {
3493
3494    TRC3(cmUnpkRguCStaRspInfo);
3495
3496    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
3497    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
3498    CMCHKUNPK(cmUnpkLteLcType, &param->lcType, mBuf);
3499    CMCHKUNPK(SUnpkS32, &param->bo, mBuf);
3500    switch(param->lcType) {
3501       case CM_LTE_LCH_BCCH:
3502       case CM_LTE_LCH_PCCH:
3503 #ifdef EMTC_ENABLE
3504          CMCHKUNPK(SUnpkU8,&param->emtcDiReason , mBuf);
3505          CMCHKUNPK(SUnpkU8,&param->pnb , mBuf);
3506 #endif
3507          CMCHKUNPK(cmUnpkLteTimingInfo, &param->u.timeToTx, mBuf);
3508          break;
3509       case CM_LTE_LCH_CCCH:
3510          CMCHKUNPK(cmUnpkLteRnti, &param->u.rnti, mBuf);
3511          break;
3512       default :
3513          RETVALUE(RFAILED);
3514    }
3515    RETVALUE(ROK);
3516 }
3517
3518
3519 \f
3520 /***********************************************************
3521 *
3522 *     Func : cmPkRguDStaRspInfo
3523 *
3524 *
3525 *     Desc : RguDStaRspInfo
3526  * Status Response from RLC to MAC  for dedicated logical channel
3527 *
3528 *
3529 *     Ret  : S16
3530 *
3531 *     Notes:
3532 *
3533 *     File  : 
3534 *
3535 **********************************************************/
3536 #ifdef ANSI
3537 PUBLIC S16 cmPkRguDStaRspInfo
3538 (
3539 RguDStaRspInfo *param,
3540 Buffer *mBuf
3541 )
3542 #else
3543 PUBLIC S16 cmPkRguDStaRspInfo(param, mBuf)
3544 RguDStaRspInfo *param;
3545 Buffer *mBuf;
3546 #endif
3547 {
3548
3549    TRC3(cmPkRguDStaRspInfo);
3550
3551    CMCHKPK(cmPkRguDBoReport, &param->boReport, mBuf);
3552    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
3553    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
3554    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
3555    RETVALUE(ROK);
3556 }
3557
3558
3559 \f
3560 /***********************************************************
3561 *
3562 *     Func : cmUnpkRguDStaRspInfo
3563 *
3564 *
3565 *     Desc : RguDStaRspInfo
3566  * Status Response from RLC to MAC  for dedicated logical channel
3567 *
3568 *
3569 *     Ret  : S16
3570 *
3571 *     Notes:
3572 *
3573 *     File  : 
3574 *
3575 **********************************************************/
3576 #ifdef ANSI
3577 PUBLIC S16 cmUnpkRguDStaRspInfo
3578 (
3579 RguDStaRspInfo *param,
3580 Buffer *mBuf
3581 )
3582 #else
3583 PUBLIC S16 cmUnpkRguDStaRspInfo(param, mBuf)
3584 RguDStaRspInfo *param;
3585 Buffer *mBuf;
3586 #endif
3587 {
3588
3589    TRC3(cmUnpkRguDStaRspInfo);
3590
3591    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
3592    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
3593    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
3594    CMCHKUNPK(cmUnpkRguDBoReport, &param->boReport, mBuf);
3595    RETVALUE(ROK);
3596 }
3597
3598
3599 \f
3600 /***********************************************************
3601 *
3602 *     Func : cmPkRguCStaIndInfo
3603 *
3604 *
3605 *     Desc : RguCStaIndInfo
3606  * Status Indication from MAC to RLC for common logical channel
3607 *
3608 *
3609 *     Ret  : S16
3610 *
3611 *     Notes:
3612 *
3613 *     File  : 
3614 *
3615 **********************************************************/
3616 #ifdef ANSI
3617 PUBLIC S16 cmPkRguCStaIndInfo
3618 (
3619 RguCStaIndInfo *param,
3620 Buffer *mBuf
3621 )
3622 #else
3623 PUBLIC S16 cmPkRguCStaIndInfo(param, mBuf)
3624 RguCStaIndInfo *param;
3625 Buffer *mBuf;
3626 #endif
3627 {
3628
3629    TRC3(cmPkRguCStaIndInfo);
3630 #ifdef EMTC_ENBALE
3631    CMCHKPK(cmPkLteTimingInfo, &param->pagingTimingInfo, mBuf);
3632    CMCHKPK(SPkU8, param->isEmtcPaging, mBuf);
3633 #endif
3634    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
3635    CMCHKPK(SPkU32, param->transId, mBuf);
3636    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
3637    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
3638    RETVALUE(ROK);
3639 }
3640
3641
3642 \f
3643 /***********************************************************
3644 *
3645 *     Func : cmUnpkRguCStaIndInfo
3646 *
3647 *
3648 *     Desc : RguCStaIndInfo
3649  * Status Indication from MAC to RLC for common logical channel
3650 *
3651 *
3652 *     Ret  : S16
3653 *
3654 *     Notes:
3655 *
3656 *     File  : 
3657 *
3658 **********************************************************/
3659 #ifdef ANSI
3660 PUBLIC S16 cmUnpkRguCStaIndInfo
3661 (
3662 RguCStaIndInfo *param,
3663 Buffer *mBuf
3664 )
3665 #else
3666 PUBLIC S16 cmUnpkRguCStaIndInfo(param, mBuf)
3667 RguCStaIndInfo *param;
3668 Buffer *mBuf;
3669 #endif
3670 {
3671
3672    TRC3(cmUnpkRguCStaIndInfo);
3673
3674    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
3675    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
3676    CMCHKUNPK(SUnpkU32, &param->transId, mBuf);
3677    /*TODO:Mukesh: Need to check why rnti unpacking is missing*/
3678 #ifdef EMTC_ENBALE
3679    CMCHKUNPK(SUnpkU8, &param->isEmtcPaging, mBuf);
3680    CMCHKUNPK(cmUnpkLteTimingInfo, &param->pagingTimingInfo, mBuf);
3681 #endif
3682    RETVALUE(ROK);
3683 }
3684
3685
3686 \f
3687 /***********************************************************
3688 *
3689 *     Func : cmPkRguLchStaInd
3690 *
3691 *
3692 *     Desc : RguLchStaInd
3693  * StaInd info for each logical channel of a UE
3694 *
3695 *
3696 *     Ret  : S16
3697 *
3698 *     Notes:
3699 *
3700 *     File  : 
3701 *
3702 **********************************************************/
3703 #ifdef ANSI
3704 PUBLIC S16 cmPkRguLchStaInd
3705 (
3706 RguLchStaInd *param,
3707 Buffer *mBuf
3708 )
3709 #else
3710 PUBLIC S16 cmPkRguLchStaInd(param, mBuf)
3711 RguLchStaInd *param;
3712 Buffer *mBuf;
3713 #endif
3714 {
3715
3716    TRC3(cmPkRguLchStaInd);
3717
3718    CMCHKPK(SPkS16, param->totBufSize, mBuf);
3719    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
3720    RETVALUE(ROK);
3721 }
3722
3723
3724 \f
3725 /***********************************************************
3726 *
3727 *     Func : cmUnpkRguLchStaInd
3728 *
3729 *
3730 *     Desc : RguLchStaInd
3731  * StaInd info for each logical channel of a UE
3732 *
3733 *
3734 *     Ret  : S16
3735 *
3736 *     Notes:
3737 *
3738 *     File  : 
3739 *
3740 **********************************************************/
3741 #ifdef ANSI
3742 PUBLIC S16 cmUnpkRguLchStaInd
3743 (
3744 RguLchStaInd *param,
3745 Buffer *mBuf
3746 )
3747 #else
3748 PUBLIC S16 cmUnpkRguLchStaInd(param, mBuf)
3749 RguLchStaInd *param;
3750 Buffer *mBuf;
3751 #endif
3752 {
3753
3754    TRC3(cmUnpkRguLchStaInd);
3755
3756    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
3757    CMCHKUNPK(SUnpkS16, &param->totBufSize, mBuf);
3758    RETVALUE(ROK);
3759 }
3760
3761 \f
3762 /***********************************************************
3763 *
3764 *     Func : cmPkRguStaIndTb
3765 *
3766 *
3767 *     Desc : RguStaIndTb
3768 * StaInd from RLC to MAC for dedicated channels of a UE
3769 *
3770 *
3771 *     Ret  : S16
3772 *
3773 *     Notes:
3774 *
3775 *     File  : 
3776 *
3777 **********************************************************/
3778 #ifdef ANSI
3779 PUBLIC S16 cmPkRguStaIndTb
3780 (
3781 RguStaIndTb *param,
3782 Buffer *mBuf
3783 )
3784 #else
3785 PUBLIC S16 cmPkRguStaIndTb(param, mBuf)
3786 RguStaIndTb *param;
3787 Buffer *mBuf;
3788 #endif
3789 {
3790    S32 i;
3791
3792    TRC3(cmPkRguStaIndTb);
3793
3794 #ifdef LTE_L2_MEAS
3795    CMCHKPK(SPkU16, param->status, mBuf);
3796    CMCHKPK(SPkU32, param->tbId, mBuf);
3797 #endif   
3798    for (i=param->nmbLch-1; i >= 0; i--) {
3799       CMCHKPK(cmPkRguLchStaInd, &param->lchStaInd[i], mBuf);
3800    }
3801    CMCHKPK(SPkU8, param->nmbLch, mBuf);
3802    RETVALUE(ROK);
3803 }
3804
3805
3806 \f
3807 /***********************************************************
3808 *
3809 *     Func : cmUnpkRguStaIndTb
3810 *
3811 *
3812 *     Desc : RguStaIndTb
3813 * StaInd from RLC to MAC for dedicated channels of a UE
3814 *
3815 *
3816 *     Ret  : S16
3817 *
3818 *     Notes:
3819 *
3820 *     File  : 
3821 *
3822 **********************************************************/
3823 #ifdef ANSI
3824 PUBLIC S16 cmUnpkRguStaIndTb
3825 (
3826 RguStaIndTb *param,
3827 Buffer *mBuf
3828 )
3829 #else
3830 PUBLIC S16 cmUnpkRguStaIndTb(param, mBuf)
3831 RguStaIndTb *param;
3832 Buffer *mBuf;
3833 #endif
3834 {
3835    S32 i;
3836
3837    TRC3(cmUnpkRguStaIndTb);
3838
3839    CMCHKUNPK(SUnpkU8, &param->nmbLch, mBuf);
3840    for (i=0; i<param->nmbLch; i++) {
3841       CMCHKUNPK(cmUnpkRguLchStaInd, &param->lchStaInd[i], mBuf);
3842    }
3843 #ifdef LTE_L2_MEAS
3844    CMCHKUNPK(SUnpkU32, &param->tbId, mBuf);
3845    CMCHKUNPK(SUnpkU16, &param->status, mBuf);
3846 #endif   
3847    RETVALUE(ROK);
3848 }
3849
3850 \f
3851 /***********************************************************
3852 *
3853 *     Func : cmPkRguDStaIndInfo
3854 *
3855 *
3856 *     Desc : RguDStaIndInfo
3857  * StaInd from MAC to RLC for dedicated logical channels of a UE
3858 *
3859 *
3860 *     Ret  : S16
3861 *
3862 *     Notes:
3863 *
3864 *     File  : 
3865 *
3866 **********************************************************/
3867 #ifdef ANSI
3868 PUBLIC S16 cmPkRguDStaIndInfo
3869 (
3870 RguDStaIndInfo *param,
3871 Buffer *mBuf
3872 )
3873 #else
3874 PUBLIC S16 cmPkRguDStaIndInfo(param, mBuf)
3875 RguDStaIndInfo *param;
3876 Buffer *mBuf;
3877 #endif
3878 {
3879    S32 i;
3880    S32 idx;
3881
3882    TRC3(cmPkRguDStaIndInfo);
3883
3884    for(idx = (param->nmbOfUeGrantPerTti - 1); idx >= 0 ; idx--)
3885    {
3886       RguDStaIndPerUe *staInd = &param->staInd[idx];
3887       CMCHKPK(SPkU8, staInd->fillCtrlPdu, mBuf);
3888       for (i=staInd->nmbOfTbs-1; i >= 0; i--) {
3889          CMCHKPK(cmPkRguStaIndTb, &staInd->staIndTb[i], mBuf);
3890       }
3891       CMCHKPK(SPkU8, staInd->nmbOfTbs, mBuf);
3892       CMCHKPK(SPkU32,staInd->transId, mBuf);
3893       CMCHKPK(cmPkLteRnti, staInd->rnti, mBuf);
3894    }
3895    CMCHKPK(SPkU8, param->nmbOfUeGrantPerTti, mBuf);
3896    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
3897    RETVALUE(ROK);
3898 }
3899
3900
3901 \f
3902 /***********************************************************
3903 *
3904 *     Func : cmUnpkRguDStaIndInfo
3905 *
3906 *
3907 *     Desc : RguDStaIndInfo
3908  * StaInd from MAC to RLC for dedicated logical channels of a UE
3909 *
3910 *
3911 *     Ret  : S16
3912 *
3913 *     Notes:
3914 *
3915 *     File  : 
3916 *
3917 **********************************************************/
3918 #ifdef ANSI
3919 PUBLIC S16 cmUnpkRguDStaIndInfo
3920 (
3921 RguDStaIndInfo *param,
3922 Buffer *mBuf
3923 )
3924 #else
3925 PUBLIC S16 cmUnpkRguDStaIndInfo(param, mBuf)
3926 RguDStaIndInfo *param;
3927 Buffer *mBuf;
3928 #endif
3929 {
3930    S32 i;
3931    S32 idx;
3932
3933    TRC3(cmUnpkRguDStaIndInfo);
3934
3935    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
3936    CMCHKUNPK(SUnpkU8, &param->nmbOfUeGrantPerTti, mBuf);
3937    for(idx = 0; idx < param->nmbOfUeGrantPerTti; idx++)
3938    {
3939       RguDStaIndPerUe *staInd = &param->staInd[idx];
3940       CMCHKUNPK(cmUnpkLteRnti, &staInd->rnti, mBuf);
3941       CMCHKUNPK(SUnpkU32, &staInd->transId, mBuf);
3942       CMCHKUNPK(SUnpkU8, &staInd->nmbOfTbs, mBuf);
3943       for (i=0; i<staInd->nmbOfTbs; i++) 
3944       {
3945          CMCHKUNPK(cmUnpkRguStaIndTb, &staInd->staIndTb[i], mBuf);
3946       }
3947       CMCHKUNPK(SUnpkU8, &staInd->fillCtrlPdu, mBuf);
3948    }
3949    RETVALUE(ROK);
3950 }
3951
3952 #endif
3953
3954 /**********************************************************************
3955          End of file
3956 **********************************************************************/