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 /********************************************************************20**
25 Desc: This file Contains the packing and unpacking functions for
30 *********************************************************************21*/
32 /* header include files (.h) */
33 #include "common_def.h"
34 #ifdef TENB_SPLIT_ARCH
39 #include "kwu.h" /* KWU defines */
41 /* extern (.x) include files */
42 #ifdef TENB_SPLIT_ARCH
51 #include "kwu.x" /* KWU */
55 /****************************************************************************
57 ***************************************************************************/
66 S16 cmPkKwuBndReq(pst, suId, spId)
78 if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
80 #if (ERRCLASS & ERRCLS_ADD_RES)
83 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
84 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
85 (ErrVal)EKWU001, (ErrVal)0, "SGetMsg() failed");
87 #endif /* ERRCLASS & ERRCLS_ADD_RES */
90 CMCHKPKLOG(SPkS16, spId, mBuf, EKWU002, pst);
91 CMCHKPKLOG(SPkS16, suId, mBuf, EKWU003, pst);
92 pst->event = (Event) KWU_EVT_BND_REQ;
93 return (SPstTsk(pst,mBuf));
105 S16 cmPkKwuBndCfm(pst, suId, status)
117 if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
119 #if (ERRCLASS & ERRCLS_ADD_RES)
122 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
123 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
124 (ErrVal)EKWU004, (ErrVal)0, "SGetMsg() failed");
126 #endif /* ERRCLASS & ERRCLS_ADD_RES */
130 CMCHKPKLOG(oduUnpackUInt8, status, mBuf, EKWU005, pst);
131 CMCHKPKLOG(SPkS16, suId, mBuf, EKWU006, pst);
132 pst->event = (Event) KWU_EVT_BND_CFM;
133 return (SPstTsk(pst,mBuf));
145 S16 cmPkKwuUbndReq(pst, suId, reason)
157 if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
159 #if (ERRCLASS & ERRCLS_ADD_RES)
162 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
163 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
164 (ErrVal)EKWU007, (ErrVal)0, "SGetMsg() failed");
166 #endif /* ERRCLASS & ERRCLS_ADD_RES */
169 CMCHKPKLOG(SPkS16, reason, mBuf, EKWU008, pst);
170 CMCHKPKLOG(SPkS16, suId, mBuf, EKWU009, pst);
172 pst->event = (Event) KWU_EVT_UBND_REQ;
173 return (SPstTsk(pst,mBuf));
174 } /* cmPkKwuUbndReq */
177 uint8_t cmPkKwuDatReqInfo
179 KwuDatReqInfo *param,
183 uint8_t cmPkKwuDatReqInfo(param, mBuf)
184 KwuDatReqInfo *param;
191 switch(param->lcType) {
192 case CM_LTE_LCH_CCCH:
193 CMCHKPK(cmPkLteRnti, param->tm.rnti, mBuf);
195 case CM_LTE_LCH_BCCH:
196 case CM_LTE_LCH_PCCH:
197 CMCHKPK(cmPkLteTimingInfo, ¶m->tm.tmg, mBuf);
199 CMCHKPK(oduUnpackUInt8, param->emtcDiReason,mBuf);
200 CMCHKPK(oduUnpackUInt8, param->pnb,mBuf);
203 case CM_LTE_LCH_DTCH:
204 case CM_LTE_LCH_DCCH:
209 CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
212 CMCHKPK(oduUnpackUInt32, param->sduId, mBuf);
213 CMCHKPK(cmPkLteRlcId, ¶m->rlcId, mBuf);
215 } /* cmPkKwuDatReqInfo */
219 uint8_t cmPkKwuDatReq
222 KwuDatReqInfo* datReq,
226 uint8_t cmPkKwuDatReq(pst, datReq, mBuf)
228 KwuDatReqInfo* datReq;
233 #if (ERRCLASS & ERRCLS_ADD_RES)
238 KwuDatReqInfo* datReqInfo;
241 switch(pst->selector)
243 case ODU_SELECTOR_LWLC:
245 if(pst->srcEnt == ENTDUAPP)
247 /* When the Selector is LWLC, we need to allocate memory, copy
248 * the contents and pass the pointer of the allocated memory. The
249 * subsequent free would be done during the Unpack function of the
251 if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datReqInfo,
252 sizeof(KwuDatReqInfo),SS_SHARABLE_MEMORY)) != ROK)
254 #if (ERRCLASS & ERRCLS_ADD_RES)
257 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
258 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
259 (ErrVal)EKWU028, (ErrVal)0, "SGetMsg() failed");
261 #endif /* ERRCLASS & ERRCLS_ADD_RES */
264 memcpy(datReqInfo,datReq,sizeof(KwuDatReqInfo));
265 CMCHKPK(oduPackPointer,(PTR)datReqInfo, mBuf);
269 CMCHKPK(oduPackPointer,(PTR)datReq, mBuf);
273 case ODU_SELECTOR_LC:
275 #if (ERRCLASS & ERRCLS_ADD_RES)
276 ret1 = cmPkKwuDatReqInfo( (datReq), mBuf);
280 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
281 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
282 (ErrVal)EKWU010, (ErrVal)ret1, "Packing failure");
286 cmPkKwuDatReqInfo( (datReq), mBuf);
287 #endif /* ERRCLASS & ERRCLS_ADD_RES */
288 if(pst->srcEnt == ENTNH)
290 if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq,
291 sizeof(KwuDatReqInfo),SS_SHARABLE_MEMORY) != ROK)
301 #if (ERRCLASS & ERRCLS_ADD_RES)
302 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
303 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
304 (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
305 #endif /* ERRCLASS & ERRCLS_ADD_RES */
310 if(datReq->rlcId.rbType == CM_LTE_SRB)
312 pst->event = (Event) KWU_EVT_CPLANE_DAT_REQ;
316 pst->event = (Event) KWU_EVT_UPLANE_DAT_REQ;
319 pst->event = (Event) KWU_EVT_DAT_REQ;
321 return (SPstTsk(pst,mBuf));
323 if (pst->srcEnt == ENTPJ)
326 KwuDatReqDetl *kwuDatReqDetl = NULLP;
327 elem = SRngGetWIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
330 kwuDatReqDetl = (KwuDatReqDetl *) elem;
331 kwuDatReqDetl->spId = spId;
332 kwuDatReqDetl->lcType = datReq->lcType;
333 kwuDatReqDetl->sduId = datReq->sduId;
334 kwuDatReqDetl->rlcId = datReq->rlcId;
335 kwuDatReqDetl->mBuf = mBuf;
336 SRngIncrWIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
337 SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].pktRate++;
342 SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].pktDrop++;
349 switch(pst->selector)
352 case ODU_SELECTOR_LC:
354 ret1 = cmPkKwuDatReqInfo( (datReq), mBuf);
355 #if (ERRCLASS & ERRCLS_ADD_RES)
359 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
360 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
361 (ErrVal)EKWU010, (ErrVal)ret1, "Packing failure");
364 #endif /* ERRCLASS & ERRCLS_ADD_RES */
367 case ODU_SELECTOR_LWLC:
369 CMCHKPK(oduPackPointer,(PTR)datReq, mBuf);
375 CMCHKPKLOG(SPkS16, spId, mBuf, EKWU011, pst);
376 pst->event = (Event) KWU_EVT_DAT_REQ;
377 ret1 = SPstTsk(pst,mBuf);
378 if(pst->selector == ODU_SELECTOR_LC)
380 if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq,
381 sizeof(KwuDatReqInfo),SS_SHARABLE_MEMORY) != ROK)
390 } /* cmPkKwuDatReq */
394 uint8_t cmPkKwuDatIndInfo
396 KwuDatIndInfo *param,
400 uint8_t cmPkKwuDatIndInfo(param, mBuf)
401 KwuDatIndInfo *param;
406 CMCHKPK(oduUnpackUInt8, param->isOutOfSeq, mBuf);
408 CMCHKPK(cmPkLteRnti, param->tCrnti, mBuf);
410 CMCHKPK(cmPkLteRlcId, ¶m->rlcId, mBuf);
416 uint8_t cmPkKwuDatInd
419 KwuDatIndInfo* datInd,
423 uint8_t cmPkKwuDatInd(pst, datInd, mBuf)
425 KwuDatIndInfo* datInd;
432 #ifdef TENB_SPLIT_ARCH
433 #ifdef SS_LOCKLESS_MEMORY
437 KwuDatIndInfo *datIndInfo = NULLP;
440 #ifdef TENB_SPLIT_ARCH
442 #ifdef SS_LOCKLESS_MEMORY
443 mInfo = (SsMsgInfo *)mBuf->b_rptr;
444 mInfo->region = pst->region;
445 #endif /* SS_LOCKLESS_MEMORY */
448 switch(pst->selector)
450 case ODU_SELECTOR_LWLC:
452 /* When the Selector is LWLC, we need to allocate memory, copy
453 * the contents and pass the pointer of the allocated memory. The
454 * subsequent free would be done during the Unpack function of the
456 if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datIndInfo,
457 sizeof(KwuDatIndInfo),SS_SHARABLE_MEMORY)) != ROK)
459 #if (ERRCLASS & ERRCLS_ADD_RES)
462 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
463 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
464 (ErrVal)EKWU028, (ErrVal)0, "SGetMsg() failed");
466 #endif /* ERRCLASS & ERRCLS_ADD_RES */
470 memcpy(datIndInfo, datInd,sizeof(KwuDatIndInfo));
471 CMCHKPK(oduPackPointer,(PTR)datIndInfo, mBuf);
474 case ODU_SELECTOR_LC:
476 #if (ERRCLASS & ERRCLS_ADD_RES)
477 ret1 = cmPkKwuDatIndInfo( (datInd), mBuf);
481 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
482 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
483 (ErrVal)EKWU012, (ErrVal)ret1, "Packing failure");
487 cmPkKwuDatIndInfo( (datInd), mBuf);
488 #endif /* ERRCLASS & ERRCLS_ADD_RES */
493 #if (ERRCLASS & ERRCLS_ADD_RES)
494 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
495 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
496 (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
497 #endif /* ERRCLASS & ERRCLS_ADD_RES */
501 pst->event = (Event) KWU_EVT_DAT_IND;
503 return (SPstTsk(pst,mBuf));
504 } /* cmPkKwuDatInd */
508 S16 cmPkKwuDatCfmInfo
510 KwuDatCfmInfo *param,
514 S16 cmPkKwuDatCfmInfo(param, mBuf)
515 KwuDatCfmInfo *param;
519 register uint32_t iter;
521 for(iter = 0; iter < param->numSduIds; iter++)
523 CMCHKPK(oduUnpackUInt32, param->sduIds[iter], mBuf);
525 CMCHKPK(oduUnpackUInt32, param->numSduIds, mBuf);
526 CMCHKPK(cmPkLteRlcId, ¶m->rlcId, mBuf);
528 } /* cmPkKwuDatCfmInfo */
536 KwuDatCfmInfo* datCfm
539 S16 cmPkKwuDatCfm(pst, suId, datCfm)
542 KwuDatCfmInfo* datCfm;
545 #if (ERRCLASS & ERRCLS_ADD_RES)
553 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
557 switch(pst->selector)
559 case ODU_SELECTOR_LWLC:
561 CMCHKPK(oduPackPointer,(PTR)datCfm, mBuf);
564 case ODU_SELECTOR_LC:
566 #if (ERRCLASS & ERRCLS_ADD_RES)
567 ret1 = cmPkKwuDatCfmInfo( (datCfm), mBuf);
571 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
572 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
573 (ErrVal)EKWU014, (ErrVal)ret1, "Packing failure");
577 cmPkKwuDatCfmInfo( (datCfm), mBuf);
578 #endif /* ERRCLASS & ERRCLS_ADD_RES */
579 if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datCfm,
580 sizeof(KwuDatCfmInfo),SS_SHARABLE_MEMORY) != ROK)
589 #if (ERRCLASS & ERRCLS_ADD_RES)
590 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
591 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
592 (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
593 #endif /* ERRCLASS & ERRCLS_ADD_RES */
597 CMCHKPKLOG(SPkS16, suId, mBuf, EKWU015, pst);
598 pst->event = (Event) KWU_EVT_DAT_CFM;
600 return (SPstTsk(pst,mBuf));
601 } /* cmPkKwuDatCfm */
605 S16 cmPkKwuDiscSduReq
609 KwuDiscSduInfo* discSdu
612 S16 cmPkKwuDiscSduReq(pst, spId, discSdu)
615 KwuDiscSduInfo* discSdu;
622 KwuDiscSduInfo* discSduInfo = NULLP;
626 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
630 switch(pst->selector)
632 case ODU_SELECTOR_LWLC:
634 /* When the Selector is LWLC, we need to allocate memory, copy
635 * the contents and pass the pointer of the allocated memory. The
636 * subsequent free would be done during the Unpack function of the
638 if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&discSduInfo,
639 sizeof(KwuDiscSduInfo),SS_SHARABLE_MEMORY)) != ROK)
641 #if (ERRCLASS & ERRCLS_ADD_RES)
644 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
645 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
646 (ErrVal)EKWU028, (ErrVal)0, "SGetMsg() failed");
648 #endif /* ERRCLASS & ERRCLS_ADD_RES */
652 memcpy(discSduInfo, discSdu,sizeof(KwuDiscSduInfo));
653 CMCHKPK(oduPackPointer,(PTR)discSduInfo, mBuf);
656 case ODU_SELECTOR_LC:
658 #if (ERRCLASS & ERRCLS_ADD_RES)
659 ret1 = cmPkKwuDiscSduInfo( (discSdu), mBuf);
663 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
664 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
665 (ErrVal)EKWU016, (ErrVal)ret1, "Packing failure");
669 cmPkKwuDiscSduInfo( (discSdu), mBuf);
670 #endif /* ERRCLASS & ERRCLS_ADD_RES */
675 CMCHKPKLOG(SPkS16, spId, mBuf, EKWU017, pst);
676 pst->event = (Event) KWU_EVT_DISC_SDU_REQ;
678 return (SPstTsk(pst,mBuf));
679 } /* cmPkKwuDiscSduReq */
683 S16 cmPkKwuStaIndInfo
685 KwuStaIndInfo *param,
689 S16 cmPkKwuStaIndInfo(param, mBuf)
690 KwuStaIndInfo *param;
697 for (i = (param->numSdu - 1); i >= 0; i--)
699 CMCHKPK(oduUnpackUInt32, param->sduId[(uint16_t)i], mBuf);
701 CMCHKPK(oduUnpackUInt32, param->numSdu, mBuf);
702 CMCHKPK(cmPkLteRlcId, ¶m->rlcId, mBuf);
707 S16 cmPkKwuFlowCntrlIndInfo
709 KwuFlowCntrlIndInfo *param,
713 S16 cmPkKwuFlowCntrlIndInfo(param, mBuf)
714 KwuFlowCntrlIndInfo *param;
719 CMCHKPK(oduUnpackUInt32, param->pktAdmitCnt, mBuf);
720 CMCHKPK(cmPkLteRlcId, ¶m->rlcId, mBuf);
723 } /* cmPkKwuFlowCntrlIndInfo */
726 S16 cmUnpkKwuFlowCntrlIndInfo
728 KwuFlowCntrlIndInfo *param,
732 S16 cmUnpkKwuFlowCntrlIndInfo(param, mBuf)
733 KwuFlowCntrlIndInfo *param;
738 CMCHKUNPK(cmUnpkLteRlcId, ¶m->rlcId, mBuf);
739 CMCHKUNPK(oduPackUInt32, ¶m->pktAdmitCnt, mBuf);
742 } /* cmUnpkKwuFlowCntrlIndInfo */
750 KwuStaIndInfo* staInd
753 S16 cmPkKwuStaInd(pst, suId, staInd)
756 KwuStaIndInfo* staInd;
760 #if (ERRCLASS & ERRCLS_ADD_RES)
769 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
773 switch(pst->selector)
775 case ODU_SELECTOR_LWLC:
777 CMCHKPK(oduPackPointer,(PTR) staInd, mBuf);
780 case ODU_SELECTOR_LC:
782 #if (ERRCLASS & ERRCLS_ADD_RES)
783 ret1 = cmPkKwuStaIndInfo( (staInd), mBuf);
787 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
788 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
789 (ErrVal)EKWU018, (ErrVal)ret1, "Packing failure");
793 cmPkKwuStaIndInfo( (staInd), mBuf);
794 #endif /* ERRCLASS & ERRCLS_ADD_RES */
795 if (SPutStaticBuffer(pst->region, pst->pool, (Data *)staInd,
796 sizeof(KwuStaIndInfo),SS_SHARABLE_MEMORY) != ROK)
805 #if (ERRCLASS & ERRCLS_ADD_RES)
806 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
807 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
808 (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
813 CMCHKPKLOG(SPkS16, suId, mBuf, EKWU019, pst);
814 pst->event = (Event) KWU_EVT_STA_IND;
816 return (SPstTsk(pst,mBuf));
817 } /* cmPkKwuStaInd */
821 S16 cmPkKwuReEstCmpInd
828 S16 cmPkKwuReEstCmpInd(pst, suId, rlcId)
835 #if (ERRCLASS & ERRCLS_ADD_RES)
844 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
848 switch(pst->selector)
851 case ODU_SELECTOR_LC:
853 #if (ERRCLASS & ERRCLS_ADD_RES)
854 ret1 = cmPkLteRlcId( &rlcId, mBuf);
858 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
859 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
860 (ErrVal)EKWU018, (ErrVal)ret1, "Packing failure");
864 cmPkLteRlcId( &rlcId, mBuf);
865 #endif /* ERRCLASS & ERRCLS_ADD_RES */
871 CMCHKPKLOG(SPkS16, suId, mBuf, EKWU019, pst);
872 pst->event = (Event) KWU_EVT_REEST_CMP_IND;
874 return (SPstTsk(pst,mBuf));
875 } /* cmPkKwuReEstCmpInd */
877 /* kwu_c_001.main_3 added support for L2 Measurement */
879 S16 cmPkKwuDiscSduCfm
883 KwuDiscSduInfo *discCfmSdu
886 S16 cmPkKwuDiscSduCfm(pst, spId, discCfmSdu)
889 KwuDiscSduInfo *discCfmSdu;
892 #if (ERRCLASS & ERRCLS_ADD_RES)
900 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
904 switch(pst->selector)
906 case ODU_SELECTOR_LWLC:
908 CMCHKPK(oduPackPointer,(PTR)discCfmSdu, mBuf);
911 case ODU_SELECTOR_LC:
913 #if (ERRCLASS & ERRCLS_ADD_RES)
914 ret1 = cmPkKwuDiscSduInfo((discCfmSdu), mBuf);
918 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
919 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
920 (ErrVal)ERRKWU, (ErrVal)ret1, "Packing failure");
924 cmPkKwuDiscSduInfo((discCfmSdu), mBuf);
925 #endif /* ERRCLASS & ERRCLS_ADD_RES */
926 if (SPutStaticBuffer(pst->region, pst->pool, (Data *)discCfmSdu,
927 sizeof(KwuDiscSduInfo),SS_SHARABLE_MEMORY) != ROK)
936 #if (ERRCLASS & ERRCLS_ADD_RES)
937 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
938 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
939 (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
944 CMCHKPKLOG(SPkS16, spId, mBuf, ERRKWU, pst);
945 pst->event = (Event) KWU_EVT_DISC_SDU_CFM;
947 return (SPstTsk(pst,mBuf));
948 } /* cmPkKwuDiscSduCfm */
951 S16 cmPkKwuFlowCntrlInd
955 KwuFlowCntrlIndInfo *flowCntrlIndInfo
958 S16 cmPkKwuFlowCntrlInd(pst, suId, flowCntrlIndInfo)
961 KwuFlowCntrlIndInfo *flowCntrlIndInfo;
969 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
971 SPutStaticBuffer(pst->region,
973 (Data *)flowCntrlIndInfo,
974 sizeof(KwuFlowCntrlIndInfo),0);
978 switch(pst->selector)
980 case ODU_SELECTOR_LC:
982 cmPkKwuFlowCntrlIndInfo((flowCntrlIndInfo), mBuf);
984 if (SPutStaticBuffer(pst->region,
986 (Data *)flowCntrlIndInfo,
987 sizeof(KwuFlowCntrlIndInfo),0) != ROK)
995 case ODU_SELECTOR_LWLC:
997 CMCHKPK(oduPackPointer,(PTR) flowCntrlIndInfo, mBuf);
1003 CMCHKPKLOG(SPkS16, suId, mBuf, ERRKWU, pst);
1004 pst->event = (Event) KWU_EVT_FLOW_CNTRL_IND;
1006 return (SPstTsk(pst,mBuf));
1007 } /* cmPkKwuFlowCntrlInd */
1011 S16 cmPkKwuDatAckInfo
1013 KwuDatAckInfo *param,
1017 S16 cmPkKwuDatAckInfo(param, mBuf)
1018 KwuDatAckInfo *param;
1023 CMCHKPK(cmPkLteRlcId, ¶m->rlcId, mBuf);
1024 CMCHKPK(oduUnpackUInt32, param->sduId, mBuf);
1029 S16 cmPkKwuDatAckInd
1033 KwuDatAckInfo* datInd
1036 S16 cmPkKwuDatAckInd(pst, suId, datInd)
1039 KwuDatAckInfo* datInd;
1049 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1053 ret1 = cmPkKwuDatAckInfo( (datInd), mBuf);
1054 #if (ERRCLASS & ERRCLS_ADD_RES)
1058 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1059 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1060 (ErrVal)ERRKWU, (ErrVal)ret1, "Packing failure");
1063 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1064 if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd,
1065 sizeof(KwuDatAckInfo),SS_SHARABLE_MEMORY) != ROK)
1071 CMCHKPKLOG(SPkS16, suId, mBuf, ERRKWU, pst);
1072 pst->event = (Event) KWU_EVT_DAT_ACK_IND;
1074 return (SPstTsk(pst,mBuf));
1075 } /* cmPkKwuDatAckInd */
1076 #endif /* LTE_L2_MEAS */
1087 S16 cmUnpkKwuBndReq(func, pst, mBuf)
1096 CMCHKUNPKLOG(SUnpkS16, &suId, mBuf, EKWU020, pst);
1097 CMCHKUNPKLOG(SUnpkS16, &spId, mBuf, EKWU021, pst);
1100 return ((*func)(pst, suId, spId));
1112 S16 cmUnpkKwuBndCfm(func, pst, mBuf)
1122 CMCHKUNPKLOG(SUnpkS16, &suId, mBuf, EKWU022, pst);
1123 CMCHKUNPKLOG(oduPackUInt8, &status, mBuf, EKWU023, pst);
1126 return ((*func)(pst, suId, status));
1131 S16 cmUnpkKwuUbndReq
1138 S16 cmUnpkKwuUbndReq(func, pst, mBuf)
1148 CMCHKUNPKLOG(SUnpkS16, &spId, mBuf, EKWU024, pst);
1149 CMCHKUNPKLOG(SUnpkS16, &reason, mBuf, EKWU025, pst);
1152 return ((*func)(pst, spId, reason));
1153 } /* cmUnpkKwuUbndReq */
1157 S16 cmUnpkKwuDatReqInfo
1159 KwuDatReqInfo *param,
1163 S16 cmUnpkKwuDatReqInfo(param, mBuf)
1164 KwuDatReqInfo *param;
1170 CMCHKUNPK(cmUnpkLteRlcId, ¶m->rlcId, mBuf);
1171 CMCHKUNPK(oduPackUInt32, ¶m->sduId, mBuf);
1174 CMCHKUNPK(cmUnpkLteLcType, ¶m->lcType, mBuf);
1175 switch(param->lcType) {
1176 case CM_LTE_LCH_BCCH:
1177 case CM_LTE_LCH_PCCH:
1179 CMCHKUNPK(oduPackUInt8,¶m->pnb , mBuf);
1180 CMCHKUNPK(oduPackUInt8,¶m->emtcDiReason , mBuf);
1182 CMCHKUNPK(cmUnpkLteTimingInfo, ¶m->tm.tmg, mBuf);
1185 case CM_LTE_LCH_CCCH:
1186 CMCHKUNPK(cmUnpkLteRnti, ¶m->tm.rnti, mBuf);
1188 case CM_LTE_LCH_DTCH:
1189 case CM_LTE_LCH_DCCH:
1207 S16 cmUnpkKwuDatReq(func, pst, mBuf)
1213 #if(ERRCLASS & ERRCLS_DEBUG)
1217 KwuDatReqInfo *datReq = NULLP;
1218 KwuDatReqInfo datReqTmp;
1221 switch(pst->selector)
1223 case ODU_SELECTOR_LWLC:
1225 CMCHKUNPK(oduUnpackPointer,(PTR *) &datReq, mBuf);
1228 case ODU_SELECTOR_LC:
1230 /* Allocate the memory statically as there is no free
1232 datReq = &datReqTmp;
1233 memset(datReq, 0, sizeof(KwuDatReqInfo));
1234 #if(ERRCLASS & ERRCLS_DEBUG)
1235 ret1 = cmUnpkKwuDatReqInfo( (datReq), mBuf);
1239 SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1240 __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1241 (ErrVal)EKWU027, (ErrVal)ret1, "Unpacking failure");
1245 cmUnpkKwuDatReqInfo( (datReq), mBuf);
1246 #endif /* ERRCLASS & ERRCLS_DEBUG */
1251 #if (ERRCLASS & ERRCLS_ADD_RES)
1252 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1253 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1254 (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
1259 retVal = (*func)(pst, datReq, mBuf);
1260 /* If LWLC is configured, we need to
1261 * free the memory here. */
1262 if(pst->selector == ODU_SELECTOR_LWLC)
1264 retVal = SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq,
1265 sizeof(KwuDatReqInfo),SS_SHARABLE_MEMORY);
1268 } /* cmUnpkKwuDatReq */
1272 uint8_t cmUnpkKwuDatIndInfo
1274 KwuDatIndInfo *param,
1278 uint8_t cmUnpkKwuDatIndInfo(param, mBuf)
1279 KwuDatIndInfo *param;
1284 CMCHKUNPK(cmUnpkLteRlcId, ¶m->rlcId, mBuf);
1287 CMCHKUNPK(cmUnpkLteRnti, ¶m->tCrnti, mBuf);
1289 CMCHKUNPK(oduPackUInt8, ¶m->isOutOfSeq, mBuf);
1295 uint8_t cmUnpkKwuDatInd
1302 uint8_t cmUnpkKwuDatInd(func, pst, mBuf)
1308 S16 ret1 = ROK, retVal;
1309 KwuDatIndInfo *datInd = NULLP;
1310 KwuDatIndInfo datIndTmp;
1313 switch(pst->selector)
1315 case ODU_SELECTOR_LWLC:
1317 CMCHKUNPK(oduUnpackPointer,(PTR *) &datInd, mBuf);
1320 case ODU_SELECTOR_LC:
1322 /*SGetStaticBuffer used as RRC has an equivalent free but PDCP
1323 * doesn't free any memory */
1324 if(pst->dstEnt != ENTPJ)
1326 if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datInd,
1327 sizeof(KwuDatIndInfo),SS_SHARABLE_MEMORY)) != ROK)
1329 #if (ERRCLASS & ERRCLS_ADD_RES)
1332 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1333 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1334 (ErrVal)EKWU028, (ErrVal)0, "SGetMsg() failed");
1336 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1342 datInd = &datIndTmp;
1345 ret1 = cmUnpkKwuDatIndInfo( (datInd), mBuf);
1346 #if(ERRCLASS & ERRCLS_DEBUG)
1350 SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1351 __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1352 (ErrVal)EKWU029, (ErrVal)ret1, "Unpacking failure");
1355 #endif /* ERRCLASS & ERRCLS_DEBUG */
1360 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1361 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1362 (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
1365 retVal = (*func)(pst, datInd, mBuf);
1366 /* If LWLC is configured and the destination entity is PDCP, we need to
1367 * free the memory here. */
1368 if((pst->selector == ODU_SELECTOR_LWLC) && (pst->dstEnt == ENTPJ))
1370 retVal = SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd,
1371 sizeof(KwuDatIndInfo),SS_SHARABLE_MEMORY);
1374 } /* cmUnpkKwuDatInd */
1378 S16 cmUnpkKwuDatCfmInfo
1380 KwuDatCfmInfo *param,
1384 S16 cmUnpkKwuDatCfmInfo(param, mBuf)
1385 KwuDatCfmInfo *param;
1391 CMCHKUNPK(cmUnpkLteRlcId, ¶m->rlcId, mBuf);
1392 CMCHKUNPK(oduPackUInt32, ¶m->numSduIds, mBuf);
1394 #ifdef L2_L3_SPLIT /*Work Around */
1395 if (param->numSduIds >= KWU_MAX_DAT_CFM)
1396 param->numSduIds = KWU_MAX_DAT_CFM;
1398 for(iter = param->numSduIds -1; iter >= 0 ; iter--)
1400 CMCHKUNPK(oduPackUInt32, ¶m->sduIds[iter], mBuf);
1413 S16 cmUnpkKwuDatCfm(func, pst, mBuf)
1421 KwuDatCfmInfo *datCfm = NULLP;
1424 CMCHKUNPK(SUnpkS16, &(suId), mBuf);
1426 switch(pst->selector)
1428 case ODU_SELECTOR_LWLC:
1430 CMCHKUNPK(oduUnpackPointer,(PTR *) &datCfm, mBuf);
1433 case ODU_SELECTOR_LC:
1435 if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datCfm,\
1436 sizeof(KwuDatCfmInfo),SS_SHARABLE_MEMORY)) != ROK)
1438 #if (ERRCLASS & ERRCLS_ADD_RES)
1441 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1442 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1443 (ErrVal)EKWU030, (ErrVal)0, "SGetMsg() failed");
1445 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1449 memset(datCfm, 0, sizeof(KwuDatCfmInfo));
1450 ret1 = cmUnpkKwuDatCfmInfo( (datCfm), mBuf);
1451 #if(ERRCLASS & ERRCLS_DEBUG)
1455 SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1456 __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1457 (ErrVal)EKWU031, (ErrVal)ret1, "Unpacking failure");
1460 #endif /* ERRCLASS & ERRCLS_DEBUG */
1464 #if (ERRCLASS & ERRCLS_ADD_RES)
1465 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1466 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1467 (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
1475 return ((*func)(pst, suId, datCfm));
1476 } /* cmUnpkKwuDatCfm */
1480 S16 cmUnpkKwuDiscSduReq
1487 S16 cmUnpkKwuDiscSduReq(func, pst, mBuf)
1495 KwuDiscSduInfo *discSdu = NULLP;
1498 CMCHKUNPK(SUnpkS16, &(spId), mBuf);
1499 switch(pst->selector)
1501 case ODU_SELECTOR_LWLC:
1503 CMCHKUNPK(oduUnpackPointer,(PTR *) &discSdu, mBuf);
1506 case ODU_SELECTOR_LC:
1508 if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&discSdu,\
1509 sizeof(KwuDiscSduInfo),SS_SHARABLE_MEMORY)) != ROK)
1511 #if (ERRCLASS & ERRCLS_ADD_RES)
1513 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1514 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1515 (ErrVal)EKWU032, (ErrVal)0, "SGetMsg() failed");
1517 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1521 memset(discSdu, 0, sizeof(KwuDiscSduInfo));
1522 ret1 = cmUnpkKwuDiscSduInfo( (discSdu), mBuf);
1523 #if(ERRCLASS & ERRCLS_DEBUG)
1527 SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1528 __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1529 (ErrVal)EKWU033, (ErrVal)ret1, "Unpacking failure");
1532 #endif /* ERRCLASS & ERRCLS_DEBUG */
1536 #if (ERRCLASS & ERRCLS_ADD_RES)
1537 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1538 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1539 (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
1546 return ((*func)(pst, spId, discSdu));
1547 } /* cmUnpkKwuDiscSduReq */
1551 S16 cmUnpkKwuStaIndInfo
1553 KwuStaIndInfo *param,
1557 S16 cmUnpkKwuStaIndInfo(param, mBuf)
1558 KwuStaIndInfo *param;
1565 CMCHKUNPK(cmUnpkLteRlcId, ¶m->rlcId, mBuf);
1566 CMCHKUNPK(oduPackUInt32, ¶m->numSdu, mBuf);
1567 for (i = 0; i < param->numSdu; i++)
1569 CMCHKUNPK(oduPackUInt32, ¶m->sduId[i], mBuf);
1573 } /* cmUnpkKwuStaIndInfo */
1584 S16 cmUnpkKwuStaInd(func, pst, mBuf)
1592 KwuStaIndInfo *staInd = NULLP;
1595 CMCHKUNPK(SUnpkS16, &(suId), mBuf);
1597 switch(pst->selector)
1599 case ODU_SELECTOR_LWLC:
1601 CMCHKUNPK(oduUnpackPointer,(PTR *)&staInd, mBuf);
1604 case ODU_SELECTOR_LC:
1606 if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&staInd,\
1607 sizeof(KwuStaIndInfo),SS_SHARABLE_MEMORY)) != ROK)
1609 #if (ERRCLASS & ERRCLS_ADD_RES)
1612 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1613 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1614 (ErrVal)EKWU034, (ErrVal)0, "SGetMsg() failed");
1616 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1620 memset(staInd, 0, sizeof(KwuStaIndInfo));
1622 ret1 = cmUnpkKwuStaIndInfo( (staInd), mBuf);
1623 #if(ERRCLASS & ERRCLS_DEBUG)
1627 SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1628 __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1629 (ErrVal)EKWU035, (ErrVal)ret1, "Unpacking failure");
1632 #endif /* ERRCLASS & ERRCLS_DEBUG */
1637 #if(ERRCLASS & ERRCLS_DEBUG)
1638 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1639 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1640 (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
1646 return ((*func)(pst, suId, staInd));
1647 } /* cmUnpkKwuStaInd */
1651 S16 cmUnpkKwuReEstCmpInd
1653 KwuReEstCmpInd func,
1658 S16 cmUnpkKwuReEstCmpInd(func, pst, mBuf)
1659 KwuReEstCmpInd func;
1664 #if(ERRCLASS & ERRCLS_DEBUG)
1670 memset(&rlcId, 0, sizeof(CmLteRlcId));
1671 CMCHKUNPK(SUnpkS16, &(suId), mBuf);
1672 switch(pst->selector)
1675 case ODU_SELECTOR_LC:
1677 #if(ERRCLASS & ERRCLS_DEBUG)
1678 ret1 = cmUnpkLteRlcId( &rlcId, mBuf);
1682 SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1683 __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1684 (ErrVal)EKWU035, (ErrVal)ret1, "Unpacking failure");
1688 cmUnpkLteRlcId( &rlcId, mBuf);
1689 #endif /* ERRCLASS & ERRCLS_DEBUG */
1696 return ((*func)(pst, suId, rlcId));
1697 } /* cmUnpkKwuReEstCmpInd */
1699 /* kwu_c_001.main_3 added support for L2 Measurement */
1701 S16 cmUnpkKwuDiscSduCfm
1708 S16 cmUnpkKwuDiscSduCfm(func, pst, mBuf)
1716 KwuDiscSduInfo *discSdu = NULLP;
1719 CMCHKUNPK(SUnpkS16, &(spId), mBuf);
1721 switch(pst->selector)
1723 case ODU_SELECTOR_LWLC:
1725 CMCHKUNPK(oduUnpackPointer,(PTR *) &discSdu, mBuf);
1728 case ODU_SELECTOR_LC:
1730 if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&discSdu,\
1731 sizeof(KwuDiscSduInfo),SS_SHARABLE_MEMORY)) != ROK)
1733 #if (ERRCLASS & ERRCLS_ADD_RES)
1736 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1737 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1738 (ErrVal)ERRKWU, (ErrVal)0, "SGetMsg() failed");
1740 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1743 memset(discSdu, 0, sizeof(KwuDiscSduInfo));
1745 ret1 = cmUnpkKwuDiscSduInfo( (discSdu), mBuf);
1746 #if(ERRCLASS & ERRCLS_DEBUG)
1750 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1751 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1752 (ErrVal)ERRKWU, (ErrVal)0, "SGetMsg() failed");
1754 #endif /* ERRCLASS & ERRCLS_DEBUG */
1759 #if(ERRCLASS & ERRCLS_DEBUG)
1760 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1761 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1762 (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
1768 return ((*func)(pst, spId, discSdu));
1769 } /* cmUnpkKwuDiscSduCfm */
1771 S16 cmUnpkKwuFlowCntrlInd
1773 KwuFlowCntrlInd func,
1778 S16 cmUnpkKwuFlowCntrlInd(func, pst, mBuf)
1779 KwuFlowCntrlInd func;
1785 KwuFlowCntrlIndInfo *flowCntrlInfo = NULLP;
1788 CMCHKUNPK(SUnpkS16, &(suId), mBuf);
1789 switch(pst->selector)
1792 case ODU_SELECTOR_LC:
1794 if(SGetStaticBuffer(pst->region,
1796 (Data **)&flowCntrlInfo,
1797 sizeof(KwuFlowCntrlIndInfo),0) != ROK)
1803 cmUnpkKwuFlowCntrlIndInfo(flowCntrlInfo, mBuf);
1807 case ODU_SELECTOR_LWLC:
1809 CMCHKUNPK(oduUnpackPointer,(PTR *) &flowCntrlInfo, mBuf);
1817 return ((*func)(pst, suId, flowCntrlInfo));
1818 } /* cmUnpkKwuFlowCntrlInd */
1822 S16 cmUnpkKwuDatAckInfo
1824 KwuDatAckInfo *param,
1828 S16 cmUnpkKwuDatAckInfo(param, mBuf)
1829 KwuDatAckInfo *param;
1834 CMCHKUNPK(oduPackUInt32, ¶m->sduId, mBuf);
1835 CMCHKUNPK(cmUnpkLteRlcId, ¶m->rlcId, mBuf);
1842 S16 cmUnpkKwuDatAckInd
1849 S16 cmUnpkKwuDatAckInd(func, pst, mBuf)
1857 KwuDatAckInfo *datInd = NULLP;
1860 if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datInd,\
1861 sizeof(KwuDatAckInfo),SS_SHARABLE_MEMORY)) != ROK)
1863 #if (ERRCLASS & ERRCLS_ADD_RES)
1866 SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1867 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1868 (ErrVal)ERRKWU, (ErrVal)0, "SGetMsg() failed");
1870 #endif /* ERRCLASS & ERRCLS_ADD_RES */
1874 memset(datInd, 0, sizeof(KwuDatAckInfo));
1876 CMCHKUNPK(SUnpkS16, &(suId), mBuf);
1877 ret1 = cmUnpkKwuDatAckInfo( (datInd), mBuf);
1878 #if(ERRCLASS & ERRCLS_DEBUG)
1882 SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
1883 __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
1884 (ErrVal)ERRKWU, (ErrVal)ret1, "Unpacking failure");
1887 #endif /* ERRCLASS & ERRCLS_DEBUG */
1889 return ((*func)(pst, suId, datInd));
1890 } /* cmUnpkKwuDatAckInd */
1891 #endif /* LTE_L2_MEAS */
1894 /**********************************************************************
1896 **********************************************************************/