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
63 S16 cmPkMacSchUeDelInd
66 RgInfUeDelInd* ueDelInd
69 S16 cmPkMacSchUeDelInd(pst, ueDelInd)
71 RgInfUeDelInd* ueDelInd;
75 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
80 #ifdef MS_MBUF_CORRUPTION
81 MS_BUF_ADD_ALLOC_CALLER();
83 if(SAddPstMsgMult((Data *)ueDelInd, sizeof(RgInfUeDelInd), mBuf) != ROK)
85 RGSCHINF_FREE_MSG(mBuf);
89 pst->event = (Event) EVTINFUEDELIND;
90 return (SPstTsk(pst,mBuf));
94 * @brief This primitive is used to indicate to scheduler
95 * that UE has been deleted at MAC.
100 * Function : cmUnpkMacSchUeDelInd
102 * @param[in] Pst* pst
103 * @param[in] SpId spId
104 * @param[in] RguDDatReqInfo * datReq
109 S16 cmUnpkMacSchUeDelInd
116 S16 cmUnpkMacSchUeDelInd(func, pst, mBuf)
122 RgInfUeDelInd ueDelInd;
124 if(SRemPreMsgMult((Data *)&ueDelInd, sizeof(RgInfUeDelInd), mBuf) != ROK)
126 RGSCHINF_FREE_MSG(mBuf);
130 RGSCHINF_FREE_MSG(mBuf);
132 return ((*func)(pst, &ueDelInd));
134 /*Fix: end: Inform UE delete to scheduler*/
137 * @brief Request from RLC to MAC for forwarding SDUs on
138 * dedicated channel for transmission.
142 * Function : cmPkMacSchDedBoUpdtReq
144 * @param[in] Pst* pst
145 * @param[in] SpId spId
146 * @param[in] RguDDatReqInfo * datReq
151 S16 cmPkMacSchDedBoUpdtReq
157 S16 cmPkMacSchDedBoUpdtReq(pst, boRpt)
159 RgInfDedBoRpt* boRpt;
162 Buffer *mBuf = NULLP;
164 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
168 #ifdef MS_MBUF_CORRUPTION
169 MS_BUF_ADD_ALLOC_CALLER();
171 if(SAddPstMsgMult((Data *)boRpt, sizeof(RgInfDedBoRpt), mBuf) != ROK)
173 RGSCHINF_FREE_MSG(mBuf);
177 pst->event = (Event) EVTINFDEDBOUPDTREQ;
178 return (SPstTsk(pst,mBuf));
183 * @brief Request from RLC to MAC for forwarding SDUs on
184 * dedicated channel for transmission.
188 * Function : cmUnpkMacSchDedBoUpdtReq
190 * @param[in] Pst* pst
191 * @param[in] SpId spId
192 * @param[in] RguDDatReqInfo * datReq
197 S16 cmUnpkMacSchDedBoUpdtReq
204 S16 cmUnpkMacSchDedBoUpdtReq(func, pst, mBuf)
212 if(SRemPreMsgMult((Data *)&boRpt, sizeof(RgInfDedBoRpt), mBuf) != ROK)
214 RGSCHINF_FREE_MSG(mBuf);
218 RGSCHINF_FREE_MSG(mBuf);
219 return ((*func)(pst, &boRpt));
222 * @brief Request from RLC to MAC for forwarding SDUs on
223 * dedicated channel for transmission.
227 * Function : cmPkMacSchCmnBoUpdtReq
229 * @param[in] Pst* pst
230 * @param[in] SpId spId
231 * @param[in] RguDDatReqInfo * datReq
236 S16 cmPkMacSchCmnBoUpdtReq
242 S16 cmPkMacSchCmnBoUpdtReq(pst, boRpt)
244 RgInfCmnBoRpt* boRpt;
247 Buffer *mBuf = NULLP;
249 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
253 #ifdef MS_MBUF_CORRUPTION
254 MS_BUF_ADD_ALLOC_CALLER();
256 if(SAddPstMsgMult((Data *)boRpt, sizeof(RgInfCmnBoRpt), mBuf) != ROK)
258 RGSCHINF_FREE_MSG(mBuf);
262 pst->event = (Event) EVTINFCMNBOUPDTREQ;
263 return (SPstTsk(pst,mBuf));
268 * @brief Request from RLC to MAC for forwarding SDUs on
269 * dedicated channel for transmission.
273 * Function : cmUnpkMacSchCmnBoUpdtReq
275 * @param[in] Pst* pst
276 * @param[in] SpId spId
277 * @param[in] RguDDatReqInfo * datReq
282 S16 cmUnpkMacSchCmnBoUpdtReq
289 S16 cmUnpkMacSchCmnBoUpdtReq(func, pst, mBuf)
297 if(SRemPreMsgMult((Data *)&boRpt, sizeof(RgInfCmnBoRpt), mBuf) != ROK)
299 RGSCHINF_FREE_MSG(mBuf);
303 RGSCHINF_FREE_MSG(mBuf);
304 return ((*func)(pst, &boRpt));
307 * @brief Request from RLC to MAC for forwarding SDUs on
308 * dedicated channel for transmission.
312 * Function : cmPkMacSchSfRecpInd
314 * @param[in] Pst* pst
315 * @param[in] SpId spId
316 * @param[in] RguDDatReqInfo * datReq
321 S16 cmPkMacSchSfRecpInd
324 RgInfSfDatInd* datInd
327 S16 cmPkMacSchSfRecpInd(pst, datInd)
329 RgInfSfDatInd* datInd;
332 Buffer *mBuf = NULLP;
334 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
338 if(oduPackPointer((PTR)datInd, mBuf) != ROK)
340 RGSCHINF_FREE_MSG(mBuf);
344 pst->event = (Event) EVTINFSFRECPIND;
345 return (SPstTsk(pst,mBuf));
350 * @brief Request from RLC to MAC for forwarding SDUs on
351 * dedicated channel for transmission.
355 * Function : cmUnpkMacSchSfRecpInd
357 * @param[in] Pst* pst
358 * @param[in] SpId spId
359 * @param[in] RguDDatReqInfo * datReq
364 S16 cmUnpkMacSchSfRecpInd
371 S16 cmUnpkMacSchSfRecpInd(func, pst, mBuf)
377 RgInfSfDatInd* datInd;
379 if(oduUnpackPointer((PTR *)&datInd, mBuf) != ROK)
381 RGSCHINF_FREE_MSG(mBuf);
385 RGSCHINF_FREE_MSG(mBuf);
386 /* Call cmFreeMem(datInd) in scheduler */
387 return ((*func)(pst, datInd));
392 * @brief Primitive from MAC to SCH to indicate release of UL SPS for a UE
396 * Function : cmPkMacSchSpsRelInd
398 * @param[in] Pst* pst
399 * @param[in] RgInfSpsRelInfo* relInfo
404 S16 cmPkMacSchSpsRelInd
407 RgInfSpsRelInfo* relInfo
410 S16 cmPkMacSchSpsRelInd(pst, relInfo)
412 RgInfSpsRelInfo* relInfo;
415 Buffer *mBuf = NULLP;
417 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
421 if(oduPackPointer((PTR)relInfo, mBuf) != ROK)
423 RGSCHINF_FREE_MSG(mBuf);
427 pst->event = (Event) EVTINFSPSRELIND;
428 return (SPstTsk(pst,mBuf));
429 } /* end of cmPkMacSchSpsRelInd */
432 * @brief Primitive from MAC to SCH to indicate release of UL SPS for a UE
436 * Function : cmUnpkMacSchSpsRelInd
438 * @param[in] SpsRelInd func
439 * @param[in] Pst* pst
440 * @param[in] Buffer *mBuf
445 S16 cmUnpkMacSchSpsRelInd
452 S16 cmUnpkMacSchSpsRelInd(func, pst, mBuf)
458 RgInfSpsRelInfo *relInfo;
460 if(oduUnpackPointer((PTR *)&relInfo, mBuf) != ROK)
462 RGSCHINF_FREE_MSG(mBuf);
466 RGSCHINF_FREE_MSG(mBuf);
467 return ((*func)(pst, relInfo));
468 } /* end of cmUnpkMacSchSpsRelInd */
469 #endif /* LTEMAC_SPS */
474 * @brief Request from RLC to MAC for forwarding SDUs on
475 * dedicated channel for transmission.
479 * Function : cmPkSchMacSfAllocReq
481 * @param[in] Pst* pst
482 * @param[in] SpId spId
483 * @param[in] RguDDatReqInfo * datReq
488 S16 cmPkSchMacSfAllocReq
491 RgInfSfAlloc* resAllocReq
494 S16 cmPkSchMacSfAllocReq(pst, resAllocReq)
496 RgInfSfAlloc* resAllocReq;
499 Buffer *mBuf = NULLP;
501 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
505 if(oduPackPointer((PTR)resAllocReq, mBuf) != ROK)
507 RGSCHINF_FREE_MSG(mBuf);
511 pst->event = (Event) EVTINFSFALLOCREQ;
512 return (SPstTsk(pst,mBuf));
517 * @brief Request from RLC to MAC for forwarding SDUs on
518 * dedicated channel for transmission.
522 * Function : cmUnpkSchMacSfAllocReq
524 * @param[in] Pst* pst
525 * @param[in] SpId spId
526 * @param[in] RguDDatReqInfo * datReq
531 S16 cmUnpkSchMacSfAllocReq
538 S16 cmUnpkSchMacSfAllocReq(func, pst, mBuf)
544 RgInfSfAlloc* resAllocReq;
546 if(oduUnpackPointer((PTR *)&resAllocReq, mBuf) != ROK)
548 RGSCHINF_FREE_MSG(mBuf);
552 RGSCHINF_FREE_MSG(mBuf);
553 return ((*func)(pst, resAllocReq));
556 * @brief Request from SCH To MAC for harq entity reset
560 * Function : cmPkSchMacRstHqEntReq
562 * @param[in] Pst* pst
563 * @param[in] RgInfResetHqEnt *hqEntInfo
568 S16 cmPkSchMacRstHqEntReq
571 RgInfResetHqEnt* hqEntInfo
574 S16 cmPkSchMacRstHqEntReq(pst, sfHqInfo)
576 RgInfResetHqEnt* hqEntInfo
579 Buffer *mBuf = NULLP;
581 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
585 if(oduPackPointer((PTR)hqEntInfo, mBuf) != ROK)
587 RGSCHINF_FREE_MSG(mBuf);
591 pst->event = (Event) EVTINFHQENTRESET;
592 return (SPstTsk(pst,mBuf));
596 * @brief Request from SCH to MAC for resetting the harqentity
600 * Function : cmUnpkSchMacRstHqEntReq
602 * @param[in] Pst* pst
603 * @param[in] RgInfResetHqEnt *hqEntInfo
608 S16 cmUnpkSchMacRstHqEntReq
615 S16 cmUnpkSchMacRstHqEntReq(func, pst, mBuf)
621 RgInfResetHqEnt* hqEntRstInfo;
623 if(oduUnpackPointer((PTR *)&hqEntRstInfo, mBuf) != ROK)
625 RGSCHINF_FREE_MSG(mBuf);
629 RGSCHINF_FREE_MSG(mBuf);
630 return ((*func)(pst, hqEntRstInfo));
634 * @brief Request from RLC to MAC for forwarding SDUs on
635 * dedicated channel for transmission.
639 * Function : cmPkSchMacRlsHqReq
641 * @param[in] Pst* pst
642 * @param[in] SpId spId
643 * @param[in] RguDDatReqInfo * datReq
648 S16 cmPkSchMacRlsHqReq
651 RgInfRlsHqInfo* sfHqInfo
654 S16 cmPkSchMacRlsHqReq(pst, sfHqInfo)
656 RgInfRlsHqInfo* sfHqInfo;
659 Buffer *mBuf = NULLP;
661 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
665 if(oduPackPointer((PTR)sfHqInfo, mBuf) != ROK)
667 RGSCHINF_FREE_MSG(mBuf);
671 pst->event = (Event) EVTINFRLSHQREQ;
672 return (SPstTsk(pst,mBuf));
676 * @brief Request from RLC to MAC for forwarding SDUs on
677 * dedicated channel for transmission.
681 * Function : cmUnpkSchMacRlsHqReq
683 * @param[in] Pst* pst
684 * @param[in] SpId spId
685 * @param[in] RguDDatReqInfo * datReq
690 S16 cmUnpkSchMacRlsHqReq
697 S16 cmUnpkSchMacRlsHqReq(func, pst, mBuf)
703 RgInfRlsHqInfo* sfHqInfo;
705 if(oduUnpackPointer((PTR *)&sfHqInfo, mBuf) != ROK)
707 RGSCHINF_FREE_MSG(mBuf);
711 RGSCHINF_FREE_MSG(mBuf);
712 return ((*func)(pst, sfHqInfo));
715 * @brief Request from RLC to MAC for forwarding SDUs on
716 * dedicated channel for transmission.
720 * Function : cmPkSchMacRlsRntiReq
722 * @param[in] Pst* pst
723 * @param[in] SpId spId
724 * @param[in] RguDDatReqInfo * datReq
729 S16 cmPkSchMacRlsRntiReq
732 RgInfRlsRnti* rlsRnti
735 S16 cmPkSchMacRlsRntiReq(pst, rlsRnti)
737 RgInfRlsRnti* rlsRnti;
740 Buffer *mBuf = NULLP;
742 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
746 #ifdef MS_MBUF_CORRUPTION
747 MS_BUF_ADD_ALLOC_CALLER();
749 if(SAddPstMsgMult((Data *)rlsRnti, sizeof(RgInfRlsRnti), mBuf) != ROK)
751 RGSCHINF_FREE_MSG(mBuf);
755 pst->event = (Event) EVTINFRLSRNTIREQ;
756 return (SPstTsk(pst,mBuf));
760 * @brief Request from RLC to MAC for forwarding SDUs on
761 * dedicated channel for transmission.
765 * Function : cmUnpkSchMacRlsRntiReq
767 * @param[in] Pst* pst
768 * @param[in] SpId spId
769 * @param[in] RguDDatReqInfo * datReq
774 S16 cmUnpkSchMacRlsRntiReq
781 S16 cmUnpkSchMacRlsRntiReq(func, pst, mBuf)
787 RgInfRlsRnti rlsRnti;
789 if(SRemPreMsgMult((Data *)&rlsRnti, sizeof(RgInfRlsRnti), mBuf) != ROK)
791 RGSCHINF_FREE_MSG(mBuf);
795 RGSCHINF_FREE_MSG(mBuf);
796 return ((*func)(pst, &rlsRnti));
800 * @brief Request from RLC to MAC for forwarding SDUs on
801 * dedicated channel for transmission.
805 * Function : cmPkSchMacCellRegReq
807 * @param[in] Pst* pst
808 * @param[in] SpId spId
809 * @param[in] RguDDatReqInfo * datReq
814 S16 cmPkSchMacCellRegReq
820 S16 cmPkSchMacCellRegReq(pst, regReq)
822 RgInfCellReg* regReq;
825 Buffer *mBuf = NULLP;
827 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
831 #ifdef MS_MBUF_CORRUPTION
832 MS_BUF_ADD_ALLOC_CALLER();
834 if(SAddPstMsgMult((Data *)regReq, sizeof(RgInfCellReg), mBuf) != ROK)
836 RGSCHINF_FREE_MSG(mBuf);
840 pst->event = (Event) EVTINFCELLREGREQ;
841 return (SPstTsk(pst,mBuf));
845 * @brief Request from RLC to MAC for forwarding SDUs on
846 * dedicated channel for transmission.
850 * Function : cmUnpkSchMacCellRegReq
852 * @param[in] Pst* pst
853 * @param[in] SpId spId
854 * @param[in] RguDDatReqInfo * datReq
859 S16 cmUnpkSchMacCellRegReq
866 S16 cmUnpkSchMacCellRegReq(func, pst, mBuf)
874 if(SRemPreMsgMult((Data *)®Req, sizeof(RgInfCellReg), mBuf) != ROK)
876 RGSCHINF_FREE_MSG(mBuf);
880 RGSCHINF_FREE_MSG(mBuf);
881 return ((*func)(pst, ®Req));
885 * @brief Primitive from SCH to MAC to register GBR LCG per UE
889 * Function : cmPkSchMacLcgRegReq
891 * @param[in] Pst* pst
892 * @param[in] RgInfLcgRegReq *lcgRegReq
897 S16 cmPkSchMacLcgRegReq
900 RgInfLcgRegReq *lcgRegReq
903 S16 cmPkSchMacLcgRegReq(pst, lcgRegReq)
905 RgInfLcgRegReq *lcgRegReq;
908 Buffer *mBuf = NULLP;
910 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
914 if(SAddPstMsgMult((Data *)lcgRegReq, sizeof(RgInfLcgRegReq), mBuf) != ROK)
916 RGSCHINF_FREE_MSG(mBuf);
920 pst->event = (Event) EVTINFLCGREG;
921 return (SPstTsk(pst,mBuf));
922 } /* end of cmPkSchMacLcgRegReq */
925 * @brief Primitive from SCH to MAC to register GBR LCG
929 * Function : cmUnpkSchMacLcgRegReq
931 * @param[in] LcgReg func
932 * @param[in] Pst* pst
933 * @param[in] Buffer *mBuf
938 S16 cmUnpkSchMacLcgRegReq
945 S16 cmUnpkSchMacLcgRegReq(func, pst, mBuf)
951 RgInfLcgRegReq *lcgRegReq;
953 if(oduUnpackPointer((PTR *)&lcgRegReq, mBuf) != ROK)
955 RGSCHINF_FREE_MSG(mBuf);
959 RGSCHINF_FREE_MSG(mBuf);
960 return ((*func)(pst, lcgRegReq));
961 } /* end of cmUnpkSchMacLcgRegReq */
966 * @brief Primitive from SCH to MAC to register the set of SPS LCs per UE
970 * Function : cmPkSchMacSpsLcRegReq
972 * @param[in] Pst* pst
973 * @param[in] RgInfSpsLcInfo *lcInfo
978 S16 cmPkSchMacSpsLcRegReq
981 RgInfSpsLcInfo *lcInfo
984 S16 cmPkSchMacSpsLcRegReq(pst, lcInfo)
986 RgInfSpsLcInfo *lcInfo;
989 Buffer *mBuf = NULLP;
991 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
995 if(oduPackPointer((PTR)lcInfo, mBuf) != ROK)
997 RGSCHINF_FREE_MSG(mBuf);
1001 pst->event = (Event) EVTINFSPSLCREG;
1002 return (SPstTsk(pst,mBuf));
1003 } /* end of cmPkSchMacSpsLcRegReq */
1006 * @brief Primitive from SCH to MAC to reset SPS Params for the UE
1010 * Function : cmPkSchMacUlSpsResetReq
1012 * @param[in] Pst* pst
1013 * @param[in] RgInfUlSpsReset *ulSpsResetInfo
1018 S16 cmPkSchMacUlSpsResetReq
1021 RgInfUlSpsReset *ulSpsResetInfo
1024 S16 cmPkSchMacUlSpsResetReq(pst, ulSpsResetInfo)
1026 RgInfUlSpsReset *ulSpsResetInfo;
1029 Buffer *mBuf = NULLP;
1031 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1035 if(oduPackPointer((PTR)ulSpsResetInfo, mBuf) != ROK)
1037 RGSCHINF_FREE_MSG(mBuf);
1041 pst->event = (Event) EVTINFSPSRESET;
1042 return (SPstTsk(pst,mBuf));
1043 } /* end of cmPkSchMacUlSpsResetReq */
1046 * @brief Primitive from SCH to MAC to register the set of SPS LCs per UE
1050 * Function : cmUnpkSchMacSpsLcRegReq
1052 * @param[in] SpsLcReg func
1053 * @param[in] Pst* pst
1054 * @param[in] Buffer *mBuf
1059 S16 cmUnpkSchMacSpsLcRegReq
1066 S16 cmUnpkSchMacSpsLcRegReq(func, pst, mBuf)
1072 RgInfSpsLcInfo *lcInfo;
1074 if(oduUnpackPointer((PTR *)&lcInfo, mBuf) != ROK)
1076 RGSCHINF_FREE_MSG(mBuf);
1080 RGSCHINF_FREE_MSG(mBuf);
1081 return ((*func)(pst, lcInfo));
1082 } /* end of cmUnpkSchMacSpsLcRegReq */
1087 * @brief Primitive from SCH to MAC to reset UL SPS params
1091 * Function : cmUnpkSchMacUlSpsResetReq
1093 * @param[in] UlSpsReset func
1094 * @param[in] Pst* pst
1095 * @param[in] Buffer *mBuf
1100 S16 cmUnpkSchMacUlSpsResetReq
1107 S16 cmUnpkSchMacUlSpsResetReq(func, pst, mBuf)
1113 RgInfUlSpsReset *ulSpsResetInfo;
1115 if(oduUnpackPointer((PTR *)&ulSpsResetInfo, mBuf) != ROK)
1117 RGSCHINF_FREE_MSG(mBuf);
1121 RGSCHINF_FREE_MSG(mBuf);
1122 return ((*func)(pst, ulSpsResetInfo));
1123 } /* end of cmUnpkSchMacUlSpsResetReq */
1128 * @brief Primitive from SCH to MAC to deregister the set of SPS LCs per UE
1132 * Function : cmPkSchMacSpsLcDeregReq
1134 * @param[in] Pst* pst
1135 * @param[in] CmLteCellId cellId,
1136 * @param[in] CmLteRnti crnti
1141 S16 cmPkSchMacSpsLcDeregReq
1148 S16 cmPkSchMacSpsLcDeregReq(pst, cellId, crnti)
1154 Buffer *mBuf = NULLP;
1156 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1160 CMCHKPK(cmPkLteCellId, cellId, mBuf);
1161 CMCHKPK(cmPkLteRnti, crnti, mBuf);
1163 pst->event = (Event) EVTINFSPSLCDEREG;
1164 return (SPstTsk(pst,mBuf));
1165 } /* end of cmPkSchMacSpsLcDeregReq */
1168 * @brief Primitive from SCH to MAC to deregister the set of SPS LCs per UE
1172 * Function : cmUnpkSchMacSpsLcDeregReq
1174 * @param[in] SpsLcDereg func
1175 * @param[in] Pst* pst
1176 * @param[in] Buffer *mBuf
1181 S16 cmUnpkSchMacSpsLcDeregReq
1188 S16 cmUnpkSchMacSpsLcDeregReq(func, pst, mBuf)
1197 CMCHKUNPK(cmUnpkLteRnti, &crnti, mBuf);
1198 CMCHKUNPK(cmUnpkLteCellId, &cellId, mBuf);
1200 RGSCHINF_FREE_MSG(mBuf);
1201 return ((*func)(pst, cellId, crnti));
1202 } /* end of cmUnpkSchMacSpsLcDeregReq */
1204 #endif /* LTEMAC_SPS */
1208 * @brief Primitive from SCH to MAC for L2 Measurement
1212 * Function : cmPkSchMacL2MeasReq
1214 * @param[in] Pst* pst
1215 * @param[in] RgInfSpsLcInfo *lcInfo
1220 S16 cmPkSchMacL2MeasReq
1223 RgInfL2MeasReq *measInfo
1226 S16 cmPkSchMacL2MeasReq(pst, measInfo)
1228 RgInfL2MeasReq *measInfo;
1231 Buffer *mBuf = NULLP;
1233 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1236 if(SAddPstMsgMult((Data *)measInfo, sizeof(RgInfL2MeasReq), mBuf) != ROK)
1238 RGSCHINF_FREE_MSG(mBuf);
1242 pst->event = (Event) EVTINFL2MEASREQ;
1243 return (SPstTsk(pst,mBuf));
1244 } /* end of cmPkSchMacL2MeasReq */
1247 * @brief Primitive from SCH to MAC for L2 Stop Measurement
1251 * Function : cmPkSchMacL2MeasStopReq
1253 * @param[in] Pst* pst
1254 * @param[in] RgInfSpsLcInfo *lcInfo
1259 S16 cmPkSchMacL2MeasStopReq
1262 RgInfL2MeasStopReq *measInfo
1265 S16 cmPkSchMacL2MeasStopReq(pst, measInfo)
1267 RgInfL2MeasStopReq *measInfo;
1270 Buffer *mBuf = NULLP;
1272 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1275 if(SAddPstMsgMult((Data *)measInfo, sizeof(RgInfL2MeasStopReq), mBuf) != ROK)
1281 pst->event = (Event) EVTINFL2MEASSTOPREQ;
1282 return (SPstTsk(pst,mBuf));
1283 } /* end of cmPkSchMacL2MeasStopReq */
1285 * @brief Primitive from SCH to MAC for L2 Measurement
1289 * Function : cmPkSchMacL2MeasSendReq
1291 * @param[in] Pst* pst
1292 * @param[in] RgInfSpsLcInfo *lcInfo
1297 S16 cmPkSchMacL2MeasSendReq
1300 RgInfL2MeasSndReq *measInfo
1303 S16 cmPkSchMacL2MeasSendReq(pst, measInfo)
1305 RgInfL2MeasSndReq *measInfo;
1308 Buffer *mBuf = NULLP;
1310 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1314 if(SAddPstMsgMult((Data *)measInfo, sizeof(RgInfL2MeasSndReq), mBuf) != ROK)
1320 pst->event = (Event) EVTINFL2MEASSENDREQ;
1321 return (SPstTsk(pst,mBuf));
1322 } /* end of cmPkSchMacL2MeasSendReq */
1325 * @brief Primitive from SCH to MAC for L2 Measurement request
1329 * Function : cmUnpkSchMacL2MeasReq
1331 * @param[in] L2MeasReg func
1332 * @param[in] Pst* pst
1333 * @param[in] Buffer *mBuf
1338 S16 cmUnpkSchMacL2MeasReq
1345 S16 cmUnpkSchMacL2MeasReq(func, pst, mBuf)
1351 RgInfL2MeasReq measInfo;
1353 if(SRemPreMsgMult((Data *)&measInfo, sizeof(RgInfL2MeasReq), mBuf) != ROK)
1355 RGSCHINF_FREE_MSG(mBuf);
1359 RGSCHINF_FREE_MSG(mBuf);
1360 return ((*func)(pst, &measInfo));
1361 } /* end of cmUnpkSchMacL2MeasReq */
1364 * @brief Primitive from SCH to MAC for L2 Measurement Stop request
1368 * Function : cmUnpkSchMacL2MeasStopReq
1370 * @param[in] L2MeasReg func
1371 * @param[in] Pst* pst
1372 * @param[in] Buffer *mBuf
1377 S16 cmUnpkSchMacL2MeasStopReq
1384 S16 cmUnpkSchMacL2MeasStopReq(func, pst, mBuf)
1390 RgInfL2MeasStopReq measInfo;
1392 if(SRemPreMsgMult((Data *)&measInfo, sizeof(RgInfL2MeasStopReq), mBuf) != ROK)
1399 return ((*func)(pst, &measInfo));
1400 } /* end of cmUnpkSchMacL2MeasReq */
1402 * @brief Primitive from SCH to MAC for L2 Measurement request
1406 * Function : cmUnpkSchMacL2MeasReq
1408 * @param[in] L2MeasReg func
1409 * @param[in] Pst* pst
1410 * @param[in] Buffer *mBuf
1415 S16 cmUnpkSchMacL2MeasSendReq
1422 S16 cmUnpkSchMacL2MeasSendReq(func, pst, mBuf)
1428 RgInfL2MeasSndReq measInfo;
1430 if(SRemPreMsgMult((Data *)&measInfo, sizeof(RgInfL2MeasSndReq), mBuf) != ROK)
1437 return ((*func)(pst, &measInfo));
1438 } /* end of cmUnpkSchMacL2MeasSendReq*/
1441 * @brief Primitive from MAC to SCH for L2 Measurement
1445 * Function : cmPkMacSchL2MeasCfm
1447 * @param[in] Pst* pst
1448 * @param[in] RgInfL2MeasCfm *measInfo
1453 S16 cmPkMacSchL2MeasCfm
1456 RgInfL2MeasCfm *measCfm
1459 S16 cmPkMacSchL2MeasCfm(pst, measCfm)
1461 RgInfL2MeasCfm *measCfm;
1464 Buffer *mBuf = NULLP;
1466 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1470 if(SAddPstMsgMult((Data *)measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
1472 RGSCHINF_FREE_MSG(mBuf);
1476 pst->event = (Event) EVTINFL2MEASCFM;
1477 return (SPstTsk(pst,mBuf));
1478 } /* end of cmPkMacSchL2MeasCfm */
1482 * @brief Primitive from MAC to SCH for L2 Measurement
1486 * Function : cmPkMacSchL2MeasStopCfm
1488 * @param[in] Pst* pst
1489 * @param[in] RgInfL2MeasCfm *measInfo
1494 S16 cmPkMacSchL2MeasStopCfm
1497 RgInfL2MeasCfm *measCfm
1500 S16 cmPkMacSchL2MeasStopCfm(pst, measCfm)
1502 RgInfL2MeasCfm *measCfm;
1505 Buffer *mBuf = NULLP;
1507 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1511 if(SAddPstMsgMult((Data *)measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
1517 pst->event = (Event) EVTINFL2MEASSTOPCFM;
1518 return (SPstTsk(pst,mBuf));
1519 }/*cmPkMacSchL2MeasStopCfm*/
1521 * @brief Primitive from MAC to SCH for L2 Measurement Cfm
1525 * Function : cmUnpkSchMacL2MeasReq
1527 * @param[in] L2MeasCfm func
1528 * @param[in] Pst* pst
1529 * @param[in] Buffer *mBuf
1534 S16 cmUnpkMacSchL2MeasCfm
1541 S16 cmUnpkMacSchL2MeasCfm(func, pst, mBuf)
1547 RgInfL2MeasCfm measCfm;
1549 if(SRemPreMsgMult((Data *)&measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
1551 RGSCHINF_FREE_MSG(mBuf);
1555 RGSCHINF_FREE_MSG(mBuf);
1556 return ((*func)(pst, &measCfm));
1557 } /* end of cmUnpkMacSchL2MeasCfm */
1560 * @brief Primitive from MAC to SCH for L2 Measurement Stop Cfm
1564 * Function : cmUnpkMacSchL2MeasStopCfm
1566 * @param[in] L2MeasCfm func
1567 * @param[in] Pst* pst
1568 * @param[in] Buffer *mBuf
1573 S16 cmUnpkMacSchL2MeasStopCfm
1580 S16 cmUnpkMacSchL2MeasStopCfm(func, pst, mBuf)
1586 RgInfL2MeasCfm measCfm;
1588 if(SRemPreMsgMult((Data *)&measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
1595 return ((*func)(pst, &measCfm));
1596 } /* end of cmUnpkMacSchL2MeasStopCfm */
1598 #endif/* LTE_L2_MEAS */
1603 /**********************************************************************
1606 **********************************************************************/