{
GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
/* consider phy delay */
- ADD_DELTA_TO_TIME(currTimingInfo,dlTtiReqTimingInfo,PHY_DELTA_DL, macCb.macCell[cellIdx]->numOfSlots);
+ ADD_DELTA_TO_TIME(currTimingInfo,dlTtiReqTimingInfo,gConfigInfo.gPhyDeltaDl, macCb.macCell[cellIdx]->numOfSlots);
dlTtiReqTimingInfo.cellId = currTimingInfo.cellId;
macCellCfg = macCb.macCell[cellIdx]->macCellCfg;
#ifdef INTEL_FAPI
uint8_t getnPdus(fapi_ul_tti_req_t *ulTtiReq, MacUlSlot *currUlSlot)
{
- uint8_t pduCount = 0;
+ uint8_t pduCount = 0, ueIdx = 0;
if(ulTtiReq && currUlSlot)
{
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PRACH)
+ if(currUlSlot->ulSchInfo.dataType & SCH_DATATYPE_PRACH)
{
- pduCount++;
- ulTtiReq->rachPresent++;
+ pduCount++;
}
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PUSCH)
- {
- pduCount++;
- ulTtiReq->nUlsch++;
- }
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PUSCH_UCI)
- {
- pduCount++;
- ulTtiReq->nUlsch++;
- }
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_UCI)
+
+ for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
{
- pduCount++;
- ulTtiReq->nUlcch++;
+ if(currUlSlot->ulSchInfo.dataType & SCH_DATATYPE_PUSCH)
+ {
+ if(currUlSlot->ulSchInfo.schPuschInfo[ueIdx].crnti != 0)
+ {
+ pduCount++;
+ }
+ }
+ if(currUlSlot->ulSchInfo.dataType & SCH_DATATYPE_PUSCH_UCI)
+ {
+ if(currUlSlot->ulSchInfo.schPuschUci[ueIdx].crnti != 0)
+ {
+ pduCount++;
+ }
+ }
+ if(currUlSlot->ulSchInfo.dataType & SCH_DATATYPE_UCI)
+ {
+ if(currUlSlot->ulSchInfo.schPucchInfo[ueIdx].crnti != 0)
+ {
+ pduCount++;
+ }
+ }
}
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_SRS)
+ if(currUlSlot->ulSchInfo.dataType & SCH_DATATYPE_SRS)
{
- pduCount++;
+ pduCount++;
}
}
return pduCount;
ulTtiReqPdu->pduType = PRACH_PDU_TYPE;
ulTtiReqPdu->pdu.prach_pdu.physCellId = macCellCfg->cellCfg.phyCellId;
ulTtiReqPdu->pdu.prach_pdu.numPrachOcas = \
- currUlSlot->ulInfo.prachSchInfo.numPrachOcas;
+ currUlSlot->ulSchInfo.prachSchInfo.numPrachOcas;
ulTtiReqPdu->pdu.prach_pdu.prachFormat = \
- currUlSlot->ulInfo.prachSchInfo.prachFormat;
- ulTtiReqPdu->pdu.prach_pdu.numRa = currUlSlot->ulInfo.prachSchInfo.numRa;
+ currUlSlot->ulSchInfo.prachSchInfo.prachFormat;
+ ulTtiReqPdu->pdu.prach_pdu.numRa = currUlSlot->ulSchInfo.prachSchInfo.numRa;
ulTtiReqPdu->pdu.prach_pdu.prachStartSymbol = \
- currUlSlot->ulInfo.prachSchInfo.prachStartSymb;
+ currUlSlot->ulSchInfo.prachSchInfo.prachStartSymb;
setNumCs(&ulTtiReqPdu->pdu.prach_pdu.numCs, macCellCfg);
ulTtiReqPdu->pdu.prach_pdu.beamforming.numPrgs = 0;
ulTtiReqPdu->pdu.prach_pdu.beamforming.prgSize = 0;
* RFAILED - failure
*
* ****************************************************************/
- void fillPuschPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, fapi_vendor_ul_tti_req_pdu_t *ulTtiVendorPdu, MacCellCfg *macCellCfg, MacUlSlot *currUlSlot)
+ void fillPuschPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, fapi_vendor_ul_tti_req_pdu_t *ulTtiVendorPdu, MacCellCfg *macCellCfg,\
+ SchPuschInfo *puschInfo)
{
if(ulTtiReqPdu != NULLP)
{
ulTtiReqPdu->pduType = PUSCH_PDU_TYPE;
memset(&ulTtiReqPdu->pdu.pusch_pdu, 0, sizeof(fapi_ul_pusch_pdu_t));
ulTtiReqPdu->pdu.pusch_pdu.pduBitMap = 1;
- ulTtiReqPdu->pdu.pusch_pdu.rnti = currUlSlot->ulInfo.crnti;
+ ulTtiReqPdu->pdu.pusch_pdu.rnti = puschInfo->crnti;
/* TODO : Fill handle in raCb when scheduling pusch and access here */
ulTtiReqPdu->pdu.pusch_pdu.handle = 100;
ulTtiReqPdu->pdu.pusch_pdu.bwpSize = macCellCfg->cellCfg.initialUlBwp.bwp.numPrb;
ulTtiReqPdu->pdu.pusch_pdu.cyclicPrefix = \
macCellCfg->cellCfg.initialUlBwp.bwp.cyclicPrefix;
ulTtiReqPdu->pdu.pusch_pdu.targetCodeRate = 308;
- ulTtiReqPdu->pdu.pusch_pdu.qamModOrder = currUlSlot->ulInfo.schPuschInfo.tbInfo.qamOrder;
- ulTtiReqPdu->pdu.pusch_pdu.mcsIndex = currUlSlot->ulInfo.schPuschInfo.tbInfo.mcs;
- ulTtiReqPdu->pdu.pusch_pdu.mcsTable = currUlSlot->ulInfo.schPuschInfo.tbInfo.mcsTable;
+ ulTtiReqPdu->pdu.pusch_pdu.qamModOrder = puschInfo->tbInfo.qamOrder;
+ ulTtiReqPdu->pdu.pusch_pdu.mcsIndex = puschInfo->tbInfo.mcs;
+ ulTtiReqPdu->pdu.pusch_pdu.mcsTable = puschInfo->tbInfo.mcsTable;
ulTtiReqPdu->pdu.pusch_pdu.transformPrecoding = 1;
- ulTtiReqPdu->pdu.pusch_pdu.dataScramblingId = currUlSlot->ulInfo.cellId;
+ ulTtiReqPdu->pdu.pusch_pdu.dataScramblingId = macCellCfg->cellId;
ulTtiReqPdu->pdu.pusch_pdu.nrOfLayers = 1;
ulTtiReqPdu->pdu.pusch_pdu.ulDmrsSymbPos = 4;
ulTtiReqPdu->pdu.pusch_pdu.dmrsConfigType = 0;
- ulTtiReqPdu->pdu.pusch_pdu.ulDmrsScramblingId = currUlSlot->ulInfo.cellId;
+ ulTtiReqPdu->pdu.pusch_pdu.ulDmrsScramblingId = macCellCfg->cellId;
ulTtiReqPdu->pdu.pusch_pdu.scid = 0;
ulTtiReqPdu->pdu.pusch_pdu.numDmrsCdmGrpsNoData = 1;
ulTtiReqPdu->pdu.pusch_pdu.dmrsPorts = 0;
ulTtiReqPdu->pdu.pusch_pdu.resourceAlloc = \
- currUlSlot->ulInfo.schPuschInfo.fdAlloc.resAllocType;
+ puschInfo->fdAlloc.resAllocType;
ulTtiReqPdu->pdu.pusch_pdu.rbStart = \
- currUlSlot->ulInfo.schPuschInfo.fdAlloc.resAlloc.type1.startPrb;
+ puschInfo->fdAlloc.resAlloc.type1.startPrb;
ulTtiReqPdu->pdu.pusch_pdu.rbSize = \
- currUlSlot->ulInfo.schPuschInfo.fdAlloc.resAlloc.type1.numPrb;
+ puschInfo->fdAlloc.resAlloc.type1.numPrb;
ulTtiReqPdu->pdu.pusch_pdu.vrbToPrbMapping = 0;
ulTtiReqPdu->pdu.pusch_pdu.frequencyHopping = 0;
ulTtiReqPdu->pdu.pusch_pdu.txDirectCurrentLocation = 0;
ulTtiReqPdu->pdu.pusch_pdu.uplinkFrequencyShift7p5khz = 0;
ulTtiReqPdu->pdu.pusch_pdu.startSymbIndex = \
- currUlSlot->ulInfo.schPuschInfo.tdAlloc.startSymb;
+ puschInfo->tdAlloc.startSymb;
ulTtiReqPdu->pdu.pusch_pdu.nrOfSymbols = \
- currUlSlot->ulInfo.schPuschInfo.tdAlloc.numSymb;
+ puschInfo->tdAlloc.numSymb;
#ifdef INTEL_FAPI
ulTtiReqPdu->pdu.pusch_pdu.mappingType = \
- currUlSlot->ulInfo.schPuschInfo.dmrsMappingType;
+ puschInfo->dmrsMappingType;
ulTtiReqPdu->pdu.pusch_pdu.nrOfDmrsSymbols = \
- currUlSlot->ulInfo.schPuschInfo.nrOfDmrsSymbols;
+ puschInfo->nrOfDmrsSymbols;
ulTtiReqPdu->pdu.pusch_pdu.dmrsAddPos = \
- currUlSlot->ulInfo.schPuschInfo.dmrsAddPos;
+ puschInfo->dmrsAddPos;
#endif
ulTtiReqPdu->pdu.pusch_pdu.puschData.rvIndex = \
- currUlSlot->ulInfo.schPuschInfo.tbInfo.rv;
+ puschInfo->tbInfo.rv;
ulTtiReqPdu->pdu.pusch_pdu.puschData.harqProcessId = \
- currUlSlot->ulInfo.schPuschInfo.harqProcId;
+ puschInfo->harqProcId;
ulTtiReqPdu->pdu.pusch_pdu.puschData.newDataIndicator = \
- currUlSlot->ulInfo.schPuschInfo.tbInfo.ndi;
+ puschInfo->tbInfo.ndi;
ulTtiReqPdu->pdu.pusch_pdu.puschData.tbSize = \
- currUlSlot->ulInfo.schPuschInfo.tbInfo.tbSize;
+ puschInfo->tbInfo.tbSize;
/* numCb is 0 for new transmission */
ulTtiReqPdu->pdu.pusch_pdu.puschData.numCb = 0;
*
* ****************************************************************/
void fillPucchPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, fapi_vendor_ul_tti_req_pdu_t *ulTtiVendorPdu, MacCellCfg *macCellCfg,\
- MacUlSlot *currUlSlot)
+ SchPucchInfo *pucchInfo)
{
if(ulTtiReqPdu != NULLP)
{
ulTtiReqPdu->pduType = PUCCH_PDU_TYPE;
memset(&ulTtiReqPdu->pdu.pucch_pdu, 0, sizeof(fapi_ul_pucch_pdu_t));
- ulTtiReqPdu->pdu.pucch_pdu.rnti = currUlSlot->ulInfo.crnti;
+ ulTtiReqPdu->pdu.pucch_pdu.rnti = pucchInfo->crnti;
/* TODO : Fill handle in raCb when scheduling pucch and access here */
ulTtiReqPdu->pdu.pucch_pdu.handle = 100;
ulTtiReqPdu->pdu.pucch_pdu.bwpSize = macCellCfg->cellCfg.initialUlBwp.bwp.numPrb;
ulTtiReqPdu->pdu.pucch_pdu.bwpStart = macCellCfg->cellCfg.initialUlBwp.bwp.firstPrb;
ulTtiReqPdu->pdu.pucch_pdu.subCarrierSpacing = macCellCfg->cellCfg.initialUlBwp.bwp.scs;
ulTtiReqPdu->pdu.pucch_pdu.cyclicPrefix = macCellCfg->cellCfg.initialUlBwp.bwp.cyclicPrefix;
- ulTtiReqPdu->pdu.pucch_pdu.formatType = currUlSlot->ulInfo.schPucchInfo.pucchFormat; /* Supporting PUCCH Format 0 */
+ ulTtiReqPdu->pdu.pucch_pdu.formatType = pucchInfo->pucchFormat; /* Supporting PUCCH Format 0 */
ulTtiReqPdu->pdu.pucch_pdu.multiSlotTxIndicator = 0; /* No Multi Slot transmission */
- ulTtiReqPdu->pdu.pucch_pdu.prbStart = currUlSlot->ulInfo.schPucchInfo.fdAlloc.startPrb;
- ulTtiReqPdu->pdu.pucch_pdu.prbSize = currUlSlot->ulInfo.schPucchInfo.fdAlloc.numPrb;
- ulTtiReqPdu->pdu.pucch_pdu.startSymbolIndex = currUlSlot->ulInfo.schPucchInfo.tdAlloc.startSymb;
- ulTtiReqPdu->pdu.pucch_pdu.nrOfSymbols = currUlSlot->ulInfo.schPucchInfo.tdAlloc.numSymb;
- ulTtiReqPdu->pdu.pucch_pdu.freqHopFlag = currUlSlot->ulInfo.schPucchInfo.intraFreqHop;
- ulTtiReqPdu->pdu.pucch_pdu.secondHopPrb = currUlSlot->ulInfo.schPucchInfo.secondPrbHop;
+ ulTtiReqPdu->pdu.pucch_pdu.prbStart = pucchInfo->fdAlloc.startPrb;
+ ulTtiReqPdu->pdu.pucch_pdu.prbSize = pucchInfo->fdAlloc.numPrb;
+ ulTtiReqPdu->pdu.pucch_pdu.startSymbolIndex = pucchInfo->tdAlloc.startSymb;
+ ulTtiReqPdu->pdu.pucch_pdu.nrOfSymbols = pucchInfo->tdAlloc.numSymb;
+ ulTtiReqPdu->pdu.pucch_pdu.freqHopFlag = pucchInfo->intraFreqHop;
+ ulTtiReqPdu->pdu.pucch_pdu.secondHopPrb = pucchInfo->secondPrbHop;
ulTtiReqPdu->pdu.pucch_pdu.groupHopFlag = 0;
ulTtiReqPdu->pdu.pucch_pdu.sequenceHopFlag = 0;
ulTtiReqPdu->pdu.pucch_pdu.hoppingId = 0;
- ulTtiReqPdu->pdu.pucch_pdu.initialCyclicShift = currUlSlot->ulInfo.schPucchInfo.initialCyclicShift;
+ ulTtiReqPdu->pdu.pucch_pdu.initialCyclicShift = pucchInfo->initialCyclicShift;
ulTtiReqPdu->pdu.pucch_pdu.dataScramblingId = 0; /* Valid for Format 2, 3, 4 */
- ulTtiReqPdu->pdu.pucch_pdu.timeDomainOccIdx = currUlSlot->ulInfo.schPucchInfo.timeDomOCC;
- ulTtiReqPdu->pdu.pucch_pdu.preDftOccIdx = currUlSlot->ulInfo.schPucchInfo.occIdx; /* Valid for Format 4 only */
- ulTtiReqPdu->pdu.pucch_pdu.preDftOccLen = currUlSlot->ulInfo.schPucchInfo.occLen; /* Valid for Format 4 only */
- ulTtiReqPdu->pdu.pucch_pdu.pi2Bpsk = currUlSlot->ulInfo.schPucchInfo.pi2BPSK;
- ulTtiReqPdu->pdu.pucch_pdu.addDmrsFlag = currUlSlot->ulInfo.schPucchInfo.addDmrs;/* Valid for Format 3, 4 only */
+ ulTtiReqPdu->pdu.pucch_pdu.timeDomainOccIdx = pucchInfo->timeDomOCC;
+ ulTtiReqPdu->pdu.pucch_pdu.preDftOccIdx = pucchInfo->occIdx; /* Valid for Format 4 only */
+ ulTtiReqPdu->pdu.pucch_pdu.preDftOccLen = pucchInfo->occLen; /* Valid for Format 4 only */
+ ulTtiReqPdu->pdu.pucch_pdu.pi2Bpsk = pucchInfo->pi2BPSK;
+ ulTtiReqPdu->pdu.pucch_pdu.addDmrsFlag = pucchInfo->addDmrs;/* Valid for Format 3, 4 only */
ulTtiReqPdu->pdu.pucch_pdu.dmrsScramblingId = 0; /* Valid for Format 2 */
ulTtiReqPdu->pdu.pucch_pdu.dmrsCyclicShift = 0; /* Valid for Format 4 */
- ulTtiReqPdu->pdu.pucch_pdu.srFlag = currUlSlot->ulInfo.schPucchInfo.srFlag;
- ulTtiReqPdu->pdu.pucch_pdu.bitLenHarq = currUlSlot->ulInfo.schPucchInfo.harqInfo.harqBitLength;
+ ulTtiReqPdu->pdu.pucch_pdu.srFlag = pucchInfo->srFlag;
+ ulTtiReqPdu->pdu.pucch_pdu.bitLenHarq = pucchInfo->harqInfo.harqBitLength;
ulTtiReqPdu->pdu.pucch_pdu.bitLenCsiPart1 = 0; /* Valid for Format 2, 3, 4 */
ulTtiReqPdu->pdu.pucch_pdu.bitLenCsiPart2 = 0; /* Valid for Format 2, 3, 4 */
- ulTtiReqPdu->pdu.pucch_pdu.beamforming.numPrgs = currUlSlot->ulInfo.schPucchInfo.beamPucchInfo.numPrgs;
- ulTtiReqPdu->pdu.pucch_pdu.beamforming.prgSize = currUlSlot->ulInfo.schPucchInfo.beamPucchInfo.prgSize;
- ulTtiReqPdu->pdu.pucch_pdu.beamforming.digBfInterface = currUlSlot->ulInfo.schPucchInfo.beamPucchInfo.digBfInterfaces;
- ulTtiReqPdu->pdu.pucch_pdu.beamforming.rx_bfi[0].beamIdx[0].beamidx = currUlSlot->ulInfo.schPucchInfo.beamPucchInfo.prg[0].beamIdx[0];
+ ulTtiReqPdu->pdu.pucch_pdu.beamforming.numPrgs = pucchInfo->beamPucchInfo.numPrgs;
+ ulTtiReqPdu->pdu.pucch_pdu.beamforming.prgSize = pucchInfo->beamPucchInfo.prgSize;
+ ulTtiReqPdu->pdu.pucch_pdu.beamforming.digBfInterface = pucchInfo->beamPucchInfo.digBfInterfaces;
+ ulTtiReqPdu->pdu.pucch_pdu.beamforming.rx_bfi[0].beamIdx[0].beamidx = pucchInfo->beamPucchInfo.prg[0].beamIdx[0];
ulTtiReqPdu->pduSize = sizeof(fapi_ul_pucch_pdu_t);
#ifdef INTEL_FAPI
uint16_t cellIdx =0;
uint8_t pduIdx = -1;
+ uint8_t ueIdx = 0;
SlotTimingInfo ulTtiReqTimingInfo;
MacUlSlot *currUlSlot = NULLP;
MacCellCfg macCellCfg;
macCellCfg = macCb.macCell[cellIdx]->macCellCfg;
/* add PHY delta */
- ADD_DELTA_TO_TIME(currTimingInfo,ulTtiReqTimingInfo,PHY_DELTA_UL, macCb.macCell[cellIdx]->numOfSlots);
+ ADD_DELTA_TO_TIME(currTimingInfo,ulTtiReqTimingInfo,gConfigInfo.gPhyDeltaUl, macCb.macCell[cellIdx]->numOfSlots);
currUlSlot = &macCb.macCell[cellIdx]->ulSlot[ulTtiReqTimingInfo.slot % macCb.macCell[cellIdx]->numOfSlots];
LWR_MAC_ALLOC(ulTtiElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_ul_tti_req_t)));
if(ulTtiElem)
{
- FILL_FAPI_LIST_ELEM(ulTtiElem, NULLP, FAPI_UL_TTI_REQUEST, 1, \
- sizeof(fapi_ul_tti_req_t));
- ulTtiReq = (fapi_ul_tti_req_t *)(ulTtiElem +1);
- memset(ulTtiReq, 0, sizeof(fapi_ul_tti_req_t));
- fillMsgHeader(&ulTtiReq->header, FAPI_UL_TTI_REQUEST, sizeof(fapi_ul_tti_req_t));
- ulTtiReq->sfn = ulTtiReqTimingInfo.sfn;
- ulTtiReq->slot = ulTtiReqTimingInfo.slot;
- ulTtiReq->nPdus = getnPdus(ulTtiReq, currUlSlot);
- vendorUlTti->num_ul_pdu = ulTtiReq->nPdus;
- vendorUlTti->sym = 0;
- ulTtiReq->nGroup = 0;
- if(ulTtiReq->nPdus > 0)
- {
- /* Fill Prach Pdu */
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PRACH)
- {
- pduIdx++;
- fillPrachPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot);
- ulTtiReq->rachPresent++;
- }
-
- /* Fill PUSCH PDU */
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PUSCH)
- {
- pduIdx++;
- fillPuschPdu(&ulTtiReq->pdus[pduIdx], &vendorUlTti->ul_pdus[pduIdx], &macCellCfg, currUlSlot);
- ulTtiReq->nUlsch++;
- }
- /* Fill PUCCH PDU */
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_UCI)
- {
- pduIdx++;
- fillPucchPdu(&ulTtiReq->pdus[pduIdx], &vendorUlTti->ul_pdus[pduIdx], &macCellCfg, currUlSlot);
- ulTtiReq->nUlcch++;
- }
- }
+ FILL_FAPI_LIST_ELEM(ulTtiElem, NULLP, FAPI_UL_TTI_REQUEST, 1, \
+ sizeof(fapi_ul_tti_req_t));
+ ulTtiReq = (fapi_ul_tti_req_t *)(ulTtiElem +1);
+ memset(ulTtiReq, 0, sizeof(fapi_ul_tti_req_t));
+ fillMsgHeader(&ulTtiReq->header, FAPI_UL_TTI_REQUEST, sizeof(fapi_ul_tti_req_t));
+ ulTtiReq->sfn = ulTtiReqTimingInfo.sfn;
+ ulTtiReq->slot = ulTtiReqTimingInfo.slot;
+ ulTtiReq->nPdus = getnPdus(ulTtiReq, currUlSlot);
+ vendorUlTti->num_ul_pdu = ulTtiReq->nPdus;
+ vendorUlTti->sym = 0;
+ ulTtiReq->nGroup = 0;
+ if(ulTtiReq->nPdus > 0)
+ {
+ /* Fill Prach Pdu */
+ if(currUlSlot->ulSchInfo.dataType & SCH_DATATYPE_PRACH)
+ {
+ pduIdx++;
+ fillPrachPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot);
+ ulTtiReq->rachPresent++;
+ }
+ for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
+ {
+ /* Fill PUSCH PDU */
+ if(currUlSlot->ulSchInfo.dataType & SCH_DATATYPE_PUSCH)
+ {
+ if(currUlSlot->ulSchInfo.schPuschInfo[ueIdx].crnti != 0)
+ {
+ pduIdx++;
+ fillPuschPdu(&ulTtiReq->pdus[pduIdx], &vendorUlTti->ul_pdus[pduIdx], &macCellCfg, &currUlSlot->ulSchInfo.schPuschInfo[ueIdx]);
+ ulTtiReq->nUlsch++;
+ }
+ }
+ /* Fill PUCCH PDU */
+ if(currUlSlot->ulSchInfo.dataType & SCH_DATATYPE_UCI)
+ {
+ if(currUlSlot->ulSchInfo.schPucchInfo[ueIdx].crnti != 0)
+ {
+ pduIdx++;
+ fillPucchPdu(&ulTtiReq->pdus[pduIdx], &vendorUlTti->ul_pdus[pduIdx], &macCellCfg, &currUlSlot->ulSchInfo.schPucchInfo[ueIdx]);
+ ulTtiReq->nUlcch++;
+ }
+ }
+ }
+ ulTtiReq->ueGrpInfo[ulTtiReq->nGroup].nUe = MAX_NUM_UE_PER_TTI;
+ ulTtiReq->nGroup++;
+ }
#ifdef ODU_SLOT_IND_DEBUG_LOG
- DU_LOG("\nDEBUG --> LWR_MAC: Sending UL TTI Request");
+ DU_LOG("\nDEBUG --> LWR_MAC: Sending UL TTI Request");
#endif
- prevElem->p_next = ulTtiElem;
+ prevElem->p_next = ulTtiElem;
- memset(currUlSlot, 0, sizeof(MacUlSlot));
- return ROK;
+ memset(currUlSlot, 0, sizeof(MacUlSlot));
+ return ROK;
}
else
{
- DU_LOG("\nERROR --> LWR_MAC: Failed to allocate memory for UL TTI Request");
- memset(currUlSlot, 0, sizeof(MacUlSlot));
- return RFAILED;
+ DU_LOG("\nERROR --> LWR_MAC: Failed to allocate memory for UL TTI Request");
+ memset(currUlSlot, 0, sizeof(MacUlSlot));
+ return RFAILED;
}
}
else
{
- lwr_mac_procInvalidEvt(&currTimingInfo);
+ lwr_mac_procInvalidEvt(&currTimingInfo);
}
#endif
return ROK;
else
{
DU_LOG("\nERROR --> SCH: Invalid value of r_pucch:%d (greater than 15) ", r_pucch);
+ memset(schPucchInfo, 0, sizeof(SchPucchInfo));
return ret;
}
ret = allocatePrbUl(cell, slotInfo, pucchResourceSet[pucchIdx][1], pucchResourceSet[pucchIdx][2],\
uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst)
{
int ret = ROK;
- #ifdef NR_DRX
- SchUeCb *ueCb;
- #endif
+ uint8_t ueIdx = 0;
UlSchedInfo ulSchedInfo;
SchUlSlotInfo *schUlSlotInfo = NULLP;
SlotTimingInfo ulTimingInfo;
memset(&ulSchedInfo, 0, sizeof(UlSchedInfo));
/* add PHY delta */
- ADD_DELTA_TO_TIME(cell->slotInfo,ulTimingInfo,PHY_DELTA_UL+SCHED_DELTA, cell->numSlots);
+ ADD_DELTA_TO_TIME(cell->slotInfo,ulTimingInfo,gConfigInfo.gPhyDeltaUl+SCHED_DELTA, cell->numSlots);
ulSchedInfo.cellId = cell->cellId;
ulSchedInfo.slotIndInfo.cellId = ulSchedInfo.cellId;
schPrachResAlloc(cell, &ulSchedInfo, ulTimingInfo);
schUlSlotInfo = cell->schUlSlotInfo[ulTimingInfo.slot];
- if(schUlSlotInfo->schPuschInfo)
+ if(schUlSlotInfo->puschPres)
{
- GET_CRNTI(ulSchedInfo.crnti, schUlSlotInfo->puschUe);
/* Check the ue drx status if the UE is active for uplink scheduling or not */
- #ifdef NR_DRX
- ueCb = schGetUeCb(cell, ulSchedInfo.crnti);
- if(ueCb->ueDrxInfoPres)
+ ulSchedInfo.dataType |= SCH_DATATYPE_PUSCH;
+ for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
{
- if(!ueCb->drxUeCb.drxUlUeActiveStatus)
- return RFAILED;
+ if(schUlSlotInfo->schPuschInfo[ueIdx] != NULLP)
+ {
+ memcpy(&ulSchedInfo.schPuschInfo[ueIdx], schUlSlotInfo->schPuschInfo[ueIdx],
+ sizeof(SchPuschInfo));
+ SCH_FREE(schUlSlotInfo->schPuschInfo[ueIdx], sizeof(SchPuschInfo));
+ schUlSlotInfo->schPuschInfo[ueIdx] = NULL;
+ }
}
- #endif
- ulSchedInfo.dataType |= SCH_DATATYPE_PUSCH;
- memcpy(&ulSchedInfo.schPuschInfo, schUlSlotInfo->schPuschInfo,
- sizeof(SchPuschInfo));
- SCH_FREE(schUlSlotInfo->schPuschInfo, sizeof(SchPuschInfo));
- schUlSlotInfo->schPuschInfo = NULL;
}
if(schUlSlotInfo->pucchPres)
{
- GET_CRNTI(ulSchedInfo.crnti, schUlSlotInfo->pucchUe);
ulSchedInfo.dataType |= SCH_DATATYPE_UCI;
memcpy(&ulSchedInfo.schPucchInfo, &schUlSlotInfo->schPucchInfo,
- sizeof(SchPucchInfo));
- memset(&schUlSlotInfo->schPucchInfo, 0, sizeof(SchPucchInfo));
+ (sizeof(SchPucchInfo) * MAX_NUM_UE));
+ memset(&schUlSlotInfo->schPucchInfo, 0, (sizeof(SchPucchInfo) * MAX_NUM_UE));
}
- /* Send msg to MAC */
- ret = sendUlSchInfoToMac(&ulSchedInfo, schInst);
- if(ret != ROK)
+ if(ulSchedInfo.dataType > 0)
{
- DU_LOG("\nERROR --> SCH : Sending UL Sch info from SCH to MAC failed");
+ /* Send msg to MAC */
+ ret = sendUlSchInfoToMac(&ulSchedInfo, schInst);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> SCH : Sending UL Sch info from SCH to MAC failed");
+ }
}
/* Update DL PRB Usage for all stats group which requested for DL Total PRB Usage */
*
*******************************************************************/
- uint8_t schAllocPucchResource(SchCellCb *cell, SlotTimingInfo pucchTime, SchUeCb *ueCb,\
+ uint8_t schAllocPucchResource(SchCellCb *cell, uint8_t ueId, SlotTimingInfo pucchTime, SchUeCb *ueCb,\
SchDlHqProcCb *hqP, SchPdcchAllocInfo *pdcchAllocInfo)
{
uint8_t ret = RFAILED;
pucchSlot = pucchTime.slot;
schUlSlotInfo = cell->schUlSlotInfo[pucchSlot];
- memset(&schUlSlotInfo->schPucchInfo, 0, sizeof(SchPucchInfo));
- ret = fillPucchResourceInfo(cell, schUlSlotInfo->pucchUe, &schUlSlotInfo->schPucchInfo,\
+ ret = fillPucchResourceInfo(cell, ueId, &schUlSlotInfo->schPucchInfo[ueId - 1],\
pucchTime, pdcchAllocInfo);
if(ret != ROK)
{
return ret;
}
-
- schUlSlotInfo->pucchPres = true;
+ schUlSlotInfo->pucchPres = true;
if(ueCb != NULLP)
{
/* set HARQ flag to true */
- schUlSlotInfo->schPucchInfo.harqInfo.harqBitLength = 1; /* 1 bit for HARQ */
+ schUlSlotInfo->schPucchInfo[ueId - 1].harqInfo.harqBitLength = 1; /* 1 bit for HARQ */
ADD_DELTA_TO_TIME(pucchTime, pucchTime, 3, cell->numSlots); /* SLOT_DELAY=3 */
cmLListAdd2Tail(&(ueCb->hqDlmap[pucchTime.slot]->hqList), &hqP->dlSlotLnk);
}
}
cell->schDlSlotInfo[pdcchTime.slot]->pdcchUe = ueId;
- cell->schUlSlotInfo[pucchTime.slot]->pucchUe = ueId;
cell->raCb[ueId-1].msg4recvd = FALSE;
if(isRetxMsg4)
}
/* Calculating time frame to send DCI for SR */
- ADD_DELTA_TO_TIME(currTime, dciTime, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
+ ADD_DELTA_TO_TIME(currTime, dciTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
#ifdef NR_TDD
if(schGetSlotSymbFrmt(dciTime.slot, cell->slotFrmtBitMap) == DL_SLOT)
#endif
if(schGetSlotSymbFrmt(puschTime.slot, cell->slotFrmtBitMap) == DL_SLOT)
continue;
#endif
- if(cell->schUlSlotInfo[puschTime.slot]->puschUe != 0)
+ if((cell->schUlSlotInfo[puschTime.slot]->schPuschInfo[ueId - 1] != NULLP)
+ && cell->schUlSlotInfo[puschTime.slot]->schPuschInfo[ueId - 1]->crnti == ueCb->crnti)
{
continue;
}
}
else
{
- DU_LOG("\nDEBUG --> SCH : schProcessSrOrBsrReq(): K2 value is not found");
+ /* K2 value not found*/
return false;
}
return true;
currTime = cell->slotInfo;
/* Calculating time frame to send DCI for MSG3 Retx*/
- ADD_DELTA_TO_TIME(currTime, dciTime, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
+ ADD_DELTA_TO_TIME(currTime, dciTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
#ifdef NR_TDD
/* Consider this slot for sending DCI, only if it is a DL slot */
if(schGetSlotSymbFrmt(dciSlot, raCb->cell->slotFrmtBitMap) == DL_SLOT)
if(cell->schDlSlotInfo[dciSlot]->pdcchUe != 0)
return false;
- k2Found = schGetMsg3K2(cell, &raCb->msg3HqProc, dciTime.slot, &msg3Time, TRUE);
+ k2Found = schGetMsg3K2(cell, raCb->ueId, &raCb->msg3HqProc, dciTime.slot, &msg3Time, TRUE);
if (!k2Found)
{
return RFAILED;
}
cell->schDlSlotInfo[msg3Time.slot]->ulGrant = dciInfo;
- SCH_ALLOC(cell->schUlSlotInfo[msg3Time.slot]->schPuschInfo, sizeof(SchPuschInfo));
+ SCH_ALLOC(cell->schUlSlotInfo[msg3Time.slot]->schPuschInfo[raCb->ueId - 1], sizeof(SchPuschInfo));
+ cell->schUlSlotInfo[msg3Time.slot]->puschPres = true;
memset(dciInfo,0,sizeof(DciInfo));
- schFillUlDciForMsg3Retx(raCb, cell->schUlSlotInfo[msg3Time.slot]->schPuschInfo, dciInfo);
+ schFillUlDciForMsg3Retx(raCb, cell->schUlSlotInfo[msg3Time.slot]->schPuschInfo[raCb->ueId - 1], dciInfo);
}
raCb->retxMsg3HqProc = NULLP;
return ROK;
* -# true
* -# false
**/
- bool schGetMsg3K2(SchCellCb *cell, SchUlHqProcCb* msg3HqProc, uint16_t dlTime, SlotTimingInfo *msg3Time, bool isRetx)
+ bool schGetMsg3K2(SchCellCb *cell, uint8_t ueId, SchUlHqProcCb* msg3HqProc, uint16_t dlTime, SlotTimingInfo *msg3Time, bool isRetx)
{
bool k2Found = false;
uint8_t k2TblIdx = 0;
#ifdef NR_TDD
uint8_t totalCfgSlot = 0;
#endif
+ uint16_t crnti = 0;
SchK2TimingInfoTbl *msg3K2InfoTbl=NULLP;
SlotTimingInfo currTime, msg3TempTime;
currTime = cell->slotInfo;
msg3MinSchTime = minMsg3SchTime[cell->numerology];
msg3Delta = puschDeltaTable[puschMu];
}
-
+
+ GET_UE_ID(crnti, ueId);
for(k2TblIdx = 0; k2TblIdx < numK2; k2TblIdx++)
{
k2Index = msg3K2InfoTbl->k2TimingInfo[dlTime].k2Indexes[k2TblIdx];
if(schGetSlotSymbFrmt(msg3TempTime.slot % totalCfgSlot, cell->slotFrmtBitMap) == DL_SLOT)
continue;
#endif
- /* If PUSCH is already scheduled on this slot, another PUSCH
- * pdu cannot be scheduled here */
- if(cell->schUlSlotInfo[msg3TempTime.slot]->puschUe != 0)
+ /* If PUSCH is already scheduled on this slot for this UE, another PUSCH
+ * pdu cannot be scheduled here for same UE*/
+ if((cell->schUlSlotInfo[msg3TempTime.slot]->schPuschInfo[ueId - 1] != NULLP)
+ && cell->schUlSlotInfo[msg3TempTime.slot]->schPuschInfo[ueId - 1]->crnti == crnti)
continue;
k2Found = true;
break;
uint8_t ret = RFAILED;
uint16_t startPrb = 0;
uint32_t totDataReq = 0; /* in bytes */
- SchUeCb *ueCb;
- SchPuschInfo *puschInfo;
+ SchUeCb *ueCb = NULLP;
+ SchPuschInfo *puschInfo = NULLP;
DciInfo *dciInfo = NULLP;
cell = (*hqP)->hqEnt->cell;
/* Update PUSCH allocation */
if(schFillPuschAlloc(ueCb, puschTime, totDataReq, startSymb, symbLen, startPrb, isRetx, *hqP) == ROK)
{
- if(cell->schUlSlotInfo[puschTime.slot]->schPuschInfo)
+ if(cell->schUlSlotInfo[puschTime.slot]->schPuschInfo[ueCb->ueId])
{
- puschInfo = cell->schUlSlotInfo[puschTime.slot]->schPuschInfo;
+ puschInfo = cell->schUlSlotInfo[puschTime.slot]->schPuschInfo[ueCb->ueId];
if(puschInfo != NULLP)
{
/* Fill DCI for UL grant */
schFillUlDci(ueCb, puschInfo, dciInfo, isRetx, *hqP);
ueCb->srRcvd = false;
ueCb->bsrRcvd = false;
- cell->schUlSlotInfo[puschTime.slot]->puschUe = ueCb->ueId;
if(fcfsHqProcCb->lcCb.dedLcList.count != 0)
updateBsrAndLcList(&(fcfsHqProcCb->lcCb.dedLcList), ueCb->bsrInfo, ROK);
updateBsrAndLcList(&(fcfsHqProcCb->lcCb.defLcList), ueCb->bsrInfo, ROK);
else
{
#ifdef NR_DRX
- schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], PHY_DELTA_DL + SCHED_DELTA);
+ schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], gConfigInfo.gPhyDeltaDl + SCHED_DELTA);
#endif
}
}
}
-
+ }
+ #ifdef NR_DRX
+ if((cell->ueCb[ueId-1].ueDrxInfoPres == true) && (cell->ueCb[ueId-1].drxUeCb.drxUlUeActiveStatus != true))
+ {
+ if(pendingUeNode->node)
+ {
+ cmLListAdd2Tail(&fcfsCell->ueToBeScheduled, cmLListDelFrm(&fcfsCell->ueToBeScheduled, pendingUeNode));
+ }
+ }
+ else
+ #endif
+ {
/* Scheduling of UL grant */
node = NULLP;
if(fcfsUeCb)
else
{
#ifdef NR_DRX
- schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], PHY_DELTA_UL + SCHED_DELTA);
+ schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], gConfigInfo.gPhyDeltaUl + SCHED_DELTA);
#endif
}
}
SchCellCb *cell = NULLP;
SchUlSlotInfo *schUlSlotInfo = NULLP;
uint8_t mcs = DEFAULT_MCS;
- uint8_t startSymb = 0;
+ uint8_t startSymb = 0, ueId = 0;
uint8_t symbLen = 0;
uint16_t startRb = 0;
uint16_t numRb = 0;
return NULLP;
}
+ GET_UE_ID(crnti, ueId);
/* Allocate time-domain and frequency-domain resource for MSG3 PUSCH */
startSymb = cell->cellCfg.ulCfgCommon.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[k2Index].startSymbol;
symbLen = cell->cellCfg.ulCfgCommon.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[k2Index].symbolLength;
/* Fill PUSCH scheduling details in Slot structure */
schUlSlotInfo = cell->schUlSlotInfo[msg3SlotTime.slot];
- SCH_ALLOC(schUlSlotInfo->schPuschInfo, sizeof(SchPuschInfo));
- if(!schUlSlotInfo->schPuschInfo)
+ SCH_ALLOC(schUlSlotInfo->schPuschInfo[ueId - 1], sizeof(SchPuschInfo));
+ if(!schUlSlotInfo->schPuschInfo[ueId - 1])
{
DU_LOG("\nERROR --> SCH : Memory allocation failed in schAllocMsg3Pusch");
return NULLP;
}
-
+ cell->schUlSlotInfo[msg3SlotTime.slot]->puschPres = true;
tbSize = 0; /* since nPrb has been incremented, recalculating tbSize */
tbSize = schCalcTbSizeFromNPrb(numRb, mcs, NUM_PDSCH_SYMBOL);
tbSize = tbSize / 8 ; /*bits to byte conversion*/
- schUlSlotInfo->schPuschInfo->harqProcId = msg3HqProc->procId;
- schUlSlotInfo->schPuschInfo->fdAlloc.resAllocType = SCH_ALLOC_TYPE_1;
- schUlSlotInfo->schPuschInfo->fdAlloc.resAlloc.type1.startPrb = startRb;
- schUlSlotInfo->schPuschInfo->fdAlloc.resAlloc.type1.numPrb = numRb;
- schUlSlotInfo->schPuschInfo->tdAlloc.startSymb = startSymb;
- schUlSlotInfo->schPuschInfo->tdAlloc.numSymb = symbLen;
- schUlSlotInfo->schPuschInfo->tbInfo.qamOrder = QPSK_MODULATION; /* QPSK modulation */
- schUlSlotInfo->schPuschInfo->tbInfo.mcs = mcs;
- schUlSlotInfo->schPuschInfo->tbInfo.mcsTable = SCH_MCS_TABLE_QAM_64;
- schUlSlotInfo->schPuschInfo->tbInfo.ndi = NEW_TRANSMISSION; /* new transmission */
- schUlSlotInfo->schPuschInfo->tbInfo.rv = 0;
- schUlSlotInfo->schPuschInfo->tbInfo.tbSize = tbSize;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->harqProcId = msg3HqProc->procId;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->crnti = crnti;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->fdAlloc.resAllocType = SCH_ALLOC_TYPE_1;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->fdAlloc.resAlloc.type1.startPrb = startRb;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->fdAlloc.resAlloc.type1.numPrb = numRb;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->tdAlloc.startSymb = startSymb;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->tdAlloc.numSymb = symbLen;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.qamOrder = QPSK_MODULATION; /* QPSK modulation */
+ schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.mcs = mcs;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.mcsTable = SCH_MCS_TABLE_QAM_64;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.ndi = NEW_TRANSMISSION; /* new transmission */
+ schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.rv = 0;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.tbSize = tbSize;
#ifdef INTEL_FAPI
- schUlSlotInfo->schPuschInfo->dmrsMappingType = DMRS_MAP_TYPE_A; /* Setting Type-A */
- schUlSlotInfo->schPuschInfo->nrOfDmrsSymbols = NUM_DMRS_SYMBOLS;
- schUlSlotInfo->schPuschInfo->dmrsAddPos = DMRS_ADDITIONAL_POS;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->dmrsMappingType = DMRS_MAP_TYPE_A; /* Setting Type-A */
+ schUlSlotInfo->schPuschInfo[ueId - 1]->nrOfDmrsSymbols = NUM_DMRS_SYMBOLS;
+ schUlSlotInfo->schPuschInfo[ueId - 1]->dmrsAddPos = DMRS_ADDITIONAL_POS;
#endif
if(!isRetx)
{
msg3HqProc->strtSymbl = startSymb;
msg3HqProc->numSymbl = symbLen;
- msg3HqProc->puschResType = schUlSlotInfo->schPuschInfo->fdAlloc.resAllocType;
- msg3HqProc->puschStartPrb = schUlSlotInfo->schPuschInfo->fdAlloc.resAlloc.type1.startPrb;
- msg3HqProc->puschNumPrb = schUlSlotInfo->schPuschInfo->fdAlloc.resAlloc.type1.numPrb;
- msg3HqProc->tbInfo.qamOrder = schUlSlotInfo->schPuschInfo->tbInfo.qamOrder;
- msg3HqProc->tbInfo.iMcs = schUlSlotInfo->schPuschInfo->tbInfo.mcs;
- msg3HqProc->tbInfo.mcsTable = schUlSlotInfo->schPuschInfo->tbInfo.mcsTable;
- msg3HqProc->tbInfo.ndi = schUlSlotInfo->schPuschInfo->tbInfo.ndi;
- msg3HqProc->tbInfo.rv = schUlSlotInfo->schPuschInfo->tbInfo.rv;
- msg3HqProc->tbInfo.tbSzReq = schUlSlotInfo->schPuschInfo->tbInfo.tbSize;
+ msg3HqProc->puschResType = schUlSlotInfo->schPuschInfo[ueId - 1]->fdAlloc.resAllocType;
+ msg3HqProc->puschStartPrb = schUlSlotInfo->schPuschInfo[ueId - 1]->fdAlloc.resAlloc.type1.startPrb;
+ msg3HqProc->puschNumPrb = schUlSlotInfo->schPuschInfo[ueId - 1]->fdAlloc.resAlloc.type1.numPrb;
+ msg3HqProc->tbInfo.qamOrder = schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.qamOrder;
+ msg3HqProc->tbInfo.iMcs = schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.mcs;
+ msg3HqProc->tbInfo.mcsTable = schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.mcsTable;
+ msg3HqProc->tbInfo.ndi = schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.ndi;
+ msg3HqProc->tbInfo.rv = schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.rv;
+ msg3HqProc->tbInfo.tbSzReq = schUlSlotInfo->schPuschInfo[ueId - 1]->tbInfo.tbSize;
#ifdef INTEL_FAPI
- msg3HqProc->dmrsMappingType = schUlSlotInfo->schPuschInfo->dmrsMappingType;
- msg3HqProc->nrOfDmrsSymbols = schUlSlotInfo->schPuschInfo->nrOfDmrsSymbols;
- msg3HqProc->dmrsAddPos = schUlSlotInfo->schPuschInfo->dmrsAddPos;
+ msg3HqProc->dmrsMappingType = schUlSlotInfo->schPuschInfo[ueId - 1]->dmrsMappingType;
+ msg3HqProc->nrOfDmrsSymbols = schUlSlotInfo->schPuschInfo[ueId - 1]->nrOfDmrsSymbols;
+ msg3HqProc->dmrsAddPos = schUlSlotInfo->schPuschInfo[ueId - 1]->dmrsAddPos;
#endif
}
- return schUlSlotInfo->schPuschInfo;
+ return schUlSlotInfo->schPuschInfo[ueId - 1];
}
/**
#ifdef NR_TDD
uint8_t totalCfgSlot = 0;
#endif
- uint16_t dciSlot = 0, rarSlot = 0;
+ uint16_t dciSlot = 0, rarSlot = 0, crnti = 0;
SlotTimingInfo dciTime, rarTime, msg3Time, pucchTime;
RarAlloc *dciSlotAlloc = NULLP; /* Stores info for transmission of PDCCH for RAR */
RarAlloc *rarSlotAlloc = NULLP; /* Stores info for transmission of RAR PDSCH */
SchK0K1TimingInfoTbl *k0K1InfoTbl=NULLP;
SchK2TimingInfoTbl *msg3K2InfoTbl=NULLP;
RaRspWindowStatus windowStatus=0;
-
+
+ GET_CRNTI(crnti, ueId);
#ifdef NR_TDD
totalCfgSlot = calculateSlotPatternLength(cell->cellCfg.ssbScs, cell->cellCfg.tddCfg.tddPeriod);
#endif
}
/* Calculating time frame to send DCI for RAR */
- ADD_DELTA_TO_TIME(currTime, dciTime, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
+ ADD_DELTA_TO_TIME(currTime, dciTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
dciSlot = dciTime.slot;
#ifdef NR_TDD
/* Consider this slot for sending DCI, only if it is a DL slot */
if(schGetSlotSymbFrmt(pucchTime.slot, cell->slotFrmtBitMap) == DL_SLOT)
continue;
#endif
- if(cell->schUlSlotInfo[pucchTime.slot]->pucchUe != 0)
+ /*In this pucchTime, this particular UE/CRNTI is already scheduled thus checking
+ * for next pucchTime for the same UE*/
+ if(cell->schUlSlotInfo[pucchTime.slot]->schPucchInfo[ueId - 1].crnti == crnti)
continue;
+
k1Found = true;
break;
}
if(schGetSlotSymbFrmt(msg3Time.slot % totalCfgSlot, cell->slotFrmtBitMap) == DL_SLOT)
continue;
#endif
- /* If PUSCH is already scheduled on this slot, another PUSCH
- * pdu cannot be scheduled here */
- if(cell->schUlSlotInfo[msg3Time.slot]->puschUe != 0)
+ /* If PUSCH is already scheduled on this slot for this UE, another PUSCH
+ * pdu cannot be scheduled here for same UE*/
+ if((cell->schUlSlotInfo[msg3Time.slot]->schPuschInfo[ueId - 1] != NULLP) && \
+ (cell->schUlSlotInfo[msg3Time.slot]->schPuschInfo[ueId - 1]->crnti == crnti))
continue;
k2Found = true;
if(cell->raReq[ueId-1]->isCFRA)
{
+ cell->schUlSlotInfo[pucchTime.slot]->schPucchInfo[ueId - 1].crnti = crnti;
/* Allocate resources for PUCCH */
- cell->schUlSlotInfo[pucchTime.slot]->pucchUe = ueId;
- ret = schAllocPucchResource(cell, pucchTime, NULLP, NULLP, NULLP);
+ ret = schAllocPucchResource(cell, ueId, pucchTime, NULLP, NULLP, NULLP);
if(ret == RFAILED)
{
SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
}
else
{
- cell->schUlSlotInfo[msg3Time.slot]->puschUe = ueId;
/* Allocate resources for msg3 */
msg3PuschInfo = schAllocMsg3Pusch(schInst, cell->raReq[ueId-1]->rachInd->crnti, k2Index, msg3Time, &(cell->raCb[ueId-1].msg3HqProc), FALSE);
if(msg3PuschInfo)
uint16_t startPrb = 0;
uint32_t totDataReq = 0; /* in bytes */
SchUeCb *ueCb;
- SchPuschInfo *puschInfo;
+ SchPuschInfo *puschInfo = NULLP;
DciInfo *dciInfo = NULLP;
cell = (*hqP)->hqEnt->cell;
/* Update PUSCH allocation */
if(schFillPuschAlloc(ueCb, puschTime, totDataReq, startSymb, symbLen, startPrb, isRetx, *hqP) == ROK)
{
- if(cell->schUlSlotInfo[puschTime.slot]->schPuschInfo)
+ if(cell->schUlSlotInfo[puschTime.slot]->schPuschInfo[ueCb->ueId - 1])
{
- puschInfo = cell->schUlSlotInfo[puschTime.slot]->schPuschInfo;
+ puschInfo = cell->schUlSlotInfo[puschTime.slot]->schPuschInfo[ueCb->ueId - 1];
if(puschInfo != NULLP)
{
/* Fill DCI for UL grant */
schFillUlDci(ueCb, puschInfo, dciInfo, isRetx, *hqP);
ueCb->srRcvd = false;
ueCb->bsrRcvd = false;
- cell->schUlSlotInfo[puschTime.slot]->puschUe = ueCb->ueId;
if(schSpcHqProcCb->lcCb.dedLcList.count != 0)
updateBsrAndLcList(&(schSpcHqProcCb->lcCb.dedLcList), ueCb->bsrInfo, ROK);
updateBsrAndLcList(&(schSpcHqProcCb->lcCb.defLcList), ueCb->bsrInfo, ROK);
else
{
#ifdef NR_DRX
- schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], PHY_DELTA_DL + SCHED_DELTA);
+ schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], gConfigInfo.gPhyDeltaDl + SCHED_DELTA);
#endif
}
}
else
{
#ifdef NR_DRX
- schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], PHY_DELTA_UL + SCHED_DELTA);
+ schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], gConfigInfo.gPhyDeltaUl + SCHED_DELTA);
#endif
}
}
}
}
- cell->schUlSlotInfo[pucchTime.slot]->pucchUe = ueId;
-
/*Re-setting the BO's of all DL LCs in this UE*/
for(lcIdx = 0; lcIdx < MAX_NUM_LC; lcIdx++)
{
* on PHY_DELTA + SCHED_DELTA + BO_DELTA *
****************************************************************/
- ADD_DELTA_TO_TIME(slotInd, schSlotValue->currentTime, PHY_DELTA_DL, numOfSlots);
- ADD_DELTA_TO_TIME(slotInd, schSlotValue->broadcastTime, PHY_DELTA_DL + SCHED_DELTA, numOfSlots);
- ADD_DELTA_TO_TIME(slotInd, schSlotValue->rarTime, PHY_DELTA_DL + SCHED_DELTA, numOfSlots);
- ADD_DELTA_TO_TIME(slotInd, schSlotValue->dlMsgTime, PHY_DELTA_DL + SCHED_DELTA, numOfSlots);
- ADD_DELTA_TO_TIME(slotInd, schSlotValue->ulDciTime, PHY_DELTA_DL + SCHED_DELTA, numOfSlots);
+ ADD_DELTA_TO_TIME(slotInd, schSlotValue->currentTime, gConfigInfo.gPhyDeltaDl, numOfSlots);
+ ADD_DELTA_TO_TIME(slotInd, schSlotValue->broadcastTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, numOfSlots);
+ ADD_DELTA_TO_TIME(slotInd, schSlotValue->rarTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, numOfSlots);
+ ADD_DELTA_TO_TIME(slotInd, schSlotValue->dlMsgTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, numOfSlots);
+ ADD_DELTA_TO_TIME(slotInd, schSlotValue->ulDciTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, numOfSlots);
}
/*******************************************************************
uint8_t numK0 = 0, k0TblIdx = 0, k0Val = 0, k0Index =0 ;
uint8_t k1TblIdx = 0, k1Index = 0, k1Val = 0, numK1 = 0;
uint8_t ret = RFAILED;
+ uint16_t crnti = 0;
SchUeCb *ueCb = NULLP;
SchK0K1TimingInfoTbl *k0K1InfoTbl;
- ADD_DELTA_TO_TIME(currTime, (*pdcchTime), PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
+ ADD_DELTA_TO_TIME(currTime, (*pdcchTime), gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
#ifdef NR_TDD
if(schGetSlotSymbFrmt(pdcchTime->slot, cell->slotFrmtBitMap) != DL_SLOT)
{
#endif
ueCb = &cell->ueCb[ueId-1];
+ GET_CRNTI(crnti, ueId);
if(dedMsg == true)
{
k0K1InfoTbl = &ueCb->k0K1InfoTbl;
continue;
}
#endif
- if(cell->schUlSlotInfo[pucchTime->slot]->pucchUe != 0)
+ if(cell->schUlSlotInfo[pucchTime->slot]->schPucchInfo[ueId - 1].crnti == crnti)
{
continue;
}
}
pdcchTime->cellId = cell->cellId;
pdschTime->cellId = cell->cellId;
-
- cell->schUlSlotInfo[pucchTime->slot]->pucchUe = ueId;
+
+ cell->schUlSlotInfo[pucchTime->slot]->schPucchInfo[ueId - 1].crnti = crnti;
/*Availability of PUCCH for HARQ resources*/
- ret = schAllocPucchResource(cell, *pucchTime, ueCb, hqP, pdcchAllocInfo);
+ ret = schAllocPucchResource(cell, ueId, *pucchTime, ueCb, hqP, pdcchAllocInfo);
if(ret == RFAILED)
{
/*DL allocation can't go through as PUCCH is unavailable*/
{
dlPageAlloc.cellId = currTime.cellId;
- ADD_DELTA_TO_TIME(currTime, dlPageAlloc.dlPageTime, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots);
+ ADD_DELTA_TO_TIME(currTime, dlPageAlloc.dlPageTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots);
dlPageAlloc.shortMsgInd = FALSE;
pdschTime = dlPageAlloc.dlPageTime;