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 Entry point fucntions
29 **********************************************************************/
32 @brief APIs related to Downlink HARQ.
35 /* header include files (.h) */
36 #include "envopt.h" /* environment options */
37 #include "envdep.h" /* environment dependent */
38 #include "envind.h" /* environment independent */
39 #include "gen.h" /* general */
40 #include "ssi.h" /* system services */
41 #include "cm_tkns.h" /* Common Token Defines */
42 #include "cm_llist.h" /* Common Link List Defines */
43 #include "cm_hash.h" /* Common Hash List Defines */
45 #include "cm_lte.h" /* Common LTE Defines */
46 #include "tfu.h" /* RGU Interface defines */
48 /* header/extern include files (.x) */
49 #include "gen.x" /* general */
50 #include "ssi.x" /* system services */
51 #include "cm_tkns.x" /* Common Token Definitions */
52 #include "cm_llist.x" /* Common Link List Definitions */
53 #include "cm_lib.x" /* Common Library Definitions */
54 #include "cm_hash.x" /* Common Hash List Definitions */
56 #include "cm_lte.x" /* Common LTE Defines */
57 #include "tfu.x" /* RGU Interface includes */
62 #endif /* __cplusplus */
64 #if !(defined(LCRGLITFU) && defined(TF) && defined(LWLCRGLITFU))
69 /* MAX Number of Service Providers of RG */
70 #define RG_MAX_TFU_PROV 3
73 /** @brief This API is used to send a Bind Request from MAC to PHY.
74 * @param pst Pointer to the post structure.
75 * @param suId SAP ID of the service user.
76 * @param spId SAP ID of the service provider.
79 EXTERN S16 PtLiTfuBndReq ARGS((Pst * pst, SuId suId, SpId spId));
80 /** @brief This API is used to send a Bind Request from Scheduler to PHY.
81 * @param pst Pointer to the post structure.
82 * @param suId SAP ID of the service user.
83 * @param spId SAP ID of the service provider.
86 EXTERN S16 PtLiTfuSchBndReq ARGS((Pst * pst, SuId suId, SpId spId));
87 /** @brief This API is used to send an Unbind Request from MAC to PHY.
88 * @param pst Pointer to the post structure.
89 * @param suId SAP ID of the service provider.
90 * @param reason Reason for Unbind request.
93 EXTERN S16 PtLiTfuUbndReq ARGS((Pst * pst, SpId spId, Reason reason));
94 /** @brief This API is used to send an Unbind Request from Scheduler to PHY.
95 * @param pst Pointer to the post structure.
96 * @param suId SAP ID of the service provider.
97 * @param reason Reason for Unbind request.
100 EXTERN S16 PtLiTfuSchUbndReq ARGS((Pst * pst, SpId spId, Reason reason));
101 /** @brief This primitive is sent from Scheduler to PHY.
102 * @details This primitive provides PHY with all the information required by
103 * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
104 * -# On PUCCH UE can transmit the following
110 * -# On PUSCH UE can transmit the following
113 * -# Data + HARQ Feedback
114 * This primitive carries all the information for the expected subframe for all
115 * the UEs that have been scheduled to transmit.
116 * @param pst Pointer to the post structure.
117 * @param spId SAP ID of the service provider.
118 * @param recpReq Pointer to the TfuRecpReqInfo structure.
119 * @return ROK/RFAILED
121 EXTERN S16 PtLiTfuRecpReq ARGS((Pst * pst, SpId spId, TfuRecpReqInfo * recpReq));
122 /** @brief This Primitive is sent from Scheduler to PHY. It provides PHY with
123 * all the control information
124 * @details This primitive carries the information sent on the following
132 * @param cntrlReq pointer to TfuCntrlReqInfo
133 * @return ROK/RFAILED
135 EXTERN S16 PtLiTfuCntrlReq ARGS((Pst * pst, SpId spId, TfuCntrlReqInfo * cntrlReq));
136 /** @brief This Primitive carries the Data PDUs from MAC to PHY for
138 * @details The data being sent in this primitive is meant to be transmitted on
139 * the downlink channel PDSCH and PBCH (if present). To facilitate physical
140 * layer processing, requisite control information is also sent along with the
142 * @sa TfUiTfuCntrlReq
145 * @param tfuDatReq pointer to TfuDatReqInfo
148 EXTERN S16 PtLiTfuDatReq ARGS((Pst * pst, SpId spId, TfuDatReqInfo * datReq));
150 /** @brief This Primitive carries cellId and UeId for which datReq need to be deleted.
151 * @details This primitive is used to send delDatReq to CL to delete the PDUs of
152 * UE which has been deleted in MAC due to ueId change or anyother scenario
153 * @details The data being sent in this primitive is meant to be transmitted on
154 * @sa TfUiTfuDelDatReq
157 * @param tfuDelDatReq pointer to TfuDelDatReqInfo
160 EXTERN S16 PtLiTfuDelDatReq ARGS((Pst * pst, SpId spId, TfuDelDatReqInfo * datReq));
162 #endif /*--#ifdef PTRGLITFU--*/
164 /** @brief This API is used to send a Bind Request from MAC to PHY.
165 * @param pst Pointer to the post structure.
166 * @param suId SAP ID of the service user.
167 * @param spId SAP ID of the service provider.
168 * @return ROK/RFAILED
170 PRIVATE CONSTANT TfuBndReq RgLiTfuBndReqMt[RG_MAX_TFU_PROV] =
189 /** @brief This API is used to send a Bind Request from Scheduler to PHY.
190 * @param pst Pointer to the post structure.
191 * @param suId SAP ID of the service user.
192 * @param spId SAP ID of the service provider.
193 * @return ROK/RFAILED
195 PRIVATE CONSTANT TfuSchBndReq RgLiTfuSchBndReqMt[RG_MAX_TFU_PROV] =
214 /** @brief This API is used to send an Unbind Request from MAC to PHY.
215 * @param pst Pointer to the post structure.
216 * @param suId SAP ID of the service provider.
217 * @param reason Reason for Unbind request.
218 * @return ROK/RFAILED
220 PRIVATE CONSTANT TfuUbndReq RgLiTfuUbndReqMt[RG_MAX_TFU_PROV] =
239 /** @brief This API is used to send an Unbind Request from Scheduler to PHY.
240 * @param pst Pointer to the post structure.
241 * @param suId SAP ID of the service provider.
242 * @param reason Reason for Unbind request.
243 * @return ROK/RFAILED
245 PRIVATE CONSTANT TfuSchUbndReq RgLiTfuSchUbndReqMt[RG_MAX_TFU_PROV] =
264 /** @brief This primitive is sent from Scheduler to PHY.
265 * @details This primitive provides PHY with all the information required by
266 * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
267 * -# On PUCCH UE can transmit the following
273 * -# On PUSCH UE can transmit the following
276 * -# Data + HARQ Feedback
277 * This primitive carries all the information for the expected subframe for all
278 * the UEs that have been scheduled to transmit.
279 * @param pst Pointer to the post structure.
280 * @param spId SAP ID of the service provider.
281 * @param recpReq Pointer to the TfuRecpReqInfo structure.
282 * @return ROK/RFAILED
284 PRIVATE CONSTANT TfuRecpReq RgLiTfuRecpReqMt[RG_MAX_TFU_PROV] =
303 /** @brief This Primitive is sent from Scheduler to PHY. It provides PHY with
304 * all the control information
305 * @details This primitive carries the information sent on the following
313 * @param cntrlReq pointer to TfuCntrlReqInfo
314 * @return ROK/RFAILED
316 PRIVATE CONSTANT TfuCntrlReq RgLiTfuCntrlReqMt[RG_MAX_TFU_PROV] =
335 /** @brief This Primitive carries the Data PDUs from MAC to PHY for
337 * @details The data being sent in this primitive is meant to be transmitted on
338 * the downlink channel PDSCH and PBCH (if present). To facilitate physical
339 * layer processing, requisite control information is also sent along with the
341 * @sa TfUiTfuCntrlReq
344 * @param tfuDatReq pointer to TfuDatReqInfo
347 PRIVATE CONSTANT TfuDatReq RgLiTfuDatReqMt[RG_MAX_TFU_PROV] =
367 /** @brief This Primitive carries cellId and UeId for which datReq need to be deleted.
368 * @details This primitive is used to send delDatReq to CL to delete the PDUs of
369 * UE which has been deleted in MAC due to ueId change or anyother scenario
370 * NOTE:: This API is only supported for TC because race condition issue
371 * happens only in case of TC
372 * @sa TfUiTfuDelDatReq
375 * @param tfuDelDatReq pointer to TfuDelDatReqInfo
378 PRIVATE CONSTANT TfuDelDatReq RgLiTfuDelDatReqMt[RG_MAX_TFU_PROV] =
381 PtLiTfuDelDatReq, /*calling dummy api as LC not required for this privitive*/
391 PtLiTfuDelDatReq, /*calling dummy api as LWLC not required for this privitive*/
402 /***********************************************************
404 * Func : RgLiTfuBndReq
407 * Desc : This API is used to send a Bind Request from MAC to PHY.
408 * @param pst Pointer to the post structure.
409 * @param suId SAP ID of the service user.
410 * @param spId SAP ID of the service provider.
411 * @return ROK/RFAILED
420 **********************************************************/
422 PUBLIC S16 RgLiTfuBndReq
429 PUBLIC S16 RgLiTfuBndReq(pst, suId, spId)
438 RETVALUE((*RgLiTfuBndReqMt[pst->selector])(pst, suId, spId));
444 /***********************************************************
446 * Func : RgLiTfuSchBndReq
449 * Desc : This API is used to send a Bind Request from Scheduler to PHY.
450 * @param pst Pointer to the post structure.
451 * @param suId SAP ID of the service user.
452 * @param spId SAP ID of the service provider.
453 * @return ROK/RFAILED
462 **********************************************************/
464 PUBLIC S16 RgLiTfuSchBndReq
471 PUBLIC S16 RgLiTfuSchBndReq(pst, suId, spId)
478 TRC3(RgLiTfuSchBndReq)
480 RETVALUE((*RgLiTfuSchBndReqMt[pst->selector])(pst, suId, spId));
486 /***********************************************************
488 * Func : RgLiTfuUbndReq
491 * Desc : This API is used to send an Unbind Request from MAC to PHY.
492 * @param pst Pointer to the post structure.
493 * @param suId SAP ID of the service provider.
494 * @param reason Reason for Unbind request.
495 * @return ROK/RFAILED
504 **********************************************************/
506 PUBLIC S16 RgLiTfuUbndReq
513 PUBLIC S16 RgLiTfuUbndReq(pst, spId, reason)
522 RETVALUE((*RgLiTfuUbndReqMt[pst->selector])(pst, spId, reason));
528 /***********************************************************
530 * Func : RgLiTfuSchUbndReq
533 * Desc : This API is used to send an Unbind Request from Scheduler to PHY.
534 * @param pst Pointer to the post structure.
535 * @param suId SAP ID of the service provider.
536 * @param reason Reason for Unbind request.
537 * @return ROK/RFAILED
546 **********************************************************/
548 PUBLIC S16 RgLiTfuSchUbndReq
555 PUBLIC S16 RgLiTfuSchUbndReq(pst, spId, reason)
562 TRC3(RgLiTfuSchUbndReq)
564 RETVALUE((*RgLiTfuSchUbndReqMt[pst->selector])(pst, spId, reason));
570 /***********************************************************
572 * Func : RgLiTfuRecpReq
575 * Desc : This primitive is sent from Scheduler to PHY.
576 * @details This primitive provides PHY with all the information required by
577 * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
578 * -# On PUCCH UE can transmit the following
584 * -# On PUSCH UE can transmit the following
587 * -# Data + HARQ Feedback
588 * This primitive carries all the information for the expected subframe for all
589 * the UEs that have been scheduled to transmit.
590 * @param pst Pointer to the post structure.
591 * @param spId SAP ID of the service provider.
592 * @param recpReq Pointer to the TfuRecpReqInfo structure.
593 * @return ROK/RFAILED
602 **********************************************************/
604 PUBLIC S16 RgLiTfuRecpReq
608 TfuRecpReqInfo * recpReq
611 PUBLIC S16 RgLiTfuRecpReq(pst, spId, recpReq)
614 TfuRecpReqInfo * recpReq;
620 RETVALUE((*RgLiTfuRecpReqMt[pst->selector])(pst, spId, recpReq));
626 /***********************************************************
628 * Func : RgLiTfuCntrlReq
631 * Desc : This Primitive is sent from Scheduler to PHY. It provides PHY with
632 * all the control information
633 * @details This primitive carries the information sent on the following
641 * @param cntrlReq pointer to TfuCntrlReqInfo
642 * @return ROK/RFAILED
651 **********************************************************/
653 PUBLIC S16 RgLiTfuCntrlReq
657 TfuCntrlReqInfo * cntrlReq
660 PUBLIC S16 RgLiTfuCntrlReq(pst, spId, cntrlReq)
663 TfuCntrlReqInfo * cntrlReq;
667 TRC3(RgLiTfuCntrlReq)
669 RETVALUE((*RgLiTfuCntrlReqMt[pst->selector])(pst, spId, cntrlReq));
675 /***********************************************************
677 * Func : RgLiTfuDatReq
680 * Desc : This Primitive carries the Data PDUs from MAC to PHY for
682 * @details The data being sent in this primitive is meant to be transmitted on
683 * the downlink channel PDSCH and PBCH (if present). To facilitate physical
684 * layer processing, requisite control information is also sent along with the
686 * @sa TfUiTfuCntrlReq
689 * @param tfuDatReq pointer to TfuDatReqInfo
699 **********************************************************/
701 PUBLIC S16 RgLiTfuDatReq
705 TfuDatReqInfo * datReq
708 PUBLIC S16 RgLiTfuDatReq(pst, spId, datReq)
711 TfuDatReqInfo * datReq;
717 RETVALUE((*RgLiTfuDatReqMt[pst->selector])(pst, spId, datReq));
723 /***********************************************************
725 * Func : RgLiTfuDelDatReq
728 * Desc : This Primitive is used to delete datReq in CL when there is ueId change.
729 * @details: This primitive is required when L2_OPMZ flag is elabed. this is required
730 * To delete datRq PDUs from CL for the Ue for which Ue Id got changed or
731 * anyother similar scenario
732 * @sa TfUiTfuDelDatReq
735 * @param tfuDelDatReq pointer to TfuDelDatReqInfo
745 **********************************************************/
747 PUBLIC S16 RgLiTfuDelDatReq
751 TfuDelDatReqInfo * delDatReq
754 PUBLIC S16 RgLiTfuDelDatReq(pst, spId, delDatReq)
757 TfuDelDatReqInfo * delDatReq;
761 TRC3(RgLiTfuDelDatReq)
763 RETVALUE((*RgLiTfuDelDatReqMt[pst->selector])(pst, spId, delDatReq));
768 #endif /*--ifdef RG--*/
774 /***********************************************************
776 * Func : PtLiTfuBndReq
779 * Desc : This API is used to send a Bind Request from MAC to PHY.
780 * @param pst Pointer to the post structure.
781 * @param suId SAP ID of the service user.
782 * @param spId SAP ID of the service provider.
783 * @return ROK/RFAILED
792 **********************************************************/
794 PUBLIC S16 PtLiTfuBndReq
801 PUBLIC S16 PtLiTfuBndReq(pst, suId, spId)
820 /***********************************************************
822 * Func : PtLiTfuSchBndReq
825 * Desc : This API is used to send a Bind Request from Scheduler to PHY.
826 * @param pst Pointer to the post structure.
827 * @param suId SAP ID of the service user.
828 * @param spId SAP ID of the service provider.
829 * @return ROK/RFAILED
838 **********************************************************/
840 PUBLIC S16 PtLiTfuSchBndReq
847 PUBLIC S16 PtLiTfuSchBndReq(pst, suId, spId)
854 TRC3(PtLiTfuSchBndReq)
866 /***********************************************************
868 * Func : PtLiTfuUbndReq
871 * Desc : This API is used to send an Unbind Request from MAC to PHY.
872 * @param pst Pointer to the post structure.
873 * @param suId SAP ID of the service provider.
874 * @param reason Reason for Unbind request.
875 * @return ROK/RFAILED
884 **********************************************************/
886 PUBLIC S16 PtLiTfuUbndReq
893 PUBLIC S16 PtLiTfuUbndReq(pst, spId, reason)
912 /***********************************************************
914 * Func : PtLiTfuSchUbndReq
917 * Desc : This API is used to send an Unbind Request from Scheduler to PHY.
918 * @param pst Pointer to the post structure.
919 * @param suId SAP ID of the service provider.
920 * @param reason Reason for Unbind request.
921 * @return ROK/RFAILED
930 **********************************************************/
932 PUBLIC S16 PtLiTfuSchUbndReq
939 PUBLIC S16 PtLiTfuSchUbndReq(pst, spId, reason)
946 TRC3(PtLiTfuSchUbndReq)
958 /***********************************************************
960 * Func : PtLiTfuRecpReq
963 * Desc : This primitive is sent from Scheduler to PHY.
964 * @details This primitive provides PHY with all the information required by
965 * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
966 * -# On PUCCH UE can transmit the following
972 * -# On PUSCH UE can transmit the following
975 * -# Data + HARQ Feedback
976 * This primitive carries all the information for the expected subframe for all
977 * the UEs that have been scheduled to transmit.
978 * @param pst Pointer to the post structure.
979 * @param spId SAP ID of the service provider.
980 * @param recpReq Pointer to the TfuRecpReqInfo structure.
981 * @return ROK/RFAILED
990 **********************************************************/
992 PUBLIC S16 PtLiTfuRecpReq
996 TfuRecpReqInfo * recpReq
999 PUBLIC S16 PtLiTfuRecpReq(pst, spId, recpReq)
1002 TfuRecpReqInfo * recpReq;
1006 TRC3(PtLiTfuRecpReq)
1018 /***********************************************************
1020 * Func : PtLiTfuCntrlReq
1023 * Desc : This Primitive is sent from Scheduler to PHY. It provides PHY with
1024 * all the control information
1025 * @details This primitive carries the information sent on the following
1033 * @param cntrlReq pointer to TfuCntrlReqInfo
1034 * @return ROK/RFAILED
1043 **********************************************************/
1045 PUBLIC S16 PtLiTfuCntrlReq
1049 TfuCntrlReqInfo * cntrlReq
1052 PUBLIC S16 PtLiTfuCntrlReq(pst, spId, cntrlReq)
1055 TfuCntrlReqInfo * cntrlReq;
1059 TRC3(PtLiTfuCntrlReq)
1071 /***********************************************************
1073 * Func : PtLiTfuDatReq
1076 * Desc : This Primitive carries the Data PDUs from MAC to PHY for
1078 * @details The data being sent in this primitive is meant to be transmitted on
1079 * the downlink channel PDSCH and PBCH (if present). To facilitate physical
1080 * layer processing, requisite control information is also sent along with the
1082 * @sa TfUiTfuCntrlReq
1085 * @param tfuDatReq pointer to TfuDatReqInfo
1095 **********************************************************/
1097 PUBLIC S16 PtLiTfuDatReq
1101 TfuDatReqInfo * datReq
1104 PUBLIC S16 PtLiTfuDatReq(pst, spId, datReq)
1107 TfuDatReqInfo * datReq;
1123 /***********************************************************
1125 * Func : PtLiTfuDelDatReq
1128 * @brief This Primitive carries cellId and UeId for which datReq need to be deleted.
1129 * @details This primitive is used to send delDatReq to CL to delete the PDUs of
1130 * UE which has been deleted in MAC due to ueId change or anyother scenario
1132 * @details The data being sent in this primitive is meant to be transmitted on
1133 * @sa TfUiTfuDelDatReq
1136 * @param tfuDelDatReq pointer to TfuDelDatReqInfo
1146 **********************************************************/
1148 PUBLIC S16 PtLiTfuDelDatReq
1152 TfuDelDatReqInfo * delDatReq
1155 PUBLIC S16 PtLiTfuDelDatReq(pst, spId, delDatReq)
1158 TfuDelDatReqInfo * DelDatReq;
1162 TRC3(PtLiTfuDelDatReq)
1173 #endif /*--ifdef PTRGLITFU--*/
1177 #endif /* __cplusplus */
1179 /**********************************************************************
1182 **********************************************************************/