From: Balaji Shankaran Date: Fri, 24 Apr 2020 10:45:26 +0000 (+0530) Subject: PRACH ocassion tracking X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=9fc4986e02c1ab2be2a9276cdfbf049c55af88e6;hp=46fa0c4b110175e7bc5d56f1e419fe4005db36b9;p=o-du%2Fl2.git PRACH ocassion tracking Change-Id: I0e4c8f62d36966ecb89644cfd32d4735ec71275b Signed-off-by: Balaji Shankaran --- diff --git a/src/5gnrmac/lwr_mac_fsm.c b/src/5gnrmac/lwr_mac_fsm.c index abc6d119a..820a73f26 100644 --- a/src/5gnrmac/lwr_mac_fsm.c +++ b/src/5gnrmac/lwr_mac_fsm.c @@ -2483,6 +2483,7 @@ S16 handleDlTtiReq(CmLteTimingInfo *dlTtiReqtimingInfo) { #ifdef FAPI uint8_t idx; + uint8_t nPdu = 0; uint32_t msgLen = 0; fapi_dl_tti_req_t *dlTtiReq = NULLP; fapi_dl_tti_req_pdu_t *dlTtiReqPdu = NULLP; @@ -2510,13 +2511,14 @@ S16 handleDlTtiReq(CmLteTimingInfo *dlTtiReqtimingInfo) dlTtiReq->slot = dlTtiReqtimingInfo->slot; currDlSlot = &macCb.macCell->dlSlot[dlTtiReq->slot % MAX_SLOT_SUPPORTED]; dlTtiReq->nPdus = calculatePduCount(&currDlSlot->cellBroadcastInfo); /* get total Pdus */ + nPdu = dlTtiReq->nPdus; dlTtiReq->nGroup = 0; if(dlTtiReq->nPdus > 0) { #ifdef INTEL_WLS - WLS_MEM_ALLOC(dlTtiReqPdu, (dlTtiReq->nPdus * sizeof(fapi_dl_tti_req_pdu_t))); + WLS_MEM_ALLOC(dlTtiReqPdu, (nPdu * sizeof(fapi_dl_tti_req_pdu_t))); #else - MAC_ALLOC(dlTtiReqPdu, (dlTtiReq->nPdus * sizeof(fapi_dl_tti_req_pdu_t))); + MAC_ALLOC(dlTtiReqPdu, (nPdu * sizeof(fapi_dl_tti_req_pdu_t))); #endif if(currDlSlot->cellBroadcastInfo.ssbTrans) { @@ -2550,9 +2552,9 @@ S16 handleDlTtiReq(CmLteTimingInfo *dlTtiReqtimingInfo) LwrMacSendToPhy(dlTtiReq->header.message_type_id, msgLen, (void *)dlTtiReq); if(currDlSlot->cellBroadcastInfo.sib1Trans) { - MAC_FREE(dlTtiReq->pdus->u.pdcch_pdu.dlDci, sizeof(fapi_dl_dci_t)); + MAC_FREE(dlTtiReqPdu->u.pdcch_pdu.dlDci, sizeof(fapi_dl_dci_t)); } - MAC_FREE(dlTtiReqPdu, (dlTtiReq->nPdus * sizeof(fapi_dl_tti_req_pdu_t))); + MAC_FREE(dlTtiReqPdu, (nPdu * sizeof(fapi_dl_tti_req_pdu_t))); } else { diff --git a/src/5gnrmac/mac.h b/src/5gnrmac/mac.h index 6894c76a4..a8a0a8683 100644 --- a/src/5gnrmac/mac.h +++ b/src/5gnrmac/mac.h @@ -48,7 +48,8 @@ #include "tfu.x" /* RGU Interface includes */ #include "lrg.x" -#define MAX_SLOT_SUPPORTED 10 /* numerology 0 15Khz */ +#define MAX_SLOT_SUPPORTED 10 /* numerology 0 15Khz */ +#define MAX_ZERO_CORR_CFG_IDX 16 /* max zero correlation config index */ typedef struct macDlSlot { diff --git a/src/5gnrmac/mac_rach.c b/src/5gnrmac/mac_rach.c new file mode 100644 index 000000000..19faa2b42 --- /dev/null +++ b/src/5gnrmac/mac_rach.c @@ -0,0 +1,59 @@ +/******************************************************************************* +################################################################################ +# 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.h" + + +/* spec-38.211 Table 6.3.3.1-7 */ +uint8_t UnrestrictedSetNcsTable[MAX_ZERO_CORR_CFG_IDX] = +{0, 2, 4, 6, 8, 10, 12, 13, 15, 17, 19, 23, 27, 34, 46, 69}; + +int MacProcUlSchInfo(Pst *pst, UlSchInfo *ulSchInfo) +{ + + return ROK; +} + +/********************************************************************** + End of file + **********************************************************************/ + diff --git a/src/5gnrmac/rg_lmm.c b/src/5gnrmac/rg_lmm.c index 45ab06661..dc71c0d45 100755 --- a/src/5gnrmac/rg_lmm.c +++ b/src/5gnrmac/rg_lmm.c @@ -2199,6 +2199,23 @@ int MacSchCellCfgReq schCellCfg.sib1SchCfg.searchSpaceZeroIndex = macCellCfg->sib1Cfg.searchSpaceZeroIndex; schCellCfg.sib1SchCfg.sib1Mcs = macCellCfg->sib1Cfg.sib1Mcs; + /* fill RACH config params */ + schCellCfg.schRachCfg.prachCfgIdx = macCellCfg->prachCfg.prachCfgIdx; + schCellCfg.schRachCfg.prachSubcSpacing = \ + macCellCfg->prachCfg.prachSubcSpacing; + schCellCfg.schRachCfg.msg1FreqStart = macCellCfg->prachCfg.msg1FreqStart; + schCellCfg.schRachCfg.msg1Fdm = macCellCfg->prachCfg.msg1Fdm; + schCellCfg.schRachCfg.rootSeqIdx = macCellCfg->prachCfg.fdm[0].rootSeqIdx; + schCellCfg.schRachCfg.numRootSeq = macCellCfg->prachCfg.fdm[0].numRootSeq; + schCellCfg.schRachCfg.k1 = macCellCfg->prachCfg.fdm[0].k1; + schCellCfg.schRachCfg.ssbPerRach = macCellCfg->prachCfg.ssbPerRach; + schCellCfg.schRachCfg.prachMultCarrBand = \ + macCellCfg->prachCfg.prachMultCarrBand; + schCellCfg.schRachCfg.raContResTmr = macCellCfg->prachCfg.raContResTmr; + schCellCfg.schRachCfg.rsrpThreshSsb = macCellCfg->prachCfg.rsrpThreshSsb; + schCellCfg.schRachCfg.raRspWindow = macCellCfg->prachCfg.raRspWindow; + + cfgPst.srcProcId = pst->dstProcId; cfgPst.dstProcId = pst->srcProcId; cfgPst.srcEnt = ENTRG; diff --git a/src/5gnrsch/sch.c b/src/5gnrsch/sch.c index 42146731b..2b2884ac6 100644 --- a/src/5gnrsch/sch.c +++ b/src/5gnrsch/sch.c @@ -347,6 +347,9 @@ int InitSchCellCb(Inst inst, SchCellCfg *schCellCfg) for(uint8_t idx=0; idxtotalPrb = MAX_NUM_RB; + /* UL Alloc */ + SCH_ALLOC(schUlAlloc, sizeof(SchUlAlloc)); + if(!schUlAlloc) + { + DU_LOG("\nMemory allocation failed in InitSchCellCb"); + return RFAILED; + } - for(uint8_t itr=0; itrtotalPrb = schUlAlloc->totalPrb = MAX_NUM_RB; + + for(uint8_t itr=0; itrassignedPrb[itr] = 0; + schUlAlloc->assignedPrb[itr] = 0; } + for(uint8_t itr=0; itrssbInfo[itr], 0, sizeof(SsbInfo)); } cell->dlAlloc[idx] = schDlAlloc; + cell->ulAlloc[idx] = schUlAlloc; + } - schCb[inst].cells[inst] = cell; //Sphoorthi TODO: check if this works + schCb[inst].cells[inst] = cell; DU_LOG("\nCell init completed for cellId:%d", cell->cellId); diff --git a/src/5gnrsch/sch.h b/src/5gnrsch/sch.h index 906e436b6..80f873dfd 100644 --- a/src/5gnrsch/sch.h +++ b/src/5gnrsch/sch.h @@ -92,6 +92,17 @@ typedef struct schDlAlloc SsbInfo ssbInfo[MAX_SSB_IDX]; /*!< SSB info */ }SchDlAlloc; +/** + * @brief + * scheduler allocationsfor UL per cell. + */ +typedef struct schUlAlloc +{ + uint16_t totalPrb; /*!< Number of RBs in the cell */ + uint16_t assignedPrb[SCH_SYMBOL_PER_SLOT]; /*!< Num RBs and corresponding symbols allocated */ + uint8_t prachStartSymb; /*!< Start symbol for PRACH */ +}SchUlAlloc; + /** * @brief * Cell Control block per cell. @@ -104,6 +115,7 @@ typedef struct schCellCb 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 */ + SchUlAlloc *ulAlloc[SCH_NUM_SLOTS]; /*!< SCH resource allocations in UL */ SchCellCfg cellCfg; /*!< Cell ocnfiguration */ }SchCellCb; @@ -123,7 +135,8 @@ SchCb schCb[SCH_MAX_INST]; /* function declarations */ uint8_t schCmnDlAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc); -uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst inst); +int schProcessSlotInd(SlotIndInfo *slotInd, Inst inst); +int schUlResAlloc(SchCellCb *cell, Inst schInst); diff --git a/src/5gnrsch/sch_common.c b/src/5gnrsch/sch_common.c index 5d79f162d..05037858a 100644 --- a/src/5gnrsch/sch_common.c +++ b/src/5gnrsch/sch_common.c @@ -60,8 +60,18 @@ File: sch_common.c #include "du_app_mac_inf.h" #include "mac_sch_interface.h" #include "sch.h" +#include "sch_utils.h" extern SchCb schCb[SCH_MAX_INST]; +extern uint16_t prachCfgIdxTable[MAX_PRACH_CONFIG_IDX][8]; +extern uint16_t numRbForPrachTable[MAX_RACH_NUM_RB_IDX][5]; + +SchMacUlSchInfoFunc schMacUlSchInfoOpts[] = +{ + packSchMacUlSchInfo, + MacProcUlSchInfo, + packSchMacUlSchInfo +}; /** * @brief Time domain allocation for SSB @@ -98,6 +108,7 @@ void ssbDlTdAlloc(uint8_t scs, uint8_t *ssbStartSymb) DU_LOG("\nSCS %d is currently not supported", scs); } } + /** * @brief common resource allocation for SSB * @@ -160,7 +171,146 @@ uint8_t schCmnDlAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc) return ROK; } +/******************************************************************* + * + * @brief Handles sending UL scheduler info to MAC + * + * @details + * + * Function : sendUlSchInfoToMac + * + * Functionality: + * Sends UL Sch info to MAC from SCH + * + * @params[in] + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +int sendUlSchInfoToMac(UlSchInfo *ulSchInfo, Inst inst) +{ + Pst pst; + + memset(&pst, 0, sizeof(Pst)); + SCH_FILL_RSP_PST(pst, inst); + pst.event = EVENT_UL_SCH_INFO; + + return(*schMacUlSchInfoOpts[pst.selector])(&pst, ulSchInfo); + +} +/** + * @brief resource allocation for PRACH + * + * @details + * + * Function : schPrachResAlloc + * + * This function handles PRACH allocation + * + * @param[in] SchCellCb *cell, cell cb + * @param[in] UlSchInfo *ulSchInfo, UL scheduling info + * @return void + **/ +int schPrachResAlloc(SchCellCb *cell, UlSchInfo *ulSchInfo) +{ + uint8_t numPrachRb; + uint8_t numRa; + uint8_t freqStart; + uint16_t sfn; + uint16_t slot; + uint8_t prachCfgIdx = 0; + uint8_t prachFormat = 0; + uint8_t x = 0; + uint8_t y = 0; + uint8_t prachSubframe = 0; + uint8_t prachStartSymbol = 0; + uint8_t prachOcas = 0; + uint8_t dataType = 0; + uint8_t idx = 0; + SchUlAlloc *ulAlloc = NULLP; + sfn = cell->slotInfo.sfn; + slot = cell->slotInfo.slot; + ulAlloc = cell->ulAlloc[cell->slotInfo.slot]; + prachCfgIdx = cell->cellCfg.schRachCfg.prachCfgIdx; + + /* derive the prachCfgIdx table paramters */ + x = prachCfgIdxTable[prachCfgIdx][1]; + y = prachCfgIdxTable[prachCfgIdx][2]; + prachSubframe = prachCfgIdxTable[prachCfgIdx][3]; + + if((sfn%x) != y) + { + /* prach occasion does not lie in this SFN */ + DU_LOG("\nPRACH ocassion doesn't lie in this SFN"); + return RFAILED; + } + /* check for subFrame number */ + if ((1 << slot) & prachSubframe) + { + /* prach ocassion present in this subframe */ + + prachFormat = prachCfgIdxTable[prachCfgIdx][0]; + prachStartSymbol = prachCfgIdxTable[prachCfgIdx][4]; + prachOcas = prachCfgIdxTable[prachCfgIdx][6]; + + /* freq domain resource determination for RACH*/ + freqStart = cell->cellCfg.schRachCfg.msg1FreqStart; + /* numRa determined as 𝑛 belonging {0,1,.., M − 1}, + * where M is given by msg1Fdm */ + numRa = (cell->cellCfg.schRachCfg.msg1Fdm - 1); + for(idx=0; idxcellCfg.schRachCfg.rootSeqIdx) + break; + } + numPrachRb = numRbForPrachTable[idx][3]; + /* Considering first slot in the frame for PRACH */ + idx = 0; + ulAlloc->assignedPrb[idx] = freqStart+numPrachRb; + } + + /* Fill UL SCH Info */ + ulSchInfo->cellId = cell->cellId; + ulSchInfo->slotIndInfo.sfn = sfn; + ulSchInfo->slotIndInfo.slot = slot; + ulSchInfo->dataType = dataType | SCH_DATATYPE_PRACH; + /* prach info */ + ulSchInfo->prachSchInfo.numPrachOcas = prachOcas; + ulSchInfo->prachSchInfo.prachFormat = prachFormat; + ulSchInfo->prachSchInfo.numRa = numRa; + ulSchInfo->prachSchInfo.prachStartSymb = prachStartSymbol; + + return ROK; +} + +/** + * @brief resource allocation for UL + * + * @details + * + * Function : schUlResAlloc + * + * This function handles UL Resource allocation + * + * @param[in] SchCellCb *cell, cellCb + * @return void + **/ +int schUlResAlloc(SchCellCb *cell, Inst schInst) +{ + int ret = ROK; + UlSchInfo ulSchInfo; + /* Schedule resources for PRACH */ + schPrachResAlloc(cell, &ulSchInfo); + //send msg to MAC + ret = sendUlSchInfoToMac(&ulSchInfo, schInst); + if(ret != ROK) + { + DU_LOG("\nSending UL Sch info from SCH to MAC failed"); + } + + return ret; +} /********************************************************************** End of file **********************************************************************/ diff --git a/src/5gnrsch/sch_slot_ind.c b/src/5gnrsch/sch_slot_ind.c index 130ed2b1f..558247596 100644 --- a/src/5gnrsch/sch_slot_ind.c +++ b/src/5gnrsch/sch_slot_ind.c @@ -114,7 +114,7 @@ int sendDlBrdcstAllocToMac(DlBrdcstAlloc *dlBrdcstAlloc, Inst inst) * RFAILED - failure * * ****************************************************************/ -uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) +int schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) { int ret = ROK; uint8_t ssb_rep; @@ -131,6 +131,8 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) #endif cell = schCb[schInst].cells[schInst]; +// schDlResAlloc(cell, slotInd); + ssb_rep = cell->cellCfg.ssbSchCfg.ssbPeriod; memcpy(&cell->slotInfo, slotInd, sizeof(SlotIndInfo)); dlBrdcstAlloc.cellId = cell->cellId; @@ -183,7 +185,6 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) RETVALUE(ret); } } - //send msg to MAC ret = sendDlBrdcstAllocToMac(&dlBrdcstAlloc, schInst); if(ret != ROK) @@ -191,6 +192,8 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) DU_LOG("\nSending DL Broadcast allocation from SCH to MAC failed"); RETVALUE(ret); } + + schUlResAlloc(cell, schInst); return ret; } diff --git a/src/5gnrsch/sch_utils.c b/src/5gnrsch/sch_utils.c index 6494033e2..4e444c34d 100644 --- a/src/5gnrsch/sch_utils.c +++ b/src/5gnrsch/sch_utils.c @@ -76,6 +76,181 @@ int8_t searchSpaceIdxTable[MAX_SEARCH_SPACE_INDEX][4] = { { 5, 1, 2, 0}, /* index 14 */ { 5, 1, 2, 0}, /* index 15 */ }; + +/* RACH tables */ + +/* spec-38.211 Table 6.3.3.2-1 */ +/* Lra, delFRa, delF, numRb, k' */ +uint16_t numRbForPrachTable[MAX_RACH_NUM_RB_IDX][5] = { +{ 839, 1.25, 15, 6, 7 }, /* index 0 */ +{ 839, 1.25, 30, 3, 1 }, /* index 1 */ +{ 839, 1.25, 60, 2, 133 }, /* index 2 */ +{ 839, 5, 15, 24, 12 }, /* index 3 */ +{ 839, 5, 30, 12, 10 }, /* index 4 */ +{ 839, 5, 60, 6, 7 }, /* index 5 */ +{ 139, 15, 15, 12, 2 }, /* index 6 */ +{ 139, 15, 30, 6, 2 }, /* index 7 */ +{ 139, 15, 60, 3, 2 }, /* index 8 */ +{ 139, 30, 15, 24, 2 }, /* index 9 */ +{ 139, 30, 30, 12, 2 }, /* index 10 */ +{ 139, 30, 60, 6, 2 }, /* index 11 */ +{ 139, 60, 60, 12, 2 }, /* index 12 */ +{ 139, 60, 120, 6, 2 }, /* index 13 */ +{ 139, 120, 60, 24, 2 }, /* index 14 */ +{ 139, 120, 120, 12, 2 }, /* index 15 */ +}; + +/* prach config index Table 6.3.3.2-2 spec 38.211 + * PRACH format given as follows: + * 0 = 0 + * 1 = 1 + * 2 = 2 + * 3 = 3 + * 4 = A1 + * 5 = A2 + * 6 = A3 + * 7 = B1 + * 8 = B4 + * 9 = C0 + * 10 = C2 + * 11 = A1/B1 + * 12 = A2/B2 + * 13 = A3/B3 + * Subframe num is represented considering 0-9 bits and + * value 1 corresponds to the subframe that is valid + */ + //Sphoorthi TODO: complete this table + +uint16_t prachCfgIdxTable[MAX_PRACH_CONFIG_IDX][8] = { +{ 0, 16, 1, 2, 0, 0, 0, 0 }, /* index 0 */ +{ 0, 16, 1, 16, 0, 0, 0, 0 }, /* index 1 */ +{ 0, 16, 1, 128, 0, 0, 0, 0 }, /* index 2 */ +{ 0, 16, 1, 512, 0, 0, 0, 0 }, /* index 3 */ +{ 0, 8, 1, 2, 0, 0, 0, 0 }, /* index 4 */ +{ 0, 8, 1, 16, 0, 0, 0, 0 }, /* index 5 */ +{ 0, 8, 1, 128, 0, 0, 0, 0 }, /* index 6 */ +{ 0, 8, 1, 512, 0, 0, 0, 0 }, /* index 7 */ +{ 0, 4, 1, 2, 0, 0, 0, 0 }, /* index 8 */ +{ 0, 4, 1, 16, 0, 0, 0, 0 }, /* index 9 */ +{ 0, 4, 1, 128, 0, 0, 0, 0 }, /* index 10 */ +{ 0, 4, 1, 512, 0, 0, 0, 0 }, /* index 11 */ +{ 0, 2, 1, 2, 0, 0, 0, 0 }, /* index 12 */ +{ 0, 2, 1, 16, 0, 0, 0, 0 }, /* index 13 */ +{ 0, 2, 1, 128, 0, 0, 0, 0 }, /* index 14 */ +{ 0, 2, 1, 512, 0, 0, 0, 0 }, /* index 15 */ +{ 0, 1, 0, 2, 0, 0, 0, 0 }, /* index 16 */ +{ 0, 1, 0, 16, 0, 0, 0, 0 }, /* index 17 */ +{ 0, 1, 0, 128, 0, 0, 0, 0 }, /* index 18 */ +{ 0, 1, 0, 66, 0, 0, 0, 0 }, /* index 19 */ +{ 0, 1, 0, 132, 0, 0, 0, 0 }, /* index 20 */ +{ 0, 1, 0, 264, 0, 0, 0, 0 }, /* index 21 */ +{ 0, 1, 0, 146, 0, 0, 0, 0 }, /* index 22 */ +{ 0, 1, 0, 292, 0, 0, 0, 0 }, /* index 23 */ +{ 0, 1, 0, 584, 0, 0, 0, 0 }, /* index 24 */ +{ 0, 1, 0, 341, 0, 0, 0, 0 }, /* index 25 */ +{ 0, 1, 0, 682, 0, 0, 0, 0 }, /* index 26 */ +{ 0, 1, 0, 1023, 0, 0, 0, 0 }, /* index 27 */ +{ 1, 16, 1, 2, 0, 0, 0, 0 }, /* index 28 */ +{ 1, 16, 1, 16, 0, 0, 0, 0 }, /* index 29 */ +{ 1, 16, 1, 128, 0, 0, 0, 0 }, /* index 30 */ +{ 1, 16, 1, 512, 0, 0, 0, 0 }, /* index 31 */ +{ 1, 8, 1, 2, 0, 0, 0, 0 }, /* index 32 */ +{ 1, 8, 1, 16, 0, 0, 0, 0 }, /* index 33 */ +{ 1, 8, 1, 128, 0, 0, 0, 0 }, /* index 34 */ +{ 1, 8, 1, 512, 0, 0, 0, 0 }, /* index 35 */ +{ 1, 4, 1, 2, 0, 0, 0, 0 }, /* index 36 */ +{ 1, 4, 1, 16, 0, 0, 0, 0 }, /* index 37 */ +{ 1, 4, 1, 128, 0, 0, 0, 0 }, /* index 38 */ +{ 1, 4, 1, 512, 0, 0, 0, 0 }, /* index 39 */ +{ 1, 2, 1, 2, 0, 0, 0, 0 }, /* index 40 */ +{ 1, 2, 1, 16, 0, 0, 0, 0 }, /* index 41 */ +{ 1, 2, 1, 128, 0, 0, 0, 0 }, /* index 42 */ +{ 1, 2, 1, 512, 0, 0, 0, 0 }, /* index 43 */ +{ 1, 1, 0, 2, 0, 0, 0, 0 }, /* index 44 */ +{ 1, 1, 0, 16, 0, 0, 0, 0 }, /* index 45 */ +{ 1, 1, 0, 128, 0, 0, 0, 0 }, /* index 46 */ +{ 1, 1, 0, 64, 0, 0, 0, 0 }, /* index 47 */ +{ 1, 1, 0, 132, 0, 0, 0, 0 }, /* index 48 */ +{ 1, 1, 0, 264, 0, 0, 0, 0 }, /* index 49 */ +{ 1, 1, 0, 146, 0, 0, 0, 0 }, /* index 50 */ +{ 1, 1, 0, 292, 0, 0, 0, 0 }, /* index 51 */ +{ 1, 1, 0, 584, 0, 0, 0, 0 }, /* index 52 */ +{ 2, 16, 1, 2, 0, 0, 0, 0 }, /* index 53 */ +{ 2, 8, 1, 2, 0, 0, 0, 0 }, /* index 54 */ +{ 2, 4, 0, 2, 0, 0, 0, 0 }, /* index 55 */ +{ 2, 2, 0, 2, 0, 0, 0, 0 }, /* index 56 */ +{ 2, 2, 0, 32, 0, 0, 0, 0 }, /* index 57 */ +{ 2, 1, 0, 2, 0, 0, 0, 0 }, /* index 58 */ +{ 2, 1, 0, 32, 0, 0, 0, 0 }, /* index 59 */ +{ 3, 16, 1, 2, 0, 0, 0, 0 }, /* index 60 */ +{ 3, 16, 1, 16, 0, 0, 0, 0 }, /* index 61 */ +{ 3, 16, 1, 128, 0, 0, 0, 0 }, /* index 62 */ +{ 3, 16, 1, 512, 0, 0, 0, 0 }, /* index 63 */ +{ 3, 8, 1, 2, 0, 0, 0, 0 }, /* index 64 */ +{ 3, 8, 1, 16, 0, 0, 0, 0 }, /* index 65 */ +{ 3, 8, 1, 128, 0, 0, 0, 0 }, /* index 66 */ +{ 3, 4, 1, 2, 0, 0, 0, 0 }, /* index 67 */ +{ 3, 4, 1, 16, 0, 0, 0, 0 }, /* index 68 */ +{ 3, 4, 1, 128, 0, 0, 0, 0 }, /* index 69 */ +{ 3, 4, 1, 512, 0, 0, 0, 0 }, /* index 70 */ +{ 3, 2, 1, 2, 0, 0, 0, 0 }, /* index 71 */ +{ 3, 2, 1, 16, 0, 0, 0, 0 }, /* index 72 */ +{ 3, 2, 1, 128, 0, 0, 0, 0 }, /* index 73 */ +{ 3, 2, 1, 512, 0, 0, 0, 0 }, /* index 74 */ +{ 3, 1, 0, 2, 0, 0, 0, 0 }, /* index 75 */ +{ 3, 1, 0, 16, 0, 0, 0, 0 }, /* index 76 */ +{ 3, 1, 0, 128, 0, 0, 0, 0 }, /* index 77 */ +{ 3, 1, 0, 66, 0, 0, 0, 0 }, /* index 78 */ +{ 3, 1, 0, 132, 0, 0, 0, 0 }, /* index 79 */ +{ 3, 1, 0, 264, 0, 0, 0, 0 }, /* index 80 */ +{ 3, 1, 0, 146, 0, 0, 0, 0 }, /* index 81 */ +{ 3, 1, 0, 292, 0, 0, 0, 0 }, /* index 82 */ +{ 3, 1, 0, 584, 0, 0, 0, 0 }, /* index 83 */ +{ 3, 1, 0, 341, 0, 0, 0, 0 }, /* index 84 */ +{ 3, 1, 0, 682, 0, 0, 0, 0 }, /* index 85 */ +{ 3, 1, 0, 1023, 0, 0, 0, 0 }, /* index 86 */ +{ 4, 16, 0, 528, 0, 1, 6, 2 }, /* index 87 */ +{ 4, 16, 1, 16, 0, 2, 6, 2 }, /* index 88 */ +{ 4, 8, 0, 528, 0, 1, 6, 2 }, /* index 89 */ +{ 4, 8, 1, 16, 0, 2, 6, 2 }, /* index 90 */ +{ 4, 4, 0, 528, 0, 1, 6, 2 }, /* index 91 */ +{ 4, 4, 1, 528, 0, 1, 6, 2 }, /* index 92 */ +{ 4, 4, 0, 16, 0, 2, 6, 2 }, /* index 93 */ +{ 4, 2, 0, 528, 0, 1, 6, 2 }, /* index 94 */ +{ 4, 2, 0, 2, 0, 2, 6, 2 }, /* index 95 */ +{ 4, 2, 0, 16, 0, 2, 6, 2 }, /* index 96 */ +{ 4, 2, 0, 128, 0, 2, 6, 2 }, /* index 97 */ +{ 4, 1, 0, 16, 0, 1, 6, 2 }, /* index 98 */ +{ 4, 1, 0, 66, 0, 1, 6, 2 }, /* index 99 */ +{ 4, 1, 0, 528, 0, 1, 6, 2 }, /* index 100 */ +{ 4, 1, 0, 2, 0, 2, 6, 2 }, /* index 101 */ +{ 4, 1, 0, 128, 0, 2, 6, 2 }, /* index 102 */ +{ 4, 1, 0, 132, 0, 2, 6, 2 }, /* index 103 */ +{ 4, 1, 0, 146, 0, 2, 6, 2 }, /* index 104 */ +{ 4, 1, 0, 341, 0, 2, 6, 2 }, /* index 105 */ +{ 4, 1, 0, 1023, 0, 2, 6, 2 }, /* index 106 */ +{ 4, 1, 0, 682, 0, 2, 6, 2 }, /* index 107 */ +{11, 2, 0, 528, 0, 1, 7, 2 }, /* index 108 */ +{11, 2, 0, 16, 0, 2, 7, 2 }, /* index 109 */ +{11, 1, 0, 16, 0, 1, 7, 2 }, /* index 110 */ +{11, 1, 0, 66, 0, 1, 7, 2 }, /* index 111 */ +{11, 1, 0, 528, 0, 1, 7, 2 }, /* index 112 */ +{11, 1, 0, 2, 0, 2, 7, 2 }, /* index 113 */ +{11, 1, 0, 128, 0, 2, 7, 2 }, /* index 114 */ +{11, 1, 0, 146, 0, 2, 7, 2 }, /* index 115 */ +{11, 1, 0, 341, 0, 2, 7, 2 }, /* index 116 */ +{ 5, 16, 1, 580, 0, 1, 3, 4 }, /* index 117 */ +{ 5, 16, 1, 16, 0, 2, 3, 4 }, /* index 118 */ +{ 5, 8, 1, 580, 0, 1, 3, 4 }, /* index 119 */ +{ 5, 8, 1, 16, 0, 2, 3, 4 }, /* index 120 */ +{ 5, 4, 0, 580, 0, 1, 3, 4 }, /* index 121 */ +{ 5, 4, 0, 16, 0, 2, 3, 4 }, /* index 122 */ +{ 5, 2, 1, 580, 0, 1, 3, 4 }, /* index 123 */ +{ 5, 2, 0, 2, 0, 2, 3, 4 }, /* index 124 */ +{ 5, 2, 0, 16, 0, 2, 3, 4 }, /* index 125 */ +}; + + /** * @brief frequency domain allocation function. * diff --git a/src/5gnrsch/sch_utils.h b/src/5gnrsch/sch_utils.h index c1a88d029..ac97fb9f2 100644 --- a/src/5gnrsch/sch_utils.h +++ b/src/5gnrsch/sch_utils.h @@ -21,6 +21,8 @@ /* macros */ #define MAX_CORESET_INDEX 16 #define MAX_SEARCH_SPACE_INDEX 16 +#define MAX_RACH_NUM_RB_IDX 16 +#define MAX_PRACH_CONFIG_IDX 255 #define SET_BITS(_startBit, _numBits, _byte) \ { \ diff --git a/src/cm/mac_sch_interface.c b/src/cm/mac_sch_interface.c index a0a614772..c8d12a641 100644 --- a/src/cm/mac_sch_interface.c +++ b/src/cm/mac_sch_interface.c @@ -76,6 +76,25 @@ int packSchMacDlBrdcstAlloc(Pst *pst, DlBrdcstAlloc *dlBrdcstAlloc) return ROK; } +/** + * @brief function to pack UL Sch Info message + * from SCH to MAC + * + * @details + * + * Function : packSchMacUlSchInfo + * + * + * @param[in] Pst *pst, the post structure + * @param[in] *ulSchInfo, UlSchInfo + * @return S16 + * -# ROK + **/ +int packSchMacUlSchInfo(Pst *pst, UlSchInfo *ulSchInfo) +{ + return ROK; +} + /** * @brief function to pack cell cfg from MAC to SCH * diff --git a/src/cm/mac_sch_interface.h b/src/cm/mac_sch_interface.h index bb2759d4f..d9ebed9e7 100644 --- a/src/cm/mac_sch_interface.h +++ b/src/cm/mac_sch_interface.h @@ -17,8 +17,10 @@ *******************************************************************************/ /* events */ -#define EVENT_SCH_CELL_CFG 1 -#define EVENT_SCH_CELL_CFG_CFM 2 +#define EVENT_SCH_CELL_CFG 1 +#define EVENT_SCH_CELL_CFG_CFM 2 +#define EVENT_DL_BRDCST_ALLOC 3 +#define EVENT_UL_SCH_INFO 4 /* selector */ #define MAC_SCH_LC_SELECTOR 0 @@ -39,6 +41,13 @@ #define MAX_DIG_BF_INTERFACES 0 /* max value should be later 255 */ #define MAX_CODEWORDS 1 /* max should be 2 */ +/* Datatype in UL SCH Info */ +#define SCH_DATATYPE_PUSCH 1 +#define SCH_DATATYPE_PUSCH_UCI 2 +#define SCH_DATATYPE_UCI 4 +#define SCH_DATATYPE_SRS 8 +#define SCH_DATATYPE_PRACH 16 + /*structures*/ @@ -211,11 +220,8 @@ typedef struct schRachCfg { uint8_t prachCfgIdx; /* PRACH config idx */ uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */ - uint8_t prachSeqLen; /* Support for PRACH long/short format */ uint16_t msg1FreqStart; /* Msg1-FrequencyStart */ uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */ - uint8_t maxPrachOcassionsInSlot; /* Number of PRACH ocassions per slot */ - uint8_t numPrachFdOccasions; /*Number of PRACH ocassions in freq domain */ uint16_t rootSeqIdx; /* Root sequence index */ uint8_t numRootSeq; /* Number of root sequences required for FD */ uint16_t k1; /* Frequency Offset for each FD */ @@ -268,6 +274,14 @@ typedef struct sib1AllocInfo Sib1PdschCfg sib1PdschCfg; } Sib1AllocInfo; +typedef struct prachSchInfo +{ + uint8_t numPrachOcas; /* Num Prach Ocassions */ + uint8_t prachFormat; /* PRACH Format */ + uint8_t numRa; /* Freq domain ocassion */ + uint8_t prachStartSymb; /* Freq domain ocassion */ +}PrachSchInfo; + /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */ typedef struct dlBrdcstAlloc { @@ -288,12 +302,16 @@ typedef struct dlBrdcstAlloc Sib1AllocInfo sib1Alloc; }DlBrdcstAlloc; -/* function pointers */ +/* Interface structure signifying DL broadcast allocation for SSB, SIB1 */ +typedef struct ulSchInfo +{ + uint16_t cellId; /* Cell Id */ + SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */ + uint8_t dataType; /* Type of info being scheduled */ + PrachSchInfo prachSchInfo; /* Prach scheduling info */ +}UlSchInfo; -typedef int (*SchMacDlBrdcstAllocFunc) ARGS(( - Pst *pst, /* Post Structure */ - DlBrdcstAlloc *dlBrdcstAlloc /* slot ind Info */ -)); +/* function pointers */ typedef int (*SchCellCfgCfmFunc) ARGS(( Pst *pst, /* Post Structure */ @@ -304,9 +322,21 @@ typedef int (*SchCellCfgFunc) ARGS(( Pst *pst, /* Post Structure */ SchCellCfg *schCellCfg /* Cell Cfg */ )); + +typedef int (*SchMacDlBrdcstAllocFunc) ARGS(( + Pst *pst, /* Post Structure */ + DlBrdcstAlloc *dlBrdcstAlloc /* DL Broadcast Info */ +)); + +typedef int (*SchMacUlSchInfoFunc) ARGS(( + Pst *pst, /* Post Structure */ + UlSchInfo *ulSchInfo /* UL Sch Info */ +)); + /* function declarations */ int packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd); int packSchMacDlBrdcstAlloc(Pst *pst, DlBrdcstAlloc *dlBrdcstAlloc); +int packSchMacUlSchInfo(Pst *pst, UlSchInfo *ulSchInfo); EXTERN int packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg); EXTERN int packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm); @@ -316,6 +346,7 @@ 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); +EXTERN int MacProcUlSchInfo(Pst *pst, UlSchInfo *ulSchInfo); /********************************************************************** End of file diff --git a/src/cm/tfu.h b/src/cm/tfu.h index a8106bc05..fe573b93b 100755 --- a/src/cm/tfu.h +++ b/src/cm/tfu.h @@ -123,7 +123,6 @@ #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 */ diff --git a/src/du_app/du_cfg.h b/src/du_app/du_cfg.h index 3a860f20e..77af09778 100644 --- a/src/du_app/du_cfg.h +++ b/src/du_app/du_cfg.h @@ -73,7 +73,7 @@ #define BANDWIDTH 20 /* MACRO defines for PRACH Configuration */ -#define PRACH_CONFIG_IDX 27 +#define PRACH_CONFIG_IDX 105 #define PRACH_FREQ_START 0 #define PRACH_SEQ_LEN SHORT_SEQUENCE #define PRACH_SUBCARRIER_SPACING 1