1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /************************************************************************
25 Desc: C source code for packing/unpacking of INF interface
30 **********************************************************************/
32 /* header include files (.h) */
33 #include "common_def.h"
34 #include "tfu.h" /* RGU defines */
38 #include "rg_sch_inf.h" /* RGU Interface defines */
40 /* header/extern include files (.x) */
41 #include "tfu.x" /* RGU defines */
45 #include "rg_sch_inf.x" /* RGU Interface includes */
48 /*Fix: start: Inform UE delete to scheduler*/
50 * @brief This primitive is used to indicate to scheduler
51 * that UE has been deleted at MAC.
55 * Function : cmPkMacSchUeDelInd
58 * @param[in] RgInfUeDelInd* ueDelInd
62 S16 cmPkMacSchUeDelInd(Pst* pst,RgInfUeDelInd* ueDelInd)
65 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
70 #ifdef MS_MBUF_CORRUPTION
71 MS_BUF_ADD_ALLOC_CALLER();
73 if(SAddPstMsgMult((Data *)ueDelInd, sizeof(RgInfUeDelInd), mBuf) != ROK)
75 RGSCHINF_FREE_MSG(mBuf);
79 pst->event = (Event) EVTINFUEDELIND;
80 return (SPstTsk(pst,mBuf));
84 * @brief This primitive is used to indicate to scheduler
85 * that UE has been deleted at MAC.
90 * Function : cmUnpkMacSchUeDelInd
93 * @param[in] SpId spId
94 * @param[in] RguDDatReqInfo * datReq
98 S16 cmUnpkMacSchUeDelInd(UeDelInd func,Pst *pst,Buffer *mBuf)
100 RgInfUeDelInd ueDelInd;
102 if(SRemPreMsgMult((Data *)&ueDelInd, sizeof(RgInfUeDelInd), mBuf) != ROK)
104 RGSCHINF_FREE_MSG(mBuf);
108 RGSCHINF_FREE_MSG(mBuf);
110 return ((*func)(pst, &ueDelInd));
112 /*Fix: end: Inform UE delete to scheduler*/
115 * @brief Request from RLC to MAC for forwarding SDUs on
116 * dedicated channel for transmission.
120 * Function : cmPkMacSchDedBoUpdtReq
122 * @param[in] Pst* pst
123 * @param[in] SpId spId
124 * @param[in] RguDDatReqInfo * datReq
128 S16 cmPkMacSchDedBoUpdtReq(Pst* pst,RgInfDedBoRpt* boRpt)
130 Buffer *mBuf = NULLP;
132 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
136 #ifdef MS_MBUF_CORRUPTION
137 MS_BUF_ADD_ALLOC_CALLER();
139 if(SAddPstMsgMult((Data *)boRpt, sizeof(RgInfDedBoRpt), mBuf) != ROK)
141 RGSCHINF_FREE_MSG(mBuf);
145 pst->event = (Event) EVTINFDEDBOUPDTREQ;
146 return (SPstTsk(pst,mBuf));
151 * @brief Request from RLC to MAC for forwarding SDUs on
152 * dedicated channel for transmission.
156 * Function : cmUnpkMacSchDedBoUpdtReq
158 * @param[in] Pst* pst
159 * @param[in] SpId spId
160 * @param[in] RguDDatReqInfo * datReq
164 S16 cmUnpkMacSchDedBoUpdtReq(DedBoUpdtReq func,Pst *pst,Buffer *mBuf)
168 if(SRemPreMsgMult((Data *)&boRpt, sizeof(RgInfDedBoRpt), mBuf) != ROK)
170 RGSCHINF_FREE_MSG(mBuf);
174 RGSCHINF_FREE_MSG(mBuf);
175 return ((*func)(pst, &boRpt));
178 * @brief Request from RLC to MAC for forwarding SDUs on
179 * dedicated channel for transmission.
183 * Function : cmPkMacSchCmnBoUpdtReq
185 * @param[in] Pst* pst
186 * @param[in] SpId spId
187 * @param[in] RguDDatReqInfo * datReq
191 S16 cmPkMacSchCmnBoUpdtReq(Pst* pst,RgInfCmnBoRpt* boRpt)
193 Buffer *mBuf = NULLP;
195 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
199 #ifdef MS_MBUF_CORRUPTION
200 MS_BUF_ADD_ALLOC_CALLER();
202 if(SAddPstMsgMult((Data *)boRpt, sizeof(RgInfCmnBoRpt), mBuf) != ROK)
204 RGSCHINF_FREE_MSG(mBuf);
208 pst->event = (Event) EVTINFCMNBOUPDTREQ;
209 return (SPstTsk(pst,mBuf));
214 * @brief Request from RLC to MAC for forwarding SDUs on
215 * dedicated channel for transmission.
219 * Function : cmUnpkMacSchCmnBoUpdtReq
221 * @param[in] Pst* pst
222 * @param[in] SpId spId
223 * @param[in] RguDDatReqInfo * datReq
227 S16 cmUnpkMacSchCmnBoUpdtReq(CmnBoUpdtReq func,Pst *pst,Buffer *mBuf)
231 if(SRemPreMsgMult((Data *)&boRpt, sizeof(RgInfCmnBoRpt), mBuf) != ROK)
233 RGSCHINF_FREE_MSG(mBuf);
237 RGSCHINF_FREE_MSG(mBuf);
238 return ((*func)(pst, &boRpt));
241 * @brief Request from RLC to MAC for forwarding SDUs on
242 * dedicated channel for transmission.
246 * Function : cmPkMacSchSfRecpInd
248 * @param[in] Pst* pst
249 * @param[in] SpId spId
250 * @param[in] RguDDatReqInfo * datReq
254 S16 cmPkMacSchSfRecpInd(Pst* pst,RgInfSfDatInd* datInd)
256 Buffer *mBuf = NULLP;
258 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
262 if(oduPackPointer((PTR)datInd, mBuf) != ROK)
264 RGSCHINF_FREE_MSG(mBuf);
268 pst->event = (Event) EVTINFSFRECPIND;
269 return (SPstTsk(pst,mBuf));
274 * @brief Request from RLC to MAC for forwarding SDUs on
275 * dedicated channel for transmission.
279 * Function : cmUnpkMacSchSfRecpInd
281 * @param[in] Pst* pst
282 * @param[in] SpId spId
283 * @param[in] RguDDatReqInfo * datReq
287 S16 cmUnpkMacSchSfRecpInd(SfRecpInd func,Pst *pst,Buffer *mBuf)
289 RgInfSfDatInd* datInd;
291 if(oduUnpackPointer((PTR *)&datInd, mBuf) != ROK)
293 RGSCHINF_FREE_MSG(mBuf);
297 RGSCHINF_FREE_MSG(mBuf);
298 /* Call cmFreeMem(datInd) in scheduler */
299 return ((*func)(pst, datInd));
304 * @brief Primitive from MAC to SCH to indicate release of UL SPS for a UE
308 * Function : cmPkMacSchSpsRelInd
310 * @param[in] Pst* pst
311 * @param[in] RgInfSpsRelInfo* relInfo
315 S16 cmPkMacSchSpsRelInd(Pst* pst,RgInfSpsRelInfo* relInfo)
317 Buffer *mBuf = NULLP;
319 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
323 if(oduPackPointer((PTR)relInfo, mBuf) != ROK)
325 RGSCHINF_FREE_MSG(mBuf);
329 pst->event = (Event) EVTINFSPSRELIND;
330 return (SPstTsk(pst,mBuf));
331 } /* end of cmPkMacSchSpsRelInd */
334 * @brief Primitive from MAC to SCH to indicate release of UL SPS for a UE
338 * Function : cmUnpkMacSchSpsRelInd
340 * @param[in] SpsRelInd func
341 * @param[in] Pst* pst
342 * @param[in] Buffer *mBuf
346 S16 cmUnpkMacSchSpsRelInd(SpsRelInd func,Pst *pst,Buffer *mBuf)
348 RgInfSpsRelInfo *relInfo;
350 if(oduUnpackPointer((PTR *)&relInfo, mBuf) != ROK)
352 RGSCHINF_FREE_MSG(mBuf);
356 RGSCHINF_FREE_MSG(mBuf);
357 return ((*func)(pst, relInfo));
358 } /* end of cmUnpkMacSchSpsRelInd */
359 #endif /* LTEMAC_SPS */
364 * @brief Request from RLC to MAC for forwarding SDUs on
365 * dedicated channel for transmission.
369 * Function : cmPkSchMacSfAllocReq
371 * @param[in] Pst* pst
372 * @param[in] SpId spId
373 * @param[in] RguDDatReqInfo * datReq
377 S16 cmPkSchMacSfAllocReq(Pst* pst,RgInfSfAlloc* resAllocReq)
379 Buffer *mBuf = NULLP;
381 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
385 if(oduPackPointer((PTR)resAllocReq, mBuf) != ROK)
387 RGSCHINF_FREE_MSG(mBuf);
391 pst->event = (Event) EVTINFSFALLOCREQ;
392 return (SPstTsk(pst,mBuf));
397 * @brief Request from RLC to MAC for forwarding SDUs on
398 * dedicated channel for transmission.
402 * Function : cmUnpkSchMacSfAllocReq
404 * @param[in] Pst* pst
405 * @param[in] SpId spId
406 * @param[in] RguDDatReqInfo * datReq
410 S16 cmUnpkSchMacSfAllocReq(SfAllocReq func,Pst *pst,Buffer *mBuf)
412 RgInfSfAlloc* resAllocReq;
414 if(oduUnpackPointer((PTR *)&resAllocReq, mBuf) != ROK)
416 RGSCHINF_FREE_MSG(mBuf);
420 RGSCHINF_FREE_MSG(mBuf);
421 return ((*func)(pst, resAllocReq));
424 * @brief Request from SCH To MAC for harq entity reset
428 * Function : cmPkSchMacRstHqEntReq
430 * @param[in] Pst* pst
431 * @param[in] RgInfResetHqEnt *hqEntInfo
435 S16 cmPkSchMacRstHqEntReq(Pst* pst,RgInfResetHqEnt* hqEntInfo)
437 Buffer *mBuf = NULLP;
439 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
443 if(oduPackPointer((PTR)hqEntInfo, mBuf) != ROK)
445 RGSCHINF_FREE_MSG(mBuf);
449 pst->event = (Event) EVTINFHQENTRESET;
450 return (SPstTsk(pst,mBuf));
454 * @brief Request from SCH to MAC for resetting the harqentity
458 * Function : cmUnpkSchMacRstHqEntReq
460 * @param[in] Pst* pst
461 * @param[in] RgInfResetHqEnt *hqEntInfo
465 S16 cmUnpkSchMacRstHqEntReq(RstHqEntReq func,Pst *pst,Buffer *mBuf)
467 RgInfResetHqEnt* hqEntRstInfo;
469 if(oduUnpackPointer((PTR *)&hqEntRstInfo, mBuf) != ROK)
471 RGSCHINF_FREE_MSG(mBuf);
475 RGSCHINF_FREE_MSG(mBuf);
476 return ((*func)(pst, hqEntRstInfo));
480 * @brief Request from RLC to MAC for forwarding SDUs on
481 * dedicated channel for transmission.
485 * Function : cmPkSchMacRlsHqReq
487 * @param[in] Pst* pst
488 * @param[in] SpId spId
489 * @param[in] RguDDatReqInfo * datReq
493 S16 cmPkSchMacRlsHqReq(Pst* pst,RgInfRlsHqInfo* sfHqInfo)
495 Buffer *mBuf = NULLP;
497 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
501 if(oduPackPointer((PTR)sfHqInfo, mBuf) != ROK)
503 RGSCHINF_FREE_MSG(mBuf);
507 pst->event = (Event) EVTINFRLSHQREQ;
508 return (SPstTsk(pst,mBuf));
512 * @brief Request from RLC to MAC for forwarding SDUs on
513 * dedicated channel for transmission.
517 * Function : cmUnpkSchMacRlsHqReq
519 * @param[in] Pst* pst
520 * @param[in] SpId spId
521 * @param[in] RguDDatReqInfo * datReq
525 S16 cmUnpkSchMacRlsHqReq(RlsHqReq func,Pst *pst,Buffer *mBuf)
527 RgInfRlsHqInfo* sfHqInfo;
529 if(oduUnpackPointer((PTR *)&sfHqInfo, mBuf) != ROK)
531 RGSCHINF_FREE_MSG(mBuf);
535 RGSCHINF_FREE_MSG(mBuf);
536 return ((*func)(pst, sfHqInfo));
539 * @brief Request from RLC to MAC for forwarding SDUs on
540 * dedicated channel for transmission.
544 * Function : cmPkSchMacRlsRntiReq
546 * @param[in] Pst* pst
547 * @param[in] SpId spId
548 * @param[in] RguDDatReqInfo * datReq
552 S16 cmPkSchMacRlsRntiReq(Pst* pst,RgInfRlsRnti* rlsRnti)
554 Buffer *mBuf = NULLP;
556 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
560 #ifdef MS_MBUF_CORRUPTION
561 MS_BUF_ADD_ALLOC_CALLER();
563 if(SAddPstMsgMult((Data *)rlsRnti, sizeof(RgInfRlsRnti), mBuf) != ROK)
565 RGSCHINF_FREE_MSG(mBuf);
569 pst->event = (Event) EVTINFRLSRNTIREQ;
570 return (SPstTsk(pst,mBuf));
574 * @brief Request from RLC to MAC for forwarding SDUs on
575 * dedicated channel for transmission.
579 * Function : cmUnpkSchMacRlsRntiReq
581 * @param[in] Pst* pst
582 * @param[in] SpId spId
583 * @param[in] RguDDatReqInfo * datReq
587 S16 cmUnpkSchMacRlsRntiReq(RlsRntiReq func,Pst *pst,Buffer *mBuf)
589 RgInfRlsRnti rlsRnti;
591 if(SRemPreMsgMult((Data *)&rlsRnti, sizeof(RgInfRlsRnti), mBuf) != ROK)
593 RGSCHINF_FREE_MSG(mBuf);
597 RGSCHINF_FREE_MSG(mBuf);
598 return ((*func)(pst, &rlsRnti));
602 * @brief Request from RLC to MAC for forwarding SDUs on
603 * dedicated channel for transmission.
607 * Function : cmPkSchMacCellRegReq
609 * @param[in] Pst* pst
610 * @param[in] SpId spId
611 * @param[in] RguDDatReqInfo * datReq
615 S16 cmPkSchMacCellRegReq(Pst* pst,RgInfCellReg* regReq)
617 Buffer *mBuf = NULLP;
619 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
623 #ifdef MS_MBUF_CORRUPTION
624 MS_BUF_ADD_ALLOC_CALLER();
626 if(SAddPstMsgMult((Data *)regReq, sizeof(RgInfCellReg), mBuf) != ROK)
628 RGSCHINF_FREE_MSG(mBuf);
632 pst->event = (Event) EVTINFCELLREGREQ;
633 return (SPstTsk(pst,mBuf));
637 * @brief Request from RLC to MAC for forwarding SDUs on
638 * dedicated channel for transmission.
642 * Function : cmUnpkSchMacCellRegReq
644 * @param[in] Pst* pst
645 * @param[in] SpId spId
646 * @param[in] RguDDatReqInfo * datReq
650 S16 cmUnpkSchMacCellRegReq(CellRegReq func,Pst *pst,Buffer *mBuf)
654 if(SRemPreMsgMult((Data *)®Req, sizeof(RgInfCellReg), mBuf) != ROK)
656 RGSCHINF_FREE_MSG(mBuf);
660 RGSCHINF_FREE_MSG(mBuf);
661 return ((*func)(pst, ®Req));
665 * @brief Primitive from SCH to MAC to register GBR LCG per UE
669 * Function : cmPkSchMacLcgRegReq
671 * @param[in] Pst* pst
672 * @param[in] RgInfLcgRegReq *lcgRegReq
676 S16 cmPkSchMacLcgRegReq(Pst* pst,RgInfLcgRegReq *lcgRegReq)
678 Buffer *mBuf = NULLP;
680 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
684 if(SAddPstMsgMult((Data *)lcgRegReq, sizeof(RgInfLcgRegReq), mBuf) != ROK)
686 RGSCHINF_FREE_MSG(mBuf);
690 pst->event = (Event) EVTINFLCGREG;
691 return (SPstTsk(pst,mBuf));
692 } /* end of cmPkSchMacLcgRegReq */
695 * @brief Primitive from SCH to MAC to register GBR LCG
699 * Function : cmUnpkSchMacLcgRegReq
701 * @param[in] LcgReg func
702 * @param[in] Pst* pst
703 * @param[in] Buffer *mBuf
707 S16 cmUnpkSchMacLcgRegReq(LcgReg func,Pst *pst,Buffer *mBuf)
709 RgInfLcgRegReq *lcgRegReq;
711 if(oduUnpackPointer((PTR *)&lcgRegReq, mBuf) != ROK)
713 RGSCHINF_FREE_MSG(mBuf);
717 RGSCHINF_FREE_MSG(mBuf);
718 return ((*func)(pst, lcgRegReq));
719 } /* end of cmUnpkSchMacLcgRegReq */
724 * @brief Primitive from SCH to MAC to register the set of SPS LCs per UE
728 * Function : cmPkSchMacSpsLcRegReq
730 * @param[in] Pst* pst
731 * @param[in] RgInfSpsLcInfo *lcInfo
735 S16 cmPkSchMacSpsLcRegReq(Pst* pst,RgInfSpsLcInfo *lcInfo)
737 Buffer *mBuf = NULLP;
739 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
743 if(oduPackPointer((PTR)lcInfo, mBuf) != ROK)
745 RGSCHINF_FREE_MSG(mBuf);
749 pst->event = (Event) EVTINFSPSLCREG;
750 return (SPstTsk(pst,mBuf));
751 } /* end of cmPkSchMacSpsLcRegReq */
754 * @brief Primitive from SCH to MAC to reset SPS Params for the UE
758 * Function : cmPkSchMacUlSpsResetReq
760 * @param[in] Pst* pst
761 * @param[in] RgInfUlSpsReset *ulSpsResetInfo
765 S16 cmPkSchMacUlSpsResetReq(Pst* pst,RgInfUlSpsReset *ulSpsResetInfo)
767 Buffer *mBuf = NULLP;
769 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
773 if(oduPackPointer((PTR)ulSpsResetInfo, mBuf) != ROK)
775 RGSCHINF_FREE_MSG(mBuf);
779 pst->event = (Event) EVTINFSPSRESET;
780 return (SPstTsk(pst,mBuf));
781 } /* end of cmPkSchMacUlSpsResetReq */
784 * @brief Primitive from SCH to MAC to register the set of SPS LCs per UE
788 * Function : cmUnpkSchMacSpsLcRegReq
790 * @param[in] SpsLcReg func
791 * @param[in] Pst* pst
792 * @param[in] Buffer *mBuf
796 S16 cmUnpkSchMacSpsLcRegReq(SpsLcReg func,Pst *pst,Buffer *mBuf)
798 RgInfSpsLcInfo *lcInfo;
800 if(oduUnpackPointer((PTR *)&lcInfo, mBuf) != ROK)
802 RGSCHINF_FREE_MSG(mBuf);
806 RGSCHINF_FREE_MSG(mBuf);
807 return ((*func)(pst, lcInfo));
808 } /* end of cmUnpkSchMacSpsLcRegReq */
813 * @brief Primitive from SCH to MAC to reset UL SPS params
817 * Function : cmUnpkSchMacUlSpsResetReq
819 * @param[in] UlSpsReset func
820 * @param[in] Pst* pst
821 * @param[in] Buffer *mBuf
825 S16 cmUnpkSchMacUlSpsResetReq(UlSpsReset func,Pst *pst,Buffer *mBuf)
827 RgInfUlSpsReset *ulSpsResetInfo;
829 if(oduUnpackPointer((PTR *)&ulSpsResetInfo, mBuf) != ROK)
831 RGSCHINF_FREE_MSG(mBuf);
835 RGSCHINF_FREE_MSG(mBuf);
836 return ((*func)(pst, ulSpsResetInfo));
837 } /* end of cmUnpkSchMacUlSpsResetReq */
842 * @brief Primitive from SCH to MAC to deregister the set of SPS LCs per UE
846 * Function : cmPkSchMacSpsLcDeregReq
848 * @param[in] Pst* pst
849 * @param[in] CmLteCellId cellId,
850 * @param[in] CmLteRnti crnti
854 S16 cmPkSchMacSpsLcDeregReq(Pst* pst,CmLteCellId cellId,CmLteRnti crnti)
856 Buffer *mBuf = NULLP;
858 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
862 CMCHKPK(cmPkLteCellId, cellId, mBuf);
863 CMCHKPK(cmPkLteRnti, crnti, mBuf);
865 pst->event = (Event) EVTINFSPSLCDEREG;
866 return (SPstTsk(pst,mBuf));
867 } /* end of cmPkSchMacSpsLcDeregReq */
870 * @brief Primitive from SCH to MAC to deregister the set of SPS LCs per UE
874 * Function : cmUnpkSchMacSpsLcDeregReq
876 * @param[in] SpsLcDereg func
877 * @param[in] Pst* pst
878 * @param[in] Buffer *mBuf
882 S16 cmUnpkSchMacSpsLcDeregReq(SpsLcDereg func,Pst *pst, Buffer *mBuf)
887 CMCHKUNPK(cmUnpkLteRnti, &crnti, mBuf);
888 CMCHKUNPK(cmUnpkLteCellId, &cellId, mBuf);
890 RGSCHINF_FREE_MSG(mBuf);
891 return ((*func)(pst, cellId, crnti));
892 } /* end of cmUnpkSchMacSpsLcDeregReq */
894 #endif /* LTEMAC_SPS */
898 * @brief Primitive from SCH to MAC for L2 Measurement
902 * Function : cmPkSchMacL2MeasReq
904 * @param[in] Pst* pst
905 * @param[in] RgInfSpsLcInfo *lcInfo
909 S16 cmPkSchMacL2MeasReq(Pst* pst,RgInfL2MeasReq *measInfo)
911 Buffer *mBuf = NULLP;
913 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
916 if(SAddPstMsgMult((Data *)measInfo, sizeof(RgInfL2MeasReq), mBuf) != ROK)
918 RGSCHINF_FREE_MSG(mBuf);
922 pst->event = (Event) EVTINFL2MEASREQ;
923 return (SPstTsk(pst,mBuf));
924 } /* end of cmPkSchMacL2MeasReq */
927 * @brief Primitive from SCH to MAC for L2 Stop Measurement
931 * Function : cmPkSchMacL2MeasStopReq
933 * @param[in] Pst* pst
934 * @param[in] RgInfSpsLcInfo *lcInfo
938 S16 cmPkSchMacL2MeasStopReq(Pst* pst,RgInfL2MeasStopReq *measInfo)
940 Buffer *mBuf = NULLP;
942 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
945 if(SAddPstMsgMult((Data *)measInfo, sizeof(RgInfL2MeasStopReq), mBuf) != ROK)
947 ODU_PUT_MSG_BUF(mBuf);
951 pst->event = (Event) EVTINFL2MEASSTOPREQ;
952 return (SPstTsk(pst,mBuf));
953 } /* end of cmPkSchMacL2MeasStopReq */
955 * @brief Primitive from SCH to MAC for L2 Measurement
959 * Function : cmPkSchMacL2MeasSendReq
961 * @param[in] Pst* pst
962 * @param[in] RgInfSpsLcInfo *lcInfo
966 S16 cmPkSchMacL2MeasSendReq(Pst* pst,RgInfL2MeasSndReq *measInfo)
968 Buffer *mBuf = NULLP;
970 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
974 if(SAddPstMsgMult((Data *)measInfo, sizeof(RgInfL2MeasSndReq), mBuf) != ROK)
976 ODU_PUT_MSG_BUF(mBuf);
980 pst->event = (Event) EVTINFL2MEASSENDREQ;
981 return (SPstTsk(pst,mBuf));
982 } /* end of cmPkSchMacL2MeasSendReq */
985 * @brief Primitive from SCH to MAC for L2 Measurement request
989 * Function : cmUnpkSchMacL2MeasReq
991 * @param[in] L2MeasReg func
992 * @param[in] Pst* pst
993 * @param[in] Buffer *mBuf
997 S16 cmUnpkSchMacL2MeasReq(L2MeasReq func,Pst *pst,Buffer *mBuf)
999 RgInfL2MeasReq measInfo;
1001 if(SRemPreMsgMult((Data *)&measInfo, sizeof(RgInfL2MeasReq), mBuf) != ROK)
1003 RGSCHINF_FREE_MSG(mBuf);
1007 RGSCHINF_FREE_MSG(mBuf);
1008 return ((*func)(pst, &measInfo));
1009 } /* end of cmUnpkSchMacL2MeasReq */
1012 * @brief Primitive from SCH to MAC for L2 Measurement Stop request
1016 * Function : cmUnpkSchMacL2MeasStopReq
1018 * @param[in] L2MeasReg func
1019 * @param[in] Pst* pst
1020 * @param[in] Buffer *mBuf
1024 S16 cmUnpkSchMacL2MeasStopReq(L2MeasStopReq func,Pst *pst,Buffer *mBuf)
1026 RgInfL2MeasStopReq measInfo;
1028 if(SRemPreMsgMult((Data *)&measInfo, sizeof(RgInfL2MeasStopReq), mBuf) != ROK)
1030 ODU_PUT_MSG_BUF(mBuf);
1034 ODU_PUT_MSG_BUF(mBuf);
1035 return ((*func)(pst, &measInfo));
1036 } /* end of cmUnpkSchMacL2MeasReq */
1038 * @brief Primitive from SCH to MAC for L2 Measurement request
1042 * Function : cmUnpkSchMacL2MeasReq
1044 * @param[in] L2MeasReg func
1045 * @param[in] Pst* pst
1046 * @param[in] Buffer *mBuf
1050 S16 cmUnpkSchMacL2MeasSendReq(L2MeasSendReq func,Pst *pst,Buffer *mBuf)
1052 RgInfL2MeasSndReq measInfo;
1054 if(SRemPreMsgMult((Data *)&measInfo, sizeof(RgInfL2MeasSndReq), mBuf) != ROK)
1056 ODU_PUT_MSG_BUF(mBuf);
1060 ODU_PUT_MSG_BUF(mBuf);
1061 return ((*func)(pst, &measInfo));
1062 } /* end of cmUnpkSchMacL2MeasSendReq*/
1065 * @brief Primitive from MAC to SCH for L2 Measurement
1069 * Function : cmPkMacSchL2MeasCfm
1071 * @param[in] Pst* pst
1072 * @param[in] RgInfL2MeasCfm *measInfo
1076 S16 cmPkMacSchL2MeasCfm(Pst* pst,RgInfL2MeasCfm *measCfm)
1078 Buffer *mBuf = NULLP;
1080 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
1084 if(SAddPstMsgMult((Data *)measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
1086 RGSCHINF_FREE_MSG(mBuf);
1090 pst->event = (Event) EVTINFL2MEASCFM;
1091 return (SPstTsk(pst,mBuf));
1092 } /* end of cmPkMacSchL2MeasCfm */
1096 * @brief Primitive from MAC to SCH for L2 Measurement
1100 * Function : cmPkMacSchL2MeasStopCfm
1102 * @param[in] Pst* pst
1103 * @param[in] RgInfL2MeasCfm *measInfo
1107 S16 cmPkMacSchL2MeasStopCfm(Pst* pst,RgInfL2MeasCfm *measCfm)
1109 Buffer *mBuf = NULLP;
1111 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
1115 if(SAddPstMsgMult((Data *)measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
1117 ODU_PUT_MSG_BUF(mBuf);
1121 pst->event = (Event) EVTINFL2MEASSTOPCFM;
1122 return (SPstTsk(pst,mBuf));
1123 }/*cmPkMacSchL2MeasStopCfm*/
1125 * @brief Primitive from MAC to SCH for L2 Measurement Cfm
1129 * Function : cmUnpkSchMacL2MeasReq
1131 * @param[in] L2MeasCfm func
1132 * @param[in] Pst* pst
1133 * @param[in] Buffer *mBuf
1137 S16 cmUnpkMacSchL2MeasCfm(L2MeasCfm func,Pst *pst,Buffer *mBuf)
1139 RgInfL2MeasCfm measCfm;
1141 if(SRemPreMsgMult((Data *)&measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
1143 RGSCHINF_FREE_MSG(mBuf);
1147 RGSCHINF_FREE_MSG(mBuf);
1148 return ((*func)(pst, &measCfm));
1149 } /* end of cmUnpkMacSchL2MeasCfm */
1152 * @brief Primitive from MAC to SCH for L2 Measurement Stop Cfm
1156 * Function : cmUnpkMacSchL2MeasStopCfm
1158 * @param[in] L2MeasCfm func
1159 * @param[in] Pst* pst
1160 * @param[in] Buffer *mBuf
1164 S16 cmUnpkMacSchL2MeasStopCfm(L2MeasCfm func,Pst *pst,Buffer *mBuf)
1166 RgInfL2MeasCfm measCfm;
1168 if(SRemPreMsgMult((Data *)&measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
1170 ODU_PUT_MSG_BUF(mBuf);
1174 ODU_PUT_MSG_BUF(mBuf);
1175 return ((*func)(pst, &measCfm));
1176 } /* end of cmUnpkMacSchL2MeasStopCfm */
1178 #endif/* LTE_L2_MEAS */
1183 /**********************************************************************
1186 **********************************************************************/