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 *******************************************************************************/
18 /* header include files (.h) */
19 #include "envopt.h" /* environment options */
20 #include "envdep.h" /* environment dependent */
21 #include "envind.h" /* environment independent */
22 #include "gen.h" /* general */
23 #include "ssi.h" /* system services */
24 #include "cm_tkns.h" /* Common Token Defines */
25 #include "cm_llist.h" /* Common Link List Defines */
26 #include "cm_hash.h" /* Common Hash List Defines */
27 #include "cm_mblk.h" /* common memory link list library */
28 #include "cm_lte.h" /* Common LTE Defines */
29 #include "tfu.h" /* RGU Interface includes */
31 #include "gen.x" /* general */
32 #include "ssi.x" /* system services */
33 #include "cm5.x" /* system services */
34 #include "cm_tkns.x" /* Common Token Definitions */
35 #include "cm_llist.x" /* Common Link List Definitions */
36 #include "cm_lib.x" /* Common Library Definitions */
37 #include "cm_hash.x" /* Common Hash List Definitions */
38 #include "cm_mblk.x" /* common memory link list library */
39 #include "cm_lte.x" /* Common LTE Defines */
40 #include "tfu.x" /* RGU Interface includes */
42 #include "du_app_mac_inf.h"
47 * @brief process DL allocation from scheduler
51 * Function : MacProcDlAlloc
53 * This function copied dl sch info in the mac slot info
56 * @param[in] DL allocation from scheduler
61 int MacProcDlAlloc(Pst *pst, DlAlloc *dlAlloc)
65 MacDlSlot *currDlSlot =
66 &macCb.macCell->dlSlot[dlAlloc->slotIndInfo.slot % MAX_SLOT_SUPPORTED];
67 memcpy(&currDlSlot->dlInfo, dlAlloc, sizeof(DlAlloc));
73 * @brief Transmission time interval indication from PHY.
77 * Function : fapiMacSlotInd
79 * This API is invoked by PHY to indicate TTI indication to MAC for a cell.
82 * @param[in] SuId suId
83 * @param[in] SlotIndInfo *slotInd
88 PUBLIC S16 fapiMacSlotInd
95 VOLATILE U32 startTime=0;
98 DU_LOG("\nMAC : Slot Indication received");
102 SStartTask(&startTime, PID_MAC_TTI_IND);
104 /* send slot indication to scheduler */
105 ret = sendSlotIndMacToSch(slotInd);
108 DU_LOG("\nMAC : Sending of slot ind msg from MAC to SCH failed");
112 ret = macProcessSlotInd(inst,*slotInd);
115 DU_LOG("\nMAC : macProcessSlotInd failed");
119 /* send slot indication to du app */
120 ret = sendSlotIndMacToDuApp(slotInd);
123 DU_LOG("\nMAC :Sending of slot ind msg from MAC to DU APP failed");
128 SStopTask(startTime, PID_MAC_TTI_IND);
131 } /* fapiMacSlotInd */
133 /**********************************************************************
135 **********************************************************************/