From: lal.harshita Date: Mon, 28 Jun 2021 11:37:50 +0000 (+0530) Subject: Fixes for SIB1 transmission and FAPI STOP.request [Issue-ID: ODUHIGH-325] X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=3c9a60ea3d2abf5e22f741f268bdfc37a09743ef;p=o-du%2Fl2.git Fixes for SIB1 transmission and FAPI STOP.request [Issue-ID: ODUHIGH-325] Change-Id: I272b01a151b458c1609e0f9700b1b7d3fd456525 Signed-off-by: lal.harshita --- diff --git a/build/odu/makefile b/build/odu/makefile index 3ca892a59..1afa0df6c 100644 --- a/build/odu/makefile +++ b/build/odu/makefile @@ -209,7 +209,10 @@ du: $(Q)$(MAKE) -j -f $(COM_BUILD_DIR)/mac.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)' $(Q)$(MAKE) -j -f $(COM_BUILD_DIR)/sch.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)' $(Q)$(MAKE) -j -f $(COM_BUILD_DIR)/mt.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)' + +ifneq ($(PHY), INTEL_L1) $(Q)$(MAKE) -j -f $(COM_BUILD_DIR)/phy_stub.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)' +endif ifeq ($(O1_ENABLE),YES) $(Q)$(MAKE) -f $(COM_BUILD_DIR)/o1.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CCPP1)' $(Q)$(MAKE) -f $(COM_BUILD_DIR)/ves.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CCPP1)' @@ -230,7 +233,10 @@ clean_odu: $(Q)$(MAKE) -j -f $(COM_BUILD_DIR)/mac.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)' $(Q)$(MAKE) -j -f $(COM_BUILD_DIR)/sch.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)' $(Q)$(MAKE) -j -f $(COM_BUILD_DIR)/mt.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)' + +ifneq ($(PHY), INTEL_L1) $(Q)$(MAKE) -j -f $(COM_BUILD_DIR)/phy_stub.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)' +endif ifeq ($(O1_ENABLE),YES) $(Q)$(MAKE) -f $(COM_BUILD_DIR)/o1.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CCPP1)' $(Q)$(MAKE) -f $(COM_BUILD_DIR)/ves.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CCPP1)' diff --git a/src/5gnrmac/lwr_mac_fsm.c b/src/5gnrmac/lwr_mac_fsm.c index 4fea61623..19ff43449 100644 --- a/src/5gnrmac/lwr_mac_fsm.c +++ b/src/5gnrmac/lwr_mac_fsm.c @@ -54,6 +54,8 @@ uint8_t UnrestrictedSetNcsTable[MAX_ZERO_CORR_CFG_IDX]; void fapiMacConfigRsp(uint16_t cellId); uint16_t sendTxDataReq(SlotIndInfo currTimingInfo, DlSchedInfo *dlInfo, p_fapi_api_queue_elem_t prevElem); uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo, p_fapi_api_queue_elem_t prevElem); +uint16_t fillUlDciReq(SlotIndInfo currTimingInfo, p_fapi_api_queue_elem_t prevElem); +uint8_t lwr_mac_procStopReqEvt(SlotIndInfo slotInfo, p_fapi_api_queue_elem_t prevElem); void lwrMacLayerInit(Region region, Pool pool) { @@ -2356,19 +2358,14 @@ uint8_t lwr_mac_procStartReqEvt(void *msg) * ********************************************************************/ -uint8_t lwr_mac_procStopReqEvt(void *msg) +uint8_t lwr_mac_procStopReqEvt(SlotIndInfo slotInfo, p_fapi_api_queue_elem_t prevElem) { #ifdef INTEL_FAPI - SlotIndInfo *slotInfo; - fapi_msg_header_t *msgHeader; fapi_stop_req_t *stopReq; fapi_vendor_msg_t *vendorMsg; - p_fapi_api_queue_elem_t headerElem; p_fapi_api_queue_elem_t stopReqElem; p_fapi_api_queue_elem_t vendorMsgElem; - slotInfo = (SlotIndInfo *)msg; - /* Allocte And fill Vendor msg */ LWR_MAC_ALLOC(vendorMsgElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_vendor_msg_t))); if(!vendorMsgElem) @@ -2379,8 +2376,8 @@ uint8_t lwr_mac_procStopReqEvt(void *msg) FILL_FAPI_LIST_ELEM(vendorMsgElem, NULLP, FAPI_VENDOR_MESSAGE, 1, sizeof(fapi_vendor_msg_t)); vendorMsg = (fapi_vendor_msg_t *)(vendorMsgElem + 1); fillMsgHeader(&vendorMsg->header, FAPI_VENDOR_MESSAGE, sizeof(fapi_vendor_msg_t)); - vendorMsg->stop_req_vendor.sfn = slotInfo->sfn; - vendorMsg->stop_req_vendor.slot = slotInfo->slot; + vendorMsg->stop_req_vendor.sfn = slotInfo.sfn; + vendorMsg->stop_req_vendor.slot = slotInfo.slot; /* Fill FAPI stop req */ LWR_MAC_ALLOC(stopReqElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_stop_req_t))); @@ -2396,24 +2393,9 @@ uint8_t lwr_mac_procStopReqEvt(void *msg) memset(stopReq, 0, sizeof(fapi_stop_req_t)); fillMsgHeader(&stopReq->header, FAPI_STOP_REQUEST, sizeof(fapi_stop_req_t)); - /* Fill message header */ - LWR_MAC_ALLOC(headerElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_msg_header_t))); - if(!headerElem) - { - DU_LOG("\nERROR --> LWR_MAC: Memory allocation failed for header in stop req"); - LWR_MAC_FREE(stopReqElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_stop_req_t))); - LWR_MAC_FREE(vendorMsgElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_vendor_msg_t))); - return RFAILED; - } - FILL_FAPI_LIST_ELEM(headerElem, stopReqElem, FAPI_VENDOR_MSG_HEADER_IND, 1, \ - sizeof(fapi_msg_header_t)); - msgHeader = (fapi_msg_header_t *)(headerElem + 1); - msgHeader->num_msg = 2; /* Stop req msg and vendor specific msg */ - msgHeader->handle = 0; - /* Send to PHY */ DU_LOG("\nINFO --> LWR_MAC: Sending Stop Request to Phy"); - LwrMacSendToL1(headerElem); + prevElem->p_next = stopReqElem; #endif return ROK; @@ -3165,7 +3147,7 @@ uint8_t calcTxDataReqPduCount(DlSchedInfo *dlInfo) uint8_t fillSib1TxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, MacCellCfg *macCellCfg, PdschCfg pdschCfg) { - uint16_t payloadSize = 0; + uint32_t payloadSize = 0; uint8_t *sib1Payload = NULLP; fapi_api_queue_elem_t *payloadElem = NULLP; #ifdef INTEL_WLS_MEM @@ -3177,8 +3159,8 @@ uint8_t fillSib1TxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, MacCel /* fill the TLV */ payloadSize = pdschCfg.codeword[0].tbSize; - pduDesc[pduIndex].tlvs[0].tl.tag = FAPI_TX_DATA_PTR_TO_PAYLOAD_64; - pduDesc[pduIndex].tlvs[0].tl.length = payloadSize; + pduDesc[pduIndex].tlvs[0].tl.tag = ((payloadSize & 0xff0000) >> 8) | FAPI_TX_DATA_PTR_TO_PAYLOAD_64; + pduDesc[pduIndex].tlvs[0].tl.length = (payloadSize & 0x0000ffff); LWR_MAC_ALLOC(sib1Payload, payloadSize); if(sib1Payload == NULLP) { @@ -3359,6 +3341,7 @@ uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo) fapi_msg_header_t *msgHeader = NULLP; p_fapi_api_queue_elem_t dlTtiElem; p_fapi_api_queue_elem_t headerElem; + p_fapi_api_queue_elem_t prevElem; if(lwrMacCb.phyState == PHY_STATE_RUNNING) { @@ -3433,9 +3416,11 @@ uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo) &currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdschCfg, currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.bwp, pduIndex); + dlTtiReq->ue_grp_info[dlTtiReq->nGroup].pduIdx[pduIndex] = pduIndex; pduIndex++; numPduEncoded++; } + DU_LOG("\033[1;34m"); DU_LOG("\nDEBUG --> LWR_MAC: SIB1 sent..."); DU_LOG("\033[0m"); @@ -3497,16 +3482,30 @@ uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo) } } + dlTtiReq->ue_grp_info[dlTtiReq->nGroup].nUe = MAX_NUM_UE_PER_TTI; + dlTtiReq->nGroup++; + #ifdef ODU_SLOT_IND_DEBUG_LOG DU_LOG("\nDEBUG --> LWR_MAC: Sending DL TTI Request"); #endif + /* Intel L1 expects UL_TTI.request following DL_TTI.request */ - msgHeader->num_msg++; fillUlTtiReq(currTimingInfo, dlTtiElem); - /* send Tx-DATA req message */ msgHeader->num_msg++; - sendTxDataReq(dlTtiReqTimingInfo, &currDlSlot->dlInfo, dlTtiElem->p_next); - LwrMacSendToL1(headerElem); + + /* Intel L1 expects UL_DCI.request following DL_TTI.request */ + fillUlDciReq(currTimingInfo, dlTtiElem->p_next); + msgHeader->num_msg++; + + /* send Tx-DATA req message */ + sendTxDataReq(dlTtiReqTimingInfo, &currDlSlot->dlInfo, dlTtiElem->p_next->p_next); + if(dlTtiElem->p_next->p_next->p_next) + { + msgHeader->num_msg++; + prevElem = dlTtiElem->p_next->p_next->p_next; + } + else + prevElem = dlTtiElem->p_next->p_next; } else { @@ -3515,10 +3514,23 @@ uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo) #endif /* Intel L1 expects UL_TTI.request following DL_TTI.request */ - msgHeader->num_msg++; fillUlTtiReq(currTimingInfo, dlTtiElem); - LwrMacSendToL1(headerElem); + msgHeader->num_msg++; + + /* Intel L1 expects UL_DCI.request following DL_TTI.request */ + fillUlDciReq(currTimingInfo, dlTtiElem->p_next); + msgHeader->num_msg++; + + prevElem = dlTtiElem->p_next->p_next; + } + + if(macCb.macCell[cellIdx]->state == CELL_STATE_DELETION_IN_PROGRESS) + { + /* Intel L1 expects UL_DCI.request following DL_TTI.request */ + lwr_mac_procStopReqEvt(currTimingInfo, prevElem); + msgHeader->num_msg++; } + LwrMacSendToL1(headerElem); memset(currDlSlot, 0, sizeof(MacDlSlot)); return ROK; } @@ -4194,7 +4206,7 @@ uint8_t fillUlDciPdcchPdu(fapi_dci_pdu_t *ulDciReqPdu, DlSchedInfo *dlInfo, uint * RFAILED - failure * ******************************************************************/ -uint16_t fillUlDciReq(SlotIndInfo currTimingInfo) +uint16_t fillUlDciReq(SlotIndInfo currTimingInfo, p_fapi_api_queue_elem_t prevElem) { #ifdef INTEL_FAPI uint8_t cellIdx =0; @@ -4202,9 +4214,7 @@ uint16_t fillUlDciReq(SlotIndInfo currTimingInfo) SlotIndInfo ulDciReqTimingInfo ={0}; MacDlSlot *currDlSlot = NULLP; fapi_ul_dci_req_t *ulDciReq =NULLP; - fapi_msg_header_t *msgHeader =NULLP; p_fapi_api_queue_elem_t ulDciElem; - p_fapi_api_queue_elem_t headerElem; if(lwrMacCb.phyState == PHY_STATE_RUNNING) { @@ -4212,8 +4222,6 @@ uint16_t fillUlDciReq(SlotIndInfo currTimingInfo) memcpy(&ulDciReqTimingInfo, &currTimingInfo, sizeof(SlotIndInfo)); currDlSlot = &macCb.macCell[cellIdx]->dlSlot[ulDciReqTimingInfo.slot % MAX_SLOTS]; - if(currDlSlot->dlInfo.ulGrant != NULLP) - { LWR_MAC_ALLOC(ulDciElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_ul_dci_req_t))); if(ulDciElem) { @@ -4225,6 +4233,8 @@ uint16_t fillUlDciReq(SlotIndInfo currTimingInfo) ulDciReq->sfn = ulDciReqTimingInfo.sfn; ulDciReq->slot = ulDciReqTimingInfo.slot; + if(currDlSlot->dlInfo.ulGrant != NULLP) + { ulDciReq->numPdus = 1; // No. of PDCCH PDUs if(ulDciReq->numPdus > 0) { @@ -4234,32 +4244,12 @@ uint16_t fillUlDciReq(SlotIndInfo currTimingInfo) /* free UL GRANT at SCH */ MAC_FREE(currDlSlot->dlInfo.ulGrant, sizeof(DciInfo)); currDlSlot->dlInfo.ulGrant = NULLP; - - /* Fill message header */ - LWR_MAC_ALLOC(headerElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_msg_header_t))); - if(!headerElem) - { - DU_LOG("\nERROR --> LWR_MAC: Memory allocation failed for UL DCI req header"); - LWR_MAC_FREE(ulDciElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_ul_dci_req_t))); - return RFAILED; - } - FILL_FAPI_LIST_ELEM(headerElem, ulDciElem, FAPI_VENDOR_MSG_HEADER_IND, 1, \ - sizeof(fapi_msg_header_t)); - msgHeader = (fapi_msg_header_t *)(headerElem + 1); - msgHeader->num_msg = 1; - msgHeader->handle = 0; + } #ifdef ODU_SLOT_IND_DEBUG_LOG DU_LOG("\nDEBUG --> LWR_MAC: Sending UL DCI Request"); #endif - LwrMacSendToL1(headerElem); - } } - else - { - DU_LOG("\nERROR --> LWR_MAC: Failed to allocate memory for UL DCI Request"); - memset(currDlSlot, 0, sizeof(MacDlSlot)); - return RFAILED; - } + prevElem->p_next = ulDciElem; } } else @@ -4306,7 +4296,7 @@ lwrMacFsmHdlr fapiEvtHdlr[MAX_STATE][MAX_EVENT] = lwr_mac_procConfigReqEvt, lwr_mac_procConfigRspEvt, lwr_mac_procInvalidEvt, - lwr_mac_procStopReqEvt, + lwr_mac_procInvalidEvt, } }; diff --git a/src/5gnrmac/lwr_mac_fsm.h b/src/5gnrmac/lwr_mac_fsm.h index 96cff0582..b64224e65 100644 --- a/src/5gnrmac/lwr_mac_fsm.h +++ b/src/5gnrmac/lwr_mac_fsm.h @@ -57,11 +57,9 @@ uint8_t lwr_mac_procParamRspEvt(void *msg); uint8_t lwr_mac_procConfigReqEvt(void *msg); uint8_t lwr_mac_procConfigRspEvt(void *msg); uint8_t lwr_mac_procStartReqEvt(void *msg); -uint8_t lwr_mac_procStopReqEvt(void *msg); void sendToLowerMac(uint16_t, uint32_t, void *); void procPhyMessages(uint16_t msgType, uint32_t msgSize, void *msg); uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo); -uint16_t fillUlDciReq(SlotIndInfo currTimingInfo); typedef uint8_t (*lwrMacFsmHdlr)(void *); void lwrMacLayerInit(Region region, Pool pool); diff --git a/src/5gnrmac/mac.h b/src/5gnrmac/mac.h index e64cba274..5630501ab 100644 --- a/src/5gnrmac/mac.h +++ b/src/5gnrmac/mac.h @@ -52,6 +52,13 @@ typedef struct macCellCb MacCellCb; +typedef enum +{ + CELL_STATE_UP, + CELL_STATE_DELETION_IN_PROGRESS, + CELL_STATE_DOWN +}CellState; + typedef enum { UE_STATE_INACTIVE, @@ -179,6 +186,7 @@ typedef struct macUeCb struct macCellCb { uint16_t cellId; + CellState state; uint8_t crntiMap; MacRaCbInfo macRaCb[MAX_NUM_UE]; MacDlSlot dlSlot[MAX_SLOTS]; diff --git a/src/5gnrmac/mac_msg_hdl.c b/src/5gnrmac/mac_msg_hdl.c index 09056e8b2..35613bc8f 100644 --- a/src/5gnrmac/mac_msg_hdl.c +++ b/src/5gnrmac/mac_msg_hdl.c @@ -477,16 +477,12 @@ uint8_t MacProcCellStop(Pst *pst, OduCellId *cellId) { #ifdef INTEL_FAPI uint16_t cellIdx; - SlotIndInfo slotInfo; DU_LOG("\nINFO --> MAC : Sending cell stop request to Lower Mac"); GET_CELL_IDX(cellId->cellId, cellIdx); if(macCb.macCell[cellIdx]) { - slotInfo.cellId = cellId->cellId; - slotInfo.sfn = macCb.macCell[cellIdx]->currTime.sfn; - slotInfo.slot = macCb.macCell[cellIdx]->currTime.slot; - sendToLowerMac(FAPI_STOP_REQUEST, 0, &slotInfo); + macCb.macCell[cellIdx]->state = CELL_STATE_DELETION_IN_PROGRESS; } #endif diff --git a/src/5gnrmac/mac_slot_ind.c b/src/5gnrmac/mac_slot_ind.c index dcbf870b4..27088ed02 100644 --- a/src/5gnrmac/mac_slot_ind.c +++ b/src/5gnrmac/mac_slot_ind.c @@ -326,11 +326,6 @@ uint8_t macProcSlotInd(SlotIndInfo slotInd) /* Trigger for DL TTI REQ */ fillDlTtiReq(slotInd); - /* TODO : check if this too needs to be sent in sequence with Dl and Ul TTI req. - * If so , move trigger for fillUlDciReq to lower mac */ - /* Trigger for UL DCI REQ */ - fillUlDciReq(slotInd); - return ROK; } /* macProcSlotInd */ @@ -353,6 +348,7 @@ uint8_t macProcSlotInd(SlotIndInfo slotInd) uint8_t fapiMacSlotInd(Pst *pst, SlotIndInfo *slotInd) { uint8_t ret = ROK; + uint16_t cellIdx; volatile uint32_t startTime=0; #ifdef ODU_SLOT_IND_DEBUG_LOG @@ -362,6 +358,12 @@ uint8_t fapiMacSlotInd(Pst *pst, SlotIndInfo *slotInd) ODU_START_TASK(&startTime, PID_MAC_TTI_IND); gSlotCount++; + if(gSlotCount == 1) + { + GET_CELL_IDX(slotInd->cellId, cellIdx); + macCb.macCell[cellIdx]->state = CELL_STATE_UP; + } + /* When testing L2 with Intel-L1, any changes specific to * timer mode testing must be guarded under INTEL_TIMER_MODE*/ #ifndef INTEL_TIMER_MODE diff --git a/src/5gnrsch/sch.c b/src/5gnrsch/sch.c index ebdab07f6..3be7fba08 100644 --- a/src/5gnrsch/sch.c +++ b/src/5gnrsch/sch.c @@ -684,7 +684,8 @@ void fillSchSib1Cfg(uint8_t mu, uint8_t bandwidth, uint8_t numSlots, SchSib1Cfg uint8_t mValue = 0; uint8_t firstSymbol = 0; /* need to calculate using formula mentioned in 38.213 */ uint8_t slotIndex = 0; - uint8_t FreqDomainResource[6] = {0}; + /* TODO : This should be filled through freqDomRscAllocType0() */ + uint8_t FreqDomainResource[6] = {15, 0, 0, 0, 0, 0}; uint16_t tbSize = 0; uint8_t numPdschSymbols = 11; /* considering pdsch region from symbols 3 to 13 */ uint8_t ssbIdx = 0; @@ -717,7 +718,7 @@ void fillSchSib1Cfg(uint8_t mu, uint8_t bandwidth, uint8_t numSlots, SchSib1Cfg sib1SchCfg->n0 = slotIndex; /* calculate the PRBs */ - freqDomRscAllocType0(((offsetPointA-offset)/6), (numRbs/6), FreqDomainResource); + //freqDomRscAllocType0(((offsetPointA-offset)/6), (numRbs/6), FreqDomainResource); /* fill BWP */ switch(bandwidth) @@ -793,7 +794,7 @@ void fillSchSib1Cfg(uint8_t mu, uint8_t bandwidth, uint8_t numSlots, SchSib1Cfg pdsch->dmrs.dlDmrsScramblingId = pci; pdsch->dmrs.scid = 0; pdsch->dmrs.numDmrsCdmGrpsNoData = 1; - pdsch->dmrs.dmrsPorts = 0; + pdsch->dmrs.dmrsPorts = 0x0001; pdsch->dmrs.mappingType = DMRS_MAP_TYPE_A; /* Type-A */ pdsch->dmrs.nrOfDmrsSymbols = NUM_DMRS_SYMBOLS; pdsch->dmrs.dmrsAddPos = DMRS_ADDITIONAL_POS; diff --git a/src/5gnrsch/sch_common.c b/src/5gnrsch/sch_common.c index f6c8011de..448434cad 100644 --- a/src/5gnrsch/sch_common.c +++ b/src/5gnrsch/sch_common.c @@ -806,7 +806,7 @@ uint8_t schDlRsrcAllocDlMsg(DlMsgAlloc *dlMsgAlloc, SchCellCb *cell, uint16_t cr pdsch->codeword[cwCount].rvIndex = 0; tbSize = schCalcTbSize(*accumalatedSize + TX_PAYLOAD_HDR_LEN); if(tbSize < *accumalatedSize) - *accumalatedSize = tbSize; + *accumalatedSize = tbSize - TX_PAYLOAD_HDR_LEN; pdsch->codeword[cwCount].tbSize = tbSize; } pdsch->dataScramblingId = cell->cellCfg.phyCellId; diff --git a/src/cm/common_def.h b/src/cm/common_def.h index af3cccad2..c60670a5f 100644 --- a/src/cm/common_def.h +++ b/src/cm/common_def.h @@ -57,6 +57,7 @@ /* MAX values */ #define MAX_NUM_CELL 1 #define MAX_NUM_UE 1 +#define MAX_NUM_UE_PER_TTI 1 #define MAX_NUM_LC 11 #define MAX_NUM_SRB 3 /* Max. no of Srbs */ #define MAX_NUM_DRB 29 /* spec 38.331, maxDRB */ diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index e9e8c2604..b98c2cd4e 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -74,6 +74,7 @@ char encBuf[ENC_BUF_MAX_LEN]; 8 UL UL UL UL UL UL UL UL UL UL UL UL UL UL 9 UL UL UL UL UL UL UL UL UL UL UL UL UL UL */ + #ifdef NR_TDD /******************************************************************* * diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 234a9737c..8c776c445 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -11795,7 +11795,7 @@ void freeAperDecodeGnbDuAck(GNBDUConfigurationUpdateAcknowledge_t *gnbDuAck) uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId) { - uint8_t ieIdx=0, arrIdx=0; + uint8_t ieIdx=0, arrIdx=0,ret=ROK; uint8_t ueId =0 , ueIdx =0; uint16_t cellId =0, cellIdx =0, crnti=0; CmLList *f1apPduNode = NULLP; @@ -11822,42 +11822,59 @@ uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId) switch(gnbDuConfigUpdate->protocolIEs.list.array[ieIdx]->id) { case ProtocolIE_ID_id_Served_Cells_To_Delete_List: - { - cellsToDelete = &gnbDuConfigUpdate->protocolIEs.list.array[ieIdx]->value.choice.\ - Served_Cells_To_Delete_List; - if(cellsToDelete->list.array) { - if(cellsToDelete->list.array[arrIdx]) + cellsToDelete = &gnbDuConfigUpdate->protocolIEs.list.array[ieIdx]->value.choice.\ + Served_Cells_To_Delete_List; + if(cellsToDelete->list.array) { - deleteItemIe = (Served_Cells_To_Delete_ItemIEs_t*)cellsToDelete->list.array[arrIdx]; - deleteItem=&deleteItemIe->value.choice.Served_Cells_To_Delete_Item; - if(deleteItem->oldNRCGI.nRCellIdentity.buf) + if(cellsToDelete->list.array[arrIdx]) { - cellIdentity = &deleteItem->oldNRCGI.nRCellIdentity; - bitStringToInt(cellIdentity, &cellId); + deleteItemIe = (Served_Cells_To_Delete_ItemIEs_t*)cellsToDelete->list.array[arrIdx]; + deleteItem=&deleteItemIe->value.choice.Served_Cells_To_Delete_Item; + if(deleteItem->oldNRCGI.nRCellIdentity.buf) + { + cellIdentity = &deleteItem->oldNRCGI.nRCellIdentity; + bitStringToInt(cellIdentity, &cellId); + } } } - } - GET_CELL_IDX(cellId, cellIdx); - if(duCb.actvCellLst[cellIdx] != NULLP) - { - for(ueIdx = 0; ueIdx < duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++) + GET_CELL_IDX(cellId, cellIdx); + if(duCb.actvCellLst[cellIdx] != NULLP) { - crnti = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].crnti; - GET_UE_IDX(crnti,ueId); - BuildAndSendUeContextReleaseReq(cellId, ueId); + if(duCb.actvCellLst[cellIdx]->numActvUes == 0) + { + duCb.actvCellLst[cellId-1]->cellStatus = DELETION_IN_PROGRESS; + ret = duSendCellDeletReq(cellId); + if(ret == RFAILED) + { + DU_LOG("ERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to send cell delete\ + request for cellId[%d]", cellId); + } + } + else + { + for(ueIdx = 0; ueIdx < duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++) + { + crnti = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].crnti; + GET_UE_IDX(crnti,ueId); + ret = BuildAndSendUeContextReleaseReq(cellId, ueId); + if(ret == RFAILED) + { + DU_LOG("ERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to build and send UE delete\ + request for cellId[%d]", cellId); + } + } + } } - } - else - { - DU_LOG("ERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): CellId [%d] not found", cellId); - return RFAILED; + else + { + DU_LOG("ERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): CellId [%d] not found", cellId); + ret = RFAILED; + } + break; } - break; - } - default: break; } @@ -11867,7 +11884,7 @@ uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId) FreeDUConfigUpdate(f1apMsgPdu); deleteFromReservedF1apPduList(f1apPduNode); - return ROK; + return ret; } /******************************************************************* diff --git a/src/phy_stub/phy_stub_thread_hdl.c b/src/phy_stub/phy_stub_thread_hdl.c index f7912f709..0eed378c4 100644 --- a/src/phy_stub/phy_stub_thread_hdl.c +++ b/src/phy_stub/phy_stub_thread_hdl.c @@ -66,7 +66,11 @@ void GenerateTicks() { clock_nanosleep(CLOCK_REALTIME, 0, &req, NULL); /* Send Slot indication indication to lower mac */ - l1BuildAndSendSlotIndication(); + if(l1BuildAndSendSlotIndication() != ROK) + { + DU_LOG("\nERROR --> PHY_STUB : GenerateTicks(): Failed to build and send Slot Indication"); + return; + } } DU_LOG("\nINFO --> PHY_STUB : Slot indication stopped");