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 *******************************************************************************/
20 /************************************************************************
26 Desc: C source code for pack/unpack of CRG interface primitives.
30 **********************************************************************/
33 @brief This file contains the packing/unpacking code for the CRG interface
36 /* header include files (.h) */
37 #include "envopt.h" /* environment options */
38 #include "envdep.h" /* environment dependent */
39 #include "envind.h" /* environment independent */
40 #include "gen.h" /* general */
41 #include "ssi.h" /* system services */
42 #include "cm_tkns.h" /* Common Token Defines */
43 #include "cm_llist.h" /* Common Link List Defines */
44 #include "cm_hash.h" /* Common Hash List Defines */
45 #include "cm_lte.h" /* Common LTE Defines */
46 #include "crg.h" /* CRG Interface defines */
48 /* header/extern include files (.x) */
49 #include "gen.x" /* general */
50 #include "ssi.x" /* system services */
51 #include "cm_tkns.x" /* Common Token Definitions */
52 #include "cm_llist.x" /* Common Link List Definitions */
53 #include "cm_lib.x" /* Common Library Definitions */
54 #include "cm_hash.x" /* Common Hash List Definitions */
55 #include "cm_lte.x" /* Common LTE Defines */
56 #include "crg.x" /* CRG Interface includes */
62 * @brief Request from RRC to MAC to bind the interface saps
66 * Function : cmPkCrgBndReq
69 * @param[in] SuId suId
70 * @param[in] SpId spId
75 PUBLIC S16 cmPkCrgBndReq
82 PUBLIC S16 cmPkCrgBndReq(pst, suId, spId)
91 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
92 #if (ERRCLASS & ERRCLS_ADD_RES)
93 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
94 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
95 (ErrVal)ECRG001, (ErrVal)0, "Packing failed");
99 if (SPkS16(spId, 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)ECRG002, (ErrVal)0, "Packing failed");
108 if (SPkS16(suId, mBuf) != ROK) {
109 #if (ERRCLASS & ERRCLS_ADD_RES)
110 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
111 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
112 (ErrVal)ECRG003, (ErrVal)0, "Packing failed");
117 pst->event = (Event) EVTCRGBNDREQ;
118 RETVALUE(SPstTsk(pst,mBuf));
123 * @brief Request from RRC to MAC to bind the interface saps
127 * Function : cmUnpkCrgBndReq
129 * @param[in] Pst* pst
130 * @param[in] SuId suId
131 * @param[in] SpId spId
136 PUBLIC S16 cmUnpkCrgBndReq
143 PUBLIC S16 cmUnpkCrgBndReq(func, pst, mBuf)
152 TRC3(cmUnpkCrgBndReq)
154 if (SUnpkS16(&suId, mBuf) != ROK) {
156 #if (ERRCLASS & ERRCLS_ADD_RES)
157 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
158 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
159 (ErrVal)ECRG004, (ErrVal)0, "Packing failed");
163 if (SUnpkS16(&spId, mBuf) != ROK) {
165 #if (ERRCLASS & ERRCLS_ADD_RES)
166 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
167 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
168 (ErrVal)ECRG005, (ErrVal)0, "Packing failed");
173 RETVALUE((*func)(pst, suId, spId));
178 * @brief Confirmation from MAC to RRC for the bind/Unbind
179 * request for the interface saps
183 * Function : cmPkCrgBndCfm
185 * @param[in] Pst* pst
186 * @param[in] SuId suId
187 * @param[in] U8 status
192 PUBLIC S16 cmPkCrgBndCfm
199 PUBLIC S16 cmPkCrgBndCfm(pst, suId, status)
205 Buffer *mBuf = NULLP;
208 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
209 #if (ERRCLASS & ERRCLS_ADD_RES)
210 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
211 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
212 (ErrVal)ECRG006, (ErrVal)0, "Packing failed");
216 if (SPkU8(status, mBuf) != ROK) {
217 #if (ERRCLASS & ERRCLS_ADD_RES)
218 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
219 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
220 (ErrVal)ECRG007, (ErrVal)0, "Packing failed");
225 if (SPkS16(suId, mBuf) != ROK) {
226 #if (ERRCLASS & ERRCLS_ADD_RES)
227 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
228 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
229 (ErrVal)ECRG008, (ErrVal)0, "Packing failed");
234 pst->event = (Event) EVTCRGBNDCFM;
235 RETVALUE(SPstTsk(pst,mBuf));
240 * @brief Confirmation from MAC to RRC for the bind/Unbind
241 * request for the interface saps
245 * Function : cmUnpkCrgBndCfm
247 * @param[in] Pst* pst
248 * @param[in] SuId suId
249 * @param[in] U8 status
254 PUBLIC S16 cmUnpkCrgBndCfm
261 PUBLIC S16 cmUnpkCrgBndCfm(func, pst, mBuf)
270 TRC3(cmUnpkCrgBndCfm)
272 if (SUnpkS16(&suId, mBuf) != ROK) {
274 #if (ERRCLASS & ERRCLS_ADD_RES)
275 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
276 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
277 (ErrVal)ECRG009, (ErrVal)0, "Packing failed");
281 if (SUnpkU8(&status, mBuf) != ROK) {
283 #if (ERRCLASS & ERRCLS_ADD_RES)
284 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
285 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
286 (ErrVal)ECRG010, (ErrVal)0, "Packing failed");
291 RETVALUE((*func)(pst, suId, status));
296 * @brief Request from RRC to MAC to Unbind the interface saps
300 * Function : cmPkCrgUbndReq
302 * @param[in] Pst* pst
303 * @param[in] SpId spId
304 * @param[in] Reason reason
309 PUBLIC S16 cmPkCrgUbndReq
316 PUBLIC S16 cmPkCrgUbndReq(pst, spId, reason)
322 Buffer *mBuf = NULLP;
325 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
326 #if (ERRCLASS & ERRCLS_ADD_RES)
327 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
328 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
329 (ErrVal)ECRG011, (ErrVal)0, "Packing failed");
333 if (SPkS16(reason, mBuf) != ROK) {
334 #if (ERRCLASS & ERRCLS_ADD_RES)
335 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
336 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
337 (ErrVal)ECRG012, (ErrVal)0, "Packing failed");
342 if (SPkS16(spId, mBuf) != ROK) {
343 #if (ERRCLASS & ERRCLS_ADD_RES)
344 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
345 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
346 (ErrVal)ECRG013, (ErrVal)0, "Packing failed");
351 pst->event = (Event) EVTCRGUBNDREQ;
352 RETVALUE(SPstTsk(pst,mBuf));
357 * @brief Request from RRC to MAC to Unbind the interface saps
361 * Function : cmUnpkCrgUbndReq
363 * @param[in] Pst* pst
364 * @param[in] SpId spId
365 * @param[in] Reason reason
370 PUBLIC S16 cmUnpkCrgUbndReq
377 PUBLIC S16 cmUnpkCrgUbndReq(func, pst, mBuf)
386 TRC3(cmUnpkCrgUbndReq)
388 if (SUnpkS16(&spId, mBuf) != ROK) {
390 #if (ERRCLASS & ERRCLS_ADD_RES)
391 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
392 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
393 (ErrVal)ECRG014, (ErrVal)0, "Packing failed");
397 if (SUnpkS16(&reason, mBuf) != ROK) {
399 #if (ERRCLASS & ERRCLS_ADD_RES)
400 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
401 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
402 (ErrVal)ECRG015, (ErrVal)0, "Packing failed");
407 RETVALUE((*func)(pst, spId, reason));
412 * @brief Configuration Request from RRC to MAC for
413 * configuring Cell/Ue/Lc
417 * Function : cmPkCrgCfgReq
419 * @param[in] Pst* pst
420 * @param[in] SpId spId
421 * @param[in] CrgCfgTransId transId
422 * @param[in] CrgCfgReqInfo * cfgReqInfo
427 PUBLIC S16 cmPkCrgCfgReq
431 CrgCfgTransId transId,
432 CrgCfgReqInfo * cfgReqInfo
435 PUBLIC S16 cmPkCrgCfgReq(pst, spId, transId, cfgReqInfo)
438 CrgCfgTransId transId;
439 CrgCfgReqInfo * cfgReqInfo;
442 Buffer *mBuf = NULLP;
445 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
446 #if (ERRCLASS & ERRCLS_ADD_RES)
447 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
448 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
449 (ErrVal)ECRG016, (ErrVal)0, "Packing failed");
451 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
454 if (cmPkCrgCfgReqInfo(cfgReqInfo, mBuf) != ROK) {
455 #if (ERRCLASS & ERRCLS_ADD_RES)
456 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
457 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
458 (ErrVal)ECRG017, (ErrVal)0, "Packing failed");
460 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
464 /* crg_c_001.main_5: MOD - Updating ERR code */
465 if (cmPkCrgCfgTransId(&transId, mBuf) != ROK) {
466 #if (ERRCLASS & ERRCLS_ADD_RES)
467 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
468 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
469 (ErrVal)ECRG018, (ErrVal)0, "Packing failed");
471 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
475 if (SPkS16(spId, mBuf) != ROK) {
476 #if (ERRCLASS & ERRCLS_ADD_RES)
477 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
478 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
479 (ErrVal)ECRG019, (ErrVal)0, "Packing failed");
481 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
485 if (SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo)) != ROK) {
486 #if (ERRCLASS & ERRCLS_ADD_RES)
487 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
488 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
489 (ErrVal)ECRG020, (ErrVal)0, "Packing failed");
494 pst->event = (Event) EVTCRGCFGREQ;
495 RETVALUE(SPstTsk(pst,mBuf));
500 * @brief Configuration Request from RRC to MAC for
501 * configuring Cell/Ue/Lc
505 * Function : cmUnpkCrgCfgReq
507 * @param[in] Pst* pst
508 * @param[in] SpId spId
509 * @param[in] CrgCfgTransId transId
510 * @param[in] CrgCfgReqInfo * cfgReqInfo
515 PUBLIC S16 cmUnpkCrgCfgReq
522 PUBLIC S16 cmUnpkCrgCfgReq(func, pst, mBuf)
529 CrgCfgTransId transId;
530 CrgCfgReqInfo *cfgReqInfo;
532 TRC3(cmUnpkCrgCfgReq)
534 if (SUnpkS16(&spId, mBuf) != ROK) {
536 #if (ERRCLASS & ERRCLS_ADD_RES)
537 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
538 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
539 (ErrVal)ECRG021, (ErrVal)0, "Packing failed");
543 if (cmUnpkCrgCfgTransId(&transId, mBuf) != ROK) {
545 #if (ERRCLASS & ERRCLS_ADD_RES)
546 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
547 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
548 (ErrVal)ECRG022, (ErrVal)0, "Packing failed");
552 if ((SGetSBuf(pst->region, pst->pool, (Data **)&cfgReqInfo, sizeof(CrgCfgReqInfo))) != ROK) {
553 #if (ERRCLASS & ERRCLS_ADD_RES)
554 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
555 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
556 (ErrVal)ECRG023, (ErrVal)0, "Packing failed");
562 if (cmUnpkCrgCfgReqInfo(cfgReqInfo, mBuf) != ROK) {
563 SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
565 #if (ERRCLASS & ERRCLS_ADD_RES)
566 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
567 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
568 (ErrVal)ECRG024, (ErrVal)0, "Packing failed");
573 RETVALUE((*func)(pst, spId, transId, cfgReqInfo));
578 * @brief Configuration Confirm from MAC to RRC
582 * Function : cmPkCrgCfgCfm
584 * @param[in] Pst* pst
585 * @param[in] SuId suId
586 * @param[in] CrgCfgTransId transId
587 * @param[in] U8 status
592 PUBLIC S16 cmPkCrgCfgCfm
596 CrgCfgTransId transId,
600 PUBLIC S16 cmPkCrgCfgCfm(pst, suId, transId, status)
603 CrgCfgTransId transId;
607 Buffer *mBuf = NULLP;
610 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
611 #if (ERRCLASS & ERRCLS_ADD_RES)
612 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
613 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
614 (ErrVal)ECRG025, (ErrVal)0, "Packing failed");
618 /* crg_c_001.main_5 - ADD - Added the packing for status. */
619 if (SPkU8(status, mBuf) != ROK) {
620 #if (ERRCLASS & ERRCLS_ADD_RES)
621 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
622 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
623 (ErrVal)ECRG026, (ErrVal)0, "Packing failed");
628 if (cmPkCrgCfgTransId(&transId, mBuf) != ROK) {
629 #if (ERRCLASS & ERRCLS_ADD_RES)
630 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
631 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
632 (ErrVal)ECRG027, (ErrVal)0, "Packing failed");
637 if (SPkS16(suId, mBuf) != ROK) {
638 #if (ERRCLASS & ERRCLS_ADD_RES)
639 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
640 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
641 (ErrVal)ECRG028, (ErrVal)0, "Packing failed");
646 pst->event = (Event) EVTCRGCFGCFM;
647 RETVALUE(SPstTsk(pst,mBuf));
652 * @brief Configuration Confirm from MAC to RRC
656 * Function : cmUnpkCrgCfgCfm
658 * @param[in] Pst* pst
659 * @param[in] SuId suId
660 * @param[in] CrgCfgTransId transId
661 * @param[in] U8 status
666 PUBLIC S16 cmUnpkCrgCfgCfm
673 PUBLIC S16 cmUnpkCrgCfgCfm(func, pst, mBuf)
680 CrgCfgTransId transId;
683 TRC3(cmUnpkCrgCfgCfm)
685 if (SUnpkS16(&suId, mBuf) != ROK) {
687 #if (ERRCLASS & ERRCLS_ADD_RES)
688 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
689 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
690 (ErrVal)ECRG029, (ErrVal)0, "Packing failed");
694 if (cmUnpkCrgCfgTransId(&transId, mBuf) != ROK) {
696 #if (ERRCLASS & ERRCLS_ADD_RES)
697 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
698 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
699 (ErrVal)ECRG030, (ErrVal)0, "Packing failed");
703 if (SUnpkU8(&status, mBuf) != ROK) {
705 #if (ERRCLASS & ERRCLS_ADD_RES)
706 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
707 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
708 (ErrVal)ECRG031, (ErrVal)0, "Packing failed");
713 RETVALUE((*func)(pst, suId, transId, status));
717 /***********************************************************
719 * Func : cmPkCrgCfgTransId
722 * Desc : Transaction ID between MAC and RRC
731 **********************************************************/
733 PUBLIC S16 cmPkCrgCfgTransId
735 CrgCfgTransId *param,
739 PUBLIC S16 cmPkCrgCfgTransId(param, mBuf)
740 CrgCfgTransId *param;
746 TRC3(cmPkCrgCfgTransId)
748 for (i=CRG_CFG_TRANSID_SIZE-1; i >= 0; i--) {
749 CMCHKPK(SPkU8, param->trans[i], mBuf);
756 /***********************************************************
758 * Func : cmUnpkCrgCfgTransId
761 * Desc : Transaction ID between MAC and RRC
770 **********************************************************/
772 PUBLIC S16 cmUnpkCrgCfgTransId
774 CrgCfgTransId *param,
778 PUBLIC S16 cmUnpkCrgCfgTransId(param, mBuf)
779 CrgCfgTransId *param;
785 TRC3(cmUnpkCrgCfgTransId)
787 for (i=0; i<CRG_CFG_TRANSID_SIZE; i++) {
788 CMCHKUNPK(SUnpkU8, ¶m->trans[i], mBuf);
795 /***********************************************************
797 * Func : cmPkCrgBwCfg
800 * Desc : Bandwidth configuration per cell
809 **********************************************************/
811 PUBLIC S16 cmPkCrgBwCfg
817 PUBLIC S16 cmPkCrgBwCfg(param, mBuf)
825 CMCHKPK(SPkU8, param->ulTotalBw, mBuf);
826 CMCHKPK(SPkU8, param->dlTotalBw, mBuf);
832 /***********************************************************
834 * Func : cmUnpkCrgBwCfg
837 * Desc : Bandwidth configuration per cell
846 **********************************************************/
848 PUBLIC S16 cmUnpkCrgBwCfg
854 PUBLIC S16 cmUnpkCrgBwCfg(param, mBuf)
862 CMCHKUNPK(SUnpkU8, ¶m->dlTotalBw, mBuf);
863 CMCHKUNPK(SUnpkU8, ¶m->ulTotalBw, mBuf);
869 /***********************************************************
871 * Func : cmPkCrgRachCfg
874 * Desc : RACH configuration per cell
883 **********************************************************/
885 PUBLIC S16 cmPkCrgRachCfg
891 PUBLIC S16 cmPkCrgRachCfg(param, mBuf)
899 CMCHKPK(SPkU8, param->maxMsg3Tx, mBuf);
905 /***********************************************************
907 * Func : cmUnpkCrgRachCfg
910 * Desc : RACH configuration per cell
919 **********************************************************/
921 PUBLIC S16 cmUnpkCrgRachCfg
927 PUBLIC S16 cmUnpkCrgRachCfg(param, mBuf)
933 TRC3(cmUnpkCrgRachCfg)
935 CMCHKUNPK(SUnpkU8, ¶m->maxMsg3Tx, mBuf);
941 /***********************************************************
943 * Func : cmPkCrgCellCfg
946 * Desc : Cell configuration
955 **********************************************************/
957 PUBLIC S16 cmPkCrgCellCfg
963 PUBLIC S16 cmPkCrgCellCfg(param, mBuf)
972 CMCHKPK(SPkU8, param->emtcEnable, mBuf);
974 #ifdef TENB_MULT_CELL_SUPPRT
975 CMCHKPK(SPkS16, param->rguDlSapId, mBuf);
976 CMCHKPK(SPkS16, param->rguUlSapId, mBuf);
978 CMCHKPK(cmPkCrgBwCfg, ¶m->bwCfg, mBuf);
979 CMCHKPK(cmPkCrgRachCfg, ¶m->rachCfg, mBuf);
980 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
986 /***********************************************************
988 * Func : cmUnpkCrgCellCfg
991 * Desc : Cell configuration
1000 **********************************************************/
1002 PUBLIC S16 cmUnpkCrgCellCfg
1008 PUBLIC S16 cmUnpkCrgCellCfg(param, mBuf)
1014 TRC3(cmUnpkCrgCellCfg)
1016 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
1017 CMCHKUNPK(cmUnpkCrgRachCfg, ¶m->rachCfg, mBuf);
1018 CMCHKUNPK(cmUnpkCrgBwCfg, ¶m->bwCfg, mBuf);
1019 #ifdef TENB_MULT_CELL_SUPPRT
1020 CMCHKUNPK(SUnpkS16, ¶m->rguUlSapId, mBuf);
1021 CMCHKUNPK(SUnpkS16, ¶m->rguDlSapId, mBuf);
1024 CMCHKUNPK(SUnpkU8, ¶m->emtcEnable, mBuf);
1031 /***********************************************************
1033 * Func : cmPkCrgUeUlHqCfg
1036 * Desc : Uplink HARQ configuration per UE
1045 **********************************************************/
1047 PUBLIC S16 cmPkCrgUeUlHqCfg
1049 CrgUeUlHqCfg *param,
1053 PUBLIC S16 cmPkCrgUeUlHqCfg(param, mBuf)
1054 CrgUeUlHqCfg *param;
1059 TRC3(cmPkCrgUeUlHqCfg)
1061 CMCHKPK(SPkU8, param->maxUlHqTx, mBuf);
1066 /***********************************************************
1068 * Func : cmPkCrgUeSCellCfg
1071 * Desc : Secondary Cell information of the UE
1080 **********************************************************/
1082 PRIVATE S16 cmPkCrgUeSCellCfg
1084 CrgUeSCellInfo *param,
1088 PRIVATE S16 cmPkCrgUeSCellCfg(param, mBuf)
1089 CrgUeSCellInfo *param;
1093 CMCHKPK(SPkS16, param->rguDlSapId, mBuf);
1094 CMCHKPK(SPkS16, param->rguUlSapId, mBuf);
1095 CMCHKPK(SPkU8, param->macInst, mBuf);
1096 CMCHKPK(SPkU16, param->sCellId, mBuf);
1100 /***********************************************************
1102 * Func : cmUnpkCrgUeSCellCfg
1105 * Desc : Secondary Cell information of the UE
1114 **********************************************************/
1116 PRIVATE S16 cmUnpkCrgUeSCellCfg
1118 CrgUeSCellInfo *param,
1122 PRIVATE S16 cmUnpkCrgUeSCellCfg(param, mBuf)
1123 CrgUeSCellInfo *param;
1127 CMCHKUNPK(SUnpkU16, ¶m->sCellId, mBuf);
1128 CMCHKUNPK(SUnpkU8, ¶m->macInst, mBuf);
1129 CMCHKUNPK(SUnpkS16, ¶m->rguUlSapId, mBuf);
1130 CMCHKUNPK(SUnpkS16, ¶m->rguDlSapId, mBuf);
1133 /***********************************************************
1135 * Func : cmPkCrgUeSecCellInfo
1138 * Desc : Secondary Cell information of the UE
1147 **********************************************************/
1149 PUBLIC S16 cmPkCrgUeSecCellInfo
1151 CrgUeSecCellInfo *param,
1155 PUBLIC S16 cmPkCrgUeSecCellInfo(param, mBuf)
1156 CrgUeSecCellInfo *param;
1161 for(idx = param->numSCells - 1; idx >= 0; idx--)
1163 CMCHKPK(cmPkCrgUeSCellCfg, ¶m->ueSCellCfg[(U8)idx], mBuf);
1166 CMCHKPK(SPkU8, param->numSCells, mBuf);
1167 CMCHKPK(SPkU8, param->isSCellCfgPres, mBuf);
1172 /***********************************************************
1174 * Func : cmUnpkCrgUeSecCellInfo
1177 * Desc : Secondary Cell information of the UE
1186 **********************************************************/
1188 PUBLIC S16 cmUnpkCrgUeSecCellInfo
1190 CrgUeSecCellInfo *param,
1194 PUBLIC S16 cmUnpkCrgUeSecCellInfo(param, mBuf)
1195 CrgUeSecCellInfo *param;
1201 CMCHKUNPK(SUnpkU8, ¶m->isSCellCfgPres, mBuf);
1202 if(TRUE == param->isSCellCfgPres)
1204 CMCHKUNPK(SUnpkU8, ¶m->numSCells, mBuf);
1206 for(idx = 0; idx < param->numSCells; idx++)
1208 CMCHKUNPK(cmUnpkCrgUeSCellCfg, ¶m->ueSCellCfg[idx],mBuf);
1215 #endif /* LTE_ADV */
1218 /***********************************************************
1220 * Func : cmUnpkCrgUeUlHqCfg
1223 * Desc : Uplink HARQ configuration per UE
1232 **********************************************************/
1234 PUBLIC S16 cmUnpkCrgUeUlHqCfg
1236 CrgUeUlHqCfg *param,
1240 PUBLIC S16 cmUnpkCrgUeUlHqCfg(param, mBuf)
1241 CrgUeUlHqCfg *param;
1246 TRC3(cmUnpkCrgUeUlHqCfg)
1248 CMCHKUNPK(SUnpkU8, ¶m->maxUlHqTx, mBuf);
1254 /***********************************************************
1256 * Func : cmPkCrgUeCfg
1259 * Desc : UE configuration
1268 **********************************************************/
1270 PUBLIC S16 cmPkCrgUeCfg
1276 PUBLIC S16 cmPkCrgUeCfg(param, mBuf)
1283 #ifdef TENB_MULT_CELL_SUPPRT
1284 CMCHKPK(SPkS16, param->rguDlSapId, mBuf);
1285 CMCHKPK(SPkS16, param->rguUlSapId, mBuf);
1287 CMCHKPK(SPkU32, param->txMode.tm, mBuf);
1288 CMCHKPK(SPkU8, param->txMode.pres, mBuf);
1289 CMCHKPK(cmPkCrgUeUlHqCfg, ¶m->ueUlHqCfg, mBuf);
1290 CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
1291 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1297 /***********************************************************
1299 * Func : cmUnpkCrgUeCfg
1302 * Desc : UE configuration
1311 **********************************************************/
1313 PUBLIC S16 cmUnpkCrgUeCfg
1319 PUBLIC S16 cmUnpkCrgUeCfg(param, mBuf)
1326 TRC3(cmUnpkCrgUeCfg)
1328 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
1329 CMCHKUNPK(cmUnpkLteRnti, ¶m->crnti, mBuf);
1330 CMCHKUNPK(cmUnpkCrgUeUlHqCfg, ¶m->ueUlHqCfg, mBuf);
1331 CMCHKUNPK(SUnpkU8, ¶m->txMode.pres, mBuf);
1332 CMCHKUNPK(SUnpkU32, (U32 *)&tmpEnum, mBuf);
1333 param->txMode.tm = (CrgTxMode) tmpEnum;
1334 #ifdef TENB_MULT_CELL_SUPPRT
1335 CMCHKUNPK(SUnpkS16, ¶m->rguUlSapId, mBuf);
1336 CMCHKUNPK(SUnpkS16, ¶m->rguDlSapId, mBuf);
1343 /***********************************************************
1345 * Func : cmPkCrgDlLchCfg
1348 * Desc : Logical channel configuration info for downlink logical channels
1357 **********************************************************/
1359 PUBLIC S16 cmPkCrgDlLchCfg
1365 PUBLIC S16 cmPkCrgDlLchCfg(param, mBuf)
1371 TRC3(cmPkCrgDlLchCfg)
1373 CMCHKPK(SPkU8, param->dlTrchType, mBuf);
1379 /***********************************************************
1381 * Func : cmUnpkCrgDlLchCfg
1384 * Desc : Logical channel configuration info for downlink logical channels
1393 **********************************************************/
1395 PUBLIC S16 cmUnpkCrgDlLchCfg
1401 PUBLIC S16 cmUnpkCrgDlLchCfg(param, mBuf)
1407 TRC3(cmUnpkCrgDlLchCfg)
1409 CMCHKUNPK(SUnpkU8, ¶m->dlTrchType, mBuf);
1415 /***********************************************************
1417 * Func : cmPkCrgUlLchCfg
1420 * Desc : Logical channel configuration info for uplink logical channels
1429 **********************************************************/
1431 PUBLIC S16 cmPkCrgUlLchCfg
1437 PUBLIC S16 cmPkCrgUlLchCfg(param, mBuf)
1443 TRC3(cmPkCrgUlLchCfg)
1445 CMCHKPK(SPkU8, param->lcgId, mBuf);
1446 CMCHKPK(SPkU8, param->ulTrchType, mBuf);
1452 /***********************************************************
1454 * Func : cmUnpkCrgUlLchCfg
1457 * Desc : Logical channel configuration info for uplink logical channels
1466 **********************************************************/
1468 PUBLIC S16 cmUnpkCrgUlLchCfg
1474 PUBLIC S16 cmUnpkCrgUlLchCfg(param, mBuf)
1480 TRC3(cmUnpkCrgUlLchCfg)
1482 CMCHKUNPK(SUnpkU8, ¶m->ulTrchType, mBuf);
1483 CMCHKUNPK(SUnpkU8, ¶m->lcgId, mBuf);
1489 /***********************************************************
1491 * Func : cmPkCrgLchCfg
1494 * Desc : Logical channel configuration info for common and dedicated channels
1503 **********************************************************/
1505 PUBLIC S16 cmPkCrgLchCfg
1511 PUBLIC S16 cmPkCrgLchCfg(param, mBuf)
1518 /* crg_c_001.main_5 - ADD - Added the packing for LTE_L2_MEAS. */
1520 CMCHKPK(SPkU8, param->qci, mBuf);
1522 CMCHKPK(cmPkCrgUlLchCfg, ¶m->ulInfo, mBuf);
1523 CMCHKPK(cmPkCrgDlLchCfg, ¶m->dlInfo, mBuf);
1524 CMCHKPK(SPkU8, param->dir, mBuf);
1525 CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
1526 CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
1527 CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
1528 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1534 /***********************************************************
1536 * Func : cmUnpkCrgLchCfg
1539 * Desc : Logical channel configuration info for common and dedicated channels
1548 **********************************************************/
1550 PUBLIC S16 cmUnpkCrgLchCfg
1556 PUBLIC S16 cmUnpkCrgLchCfg(param, mBuf)
1562 TRC3(cmUnpkCrgLchCfg)
1564 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
1565 CMCHKUNPK(cmUnpkLteRnti, ¶m->crnti, mBuf);
1566 CMCHKUNPK(cmUnpkLteLcId, ¶m->lcId, mBuf);
1567 CMCHKUNPK(cmUnpkLteLcType, ¶m->lcType, mBuf);
1568 CMCHKUNPK(SUnpkU8, ¶m->dir, mBuf);
1569 CMCHKUNPK(cmUnpkCrgDlLchCfg, ¶m->dlInfo, mBuf);
1570 CMCHKUNPK(cmUnpkCrgUlLchCfg, ¶m->ulInfo, mBuf);
1571 /* crg_c_001.main_5 - ADD - Added the unpacking for LTE_L2_MEAS. */
1573 CMCHKUNPK(SUnpkU8, ¶m->qci, mBuf);
1580 /***********************************************************
1585 * Desc : Basic configuration info for MAC
1594 **********************************************************/
1596 PUBLIC S16 cmPkCrgCfg
1602 PUBLIC S16 cmPkCrgCfg(param, mBuf)
1610 switch(param->cfgType) {
1612 CMCHKPK(cmPkCrgLchCfg, ¶m->u.lchCfg, mBuf);
1615 CMCHKPK(cmPkCrgUeCfg, ¶m->u.ueCfg, mBuf);
1618 CMCHKPK(cmPkCrgCellCfg, ¶m->u.cellCfg, mBuf);
1623 CMCHKPK(SPkU8, param->cfgType, mBuf);
1629 /***********************************************************
1631 * Func : cmUnpkCrgCfg
1634 * Desc : Basic configuration info for MAC
1643 **********************************************************/
1645 PUBLIC S16 cmUnpkCrgCfg
1651 PUBLIC S16 cmUnpkCrgCfg(param, mBuf)
1659 CMCHKUNPK(SUnpkU8, ¶m->cfgType, mBuf);
1660 switch(param->cfgType) {
1662 CMCHKUNPK(cmUnpkCrgCellCfg, ¶m->u.cellCfg, mBuf);
1665 CMCHKUNPK(cmUnpkCrgUeCfg, ¶m->u.ueCfg, mBuf);
1668 CMCHKUNPK(cmUnpkCrgLchCfg, ¶m->u.lchCfg, mBuf);
1678 /***********************************************************
1680 * Func : cmPkCrgCellRecfg
1683 * Desc : Cell reconfiguration info
1692 **********************************************************/
1694 PUBLIC S16 cmPkCrgCellRecfg
1696 CrgCellRecfg *param,
1700 PUBLIC S16 cmPkCrgCellRecfg(param, mBuf)
1701 CrgCellRecfg *param;
1706 TRC3(cmPkCrgCellRecfg)
1708 CMCHKPK(cmPkCrgRachCfg, ¶m->rachRecfg, mBuf);
1709 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1715 /***********************************************************
1717 * Func : cmUnpkCrgCellRecfg
1720 * Desc : Cell reconfiguration info
1729 **********************************************************/
1731 PUBLIC S16 cmUnpkCrgCellRecfg
1733 CrgCellRecfg *param,
1737 PUBLIC S16 cmUnpkCrgCellRecfg(param, mBuf)
1738 CrgCellRecfg *param;
1743 TRC3(cmUnpkCrgCellRecfg)
1745 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
1746 CMCHKUNPK(cmUnpkCrgRachCfg, ¶m->rachRecfg, mBuf);
1752 /***********************************************************
1754 * Func : cmPkCrgUeRecfg
1757 * Desc : UE reconfiguration info
1766 **********************************************************/
1768 PUBLIC S16 cmPkCrgUeRecfg
1774 PUBLIC S16 cmPkCrgUeRecfg(param, mBuf)
1780 TRC3(cmPkCrgUeRecfg)
1782 if(TRUE == param->crgSCellCfg.isSCellCfgPres)
1784 CMCHKPK(cmPkCrgUeSecCellInfo, ¶m->crgSCellCfg, mBuf);
1788 CMCHKPK(SPkU8, param->crgSCellCfg.isSCellCfgPres, mBuf);
1790 #endif /* LTE_ADV */
1791 CMCHKPK(SPkU32, param->txMode.tm, mBuf);
1792 CMCHKPK(SPkU8, param->txMode.pres, mBuf);
1793 CMCHKPK(cmPkCrgUeUlHqCfg, ¶m->ueUlHqRecfg, mBuf);
1794 CMCHKPK(cmPkLteRnti, param->newCrnti, mBuf);
1795 CMCHKPK(cmPkLteRnti, param->oldCrnti, mBuf);
1796 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1802 /***********************************************************
1804 * Func : cmUnpkCrgUeRecfg
1807 * Desc : UE reconfiguration info
1816 **********************************************************/
1818 PUBLIC S16 cmUnpkCrgUeRecfg
1824 PUBLIC S16 cmUnpkCrgUeRecfg(param, mBuf)
1830 TRC3(cmUnpkCrgUeRecfg)
1832 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
1833 CMCHKUNPK(cmUnpkLteRnti, ¶m->oldCrnti, mBuf);
1834 CMCHKUNPK(cmUnpkLteRnti, ¶m->newCrnti, mBuf);
1835 CMCHKUNPK(cmUnpkCrgUeUlHqCfg, ¶m->ueUlHqRecfg, mBuf);
1836 CMCHKUNPK(SUnpkU8, ¶m->txMode.pres, mBuf);
1837 CMCHKUNPK(SUnpkU32, (U32 *)¶m->txMode.tm, mBuf);
1839 CMCHKUNPK(cmUnpkCrgUeSecCellInfo, ¶m->crgSCellCfg, mBuf);
1840 #endif /* LTE_ADV */
1846 /***********************************************************
1848 * Func : cmPkCrgLchRecfg
1851 * Desc : Logical channel reconfiguration info for dedicated channels only
1860 **********************************************************/
1862 PUBLIC S16 cmPkCrgLchRecfg
1868 PUBLIC S16 cmPkCrgLchRecfg(param, mBuf)
1874 TRC3(cmPkCrgLchRecfg)
1876 CMCHKPK(SPkU8, param->ulRecfg.lcgId, mBuf);
1877 CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
1878 CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
1879 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1885 /***********************************************************
1887 * Func : cmUnpkCrgLchRecfg
1890 * Desc : Logical channel reconfiguration info for dedicated channels only
1899 **********************************************************/
1901 PUBLIC S16 cmUnpkCrgLchRecfg
1907 PUBLIC S16 cmUnpkCrgLchRecfg(param, mBuf)
1913 TRC3(cmUnpkCrgLchRecfg)
1915 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
1916 CMCHKUNPK(cmUnpkLteRnti, ¶m->crnti, mBuf);
1917 CMCHKUNPK(cmUnpkLteLcId, ¶m->lcId, mBuf);
1918 CMCHKUNPK(SUnpkU8, ¶m->ulRecfg.lcgId, mBuf);
1924 /***********************************************************
1926 * Func : cmPkCrgRecfg
1929 * Desc : Basic reconfiguration info for MAC
1938 **********************************************************/
1940 PUBLIC S16 cmPkCrgRecfg
1946 PUBLIC S16 cmPkCrgRecfg(param, mBuf)
1954 switch(param->recfgType) {
1956 CMCHKPK(cmPkCrgLchRecfg, ¶m->u.lchRecfg, mBuf);
1959 CMCHKPK(cmPkCrgUeRecfg, ¶m->u.ueRecfg, mBuf);
1962 CMCHKPK(cmPkCrgCellRecfg, ¶m->u.cellRecfg, mBuf);
1967 CMCHKPK(SPkU8, param->recfgType, mBuf);
1973 /***********************************************************
1975 * Func : cmUnpkCrgRecfg
1978 * Desc : Basic reconfiguration info for MAC
1987 **********************************************************/
1989 PUBLIC S16 cmUnpkCrgRecfg
1995 PUBLIC S16 cmUnpkCrgRecfg(param, mBuf)
2001 TRC3(cmUnpkCrgRecfg)
2003 CMCHKUNPK(SUnpkU8, ¶m->recfgType, mBuf);
2004 switch(param->recfgType) {
2006 CMCHKUNPK(cmUnpkCrgCellRecfg, ¶m->u.cellRecfg, mBuf);
2009 CMCHKUNPK(cmUnpkCrgUeRecfg, ¶m->u.ueRecfg, mBuf);
2012 CMCHKUNPK(cmUnpkCrgLchRecfg, ¶m->u.lchRecfg, mBuf);
2022 /***********************************************************
2027 * Desc : Basic Delete info for MAC
2036 **********************************************************/
2038 PUBLIC S16 cmPkCrgDel
2044 PUBLIC S16 cmPkCrgDel(param, mBuf)
2052 switch(param->delType) {
2054 CMCHKPK(SPkU8, param->u.lchDel.dir, mBuf);
2055 CMCHKPK(cmPkLteLcId, param->u.lchDel.lcId, mBuf);
2056 CMCHKPK(cmPkLteRnti, param->u.lchDel.crnti, mBuf);
2057 CMCHKPK(cmPkLteCellId, param->u.lchDel.cellId, mBuf);
2060 CMCHKPK(cmPkLteRnti, param->u.ueDel.crnti, mBuf);
2061 CMCHKPK(cmPkLteCellId, param->u.ueDel.cellId, mBuf);
2064 CMCHKPK(cmPkLteCellId, param->u.cellDel.cellId, mBuf);
2069 CMCHKPK(SPkU8, param->delType, mBuf);
2075 /***********************************************************
2077 * Func : cmUnpkCrgDel
2080 * Desc : Basic Delete info for MAC
2089 **********************************************************/
2091 PUBLIC S16 cmUnpkCrgDel
2097 PUBLIC S16 cmUnpkCrgDel(param, mBuf)
2105 CMCHKUNPK(SUnpkU8, ¶m->delType, mBuf);
2106 switch(param->delType) {
2108 CMCHKUNPK(cmUnpkLteCellId, ¶m->u.cellDel.cellId, mBuf);
2111 CMCHKUNPK(cmUnpkLteCellId, ¶m->u.ueDel.cellId, mBuf);
2112 CMCHKUNPK(cmUnpkLteRnti, ¶m->u.ueDel.crnti, mBuf);
2115 CMCHKUNPK(cmUnpkLteCellId, ¶m->u.lchDel.cellId, mBuf);
2116 CMCHKUNPK(cmUnpkLteRnti, ¶m->u.lchDel.crnti, mBuf);
2117 CMCHKUNPK(cmUnpkLteLcId, ¶m->u.lchDel.lcId, mBuf);
2118 CMCHKUNPK(SUnpkU8, ¶m->u.lchDel.dir, mBuf);
2128 /***********************************************************
2133 * Desc : UE RESET info for MAC
2142 **********************************************************/
2144 PUBLIC S16 cmPkCrgRst
2150 PUBLIC S16 cmPkCrgRst(param, mBuf)
2158 CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
2159 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
2165 /***********************************************************
2167 * Func : cmUnpkCrgRst
2170 * Desc : UE RESET info for MAC
2179 **********************************************************/
2181 PUBLIC S16 cmUnpkCrgRst
2187 PUBLIC S16 cmUnpkCrgRst(param, mBuf)
2195 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
2196 CMCHKUNPK(cmUnpkLteRnti, ¶m->crnti, mBuf);
2202 /***********************************************************
2204 * Func : cmPkCrgCfgReqInfo
2207 * Desc : Config/Reconfig/Delete info for MAC
2216 **********************************************************/
2218 PUBLIC S16 cmPkCrgCfgReqInfo
2220 CrgCfgReqInfo *param,
2224 PUBLIC S16 cmPkCrgCfgReqInfo(param, mBuf)
2225 CrgCfgReqInfo *param;
2230 TRC3(cmPkCrgCfgReqInfo)
2232 switch(param->action) {
2234 CMCHKPK(cmPkCrgRst, ¶m->u.rstInfo, mBuf);
2237 CMCHKPK(cmPkCrgDel, ¶m->u.delInfo, mBuf);
2240 CMCHKPK(cmPkCrgRecfg, ¶m->u.recfgInfo, mBuf);
2243 CMCHKPK(cmPkCrgCfg, ¶m->u.cfgInfo, mBuf);
2248 CMCHKPK(SPkU8, param->action, mBuf);
2254 /***********************************************************
2256 * Func : cmUnpkCrgCfgReqInfo
2259 * Desc : Config/Reconfig/Delete info for MAC
2268 **********************************************************/
2270 PUBLIC S16 cmUnpkCrgCfgReqInfo
2272 CrgCfgReqInfo *param,
2276 PUBLIC S16 cmUnpkCrgCfgReqInfo(param, mBuf)
2277 CrgCfgReqInfo *param;
2282 TRC3(cmUnpkCrgCfgReqInfo)
2284 CMCHKUNPK(SUnpkU8, ¶m->action, mBuf);
2285 switch(param->action) {
2287 CMCHKUNPK(cmUnpkCrgCfg, ¶m->u.cfgInfo, mBuf);
2290 CMCHKUNPK(cmUnpkCrgRecfg, ¶m->u.recfgInfo, mBuf);
2293 CMCHKUNPK(cmUnpkCrgDel, ¶m->u.delInfo, mBuf);
2296 CMCHKUNPK(cmUnpkCrgRst, ¶m->u.rstInfo, mBuf);
2305 /**********************************************************************
2307 **********************************************************************/