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