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 "envopt.h" /* environment options */
34 #include "envdep.h" /* environment dependent */
35 #include "envind.h" /* environment independent */
36 #include "gen.h" /* general */
37 #include "ssi.h" /* system services */
38 #include "cm_tkns.h" /* Common Token Defines */
39 #include "cm_llist.h" /* Common Link List Defines */
40 #include "cm_hash.h" /* Common Hash List Defines */
41 #include "cm_mblk.h" /* memory management */
42 #include "cm_lte.h" /* Common LTE Defines */
43 #include "tfu.h" /* RGU defines */
47 #include "rg_sch_inf.h" /* RGU Interface defines */
49 /* header/extern include files (.x) */
50 #include "gen.x" /* general */
51 #include "ssi.x" /* system services */
52 #include "cm_tkns.x" /* Common Token Definitions */
53 #include "cm_llist.x" /* Common Link List Definitions */
54 #include "cm_lib.x" /* Common Library Definitions */
55 #include "cm_hash.x" /* Common Hash List Definitions */
56 #include "cm_mblk.x" /* memory management */
57 #include "cm_lte.x" /* Common LTE Defines */
58 #include "tfu.x" /* RGU defines */
62 #include "rg_sch_inf.x" /* RGU Interface includes */
65 /*Fix: start: Inform UE delete to scheduler*/
67 * @brief This primitive is used to indicate to scheduler
68 * that UE has been deleted at MAC.
72 * Function : cmPkMacSchUeDelInd
75 * @param[in] RgInfUeDelInd* ueDelInd
80 PUBLIC S16 cmPkMacSchUeDelInd
83 RgInfUeDelInd* ueDelInd
86 PUBLIC S16 cmPkMacSchUeDelInd(pst, ueDelInd)
88 RgInfUeDelInd* ueDelInd;
92 TRC2(cmPkMacSchUeDelInd)
94 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
99 #ifdef MS_MBUF_CORRUPTION
100 MS_BUF_ADD_ALLOC_CALLER();
102 if(SAddPstMsgMult((Data *)ueDelInd, sizeof(RgInfUeDelInd), mBuf) != ROK)
104 RGSCHINF_FREE_MSG(mBuf);
108 pst->event = (Event) EVTINFUEDELIND;
109 RETVALUE(SPstTsk(pst,mBuf));
113 * @brief This primitive is used to indicate to scheduler
114 * that UE has been deleted at MAC.
119 * Function : cmUnpkMacSchUeDelInd
121 * @param[in] Pst* pst
122 * @param[in] SpId spId
123 * @param[in] RguDDatReqInfo * datReq
128 PUBLIC S16 cmUnpkMacSchUeDelInd
135 PUBLIC S16 cmUnpkMacSchUeDelInd(func, pst, mBuf)
141 RgInfUeDelInd ueDelInd;
143 TRC2(cmUnpkMacSchUeDelInd)
145 if(SRemPreMsgMult((Data *)&ueDelInd, sizeof(RgInfUeDelInd), mBuf) != ROK)
147 RGSCHINF_FREE_MSG(mBuf);
151 RGSCHINF_FREE_MSG(mBuf);
153 RETVALUE((*func)(pst, &ueDelInd));
155 /*Fix: end: Inform UE delete to scheduler*/
158 * @brief Request from RLC to MAC for forwarding SDUs on
159 * dedicated channel for transmission.
163 * Function : cmPkMacSchDedBoUpdtReq
165 * @param[in] Pst* pst
166 * @param[in] SpId spId
167 * @param[in] RguDDatReqInfo * datReq
172 PUBLIC S16 cmPkMacSchDedBoUpdtReq
178 PUBLIC S16 cmPkMacSchDedBoUpdtReq(pst, boRpt)
180 RgInfDedBoRpt* boRpt;
183 Buffer *mBuf = NULLP;
184 TRC2(cmPkMacSchDedBoUpdtReq)
186 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
190 #ifdef MS_MBUF_CORRUPTION
191 MS_BUF_ADD_ALLOC_CALLER();
193 if(SAddPstMsgMult((Data *)boRpt, sizeof(RgInfDedBoRpt), mBuf) != ROK)
195 RGSCHINF_FREE_MSG(mBuf);
199 pst->event = (Event) EVTINFDEDBOUPDTREQ;
200 RETVALUE(SPstTsk(pst,mBuf));
205 * @brief Request from RLC to MAC for forwarding SDUs on
206 * dedicated channel for transmission.
210 * Function : cmUnpkMacSchDedBoUpdtReq
212 * @param[in] Pst* pst
213 * @param[in] SpId spId
214 * @param[in] RguDDatReqInfo * datReq
219 PUBLIC S16 cmUnpkMacSchDedBoUpdtReq
226 PUBLIC S16 cmUnpkMacSchDedBoUpdtReq(func, pst, mBuf)
234 TRC2(cmUnpkMacSchDedBoUpdtReq)
236 if(SRemPreMsgMult((Data *)&boRpt, sizeof(RgInfDedBoRpt), mBuf) != ROK)
238 RGSCHINF_FREE_MSG(mBuf);
242 RGSCHINF_FREE_MSG(mBuf);
243 RETVALUE((*func)(pst, &boRpt));
246 * @brief Request from RLC to MAC for forwarding SDUs on
247 * dedicated channel for transmission.
251 * Function : cmPkMacSchCmnBoUpdtReq
253 * @param[in] Pst* pst
254 * @param[in] SpId spId
255 * @param[in] RguDDatReqInfo * datReq
260 PUBLIC S16 cmPkMacSchCmnBoUpdtReq
266 PUBLIC S16 cmPkMacSchCmnBoUpdtReq(pst, boRpt)
268 RgInfCmnBoRpt* boRpt;
271 Buffer *mBuf = NULLP;
272 TRC2(cmPkMacSchCmnBoUpdtReq)
274 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
278 #ifdef MS_MBUF_CORRUPTION
279 MS_BUF_ADD_ALLOC_CALLER();
281 if(SAddPstMsgMult((Data *)boRpt, sizeof(RgInfCmnBoRpt), mBuf) != ROK)
283 RGSCHINF_FREE_MSG(mBuf);
287 pst->event = (Event) EVTINFCMNBOUPDTREQ;
288 RETVALUE(SPstTsk(pst,mBuf));
293 * @brief Request from RLC to MAC for forwarding SDUs on
294 * dedicated channel for transmission.
298 * Function : cmUnpkMacSchCmnBoUpdtReq
300 * @param[in] Pst* pst
301 * @param[in] SpId spId
302 * @param[in] RguDDatReqInfo * datReq
307 PUBLIC S16 cmUnpkMacSchCmnBoUpdtReq
314 PUBLIC S16 cmUnpkMacSchCmnBoUpdtReq(func, pst, mBuf)
322 TRC2(cmUnpkMacSchCmnBoUpdtReq)
324 if(SRemPreMsgMult((Data *)&boRpt, sizeof(RgInfCmnBoRpt), mBuf) != ROK)
326 RGSCHINF_FREE_MSG(mBuf);
330 RGSCHINF_FREE_MSG(mBuf);
331 RETVALUE((*func)(pst, &boRpt));
334 * @brief Request from RLC to MAC for forwarding SDUs on
335 * dedicated channel for transmission.
339 * Function : cmPkMacSchSfRecpInd
341 * @param[in] Pst* pst
342 * @param[in] SpId spId
343 * @param[in] RguDDatReqInfo * datReq
348 PUBLIC S16 cmPkMacSchSfRecpInd
351 RgInfSfDatInd* datInd
354 PUBLIC S16 cmPkMacSchSfRecpInd(pst, datInd)
356 RgInfSfDatInd* datInd;
359 Buffer *mBuf = NULLP;
360 TRC2(cmPkMacSchSfRecpInd)
362 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
366 if(cmPkPtr((PTR)datInd, mBuf) != ROK)
368 RGSCHINF_FREE_MSG(mBuf);
372 pst->event = (Event) EVTINFSFRECPIND;
373 RETVALUE(SPstTsk(pst,mBuf));
378 * @brief Request from RLC to MAC for forwarding SDUs on
379 * dedicated channel for transmission.
383 * Function : cmUnpkMacSchSfRecpInd
385 * @param[in] Pst* pst
386 * @param[in] SpId spId
387 * @param[in] RguDDatReqInfo * datReq
392 PUBLIC S16 cmUnpkMacSchSfRecpInd
399 PUBLIC S16 cmUnpkMacSchSfRecpInd(func, pst, mBuf)
405 RgInfSfDatInd* datInd;
407 TRC2(cmUnpkMacSchCmnBoUpdtReq)
409 if(cmUnpkPtr((PTR *)&datInd, mBuf) != ROK)
411 RGSCHINF_FREE_MSG(mBuf);
415 RGSCHINF_FREE_MSG(mBuf);
416 /* Call cmFreeMem(datInd) in scheduler */
417 RETVALUE((*func)(pst, datInd));
422 * @brief Primitive from MAC to SCH to indicate release of UL SPS for a UE
426 * Function : cmPkMacSchSpsRelInd
428 * @param[in] Pst* pst
429 * @param[in] RgInfSpsRelInfo* relInfo
434 PUBLIC S16 cmPkMacSchSpsRelInd
437 RgInfSpsRelInfo* relInfo
440 PUBLIC S16 cmPkMacSchSpsRelInd(pst, relInfo)
442 RgInfSpsRelInfo* relInfo;
445 Buffer *mBuf = NULLP;
447 TRC2(cmPkMacSchSpsRelInd)
449 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
453 if(cmPkPtr((PTR)relInfo, mBuf) != ROK)
455 RGSCHINF_FREE_MSG(mBuf);
459 pst->event = (Event) EVTINFSPSRELIND;
460 RETVALUE(SPstTsk(pst,mBuf));
461 } /* end of cmPkMacSchSpsRelInd */
464 * @brief Primitive from MAC to SCH to indicate release of UL SPS for a UE
468 * Function : cmUnpkMacSchSpsRelInd
470 * @param[in] SpsRelInd func
471 * @param[in] Pst* pst
472 * @param[in] Buffer *mBuf
477 PUBLIC S16 cmUnpkMacSchSpsRelInd
484 PUBLIC S16 cmUnpkMacSchSpsRelInd(func, pst, mBuf)
490 RgInfSpsRelInfo *relInfo;
492 TRC2(cmUnpkMacSchSpsRelInd)
494 if(cmUnpkPtr((PTR *)&relInfo, mBuf) != ROK)
496 RGSCHINF_FREE_MSG(mBuf);
500 RGSCHINF_FREE_MSG(mBuf);
501 RETVALUE((*func)(pst, relInfo));
502 } /* end of cmUnpkMacSchSpsRelInd */
503 #endif /* LTEMAC_SPS */
508 * @brief Request from RLC to MAC for forwarding SDUs on
509 * dedicated channel for transmission.
513 * Function : cmPkSchMacSfAllocReq
515 * @param[in] Pst* pst
516 * @param[in] SpId spId
517 * @param[in] RguDDatReqInfo * datReq
522 PUBLIC S16 cmPkSchMacSfAllocReq
525 RgInfSfAlloc* resAllocReq
528 PUBLIC S16 cmPkSchMacSfAllocReq(pst, resAllocReq)
530 RgInfSfAlloc* resAllocReq;
533 Buffer *mBuf = NULLP;
534 TRC2(cmPkSchMacSfAllocReq)
536 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
540 if(cmPkPtr((PTR)resAllocReq, mBuf) != ROK)
542 RGSCHINF_FREE_MSG(mBuf);
546 pst->event = (Event) EVTINFSFALLOCREQ;
547 RETVALUE(SPstTsk(pst,mBuf));
552 * @brief Request from RLC to MAC for forwarding SDUs on
553 * dedicated channel for transmission.
557 * Function : cmUnpkSchMacSfAllocReq
559 * @param[in] Pst* pst
560 * @param[in] SpId spId
561 * @param[in] RguDDatReqInfo * datReq
566 PUBLIC S16 cmUnpkSchMacSfAllocReq
573 PUBLIC S16 cmUnpkSchMacSfAllocReq(func, pst, mBuf)
579 RgInfSfAlloc* resAllocReq;
581 TRC2(cmUnpkSchMacSfAllocReq)
583 if(cmUnpkPtr((PTR *)&resAllocReq, mBuf) != ROK)
585 RGSCHINF_FREE_MSG(mBuf);
589 RGSCHINF_FREE_MSG(mBuf);
590 RETVALUE((*func)(pst, resAllocReq));
593 * @brief Request from SCH To MAC for harq entity reset
597 * Function : cmPkSchMacRstHqEntReq
599 * @param[in] Pst* pst
600 * @param[in] RgInfResetHqEnt *hqEntInfo
605 PUBLIC S16 cmPkSchMacRstHqEntReq
608 RgInfResetHqEnt* hqEntInfo
611 PUBLIC S16 cmPkSchMacRstHqEntReq(pst, sfHqInfo)
613 RgInfResetHqEnt* hqEntInfo
616 Buffer *mBuf = NULLP;
617 TRC2(cmPkSchMacRstHqEntReq)
619 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
623 if(cmPkPtr((PTR)hqEntInfo, mBuf) != ROK)
625 RGSCHINF_FREE_MSG(mBuf);
629 pst->event = (Event) EVTINFHQENTRESET;
630 RETVALUE(SPstTsk(pst,mBuf));
634 * @brief Request from SCH to MAC for resetting the harqentity
638 * Function : cmUnpkSchMacRstHqEntReq
640 * @param[in] Pst* pst
641 * @param[in] RgInfResetHqEnt *hqEntInfo
646 PUBLIC S16 cmUnpkSchMacRstHqEntReq
653 PUBLIC S16 cmUnpkSchMacRstHqEntReq(func, pst, mBuf)
659 RgInfResetHqEnt* hqEntRstInfo;
661 TRC2(cmUnpkSchMacRstHqEntReq)
663 if(cmUnpkPtr((PTR *)&hqEntRstInfo, mBuf) != ROK)
665 RGSCHINF_FREE_MSG(mBuf);
669 RGSCHINF_FREE_MSG(mBuf);
670 RETVALUE((*func)(pst, hqEntRstInfo));
674 * @brief Request from RLC to MAC for forwarding SDUs on
675 * dedicated channel for transmission.
679 * Function : cmPkSchMacRlsHqReq
681 * @param[in] Pst* pst
682 * @param[in] SpId spId
683 * @param[in] RguDDatReqInfo * datReq
688 PUBLIC S16 cmPkSchMacRlsHqReq
691 RgInfRlsHqInfo* sfHqInfo
694 PUBLIC S16 cmPkSchMacRlsHqReq(pst, sfHqInfo)
696 RgInfRlsHqInfo* sfHqInfo;
699 Buffer *mBuf = NULLP;
700 TRC2(cmPkSchMacRlsHqReq)
702 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
706 if(cmPkPtr((PTR)sfHqInfo, mBuf) != ROK)
708 RGSCHINF_FREE_MSG(mBuf);
712 pst->event = (Event) EVTINFRLSHQREQ;
713 RETVALUE(SPstTsk(pst,mBuf));
717 * @brief Request from RLC to MAC for forwarding SDUs on
718 * dedicated channel for transmission.
722 * Function : cmUnpkSchMacRlsHqReq
724 * @param[in] Pst* pst
725 * @param[in] SpId spId
726 * @param[in] RguDDatReqInfo * datReq
731 PUBLIC S16 cmUnpkSchMacRlsHqReq
738 PUBLIC S16 cmUnpkSchMacRlsHqReq(func, pst, mBuf)
744 RgInfRlsHqInfo* sfHqInfo;
746 TRC2(cmUnpkSchMacRlsHqReq)
748 if(cmUnpkPtr((PTR *)&sfHqInfo, mBuf) != ROK)
750 RGSCHINF_FREE_MSG(mBuf);
754 RGSCHINF_FREE_MSG(mBuf);
755 RETVALUE((*func)(pst, sfHqInfo));
758 * @brief Request from RLC to MAC for forwarding SDUs on
759 * dedicated channel for transmission.
763 * Function : cmPkSchMacRlsRntiReq
765 * @param[in] Pst* pst
766 * @param[in] SpId spId
767 * @param[in] RguDDatReqInfo * datReq
772 PUBLIC S16 cmPkSchMacRlsRntiReq
775 RgInfRlsRnti* rlsRnti
778 PUBLIC S16 cmPkSchMacRlsRntiReq(pst, rlsRnti)
780 RgInfRlsRnti* rlsRnti;
783 Buffer *mBuf = NULLP;
784 TRC2(cmPkSchMacRlsRntiReq)
786 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
790 #ifdef MS_MBUF_CORRUPTION
791 MS_BUF_ADD_ALLOC_CALLER();
793 if(SAddPstMsgMult((Data *)rlsRnti, sizeof(RgInfRlsRnti), mBuf) != ROK)
795 RGSCHINF_FREE_MSG(mBuf);
799 pst->event = (Event) EVTINFRLSRNTIREQ;
800 RETVALUE(SPstTsk(pst,mBuf));
804 * @brief Request from RLC to MAC for forwarding SDUs on
805 * dedicated channel for transmission.
809 * Function : cmUnpkSchMacRlsRntiReq
811 * @param[in] Pst* pst
812 * @param[in] SpId spId
813 * @param[in] RguDDatReqInfo * datReq
818 PUBLIC S16 cmUnpkSchMacRlsRntiReq
825 PUBLIC S16 cmUnpkSchMacRlsRntiReq(func, pst, mBuf)
831 RgInfRlsRnti rlsRnti;
833 TRC2(cmUnpkSchMacRlsRntiReq)
835 if(SRemPreMsgMult((Data *)&rlsRnti, sizeof(RgInfRlsRnti), mBuf) != ROK)
837 RGSCHINF_FREE_MSG(mBuf);
841 RGSCHINF_FREE_MSG(mBuf);
842 RETVALUE((*func)(pst, &rlsRnti));
846 * @brief Request from RLC to MAC for forwarding SDUs on
847 * dedicated channel for transmission.
851 * Function : cmPkSchMacCellRegReq
853 * @param[in] Pst* pst
854 * @param[in] SpId spId
855 * @param[in] RguDDatReqInfo * datReq
860 PUBLIC S16 cmPkSchMacCellRegReq
866 PUBLIC S16 cmPkSchMacCellRegReq(pst, regReq)
868 RgInfCellReg* regReq;
871 Buffer *mBuf = NULLP;
872 TRC2(cmPkSchMacCellRegReq)
874 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
878 #ifdef MS_MBUF_CORRUPTION
879 MS_BUF_ADD_ALLOC_CALLER();
881 if(SAddPstMsgMult((Data *)regReq, sizeof(RgInfCellReg), mBuf) != ROK)
883 RGSCHINF_FREE_MSG(mBuf);
887 pst->event = (Event) EVTINFCELLREGREQ;
888 RETVALUE(SPstTsk(pst,mBuf));
892 * @brief Request from RLC to MAC for forwarding SDUs on
893 * dedicated channel for transmission.
897 * Function : cmUnpkSchMacCellRegReq
899 * @param[in] Pst* pst
900 * @param[in] SpId spId
901 * @param[in] RguDDatReqInfo * datReq
906 PUBLIC S16 cmUnpkSchMacCellRegReq
913 PUBLIC S16 cmUnpkSchMacCellRegReq(func, pst, mBuf)
921 TRC2(cmUnpkSchMacCellRegReq)
923 if(SRemPreMsgMult((Data *)®Req, sizeof(RgInfCellReg), mBuf) != ROK)
925 RGSCHINF_FREE_MSG(mBuf);
929 RGSCHINF_FREE_MSG(mBuf);
930 RETVALUE((*func)(pst, ®Req));
934 * @brief Primitive from SCH to MAC to register GBR LCG per UE
938 * Function : cmPkSchMacLcgRegReq
940 * @param[in] Pst* pst
941 * @param[in] RgInfLcgRegReq *lcgRegReq
946 PUBLIC S16 cmPkSchMacLcgRegReq
949 RgInfLcgRegReq *lcgRegReq
952 PUBLIC S16 cmPkSchMacLcgRegReq(pst, lcgRegReq)
954 RgInfLcgRegReq *lcgRegReq;
957 Buffer *mBuf = NULLP;
959 TRC2(cmPkSchMacLcgRegReq)
961 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
965 if(SAddPstMsgMult((Data *)lcgRegReq, sizeof(RgInfLcgRegReq), mBuf) != ROK)
967 RGSCHINF_FREE_MSG(mBuf);
971 pst->event = (Event) EVTINFLCGREG;
972 RETVALUE(SPstTsk(pst,mBuf));
973 } /* end of cmPkSchMacLcgRegReq */
976 * @brief Primitive from SCH to MAC to register GBR LCG
980 * Function : cmUnpkSchMacLcgRegReq
982 * @param[in] LcgReg func
983 * @param[in] Pst* pst
984 * @param[in] Buffer *mBuf
989 PUBLIC S16 cmUnpkSchMacLcgRegReq
996 PUBLIC S16 cmUnpkSchMacLcgRegReq(func, pst, mBuf)
1002 RgInfLcgRegReq *lcgRegReq;
1004 TRC2(cmUnpkSchMacLcgRegReq)
1006 if(cmUnpkPtr((PTR *)&lcgRegReq, mBuf) != ROK)
1008 RGSCHINF_FREE_MSG(mBuf);
1012 RGSCHINF_FREE_MSG(mBuf);
1013 RETVALUE((*func)(pst, lcgRegReq));
1014 } /* end of cmUnpkSchMacLcgRegReq */
1019 * @brief Primitive from SCH to MAC to register the set of SPS LCs per UE
1023 * Function : cmPkSchMacSpsLcRegReq
1025 * @param[in] Pst* pst
1026 * @param[in] RgInfSpsLcInfo *lcInfo
1031 PUBLIC S16 cmPkSchMacSpsLcRegReq
1034 RgInfSpsLcInfo *lcInfo
1037 PUBLIC S16 cmPkSchMacSpsLcRegReq(pst, lcInfo)
1039 RgInfSpsLcInfo *lcInfo;
1042 Buffer *mBuf = NULLP;
1044 TRC2(cmPkSchMacSpsLcRegReq)
1046 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1050 if(cmPkPtr((PTR)lcInfo, mBuf) != ROK)
1052 RGSCHINF_FREE_MSG(mBuf);
1056 pst->event = (Event) EVTINFSPSLCREG;
1057 RETVALUE(SPstTsk(pst,mBuf));
1058 } /* end of cmPkSchMacSpsLcRegReq */
1061 * @brief Primitive from SCH to MAC to reset SPS Params for the UE
1065 * Function : cmPkSchMacUlSpsResetReq
1067 * @param[in] Pst* pst
1068 * @param[in] RgInfUlSpsReset *ulSpsResetInfo
1073 PUBLIC S16 cmPkSchMacUlSpsResetReq
1076 RgInfUlSpsReset *ulSpsResetInfo
1079 PUBLIC S16 cmPkSchMacUlSpsResetReq(pst, ulSpsResetInfo)
1081 RgInfUlSpsReset *ulSpsResetInfo;
1084 Buffer *mBuf = NULLP;
1086 TRC2(cmPkSchMacUlSpsResetReq)
1088 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1092 if(cmPkPtr((PTR)ulSpsResetInfo, mBuf) != ROK)
1094 RGSCHINF_FREE_MSG(mBuf);
1098 pst->event = (Event) EVTINFSPSRESET;
1099 RETVALUE(SPstTsk(pst,mBuf));
1100 } /* end of cmPkSchMacUlSpsResetReq */
1103 * @brief Primitive from SCH to MAC to register the set of SPS LCs per UE
1107 * Function : cmUnpkSchMacSpsLcRegReq
1109 * @param[in] SpsLcReg func
1110 * @param[in] Pst* pst
1111 * @param[in] Buffer *mBuf
1116 PUBLIC S16 cmUnpkSchMacSpsLcRegReq
1123 PUBLIC S16 cmUnpkSchMacSpsLcRegReq(func, pst, mBuf)
1129 RgInfSpsLcInfo *lcInfo;
1131 TRC2(cmUnpkSchMacSpsLcRegReq)
1133 if(cmUnpkPtr((PTR *)&lcInfo, mBuf) != ROK)
1135 RGSCHINF_FREE_MSG(mBuf);
1139 RGSCHINF_FREE_MSG(mBuf);
1140 RETVALUE((*func)(pst, lcInfo));
1141 } /* end of cmUnpkSchMacSpsLcRegReq */
1146 * @brief Primitive from SCH to MAC to reset UL SPS params
1150 * Function : cmUnpkSchMacUlSpsResetReq
1152 * @param[in] UlSpsReset func
1153 * @param[in] Pst* pst
1154 * @param[in] Buffer *mBuf
1159 PUBLIC S16 cmUnpkSchMacUlSpsResetReq
1166 PUBLIC S16 cmUnpkSchMacUlSpsResetReq(func, pst, mBuf)
1172 RgInfUlSpsReset *ulSpsResetInfo;
1174 TRC2(cmUnpkSchMacUlSpsResetReq)
1176 if(cmUnpkPtr((PTR *)&ulSpsResetInfo, mBuf) != ROK)
1178 RGSCHINF_FREE_MSG(mBuf);
1182 RGSCHINF_FREE_MSG(mBuf);
1183 RETVALUE((*func)(pst, ulSpsResetInfo));
1184 } /* end of cmUnpkSchMacUlSpsResetReq */
1189 * @brief Primitive from SCH to MAC to deregister the set of SPS LCs per UE
1193 * Function : cmPkSchMacSpsLcDeregReq
1195 * @param[in] Pst* pst
1196 * @param[in] CmLteCellId cellId,
1197 * @param[in] CmLteRnti crnti
1202 PUBLIC S16 cmPkSchMacSpsLcDeregReq
1209 PUBLIC S16 cmPkSchMacSpsLcDeregReq(pst, cellId, crnti)
1215 Buffer *mBuf = NULLP;
1217 TRC2(cmPkSchMacSpsLcDeregReq)
1219 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1223 CMCHKPK(cmPkLteCellId, cellId, mBuf);
1224 CMCHKPK(cmPkLteRnti, crnti, mBuf);
1226 pst->event = (Event) EVTINFSPSLCDEREG;
1227 RETVALUE(SPstTsk(pst,mBuf));
1228 } /* end of cmPkSchMacSpsLcDeregReq */
1231 * @brief Primitive from SCH to MAC to deregister the set of SPS LCs per UE
1235 * Function : cmUnpkSchMacSpsLcDeregReq
1237 * @param[in] SpsLcDereg func
1238 * @param[in] Pst* pst
1239 * @param[in] Buffer *mBuf
1244 PUBLIC S16 cmUnpkSchMacSpsLcDeregReq
1251 PUBLIC S16 cmUnpkSchMacSpsLcDeregReq(func, pst, mBuf)
1260 TRC2(cmUnpkSchMacSpsLcDeregReq)
1262 CMCHKUNPK(cmUnpkLteRnti, &crnti, mBuf);
1263 CMCHKUNPK(cmUnpkLteCellId, &cellId, mBuf);
1265 RGSCHINF_FREE_MSG(mBuf);
1266 RETVALUE((*func)(pst, cellId, crnti));
1267 } /* end of cmUnpkSchMacSpsLcDeregReq */
1269 #endif /* LTEMAC_SPS */
1273 * @brief Primitive from SCH to MAC for L2 Measurement
1277 * Function : cmPkSchMacL2MeasReq
1279 * @param[in] Pst* pst
1280 * @param[in] RgInfSpsLcInfo *lcInfo
1285 PUBLIC S16 cmPkSchMacL2MeasReq
1288 RgInfL2MeasReq *measInfo
1291 PUBLIC S16 cmPkSchMacL2MeasReq(pst, measInfo)
1293 RgInfL2MeasReq *measInfo;
1296 Buffer *mBuf = NULLP;
1298 TRC2(cmPkSchMacL2MeasReq)
1300 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1303 if(SAddPstMsgMult((Data *)measInfo, sizeof(RgInfL2MeasReq), mBuf) != ROK)
1305 RGSCHINF_FREE_MSG(mBuf);
1309 pst->event = (Event) EVTINFL2MEASREQ;
1310 RETVALUE(SPstTsk(pst,mBuf));
1311 } /* end of cmPkSchMacL2MeasReq */
1314 * @brief Primitive from SCH to MAC for L2 Stop Measurement
1318 * Function : cmPkSchMacL2MeasStopReq
1320 * @param[in] Pst* pst
1321 * @param[in] RgInfSpsLcInfo *lcInfo
1326 PUBLIC S16 cmPkSchMacL2MeasStopReq
1329 RgInfL2MeasStopReq *measInfo
1332 PUBLIC S16 cmPkSchMacL2MeasStopReq(pst, measInfo)
1334 RgInfL2MeasStopReq *measInfo;
1337 Buffer *mBuf = NULLP;
1339 TRC2(cmPkSchMacL2MeasStopReq)
1341 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1344 if(SAddPstMsgMult((Data *)measInfo, sizeof(RgInfL2MeasStopReq), mBuf) != ROK)
1350 pst->event = (Event) EVTINFL2MEASSTOPREQ;
1351 RETVALUE(SPstTsk(pst,mBuf));
1352 } /* end of cmPkSchMacL2MeasStopReq */
1354 * @brief Primitive from SCH to MAC for L2 Measurement
1358 * Function : cmPkSchMacL2MeasSendReq
1360 * @param[in] Pst* pst
1361 * @param[in] RgInfSpsLcInfo *lcInfo
1366 PUBLIC S16 cmPkSchMacL2MeasSendReq
1369 RgInfL2MeasSndReq *measInfo
1372 PUBLIC S16 cmPkSchMacL2MeasSendReq(pst, measInfo)
1374 RgInfL2MeasSndReq *measInfo;
1377 Buffer *mBuf = NULLP;
1379 TRC2(cmPkSchMacL2MeasSendReq)
1380 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1384 if(SAddPstMsgMult((Data *)measInfo, sizeof(RgInfL2MeasSndReq), mBuf) != ROK)
1390 pst->event = (Event) EVTINFL2MEASSENDREQ;
1391 RETVALUE(SPstTsk(pst,mBuf));
1392 } /* end of cmPkSchMacL2MeasSendReq */
1395 * @brief Primitive from SCH to MAC for L2 Measurement request
1399 * Function : cmUnpkSchMacL2MeasReq
1401 * @param[in] L2MeasReg func
1402 * @param[in] Pst* pst
1403 * @param[in] Buffer *mBuf
1408 PUBLIC S16 cmUnpkSchMacL2MeasReq
1415 PUBLIC S16 cmUnpkSchMacL2MeasReq(func, pst, mBuf)
1421 RgInfL2MeasReq measInfo;
1423 TRC2(cmUnpkSchMacL2MeasReq)
1425 if(SRemPreMsgMult((Data *)&measInfo, sizeof(RgInfL2MeasReq), mBuf) != ROK)
1427 RGSCHINF_FREE_MSG(mBuf);
1431 RGSCHINF_FREE_MSG(mBuf);
1432 RETVALUE((*func)(pst, &measInfo));
1433 } /* end of cmUnpkSchMacL2MeasReq */
1436 * @brief Primitive from SCH to MAC for L2 Measurement Stop request
1440 * Function : cmUnpkSchMacL2MeasStopReq
1442 * @param[in] L2MeasReg func
1443 * @param[in] Pst* pst
1444 * @param[in] Buffer *mBuf
1449 PUBLIC S16 cmUnpkSchMacL2MeasStopReq
1456 PUBLIC S16 cmUnpkSchMacL2MeasStopReq(func, pst, mBuf)
1462 RgInfL2MeasStopReq measInfo;
1464 TRC2(cmUnpkSchMacL2MeasStopReq)
1465 if(SRemPreMsgMult((Data *)&measInfo, sizeof(RgInfL2MeasStopReq), mBuf) != ROK)
1472 RETVALUE((*func)(pst, &measInfo));
1473 } /* end of cmUnpkSchMacL2MeasReq */
1475 * @brief Primitive from SCH to MAC for L2 Measurement request
1479 * Function : cmUnpkSchMacL2MeasReq
1481 * @param[in] L2MeasReg func
1482 * @param[in] Pst* pst
1483 * @param[in] Buffer *mBuf
1488 PUBLIC S16 cmUnpkSchMacL2MeasSendReq
1495 PUBLIC S16 cmUnpkSchMacL2MeasSendReq(func, pst, mBuf)
1501 RgInfL2MeasSndReq measInfo;
1503 TRC2(cmUnpkSchMacL2MeasSendReq)
1504 if(SRemPreMsgMult((Data *)&measInfo, sizeof(RgInfL2MeasSndReq), mBuf) != ROK)
1511 RETVALUE((*func)(pst, &measInfo));
1512 } /* end of cmUnpkSchMacL2MeasSendReq*/
1515 * @brief Primitive from MAC to SCH for L2 Measurement
1519 * Function : cmPkMacSchL2MeasCfm
1521 * @param[in] Pst* pst
1522 * @param[in] RgInfL2MeasCfm *measInfo
1527 PUBLIC S16 cmPkMacSchL2MeasCfm
1530 RgInfL2MeasCfm *measCfm
1533 PUBLIC S16 cmPkMacSchL2MeasCfm(pst, measCfm)
1535 RgInfL2MeasCfm *measCfm;
1538 Buffer *mBuf = NULLP;
1540 TRC2(cmPkMacSchL2MeasCfm)
1542 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1546 if(SAddPstMsgMult((Data *)measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
1548 RGSCHINF_FREE_MSG(mBuf);
1552 pst->event = (Event) EVTINFL2MEASCFM;
1553 RETVALUE(SPstTsk(pst,mBuf));
1554 } /* end of cmPkMacSchL2MeasCfm */
1558 * @brief Primitive from MAC to SCH for L2 Measurement
1562 * Function : cmPkMacSchL2MeasStopCfm
1564 * @param[in] Pst* pst
1565 * @param[in] RgInfL2MeasCfm *measInfo
1570 PUBLIC S16 cmPkMacSchL2MeasStopCfm
1573 RgInfL2MeasCfm *measCfm
1576 PUBLIC S16 cmPkMacSchL2MeasStopCfm(pst, measCfm)
1578 RgInfL2MeasCfm *measCfm;
1581 Buffer *mBuf = NULLP;
1583 TRC2(cmPkMacSchL2MeasStopCfm)
1584 if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1588 if(SAddPstMsgMult((Data *)measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
1594 pst->event = (Event) EVTINFL2MEASSTOPCFM;
1595 RETVALUE(SPstTsk(pst,mBuf));
1596 }/*cmPkMacSchL2MeasStopCfm*/
1598 * @brief Primitive from MAC to SCH for L2 Measurement Cfm
1602 * Function : cmUnpkSchMacL2MeasReq
1604 * @param[in] L2MeasCfm func
1605 * @param[in] Pst* pst
1606 * @param[in] Buffer *mBuf
1611 PUBLIC S16 cmUnpkMacSchL2MeasCfm
1618 PUBLIC S16 cmUnpkMacSchL2MeasCfm(func, pst, mBuf)
1624 RgInfL2MeasCfm measCfm;
1626 TRC2(cmUnpkMacSchL2MeasCfm)
1628 if(SRemPreMsgMult((Data *)&measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
1630 RGSCHINF_FREE_MSG(mBuf);
1634 RGSCHINF_FREE_MSG(mBuf);
1635 RETVALUE((*func)(pst, &measCfm));
1636 } /* end of cmUnpkMacSchL2MeasCfm */
1639 * @brief Primitive from MAC to SCH for L2 Measurement Stop Cfm
1643 * Function : cmUnpkMacSchL2MeasStopCfm
1645 * @param[in] L2MeasCfm func
1646 * @param[in] Pst* pst
1647 * @param[in] Buffer *mBuf
1652 PUBLIC S16 cmUnpkMacSchL2MeasStopCfm
1659 PUBLIC S16 cmUnpkMacSchL2MeasStopCfm(func, pst, mBuf)
1665 RgInfL2MeasCfm measCfm;
1667 TRC2(cmUnpkMacSchL2MeasStopCfm)
1669 if(SRemPreMsgMult((Data *)&measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
1676 RETVALUE((*func)(pst, &measCfm));
1677 } /* end of cmUnpkMacSchL2MeasStopCfm */
1679 #endif/* LTE_L2_MEAS */
1684 /**********************************************************************
1687 **********************************************************************/