#define MAX_NUM_HARQ_PROC 16
#define MAX_SLOT_SUPPORTED 10 /* numerology 0 15Khz */
#define MAX_ZERO_CORR_CFG_IDX 16 /* max zero correlation config index */
+#define MAC_TQ_SIZE 10 /* Timing Queue Size */
+#define MAX_NUM_TIMER 1 /* MAX number of MAC timers */
#define DEFAULT_CELLS 1
#define SI_RNTI 0xFFFF
{
Inst macInst;
ProcId procId;
+ uint8_t tmrRes; /*!< Timer resolution */
+ CmTqCp tmrTqCp; /*!< Timer Task Queue Cntrl Point */
+ CmTqType tmrTq[MAC_TQ_SIZE]; /*!< Timer Task Queue */
+ CmTimer tmrBlk[MAX_NUM_TIMER]; /*!< Timer Block */
MacCellCb *macCell[MAX_NUM_CELL];
}MacCb;
MacCb macCb;
/* Function declarations */
+short int macActvTmr(Ent ent,Inst inst);
void fillRarPdu(RarInfo *rarInfo);
void createMacRaCb(RachIndInfo *rachIndInfo);
void fillMsg4DlData(MacDlData *dlData, uint16_t msg4PduLen, uint8_t *msg4Pdu);
--- /dev/null
+/*******************************************************************************
+################################################################################
+# Copyright (c) [2017-2019] [Radisys] #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+*******************************************************************************/
+
+#include "common_def.h"
+#include "lrg.h" /* Layer manager interface includes*/
+#include "lrg.x" /* layer management typedefs for MAC */
+#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "lwr_mac_upr_inf.h"
+#include "mac.h"
+
+/**
+ * @brief Timer Expiry handler.
+ *
+ * @details
+ *
+ * Function : macTmrExpiry
+ *
+ * This is a callback function used as an input parameter to cmPrcTmr()
+ * to check expiry of any timer. In this function, the only concern is
+ * about tmrEvnt=Bind timer.
+ *
+ * @param[in] PTR cb, Entry for which Timer expired
+ * @param[in] S16 tmrEvnt, the Timer Event
+ * @return uint8_t
+ * -# ROK
+ **/
+uint8_t macTmrExpiry(PTR cb, uint8_t tmrEvnt)
+{
+ /* TODO : Handling of any timer event expiry */
+ return ROK;
+}
+
+/**
+ * @brief MAC timer call back function registered with System services
+ *
+ * @details
+ *
+ * Function : macActvTmr
+ *
+ * This function is invoked for every timer activation
+ * period expiry.
+ *
+ * @return S16
+ * -# ROK
+ **/
+short int macActvTmr(Ent ent,Inst inst)
+{
+ /* Check if any MAC timer has expired */
+ cmPrcTmr(&macCb.tmrTqCp, macCb.tmrTq, (PFV) macTmrExpiry);
+
+ return ROK;
+
+} /* end of rgActvTmr */
+
+/**********************************************************************
+
+ End of file
+**********************************************************************/
rgCb[inst].rgInit.pool = cfg->s.genCfg.mem.pool;
rgCb[inst].genCfg.tmrRes = cfg->s.genCfg.tmrRes;
+ macCb.tmrRes = cfg->s.genCfg.tmrRes;
macCb.macInst = rgCb[inst].rgInit.inst;
macCb.procId = rgCb[inst].rgInit.procId;
}
rgCb[inst].tfuSap.sapSta.sapState = LRG_NOT_CFG;
/* Initialize the timer blocks */
- cmInitTimers(rgCb[inst].tmrBlk, RG_MAX_TIMER);
+ cmInitTimers(macCb.tmrBlk, MAX_NUM_TIMER);
/* Initialzie the timer queue */
- memset(&rgCb[inst].tmrTq, 0, sizeof(CmTqType)*RG_TQ_SIZE);
+ memset(&macCb.tmrTq, 0, sizeof(CmTqType) * MAC_TQ_SIZE);
/* Initialize the timer control point */
- memset(&rgCb[inst].tmrTqCp, 0, sizeof(CmTqCp));
- rgCb[inst].tmrTqCp.tmrLen = RG_TQ_SIZE;
-#if 0
+ memset(&macCb.tmrTqCp, 0, sizeof(CmTqCp));
+ macCb.tmrTqCp.tmrLen = MAC_TQ_SIZE;
+
/* Timer Registration request to SSI */
- if (SRegTmrMt(rgCb[inst].rgInit.ent, rgCb[inst].rgInit.inst,
- (S16)rgCb[inst].genCfg.tmrRes, rgActvTmr) != ROK)
+ if(ODU_REG_TMR_MT(ENTMAC, macCb.macInst, macCb.tmrRes, macActvTmr) != ROK)
{
DU_LOG("\nERROR --> MAC : Failed to register timer");
return (LCM_REASON_MEM_NOAVAIL);
}
-#endif
+
/* Set Config done in TskInit */
rgCb[inst].rgInit.cfgDone = TRUE;
/* De-register the Timer Service */
(Void) SDeregTmrMt(rgCb[inst].rgInit.ent, rgCb[inst].rgInit.inst,
- (S16)rgCb[inst].genCfg.tmrRes, rgActvTmr);
+ (S16)rgCb[inst].genCfg.tmrRes, macActvTmr);
/* call back the task initialization function to intialize
* the global RgCb Struct */
return (ret);
}
-\f
-/**
- * @brief LTE MAC timer call back function registered with SSI.
- *
- * @details
- *
- * Function : rgActvTmr
- *
- * This function is invoked by SSI for every timer activation
- * period expiry.
- *
- * @return S16
- * -# ROK
- **/
-S16 rgActvTmr(Ent ent,Inst inst)
-{
- Inst macInst = (inst - RG_INST_START);
-
- /* Check if any MAC timer has expired */
- cmPrcTmr(&rgCb[macInst].tmrTqCp, rgCb[macInst].tmrTq, (PFV) rgLMMTmrExpiry);
-
- return ROK;
-
-} /* end of rgActvTmr */
-
/**********************************************************************
End of file
}
\f
-/**
- * @brief Scheduler instance timer call back function registered with SSI.
- *
- * @details
- *
- * Function : schActvTmr
- *
- * This function is invoked by SSI for every timer activation
- * period expiry. Note that SS_MT_TMR flag needs to be enabled for this
- * as isntId is needed.As part of SRegTmr call for scheduler instance
- * SS_MT_TMR flag needs to be enabled and schActvTmr needs to be given as
- * callback function
- *
- * @return S16
- * -# ROK
- **/
-S16 schActvTmr(Ent ent,Inst inst)
-{
- Inst schInst = (inst - SCH_INST_START);
-
- /* Check if any timer in the scheduler instance has expired */
- cmPrcTmr(&rgSchCb[schInst].tmrTqCp,
- rgSchCb[schInst].tmrTq, (PFV) rgSCHLmmTmrExpiry);
-
- return ROK;
-
-} /* end of schActvTmr */
-
-\f
/**********************************************************************
End of file
schCb[inst].genCfg.isSCellActDeactAlgoEnable = cfg->s.schInstCfg.genCfg.isSCellActDeactAlgoEnable;
#endif
schCb[inst].genCfg.startCellId = cfg->s.schInstCfg.genCfg.startCellId;
-#if 0
+
/* Initialzie the timer queue */
- memset(&schCb[inst].tmrTq, 0, sizeof(CmTqType)*RGSCH_TQ_SIZE);
+ memset(&schCb[inst].tmrTq, 0, sizeof(CmTqType) * SCH_TQ_SIZE);
/* Initialize the timer control point */
memset(&schCb[inst].tmrTqCp, 0, sizeof(CmTqCp));
schCb[inst].tmrTqCp.tmrLen = RGSCH_TQ_SIZE;
/* SS_MT_TMR needs to be enabled as schActvTmr needs instance information */
- /* Timer Registration request to SSI */
+ /* Timer Registration request to system services */
if (ODU_REG_TMR_MT(schCb[inst].schInit.ent, dInst,
(int)schCb[inst].genCfg.tmrRes, schActvTmr) != ROK)
{
"register timer.");
return (LCM_REASON_MEM_NOAVAIL);
}
-#endif
+
/* Set Config done in TskInit */
schCb[inst].schInit.cfgDone = TRUE;
DU_LOG("\nINFO --> SCH : Scheduler gen config done");
#define NUM_DMRS_SYMBOLS 12
#define DMRS_ADDITIONAL_POS 2
#define SCH_DEFAULT_K1 1
+#define SCH_TQ_SIZE 10
#define CRC_FAILED 0
#define CRC_PASSED 1
*/
typedef struct schCb
{
- TskInit schInit; /*!< Task Init info */
- SchGenCb genCfg; /*!< General Config info */
+ TskInit schInit; /*!< Task Init info */
+ SchGenCb genCfg; /*!< General Config info */
+ CmTqCp tmrTqCp; /*!< Timer Task Queue Cntrl Point */
+ CmTqType tmrTq[SCH_TQ_SIZE]; /*!< Timer Task Queue */
SchCellCb *cells[MAX_NUM_CELL]; /* Array to store cellCb ptr */
}SchCb;
SchCb schCb[SCH_MAX_INST];
/* function declarations */
+short int schActvTmr(Ent ent,Inst inst);
uint8_t schBroadcastAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc,uint16_t slot);
uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst inst);
uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst);
--- /dev/null
+/*******************************************************************************
+################################################################################
+# Copyright (c) [2017-2019] [Radisys] #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+*******************************************************************************/
+
+#include "common_def.h"
+#include "lrg.h"
+#include "lrg.x"
+#include "mac_sch_interface.h"
+#include "sch.h"
+
+/**
+ * @brief Timer Expiry handler.
+ *
+ * @details
+ *
+ * Function : schTmrExpiry
+ *
+ * This is a callback function used as an input parameter to cmPrcTmr()
+ * to check expiry of any timer. In this function, we are only concerned
+ * about tmrEvnt=Bind timer.
+ *
+ * @param[in] PTR cb, Entry for which Timer expired
+ * @param[in] S16 tmrEvnt, the Timer Event
+ * @return uint8_t
+ * -# ROK
+ **/
+uint8_t schTmrExpiry(PTR cb, uint8_t tmrEvnt)
+{
+ /* TODO : Handling of any timer event expiry */
+ return ROK;
+}
+
+/**
+ * @brief Scheduler instance timer call back function registered with system services.
+ *
+ * @details
+ *
+ * Function : schActvTmr
+ *
+ * This function is invoked for every timer activation
+ * period expiry. Note that SS_MT_TMR flag needs to be enabled for this
+ * as isntId is needed.As part of SRegTmr call for scheduler instance
+ * SS_MT_TMR flag needs to be enabled and schActvTmr needs to be given as
+ * callback function
+ *
+ * @return short int
+ * -# ROK
+ **/
+short int schActvTmr(Ent ent,Inst inst)
+{
+ Inst schInst = (inst - SCH_INST_START);
+
+ /* Check if any timer in the scheduler instance has expired */
+ cmPrcTmr(&schCb[schInst].tmrTqCp,
+ schCb[schInst].tmrTq, (PFV) schTmrExpiry);
+
+ return ROK;
+
+} /* end of schActvTmr */
+
+/**********************************************************************
+
+ End of file
+**********************************************************************/
+