U8, U16, U32 data type changes
[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 "common_def.h"
39 #include "rgu.h"           /* RGU Interface defines */
40
41 /* header/extern include files (.x) */
42 #include "rgu.x"           /* RGU Interface includes */
43
44 #ifdef SS_RBUF
45 #include "ss_rbuf.h"
46 #include "ss_rbuf.x"
47 #endif
48
49 #ifdef LCRGU
50
51 \f
52 /**
53 * @brief Request from RLC to MAC to bind the interface saps
54 *
55 * @details
56 *
57 *     Function : cmPkRguBndReq
58 *
59 *  @param[in]   Pst*  pst
60 *  @param[in]   SuId  suId
61 *  @param[in]   SpId  spId
62 *  @return   S16
63 *      -# ROK
64 **/
65 #ifdef ANSI
66 S16 cmPkRguBndReq
67 (
68 Pst* pst,
69 SuId suId,
70 SpId spId
71 )
72 #else
73 S16 cmPkRguBndReq(pst, suId, spId)
74 Pst* pst;
75 SuId suId;
76 SpId spId;
77 #endif
78 {
79    Buffer *mBuf = NULLP;
80
81    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
82 #if (ERRCLASS & ERRCLS_ADD_RES)      
83       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
84           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
85           (ErrVal)ERGU001, (ErrVal)0, "Packing failed");
86 #endif      
87       return RFAILED;
88    }
89    if (SPkS16(spId, mBuf) != ROK) {
90 #if (ERRCLASS & ERRCLS_ADD_RES)      
91       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
92           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
93           (ErrVal)ERGU002, (ErrVal)0, "Packing failed");
94 #endif      
95       SPutMsg(mBuf);
96       return RFAILED;
97    }
98    if (SPkS16(suId, mBuf) != ROK) {
99 #if (ERRCLASS & ERRCLS_ADD_RES)      
100       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
101           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
102           (ErrVal)ERGU003, (ErrVal)0, "Packing failed");
103 #endif      
104       SPutMsg(mBuf);
105       return RFAILED;
106    }
107    pst->event = (Event) EVTRGUBNDREQ;
108    return (SPstTsk(pst,mBuf));
109 }
110
111 \f
112 /**
113 * @brief Request from RLC to MAC to bind the interface saps
114 *
115 * @details
116 *
117 *     Function : cmUnpkRguBndReq
118 *
119 *  @param[in]   Pst*  pst
120 *  @param[in]   SuId  suId
121 *  @param[in]   SpId  spId
122 *  @return   S16
123 *      -# ROK
124 **/
125 #ifdef ANSI
126 S16 cmUnpkRguBndReq
127 (
128 RguBndReq func,
129 Pst *pst,
130 Buffer *mBuf
131 )
132 #else
133 S16 cmUnpkRguBndReq(func, pst, mBuf)
134 RguBndReq func;
135 Pst *pst;
136 Buffer *mBuf;
137 #endif
138 {
139    SuId suId;
140    SpId spId;
141    
142
143    if (SUnpkS16(&suId, mBuf) != ROK) {
144 #if (ERRCLASS & ERRCLS_ADD_RES)      
145       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
146           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
147           (ErrVal)ERGU004, (ErrVal)0, "UnPacking failed");
148 #endif      
149       SPutMsg(mBuf);
150       return RFAILED;
151    }
152    if (SUnpkS16(&spId, mBuf) != ROK) {
153 #if (ERRCLASS & ERRCLS_ADD_RES)      
154       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
155           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
156           (ErrVal)ERGU005, (ErrVal)0, "UnPacking failed");
157 #endif      
158       SPutMsg(mBuf);
159       return RFAILED;
160    }
161    SPutMsg(mBuf);
162    return ((*func)(pst, suId, spId));
163 }
164
165 \f
166 /**
167 * @brief Request from RLC to MAC to Unbind the interface saps
168 *
169 * @details
170 *
171 *     Function : cmPkRguUbndReq
172 *
173 *  @param[in]   Pst*  pst
174 *  @param[in]   SpId  spId
175 *  @param[in]   Reason  reason
176 *  @return   S16
177 *      -# ROK
178 **/
179 #ifdef ANSI
180 S16 cmPkRguUbndReq
181 (
182 Pst* pst,
183 SpId spId,
184 Reason reason
185 )
186 #else
187 S16 cmPkRguUbndReq(pst, spId, reason)
188 Pst* pst;
189 SpId spId;
190 Reason reason;
191 #endif
192 {
193    Buffer *mBuf = NULLP;
194
195    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
196 #if (ERRCLASS & ERRCLS_ADD_RES)      
197       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
198           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
199           (ErrVal)ERGU006, (ErrVal)0, "Packing failed");
200 #endif      
201       return RFAILED;
202    }
203    if (SPkS16(reason, mBuf) != ROK) {
204 #if (ERRCLASS & ERRCLS_ADD_RES)      
205       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
206           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
207           (ErrVal)ERGU007, (ErrVal)0, "Packing failed");
208 #endif      
209       SPutMsg(mBuf);
210       return RFAILED;
211    }
212    if (SPkS16(spId, mBuf) != ROK) {
213 #if (ERRCLASS & ERRCLS_ADD_RES)      
214       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
215           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
216           (ErrVal)ERGU008, (ErrVal)0, "Packing failed");
217 #endif      
218       SPutMsg(mBuf);
219       return RFAILED;
220    }
221    pst->event = (Event) EVTRGUUBNDREQ;
222    return (SPstTsk(pst,mBuf));
223 }
224
225 \f
226 /**
227 * @brief Request from RLC to MAC to Unbind the interface saps
228 *
229 * @details
230 *
231 *     Function : cmUnpkRguUbndReq
232 *
233 *  @param[in]   Pst*  pst
234 *  @param[in]   SpId  spId
235 *  @param[in]   Reason  reason
236 *  @return   S16
237 *      -# ROK
238 **/
239 #ifdef ANSI
240 S16 cmUnpkRguUbndReq
241 (
242 RguUbndReq func,
243 Pst *pst,
244 Buffer *mBuf
245 )
246 #else
247 S16 cmUnpkRguUbndReq(func, pst, mBuf)
248 RguUbndReq func;
249 Pst *pst;
250 Buffer *mBuf;
251 #endif
252 {
253    SpId spId;
254    Reason reason;
255    
256
257    if (SUnpkS16(&spId, mBuf) != ROK) {
258 #if (ERRCLASS & ERRCLS_ADD_RES)      
259       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
260           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
261           (ErrVal)ERGU009, (ErrVal)0, "UnPacking failed");
262 #endif      
263       SPutMsg(mBuf);
264       return RFAILED;
265    }
266    if (SUnpkS16(&reason, mBuf) != ROK) {
267 #if (ERRCLASS & ERRCLS_ADD_RES)      
268       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
269           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
270           (ErrVal)ERGU010, (ErrVal)0, "UnPacking failed");
271 #endif      
272       SPutMsg(mBuf);
273       return RFAILED;
274    }
275    SPutMsg(mBuf);
276    return ((*func)(pst, spId, reason));
277 }
278
279 \f
280 /**
281 * @brief Confirmation from MAC to RLC for the bind/Unbind 
282  * request for the interface saps
283 *
284 * @details
285 *
286 *     Function : cmPkRguBndCfm
287 *
288 *  @param[in]   Pst*  pst
289 *  @param[in]   SuId  suId
290 *  @param[in]   uint8_t  status
291 *  @return   S16
292 *      -# ROK
293 **/
294 #ifdef ANSI
295 S16 cmPkRguBndCfm
296 (
297 Pst* pst,
298 SuId suId,
299 uint8_t status
300 )
301 #else
302 S16 cmPkRguBndCfm(pst, suId, status)
303 Pst* pst;
304 SuId suId;
305 uint8_t status;
306 #endif
307 {
308    Buffer *mBuf = NULLP;
309
310    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
311 #if (ERRCLASS & ERRCLS_ADD_RES)      
312       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
313           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
314           (ErrVal)ERGU011, (ErrVal)0, "Packing failed");
315 #endif      
316       return RFAILED;
317    }
318    if (oduUnpackUInt8(status, mBuf) != ROK) {
319 #if (ERRCLASS & ERRCLS_ADD_RES)      
320       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
321           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
322           (ErrVal)ERGU012, (ErrVal)0, "Packing failed");
323 #endif      
324       SPutMsg(mBuf);
325       return RFAILED;
326    }
327    if (SPkS16(suId, mBuf) != ROK) {
328 #if (ERRCLASS & ERRCLS_ADD_RES)      
329       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
330           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
331           (ErrVal)ERGU013, (ErrVal)0, "Packing failed");
332 #endif      
333       SPutMsg(mBuf);
334       return RFAILED;
335    }
336    pst->event = (Event) EVTRGUBNDCFM;
337    return (SPstTsk(pst,mBuf));
338 }
339
340 \f
341 /**
342 * @brief Confirmation from MAC to RLC for the bind/Unbind 
343  * request for the interface saps
344 *
345 * @details
346 *
347 *     Function : cmUnpkRguBndCfm
348 *
349 *  @param[in]   Pst*  pst
350 *  @param[in]   SuId  suId
351 *  @param[in]   uint8_t  status
352 *  @return   S16
353 *      -# ROK
354 **/
355 #ifdef ANSI
356 S16 cmUnpkRguBndCfm
357 (
358 RguBndCfm func,
359 Pst *pst,
360 Buffer *mBuf
361 )
362 #else
363 S16 cmUnpkRguBndCfm(func, pst, mBuf)
364 RguBndCfm func;
365 Pst *pst;
366 Buffer *mBuf;
367 #endif
368 {
369    SuId suId;
370    uint8_t status;
371    
372
373    if (SUnpkS16(&suId, mBuf) != ROK) {
374 #if (ERRCLASS & ERRCLS_ADD_RES)      
375       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
376           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
377           (ErrVal)ERGU014, (ErrVal)0, "UnPacking failed");
378 #endif      
379       SPutMsg(mBuf);
380       return RFAILED;
381    }
382    if (oduPackUInt8(&status, mBuf) != ROK) {
383 #if (ERRCLASS & ERRCLS_ADD_RES)      
384       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
385           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
386           (ErrVal)ERGU015, (ErrVal)0, "UnPacking failed");
387 #endif      
388       SPutMsg(mBuf);
389       return RFAILED;
390    }
391    SPutMsg(mBuf);
392    return ((*func)(pst, suId, status));
393 }
394
395 /*rgu_c_001.main_5 - ADD - L2M & R9 Support */
396 #ifdef LTE_L2_MEAS
397
398 /***********************************************************
399 *
400 *     Func :cmPkRguL2MUlThrpMeasReqInfo 
401 *
402 *
403 * Status Response from RLC to MAC on UL dedicated logical channel for Uplink
404 * Scheduled throughput measurement
405 *
406 *
407 *     Ret  : S16
408 *
409 *     Notes:
410 *
411 *     File  : 
412 *
413 **********************************************************/
414 #ifdef ANSI
415 S16 cmPkRguL2MUlThrpMeasReqInfo 
416 (
417 RguL2MUlThrpMeasReqInfo* param,
418 Buffer *mBuf
419 )
420 #else
421 S16 cmPkRguL2MUlThrpMeasReqInfo(param, mBuf)
422 RguL2MUlThrpMeasReqInfo* param;
423 Buffer *mBuf;
424 #endif
425 {
426    S32 loop;
427
428    CMCHKPK(oduUnpackUInt8, param->enbMeas, mBuf);
429    for (loop=param->numLcId-1; loop >= 0; loop--)
430    {
431       CMCHKPK(oduUnpackUInt8, param->lcId[loop], mBuf);
432    }
433    CMCHKPK(cmPkLteLcId, param->numLcId, mBuf);
434    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
435    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
436    return ROK;
437 }
438
439
440 \f
441 /***********************************************************
442 *
443 *     Func :cmUnpkRguL2MUlThrpMeasReqInfo 
444 *
445 *
446 * Status Response from RLC to MAC on UL dedicated logical channel for Uplink
447 * Scheduled throughput measurement
448 *
449 *
450 *     Ret  : S16
451 *
452 *     Notes:
453 *
454 *     File  : 
455 *
456 **********************************************************/
457 #ifdef ANSI
458 S16 cmUnpkRguL2MUlThrpMeasReqInfo 
459 (
460 RguL2MUlThrpMeasReqInfo *param,
461 Buffer *mBuf
462 )
463 #else
464 S16 cmUnpkRguL2MUlThrpMeasReqInfo(param, mBuf)
465 RguL2MUlThrpMeasReqInfo *param;
466 Buffer *mBuf;
467 #endif
468 {
469    uint8_t loop;
470
471    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
472    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
473    CMCHKUNPK(cmUnpkLteLcId, &param->numLcId, mBuf);
474    for (loop=0; loop<param->numLcId; loop++)
475    {
476       CMCHKUNPK(oduPackUInt8, &param->lcId[loop], mBuf);
477    }
478    CMCHKUNPK(oduPackUInt8, &param->enbMeas, mBuf);
479    return ROK;
480 }
481
482 /**
483 * @brief Primitive invoked from RLC to MAC to 
484 * inform the On/Off status for Scheduled UL throughput 
485 * measurment for dedicated channels
486 *
487 * @details
488 *
489 *     Function :cmPkRguL2MUlThrpMeasReq 
490 *
491 *  @param[in]   Pst*  pst
492 *  @param[in]   SpId  spId
493 *  @param[in]   RguL2MUlThrpMeasReqInfo*  measReq
494 *  @return   S16
495 *      -# ROK
496 **/
497 #ifdef ANSI
498 S16 cmPkRguL2MUlThrpMeasReq 
499 (
500 Pst* pst,
501 SpId spId,
502 RguL2MUlThrpMeasReqInfo* measReq
503 )
504 #else
505 S16 cmPkRguL2MUlThrpMeasReq(pst, spId, measReq)
506 Pst* pst;
507 SpId spId;
508 RguL2MUlThrpMeasReqInfo* measReq;
509 #endif
510 {
511    Buffer *mBuf = NULLP;
512
513    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
514 #if (ERRCLASS & ERRCLS_ADD_RES)      
515       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
516           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
517           (ErrVal)ERGU049, (ErrVal)0, "Packing failed");
518 #endif      
519       SPutSBuf(pst->region, pst->pool, (Data *)measReq, sizeof(RguL2MUlThrpMeasReqInfo));
520       return RFAILED;
521    }
522    if (pst->selector == ODU_SELECTOR_LWLC)
523    {
524       CMCHKPK(oduPackPointer,(PTR) measReq, mBuf);
525    }
526    else
527    {
528       if (cmPkRguL2MUlThrpMeasReqInfo(measReq, mBuf) != ROK) {
529 #if (ERRCLASS & ERRCLS_ADD_RES)      
530          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
531              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
532              (ErrVal)ERGU050, (ErrVal)0, "Packing failed");
533 #endif      
534          SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
535                                     sizeof(RguL2MUlThrpMeasReqInfo));
536          SPutMsg(mBuf);
537          return RFAILED;
538       }
539       if (SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
540                            sizeof(RguL2MUlThrpMeasReqInfo)) != ROK) {
541 #if (ERRCLASS & ERRCLS_ADD_RES)      
542          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
543             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
544              (ErrVal)ERGU052, (ErrVal)0, "Packing failed");
545 #endif      
546          SPutMsg(mBuf);
547          return RFAILED;
548       }
549       measReq = NULLP;
550    }
551
552    if (SPkS16(spId, mBuf) != ROK) {
553 #if (ERRCLASS & ERRCLS_ADD_RES)      
554       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
555           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
556           (ErrVal)ERGU051, (ErrVal)0, "Packing failed");
557 #endif      
558       if (measReq != NULLP)
559       {
560          SPutSBuf(pst->region, pst->pool, (Data *)measReq,
561                              sizeof(RguL2MUlThrpMeasReqInfo));
562       }
563       SPutMsg(mBuf);
564       return RFAILED;
565    }
566
567    pst->event = (Event) EVTRGUL2MULTHRPMEASREQ;
568    return (SPstTsk(pst,mBuf));
569 }
570
571 \f
572 /**
573 * @brief Primitive invoked from RLC to MAC to 
574 * inform the On/Off status for Scheduled UL throughput 
575 * measurment for dedicated channels
576 *
577 * @details
578 *
579 *     Function :cmUnpkRguL2MUlThrpMeasReq 
580 *
581 *  @param[in]   Pst*  pst
582 *  @param[in]   SpId  spId
583 *  @param[in]   RguL2MUlThrpMeasReqInfo  * measReq 
584 *  @return   S16
585 *      -# ROK
586 **/
587 #ifdef ANSI
588 S16 cmUnpkRguL2MUlThrpMeasReq 
589 (
590 RguL2MUlThrpMeasReq func,
591 Pst *pst,
592 Buffer *mBuf
593 )
594 #else
595 S16 cmUnpkRguL2MUlThrpMeasReq(func, pst, mBuf)
596 RguL2MUlThrpMeasReq func;
597 Pst *pst;
598 Buffer *mBuf;
599 #endif
600 {
601    SpId spId;
602    RguL2MUlThrpMeasReqInfo* measReq;
603    
604
605    if (SUnpkS16(&spId, mBuf) != ROK) {
606 #if (ERRCLASS & ERRCLS_ADD_RES)      
607       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
608           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
609           (ErrVal)ERGU053, (ErrVal)0, "UnPacking failed");
610 #endif      
611       SPutMsg(mBuf);
612       return RFAILED;
613    }
614    if (pst->selector == ODU_SELECTOR_LWLC)
615    {
616       CMCHKUNPK(oduUnpackPointer,(PTR *) &measReq, mBuf);
617    }
618    else 
619    {
620       if ((SGetSBuf(pst->region, pst->pool, (Data **)&measReq,
621                               sizeof(RguL2MUlThrpMeasReqInfo))) != ROK) {
622 #if (ERRCLASS & ERRCLS_ADD_RES)      
623          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
624              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
625              (ErrVal)ERGU054, (ErrVal)0, "UnPacking failed");
626 #endif      
627          SPutMsg(mBuf);
628          return RFAILED;
629       }
630       if (cmUnpkRguL2MUlThrpMeasReqInfo(measReq, mBuf) != ROK) {
631 #if (ERRCLASS & ERRCLS_ADD_RES)      
632          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
633              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
634              (ErrVal)ERGU055, (ErrVal)0, "UnPacking failed");
635 #endif      
636          SPutMsg(mBuf);
637          SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
638                                 sizeof(RguL2MUlThrpMeasReqInfo));
639          return RFAILED;
640       }
641    }
642    SPutMsg(mBuf);
643    return ((*func)(pst, spId, measReq));
644 }
645
646 #endif
647
648
649    /*rgu_c_001.main_5 - ADD - L2M Support */
650 #ifdef LTE_L2_MEAS
651 \f
652 /**
653 * @brief Harq Status Indication from MAC to RLC  
654 *
655 * @details
656 *
657 *     Function : cmPkRguHqStaInd
658 *
659 *  @param[in]   Pst*  pst
660 *  @param[in]   SuId  suId
661 *  @param[in]   RguHarqStatusInd  *harqStatusInd
662 *  @return   S16
663 *      -# ROK
664 **/
665 #ifdef ANSI
666 S16 cmPkRguHqStaInd
667 (
668 Pst* pst,
669 SuId suId,
670 RguHarqStatusInd  *harqStatusInd
671 )
672 #else
673 S16 cmPkRguHqStaInd(pst, suId, harqStatusInd)
674 Pst* pst;
675 SuId suId;
676 RguHarqStatusInd  *harqStatusInd;
677 #endif
678 {
679
680    Buffer   *mBuf;
681    uint8_t       idx;
682    RguHarqStatusInd *harqStaInd = NULL;
683
684 #ifdef XEON_SPECIFIC_CHANGES
685    if (SGetSBuf(pst->region, pst->pool, (Data **)&harqStaInd, sizeof(RguHarqStatusInd)) != ROK)
686 #else      
687    if ((SGetStaticBuffer(pst->region, pst->pool, 
688                (Data **)&harqStaInd, sizeof(RguHarqStatusInd),0)) != ROK)
689 #endif      
690    {
691 #if (ERRCLASS & ERRCLS_ADD_RES)      
692       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
693             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
694             (ErrVal)ERGU070, (ErrVal)0, "Packing failed");
695 #endif      
696       return RFAILED;
697    }
698
699    memcpy(harqStaInd, harqStatusInd, sizeof(RguHarqStatusInd));
700
701    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
702 #if (ERRCLASS & ERRCLS_ADD_RES)      
703       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
704             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
705             (ErrVal)ERGU070, (ErrVal)0, "Packing failed");
706 #endif
707 #ifdef XEON_SPECIFIC_CHANGES
708       SPutSBuf(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd));
709 #else      
710       SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd), 0);
711 #endif      
712       return RFAILED;
713    }
714
715    if (pst->selector == ODU_SELECTOR_LWLC)
716    {
717       CMCHKPK(oduPackPointer,(PTR) harqStaInd, mBuf); 
718    }
719    else
720    {
721       for(idx = 0; idx < harqStaInd->numTbs; idx++)
722       {
723          CMCHKPK(oduUnpackUInt16, harqStaInd->status[idx], mBuf);
724       }
725       for(idx = 0; idx < harqStaInd->numTbs; idx++)
726       {
727          CMCHKPK(oduUnpackUInt32, harqStaInd->tbId[idx], mBuf);
728       }
729       CMCHKPK(oduUnpackUInt8, harqStaInd->numTbs, mBuf);
730       CMCHKPK(cmPkLteRnti, harqStaInd->ueId, mBuf);
731       CMCHKPK(cmPkLteCellId, harqStaInd->cellId, mBuf);
732    }
733    if (SPkS16(suId, mBuf) != ROK) {
734 #if (ERRCLASS & ERRCLS_ADD_RES)      
735       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
736           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
737           (ErrVal)ERGU071, (ErrVal)0, "Packing failed");
738 #endif
739 #ifdef XEON_SPECIFIC_CHANGES
740       SPutSBuf(pst->region, pst->pool, (Data *)harqStaInd,
741               sizeof(RguHarqStatusInd));
742 #else      
743       SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd), 0);
744 #endif      
745       SPutMsg(mBuf);
746       return RFAILED;
747    }
748 #ifdef XEON_SPECIFIC_CHANGES
749    if (SPutSBuf(pst->region, pst->pool, (Data *)harqStaInd,
750             sizeof(RguHarqStatusInd)) != ROK) {
751 #else   
752    if (pst->selector != ODU_SELECTOR_LWLC)
753    {
754       if(SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, 
755                sizeof(RguHarqStatusInd), 0) != ROK)
756       {
757 #endif         
758 #if (ERRCLASS & ERRCLS_ADD_RES)      
759          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
760                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
761                (ErrVal)ERGU072, (ErrVal)0, "Packing failed");
762 #endif      
763          SPutMsg(mBuf);
764          return RFAILED;
765       }
766 #ifndef XEON_SPECIFIC_CHANGES      
767    }
768 #endif   
769
770    pst->event = (Event) EVTRGUHQSTAIND;
771    return (SPstTsk(pst,mBuf));
772 }
773 \f
774
775 /**
776 * @brief Harq Status Indication from MAC to RLC  
777 *
778 * @details
779 *
780 *     Function : cmUnpkRguHqStaInd
781 *
782 *  @param[in]  RguHqStaInd   func
783 *  @param[in]  Pst           *pst
784 *  @param[in]  Buffer        *mBuf
785 *  @return   S16
786 *      -# ROK
787 **/
788 #ifdef ANSI
789 S16 cmUnpkRguHqStaInd
790 (
791 RguHqStaInd  func,
792 Pst *pst,
793 Buffer *mBuf
794 )
795 #else
796 S16 cmUnpkRguHqStaInd(func, pst, mBuf)
797 RguHqStaInd   func;
798 Pst *pst;
799 Buffer *mBuf;
800 #endif
801 {
802    RguHarqStatusInd    *hqStaInd;  
803    SuId                suId;
804    uint8_t                  idx;
805
806
807    if (SUnpkS16(&suId, mBuf) != ROK) {
808 #if (ERRCLASS & ERRCLS_ADD_RES)      
809       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
810           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
811           (ErrVal)ERGU073, (ErrVal)0, "UnPacking failed");
812 #endif      
813       SPutMsg(mBuf);
814       return RFAILED;
815    }
816 #ifdef XEON_SPECIFIC_CHANGES
817    if ((SGetSBuf(pst->region, pst->pool, (Data **)&hqStaInd, 
818         sizeof(RguHarqStatusInd))) != ROK) {
819 #else   
820    if (pst->selector == ODU_SELECTOR_LWLC)
821    {
822       CMCHKUNPK(oduUnpackPointer,(PTR *) &hqStaInd, mBuf);
823    }  
824    else
825    {   
826       if ((SGetStaticBuffer(pst->region, pst->pool, 
827                   (Data **)&hqStaInd, sizeof(RguHarqStatusInd),0)) != ROK)
828       {
829 #endif         
830 #if (ERRCLASS & ERRCLS_ADD_RES)      
831          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
832                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
833                (ErrVal)ERGU074, (ErrVal)0, "UnPacking failed");
834 #endif      
835          SPutMsg(mBuf);
836          return RFAILED;
837       }
838       CMCHKUNPK(cmUnpkLteCellId, &hqStaInd->cellId, mBuf);
839       CMCHKUNPK(cmUnpkLteRnti, &hqStaInd->ueId, mBuf);
840       CMCHKUNPK(oduPackUInt8, &hqStaInd->numTbs, mBuf);
841       for(idx = hqStaInd->numTbs; idx > 0; idx--)
842       {
843          CMCHKUNPK(oduPackUInt32, &hqStaInd->tbId[idx - 1], mBuf);
844       }
845       for(idx = hqStaInd->numTbs; idx > 0; idx--)
846       {
847          CMCHKUNPK(oduPackUInt16, &hqStaInd->status[idx - 1], mBuf);
848       }
849 #ifndef XEON_SPECIFIC_CHANGES      
850    }
851 #endif   
852    SPutMsg(mBuf);
853    (*func)(pst, suId, hqStaInd);
854 #ifdef XEON_SPECIFIC_CHANGES
855    SPutSBuf(pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd));
856 #else   
857    SPutStaticBuffer(pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd), 0);
858 #endif   
859    return ROK;
860 }
861 #endif /* LTE_L2_MEAS */
862
863 #ifdef ANSI
864 S16 cmPkRguLcFlowCntrlInfo
865 (
866 RguLcFlowCntrlInfo *param,
867 Buffer             *mBuf
868 )
869 #else
870 S16 cmPkRguLcFlowCntrlInfo (param,mBuf)
871 RguLcFlowCntrlInfo *param;
872 Buffer             *mBuf;
873 #endif
874 {
875   CMCHKPK(oduUnpackUInt32, param->maxBo4FlowCtrl, mBuf);
876   CMCHKPK(oduUnpackUInt32, param->pktAdmitCnt, mBuf);
877   CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
878
879   return ROK;
880 }
881
882 #ifdef ANSI
883 S16 cmPkRguUeFlowCntrlInfo
884 (
885 RguUeFlowCntrlInfo *param,
886 Buffer             *mBuf
887 )
888 #else
889 S16 cmPkRguUeFlowCntrlInfo (param,mBuf)
890 RguUeFlowCntrlInfo *param;
891 Buffer             *mBuf;
892 #endif
893 {
894   uint32_t idx;
895
896
897   for(idx=(param->numLcs - 1); idx >= 0; idx--)
898   {
899     cmPkRguLcFlowCntrlInfo(&param->lcInfo[idx],mBuf);
900   }
901   CMCHKPK(oduUnpackUInt32, param->numLcs, mBuf);
902   CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
903   return ROK;
904 }
905
906 #ifdef ANSI
907 S16 cmPkRguFlowCntrlInfo
908 (
909 RguFlowCntrlInd *param, 
910 Buffer          *mBuf
911 )
912 #else
913 S16 cmPkRguFlowCntrlInfo(flowCntrlInd, mBuf)
914 RguFlowCntrlInd *param;
915 Buffer          *mBuf;
916 #endif
917 {
918   uint32_t idx;
919
920
921   for (idx=(param->numUes - 1); idx >= 0; idx--)
922   {
923     cmPkRguUeFlowCntrlInfo(&param->ueFlowCntrlInfo[idx],mBuf);
924   }
925   CMCHKPK(oduUnpackUInt32, param->numUes, mBuf);
926   CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
927   return ROK;
928 }
929 \f
930 /**
931 * @brief Flow Cntrl Indication from MAC to RLC  
932  * Informs RLC of the LCs on which flow control
933  * to be performed.
934 *
935 * @details
936 *
937 *     Function : cmPkRguFlowCntrlInd
938 *
939 *  @param[in]   Pst*  pst
940 *  @param[in]   SuId  suId
941 *  @param[in]   RguFlowCntrlInd *staInd
942 *  @return   S16
943 *      -# ROK
944 **/
945 #ifdef ANSI
946 S16 cmPkRguFlowCntrlInd
947 (
948 Pst* pst,
949 SuId suId,
950 RguFlowCntrlInd  *flowCntrlInd
951 )
952 #else
953 S16 cmPkRguFlowCntrlInd(pst, suId, flowCntrlInd)
954 Pst* pst;
955 SuId suId;
956 RguFlowCntrlInd   *flowCntrlInd;
957 #endif
958 {
959    Buffer *mBuf = NULLP;
960
961    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
962 #if (ERRCLASS & ERRCLS_ADD_RES)      
963       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
964           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
965           (ErrVal)ERGU076, (ErrVal)0, "Packing failed");
966 #endif      
967       return RFAILED;
968    }
969    if (pst->selector == ODU_SELECTOR_LWLC)
970    {
971       CMCHKPK(oduPackPointer,(PTR) flowCntrlInd, mBuf);
972    }
973    else
974    {
975       if (cmPkRguFlowCntrlInfo(flowCntrlInd, mBuf) != ROK) {
976 #if (ERRCLASS & ERRCLS_ADD_RES)      
977            SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
978                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
979                (ErrVal)ERGU077, (ErrVal)0, "Packing failed");
980 #endif      
981          SPutMsg(mBuf);
982          return RFAILED;
983       } 
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)ERGU078, (ErrVal)0, "Packing failed");
990 #endif      
991       SPutMsg(mBuf);
992       return RFAILED;
993    }
994    
995    pst->event = (Event) EVTRGUFLOWCNTRLIND;
996    return (SPstTsk(pst,mBuf));
997 }
998
999 #ifdef ANSI
1000 S16 cmUnpkRguLcFlowCntrlInfo
1001 (
1002 RguLcFlowCntrlInfo *param,
1003 Buffer           *mBuf
1004 )
1005 #else
1006 S16 cmUnpkRguLcFlowCntrlInfo (param,mBuf)
1007 RguLcFlowCntrlInfo *param;
1008 Buffer           *mBuf;
1009 #endif
1010 {
1011
1012   CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
1013   CMCHKUNPK(oduPackUInt32, &param->pktAdmitCnt, mBuf);
1014   CMCHKUNPK(oduPackUInt32, &param->maxBo4FlowCtrl, mBuf);
1015   
1016   return ROK;
1017 }
1018 #ifdef ANSI
1019 S16 cmUnpkRguUeFlowCntrlInfo
1020 (
1021 RguUeFlowCntrlInfo *param,
1022 Buffer           *mBuf
1023 )
1024 #else
1025 S16 cmUnpkRguUeFlowCntrlInfo (param,mBuf)
1026 RguUeFlowCntrlInfo *param;
1027 Buffer           *mBuf;
1028 #endif
1029 {
1030   uint32_t idx;
1031   CMCHKUNPK(cmUnpkLteRnti, &param->ueId, mBuf);
1032   CMCHKUNPK(oduPackUInt32, &param->numLcs, mBuf);
1033   for(idx=0; idx < param->numLcs; idx++)
1034   {
1035     cmUnpkRguLcFlowCntrlInfo(&param->lcInfo[idx],mBuf);
1036   }
1037   return ROK;
1038 }
1039
1040 #ifdef ANSI
1041 S16 cmUnpkRguFlowCntrlInfo
1042 (
1043 RguFlowCntrlInd *param, 
1044 Buffer           *mBuf
1045 )
1046 #else
1047 S16 cmUnpkRguFlowCntrlInfo(flowCntrlInfo, mBuf)
1048 RguFlowCntrlInd *param;
1049 Buffer           *mBuf;
1050 #endif
1051 {
1052   uint32_t idx; 
1053   
1054
1055   CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
1056   CMCHKUNPK(oduPackUInt32, &param->numUes, mBuf);
1057   for (idx=0; idx < param->numUes; idx++)
1058   {
1059     cmUnpkRguUeFlowCntrlInfo(&param->ueFlowCntrlInfo[idx],mBuf);
1060   }
1061   return ROK;
1062 }
1063
1064 /**
1065 * @brief Flow control indication from MAC to RLC  
1066 * Informs RLC of the LCs on which flow control to  
1067 * be started
1068 *
1069 * @details
1070 *
1071 *     Function : cmUnpkRguFlowCntrlInd
1072 *
1073 *  @param[in]   RguFlowCntrlInd func
1074 *  @param[in]   Pst    *pst
1075 *  @param[in]   Buffer *mBuf
1076 *  @return   S16
1077 *      -# ROK
1078 **/
1079 #ifdef ANSI
1080 S16 cmUnpkRguFlowCntrlInd
1081 (
1082 RguFlowCntrlIndInfo func,
1083 Pst *pst,
1084 Buffer *mBuf
1085 )
1086 #else
1087 S16 cmUnpkRguFlowCntrlInd(func, pst, mBuf)
1088 RguFlowCntrlIndInfo func;
1089 Pst *pst;
1090 Buffer *mBuf;
1091 #endif
1092 {
1093    SuId suId;
1094    RguFlowCntrlInd *flowCntrlInd;
1095    
1096
1097    if (SUnpkS16(&suId, mBuf) != ROK) {
1098 #if (ERRCLASS & ERRCLS_ADD_RES)      
1099       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1100           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1101           (ErrVal)ERGU080, (ErrVal)0, "UnPacking failed");
1102 #endif      
1103       SPutMsg(mBuf);
1104       return RFAILED;
1105    }
1106    if (pst->selector == ODU_SELECTOR_LWLC)
1107    {
1108       CMCHKUNPK(oduUnpackPointer,(PTR *) &flowCntrlInd, mBuf);
1109    }
1110    else 
1111    {
1112       if ((SGetSBuf(pst->region, pst->pool, (Data **)&flowCntrlInd, sizeof(RguFlowCntrlInd))) != ROK) {
1113 #if (ERRCLASS & ERRCLS_ADD_RES)      
1114          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1115          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1116          (ErrVal)ERGU081, (ErrVal)0, "UnPacking failed");
1117 #endif      
1118          SPutMsg(mBuf);
1119          return RFAILED;
1120       }
1121       if (cmUnpkRguFlowCntrlInfo(flowCntrlInd, mBuf) != ROK) {
1122 #if (ERRCLASS & ERRCLS_ADD_RES)      
1123          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1124              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1125              (ErrVal)ERGU082, (ErrVal)0, "UnPacking failed");
1126 #endif      
1127          SPutMsg(mBuf);
1128          SPutSBuf(pst->region, pst->pool, (Data *)flowCntrlInd, sizeof(RguFlowCntrlInd));
1129          return RFAILED;
1130       }
1131    }
1132    SPutMsg(mBuf);
1133    return ((*func)(pst, suId, flowCntrlInd));
1134 }
1135
1136 /***********************************************************
1137 *
1138 *     Func : cmPkRguPduInfo
1139 *
1140 *
1141 *     Desc : RguPduInfo
1142  * PDU information given on a logical channel
1143 *
1144 *
1145 *     Ret  : S16
1146 *
1147 *     Notes:
1148 *
1149 *     File  : 
1150 *
1151 **********************************************************/
1152 #ifdef ANSI
1153 S16 cmPkRguPduInfo
1154 (
1155 RguPduInfo *param,
1156 Buffer *mBuf
1157 )
1158 #else
1159 S16 cmPkRguPduInfo(param, mBuf)
1160 RguPduInfo *param;
1161 Buffer *mBuf;
1162 #endif
1163 {
1164    S32 i;
1165
1166
1167    for (i=param->numPdu-1; i >= 0; i--) {
1168      /* rgu_c_001.main_3: ccpu00111328: S16 is renamed as MsgLen */
1169       MsgLen msgLen = 0;
1170       if (SFndLenMsg(param->mBuf[i], &msgLen) != ROK)
1171          return RFAILED;
1172       if (SCatMsg(mBuf, param->mBuf[i], M1M2) != ROK)
1173          return RFAILED;
1174       SPutMsg(param->mBuf[i]);
1175       CMCHKPK(cmPkMsgLen, msgLen, mBuf);
1176    }
1177    CMCHKPK(oduUnpackUInt8, param->numPdu, mBuf);
1178    return ROK;
1179 }
1180
1181
1182 \f
1183 /***********************************************************
1184 *
1185 *     Func : cmUnpkRguPduInfo
1186 *
1187 *
1188 *     Desc : RguPduInfo
1189  * PDU information given on a logical channel
1190 *
1191 *
1192 *     Ret  : S16
1193 *
1194 *     Notes:
1195 *
1196 *     File  : 
1197 *
1198 **********************************************************/
1199 #ifdef ANSI
1200 S16 cmUnpkRguPduInfo
1201 (
1202 RguPduInfo *param,
1203 Buffer *mBuf
1204 )
1205 #else
1206 S16 cmUnpkRguPduInfo(param, mBuf)
1207 RguPduInfo *param;
1208 Buffer *mBuf;
1209 #endif
1210 {
1211    S32 i;
1212
1213
1214    CMCHKUNPK(oduPackUInt8, &param->numPdu, mBuf);
1215    for (i=0; i<param->numPdu; i++) {
1216       MsgLen msgLen, totalMsgLen;
1217       CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
1218       if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
1219          return RFAILED;
1220       if (SSegMsg(mBuf, totalMsgLen-msgLen, &param->mBuf[i]) != ROK)
1221          return RFAILED;
1222    }
1223    return ROK;
1224 }
1225
1226
1227 \f
1228 /***********************************************************
1229 *
1230 *     Func : cmPkRguDBoReport
1231 *
1232 *
1233 *     Desc : RguDBoReport
1234  * Buffer Occupancy Report for dedicated logical channel
1235 *
1236 *
1237 *     Ret  : S16
1238 *
1239 *     Notes:
1240 *
1241 *     File  : 
1242 *
1243 **********************************************************/
1244 #ifdef ANSI
1245 S16 cmPkRguDBoReport
1246 (
1247 RguDBoReport *param,
1248 Buffer *mBuf
1249 )
1250 #else
1251 S16 cmPkRguDBoReport(param, mBuf)
1252 RguDBoReport *param;
1253 Buffer *mBuf;
1254 #endif
1255 {
1256
1257
1258    CMCHKPK(oduUnpackUInt32, param->oldestSduArrTime, mBuf);
1259    CMCHKPK(oduUnpackUInt32, param->staPduBo, mBuf);
1260 #ifdef CCPU_OPT
1261    CMCHKPK(oduUnpackUInt8, param->staPduPrsnt, mBuf);
1262    CMCHKPK(oduUnpackUInt16, param->estRlcHdrSz, mBuf);
1263 #endif
1264    CMCHKPK(SPkS32, param->bo, mBuf);
1265    return ROK;
1266 }
1267
1268
1269 \f
1270 /***********************************************************
1271 *
1272 *     Func : cmUnpkRguDBoReport
1273 *
1274 *
1275 *     Desc : RguDBoReport
1276  * Buffer Occupancy Report for dedicated logical channel
1277 *
1278 *
1279 *     Ret  : S16
1280 *
1281 *     Notes:
1282 *
1283 *     File  : 
1284 *
1285 **********************************************************/
1286 #ifdef ANSI
1287 S16 cmUnpkRguDBoReport
1288 (
1289 RguDBoReport *param,
1290 Buffer *mBuf
1291 )
1292 #else
1293 S16 cmUnpkRguDBoReport(param, mBuf)
1294 RguDBoReport *param;
1295 Buffer *mBuf;
1296 #endif
1297 {
1298
1299
1300    CMCHKUNPK(SUnpkS32, &param->bo, mBuf);
1301 #ifdef CCPU_OPT
1302    CMCHKUNPK(oduPackUInt16, &param->estRlcHdrSz, mBuf);
1303    CMCHKUNPK(oduPackUInt8, &param->staPduPrsnt, mBuf);
1304 #endif
1305    
1306    CMCHKUNPK(oduPackUInt32, &param->staPduBo, mBuf);
1307    CMCHKUNPK(oduPackUInt32, &param->oldestSduArrTime, mBuf);
1308    return ROK;
1309 }
1310
1311 \f
1312 /***********************************************************
1313 *
1314 *     Func : cmPkRguCDatReqInfo
1315 *
1316 *
1317 *     Desc : RguCDatReqInfo
1318  * DatReq from RLC to MAC for Common Channels(BCCH, PCCH and CCCH)
1319 *
1320 *
1321 *     Ret  : S16
1322 *
1323 *     Notes:
1324 *
1325 *     File  : 
1326 *
1327 **********************************************************/
1328 #ifdef ANSI
1329 S16 cmPkRguCDatReqInfo
1330 (
1331 RguCDatReqInfo *param,
1332 Buffer *mBuf
1333 )
1334 #else
1335 S16 cmPkRguCDatReqInfo(param, mBuf)
1336 RguCDatReqInfo *param;
1337 Buffer *mBuf;
1338 #endif
1339 {
1340    MsgLen msgLen;
1341
1342
1343    if (param->pdu != NULLP)
1344    {
1345       if (SFndLenMsg(param->pdu, &msgLen) != ROK)
1346          return RFAILED;
1347       if (SCatMsg(mBuf, param->pdu, M1M2) != ROK)
1348          return RFAILED;
1349       SPutMsg(param->pdu);
1350       CMCHKPK(cmPkMsgLen, msgLen, mBuf);
1351    }
1352    switch(param->lcType) {
1353       case CM_LTE_LCH_CCCH:
1354          CMCHKPK(cmPkLteRnti, param->u.rnti, mBuf);
1355          break;
1356       case CM_LTE_LCH_BCCH:
1357       case CM_LTE_LCH_PCCH:
1358          CMCHKPK(cmPkLteTimingInfo, &param->u.timeToTx, mBuf);
1359 #ifdef EMTC_ENABLE
1360         CMCHKPK(oduUnpackUInt8,param->pnb,mBuf);
1361 #endif
1362          break;
1363       default :
1364          return RFAILED;
1365    }
1366    CMCHKPK(oduUnpackUInt32, param->transId, mBuf);
1367    CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
1368    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
1369    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1370    return ROK;
1371 }
1372
1373
1374 \f
1375 /***********************************************************
1376 *
1377 *     Func : cmUnpkRguCDatReqInfo
1378 *
1379 *
1380 *     Desc : RguCDatReqInfo
1381  * DatReq from RLC to MAC for Common Channels(BCCH, PCCH and CCCH)
1382 *
1383 *
1384 *     Ret  : S16
1385 *
1386 *     Notes:
1387 *
1388 *     File  : 
1389 *
1390 **********************************************************/
1391 #ifdef ANSI
1392 S16 cmUnpkRguCDatReqInfo
1393 (
1394 RguCDatReqInfo *param,
1395 Buffer *mBuf
1396 )
1397 #else
1398 S16 cmUnpkRguCDatReqInfo(param, mBuf)
1399 RguCDatReqInfo *param;
1400 Buffer *mBuf;
1401 #endif
1402 {
1403    MsgLen msgLen, totalMsgLen;
1404
1405
1406    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
1407    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
1408    CMCHKUNPK(cmUnpkLteLcType, &param->lcType, mBuf);
1409    CMCHKUNPK(oduPackUInt32, &param->transId, mBuf);
1410    switch(param->lcType) {
1411       case CM_LTE_LCH_BCCH:
1412       case CM_LTE_LCH_PCCH:
1413 #ifdef EMTC_ENABLE
1414          CMCHKUNPK(oduPackUInt8,&param->pnb, mBuf);
1415 #endif
1416          CMCHKUNPK(cmUnpkLteTimingInfo, &param->u.timeToTx, mBuf);
1417          break;
1418       case CM_LTE_LCH_CCCH:
1419          CMCHKUNPK(cmUnpkLteRnti, &param->u.rnti, mBuf);
1420          break;
1421       default :
1422          return RFAILED;
1423    }
1424    SFndLenMsg(mBuf, &msgLen);
1425    if (msgLen > 0)
1426    {
1427       CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
1428       if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
1429          return RFAILED;
1430       if (SSegMsg(mBuf, totalMsgLen-msgLen, &param->pdu) != ROK)
1431          return RFAILED;
1432    }
1433    return ROK;
1434 }
1435
1436
1437 \f
1438 /***********************************************************
1439 *
1440 *     Func : cmPkRguLchDatReq
1441 *
1442 *
1443 *     Desc : RguLchDatReq
1444  * DatReq Information of a logical channel
1445 *
1446 *
1447 *     Ret  : S16
1448 *
1449 *     Notes:
1450 *
1451 *     File  : 
1452 *
1453 **********************************************************/
1454 #ifdef ANSI
1455 S16 cmPkRguLchDatReq
1456 (
1457 RguLchDatReq *param,
1458 Buffer *mBuf
1459 )
1460 #else
1461 S16 cmPkRguLchDatReq(param, mBuf)
1462 RguLchDatReq *param;
1463 Buffer *mBuf;
1464 #endif
1465 {
1466
1467
1468 #ifdef L2_OPTMZ
1469    CMCHKPK(oduUnpackUInt8, param->freeBuff, mBuf);
1470 #endif
1471    CMCHKPK(oduUnpackUInt8, param->setMaxUlPrio, mBuf);
1472    CMCHKPK(cmPkRguPduInfo, &param->pdu, mBuf);
1473    CMCHKPK(cmPkRguDBoReport, &param->boReport, mBuf);
1474    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
1475    return ROK;
1476 }
1477
1478
1479 \f
1480 /***********************************************************
1481 *
1482 *     Func : cmUnpkRguLchDatReq
1483 *
1484 *
1485 *     Desc : RguLchDatReq
1486  * DatReq Information of a logical channel
1487 *
1488 *
1489 *     Ret  : S16
1490 *
1491 *     Notes:
1492 *
1493 *     File  : 
1494 *
1495 **********************************************************/
1496 #ifdef ANSI
1497 S16 cmUnpkRguLchDatReq
1498 (
1499 RguLchDatReq *param,
1500 Buffer *mBuf
1501 )
1502 #else
1503 S16 cmUnpkRguLchDatReq(param, mBuf)
1504 RguLchDatReq *param;
1505 Buffer *mBuf;
1506 #endif
1507 {
1508
1509
1510    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
1511    CMCHKUNPK(cmUnpkRguDBoReport, &param->boReport, mBuf);
1512    CMCHKUNPK(cmUnpkRguPduInfo, &param->pdu, mBuf);
1513    CMCHKUNPK(oduPackUInt8, &param->setMaxUlPrio, mBuf);
1514 #ifdef L2_OPTMZ
1515    CMCHKUNPK(oduPackUInt8, &param->freeBuff, mBuf);
1516 #endif
1517    return ROK;
1518 }
1519
1520 \f
1521 /***********************************************************
1522 *
1523 *     Func : cmPkRguDatReqTb
1524 *
1525 *
1526 *     Desc : RguDatReqTb
1527 * DatReq from RLC to MAC for dedicated channels of a UE
1528 *
1529 *
1530 *     Ret  : S16
1531 *
1532 *     Notes:
1533 *
1534 *     File  : 
1535 *
1536 **********************************************************/
1537 #ifdef ANSI
1538 S16 cmPkRguDatReqTb
1539 (
1540 RguDatReqTb *param,
1541 Buffer *mBuf
1542 )
1543 #else
1544 S16 cmPkRguDatReqTb(param, mBuf)
1545 RguDatReqTb *param;
1546 Buffer *mBuf;
1547 #endif
1548 {
1549    S32 i;
1550
1551    /*rgu_c_001.main_5 - ADD - L2M Support */
1552 #ifdef LTE_L2_MEAS
1553    CMCHKPK(oduUnpackUInt32, param->tbId, mBuf);
1554 #endif
1555    for (i=param->nmbLch-1; i >= 0; i--) {
1556       CMCHKPK(cmPkRguLchDatReq, &param->lchData[i], mBuf);
1557    }
1558    CMCHKPK(oduUnpackUInt8, param->nmbLch, mBuf);
1559    return ROK;
1560 }
1561
1562
1563 \f
1564 /***********************************************************
1565 *
1566 *     Func : cmUnpkRguDatReqTb
1567 *
1568 *
1569 *     Desc : RguDatReqTb
1570  * DatReq from RLC to MAC for dedicated channels of a UE
1571 *
1572 *
1573 *     Ret  : S16
1574 *
1575 *     Notes:
1576 *
1577 *     File  : 
1578 *
1579 **********************************************************/
1580 #ifdef LTE_L2_MEAS
1581 #ifdef ANSI
1582 S16 cmUnpkRguDatReqTb
1583 (
1584 Pst         *pst, 
1585 RguDatReqTb *param,
1586 Buffer *mBuf
1587 )
1588 #else
1589 S16 cmUnpkRguDatReqTb(pst, param, mBuf)
1590 Pst         *pst;   
1591 RguDatReqTb *param;
1592 Buffer *mBuf;
1593 #endif
1594 #else
1595 #ifdef ANSI
1596 S16 cmUnpkRguDatReqTb
1597 (
1598 RguDatReqTb *param,
1599 Buffer *mBuf
1600 )
1601 #else
1602 S16 cmUnpkRguDatReqTb(param, mBuf)
1603 RguDatReqTb *param;
1604 Buffer *mBuf;
1605 #endif
1606 #endif
1607 {
1608    S32 i;
1609
1610
1611    CMCHKUNPK(oduPackUInt8, &param->nmbLch, mBuf);
1612    for (i=0; i<param->nmbLch; i++) {
1613       CMCHKUNPK(cmUnpkRguLchDatReq, &param->lchData[i], mBuf);
1614    }
1615    /*rgu_c_001.main_5 - ADD - L2M Support */
1616 #ifdef LTE_L2_MEAS
1617    CMCHKUNPK(oduPackUInt32, &param->tbId, mBuf);
1618 #endif
1619    return ROK;
1620 }
1621
1622 \f
1623 /***********************************************************
1624 *
1625 *     Func : cmPkRguDDatReqInfo
1626 *
1627 *
1628 *     Desc : RguDDatReqInfo
1629  * DatReq from RLC to MAC for dedicated channels of a UE
1630 *
1631 *
1632 *     Ret  : S16
1633 *
1634 *     Notes:
1635 *
1636 *     File  : 
1637 *
1638 **********************************************************/
1639    /*rgu_c_001.main_5 - ADD - L2M Support */
1640 #ifdef LTE_L2_MEAS
1641 #ifdef ANSI
1642 S16 cmPkRguDDatReqInfo
1643 (
1644 Pst            *pst,
1645 RguDDatReqInfo *param,
1646 Buffer *mBuf
1647 )
1648 #else
1649 S16 cmPkRguDDatReqInfo(pst, param, mBuf)
1650 Pst            *pst;
1651 RguDDatReqInfo *param;
1652 Buffer *mBuf;
1653 #endif
1654 #else
1655 #ifdef ANSI
1656 S16 cmPkRguDDatReqInfo
1657 (
1658 RguDDatReqInfo *param,
1659 Buffer *mBuf
1660 )
1661 #else
1662 S16 cmPkRguDDatReqInfo(param, mBuf)
1663 RguDDatReqInfo *param;
1664 Buffer *mBuf;
1665 #endif
1666 #endif
1667 {
1668    S32 i;
1669    S32 idx;
1670
1671
1672    for(idx = (param->nmbOfUeGrantPerTti-1); idx >= 0; idx--)
1673    {
1674       RguDDatReqPerUe *datReq = &param->datReq[idx];
1675       for (i=RGU_MAX_TB-1; i >= 0; i--) 
1676       {
1677          CMCHKPK(cmPkRguDatReqTb, &datReq->datReqTb[i], mBuf);
1678       }
1679       CMCHKPK(oduUnpackUInt8, datReq->nmbOfTbs, mBuf);
1680       CMCHKPK(oduUnpackUInt32, datReq->transId, mBuf);
1681       CMCHKPK(cmPkLteRnti, datReq->rnti, mBuf);
1682    }
1683    CMCHKPK(oduUnpackUInt8, param->nmbOfUeGrantPerTti, mBuf);
1684    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1685    return ROK;
1686 }
1687
1688
1689 \f
1690 /***********************************************************
1691 *
1692 *     Func : cmUnpkRguDDatReqInfo
1693 *
1694 *
1695 *     Desc : RguDDatReqInfo
1696  * DatReq from RLC to MAC for dedicated channels of a UE
1697 *
1698 *
1699 *     Ret  : S16
1700 *
1701 *     Notes:
1702 *
1703 *     File  : 
1704 *
1705 **********************************************************/
1706 #ifdef LTE_L2_MEAS
1707 #ifdef ANSI
1708 S16 cmUnpkRguDDatReqInfo
1709 (
1710 Pst            *pst, 
1711 RguDDatReqInfo *param,
1712 Buffer *mBuf
1713 )
1714 #else
1715 S16 cmUnpkRguDDatReqInfo(pst, param, mBuf)
1716 Pst            *pst;
1717 RguDDatReqInfo *param;
1718 Buffer *mBuf;
1719 #endif
1720 #else
1721 #ifdef ANSI
1722 S16 cmUnpkRguDDatReqInfo
1723 (
1724 RguDDatReqInfo *param,
1725 Buffer *mBuf
1726 )
1727 #else
1728 S16 cmUnpkRguDDatReqInfo(param, mBuf)
1729 RguDDatReqInfo *param;
1730 Buffer *mBuf;
1731 #endif
1732 #endif
1733 {
1734    S32 i;
1735   /* After Merging from 2.1 to 2.2 */
1736    /*rgu_c_001.main_5 - ADD - L2M Support */
1737 #ifdef LTE_L2_MEAS
1738    S16 retVal;
1739 #endif
1740    S32 idx;
1741
1742
1743   /* After Merging from 2.1 to 2.2 */
1744    /*rgu_c_001.main_5 - ADD - L2M Support */
1745 #ifdef LTE_L2_MEAS
1746    retVal = ROK;
1747 #endif
1748    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
1749    CMCHKUNPK(oduPackUInt8, &param->nmbOfUeGrantPerTti, mBuf);
1750    for(idx = 0; idx < param->nmbOfUeGrantPerTti; idx++)
1751    { 
1752       RguDDatReqPerUe *datReq = &param->datReq[idx];
1753       CMCHKUNPK(cmUnpkLteRnti, &datReq->rnti, mBuf);
1754       CMCHKUNPK(oduPackUInt32, &datReq->transId, mBuf);
1755       CMCHKUNPK(oduPackUInt8, &datReq->nmbOfTbs, mBuf);
1756       /* rgu_c_001.main_4 - Changes for MIMO feature addition */
1757       for (i=0; i<RGU_MAX_TB; i++) 
1758       {
1759          /*rgu_c_001.main_5 - ADD - L2M Support */
1760 #ifdef LTE_L2_MEAS
1761          /* After Merging from 2.1 to 2.2 */
1762          retVal = cmUnpkRguDatReqTb(pst, &datReq->datReqTb[i], mBuf);
1763          if(retVal != ROK)
1764          {
1765             return RFAILED;
1766          }
1767 #else
1768          CMCHKUNPK(cmUnpkRguDatReqTb, &datReq->datReqTb[i], mBuf);
1769 #endif
1770       }
1771    }
1772    return ROK;
1773 }
1774
1775
1776 \f
1777 /***********************************************************
1778 *
1779 *     Func : cmPkRguCDatIndInfo
1780 *
1781 *
1782 *     Desc : RguCDatIndInfo
1783  * DatInd from MAC to RLC on CCCH
1784 *
1785 *
1786 *     Ret  : S16
1787 *
1788 *     Notes:
1789 *
1790 *     File  : 
1791 *
1792 **********************************************************/
1793 #ifdef ANSI
1794 S16 cmPkRguCDatIndInfo
1795 (
1796 RguCDatIndInfo *param,
1797 Buffer *mBuf
1798 )
1799 #else
1800 S16 cmPkRguCDatIndInfo(param, mBuf)
1801 RguCDatIndInfo *param;
1802 Buffer *mBuf;
1803 #endif
1804 {
1805    MsgLen msgLen;
1806
1807
1808    if (SFndLenMsg(param->pdu, &msgLen) != ROK)
1809       return RFAILED;
1810    if (SCatMsg(mBuf, param->pdu, M1M2) != ROK)
1811       return RFAILED;
1812    SPutMsg(param->pdu);
1813    CMCHKPK(cmPkMsgLen, msgLen, mBuf);
1814    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
1815    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
1816    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1817    return ROK;
1818 }
1819
1820
1821 \f
1822 /***********************************************************
1823 *
1824 *     Func : cmUnpkRguCDatIndInfo
1825 *
1826 *
1827 *     Desc : RguCDatIndInfo
1828  * DatInd from MAC to RLC on CCCH
1829 *
1830 *
1831 *     Ret  : S16
1832 *
1833 *     Notes:
1834 *
1835 *     File  : 
1836 *
1837 **********************************************************/
1838 #ifdef ANSI
1839 S16 cmUnpkRguCDatIndInfo
1840 (
1841 RguCDatIndInfo *param,
1842 Buffer *mBuf
1843 )
1844 #else
1845 S16 cmUnpkRguCDatIndInfo(param, mBuf)
1846 RguCDatIndInfo *param;
1847 Buffer *mBuf;
1848 #endif
1849 {
1850    MsgLen msgLen, totalMsgLen;
1851
1852
1853    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
1854    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
1855    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
1856    CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
1857    if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
1858       return RFAILED;
1859    if (SSegMsg(mBuf, totalMsgLen-msgLen, &param->pdu) != ROK)
1860       return RFAILED;
1861    return ROK;
1862 }
1863
1864
1865 \f
1866 /***********************************************************
1867 *
1868 *     Func : cmPkRguLchDatInd
1869 *
1870 *
1871 *     Desc : RguLchDatInd
1872  * DatInd Information for a logical channel
1873 *
1874 *
1875 *     Ret  : S16
1876 *
1877 *     Notes:
1878 *
1879 *     File  : 
1880 *
1881 **********************************************************/
1882 #ifdef ANSI
1883 S16 cmPkRguLchDatInd
1884 (
1885 RguLchDatInd *param,
1886 Buffer *mBuf
1887 )
1888 #else
1889 S16 cmPkRguLchDatInd(param, mBuf)
1890 RguLchDatInd *param;
1891 Buffer *mBuf;
1892 #endif
1893 {
1894
1895       CMCHKPK(cmPkRguPduInfo, &param->pdu, mBuf);
1896    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
1897    return ROK;
1898 }
1899
1900
1901 \f
1902 /***********************************************************
1903 *
1904 *     Func : cmUnpkRguLchDatInd
1905 *
1906 *
1907 *     Desc : RguLchDatInd
1908  * DatInd Information for a logical channel
1909 *
1910 *
1911 *     Ret  : S16
1912 *
1913 *     Notes:
1914 *
1915 *     File  : 
1916 *
1917 **********************************************************/
1918 #ifdef ANSI
1919 S16 cmUnpkRguLchDatInd
1920 (
1921 RguLchDatInd *param,
1922 Buffer *mBuf
1923 )
1924 #else
1925 S16 cmUnpkRguLchDatInd(param, mBuf)
1926 RguLchDatInd *param;
1927 Buffer *mBuf;
1928 #endif
1929 {
1930
1931    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
1932    CMCHKUNPK(cmUnpkRguPduInfo, &param->pdu, mBuf);
1933    return ROK;
1934 }
1935
1936 \f
1937 /***********************************************************
1938 *
1939 *     Func : cmPkRguCStaRspInfo
1940 *
1941 *
1942 *     Desc : RguCStaRspInfo
1943  * Status Response from RLC to MAC  for common logical channel
1944 *
1945 *
1946 *     Ret  : S16
1947 *
1948 *     Notes:
1949 *
1950 *     File  : 
1951 *
1952 **********************************************************/
1953 #ifdef ANSI
1954 S16 cmPkRguCStaRspInfo
1955 (
1956 RguCStaRspInfo *param,
1957 Buffer *mBuf
1958 )
1959 #else
1960 S16 cmPkRguCStaRspInfo(param, mBuf)
1961 RguCStaRspInfo *param;
1962 Buffer *mBuf;
1963 #endif
1964 {
1965
1966
1967    switch(param->lcType) {
1968       case CM_LTE_LCH_CCCH:
1969          CMCHKPK(cmPkLteRnti, param->u.rnti, mBuf);
1970          break;
1971       case CM_LTE_LCH_BCCH:
1972       case CM_LTE_LCH_PCCH:
1973          CMCHKPK(cmPkLteTimingInfo, &param->u.timeToTx, mBuf);
1974 #ifdef EMTC_ENABLE
1975          CMCHKPK(oduUnpackUInt8,param->pnb,mBuf);
1976          CMCHKPK(oduUnpackUInt8,param->emtcDiReason,mBuf);
1977 #endif
1978          break;
1979       default :
1980          return RFAILED;
1981    }
1982    CMCHKPK(SPkS32, param->bo, mBuf);
1983    CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
1984    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
1985    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1986    return ROK;
1987 }
1988
1989
1990 \f
1991 /***********************************************************
1992 *
1993 *     Func : cmUnpkRguCStaRspInfo
1994 *
1995 *
1996 *     Desc : RguCStaRspInfo
1997  * Status Response from RLC to MAC  for common logical channel
1998 *
1999 *
2000 *     Ret  : S16
2001 *
2002 *     Notes:
2003 *
2004 *     File  : 
2005 *
2006 **********************************************************/
2007 #ifdef ANSI
2008 S16 cmUnpkRguCStaRspInfo
2009 (
2010 RguCStaRspInfo *param,
2011 Buffer *mBuf
2012 )
2013 #else
2014 S16 cmUnpkRguCStaRspInfo(param, mBuf)
2015 RguCStaRspInfo *param;
2016 Buffer *mBuf;
2017 #endif
2018 {
2019
2020
2021    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
2022    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
2023    CMCHKUNPK(cmUnpkLteLcType, &param->lcType, mBuf);
2024    CMCHKUNPK(SUnpkS32, &param->bo, mBuf);
2025    switch(param->lcType) {
2026       case CM_LTE_LCH_BCCH:
2027       case CM_LTE_LCH_PCCH:
2028 #ifdef EMTC_ENABLE
2029          CMCHKUNPK(oduPackUInt8,&param->emtcDiReason , mBuf);
2030          CMCHKUNPK(oduPackUInt8,&param->pnb , mBuf);
2031 #endif
2032          CMCHKUNPK(cmUnpkLteTimingInfo, &param->u.timeToTx, mBuf);
2033          break;
2034       case CM_LTE_LCH_CCCH:
2035          CMCHKUNPK(cmUnpkLteRnti, &param->u.rnti, mBuf);
2036          break;
2037       default :
2038          return RFAILED;
2039    }
2040    return ROK;
2041 }
2042
2043 \f
2044 /***********************************************************
2045 *
2046 *     Func : cmPkRguLchStaInd
2047 *
2048 *
2049 *     Desc : RguLchStaInd
2050  * StaInd info for each logical channel of a UE
2051 *
2052 *
2053 *     Ret  : S16
2054 *
2055 *     Notes:
2056 *
2057 *     File  : 
2058 *
2059 **********************************************************/
2060 #ifdef ANSI
2061 S16 cmPkRguLchStaInd
2062 (
2063 RguLchStaInd *param,
2064 Buffer *mBuf
2065 )
2066 #else
2067 S16 cmPkRguLchStaInd(param, mBuf)
2068 RguLchStaInd *param;
2069 Buffer *mBuf;
2070 #endif
2071 {
2072
2073
2074    CMCHKPK(SPkS16, param->totBufSize, mBuf);
2075    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
2076    return ROK;
2077 }
2078
2079
2080 \f
2081 /***********************************************************
2082 *
2083 *     Func : cmUnpkRguLchStaInd
2084 *
2085 *
2086 *     Desc : RguLchStaInd
2087  * StaInd info for each logical channel of a UE
2088 *
2089 *
2090 *     Ret  : S16
2091 *
2092 *     Notes:
2093 *
2094 *     File  : 
2095 *
2096 **********************************************************/
2097 #ifdef ANSI
2098 S16 cmUnpkRguLchStaInd
2099 (
2100 RguLchStaInd *param,
2101 Buffer *mBuf
2102 )
2103 #else
2104 S16 cmUnpkRguLchStaInd(param, mBuf)
2105 RguLchStaInd *param;
2106 Buffer *mBuf;
2107 #endif
2108 {
2109
2110
2111    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
2112    CMCHKUNPK(SUnpkS16, &param->totBufSize, mBuf);
2113    return ROK;
2114 }
2115
2116 \f
2117 /***********************************************************
2118 *
2119 *     Func : cmPkRguStaIndTb
2120 *
2121 *
2122 *     Desc : RguStaIndTb
2123 * StaInd from RLC to MAC for dedicated channels of a UE
2124 *
2125 *
2126 *     Ret  : S16
2127 *
2128 *     Notes:
2129 *
2130 *     File  : 
2131 *
2132 **********************************************************/
2133 #ifdef ANSI
2134 S16 cmPkRguStaIndTb
2135 (
2136 RguStaIndTb *param,
2137 Buffer *mBuf
2138 )
2139 #else
2140 S16 cmPkRguStaIndTb(param, mBuf)
2141 RguStaIndTb *param;
2142 Buffer *mBuf;
2143 #endif
2144 {
2145    S32 i;
2146
2147
2148 #ifdef LTE_L2_MEAS
2149    CMCHKPK(oduUnpackUInt16, param->status, mBuf);
2150    CMCHKPK(oduUnpackUInt32, param->tbId, mBuf);
2151 #endif   
2152    for (i=param->nmbLch-1; i >= 0; i--) {
2153       CMCHKPK(cmPkRguLchStaInd, &param->lchStaInd[i], mBuf);
2154    }
2155    CMCHKPK(oduUnpackUInt8, param->nmbLch, mBuf);
2156    return ROK;
2157 }
2158
2159
2160 \f
2161 /***********************************************************
2162 *
2163 *     Func : cmUnpkRguStaIndTb
2164 *
2165 *
2166 *     Desc : RguStaIndTb
2167 * StaInd from RLC to MAC for dedicated channels of a UE
2168 *
2169 *
2170 *     Ret  : S16
2171 *
2172 *     Notes:
2173 *
2174 *     File  : 
2175 *
2176 **********************************************************/
2177 #ifdef ANSI
2178 S16 cmUnpkRguStaIndTb
2179 (
2180 RguStaIndTb *param,
2181 Buffer *mBuf
2182 )
2183 #else
2184 S16 cmUnpkRguStaIndTb(param, mBuf)
2185 RguStaIndTb *param;
2186 Buffer *mBuf;
2187 #endif
2188 {
2189    S32 i;
2190
2191    CMCHKUNPK(oduPackUInt8, &param->nmbLch, mBuf);
2192    for (i=0; i<param->nmbLch; i++) {
2193       CMCHKUNPK(cmUnpkRguLchStaInd, &param->lchStaInd[i], mBuf);
2194    }
2195 #ifdef LTE_L2_MEAS
2196    CMCHKUNPK(oduPackUInt32, &param->tbId, mBuf);
2197    CMCHKUNPK(oduPackUInt16, &param->status, mBuf);
2198 #endif   
2199    return ROK;
2200 }
2201
2202 #endif
2203
2204 /**********************************************************************
2205          End of file
2206 **********************************************************************/