/* Events in Lower Mac */
typedef enum{
PARAM_REQ,
- CONFIG_REQ = 2,
- START_REQ = 4,
+ PARAM_RSP,
+ CONFIG_REQ,
+ CONFIG_RSP,
+ START_REQ,
STOP_REQ,
MAX_EVENT
}EventState;
--- /dev/null
+
+/* header include files (.h) */
+#include "envopt.h" /* environment options */
+#include "envdep.h" /* environment dependent */
+#include "envind.h" /* environment independent */
+#include "gen.h" /* general */
+#include "ssi.h" /* system services */
+#include "cm_tkns.h" /* Common Token Defines */
+#include "cm_llist.h" /* Common Link List Defines */
+#include "cm_hash.h" /* Common Hash List Defines */
+#include "cm_lte.h" /* Common LTE Defines */
+#include "cm_mblk.h" /* Common LTE Defines */
+#include "tfu.h" /* RGU Interface defines */
+//#include "rg.h"
+#include "fapi.h"
+
+/* header/extern include files (.x) */
+#include "gen.x" /* general */
+#include "ssi.x" /* system services */
+#include "cm_tkns.x" /* Common Token Definitions */
+#include "cm_llist.x" /* Common Link List Definitions */
+#include "cm_lib.x" /* Common Library Definitions */
+#include "cm_hash.x" /* Common Hash List Definitions */
+#include "cm_lte.x" /* Common LTE Defines */
+#include "cm_mblk.x" /* Common LTE Defines */
+#include "tfu.x" /* RGU Interface includes */
+//#include "rg.x"
+
+/* function pointers for packing macCellCfg Request */
+typedef S16 (*packSlotIndMsg) ARGS((
+ Pst *pst,
+ fapi_slot_ind_t *slotInd
+));
+
+S16 packLcSlotInd (Pst *pst, fapi_slot_ind_t *slotInd);
+S16 packTcSlotInd (Pst *pst, fapi_slot_ind_t *slotInd);
+S16 packLwlcSlotInd (Pst *pst, fapi_slot_ind_t *slotInd);
+
+packSlotIndMsg packSlotIndMt[] =
+{
+ packLcSlotInd, /* packing for loosely coupled */
+ fapiMacSlotInd, /* packing for tightly coupled */
+ packLwlcSlotInd, /* packing for light weight loosly coupled */
+};
+
+S16 packLcSlotInd (Pst *pst, fapi_slot_ind_t *slotInd)
+{
+ Buffer *mBuf = NULLP;
+ if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ RETVALUE(RFAILED);
+ }
+
+ /* pack SFN and slot value */
+ CMCHKPK(SPkU16,slotInd->sfn, mBuf);
+ CMCHKPK(SPkU16,slotInd->slot, mBuf);
+
+ RETVALUE(SPstTsk(pst,mBuf));
+}
+
+S16 packTcSlotInd (Pst *pst, fapi_slot_ind_t *slotInd)
+{
+ return ROK;
+}
+
+S16 packLwlcSlotInd (Pst *pst, fapi_slot_ind_t *slotInd)
+{
+ return ROK;
+}
+
+void handleSlotInd(fapi_slot_ind_t *fapiSlotInd)
+{
+ /* fill Pst structure to send to lwr_mac to MAC */
+ Pst pst;
+ SlotIndInfo slotInd;
+
+ pst.srcProcId = 0;
+ pst.dstProcId = 0;
+ pst.srcEnt = ENTTF;
+ pst.dstEnt = ENTRG;
+ pst.srcInst = 0;
+ pst.dstInst = 0;
+ pst.event = EVENT_SLOT_IND_TO_MAC;
+ pst.region = 0;
+ pst.pool = 0;
+ pst.selector = MAC_SELECTOR_TC;
+
+ slotInd.sfn = fapiSlotInd->sfn;
+ slotInd.slot = fapiSlotInd->slot;
+
+ return (*packSlotIndMt[pst.selector])(&pst, &slotInd);
+}
+
+void handlePhyMessages(U8 *msg)
+{
+ /* extract the header */
+ fapi_msg_t *header;
+ header = (fapi_msg_t *)msg;
+
+ switch(header->message_type_id)
+ {
+ case FAPI_SLOT_INDICATION:
+ {
+ fapi_slot_ind_t *slotInd;
+ slotInd = (fapi_slot_ind_t *)msg;
+ handleSlotInd(slotInd);
+ break;
+ }
+ case FAPI_ERROR_INDICATION:
+ {
+ break;
+ }
+ case FAPI_RX_DATA_INDICATION:
+ {
+ break;
+ }
+ case FAPI_CRC_INDICATION:
+ {
+ break;
+ }
+ case FAPI_UCI_INDICATION:
+ {
+ break;
+ }
+ case FAPI_SRS_INDICATION:
+ {
+ break;
+ }
+ case FAPI_RACH_INDICATION:
+ {
+ break;
+ }
+ }
+}
--- /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. #
+################################################################################
+ *******************************************************************************/
+/* header include files (.h) */
+#include "envopt.h" /* environment options */
+#include "envdep.h" /* environment dependent */
+#include "envind.h" /* environment independent */
+#include "gen.h" /* general */
+#include "ssi.h" /* system services */
+#include "cm_tkns.h" /* Common Token Defines */
+#include "cm_llist.h" /* Common Link List Defines */
+#include "cm_hash.h" /* Common Hash List Defines */
+#include "cm_mblk.h" /* common memory link list library */
+#include "cm_lte.h" /* Common LTE Defines */
+#include "tfu.h" /* RGU Interface includes */
+#include "lrg.h"
+#include "gen.x" /* general */
+#include "ssi.x" /* system services */
+#include "cm5.x" /* system services */
+#include "cm_tkns.x" /* Common Token Definitions */
+#include "cm_llist.x" /* Common Link List Definitions */
+#include "cm_lib.x" /* Common Library Definitions */
+#include "cm_hash.x" /* Common Hash List Definitions */
+#include "cm_mblk.x" /* common memory link list library */
+#include "cm_lte.x" /* Common LTE Defines */
+#include "tfu.x" /* RGU Interface includes */
+#include "lrg.x"
+#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+
+int MacProcDlBrdcstAlloc(Pst *pst, DlBrdcstAlloc *dlBrdcstAlloc)
+{
+
+ return ROK;
+}
+
+/**********************************************************************
+ End of file
+ **********************************************************************/
+
#define RG_ULCCCH_ISCFGD(cell) ((cell)->ulCcchId != RG_INVALID_LC_ID)
/* After merging from 2.1 to 2.2 */
#define RG_CALC_SF_DIFF(_time1, _time2)\
- (_time1.sfn*RG_NUM_SUB_FRAMES_5G+_time1.subframe) < (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.subframe)?\
- ((_time1.sfn+RG_MAX_SFN)*RG_NUM_SUB_FRAMES_5G+_time1.subframe) -\
- (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.subframe) : \
- (_time1.sfn*RG_NUM_SUB_FRAMES_5G+_time1.subframe) - (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.subframe)
+ (_time1.sfn*RG_NUM_SUB_FRAMES_5G+_time1.slot) < (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.slot)?\
+ ((_time1.sfn+RG_MAX_SFN)*RG_NUM_SUB_FRAMES_5G+_time1.slot) -\
+ (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.slot) : \
+ (_time1.sfn*RG_NUM_SUB_FRAMES_5G+_time1.slot) - (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.slot)
/*LTE_L2_MEAS_PHASE2*/
#define RG_CALC_SFN_SF_DIFF(_time1,_sfnCycle, _time2)\
-(((_time1.sfn+RG_MAX_SFN * _sfnCycle)*RG_NUM_SUB_FRAMES_5G) + _time1.subframe -\
-(_time2.sfn*RG_NUM_SUB_FRAMES_5G + _time2.subframe))
+(((_time1.sfn+RG_MAX_SFN * _sfnCycle)*RG_NUM_SUB_FRAMES_5G) + _time1.slot -\
+(_time2.sfn*RG_NUM_SUB_FRAMES_5G + _time2.slot))
#define RG_EXT_LCID(_lcId, _byte) {\
(_lcId) = (_byte) & RG_LCID_MASK; \
}
#define RGADDTOCRNTTIME(crntTime, toFill, incr) \
- if ((crntTime.subframe + incr) > (RG_NUM_SUB_FRAMES_5G - 1)) \
+ if ((crntTime.slot + incr) > (RG_NUM_SUB_FRAMES_5G - 1)) \
toFill.sfn = (crntTime.sfn + 1); \
else \
toFill.sfn = crntTime.sfn; \
- toFill.subframe = (crntTime.subframe + incr) % RG_NUM_SUB_FRAMES_5G; \
+ toFill.slot = (crntTime.slot + incr) % RG_NUM_SUB_FRAMES_5G; \
if (toFill.sfn >= RG_MAX_SFN) \
{ \
- toFill.hSfn = (crntTime.hSfn + 1)%RG_MAX_SFN; \
toFill.sfn%=RG_MAX_SFN; \
} \
- else \
- { \
- toFill.hSfn = crntTime.hSfn; \
- }
#define RGSUBFRMCRNTTIME(crntTime, toFill, dcr) \
{ \
if (crntTime.sfn == 0) \
{ \
- if ((crntTime.subframe - (dcr)) < 0) \
+ if ((crntTime.slot - (dcr)) < 0) \
{ \
toFill.sfn = RG_MAX_SFN - 1; \
} \
} \
else \
{ \
- if ((crntTime.subframe - (dcr)) < 0) \
+ if ((crntTime.slot - (dcr)) < 0) \
{ \
toFill.sfn = crntTime.sfn - 1; \
} \
else \
toFill.sfn = crntTime.sfn; \
} \
-toFill.subframe = (RG_NUM_SUB_FRAMES_5G + crntTime.subframe - (dcr)) % (RG_NUM_SUB_FRAMES_5G); \
+toFill.slot = (RG_NUM_SUB_FRAMES_5G + crntTime.slot - (dcr)) % (RG_NUM_SUB_FRAMES_5G); \
}
#define RGCPYTIMEINFO(src, dst) \
- dst.hSfn = src.hSfn; \
- dst.sfn = src.sfn; \
- dst.subframe = src.subframe;
-#define RG_TIMEINFO_SAME(x, y) ((x.sfn == y.sfn) && (x.subframe == y.subframe))
+ dst.sfn = src.sfn; \
+ dst.slot = src.slot;
+#define RG_TIMEINFO_SAME(x, y) ((x.sfn == y.sfn) && (x.slot == y.slot))
#define rgPBuf(_inst) rgCb[_inst].rgInit.prntBuf
#endif
#define RG_CALC_SF_DIFF(_time1, _time2)\
- (_time1.sfn*RG_NUM_SUB_FRAMES_5G+_time1.subframe) < (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.subframe)?\
- ((_time1.sfn+RG_MAX_SFN)*RG_NUM_SUB_FRAMES_5G+_time1.subframe) -\
- (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.subframe) : \
- (_time1.sfn*RG_NUM_SUB_FRAMES_5G+_time1.subframe) - (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.subframe)
+ (_time1.sfn*RG_NUM_SUB_FRAMES_5G+_time1.slot) < (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.slot)?\
+ ((_time1.sfn+RG_MAX_SFN)*RG_NUM_SUB_FRAMES_5G+_time1.slot) -\
+ (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.slot) : \
+ (_time1.sfn*RG_NUM_SUB_FRAMES_5G+_time1.slot) - (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.slot)
#define RG_TTI_CYCLE_INVLD 0xFFFFFFFF
#define RG_CALC_TTI_CNT(_cellCb, _ttiCnt)\
_ttiCnt = (RG_NUM_SUB_FRAMES_5G * (_cellCb->crntTime.sfn + (_cellCb->ttiCycle * 1024)) )+\
- _cellCb->crntTime.subframe;
+ _cellCb->crntTime.slot;
#endif /* LTE_L2_MEAS */
/* Tuned according to TDD Cfg Mode2 and 2UE/TTI.
Inst inst,
TfuDatIndInfo *datInd));
-EXTERN S16 rgTOMTtiInd ARGS((
+EXTERN S16 macProcessSlotInd ARGS((
Inst inst,
- TfuTtiIndInfo *ttiInd));
+ SlotIndInfo slotInd));
EXTERN Void rgTOMRlsSf ARGS((Inst inst,RgDlSf *dlSf));
EXTERN S16 rgSchMacSfAllocReq ARGS((Pst *pst, RgInfSfAlloc *sfInfo));
"macCell(sfn sf): (%d %d) tbTimingInfo(sfn sf): (%d %d)\n"
"dlSf %p dlSf->tbs.count %d hqp %p tb %p\n",
hqP->tbInfo[i].pdcch.rnti,
- dlSf->schdTime.sfn, dlSf->schdTime.subframe,
- cellCb->crntTime.sfn, cellCb->crntTime.subframe,
+ dlSf->schdTime.sfn, dlSf->schdTime.slot,
+ cellCb->crntTime.sfn, cellCb->crntTime.slot,
hqP->tbInfo[i].timingInfo.sfn,
- hqP->tbInfo[i].timingInfo.subframe,
+ hqP->tbInfo[i].timingInfo.slot,
(Void *)dlSf, dlSf->tbs.count,
(Void *)hqP,
(Void *)hqP->tbInfo[i].tb);*/
/* Mukesh :: in case of rpepetiton this is not rerd*/
- if (hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.subframe % 2].sf == dlSf)
+ if (hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf == dlSf)
{
/* Check if data from RLC had been received and got muxed. */
#ifndef L2_OPTMZ
/* Data not received but ta needs to be sent. */
/* MUX TA and send it */
bldPdu.datReq = NULLP;
- bldPdu.reqType = EVTTFUTTIIND;
+ bldPdu.reqType = EVENT_SLOT_IND_TO_MAC;
bldPdu.schdTbSz = hqP->tbInfo[i].tbSz;
bldPdu.ta = hqP->tbInfo[i].schdTa;
#ifdef LTE_ADV
RLOG1(L_ERROR, "MUXing failed for: MacInst %d", inst);
RLOG4(L_ERROR, "MUXing failed for: time: %d/%d\
procId %d ueId %d", hqP->tbInfo[i].timingInfo.sfn,
- hqP->tbInfo[i].timingInfo.subframe, hqP->procId,
+ hqP->tbInfo[i].timingInfo.slot, hqP->procId,
hqP->tbInfo[i].pdcch.rnti);
RETVALUE(RFAILED);
#ifdef LTEMAC_RGU_PAD
/* Data not received from RLC. Padding at MAC */
bldPdu.datReq = NULLP;
- bldPdu.reqType = EVTTFUTTIIND;
+ bldPdu.reqType = EVENT_SLOT_IND_TO_MAC;
bldPdu.schdTbSz = hqP->tbInfo[i].tbSz;
bldPdu.ta = hqP->tbInfo[i].schdTa;
#ifdef LTE_ADV
RLOG1(L_ERROR, "MUXing failed for: MacInst %d", inst);
RLOG4(L_ERROR, "MUXing failed for: time: %d/%d\
procId %d ueId %d", hqP->tbInfo[i].timingInfo.sfn,
- hqP->tbInfo[i].timingInfo.subframe, hqP->procId,
+ hqP->tbInfo[i].timingInfo.slot, hqP->procId,
hqP->tbInfo[i].pdcch.rnti);
RETVALUE(RFAILED);
/* MS_WORKAROUND for ccpu00122894 */
for(i=0;i< RG_MAX_TB_PER_UE;i++)
{
- if (hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.subframe % 2].sf == dlSf)
+ if (hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf == dlSf)
{
- cmLListDelFrm(&dlSf->tbs, &(hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.subframe % 2].sfLnk));
- hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.subframe % 2].sfLnk.node = NULLP;
+ cmLListDelFrm(&dlSf->tbs, &(hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk));
+ hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk.node = NULLP;
- hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.subframe % 2].sf = NULLP;
+ hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf = NULLP;
}
}
cmLListAdd2Tail(&datInfo->pdus, &(datReq->lnk));
{
continue;
}
- if (hqProc->tbInfo[i].sfLnkInfo[dlSf->schdTime.subframe % 2].sfLnk.node == NULLP)
+ if (hqProc->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk.node == NULLP)
{
/* release corresponding TBs from SF tbs List */
for(j=0;j<datReq->nmbOfTbs;j++)
RLOG1(L_ERROR, "MUXing failed for: MacInst %d", inst);
RLOG4(L_ERROR, "MUXing failed for: time: %d/%d\
procId %d ueId %d", hqProc->tbInfo[i].timingInfo.sfn,
- hqProc->tbInfo[i].timingInfo.subframe, hqProc->procId,
+ hqProc->tbInfo[i].timingInfo.slot, hqProc->procId,
hqProc->tbInfo[i].pdcch.rnti);
/* release corresponding TBs from SF tbs List */
RLOG1(L_ERROR, "MUXing failed for: MacInst %d", inst);
RLOG4(L_ERROR, "MUXing failed for: time: %d/%d\
procId %d ueId %d", hqProc->tbInfo[0].timingInfo.sfn,
- hqProc->tbInfo[0].timingInfo.subframe, hqProc->procId,
+ hqProc->tbInfo[0].timingInfo.slot, hqProc->procId,
hqProc->tbInfo[0].pdcch.rnti);
RG_FREE_MSG(datReq->pdu);
U8 ueIdx;
U8 lcIdx;
U8 tbIndex=0,idx1;
- RgDlSf *dlSf = &cell->subFrms[(timingInfo.subframe % RG_NUM_SUB_FRAMES)];
+ RgDlSf *dlSf = &cell->subFrms[(timingInfo.slot % RG_NUM_SUB_FRAMES)];
Inst inst = cell->macInst - RG_INST_START;
// Bool isDStaReqrd = FALSE;
RgRguDedStaInd *dStaInd[rgCb[inst].numRguSaps] ;
#endif
hqP->numOfTBs = allocInfo->nmbOfTBs;
- hqP->tbInfo[idx].sfLnkInfo[dlSf->schdTime.subframe % 2].sfLnk.node = (PTR)hqP;
- hqP->tbInfo[idx].sfLnkInfo[dlSf->schdTime.subframe % 2].sf = dlSf;
- cmLListAdd2Tail(&dlSf->tbs,&(hqP->tbInfo[idx].sfLnkInfo[dlSf->schdTime.subframe % 2].sfLnk));
+ hqP->tbInfo[idx].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk.node = (PTR)hqP;
+ hqP->tbInfo[idx].sfLnkInfo[dlSf->schdTime.slot % 2].sf = dlSf;
+ cmLListAdd2Tail(&dlSf->tbs,&(hqP->tbInfo[idx].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk));
/* Changes as part of performance testing*/
/* hqP->numOfTBs++;*/
hqP->tbInfo[idx].doa = allocInfo->doa;
cStaInd->rnti = allocInfo->rnti;
cStaInd->lcId = cell->dlCcchId;
cStaInd->transId = (timingInfo.sfn << 16) |
- (timingInfo.subframe << 8) | idx1;
+ (timingInfo.slot << 8) | idx1;
/* ADD Changes for Downlink UE Timing Optimization */
#ifdef LTEMAC_DLUE_TMGOPTMZ
dlSf->remDatReqCnt++;
dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].rnti = allocInfo->rnti;
/*
dStaInd->transId = (hqP->timingInfo.sfn << 16) |
- (hqP->timingInfo.subframe << 8) | hqP->procId;
+ (hqP->timingInfo.slot << 8) | hqP->procId;
*/
dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].transId = (timingInfo.sfn << 16) |
- (timingInfo.subframe << 8) | idx1;
+ (timingInfo.slot << 8) | idx1;
dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].nmbOfTbs = hqP->numOfTBs;
#ifdef LTE_ADV
dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].fillCtrlPdu = allocInfo->fillCtrlPdu;
for(i=0;i<RG_MAX_TB_PER_UE;i++)
{
#ifndef L2_OPTMZ
- if ((hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.subframe % 2].sf == dlSf) &&
+ if ((hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf == dlSf) &&
(hqP->tbInfo[i].tb != NULLP))
#else
- if ((hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.subframe % 2].sf == dlSf) &&
+ if ((hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf == dlSf) &&
RgUtlIsTbMuxed(&(hqP->tbInfo[i].tb)))
#endif
{
if(dbgBufLen == 0)
{
RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
- "RNTI:%d SFN:%d subframe:%d tbIdx:%d Sdu Length 0 ",
+ "RNTI:%d SFN:%d slot:%d tbIdx:%d Sdu Length 0 ",
datReq->rnti,
hqP->tbInfo[i].timingInfo.sfn,
- hqP->tbInfo[i].timingInfo.subframe,i);
+ hqP->tbInfo[i].timingInfo.slot,i);
RLOG_ARG3(L_ERROR,DBG_CELLID,cellCb->cellId,
"taPres [%d] numOfTbs [%d] format[%d]",
datReq->isTApres,
* Function : RgSchMacRlsHqReq
*
* This function shall be invoked whenever scheduler is done with the
- * allocations of random access responses for a subframe.
+ * allocations of random access responses for a slot.
* This shall invoke RAM to create ueCbs for all the rapIds allocated and
* shall invoke MUX to create RAR PDUs for raRntis allocated.
*
/* Process a config. request */
cmUnpkLrgSchCfgReq(MacSchGenCfgReq, pst, mBuf);
break;
- case EVTMACSCHCFGREQ:
- cmUnpkRgrCfgReq(MacSchCfgReq, pst, mBuf);
- break;
case EVTLRGCNTRLREQ:
/* Process a control request */
cmUnpkLrgCntrlReq(RgMiLrgCntrlReq, pst, mBuf);
case EVTTFUDATIND:
cmUnpkTfuDatInd(RgLiTfuDatInd, pst, mBuf);
break;
- case EVTTFUTTIIND:
- cmUnpkTfuTtiInd(RgLiTfuTtiInd, pst, mBuf);
+ case EVENT_SLOT_IND_TO_MAC:
+ cmUnpackSlotInd(fapiMacSlotInd, pst, mBuf);
break;
#if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
case EVTTFUNONRTIND:
node = node->next;
crntTime = cell->crntTime;
- if(cell->crntTime.sfn == 0 && (cell->crntTime.subframe % RG_NUM_SUB_FRAMES) == 0)
+ if(cell->crntTime.sfn == 0 && (cell->crntTime.slot % RG_NUM_SUB_FRAMES) == 0)
{
measCb->sfnCycle++;
}
#include "rg_sch_inf.h" /* layer management defines for LTE-MAC */
#include "rg_env.h" /* customisable defines and macros for MAC */
#include "rg.h" /* defines and macros for MAC */
-
+#include "du_log.h"
/* header/extern include files (.x) */
#include "gen.x" /* general layer typedefs */
#include "du_app_mac_inf.h"
#include "rg.x" /* typedefs for MAC */
+#include "mac_sch_interface.h"
/* local defines */
/* local typedefs */
PRIVATE S16 rgLIMValidateSap ARGS((Inst inst,SuId suId));
PRIVATE Void rgLIMUtlFreeDatIndEvnt ARGS((TfuDatIndInfo *datInd,
Bool error));
+
+/* function pointers for packing slot ind from mac to sch */
+//S16 packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
+
+MacSchSlotIndFunc macSchSlotIndOpts[] =
+{
+ packMacSchSlotInd,
+ macSchSlotInd,
+ packMacSchSlotInd
+};
+
#ifdef RG_UNUSED
PRIVATE Void rgLIMUtlFreeDatReqEvnt ARGS((TfuDatReqInfo *datReq,
Bool error));
*
* @details
*
- * Function : RgLiTfuTtiInd
+ * Function : sendSlotIndMacToSch
+ *
+ * This API is invoked by MAC to send slot ind to scheduler.
+ *
+ * @param[in] SlotIndInfo *slotInd
+ * @return S16
+ * -# ROK
+ * -# RFAILED
+ **/
+int sendSlotIndMacToSch(SlotIndInfo *slotInd)
+{
+ int ret = ROK;
+ /* fill Pst structure to send to lwr_mac to MAC */
+ Pst pst;
+ pst.srcProcId = 0;
+ pst.dstProcId = 0;
+ pst.srcEnt = ENTRG;
+ pst.dstEnt = ENTRG;
+ pst.srcInst = 0;
+ pst.dstInst = 1;
+ pst.event = EVENT_SLOT_IND_TO_SCH;
+ pst.region = 0;
+ pst.pool = 0;
+ pst.selector = MAC_SELECTOR_TC;
+
+ return(*macSchSlotIndOpts[pst.selector])(&pst,slotInd);
+}
+
+/**
+ * @brief Transmission time interval indication from PHY.
+ *
+ * @details
+ *
+ * Function : fapiMacSlotInd
*
* This API is invoked by PHY to indicate TTI indication to MAC for a cell.
*
* @param[in] Pst *pst
* @param[in] SuId suId
- * @param[in] TfuTtiIndInfo *ttiInd
+ * @param[in] SlotIndInfo *slotInd
* @return S16
* -# ROK
* -# RFAILED
**/
-#ifdef ANSI
-PUBLIC S16 RgLiTfuTtiInd
+PUBLIC S16 fapiMacSlotInd
(
Pst *pst,
-SuId suId,
-TfuTtiIndInfo *ttiInd
+SlotIndInfo *slotInd
)
-#else
-PUBLIC S16 RgLiTfuTtiInd(pst, suId, ttiInd)
-Pst *pst;
-SuId suId;
-TfuTtiIndInfo *ttiInd;
-#endif
{
S16 ret;
VOLATILE U32 startTime=0;
Inst inst;
- TRC3(RgLiTfuTtiInd);
-
RG_IS_INST_VALID(pst->dstInst);
inst = pst->dstInst - RG_INST_START;
/*starting Task*/
SStartTask(&startTime, PID_MAC_TTI_IND);
-#ifdef NO_ERRCLS
- if ((ret = rgLIMValidateSap (pst->dstInst - RG_INST_START,suId)) != ROK)
+ /* send slot indication to scheduler */
+ ret = sendSlotIndMacToSch(slotInd);
+ if(ret != ROK)
{
- RLOG_ARG0(L_ERROR,DBG_CELLID,ttiInd->cells[0].cellId,"SAP Validation failed");
+ DU_LOG("\nsending of slot ind msg from MAC to SCH failed");
RETVALUE(ret);
}
-#endif
/* Now call the TOM (Tfu ownership module) primitive to process further */
- ret = rgTOMTtiInd(inst,ttiInd);
+ ret = macProcessSlotInd(inst,*slotInd);
+ if(ret != ROK)
+ {
+ DU_LOG("\nmacProcessSlotInd failed");
+ RETVALUE(ret);
+ }
/*stoping Task*/
SStopTask(startTime, PID_MAC_TTI_IND);
RETVALUE(ret);
-} /* RgLiTfuTtiInd */
+} /* fapiMacSlotInd */
#if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
/**
#include "lrg.x" /* LRG Interface includes */
#include "rgr.x" /* LRG Interface includes */
#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
#include "rg.x" /* MAC includes */
#ifdef SS_DIAG
#include "ss_diag.h" /* Common log file */
duHandleMacCellCfgCfm, /* packing for tightly coupled */
packMacCellCfgCfm, /* packing for light weight loosly coupled */
};
+
+SchCellCfgFunc SchCellCfgOpts[] =
+{
+ packSchCellCfg, /* packing for loosely coupled */
+ SchHdlCellCfgReq, /* packing for tightly coupled */
+ packSchCellCfg /* packing for light weight loosly coupled */
+};
+
\f
/**
* @brief Task Initiation callback function.
/* Initialize the timer control point */
cmMemset((U8 *)&rgCb[inst].tmrTqCp, 0, sizeof(CmTqCp));
rgCb[inst].tmrTqCp.tmrLen = RG_TQ_SIZE;
+#if 0
/* Timer Registration request to SSI */
if (SRegTmrMt(rgCb[inst].rgInit.ent, rgCb[inst].rgInit.inst,
(S16)rgCb[inst].genCfg.tmrRes, rgActvTmr) != ROK)
RETVALUE(LCM_REASON_MEM_NOAVAIL);
}
+#endif
/* Set Config done in TskInit */
rgCb[inst].rgInit.cfgDone = TRUE;
#endif
{
printf("\nSending Scheduler config confirm to DU APP");
+ pst->dstEnt = ENTDUAPP;
+ pst->dstInst = 0;
+ pst->srcInst = 0;
+ pst->selector = MAC_SCH_LC_SELECTOR;
RgMiLrgSchCfgCfm(pst, cfm);
RETVALUE(ROK);
}
-/**
- * @brief Layer Manager Configuration request handler.
- *
- * @details
- *
- * Function : MacSchCfgReq
- *
- * This function handles the gNB and cell configuration
- * request received from DU APP.
- * This API unapcks and forwards the config towards SCH
- *
- * @param[in] Pst *pst
- * @param[in] RgrCfgTransId transId
- * @param[in] RgrCfgReqInfo *cfgReqInfo
- * @return S16
- * -# ROK
- **/
-#ifdef ANSI
-PUBLIC S16 MacSchCfgReq
-(
- Pst *pst,
- RgrCfgTransId transId,
- RgrCfgReqInfo *cfgReqInfo
-)
-#else
-PUBLIC S16 MacSchCfgReq(pst, transId, cfgReqInfo)
- Pst *pst;
- RgrCfgTransId transId;
- RgrCfgReqInfo *cfgReqInfo;
-#endif
-{
- printf("\nReceived Scheduler config at MAC");
- pst->dstInst = DEFAULT_CELLS + 1;
- HandleSchCfgReq(pst, transId, cfgReqInfo);
-
- RETVALUE(ROK);
-
-} /* end of MacSchCfgReq*/
-
\f
/***********************************************************
*
cfmPst->srcInst = rgCb[inst].rgInit.inst;
cfmPst->srcProcId = rgCb[inst].rgInit.procId;
- cfmPst->srcEnt = reqPst->dstEnt;
- cfmPst->dstEnt = reqPst->srcEnt;
- cfmPst->srcInst = reqPst->dstInst;
- cfmPst->dstInst = reqPst->srcInst;
- cfmPst->srcProcId = reqPst->dstProcId;
- cfmPst->dstProcId = reqPst->srcProcId;
+ cfmPst->dstEnt = ENTDUAPP;
+ cfmPst->dstInst = 0;
+ cfmPst->dstProcId = cfmPst->srcProcId;
cfmPst->selector = LRG_SEL_LC;
cfmPst->prior = reqPst->prior;
cfmPst->route = reqPst->route;
cfmPst->region = reqPst->region;
cfmPst->pool = reqPst->pool;
- cfmPst->event = EVENT_MAC_CELL_CONFIG_CFM;
+ cfmPst->event = EVENT_MAC_CELL_CONFIG_CFM;
RETVOID;
}
* @return S16
* -# ROK
**/
-S16 MacHdlCellCfgReq
+int MacHdlCellCfgReq
(
Pst *pst,
MacCellCfg *macCellCfg
)
{
- U16 ret = ROK;
- MacCellCfgCfm macCellCfgCfm;
+ Pst cfmPst;
+ int ret = ROK;
RgCellCb *cellCb;
- Pst cnfPst;
Inst inst = pst->dstInst;
- cellCb = rgCb[inst].cell;
+ cmMemset((U8 *)&cfmPst, 0, sizeof(Pst));
MAC_ALLOC(cellCb,sizeof(RgCellCb));
if(cellCb == NULLP)
}
memcpy(&cellCb->macCellCfg,macCellCfg,sizeof(MacCellCfg));
-
- macCellCfgFillCfmPst(pst,&cnfPst);
-
- macCellCfgCfm.transId = macCellCfg->transId;
-
- ret = (*packMacCellCfmOpts[cnfPst.selector])(&cnfPst,&macCellCfgCfm);
+ rgCb[inst].cell = cellCb;
+
+ /* Send cell cfg to scheduler */
+ ret = MacSchCellCfgReq(pst, macCellCfg);
+ if(ret != ROK)
+ {
+ MacCellCfgCfm macCellCfgCfm;
+ macCellCfgCfm.rsp = RSP_NOK;
+ macCellCfgCfm.transId = macCellCfg->transId;
+ macCellCfgFillCfmPst(pst,&cfmPst);
+ ret = (*packMacCellCfmOpts[cfmPst.selector])(&cfmPst,&macCellCfgCfm);
+ }
return ret;
} /* end of MacHdlCellCfgReq */
-\f
+/**
+ * @brief Layer Manager Configuration request handler.
+ *
+ * @details
+ *
+ * Function : MacSchCellCfgReq
+ *
+ * This function sends cell configuration to SCH
+ *
+ * @param[in] Pst *pst
+ * @param[in] MacCellCfg *macCellCfg
+ * @return S16
+ * -# ROK
+ **/
+int MacSchCellCfgReq
+(
+ Pst *pst,
+ MacCellCfg *macCellCfg
+)
+{
+ SchCellCfg schCellCfg;
+ Pst cfgPst;
+ int ret;
+
+ cmMemset((U8 *)&cfgPst, 0, sizeof(Pst));
+ schCellCfg.cellId = macCellCfg->cellId;
+ schCellCfg.phyCellId = macCellCfg->phyCellId;
+ schCellCfg.bandwidth = macCellCfg->dlCarrCfg.bw;
+ schCellCfg.dupMode = macCellCfg->dupType;
+ schCellCfg.ssbPbchPwr = macCellCfg->ssbCfg.ssbPbchPwr;
+ schCellCfg.scsCommon = macCellCfg->ssbCfg.scsCmn;
+ schCellCfg.ssbOffsetPointA = macCellCfg->ssbCfg.ssbOffsetPointA;
+ schCellCfg.ssbPeriod = macCellCfg->ssbCfg.ssbPeriod;
+ schCellCfg.ssbSubcOffset = macCellCfg->ssbCfg.ssbScOffset;
+ for(uint8_t idx=0; idx<SSB_MASK_SIZE; idx++)
+ {
+ schCellCfg.nSSBMask[idx] = macCellCfg->ssbCfg.ssbMask[idx];
+ }
+ cfgPst.srcProcId = pst->dstProcId;
+ cfgPst.dstProcId = pst->srcProcId;
+ cfgPst.srcEnt = ENTRG;
+ cfgPst.srcInst = 0;
+ cfgPst.dstEnt = ENTRG;
+ cfgPst.dstInst = 1;
+ cfgPst.selector = MAC_SCH_TC_SELECTOR;
+ cfgPst.event = EVENT_SCH_CELL_CFG;
+
+ ret = (*SchCellCfgOpts[cfgPst.selector])(&cfgPst, &schCellCfg);
+ return ret;
+} /* end of MacSchCellCfgReq */
+
+/**
+ * @brief Layer Manager Configuration response handler.
+ *
+ * @details
+ *
+ * Function : MacProcSchCellCfgCfm
+ *
+ * This function processes cell configuration to SCH
+ *
+ * @param[in] Pst *pst
+ * @param[in] SchCellCfgCfm *schCellCfgCfm
+ * @return int
+ * -# ROK
+ **/
+int MacProcSchCellCfgCfm
+(
+ Pst *pst,
+ SchCellCfgCfm *schCellCfgCfm
+)
+{
+ Pst cfmPst;
+ int ret;
+ RgCellCb *cellCb;
+ MacCellCfgCfm macCellCfgCfm;
+
+ cmMemset((U8 *)&cfmPst, 0, sizeof(Pst));
+ cellCb = rgCb[pst->dstInst].cell;
+ macCellCfgCfm.transId = cellCb->macCellCfg.transId;
+ if(schCellCfgCfm->rsp == RSP_OK)
+ {
+ macCellCfgCfm.rsp = RSP_OK;
+ }
+ else
+ {
+ macCellCfgCfm.rsp = RSP_NOK;
+ }
+ macCellCfgFillCfmPst(pst,&cfmPst);
+ ret = (*packMacCellCfmOpts[cfmPst.selector])(&cfmPst,&macCellCfgCfm);
+
+}
/**********************************************************************
End of file
}
break;
- case EVTTFUTTIIND:
+ case EVENT_SLOT_IND_TO_MAC:
break;
default:
break;
}
break;
- case EVTTFUTTIIND:
+ case EVENT_SLOT_IND_TO_MAC:
break;
default:
break;
RETVALUE(RFAILED);
}
- idx = (timingInfo.subframe % RG_NUM_SUB_FRAMES);
+ idx = (timingInfo.slot % RG_NUM_SUB_FRAMES);
dlSf = &cell->subFrms[idx];
/* Create RAR PDUs for all the allocated RA-RNTIs */
for(idx = 0; idx < datReq->nmbOfUeGrantPerTti; idx++)
{
- timingInfo.subframe = (U8)((datReq->datReq[idx].transId >> 8) & 0XFF);
+ timingInfo.slot = (U8)((datReq->datReq[idx].transId >> 8) & 0XFF);
timingInfo.sfn = (U16)((datReq->datReq[idx].transId >> 16) & 0xFFFF);
- sf = &cell->subFrms[(timingInfo.subframe % RG_NUM_SUB_FRAMES)];
+ sf = &cell->subFrms[(timingInfo.slot % RG_NUM_SUB_FRAMES)];
if( (sf->txDone == TRUE) ||
(!RG_TIMEINFO_SAME(sf->schdTime,timingInfo)))
{
#if (ERRCLASS & ERRCLS_DEBUG)
- /* Transmission is already done for this subframe. This is a delayed
+ /* Transmission is already done for this slot. This is a delayed
* datReq. So discard */
rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM);
rgLMMStaInd(inst,LCM_CATEGORY_PROTOCOL, LCM_EVENT_UI_INV_EVT,
/*Get the timing Info*/
/* ADD Changes for Downlink UE Timing Optimization */
#ifdef LTEMAC_DLUE_TMGOPTMZ
- timingInfo.subframe = (U8)((datReq->transId >> 8) & 0XFF);
+ timingInfo.slot = (U8)((datReq->transId >> 8) & 0XFF);
timingInfo.sfn = (U16)((datReq->transId >> 16) & 0xFFFF);
#endif
}
/*Get the timing Info*/
/* ADD Changes for Downlink UE Timing Optimization */
#ifdef LTEMAC_DLUE_TMGOPTMZ
- timingInfo.subframe = (U8)(datReq->transId & 0XFF);
+ timingInfo.slot = (U8)(datReq->transId & 0XFF);
timingInfo.sfn = (U16)((datReq->transId >> 8) & 0xFFFF);
#endif
}
/* ADD Changes for Downlink UE Timing Optimization */
#ifdef LTEMAC_DLUE_TMGOPTMZ
- RG_ARRAY_BOUND_CHECK(0, cell->subFrms, (timingInfo.subframe % RG_NUM_SUB_FRAMES));
- sf = &cell->subFrms[(timingInfo.subframe % RG_NUM_SUB_FRAMES)];
+ RG_ARRAY_BOUND_CHECK(0, cell->subFrms, (timingInfo.slot % RG_NUM_SUB_FRAMES));
+ sf = &cell->subFrms[(timingInfo.slot % RG_NUM_SUB_FRAMES)];
ret = rgROMUpdDlSfRemDataCnt(cell, sf);
/*Added check for RFAILED as above function can return RFAILED*/
}
}
- timingInfo.subframe = (U8)((datReq->transId >> 8) & 0XFF);
+ timingInfo.slot = (U8)((datReq->transId >> 8) & 0XFF);
timingInfo.sfn = (U16)((datReq->transId >> 16) & 0xFFFF);
- sf = &cell->subFrms[(timingInfo.subframe % RG_NUM_SUB_FRAMES)];
+ sf = &cell->subFrms[(timingInfo.slot % RG_NUM_SUB_FRAMES)];
if( (sf->txDone == TRUE) ||
(!RG_TIMEINFO_SAME(sf->schdTime,timingInfo)))
{
#if (ERRCLASS & ERRCLS_DEBUG)
- /* Transmission is already done for this subframe. This is a delayed
+ /* Transmission is already done for this slot. This is a delayed
* datReq. So discard */
rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM);
rgLMMStaInd(inst,LCM_CATEGORY_PROTOCOL, LCM_EVENT_UI_INV_EVT,
TRC2(rgROMHndlBcchPcchDatReq);
- timingInfo.subframe = (U8)(datReq->transId & 0XFF);
+ timingInfo.slot = (U8)(datReq->transId & 0XFF);
timingInfo.sfn = (U16)((datReq->transId >> 8) & 0xFFFF);
- sf = &cell->subFrms[(timingInfo.subframe % RG_NUM_SUB_FRAMES)];
+ sf = &cell->subFrms[(timingInfo.slot % RG_NUM_SUB_FRAMES)];
if( (sf->txDone == TRUE) ||
(!RG_TIMEINFO_SAME(sf->schdTime,timingInfo)))
{
#if (ERRCLASS & ERRCLS_DEBUG)
- /* Transmission is already done for this subframe. This is a delayed
+ /* Transmission is already done for this slot. This is a delayed
* datReq. So discard */
rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM);
rgLMMStaInd(inst,LCM_CATEGORY_PROTOCOL, LCM_EVENT_UI_INV_EVT,
bcch = rgDBMGetBcchOnDlsch(cell,datReq->lcId);
if (bcch )
{
- /* Store BCCH-DLSCH data received in Scheduled subframe */
+ /* Store BCCH-DLSCH data received in Scheduled slot */
sf->bcch.tb = datReq->pdu;
SCpyMsgMsg(datReq->pdu, RG_GET_MEM_REGION(rgCb[inst]),
bch = rgDBMGetBcchOnBch(cell);
if ((bch) && (bch->lcId == datReq->lcId))
{
- /* Store BCH data received in Scheduled subframe */
+ /* Store BCH data received in Scheduled slot */
sf->bch.tb = datReq->pdu;
RETVALUE(ROK);
}
pcch = rgDBMGetPcch(cell);
if ((pcch) && (pcch->lcId == datReq->lcId))
{
- /* Store PCCH-DLSCH data received in Scheduled subframe */
+ /* Store PCCH-DLSCH data received in Scheduled slot */
sf->pcch.tb = datReq->pdu;
RETVALUE(ROK);
}
nextBchSfn = (cell->crntTime.sfn + 4 - (cell->crntTime.sfn%4)) % RG_MAX_SFN;
if ((staRsp->u.timeToTx.sfn != nextBchSfn) ||
- ((staRsp->u.timeToTx.sfn == cell->crntTime.sfn) && (cell->crntTime.subframe >= 7)))
+ ((staRsp->u.timeToTx.sfn == cell->crntTime.sfn) && (cell->crntTime.slot >= 7)))
{
RETVALUE(ROK);
}
if (ROK != rgTOMUtlProcDlSf (dlSf, cellCb, &err))
{
RLOG_ARG0(L_ERROR,DBG_CELLID,cellCb->cellId,
- "Unable to process downlink subframe for cell");
+ "Unable to process downlink slot for cell");
err.errType = RGERR_ROM_DEDDATREQ;
}
RgCellCb *cellCb,
TfuDatInfo *datInfo,
RgInfCeInfo *ceInfo,
-U8 subframe
+U16 slot
));
PRIVATE S16 rgTOMProcCCCHSduInDatInd ARGS((
RgCellCb *cellCb,
TfuDatInfo *datInfo,
RgInfCeInfo *ceInfo,
-U8 subframe
+U16 slot
));
PUBLIC S16 rgHndlFlowCntrl
RGADDTOCRNTTIME(dlSf->schdTime, datInfo->timingInfo, TFU_DLDATA_DLDELTA);
#endif
datInfo->cellId = cellCb->cellId;
- if((0 == (datInfo->timingInfo.sfn % 30)) && (0 == datInfo->timingInfo.subframe))
+ if((0 == (datInfo->timingInfo.sfn % 30)) && (0 == datInfo->timingInfo.slot))
{
- //printf("5GTF_CHECK rgTOMUtlProcDlSf dat (%d : %d)\n", datInfo->timingInfo.sfn, datInfo->timingInfo.subframe);
+ //printf("5GTF_CHECK rgTOMUtlProcDlSf dat (%d : %d)\n", datInfo->timingInfo.sfn, datInfo->timingInfo.slot);
}
#ifdef TFU_ALLOC_EVENT_NO_INIT
datInfo->bchDat.pres = 0;
*
* @details
*
- * Function: rgTOMTtiInd
+ * Function: macProcessSlotInd
*
- * Handler for processing TTI indication recieved from PHY
+ * Handler for processing slot indication recieved from PHY
* for a cell.
*
- * Invoked by: RgLiTfuTtiInd
+ * Invoked by: macProcessSlotInd
*
* Processing Steps:
* - Get cell and update the cell's current time with the timing value given
* - Invoke COM's TTI handler rgCOMTtiHndlr
*
* @param[in] Inst inst
- * @param[in] TfuTtiIndInfo *ttiInd
+ * @param[in] SlotIndInfo slotInd
* @return S16
* -# ROK
* -# RFAILED
#if (defined (MAC_FREE_RING_BUF) || defined (RLC_FREE_RING_BUF))
pthread_t gMacTId = 0;
#endif
-#ifdef ANSI
-PUBLIC S16 rgTOMTtiInd
+PUBLIC S16 macProcessSlotInd
(
Inst inst,
-TfuTtiIndInfo *ttiInfo
+SlotIndInfo slotInd
)
-#else
-PUBLIC S16 rgTOMTtiInd(inst, ttiInfo)
-Inst inst;
-TfuTtiIndInfo *ttiInfo;
-#endif
{
RgCellCb *cellCb;
RgErrInfo err;
RgDlSf *prevDlSf;
CmLteTimingInfo prevTmInfo;
#endif
- TfuTtiCellInfo *ttiInd = &ttiInfo->cells[0];
+ //SlotIndInfo *slotInd = &ttiInfo->cells[0];
- TRC2(rgTOMTtiInd);
+ TRC2(macProcessSlotInd);
#ifdef MAC_FREE_RING_BUF
gMacTId = pthread_self();
#endif
+
cellCb = rgCb[inst].cell;
- if ((cellCb == NULLP)
- ||(cellCb->cellId != ttiInd->cellId))
+ if (cellCb == NULLP)
{
-
- RLOG_ARG0(L_ERROR,DBG_CELLID,ttiInd->cellId,
- "Unable to get the cellCb for cell");
err.errType = RGERR_TOM_TTIIND;
err.errCause = RGERR_TOM_INV_CELL_ID;
RETVALUE(RFAILED);
}
- RGCPYTIMEINFO(ttiInd->timingInfo, cellCb->crntTime);
- if((0 == (ttiInd->timingInfo.sfn % 30)) && (0 == ttiInd->timingInfo.sfn))
- {
- //printf("5GTF_CHECK rgTOMTtiInd (%d : %d)\n", ttiInd->timingInfo.sfn, ttiInd->timingInfo.subframe);
- }
- rgMacGT = (ttiInd->timingInfo.sfn * RG_NUM_SUB_FRAMES_5G) + ttiInd->timingInfo.subframe;
+
+ RGCPYTIMEINFO(slotInd, cellCb->crntTime);
+
+ rgMacGT = (slotInd.sfn * RG_NUM_SUB_FRAMES_5G) + slotInd.slot;
#ifdef LTE_L2_MEAS
rgL2Meas(cellCb);
/*Included to track the number of 10240 cycles completed */
- if((cellCb->crntTime.sfn == 0) && (cellCb->crntTime.subframe==0))
+ if((cellCb->crntTime.sfn == 0) && (cellCb->crntTime.slot==0))
{
cellCb->ttiCycle += 1;
}
and thus we would not have transmitted previous DL SF yet.*/
/* ADD Changes for Downlink UE Timing Optimization */
#ifdef LTEMAC_DLUE_TMGOPTMZ
- RGSUBFRMCRNTTIME(ttiInd->timingInfo, prevTmInfo, 1);
- prevDlSf = &cellCb->subFrms[(prevTmInfo.subframe % RG_NUM_SUB_FRAMES)];
+ RGSUBFRMCRNTTIME(slotInd, prevTmInfo, 1);
+ prevDlSf = &cellCb->subFrms[(prevTmInfo.slot % RG_NUM_SUB_FRAMES)];
if(FALSE == prevDlSf->txDone)
{
if (ROK != rgTOMUtlProcDlSf (prevDlSf, cellCb, &err))
}
}
#endif
- dlSf = &cellCb->subFrms[(ttiInd->timingInfo.subframe % RG_NUM_SUB_FRAMES)];
+ dlSf = &cellCb->subFrms[(slotInd.slot % RG_NUM_SUB_FRAMES)];
if((dlSf->txDone == TRUE) ||
- (!RG_TIMEINFO_SAME(ttiInd->timingInfo,dlSf->schdTime)))
+ (!RG_TIMEINFO_SAME(slotInd,dlSf->schdTime)))
{
/* MS_WORKAROUND */
#ifndef LTEMAC_DLUE_TMGOPTMZ
RGADDTOCRNTTIME(cellCb->crntTime, timingInfo, TFU_DELTA);
#endif
/* Fill Data Request from MAC for BCH */
- if ((timingInfo.sfn % 4 == 0) && (timingInfo.subframe == 0))
+ if ((timingInfo.sfn % 4 == 0) && (timingInfo.slot == 0))
{
if (ROK != rgAllocEventMem(inst,(Ptr *)&datInfo,
sizeof(TfuDatReqInfo)))
#endif
#ifdef XEON_SPECIFIC_CHANGES
- CM_MEAS_TIME((ttiInd->timingInfo.subframe % RG_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MAC_DL_BR_PRC);
+ CM_MEAS_TIME((slotInd.slot % RG_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MAC_DL_BR_PRC);
#endif
if (ROK != rgTOMUtlProcDlSf (dlSf, cellCb, &err))
{
- RLOG_ARG0(L_ERROR,DBG_CELLID,ttiInd->cellId,
- "Unable to process downlink subframe for cell");
+ //RLOG_ARG0(L_ERROR,DBG_CELLID,slotInd->cellId,
+ // "Unable to process downlink subframe for cell");
err.errType = RGERR_TOM_TTIIND;
}
#ifdef XEON_SPECIFIC_CHANGES
- CM_MEAS_TIME((ttiInd->timingInfo.subframe % RG_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MAC_DL_AFTER_PRC);
+ CM_MEAS_TIME((slotInd->slot % RG_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MAC_DL_AFTER_PRC);
#endif
/* Mark this frame as sent */
rgDHMFreeTbBufs(inst);
#endif
RETVALUE(ROK);
-} /* rgTOMTtiInd */
+} /* macProcessSlotInd */
/** @brief This function allocates the RgMacPdu that will be populated by DEMUX
* with the SubHeaders list and the values of the Control elements.
}
RETVALUE(ROK);
-} /* rgTOMTtiInd */
+}
#endif
Bool isSpsRnti,
Bool *spsToBeActvtd,
U16 *sduSize,
- U8 subframe,
+ U16 slot,
U32 *lcgBytes
)
#else
-PRIVATE S16 rgTOMUtlProcMsg(cellCb, ueCb, pdu, isSpsRnti,spsToBeActvtd,sduSize, subframe, lcgBytes)
+PRIVATE S16 rgTOMUtlProcMsg(cellCb, ueCb, pdu, isSpsRnti,spsToBeActvtd,sduSize, slot, lcgBytes)
RgCellCb *cellCb;
RgUeCb *ueCb;
RgMacPdu *pdu;
Bool isSpsRnti;
Bool *spsToBeActvtd;
U16 *sduSize;
- U8 subframe;
+ U16 slot;
U32 *lcgBytes;
#endif
#else /* LTEMAC_SPS */
RgCellCb *cellCb,
RgUeCb *ueCb,
RgMacPdu *pdu,
- U8 subframe,
+ U16 slot,
U32 *lcgBytes
)
#else
-PRIVATE S16 rgTOMUtlProcMsg(cellCb, ueCb, pdu, subframe, lcgBytes)
+PRIVATE S16 rgTOMUtlProcMsg(cellCb, ueCb, pdu, slot, lcgBytes)
RgCellCb *cellCb;
RgUeCb *ueCb;
RgMacPdu *pdu;
- U8 subframe;
+ U16 slot;
U32 *lcgByes;
#endif
#endif
TRC2(rgTOMUtlProcMsg)
#ifndef LTE_L2_MEAS
- UNUSED(subframe);
+ UNUSED(slot);
#endif
if(pdu->sduLst.first)
&cpySz);
}
#ifdef XEON_SPECIFIC_CHANGES
- CM_LOG_DEBUG(CM_LOG_ID_MAC, "CCCH SDU of size(%d) received for UE(%d) CRES[0x%x 0x%x 0x%x 0x%x 0x%x 0x%x] Time[%d %d]\n", ((S16)ccchSz), ueCb->ueId,ueCb->contResId.resId[0], ueCb->contResId.resId[1], ueCb->contResId.resId[2], ueCb->contResId.resId[3], ueCb->contResId.resId[4], ueCb->contResId.resId[5], cellCb->crntTime.sfn, cellCb->crntTime.subframe);
+ CM_LOG_DEBUG(CM_LOG_ID_MAC, "CCCH SDU of size(%d) received for UE(%d) CRES[0x%x 0x%x 0x%x 0x%x 0x%x 0x%x] Time[%d %d]\n", ((S16)ccchSz), ueCb->ueId,ueCb->contResId.resId[0], ueCb->contResId.resId[1], ueCb->contResId.resId[2], ueCb->contResId.resId[3], ueCb->contResId.resId[4], ueCb->contResId.resId[5], cellCb->crntTime.sfn, cellCb->crntTime.slot);
#endif
sdu->mBuf = NULLP;
rgUIMSndCmnDatInd(inst,cellCb->rguUlSap,cDatInd);
dDatInd->numLch = 0;
}
#ifdef LTE_L2_MEAS
- ulSf = &cellCb->ulSf[(subframe % RG_NUM_SUB_FRAMES)];
+ ulSf = &cellCb->ulSf[(slot % RG_NUM_SUB_FRAMES)];
if(ulSf->ueUlAllocInfo != NULLP)
{
for(idx1 = 0; idx1 < ulSf->numUe; idx1++)
CmLList *node;
TfuDatInfo *datInfo;
RgLowSapCb *tfuSap;
- U8 subframe;
+ U16 slot;
#ifdef LTEMAC_SPS
Bool isSpsRnti=FALSE;
Pst schPst1;
cmLListInit(&sfInfo->ueLst);
sfInfo->cellId = datInd->cellId;
sfInfo->timingInfo = datInd->timingInfo;
- subframe = datInd->timingInfo.subframe;
+ slot = datInd->timingInfo.slot;
node = datInd->datIndLst.first;
for (;node; node=node->next)
if (ceInfo.bitMask & RG_CCCH_SDU_PRSNT)
{
ret = rgTOMProcCCCHSduInDatInd(pdu, prevUeCb, \
- cellCb, datInfo, &ceInfo, subframe);
+ cellCb, datInfo, &ceInfo, slot);
if (ret == RFAILED)
{
rgTOMUtlFreePduEvnt (pdu, TRUE);
else if (ceInfo.bitMask & RG_CRNTI_CE_PRSNT)
{
ret = rgTOMProcCrntiCEInDatInd(pdu, prevUeCb, \
- cellCb, datInfo, &ceInfo, subframe);
+ cellCb, datInfo, &ceInfo, slot);
if (ret == RFAILED)
{
rgTOMUtlFreePduEvnt (pdu, TRUE);
rgTOML2MCompileActiveLCs (cellCb, ueCb, pdu, &ceInfo);
#endif
#ifdef LTEMAC_SPS
- if ((ret = rgTOMUtlProcMsg(cellCb, ueCb, pdu, isSpsRnti,&spsToBeActvtd,&sduSize, subframe, (U32 *)&lcgBytes)) != ROK)
+ if ((ret = rgTOMUtlProcMsg(cellCb, ueCb, pdu, isSpsRnti,&spsToBeActvtd,&sduSize, slot, (U32 *)&lcgBytes)) != ROK)
#else
- if ((ret = rgTOMUtlProcMsg (cellCb, ueCb, pdu, subframe, (U32 *)&lcgBytes)) != ROK)
+ if ((ret = rgTOMUtlProcMsg (cellCb, ueCb, pdu, slot, (U32 *)&lcgBytes)) != ROK)
#endif /* LTEMAC_SPS */
{
rgTOMUtlFreePduEvnt (pdu, TRUE);
}
/* Free the allocated memory for ueUlAllocInfo here */
#ifdef LTE_L2_MEAS
- if(cellCb->ulSf[(subframe % RG_NUM_SUB_FRAMES)].ueUlAllocInfo != NULLP)
+ if(cellCb->ulSf[(slot % RG_NUM_SUB_FRAMES)].ueUlAllocInfo != NULLP)
{
/*ccpu00117052 - MOD - Passing double for proper NULLP
assignment */
- rgFreeSBuf(inst,(Data **)&(cellCb->ulSf[(subframe % RG_NUM_SUB_FRAMES)].ueUlAllocInfo),
- ((cellCb->ulSf[(subframe % RG_NUM_SUB_FRAMES)].numUe) * sizeof(RgUeUlAlloc)));
+ rgFreeSBuf(inst,(Data **)&(cellCb->ulSf[(slot % RG_NUM_SUB_FRAMES)].ueUlAllocInfo),
+ ((cellCb->ulSf[(slot % RG_NUM_SUB_FRAMES)].numUe) * sizeof(RgUeUlAlloc)));
}
#endif
/* RRM_RBC_X */
TRC2(rgHndlCmnChnl)
- dlSf = &cell->subFrms[(timingInfo.subframe % RG_NUM_SUB_FRAMES)];
+ dlSf = &cell->subFrms[(timingInfo.slot % RG_NUM_SUB_FRAMES)];
if(cmnLcInfo->bitMask & RGINF_BCH_INFO)
{
staInd->cellId = cell->cellId;
staInd->rnti = RG_INVALID_RNTI;
staInd->lcId = cmnLcInfo->bchInfo.lcId;
- staInd->transId = (timingInfo.sfn << 8) | (timingInfo.subframe);
+ staInd->transId = (timingInfo.sfn << 8) | (timingInfo.slot);
/* ADD Changes for Downlink UE Timing Optimization */
#ifdef LTEMAC_DLUE_TMGOPTMZ
dlSf->remDatReqCnt++;
staInd->cellId = cell->cellId;
staInd->rnti = RG_INVALID_RNTI;
staInd->lcId = cmnLcInfo->pcchInfo.lcId;
- staInd->transId = (timingInfo.sfn << 8) | (timingInfo.subframe);
+ staInd->transId = (timingInfo.sfn << 8) | (timingInfo.slot);
/* ADD Changes for Downlink UE Timing Optimization */
#ifdef LTEMAC_DLUE_TMGOPTMZ
dlSf->remDatReqCnt++;
staInd->cellId = cell->cellId;
staInd->rnti = RG_INVALID_RNTI;
staInd->lcId = cmnLcInfo->bcchInfo.lcId;
- staInd->transId = (timingInfo.sfn << 8) | (timingInfo.subframe);
+ staInd->transId = (timingInfo.sfn << 8) | (timingInfo.slot);
/* ADD Changes for Downlink UE Timing Optimization */
#ifdef LTEMAC_DLUE_TMGOPTMZ
dlSf->remDatReqCnt++;
TRC2(rgHndlUlUeInfo)
- ulSf = &cell->ulSf[(timingInfo.subframe % RGSCH_NUM_SUB_FRAMES)];
+ ulSf = &cell->ulSf[(timingInfo.slot % RGSCH_NUM_SUB_FRAMES)];
/* rg003.301-MOD- Corrected the purifier memory leak */
if (ulSf->numUe != ueInfo->numUes)
}
}
#ifdef XEON_SPECIFIC_CHANGES
- CM_MEAS_TIME((cell->crntTime.subframe % RGSCH_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MEAS_FREE);
- CM_ADD_INFO((cell->crntTime.subframe % RGSCH_NUM_SUB_FRAMES), CM_DBG_MEAS_FREE, ulSf->numUe);
+ CM_MEAS_TIME((cell->crntTime.slot % RGSCH_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MEAS_FREE);
+ CM_ADD_INFO((cell->crntTime.slot % RGSCH_NUM_SUB_FRAMES), CM_DBG_MEAS_FREE, ulSf->numUe);
#endif
ulSf->numUe = ueInfo->numUes;
if((ulSf->ueUlAllocInfo == NULLP) && (ueInfo->numUes > 0))
{
/* Allocate memory for ulAllocInfo */
- if((ret = rgAllocSBuf(inst,(Data**)&(cell->ulSf[(timingInfo.subframe % RGSCH_NUM_SUB_FRAMES)].
+ if((ret = rgAllocSBuf(inst,(Data**)&(cell->ulSf[(timingInfo.slot % RGSCH_NUM_SUB_FRAMES)].
ueUlAllocInfo), ueInfo->numUes * sizeof(RgUeUlAlloc))) != ROK)
{
RETVALUE(ret);
}
}
#ifdef XEON_SPECIFIC_CHANGES
- CM_MEAS_TIME((cell->crntTime.subframe % RGSCH_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MEAS_ALLOC);
- CM_ADD_INFO((cell->crntTime.subframe % RGSCH_NUM_SUB_FRAMES), CM_DBG_MEAS_ALLOC, ueInfo->numUes);
+ CM_MEAS_TIME((cell->crntTime.slot % RGSCH_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MEAS_ALLOC);
+ CM_ADD_INFO((cell->crntTime.slot % RGSCH_NUM_SUB_FRAMES), CM_DBG_MEAS_ALLOC, ueInfo->numUes);
#endif
if (ulSf->ueUlAllocInfo != NULLP)
{
{
for(i=0;i< RG_MAX_TB_PER_UE;i++)
{
- if (hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.subframe % 2].sf == dlSf)
+ if (hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf == dlSf)
{
- cmLListDelFrm(&dlSf->tbs, &(hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.subframe % 2].sfLnk));
- hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.subframe % 2].sfLnk.node = NULLP;
+ cmLListDelFrm(&dlSf->tbs, &(hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk));
+ hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk.node = NULLP;
printf("\n rgTOMRlsSf:: hqP %p \n", (Void *)hqP);
}
- hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.subframe % 2].sf = NULLP;
+ hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf = NULLP;
}
}
}
RETVALUE(RFAILED);
}
- dlSf = &cell->subFrms[(sfInfo->timingInfo.subframe % RG_NUM_SUB_FRAMES)];
+ dlSf = &cell->subFrms[(sfInfo->timingInfo.slot % RG_NUM_SUB_FRAMES)];
rgTOMRlsSf(inst,dlSf);
dlSf->schdTime = sfInfo->timingInfo;
#ifdef LTE_ADV
#ifdef XEON_SPECIFIC_CHANGES
- CM_MEAS_TIME((cell->crntTime.subframe % RG_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MAC_B4_UE_SCHD);
+ CM_MEAS_TIME((cell->crntTime.slot % RG_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MAC_B4_UE_SCHD);
#endif
rgHndlSchdUe(cell, sfInfo->timingInfo, &sfInfo->ueInfo, &err);
#ifdef XEON_SPECIFIC_CHANGES
- CM_MEAS_TIME((cell->crntTime.subframe % RG_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MAC_UE_SCHD);
+ CM_MEAS_TIME((cell->crntTime.slot % RG_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MAC_UE_SCHD);
#endif
rgLaaChkAndReqTbs(dlSf,cell, inst);
}
#endif
#ifdef XEON_SPECIFIC_CHANGES
- CM_MEAS_TIME((cell->crntTime.subframe % RG_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MAC_MEAS);
+ CM_MEAS_TIME((cell->crntTime.slot % RG_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MAC_MEAS);
#endif
/* Fix[ccpu00126310]: Tracks Data Requests from RLC for both loosely and tight coupled
RLC-MAC */
RgCellCb *cellCb,
TfuDatInfo *datInfo,
RgInfCeInfo *ceInfo,
-U8 subframe
+U16 slot
)
#else
-PRIVATE S16 rgTOMProcCrntiCEInDatInd( pdu, prevUeCb, cellCb, datInfo, ceInfo, subframe)
+PRIVATE S16 rgTOMProcCrntiCEInDatInd( pdu, prevUeCb, cellCb, datInfo, ceInfo, slot)
RgMacPdu *pdu;
RgUeCb *prevUeCb;
RgCellCb *cellCb;
TfuDatInfo *datInfo;
RgInfCeInfo *ceInfo;
-U8 subframe;
+U16 slot;
#endif
{
RgUeCb *ueCb = NULLP;
TRC2(rgTOMProcCrntiCEInDatInd)
#ifndef LTE_L2_MEAS
- UNUSED(subframe);
+ UNUSED(slot);
#endif
ueCb = rgDBMGetUeCbFromRachLst (cellCb, datInfo->rnti);
rgRAMFreeUeCb(inst,ueCb);
ueCb = prevUeCb;
#ifdef LTEMAC_SPS
- if ((rgTOMUtlProcMsg(cellCb, ueCb, pdu, FALSE,&spsToBeActvtd,&sduSize, subframe, NULLP)) != ROK)
+ if ((rgTOMUtlProcMsg(cellCb, ueCb, pdu, FALSE,&spsToBeActvtd,&sduSize, slot, NULLP)) != ROK)
#else
- if ((rgTOMUtlProcMsg (cellCb, ueCb, pdu, subframe, NULLP)) != ROK)
+ if ((rgTOMUtlProcMsg (cellCb, ueCb, pdu, slot, NULLP)) != ROK)
#endif /* LTEMAC_SPS */
{
RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,
RgCellCb *cellCb,
TfuDatInfo *datInfo,
RgInfCeInfo *ceInfo,
-U8 subframe
+U16 slot
)
#else
-PRIVATE S16 rgTOMProcCCCHSduInDatInd( pdu, prevUeCb, cellCb, datInfo, ceInfo, subframe)
+PRIVATE S16 rgTOMProcCCCHSduInDatInd( pdu, prevUeCb, cellCb, datInfo, ceInfo, slot)
RgMacPdu *pdu;
RgUeCb *prevUeCb;
RgCellCb *cellCb;
TfuDatInfo *datInfo;
RgInfCeInfo *ceInfo;
-U8 subframe;
+U16 slot;
#endif
{
RgUeCb *ueCb = NULLP;
TRC2(rgTOMProcCCCHSduInDatInd)
#ifndef LTE_L2_MEAS
- UNUSED(subframe);
+ UNUSED(slot);
#endif
if (ceInfo->bitMask & RG_CRNTI_CE_PRSNT)
RLOG_ARG1(L_DEBUG,DBG_CELLID,cellCb->cellId,
"CCCH SDU received through tmpCrnti(%d)",datInfo->rnti);
#ifdef LTEMAC_SPS
- if ((rgTOMUtlProcMsg(cellCb, ueCb, pdu, FALSE,&spsToBeActvtd,&sduSize, subframe, NULLP)) != ROK)
+ if ((rgTOMUtlProcMsg(cellCb, ueCb, pdu, FALSE,&spsToBeActvtd,&sduSize, slot, NULLP)) != ROK)
#else
- if ((rgTOMUtlProcMsg (cellCb, ueCb, pdu, subframe, NULLP)) != ROK)
+ if ((rgTOMUtlProcMsg (cellCb, ueCb, pdu, slot, NULLP)) != ROK)
#endif /* LTEMAC_SPS */
{
RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"RNTI:%d Processing for MSG3 failed",
struct _t
{
U16 sfn; /*!< Sub frame number for BCCH/PCCH */
- U8 subframe; /*!< Subframe number */
+ U16 slot; /*!< Subframe number */
CmLteRnti rnti; /*!< RNTI for CCCH */
#ifdef EMTC_ENABLE
U8 emtcDiReason; /*!< DI reason */
RLOG0(L_FATAL,"RLC DL Initialization failed");
RETVALUE(LCM_REASON_MEM_NOAVAIL);
}
+#if 0
/* Register the timer */
/*Pradeep: changing the SRegTmrMt() to SRegTmr()*/
if(SRegTmrMt(gCb->init.ent, gCb->init.inst, (U16)cfg->timeRes,
RETVALUE(LCM_REASON_REGTMR_FAIL);
}
-
+#endif
/* initializations for background processing of freeing memory */
kwUtlInitToBeFreed(gCb, &(gCb->u.dlCb->toBeFreed));
kwUtlInitializeSelfPst(gCb);
}
/* Register the timer */
-
+#if 0
if(SRegTmrMt(gCb->init.ent, gCb->init.inst, (U16)cfg->timeRes,
kwActvTmr) != ROK)
{
RETVALUE(LCM_REASON_REGTMR_FAIL);
}
+#endif
#ifdef LTE_L2_MEAS
kwUtlL2MeasUlInit(gCb);
#endif
rbCb->lch.lChType == CM_LTE_LCH_PCCH )
{
sdu->mode.tm.sfn = datReqInfo->tm.tmg.sfn;
- sdu->mode.tm.subframe = datReqInfo->tm.tmg.subframe;
+ sdu->mode.tm.slot = datReqInfo->tm.tmg.slot;
#ifdef EMTC_ENABLE
if(rbCb->lch.lChType == CM_LTE_LCH_PCCH)
{
CM_LLIST_FIRST_NODE(&(rbCb->m.tm.sduQ),
node);
- /* (Sfn,subframe) at which the message should be transmitted is
- * validated with alloted (sfn,subframe)in the MAC layer */
+ /* (Sfn,slot) at which the message should be transmitted is
+ * validated with alloted (sfn,slot)in the MAC layer */
while (node != NULLP)
{
sdu = (KwSdu *)(node->node);
if ( rbCb->lch.lChType == CM_LTE_LCH_BCCH ||
rbCb->lch.lChType == CM_LTE_LCH_PCCH )
{
- U16 sfn, subframe;
+ U16 sfn, slot;
/* MS_FIX: syed sfn is of 10 bytes rather than 8 */
#ifdef EMTC_ENABLE
- /* As part of CATM feature cross subframe scheduling is implemented , so there is some delta(currently 2)
+ /* As part of CATM feature cross slot scheduling is implemented , so there is some delta(currently 2)
between MPDCCH and PDSCH,RLC expects cell crntTime of transmission of control dlsf, so one extra
- information is provided in staInd, so that sfn,subframe should calculate from paging Timing information
+ information is provided in staInd, so that sfn,slot should calculate from paging Timing information
in case of EMTC paging, instead of transId */
if(staInd->isEmtcPaging)
{
sfn = staInd->pagingTimingInfo.sfn;
- subframe = staInd->pagingTimingInfo.subframe;
+ slot = staInd->pagingTimingInfo.slot;
}
else
#endif
{
sfn = (staInd->transId >> 8) & 0x3FF;
- subframe = staInd->transId & 0xFF;
+ slot = staInd->transId & 0xFF;
}
/* Table
- * tm.subframe - current subframe
+ * tm.slot - current slot
* 0,sfn 7,sfn-1
* 4,sfn 1,sfn
* 5,sfn 2,sfn
* Take care of SFN wraparound. TODO: It is better for RLC
* not to be aware of SCH DELTAs. So we should look for
* sending actual transmission time to RLC. */
- if ((subframe + TFU_DELTA) >= 10)
+ if ((slot + TFU_DELTA) >= 10)
{
sfn = (sfn + 1)%1024;
}
if ((sdu->mode.tm.sfn != sfn) ||
- (sdu->mode.tm.subframe != ((subframe+TFU_DELTA)%10)))
+ (sdu->mode.tm.slot != ((slot+TFU_DELTA)%10)))
{
node = node->next;
RLOG_ARG4(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId,
rbCb->rlcId.ueId,
rbCb->rlcId.cellId);
RLOG_ARG4(L_DEBUG,DBG_RBID,rbCb->rlcId.rbId,
- "sfn %d subframe %d UEID:%d CELLID:%d",
+ "sfn %d slot %d UEID:%d CELLID:%d",
sfn,
- subframe,
+ slot,
rbCb->rlcId.ueId,
rbCb->rlcId.cellId);
cmLListDelFrm(&(rbCb->m.tm.sduQ), &sdu->lstEnt);
#endif /* ERRCLASS & ERRCLS_ADD_RES */
dlData->timeToTx.sfn = sdu->mode.tm.sfn;
- dlData->timeToTx.subframe = sdu->mode.tm.subframe;
+ dlData->timeToTx.slot = sdu->mode.tm.slot;
dlData->cellId = rbCb->rlcId.cellId;
dlData->rnti = sdu->mode.tm.rnti;
dlData->nmbPdu = 1;
#endif
/* local defines */
/************** LRG Interface ****************/
-/**
- * @brief Layer Manager Configuration request handler.
- *
- * @details
- *
- * Function : HandleSchGenCfgReq
- *
- * This function handles the configuration
- * request received at scheduler instance from the Layer Manager.
- * -# Based on the cfg->hdr.elmId.elmnt value it invokes one of the
- * functions rgHdlGenCfg() or rgHdlSapCfg().
- * -# Invokes RgMiLrgSchCfgCfm() to send back the confirmation to the LM.
- *
- * @param[in] Pst *pst, the post structure
- * @param[in] RgMngmt *cfg, the configuration parameter's structure
- * @return S16
- * -# ROK
- **/
-#ifdef ANSI
-PUBLIC S16 HandleSchGenCfgReq
-(
-Pst *pst, /* post structure */
-RgMngmt *cfg /* config structure */
-)
-#else
-PUBLIC S16 HandleSchGenCfgReq(pst, cfg)
-Pst *pst; /* post structure */
-RgMngmt *cfg; /* config structure */
-#endif
-{
- U16 ret = LCM_PRIM_OK;
- U16 reason = LCM_REASON_NOT_APPL;
- RgMngmt cfm;
- Pst cfmPst;
-#ifdef DEBUGP
- Inst inst = (pst->dstInst - SCH_INST_START);
-#endif
-
- TRC3(HandleSchGenCfgReq)
-
-
- if(pst->dstInst < SCH_INST_START)
- {
- RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "Invalid inst ID");
- RLOG_ARG2(L_DEBUG,DBG_INSTID,inst, "HandleSchGenCfgReq(): "
- "pst->dstInst=%d SCH_INST_START=%d", pst->dstInst,SCH_INST_START);
- RETVALUE(ROK);
- }
- printf("\nReceived scheduler gen config");
- /* Fill the post structure for sending the confirmation */
- SchFillCfmPst(pst, &cfmPst, cfg);
-
- /* Initialize the cfg cfm structure
- if (SGetSBuf(cfmPst.region, cfmPst.pool, (Data **)&cfm, sizeof(RgMngmt))
- != ROK)
- {
- RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "Memory Unavailable for Confirmation");
- RETVALUE(ROK);
- } */
- cmMemset((U8 *)&cfm, 0, sizeof(RgMngmt));
-
-#ifdef LMINT3
- cfm.hdr.transId =
- cfg->hdr.transId;
-#endif
-
- cfm.hdr.elmId.elmnt = cfg->hdr.elmId.elmnt;
- switch(cfg->hdr.elmId.elmnt)
- {
- case STSCHINST:
- reason = SchInstCfg(&cfg->t.cfg,pst->dstInst );
- break;
- default:
- ret = LCM_PRIM_NOK;
- reason = LCM_REASON_INVALID_ELMNT;
- RLOG_ARG1(L_ERROR,DBG_INSTID,inst, "Invalid Elmnt=%d", cfg->hdr.elmId.elmnt);
- break;
- }
-
- if (reason != LCM_REASON_NOT_APPL)
- {
- ret = LCM_PRIM_NOK;
- }
-
- cfm.cfm.status = ret;
- cfm.cfm.reason = reason;
-
- SchSendCfgCfm(&cfmPst, &cfm);
- /* SPutSBuf(pst->region, pst->pool, (Data *)cfg, sizeof(RgMngmt)); */
-
- RETVALUE(ROK);
-}/*-- HandleSchGenCfgReq --*/
-
\f
/**
* @brief Layer Manager Control request handler.
RETVALUE(ROK);
} /* RgUiRgrUbndReq */
-/**
- * @brief API for configuration request from RRM towards MAC.
- *
- * @details
- *
- * Function: HandleSchCfgReq
- *
- * This API is invoked by RRM towards MAC to configure MAC.
- * These API validates the Pst, spId, suId and transfers the config request
- * specific information to corresponding ownership module (GOM) API.
- *
- *
- * @param[in] Pst *pst
- * @param[in] RgrCfgTransId transId
- * @param[in] RgrCfgReqInfo *cfgReqInfo
- * @return S16
- * -# ROK
- * -# RFAILED
- **/
-#ifdef ANSI
-PUBLIC S16 HandleSchCfgReq
-(
- Pst *pst,
- RgrCfgTransId transId,
- RgrCfgReqInfo *cfgReqInfo
- )
-#else
-PUBLIC S16 HandleSchCfgReq(pst, transId, cfgReqInfo)
- Pst *pst;
- RgrCfgTransId transId;
- RgrCfgReqInfo *cfgReqInfo;
-#endif
-{
-
- SpId spId = 0;
- S16 ret = ROK;
- U8 cfmStatus = 0x00ff;
- U8 prntTrans[RGR_CFG_TRANSID_SIZE+1];
- Inst instId = pst->dstInst-SCH_INST_START;
-
- TRC3(HandleSchCfgReq);
-
- cmMemcpy((U8 *)prntTrans, (U8 *)transId.trans, RGR_CFG_TRANSID_SIZE);
- prntTrans[RGR_CFG_TRANSID_SIZE] = '\0';
-
-
- if (cfgReqInfo == NULLP)
- {
- RLOG_ARG0(L_ERROR,DBG_INSTID,instId,"Input Message Buffer is NULL");
- schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
- RETVALUE(RFAILED);
- }
-#if 0
- if (spId < rgSchCb[instId].numSaps)
- {
- switch(rgSchCb[instId].rgrSap[spId].sapSta.sapState)
- {
- case LRG_BND: /* SAP is already bound */
- RLOG0(L_DEBUG,"SAP is already bound");
- break;
- default: /* Should never reach here */
-#if (ERRCLASS & ERRCLS_ADD_RES)
- RGSCHLOGERROR(instId, ERRCLS_INT_PAR, ERG005,
- (ErrVal)rgSchCb[instId].rgrSap[spId].sapSta.sapState,
- "Invalid SAP State: HandleSchCfgReq failed\n");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
- (Size)sizeof(*cfgReqInfo));
- schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
- RETVALUE(RFAILED);
- }
- }
- else
- {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- RGSCHLOGERROR(instId, ERRCLS_INT_PAR, ERG006,
- (ErrVal)rgSchCb[instId].rgrSap[spId].sapCfg.spId,
- "Invalid SAP Id:HandleSchCfgReq failed\n");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
- (Size)sizeof(*cfgReqInfo));
- schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus);
- RETVALUE(RFAILED);
- }
-#endif
- /* Handle configuration */
- ret = rgSCHGomHndlCfg(pst, &rgSchCb[instId],
- transId, cfgReqInfo);
- if (ret != ROK)
- {
- RLOG_ARG0(L_ERROR,DBG_INSTID,instId,"Configuration Request Handling Failed");
- RETVALUE(RFAILED);
- }
-
- RETVALUE(ROK);
-} /* HandleSchCfgReq */
-
#ifdef RGR_SI_SCH
/**
* @brief API for SI configuration request from RRM towards MAC.
RETVALUE(ret);
} /* RgLiTfuTimingAdvInd */
-
-/**
- * @brief Transmission time interval indication from PHY.
- *
- * @details
- *
- * Function : RgLiTfuSchTtiInd
- *
- * This API is invoked by PHY to indicate TTI indication to Scheduler for
- * a cell.
- *
- * @param[in] Pst *pst
- * @param[in] SuId suId
- * @param[in] TfuTtiIndInfo *ttiInd
- * @return S16
- * -# ROK
- * -# RFAILED
- **/
-#ifdef ANSI
-PUBLIC S16 RgLiTfuSchTtiInd
-(
-Pst *pst,
-SuId suId,
-TfuTtiIndInfo *ttiInd
-)
-#else
-PUBLIC S16 RgLiTfuSchTtiInd(pst, suId, ttiInd)
-Pst *pst;
-SuId suId;
-TfuTtiIndInfo *ttiInd;
-#endif
-{
- S16 ret = ROK;
- Inst inst = pst->dstInst-SCH_INST_START;
-
- TRC3(RgLiTfuSchTtiInd);
-
-
- /* Removing the validation with every TTI - for optimization */
-#ifndef NO_ERRCLS
- if ((ret = rgSCHUtlValidateTfuSap (inst, suId)) != ROK)
- {
- RLOG_ARG0(L_ERROR,DBG_INSTID,inst,"SAP Validation failed");
- RETVALUE(ret);
- }
-#endif
- /* Moved check for cell outside ERRCLS*/
-
- /* Now call the TOM (Tfu ownership module) primitive to process further */
- rgSCHTomTtiInd(ttiInd, inst);
-
- RETVALUE(ret);
-} /* RgLiTfuSchTtiInd */
-
/************* RGM Interface ****************/
/**
* @brief API for bind request from RRM towards MAC.
(_time2.sfn*10 + _time2.subframe))*/
#define RG_SCH_ADD_TO_CRNT_TIME_EMTC(crntTime, toFill, incr) \
- if ((crntTime.subframe + (incr)) >= RGSCH_NUM_SUB_FRAMES) \
+ if ((crntTime.slot + (incr)) >= RGSCH_NUM_SUB_FRAMES) \
toFill.sfn = (crntTime.sfn + \
- (crntTime.subframe + (incr)) / RGSCH_NUM_SUB_FRAMES); \
+ (crntTime.slot + (incr)) / RGSCH_NUM_SUB_FRAMES); \
else \
toFill.sfn = crntTime.sfn; \
- toFill.subframe = (crntTime.subframe + (incr)) % RGSCH_NUM_SUB_FRAMES; \
+ toFill.subframe = (crntTime.slot + (incr)) % RGSCH_NUM_SUB_FRAMES; \
if (toFill.sfn >= RGSCH_MAX_SFN) \
{ \
toFill.hSfn = (crntTime.hSfn + 1) % RGSCH_MAX_SFN; \
#else
-#define RGSCH_SUBFRAME_INDEX(x) ( ( ((x).sfn) * RGSCH_NUM_SUB_FRAMES_5G ) + (x).subframe )
+#define RGSCH_SUBFRAME_INDEX(x) ( ( ((x).sfn) * RGSCH_NUM_SUB_FRAMES_5G ) + (x).slot )
#endif
/* Note: In RGSCH_CALC_SF_DIFF, _time1 should be the latest */
#define RGSCH_CALC_SF_DIFF(_time1, _time2)\
- (_time1.sfn*RGSCH_NUM_SUB_FRAMES_5G+_time1.subframe) < (_time2.sfn*RGSCH_NUM_SUB_FRAMES_5G +_time2.subframe)?\
- (_time1.sfn*RGSCH_NUM_SUB_FRAMES_5G+_time1.subframe) -\
- (_time2.sfn*RGSCH_NUM_SUB_FRAMES_5G+_time2.subframe) : \
- (_time1.sfn*RGSCH_NUM_SUB_FRAMES_5G+_time1.subframe) - (_time2.sfn*RGSCH_NUM_SUB_FRAMES_5G +_time2.subframe)\
+ (_time1.sfn*RGSCH_NUM_SUB_FRAMES_5G+_time1.slot) < (_time2.sfn*RGSCH_NUM_SUB_FRAMES_5G +_time2.slot)?\
+ (_time1.sfn*RGSCH_NUM_SUB_FRAMES_5G+_time1.slot) -\
+ (_time2.sfn*RGSCH_NUM_SUB_FRAMES_5G+_time2.slot) : \
+ (_time1.sfn*RGSCH_NUM_SUB_FRAMES_5G+_time1.slot) - (_time2.sfn*RGSCH_NUM_SUB_FRAMES_5G +_time2.slot)\
/*Addef for L2Meas*/
/*LTE_L2_MEAS_PHASE2*/
#define RGSCH_CALC_SFN_SF_DIFF(_time1,_sfnCycle, _time2)\
-(((_time1.sfn+RGSCH_MAX_SFN * _sfnCycle)*RGSCH_NUM_SUB_FRAMES_5G) + _time1.subframe -\
-(_time2.sfn*RGSCH_NUM_SUB_FRAMES_5G + _time2.subframe))
+(((_time1.sfn+RGSCH_MAX_SFN * _sfnCycle)*RGSCH_NUM_SUB_FRAMES_5G) + _time1.slot -\
+(_time2.sfn*RGSCH_NUM_SUB_FRAMES_5G + _time2.slot))
#define RG_SCH_ADD_TO_CRNT_TIME(crntTime, toFill, incr) \
- if ((crntTime.subframe + (incr)) >= RGSCH_NUM_SUB_FRAMES_5G) \
+ if ((crntTime.slot + (incr)) >= RGSCH_NUM_SUB_FRAMES_5G) \
toFill.sfn = (crntTime.sfn + \
- (crntTime.subframe + (incr)) / RGSCH_NUM_SUB_FRAMES_5G); \
+ (crntTime.slot + (incr)) / RGSCH_NUM_SUB_FRAMES_5G); \
else \
toFill.sfn = crntTime.sfn; \
- toFill.subframe = (crntTime.subframe + (incr)) % RGSCH_NUM_SUB_FRAMES_5G; \
+ toFill.slot = (crntTime.slot + (incr)) % RGSCH_NUM_SUB_FRAMES_5G; \
if (toFill.sfn >= RGSCH_MAX_SFN) \
{ \
toFill.sfn = toFill.sfn % RGSCH_MAX_SFN; \
do \
{ \
S32 _subframe;\
- _subframe = _crntDl.sfn * RGSCH_NUM_SUB_FRAMES_5G + _crntDl.subframe; \
+ _subframe = _crntDl.sfn * RGSCH_NUM_SUB_FRAMES_5G + _crntDl.slot; \
_subframe = _subframe - decr; \
if(_subframe < 0) \
{ \
} \
_subframe = _subframe % RGSCH_MAX_SUBFRM_5G; \
_prevDl.sfn = _subframe / RGSCH_NUM_SUB_FRAMES_5G; \
- _prevDl.subframe = _subframe % RGSCH_NUM_SUB_FRAMES_5G; \
+ _prevDl.slot = _subframe % RGSCH_NUM_SUB_FRAMES_5G; \
} while(0)
/* ccpu00133109: Removed RGSCHSUBFRMCRNTTIME as it is not giving proper output
#define RGSCHCPYTIMEINFO(src, dst) \
dst.sfn = src.sfn; \
- dst.subframe = src.subframe; \
+ dst.slot = src.slot; \
-#define RGSCH_TIMEINFO_SAME(x, y) (((x).sfn == (y).sfn) && ((x).subframe == (y).subframe))
+#define RGSCH_TIMEINFO_SAME(x, y) (((x).sfn == (y).sfn) && ((x).slot == (y).slot))
/* Added support for SPS*/
#ifdef LTEMAC_SPS
{*_ret = -1; }\
else if ((_x).sfn == (_y).sfn)\
{\
- if ((_x).subframe > (_y).subframe)\
+ if ((_x).slot > (_y).slot)\
{ *_ret = 1; }\
else\
{*_ret = -1; }\
}
#define RGSCH_INCR_SUB_FRAME(x,y) do { \
- if ((x.subframe += y) > (RGSCH_NUM_SUB_FRAMES_5G - 1)) {\
- x.sfn += (x.subframe/RGSCH_NUM_SUB_FRAMES_5G); x.subframe = (x.subframe%RGSCH_NUM_SUB_FRAMES_5G);\
+ if ((x.slot += y) > (RGSCH_NUM_SUB_FRAMES_5G - 1)) {\
+ x.sfn += (x.slot/RGSCH_NUM_SUB_FRAMES_5G); x.slot = (x.slot%RGSCH_NUM_SUB_FRAMES_5G);\
if (x.sfn >= RGSCH_MAX_SFN) \
{ \
x.sfn %= RGSCH_MAX_SFN; \
(_tbInfo)->m = 0; \
(_tbInfo)->fdbkTime.sfn = (_timingInfo.sfn + \
_dlSf->dlFdbkInfo.sfnOffset) % RGSCH_MAX_SFN; \
- (_tbInfo)->fdbkTime.subframe = _dlSf->dlFdbkInfo.subframe; \
+ (_tbInfo)->fdbkTime.slot = _dlSf->dlFdbkInfo.slot; \
(_tbInfo)->timingInfo = _timingInfo; \
} while(0)
do \
{ \
_anInfo->sfn = (_tbInfo)->fdbkTime.sfn; \
- _anInfo->subframe = (_tbInfo)->fdbkTime.subframe; \
+ _anInfo->slot = (_tbInfo)->fdbkTime.slot; \
_anInfo->latestMIdx = (_tbInfo)->m; \
} while(0)
/* Support for iPhich=1 for TDD*/
#define RGSCH_SF_ALLOC_SIZE 4
/* Defining new MACRO for DL subframes */
-#define RGSCH_NUM_DL_SUBFRAMES 20
+#define RGSCH_NUM_DL_slotS 20
/* Define for the block size for memory allocation */
#define RGSCH_BLKSZ 2048
/* To Get the Idx to pCqiSrsSrLst in RgSchCellCb*/
#define RG_SCH_GET_IDX_PCQISRSSR(_time, _indexId)\
{\
- (_indexId) = (_time.sfn)* RGSCH_NUM_SUB_FRAMES_5G + (_time.subframe); \
+ (_indexId) = (_time.sfn)* RGSCH_NUM_SUB_FRAMES_5G + (_time.slot); \
(_indexId) = (_indexId)%RG_SCH_PCQI_SRS_SR_TRINS_SIZE;\
}
#include "rg_sch_emtc.x"
#endif
+
typedef struct rgSchHistNode
{
U32 line;
#else
#ifdef RG_5GTF
/* 5GTF TODO : Hard setting number of CCs to 3 */
- RgSchDlHqInfo dlSfHqInfo[MAX_5GTF_CELL][RGSCH_NUM_DL_SUBFRAMES];
+ RgSchDlHqInfo dlSfHqInfo[MAX_5GTF_CELL][RGSCH_NUM_DL_slotS];
#else
- RgSchDlHqInfo dlSfHqInfo[RGSCH_NUM_DL_SUBFRAMES];
+ RgSchDlHqInfo dlSfHqInfo[RGSCH_NUM_DL_slotS];
#endif
#endif
/* Moved from rgSchCmnDlUe to Here, as this shouldn't be present per cell*/
CmLListCp n1ResUsedLst[RGSCH_NUM_SUB_FRAMES]; /*!< For storing the used
N1 resources for scell in case of F1B CS */
#else
- RgSchDlSf *subFrms[RGSCH_NUM_DL_SUBFRAMES];
+ RgSchDlSf *subFrms[RGSCH_NUM_DL_slotS];
U16 nCce;
#endif
RgSchDynCfiCb dynCfiCb; /*!< Dynamic CFI control block */
RgSchCellCb *cell,
TfuCrcIndInfo *crcInd));
-EXTERN Void rgSCHTomTtiInd ARGS((
- TfuTtiIndInfo *ttiInd,
- Inst inst));
-
EXTERN S16 rgSCHTomHarqAckInd ARGS((
RgSchCellCb *cell,
TfuHqIndInfo *harqAckInd));
/*ccpu00117778- Initialize Transmission Indices upon UE CB creation */
#ifdef LA
ue->lastRprdAckNackTime.sfn = cell->crntTime.sfn;
- ue->lastRprdAckNackTime.subframe = cell->crntTime.subframe;
+ ue->lastRprdAckNackTime.subframe = cell->crntTime.slot;
ue->ueIdle = FALSE;
#endif
(Data **)&ue->dl.dlSfHqInfo, sizeof(RgSchDlHqInfo) * (ue->dl.numHqDlSfInfo));
#else
- ue->dl.numHqDlSfInfo = RGSCH_NUM_DL_SUBFRAMES;
+ ue->dl.numHqDlSfInfo = RGSCH_NUM_DL_slotS;
#endif
#ifndef RG_5GTF
for (idx =0;idx < ue->dl.numHqDlSfInfo; idx++)
/* dsfr_pal_fixes ** 21-March-2013 ** SKS */
if (cellRecfg->rgrLteAdvCfg.sfrCfg.status == RGR_ENABLE)
{
- for(i = 0; i < RGSCH_NUM_DL_SUBFRAMES; i++)
+ for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
{
/*initialise the pools of CC and CE*/
if(rgSchSFRTotalPoolInit(cell, cell->subFrms[i]))
}
else
{
- for(i = 0; i < RGSCH_NUM_DL_SUBFRAMES; i++)
+ for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
{
/*initialise the pools of CC and CE*/
rgSchSFRTotalPoolFree(&cell->subFrms[i]->sfrTotalPoolInfo, cell);
if (cell->lteAdvCb.dsfrCfg.status == RGR_ENABLE)
{
/* releasing rntp info val from each subframe */
- for(i = 0; i < RGSCH_NUM_DL_SUBFRAMES; i++)
+ for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
{
rgSchDSFRRntpInfoFree(&cell->subFrms[i]->rntpInfo, cell, cell->bwCfg.dlTotalBw);
}
cellRecfg->rgrLteAdvCfg.dsfrCfg;
if (cell->lteAdvCb.dsfrCfg.status == RGR_ENABLE)
{
- for(i = 0; i < RGSCH_NUM_DL_SUBFRAMES; i++)
+ for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
{
/*initialise the pools of CC and CE*/
if(rgSchDSFRRntpInfoInit(&cell->subFrms[i]->rntpInfo,cell,cell->bwCfg.dlTotalBw))
else
{
/* releasing rntp info val from each subframe */
- for(i = 0; i < RGSCH_NUM_DL_SUBFRAMES; i++)
+ for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
{
rgSchDSFRRntpInfoFree(&cell->subFrms[i]->rntpInfo, cell, cell->bwCfg.dlTotalBw);
}
TRC3(rgSCHCfgPCqiUeCfg);
crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)+
- (cellCb->crntTime.subframe);
+ (cellCb->crntTime.slot);
cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
cqiCb->servCellInfo = ueCb->cellInfo[0];
/* Periodic CQI is setup */
cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx % (RGSCH_MAX_SFN * RGSCH_NUM_SUB_FRAMES_5G);
timingInfo.sfn = cqiCb->nCqiTrIdx/RGSCH_NUM_SUB_FRAMES_5G;
- timingInfo.subframe = cqiCb->nCqiTrIdx % RGSCH_NUM_SUB_FRAMES_5G;
+ timingInfo.slot = cqiCb->nCqiTrIdx % RGSCH_NUM_SUB_FRAMES_5G;
cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx
%RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
- +(cellCb->crntTime.subframe);
+ +(cellCb->crntTime.slot);
cqiCb = RG_SCH_GET_UE_CELL_CQI_CB(ueCb,cellCb);
/* 1. Rank Indicator is enabled */
if(cqiCfg->cqiSetup.riEna)
crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
- +(cellCb->crntTime.subframe);
+ +(cellCb->crntTime.slot);
if(RGR_SCH_SRS_SETUP == srsCfg->type)
{
crntTime = (cellCb->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
- +(cellCb->crntTime.subframe);
+ +(cellCb->crntTime.slot);
if(srCfg->type == RGR_SCH_SR_SETUP)
{
/* 1. Copy the Received Cfg parameters to local cb */
if (end.sfn > start.sfn)
{
if (frm.sfn > start.sfn
- || (frm.sfn == start.sfn && frm.subframe >= start.subframe))
+ || (frm.sfn == start.sfn && frm.slot >= start.slot))
{
if (frm.sfn < end.sfn
#ifdef EMTC_ENABLE
- || (frm.sfn == end.sfn && frm.subframe <= end.subframe))
+ || (frm.sfn == end.sfn && frm.slot <= end.slot))
#else
- || (frm.sfn == end.sfn && frm.subframe <= start.subframe))
+ || (frm.sfn == end.sfn && frm.slot <= start.slot))
#endif
{
inWin = TRUE;
else if (end.sfn < start.sfn)
{
if (frm.sfn > start.sfn
- || (frm.sfn == start.sfn && frm.subframe >= start.subframe))
+ || (frm.sfn == start.sfn && frm.slot >= start.slot))
{
inWin = TRUE;
}
else
{
if (frm.sfn < end.sfn
- || (frm.sfn == end.sfn && frm.subframe <= end.subframe))
+ || (frm.sfn == end.sfn && frm.slot <= end.slot))
{
inWin = TRUE;
}
else /* start.sfn == end.sfn */
{
if (frm.sfn == start.sfn
- && (frm.subframe >= start.subframe
- && frm.subframe <= end.subframe))
+ && (frm.slot >= start.slot
+ && frm.slot <= end.slot))
{
inWin = TRUE;
}
RGSCHDECRFRMCRNTTIME(frm, winStartFrm, winGap);
//5G_TODO TIMING update. Need to check
- winStartIdx = (winStartFrm.sfn & 1) * RGSCH_MAX_RA_RNTI+ winStartFrm.subframe;
+ winStartIdx = (winStartFrm.sfn & 1) * RGSCH_MAX_RA_RNTI+ winStartFrm.slot;
for(i = 0; ((i < cell->rachCfg.raWinSize) && (noRaRnti < RG_SCH_CMN_MAX_CMN_PDCCH)); i++)
{
addedForScell,
addedForScell1,
cell->crntTime.sfn,
- cell->crntTime.subframe);
+ cell->crntTime.slot);
*/
}
#endif
/*
printf ("add DL TPT is %lu sfn:sf %d:%d \n", hqP->hqE->ue->tenbStats->stats.nonPersistent.sch[RG_SCH_CELLINDEX(hqP->hqE->cell)].dlTpt ,
cell->crntTime.sfn,
- cell->crntTime.subframe);
+ cell->crntTime.slot);
*/
}
#endif
TRC2(rgSCHCmnUpdVars);
- idx = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe);
+ idx = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot);
cellUl->idx = ((idx) % (RG_SCH_CMN_UL_NUM_SF));
#ifdef UL_ADPT_DBG
- printf("idx %d cellUl->idx %d RGSCH_NUM_SUB_FRAMES_5G %d time(%d %d) \n",idx,cellUl->idx ,RGSCH_NUM_SUB_FRAMES_5G,cell->crntTime.sfn,cell->crntTime.subframe);
+ printf("idx %d cellUl->idx %d RGSCH_NUM_SUB_FRAMES_5G %d time(%d %d) \n",idx,cellUl->idx ,RGSCH_NUM_SUB_FRAMES_5G,cell->crntTime.sfn,cell->crntTime.slot);
#endif
/* Need to scheduler for after SCHED_DELTA */
/* UL allocation has been advanced by 1 subframe
U32 numUlSf;
#ifndef LTE_TDD
- numUlSf = (timeInfo->sfn * RGSCH_NUM_SUB_FRAMES_5G + timeInfo->subframe);
+ numUlSf = (timeInfo->sfn * RGSCH_NUM_SUB_FRAMES_5G + timeInfo->slot);
procId = numUlSf % RGSCH_NUM_UL_HQ_PROC;
#else
U8 ulDlCfgIdx = cell->ulDlCfgIdx;
/* Calculate the total number of UL sf */
/* -1 is done since uplink sf are counted from 0 */
numUlSf = numUlSfInSfn * (timeInfo->sfn + (sfnCycle*1024)) +
- rgSchTddNumUlSubfrmTbl[ulDlCfgIdx][timeInfo->subframe] - 1;
+ rgSchTddNumUlSubfrmTbl[ulDlCfgIdx][timeInfo->slot] - 1;
procId = numUlSf % numUlHarq;
#endif
TRC2(rgSCHCmnGetRefreshPer);
refreshPer = RG_SCH_CMN_REFRESH_TIME * RG_SCH_CMN_REFRESH_TIMERES;
- crntSubFrm = cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe;
+ crntSubFrm = cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot;
/* Fix: syed align multiple UEs to refresh at same time */
*waitPer = refreshPer - (crntSubFrm % refreshPer);
*waitPer = RGSCH_CEIL(*waitPer, RG_SCH_CMN_REFRESH_TIMERES);
ue->ue5gtfCb.cqiRiPer = 100;
/* 5gtf TODO: CQIs to start from (10,0)*/
ue->ue5gtfCb.nxtCqiRiOccn.sfn = 10;
- ue->ue5gtfCb.nxtCqiRiOccn.subframe = 0;
+ ue->ue5gtfCb.nxtCqiRiOccn.slot = 0;
ue->ue5gtfCb.rank = 1;
printf("\nschd cfg at mac,%u,%u,%u,%u,%u\n",ue->ue5gtfCb.grpId,ue->ue5gtfCb.BeamId,ue->ue5gtfCb.numCC,
{
#ifndef ALIGN_64BIT
printf("CA_DBG:: puschRbStart:n1Rb:mixedRb:n1PerRb:totalCce:n1Max:n1RbPart:n2Rb::[%d:%d] [%d:%d:%ld:%d:%d:%d:%d:%d]\n",
- cell->crntTime.sfn, cell->crntTime.subframe, puschRbStart, n1Rb, mixedRb,n1PerRb, totalCce, n1Max, n1RbPart, n2Rb);
+ cell->crntTime.sfn, cell->crntTime.slot, puschRbStart, n1Rb, mixedRb,n1PerRb, totalCce, n1Max, n1RbPart, n2Rb);
#else
printf("CA_DBG:: puschRbStart:n1Rb:mixedRb:n1PerRb:totalCce:n1Max:n1RbPart:n2Rb::[%d:%d] [%d:%d:%d:%d:%d:%d:%d:%d]\n",
- cell->crntTime.sfn, cell->crntTime.subframe, puschRbStart, n1Rb, mixedRb,n1PerRb, totalCce, n1Max, n1RbPart, n2Rb);
+ cell->crntTime.sfn, cell->crntTime.slot, puschRbStart, n1Rb, mixedRb,n1PerRb, totalCce, n1Max, n1RbPart, n2Rb);
#endif
}
raCb->msg3AllocTime = cell->crntTime;
RGSCH_INCR_SUB_FRAME(raCb->msg3AllocTime, RG_SCH_CMN_MIN_MSG3_RECP_INTRVL);
#else
- msg3SchdIdx = (cell->crntTime.subframe+RG_SCH_CMN_DL_DELTA) %
+ msg3SchdIdx = (cell->crntTime.slot+RG_SCH_CMN_DL_DELTA) %
RGSCH_NUM_SUB_FRAMES;
/*[ccpu00134666]-MOD-Modify the check to schedule the RAR in
special subframe */
RGSCHCMNADDTOCRNTTIME(cell->crntTime,raCb->msg3AllocTime,
RG_SCH_CMN_DL_DELTA)
msg3Subfrm = rgSchTddMsg3SubfrmTbl[ulDlCfgIdx][
- raCb->msg3AllocTime.subframe];
+ raCb->msg3AllocTime.slot];
RGSCHCMNADDTOCRNTTIME(raCb->msg3AllocTime, raCb->msg3AllocTime,
msg3Subfrm);
}
"RNTI:%d Scheduled RAR @ (%u,%u) ",
raRspAlloc->rnti,
cell->crntTime.sfn,
- cell->crntTime.subframe);
+ cell->crntTime.slot);
}
RETVOID;
}
to available scope for optimization */
TRC2(rgSCHCmnTmrProc);
- if ((cell->crntTime.subframe % RGSCH_NUM_SUB_FRAMES_5G) == 0)
+ if ((cell->crntTime.slot % RGSCH_NUM_SUB_FRAMES_5G) == 0)
{
/* Reset the counters periodically */
if ((cell->crntTime.sfn % RG_SCH_CMN_CSG_REFRESH_TIME) == 0)
#ifdef LTE_TDD
dlIdx = rgSCHUtlGetDlSfIdx(cell, &pdsch);
#else
- dlIdx = (((pdsch.sfn & 1) * RGSCH_NUM_SUB_FRAMES) + (pdsch.subframe % RGSCH_NUM_SUB_FRAMES));
+ dlIdx = (((pdsch.sfn & 1) * RGSCH_NUM_SUB_FRAMES) + (pdsch.slot % RGSCH_NUM_SUB_FRAMES));
RGSCH_ARRAY_BOUND_CHECK(cell->instIdx, cell->subFrms, dlIdx);
#endif
/* If current downlink subframe index is same as pdcch SF index,
rgSchTddPdcchSfIncTbl[cell->ulDlCfgIdx][sfNum]) % cell->numDlSubfrms;
#else
cell->dynCfiCb.pdcchSfIdx = (dlIdx + RG_SCH_CFI_APPLY_DELTA) % \
- RGSCH_NUM_DL_SUBFRAMES;
+ RGSCH_NUM_DL_slotS;
#endif
}
#else
/* Changing the idexing
so that proper subframe is selected */
- dlIdx = (((frm.sfn & 1) * RGSCH_NUM_SUB_FRAMES) + (frm.subframe % RGSCH_NUM_SUB_FRAMES));
+ dlIdx = (((frm.sfn & 1) * RGSCH_NUM_SUB_FRAMES) + (frm.slot % RGSCH_NUM_SUB_FRAMES));
RGSCH_ARRAY_BOUND_CHECK(cell->instIdx, cell->subFrms, dlIdx);
dlSf = cell->subFrms[dlIdx];
#endif
U32 recReqTime; /*Received Time in TTI*/
TRC2(rgSCHCmnSrsInd);
- recReqTime = (timingInfo.sfn * RGSCH_NUM_SUB_FRAMES_5G) + timingInfo.subframe;
+ recReqTime = (timingInfo.sfn * RGSCH_NUM_SUB_FRAMES_5G) + timingInfo.slot;
ue->srsCb.selectedAnt = (recReqTime/ue->srsCb.peri)%2;
if(srsRpt->wideCqiPres)
{
/* ccpu00132654-ADD- Initializing all the indices in every subframe*/
rgSCHCmnInitVars(cell);
- idx = (cell->crntTime.subframe + TFU_ULCNTRL_DLDELTA) % RGSCH_NUM_SUB_FRAMES;
+ idx = (cell->crntTime.slot + TFU_ULCNTRL_DLDELTA) % RGSCH_NUM_SUB_FRAMES;
/* Calculate the UL scheduling subframe idx based on the
Pusch k table */
if(rgSchTddPuschTxKTbl[ulDlCfgIdx][idx] != 0)
}
}
- idx = (cell->crntTime.subframe + TFU_RECPREQ_DLDELTA) % RGSCH_NUM_SUB_FRAMES;
+ idx = (cell->crntTime.slot + TFU_RECPREQ_DLDELTA) % RGSCH_NUM_SUB_FRAMES;
if (rgSchTddUlDlSubfrmTbl[ulDlCfgIdx][idx] == RG_SCH_TDD_UL_SUBFRAME)
{
RGSCHCMNADDTOCRNTTIME(cell->crntTime, timeInfo, TFU_RECPREQ_DLDELTA)
cellUl->rcpReqIdx = rgSCHCmnGetUlSfIdx(&timeInfo, cell);
}
- idx = (cell->crntTime.subframe+RG_SCH_CMN_DL_DELTA) % RGSCH_NUM_SUB_FRAMES;
+ idx = (cell->crntTime.slot+RG_SCH_CMN_DL_DELTA) % RGSCH_NUM_SUB_FRAMES;
/*[ccpu00134666]-MOD-Modify the check to schedule the RAR in
special subframe */
{
while (cellSch->rachCfg.prachMskIndx < cell->rachCfg.raOccasion.size)
{
- if (cell->crntTime.subframe <\
+ if (cell->crntTime.slot <\
cell->rachCfg.raOccasion.subFrameNum[cellSch->rachCfg.prachMskIndx])
{
break;
}
cellSch->rachCfg.prachMskIndx = 0;
}
- cellSch->rachCfg.applFrm.subframe = \
+ cellSch->rachCfg.applFrm.slot = \
cell->rachCfg.raOccasion.subFrameNum[cellSch->rachCfg.prachMskIndx];
}
else
{
- cellSch->rachCfg.applFrm.subframe = \
+ cellSch->rachCfg.applFrm.slot = \
cell->rachCfg.raOccasion.subFrameNum[cellSch->rachCfg.prachMskIndx];
}
cellSch->rachCfg.applFrm.sfn = (cellSch->rachCfg.applFrm.sfn+2) % \
RGSCH_MAX_SFN;
}
- cellSch->rachCfg.applFrm.subframe = cell->rachCfg.raOccasion.\
+ cellSch->rachCfg.applFrm.slot = cell->rachCfg.raOccasion.\
subFrameNum[0];
}
else /* applFrm.sfn is still valid */
cellSch->rachCfg.prachMskIndx += 1;
if ( cellSch->rachCfg.prachMskIndx < RGR_MAX_SUBFRAME_NUM )
{
- cellSch->rachCfg.applFrm.subframe = \
+ cellSch->rachCfg.applFrm.slot = \
cell->rachCfg.raOccasion.subFrameNum[cellSch->rachCfg.prachMskIndx];
}
}
{
nxtAlloc = rgSCHUtlUlAllocNxt(sf, alloc);
#ifdef UL_ADPT_DBG
- printf("rgSCHCmnUlRmvCmpltdAllocs:time(%d %d) alloc->hqProc->remTx %d hqProcId(%d) \n",cell->crntTime.sfn,cell->crntTime.subframe,alloc->hqProc->remTx, alloc->grnt.hqProcId);
+ printf("rgSCHCmnUlRmvCmpltdAllocs:time(%d %d) alloc->hqProc->remTx %d hqProcId(%d) \n",cell->crntTime.sfn,cell->crntTime.slot,alloc->hqProc->remTx, alloc->grnt.hqProcId);
#endif
alloc->hqProc->rcvdCrcInd = TRUE;
if ((alloc->hqProc->rcvdCrcInd) || (alloc->hqProc->remTx == 0))
* from application. No need to wait for next modification period.
*/
if((pdSchTmInfo.sfn % RGSCH_SIB1_RPT_PERIODICITY == 0)
- && (RGSCH_SIB1_TX_SF_NUM == (pdSchTmInfo.subframe % RGSCH_NUM_SUB_FRAMES)))
+ && (RGSCH_SIB1_TX_SF_NUM == (pdSchTmInfo.slot % RGSCH_NUM_SUB_FRAMES)))
{
/*Check whether SIB1 with PWS has been updated*/
if(cell->siCb.siBitMask & RGSCH_SI_SIB1_PWS_UPD)
period. If current SFN,SF No doesn't marks the start of next
modification period, then return. */
if(!((pdSchTmInfo.sfn % cell->siCfg.modPrd == 0)
- && (0 == pdSchTmInfo.subframe)))
+ && (0 == pdSchTmInfo.slot)))
/*if(!((((pdSchTmInfo.hSfn * 1024) + pdSchTmInfo.sfn) % cell->siCfg.modPrd == 0)
- && (0 == pdSchTmInfo.subframe)))*/
+ && (0 == pdSchTmInfo.slot)))*/
{
RETVOID;
}
if(cell->siCb.inWindow)
{
if ((crntTmInfo.sfn % cell->siCfg.minPeriodicity) == 0 &&
- crntTmInfo.subframe == 0)
+ crntTmInfo.slot == 0)
{
/* Reinit inWindow at the beginning of every SI window */
cell->siCb.inWindow = siWinSize - 1;
cell->siCb.inWindow = siWinSize - 1;
}
- x = rgSCHCmnGetSiSetId(crntTmInfo.sfn, crntTmInfo.subframe,
+ x = rgSCHCmnGetSiSetId(crntTmInfo.sfn, crntTmInfo.slot,
cell->siCfg.minPeriodicity);
/* Window Id within a SI set. This window Id directly maps to a
* unique SI Id */
windowId = (((crntTmInfo.sfn * RGSCH_NUM_SUB_FRAMES_5G) +
- crntTmInfo.subframe) - (x * (cell->siCfg.minPeriodicity * 10)))
+ crntTmInfo.slot) - (x * (cell->siCfg.minPeriodicity * 10)))
/ siWinSize;
if(windowId >= RGR_MAX_NUM_SI)
cell->siCb.siCtx.warningSiFlag = cell->siCb.siArray[windowId].
isWarningSi;
cell->siCb.siCtx.timeToTx.sfn = crntTmInfo.sfn;
- cell->siCb.siCtx.timeToTx.subframe = crntTmInfo.subframe;
+ cell->siCb.siCtx.timeToTx.slot = crntTmInfo.slot;
RG_SCH_ADD_TO_CRNT_TIME(cell->siCb.siCtx.timeToTx,
cell->siCb.siCtx.maxTimeToTx, (siWinSize - 1))
{
#endif
if((crntTimInfo.sfn % RGSCH_MIB_PERIODICITY == 0)
- && (RGSCH_MIB_TX_SF_NUM == crntTimInfo.subframe))
+ && (RGSCH_MIB_TX_SF_NUM == crntTimInfo.slot))
{
MsgLen mibLen = 0;
U8 sfnOctet, mibOct2 = 0;
is not required here since the below check takes care
of SFNs applicable for this one too.*/
if((crntTimInfo.sfn % RGSCH_SIB1_RPT_PERIODICITY == 0)
- && (RGSCH_SIB1_TX_SF_NUM == crntTimInfo.subframe))
+ && (RGSCH_SIB1_TX_SF_NUM == crntTimInfo.slot))
{
/*If SIB1 has not been yet setup by Application, return*/
if(NULLP == (cell->siCb.crntSiInfo.sib1Info.sib1))
{
/* Determine next scheduling subframe is ABS or not */
if(RG_SCH_ABS_ENABLED_ABS_SF == (RgSchAbsSfEnum)(cell->lteAdvCb.absCfg.absPattern
- [((crntTimInfo.sfn*RGSCH_NUM_SUB_FRAMES) + crntTimInfo.subframe) % RGR_ABS_PATTERN_LEN]))
+ [((crntTimInfo.sfn*RGSCH_NUM_SUB_FRAMES) + crntTimInfo.slot) % RGR_ABS_PATTERN_LEN]))
{
/* Skip the SI scheduling to next tti */
RETVOID;
if(RGR_ENABLE == cell->lteAdvCb.absCfg.status)
{
cell->lteAdvCb.absPatternDlIdx =
- ((frm.sfn*RGSCH_NUM_SUB_FRAMES_5G) + frm.subframe) % RGR_ABS_PATTERN_LEN;
+ ((frm.sfn*RGSCH_NUM_SUB_FRAMES_5G) + frm.slot) % RGR_ABS_PATTERN_LEN;
cell->lteAdvCb.absDlSfInfo = (RgSchAbsSfEnum)(cell->lteAdvCb.absCfg.absPattern[
cell->lteAdvCb.absPatternDlIdx]);
/*
printf("ul5gtfsidDlAlreadyMarkUl: %d, [sfn:sf] [%04d:%02d]\n",
ul5gtfsidDlAlreadyMarkUl, cellSch->dl.time.sfn,
- cellSch->dl.time.subframe);
+ cellSch->dl.time.slot);
*/
}
RETVOID;
((RgSchCmnCell *)(_ue->cell->sc.sch))->ul.schdHqProcIdx])->alloc) &&\
((&RG_SCH_CMN_GET_UL_UE(_ue, _ue->cell)->hqEnt.hqProcCb[\
((RgSchCmnCell *)(_ue->cell->sc.sch))->ul.schdHqProcIdx])->alloc->rnti == _ue->spsRnti) ? TRUE:FALSE)) || \
- (_ue->ul.relPdcchSchdTime.sfn == _cell->crntTime.sfn && _ue->ul.relPdcchSchdTime.subframe == _cell->crntTime.subframe))
+ (_ue->ul.relPdcchSchdTime.sfn == _cell->crntTime.sfn && _ue->ul.relPdcchSchdTime.slot == _cell->crntTime.slot))
#endif /* LTEMAC_SPS */
/* RRM_SP1_START */
#define RGSCHCMNADDTOCRNTTIME(crntTime, toFill, incr) \
{\
U32 absoluteTime;\
- absoluteTime = crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + crntTime.subframe;\
+ absoluteTime = crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + crntTime.slot;\
absoluteTime += incr;\
toFill.sfn = (absoluteTime /RGSCH_NUM_SUB_FRAMES_5G)% 1024;\
- toFill.subframe = absoluteTime % RGSCH_NUM_SUB_FRAMES_5G;\
- toFill.hSfn = 0;\
+ toFill.slot = absoluteTime % RGSCH_NUM_SUB_FRAMES_5G;\
}
#define RG_SCH_CMN_PWR_USE_CFG_MAX_PWR (-128)
#define RG_SCH_CMN_SPS_DL_IS_SPS_TX_HQP(hqP) (((RgSchCmnDlHqProc *)((hqP)->sch))->isSpsActv)
#define RG_SCH_CMN_IS_UE_SPS_SCHDLD(_ue, _cell, _schdTime)\
((((_ue)->cellInfo[(_ue->cellIdToCellIdxMap[RG_SCH_CELLINDEX(_cell)])])->dlAllocCb.spsSchdTime.sfn == _schdTime.sfn) &&\
- (((_ue)->cellInfo[(_ue->cellIdToCellIdxMap[RG_SCH_CELLINDEX(_cell)])])->dlAllocCb.spsSchdTime.subframe == _schdTime.subframe))
+ (((_ue)->cellInfo[(_ue->cellIdToCellIdxMap[RG_SCH_CELLINDEX(_cell)])])->dlAllocCb.spsSchdTime.slot == _schdTime.slot))
#define RG_SCH_CMN_DL_COUNT_ONES(_bitMask, _size, _numOnes)\
{\
while(tmpNode)
{
if((((RgSchCfgElem *)tmpNode->node)->actvTime.sfn == key.sfn) &&
- (((RgSchCfgElem *)tmpNode->node)->actvTime.subframe == key.subframe))
+ (((RgSchCfgElem *)tmpNode->node)->actvTime.slot == key.slot))
{
RETVALUE((RgSchCfgElem *)(tmpNode->node));
}
RETVALUE(NULLP);
}
- idx = ((timingInfo.sfn * RGSCH_NUM_SUB_FRAMES_5G + timingInfo.subframe)/
+ idx = ((timingInfo.sfn * RGSCH_NUM_SUB_FRAMES_5G + timingInfo.slot)/
ue->dl.dlSpsCfg.dlSpsPrdctyEnum) % ue->dl.dlSpsCfg.numSpsHqProc;
RETVALUE(ROK);
}
}
- ascIdx = rgSchTddDlAscSetIdxKTbl[cell->ulDlCfgIdx][timeInfo.subframe];
+ ascIdx = rgSchTddDlAscSetIdxKTbl[cell->ulDlCfgIdx][timeInfo.slot];
noFdbks = ascIdx.numFdbkSubfrms;
for(idx=0; idx<noFdbks; idx++)
statsCnt = statsCnt % 10000;
dlHqStats[statsCnt].cellId = hqP->hqE->cell->cellId;
dlHqStats[statsCnt].sfn = hqP->tbInfo[tbIdx].timingInfo.sfn;
- dlHqStats[statsCnt].sf = hqP->tbInfo[tbIdx].timingInfo.subframe;
+ dlHqStats[statsCnt].sf = hqP->tbInfo[tbIdx].timingInfo.slot;
dlHqStats[statsCnt].ack = *isAck;
dlHqStats[statsCnt].fdbkIdx = fdbkIdx;
dlHqStats[statsCnt].ue = hqP->hqE->ue->ueId;;
}
#if ((defined LTEMAC_SPS_AN_MUX) || (defined LTE_ADV))
- ascIdx = rgSchTddDlAscSetIdxKTbl[cellCb->ulDlCfgIdx][timeInfo.subframe];
+ ascIdx = rgSchTddDlAscSetIdxKTbl[cellCb->ulDlCfgIdx][timeInfo.slot];
noFdbks = ascIdx.numFdbkSubfrms;
#endif
#ifdef LTEMAC_SPS_AN_MUX
ulDlCfgIdx = cellCb->ulDlCfgIdx;
maxFdbks = rgSchTddDlAscSetIdxKTbl[ulDlCfgIdx]
- [timeInfo.subframe].
+ [timeInfo.slot].
numFdbkSubfrms;
for(itr=0; itr< maxFdbks; itr++)
if(ue->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS)
{/* Using the sorted K table */
RGSCHDECRFRMCRNTTIME (timeInfo, txTime,
- rgSchTddDlHqPucchResCalTbl[ulDlCfgIdx][timeInfo.subframe].subfrmNum[itr]);
+ rgSchTddDlHqPucchResCalTbl[ulDlCfgIdx][timeInfo.slot].subfrmNum[itr]);
}else
#endif
{
RGSCHDECRFRMCRNTTIME (timeInfo, txTime,
- rgSchTddDlAscSetIdxKTbl[ulDlCfgIdx][timeInfo.subframe].subfrmNum[itr]);
+ rgSchTddDlAscSetIdxKTbl[ulDlCfgIdx][timeInfo.slot].subfrmNum[itr]);
}
if (RGSCH_TIMEINFO_SAME (txTime, ue->relPdcchTxTime))
{
RGSCH_NULL_CHECK(cellCb->instIdx, ue);
RLOG_ARG3(L_ERROR,DBG_CELLID,cellCb->cellId,"CRNTI:%d"
- " NO HARQ proc available for feedback:timeInfo:snf %d,subframe %d",
- ue->ueId,timeInfo.sfn, timeInfo.subframe);
+ " NO HARQ proc available for feedback:timeInfo:snf %d,slot %d",
+ ue->ueId,timeInfo.sfn, timeInfo.slot);
err->errType = RGSCHERR_DHM_FDBK_IND;
err->errCause = RGSCHERR_DHM_FDBK_IND_INVALID_CB;
RETVALUE(RFAILED);
{
RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,
"CRNTI:%d NO HARQ proc available for feedback: TimingInfo: "
- "sfn %d subframe %d", ue->ueId, timingInfo.sfn,
- timingInfo.subframe);
+ "sfn %d slot %d", ue->ueId, timingInfo.sfn,
+ timingInfo.slot);
RETVALUE(RFAILED);
}
TRC2(rgSCHDhmTddRlsSubFrm)
ascIdx =
- rgSchTddDlAscSetIdxKTbl[cellCb->ulDlCfgIdx][uciTimingInfo.subframe];
+ rgSchTddDlAscSetIdxKTbl[cellCb->ulDlCfgIdx][uciTimingInfo.slot];
noFdbks = ascIdx.numFdbkSubfrms;
for(i=0; i < noFdbks; i++)
{
TRC2(rgSCHDhmRlsDlsfHqProc)
ascIdx =
- rgSchTddDlAscSetIdxKTbl[cellCb->ulDlCfgIdx][uciTimingInfo.subframe];
+ rgSchTddDlAscSetIdxKTbl[cellCb->ulDlCfgIdx][uciTimingInfo.slot];
noFdbks = ascIdx.numFdbkSubfrms;
for(i=0; i < noFdbks; i++)
{
if(anInfo == NULLP)
{
RGSCHDBGERR(cellCb->instIdx, (rgSchPBuf(cellCb->instIdx),
- "Ack/Nack Info is NULL, Processing %dth feedback subframe for DTX"
+ "Ack/Nack Info is NULL, Processing %dth feedback slot for DTX"
"received on SFN [%d] and SF [%d]\n",i, uciTimingInfo.sfn,
- uciTimingInfo.subframe));
+ uciTimingInfo.slot));
}
else if (tbCb->fbkRepCntr == 0)
{
* - Processing is divided into respective timer handling.
* - Calculate the DL and UL indices as follows
* @code
- * dlIndex = (cell->crntTime.sfn * 10 + cell->crntTime.subframe +
+ * dlIndex = (cell->crntTime.sfn * 10 + cell->crntTime.slot +
* RG_SCH_DRX_DL_DELTA) % RG_SCH_MAX_DRXQ_SIZE;
*
- * ulIndex = (cell->crntTime.sfn * 10 + cell->crntTime.subframe +
+ * ulIndex = (cell->crntTime.sfn * 10 + cell->crntTime.slot +
* RG_SCH_DRX_UL_DELTA) % RG_SCH_MAX_DRXQ_SIZE;
* @endcode
* - Call rgSCHDrxTtiHdlOnDur to handle onDurationTimer handling
TRC2(rgSCHDrxTtiInd );
- dlIndex = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe +
+ dlIndex = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot +
RG_SCH_DRX_DL_DELTA) % RG_SCH_MAX_DRXQ_SIZE;
- ulIndex = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe +
+ ulIndex = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot +
RG_SCH_DRX_UL_DELTA) % RG_SCH_MAX_DRXQ_SIZE;
#ifdef LTEMAC_R9
{
#ifndef LTE_TDD
curTimeInSf = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G) +
- (cell->crntTime.subframe) +RG_SCH_DRX_UL_DELTA;
+ (cell->crntTime.slot) +RG_SCH_DRX_UL_DELTA;
#endif
#ifdef LTE_TDD
{
#ifndef LTE_TDD
curTimeInSf = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G) +
- (cell->crntTime.subframe) + RG_SCH_DRX_DL_DELTA;
+ (cell->crntTime.slot) + RG_SCH_DRX_DL_DELTA;
#endif
#ifdef LTE_TDD
* so that UE is scheduled for retransmission in the next subframe*/
/* ccpu00134196-[Add]-DRX retx timer changes */
harqRTTExpIndx = ((hqP->tbInfo[tbCnt].timingInfo.sfn * RGSCH_NUM_SUB_FRAMES_5G) +
- hqP->tbInfo[tbCnt].timingInfo.subframe + RG_SCH_MIN_HARQ_RTT)
+ hqP->tbInfo[tbCnt].timingInfo.slot + RG_SCH_MIN_HARQ_RTT)
% RG_SCH_MAX_DRXQ_SIZE;
fdbkDelta = RGSCH_CALC_SF_DIFF(cell->crntTime, hqP->tbInfo[tbCnt].timingInfo);
rgSCHDrxGetNxtOnDur (cell, ueDrxCb, &nxtOnDur,RG_SCH_NO_DELTA);
- nxtOnDurTime = ((nxtOnDur.sfn * RGSCH_NUM_SUB_FRAMES_5G) + nxtOnDur.subframe);
+ nxtOnDurTime = ((nxtOnDur.sfn * RGSCH_NUM_SUB_FRAMES_5G) + nxtOnDur.slot);
curTime = ((cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G) +
- cell->crntTime.subframe);
+ cell->crntTime.slot);
onDurIndx = nxtOnDurTime % RG_SCH_MAX_DRXQ_SIZE;
cycleLen = drxCb->shortDrxCycle;
}
- curTime = ((cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G) + cell->crntTime.subframe);
+ curTime = ((cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G) + cell->crntTime.slot);
curTime += delta; /*TODO: see if we need to take care of wrap arounds */
{
/* offset is the nextOnDur */
nxtOnDur->sfn = drxCb->drxStartOffset / RGSCH_NUM_SUB_FRAMES_5G;
- nxtOnDur->subframe = (U8)(drxCb->drxStartOffset % RGSCH_NUM_SUB_FRAMES_5G);
- nxtDist = ((nxtOnDur->sfn * RGSCH_NUM_SUB_FRAMES_5G) + nxtOnDur->subframe);
+ nxtOnDur->slot = (U8)(drxCb->drxStartOffset % RGSCH_NUM_SUB_FRAMES_5G);
+ nxtDist = ((nxtOnDur->sfn * RGSCH_NUM_SUB_FRAMES_5G) + nxtOnDur->slot);
}
else
{
/* Perfect match pick up the current time */
/*nxtOnDur should be set to equal to currentTime + DELTA */
nxtOnDur->sfn = (U16)curTime / RGSCH_NUM_SUB_FRAMES_5G;
- nxtOnDur->subframe = (U16)curTime % RGSCH_NUM_SUB_FRAMES_5G;
- nxtDist = ((nxtOnDur->sfn * RGSCH_NUM_SUB_FRAMES_5G) + nxtOnDur->subframe);
+ nxtOnDur->slot = (U16)curTime % RGSCH_NUM_SUB_FRAMES_5G;
+ nxtDist = ((nxtOnDur->sfn * RGSCH_NUM_SUB_FRAMES_5G) + nxtOnDur->slot);
}
else
nxtDist = drxCb->drxStartOffset + (numOfCycles + 1) *
cycleLen;
nxtOnDur->sfn = (U16)nxtDist / RGSCH_NUM_SUB_FRAMES_5G;
- nxtOnDur->subframe = (U16)nxtDist % RGSCH_NUM_SUB_FRAMES_5G;
+ nxtOnDur->slot = (U16)nxtDist % RGSCH_NUM_SUB_FRAMES_5G;
}
}
{
nxtDist = nxtDist + cycleLen;
nxtOnDur->sfn = (U16)nxtDist / RGSCH_NUM_SUB_FRAMES_5G;
- nxtOnDur->subframe = (U16)nxtDist % RGSCH_NUM_SUB_FRAMES_5G;
+ nxtOnDur->slot = (U16)nxtDist % RGSCH_NUM_SUB_FRAMES_5G;
}
RETVALUE(ROK);
} /* end of rgSCHDrxGetNxtOnDur */
}
- nxtOnDurTime = (nxtOnDur.sfn * RGSCH_NUM_SUB_FRAMES_5G) + nxtOnDur.subframe;
+ nxtOnDurTime = (nxtOnDur.sfn * RGSCH_NUM_SUB_FRAMES_5G) + nxtOnDur.slot;
curTime = ((cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G) +
- cell->crntTime.subframe);
+ cell->crntTime.slot);
/* If Onduration timer of old configuration is already running then waiting till it expires */
if((ueDrxCb->onDurExpIndx != DRX_INVALID) && (ueDrxCb->onDurExpDistance != DRX_TMR_EXPRD))
rgSCHDrxGetNxtOnDur(cell,drxUe,&nxtOnDur,(U8)idx);
nxtOnDurInSf = ((nxtOnDur.sfn * RGSCH_NUM_SUB_FRAMES_5G) +
- nxtOnDur.subframe);
+ nxtOnDur.slot);
curTime = ((cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G) +
- cell->crntTime.subframe);
+ cell->crntTime.slot);
nxtOnDurIndex = nxtOnDurInSf % RG_SCH_MAX_DRXQ_SIZE;
drxUe->distance = (nxtOnDurInSf-curTime) / RG_SCH_MAX_DRXQ_SIZE;
tddCfgMode = cell->ulDlCfgIdx;
crntTime.sfn = curTime / RGSCH_NUM_SUB_FRAMES_5G;
- crntTime.subframe = curTime % RGSCH_NUM_SUB_FRAMES_5G;
+ crntTime.slot = curTime % RGSCH_NUM_SUB_FRAMES_5G;
/* First calculate the number of DL subframes till next SFN */
dlSfTillNxtSFN = rgSchDrxDLSfTillNxtSFN[isDwPtsCnted][tddCfgMode]
- [(crntTime.subframe % RGSCH_NUM_SUB_FRAMES)];
+ [(crntTime.slot % RGSCH_NUM_SUB_FRAMES)];
if ( dlSfTillNxtSFN >= duration )
TRC2(rgSCHDrxCalcNxtTmrExpry)
curTimeInSf = cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G +
- cell->crntTime.subframe;
+ cell->crntTime.slot;
/* add delta to curTime */
curTimeInSf += delta;
drxCell = (cell->drxCb);
delInUlScan = drxCell->delInUlScan;
- //printf("CELL Timer [SFN : %d],[SF : %d]\n",cell->crntTime.sfn,cell->crntTime.subframe);
+ //printf("CELL Timer [SFN : %d],[SF : %d]\n",cell->crntTime.sfn,cell->crntTime.slot);
node = drxCell->drxQ[dlIndex].onDurationQ.first;
cmLListAdd2Tail(&(drxCell->drxQ[expiryIndex].onDurationExpQ),
&(drxUe->onDurationExpEnt));
- //printf("DRXOnDuration Timer Started at [SFN : %d],[SF : %d]\n",cell->crntTime.sfn,cell->crntTime.subframe);
+ //printf("DRXOnDuration Timer Started at [SFN : %d],[SF : %d]\n",cell->crntTime.sfn,cell->crntTime.slot);
drxUe->onDurationExpEnt.node = (PTR)ue;
drxUe->onDurExpIndx = expiryIndex;
- //printf("DRxOnDuration will Expire = [%d]\n",(cell->crntTime.sfn*10+cell->crntTime.subframe+drxUe->onDurTmrLen));
+ //printf("DRxOnDuration will Expire = [%d]\n",(cell->crntTime.sfn*10+cell->crntTime.slot+drxUe->onDurTmrLen));
if ( delInUlScan == FALSE )
{
case EVTTFUTIMINGADVIND:
cmUnpkTfuTimingAdvInd(RgLiTfuTimingAdvInd, pst, mBuf);
break;
- case EVTTFUSCHTTIIND:
- cmUnpkTfuSchTtiInd(RgLiTfuSchTtiInd, pst, mBuf);
- break;
case EVTTFUPUCCHDELPWR:
cmUnpkTfuPucchDeltaPwr(RgLiTfuPucchDeltaPwrInd, pst, mBuf);
break;
break;
#endif
#endif
+ case EVENT_SLOT_IND_TO_SCH:
+ cmUnpackMacSchSlotInd(macSchSlotInd, pst, mBuf);
+ break;
default:
RGSCH_FREE_MSG(mBuf);
break;
/* Check if the activation time is valid */
if (actvTime.sfn >= RGSCH_MAX_SFN
- || actvTime.subframe >= RGSCH_NUM_SUB_FRAMES_5G)
+ || actvTime.slot >= RGSCH_NUM_SUB_FRAMES_5G)
{
RLOG_ARG4(L_ERROR,DBG_CELLID,cell->cellId, "Invalid activation time for RGR "
- "config request: activation sfn %d activation subframe %d current "
- "sfn %d current subframe %d", actvTime.sfn, actvTime.subframe,
- cell->crntTime.sfn, cell->crntTime.subframe);
+ "config request: activation sfn %d activation slot %d current "
+ "sfn %d current slot %d", actvTime.sfn, actvTime.slot,
+ cell->crntTime.sfn, cell->crntTime.slot);
/* ccpu00117052 - MOD - Passing double pointer
for proper NULLP assignment*/
rgSCHUtlFreeSBuf(inst, (Data **)&rgrCfgElem, sizeof(*rgrCfgElem));
if (sfDiff > (RGR_ACTV_WIN_SIZE * RGSCH_NUM_SUB_FRAMES_5G))
{
RLOG_ARG4(L_ERROR,DBG_CELLID,cell->cellId,"Invalid activation time for RGR"
- " config request: activation sfn %d activation subframe %d "
- "current sfn %d current subframe %d", actvTime.sfn,
- actvTime.subframe, cell->crntTime.sfn, cell->crntTime.subframe);
+ " config request: activation sfn %d activation slot %d "
+ "current sfn %d current slot %d", actvTime.sfn,
+ actvTime.slot, cell->crntTime.sfn, cell->crntTime.slot);
/* ccpu00117052 - MOD - Passing double pointer
for proper NULLP assignment*/
rgSCHUtlFreeSBuf(inst, (Data **)&rgrCfgElem, sizeof(*rgrCfgElem));
}
/* Update the RNTP info rcvd in the respective cell centre pool so that Phigh can be
sent for the UEs scheduled in that particular RB range*/
- for(i = 0; i < RGSCH_NUM_DL_SUBFRAMES; i++)
+ for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
{
if((rgSchUpdtRNTPInfo(cell, cell->subFrms[i], loadInfReq) != ROK))
{
EXTERN S16 RgMacSchSpsRel ARGS((Pst *pst, RgInfSpsRelInfo* relInfo));
#endif
EXTERN S16 RgMacSchUeDel ARGS((Pst* pst, RgInfUeDelInd* ueDelInd));
-EXTERN S16 schActvInit ARGS((Ent entity, Inst inst, Region
- region, Reason reason));
#ifdef __cplusplus
}
#endif
RGSCH_INCR_SUB_FRAME(frm, RG_SCH_CMN_DL_DELTA);
sf = rgSCHUtlSubFrmGet(cell, frm);
#ifdef LTE_TDD
- idx = (cell->crntTime.subframe + RG_SCH_CMN_DL_DELTA) %
+ idx = (cell->crntTime.slot + RG_SCH_CMN_DL_DELTA) %
RGSCH_NUM_SUB_FRAMES;
if(RG_SCH_CMN_CHK_DL_DATA_ALLOWED(cell, idx))
{
{
measCb = (RgSchL2MeasCb *)node->node;
node = node->next;
- if(cell->crntTime.sfn == 1023 && cell->crntTime.subframe == 9)
+ if(cell->crntTime.sfn == 1023 && cell->crntTime.slot == 9)
{
/*calculates diff between crnt time and start time*/
meas = RGSCH_CALC_SFN_SF_DIFF(cell->crntTime,
numDlSf = (meas / RGSCH_NUM_SUB_FRAMES) * rgSchTddNumDlSubfrmTbl[cell->ulDlCfgIdx][RGSCH_NUM_SUB_FRAMES-1];
numUlSf = (meas / RGSCH_NUM_SUB_FRAMES) * rgSchTddNumUlSubfrmTbl[cell->ulDlCfgIdx][RGSCH_NUM_SUB_FRAMES-1];
- sfIdx = (measCb->startTime.subframe + 1) % RGSCH_NUM_SUB_FRAMES;
+ sfIdx = (measCb->startTime.slot + 1) % RGSCH_NUM_SUB_FRAMES;
while(rem)
{
}
}
-\f
-/**
- * @brief Task Initiation callback function.
- *
- * @details
- *
- * Function : schActvInit
- *
- * This function is supplied as one of parameters during MAC's
- * task registration. SSI will invoke this function once, after
- * it creates and attaches this TAPA Task to a system task.
- *
- * @param[in] Ent Entity, the entity ID of this task.
- * @param[in] Inst Inst, the instance ID of this task.
- * @param[in] Region Region, the region ID registered for memory
- * usage of this task.
- * @param[in] Reason Reason.
- * @return S16
- * -# ROK
- **/
-#ifdef ANSI
-PUBLIC S16 schActvInit
-(
-Ent entity, /* entity */
-Inst instId, /* instance */
-Region region, /* region */
-Reason reason /* reason */
-)
-#else
-PUBLIC S16 schActvInit(entity, instId, region, reason)
-Ent entity; /* entity */
-Inst instId; /* instance */
-Region region; /* region */
-Reason reason; /* reason */
-#endif
-{
- Inst inst = (instId - SCH_INST_START);
-
- TRC2(schActvInit);
-
- /* Initialize the MAC TskInit structure to zero */
- cmMemset ((U8 *)&rgSchCb[inst], 0, sizeof(RgSchCb));
-
- /* Initialize the MAC TskInit with received values */
- rgSchCb[inst].rgSchInit.ent = entity;
- rgSchCb[inst].rgSchInit.inst = inst;
- rgSchCb[inst].rgSchInit.region = region;
- rgSchCb[inst].rgSchInit.pool = 0;
- rgSchCb[inst].rgSchInit.reason = reason;
- rgSchCb[inst].rgSchInit.cfgDone = FALSE;
- rgSchCb[inst].rgSchInit.acnt = FALSE;
- rgSchCb[inst].rgSchInit.usta = FALSE;
- rgSchCb[inst].rgSchInit.trc = FALSE;
-#ifdef DEBUGP
-#ifdef RG_DEBUG
- /* disabling debugs by default */
- /* rgSchCb[inst].rgSchInit.dbgMask = 0xffffffff; */
-#endif
-#endif /* DEBUGP */
- rgSchCb[inst].rgSchInit.procId = SFndProcId();
-
- rgSchCb[inst].rgrSap = NULLP;
- rgSchCb[inst].tfuSap = NULLP;
- rgSchCb[inst].rgmSap = NULLP;
- rgSCHCmnInit();
-
- RETVALUE(ROK);
-} /* schActvInit */
-\f
-\f
/**
* @brief SAP Configuration Handler.
*
}
RETVALUE(ret);
}
-
-\f
-/**
- * @brief Scheduler instance Configuration Handler.
- *
- * @details
- *
- * Function : SchInstCfg
- *
- * This function in called by HandleSchGenCfgReq(). It handles the
- * general and SAP configurations of the scheduler instance. It initializes
- * the hash lists of rgSchCb. Returns
- * reason for success/failure of this function.
- *
- * @param[in] RgCfg *cfg, the Configuaration information
- * @return U16
- * -# LCM_REASON_NOT_APPL
- * -# LCM_REASON_INVALID_MSGTYPE
- * -# LCM_REASON_MEM_NOAVAIL
- **/
-#ifdef ANSI
-PUBLIC U16 SchInstCfg
-(
-RgCfg *cfg, /* Configuaration information */
-Inst dInst
-)
-#else
-PUBLIC U16 SchInstCfg(cfg,dInst)
-RgCfg *cfg; /* Configuaration information */
-Inst dInst;
-#endif
-{
- U16 ret = LCM_REASON_NOT_APPL;
- Inst inst = (dInst - SCH_INST_START);
-
- TRC2(SchInstCfg)
-
- printf("\nEntered SchInstCfg()");
- /* Check if Instance Configuration is done already */
- if (rgSchCb[inst].rgSchInit.cfgDone == TRUE)
- {
- RETVALUE(LCM_REASON_INVALID_MSGTYPE);
- }
- if ((cfg->s.schInstCfg.genCfg.lmPst.selector != LRG_SEL_TC) &&
- (cfg->s.schInstCfg.genCfg.lmPst.selector != LRG_SEL_LC))
- {
- RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg(): unsupported "
- "Selector value for lmPst.");
- RETVALUE(LCM_REASON_INVALID_PAR_VAL);
- }
- /* Update the Pst structure for LM interface */
- cmMemcpy((U8 *)&rgSchCb[inst].rgSchInit.lmPst,
- (U8 *)&cfg->s.schInstCfg.genCfg.lmPst,
- sizeof(Pst));
-
- rgSchCb[inst].rgSchInit.inst = inst;
- rgSchCb[inst].rgSchInit.lmPst.srcProcId = rgSchCb[inst].rgSchInit.procId;
- rgSchCb[inst].rgSchInit.lmPst.srcEnt = rgSchCb[inst].rgSchInit.ent;
- rgSchCb[inst].rgSchInit.lmPst.srcInst = rgSchCb[inst].rgSchInit.inst +
- SCH_INST_START;
- rgSchCb[inst].rgSchInit.lmPst.event = EVTNONE;
-
- rgSchCb[inst].rgSchInit.region = cfg->s.schInstCfg.genCfg.mem.region;
- rgSchCb[inst].rgSchInit.pool = cfg->s.schInstCfg.genCfg.mem.pool;
- rgSchCb[inst].genCfg.tmrRes = cfg->s.schInstCfg.genCfg.tmrRes;
-#ifdef LTE_ADV
- rgSchCb[inst].genCfg.forceCntrlSrbBoOnPCel = cfg->s.schInstCfg.genCfg.forceCntrlSrbBoOnPCel;
- rgSchCb[inst].genCfg.isSCellActDeactAlgoEnable = cfg->s.schInstCfg.genCfg.isSCellActDeactAlgoEnable;
-#endif
- rgSchCb[inst].genCfg.startCellId = cfg->s.schInstCfg.genCfg.startCellId;
-
-/* Not adding any SAPs towards SCH now */
-#if 0
- /* allocate RGR saps */
- if (SGetSBuf(rgSchCb[inst].rgSchInit.region,
- rgSchCb[inst].rgSchInit.pool,
- (Data **)&rgSchCb[inst].rgrSap,
- (sizeof(RgSchUpSapCb) * cfg->s.schInstCfg.numSaps)) != ROK)
- {
- RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg: SGetSBuf for "
- "RGR saps failed");
- RETVALUE(RFAILED);
- }
- /* allocate RGM saps */
- if (SGetSBuf(rgSchCb[inst].rgSchInit.region,
- rgSchCb[inst].rgSchInit.pool,
- (Data **)&rgSchCb[inst].rgmSap,
- (sizeof(RgSchUpSapCb) * cfg->s.schInstCfg.numSaps)) != ROK)
- {
- RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg: SGetSBuf for "
- "RGM saps failed");
- RETVALUE(RFAILED);
- }
-
-
- /* allocate TFU saps */
- if (SGetSBuf(rgSchCb[inst].rgSchInit.region,
- rgSchCb[inst].rgSchInit.pool,
- (Data **)&rgSchCb[inst].tfuSap,
- (sizeof(RgSchLowSapCb) * cfg->s.schInstCfg.numSaps)) != ROK)
- {
- RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg: SGetSBuf for TFU "
- "saps failed");
- RETVALUE(RFAILED);
- }
-
- /* allocate for bndCfmResponses */
- if (SGetSBuf(rgSchCb[inst].rgSchInit.region,
- rgSchCb[inst].rgSchInit.pool,
- (Data **)&rgSchCb[inst].genCfg.bndCfmResp,
- (sizeof(RgSchLmResponse) * cfg->s.schInstCfg.numSaps)) != ROK)
- {
- RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg: SGetSBuf for bind"
- " confirm responses failed");
- RETVALUE(RFAILED);
- }
-#ifdef LTE_ADV
- rgSCHLaaInitEnbCb(&rgSchCb[inst]);
-#endif
- rgSchCb[inst].numSaps = cfg->s.schInstCfg.numSaps;
- for (idx = 0; idx < cfg->s.schInstCfg.numSaps; idx++)
- {
- /* Initialize SAP State and configure SAP */
- rgSchCb[inst].rgrSap[idx].sapSta.sapState = LRG_NOT_CFG;
- rgSchCb[inst].rgrSap[idx].cell = NULLP;
- rgSCHLmmSapCfg(dInst, cfg, idx, STRGRSAP);
-
- rgSchCb[inst].rgmSap[idx].sapSta.sapState = LRG_NOT_CFG;
- rgSchCb[inst].rgmSap[idx].cell = NULLP;
- rgSCHLmmSapCfg(dInst, cfg, idx, STRGMSAP);
-
- rgSchCb[inst].tfuSap[idx].sapSta.sapState = LRG_NOT_CFG;
- rgSchCb[inst].tfuSap[idx].cell = NULLP;
- rgSCHLmmSapCfg(dInst, cfg, idx, STTFUSAP);
- rgSchCb[inst].tfuSap[idx].numBndRetries = 0;
- }
-#endif
- /* Initialzie the timer queue */
- cmMemset((U8 *)&rgSchCb[inst].tmrTq, 0, sizeof(CmTqType)*RGSCH_TQ_SIZE);
- /* Initialize the timer control point */
- cmMemset((U8 *)&rgSchCb[inst].tmrTqCp, 0, sizeof(CmTqCp));
- rgSchCb[inst].tmrTqCp.tmrLen = RGSCH_TQ_SIZE;
-
- /* SS_MT_TMR needs to be enabled as schActvTmr needs instance information */
- /* Timer Registration request to SSI */
- if (SRegTmrMt(rgSchCb[inst].rgSchInit.ent, dInst,
- (S16)rgSchCb[inst].genCfg.tmrRes, schActvTmr) != ROK)
- {
- RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg(): Failed to "
- "register timer.");
- RETVALUE(LCM_REASON_MEM_NOAVAIL);
- }
-
- /* Set Config done in TskInit */
- rgSchCb[inst].rgSchInit.cfgDone = TRUE;
- printf("\nScheduler gen config done");
-
- RETVALUE(ret);
-}
-
\f
/***********************************************************
*
inst = (reqPst->dstInst - SCH_INST_START);
- cfmPst->srcEnt = rgSchCb[inst].rgSchInit.ent;
- cfmPst->srcInst = (Inst) 0;
+ cfmPst->srcEnt = ENTRG;
+ cfmPst->srcInst = (Inst) 1;
cfmPst->srcProcId = rgSchCb[inst].rgSchInit.procId;
- cfmPst->dstEnt = reqPst->srcEnt;
+ cfmPst->dstEnt = ENTRG;
cfmPst->dstInst = (Inst) 0;
cfmPst->dstProcId = reqPst->srcProcId;
cfmPst->selector = cfm->hdr.response.selector;
- cfmPst->prior = cfm->hdr.response.prior;
- cfmPst->route = cfm->hdr.response.route;
cfmPst->region = cfm->hdr.response.mem.region;
cfmPst->pool = cfm->hdr.response.mem.pool;
/* 40ms offset */
/* Introduced timing delta for DL control in FDD */
#ifdef LTE_TDD
- offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe + TFU_DELTA) %
+ offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot + TFU_DELTA) %
RG_MEAS_GAPPRD_40;
#else
- offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe + TFU_DLCNTRL_DLDELTA) %
+ offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot + TFU_DLCNTRL_DLDELTA) %
RG_MEAS_GAPPRD_40;
#endif
queue = &(cell->measGapCb.gapPrd40Q[offset]);
/* 80ms offset */
/* Introduced timing delta for DL control in FDD */
#ifdef LTE_TDD
- offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe + TFU_DELTA) %
+ offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot + TFU_DELTA) %
RG_MEAS_GAPPRD_80;
#else
- offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe + TFU_DLCNTRL_DLDELTA) %
+ offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot + TFU_DLCNTRL_DLDELTA) %
RG_MEAS_GAPPRD_80;
#endif
queue = &(cell->measGapCb.gapPrd80Q[offset]);
/* for ACK NACK repetition starts at offset - however at MAC we are
* concerned with subframe - TFU_DELTA */
- /* offset = ((cell->crntTime.sfn * 10) + cell->crntTime.subframe) %
+ /* offset = ((cell->crntTime.sfn * 10) + cell->crntTime.slot) %
* RG_MAX_NUM_DLSF; */
/* We wish to get the subframe whose HARQ Reception request would go out in
* this subframe. HARQ_RTT - TFU_DELTA
TRC2(rgSCHMeasGapANRepGetDlInactvUe);
- schedTime = cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe + RG_DL_DELTA;
+ schedTime = cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot + RG_DL_DELTA;
#ifdef LTE_TDD
RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, ackNakTime, RG_DL_DELTA);
/* Calc offset for ACK NACK repetition */
/*offset = (cell->crntTime.sfn * 10 +
- cell->crntTime.subframe + RG_DL_DELTA + RG_SCH_CMN_HARQ_INTERVAL - 1)
+ cell->crntTime.slot + RG_DL_DELTA + RG_SCH_CMN_HARQ_INTERVAL - 1)
% RG_MAX_NUM_DLSF;*/
/* The ackNakRepQ resides in each dlSf corresponding to the repStart */
/* Must pick up the subframe that was scheduled in the last TTI */
TRC2(rgSCHMeasGapANRepGetUlInactvUe);
/*ccpu00139481- Meas Gap should be monitored in UL with TFU_ULCNTRL_DLDELTA*/
- schedTime = cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe + \
+ schedTime = cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot + \
TFU_ULCNTRL_DLDELTA;
#ifndef LTE_TDD
pdcchToPuschGap = RGSCH_PDCCH_PUSCH_DELTA;
}
/* Calc offset for ACK NACK repetition */
/*offset = (cell->crntTime.sfn * 10 +
- cell->crntTime.subframe + RG_UL_SCHED_DELTA +
+ cell->crntTime.slot + RG_UL_SCHED_DELTA +
RG_SCH_CMN_HARQ_INTERVAL ) % RG_MAX_NUM_DLSF;*/
/* Must get the DLSF that is scheduled at TFU_DELTA Away */
* 10 subframes, which would have otherwise caused
* the check to succeed for a possibly older process.
*/
- if ((proc->tbInfo[0].timingInfo.subframe == sf->sfNum) ||
- (proc->tbInfo[1].timingInfo.subframe == sf->sfNum))
+ if ((proc->tbInfo[0].timingInfo.slot == sf->sfNum) ||
+ (proc->tbInfo[1].timingInfo.slot == sf->sfNum))
{
/*
* Later, if a proc can be scheduled without having an
winGap = (rgRaPrmblToRaFrmTbl[cell->rachCfg.preambleFormat]-1)+
(cell->rachCfg.raWinSize -1 ) + RGSCH_RARSP_WAIT_PERIOD;
- raIdx = (((crntSfn & 1) * RGSCH_MAX_RA_RNTI+ cell->crntTime.subframe
+ raIdx = (((crntSfn & 1) * RGSCH_MAX_RA_RNTI+ cell->crntTime.slot
+ RG_SCH_CMN_DL_DELTA - winGap)+ RGSCH_RAREQ_ARRAY_SIZE )
% RGSCH_RAREQ_ARRAY_SIZE;
/* Fixes for RACH handling: Added deletion of queued RaReq */
frm = cell->crntTime;
RGSCH_INCR_SUB_FRAME(frm, RG_SCH_CMN_DL_DELTA);
- if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx][frm.subframe] !=
+ if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx][frm.slot] !=
RG_SCH_TDD_UL_SUBFRAME)
{
- raIdx = rgSchTddNumDlSubfrmTbl[cell->ulDlCfgIdx][frm.subframe]-1;
+ raIdx = rgSchTddNumDlSubfrmTbl[cell->ulDlCfgIdx][frm.slot]-1;
rgSCHRamDelRaReq(cell, cell->crntTime, raIdx);
}
#endif
/* ccpu00132536:MOD- racb timeout will be verified in each SFN such that
* the RACB whose processing is not completed in RG_MAX_RA_PRC_FRM
* will be deleted*/
- if (cell->crntTime.subframe == 0)
+ if (cell->crntTime.slot == 0)
{
maxCnt = cell->raInfo.raCbLst.count;
for (idx = 0; idx < maxCnt; idx++)
ue = hqP->hqE->ue;
#ifndef LTE_TDD
- if((0 == schdTime.subframe) || (5 == schdTime.subframe))
+ if((0 == schdTime.slot) || (5 == schdTime.slot))
{
Bool reTxAllw;
rgSCHCmnChkRetxAllowDtx(cell, ue, hqP, &reTxAllw);
#ifdef TFU_UPGRADE
/* Start receiving CQI for this SCell for this UE */
crntTime = (ueCb->cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)+
- (ueCb->cell->crntTime.subframe);
+ (ueCb->cell->crntTime.slot);
cqiCb = &sCellInfo->cqiCb;
cqiCfg = &cqiCb->cqiCfg;
}
timingInfo.sfn = cqiCb->nCqiTrIdx/RGSCH_NUM_SUB_FRAMES_5G;
- timingInfo.subframe = cqiCb->nCqiTrIdx%RGSCH_NUM_SUB_FRAMES_5G;
+ timingInfo.slot = cqiCb->nCqiTrIdx%RGSCH_NUM_SUB_FRAMES_5G;
if(cqiCb->cqiCfg.cqiSetup.cqiRepType == RGR_UE_PCQI_SB_REP)
{
rgSCHTomUtlPcqiSbCalcBpIdx(timingInfo,ueCb,cqiCb);
Bool hqPres
));
+PUBLIC void schFillCrntTime(
+ SlotIndInfo slotInd,
+ Inst schInst);
#ifdef CA_DBG
EXTERN U32 delayedApiCnt;
TRC2(rgSCHTomUtlMovePriNxtOccasion);
crntTime = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
- +(cell->crntTime.subframe);
+ +(cell->crntTime.slot);
#ifdef XEON_SPECIFIC_CHANGES
RGSCHCPYTIMEINFO(cell->crntTime, ue->riRecpTime);
#endif
TRC2(rgSCHTomUtlMoveSrsNxtOccasion);
crntTime = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
- +(cell->crntTime.subframe);
+ +(cell->crntTime.slot);
/* Compute Next Transmission Instance */
tempIdx = ue->srsCb.peri + ue->srsCb.nSrsTrIdx;
if (rawCqiInfo->numBits >= 5)
printf("cellId [%d] crnti [%d] numBits [%d] uciPayload [0x%08x] sfn/sf [%d:%d]\n",
cell->cellId, rawCqiInfo->crnti, rawCqiInfo->numBits, rawCqiInfo->uciPayload,
- rawCqiInd->timingInfo.sfn, rawCqiInd->timingInfo.subframe);
+ rawCqiInd->timingInfo.sfn, rawCqiInd->timingInfo.slot);
*/
if (rawCqiInfo->numBits == 1)
{
}
/*
printf("rawCqiInfo->numBits [%d] uciPayload [0x%08x] sfn/sf [%d:%d]\n", rawCqiInfo->numBits,
- rawCqiInfo->uciPayload, rawCqiInd->timingInfo.sfn, rawCqiInd->timingInfo.subframe);
+ rawCqiInfo->uciPayload, rawCqiInd->timingInfo.sfn, rawCqiInd->timingInfo.slot);
*/
}
else if (rawCqiInfo->numBits == 5)
}
else if (rawCqiInfo->numBits == 6)
{
- RgInfRlsHqInfo *rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
+ rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
TfuHqFdbk fdbk = TFU_HQFDB_NACK;
/* Process both HARQ and CQI-RI Ind*/
ri = (rawCqiInfo->uciPayload >> 26) & 0x1;
/*Removed the WA to drop 2nd CRC*/
RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"Recieved CRC "
"twice per TTI @(%u,%u)", cell->crntTime.sfn,
- cell->crntTime.subframe);
+ cell->crntTime.slot);
}
lastCrc = crntCrc;
}
#ifdef LTE_TDD
/*ccpu00128820 - MOD - Msg3 alloc double delete issue*/
hqProc = &(raCb->msg3HqProc);
- RGSCH_UPD_PHICH(cell->ulDlCfgIdx, crcInd->timingInfo.subframe,
+ RGSCH_UPD_PHICH(cell->ulDlCfgIdx, crcInd->timingInfo.slot,
hqProc);
#endif
raCb = NULLP;
*
* Function: rgSCHTomTtiInd
*
- * Handler for processing TTI indication recieved from PHY
+ * Handler for processing slot indication recieved from MAC
* for a cell. This is split into the below Steps.
*
* 1: Complete the Uplink and Common Channel Scheduling for each Cell
* 4: Fill the Tfu structures for DL and UL Config requests
* 5: Handle the RGR Config messages per Cell
*
- * @param[in] TfuTtiIndInfo *ttiInd
+ * @param[in] SlotIndInfo *slotInd
* @param[in] Inst schInst
* @return Void
**/
#ifdef ANSI
PUBLIC Void rgSCHTomTtiInd
(
-TfuTtiIndInfo *ttiInd,
+SlotIndInfo *slotInd,
Inst schInst
)
#else
-PUBLIC Void rgSCHTomTtiInd(ttiInd, schInst)
-TfuTtiIndInfo *ttiInd;
+PUBLIC Void rgSCHTomTtiInd(slotInd, schInst)
+SlotIndInfo *slotInd;
Inst schInst;
#endif
{
glblTtiCnt++;
#endif
- rgSchTomFillCellTtiInfo(ttiInd, schInst, &nCell, &cell[0]);
+ //rgSchTomFillCellTtiInfo(slotInd, schInst, &nCell, &cell[0]);
+
+ schFillCrntTime(*slotInd,schInst);
for (i = 0; i < nCell; i++)
{
/* Perform UL and DL Common Channel scheduling */
/*ccpu00130768 */
if(cell->srsCfg.isSrsCfgPres &&
- rgSchTddCellSpSrsSubfrmTbl[cell->srsCfg.srsSubFrameCfg][recpReqInfo->timingInfo.subframe])
+ rgSchTddCellSpSrsSubfrmTbl[cell->srsCfg.srsSubFrameCfg][recpReqInfo->timingInfo.slot])
{
recpReqInfo->srsPres = TRUE;
}
cntrlInfo->dlTiming = cell->dlDciTime;
cntrlInfo->cellId = cell->cellId;
cntrlInfo->ulTiming = cell->hiDci0Time;
- if((0 == (cntrlInfo->dlTiming.sfn % 30)) && (0 == cntrlInfo->dlTiming.subframe))
+ if((0 == (cntrlInfo->dlTiming.sfn % 30)) && (0 == cntrlInfo->dlTiming.slot))
{
//printf("5GTF_CHECK rgSCHTomUtlProcDlSf Cntrl dl (%d : %d) ul (%d : %d)\n", cntrlInfo->dlTiming.sfn, cntrlInfo->dlTiming.subframe, cntrlInfo->ulTiming.sfn, cntrlInfo->ulTiming.subframe);
}
TRC2(rgSCHTomUtlFillDatRecpReq);
- if((0 == (recpReqInfo->timingInfo.sfn % 30)) && (0 == recpReqInfo->timingInfo.subframe))
+ if((0 == (recpReqInfo->timingInfo.sfn % 30)) && (0 == recpReqInfo->timingInfo.slot))
{
- //printf("5GTF_CHECK rgSCHTomUtlFillDatRecpReq (%d : %d)\n", recpReqInfo->timingInfo.sfn, recpReqInfo->timingInfo.subframe);
+ //printf("5GTF_CHECK rgSCHTomUtlFillDatRecpReq (%d : %d)\n", recpReqInfo->timingInfo.sfn, recpReqInfo->timingInfo.slot);
}
/* processing steps are
* - Run through the UL allocations going out in this subframe.
{
RGSCHDECRFRMCRNTTIME(cell->crntTime,dci0Time,(RGSCH_ULCTRL_RECP_DIST));
- idx = (dci0Time.sfn * RGSCH_NUM_SUB_FRAMES_5G + dci0Time.subframe)%
+ idx = (dci0Time.sfn * RGSCH_NUM_SUB_FRAMES_5G + dci0Time.slot)%
RGSCH_ULCTRL_RECP_DIST;
UNUSED(idx);
datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA;
RgSchUePCqiCb *cqiCb;
#endif
{
- U16 tti = (crntTimInfo.sfn * RGSCH_NUM_SUB_FRAMES_5G + crntTimInfo.subframe);
+ U16 tti = (crntTimInfo.sfn * RGSCH_NUM_SUB_FRAMES_5G + crntTimInfo.slot);
U16 prdNum = tti/cqiCb->cqiPeri;
TRC2(rgSCHTomUtlPcqiSbCalcBpIdx);
/* Added support for period = 0 to disable tick to RRM */
if ((cell->rrmTtiIndPrd != 0) &&
((cell->crntTime.sfn % cell->rrmTtiIndPrd) == 0) &&
- (cell->crntTime.subframe == 0))
+ (cell->crntTime.slot == 0))
{
/* Allocate a TTI indication structure and send to RRM over RGR interface */
if (rgSCHUtlAllocSBuf (cell->instIdx,
RETVOID;
}
rgrTtiInd->cellId = cell->cellId;
- rgrTtiInd->hSfn = cell->crntTime.hSfn;
+ //rgrTtiInd->hSfn = cell->crntTime.hSfn;
rgrTtiInd->sfn = cell->crntTime.sfn;
if (rgSCHUtlRgrTtiInd (cell, rgrTtiInd) != ROK)
{
cell->stopDlSch = TRUE;
}
- if((0 == (cellInfo->timingInfo.sfn % 30)) && (0 == cellInfo->timingInfo.subframe))
+ if((0 == (cellInfo->timingInfo.sfn % 30)) && (0 == cellInfo->timingInfo.slot))
{
- //printf("5GTF_CHECK rgSCHTOMTtiInd (%d : %d)\n", cellInfo->timingInfo.sfn, cellInfo->timingInfo.subframe);
+ //printf("5GTF_CHECK rgSCHTOMTtiInd (%d : %d)\n", cellInfo->timingInfo.sfn, cellInfo->timingInfo.slot);
}
#ifndef EMTC_ENABLE
RGSCHCPYTIMEINFO(cellInfo->timingInfo, cell->crntTime);
cell->totalTime++;
#endif
#ifdef LTE_TDD
- U8 idx = (cell->crntTime.subframe + RG_SCH_CMN_DL_DELTA) %
+ U8 idx = (cell->crntTime.slot + RG_SCH_CMN_DL_DELTA) %
RGSCH_NUM_SUB_FRAMES_5G;
cell->isDlDataAllwd = RG_SCH_CMN_CHK_DL_DATA_ALLOWED(cell, idx);
/*ccpu00130639 -ADD - used in UL HARQ proc id calculation*/
- if((cell->crntTime.sfn == 0) && (cell->crntTime.subframe == 0))
+ if((cell->crntTime.sfn == 0) && (cell->crntTime.slot == 0))
{
/* sfn Cycle used for Tdd UL Harq Proc Determination.
This sfn Cycle will have values from 0 to numUl Harq-1. */
}
}
+void schFillCrntTime(
+ SlotIndInfo slotInd,
+ Inst schInst)
+{
+ U8 cellCount = 0;
+ for(cellCount = 0; cellCount < CM_LTE_MAX_CELLS; cellCount++)
+ {
+ RgSchCellCb *cell;
+ cell = rgSchCb[schInst].cells[cellCount];
+
+ RGSCHCPYTIMEINFO(slotInd, cell->crntTime);
+
+ RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->hiDci0Time,
+ TFU_ULCNTRL_DLDELTA);
+ RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->dlDciTime,
+ TFU_DLCNTRL_DLDELTA);
+ RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->rcpReqTime,
+ TFU_RECPREQ_DLDELTA);
+ RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->hqRlsTime,
+ TFU_HQFBKIND_ULDELTA);
+ RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->dlSfRlsTime,
+ RGSCH_RLS_SF_IDX);
+
+ RGSCH_INCR_SUB_FRAME(cell->crntTime, RG_SCH_CMN_DL_DELTA);
+
+ RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
+ cellSch->dl.time = cell->crntTime;
+ }
+}
+
/** @brief This function prepares the TTI for scheduling and
* invokes the Common channel scheduler. Uplink scheduler
* is invoked first if UL Scheduling at CRC is not enabled
if (hqProc == NULLP)
{
printf("UE[%d] failed to find UL HqProc for [%d:%d]\n",
- ue->ueId, frm.sfn, frm.subframe);
+ ue->ueId, frm.sfn, frm.slot);
RETVOID;
}
hqProc->rcvdCrcInd = TRUE;
if (hqProc == NULLP)
{
printf("UE[%d] failed to find UL HqProc for [%d:%d]\n",
- ue->ueId, frm.sfn, frm.subframe);
+ ue->ueId, frm.sfn, frm.slot);
RETVOID;
}
#ifdef UL_LA
#endif
hqProc->alloc = NULLP;
hqProc->ulSfIdx = RGSCH_INVALID_INFO;
- /*ccpu00116293 - Correcting relation between UL subframe and DL subframe based on RG_UL_DELTA*/
+ /*ccpu00116293 - Correcting relation between UL slot and DL slot based on RG_UL_DELTA*/
hqProc->isRetx = FALSE;
hqProc->remTx = 0; /*Reseting the remTx value to 0*/
#ifdef EMTC_ENABLE
cmLListAdd2Tail(&hqE->inUse, &tmpHqProc->lnk);
#ifdef UL_ADPT_DBG
- printf("rgSCHUhmGetAvlHqProc cellId %d free %ld inUse %ld ue %d time (%d %d)\n",cell->cellId, hqE->free.count, hqE->inUse.count, ue->ueId,cellUl->schdTime.sfn,cellUl->schdTime.subframe);
+ printf("rgSCHUhmGetAvlHqProc cellId %d free %ld inUse %ld ue %d time (%d %d)\n",cell->cellId, hqE->free.count, hqE->inUse.count, ue->ueId,cellUl->schdTime.sfn,cellUl->schdTime.slot);
#endif
tmpHqProc->schdTime = cellUl->schdTime;
{
proc = (RgSchUlHqProcCb *)(lnk->node);
lnk = lnk->next;
- // printf("compare rgSCHUhmGetUlProcByTime time (%d %d) CRC time (%d %d) proc->procId %d \n",proc->schdTime.sfn,proc->schdTime.subframe,frm.sfn,frm.subframe ,proc->procId);
+ // printf("compare rgSCHUhmGetUlProcByTime time (%d %d) CRC time (%d %d) proc->procId %d \n",proc->schdTime.sfn,proc->schdTime.slot,frm.sfn,frm.slot ,proc->procId);
if (RGSCH_TIMEINFO_SAME(proc->schdTime, frm))
{
- // printf("Harq timing Matched rgSCHUhmGetUlProcByTime time (%d %d) proc->procId %d \n",proc->schdTime.sfn,proc->schdTime.subframe, proc->procId);
+ // printf("Harq timing Matched rgSCHUhmGetUlProcByTime time (%d %d) proc->procId %d \n",proc->schdTime.sfn,proc->schdTime.slot, proc->procId);
RETVALUE(proc);
}
}
*
* Function: rgSCHUtlPdcchInit
* Purpose: This function initializes PDCCH information for
- * a subframe. It removes the list of PDCCHs allocated
- * in the prior use of this subframe structure.
+ * a slot. It removes the list of PDCCHs allocated
+ * in the prior use of this slot structure.
*
* Invoked by: rgSCHUtlSubFrmPut
*
}
/**
- * @brief This function release RNTP pattern from subFrame and Cell
+ * @brief This function release RNTP pattern from slot and Cell
* @details
*
* Function: rgSchDSFRRntpInfoFree
* @details
*
* Function: rgSCHSFRUtlTotalPooReset
- * Purpose: Update the dynamic variables in each pool as they will be modified in each subframe.
+ * Purpose: Update the dynamic variables in each pool as they will be modified in each slot.
* Dont modify the static variables like startRB, endRB, BW
* Invoked by: rgSCHUtlSubFrmPut
*
*
* Function: rgSCHUtlAddPhich
* Purpose: This function appends PHICH information for
- * a subframe.
+ * a slot.
*
* Invoked by: TOM
*
*
* Function: rgSCHUtlPhichReset
* Purpose: This function initializes PHICH information for
- * a subframe. It removes the list of PHICHs allocated
- * in the prior use of this subframe structure.
+ * a slot. It removes the list of PHICHs allocated
+ * in the prior use of this slot structure.
*
* Invoked by: rgSCHUtlSubFrmPut
*
\f
/**
- * @brief This function returns subframe data structure for a cell
+ * @brief This function returns slot data structure for a cell
*
* @details
*
* Function: rgSCHUtlSubFrmGet
- * Purpose: This function resets the subframe data structure
- * when the subframe is released
+ * Purpose: This function resets the slot data structure
+ * when the slot is released
*
* Invoked by: scheduler
*
sf = cell->subFrms[dlIdx];
#else
/* Changing the idexing
- so that proper subframe is selected */
- dlIdx = (((frm.sfn & 1) * RGSCH_NUM_SUB_FRAMES) + (frm.subframe % RGSCH_NUM_SUB_FRAMES));
+ so that proper slot is selected */
+ dlIdx = (((frm.sfn & 1) * RGSCH_NUM_SUB_FRAMES) + (frm.slot % RGSCH_NUM_SUB_FRAMES));
RGSCH_ARRAY_BOUND_CHECK(cell->instIdx, cell->subFrms, dlIdx);
sf = cell->subFrms[dlIdx];
#endif
\f
/**
- * @brief This function returns subframe data structure for a cell
+ * @brief This function returns slot data structure for a cell
*
* @details
*
* Function: rgSCHUtlSubFrmPut
- * Purpose: This function resets the subframe data structure
- * when the subframe is released
+ * Purpose: This function resets the slot data structure
+ * when the slot is released
*
* Invoked by: scheduler
*
#ifdef LTE_TDD
/**
- * @brief This function initialises the PRACH subframe occasions
+ * @brief This function initialises the PRACH slot occasions
*
* @details
*
* Function: rgSCHUtlUpdPrachOcc
- * Purpose: This function updates the PRACH subframes based on
+ * Purpose: This function updates the PRACH slots based on
* RGR configuration.
*
* Invoked by: Scheduler
for(idx = startIdx; idx < endIdx; idx++)
{
if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx][idx]
- == RG_SCH_TDD_UL_SUBFRAME)
+ == RG_SCH_TDD_UL_slot)
{
if(cellCfg->ulStartSfIdx == count)
{
size = cell->rachCfg.raOccasion.size;
- cell->rachCfg.raOccasion.subFrameNum[size] = idx;
+ cell->rachCfg.raOccasion.slotNum[size] = idx;
cell->rachCfg.raOccasion.size++;
break;
}
cell->rachCfg.raOccasion.size = 0;
- /* Update subframe occasions */
+ /* Update slot occasions */
for(idx = 0; idx < cellCfg->prachRscInfo.numRsc; idx++)
{
if(cellCfg->prachRscInfo.prachInfo[idx].freqIdx == 0)
RGR_TDD_SPL_UL_IDX)
{
subfrmIdx = cell->rachCfg.raOccasion.size;
- cell->rachCfg.raOccasion.subFrameNum[subfrmIdx] = splFrm;
+ cell->rachCfg.raOccasion.slotNum[subfrmIdx] = splFrm;
cell->rachCfg.raOccasion.size++;
}
else
*
* Function: rgSCHUtlRgrCellCfg
* Purpose: This function initialises the cell with RGR configuration
- * and subframe related initialization.
+ * and slot related initialization.
*
* Invoked by: Scheduler
*
RgSchDlSf *sf;
CmLteTimingInfo frm;
U8 ulDlCfgIdx = cellCfg->ulDlCfgIdx;
- U8 maxSubframes ;
- U8 maxDlSubframes;
+ U8 maxslots ;
+ U8 maxDlslots;
S16 ret = ROK;
U16 bw; /*!< Number of RBs in the cell */
cmMemset((U8 *)&frm,0,sizeof(CmLteTimingInfo));
/* ccpu00132657-MOD- Determining DLSF array size independent of DELTAS */
- maxDlSubframes = rgSchTddNumDlSubfrmTbl[ulDlCfgIdx][RGSCH_NUM_SUB_FRAMES-1];
- maxSubframes = 2 * maxDlSubframes;
- cell->numDlSubfrms = maxSubframes;
+ maxDlslots = rgSchTddNumDlSubfrmTbl[ulDlCfgIdx][RGSCH_NUM_SUB_FRAMES-1];
+ maxslots = 2 * maxDlslots;
+ cell->numDlSubfrms = maxslots;
/* ACC-TDD <ccpu00130639> */
cell->tddHqSfnCycle = -1;
cell->ulDlCfgIdx = ulDlCfgIdx;
bw = cell->bwCfg.dlTotalBw;
rgSCHUtlAllocSBuf(cell->instIdx,
- (Data **)&cell->subFrms, sizeof(RgSchDlSf *) * maxSubframes);
+ (Data **)&cell->subFrms, sizeof(RgSchDlSf *) * maxslots);
if (cell->subFrms == NULLP)
{
RETVALUE(RFAILED);
}
/* Create memory for each frame. */
- for(i = 0; i < maxSubframes; i++)
+ for(i = 0; i < maxslots; i++)
{
while(rgSchTddUlDlSubfrmTbl[ulDlCfgIdx][sfNum] ==
- RG_SCH_TDD_UL_SUBFRAME)
+ RG_SCH_TDD_UL_slot)
{
sfNum = (sfNum+1) % RGSCH_NUM_SUB_FRAMES;
}
cell->subFrms[i] = sf;
sfNum = (sfNum+1) % RGSCH_NUM_SUB_FRAMES;
}
- if (i != maxSubframes)
+ if (i != maxslots)
{
for (; i > 0; i--)
{
/* ccpu00117052 - MOD - Passing double pointer
for proper NULLP assignment*/
rgSCHUtlFreeSBuf(cell->instIdx,
- (Data **)(&(cell->subFrms)), sizeof(RgSchDlSf *) * maxSubframes);
+ (Data **)(&(cell->subFrms)), sizeof(RgSchDlSf *) * maxslots);
RETVALUE(RFAILED);
}
RETVALUE(ret);
}
- /* Release the subframes and thereby perform the initialization */
- for (i = 0; i < maxSubframes; i++)
+ /* Release the slots and thereby perform the initialization */
+ for (i = 0; i < maxslots; i++)
{
- if((i > 0) && (i%maxDlSubframes == 0))
+ if((i > 0) && (i%maxDlslots == 0))
{
sfn++;
}
frm.sfn = sfn;
- frm.subframe = cell->subFrms[i]->sfNum;
+ frm.slot = cell->subFrms[i]->sfNum;
rgSCHUtlDlRlsSubFrm(cell, frm);
}
* @details
*
* Function: rgSCHUtlRgrCellCfg
- * Purpose: This function creates the subframes needed for the
+ * Purpose: This function creates the slots needed for the
* cell. It then peforms init of the scheduler by calling
* scheduler specific cell init function.
*
cell->noOfRbgs = RGSCH_CEIL(cell->bwCfg.dlTotalBw, cell->rbgSize);
/* Create memory for each frame. */
/* Changing loop limit from
- RGSCH_NUM_SUB_FRAMES to RGSCH_NUM_DL_SUBFRAMES */
- for(i = 0; i < RGSCH_NUM_DL_SUBFRAMES; i++)
+ RGSCH_NUM_SUB_FRAMES to RGSCH_NUM_DL_slotS */
+ for(i = 0; i < RGSCH_NUM_DL_slotS; i++)
{
rgSCHUtlAllocSBuf(inst, (Data **)&sf, sizeof(RgSchDlSf));
if (sf == NULLP)
/* LTE_ADV_FLAG_REMOVED_END */
/* Changing loop limit from
- RGSCH_NUM_SUB_FRAMES to RGSCH_NUM_DL_SUBFRAMES */
- if (i != RGSCH_NUM_DL_SUBFRAMES)
+ RGSCH_NUM_SUB_FRAMES to RGSCH_NUM_DL_slotS */
+ if (i != RGSCH_NUM_DL_slotS)
{
for (; i > 0; i--)
{
cell->sc.apis = &rgSchCmnApis;
}
- /* Release the subframes and thereby perform the initialization */
- for (i = 0; i < RGSCH_NUM_DL_SUBFRAMES; i++)
+ /* Release the slots and thereby perform the initialization */
+ for (i = 0; i < RGSCH_NUM_DL_slotS; i++)
{
if (i >= RGSCH_NUM_SUB_FRAMES)
{
it to one */
frm.sfn = 1;
}
- frm.subframe = i % RGSCH_NUM_SUB_FRAMES;
+ frm.slot = i % RGSCH_NUM_SUB_FRAMES;
rgSCHUtlDlRlsSubFrm(cell, frm);
}
* Function: rgSCHUtlFreeCell
* Purpose: This function updates the value of Y stored in the
* UE control block. It uses the previously computed
- * value for computing for this subframe.
+ * value for computing for this slot.
*
* Invoked by: Scheduler
*
RgSchPhichInfo *phichInfo;
RgSchPhich *phich;
Inst inst = cell->instIdx;
- U8 maxSubframes;
+ U8 maxslots;
#ifdef LTE_TDD
RgSchRaReqInfo *raReqInfo;
U8 idx;
TRC2(rgSCHUtlFreeCell);
#ifdef LTE_TDD
- maxSubframes = cell->numDlSubfrms;
+ maxslots = cell->numDlSubfrms;
#else
- maxSubframes = RGSCH_NUM_DL_SUBFRAMES;
+ maxslots = RGSCH_NUM_DL_slotS;
#endif
/* Invoke the index for scheduler, cell deletion */
cell->sc.apis->rgSCHFreeCell(cell);
- /* Release the subframes allocated */
- for (i = 0; i < maxSubframes; i++)
+ /* Release the slots allocated */
+ for (i = 0; i < maxslots; i++)
{
#ifdef LTE_ADV
rgSCHLaaDeInitDlSfCb(cell, cell->subFrms[i]);
rgSCHUtlFreeSBuf(inst, (Data **)(&(cell->subFrms[i])), sizeof(RgSchDlSf));
}
#ifdef LTE_TDD
- /* Release the subframe pointers */
+ /* Release the slot pointers */
/* ccpu00117052 - MOD - Passing double pointer
for proper NULLP assignment*/
rgSCHUtlFreeSBuf(inst,
- (Data **) (&(cell->subFrms)), sizeof(RgSchDlSf *) * maxSubframes);
+ (Data **) (&(cell->subFrms)), sizeof(RgSchDlSf *) * maxslots);
for(idx=0; idx < cell->raInfo.lstSize; idx++)
{
* @details
*
* Function: rgSCHUtlDlHqPTbAddToTx
- * Purpose: This function a HarqProcess TB to the subframe
+ * Purpose: This function a HarqProcess TB to the slot
* list.
*
* Invoked by: Scheduler
* @details
*
* Function: rgSCHUtlDlHqPTbRmvFrmTx
- * Purpose: This function removes a HarqProcess TB to the subframe
+ * Purpose: This function removes a HarqProcess TB to the slot
* list.
*
* Invoked by: Scheduler
*
* Function: rgSCHUtlUlHqProcForUe
* Purpose: This function returns the harq process for
- * which data is expected in the current subframe.
+ * which data is expected in the current slot.
* It does not validate if the HARQ process
* has an allocation.
*
*
* Function: rgSCHUtlFirstRcptnReq(cell)
* Purpose: This function returns the first uplink allocation
- * (or NULLP if there is none) in the subframe
+ * (or NULLP if there is none) in the slot
* in which is expected to prepare and send reception
* request to PHY.
*
*
* Function: rgSCHUtlNextRcptnReq(cell)
* Purpose: This function returns the next uplink allocation
- * (or NULLP if there is none) in the subframe
+ * (or NULLP if there is none) in the slot
* in which is expected to prepare and send reception
* request to PHY.
*
*
* Function: rgSCHUtlFirstHqFdbkAlloc
* Purpose: This function returns the first uplink allocation
- * (or NULLP if there is none) in the subframe
+ * (or NULLP if there is none) in the slot
* in which it is expected to prepare and send HARQ
* feedback to PHY.
*
*
* Function: rgSCHUtlNextHqFdbkAlloc(cell)
* Purpose: This function returns the next uplink allocation
- * (or NULLP if there is none) in the subframe
+ * (or NULLP if there is none) in the slot
* for which HARQ feedback needs to be sent.
*
* Invoked by: TOM
*
* Func : rgSCHUtlResetSfAlloc
*
- * Desc : Utility Function to Reset subframe allocation information.
+ * Desc : Utility Function to Reset slot allocation information.
*
*
* Ret : ROK
*
* Func : rgSCHUtlGetRlsHqAlloc
*
- * Desc : Utility Function to Allocate subframe allocation information.
+ * Desc : Utility Function to Allocate slot allocation information.
*
*
* Ret : ROK
*
* Func : rgSCHUtlPutRlsHqAlloc
*
- * Desc : Utility Function to deallocate subframe allocation information.
+ * Desc : Utility Function to deallocate slot allocation information.
*
*
* Ret : ROK
*
* Func : rgSCHUtlGetSfAlloc
*
- * Desc : Utility Function to Allocate subframe allocation information.
+ * Desc : Utility Function to Allocate slot allocation information.
*
*
* Ret : ROK
*
* Func : rgSCHUtlPutSfAlloc
*
- * Desc : Utility Function to deallocate subframe allocation information.
+ * Desc : Utility Function to deallocate slot allocation information.
*
*
* Ret : ROK
/** @brief This function fills in the pdsch data related allocation Info
* from the pdcch DCI info.
- * subframe
+ * slot
*
* @details
*
CmLteTimingInfo frm;
- /* Get Downlink Subframe */
+ /* Get Downlink slot */
frm = cell->crntTime;
RGSCH_INCR_SUB_FRAME(frm, RG_SCH_CMN_DL_DELTA);
sf = rgSCHUtlSubFrmGet(cell, frm);
{
/* Added for dropping paging Message*/
/*suman*/
- if ((rgSCHChkBoUpdate(cell,boUpdt))== ROK) /* Checking if received BO falls within the window of 5120 subframes*/
+ if ((rgSCHChkBoUpdate(cell,boUpdt))== ROK) /* Checking if received BO falls within the window of 5120 slots*/
{
if (rgSCHUtlGetAllwdCchTbSz(boUpdt->bo*8, &nPrb, &mcs)
!= (boUpdt->bo*8))
TRC2(rgSCHUtlInitUeANFdbkInfo);
anFdInfo->sfn = RGSCH_MAX_SFN+1; /* defensively setting invalid sfn */
- anFdInfo->subframe = 0;
+ anFdInfo->slot = 0;
anFdInfo->ulDai = RG_SCH_INVALID_DAI_VAL;
anFdInfo->dlDai = RG_SCH_INVALID_DAI_VAL;
anFdInfo->latestMIdx = RG_SCH_INVALID_M_VAL;
* Function : rgSCHUtlGetUeANFdbkInfo
*
* It gets the UE related ACK NACK information based on
- * SFN and subframe number.
+ * SFN and slot number.
*
* @param[in] RgSchUeCb *ueCb
* @param[in] CmLteTimingInfo *time
for (idx = 0; idx < ueCb->cell->ackNackFdbkArrSize; ++idx)
{
if( (timeInfo->sfn == ueCb->cellInfo[servCellIdx]->anInfo[idx].sfn) &&
- (timeInfo->subframe == ueCb->cellInfo[servCellIdx]->anInfo[idx].subframe))
+ (timeInfo->slot == ueCb->cellInfo[servCellIdx]->anInfo[idx].slot))
{
RETVALUE(&ueCb->cellInfo[servCellIdx]->anInfo[idx]);
}
} /* rgSCHUtlGetUeANFdbkInfo */
/**
- * @brief To get downlink subframe index
+ * @brief To get downlink slot index
*
* @details
*
* Function: rgSCHUtlGetDlSfIdx
- * Purpose: Gets downlink subframe index based on SFN and subframe no
+ * Purpose: Gets downlink slot index based on SFN and slot no
*
* @param[in] CmLteTimingInfo *timeInfo
* @param[in] RgSchCellCb *cell
idx = RGSCH_NUM_SUB_FRAMES - \
rgSchTddNumUlSubfrmTbl[cell->ulDlCfgIdx][RGSCH_NUM_SUB_FRAMES-1];
idx = ((idx * timeInfo->sfn) + \
- rgSchTddNumDlSubfrmTbl[cell->ulDlCfgIdx][timeInfo->subframe]) - 1;
+ rgSchTddNumDlSubfrmTbl[cell->ulDlCfgIdx][timeInfo->slot]) - 1;
idx = idx % cell->numDlSubfrms;
RETVALUE((U8)idx);
}
/**
- * @brief To get the next downlink subframe
+ * @brief To get the next downlink slot
*
* @details
*
* Function: rgSCHUtlGetNxtDlSfInfo
- * Purpose: Gets next downlink subframe based on current DL subframe
+ * Purpose: Gets next downlink slot based on current DL slot
*
* @param[in] CmLteTimingInfo curDlTime
* @param[in] RgSchCellCb *cell
CmLteTimingInfo *nxtDlTime;
#endif
{
- U16 idx = curDlTime.subframe;
+ U16 idx = curDlTime.slot;
U8 count = 0;
TRC2(rgSCHUtlGetNxtDlSfInfo);
idx = (idx + 1) % RGSCH_NUM_SUB_FRAMES;
count++;
}while(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx][idx]
- != RG_SCH_TDD_DL_SUBFRAME);
+ != RG_SCH_TDD_DL_slot);
RG_SCH_ADD_TO_CRNT_TIME(curDlTime, (*nxtDlTime), count);
*nxtDlsf = rgSCHUtlSubFrmGet(cell, *nxtDlTime);
- if(dlSf->dlFdbkInfo.subframe != (*nxtDlsf)->dlFdbkInfo.subframe)
+ if(dlSf->dlFdbkInfo.slot != (*nxtDlsf)->dlFdbkInfo.slot)
{
break;
}
}
/**
- * @brief To get the previous downlink subframe
+ * @brief To get the previous downlink slot
*
* @details
*
* Function: rgSCHUtlGetPrevDlSfInfo
- * Purpose: Gets previous downlink subframe based on current DL subframe
+ * Purpose: Gets previous downlink slot based on current DL slot
*
* @param[in] RgSchCellCb *cell
* @param[in] CmLteTimingInfo curDlTime
U8 *numSubfrm;
#endif
{
- S16 idx = curDlTime.subframe;
+ S16 idx = curDlTime.slot;
U8 count = 0;
TRC2(rgSCHUtlGetPrevDlSfInfo);
}
count++;
}while(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx][idx]
- != RG_SCH_TDD_DL_SUBFRAME);
+ != RG_SCH_TDD_DL_slot);
*numSubfrm = count;
RGSCHDECRFRMCRNTTIME(curDlTime, (*prevDlTime), count);
RETVOID;
*
* Func : rgSCHUtlUlSfInit
*
- * Desc : UL subframe init.
+ * Desc : UL slot init.
*
* Ret : S16
*
#ifdef LTE_TDD
if(cell->ulDlCfgIdx == 0)
{
- /* Store the Uplink subframe number corresponding to the idx */
+ /* Store the Uplink slot number corresponding to the idx */
sf->ulSfIdx = rgSchTddCfg0UlSfTbl[idx%6];
}
#endif
*
* Func : rgSCHUtlUlSfDeinit
*
- * Desc : Deinitialises a subframe
+ * Desc : Deinitialises a slot
*
* Ret : Void
*
*
* Func : rgSCHUtlUlAllocFirst
*
- * Desc : Get first alloc in subframe
+ * Desc : Get first alloc in slot
*
* Ret : RgSchUlAlloc *
*
{
/*Stop the DRX retransmission timer as UE scheduled for retx. Here
* we stop the timer and inactivate the UE for both UL and DL.
- * This may result in loss of one subframe for UL but this trade
+ * This may result in loss of one slot for UL but this trade
* off is taken to avoid the overhead of maintaining a list of UEs
- * to be inactivated in the next subframe.*/
+ * to be inactivated in the next slot.*/
drxHq = RG_SCH_DRX_GET_DL_HQ(dlHq);
drxUe = RG_SCH_DRX_GET_UE(ueCb);
if(drxHq->reTxIndx != DRX_INVALID)
if(cell->prbUsage.rprtPeriod >= RGSCH_NUM_SUB_FRAMES)
{
- /* Get the total number of DL and UL subframes within the reporting period*/
+ /* Get the total number of DL and UL slots within the reporting period*/
numDlSf = (cell->prbUsage.rprtPeriod *
rgSchTddNumDlSubfrmTbl[cell->ulDlCfgIdx][RGSCH_NUM_SUB_FRAMES-1])
/ RGSCH_NUM_SUB_FRAMES;
}
else
{
- /* Get the total number of DL and UL subframes < 10 ms interval */
- numDlSf = rgSchTddNumDlSubfrmTbl[cell->ulDlCfgIdx][frm.subframe];
- numUlSf = rgSchTddNumUlSubfrmTbl[cell->ulDlCfgIdx][frm.subframe];
+ /* Get the total number of DL and UL slots < 10 ms interval */
+ numDlSf = rgSchTddNumDlSubfrmTbl[cell->ulDlCfgIdx][frm.slot];
+ numUlSf = rgSchTddNumUlSubfrmTbl[cell->ulDlCfgIdx][frm.slot];
}
#else
numDlSf = cell->prbUsage.rprtPeriod;
U32 distance = 0;
TRC2(rgSCHChkBoUpdate);
- crntTimeInSubFrms = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G) + cell->crntTime.subframe +
+ crntTimeInSubFrms = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G) + cell->crntTime.slot +
RG_SCH_CMN_DL_DELTA + 2; /* As bo received will scheduled in next TTI
so incrementing with +1 more */
- boUpdTimeInSubFrms = (boUpdt->u.timeToTx.sfn * RGSCH_NUM_SUB_FRAMES_5G)+ boUpdt->u.timeToTx.subframe;
+ boUpdTimeInSubFrms = (boUpdt->u.timeToTx.sfn * RGSCH_NUM_SUB_FRAMES_5G)+ boUpdt->u.timeToTx.slot;
distance = boUpdTimeInSubFrms > crntTimeInSubFrms ? \
{
iPhich = 1;
}
- if(phichTime.subframe == 0 || phichTime.subframe == 5)
+ if(phichTime.slot == 0 || phichTime.slot == 5)
{
if(iPhich == 0)
{
{
/* Retx will happen at n+7 */
RGSCHCMNADDTOCRNTTIME(phichTime, phichTime, 7);
- /* Fetch the corresponding UL subframe Idx in UL sf array */
+ /* Fetch the corresponding UL slot Idx in UL sf array */
reTxIdx = rgSCHCmnGetUlSfIdx(&phichTime, cell);
}
}
- else if(phichTime.subframe == 1 || phichTime.subframe == 6)
+ else if(phichTime.slot == 1 || phichTime.slot == 6)
{
/* Retx will happen at n+7 */
RGSCHCMNADDTOCRNTTIME(phichTime, phichTime, 7);
- /* Fetch the corresponding UL subframe Idx in UL sf array */
+ /* Fetch the corresponding UL slot Idx in UL sf array */
reTxIdx = rgSCHCmnGetUlSfIdx(&phichTime, cell);
}
RETVALUE(reTxIdx);
RgSchCmnCell *cellSch;
U8 maxUeNewDlTxPerTti;
U8 maxUeNewUlTxPerTti;
- U8 tmpSubFrame = 0;
+ U8 tmpslot = 0;
#ifdef CPU_OL_DBG_PRINTS
U8 idx = 0;
#endif
/* Decrement till 90% of maxUeNewDlTxPerTti */
if ( cpuInstr->dlNxtIndxDecNumUeTti < maxDlDecCnt )
{
- tmpSubFrame = (cpuInstr->dlNxtIndxDecNumUeTti) % 10;
+ tmpslot = (cpuInstr->dlNxtIndxDecNumUeTti) % 10;
cpuInstr->dlNxtIndxDecNumUeTti++;
- if ( cpuInstr->maxUeNewTxPerTti[tmpSubFrame] > 1 )
+ if ( cpuInstr->maxUeNewTxPerTti[tmpslot] > 1 )
{
- cpuInstr->maxUeNewTxPerTti[tmpSubFrame]--;
+ cpuInstr->maxUeNewTxPerTti[tmpslot]--;
}
else
{
if ( cpuInstr->dlNxtIndxDecNumUeTti > 0)
{
cpuInstr->dlNxtIndxDecNumUeTti--;
- tmpSubFrame = (cpuInstr->dlNxtIndxDecNumUeTti) % 10;
- if ( cpuInstr->maxUeNewTxPerTti[tmpSubFrame] < maxUeNewDlTxPerTti )
+ tmpslot = (cpuInstr->dlNxtIndxDecNumUeTti) % 10;
+ if ( cpuInstr->maxUeNewTxPerTti[tmpslot] < maxUeNewDlTxPerTti )
{
- cpuInstr->maxUeNewTxPerTti[tmpSubFrame]++;
+ cpuInstr->maxUeNewTxPerTti[tmpslot]++;
}
else
{
/* Decrement till 90% of maxUeNewDlTxPerTti */
if ( cpuInstr->ulNxtIndxDecNumUeTti < maxUlDecCnt )
{
- tmpSubFrame = (cpuInstr->ulNxtIndxDecNumUeTti) % 10;
+ tmpslot = (cpuInstr->ulNxtIndxDecNumUeTti) % 10;
cpuInstr->ulNxtIndxDecNumUeTti++;
- if ( cpuInstr->maxUeNewRxPerTti[tmpSubFrame] > 1 )
+ if ( cpuInstr->maxUeNewRxPerTti[tmpslot] > 1 )
{
- cpuInstr->maxUeNewRxPerTti[tmpSubFrame]--;
+ cpuInstr->maxUeNewRxPerTti[tmpslot]--;
}
else
{
if ( cpuInstr->ulNxtIndxDecNumUeTti > 0)
{
cpuInstr->ulNxtIndxDecNumUeTti--;
- tmpSubFrame = (cpuInstr->ulNxtIndxDecNumUeTti) % 10;
- if ( cpuInstr->maxUeNewRxPerTti[tmpSubFrame] < maxUeNewUlTxPerTti )
+ tmpslot = (cpuInstr->ulNxtIndxDecNumUeTti) % 10;
+ if ( cpuInstr->maxUeNewRxPerTti[tmpslot] < maxUeNewUlTxPerTti )
{
- cpuInstr->maxUeNewRxPerTti[tmpSubFrame]++;
+ cpuInstr->maxUeNewRxPerTti[tmpslot]++;
}
else
{
--- /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. #
+################################################################################
+*******************************************************************************/
+
+/************************************************************************
+
+ Name: sch.c
+
+ Type: C source file
+
+ Desc: C source code for scheduler fucntions
+
+ File: sch.c
+
+**********************************************************************/
+
+/** @file sch.c
+@brief This file implements the schedulers main access to MAC layer code.
+*/
+#include "stdbool.h"
+#include "envopt.h" /* environment options */
+#include "envdep.h" /* environment dependent */
+#include "envind.h" /* environment independent */
+#include "gen.h" /* general layer */
+#include "ssi.h" /* system service interface */
+#include "cm_tkns.h" /* Common Token Defines */
+#include "cm_llist.h" /* Common Link List Defines */
+#include "cm_hash.h" /* Common Hash List Defines */
+#include "cm_mblk.h" /* common memory link list library */
+#include "cm_lte.h" /* Common LTE Defines */
+#include "lrg.h"
+#include "rgr.h"
+#include "tfu.h"
+#include "rg_sch_inf.h"
+#include "rg_sch.h"
+#include "gen.x" /* general layer typedefs */
+#include "ssi.x" /* system services typedefs */
+#include "cm5.x" /* system services */
+#include "cm_tkns.x" /* Common Token Definitions */
+#include "cm_llist.x" /* Common Link List Definitions */
+#include "cm_lib.x" /* Common Library Definitions */
+#include "cm_hash.x" /* Common Hash List Definitions */
+#include "cm_mblk.x" /* common memory link list library */
+#include "cm_lte.x" /* Common LTE Defines */
+#include "tfu.x" /* TFU types */
+#include "lrg.x" /* layer management typedefs for MAC */
+#include "rgr.x" /* layer management typedefs for MAC */
+#include "rg_sch_inf.x" /* typedefs for Scheduler */
+#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "sch.h"
+#include "du_log.h"
+
+extern SchCb schCb[SCH_MAX_INST];
+/* local defines */
+SchCellCfgCfmFunc SchCellCfgCfmOpts[] =
+{
+ packSchCellCfgCfm, /* LC */
+ MacProcSchCellCfgCfm, /* TC */
+ packSchCellCfgCfm /* LWLC */
+};
+
+/**
+ * @brief Task Initiation function.
+ *
+ * @details
+ *
+ * Function : schActvInit
+ *
+ * This function is supplied as one of parameters during MAC's
+ * task registration. MAC will invoke this function once, after
+ * it creates and attaches this TAPA Task to a system task.
+ *
+ * @param[in] Ent Entity, the entity ID of this task.
+ * @param[in] Inst Inst, the instance ID of this task.
+ * @param[in] Region Region, the region ID registered for memory
+ * usage of this task.
+ * @param[in] Reason Reason.
+ * @return int
+ * -# ROK
+ **/
+int schActvInit
+(
+Ent entity, /* entity */
+Inst instId, /* instance */
+Region region, /* region */
+Reason reason /* reason */
+)
+{
+ Inst inst = (instId - SCH_INST_START);
+
+ /* Initialize the MAC TskInit structure to zero */
+ cmMemset ((uint8_t *)&schCb[inst], 0, sizeof(schCb));
+
+ /* Initialize the MAC TskInit with received values */
+ schCb[inst].schInit.ent = entity;
+ schCb[inst].schInit.inst = inst;
+ schCb[inst].schInit.region = region;
+ schCb[inst].schInit.pool = 0;
+ schCb[inst].schInit.reason = reason;
+ schCb[inst].schInit.cfgDone = FALSE;
+ schCb[inst].schInit.acnt = FALSE;
+ schCb[inst].schInit.usta = FALSE;
+ schCb[inst].schInit.trc = FALSE;
+ schCb[inst].schInit.procId = SFndProcId();
+
+ RETVALUE(ROK);
+} /* schActvInit */
+
+/**
+ * @brief Scheduler instance Configuration Handler.
+ *
+ * @details
+ *
+ * Function : SchInstCfg
+ *
+ * This function in called by HandleSchGenCfgReq(). It handles the
+ * general configurations of the scheduler instance. Returns
+ * reason for success/failure of this function.
+ *
+ * @param[in] RgCfg *cfg, the Configuaration information
+ * @return U16
+ * -# LCM_REASON_NOT_APPL
+ * -# LCM_REASON_INVALID_MSGTYPE
+ * -# LCM_REASON_MEM_NOAVAIL
+ **/
+PUBLIC U16 SchInstCfg
+(
+RgCfg *cfg, /* Configuaration information */
+Inst dInst
+)
+{
+ uint16_t ret = LCM_REASON_NOT_APPL;
+ Inst inst = (dInst - SCH_INST_START);
+
+ printf("\nEntered SchInstCfg()");
+ /* Check if Instance Configuration is done already */
+ if (schCb[inst].schInit.cfgDone == TRUE)
+ {
+ RETVALUE(LCM_REASON_INVALID_MSGTYPE);
+ }
+ /* Update the Pst structure for LM interface */
+ cmMemcpy((U8 *)&schCb[inst].schInit.lmPst,
+ (U8 *)&cfg->s.schInstCfg.genCfg.lmPst,
+ sizeof(Pst));
+
+ schCb[inst].schInit.inst = inst;
+ schCb[inst].schInit.lmPst.srcProcId = schCb[inst].schInit.procId;
+ schCb[inst].schInit.lmPst.srcEnt = schCb[inst].schInit.ent;
+ schCb[inst].schInit.lmPst.srcInst = schCb[inst].schInit.inst +
+ SCH_INST_START;
+ schCb[inst].schInit.lmPst.event = EVTNONE;
+
+ schCb[inst].schInit.region = cfg->s.schInstCfg.genCfg.mem.region;
+ schCb[inst].schInit.pool = cfg->s.schInstCfg.genCfg.mem.pool;
+ schCb[inst].genCfg.tmrRes = cfg->s.schInstCfg.genCfg.tmrRes;
+#ifdef LTE_ADV
+ schCb[inst].genCfg.forceCntrlSrbBoOnPCel = cfg->s.schInstCfg.genCfg.forceCntrlSrbBoOnPCel;
+ 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 */
+ cmMemset((U8 *)&schCb[inst].tmrTq, 0, sizeof(CmTqType)*RGSCH_TQ_SIZE);
+ /* Initialize the timer control point */
+ cmMemset((U8 *)&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 */
+ if (SRegTmrMt(schCb[inst].schInit.ent, dInst,
+ (S16)schCb[inst].genCfg.tmrRes, schActvTmr) != ROK)
+ {
+ RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg(): Failed to "
+ "register timer.");
+ RETVALUE(LCM_REASON_MEM_NOAVAIL);
+ }
+#endif
+ /* Set Config done in TskInit */
+ schCb[inst].schInit.cfgDone = TRUE;
+ printf("\nScheduler gen config done");
+
+ RETVALUE(ret);
+}
+
+/**
+ * @brief Layer Manager Configuration request handler.
+ *
+ * @details
+ *
+ * Function : HandleSchGenCfgReq
+ *
+ * This function handles the configuration
+ * request received at scheduler instance from the Layer Manager.
+ * -# Based on the cfg->hdr.elmId.elmnt value it invokes one of the
+ * functions rgHdlGenCfg() or rgHdlSapCfg().
+ * -# Invokes RgMiLrgSchCfgCfm() to send back the confirmation to the LM.
+ *
+ * @param[in] Pst *pst, the post structure
+ * @param[in] RgMngmt *cfg, the configuration parameter's structure
+ * @return S16
+ * -# ROK
+ **/
+int HandleSchGenCfgReq
+(
+Pst *pst, /* post structure */
+RgMngmt *cfg /* config structure */
+)
+{
+ uint16_t ret = LCM_PRIM_OK;
+ uint16_t reason = LCM_REASON_NOT_APPL;
+ RgMngmt cfm;
+ Pst cfmPst;
+
+ if(pst->dstInst < SCH_INST_START)
+ {
+ DU_LOG("\nInvalid inst ID");
+ DU_LOG("\nHandleSchGenCfgReq(): "
+ "pst->dstInst=%d SCH_INST_START=%d", pst->dstInst,SCH_INST_START);
+ RETVALUE(ROK);
+ }
+ printf("\nReceived scheduler gen config");
+ /* Fill the post structure for sending the confirmation */
+ memset(&cfmPst, 0 , sizeof(Pst));
+ SchFillCfmPst(pst, &cfmPst, cfg);
+
+ cmMemset((U8 *)&cfm, 0, sizeof(RgMngmt));
+
+#ifdef LMINT3
+ cfm.hdr.transId =
+ cfg->hdr.transId;
+#endif
+
+ cfm.hdr.elmId.elmnt = cfg->hdr.elmId.elmnt;
+ switch(cfg->hdr.elmId.elmnt)
+ {
+ case STSCHINST:
+ reason = SchInstCfg(&cfg->t.cfg,pst->dstInst );
+ break;
+ default:
+ ret = LCM_PRIM_NOK;
+ reason = LCM_REASON_INVALID_ELMNT;
+ DU_LOG("\nInvalid Elmnt=%d", cfg->hdr.elmId.elmnt);
+ break;
+ }
+
+ if (reason != LCM_REASON_NOT_APPL)
+ {
+ ret = LCM_PRIM_NOK;
+ }
+
+ cfm.cfm.status = ret;
+ cfm.cfm.reason = reason;
+
+ SchSendCfgCfm(&cfmPst, &cfm);
+ /* SPutSBuf(pst->region, pst->pool, (Data *)cfg, sizeof(RgMngmt)); */
+
+ RETVALUE(ROK);
+}/*-- HandleSchGenCfgReq --*/
+
+/**
+ * @brief slot indication from MAC to SCH.
+ *
+ * @details
+ *
+ * Function : macSchSlotInd
+ *
+ * This API is invoked by PHY to indicate slot indication to Scheduler for
+ * a cell.
+ *
+ * @param[in] Pst *pst
+ * @param[in] SlotIndInfo *slotInd
+ * @return S16
+ * -# ROK
+ * -# RFAILED
+ **/
+int macSchSlotInd
+(
+Pst *pst,
+SlotIndInfo *slotInd
+)
+{
+ Inst inst = pst->dstInst-SCH_INST_START;
+
+ /* Now call the TOM (Tfu ownership module) primitive to process further */
+ schProcessSlotInd(slotInd, inst);
+
+ RETVALUE(ROK);
+} /* macSchSlotInd */
+
+/**
+ * @brief inti cellCb based on cellCfg
+ *
+ * @details
+ *
+ * Function : InitSchCellCb
+ *
+ * This API is invoked after receiving schCellCfg
+ *
+ * @param[in] schCellCb *cell
+ * @param[in] SchCellCfg *schCellCfg
+ * @return int
+ * -# ROK
+ * -# RFAILED
+ **/
+int InitSchCellCb(Inst inst, SchCellCfg *schCellCfg)
+{
+ SchCellCb *cell;
+ SCH_ALLOC(cell, sizeof(SchCellCb));
+ if(!cell)
+ {
+ DU_LOG("\nMemory allocation failed in InitSchCellCb");
+ return RFAILED;
+ }
+
+ cell->cellId = schCellCfg->cellId;
+ cell->instIdx = inst;
+ switch(schCellCfg->scsCommon)
+ {
+ case SCH_SCS_15KHZ:
+ {
+ cell->numSlots = SCH_NUM_SLOTS;
+ }
+ break;
+ default:
+ DU_LOG("\nSCS %d not supported", schCellCfg->scsCommon);
+ }
+
+ for(uint8_t idx=0; idx<SCH_NUM_SLOTS; idx++)
+ {
+ SchDlAlloc *schDlAlloc;
+ SCH_ALLOC(schDlAlloc, sizeof(SchDlAlloc));
+ if(!schDlAlloc)
+ {
+ DU_LOG("\nMemory allocation failed in InitSchCellCb");
+ return RFAILED;
+ }
+
+ schDlAlloc->totalPrb = ((schCellCfg->bandwidth *
+ 1000)/(schCellCfg->scsCommon))/SCH_NUM_SC_PRB;
+ for(uint8_t itr=0; itr<MAX_SSB_IDX; itr++)
+ {
+ schDlAlloc->assignedPrb[itr] = 0;
+ }
+ for(uint8_t itr=0; itr<MAX_SSB_IDX; itr++)
+ {
+ memset(&schDlAlloc->ssbInfo[itr], 0, sizeof(SsbInfo));
+ }
+
+ cell->dlAlloc[idx] = schDlAlloc;
+ }
+ schCb[inst].cells[inst] = cell; //Sphoorthi TODO: check if this works
+
+ DU_LOG("\nCell init completed for cellId:%d", cell->cellId);
+
+ return ROK;
+}
+
+/**
+ * @brief cell config from MAC to SCH.
+ *
+ * @details
+ *
+ * Function : macSchCellCfgReq
+ *
+ * This API is invoked by MAC to send cell config to SCH
+ *
+ * @param[in] Pst *pst
+ * @param[in] SchCellCfg *schCellCfg
+ * @return int
+ * -# ROK
+ * -# RFAILED
+ **/
+int SchHdlCellCfgReq
+(
+Pst *pst,
+SchCellCfg *schCellCfg
+)
+{
+ int ret = ROK;
+ SchCellCb *cellCb;
+ SchCellCfgCfm schCellCfgCfm;
+ Pst rspPst;
+ Inst inst = pst->dstInst-1;
+
+ InitSchCellCb(inst, schCellCfg);
+ cellCb = schCb[inst].cells[inst];
+ cellCb->macInst = pst->srcInst;
+ memcpy(&cellCb->cellCfg, schCellCfg, sizeof(SchCellCfg));
+
+ memset(&rspPst, 0, sizeof(Pst));
+ SCH_FILL_RSP_PST(rspPst, inst);
+ rspPst.event = EVENT_SCH_CELL_CFG_CFM;
+ schCellCfgCfm.rsp = RSP_OK;
+
+ ret = (*SchCellCfgCfmOpts[rspPst.selector])(&rspPst, &schCellCfgCfm);
+
+ return ret;
+
+}
+
+/**********************************************************************
+ End of file
+**********************************************************************/
--- /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. #
+################################################################################
+*******************************************************************************/
+
+/* macros */
+#define SCH_INST_START 1
+#define SCH_MAX_CELLS 1
+#define SCH_MAX_INST 1
+#define SCH_NUM_SLOTS 10 /*forcing this to 10 */
+#define SCH_MIB_TRANS 80
+#define SCH_NUM_SC_PRB 12 /* number of SCs in a PRB */
+#define SCH_MAX_SSB_BEAM 4 /* since we are supporting only SCS=15KHz */
+#define SCH_SCS_15KHZ 15
+#define SCH_SYMBOL_PER_SLOT 14
+#define SCH_SSB_SYMB_DURATION 4
+#define SCH_SSB_PRB_DURATION 20
+#define SCH_MEM_REGION 4
+#define SCH_POOL 1
+
+/* allocate and zero out a static buffer */
+#define SCH_ALLOC(_datPtr, _size) \
+{ \
+ S16 _ret; \
+ _ret = SGetSBuf(SCH_MEM_REGION, SCH_POOL, \
+ (Data **)&_datPtr, _size); \
+ if(_ret == ROK) \
+ cmMemset((U8*)_datPtr, 0, _size); \
+ else \
+ _datPtr = NULLP; \
+}
+
+/* free a static buffer */
+#define SCH_FREE(_datPtr, _size) \
+ if(_datPtr) \
+ SPutSBuf(SCH_MEM_REGION, SCH_POOL, \
+ (Data *)_datPtr, _size);
+
+
+#define SCH_FILL_RSP_PST(_rspPst, _inst)\
+{ \
+ _rspPst.srcProcId = SFndProcId(); \
+ _rspPst.dstProcId = SFndProcId();\
+ _rspPst.srcEnt = ENTRG;\
+ _rspPst.dstEnt = ENTRG;\
+ _rspPst.srcInst = 1;\
+ _rspPst.dstInst = 0;\
+ _rspPst.selector = MAC_SELECTOR_TC;\
+}
+
+/**
+ * @brief
+ * Structure holding LTE MAC's General Configuration information.
+ */
+typedef struct schGenCb
+{
+ uint8_t tmrRes; /*!< Timer resolution */
+ uint8_t startCellId; /*!< Starting Cell Id */
+#ifdef LTE_ADV
+ bool forceCntrlSrbBoOnPCel; /*!< value 1 means force scheduling
+ of RLC control BO and SRB BO on
+ PCell. val 0 means don't force*/
+ bool isSCellActDeactAlgoEnable; /*!< TRUE will enable activation/deactivation algo at Schd */
+#endif
+}SchGenCb;
+
+/**
+ * @brief
+ * scheduler allocationsfor DL per cell.
+ */
+typedef struct schDlAlloc
+{
+ uint16_t totalPrb; /*!< Number of RBs in the cell */
+ uint16_t assignedPrb[SCH_SYMBOL_PER_SLOT]; /*!< Num RBs and corresponding symbols allocated */
+ bool ssbPres; /*!< Flag to determine if SSB is present in this slot */
+ uint8_t ssbIdxSupported; /*!< Max SSB index */
+ SsbInfo ssbInfo[MAX_SSB_IDX]; /*!< SSB info */
+}SchDlAlloc;
+
+/**
+ * @brief
+ * Cell Control block per cell.
+ */
+typedef struct schCellCb
+{
+ uint16_t cellId; /*!< Cell ID */
+ Inst instIdx; /*!< Index of the scheduler instance */
+ Inst macInst; /*!< Index of the MAC instance */
+ uint8_t numSlots; /*!< Number of slots in current frame */
+ SlotIndInfo slotInfo; /*!< SFN, Slot info being processed*/
+ SchDlAlloc *dlAlloc[SCH_NUM_SLOTS]; /*!< SCH resource allocations in DL */
+ SchCellCfg cellCfg; /*!< Cell ocnfiguration */
+}SchCellCb;
+
+/**
+ * @brief
+ * Control block for sch
+ */
+typedef struct schCb
+{
+ TskInit schInit; /*!< Task Init info */
+ SchGenCb genCfg; /*!< General Config info */
+ SchCellCb *cells[SCH_MAX_CELLS]; /* Array to store cellCb ptr */
+}SchCb;
+
+/* Declaration for scheduler control blocks */
+SchCb schCb[SCH_MAX_INST];
+
+/* function declarations */
+int schCmnDlAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc);
+int schProcessSlotInd(SlotIndInfo *slotInd, Inst inst);
+
+
+
+/**********************************************************************
+ End of file
+**********************************************************************/
--- /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. #
+################################################################################
+ *******************************************************************************/
+
+/************************************************************************
+
+Name: 5G NR SCH layer
+
+Type: C source file
+
+Desc: C source code for Entry point fucntions
+
+File: sch_common.c
+
+ **********************************************************************/
+
+/** @file sch_common.c
+ @brief This module performs common scheduling
+ */
+#include "stdbool.h"
+#include "envopt.h" /* environment options */
+#include "envdep.h" /* environment dependent */
+#include "envind.h" /* environment independent */
+#include "gen.h" /* general layer */
+#include "ssi.h" /* system service interface */
+#include "cm_tkns.h" /* Common Token Defines */
+#include "cm_llist.h" /* Common Link List Defines */
+#include "cm_hash.h" /* Common Hash List Defines */
+#include "cm_mblk.h" /* common memory link list library */
+#include "cm_lte.h" /* Common LTE Defines */
+#include "tfu.h"
+#include "lrg.h"
+
+#include "gen.x" /* general layer typedefs */
+#include "ssi.x" /* system services typedefs */
+#include "cm5.x" /* system services */
+#include "cm_tkns.x" /* Common Token Definitions */
+#include "cm_llist.x" /* Common Link List Definitions */
+#include "cm_lib.x" /* Common Library Definitions */
+#include "cm_hash.x" /* Common Hash List Definitions */
+#include "cm_mblk.x" /* common memory link list library */
+#include "cm_lte.x" /* Common LTE Defines */
+#include "tfu.x"
+#include "lrg.x"
+#include "du_log.h"
+#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "sch.h"
+
+extern SchCb schCb[SCH_MAX_INST];
+
+/**
+ * @brief Time domain allocation for SSB
+ *
+ * @details
+ *
+ * Function : ssbDlTdAlloc
+ *
+ * This function handles common scheduling for DL
+ *
+ * @param[in] schCellCb *cell, cell cb
+ * @param[in] DlBrdcstAlloc *dlBrdcstAlloc, DL brdcst allocation
+ * @return void
+ **/
+void ssbDlTdAlloc(uint8_t scs, uint8_t *ssbStartSymb)
+{
+ uint8_t n;
+ /* Determine value of "n" based on Section 4.1 of 3GPP TS 38.213 */
+ switch(scs)
+ {
+ case SCH_SCS_15KHZ:
+ {
+ uint8_t symbIdx=0;
+ n = 2;/* n = 0, 1 for SCS = 15KHz */
+ for(uint8_t idx=0; idx<n; idx++)
+ {
+ /* start symbol determined using {2, 8} + 14n */
+ ssbStartSymb[symbIdx++] = 2 + SCH_SYMBOL_PER_SLOT*idx;
+ ssbStartSymb[symbIdx++] = 8 + SCH_SYMBOL_PER_SLOT*idx;
+ }
+ }
+ break;
+ default:
+ DU_LOG("\nSCS %d is currently not supported", scs);
+ }
+}
+/**
+ * @brief common resource allocation for SSB
+ *
+ * @details
+ *
+ * Function : schCmnDlAlloc
+ *
+ * This function handles common scheduling for DL
+ *
+ * @param[in] SchCellCb *cell, cell cb
+ * @param[in] DlBrdcstAlloc *dlBrdcstAlloc, DL brdcst allocation
+ * @return void
+ **/
+int schCmnDlAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc)
+{
+ /* schedule SSB */
+ uint8_t scs, ssbStartPrb, ssbStartSymb, idx;
+ uint8_t ssbStartSymbArr[SCH_MAX_SSB_BEAM];
+ SchDlAlloc *dlAlloc;
+ SsbInfo ssbInfo;
+
+ dlAlloc = cell->dlAlloc[cell->slotInfo.slot];
+ if(dlBrdcstAlloc->ssbTrans)
+ {
+ scs = cell->cellCfg.scsCommon;
+ ssbStartPrb = \
+ ((cell->cellCfg.ssbSubcOffset)-(cell->cellCfg.ssbOffsetPointA))/SCH_NUM_SC_PRB;
+
+ memset(ssbStartSymbArr, 0, SCH_MAX_SSB_BEAM);
+ ssbDlTdAlloc(scs, ssbStartSymbArr);
+ ssbStartSymb = ssbStartSymbArr[dlBrdcstAlloc->ssbIdxSupported-1]; /*since we are supporting only 1 ssb beam */
+ /* Assign interface structure */
+ for(idx=0; idx<dlBrdcstAlloc->ssbIdxSupported; idx++)
+ {
+ ssbInfo.ssbIdx = idx;
+ ssbInfo.fdAlloc.ssbStartPrbIdx = ssbStartPrb;
+ ssbInfo.fdAlloc.ssbPrbDuration = SCH_SSB_PRB_DURATION;
+ ssbInfo.tdAlloc.ssbStartSymbIdx = ssbStartSymb;
+ ssbInfo.tdAlloc.ssbSymbolDuration = SCH_SSB_SYMB_DURATION;
+ dlBrdcstAlloc->ssbInfo[idx] = ssbInfo;
+ dlAlloc->ssbInfo[idx] = ssbInfo;
+
+ }
+
+ dlAlloc->ssbPres = true;
+ dlAlloc->ssbIdxSupported = dlBrdcstAlloc->ssbIdxSupported;
+ for(idx=ssbStartSymb; idx<ssbStartSymb+SCH_SSB_SYMB_DURATION; idx++)
+ {
+ dlAlloc->assignedPrb[idx] = SCH_SSB_PRB_DURATION;
+ }
+
+ }
+ return ROK;
+}
+
+
+/**********************************************************************
+ End of file
+ **********************************************************************/
+
--- /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. #
+################################################################################
+ *******************************************************************************/
+
+/************************************************************************
+
+Name: 5G NR SCH layer
+
+Type: C source file
+
+Desc: C source code for Entry point fucntions for slot indications
+
+File: sch_slot_ind.c
+
+ **********************************************************************/
+
+/** @file sch_slot_ind.c
+ @brief This module processes slot indications
+ */
+#include "stdbool.h"
+#include "envopt.h" /* environment options */
+#include "envdep.h" /* environment dependent */
+#include "envind.h" /* environment independent */
+#include "gen.h" /* general layer */
+#include "ssi.h" /* system service interface */
+#include "cm_tkns.h" /* Common Token Defines */
+#include "cm_llist.h" /* Common Link List Defines */
+#include "cm_hash.h" /* Common Hash List Defines */
+#include "cm_mblk.h" /* common memory link list library */
+#include "cm_lte.h" /* Common LTE Defines */
+#include "tfu.h"
+#include "lrg.h"
+
+#include "gen.x" /* general layer typedefs */
+#include "ssi.x" /* system services typedefs */
+#include "cm5.x" /* system services */
+#include "cm_tkns.x" /* Common Token Definitions */
+#include "cm_llist.x" /* Common Link List Definitions */
+#include "cm_lib.x" /* Common Library Definitions */
+#include "cm_hash.x" /* Common Hash List Definitions */
+#include "cm_mblk.x" /* common memory link list library */
+#include "cm_lte.x" /* Common LTE Defines */
+#include "tfu.x"
+#include "lrg.x"
+#include "du_log.h"
+#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "sch.h"
+
+SchMacDlBrdcstAllocFunc schMacDlBrdcstAllocOpts[] =
+{
+ packSchMacDlBrdcstAlloc,
+ MacProcDlBrdcstAlloc,
+ packSchMacDlBrdcstAlloc
+};
+
+extern SchCb schCb[SCH_MAX_INST];
+
+
+/*******************************************************************
+ *
+ * @brief Handles sending DL broadcast alloc to MAC
+ *
+ * @details
+ *
+ * Function : sendDlBrdcstAllocToMac
+ *
+ * Functionality:
+ * Sends DL Broadcast Resource Allocation to MAC from SCH
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+int sendDlBrdcstAllocToMac(DlBrdcstAlloc *dlBrdcstAlloc, Inst inst)
+{
+ Pst pst;
+
+ memset(&pst, 0, sizeof(Pst));
+ SCH_FILL_RSP_PST(pst, inst);
+ pst.event = EVENT_DL_BRDCST_ALLOC;
+
+ return(*schMacDlBrdcstAllocOpts[pst.selector])(&pst, dlBrdcstAlloc);
+
+}
+/*******************************************************************
+ *
+ * @brief Handles slot indication at SCH
+ *
+ * @details
+ *
+ * Function : schProcessSlotInd
+ *
+ * Functionality:
+ * Handles TTI indication received from PHY
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+int schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
+{
+ int ret = ROK;
+ uint8_t ssb_rep;
+ DlBrdcstAlloc dlBrdcstAlloc;
+ dlBrdcstAlloc.ssbTrans = NO_SSB;
+ SchCellCb *cell;
+
+#ifdef LTE_L2_MEAS
+ glblTtiCnt++;
+#endif
+
+ cell = schCb[schInst].cells[schInst];
+ ssb_rep = cell->cellCfg.ssbPeriod;
+ memcpy(&cell->slotInfo, slotInd, sizeof(SlotIndInfo));
+ memcpy(&dlBrdcstAlloc.slotIndInfo, slotInd, sizeof(SlotIndInfo));
+ dlBrdcstAlloc.cellId = cell->cellId;
+ dlBrdcstAlloc.ssbIdxSupported = 1;
+
+ /* Identify SSB ocassion*/
+ if ((slotInd->sfn % SCH_MIB_TRANS == 0))// && (slotInd.slot == 0))
+ {
+ dlBrdcstAlloc.ssbTrans = SSB_TRANSMISSION;
+ }
+ else if ((slotInd->sfn % ssb_rep == 0))// && (slotInd.slot == 0))
+ {
+ dlBrdcstAlloc.ssbTrans = SSB_REPEAT;
+ }
+ else
+ {
+ ;
+ }
+ schCmnDlAlloc(cell, &dlBrdcstAlloc);
+ //send msg to MAC
+ ret = sendDlBrdcstAllocToMac(&dlBrdcstAlloc, schInst);
+ if(ret != ROK)
+ {
+ DU_LOG("\nSending DL Broadcast allocation from SCH to MAC failed");
+ RETVALUE(ret);
+ }
+ return ret;
+}
+
+/**********************************************************************
+ End of file
+ **********************************************************************/
+
+
++tqCp->nxtEnt;
expire = tqCp->nxtEnt;
+ tqCp->tmrLen = 1;
entry = (U32) (expire % (U32)(tqCp->tmrLen));
tqCp->tmp = (tqEnt = &tq[entry])->first;
TRC3(cmPkLteTimingInfo);
- CMCHKPK(SPkU8, param->subframe, mBuf);
+ CMCHKPK(SPkU16, param->slot, mBuf);
CMCHKPK(SPkU16, param->sfn, mBuf);
- CMCHKPK(SPkU16, param->hSfn, mBuf);
+ //CMCHKPK(SPkU16, param->hSfn, mBuf);
RETVALUE(ROK);
}
TRC3(cmUnpkLteTimingInfo);
- CMCHKUNPK(SUnpkU16, ¶m->hSfn, mBuf);
+ //CMCHKUNPK(SUnpkU16, ¶m->hSfn, mBuf);
CMCHKUNPK(SUnpkU16, ¶m->sfn, mBuf);
- CMCHKUNPK(SUnpkU8, ¶m->subframe, mBuf);
+ CMCHKUNPK(SUnpkU8, ¶m->slot, mBuf);
RETVALUE(ROK);
}
/** @brief LTE Timing Info */
typedef struct cmLteTimingInfo
{
+#if 0
U16 hSfn; /*!< Hyper System Frame Number */
+#endif
U16 sfn; /*!< System Frame Number */
- U8 subframe; /*!< Subframe number */
+ U16 slot; /*!< Subframe number */
} CmLteTimingInfo;
/** @brief PDCP ID */
}
/* pack the transaction ID in CNF structure */
+ CMCHKPK(SPkU8, macCellCfgCfm->rsp, mBuf);
CMCHKPK(SPkU16, macCellCfgCfm->transId, mBuf);
RETVALUE(SPstTsk(pst,mBuf));
{
/* unpack the transaction ID in CNF structure */
CMCHKUNPK(SUnpkU16, &(macCellCfgCfm.transId), mBuf);
+ CMCHKUNPK(SUnpkU8, &(macCellCfgCfm.rsp), mBuf);
RETVALUE((*func)(&macCellCfgCfm));
}
typedef struct macCellCfgCfm
{
+ uint8_t rsp;
U16 transId;
}MacCellCfgCfm;
U16 packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
-EXTERN S16 MacHdlCellCfgReq
+EXTERN int MacHdlCellCfgReq
(
Pst *pst,
MacCellCfg *macCellCfg
RgMngmt *cfg /* Management Structure */
));
-typedef S16 (*LrgSchCfgReq) ARGS((
+typedef int (*LrgSchCfgReq) ARGS((
Pst *pst, /* Post Structure */
RgMngmt *cfg /* Management Structure */
));
* @param cfg pointer to RgMngmt
* @return ROK/RFAILED
*/
-EXTERN S16 HandleSchGenCfgReq ARGS((Pst *pst, RgMngmt *cfg));
+EXTERN int HandleSchGenCfgReq ARGS((Pst *pst, RgMngmt *cfg));
/** @brief This primitive carries the Confirmation for a Configuration Request
* sent from the layer manager to Scheduler.
--- /dev/null
+/* header include files (.h) */
+#include "envopt.h" /* environment options */
+#include "envdep.h" /* environment dependent */
+#include "envind.h" /* environment independent */
+#include "gen.h" /* general */
+#include "ssi.h" /* system services */
+#include "cm_tkns.h" /* Common Token Defines */
+#include "cm_llist.h" /* Common Link List Defines */
+#include "cm_hash.h" /* Common Hash List Defines */
+#include "cm_lte.h" /* Common LTE Defines */
+#include "cm_mblk.h" /* Common LTE Defines */
+#include "tfu.h" /* RGU Interface defines */
+#include "lrg.h"
+//#include "fapi.h"
+
+/* header/extern include files (.x) */
+#include "gen.x" /* general */
+#include "ssi.x" /* system services */
+#include "cm_tkns.x" /* Common Token Definitions */
+#include "cm_llist.x" /* Common Link List Definitions */
+#include "cm_lib.x" /* Common Library Definitions */
+#include "cm_hash.x" /* Common Hash List Definitions */
+#include "cm_lte.x" /* Common LTE Defines */
+#include "cm_mblk.x" /* Common LTE Defines */
+#include "tfu.x" /* RGU Interface includes */
+#include "lrg.x"
+
+#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+
+/**
+ * @brief function to send Slot ind message from MAC
+ * to scheduler with loose coupling
+ *
+ * @details
+ *
+ * Function : packMacSchSlotInd
+ *
+ *
+ * @param[in] Pst *pst, the post structure
+ * @param[in] *slotInd, the value of SFN and slot
+ * @return S16
+ * -# ROK
+ **/
+int packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd)
+{
+ Buffer *mBuf = NULLP;
+ if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ RETVALUE(RFAILED);
+ }
+
+ /* pack SFN and slot value */
+ CMCHKPK(SPkU16,slotInd->sfn, mBuf);
+ CMCHKPK(SPkU16,slotInd->slot, mBuf);
+
+ RETVALUE(SPstTsk(pst,mBuf));
+}
+
+/**
+ * @brief function to pack DL Broadcast allocation message
+ * from MAC to SCH
+ *
+ * @details
+ *
+ * Function : packSchMaccDlBrdcstAlloc
+ *
+ *
+ * @param[in] Pst *pst, the post structure
+ * @param[in] *dlBrdcstAlloc, dlBroadcastAlloc
+ * @return S16
+ * -# ROK
+ **/
+int packSchMacDlBrdcstAlloc(Pst *pst, DlBrdcstAlloc *dlBrdcstAlloc)
+{
+ return ROK;
+}
+
+/**
+ * @brief function to pack cell cfg from MAC to SCH
+ *
+ * @details
+ *
+ * Function : packSchCellCfg
+ *
+ *
+ * @param[in] Pst *pst, the post structure
+ * @param[in] *schCellCfg, SchCellCfg structure
+ * @return S16
+ * -# ROK
+ **/
+int packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg)
+{
+ return ROK;
+}
+
+/**
+ * @brief function to pack cell cfg cfm from SCH to MAC
+ *
+ * @details
+ *
+ * Function : packSchCellCfgCfm
+ *
+ *
+ * @param[in] Pst *pst, the post structure
+ * @param[in] *schCellCfgCfm, SchCellCfgCfm structure
+ * @return S16
+ * -# ROK
+ **/
+int packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm)
+{
+ return ROK;
+}
+
+
+/**********************************************************************
+ End of file
+ **********************************************************************/
+
--- /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. #
+################################################################################
+*******************************************************************************/
+
+/* events */
+#define EVENT_SCH_CELL_CFG 1
+#define EVENT_SCH_CELL_CFG_CFM 2
+
+/* selector */
+#define MAC_SCH_LC_SELECTOR 0
+#define MAC_SCH_TC_SELECTOR 1
+#define MAC_SCH_LWLC_SELECTOR 2
+
+/*macros*/
+#define NO_SSB 0
+#define SSB_TRANSMISSION 1
+#define SSB_REPEAT 2
+#define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
+
+/*structures*/
+
+
+typedef enum
+{
+ RSP_OK,
+ RSP_NOK
+}schMacRsp;
+
+typedef struct schCellCfg
+{
+ U16 cellId; /* Cell Id */
+ U16 phyCellId; /* Physical cell id */
+ U8 bandwidth; /* Supported B/W */
+ DuplexMode dupMode; /* Duplex type: TDD/FDD */
+ U32 ssbPbchPwr; /* SSB block power */
+ U8 scsCommon; /* subcarrier spacing for common [0-3]*/
+ U16 ssbOffsetPointA; /* SSB sub carrier offset from point A */
+ SSBPeriod ssbPeriod; /* SSB Periodicity in msec */
+ U8 ssbSubcOffset; /* Subcarrier Offset(Kssb) */
+ U32 nSSBMask[SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
+}SchCellCfg;
+
+typedef struct schCellCfgCfm
+{
+ U16 cellId; /* Cell Id */
+ schMacRsp rsp;
+}SchCellCfgCfm;
+
+typedef struct timeDomainAlloc
+{
+ uint16_t ssbStartSymbIdx;
+ uint16_t ssbSymbolDuration;
+}TimeDomainAlloc;
+
+typedef struct freqDomainAlloc
+{
+ uint16_t ssbStartPrbIdx;
+ uint16_t ssbPrbDuration;
+}FreqDomainAlloc;
+
+typedef struct ssbInfo
+{
+ uint8_t ssbIdx; /* SSB Index */
+ TimeDomainAlloc tdAlloc; /* Time domain allocation */
+ FreqDomainAlloc fdAlloc; /* Freq domain allocation */
+}SsbInfo;
+
+/* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
+typedef struct dlBrdcstAlloc
+{
+ uint16_t cellId; /* Cell Id */
+ SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
+ /* Ssb transmission is determined as follows:
+ * 0 : No tranamission
+ * 1 : SSB Transmission
+ * 2 : SSB Repetition */
+ uint8_t ssbTrans;
+ uint8_t ssbIdxSupported;
+ SsbInfo ssbInfo[MAX_SSB_IDX];
+ /* Sib1 transmission is determined as follows:
+ * 0 : No tranamission
+ * 1 : SIB1 Transmission
+ * 2 : SIB1 Repetition */
+ U8 sib1Trans;
+}DlBrdcstAlloc;
+
+/* function pointers */
+
+typedef int (*SchMacDlBrdcstAllocFunc) ARGS((
+ Pst *pst, /* Post Structure */
+ DlBrdcstAlloc *dlBrdcstAlloc /* slot ind Info */
+));
+
+typedef int (*SchCellCfgCfmFunc) ARGS((
+ Pst *pst, /* Post Structure */
+ SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
+));
+
+typedef int (*SchCellCfgFunc) ARGS((
+ Pst *pst, /* Post Structure */
+ SchCellCfg *schCellCfg /* Cell Cfg */
+));
+/* function declarations */
+int packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
+int packSchMacDlBrdcstAlloc(Pst *pst, DlBrdcstAlloc *dlBrdcstAlloc);
+EXTERN int packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
+EXTERN int packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
+
+EXTERN int MacProcDlBrdcstAlloc(Pst *pst, DlBrdcstAlloc *dlBrdcstAlloc);
+EXTERN int MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
+EXTERN int MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
+EXTERN int SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
+EXTERN int schActvInit(Ent entity, Inst instId, Region region, Reason reason);
+EXTERN S16 SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
+
+/**********************************************************************
+ End of file
+ **********************************************************************/
+
}
\f
-/***********************************************************
-*
-* Func : cmPkRgrCfgReq
-*
-*
-* Desc : Configuration Request from DU_APP to MAC for
-* configuring Cell/Ue/Lc
-*
-*
-* Ret : S16
-*
-* Notes:
-*
-* File :
-*
-**********************************************************/
-#ifdef ANSI
-PUBLIC S16 cmPkRgrCfgReq
-(
-Pst* pst,
-RgrCfgTransId transId,
-RgrCfgReqInfo * cfgReqInfo
-)
-#else
-PUBLIC S16 cmPkRgrCfgReq(pst, transId, cfgReqInfo)
-Pst* pst;
-RgrCfgTransId transId;
-RgrCfgReqInfo * cfgReqInfo;
-#endif
-{
- Buffer *mBuf = NULLP;
- TRC3(cmPkRgrCfgReq)
-
- if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGR016, (ErrVal)0, "Packing failed");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(RgrCfgReqInfo));
- RETVALUE(RFAILED);
- }
- if (cmPkRgrCfgReqInfo(cfgReqInfo, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGR017, (ErrVal)0, "Packing failed");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(RgrCfgReqInfo));
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
- if (cmPkRgrCfgTransId(&transId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGR018, (ErrVal)0, "Packing failed");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(RgrCfgReqInfo));
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
-#if 0
- if (SPkS16(spId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGR019, (ErrVal)0, "Packing failed");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(RgrCfgReqInfo));
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
-#endif
- if (SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(RgrCfgReqInfo)) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGR020, (ErrVal)0, "Packing failed");
-#endif
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
-
- pst->event = (Event) EVTMACSCHCFGREQ;
- RETVALUE(SPstTsk(pst,mBuf));
-}
-
-\f
/***********************************************************
*
* Func : cmUnpkRgrCfgReq
#define EVTRGRBNDREQ 1 /*!< Bind Request */
#define EVTRGRBNDCFM 2 /*!< Bind Confirm */
#define EVTRGRUBNDREQ 3 /*!< Unbind Request */
-#define EVTMACSCHCFGREQ 4 /*!< Configuration Request */
#define EVTMACSCHCFGCFM 5 /*!< Configuration Confirm */
/* rgr_h_001.main_2: Added TTI indication from MAC to RGR user */
/** @name RGR_RRM_TICK */
Pst* pst,
RgrCfgTransId transId,
RgrCfgReqInfo * cfgReqInfo));
+
+EXTERN S16 cmPkRgrCfgCfm ARGS((
+ Pst* pst,
+ RgrCfgTransId transId,
+ U8 status
+));
+
/** @brief Configuration confirm from MAC to RRM.
*
* @details This API confirms the RGR User about the status of the Configuration.
Reason reason
));
-/** @brief Configuration request from RRM to MAC for configuring Cell/UE/LC.
- *
- * @details This API is invoked by RRM towards MAC to configure MAC.
- * These API validates the Pst, spId, suId and transfers the config request
- * specific information to corresponding ownership module (GOM) API.
- *
- * @param[in] pst Pointer to a post structure.
- * @param[in] spId SAP Id of the Service Provider.
- * @param[in] transId MAC to RRM Transaction Id.
- * @param[in] cfgReqInfo Basic RGR configuration/reconfiguration info at RRM.
- * @return ROK/RFAILED
- */
-EXTERN S16 HandleSchCfgReq ARGS((
- Pst* pst,
- RgrCfgTransId transId,
- RgrCfgReqInfo * cfgReqInfo
-));
-
/** @brief Configuration Confirm from MAC to RRM.
*
* @details In this API crnti, preambleId, and
Buffer *mBuf
));
-EXTERN S16 cmPkRgrCfgCfm ARGS((
- Pst* pst,
- RgrCfgTransId transId,
- U8 status
-));
-
EXTERN S16 cmUnpkRgrCfgCfm ARGS((
RgrCfgCfm func,
Pst* pst,
Buffer *mBuf
));
-EXTERN S16 MacSchCfgReq ARGS((Pst *pst, RgrCfgTransId transId,
- RgrCfgReqInfo *cfgReqInfo));
#ifdef RLC_MAC_DAT_REQ_RBUF
EXTERN S16 rgDlDatReqBatchProc ARGS((
Void));
#include "cm_mblk.x" /* Common LTE Defines */
#include "tfu.x" /* RGU Interface includes */
+#include "du_app_mac_inf.h"
+//#include "mac_sch_interface.h"
+
#if (defined(LCTFU))
\f
}
}
- pst->event = (Event) EVTTFUTTIIND;
+ pst->event = (Event) EVENT_SLOT_IND_TO_MAC;
RETVALUE(SPstTsk(pst,mBuf));
}
\f
/***********************************************************
*
-* Func : cmUnpkTfuTtiInd
+* Func : cmUnpackSlotInd
*
*
* Desc : This API is the TTI indication from PHY to MAC .
* File :
*
**********************************************************/
-#ifdef ANSI
-PUBLIC S16 cmUnpkTfuTtiInd
+PUBLIC S16 cmUnpackSlotInd
(
TfuTtiInd func,
Pst *pst,
Buffer *mBuf
)
-#else
-PUBLIC S16 cmUnpkTfuTtiInd(func, pst, mBuf)
-TfuTtiInd func;
-Pst *pst;
-Buffer *mBuf;
-#endif
{
SuId suId;
- TfuTtiIndInfo *ttiInd;
+ SlotIndInfo *slotInd;
- TRC3(cmUnpkTfuTtiInd)
+ TRC3(cmUnpackSlotInd)
if (SUnpkS16(&suId, mBuf) != ROK) {
TFU_FREE_MSG(mBuf);
RETVALUE(RFAILED);
}
if (pst->selector != TFU_SEL_LWLC) {
- if ((SGetSBuf(pst->region, pst->pool, (Data **)&ttiInd, sizeof(TfuTtiIndInfo))) != ROK) {
+ if ((SGetSBuf(pst->region, pst->pool, (Data **)&slotInd, sizeof(SlotIndInfo))) != ROK) {
#if (ERRCLASS & ERRCLS_ADD_RES)
SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
if (pst->selector == TFU_SEL_LC)
{
- if (cmUnpkTfuTtiIndInfo(ttiInd, mBuf) != ROK) {
- SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
+ if (cmUnpackSlotIndInfo(slotInd, mBuf) != ROK) {
+ SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
TFU_FREE_MSG(mBuf);
#if (ERRCLASS & ERRCLS_ADD_RES)
SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
}
else if(pst->selector == TFU_SEL_LWLC)
{
- if (cmUnpkPtr((PTR *)&ttiInd, mBuf) != ROK)
+ if (cmUnpkPtr((PTR *)&slotInd, mBuf) != ROK)
{
#if (ERRCLASS & ERRCLS_ADD_RES)
SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
(ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
#endif
- SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
+ SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
TFU_FREE_MSG(mBuf);
RETVALUE(RFAILED);
}
}
TFU_FREE_MSG(mBuf);
- /* [ccpu00141698]-MOD- MAC/SCH does not free the TTI ind anymore */
- (*func)(pst, suId, ttiInd);
- SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
- RETVALUE((*func)(pst, suId, ttiInd));
+ RETVALUE((*func)(pst, slotInd));
}
#if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
/***********************************************************
*
-* Func : cmPkTfuSchTtiInd
+* Func : cmUnpackMacSchSlotInd
*
*
* Desc : This API is the TTI indication from PHY to scheduler.
* File :
*
**********************************************************/
-#ifdef ANSI
-PUBLIC S16 cmPkTfuSchTtiInd
+PUBLIC S16 cmUnpackMacSchSlotInd
(
-Pst * pst,
-SuId suId,
-TfuTtiIndInfo * ttiInd
-)
-#else
-PUBLIC S16 cmPkTfuSchTtiInd(pst, suId, ttiInd)
-Pst * pst;
-SuId suId;
-TfuTtiIndInfo * ttiInd;
-#endif
-{
- Buffer *mBuf = NULLP;
- TRC3(cmPkTfuSchTtiInd)
-
- if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ETFU112, (ErrVal)0, "Packing failed");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
- RETVALUE(RFAILED);
- }
- if (pst->selector == TFU_SEL_LC) {
- if (cmPkTfuTtiIndInfo(ttiInd, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ETFU113, (ErrVal)0, "Packing failed");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
- TFU_FREE_MSG(mBuf);
- RETVALUE(RFAILED);
- }
- }
- else if(pst->selector == TFU_SEL_LWLC)
- {
- if (cmPkPtr((PTR)ttiInd, mBuf) != ROK)
- {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
- TFU_FREE_MSG(mBuf);
- RETVALUE(RFAILED);
- }
- }
-
- if (SPkS16(suId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ETFU114, (ErrVal)0, "Packing failed");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
- TFU_FREE_MSG(mBuf);
- RETVALUE(RFAILED);
- }
- if (pst->selector != TFU_SEL_LWLC) {
- if (SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo)) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ETFU115, (ErrVal)0, "Packing failed");
-#endif
- TFU_FREE_MSG(mBuf);
- RETVALUE(RFAILED);
- }
- }
- pst->event = (Event) EVTTFUSCHTTIIND;
- RETVALUE(SPstTsk(pst,mBuf));
-}
-
-\f
-/***********************************************************
-*
-* Func : cmUnpkTfuSchTtiInd
-*
-*
-* Desc : This API is the TTI indication from PHY to scheduler.
- * @details This primitive provides the timing information (SFN and subframe)
- * which is currently running on the physical layer.
- * @param pst Pointer to the post structure.
- * @param suId SAP ID of the service user.
- * @param ttiInd Pointer to the TfuTtiIndInfo.
- * @return ROK/RFAILED
-*
-*
-* Ret : S16
-*
-* Notes:
-*
-* File :
-*
-**********************************************************/
-#ifdef ANSI
-PUBLIC S16 cmUnpkTfuSchTtiInd
-(
-TfuSchTtiInd func,
+MacSchSlotIndFunc func,
Pst *pst,
Buffer *mBuf
)
-#else
-PUBLIC S16 cmUnpkTfuSchTtiInd(func, pst, mBuf)
-TfuSchTtiInd func;
-Pst *pst;
-Buffer *mBuf;
-#endif
{
+#if 0
SuId suId;
- TfuTtiIndInfo *ttiInd;
+ SlotIndInfo *slotInd;
- TRC3(cmUnpkTfuSchTtiInd)
+ TRC3(cmUnpackMacSchSlotInd)
if (SUnpkS16(&suId, mBuf) != ROK) {
TFU_FREE_MSG(mBuf);
RETVALUE(RFAILED);
}
if (pst->selector != TFU_SEL_LWLC) {
- if ((SGetSBuf(pst->region, pst->pool, (Data **)&ttiInd, sizeof(TfuTtiIndInfo))) != ROK) {
+ if ((SGetSBuf(pst->region, pst->pool, (Data **)&slotInd, sizeof(SlotIndInfo))) != ROK) {
#if (ERRCLASS & ERRCLS_ADD_RES)
SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
if (pst->selector == TFU_SEL_LC)
{
- if (cmUnpkTfuTtiIndInfo(ttiInd, mBuf) != ROK) {
- SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
+ if (cmUnpackSlotIndInfo(slotInd, mBuf) != ROK) {
+ SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
TFU_FREE_MSG(mBuf);
#if (ERRCLASS & ERRCLS_ADD_RES)
SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
}
else if(pst->selector == TFU_SEL_LWLC)
{
- if (cmUnpkPtr((PTR *)&ttiInd, mBuf) != ROK)
+ if (cmUnpkPtr((PTR *)&slotInd, mBuf) != ROK)
{
#if (ERRCLASS & ERRCLS_ADD_RES)
SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
(ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
#endif
- SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
+ SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
TFU_FREE_MSG(mBuf);
RETVALUE(RFAILED);
}
}
TFU_FREE_MSG(mBuf);
/* [ccpu00141698]-MOD- MAC/SCH does not free the TTI ind anymore */
- (*func)(pst, suId, ttiInd);
- SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
-
+// (*func)(pst, suId, slotInd);
+ (*func)(pst, slotInd);
+ SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
RETVALUE(ROK);
+#endif
}
\f
\f
/***********************************************************
*
-* Func : cmUnpkTfuTtiIndInfo
+* Func : cmUnpackSlotIndInfo
*
*
-* Desc : This structure contains information that is passed as a part of the TTI
+* Desc : This structure contains information that is passed as a part of the Slot
* indication sent from PHY to MAC.
*
*
* File :
*
**********************************************************/
-#ifdef ANSI
-PUBLIC S16 cmUnpkTfuTtiIndInfo
+PUBLIC S16 cmUnpackSlotIndInfo
(
-TfuTtiIndInfo *param,
+SlotIndInfo *param,
Buffer *mBuf
)
-#else
-PUBLIC S16 cmUnpkTfuTtiIndInfo(param, mBuf)
-TfuTtiIndInfo *param;
-Buffer *mBuf;
-#endif
{
+ CMCHKUNPK(SUnpkU16, ¶m->sfn, mBuf);
+ CMCHKUNPK(SUnpkU16, ¶m->slot, mBuf);
- S32 i;
- TRC3(cmUnpkTfuTtiIndInfo)
-
- /* CA dev Start */
- CMCHKUNPK(SUnpkU8, ¶m->numCells, mBuf);
- for (i=0; i<(param->numCells); i++) {
- CMCHKUNPK(cmUnpkTfuTtiCellInfo, ¶m->cells[i], mBuf);
- }
- /* CA dev End */
RETVALUE(ROK);
}
#define TFU_MAX_HARQ_FDBKS TFU_MAX_TB /*For Rel8/Rel9 UE*/
#endif/*LTE_ADV*/
+/* Selector */
+#define MAC_SELECTOR_LC 0
+#define MAC_SELECTOR_TC 1
+#define MAC_SELECTOR_LWLC 2
+
/* Event corresponding to each primitive at this interface */
#define EVTTFUBNDREQ 1 /*!< Bind Request */
#define EVTTFUBNDCFM 2 /*!< Bind Confirm */
#define EVTTFUCRCIND 14 /*!< CRC indication. */
#define EVTTFUTIMINGADVIND 15 /*!< Timing advance indication.*/
#define EVTTFUDATREQ 16 /*!< Data Request.*/
-#define EVTTFUTTIIND 17 /*!< TTI indication.*/
-#define EVTTFUSCHTTIIND 18 /*!< TTI indication for scheduler.*/
+#define EVENT_SLOT_IND_TO_MAC 17 /*!< TTI indication.*/
+#define EVENT_SLOT_IND_TO_SCH 18 /*!< TTI indication for scheduler.*/
#define EVTTFUCNTRLREQ 19 /*!< Control Request.*/
#define EVTTFUPUCCHDELPWR 20 /*!< PUCCH Delta power. */
#define EVTTFUDOAIND 21 /*!< PUCCH Delta power. */
#define EVTTFUNONRTIND 24 /*!< Non-RT indication.*/
#endif
#define EVTTFUERRIND 25 /*!< TFU Error Indication */
+#define EVENT_DL_BRDCST_ALLOC 26 /*!< DL BROADCAST ALLOCATION */
/** @} */
/* selector(coupling) values */
} TfuDelDatReqInfo;
#endif
+typedef struct slotIndInfo
+{
+ U16 sfn;
+ U16 slot;
+}SlotIndInfo;
typedef S16 (*TfuBndReq) ARGS((
Pst* pst,
/* CA dev End */
typedef S16 (*TfuTtiInd) ARGS((
Pst * pst,
- SuId suId,
- TfuTtiIndInfo * ttiInd));
+ SlotIndInfo * slotInd));
#if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
typedef S16 (*TfuNonRtInd) ARGS((
typedef S16 (*TfuSchTtiInd) ARGS((
Pst * pst,
- SuId suId,
- TfuTtiIndInfo * ttiInd));
+// SuId suId,
+ SlotIndInfo* slotInd));
typedef S16 (*TfuPucchDeltaPwrInd) ARGS((
Pst * pst,
TfuDatIndInfo * datInd
));
+EXTERN S16 fapiMacSlotInd
+(
+Pst *pst,
+SlotIndInfo *slotInd
+);
+
EXTERN S16 RgLiTfuCrcInd ARGS((
Pst * pst,
SuId suId,
TfuTtiIndInfo * ttiInd
));
-EXTERN S16 RgLiTfuSchTtiInd ARGS((
+EXTERN int macSchSlotInd ARGS((
Pst * pst,
- SuId suId,
- TfuTtiIndInfo * ttiInd
+ SlotIndInfo * slotInd
));
#if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
));
/** @brief This API is the TTI indication from PHY to MAC.
*/
-EXTERN S16 cmUnpkTfuTtiInd ARGS((
+EXTERN S16 cmUnpackSlotInd ARGS((
TfuTtiInd func,
Pst * pst,
Buffer *mBuf
));
+typedef int (*MacSchSlotIndFunc) ARGS((
+ Pst *pst, /* Post Structure */
+ SlotIndInfo *slotInd /* slot ind Info */
+));
+
#if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
/** @brief This API is the non-rt indication from PHY to MAC.
*/
));
/** @brief This API is the TTI indication from PHY to SCH.
*/
-EXTERN S16 cmUnpkTfuSchTtiInd ARGS((
- TfuSchTtiInd func,
+EXTERN S16 cmUnpackMacSchSlotInd ARGS((
+ MacSchSlotIndFunc func,
Pst * pst,
Buffer *mBuf
));
TfuTtiIndInfo *param,
Buffer *mBuf
));
-EXTERN S16 cmUnpkTfuTtiIndInfo ARGS((
- TfuTtiIndInfo *param,
+EXTERN S16 cmUnpackSlotIndInfo ARGS((
+ SlotIndInfo *param,
Buffer *mBuf
));
EXTERN S16 cmPkTfuRaReqInfo ARGS((
#endif
-
#endif
/* LTE_UNLICENSED */
--- /dev/null
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "NR-RRC-Definitions"
+ * found in "../../mib_sib1.asn1"
+ * `asn1c -D ./mib_sib_out/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
+ */
+
+#include "BCCH-BCH-Message.h"
+
+static asn_TYPE_member_t asn_MBR_BCCH_BCH_Message_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct BCCH_BCH_Message, message),
+ (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ +1, /* EXPLICIT tag at current level */
+ &asn_DEF_BCCH_BCH_MessageType,
+ 0,
+ { 0, 0, 0 },
+ 0, 0, /* No default value */
+ "message"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_BCCH_BCH_Message_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_BCCH_BCH_Message_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* message */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_BCCH_BCH_Message_specs_1 = {
+ sizeof(struct BCCH_BCH_Message),
+ offsetof(struct BCCH_BCH_Message, _asn_ctx),
+ asn_MAP_BCCH_BCH_Message_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_BCCH_BCH_Message = {
+ "BCCH-BCH-Message",
+ "BCCH-BCH-Message",
+ &asn_OP_SEQUENCE,
+ asn_DEF_BCCH_BCH_Message_tags_1,
+ sizeof(asn_DEF_BCCH_BCH_Message_tags_1)
+ /sizeof(asn_DEF_BCCH_BCH_Message_tags_1[0]), /* 1 */
+ asn_DEF_BCCH_BCH_Message_tags_1, /* Same as above */
+ sizeof(asn_DEF_BCCH_BCH_Message_tags_1)
+ /sizeof(asn_DEF_BCCH_BCH_Message_tags_1[0]), /* 1 */
+ { 0, 0, SEQUENCE_constraint },
+ asn_MBR_BCCH_BCH_Message_1,
+ 1, /* Elements count */
+ &asn_SPC_BCCH_BCH_Message_specs_1 /* Additional specs */
+};
+
--- /dev/null
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "NR-RRC-Definitions"
+ * found in "../../mib_sib1.asn1"
+ * `asn1c -D ./mib_sib_out/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
+ */
+
+#ifndef _BCCH_BCH_Message_H_
+#define _BCCH_BCH_Message_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include "BCCH-BCH-MessageType.h"
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* BCCH-BCH-Message */
+typedef struct BCCH_BCH_Message {
+ BCCH_BCH_MessageType_t message;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} BCCH_BCH_Message_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_BCCH_BCH_Message;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _BCCH_BCH_Message_H_ */
+#include <asn_internal.h>
--- /dev/null
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "NR-RRC-Definitions"
+ * found in "../../mib_sib1.asn1"
+ * `asn1c -D ./mib_sib_out/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
+ */
+
+#include "BCCH-BCH-MessageType.h"
+
+#include "MIB.h"
+static asn_oer_constraints_t asn_OER_type_BCCH_BCH_MessageType_constr_1 CC_NOTUSED = {
+ { 0, 0 },
+ -1};
+asn_per_constraints_t asn_PER_type_BCCH_BCH_MessageType_constr_1 CC_NOTUSED = {
+ { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
+ { APC_UNCONSTRAINED, -1, -1, 0, 0 },
+ 0, 0 /* No PER value map */
+};
+static const ber_tlv_tag_t asn_DEF_messageClassExtension_tags_3[] = {
+ (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_SEQUENCE_specifics_t asn_SPC_messageClassExtension_specs_3 = {
+ sizeof(struct BCCH_BCH_MessageType__messageClassExtension),
+ offsetof(struct BCCH_BCH_MessageType__messageClassExtension, _asn_ctx),
+ 0, /* No top level tags */
+ 0, /* No tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* First extension addition */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_messageClassExtension_3 = {
+ "messageClassExtension",
+ "messageClassExtension",
+ &asn_OP_SEQUENCE,
+ asn_DEF_messageClassExtension_tags_3,
+ sizeof(asn_DEF_messageClassExtension_tags_3)
+ /sizeof(asn_DEF_messageClassExtension_tags_3[0]) - 1, /* 1 */
+ asn_DEF_messageClassExtension_tags_3, /* Same as above */
+ sizeof(asn_DEF_messageClassExtension_tags_3)
+ /sizeof(asn_DEF_messageClassExtension_tags_3[0]), /* 2 */
+ { 0, 0, SEQUENCE_constraint },
+ 0, 0, /* No members */
+ &asn_SPC_messageClassExtension_specs_3 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_BCCH_BCH_MessageType_1[] = {
+ { ATF_POINTER, 0, offsetof(struct BCCH_BCH_MessageType, choice.mib),
+ (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+ -1, /* IMPLICIT tag at current level */
+ &asn_DEF_MIB,
+ 0,
+ { 0, 0, 0 },
+ 0, 0, /* No default value */
+ "mib"
+ },
+ { ATF_POINTER, 0, offsetof(struct BCCH_BCH_MessageType, choice.messageClassExtension),
+ (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+ 0,
+ &asn_DEF_messageClassExtension_3,
+ 0,
+ { 0, 0, 0 },
+ 0, 0, /* No default value */
+ "messageClassExtension"
+ },
+};
+static const asn_TYPE_tag2member_t asn_MAP_BCCH_BCH_MessageType_tag2el_1[] = {
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* mib */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* messageClassExtension */
+};
+asn_CHOICE_specifics_t asn_SPC_BCCH_BCH_MessageType_specs_1 = {
+ sizeof(struct BCCH_BCH_MessageType),
+ offsetof(struct BCCH_BCH_MessageType, _asn_ctx),
+ offsetof(struct BCCH_BCH_MessageType, present),
+ sizeof(((struct BCCH_BCH_MessageType *)0)->present),
+ asn_MAP_BCCH_BCH_MessageType_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0,
+ -1 /* Extensions start */
+};
+asn_TYPE_descriptor_t asn_DEF_BCCH_BCH_MessageType = {
+ "BCCH-BCH-MessageType",
+ "BCCH-BCH-MessageType",
+ &asn_OP_CHOICE,
+ 0, /* No effective tags (pointer) */
+ 0, /* No effective tags (count) */
+ 0, /* No tags (pointer) */
+ 0, /* No tags (count) */
+ { &asn_OER_type_BCCH_BCH_MessageType_constr_1, &asn_PER_type_BCCH_BCH_MessageType_constr_1, CHOICE_constraint },
+ asn_MBR_BCCH_BCH_MessageType_1,
+ 2, /* Elements count */
+ &asn_SPC_BCCH_BCH_MessageType_specs_1 /* Additional specs */
+};
+
--- /dev/null
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "NR-RRC-Definitions"
+ * found in "../../mib_sib1.asn1"
+ * `asn1c -D ./mib_sib_out/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
+ */
+
+#ifndef _BCCH_BCH_MessageType_H_
+#define _BCCH_BCH_MessageType_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <constr_SEQUENCE.h>
+#include <constr_CHOICE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum BCCH_BCH_MessageType_PR {
+ BCCH_BCH_MessageType_PR_NOTHING, /* No components present */
+ BCCH_BCH_MessageType_PR_mib,
+ BCCH_BCH_MessageType_PR_messageClassExtension
+} BCCH_BCH_MessageType_PR;
+
+/* Forward declarations */
+struct MIB;
+
+/* BCCH-BCH-MessageType */
+typedef struct BCCH_BCH_MessageType {
+ BCCH_BCH_MessageType_PR present;
+ union BCCH_BCH_MessageType_u {
+ struct MIB *mib;
+ struct BCCH_BCH_MessageType__messageClassExtension {
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } *messageClassExtension;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} BCCH_BCH_MessageType_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_BCCH_BCH_MessageType;
+extern asn_CHOICE_specifics_t asn_SPC_BCCH_BCH_MessageType_specs_1;
+extern asn_TYPE_member_t asn_MBR_BCCH_BCH_MessageType_1[2];
+extern asn_per_constraints_t asn_PER_type_BCCH_BCH_MessageType_constr_1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _BCCH_BCH_MessageType_H_ */
+#include <asn_internal.h>
--- /dev/null
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ */
+
+#ifndef _ASN_CONSTANT_H
+#define _ASN_CONSTANT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define maxSIB (32)
+#define maxNrofPhysicalResourceBlocks (275)
+#define maxNrofPhysicalResourceBlocks_1 (274)
+#define maxNrofPhysicalResourceBlocksPlus1 (276)
+#define maxNR_NS_Pmax (8)
+#define maxNrofMultiBands (8)
+#define maxSCSs (5)
+#define maxPO_perPF (4)
+#define maxPLMN (12)
+#define maxSI_Message (32)
+#define maxCoReSetDuration (3)
+#define maxNrofSearchSpaces_1 (39)
+#define maxNrofControlResourceSets_1 (11)
+#define maxNrofTCI_StatesPDCCH (64)
+#define maxNrofDL_Allocations (16)
+#define maxNARFCN (3279165)
+#define maxNrofSlots (320)
+#define maxNrofSlots_1 (319)
+#define maxNrofSymbols_1 (13)
+#define maxNrofUL_Allocations (16)
+#define maxAccessCat_1 (63)
+#define maxBarringInfoSet (8)
+#define maxNrofTCI_States (128)
+#define maxNrofTCI_States_1 (127)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ASN_CONSTANT_H */
extern DuCfgParams duCfgParam;
-extern S16 cmPkRgrCfgReq(Pst* pst, RgrCfgTransId transId, \
- RgrCfgReqInfo *cfgReqInfo);
-
extern S16 duBuildAndSendMacCellCfg();
/*******************************************************************
return RFAILED;
}
}
-
return ret;
}
return ret;
}
-/******************************************************************
-*
-* @brief Send gNB cfg to scheduler via MAC
-*
-* @details
-*
-* Function : duSendSchGnbCfg
-*
-* Functionality: Send gNB cfg to scheduler via MAC
-*
-* @return ROK - success
-* RFAILED - failure
-*
-* ****************************************************************/
-S16 duSendSchGnbCfg()
-{
-
- RgrCfgReqInfo *cfgReq = NULLP;
- MacSchedGnbCfg *cfg = NULLP;
- U32 transId = 1;
-
- DU_ALLOC(cfgReq, sizeof(RgrCfgReqInfo));
- if( cfgReq == NULLP)
- {
- DU_LOG("\nDU_APP : Mem allocation failed in duSendSchGnbCfg");
- return RFAILED;
- }
-
- cfgReq->action = SCH_CONFIG;
- cfgReq->u.cfgInfo.cfgType = MAC_GNB_CFG;
- cfg = &(cfgReq->u.cfgInfo.u.schedGnbCfg);
- cfg->numTxAntPorts = duCfgParam.schedCfg.numTxAntPorts;
- cfg->ulSchdType = duCfgParam.schedCfg.ulSchdType;
- cfg->dlSchdType = duCfgParam.schedCfg.dlSchdType;
- cfg->numCells = duCfgParam.schedCfg.numCells;
- cfg->maxUlUePerTti = duCfgParam.schedCfg.maxUlUePerTti;
- cfg->maxDlUePerTti = duCfgParam.schedCfg.maxDlUePerTti;
-
- if(ROK != duSendSchGnbCfgToMac(cfgReq, transId))
- {
- return RFAILED;
- }
-
- return ROK;
-}
-
-/******************************************************************
-*
-* @brief Send gNB cfg to scheduler via MAC
-*
-* @details
-*
-* Function : duSendSchGnbCfgToMac
-*
-* Functionality: Send gNB cfg to scheduler via MAC
-*
-* @return ROK - success
-* RFAILED - failure
-*
-* ****************************************************************/
-S16 duSendSchGnbCfgToMac(RgrCfgReqInfo *cfgReq, U32 trans_id)
-{
- RgrCfgTransId transId;
- Pst pst;
-
- DU_SET_ZERO(&pst, sizeof(Pst));
- DU_SET_ZERO(&transId, sizeof(RgrCfgTransId));
-
- transId.trans[0] = MAC_GNB_CFG;
- transId.trans[1] = cfgReq->action;
- transId.trans[7] = trans_id & 0x000000ff; trans_id >>= 8;
- transId.trans[6] = trans_id & 0x000000ff; trans_id >>= 8;
- transId.trans[5] = trans_id & 0x000000ff; trans_id >>= 8;
- transId.trans[4] = trans_id & 0x000000ff; trans_id >>= 8;
-
- pst.selector = DU_SELECTOR_LC;
- pst.srcEnt = ENTDUAPP;
- pst.dstEnt = ENTRG;
- pst.dstInst = (Inst)0;
- pst.dstProcId = DU_PROC;
- pst.srcProcId = DU_PROC;
- pst.region = duCb.init.region;
- pst.event = (Event) EVTMACSCHCFGREQ;
-
- cmPkRgrCfgReq(&pst, transId, cfgReq);
-
- return ROK;
-}
-
/**********************************************************************
End of file
**********************************************************************/
/* This file contains all utility functions */
#include "du_mgr.h"
+#include "du_sys_info_hdl.h"
#include "MIB.h"
#include "PLMN-IdentityInfo.h"
#include "odu_common_codec.h"
/* DL carrier configuration */
duCfgParam.macCellCfg.dlCarrCfg.pres = TRUE;
- duCfgParam.macCellCfg.dlCarrCfg.bw = SUL_ARFCN;
+ duCfgParam.macCellCfg.dlCarrCfg.bw = BANDWIDTH;
duCfgParam.macCellCfg.dlCarrCfg.freq = NR_ARFCN;
duCfgParam.macCellCfg.dlCarrCfg.k0[0] = 1;
duCfgParam.macCellCfg.dlCarrCfg.k0[1] = 1;
duCfgParam.macCellCfg.ssbCfg.betaPss = BETA_PSS;
duCfgParam.macCellCfg.ssbCfg.ssbPeriod = SSB_PERIODICITTY;
duCfgParam.macCellCfg.ssbCfg.ssbScOffset = SSB_SUBCARRIER_OFFSET;
- duCfgParam.macCellCfg.ssbCfg.mibPdu[0] = 0x01;
- duCfgParam.macCellCfg.ssbCfg.mibPdu[1] = 0x01;
- duCfgParam.macCellCfg.ssbCfg.mibPdu[2] = 0x84;
duCfgParam.macCellCfg.ssbCfg.ssbMask[0] = 1; /* only one SSB is transmitted */
duCfgParam.macCellCfg.ssbCfg.ssbMask[1] = 0;
+ if(BuildMibPdu() != ROK)
+ {
+ DU_LOG("\nFailed to build MIB PDU");
+ memset(&duCfgParam.macCellCfg.ssbCfg.mibPdu, 0, 3*sizeof(uint8_t));
+ }
+ else
+ {
+ for(uint8_t idx=0; idx<encBufSize; idx++)
+ {
+ duCfgParam.macCellCfg.ssbCfg.mibPdu[idx]=encBuf[idx];
+ }
+ }
duCfgParam.macCellCfg.ssbCfg.multCarrBand = SSB_MULT_CARRIER_BAND;
duCfgParam.macCellCfg.ssbCfg.multCellCarr = MULT_CELL_CARRIER;
}
/*******************************************************************
- *
- * @brief Configures the DU Parameters
- *
- * @details
- *
- * Function : fillDuPort
- *
- * Functionality:
- * - fills the DU Ports.
- *
- * @params[in] duPort array to be filled
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-
+*
+* @brief Configures the DU Parameters
+*
+* @details
+*
+* Function : fillDuPort
+*
+* Functionality:
+* - fills the DU Ports.
+*
+* @params[in] duPort array to be filled
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
S16 fillDuPort(U16 *duPort)
{
- duPort[F1_INTERFACE] = DU_PORT; /* DU Port idx 0 38472 */
- duPort[E2_INTERFACE] = RIC_PORT; /* RIC Port idx 1 38482 */
+ duPort[F1_INTERFACE] = DU_PORT; /* DU Port idx 0 38472 */
+ duPort[E2_INTERFACE] = RIC_PORT; /* RIC Port idx 1 38482 */
- RETVALUE(ROK);
+ RETVALUE(ROK);
}
+
+
/*******************************************************************
*
* @brief Configures the DU Parameters
cmInetAddr((S8*)DU_IP_V4_ADDR, &ipv4_du);
cmInetAddr((S8*)CU_IP_V4_ADDR, &ipv4_cu);
- cmInetAddr((S8*)RIC_IP_V4_ADDR, &ipv4_ric);
- fillDuPort(duCfgParam.sctpParams.duPort);
+ cmInetAddr((S8*)RIC_IP_V4_ADDR, &ipv4_ric);
+ fillDuPort(duCfgParam.sctpParams.duPort);
/* F1 DU IP Address and Port*/
duCfgParam.sctpParams.duIpAddr.ipV4Addr = ipv4_du;
duCfgParam.sctpParams.cuIpAddr.ipV4Addr = ipv4_cu;
duCfgParam.sctpParams.cuPort = CU_PORT;
- /* Fill RIC Params */
- duCfgParam.sctpParams.ricIpAddr.ipV4Addr = ipv4_ric;
- duCfgParam.sctpParams.ricPort = RIC_PORT;
-
-
+ /* Fill RIC Params */
+ duCfgParam.sctpParams.ricIpAddr.ipV4Addr = ipv4_ric;
+ duCfgParam.sctpParams.ricPort = RIC_PORT;
/* EGTP Parameters */
duCfgParam.egtpParams.localIp.ipV4Pres = TRUE;
duCfgParam.egtpParams.localIp.ipV4Addr = ipv4_du;
sib1.tac = DU_TAC;
sib1.ranac = DU_RANAC;
sib1.cellIdentity = CELL_IDENTITY;
- sib1.cellResvdForOpUse =\
+ sib1.cellResvdForOpUse =
PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
duCfgParam.sib1Params = sib1;
* ****************************************************************/
S16 bitStringToInt(BIT_STRING_t *bitString, U16 *val)
{
- U16 numOctets, idx;
+ U16 idx;
if(bitString->buf == NULL || bitString->size <= 0)
{
DU_LOG("\nDU_APP : Bit string is empty");
return RFAILED;
}
- for(idx=0; idx<bitString->size-1; idx++)
+ for(idx=0; idx< bitString->size-1; idx++)
{
*val |= bitString->buf[idx];
*val <<= 8;
}
*val |= bitString->buf[idx];
- *val >>= bitString->bits_unused;
+ *val >>= bitString->bits_unused;
return ROK;
}
#define NR_CELL_ID 1
#define DU_NAME "ORAN_OAM_DU"
#define CELL_TYPE SMALL
-#define DUPLEX_MODE DUP_MODE_TDD
+#define DUPLEX_MODE DUP_MODE_FDD
#define DU_TAC 1
#define PLMN_MCC0 3
#define PLMN_MCC1 1
#define FREQ_SHIFT_7P5KHZ FALSE
#define SSB_PBCH_PWR 0
#define BCH_PAYLOAD MAC_GEN_FULL_PBCH_PAYLD
-#define SUBCARRIER_SPACING 3
+#define SUBCARRIER_SPACING 15
#define OFFSET_TO_POINT_A 0
#define BETA_PSS BETA_PSS_0DB
-#define SSB_PERIODICITTY SSB_PRDCTY_MS_20
+#define SSB_PERIODICITTY 20
#define SSB_SUBCARRIER_OFFSET 0
#define SSB_MULT_CARRIER_BAND FALSE
#define MULT_CELL_CARRIER FALSE
+#define BANDWIDTH 20
#define PRACH_SEQ_LEN SHORT_SEQUENCE
#define PRACH_SUBCARRIER_SPACING 3
{
S16 ret = ROK;
- if(macCellCfgCfm->transId == duCb.duMacCellCfg->transId)
- {
- /* free the memory allocated during sending macCellCfg request */
- DU_FREE(duCb.duMacCellCfg,sizeof(MacCellCfg));
- duCb.duMacCellCfg = NULLP;
- DU_LOG("\nDU-APP : MAC CELL config confirm recieved\n");
-
-
- /* Build and send GNB-DU config update */
- ret = BuildAndSendDUConfigUpdate();
- }
- else
- {
- /* transaction ID missmatch */
- DU_LOG("\n transaction ID mismatch in macCellCfg");
- ret = RFAILED;
- }
-
+ if(macCellCfgCfm->rsp == ROK)
+ {
+ if(macCellCfgCfm->transId == duCb.duMacCellCfg->transId)
+ {
+ /* free the memory allocated during sending macCellCfg request */
+ DU_FREE(duCb.duMacCellCfg,sizeof(MacCellCfg));
+ duCb.duMacCellCfg = NULLP;
+
+ /* Build and send GNB-DU config update */
+ ret = BuildAndSendDUConfigUpdate();
+ }
+ else
+ {
+ /* transaction ID missmatch */
+ DU_LOG("\n transaction ID mismatch in macCellCfg");
+ ret = RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("\nMac cell cfg failed");
+ ret = RFAILED;
+ }
return ret;
}
/* This file contains ASN codec for MIB and SIB1 msgs */
-#include "du_sys_info_hdl.h"
+#include "du_mgr.h"
+#include "du_log.h"
+#include "BCCH-BCH-Message.h"
#include "MIB.h"
#include "SIB1.h"
#include "PLMN-IdentityInfo.h"
#include "PLMN-IdentitY.h"
#include "MCC.h"
+#include "du_sys_info_hdl.h"
extern char encBuf[ENC_BUF_MAX_LEN];
/*******************************************************************
*
- * @brief Builds MIB message in Served Cell Info
+ * @brief Builds MIB
*
* @details
*
- * Function : BuildMibMsg
+ * Function : BuildMib
*
- * Functionality: Building MIB message in Served Cell Info
+ * Functionality: Building MIB
*
- * @params[in] GNB_DU_System_Information *gnbDuSysInfo
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-S16 BuildMibMsg()
+int BuildMib(MIB_t *mib)
{
- MIB_t *mibMsg;
- asn_enc_rval_t encRetVal; /* Encoder return value */
-
- DU_ALLOC(mibMsg, sizeof(MIB_t));
- if(!mibMsg)
- {
- DU_LOG("DU APP: MIB msg memory allocation failure");
- return RFAILED;
- }
- mibMsg->systemFrameNumber.size = sizeof(uint8_t);
- DU_ALLOC(mibMsg->systemFrameNumber.buf,
- mibMsg->systemFrameNumber.size);
- if(!(mibMsg->systemFrameNumber.buf))
+ mib->systemFrameNumber.size = sizeof(uint8_t);
+ DU_ALLOC(mib->systemFrameNumber.buf,
+ mib->systemFrameNumber.size);
+ if(!(mib->systemFrameNumber.buf))
{
DU_LOG("DU APP: MIB msg memory allocation failure");
return RFAILED;
}
- *(mibMsg->systemFrameNumber.buf) =
+ *(mib->systemFrameNumber.buf) =
duCfgParam.mibParams.sysFrmNum;
- mibMsg->systemFrameNumber.bits_unused = ODU_VALUE_TWO;
+ mib->systemFrameNumber.bits_unused = ODU_VALUE_TWO;
- mibMsg->subCarrierSpacingCommon =\
+ mib->subCarrierSpacingCommon =\
duCfgParam.mibParams.subCarrierSpacingCommon;
- mibMsg->ssb_SubcarrierOffset =\
+ mib->ssb_SubcarrierOffset =\
duCfgParam.mibParams.ssb_SubcarrierOffset;
- mibMsg->dmrs_TypeA_Position =\
+ mib->dmrs_TypeA_Position =\
duCfgParam.mibParams.dmrs_TypeA_Position;
- mibMsg->pdcch_ConfigSIB1.controlResourceSetZero = \
+ mib->pdcch_ConfigSIB1.controlResourceSetZero = \
duCfgParam.mibParams.controlResourceSetZero;
- mibMsg->pdcch_ConfigSIB1.searchSpaceZero = \
+ mib->pdcch_ConfigSIB1.searchSpaceZero = \
duCfgParam.mibParams.searchSpaceZero;
- mibMsg->cellBarred = duCfgParam.mibParams.cellBarred;
- mibMsg->intraFreqReselection =
+ mib->cellBarred = duCfgParam.mibParams.cellBarred;
+ mib->intraFreqReselection =
duCfgParam.mibParams.intraFreqReselection;
- mibMsg->spare.size = sizeof(uint8_t);
- DU_ALLOC(mibMsg->spare.buf,sizeof(uint8_t));
- if(!mibMsg->spare.buf)
+ mib->spare.size = sizeof(uint8_t);
+ DU_ALLOC(mib->spare.buf,sizeof(uint8_t));
+ if(!mib->spare.buf)
+ {
+ DU_LOG("DU APP: MIB msg memory allocation failure");
+ return RFAILED;
+ }
+ *(mib->spare.buf) = SPARE;
+ mib->spare.bits_unused = ODU_VALUE_SEVEN;
+ return ROK;
+}
+/*******************************************************************
+ *
+ * @brief Builds MIB PDU for broadcast
+ *
+ * @details
+ *
+ * Function : BuildMibPdu
+ *
+ * Functionality: Building MIB PDU for system broadcast
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+int BuildMibPdu()
+{
+ BCCH_BCH_Message_t *bcchMsg;
+ asn_enc_rval_t encRetVal; /* Encoder return value */
+
+ DU_ALLOC(bcchMsg, sizeof(BCCH_BCH_Message_t));
+ if(!bcchMsg)
+ {
+ DU_LOG("\nMemory allocation failure in BuildMibPdu");
+ return RFAILED;
+ }
+
+ bcchMsg->message.present = BCCH_BCH_MessageType_PR_mib;
+ DU_ALLOC(bcchMsg->message.choice.mib, sizeof(MIB_t));
+ if(!bcchMsg->message.choice.mib)
+ {
+ DU_LOG("\nMemory allocation failure in BuildMibPdu");
+ return RFAILED;
+ }
+ BuildMib(bcchMsg->message.choice.mib);
+ xer_fprint(stdout, &asn_DEF_BCCH_BCH_Message, bcchMsg);
+ cmMemset((U8 *)encBuf, 0, ENC_BUF_MAX_LEN);
+ encBufSize = 0;
+ encRetVal = aper_encode(&asn_DEF_BCCH_BCH_Message, 0,
+ bcchMsg, PrepFinalEncBuf, encBuf);
+ printf("\nencbufSize:%d\n", encBufSize);
+ if(encRetVal.encoded == -1)
+ {
+ DU_LOG("\nDU APP: Could not encode BCCH BCH Message Type structure(at %s)\n",
+ encRetVal.failed_type?\
+ encRetVal.failed_type->name
+ :"unknown");
+ return RFAILED;
+ }
+
+ /* Print encoded buffer */
+ for(int i=0; i< encBufSize; i++)
+ {
+ printf("%x\t",encBuf[i]);
+ }
+ printf("\n");
+
+ /* Free allocated memory */
+ DU_FREE(bcchMsg->message.choice.mib->systemFrameNumber.buf,
+ bcchMsg->message.choice.mib->systemFrameNumber.size);
+ DU_FREE(bcchMsg->message.choice.mib->spare.buf,
+ bcchMsg->message.choice.mib->spare.size);
+ DU_FREE(bcchMsg->message.choice.mib, sizeof(MIB_t));
+ DU_FREE(bcchMsg, sizeof(BCCH_BCH_MessageType_t));
+
+ return ROK;
+
+}
+/*******************************************************************
+ *
+ * @brief Builds MIB message in Served Cell Info
+ *
+ * @details
+ *
+ * Function : BuildMibMsg
+ *
+ * Functionality: Building MIB message in Served Cell Info
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+int BuildMibMsg()
+{
+ MIB_t *mibMsg;
+ asn_enc_rval_t encRetVal; /* Encoder return value */
+
+ DU_ALLOC(mibMsg, sizeof(MIB_t));
+ if(!mibMsg)
{
DU_LOG("DU APP: MIB msg memory allocation failure");
return RFAILED;
}
- *(mibMsg->spare.buf) = SPARE;
- mibMsg->spare.bits_unused = ODU_VALUE_SEVEN;
+ BuildMib(mibMsg);
xer_fprint(stdout, &asn_DEF_MIB, mibMsg);
cmMemset((U8 *)encBuf, 0, ENC_BUF_MAX_LEN);
* RFAILED - failure
*
* ****************************************************************/
-S16 BuildCellIdentity(CellIdentity_t *cellIdentity)
+int BuildCellIdentity(CellIdentity_t *cellIdentity)
{
cellIdentity->size = ODU_VALUE_FIVE*sizeof(uint8_t);
cellIdentity->bits_unused = ODU_VALUE_FOUR;
* RFAILED - failure
*
* ****************************************************************/
-S16 BuildRanac(RAN_AreaCode_t **ranAreaCode)
+int BuildRanac(RAN_AreaCode_t **ranAreaCode)
{
RAN_AreaCode_t *ranac;
DU_ALLOC(ranac, sizeof(RAN_AreaCode_t));
* RFAILED - failure
*
* ****************************************************************/
-S16 BuildTac(TrackingAreaCode_t **trackAreaCode)
+int BuildTac(TrackingAreaCode_t **trackAreaCode)
{
TrackingAreaCode_t *tac;
* RFAILED - failure
*
* ****************************************************************/
-S16 BuildPlmnList(CellAccessRelatedInfo_t *cellAccessInfo)
+int BuildPlmnList(CellAccessRelatedInfo_t *cellAccessInfo)
{
U8 idx, idx1, idx2;
U8 elementCnt;
*
* Functionality: Building SIB message in Served Cell Info
*
- * @params[in] GNB_DU_System_Information *gnbDuSysInfo
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-S16 BuildSib1Msg()
+int BuildSib1Msg()
{
SIB1_t *sib1Msg;
CellAccessRelatedInfo_t *cellAccessInfo;
################################################################################
*******************************************************************************/
-#include "du_mgr.h"
-#include "du_log.h"
#include "odu_common_codec.h"
/* Macros */
#define ODU_VALUE_SEVEN 7
/* Function declarations */
-S16 BuildMibMsg();
-S16 BuildSib1Msg();
+int BuildMibPdu();
+int BuildMibMsg();
+int BuildSib1Msg();
/**********************************************************************
End of file