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 "common_def.h"
37 #include "tfu.h" /* RGU Interface defines */
39 /* header/extern include files (.x) */
40 #include "tfu.x" /* RGU Interface includes */
45 #endif /* __cplusplus */
47 #if !(defined(LCRGLITFU) && defined(TF) && defined(LWLCRGLITFU))
52 /* MAX Number of Service Providers of RG */
53 #define RG_MAX_TFU_PROV 3
56 /** @brief This API is used to send a Bind Request from MAC to PHY.
57 * @param pst Pointer to the post structure.
58 * @param suId SAP ID of the service user.
59 * @param spId SAP ID of the service provider.
62 S16 PtLiTfuBndReq ARGS((Pst * pst, SuId suId, SpId spId));
63 /** @brief This API is used to send a Bind Request from Scheduler to PHY.
64 * @param pst Pointer to the post structure.
65 * @param suId SAP ID of the service user.
66 * @param spId SAP ID of the service provider.
69 S16 PtLiTfuSchBndReq ARGS((Pst * pst, SuId suId, SpId spId));
70 /** @brief This API is used to send an Unbind Request from MAC to PHY.
71 * @param pst Pointer to the post structure.
72 * @param suId SAP ID of the service provider.
73 * @param reason Reason for Unbind request.
76 S16 PtLiTfuUbndReq ARGS((Pst * pst, SpId spId, Reason reason));
77 /** @brief This API is used to send an Unbind Request from Scheduler to PHY.
78 * @param pst Pointer to the post structure.
79 * @param suId SAP ID of the service provider.
80 * @param reason Reason for Unbind request.
83 S16 PtLiTfuSchUbndReq ARGS((Pst * pst, SpId spId, Reason reason));
84 /** @brief This primitive is sent from Scheduler to PHY.
85 * @details This primitive provides PHY with all the information required by
86 * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
87 * -# On PUCCH UE can transmit the following
93 * -# On PUSCH UE can transmit the following
96 * -# Data + HARQ Feedback
97 * This primitive carries all the information for the expected subframe for all
98 * the UEs that have been scheduled to transmit.
99 * @param pst Pointer to the post structure.
100 * @param spId SAP ID of the service provider.
101 * @param recpReq Pointer to the TfuRecpReqInfo structure.
102 * @return ROK/RFAILED
104 S16 PtLiTfuRecpReq ARGS((Pst * pst, SpId spId, TfuRecpReqInfo * recpReq));
105 /** @brief This Primitive is sent from Scheduler to PHY. It provides PHY with
106 * all the control information
107 * @details This primitive carries the information sent on the following
115 * @param cntrlReq pointer to TfuCntrlReqInfo
116 * @return ROK/RFAILED
118 S16 PtLiTfuCntrlReq ARGS((Pst * pst, SpId spId, TfuCntrlReqInfo * cntrlReq));
119 /** @brief This Primitive carries the Data PDUs from MAC to PHY for
121 * @details The data being sent in this primitive is meant to be transmitted on
122 * the downlink channel PDSCH and PBCH (if present). To facilitate physical
123 * layer processing, requisite control information is also sent along with the
125 * @sa TfUiTfuCntrlReq
128 * @param tfuDatReq pointer to TfuDatReqInfo
131 S16 PtLiTfuDatReq ARGS((Pst * pst, SpId spId, TfuDatReqInfo * datReq));
133 /** @brief This Primitive carries cellId and UeId for which datReq need to be deleted.
134 * @details This primitive is used to send delDatReq to CL to delete the PDUs of
135 * UE which has been deleted in MAC due to ueId change or anyother scenario
136 * @details The data being sent in this primitive is meant to be transmitted on
137 * @sa TfUiTfuDelDatReq
140 * @param tfuDelDatReq pointer to TfuDelDatReqInfo
143 S16 PtLiTfuDelDatReq ARGS((Pst * pst, SpId spId, TfuDelDatReqInfo * datReq));
145 #endif /*--#ifdef PTRGLITFU--*/
147 /** @brief This API is used to send a Bind Request from MAC to PHY.
148 * @param pst Pointer to the post structure.
149 * @param suId SAP ID of the service user.
150 * @param spId SAP ID of the service provider.
151 * @return ROK/RFAILED
153 static const TfuBndReq RgLiTfuBndReqMt[RG_MAX_TFU_PROV] =
172 /** @brief This API is used to send a Bind Request from Scheduler to PHY.
173 * @param pst Pointer to the post structure.
174 * @param suId SAP ID of the service user.
175 * @param spId SAP ID of the service provider.
176 * @return ROK/RFAILED
178 static const TfuSchBndReq RgLiTfuSchBndReqMt[RG_MAX_TFU_PROV] =
197 /** @brief This API is used to send an Unbind Request from MAC to PHY.
198 * @param pst Pointer to the post structure.
199 * @param suId SAP ID of the service provider.
200 * @param reason Reason for Unbind request.
201 * @return ROK/RFAILED
203 static const TfuUbndReq RgLiTfuUbndReqMt[RG_MAX_TFU_PROV] =
222 /** @brief This API is used to send an Unbind Request from Scheduler to PHY.
223 * @param pst Pointer to the post structure.
224 * @param suId SAP ID of the service provider.
225 * @param reason Reason for Unbind request.
226 * @return ROK/RFAILED
228 static const TfuSchUbndReq RgLiTfuSchUbndReqMt[RG_MAX_TFU_PROV] =
247 /** @brief This primitive is sent from Scheduler to PHY.
248 * @details This primitive provides PHY with all the information required by
249 * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
250 * -# On PUCCH UE can transmit the following
256 * -# On PUSCH UE can transmit the following
259 * -# Data + HARQ Feedback
260 * This primitive carries all the information for the expected subframe for all
261 * the UEs that have been scheduled to transmit.
262 * @param pst Pointer to the post structure.
263 * @param spId SAP ID of the service provider.
264 * @param recpReq Pointer to the TfuRecpReqInfo structure.
265 * @return ROK/RFAILED
267 static const TfuRecpReq RgLiTfuRecpReqMt[RG_MAX_TFU_PROV] =
286 /** @brief This Primitive is sent from Scheduler to PHY. It provides PHY with
287 * all the control information
288 * @details This primitive carries the information sent on the following
296 * @param cntrlReq pointer to TfuCntrlReqInfo
297 * @return ROK/RFAILED
299 static const TfuCntrlReq RgLiTfuCntrlReqMt[RG_MAX_TFU_PROV] =
318 /** @brief This Primitive carries the Data PDUs from MAC to PHY for
320 * @details The data being sent in this primitive is meant to be transmitted on
321 * the downlink channel PDSCH and PBCH (if present). To facilitate physical
322 * layer processing, requisite control information is also sent along with the
324 * @sa TfUiTfuCntrlReq
327 * @param tfuDatReq pointer to TfuDatReqInfo
330 static const TfuDatReq RgLiTfuDatReqMt[RG_MAX_TFU_PROV] =
350 /** @brief This Primitive carries cellId and UeId for which datReq need to be deleted.
351 * @details This primitive is used to send delDatReq to CL to delete the PDUs of
352 * UE which has been deleted in MAC due to ueId change or anyother scenario
353 * NOTE:: This API is only supported for TC because race condition issue
354 * happens only in case of TC
355 * @sa TfUiTfuDelDatReq
358 * @param tfuDelDatReq pointer to TfuDelDatReqInfo
361 static const TfuDelDatReq RgLiTfuDelDatReqMt[RG_MAX_TFU_PROV] =
364 PtLiTfuDelDatReq, /*calling dummy api as LC not required for this privitive*/
374 PtLiTfuDelDatReq, /*calling dummy api as LWLC not required for this privitive*/
385 /***********************************************************
387 * Func : RgLiTfuBndReq
390 * Desc : This API is used to send a Bind Request from MAC to PHY.
391 * @param pst Pointer to the post structure.
392 * @param suId SAP ID of the service user.
393 * @param spId SAP ID of the service provider.
394 * @return ROK/RFAILED
403 **********************************************************/
412 S16 RgLiTfuBndReq(pst, suId, spId)
419 return ((*RgLiTfuBndReqMt[pst->selector])(pst, suId, spId));
425 /***********************************************************
427 * Func : RgLiTfuSchBndReq
430 * Desc : This API is used to send a Bind Request from Scheduler to PHY.
431 * @param pst Pointer to the post structure.
432 * @param suId SAP ID of the service user.
433 * @param spId SAP ID of the service provider.
434 * @return ROK/RFAILED
443 **********************************************************/
452 S16 RgLiTfuSchBndReq(pst, suId, spId)
459 return ((*RgLiTfuSchBndReqMt[pst->selector])(pst, suId, spId));
465 /***********************************************************
467 * Func : RgLiTfuUbndReq
470 * Desc : This API is used to send an Unbind Request from MAC to PHY.
471 * @param pst Pointer to the post structure.
472 * @param suId SAP ID of the service provider.
473 * @param reason Reason for Unbind request.
474 * @return ROK/RFAILED
483 **********************************************************/
492 S16 RgLiTfuUbndReq(pst, spId, reason)
499 return ((*RgLiTfuUbndReqMt[pst->selector])(pst, spId, reason));
505 /***********************************************************
507 * Func : RgLiTfuSchUbndReq
510 * Desc : This API is used to send an Unbind Request from Scheduler to PHY.
511 * @param pst Pointer to the post structure.
512 * @param suId SAP ID of the service provider.
513 * @param reason Reason for Unbind request.
514 * @return ROK/RFAILED
523 **********************************************************/
525 S16 RgLiTfuSchUbndReq
532 S16 RgLiTfuSchUbndReq(pst, spId, reason)
539 return ((*RgLiTfuSchUbndReqMt[pst->selector])(pst, spId, reason));
545 /***********************************************************
547 * Func : RgLiTfuRecpReq
550 * Desc : This primitive is sent from Scheduler to PHY.
551 * @details This primitive provides PHY with all the information required by
552 * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
553 * -# On PUCCH UE can transmit the following
559 * -# On PUSCH UE can transmit the following
562 * -# Data + HARQ Feedback
563 * This primitive carries all the information for the expected subframe for all
564 * the UEs that have been scheduled to transmit.
565 * @param pst Pointer to the post structure.
566 * @param spId SAP ID of the service provider.
567 * @param recpReq Pointer to the TfuRecpReqInfo structure.
568 * @return ROK/RFAILED
577 **********************************************************/
583 TfuRecpReqInfo * recpReq
586 S16 RgLiTfuRecpReq(pst, spId, recpReq)
589 TfuRecpReqInfo * recpReq;
593 return ((*RgLiTfuRecpReqMt[pst->selector])(pst, spId, recpReq));
599 /***********************************************************
601 * Func : RgLiTfuCntrlReq
604 * Desc : This Primitive is sent from Scheduler to PHY. It provides PHY with
605 * all the control information
606 * @details This primitive carries the information sent on the following
614 * @param cntrlReq pointer to TfuCntrlReqInfo
615 * @return ROK/RFAILED
624 **********************************************************/
630 TfuCntrlReqInfo * cntrlReq
633 S16 RgLiTfuCntrlReq(pst, spId, cntrlReq)
636 TfuCntrlReqInfo * cntrlReq;
640 return ((*RgLiTfuCntrlReqMt[pst->selector])(pst, spId, cntrlReq));
646 /***********************************************************
648 * Func : RgLiTfuDatReq
651 * Desc : This Primitive carries the Data PDUs from MAC to PHY for
653 * @details The data being sent in this primitive is meant to be transmitted on
654 * the downlink channel PDSCH and PBCH (if present). To facilitate physical
655 * layer processing, requisite control information is also sent along with the
657 * @sa TfUiTfuCntrlReq
660 * @param tfuDatReq pointer to TfuDatReqInfo
670 **********************************************************/
676 TfuDatReqInfo * datReq
679 S16 RgLiTfuDatReq(pst, spId, datReq)
682 TfuDatReqInfo * datReq;
686 return ((*RgLiTfuDatReqMt[pst->selector])(pst, spId, datReq));
692 /***********************************************************
694 * Func : RgLiTfuDelDatReq
697 * Desc : This Primitive is used to delete datReq in CL when there is ueId change.
698 * @details: This primitive is required when L2_OPMZ flag is elabed. this is required
699 * To delete datRq PDUs from CL for the Ue for which Ue Id got changed or
700 * anyother similar scenario
701 * @sa TfUiTfuDelDatReq
704 * @param tfuDelDatReq pointer to TfuDelDatReqInfo
714 **********************************************************/
720 TfuDelDatReqInfo * delDatReq
723 S16 RgLiTfuDelDatReq(pst, spId, delDatReq)
726 TfuDelDatReqInfo * delDatReq;
730 return ((*RgLiTfuDelDatReqMt[pst->selector])(pst, spId, delDatReq));
735 #endif /*--ifdef RG--*/
741 /***********************************************************
743 * Func : PtLiTfuBndReq
746 * Desc : This API is used to send a Bind Request from MAC to PHY.
747 * @param pst Pointer to the post structure.
748 * @param suId SAP ID of the service user.
749 * @param spId SAP ID of the service provider.
750 * @return ROK/RFAILED
759 **********************************************************/
768 S16 PtLiTfuBndReq(pst, suId, spId)
786 /***********************************************************
788 * Func : PtLiTfuSchBndReq
791 * Desc : This API is used to send a Bind Request from Scheduler to PHY.
792 * @param pst Pointer to the post structure.
793 * @param suId SAP ID of the service user.
794 * @param spId SAP ID of the service provider.
795 * @return ROK/RFAILED
804 **********************************************************/
813 S16 PtLiTfuSchBndReq(pst, suId, spId)
830 /***********************************************************
832 * Func : PtLiTfuUbndReq
835 * Desc : This API is used to send an Unbind Request from MAC to PHY.
836 * @param pst Pointer to the post structure.
837 * @param suId SAP ID of the service provider.
838 * @param reason Reason for Unbind request.
839 * @return ROK/RFAILED
848 **********************************************************/
857 S16 PtLiTfuUbndReq(pst, spId, reason)
874 /***********************************************************
876 * Func : PtLiTfuSchUbndReq
879 * Desc : This API is used to send an Unbind Request from Scheduler to PHY.
880 * @param pst Pointer to the post structure.
881 * @param suId SAP ID of the service provider.
882 * @param reason Reason for Unbind request.
883 * @return ROK/RFAILED
892 **********************************************************/
894 S16 PtLiTfuSchUbndReq
901 S16 PtLiTfuSchUbndReq(pst, spId, reason)
918 /***********************************************************
920 * Func : PtLiTfuRecpReq
923 * Desc : This primitive is sent from Scheduler to PHY.
924 * @details This primitive provides PHY with all the information required by
925 * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
926 * -# On PUCCH UE can transmit the following
932 * -# On PUSCH UE can transmit the following
935 * -# Data + HARQ Feedback
936 * This primitive carries all the information for the expected subframe for all
937 * the UEs that have been scheduled to transmit.
938 * @param pst Pointer to the post structure.
939 * @param spId SAP ID of the service provider.
940 * @param recpReq Pointer to the TfuRecpReqInfo structure.
941 * @return ROK/RFAILED
950 **********************************************************/
956 TfuRecpReqInfo * recpReq
959 S16 PtLiTfuRecpReq(pst, spId, recpReq)
962 TfuRecpReqInfo * recpReq;
976 /***********************************************************
978 * Func : PtLiTfuCntrlReq
981 * Desc : This Primitive is sent from Scheduler to PHY. It provides PHY with
982 * all the control information
983 * @details This primitive carries the information sent on the following
991 * @param cntrlReq pointer to TfuCntrlReqInfo
992 * @return ROK/RFAILED
1001 **********************************************************/
1007 TfuCntrlReqInfo * cntrlReq
1010 S16 PtLiTfuCntrlReq(pst, spId, cntrlReq)
1013 TfuCntrlReqInfo * cntrlReq;
1027 /***********************************************************
1029 * Func : PtLiTfuDatReq
1032 * Desc : This Primitive carries the Data PDUs from MAC to PHY for
1034 * @details The data being sent in this primitive is meant to be transmitted on
1035 * the downlink channel PDSCH and PBCH (if present). To facilitate physical
1036 * layer processing, requisite control information is also sent along with the
1038 * @sa TfUiTfuCntrlReq
1041 * @param tfuDatReq pointer to TfuDatReqInfo
1051 **********************************************************/
1057 TfuDatReqInfo * datReq
1060 S16 PtLiTfuDatReq(pst, spId, datReq)
1063 TfuDatReqInfo * datReq;
1077 /***********************************************************
1079 * Func : PtLiTfuDelDatReq
1082 * @brief This Primitive carries cellId and UeId for which datReq need to be deleted.
1083 * @details This primitive is used to send delDatReq to CL to delete the PDUs of
1084 * UE which has been deleted in MAC due to ueId change or anyother scenario
1086 * @details The data being sent in this primitive is meant to be transmitted on
1087 * @sa TfUiTfuDelDatReq
1090 * @param tfuDelDatReq pointer to TfuDelDatReqInfo
1100 **********************************************************/
1102 S16 PtLiTfuDelDatReq
1106 TfuDelDatReqInfo * delDatReq
1109 S16 PtLiTfuDelDatReq(pst, spId, delDatReq)
1112 TfuDelDatReqInfo * DelDatReq;
1125 #endif /*--ifdef PTRGLITFU--*/
1129 #endif /* __cplusplus */
1131 /**********************************************************************
1134 **********************************************************************/