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 "common_def.h"
38 #include "crg.h" /* CRG Interface defines */
40 /* header/extern include files (.x) */
41 #include "crg.x" /* CRG Interface includes */
46 * @brief Request from RRC to MAC to bind the interface saps
50 * Function : cmPkCrgBndReq
53 * @param[in] SuId suId
54 * @param[in] SpId spId
67 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
68 #if (ERRCLASS & ERRCLS_ADD_RES)
69 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
70 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
71 (ErrVal)ECRG001, (ErrVal)0, "Packing failed");
75 if (SPkS16(spId, mBuf) != ROK) {
76 #if (ERRCLASS & ERRCLS_ADD_RES)
77 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
78 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
79 (ErrVal)ECRG002, (ErrVal)0, "Packing failed");
84 if (SPkS16(suId, mBuf) != ROK) {
85 #if (ERRCLASS & ERRCLS_ADD_RES)
86 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
87 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
88 (ErrVal)ECRG003, (ErrVal)0, "Packing failed");
93 pst->event = (Event) EVTCRGBNDREQ;
94 return (SPstTsk(pst,mBuf));
99 * @brief Request from RRC to MAC to bind the interface saps
103 * Function : cmUnpkCrgBndReq
105 * @param[in] Pst* pst
106 * @param[in] SuId suId
107 * @param[in] SpId spId
122 if (SUnpkS16(&suId, mBuf) != ROK) {
124 #if (ERRCLASS & ERRCLS_ADD_RES)
125 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
126 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
127 (ErrVal)ECRG004, (ErrVal)0, "Packing failed");
131 if (SUnpkS16(&spId, mBuf) != ROK) {
133 #if (ERRCLASS & ERRCLS_ADD_RES)
134 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
135 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
136 (ErrVal)ECRG005, (ErrVal)0, "Packing failed");
141 return ((*func)(pst, suId, spId));
146 * @brief Confirmation from MAC to RRC for the bind/Unbind
147 * request for the interface saps
151 * Function : cmPkCrgBndCfm
153 * @param[in] Pst* pst
154 * @param[in] SuId suId
155 * @param[in] uint8_t status
166 Buffer *mBuf = NULLP;
168 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
169 #if (ERRCLASS & ERRCLS_ADD_RES)
170 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
171 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
172 (ErrVal)ECRG006, (ErrVal)0, "Packing failed");
176 if (oduUnpackUInt8(status, mBuf) != ROK) {
177 #if (ERRCLASS & ERRCLS_ADD_RES)
178 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
179 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
180 (ErrVal)ECRG007, (ErrVal)0, "Packing failed");
185 if (SPkS16(suId, mBuf) != ROK) {
186 #if (ERRCLASS & ERRCLS_ADD_RES)
187 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
188 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
189 (ErrVal)ECRG008, (ErrVal)0, "Packing failed");
194 pst->event = (Event) EVTCRGBNDCFM;
195 return (SPstTsk(pst,mBuf));
200 * @brief Confirmation from MAC to RRC for the bind/Unbind
201 * request for the interface saps
205 * Function : cmUnpkCrgBndCfm
207 * @param[in] Pst* pst
208 * @param[in] SuId suId
209 * @param[in] uint8_t status
224 if (SUnpkS16(&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)ECRG009, (ErrVal)0, "Packing failed");
233 if (oduPackUInt8(&status, mBuf) != ROK) {
235 #if (ERRCLASS & ERRCLS_ADD_RES)
236 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
237 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
238 (ErrVal)ECRG010, (ErrVal)0, "Packing failed");
243 return ((*func)(pst, suId, status));
248 * @brief Request from RRC to MAC to Unbind the interface saps
252 * Function : cmPkCrgUbndReq
254 * @param[in] Pst* pst
255 * @param[in] SpId spId
256 * @param[in] Reason reason
267 Buffer *mBuf = NULLP;
269 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
270 #if (ERRCLASS & ERRCLS_ADD_RES)
271 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
272 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
273 (ErrVal)ECRG011, (ErrVal)0, "Packing failed");
277 if (SPkS16(reason, mBuf) != ROK) {
278 #if (ERRCLASS & ERRCLS_ADD_RES)
279 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
280 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
281 (ErrVal)ECRG012, (ErrVal)0, "Packing failed");
286 if (SPkS16(spId, mBuf) != ROK) {
287 #if (ERRCLASS & ERRCLS_ADD_RES)
288 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
289 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
290 (ErrVal)ECRG013, (ErrVal)0, "Packing failed");
295 pst->event = (Event) EVTCRGUBNDREQ;
296 return (SPstTsk(pst,mBuf));
301 * @brief Request from RRC to MAC to Unbind the interface saps
305 * Function : cmUnpkCrgUbndReq
307 * @param[in] Pst* pst
308 * @param[in] SpId spId
309 * @param[in] Reason reason
324 if (SUnpkS16(&spId, 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)ECRG014, (ErrVal)0, "Packing failed");
333 if (SUnpkS16(&reason, mBuf) != ROK) {
335 #if (ERRCLASS & ERRCLS_ADD_RES)
336 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
337 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
338 (ErrVal)ECRG015, (ErrVal)0, "Packing failed");
343 return ((*func)(pst, spId, reason));
348 * @brief Configuration Request from RRC to MAC for
349 * configuring Cell/Ue/Lc
353 * Function : cmPkCrgCfgReq
355 * @param[in] Pst* pst
356 * @param[in] SpId spId
357 * @param[in] CrgCfgTransId transId
358 * @param[in] CrgCfgReqInfo * cfgReqInfo
366 CrgCfgTransId transId,
367 CrgCfgReqInfo * cfgReqInfo
370 Buffer *mBuf = NULLP;
372 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
373 #if (ERRCLASS & ERRCLS_ADD_RES)
374 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
375 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
376 (ErrVal)ECRG016, (ErrVal)0, "Packing failed");
378 SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
381 if (cmPkCrgCfgReqInfo(cfgReqInfo, mBuf) != ROK) {
382 #if (ERRCLASS & ERRCLS_ADD_RES)
383 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
384 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
385 (ErrVal)ECRG017, (ErrVal)0, "Packing failed");
387 SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
391 /* crg_c_001.main_5: MOD - Updating ERR code */
392 if (cmPkCrgCfgTransId(&transId, mBuf) != ROK) {
393 #if (ERRCLASS & ERRCLS_ADD_RES)
394 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
395 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
396 (ErrVal)ECRG018, (ErrVal)0, "Packing failed");
398 SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
402 if (SPkS16(spId, mBuf) != ROK) {
403 #if (ERRCLASS & ERRCLS_ADD_RES)
404 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
405 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
406 (ErrVal)ECRG019, (ErrVal)0, "Packing failed");
408 SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
412 if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo)) != ROK) {
413 #if (ERRCLASS & ERRCLS_ADD_RES)
414 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
415 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
416 (ErrVal)ECRG020, (ErrVal)0, "Packing failed");
421 pst->event = (Event) EVTCRGCFGREQ;
422 return (SPstTsk(pst,mBuf));
427 * @brief Configuration Request from RRC to MAC for
428 * configuring Cell/Ue/Lc
432 * Function : cmUnpkCrgCfgReq
434 * @param[in] Pst* pst
435 * @param[in] SpId spId
436 * @param[in] CrgCfgTransId transId
437 * @param[in] CrgCfgReqInfo * cfgReqInfo
449 CrgCfgTransId transId;
450 CrgCfgReqInfo *cfgReqInfo;
453 if (SUnpkS16(&spId, 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)ECRG021, (ErrVal)0, "Packing failed");
462 if (cmUnpkCrgCfgTransId(&transId, mBuf) != ROK) {
464 #if (ERRCLASS & ERRCLS_ADD_RES)
465 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
466 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
467 (ErrVal)ECRG022, (ErrVal)0, "Packing failed");
471 if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&cfgReqInfo, sizeof(CrgCfgReqInfo))) != ROK) {
472 #if (ERRCLASS & ERRCLS_ADD_RES)
473 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
474 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
475 (ErrVal)ECRG023, (ErrVal)0, "Packing failed");
481 if (cmUnpkCrgCfgReqInfo(cfgReqInfo, mBuf) != ROK) {
482 SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
484 #if (ERRCLASS & ERRCLS_ADD_RES)
485 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
486 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
487 (ErrVal)ECRG024, (ErrVal)0, "Packing failed");
492 return ((*func)(pst, spId, transId, cfgReqInfo));
497 * @brief Configuration Confirm from MAC to RRC
501 * Function : cmPkCrgCfgCfm
503 * @param[in] Pst* pst
504 * @param[in] SuId suId
505 * @param[in] CrgCfgTransId transId
506 * @param[in] uint8_t status
514 CrgCfgTransId transId,
518 Buffer *mBuf = NULLP;
520 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
521 #if (ERRCLASS & ERRCLS_ADD_RES)
522 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
523 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
524 (ErrVal)ECRG025, (ErrVal)0, "Packing failed");
528 /* crg_c_001.main_5 - ADD - Added the packing for status. */
529 if (oduUnpackUInt8(status, mBuf) != ROK) {
530 #if (ERRCLASS & ERRCLS_ADD_RES)
531 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
532 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
533 (ErrVal)ECRG026, (ErrVal)0, "Packing failed");
538 if (cmPkCrgCfgTransId(&transId, mBuf) != ROK) {
539 #if (ERRCLASS & ERRCLS_ADD_RES)
540 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
541 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
542 (ErrVal)ECRG027, (ErrVal)0, "Packing failed");
547 if (SPkS16(suId, mBuf) != ROK) {
548 #if (ERRCLASS & ERRCLS_ADD_RES)
549 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
550 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
551 (ErrVal)ECRG028, (ErrVal)0, "Packing failed");
556 pst->event = (Event) EVTCRGCFGCFM;
557 return (SPstTsk(pst,mBuf));
562 * @brief Configuration Confirm from MAC to RRC
566 * Function : cmUnpkCrgCfgCfm
568 * @param[in] Pst* pst
569 * @param[in] SuId suId
570 * @param[in] CrgCfgTransId transId
571 * @param[in] uint8_t status
583 CrgCfgTransId transId;
587 if (SUnpkS16(&suId, mBuf) != ROK) {
589 #if (ERRCLASS & ERRCLS_ADD_RES)
590 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
591 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
592 (ErrVal)ECRG029, (ErrVal)0, "Packing failed");
596 if (cmUnpkCrgCfgTransId(&transId, mBuf) != ROK) {
598 #if (ERRCLASS & ERRCLS_ADD_RES)
599 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
600 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
601 (ErrVal)ECRG030, (ErrVal)0, "Packing failed");
605 if (oduPackUInt8(&status, mBuf) != ROK) {
607 #if (ERRCLASS & ERRCLS_ADD_RES)
608 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
609 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
610 (ErrVal)ECRG031, (ErrVal)0, "Packing failed");
615 return ((*func)(pst, suId, transId, status));
619 /***********************************************************
621 * Func : cmPkCrgCfgTransId
624 * Desc : Transaction ID between MAC and RRC
633 **********************************************************/
634 S16 cmPkCrgCfgTransId
636 CrgCfgTransId *param,
643 for (i=CRG_CFG_TRANSID_SIZE-1; i >= 0; i--) {
644 CMCHKPK(oduUnpackUInt8, param->trans[i], mBuf);
651 /***********************************************************
653 * Func : cmUnpkCrgCfgTransId
656 * Desc : Transaction ID between MAC and RRC
665 **********************************************************/
666 S16 cmUnpkCrgCfgTransId
668 CrgCfgTransId *param,
675 for (i=0; i<CRG_CFG_TRANSID_SIZE; i++) {
676 CMCHKUNPK(oduPackUInt8, ¶m->trans[i], mBuf);
683 /***********************************************************
685 * Func : cmPkCrgBwCfg
688 * Desc : Bandwidth configuration per cell
697 **********************************************************/
706 CMCHKPK(oduUnpackUInt8, param->ulTotalBw, mBuf);
707 CMCHKPK(oduUnpackUInt8, param->dlTotalBw, mBuf);
713 /***********************************************************
715 * Func : cmUnpkCrgBwCfg
718 * Desc : Bandwidth configuration per cell
727 **********************************************************/
736 CMCHKUNPK(oduPackUInt8, ¶m->dlTotalBw, mBuf);
737 CMCHKUNPK(oduPackUInt8, ¶m->ulTotalBw, mBuf);
743 /***********************************************************
745 * Func : cmPkCrgRachCfg
748 * Desc : RACH configuration per cell
757 **********************************************************/
766 CMCHKPK(oduUnpackUInt8, param->maxMsg3Tx, mBuf);
772 /***********************************************************
774 * Func : cmUnpkCrgRachCfg
777 * Desc : RACH configuration per cell
786 **********************************************************/
795 CMCHKUNPK(oduPackUInt8, ¶m->maxMsg3Tx, mBuf);
801 /***********************************************************
803 * Func : cmPkCrgCellCfg
806 * Desc : Cell configuration
815 **********************************************************/
824 CMCHKPK(oduUnpackUInt8, param->emtcEnable, mBuf);
826 #ifdef TENB_MULT_CELL_SUPPRT
827 CMCHKPK(SPkS16, param->rguDlSapId, mBuf);
828 CMCHKPK(SPkS16, param->rguUlSapId, mBuf);
830 CMCHKPK(cmPkCrgBwCfg, ¶m->bwCfg, mBuf);
831 CMCHKPK(cmPkCrgRachCfg, ¶m->rachCfg, mBuf);
832 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
838 /***********************************************************
840 * Func : cmUnpkCrgCellCfg
843 * Desc : Cell configuration
852 **********************************************************/
861 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
862 CMCHKUNPK(cmUnpkCrgRachCfg, ¶m->rachCfg, mBuf);
863 CMCHKUNPK(cmUnpkCrgBwCfg, ¶m->bwCfg, mBuf);
864 #ifdef TENB_MULT_CELL_SUPPRT
865 CMCHKUNPK(SUnpkS16, ¶m->rguUlSapId, mBuf);
866 CMCHKUNPK(SUnpkS16, ¶m->rguDlSapId, mBuf);
869 CMCHKUNPK(oduPackUInt8, ¶m->emtcEnable, mBuf);
876 /***********************************************************
878 * Func : cmPkCrgUeUlHqCfg
881 * Desc : Uplink HARQ configuration per UE
890 **********************************************************/
899 CMCHKPK(oduUnpackUInt8, param->maxUlHqTx, mBuf);
904 /***********************************************************
906 * Func : cmPkCrgUeSCellCfg
909 * Desc : Secondary Cell information of the UE
918 **********************************************************/
919 static S16 cmPkCrgUeSCellCfg
921 CrgUeSCellInfo *param,
925 CMCHKPK(SPkS16, param->rguDlSapId, mBuf);
926 CMCHKPK(SPkS16, param->rguUlSapId, mBuf);
927 CMCHKPK(oduUnpackUInt8, param->macInst, mBuf);
928 CMCHKPK(oduUnpackUInt16, param->sCellId, mBuf);
932 /***********************************************************
934 * Func : cmUnpkCrgUeSCellCfg
937 * Desc : Secondary Cell information of the UE
946 **********************************************************/
947 static S16 cmUnpkCrgUeSCellCfg
949 CrgUeSCellInfo *param,
953 CMCHKUNPK(oduPackUInt16, ¶m->sCellId, mBuf);
954 CMCHKUNPK(oduPackUInt8, ¶m->macInst, mBuf);
955 CMCHKUNPK(SUnpkS16, ¶m->rguUlSapId, mBuf);
956 CMCHKUNPK(SUnpkS16, ¶m->rguDlSapId, mBuf);
959 /***********************************************************
961 * Func : cmPkCrgUeSecCellInfo
964 * Desc : Secondary Cell information of the UE
973 **********************************************************/
974 S16 cmPkCrgUeSecCellInfo
976 CrgUeSecCellInfo *param,
981 for(idx = param->numSCells - 1; idx >= 0; idx--)
983 CMCHKPK(cmPkCrgUeSCellCfg, ¶m->ueSCellCfg[(uint8_t)idx], mBuf);
986 CMCHKPK(oduUnpackUInt8, param->numSCells, mBuf);
987 CMCHKPK(oduUnpackUInt8, param->isSCellCfgPres, mBuf);
992 /***********************************************************
994 * Func : cmUnpkCrgUeSecCellInfo
997 * Desc : Secondary Cell information of the UE
1006 **********************************************************/
1007 S16 cmUnpkCrgUeSecCellInfo
1009 CrgUeSecCellInfo *param,
1015 CMCHKUNPK(oduPackUInt8, ¶m->isSCellCfgPres, mBuf);
1016 if(TRUE == param->isSCellCfgPres)
1018 CMCHKUNPK(oduPackUInt8, ¶m->numSCells, mBuf);
1020 for(idx = 0; idx < param->numSCells; idx++)
1022 CMCHKUNPK(cmUnpkCrgUeSCellCfg, ¶m->ueSCellCfg[idx],mBuf);
1029 #endif /* LTE_ADV */
1032 /***********************************************************
1034 * Func : cmUnpkCrgUeUlHqCfg
1037 * Desc : Uplink HARQ configuration per UE
1046 **********************************************************/
1047 S16 cmUnpkCrgUeUlHqCfg
1049 CrgUeUlHqCfg *param,
1055 CMCHKUNPK(oduPackUInt8, ¶m->maxUlHqTx, mBuf);
1061 /***********************************************************
1063 * Func : cmPkCrgUeCfg
1066 * Desc : UE configuration
1075 **********************************************************/
1083 #ifdef TENB_MULT_CELL_SUPPRT
1084 CMCHKPK(SPkS16, param->rguDlSapId, mBuf);
1085 CMCHKPK(SPkS16, param->rguUlSapId, mBuf);
1087 CMCHKPK(oduUnpackUInt32, param->txMode.tm, mBuf);
1088 CMCHKPK(oduUnpackUInt8, param->txMode.pres, mBuf);
1089 CMCHKPK(cmPkCrgUeUlHqCfg, ¶m->ueUlHqCfg, mBuf);
1090 CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
1091 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1097 /***********************************************************
1099 * Func : cmUnpkCrgUeCfg
1102 * Desc : UE configuration
1111 **********************************************************/
1121 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
1122 CMCHKUNPK(cmUnpkLteRnti, ¶m->crnti, mBuf);
1123 CMCHKUNPK(cmUnpkCrgUeUlHqCfg, ¶m->ueUlHqCfg, mBuf);
1124 CMCHKUNPK(oduPackUInt8, ¶m->txMode.pres, mBuf);
1125 CMCHKUNPK(oduPackUInt32, (uint32_t *)&tmpEnum, mBuf);
1126 param->txMode.tm = (CrgTxMode) tmpEnum;
1127 #ifdef TENB_MULT_CELL_SUPPRT
1128 CMCHKUNPK(SUnpkS16, ¶m->rguUlSapId, mBuf);
1129 CMCHKUNPK(SUnpkS16, ¶m->rguDlSapId, mBuf);
1136 /***********************************************************
1138 * Func : cmPkCrgDlLchCfg
1141 * Desc : Logical channel configuration info for downlink logical channels
1150 **********************************************************/
1159 CMCHKPK(oduUnpackUInt8, param->dlTrchType, mBuf);
1165 /***********************************************************
1167 * Func : cmUnpkCrgDlLchCfg
1170 * Desc : Logical channel configuration info for downlink logical channels
1179 **********************************************************/
1180 S16 cmUnpkCrgDlLchCfg
1188 CMCHKUNPK(oduPackUInt8, ¶m->dlTrchType, mBuf);
1194 /***********************************************************
1196 * Func : cmPkCrgUlLchCfg
1199 * Desc : Logical channel configuration info for uplink logical channels
1208 **********************************************************/
1216 CMCHKPK(oduUnpackUInt8, param->lcgId, mBuf);
1217 CMCHKPK(oduUnpackUInt8, param->ulTrchType, mBuf);
1223 /***********************************************************
1225 * Func : cmUnpkCrgUlLchCfg
1228 * Desc : Logical channel configuration info for uplink logical channels
1237 **********************************************************/
1238 S16 cmUnpkCrgUlLchCfg
1246 CMCHKUNPK(oduPackUInt8, ¶m->ulTrchType, mBuf);
1247 CMCHKUNPK(oduPackUInt8, ¶m->lcgId, mBuf);
1253 /***********************************************************
1255 * Func : cmPkCrgLchCfg
1258 * Desc : Logical channel configuration info for common and dedicated channels
1267 **********************************************************/
1275 /* crg_c_001.main_5 - ADD - Added the packing for LTE_L2_MEAS. */
1277 CMCHKPK(oduUnpackUInt8, param->qci, mBuf);
1279 CMCHKPK(cmPkCrgUlLchCfg, ¶m->ulInfo, mBuf);
1280 CMCHKPK(cmPkCrgDlLchCfg, ¶m->dlInfo, mBuf);
1281 CMCHKPK(oduUnpackUInt8, param->dir, mBuf);
1282 CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
1283 CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
1284 CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
1285 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1291 /***********************************************************
1293 * Func : cmUnpkCrgLchCfg
1296 * Desc : Logical channel configuration info for common and dedicated channels
1305 **********************************************************/
1314 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
1315 CMCHKUNPK(cmUnpkLteRnti, ¶m->crnti, mBuf);
1316 CMCHKUNPK(cmUnpkLteLcId, ¶m->lcId, mBuf);
1317 CMCHKUNPK(cmUnpkLteLcType, ¶m->lcType, mBuf);
1318 CMCHKUNPK(oduPackUInt8, ¶m->dir, mBuf);
1319 CMCHKUNPK(cmUnpkCrgDlLchCfg, ¶m->dlInfo, mBuf);
1320 CMCHKUNPK(cmUnpkCrgUlLchCfg, ¶m->ulInfo, mBuf);
1321 /* crg_c_001.main_5 - ADD - Added the unpacking for LTE_L2_MEAS. */
1323 CMCHKUNPK(oduPackUInt8, ¶m->qci, mBuf);
1330 /***********************************************************
1335 * Desc : Basic configuration info for MAC
1344 **********************************************************/
1353 switch(param->cfgType) {
1355 CMCHKPK(cmPkCrgLchCfg, ¶m->u.lchCfg, mBuf);
1358 CMCHKPK(cmPkCrgUeCfg, ¶m->u.ueCfg, mBuf);
1361 CMCHKPK(cmPkCrgCellCfg, ¶m->u.cellCfg, mBuf);
1366 CMCHKPK(oduUnpackUInt8, param->cfgType, mBuf);
1372 /***********************************************************
1374 * Func : cmUnpkCrgCfg
1377 * Desc : Basic configuration info for MAC
1386 **********************************************************/
1395 CMCHKUNPK(oduPackUInt8, ¶m->cfgType, mBuf);
1396 switch(param->cfgType) {
1398 CMCHKUNPK(cmUnpkCrgCellCfg, ¶m->u.cellCfg, mBuf);
1401 CMCHKUNPK(cmUnpkCrgUeCfg, ¶m->u.ueCfg, mBuf);
1404 CMCHKUNPK(cmUnpkCrgLchCfg, ¶m->u.lchCfg, mBuf);
1414 /***********************************************************
1416 * Func : cmPkCrgCellRecfg
1419 * Desc : Cell reconfiguration info
1428 **********************************************************/
1429 S16 cmPkCrgCellRecfg
1431 CrgCellRecfg *param,
1437 CMCHKPK(cmPkCrgRachCfg, ¶m->rachRecfg, mBuf);
1438 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1444 /***********************************************************
1446 * Func : cmUnpkCrgCellRecfg
1449 * Desc : Cell reconfiguration info
1458 **********************************************************/
1459 S16 cmUnpkCrgCellRecfg
1461 CrgCellRecfg *param,
1467 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
1468 CMCHKUNPK(cmUnpkCrgRachCfg, ¶m->rachRecfg, mBuf);
1474 /***********************************************************
1476 * Func : cmPkCrgUeRecfg
1479 * Desc : UE reconfiguration info
1488 **********************************************************/
1497 if(TRUE == param->crgSCellCfg.isSCellCfgPres)
1499 CMCHKPK(cmPkCrgUeSecCellInfo, ¶m->crgSCellCfg, mBuf);
1503 CMCHKPK(oduUnpackUInt8, param->crgSCellCfg.isSCellCfgPres, mBuf);
1505 #endif /* LTE_ADV */
1506 CMCHKPK(oduUnpackUInt32, param->txMode.tm, mBuf);
1507 CMCHKPK(oduUnpackUInt8, param->txMode.pres, mBuf);
1508 CMCHKPK(cmPkCrgUeUlHqCfg, ¶m->ueUlHqRecfg, mBuf);
1509 CMCHKPK(cmPkLteRnti, param->newCrnti, mBuf);
1510 CMCHKPK(cmPkLteRnti, param->oldCrnti, mBuf);
1511 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1517 /***********************************************************
1519 * Func : cmUnpkCrgUeRecfg
1522 * Desc : UE reconfiguration info
1531 **********************************************************/
1532 S16 cmUnpkCrgUeRecfg
1540 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
1541 CMCHKUNPK(cmUnpkLteRnti, ¶m->oldCrnti, mBuf);
1542 CMCHKUNPK(cmUnpkLteRnti, ¶m->newCrnti, mBuf);
1543 CMCHKUNPK(cmUnpkCrgUeUlHqCfg, ¶m->ueUlHqRecfg, mBuf);
1544 CMCHKUNPK(oduPackUInt8, ¶m->txMode.pres, mBuf);
1545 CMCHKUNPK(oduPackUInt32, (uint32_t *)¶m->txMode.tm, mBuf);
1547 CMCHKUNPK(cmUnpkCrgUeSecCellInfo, ¶m->crgSCellCfg, mBuf);
1548 #endif /* LTE_ADV */
1554 /***********************************************************
1556 * Func : cmPkCrgLchRecfg
1559 * Desc : Logical channel reconfiguration info for dedicated channels only
1568 **********************************************************/
1577 CMCHKPK(oduUnpackUInt8, param->ulRecfg.lcgId, mBuf);
1578 CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
1579 CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
1580 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1586 /***********************************************************
1588 * Func : cmUnpkCrgLchRecfg
1591 * Desc : Logical channel reconfiguration info for dedicated channels only
1600 **********************************************************/
1601 S16 cmUnpkCrgLchRecfg
1609 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
1610 CMCHKUNPK(cmUnpkLteRnti, ¶m->crnti, mBuf);
1611 CMCHKUNPK(cmUnpkLteLcId, ¶m->lcId, mBuf);
1612 CMCHKUNPK(oduPackUInt8, ¶m->ulRecfg.lcgId, mBuf);
1618 /***********************************************************
1620 * Func : cmPkCrgRecfg
1623 * Desc : Basic reconfiguration info for MAC
1632 **********************************************************/
1641 switch(param->recfgType) {
1643 CMCHKPK(cmPkCrgLchRecfg, ¶m->u.lchRecfg, mBuf);
1646 CMCHKPK(cmPkCrgUeRecfg, ¶m->u.ueRecfg, mBuf);
1649 CMCHKPK(cmPkCrgCellRecfg, ¶m->u.cellRecfg, mBuf);
1654 CMCHKPK(oduUnpackUInt8, param->recfgType, mBuf);
1660 /***********************************************************
1662 * Func : cmUnpkCrgRecfg
1665 * Desc : Basic reconfiguration info for MAC
1674 **********************************************************/
1683 CMCHKUNPK(oduPackUInt8, ¶m->recfgType, mBuf);
1684 switch(param->recfgType) {
1686 CMCHKUNPK(cmUnpkCrgCellRecfg, ¶m->u.cellRecfg, mBuf);
1689 CMCHKUNPK(cmUnpkCrgUeRecfg, ¶m->u.ueRecfg, mBuf);
1692 CMCHKUNPK(cmUnpkCrgLchRecfg, ¶m->u.lchRecfg, mBuf);
1702 /***********************************************************
1707 * Desc : Basic Delete info for MAC
1716 **********************************************************/
1725 switch(param->delType) {
1727 CMCHKPK(oduUnpackUInt8, param->u.lchDel.dir, mBuf);
1728 CMCHKPK(cmPkLteLcId, param->u.lchDel.lcId, mBuf);
1729 CMCHKPK(cmPkLteRnti, param->u.lchDel.crnti, mBuf);
1730 CMCHKPK(cmPkLteCellId, param->u.lchDel.cellId, mBuf);
1733 CMCHKPK(cmPkLteRnti, param->u.ueDel.crnti, mBuf);
1734 CMCHKPK(cmPkLteCellId, param->u.ueDel.cellId, mBuf);
1737 CMCHKPK(cmPkLteCellId, param->u.cellDel.cellId, mBuf);
1742 CMCHKPK(oduUnpackUInt8, param->delType, mBuf);
1748 /***********************************************************
1750 * Func : cmUnpkCrgDel
1753 * Desc : Basic Delete info for MAC
1762 **********************************************************/
1771 CMCHKUNPK(oduPackUInt8, ¶m->delType, mBuf);
1772 switch(param->delType) {
1774 CMCHKUNPK(cmUnpkLteCellId, ¶m->u.cellDel.cellId, mBuf);
1777 CMCHKUNPK(cmUnpkLteCellId, ¶m->u.ueDel.cellId, mBuf);
1778 CMCHKUNPK(cmUnpkLteRnti, ¶m->u.ueDel.crnti, mBuf);
1781 CMCHKUNPK(cmUnpkLteCellId, ¶m->u.lchDel.cellId, mBuf);
1782 CMCHKUNPK(cmUnpkLteRnti, ¶m->u.lchDel.crnti, mBuf);
1783 CMCHKUNPK(cmUnpkLteLcId, ¶m->u.lchDel.lcId, mBuf);
1784 CMCHKUNPK(oduPackUInt8, ¶m->u.lchDel.dir, mBuf);
1794 /***********************************************************
1799 * Desc : UE RESET info for MAC
1808 **********************************************************/
1817 CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
1818 CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
1824 /***********************************************************
1826 * Func : cmUnpkCrgRst
1829 * Desc : UE RESET info for MAC
1838 **********************************************************/
1847 CMCHKUNPK(cmUnpkLteCellId, ¶m->cellId, mBuf);
1848 CMCHKUNPK(cmUnpkLteRnti, ¶m->crnti, mBuf);
1854 /***********************************************************
1856 * Func : cmPkCrgCfgReqInfo
1859 * Desc : Config/Reconfig/Delete info for MAC
1868 **********************************************************/
1869 S16 cmPkCrgCfgReqInfo
1871 CrgCfgReqInfo *param,
1877 switch(param->action) {
1879 CMCHKPK(cmPkCrgRst, ¶m->u.rstInfo, mBuf);
1882 CMCHKPK(cmPkCrgDel, ¶m->u.delInfo, mBuf);
1885 CMCHKPK(cmPkCrgRecfg, ¶m->u.recfgInfo, mBuf);
1888 CMCHKPK(cmPkCrgCfg, ¶m->u.cfgInfo, mBuf);
1893 CMCHKPK(oduUnpackUInt8, param->action, mBuf);
1899 /***********************************************************
1901 * Func : cmUnpkCrgCfgReqInfo
1904 * Desc : Config/Reconfig/Delete info for MAC
1913 **********************************************************/
1914 S16 cmUnpkCrgCfgReqInfo
1916 CrgCfgReqInfo *param,
1922 CMCHKUNPK(oduPackUInt8, ¶m->action, mBuf);
1923 switch(param->action) {
1925 CMCHKUNPK(cmUnpkCrgCfg, ¶m->u.cfgInfo, mBuf);
1928 CMCHKUNPK(cmUnpkCrgRecfg, ¶m->u.recfgInfo, mBuf);
1931 CMCHKUNPK(cmUnpkCrgDel, ¶m->u.delInfo, mBuf);
1934 CMCHKUNPK(cmUnpkCrgRst, ¶m->u.rstInfo, mBuf);
1943 /**********************************************************************
1945 **********************************************************************/