1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 /************************************************************************
25 Desc: C source code for packing/unpacking of RGU interface
30 **********************************************************************/
33 @brief This file contains the packing/unpacking code for the RGU interface
37 /* header include files (.h) */
38 #include "envopt.h" /* environment options */
39 #include "envdep.h" /* environment dependent */
40 #include "envind.h" /* environment independent */
41 #include "gen.h" /* general */
42 #include "ssi.h" /* system services */
43 #include "cm_tkns.h" /* Common Token Defines */
44 #include "cm_llist.h" /* Common Link List Defines */
45 #include "cm_hash.h" /* Common Hash List Defines */
46 #include "cm_lte.h" /* Common LTE Defines */
47 #include "rgu.h" /* RGU Interface defines */
49 /* header/extern include files (.x) */
50 #include "gen.x" /* general */
51 #include "ssi.x" /* system services */
52 #include "cm_tkns.x" /* Common Token Definitions */
53 #include "cm_llist.x" /* Common Link List Definitions */
54 #include "cm_lib.x" /* Common Library Definitions */
55 #include "cm_hash.x" /* Common Hash List Definitions */
56 #include "cm_lte.x" /* Common LTE Defines */
57 #include "rgu.x" /* RGU Interface includes */
68 * @brief Request from RLC to MAC to bind the interface saps
72 * Function : cmPkRguBndReq
75 * @param[in] SuId suId
76 * @param[in] SpId spId
81 PUBLIC S16 cmPkRguBndReq
88 PUBLIC S16 cmPkRguBndReq(pst, suId, spId)
97 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
98 #if (ERRCLASS & ERRCLS_ADD_RES)
99 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
100 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
101 (ErrVal)ERGU001, (ErrVal)0, "Packing failed");
105 if (SPkS16(spId, mBuf) != ROK) {
106 #if (ERRCLASS & ERRCLS_ADD_RES)
107 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
108 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
109 (ErrVal)ERGU002, (ErrVal)0, "Packing failed");
114 if (SPkS16(suId, mBuf) != ROK) {
115 #if (ERRCLASS & ERRCLS_ADD_RES)
116 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
117 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
118 (ErrVal)ERGU003, (ErrVal)0, "Packing failed");
123 pst->event = (Event) EVTRGUBNDREQ;
124 RETVALUE(SPstTsk(pst,mBuf));
129 * @brief Request from RLC to MAC to bind the interface saps
133 * Function : cmUnpkRguBndReq
135 * @param[in] Pst* pst
136 * @param[in] SuId suId
137 * @param[in] SpId spId
142 PUBLIC S16 cmUnpkRguBndReq
149 PUBLIC S16 cmUnpkRguBndReq(func, pst, mBuf)
158 TRC3(cmUnpkRguBndReq)
160 if (SUnpkS16(&suId, mBuf) != ROK) {
161 #if (ERRCLASS & ERRCLS_ADD_RES)
162 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
163 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
164 (ErrVal)ERGU004, (ErrVal)0, "UnPacking failed");
169 if (SUnpkS16(&spId, mBuf) != ROK) {
170 #if (ERRCLASS & ERRCLS_ADD_RES)
171 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
172 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
173 (ErrVal)ERGU005, (ErrVal)0, "UnPacking failed");
179 RETVALUE((*func)(pst, suId, spId));
184 * @brief Request from RLC to MAC to Unbind the interface saps
188 * Function : cmPkRguUbndReq
190 * @param[in] Pst* pst
191 * @param[in] SpId spId
192 * @param[in] Reason reason
197 PUBLIC S16 cmPkRguUbndReq
204 PUBLIC S16 cmPkRguUbndReq(pst, spId, reason)
210 Buffer *mBuf = NULLP;
213 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
214 #if (ERRCLASS & ERRCLS_ADD_RES)
215 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
216 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
217 (ErrVal)ERGU006, (ErrVal)0, "Packing failed");
221 if (SPkS16(reason, mBuf) != ROK) {
222 #if (ERRCLASS & ERRCLS_ADD_RES)
223 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
224 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
225 (ErrVal)ERGU007, (ErrVal)0, "Packing failed");
230 if (SPkS16(spId, mBuf) != ROK) {
231 #if (ERRCLASS & ERRCLS_ADD_RES)
232 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
233 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
234 (ErrVal)ERGU008, (ErrVal)0, "Packing failed");
239 pst->event = (Event) EVTRGUUBNDREQ;
240 RETVALUE(SPstTsk(pst,mBuf));
245 * @brief Request from RLC to MAC to Unbind the interface saps
249 * Function : cmUnpkRguUbndReq
251 * @param[in] Pst* pst
252 * @param[in] SpId spId
253 * @param[in] Reason reason
258 PUBLIC S16 cmUnpkRguUbndReq
265 PUBLIC S16 cmUnpkRguUbndReq(func, pst, mBuf)
274 TRC3(cmUnpkRguUbndReq)
276 if (SUnpkS16(&spId, mBuf) != ROK) {
277 #if (ERRCLASS & ERRCLS_ADD_RES)
278 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
279 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
280 (ErrVal)ERGU009, (ErrVal)0, "UnPacking failed");
285 if (SUnpkS16(&reason, mBuf) != ROK) {
286 #if (ERRCLASS & ERRCLS_ADD_RES)
287 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
288 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
289 (ErrVal)ERGU010, (ErrVal)0, "UnPacking failed");
295 RETVALUE((*func)(pst, spId, reason));
300 * @brief Confirmation from MAC to RLC for the bind/Unbind
301 * request for the interface saps
305 * Function : cmPkRguBndCfm
307 * @param[in] Pst* pst
308 * @param[in] SuId suId
309 * @param[in] U8 status
314 PUBLIC S16 cmPkRguBndCfm
321 PUBLIC S16 cmPkRguBndCfm(pst, suId, status)
327 Buffer *mBuf = NULLP;
330 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
331 #if (ERRCLASS & ERRCLS_ADD_RES)
332 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
333 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
334 (ErrVal)ERGU011, (ErrVal)0, "Packing failed");
338 if (SPkU8(status, mBuf) != ROK) {
339 #if (ERRCLASS & ERRCLS_ADD_RES)
340 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
341 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
342 (ErrVal)ERGU012, (ErrVal)0, "Packing failed");
347 if (SPkS16(suId, mBuf) != ROK) {
348 #if (ERRCLASS & ERRCLS_ADD_RES)
349 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
350 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
351 (ErrVal)ERGU013, (ErrVal)0, "Packing failed");
356 pst->event = (Event) EVTRGUBNDCFM;
357 RETVALUE(SPstTsk(pst,mBuf));
362 * @brief Confirmation from MAC to RLC for the bind/Unbind
363 * request for the interface saps
367 * Function : cmUnpkRguBndCfm
369 * @param[in] Pst* pst
370 * @param[in] SuId suId
371 * @param[in] U8 status
376 PUBLIC S16 cmUnpkRguBndCfm
383 PUBLIC S16 cmUnpkRguBndCfm(func, pst, mBuf)
392 TRC3(cmUnpkRguBndCfm)
394 if (SUnpkS16(&suId, mBuf) != ROK) {
395 #if (ERRCLASS & ERRCLS_ADD_RES)
396 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
397 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
398 (ErrVal)ERGU014, (ErrVal)0, "UnPacking failed");
403 if (SUnpkU8(&status, mBuf) != ROK) {
404 #if (ERRCLASS & ERRCLS_ADD_RES)
405 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
406 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
407 (ErrVal)ERGU015, (ErrVal)0, "UnPacking failed");
413 RETVALUE((*func)(pst, suId, status));
418 * @brief Request from RLC to MAC for forwarding SDUs on
419 * dedicated channel for transmission
423 * Function : packDlData
425 * @param[in] Pst* pst
426 * @param[in] SpId spId
427 * @param[in] RguDDatReqInfo * datReq
432 PUBLIC S16 packDlData
439 PUBLIC S16 packDlData(pst, spId, dlData)
445 Buffer *mBuf = NULLP;
448 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
449 #if (ERRCLASS & ERRCLS_ADD_RES)
450 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
451 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
452 (ErrVal)ERGU022, (ErrVal)0, "Packing failed");
454 SPutSBuf(pst->region, pst->pool, (Data *)dlData, sizeof(RlcMacData));
458 if (pst->selector == RGU_SEL_LWLC)
460 CMCHKPK(cmPkPtr,(PTR) dlData, mBuf);
464 /*rgu_c_001.main_5 - ADD - L2M Support */
466 if (packRlcMacDataInfo(pst, dlData, mBuf) != ROK)
468 if (packRlcMacDataInfo(dlData, mBuf) != ROK)
471 #if (ERRCLASS & ERRCLS_ADD_RES)
472 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
473 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
474 (ErrVal)ERGU023, (ErrVal)0, "Packing failed");
476 SPutSBuf(pst->region, pst->pool, (Data *)dlData,
482 if (SPutSBuf(pst->region, pst->pool,
483 (Data *)dlData, sizeof(RlcMacData)) != ROK) {
484 #if (ERRCLASS & ERRCLS_ADD_RES)
485 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
486 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
487 (ErrVal)ERGU025, (ErrVal)0, "Packing failed");
494 if (SPkS16(spId, mBuf) != ROK) {
495 #if (ERRCLASS & ERRCLS_ADD_RES)
496 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
497 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
498 (ErrVal)ERGU024, (ErrVal)0, "Packing failed");
500 if (dlData != NULLP);
502 SPutSBuf(pst->region, pst->pool,
503 (Data *)dlData, sizeof(RlcMacData));
508 pst->event = (Event) EVTRLCDLDAT;
509 RETVALUE(SPstTsk(pst,mBuf));
514 * @brief Request from RLC to MAC for forwarding SDUs on
515 * dedicated channel for transmission
519 * Function : unpackDlData
521 * @param[in] Pst* pst
522 * @param[in] SpId spId
523 * @param[in] RguDDatReqInfo * datReq
528 PUBLIC S16 unpackDlData
535 PUBLIC S16 unpackDlData(func, pst, mBuf)
542 // RguDDatReqInfo *datReq;
547 if (SUnpkS16(&spId, mBuf) != ROK) {
552 if (pst->selector == RGU_SEL_LWLC)
554 CMCHKUNPK(cmUnpkPtr,(PTR *) &dlData, mBuf);
558 if ((SGetSBuf(pst->region, pst->pool,
559 (Data **)&dlData, sizeof(RlcMacData))) != ROK) {
560 #if (ERRCLASS & ERRCLS_ADD_RES)
561 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
562 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
563 (ErrVal)ERGU026, (ErrVal)0, "UnPacking failed");
568 cmMemset((U8*)dlData, (U8)0, sizeof(RlcMacData));
569 /*rgu_c_001.main_5 - ADD - L2M Support */
571 if (unpackRlcMacDataInfo(pst,dlData, mBuf) != ROK)
573 if (unpackRlcMacDataInfo(dlData, mBuf) != ROK)
576 #if (ERRCLASS & ERRCLS_ADD_RES)
577 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
578 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
579 (ErrVal)ERGU027, (ErrVal)0, "UnPacking failed");
582 SPutSBuf(pst->region, pst->pool, (Data *)dlData,
589 /* TODO : change function call to send RlcMacData as below: */
590 RETVALUE((*func)(pst, spId, dlData));
592 //RETVALUE((*func)(pst, spId, datReq));
597 * @brief Data Indication from MAC to RLC to
598 * forward the data received for dedicated channels
602 * Function : packRcvdUlData
604 * @param[in] Pst* pst
605 * @param[in] SuId suId
606 * @param[in] RlcMacData *ulData
611 PUBLIC S16 packRcvdUlData
618 PUBLIC S16 packRcvdUlData(pst, suId, ulData)
624 Buffer *mBuf = NULLP;
627 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
628 #if (ERRCLASS & ERRCLS_ADD_RES)
629 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
630 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
631 (ErrVal)ERGU035, (ErrVal)0, "Packing failed");
633 SPutStaticBuffer(pst->region, pst->pool, (Data *)ulData, sizeof(RlcMacData),0);
637 if (pst->selector == RGU_SEL_LWLC)
639 CMCHKPK(cmPkPtr,(PTR)ulData, mBuf);
643 if (packRlcMacDataInfo(ulData, mBuf) != ROK) {
644 #if (ERRCLASS & ERRCLS_ADD_RES)
645 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
646 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
647 (ErrVal)ERGU036, (ErrVal)0, "Packing failed");
649 SPutStaticBuffer(pst->region, pst->pool, (Data *)ulData, sizeof(RlcMacData),0);
654 if (SPutStaticBuffer(pst->region, pst->pool,
655 (Data *)ulData, sizeof(RlcMacData),0) != ROK) {
656 #if (ERRCLASS & ERRCLS_ADD_RES)
657 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
658 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
659 (ErrVal)ERGU038, (ErrVal)0, "Packing failed");
666 if (SPkS16(suId, mBuf) != ROK) {
667 #if (ERRCLASS & ERRCLS_ADD_RES)
668 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
669 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
670 (ErrVal)ERGU037, (ErrVal)0, "Packing failed");
672 SPutStaticBuffer(pst->region, pst->pool, (Data *)ulData, sizeof(RlcMacData),0);
677 pst->event = (Event) EVTRLCULDAT;
678 RETVALUE(SPstTsk(pst,mBuf));
683 * @brief Data Indication from MAC to RLC to
684 * forward the data received for dedicated channels
688 * Function : unpackRcvdUlData
690 * @param[in] Pst* pst
691 * @param[in] SuId suId
692 * @param[in] RlcMacData *ulData
697 PUBLIC S16 unpackRcvdUlData
704 PUBLIC S16 unpackRcvdUlData(func, pst, mBuf)
713 TRC3(unpackRcvdUlData)
715 if (SUnpkS16(&suId, mBuf) != ROK) {
716 #if (ERRCLASS & ERRCLS_ADD_RES)
717 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
718 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
719 (ErrVal)ERGU039, (ErrVal)0, "UnPacking failed");
725 if (pst->selector == RGU_SEL_LWLC)
727 CMCHKUNPK(cmUnpkPtr,(PTR *) &ulData, mBuf);
731 if ((SGetStaticBuffer(pst->region, pst->pool,
732 (Data **)&ulData, sizeof(RlcMacData),0)) != ROK) {
733 #if (ERRCLASS & ERRCLS_ADD_RES)
734 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
735 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
736 (ErrVal)ERGU040, (ErrVal)0, "UnPacking failed");
741 if (unpackRlcMacDataInfo(ulData, mBuf) != ROK) {
742 #if (ERRCLASS & ERRCLS_ADD_RES)
743 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
744 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
745 (ErrVal)ERGU041, (ErrVal)0, "UnPacking failed");
748 SPutStaticBuffer(pst->region, pst->pool,
749 (Data *)ulData, sizeof(RlcMacData),0);
754 RETVALUE((*func)(pst, suId, ulData));
758 /*rgu_c_001.main_5 - ADD - L2M & R9 Support */
761 /***********************************************************
763 * Func :cmPkRguL2MUlThrpMeasReqInfo
766 * Status Response from RLC to MAC on UL dedicated logical channel for Uplink
767 * Scheduled throughput measurement
776 **********************************************************/
778 PUBLIC S16 cmPkRguL2MUlThrpMeasReqInfo
780 RguL2MUlThrpMeasReqInfo* param,
784 PUBLIC S16 cmPkRguL2MUlThrpMeasReqInfo(param, mBuf)
785 RguL2MUlThrpMeasReqInfo* param;
790 TRC3(cmPkRguL2MUlThrpMeasReqInfo);
792 CMCHKPK(SPkU8, param->enbMeas, mBuf);
793 for (loop=param->numLcId-1; loop >= 0; loop--)
795 CMCHKPK(SPkU8, param->lcId[loop], mBuf);
797 CMCHKPK(cmPkLteLcId, param->numLcId, mBuf);
798 CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
799 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
805 /***********************************************************
807 * Func :cmUnpkRguL2MUlThrpMeasReqInfo
810 * Status Response from RLC to MAC on UL dedicated logical channel for Uplink
811 * Scheduled throughput measurement
820 **********************************************************/
822 PUBLIC S16 cmUnpkRguL2MUlThrpMeasReqInfo
824 RguL2MUlThrpMeasReqInfo *param,
828 PUBLIC S16 cmUnpkRguL2MUlThrpMeasReqInfo(param, mBuf)
829 RguL2MUlThrpMeasReqInfo *param;
834 TRC3(cmUnpkRguL2MUlThrpMeasReqInfo);
836 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
837 CMCHKUNPK(cmUnpkLteRnti, ¶m->rnti, mBuf);
838 CMCHKUNPK(cmUnpkLteLcId, ¶m->numLcId, mBuf);
839 for (loop=0; loop<param->numLcId; loop++)
841 CMCHKUNPK(SUnpkU8, ¶m->lcId[loop], mBuf);
843 CMCHKUNPK(SUnpkU8, ¶m->enbMeas, mBuf);
848 * @brief Primitive invoked from RLC to MAC to
849 * inform the On/Off status for Scheduled UL throughput
850 * measurment for dedicated channels
854 * Function :cmPkRguL2MUlThrpMeasReq
856 * @param[in] Pst* pst
857 * @param[in] SpId spId
858 * @param[in] RguL2MUlThrpMeasReqInfo* measReq
863 PUBLIC S16 cmPkRguL2MUlThrpMeasReq
867 RguL2MUlThrpMeasReqInfo* measReq
870 PUBLIC S16 cmPkRguL2MUlThrpMeasReq(pst, spId, measReq)
873 RguL2MUlThrpMeasReqInfo* measReq;
876 Buffer *mBuf = NULLP;
877 TRC3(cmPkRguL2MUlThrpMeasReq)
879 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
880 #if (ERRCLASS & ERRCLS_ADD_RES)
881 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
882 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
883 (ErrVal)ERGU049, (ErrVal)0, "Packing failed");
885 SPutSBuf(pst->region, pst->pool, (Data *)measReq, sizeof(RguL2MUlThrpMeasReqInfo));
888 if (pst->selector == RGU_SEL_LWLC)
890 CMCHKPK(cmPkPtr,(PTR) measReq, mBuf);
894 if (cmPkRguL2MUlThrpMeasReqInfo(measReq, mBuf) != ROK) {
895 #if (ERRCLASS & ERRCLS_ADD_RES)
896 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
897 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
898 (ErrVal)ERGU050, (ErrVal)0, "Packing failed");
900 SPutSBuf(pst->region, pst->pool, (Data *)measReq,
901 sizeof(RguL2MUlThrpMeasReqInfo));
905 if (SPutSBuf(pst->region, pst->pool, (Data *)measReq,
906 sizeof(RguL2MUlThrpMeasReqInfo)) != ROK) {
907 #if (ERRCLASS & ERRCLS_ADD_RES)
908 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
909 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
910 (ErrVal)ERGU052, (ErrVal)0, "Packing failed");
918 if (SPkS16(spId, mBuf) != ROK) {
919 #if (ERRCLASS & ERRCLS_ADD_RES)
920 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
921 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
922 (ErrVal)ERGU051, (ErrVal)0, "Packing failed");
924 if (measReq != NULLP)
926 SPutSBuf(pst->region, pst->pool, (Data *)measReq,
927 sizeof(RguL2MUlThrpMeasReqInfo));
933 pst->event = (Event) EVTRGUL2MULTHRPMEASREQ;
934 RETVALUE(SPstTsk(pst,mBuf));
939 * @brief Primitive invoked from RLC to MAC to
940 * inform the On/Off status for Scheduled UL throughput
941 * measurment for dedicated channels
945 * Function :cmUnpkRguL2MUlThrpMeasReq
947 * @param[in] Pst* pst
948 * @param[in] SpId spId
949 * @param[in] RguL2MUlThrpMeasReqInfo * measReq
954 PUBLIC S16 cmUnpkRguL2MUlThrpMeasReq
956 RguL2MUlThrpMeasReq func,
961 PUBLIC S16 cmUnpkRguL2MUlThrpMeasReq(func, pst, mBuf)
962 RguL2MUlThrpMeasReq func;
968 RguL2MUlThrpMeasReqInfo* measReq;
970 TRC3(cmUnpkRguL2MUlThrpMeasReq)
972 if (SUnpkS16(&spId, mBuf) != ROK) {
973 #if (ERRCLASS & ERRCLS_ADD_RES)
974 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
975 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
976 (ErrVal)ERGU053, (ErrVal)0, "UnPacking failed");
981 if (pst->selector == RGU_SEL_LWLC)
983 CMCHKUNPK(cmUnpkPtr,(PTR *) &measReq, mBuf);
987 if ((SGetSBuf(pst->region, pst->pool, (Data **)&measReq,
988 sizeof(RguL2MUlThrpMeasReqInfo))) != ROK) {
989 #if (ERRCLASS & ERRCLS_ADD_RES)
990 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
991 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
992 (ErrVal)ERGU054, (ErrVal)0, "UnPacking failed");
997 if (cmUnpkRguL2MUlThrpMeasReqInfo(measReq, mBuf) != ROK) {
998 #if (ERRCLASS & ERRCLS_ADD_RES)
999 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1000 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1001 (ErrVal)ERGU055, (ErrVal)0, "UnPacking failed");
1004 SPutSBuf(pst->region, pst->pool, (Data *)measReq,
1005 sizeof(RguL2MUlThrpMeasReqInfo));
1010 RETVALUE((*func)(pst, spId, measReq));
1019 * @brief Primitive invoked from RLC to MAC to
1020 * inform the BO report for dedicated channels
1024 * Function : packBOStatus,
1026 * @param[in] Pst* pst
1027 * @param[in] SpId spId
1028 * @param[in] RlcMacBOStatus * staRsp
1033 PUBLIC S16 packBOStatus
1037 RlcMacBOStatus *boStatus
1040 PUBLIC S16 packBOStatus(pst, spId, staRsp)
1043 RlcMacBOStatus *boStatus;
1046 RlcMacBOStatus *boStaInfo = NULL;
1047 Buffer *mBuf = NULLP;
1049 if(SGetSBuf(pst->region, pst->pool, (Data **)&boStaInfo, sizeof(RlcMacBOStatus)) != ROK)
1051 #if (ERRCLASS & ERRCLS_ADD_RES)
1052 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1053 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1054 (ErrVal)ERGU056, (ErrVal)0, "Packing failed");
1059 /* boStaInfo cant be NULL here */
1060 if (boStaInfo == NULLP)
1065 cmMemcpy((U8 *)boStaInfo, (U8 *)boStatus, sizeof(RlcMacBOStatus));
1066 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1067 #if (ERRCLASS & ERRCLS_ADD_RES)
1068 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1069 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1070 (ErrVal)ERGU056, (ErrVal)0, "Packing failed");
1072 SPutSBuf(pst->region, pst->pool, (Data *)boStaInfo, sizeof(RlcMacBOStatus));
1076 if (pst->selector == RGU_SEL_LWLC)
1078 CMCHKPK(cmPkPtr,(PTR) boStaInfo, mBuf);
1082 if (packBOStatusInfo(boStatus, mBuf) != ROK) {
1083 #if (ERRCLASS & ERRCLS_ADD_RES)
1084 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1085 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1086 (ErrVal)ERGU057, (ErrVal)0, "Packing failed");
1092 if (SPkS16(spId, mBuf) != ROK) {
1093 #if (ERRCLASS & ERRCLS_ADD_RES)
1094 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1095 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1096 (ErrVal)ERGU058, (ErrVal)0, "Packing failed");
1098 if (boStaInfo != NULLP)
1100 SPutSBuf(pst->region, pst->pool, (Data *)boStaInfo, sizeof(RlcMacBOStatus));
1106 pst->event = (Event)EVTRLCBOSTA;
1107 RETVALUE(SPstTsk(pst,mBuf));
1113 * @brief Primitive invoked from RLC to MAC to
1114 * inform the BO report for dedicated channels
1118 * Function : unpackBOStatus
1120 * @param[in] Pst* pst
1121 * @param[in] SpId spId
1122 * @param[in] RlcMacBOStatus * staRsp
1127 PUBLIC S16 unpackBOStatus
1134 PUBLIC S16 unpackBOStatus(func, pst, mBuf)
1141 RlcMacBOStatus *boSta;
1143 TRC3(unpackBOStatus)
1145 if (SUnpkS16(&spId, mBuf) != ROK) {
1146 #if (ERRCLASS & ERRCLS_ADD_RES)
1147 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1148 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1149 (ErrVal)ERGU060, (ErrVal)0, "UnPacking failed");
1155 if (pst->selector == RGU_SEL_LWLC)
1157 CMCHKUNPK(cmUnpkPtr,(PTR *) &boSta, mBuf);
1161 if ((SGetSBuf(pst->region, pst->pool, (Data **)&boSta,
1162 sizeof(RlcMacBOStatus))) != ROK) {
1163 #if (ERRCLASS & ERRCLS_ADD_RES)
1164 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1165 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1166 (ErrVal)ERGU061, (ErrVal)0, "UnPacking failed");
1171 if (unpackBOStatusInfo(boSta, mBuf) != ROK) {
1172 #if (ERRCLASS & ERRCLS_ADD_RES)
1173 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1174 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1175 (ErrVal)ERGU062, (ErrVal)0, "UnPacking failed");
1178 SPutSBuf(pst->region, pst->pool, (Data *)boSta, sizeof(RlcMacBOStatus));
1183 // (*func)(pst, spId, boSta);
1184 SPutSBuf(pst->region, pst->pool, (Data *)boSta, sizeof(RlcMacBOStatus));
1189 /*rgu_c_001.main_5 - ADD - L2M Support */
1193 * @brief Harq Status Indication from MAC to RLC
1197 * Function : cmPkRguHqStaInd
1199 * @param[in] Pst* pst
1200 * @param[in] SuId suId
1201 * @param[in] RguHarqStatusInd *harqStatusInd
1206 PUBLIC S16 cmPkRguHqStaInd
1210 RguHarqStatusInd *harqStatusInd
1213 PUBLIC S16 cmPkRguHqStaInd(pst, suId, harqStatusInd)
1216 RguHarqStatusInd *harqStatusInd;
1222 RguHarqStatusInd *harqStaInd = NULL;
1224 TRC3(cmPkRguHqStaInd)
1225 #ifdef XEON_SPECIFIC_CHANGES
1226 if (SGetSBuf(pst->region, pst->pool, (Data **)&harqStaInd, sizeof(RguHarqStatusInd)) != ROK)
1228 if ((SGetStaticBuffer(pst->region, pst->pool,
1229 (Data **)&harqStaInd, sizeof(RguHarqStatusInd),0)) != ROK)
1232 #if (ERRCLASS & ERRCLS_ADD_RES)
1233 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1234 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1235 (ErrVal)ERGU070, (ErrVal)0, "Packing failed");
1240 cmMemcpy((U8 *)harqStaInd, (U8 *)harqStatusInd, sizeof(RguHarqStatusInd));
1242 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1243 #if (ERRCLASS & ERRCLS_ADD_RES)
1244 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1245 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1246 (ErrVal)ERGU070, (ErrVal)0, "Packing failed");
1248 #ifdef XEON_SPECIFIC_CHANGES
1249 SPutSBuf(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd));
1251 SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd), 0);
1256 if (pst->selector == RGU_SEL_LWLC)
1258 CMCHKPK(cmPkPtr,(PTR) harqStaInd, mBuf);
1262 for(idx = 0; idx < harqStaInd->numTbs; idx++)
1264 CMCHKPK(SPkU16, harqStaInd->status[idx], mBuf);
1266 for(idx = 0; idx < harqStaInd->numTbs; idx++)
1268 CMCHKPK(SPkU32, harqStaInd->tbId[idx], mBuf);
1270 CMCHKPK(SPkU8, harqStaInd->numTbs, mBuf);
1271 CMCHKPK(cmPkLteRnti, harqStaInd->ueId, mBuf);
1272 CMCHKPK(cmPkLteCellId, harqStaInd->cellId, mBuf);
1274 if (SPkS16(suId, mBuf) != ROK) {
1275 #if (ERRCLASS & ERRCLS_ADD_RES)
1276 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1277 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1278 (ErrVal)ERGU071, (ErrVal)0, "Packing failed");
1280 #ifdef XEON_SPECIFIC_CHANGES
1281 SPutSBuf(pst->region, pst->pool, (Data *)harqStaInd,
1282 sizeof(RguHarqStatusInd));
1284 SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd), 0);
1289 #ifdef XEON_SPECIFIC_CHANGES
1290 if (SPutSBuf(pst->region, pst->pool, (Data *)harqStaInd,
1291 sizeof(RguHarqStatusInd)) != ROK) {
1293 if (pst->selector != RGU_SEL_LWLC)
1295 if(SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd,
1296 sizeof(RguHarqStatusInd), 0) != ROK)
1299 #if (ERRCLASS & ERRCLS_ADD_RES)
1300 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1301 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1302 (ErrVal)ERGU072, (ErrVal)0, "Packing failed");
1307 #ifndef XEON_SPECIFIC_CHANGES
1311 pst->event = (Event) EVTRGUHQSTAIND;
1312 RETVALUE(SPstTsk(pst,mBuf));
1317 * @brief Harq Status Indication from MAC to RLC
1321 * Function : cmUnpkRguHqStaInd
1323 * @param[in] RguHqStaInd func
1324 * @param[in] Pst *pst
1325 * @param[in] Buffer *mBuf
1330 PUBLIC S16 cmUnpkRguHqStaInd
1337 PUBLIC S16 cmUnpkRguHqStaInd(func, pst, mBuf)
1343 RguHarqStatusInd *hqStaInd;
1347 TRC3(cmUnpkRguHqStaInd)
1349 if (SUnpkS16(&suId, mBuf) != ROK) {
1350 #if (ERRCLASS & ERRCLS_ADD_RES)
1351 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1352 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1353 (ErrVal)ERGU073, (ErrVal)0, "UnPacking failed");
1358 #ifdef XEON_SPECIFIC_CHANGES
1359 if ((SGetSBuf(pst->region, pst->pool, (Data **)&hqStaInd,
1360 sizeof(RguHarqStatusInd))) != ROK) {
1362 if (pst->selector == RGU_SEL_LWLC)
1364 CMCHKUNPK(cmUnpkPtr,(PTR *) &hqStaInd, mBuf);
1368 if ((SGetStaticBuffer(pst->region, pst->pool,
1369 (Data **)&hqStaInd, sizeof(RguHarqStatusInd),0)) != ROK)
1372 #if (ERRCLASS & ERRCLS_ADD_RES)
1373 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1374 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1375 (ErrVal)ERGU074, (ErrVal)0, "UnPacking failed");
1380 CMCHKUNPK(cmUnpkLteCellId, &hqStaInd->cellId, mBuf);
1381 CMCHKUNPK(cmUnpkLteRnti, &hqStaInd->ueId, mBuf);
1382 CMCHKUNPK(SUnpkU8, &hqStaInd->numTbs, mBuf);
1383 for(idx = hqStaInd->numTbs; idx > 0; idx--)
1385 CMCHKUNPK(SUnpkU32, &hqStaInd->tbId[idx - 1], mBuf);
1387 for(idx = hqStaInd->numTbs; idx > 0; idx--)
1389 CMCHKUNPK(SUnpkU16, &hqStaInd->status[idx - 1], mBuf);
1391 #ifndef XEON_SPECIFIC_CHANGES
1395 (*func)(pst, suId, hqStaInd);
1396 #ifdef XEON_SPECIFIC_CHANGES
1397 SPutSBuf(pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd));
1399 SPutStaticBuffer(pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd), 0);
1403 #endif /* LTE_L2_MEAS */
1407 * @brief Status Indication from MAC to RLC
1408 * as a response to the staRsp primitive from RLC.
1409 * Informs RLC of the totalBufferSize and Timing Info
1410 * for the transmission on dedicated channels.
1414 * Function : packSchedRep
1416 * @param[in] Pst* pst
1417 * @param[in] SuId suId
1418 * @param[in] RlcMacSchedRep* schRep
1423 PUBLIC S16 packSchedRep
1427 RlcMacSchedRep * schRep
1430 PUBLIC S16 packSchedRep(pst, suId, staInd)
1433 RlcMacSchedRep * schRep;
1436 Buffer *mBuf = NULLP;
1439 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1440 #if (ERRCLASS & ERRCLS_ADD_RES)
1441 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1442 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1443 (ErrVal)ERGU076, (ErrVal)0, "Packing failed");
1445 SPutSBuf(pst->region, pst->pool, (Data *)schRep, sizeof(RlcMacSchedRep));
1448 if (pst->selector == RGU_SEL_LWLC)
1450 CMCHKPK(cmPkPtr,(PTR) schRep, mBuf);
1454 if (packSchedRepInfo(schRep, mBuf) != ROK) {
1455 #if (ERRCLASS & ERRCLS_ADD_RES)
1456 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1457 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1458 (ErrVal)ERGU077, (ErrVal)0, "Packing failed");
1460 SPutSBuf(pst->region, pst->pool, (Data *)schRep,
1461 sizeof(RlcMacSchedRep));
1465 if (SPutSBuf(pst->region, pst->pool, (Data *)schRep,
1466 sizeof(RlcMacSchedRep)) != ROK) {
1467 #if (ERRCLASS & ERRCLS_ADD_RES)
1468 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1469 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1470 (ErrVal)ERGU079, (ErrVal)0, "Packing failed");
1477 if (SPkS16(suId, mBuf) != ROK) {
1478 #if (ERRCLASS & ERRCLS_ADD_RES)
1479 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1480 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1481 (ErrVal)ERGU078, (ErrVal)0, "Packing failed");
1483 if (schRep != NULLP)
1485 SPutSBuf(pst->region, pst->pool, (Data *)schRep, sizeof(RlcMacSchedRep));
1491 pst->event = (Event) EVTSCHREP;
1492 RETVALUE(SPstTsk(pst,mBuf));
1497 * @brief Status Indication from MAC to RLC
1498 * as a response to the staRsp primitive from RLC.
1499 * Informs RLC of the totalBufferSize and Timing Info
1500 * for the transmission on dedicated channels.
1504 * Function : unpackSchedRep
1506 * @param[in] Pst* pst
1507 * @param[in] SuId suId
1508 * @param[in] RguDStaIndInfo * staInd
1513 PUBLIC S16 unpackSchedRep
1520 PUBLIC S16 unpackSchedRep(func, pst, mBuf)
1527 // RguDStaIndInfo *staInd;
1528 RlcMacSchedRep *schRep;
1530 TRC3(unpackSchedRep)
1532 if (SUnpkS16(&suId, mBuf) != ROK) {
1533 #if (ERRCLASS & ERRCLS_ADD_RES)
1534 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1535 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1536 (ErrVal)ERGU080, (ErrVal)0, "UnPacking failed");
1541 if (pst->selector == RGU_SEL_LWLC)
1543 CMCHKUNPK(cmUnpkPtr,(PTR *) &schRep, mBuf);
1547 if ((SGetSBuf(pst->region, pst->pool, (Data **)&schRep, sizeof(RlcMacSchedRep))) != ROK) {
1548 #if (ERRCLASS & ERRCLS_ADD_RES)
1549 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1550 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1551 (ErrVal)ERGU081, (ErrVal)0, "UnPacking failed");
1556 if (unpackSchedRepInfo(schRep, mBuf) != ROK) {
1557 #if (ERRCLASS & ERRCLS_ADD_RES)
1558 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1559 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1560 (ErrVal)ERGU082, (ErrVal)0, "UnPacking failed");
1563 SPutSBuf(pst->region, pst->pool, (Data *)schRep, sizeof(RlcMacSchedRep));
1568 RETVALUE((*func)(pst, suId, schRep));
1572 PUBLIC S16 cmPkRguLcFlowCntrlInfo
1574 RguLcFlowCntrlInfo *param,
1578 PUBLIC S16 cmPkRguLcFlowCntrlInfo (param,mBuf)
1579 RguLcFlowCntrlInfo *param;
1583 TRC3(cmPkRguLcFlowCntrlInfo);
1584 CMCHKPK(SPkU32, param->maxBo4FlowCtrl, mBuf);
1585 CMCHKPK(SPkU32, param->pktAdmitCnt, mBuf);
1586 CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
1592 PUBLIC S16 cmPkRguUeFlowCntrlInfo
1594 RguUeFlowCntrlInfo *param,
1598 PUBLIC S16 cmPkRguUeFlowCntrlInfo (param,mBuf)
1599 RguUeFlowCntrlInfo *param;
1605 TRC3(cmPkRguUeFlowCntrlInfo);
1607 for(idx=(param->numLcs - 1); idx >= 0; idx--)
1609 cmPkRguLcFlowCntrlInfo(¶m->lcInfo[idx],mBuf);
1611 CMCHKPK(SPkU32, param->numLcs, mBuf);
1612 CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
1617 PUBLIC S16 cmPkRguFlowCntrlInfo
1619 RguFlowCntrlInd *param,
1623 PUBLIC S16 cmPkRguFlowCntrlInfo(flowCntrlInd, mBuf)
1624 RguFlowCntrlInd *param;
1630 TRC3(cmPkRguFlowCntrlInfo);
1632 for (idx=(param->numUes - 1); idx >= 0; idx--)
1634 cmPkRguUeFlowCntrlInfo(¶m->ueFlowCntrlInfo[idx],mBuf);
1636 CMCHKPK(SPkU32, param->numUes, mBuf);
1637 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1642 * @brief Flow Cntrl Indication from MAC to RLC
1643 * Informs RLC of the LCs on which flow control
1648 * Function : cmPkRguFlowCntrlInd
1650 * @param[in] Pst* pst
1651 * @param[in] SuId suId
1652 * @param[in] RguFlowCntrlInd *staInd
1657 PUBLIC S16 cmPkRguFlowCntrlInd
1661 RguFlowCntrlInd *flowCntrlInd
1664 PUBLIC S16 cmPkRguFlowCntrlInd(pst, suId, flowCntrlInd)
1667 RguFlowCntrlInd *flowCntrlInd;
1670 Buffer *mBuf = NULLP;
1672 TRC3(cmPkRguFlowCntrlInd);
1673 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1674 #if (ERRCLASS & ERRCLS_ADD_RES)
1675 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1676 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1677 (ErrVal)ERGU076, (ErrVal)0, "Packing failed");
1681 if (pst->selector == RGU_SEL_LWLC)
1683 CMCHKPK(cmPkPtr,(PTR) flowCntrlInd, mBuf);
1687 if (cmPkRguFlowCntrlInfo(flowCntrlInd, mBuf) != ROK) {
1688 #if (ERRCLASS & ERRCLS_ADD_RES)
1689 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1690 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1691 (ErrVal)ERGU077, (ErrVal)0, "Packing failed");
1697 if (SPkS16(suId, mBuf) != ROK) {
1698 #if (ERRCLASS & ERRCLS_ADD_RES)
1699 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1700 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1701 (ErrVal)ERGU078, (ErrVal)0, "Packing failed");
1707 pst->event = (Event) EVTRGUFLOWCNTRLIND;
1708 RETVALUE(SPstTsk(pst,mBuf));
1712 PUBLIC S16 cmUnpkRguLcFlowCntrlInfo
1714 RguLcFlowCntrlInfo *param,
1718 PUBLIC S16 cmUnpkRguLcFlowCntrlInfo (param,mBuf)
1719 RguLcFlowCntrlInfo *param;
1723 TRC3(cmUnpkRguLcFlowCntrlInfo);
1725 CMCHKUNPK(cmUnpkLteLcId, ¶m->lcId, mBuf);
1726 CMCHKUNPK(SUnpkU32, ¶m->pktAdmitCnt, mBuf);
1727 CMCHKUNPK(SUnpkU32, ¶m->maxBo4FlowCtrl, mBuf);
1732 PUBLIC S16 cmUnpkRguUeFlowCntrlInfo
1734 RguUeFlowCntrlInfo *param,
1738 PUBLIC S16 cmUnpkRguUeFlowCntrlInfo (param,mBuf)
1739 RguUeFlowCntrlInfo *param;
1744 TRC3(cmUnpkRguUeFlowCntrlInfo);
1745 CMCHKUNPK(cmUnpkLteRnti, ¶m->ueId, mBuf);
1746 CMCHKUNPK(SUnpkU32, ¶m->numLcs, mBuf);
1747 for(idx=0; idx < param->numLcs; idx++)
1749 cmUnpkRguLcFlowCntrlInfo(¶m->lcInfo[idx],mBuf);
1755 PUBLIC S16 cmUnpkRguFlowCntrlInfo
1757 RguFlowCntrlInd *param,
1761 PUBLIC S16 cmUnpkRguFlowCntrlInfo(flowCntrlInfo, mBuf)
1762 RguFlowCntrlInd *param;
1768 TRC3(cmUnpkRguFlowCntrlInfo);
1770 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
1771 CMCHKUNPK(SUnpkU32, ¶m->numUes, mBuf);
1772 for (idx=0; idx < param->numUes; idx++)
1774 cmUnpkRguUeFlowCntrlInfo(¶m->ueFlowCntrlInfo[idx],mBuf);
1780 * @brief Flow control indication from MAC to RLC
1781 * Informs RLC of the LCs on which flow control to
1786 * Function : cmUnpkRguFlowCntrlInd
1788 * @param[in] RguFlowCntrlInd func
1789 * @param[in] Pst *pst
1790 * @param[in] Buffer *mBuf
1795 PUBLIC S16 cmUnpkRguFlowCntrlInd
1797 RguFlowCntrlIndInfo func,
1802 PUBLIC S16 cmUnpkRguFlowCntrlInd(func, pst, mBuf)
1803 RguFlowCntrlIndInfo func;
1809 RguFlowCntrlInd *flowCntrlInd;
1811 TRC3(cmUnpkRguFlowCntrlInd)
1813 if (SUnpkS16(&suId, mBuf) != ROK) {
1814 #if (ERRCLASS & ERRCLS_ADD_RES)
1815 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1816 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1817 (ErrVal)ERGU080, (ErrVal)0, "UnPacking failed");
1822 if (pst->selector == RGU_SEL_LWLC)
1824 CMCHKUNPK(cmUnpkPtr,(PTR *) &flowCntrlInd, mBuf);
1828 if ((SGetSBuf(pst->region, pst->pool, (Data **)&flowCntrlInd, sizeof(RguFlowCntrlInd))) != ROK) {
1829 #if (ERRCLASS & ERRCLS_ADD_RES)
1830 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1831 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1832 (ErrVal)ERGU081, (ErrVal)0, "UnPacking failed");
1837 if (cmUnpkRguFlowCntrlInfo(flowCntrlInd, mBuf) != ROK) {
1838 #if (ERRCLASS & ERRCLS_ADD_RES)
1839 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1840 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1841 (ErrVal)ERGU082, (ErrVal)0, "UnPacking failed");
1844 SPutSBuf(pst->region, pst->pool, (Data *)flowCntrlInd, sizeof(RguFlowCntrlInd));
1849 RETVALUE((*func)(pst, suId, flowCntrlInd));
1852 /***********************************************************
1854 * Func : cmPkRguPduInfo
1858 * PDU information given on a logical channel
1867 **********************************************************/
1869 PUBLIC S16 cmPkRguPduInfo
1875 PUBLIC S16 cmPkRguPduInfo(param, mBuf)
1882 TRC3(cmPkRguPduInfo);
1884 for (i=param->numPdu-1; i >= 0; i--) {
1885 /* rgu_c_001.main_3: ccpu00111328: S16 is renamed as MsgLen */
1887 if (SFndLenMsg(param->mBuf[i], &msgLen) != ROK)
1889 if (SCatMsg(mBuf, param->mBuf[i], M1M2) != ROK)
1891 SPutMsg(param->mBuf[i]);
1892 CMCHKPK(cmPkMsgLen, msgLen, mBuf);
1894 CMCHKPK(SPkU8, param->numPdu, mBuf);
1900 /***********************************************************
1902 * Func : cmUnpkRguPduInfo
1906 * PDU information given on a logical channel
1915 **********************************************************/
1917 PUBLIC S16 cmUnpkRguPduInfo
1923 PUBLIC S16 cmUnpkRguPduInfo(param, mBuf)
1930 TRC3(cmUnpkRguPduInfo);
1932 CMCHKUNPK(SUnpkU8, ¶m->numPdu, mBuf);
1933 for (i=0; i<param->numPdu; i++) {
1934 MsgLen msgLen, totalMsgLen;
1935 CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
1936 if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
1938 if (SSegMsg(mBuf, totalMsgLen-msgLen, ¶m->mBuf[i]) != ROK)
1946 /***********************************************************
1948 * Func : cmPkRguDBoReport
1951 * Desc : RguDBoReport
1952 * Buffer Occupancy Report for dedicated logical channel
1961 **********************************************************/
1963 PUBLIC S16 cmPkRguDBoReport
1965 RguDBoReport *param,
1969 PUBLIC S16 cmPkRguDBoReport(param, mBuf)
1970 RguDBoReport *param;
1975 TRC3(cmPkRguDBoReport);
1977 CMCHKPK(SPkU32, param->oldestSduArrTime, mBuf);
1978 CMCHKPK(SPkU32, param->staPduBo, mBuf);
1980 CMCHKPK(SPkU8, param->staPduPrsnt, mBuf);
1981 CMCHKPK(SPkU16, param->estRlcHdrSz, mBuf);
1983 CMCHKPK(SPkS32, param->bo, mBuf);
1989 /***********************************************************
1991 * Func : cmUnpkRguDBoReport
1994 * Desc : RguDBoReport
1995 * Buffer Occupancy Report for dedicated logical channel
2004 **********************************************************/
2006 PUBLIC S16 cmUnpkRguDBoReport
2008 RguDBoReport *param,
2012 PUBLIC S16 cmUnpkRguDBoReport(param, mBuf)
2013 RguDBoReport *param;
2018 TRC3(cmUnpkRguDBoReport);
2020 CMCHKUNPK(SUnpkS32, ¶m->bo, mBuf);
2022 CMCHKUNPK(SUnpkU16, ¶m->estRlcHdrSz, mBuf);
2023 CMCHKUNPK(SUnpkU8, ¶m->staPduPrsnt, mBuf);
2026 CMCHKUNPK(SUnpkU32, ¶m->staPduBo, mBuf);
2027 CMCHKUNPK(SUnpkU32, ¶m->oldestSduArrTime, mBuf);
2032 /***********************************************************
2034 * Func : cmPkRguCDatReqInfo
2037 * Desc : RguCDatReqInfo
2038 * DatReq from RLC to MAC for Common Channels(BCCH, PCCH and CCCH)
2047 **********************************************************/
2049 PUBLIC S16 cmPkRguCDatReqInfo
2051 RguCDatReqInfo *param,
2055 PUBLIC S16 cmPkRguCDatReqInfo(param, mBuf)
2056 RguCDatReqInfo *param;
2062 TRC3(cmPkRguCDatReqInfo);
2064 if (param->pdu != NULLP)
2066 if (SFndLenMsg(param->pdu, &msgLen) != ROK)
2068 if (SCatMsg(mBuf, param->pdu, M1M2) != ROK)
2070 SPutMsg(param->pdu);
2071 CMCHKPK(cmPkMsgLen, msgLen, mBuf);
2073 switch(param->lcType) {
2074 case CM_LTE_LCH_CCCH:
2075 CMCHKPK(cmPkLteRnti, param->u.rnti, mBuf);
2077 case CM_LTE_LCH_BCCH:
2078 case CM_LTE_LCH_PCCH:
2079 CMCHKPK(cmPkLteTimingInfo, ¶m->u.timeToTx, mBuf);
2081 CMCHKPK(SPkU8,param->pnb,mBuf);
2087 CMCHKPK(SPkU32, param->transId, mBuf);
2088 CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
2089 CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
2090 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
2096 /***********************************************************
2098 * Func : cmUnpkRguCDatReqInfo
2101 * Desc : RguCDatReqInfo
2102 * DatReq from RLC to MAC for Common Channels(BCCH, PCCH and CCCH)
2111 **********************************************************/
2113 PUBLIC S16 cmUnpkRguCDatReqInfo
2115 RguCDatReqInfo *param,
2119 PUBLIC S16 cmUnpkRguCDatReqInfo(param, mBuf)
2120 RguCDatReqInfo *param;
2124 MsgLen msgLen, totalMsgLen;
2126 TRC3(cmUnpkRguCDatReqInfo);
2128 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
2129 CMCHKUNPK(cmUnpkLteLcId, ¶m->lcId, mBuf);
2130 CMCHKUNPK(cmUnpkLteLcType, ¶m->lcType, mBuf);
2131 CMCHKUNPK(SUnpkU32, ¶m->transId, mBuf);
2132 switch(param->lcType) {
2133 case CM_LTE_LCH_BCCH:
2134 case CM_LTE_LCH_PCCH:
2136 CMCHKUNPK(SUnpkU8,¶m->pnb, mBuf);
2138 CMCHKUNPK(cmUnpkLteTimingInfo, ¶m->u.timeToTx, mBuf);
2140 case CM_LTE_LCH_CCCH:
2141 CMCHKUNPK(cmUnpkLteRnti, ¶m->u.rnti, mBuf);
2146 SFndLenMsg(mBuf, &msgLen);
2149 CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
2150 if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
2152 if (SSegMsg(mBuf, totalMsgLen-msgLen, ¶m->pdu) != ROK)
2160 /***********************************************************
2162 * Func : cmPkRguLchDatReq
2165 * Desc : RguLchDatReq
2166 * DatReq Information of a logical channel
2175 **********************************************************/
2177 PUBLIC S16 cmPkRguLchDatReq
2179 RguLchDatReq *param,
2183 PUBLIC S16 cmPkRguLchDatReq(param, mBuf)
2184 RguLchDatReq *param;
2189 TRC3(cmPkRguLchDatReq);
2192 CMCHKPK(SPkU8, param->freeBuff, mBuf);
2194 CMCHKPK(SPkU8, param->setMaxUlPrio, mBuf);
2195 CMCHKPK(cmPkRguPduInfo, ¶m->pdu, mBuf);
2196 CMCHKPK(cmPkRguDBoReport, ¶m->boReport, mBuf);
2197 CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
2203 /***********************************************************
2205 * Func : cmUnpkRguLchDatReq
2208 * Desc : RguLchDatReq
2209 * DatReq Information of a logical channel
2218 **********************************************************/
2220 PUBLIC S16 cmUnpkRguLchDatReq
2222 RguLchDatReq *param,
2226 PUBLIC S16 cmUnpkRguLchDatReq(param, mBuf)
2227 RguLchDatReq *param;
2232 TRC3(cmUnpkRguLchDatReq);
2234 CMCHKUNPK(cmUnpkLteLcId, ¶m->lcId, mBuf);
2235 CMCHKUNPK(cmUnpkRguDBoReport, ¶m->boReport, mBuf);
2236 CMCHKUNPK(cmUnpkRguPduInfo, ¶m->pdu, mBuf);
2237 CMCHKUNPK(SUnpkU8, ¶m->setMaxUlPrio, mBuf);
2239 CMCHKUNPK(SUnpkU8, ¶m->freeBuff, mBuf);
2245 /***********************************************************
2247 * Func : cmPkRguDatReqTb
2250 * Desc : RguDatReqTb
2251 * DatReq from RLC to MAC for dedicated channels of a UE
2260 **********************************************************/
2262 PUBLIC S16 cmPkRguDatReqTb
2268 PUBLIC S16 cmPkRguDatReqTb(param, mBuf)
2275 TRC3(cmPkRguDatReqTb);
2276 /*rgu_c_001.main_5 - ADD - L2M Support */
2278 CMCHKPK(SPkU32, param->tbId, mBuf);
2280 for (i=param->nmbLch-1; i >= 0; i--) {
2281 CMCHKPK(cmPkRguLchDatReq, ¶m->lchData[i], mBuf);
2283 CMCHKPK(SPkU8, param->nmbLch, mBuf);
2289 /***********************************************************
2291 * Func : cmUnpkRguDatReqTb
2294 * Desc : RguDatReqTb
2295 * DatReq from RLC to MAC for dedicated channels of a UE
2304 **********************************************************/
2307 PUBLIC S16 cmUnpkRguDatReqTb
2314 PUBLIC S16 cmUnpkRguDatReqTb(pst, param, mBuf)
2321 PUBLIC S16 cmUnpkRguDatReqTb
2327 PUBLIC S16 cmUnpkRguDatReqTb(param, mBuf)
2335 TRC3(cmUnpkRguDatReqTb);
2337 CMCHKUNPK(SUnpkU8, ¶m->nmbLch, mBuf);
2338 for (i=0; i<param->nmbLch; i++) {
2339 CMCHKUNPK(cmUnpkRguLchDatReq, ¶m->lchData[i], mBuf);
2341 /*rgu_c_001.main_5 - ADD - L2M Support */
2343 CMCHKUNPK(SUnpkU32, ¶m->tbId, mBuf);
2349 /***********************************************************
2351 * Func : cmPkRguDDatReqInfo
2354 * Desc : RguDDatReqInfo
2355 * DatReq from RLC to MAC for dedicated channels of a UE
2364 **********************************************************/
2365 /*rgu_c_001.main_5 - ADD - L2M Support */
2368 PUBLIC S16 cmPkRguDDatReqInfo
2371 RguDDatReqInfo *param,
2375 PUBLIC S16 cmPkRguDDatReqInfo(pst, param, mBuf)
2377 RguDDatReqInfo *param;
2382 PUBLIC S16 cmPkRguDDatReqInfo
2384 RguDDatReqInfo *param,
2388 PUBLIC S16 cmPkRguDDatReqInfo(param, mBuf)
2389 RguDDatReqInfo *param;
2397 TRC3(cmPkRguDDatReqInfo);
2399 for(idx = (param->nmbOfUeGrantPerTti-1); idx >= 0; idx--)
2401 RguDDatReqPerUe *datReq = ¶m->datReq[idx];
2402 for (i=RGU_MAX_TB-1; i >= 0; i--)
2404 CMCHKPK(cmPkRguDatReqTb, &datReq->datReqTb[i], mBuf);
2406 CMCHKPK(SPkU8, datReq->nmbOfTbs, mBuf);
2407 CMCHKPK(SPkU32, datReq->transId, mBuf);
2408 CMCHKPK(cmPkLteRnti, datReq->rnti, mBuf);
2410 CMCHKPK(SPkU8, param->nmbOfUeGrantPerTti, mBuf);
2411 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
2417 /***********************************************************
2419 * Func : cmUnpkRguDDatReqInfo
2422 * Desc : RguDDatReqInfo
2423 * DatReq from RLC to MAC for dedicated channels of a UE
2432 **********************************************************/
2435 PUBLIC S16 cmUnpkRguDDatReqInfo
2438 RguDDatReqInfo *param,
2442 PUBLIC S16 cmUnpkRguDDatReqInfo(pst, param, mBuf)
2444 RguDDatReqInfo *param;
2449 PUBLIC S16 cmUnpkRguDDatReqInfo
2451 RguDDatReqInfo *param,
2455 PUBLIC S16 cmUnpkRguDDatReqInfo(param, mBuf)
2456 RguDDatReqInfo *param;
2462 /* After Merging from 2.1 to 2.2 */
2463 /*rgu_c_001.main_5 - ADD - L2M Support */
2469 TRC3(cmUnpkRguDDatReqInfo);
2471 /* After Merging from 2.1 to 2.2 */
2472 /*rgu_c_001.main_5 - ADD - L2M Support */
2476 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
2477 CMCHKUNPK(SUnpkU8, ¶m->nmbOfUeGrantPerTti, mBuf);
2478 for(idx = 0; idx < param->nmbOfUeGrantPerTti; idx++)
2480 RguDDatReqPerUe *datReq = ¶m->datReq[idx];
2481 CMCHKUNPK(cmUnpkLteRnti, &datReq->rnti, mBuf);
2482 CMCHKUNPK(SUnpkU32, &datReq->transId, mBuf);
2483 CMCHKUNPK(SUnpkU8, &datReq->nmbOfTbs, mBuf);
2484 /* rgu_c_001.main_4 - Changes for MIMO feature addition */
2485 for (i=0; i<RGU_MAX_TB; i++)
2487 /*rgu_c_001.main_5 - ADD - L2M Support */
2489 /* After Merging from 2.1 to 2.2 */
2490 retVal = cmUnpkRguDatReqTb(pst, &datReq->datReqTb[i], mBuf);
2496 CMCHKUNPK(cmUnpkRguDatReqTb, &datReq->datReqTb[i], mBuf);
2505 /***********************************************************
2507 * Func : cmPkRguCDatIndInfo
2510 * Desc : RguCDatIndInfo
2511 * DatInd from MAC to RLC on CCCH
2520 **********************************************************/
2522 PUBLIC S16 cmPkRguCDatIndInfo
2524 RguCDatIndInfo *param,
2528 PUBLIC S16 cmPkRguCDatIndInfo(param, mBuf)
2529 RguCDatIndInfo *param;
2535 TRC3(cmPkRguCDatIndInfo);
2537 if (SFndLenMsg(param->pdu, &msgLen) != ROK)
2539 if (SCatMsg(mBuf, param->pdu, M1M2) != ROK)
2541 SPutMsg(param->pdu);
2542 CMCHKPK(cmPkMsgLen, msgLen, mBuf);
2543 CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
2544 CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
2545 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
2551 /***********************************************************
2553 * Func : cmUnpkRguCDatIndInfo
2556 * Desc : RguCDatIndInfo
2557 * DatInd from MAC to RLC on CCCH
2566 **********************************************************/
2568 PUBLIC S16 cmUnpkRguCDatIndInfo
2570 RguCDatIndInfo *param,
2574 PUBLIC S16 cmUnpkRguCDatIndInfo(param, mBuf)
2575 RguCDatIndInfo *param;
2579 MsgLen msgLen, totalMsgLen;
2581 TRC3(cmUnpkRguCDatIndInfo);
2583 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
2584 CMCHKUNPK(cmUnpkLteRnti, ¶m->rnti, mBuf);
2585 CMCHKUNPK(cmUnpkLteLcId, ¶m->lcId, mBuf);
2586 CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
2587 if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
2589 if (SSegMsg(mBuf, totalMsgLen-msgLen, ¶m->pdu) != ROK)
2596 /***********************************************************
2598 * Func : cmPkRguLchDatInd
2601 * Desc : RguLchDatInd
2602 * DatInd Information for a logical channel
2611 **********************************************************/
2613 PUBLIC S16 cmPkRguLchDatInd
2615 RguLchDatInd *param,
2619 PUBLIC S16 cmPkRguLchDatInd(param, mBuf)
2620 RguLchDatInd *param;
2624 TRC3(cmPkRguLchDatInd);
2626 CMCHKPK(cmPkRguPduInfo, ¶m->pdu, mBuf);
2627 CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
2633 /***********************************************************
2635 * Func : cmUnpkRguLchDatInd
2638 * Desc : RguLchDatInd
2639 * DatInd Information for a logical channel
2648 **********************************************************/
2650 PUBLIC S16 cmUnpkRguLchDatInd
2652 RguLchDatInd *param,
2656 PUBLIC S16 cmUnpkRguLchDatInd(param, mBuf)
2657 RguLchDatInd *param;
2661 TRC3(cmUnpkRguLchDatInd);
2663 CMCHKUNPK(cmUnpkLteLcId, ¶m->lcId, mBuf);
2664 CMCHKUNPK(cmUnpkRguPduInfo, ¶m->pdu, mBuf);
2670 /***********************************************************
2672 * Func : packRlcMacDataInfo
2676 * Data Indication from MAC to RLC for dedicated channels of a UE
2685 **********************************************************/
2687 PUBLIC S16 packRlcMacDataInfo
2693 PUBLIC S16 packRlcMacDataInfo(param, mBuf)
2701 TRC3(packRlcMacDataInfo);
2703 for (i=param->nmbPdu-1; i >= 0; i--)
2706 if (SFndLenMsg(param->pduInfo[i].pduBuf, &msgLen) != ROK)
2708 if (SCatMsg(mBuf, param->pduInfo[i].pduBuf, M1M2) != ROK)
2710 CMCHKPK(cmPkMsgLen, msgLen, mBuf);
2711 CMCHKPK(cmPkLteLcId, param->pduInfo[i].lcId, mBuf);
2712 CMCHKPK(cmPkBool, param->pduInfo[i].commCh, mBuf);
2714 CMCHKPK(SPkU8, param->nmbPdu, mBuf);
2715 CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
2716 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
2717 CMCHKPK(cmPkLteTimingInfo, ¶m->timeToTx, mBuf);
2723 /***********************************************************
2725 * Func : unpackRlcMacDataInfo
2729 * Data Indication from MAC to RLC for dedicated channels of a UE
2738 **********************************************************/
2740 PUBLIC S16 unpackRlcMacDataInfo
2746 PUBLIC S16 unpackRlcMacDataInfo(param, mBuf)
2753 TRC3(unpackRlcMacDataInfo);
2755 CMCHKUNPK(cmUnpkLteTimingInfo, ¶m->timeToTx, mBuf);
2756 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
2757 CMCHKUNPK(cmUnpkLteRnti, ¶m->rnti, mBuf);
2758 CMCHKUNPK(SUnpkU8, ¶m->nmbPdu, mBuf);
2759 for (i=0; i<param->nmbPdu; i++)
2763 CMCHKUNPK(cmUnpkBool, ¶m->pduInfo[i].commCh, mBuf);
2764 CMCHKUNPK(cmUnpkLteLcId, ¶m->pduInfo[i].lcId, mBuf);
2765 CMCHKUNPK(cmUnpkMsgLen, ¶m->pduInfo[i].pduLen, mBuf);
2766 if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
2768 if (SSegMsg(mBuf, totalMsgLen-param->pduInfo[i].pduLen, ¶m->pduInfo[i].pduBuf) != ROK)
2775 /***********************************************************
2777 * Func : cmPkRguCStaRspInfo
2780 * Desc : RguCStaRspInfo
2781 * Status Response from RLC to MAC for common logical channel
2790 **********************************************************/
2792 PUBLIC S16 cmPkRguCStaRspInfo
2794 RguCStaRspInfo *param,
2798 PUBLIC S16 cmPkRguCStaRspInfo(param, mBuf)
2799 RguCStaRspInfo *param;
2804 TRC3(cmPkRguCStaRspInfo);
2806 switch(param->lcType) {
2807 case CM_LTE_LCH_CCCH:
2808 CMCHKPK(cmPkLteRnti, param->u.rnti, mBuf);
2810 case CM_LTE_LCH_BCCH:
2811 case CM_LTE_LCH_PCCH:
2812 CMCHKPK(cmPkLteTimingInfo, ¶m->u.timeToTx, mBuf);
2814 CMCHKPK(SPkU8,param->pnb,mBuf);
2815 CMCHKPK(SPkU8,param->emtcDiReason,mBuf);
2821 CMCHKPK(SPkS32, param->bo, mBuf);
2822 CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
2823 CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
2824 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
2830 /***********************************************************
2832 * Func : cmUnpkRguCStaRspInfo
2835 * Desc : RguCStaRspInfo
2836 * Status Response from RLC to MAC for common logical channel
2845 **********************************************************/
2847 PUBLIC S16 cmUnpkRguCStaRspInfo
2849 RguCStaRspInfo *param,
2853 PUBLIC S16 cmUnpkRguCStaRspInfo(param, mBuf)
2854 RguCStaRspInfo *param;
2859 TRC3(cmUnpkRguCStaRspInfo);
2861 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
2862 CMCHKUNPK(cmUnpkLteLcId, ¶m->lcId, mBuf);
2863 CMCHKUNPK(cmUnpkLteLcType, ¶m->lcType, mBuf);
2864 CMCHKUNPK(SUnpkS32, ¶m->bo, mBuf);
2865 switch(param->lcType) {
2866 case CM_LTE_LCH_BCCH:
2867 case CM_LTE_LCH_PCCH:
2869 CMCHKUNPK(SUnpkU8,¶m->emtcDiReason , mBuf);
2870 CMCHKUNPK(SUnpkU8,¶m->pnb , mBuf);
2872 CMCHKUNPK(cmUnpkLteTimingInfo, ¶m->u.timeToTx, mBuf);
2874 case CM_LTE_LCH_CCCH:
2875 CMCHKUNPK(cmUnpkLteRnti, ¶m->u.rnti, mBuf);
2885 /***********************************************************
2887 * Func : packBOStatusInfo
2890 * Desc : RlcMacBOStatus
2891 * Status Response from RLC to MAC for dedicated logical channel
2900 **********************************************************/
2902 PUBLIC S16 packBOStatusInfo
2904 RlcMacBOStatus *param,
2908 PUBLIC S16 packBOStatusInfo(param, mBuf)
2909 RlcMacBOStatus *param;
2914 TRC3(packBOStatusInfo);
2916 CMCHKPK(SPkS32, param->bo, mBuf);
2917 CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
2918 CMCHKPK(cmPkBool, param->commCh, mBuf);
2919 CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
2920 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
2922 } /* End of packBOStatusInfo */
2926 /***********************************************************
2928 * Func : unpackBOStatusInfo
2931 * Desc : RlcMacBOStatus
2932 * Status Response from RLC to MAC for dedicated logical channel
2941 **********************************************************/
2943 PUBLIC S16 unpackBOStatusInfo
2945 RlcMacBOStatus *param,
2949 PUBLIC S16 unpackBOStatusInfo(param, mBuf)
2950 RlcMacBOStatus *param;
2955 TRC3(unpackBOStatusInfo);
2957 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
2958 CMCHKUNPK(cmUnpkLteRnti, ¶m->rnti, mBuf);
2959 CMCHKUNPK(cmUnpkBool, ¶m->commCh, mBuf);
2960 CMCHKUNPK(cmUnpkLteLcId, ¶m->lcId, mBuf);
2961 CMCHKUNPK(SUnpkS32, ¶m->bo, mBuf);
2963 } /* End of unpackBOStatusInfo */
2966 /***********************************************************
2968 * Func : cmPkRguLchStaInd
2971 * Desc : RguLchStaInd
2972 * StaInd info for each logical channel of a UE
2981 **********************************************************/
2983 PUBLIC S16 cmPkRguLchStaInd
2985 RguLchStaInd *param,
2989 PUBLIC S16 cmPkRguLchStaInd(param, mBuf)
2990 RguLchStaInd *param;
2995 TRC3(cmPkRguLchStaInd);
2997 CMCHKPK(SPkS16, param->totBufSize, mBuf);
2998 CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
3004 /***********************************************************
3006 * Func : cmUnpkRguLchStaInd
3009 * Desc : RguLchStaInd
3010 * StaInd info for each logical channel of a UE
3019 **********************************************************/
3021 PUBLIC S16 cmUnpkRguLchStaInd
3023 RguLchStaInd *param,
3027 PUBLIC S16 cmUnpkRguLchStaInd(param, mBuf)
3028 RguLchStaInd *param;
3033 TRC3(cmUnpkRguLchStaInd);
3035 CMCHKUNPK(cmUnpkLteLcId, ¶m->lcId, mBuf);
3036 CMCHKUNPK(SUnpkS16, ¶m->totBufSize, mBuf);
3041 /***********************************************************
3043 * Func : cmPkRguStaIndTb
3046 * Desc : RguStaIndTb
3047 * StaInd from RLC to MAC for dedicated channels of a UE
3056 **********************************************************/
3058 PUBLIC S16 cmPkRguStaIndTb
3064 PUBLIC S16 cmPkRguStaIndTb(param, mBuf)
3071 TRC3(cmPkRguStaIndTb);
3074 CMCHKPK(SPkU16, param->status, mBuf);
3075 CMCHKPK(SPkU32, param->tbId, mBuf);
3077 for (i=param->nmbLch-1; i >= 0; i--) {
3078 CMCHKPK(cmPkRguLchStaInd, ¶m->lchStaInd[i], mBuf);
3080 CMCHKPK(SPkU8, param->nmbLch, mBuf);
3086 /***********************************************************
3088 * Func : cmUnpkRguStaIndTb
3091 * Desc : RguStaIndTb
3092 * StaInd from RLC to MAC for dedicated channels of a UE
3101 **********************************************************/
3103 PUBLIC S16 cmUnpkRguStaIndTb
3109 PUBLIC S16 cmUnpkRguStaIndTb(param, mBuf)
3116 TRC3(cmUnpkRguStaIndTb);
3118 CMCHKUNPK(SUnpkU8, ¶m->nmbLch, mBuf);
3119 for (i=0; i<param->nmbLch; i++) {
3120 CMCHKUNPK(cmUnpkRguLchStaInd, ¶m->lchStaInd[i], mBuf);
3123 CMCHKUNPK(SUnpkU32, ¶m->tbId, mBuf);
3124 CMCHKUNPK(SUnpkU16, ¶m->status, mBuf);
3130 /***********************************************************
3132 * Func : packSchedRepInfo
3135 * Desc : RlcMacSchedRep
3136 * StaInd from MAC to RLC for dedicated logical channels of a UE
3145 **********************************************************/
3147 PUBLIC S16 packSchedRepInfo
3149 RlcMacSchedRep *param,
3153 PUBLIC S16 packSchedRepInfo(param, mBuf)
3154 RlcMacSchedRep *param;
3160 TRC3(packSchedRepInfo);
3162 for(idx = (param->nmbLch-1); idx >= 0; idx--)
3164 CMCHKPK(cmPkRguLchStaInd, ¶m->lchSta[idx].lchStaInd, mBuf);
3165 CMCHKPK(cmPkBool, param->lchSta[idx].commCh, mBuf);
3167 CMCHKPK(SPkU8, param->nmbLch, mBuf);
3168 CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
3169 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
3170 CMCHKPK(cmPkLteTimingInfo, ¶m->timeToTx, mBuf);
3173 } /* End of packSchedRepInfo */
3177 /***********************************************************
3179 * Func : unpackSchedRepInfo
3182 * Desc : RlcMacSchedRep
3183 * StaInd from MAC to RLC for dedicated logical channels of a UE
3192 **********************************************************/
3194 PUBLIC S16 unpackSchedRepInfo
3196 RlcMacSchedRep *param,
3200 PUBLIC S16 unpackSchedRepInfo(param, mBuf)
3201 RlcMacSchedRep *param;
3207 TRC3(unpackSchedRepInfo);
3209 CMCHKUNPK(cmUnpkLteTimingInfo, ¶m->timeToTx, mBuf);
3210 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
3211 CMCHKUNPK(cmUnpkLteRnti, ¶m->rnti, mBuf);
3212 CMCHKUNPK(SUnpkU8, ¶m->nmbLch, mBuf);
3213 for(idx = 0; idx < param->nmbLch; idx++)
3215 CMCHKUNPK(cmUnpkBool, ¶m->lchSta[idx].commCh, mBuf);
3216 CMCHKUNPK(cmUnpkRguLchStaInd, ¶m->lchSta[idx].lchStaInd, mBuf);
3220 } /* End of unpackSchedRepInfo */
3224 /**********************************************************************
3226 **********************************************************************/