From: lal.harshita Date: Tue, 18 Oct 2022 11:02:55 +0000 (+0530) Subject: [Epic-ID: ODUHIGH-475][Task-ID: ODUHIGH-476]Integration fixes upto PRACH scheduling... X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fl2.git;a=commitdiff_plain;h=3eb33bcb19a8e47fcf8b58b417d6fa05919952cf [Epic-ID: ODUHIGH-475][Task-ID: ODUHIGH-476]Integration fixes upto PRACH scheduling in FDD Signed-off-by: lal.harshita Change-Id: I62bcfea3a97eb8f0c95034a1da76b9a5a997078a Signed-off-by: lal.harshita --- diff --git a/build/odu/makefile b/build/odu/makefile index 9a9a641a6..892d38fc7 100644 --- a/build/odu/makefile +++ b/build/odu/makefile @@ -74,7 +74,7 @@ endif # macro for output file name and makefile name # -PLTFRM_FLAGS= -UMSPD -DODU -DINTEL_FAPI #-DNR_DRX -DCALL_FLOW_DEBUG_LOG -DODU_MEMORY_DEBUG_LOG -DODU_SLOT_IND_DEBUG_LOG +PLTFRM_FLAGS= -UMSPD -DODU -DINTEL_FAPI -UODU_MEMORY_DEBUG_LOG -DDEBUG_ASN_PRINT -DDEBUG_PRINT -DERROR_PRINT #-DNR_DRX -DCALL_FLOW_DEBUG_LOG -DODU_SLOT_IND_DEBUG_LOG ifeq ($(MODE),TDD) PLTFRM_FLAGS += -DNR_TDD diff --git a/src/5gnrmac/lwr_mac_fsm.c b/src/5gnrmac/lwr_mac_fsm.c index 63a86c54c..d384c3d6a 100644 --- a/src/5gnrmac/lwr_mac_fsm.c +++ b/src/5gnrmac/lwr_mac_fsm.c @@ -52,9 +52,9 @@ LwrMacCb lwrMacCb; uint8_t UnrestrictedSetNcsTable[MAX_ZERO_CORR_CFG_IDX]; void fapiMacConfigRsp(uint16_t cellId); -uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, MacDlSlot *dlSlot, p_fapi_api_queue_elem_t prevElem); -uint16_t fillUlTtiReq(SlotTimingInfo currTimingInfo, p_fapi_api_queue_elem_t prevElem); -uint16_t fillUlDciReq(SlotTimingInfo currTimingInfo, p_fapi_api_queue_elem_t prevElem); +uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, MacDlSlot *dlSlot, p_fapi_api_queue_elem_t prevElem, fapi_vendor_tx_data_req_t *vendorTxDataReq); +uint16_t fillUlTtiReq(SlotTimingInfo currTimingInfo, p_fapi_api_queue_elem_t prevElem, fapi_vendor_ul_tti_req_t* vendorUlTti); +uint16_t fillUlDciReq(SlotTimingInfo currTimingInfo, p_fapi_api_queue_elem_t prevElem, fapi_vendor_ul_dci_req_t *vendorUlDciReq); uint8_t lwr_mac_procStopReqEvt(SlotTimingInfo slotInfo, p_fapi_api_queue_elem_t prevElem); void lwrMacLayerInit(Region region, Pool pool) @@ -2041,6 +2041,13 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg) vendorMsg->config_req_vendor.carrier_aggregation_level = 0; vendorMsg->config_req_vendor.group_hop_flag = 0; vendorMsg->config_req_vendor.sequence_hop_flag = 0; + vendorMsg->config_req_vendor.urllc_capable = 0; + vendorMsg->config_req_vendor.urllc_mini_slot_mask =0; + vendorMsg->config_req_vendor.nr_of_dl_ports =1; + vendorMsg->config_req_vendor.nr_of_ul_ports =1; + vendorMsg->config_req_vendor.prach_nr_of_rx_ru =1; + vendorMsg->config_req_vendor.ssb_subc_spacing =1; + vendorMsg->config_req_vendor.use_vendor_EpreXSSB = USE_VENDOR_EPREXSSB; vendorMsg->start_req_vendor.sfn = 0; vendorMsg->start_req_vendor.slot = 0; vendorMsg->start_req_vendor.mode = 4; @@ -2053,7 +2060,7 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg) if(!cfgReqQElem) { DU_LOG("\nERROR --> LWR_MAC: Memory allocation failed for config req"); - LWR_MAC_ALLOC(vendorMsgQElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_vendor_msg_t))); + LWR_MAC_FREE(vendorMsgQElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_vendor_msg_t))); return RFAILED; } FILL_FAPI_LIST_ELEM(cfgReqQElem, vendorMsgQElem, FAPI_CONFIG_REQUEST, 1, \ @@ -2062,11 +2069,12 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg) configReq = (fapi_config_req_t *)(cfgReqQElem + 1); memset(configReq, 0, sizeof(fapi_config_req_t)); fillMsgHeader(&configReq->header, FAPI_CONFIG_REQUEST, sizeof(fapi_config_req_t)); -#ifdef NR_TDD - configReq->number_of_tlvs = 25 + 1 + MAX_TDD_PERIODICITY_SLOTS * MAX_SYMB_PER_SLOT; -#else +#ifndef NR_TDD configReq->number_of_tlvs = 25; +#else + configReq->number_of_tlvs = 25 + 1 + MAX_TDD_PERIODICITY_SLOTS * MAX_SYMB_PER_SLOT; #endif + msgLen = sizeof(configReq->number_of_tlvs); if(macCfgParams.dlCarrCfg.pres) @@ -2118,7 +2126,7 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg) //fillTlvs(&configReq->tlvs[index++], FAPI_PRACH_SEQUENCE_LENGTH_TAG, \ sizeof(uint8_t), macCfgParams.prachCfg.prachSeqLen, &msgLen); fillTlvs(&configReq->tlvs[index++], FAPI_PRACH_SUBC_SPACING_TAG, \ - sizeof(uint8_t), macCfgParams.prachCfg.prachSubcSpacing, &msgLen); + sizeof(uint8_t), convertScsValToScsEnum(macCfgParams.prachCfg.prachSubcSpacing), &msgLen); fillTlvs(&configReq->tlvs[index++], FAPI_RESTRICTED_SET_CONFIG_TAG, \ sizeof(uint8_t), macCfgParams.prachCfg.prachRstSetCfg, &msgLen); fillTlvs(&configReq->tlvs[index++], FAPI_NUM_PRACH_FD_OCCASIONS_TAG, @@ -2202,8 +2210,8 @@ uint8_t lwr_mac_procConfigReqEvt(void *msg) if(!headerElem) { DU_LOG("\nERROR --> LWR_MAC: Memory allocation failed for vendor msg in config req"); - LWR_MAC_ALLOC(cfgReqQElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_config_req_t))); - LWR_MAC_ALLOC(vendorMsgQElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_vendor_msg_t))); + LWR_MAC_FREE(cfgReqQElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_config_req_t))); + LWR_MAC_FREE(vendorMsgQElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_vendor_msg_t))); return RFAILED; } FILL_FAPI_LIST_ELEM(headerElem, cfgReqQElem, FAPI_VENDOR_MSG_HEADER_IND, 1, \ @@ -2326,7 +2334,7 @@ uint8_t lwr_mac_procStartReqEvt(void *msg) if(!startReqElem) { DU_LOG("\nERROR --> LWR_MAC: Memory allocation failed for start req"); - LWR_MAC_ALLOC(vendorMsgElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_vendor_msg_t))); + LWR_MAC_FREE(vendorMsgElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_vendor_msg_t))); return RFAILED; } FILL_FAPI_LIST_ELEM(startReqElem, vendorMsgElem, FAPI_START_REQUEST, 1, \ @@ -2341,8 +2349,8 @@ uint8_t lwr_mac_procStartReqEvt(void *msg) if(!headerElem) { DU_LOG("\nERROR --> LWR_MAC: Memory allocation failed for vendor msg in config req"); - LWR_MAC_ALLOC(startReqElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_start_req_t))); - LWR_MAC_ALLOC(vendorMsgElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_vendor_msg_t))); + LWR_MAC_FREE(startReqElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_start_req_t))); + LWR_MAC_FREE(vendorMsgElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_vendor_msg_t))); return RFAILED; } FILL_FAPI_LIST_ELEM(headerElem, startReqElem, FAPI_VENDOR_MSG_HEADER_IND, 1, \ @@ -3096,7 +3104,7 @@ void fillDlMsgDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *pdcchInfo,\ * @return ROK * ******************************************************************/ -uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, MacDlSlot *dlSlot, int8_t dlMsgSchInfoIdx, \ +uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, fapi_vendor_dl_tti_req_pdu_t *dlTtiVendorPdu, MacDlSlot *dlSlot, int8_t dlMsgSchInfoIdx, \ RntiType rntiType, uint8_t coreSetType, uint8_t ueIdx) { if(dlTtiReqPdu != NULLP) @@ -3153,6 +3161,13 @@ uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, MacDlSlot *dlSlot, int8 /* Calculating PDU length. Considering only one dl dci pdu for now */ dlTtiReqPdu->pduSize = sizeof(fapi_dl_pdcch_pdu_t); + + /* Filling Vendor message PDU */ + dlTtiVendorPdu->pdu_type = FAPI_PDCCH_PDU_TYPE; + dlTtiVendorPdu->pdu_size = sizeof(fapi_vendor_dl_pdcch_pdu_t); + dlTtiVendorPdu->pdu.pdcch_pdu.num_dl_dci = dlTtiReqPdu->pdu.pdcch_pdu.numDlDci; + dlTtiVendorPdu->pdu.pdcch_pdu.dl_dci[0].epre_ratio_of_pdcch_to_ssb = 0; + dlTtiVendorPdu->pdu.pdcch_pdu.dl_dci[0].epre_ratio_of_dmrs_to_ssb = 0; } return ROK; @@ -3177,7 +3192,7 @@ uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, MacDlSlot *dlSlot, int8 * ******************************************************************/ -void fillPdschPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, PdschCfg *pdschInfo, +void fillPdschPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, fapi_vendor_dl_tti_req_pdu_t *dlTtiVendorPdu, PdschCfg *pdschInfo, BwpCfg bwp, uint16_t pduIndex) { uint8_t idx; @@ -3234,6 +3249,15 @@ void fillPdschPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, PdschCfg *pdschInfo, dlTtiReqPdu->pdu.pdsch_pdu.dmrsAddPos = pdschInfo->dmrs.dmrsAddPos; dlTtiReqPdu->pduSize = sizeof(fapi_dl_pdsch_pdu_t); + + /* DL TTI Request vendor message */ + dlTtiVendorPdu->pdu_type = FAPI_PDSCH_PDU_TYPE; + dlTtiVendorPdu->pdu_size = sizeof(fapi_vendor_dl_pdsch_pdu_t); + dlTtiVendorPdu->pdu.pdsch_pdu.nr_of_antenna_ports = 1; + for(int i =0; i< FAPI_VENDOR_MAX_TXRU_NUM; i++) + { + dlTtiVendorPdu->pdu.pdsch_pdu.tx_ru_idx[i] =0; + } } } @@ -3636,264 +3660,286 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) 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) { - GET_CELL_IDX(currTimingInfo.cellId, cellIdx); - /* consider phy delay */ - ADD_DELTA_TO_TIME(currTimingInfo,dlTtiReqTimingInfo,PHY_DELTA_DL); - dlTtiReqTimingInfo.cellId = currTimingInfo.cellId; - - macCellCfg = macCb.macCell[cellIdx]->macCellCfg; - - currDlSlot = &macCb.macCell[cellIdx]->dlSlot[dlTtiReqTimingInfo.slot]; - - LWR_MAC_ALLOC(dlTtiElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_dl_tti_req_t))); - if(dlTtiElem) - { - FILL_FAPI_LIST_ELEM(dlTtiElem, NULLP, FAPI_DL_TTI_REQUEST, 1, \ - sizeof(fapi_dl_tti_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 DL TTI req"); - LWR_MAC_FREE(dlTtiElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_dl_tti_req_t))); - return RFAILED; - } - FILL_FAPI_LIST_ELEM(headerElem, dlTtiElem, 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; - - /* Fill Dl TTI Request */ - dlTtiReq = (fapi_dl_tti_req_t *)(dlTtiElem +1); - memset(dlTtiReq, 0, sizeof(fapi_dl_tti_req_t)); - fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, sizeof(fapi_dl_tti_req_t)); - - dlTtiReq->sfn = dlTtiReqTimingInfo.sfn; - dlTtiReq->slot = dlTtiReqTimingInfo.slot; - dlTtiReq->nPdus = calcDlTtiReqPduCount(currDlSlot); /* get total Pdus */ - nPdu = dlTtiReq->nPdus; - dlTtiReq->nGroup = 0; - if(dlTtiReq->nPdus > 0) - { - if(currDlSlot->dlInfo.isBroadcastPres) - { - if(currDlSlot->dlInfo.brdcstAlloc.ssbTrans) - { - if(dlTtiReq->pdus != NULLP) - { - for(idx = 0; idx < currDlSlot->dlInfo.brdcstAlloc.ssbIdxSupported; idx++) - { - fillSsbPdu(&dlTtiReq->pdus[numPduEncoded], &macCellCfg,\ - currDlSlot, idx, dlTtiReq->sfn); - numPduEncoded++; - } - } - DU_LOG("\033[1;31m"); - DU_LOG("\nDEBUG --> LWR_MAC: MIB sent.."); - DU_LOG("\033[0m"); - } - - if(currDlSlot->dlInfo.brdcstAlloc.sib1Trans) - { - /* Filling SIB1 param */ - if(numPduEncoded != nPdu) - { - rntiType = SI_RNTI_TYPE; - fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], currDlSlot, -1, \ - rntiType, CORESET_TYPE0, MAX_NUM_UE); - numPduEncoded++; - fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], - &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"); - } - } - - if(currDlSlot->pageAllocInfo != NULLP) - { - /* Filling DL Paging Alloc param */ - if(numPduEncoded != nPdu) - { - rntiType = P_RNTI_TYPE; - fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], currDlSlot, -1, \ - rntiType, CORESET_TYPE0, MAX_NUM_UE); - numPduEncoded++; - fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], - &currDlSlot->pageAllocInfo->pagePdschCfg, - currDlSlot->pageAllocInfo->bwp, - pduIndex); - dlTtiReq->ue_grp_info[dlTtiReq->nGroup].pduIdx[pduIndex] = pduIndex; - pduIndex++; - numPduEncoded++; - } - DU_LOG("\033[1;34m"); - DU_LOG("\nDEBUG --> LWR_MAC: PAGE sent..."); - DU_LOG("\033[0m"); - } - - for(ueIdx=0; ueIdxdlInfo.rarAlloc[ueIdx] != NULLP) - { - /* Filling RAR param */ - rntiType = RA_RNTI_TYPE; - if((currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || \ - (currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDCCH_PDU)) - { - fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \ - currDlSlot, -1, rntiType, CORESET_TYPE0, ueIdx); - numPduEncoded++; - } - if((currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || \ - (currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDSCH_PDU)) - { - fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], - &currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg, - currDlSlot->dlInfo.rarAlloc[ueIdx]->bwp, - pduIndex); - numPduEncoded++; - pduIndex++; - - DU_LOG("\033[1;32m"); - DU_LOG("\nDEBUG --> LWR_MAC: RAR sent..."); - DU_LOG("\033[0m"); - } - } - - if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP) - { - for(idx=0; idxdlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; idx++) - { - /* Filling Msg4 param */ - if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) || \ - (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDCCH_PDU)) - { - if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.isMsg4Pdu) - { - rntiType = TC_RNTI_TYPE; - fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \ - currDlSlot, idx, rntiType, CORESET_TYPE0, ueIdx); - } - else - { - /* Filling other DL msg params */ - rntiType = C_RNTI_TYPE; - fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \ - currDlSlot, idx, rntiType, CORESET_TYPE1, ueIdx); - } - numPduEncoded++; - } - - if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.dlMsgPdu != NULLP) - { - if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) || \ - (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDSCH_PDU)) - { - fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], \ - &currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgPdschCfg,\ - currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].bwp, pduIndex); - numPduEncoded++; - pduIndex++; - - DU_LOG("\033[1;32m"); - if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.isMsg4Pdu) - { - DU_LOG("\nDEBUG --> LWR_MAC: MSG4 sent..."); - } - else - { - DU_LOG("\nDEBUG --> LWR_MAC: DL MSG sent..."); - } - DU_LOG("\033[0m"); - } - - } - /* else - { - MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc)); - currDlSlot->dlInfo.dlMsgAlloc[ueIdx] = NULLP; - } - */ - } - } - } - - dlTtiReq->ue_grp_info[dlTtiReq->nGroup].nUe = MAX_NUM_UE_PER_TTI; - dlTtiReq->nGroup++; + GET_CELL_IDX(currTimingInfo.cellId, cellIdx); + /* consider phy delay */ + ADD_DELTA_TO_TIME(currTimingInfo,dlTtiReqTimingInfo,PHY_DELTA_DL); + dlTtiReqTimingInfo.cellId = currTimingInfo.cellId; + + macCellCfg = macCb.macCell[cellIdx]->macCellCfg; + + currDlSlot = &macCb.macCell[cellIdx]->dlSlot[dlTtiReqTimingInfo.slot]; + + /* Vendor Message */ + fapi_vendor_msg_t *vendorMsg; + p_fapi_api_queue_elem_t vendorMsgQElem; + /* Allocte And fill Vendor msg */ + LWR_MAC_ALLOC(vendorMsgQElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_vendor_msg_t))); + if(!vendorMsgQElem) + { + DU_LOG("\nERROR --> LWR_MAC: Memory allocation failed for vendor msg in config req"); + return RFAILED; + } + FILL_FAPI_LIST_ELEM(vendorMsgQElem, NULLP, FAPI_VENDOR_MESSAGE, 1, sizeof(fapi_vendor_msg_t)); + vendorMsg = (fapi_vendor_msg_t *)(vendorMsgQElem + 1); + fillMsgHeader(&vendorMsg->header, FAPI_VENDOR_MESSAGE, sizeof(fapi_vendor_msg_t)); + + LWR_MAC_ALLOC(dlTtiElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_dl_tti_req_t))); + if(dlTtiElem) + { + FILL_FAPI_LIST_ELEM(dlTtiElem, NULLP, FAPI_DL_TTI_REQUEST, 1, \ + sizeof(fapi_dl_tti_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 DL TTI req"); + LWR_MAC_FREE(dlTtiElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_dl_tti_req_t))); + return RFAILED; + } + + FILL_FAPI_LIST_ELEM(headerElem, dlTtiElem, FAPI_VENDOR_MSG_HEADER_IND, 1, \ + sizeof(fapi_msg_header_t)); + msgHeader = (fapi_msg_header_t *)(headerElem + 1); + msgHeader->num_msg = 2; + msgHeader->handle = 0; + + /* Fill Dl TTI Request */ + dlTtiReq = (fapi_dl_tti_req_t *)(dlTtiElem +1); + memset(dlTtiReq, 0, sizeof(fapi_dl_tti_req_t)); + fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, sizeof(fapi_dl_tti_req_t)); + + dlTtiReq->sfn = dlTtiReqTimingInfo.sfn; + dlTtiReq->slot = dlTtiReqTimingInfo.slot; + dlTtiReq->nPdus = calcDlTtiReqPduCount(currDlSlot); /* get total Pdus */ + nPdu = dlTtiReq->nPdus; + + vendorMsg->p7_req_vendor.dl_tti_req.num_pdus = nPdu; + vendorMsg->p7_req_vendor.dl_tti_req.sym = 0; + + dlTtiReq->nGroup = 0; + if(dlTtiReq->nPdus > 0) + { + if(currDlSlot->dlInfo.isBroadcastPres) + { + if(currDlSlot->dlInfo.brdcstAlloc.ssbTrans) + { + if(dlTtiReq->pdus != NULLP) + { + for(idx = 0; idx < currDlSlot->dlInfo.brdcstAlloc.ssbIdxSupported; idx++) + { + fillSsbPdu(&dlTtiReq->pdus[numPduEncoded], &macCellCfg,\ + currDlSlot, idx, dlTtiReq->sfn); + numPduEncoded++; + } + } + DU_LOG("\033[1;31m"); + DU_LOG("\nDEBUG --> LWR_MAC: MIB sent.."); + DU_LOG("\033[0m"); + } + + if(currDlSlot->dlInfo.brdcstAlloc.sib1Trans) + { + /* Filling SIB1 param */ + if(numPduEncoded != nPdu) + { + rntiType = SI_RNTI_TYPE; + + /* PDCCH PDU */ + fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], + currDlSlot, -1, rntiType, CORESET_TYPE0, MAX_NUM_UE); + numPduEncoded++; + + /* PDSCH PDU */ + fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], + &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"); + } + } + + if(currDlSlot->pageAllocInfo != NULLP) + { + /* Filling DL Paging Alloc param */ + if(numPduEncoded != nPdu) + { + rntiType = P_RNTI_TYPE; + fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], currDlSlot, -1, \ + rntiType, CORESET_TYPE0, MAX_NUM_UE); + numPduEncoded++; + fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], + &currDlSlot->pageAllocInfo->pagePdschCfg, + currDlSlot->pageAllocInfo->bwp, + pduIndex); + dlTtiReq->ue_grp_info[dlTtiReq->nGroup].pduIdx[pduIndex] = pduIndex; + pduIndex++; + numPduEncoded++; + } + DU_LOG("\033[1;34m"); + DU_LOG("\nDEBUG --> LWR_MAC: PAGE sent..."); + DU_LOG("\033[0m"); + } + + for(ueIdx=0; ueIdxdlInfo.rarAlloc[ueIdx] != NULLP) + { + /* Filling RAR param */ + rntiType = RA_RNTI_TYPE; + if((currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || \ + (currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDCCH_PDU)) + { + fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], + currDlSlot, -1, rntiType, CORESET_TYPE0, ueIdx); + numPduEncoded++; + } + if((currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || \ + (currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDSCH_PDU)) + { + fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], + &currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg, + currDlSlot->dlInfo.rarAlloc[ueIdx]->bwp, + pduIndex); + numPduEncoded++; + pduIndex++; + + DU_LOG("\033[1;32m"); + DU_LOG("\nDEBUG --> LWR_MAC: RAR sent..."); + DU_LOG("\033[0m"); + } + } + + if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP) + { + for(idx=0; idxdlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; idx++) + { + /* Filling Msg4 param */ + if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) || \ + (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDCCH_PDU)) + { + if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.isMsg4Pdu) + { + rntiType = TC_RNTI_TYPE; + fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], + currDlSlot, idx, rntiType, CORESET_TYPE0, ueIdx); + } + else + { + /* Filling other DL msg params */ + rntiType = C_RNTI_TYPE; + fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], + currDlSlot, idx, rntiType, CORESET_TYPE1, ueIdx); + } + numPduEncoded++; + } + + if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.dlMsgPdu != NULLP) + { + if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) || \ + (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDSCH_PDU)) + { + fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], \ + &currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgPdschCfg,\ + currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].bwp, pduIndex); + numPduEncoded++; + pduIndex++; + + DU_LOG("\033[1;32m"); + if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.isMsg4Pdu) + { + DU_LOG("\nDEBUG --> LWR_MAC: MSG4 sent..."); + } + else + { + DU_LOG("\nDEBUG --> LWR_MAC: DL MSG sent..."); + } + DU_LOG("\033[0m"); + } + + } + /* else + { + MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc)); + currDlSlot->dlInfo.dlMsgAlloc[ueIdx] = NULLP; + } + */ + } + } + } + + 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"); + DU_LOG("\nDEBUG --> LWR_MAC: Sending DL TTI Request"); #endif - /* Intel L1 expects UL_TTI.request following DL_TTI.request */ - fillUlTtiReq(currTimingInfo, dlTtiElem); - msgHeader->num_msg++; - - /* Intel L1 expects UL_DCI.request following DL_TTI.request */ - fillUlDciReq(dlTtiReqTimingInfo, dlTtiElem->p_next); - msgHeader->num_msg++; - - /* send Tx-DATA req message */ - sendTxDataReq(dlTtiReqTimingInfo, currDlSlot, 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 - { + /* Intel L1 expects UL_TTI.request following DL_TTI.request */ + fillUlTtiReq(currTimingInfo, dlTtiElem, &(vendorMsg->p7_req_vendor.ul_tti_req)); + msgHeader->num_msg++; + + /* Intel L1 expects UL_DCI.request following DL_TTI.request */ + fillUlDciReq(dlTtiReqTimingInfo, dlTtiElem->p_next, &(vendorMsg->p7_req_vendor.ul_dci_req)); + msgHeader->num_msg++; + + /* send Tx-DATA req message */ + sendTxDataReq(dlTtiReqTimingInfo, currDlSlot, dlTtiElem->p_next->p_next, &(vendorMsg->p7_req_vendor.tx_data_req)); + 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 + { #ifdef ODU_SLOT_IND_DEBUG_LOG - DU_LOG("\nDEBUG --> LWR_MAC: Sending DL TTI Request"); + DU_LOG("\nDEBUG --> LWR_MAC: Sending DL TTI Request"); #endif - - /* Intel L1 expects UL_TTI.request following DL_TTI.request */ - fillUlTtiReq(currTimingInfo, dlTtiElem); - msgHeader->num_msg++; - - /* Intel L1 expects UL_DCI.request following DL_TTI.request */ - fillUlDciReq(dlTtiReqTimingInfo, dlTtiElem->p_next); - msgHeader->num_msg++; - - prevElem = dlTtiElem->p_next->p_next; - } - - if(macCb.macCell[cellIdx]->state == CELL_TO_BE_STOPPED) - { - /* Intel L1 expects UL_DCI.request following DL_TTI.request */ - lwr_mac_procStopReqEvt(currTimingInfo, prevElem); - msgHeader->num_msg++; - macCb.macCell[cellIdx]->state = CELL_STOP_IN_PROGRESS; - } - LwrMacSendToL1(headerElem); - memset(currDlSlot, 0, sizeof(MacDlSlot)); - return ROK; - } - else - { - DU_LOG("\nERROR --> LWR_MAC: Failed to allocate memory for DL TTI Request"); - memset(currDlSlot, 0, sizeof(MacDlSlot)); - return RFAILED; - } + /* Intel L1 expects UL_TTI.request following DL_TTI.request */ + fillUlTtiReq(currTimingInfo, dlTtiElem, &(vendorMsg->p7_req_vendor.ul_tti_req)); + msgHeader->num_msg++; + + /* Intel L1 expects UL_DCI.request following DL_TTI.request */ + fillUlDciReq(dlTtiReqTimingInfo, dlTtiElem->p_next, &(vendorMsg->p7_req_vendor.ul_dci_req)); + msgHeader->num_msg++; + + prevElem = dlTtiElem->p_next->p_next; + } + + if(macCb.macCell[cellIdx]->state == CELL_TO_BE_STOPPED) + { + /* Intel L1 expects UL_DCI.request following DL_TTI.request */ + lwr_mac_procStopReqEvt(currTimingInfo, prevElem); + msgHeader->num_msg++; + macCb.macCell[cellIdx]->state = CELL_STOP_IN_PROGRESS; + prevElem = prevElem->p_next; + } + prevElem->p_next = vendorMsgQElem; + LwrMacSendToL1(headerElem); + memset(currDlSlot, 0, sizeof(MacDlSlot)); + return ROK; + } + else + { + DU_LOG("\nERROR --> LWR_MAC: Failed to allocate memory for DL TTI Request"); + memset(currDlSlot, 0, sizeof(MacDlSlot)); + return RFAILED; + } } else { - lwr_mac_procInvalidEvt(&currTimingInfo); - return RFAILED; + lwr_mac_procInvalidEvt(&currTimingInfo); + return RFAILED; } #endif return ROK; @@ -3915,7 +3961,7 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) * RFAILED - failure * * ****************************************************************/ -uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, MacDlSlot *dlSlot, p_fapi_api_queue_elem_t prevElem) +uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, MacDlSlot *dlSlot, p_fapi_api_queue_elem_t prevElem, fapi_vendor_tx_data_req_t *vendorTxDataReq) { #ifdef INTEL_FAPI #ifdef CALL_FLOW_DEBUG_LOG @@ -3949,6 +3995,8 @@ uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, MacDlSlot *dlSlot, p_fapi_ memset(txDataReq, 0, sizeof(fapi_tx_data_req_t)); fillMsgHeader(&txDataReq->header, FAPI_TX_DATA_REQUEST, sizeof(fapi_tx_data_req_t)); + vendorTxDataReq->sym = 0; + txDataReq->sfn = currTimingInfo.sfn; txDataReq->slot = currTimingInfo.slot; if(dlSlot->dlInfo.brdcstAlloc.sib1Trans) @@ -4144,7 +4192,7 @@ void fillPrachPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, MacCellCfg *macCellCfg, Ma * RFAILED - failure * * ****************************************************************/ -void fillPuschPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, MacCellCfg *macCellCfg, MacUlSlot *currUlSlot) +void fillPuschPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, fapi_vendor_ul_tti_req_pdu_t *ulTtiVendorPdu, MacCellCfg *macCellCfg, MacUlSlot *currUlSlot) { if(ulTtiReqPdu != NULLP) { @@ -4205,6 +4253,15 @@ void fillPuschPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, MacCellCfg *macCellCfg, Ma ulTtiReqPdu->pdu.pusch_pdu.puschData.numCb = 0; ulTtiReqPdu->pduSize = sizeof(fapi_ul_pusch_pdu_t); + + /* UL TTI Vendor PDU */ + ulTtiVendorPdu->pdu_type = FAPI_PUSCH_PDU_TYPE; + ulTtiVendorPdu->pdu.pusch_pdu.nr_of_antenna_ports=1; + ulTtiVendorPdu->pdu.pusch_pdu.nr_of_rx_ru=1; + for(int i =0; i< FAPI_VENDOR_MAX_RXRU_NUM; i++) + { + ulTtiVendorPdu->pdu.pusch_pdu.rx_ru_idx[i]=0; + } } } @@ -4223,7 +4280,7 @@ void fillPuschPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, MacCellCfg *macCellCfg, Ma * RFAILED - failure * * ****************************************************************/ -void fillPucchPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, MacCellCfg *macCellCfg,\ +void fillPucchPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, fapi_vendor_ul_tti_req_pdu_t *ulTtiVendorPdu, MacCellCfg *macCellCfg,\ MacUlSlot *currUlSlot) { if(ulTtiReqPdu != NULLP) @@ -4270,6 +4327,15 @@ void fillPucchPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, MacCellCfg *macCellCfg,\ ulTtiReqPdu->pdu.pucch_pdu.beamforming.rx_bfi[0].beamIdx[0].beamidx = 0; ulTtiReqPdu->pduSize = sizeof(fapi_ul_pucch_pdu_t); + + /* UL TTI Vendor PDU */ + ulTtiVendorPdu->pdu_type = FAPI_PUCCH_PDU_TYPE; + ulTtiVendorPdu->pdu.pucch_pdu.nr_of_rx_ru=1; + ulTtiVendorPdu->pdu.pucch_pdu.group_id=0; + for(int i =0; ipdu.pucch_pdu.rx_ru_idx[i]=0; + } } } @@ -4291,7 +4357,7 @@ void fillPucchPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, MacCellCfg *macCellCfg,\ * RFAILED - failure * ******************************************************************/ -uint16_t fillUlTtiReq(SlotTimingInfo currTimingInfo, p_fapi_api_queue_elem_t prevElem) +uint16_t fillUlTtiReq(SlotTimingInfo currTimingInfo, p_fapi_api_queue_elem_t prevElem, fapi_vendor_ul_tti_req_t* vendorUlTti) { #ifdef CALL_FLOW_DEBUG_LOG DU_LOG("\nCall Flow: ENTMAC -> ENTLWRMAC : UL_TTI_REQUEST\n"); @@ -4318,56 +4384,61 @@ uint16_t fillUlTtiReq(SlotTimingInfo currTimingInfo, p_fapi_api_queue_elem_t pre 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); - ulTtiReq->nGroup = 0; - if(ulTtiReq->nPdus > 0) - { - /* Fill Prach Pdu */ - if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PRACH) - { - pduIdx++; - fillPrachPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot); - } - - /* Fill PUSCH PDU */ - if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PUSCH) - { - pduIdx++; - fillPuschPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot); - } - /* Fill PUCCH PDU */ - if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_UCI) - { - pduIdx++; - fillPucchPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot); - } - } + 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++; + } + } #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; @@ -4545,7 +4616,7 @@ void fillUlDciPdu(fapi_dl_dci_t *ulDciPtr, DciInfo *schDciInfo) * @return ROK * ******************************************************************/ -uint8_t fillUlDciPdcchPdu(fapi_dci_pdu_t *ulDciReqPdu, DlSchedInfo *dlInfo, uint8_t coreSetType) +uint8_t fillUlDciPdcchPdu(fapi_dci_pdu_t *ulDciReqPdu, fapi_vendor_dci_pdu_t *vendorUlDciPdu, DlSchedInfo *dlInfo, uint8_t coreSetType) { if(ulDciReqPdu != NULLP) { @@ -4569,6 +4640,11 @@ uint8_t fillUlDciPdcchPdu(fapi_dci_pdu_t *ulDciReqPdu, DlSchedInfo *dlInfo, uint /* Calculating PDU length. Considering only one Ul dci pdu for now */ ulDciReqPdu->pduSize = sizeof(fapi_dl_pdcch_pdu_t); + + /* Vendor UL DCI PDU */ + vendorUlDciPdu->pdcch_pdu_config.num_dl_dci = ulDciReqPdu->pdcchPduConfig.numDlDci; + vendorUlDciPdu->pdcch_pdu_config.dl_dci[0].epre_ratio_of_pdcch_to_ssb = 0; + vendorUlDciPdu->pdcch_pdu_config.dl_dci[0].epre_ratio_of_dmrs_to_ssb = 0; } return ROK; } @@ -4589,7 +4665,7 @@ uint8_t fillUlDciPdcchPdu(fapi_dci_pdu_t *ulDciReqPdu, DlSchedInfo *dlInfo, uint * RFAILED - failure * ******************************************************************/ -uint16_t fillUlDciReq(SlotTimingInfo currTimingInfo, p_fapi_api_queue_elem_t prevElem) +uint16_t fillUlDciReq(SlotTimingInfo currTimingInfo, p_fapi_api_queue_elem_t prevElem, fapi_vendor_ul_dci_req_t *vendorUlDciReq) { #ifdef INTEL_FAPI uint8_t cellIdx =0; @@ -4618,11 +4694,13 @@ uint16_t fillUlDciReq(SlotTimingInfo currTimingInfo, p_fapi_api_queue_elem_t pre ulDciReq->slot = ulDciReqTimingInfo.slot; if(currDlSlot->dlInfo.ulGrant != NULLP) { + vendorUlDciReq->sym = 0; ulDciReq->numPdus = 1; // No. of PDCCH PDUs + vendorUlDciReq->num_pdus = ulDciReq->numPdus; if(ulDciReq->numPdus > 0) { /* Fill PDCCH configuration Pdu */ - fillUlDciPdcchPdu(&ulDciReq->pdus[numPduEncoded], &currDlSlot->dlInfo, CORESET_TYPE1); + fillUlDciPdcchPdu(&ulDciReq->pdus[numPduEncoded], &vendorUlDciReq->pdus[numPduEncoded], &currDlSlot->dlInfo, CORESET_TYPE1); numPduEncoded++; /* free UL GRANT at SCH */ MAC_FREE(currDlSlot->dlInfo.ulGrant, sizeof(DciInfo)); @@ -4705,6 +4783,7 @@ void sendToLowerMac(uint16_t msgType, uint32_t msgLen, void *msg) lwrMacCb.event = msgType; fapiEvtHdlr[lwrMacCb.phyState][lwrMacCb.event](msg); } + /********************************************************************** End of file **********************************************************************/ diff --git a/src/5gnrmac/lwr_mac_handle_phy.c b/src/5gnrmac/lwr_mac_handle_phy.c index bce5ed4d4..a8f251ca2 100644 --- a/src/5gnrmac/lwr_mac_handle_phy.c +++ b/src/5gnrmac/lwr_mac_handle_phy.c @@ -114,7 +114,6 @@ uint8_t procSlotInd(fapi_slot_ind_t *fapiSlotInd) slotInd->cellId = lwrMacCb.cellCb[0].cellId; slotInd->sfn = fapiSlotInd->sfn; slotInd->slot = fapiSlotInd->slot; - FILL_PST_LWR_MAC_TO_MAC(pst, EVENT_SLOT_IND_TO_MAC); pst.selector = ODU_SELECTOR_LWLC; ret = (*sendSlotIndOpts[pst.selector])(&pst, slotInd); @@ -188,18 +187,18 @@ uint8_t procRachInd(fapi_rach_indication_t *fapiRachInd) RachPduInfo *rachPdu = NULLP; RachInd *rachInd = NULLP; - MAC_ALLOC_SHRABL_BUF(rachInd, sizeof(RachInd)); - if(!rachInd) - { - DU_LOG("\nERROR --> LWR_MAC : Memory Allocation failed in procRachInd"); - return RFAILED; - } if(!fapiRachInd->numPdus) { DU_LOG("\nDEBUG --> LWR_MAC : No PDU in RACH.indication at [%d, %d]", fapiRachInd->sfn, fapiRachInd->slot); return ROK; } + MAC_ALLOC_SHRABL_BUF(rachInd, sizeof(RachInd)); + if(!rachInd) + { + DU_LOG("\nERROR --> LWR_MAC : Memory Allocation failed in procRachInd"); + return RFAILED; + } rachInd->cellId = lwrMacCb.cellCb[0].cellId; rachInd->timingInfo.sfn = fapiRachInd->sfn; rachInd->timingInfo.slot = fapiRachInd->slot; @@ -534,6 +533,7 @@ void callFlowFromPhyToLwrMac(uint16_t msgId) } DU_LOG("\nCall Flow: PHY -> ENTLWRMAC : %s\n",message); } + /******************************************************************* * * @brief Processes message from PHY @@ -559,6 +559,7 @@ void procPhyMessages(uint16_t msgType, uint32_t msgSize, void *msg) #ifdef CALL_FLOW_DEBUG_LOG callFlowFromPhyToLwrMac(header->msg_id); #endif + switch(header->msg_id) { #ifdef INTEL_TIMER_MODE diff --git a/src/5gnrmac/lwr_mac_phy.h b/src/5gnrmac/lwr_mac_phy.h index 516fa1715..54ae8db13 100644 --- a/src/5gnrmac/lwr_mac_phy.h +++ b/src/5gnrmac/lwr_mac_phy.h @@ -32,6 +32,18 @@ typedef enum MSG_TX_ERR }ErrorCode; +#ifdef ODU_MEMORY_DEBUG_LOG +#define WLS_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\ +{\ + printf("\n%s=== %s +%d, %s, %lu, %p", \ + _macro, _file, _line, _func, (uint64_t)_size, _datPtr); \ +} +#else +#define WLS_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr) \ +{\ +} +#endif + #ifdef INTEL_WLS_MEM #define LWR_MAC_WLS_BUF_SIZE 32000 /* Size of WLS memory block */ #define EVT_START_WLS_RCVR 1 @@ -42,7 +54,10 @@ typedef enum uint8_t _ret; \ _ret = SGetSBufWls(0, 0, (Data **)&_datPtr, _size); \ if(_ret == ROK) \ - memset(_datPtr, 0, _size); \ + {\ + WLS_MEM_LOG("WLSMEM_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\ + memset(_datPtr, 0, _size); \ + }\ else \ _datPtr = NULLP; \ } @@ -51,6 +66,7 @@ typedef enum #define WLS_MEM_FREE(_datPtr, _size) \ if(_datPtr) \ { \ + WLS_MEM_LOG("WLSMEM_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\ SPutSBufWls(0, 0, (Data *)_datPtr, _size); \ _datPtr = NULLP; \ } diff --git a/src/5gnrmac/mac_utils.h b/src/5gnrmac/mac_utils.h index f982b6abd..16166d094 100644 --- a/src/5gnrmac/mac_utils.h +++ b/src/5gnrmac/mac_utils.h @@ -26,11 +26,12 @@ #ifdef ODU_MEMORY_DEBUG_LOG #define MAC_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\ {\ - printf("\n%s=== %s +%d, %s, %d, %p\n", \ - _macro, _file, _line, _func, _size, _datPtr); \ + printf("\n%s=== %s +%d, %s, %lu, %p", \ + _macro, _file, _line, _func, (uint64_t)_size, _datPtr); \ } #else -#define MAC_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr) {} +#define MAC_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr){\ +} #endif /* allocate and zero out a MAC static buffer */ diff --git a/src/5gnrrlc/rlc_utils.h b/src/5gnrrlc/rlc_utils.h index 1fd31eeb4..14a5e0dec 100755 --- a/src/5gnrrlc/rlc_utils.h +++ b/src/5gnrrlc/rlc_utils.h @@ -107,8 +107,8 @@ extern "C" { #ifdef ODU_MEMORY_DEBUG_LOG #define RLC_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\ {\ - printf("\n%s=== %s +%d, %s, %d, %p\n", \ - _macro, _file, _line, _func, _size, _datPtr); \ + printf("\n%s=== %s +%d, %s, %lu, %p", \ + _macro, _file, _line, _func, (uint64_t)_size, _datPtr); \ } #else #define RLC_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr) {} diff --git a/src/5gnrsch/sch_utils.h b/src/5gnrsch/sch_utils.h index 5d3d41e5d..cc48c4b7b 100644 --- a/src/5gnrsch/sch_utils.h +++ b/src/5gnrsch/sch_utils.h @@ -51,11 +51,12 @@ #ifdef ODU_MEMORY_DEBUG_LOG #define SCH_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\ {\ - printf("\n%s=== %s +%d, %s, %d, %p\n", \ - _macro, _file, _line, _func, _size, _datPtr); \ + printf("\n%s=== %s +%d, %s, %lu, %p", \ + _macro, _file, _line, _func, (uint64_t)_size, (void *)_datPtr); \ } #else -#define SCH_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr) {} +#define SCH_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr){\ +} #endif #define SCH_ALLOC(_datPtr, _size) \ @@ -65,8 +66,8 @@ (Data **)&_datPtr, _size); \ if(_ret == ROK) \ { \ - SCH_MEM_LOG("SCH_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\ memset(_datPtr, 0, _size); \ + SCH_MEM_LOG("SCH_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\ } \ else \ { \ diff --git a/src/cm/cm_hash.c b/src/cm/cm_hash.c index f6c2a2f03..c8c6a5824 100644 --- a/src/cm/cm_hash.c +++ b/src/cm/cm_hash.c @@ -81,23 +81,7 @@ *********************************************************************21*/ -/* header include files -- defines (.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_hash.h" /* common hash functions */ -#include "cm_err.h" /* common functions error */ - -/* header include -- typedef structs (.x) */ - -#include "gen.x" /* general */ -#include "ssi.x" /* system services */ -#include "cm_lib.x" /* common library functions */ -#include "cm_hash.x" /* common hash functions */ +#include /* local defines */ diff --git a/src/cm/cm_inet.c b/src/cm/cm_inet.c index 0278b08bd..69f8035dc 100644 --- a/src/cm/cm_inet.c +++ b/src/cm/cm_inet.c @@ -45,12 +45,7 @@ /* 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 interface */ +#include "common_def.h" #include "cm_inet.h" /* socket library file */ /*cm_inet_c_001.main_35 : Updated for C++ compilation */ @@ -145,14 +140,10 @@ extern "C" { #endif /* __cplusplus */ /* header/extern include files (.x) */ -#include "gen.x" /* general */ -#include "ssi.x" /* system services interface */ #include "cm_inet.x" /* socket library file */ -#include "cm_lib.x" /* lib library file */ #ifdef NTL_LIB #include "ntl_lib.h" #endif -#include "du_log.h" /* local defines */ diff --git a/src/cm/cm_mblk.c b/src/cm/cm_mblk.c index e2fee9b23..03c4583b8 100644 --- a/src/cm/cm_mblk.c +++ b/src/cm/cm_mblk.c @@ -30,18 +30,7 @@ /* header include files (.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 services */ -#include "cm_mblk.h" /* Header file */ - -/* header/extern include files (.x) */ -#include "gen.x" /* general layer */ -#include "ssi.x" /* system services */ -#include "cm_lib.x" /* Common library */ -#include "cm_mblk.x" /* Typedef file */ +#include "common_def.h" /* Header file */ #ifdef SS_LOCKLESS_MEMORY pthread_t tmpRegTidMap[20]; diff --git a/src/cm/common_def.c b/src/cm/common_def.c index 0faff3997..5071b7bc8 100644 --- a/src/cm/common_def.c +++ b/src/cm/common_def.c @@ -276,14 +276,14 @@ uint8_t convertScsPeriodicityToEnum(uint32_t num) * RFAILED - failure * * ****************************************************************/ -uint8_t SGetSBufNewForDebug(char *file, char *func, char *line, Region region, Pool pool, Data **ptr, Size size) +uint8_t SGetSBufNewForDebug(char *file, const char *func, int line, Region region, Pool pool, Data **ptr, Size size) { if(SGetSBuf(region, pool, ptr, size) == ROK) { #ifdef ODU_MEMORY_DEBUG_LOG if (strncmp(func,"cmInetRecvMsg",sizeof("cmInetRecvMsg"))) { - printf("\nCM_ALLOC=== SGetSBufNewForDebug %s +%d, %s, %d, %p\n",\ + printf("\nCM_ALLOC=== SGetSBufNewForDebug %s +%d, %s, %d, %p",\ file, line, func, size, *ptr); } #endif @@ -309,14 +309,14 @@ uint8_t SGetSBufNewForDebug(char *file, char *func, char *line, Region region, P * RFAILED - failure * * ****************************************************************/ -uint8_t SPutSBufNewForDebug(char *file, char *func, char *line, Region region, Pool pool, Data *ptr, Size size) +uint8_t SPutSBufNewForDebug(char *file, const char *func, int line, Region region, Pool pool, Data *ptr, Size size) { if(SPutSBuf(region, pool, ptr, size) == ROK) { #ifdef ODU_MEMORY_DEBUG_LOG if (strncmp(func,"cmInetRecvMsg",sizeof("cmInetRecvMsg"))) { - printf("\nCM_FREE=== SPutSBufNewForDebug %s +%d, %s, %d, %p\n",\ + printf("\nCM_FREE=== SPutSBufNewForDebug %s +%d, %s, %d, %p",\ file, line, func, size, ptr); } #endif @@ -343,13 +343,13 @@ uint8_t SPutSBufNewForDebug(char *file, char *func, char *line, Region region, P * RFAILED - failure * * ****************************************************************/ -uint8_t SGetStaticBufNewForDebug(char *file, char *func, char *line, \ +uint8_t SGetStaticBufNewForDebug(char *file, const char *func, int line, \ Region region, Pool pool, Data **ptr, Size size, uint8_t memType) { if(SGetStaticBuffer(region, pool, ptr, size, memType) == ROK) { #ifdef ODU_MEMORY_DEBUG_LOG - printf("\nCM_ALLOC=== SGetStaticBufNewForDebug %s +%d, %s, %d, %p\n",\ + printf("\nCM_ALLOC=== SGetStaticBufNewForDebug %s +%d, %s, %d, %p",\ file, line, func, size, *ptr); #endif return ROK; @@ -374,13 +374,13 @@ Region region, Pool pool, Data **ptr, Size size, uint8_t memType) * RFAILED - failure * * ****************************************************************/ -uint8_t SPutStaticBufNewForDebug(char *file, char *func, char *line, \ +uint8_t SPutStaticBufNewForDebug(char *file, const char *func, int line, \ Region region, Pool pool, Data *ptr, Size size, uint8_t memType) { if(SPutStaticBuffer(region, pool, ptr, size, memType) == ROK) { #ifdef ODU_MEMORY_DEBUG_LOG - printf("\nCM_FREE=== SPutStaticBufNewForDebug %s +%d, %s, %d, %p\n",\ + printf("\nCM_FREE=== SPutStaticBufNewForDebug %s +%d, %s, %d, %p",\ file, line, func, size, ptr); #endif return ROK; diff --git a/src/cm/common_def.h b/src/cm/common_def.h index 0ed59eed5..b61641aed 100644 --- a/src/cm/common_def.h +++ b/src/cm/common_def.h @@ -67,8 +67,13 @@ #define MAX_NUM_TB_PER_UE 2 /* spec 38.331, maxNrofCodeWordsScheduledByDCI */ /* 5G ORAN phy delay */ +#ifdef NR_TDD +#define PHY_DELTA_DL 2 +#define PHY_DELTA_UL 0 +#else #define PHY_DELTA_DL 1 #define PHY_DELTA_UL 0 +#endif /* SELECTORS */ #define ODU_SELECTOR_LC 0 @@ -154,8 +159,10 @@ #ifdef NR_TDD /* Maximum slots for max periodicity and highest numerology is 320. - * However, aligning to fapi_interface.h, setting this macro to 160 */ -#define MAX_TDD_PERIODICITY_SLOTS 160 + * However, aligning to fapi_interface.h, setting this macro to 160. + * TODO : To support 160, FAPI_MAX_NUM_TLVS_CONFIG in fapi_interface.h + * of Intel L1 must be incremented to a higher number */ +#define MAX_TDD_PERIODICITY_SLOTS 10 #endif #define GET_UE_ID( _crnti,_ueId) \ @@ -337,12 +344,13 @@ void fillCoresetFeqDomAllocMap(uint16_t startPrb, uint16_t prbSize, uint8_t *fre void oduCpyFixBufToMsg(uint8_t *fixBuf, Buffer *mBuf, uint16_t len); uint8_t buildPlmnId(Plmn plmn, uint8_t *buf); uint16_t convertScsEnumValToScsVal(uint8_t scsEnumValue); +uint8_t convertScsValToScsEnum(uint32_t num); -uint8_t SGetSBufNewForDebug(char *file, char *func, char *line, Region region, Pool pool, Data **ptr, Size size); -uint8_t SPutSBufNewForDebug(char *file, char *func, char *line, Region region, Pool pool, Data *ptr, Size size); -uint8_t SGetStaticBufNewForDebug(char *file, char *func, char *line, \ +uint8_t SGetSBufNewForDebug(char *file, const char *func, int line, Region region, Pool pool, Data **ptr, Size size); +uint8_t SPutSBufNewForDebug(char *file, const char *func, int line, Region region, Pool pool, Data *ptr, Size size); +uint8_t SGetStaticBufNewForDebug(char *file, const char *func, int line, \ Region region, Pool pool, Data **ptr, Size size, uint8_t memType); -uint8_t SPutStaticBufNewForDebug(char *file, char *func, char *line, \ +uint8_t SPutStaticBufNewForDebug(char *file, const char *func, int line, \ Region region, Pool pool, Data *ptr, Size size, uint8_t memType); uint8_t countSetBits(uint32_t num); diff --git a/src/codec_utils/common/xer_encoder.c b/src/codec_utils/common/xer_encoder.c index 4177ede5c..cfdcf8e6c 100755 --- a/src/codec_utils/common/xer_encoder.c +++ b/src/codec_utils/common/xer_encoder.c @@ -55,6 +55,9 @@ int xer_fprint(FILE *stream, const asn_TYPE_descriptor_t *td, const void *sptr) { asn_enc_rval_t er = {0,0,0}; +#ifndef DEBUG_ASN_PRINT + return 0; +#endif if(!stream) stream = stdout; if(!td || !sptr) return -1; diff --git a/src/du_app/du_cfg.h b/src/du_app/du_cfg.h index 8ee553a55..bfda5a5a7 100644 --- a/src/du_app/du_cfg.h +++ b/src/du_app/du_cfg.h @@ -99,7 +99,11 @@ #define CORESET1_NUM_PRB 24 /* MACRO defines for PRACH Configuration */ +#ifndef NR_TDD +#define PRACH_CONFIG_IDX 16 +#else #define PRACH_CONFIG_IDX 88 +#endif #define PRACH_MAX_PRB 24 /* As per (spec 38.211-Table 6.3.3.2-1), max allocated PRBs can go upto 24 */ #define PRACH_FREQ_START (MAX_NUM_RB - PRACH_MAX_PRB) /* In order to allocate PRACH from end of the resource grid */ #define PRACH_SEQ_LEN SHORT_SEQUENCE diff --git a/src/du_app/du_e2ap_msg_hdl.c b/src/du_app/du_e2ap_msg_hdl.c index c45ed3be8..b01fcb2fb 100644 --- a/src/du_app/du_e2ap_msg_hdl.c +++ b/src/du_app/du_e2ap_msg_hdl.c @@ -476,10 +476,12 @@ uint8_t BuildAndSendE2SetupReq() else { DU_LOG("\nDEBUG --> E2AP : Created APER encoded buffer for E2SetupRequest\n"); +#ifdef DEBUG_ASN_PRINT for(int i=0; i< encBufSize; i++) { printf("%x",encBuf[i]); } +#endif } if(SendE2APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK) { @@ -841,10 +843,12 @@ uint8_t BuildAndSendRicSubscriptionRsp() else { DU_LOG("\nDEBUG --> E2AP : Created APER encoded buffer for RIC subscription response \n"); +#ifdef DEBUG_ASN_PRINT for(int i=0; i< encBufSize; i++) { printf("%x",encBuf[i]); } +#endif } if(SendE2APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK) @@ -1367,10 +1371,12 @@ uint8_t BuildAndSendRicIndication() else { DU_LOG("\nDEBUG --> E2AP : Created APER encoded buffer for RIC Indication Message \n"); +#ifdef DEBUG_ASN_PRINT for(int i=0; i< encBufSize; i++) { printf("%x",encBuf[i]); } +#endif } if(SendE2APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK) @@ -1570,10 +1576,12 @@ uint8_t BuildAndSendE2NodeConfigUpdate() else { DU_LOG("\nDEBUG --> E2AP : Created APER encoded buffer for E2nodeConfigurationUpdate\n"); +#ifdef DEBUG_ASN_PRINT for(int i=0; i< encBufSize; i++) { printf("%x",encBuf[i]); } +#endif } if(SendE2APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK) { @@ -1633,11 +1641,13 @@ void E2APMsgHdlr(Buffer *mBuf) return; } +#ifdef DEBUG_ASN_PRINT printf("\nDEBUG --> E2AP : Received flat buffer to be decoded : "); for(i=0; i< recvBufLen; i++) { printf("%x",recvBuf[i]); } +#endif /* Decoding flat buffer into E2AP messsage */ e2apMsg = &e2apasnmsg; diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 0f9450ce0..a44829db0 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -1513,10 +1513,12 @@ uint8_t BuildAndSendF1SetupReq() else { DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for F1SetupRequest\n"); +#ifdef DEBUG_ASN_PRINT for(ieIdx=0; ieIdx< encBufSize; ieIdx++) { printf("%x",encBuf[ieIdx]); } +#endif duCb.f1SetupReqAndRspMsg.f1MsgReqBufSize = encBufSize; DU_ALLOC(duCb.f1SetupReqAndRspMsg.f1MsgReqBuf, encBufSize); @@ -2448,10 +2450,12 @@ uint8_t BuildAndSendDUConfigUpdate(ServCellAction servCellAction) else { DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for DUConfigUpdate\n"); +#ifdef DEBUG_ASN_PRINT for(ieIdx =0; ieIdx < encBufSize; ieIdx++) { printf("%x",encBuf[ieIdx]); } +#endif } /* Sending msg */ if(sendF1APMsg() != ROK) @@ -2649,10 +2653,12 @@ uint8_t BuildAndSendULRRCMessageTransfer(DuUeCb *ueCb, uint8_t lcId, \ else { DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for ULRRCMessageTransfer\n"); +#ifdef DEBUG_ASN_PRINT for(int i=0; i< encBufSize; i++) { printf("%x",encBuf[i]); } +#endif } /* Sending msg */ @@ -8562,10 +8568,12 @@ uint8_t BuildCellGroupConfigRrc(DuUeCb *ueCb, OCTET_STRING_t *duToCuRrcContainer else { DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for DuToCuRrcContainer\n"); +#ifdef DEBUG_ASN_PRINT for(int i=0; i< encBufSize; i++) { printf("%x",encBuf[i]); } +#endif } duToCuRrcContainer->size = encBufSize; @@ -8851,10 +8859,12 @@ uint8_t BuildAndSendInitialRrcMsgTransfer(uint32_t gnbDuUeF1apId, uint16_t crnti DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for Initial UL RRC\ Message transfer\n"); +#ifdef DEBUG_ASN_PRINT for(int i=0; i< encBufSize; i++) { printf("%x",encBuf[i]); } +#endif } /* Sending msg */ if(sendF1APMsg() != ROK) @@ -13914,10 +13924,12 @@ uint8_t EncodeUeCntxtDuToCuInfo(CellGroupConfig_t *duToCuCellGrp, CellGroupConfi else { DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for UeCntxtDuToCuInfo\n"); +#ifdef DEBUG_ASN_PRINT for(int i=0; i< encBufSize; i++) { printf("%x",encBuf[i]); } +#endif } duToCuCellGrp->size = encBufSize; DU_ALLOC(duToCuCellGrp->buf, duToCuCellGrp->size); @@ -14246,10 +14258,12 @@ uint8_t BuildAndSendUeContextSetupRsp(uint8_t cellId,uint8_t ueId) else { DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for UE Context Setup Response\n"); +#ifdef DEBUG_ASN_PRINT for(int i=0; i< encBufSize; i++) { printf("%x",encBuf[i]); } +#endif } /* Sending msg */ @@ -14461,10 +14475,12 @@ uint8_t BuildAndSendF1ResetReq() else { DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for F1Reset\n"); +#ifdef DEBUG_ASN_PRINT for(idx=0; idx< encBufSize; idx++) { printf("%x",encBuf[idx]); } +#endif } if(sendF1APMsg() != ROK) @@ -14614,10 +14630,12 @@ uint8_t BuildAndSendF1ResetAck() else { DU_LOG("\nDUBUG --> F1AP : Created APER encoded buffer for F1ResetAck\n"); +#ifdef DEBUG_ASN_PRINT for(int i=0; i< encBufSize; i++) { printf("%x",encBuf[i]); } +#endif } /* Sending msg */ if(sendF1APMsg() != ROK) @@ -14880,10 +14898,12 @@ uint8_t BuildAndSendRrcDeliveryReport(uint32_t gnbCuUeF1apId, \ else { DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for RRC Delivery Msg \n"); +#ifdef DEBUG_ASN_PRINT for(idx=0; idx< encBufSize; idx++) { printf("%x",encBuf[idx]); } +#endif } /* Sending msg */ @@ -15900,10 +15920,12 @@ uint8_t BuildAndSendUeContextModRsp(DuUeCb *ueCb) else { DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for UE Context Modification Response\n"); +#ifdef DEBUG_ASN_PRINT for(int i=0; i< encBufSize; i++) { printf("%x",encBuf[i]); } +#endif } /* Sending msg */ @@ -16519,10 +16541,12 @@ uint8_t BuildAndSendUeContextReleaseReq(uint16_t cellId, uint8_t ueId) else { DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for UEContextReleaseRequest\n"); +#ifdef DEBUG_ASN_PRINT for(ieIdx=0; ieIdx< encBufSize; ieIdx++) { printf("%x",encBuf[ieIdx]); } +#endif } /* Sending msg */ @@ -16683,10 +16707,12 @@ uint8_t BuildAndSendUeContextReleaseComplete(uint16_t cellId, uint32_t gnbCuUeF1 else { DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for UEContextReleaseComplete\n"); +#ifdef DEBUG_ASN_PRINT for(ieIdx=0; ieIdx< encBufSize; ieIdx++) { printf("%x",encBuf[ieIdx]); } +#endif } /* Sending msg */ @@ -17160,11 +17186,13 @@ void F1APMsgHdlr(Buffer *mBuf) return; } +#ifdef DEBUG_ASN_PRINT printf("\nDEBUG --> F1AP : Received flat buffer to be decoded : "); for(i=0; i< recvBufLen; i++) { printf("%x",recvBuf[i]); } +#endif /* Decoding flat buffer into F1AP messsage */ f1apMsg = &f1apasnmsg; diff --git a/src/du_app/du_mgr_main.c b/src/du_app/du_mgr_main.c index d55faa97d..ba89f0be0 100644 --- a/src/du_app/du_mgr_main.c +++ b/src/du_app/du_mgr_main.c @@ -556,7 +556,7 @@ uint8_t commonInit() DU_LOG("\nERROR --> DU_APP : System Task creation for EGTP failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 17, 0); + ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 27, 0); /* system task for RLC_DL and MAC */ if(ODU_CREATE_TASK(PRIOR0, &rlc_mac_cl_stsk) != ROK) @@ -574,7 +574,7 @@ uint8_t commonInit() DU_LOG("\nERROR --> DU_APP : System Task creation for RLC UL failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 19, 0); + ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 22, 0); /* system task for SCTP receiver thread */ if(ODU_CREATE_TASK(PRIOR0, &sctp_stsk) != ROK) @@ -582,7 +582,7 @@ uint8_t commonInit() DU_LOG("\nERROR --> DU_APP : System Task creation for SCTP failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 20, 0); + ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 25, 0); /* system task for lower-mac receiver thread */ if(ODU_CREATE_TASK(PRIOR0, &lwr_mac_stsk) != ROK) @@ -703,7 +703,6 @@ void init_log() uint8_t tst(void) { init_log(); - #ifdef O1_ENABLE if(start_O1_module() != ROK) return RFAILED; diff --git a/src/du_app/du_sys_info_hdl.c b/src/du_app/du_sys_info_hdl.c index a53e16215..080ccf16d 100644 --- a/src/du_app/du_sys_info_hdl.c +++ b/src/du_app/du_sys_info_hdl.c @@ -203,12 +203,14 @@ uint8_t BuildMibPdu() break; } +#ifdef DEBUG_ASN_PRINT /* Print encoded buffer */ for(int i=0; i< encBufSize; i++) { printf("%x\t",encBuf[i]); } printf("\n"); +#endif ret = ROK; break; @@ -297,12 +299,14 @@ uint8_t BuildMibMsg() break; } +#ifdef DEBUG_ASN_PRINT /* Print encoded buffer */ for(int i=0; i< encBufSize; i++) { printf("%x\t",encBuf[i]); } printf("\n"); +#endif /* Free allocated memory */ ret = ROK; @@ -2461,11 +2465,13 @@ uint8_t BuildSib1Msg() "unknown"); break; } +#ifdef DEBUG_ASN_PRINT for(int i=0; i< encBufSize; i++) { printf("%x\t",encBuf[i]); } printf("\n"); +#endif ret = ROK; break; diff --git a/src/du_app/du_utils.h b/src/du_app/du_utils.h index 5d46f099b..55a40de73 100644 --- a/src/du_app/du_utils.h +++ b/src/du_app/du_utils.h @@ -47,11 +47,12 @@ #ifdef ODU_MEMORY_DEBUG_LOG #define DU_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\ {\ - printf("\n%s=== %s +%d, %s, %d, %p\n", \ - _macro, _file, _line, _func, _size, _datPtr); \ + printf("\n%s=== %s +%d, %s, %lu, %p", \ + _macro, _file, _line, _func, (uint64_t)_size, _datPtr); \ } #else -#define DU_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr) {} +#define DU_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr) {\ +} #endif #define DU_ALLOC(_datPtr, _size) \ diff --git a/src/mt/mt_ss.c b/src/mt/mt_ss.c index 3c12a8d31..8e9edd830 100644 --- a/src/mt/mt_ss.c +++ b/src/mt/mt_ss.c @@ -899,7 +899,7 @@ static int SOpenWlsIntf() void *hdl = NULLP; #define WLS_DEVICE_NAME "wls0" - char *my_argv[] = {"gnodeb", "-c3", "--proc-type=auto", "--file-prefix", WLS_DEVICE_NAME, "--iova-mode=pa"}; + char *my_argv[] = {"gnodeb", "-c3", "--proc-type=auto", "--file-prefix", "gnb0", "--iova-mode=pa"}; printf("\nCalling rte_eal_init: "); for (i = 0; i < RTE_DIM(my_argv); i++) { diff --git a/src/mt/mt_ss.h b/src/mt/mt_ss.h index 8e6f9ebd3..4c002560c 100755 --- a/src/mt/mt_ss.h +++ b/src/mt/mt_ss.h @@ -276,7 +276,7 @@ that are configured below. #endif #define MT_BKT_4_DSIZE 65000 -#define MT_BKT_4_NUMBLKS 1000 +#define MT_BKT_4_NUMBLKS 2000 /* For Non-Sharable regions/static regions */ #ifdef XEON_SPECIFIC_CHANGES diff --git a/src/mt/ss_msg.c b/src/mt/ss_msg.c index 9e89c3f6e..87e10376c 100644 --- a/src/mt/ss_msg.c +++ b/src/mt/ss_msg.c @@ -649,7 +649,9 @@ Buffer *mBuf CM_MEM_GET_REGION(tmpThrReg) if(tmpThrReg == 0xFF) { +#ifdef ERROR_PRINT printf("\n Not able to get region \n"); +#endif return RFAILED; } #endif @@ -3631,7 +3633,9 @@ Buffer **dstBuf (Void) SPutDBuf(minfo1->region, minfo1->pool, newblk); newblk = curblk; } +#ifdef ERROR_PRINT printf("\nFailed to get the buffer of size %s %d\n", __FILE__, __LINE__); +#endif (Void) SPutMsg(*dstBuf); return (ROUTRES); } @@ -4100,7 +4104,9 @@ Buffer **bufPtr #ifndef SS_DBUF_REFLOCK_DISABLE if((SInitLock (&(dptr->dBufLock), SS_LOCK_MUTEX)) != 0) { +#ifdef ERROR_PRINT printf("\nFalied to destroy lock\n"); +#endif } #endif @@ -4257,7 +4263,9 @@ Buffer *buf ret = SUnlock(&dptr->dBufLock) ; if((SDestroyLock(&dptr->dBufLock)) != 0) { +#ifdef ERROR_PRINT printf("\nFalied to destroy lock\n"); +#endif } #endif /* free buffer to region */ @@ -5401,6 +5409,7 @@ S16 dst /* destination id */ mlen = ((SsMsgInfo*)(mBuf->b_rptr))->len; reg = ((SsMsgInfo*)(mBuf->b_rptr))->region; /*ss013.301: Fixed Warnings for 32/64 bit compilation*/ +#ifdef DEBUG_PRINT sprintf(prntBuf,"\nmsg: qlen: %04d mlen: %04d %02d-->%02d region: %02d\n", (uint16_t)qlen,(uint16_t)mlen,src,dst,reg); SPrint( prntBuf); @@ -5410,6 +5419,7 @@ S16 dst /* destination id */ SPrint((S8*) "dat: "); #ifdef XEON_SPECIFIC_CHANGES printf("\ndat: "); +#endif #endif if (mlen == 0) @@ -5433,9 +5443,11 @@ S16 dst /* destination id */ /* print hex */ tdata[j]=data; sprintf( prntBuf,"%02x ",(uint16_t) data); +#ifdef DEBUG_PRINT SPrint( prntBuf); #ifdef XEON_SPECIFIC_CHANGES printf("%s\n", prntBuf); +#endif #endif if (cptr == tmp->b_wptr) { @@ -5451,9 +5463,11 @@ S16 dst /* destination id */ else { sprintf( prntBuf," "); +#ifdef DEBUG_PRINT SPrint( prntBuf ); #ifdef XEON_SPECIFIC_CHANGES printf("%s\n", prntBuf); +#endif #endif } } @@ -5465,25 +5479,31 @@ S16 dst /* destination id */ { /* print character if printable */ sprintf(prntBuf,"%c",tdata[k]); +#ifdef DEBUG_PRINT SPrint( prntBuf); #ifdef XEON_SPECIFIC_CHANGES printf("%s\n", prntBuf); +#endif #endif } else { /* print . if non printable */ +#ifdef DEBUG_PRINT SPrint((S8*) "."); #ifdef XEON_SPECIFIC_CHANGES printf("."); #endif +#endif } } sprintf(prntBuf,"\n "); +#ifdef DEBUG_PRINT SPrint(prntBuf); #ifdef XEON_SPECIFIC_CHANGES printf("%s\n", prntBuf); #endif +#endif } return ROK; @@ -7558,7 +7578,9 @@ Buffer** mBuf #ifndef SS_DBUF_REFLOCK_DISABLE if((SInitLock (&(dptr->dBufLock), SS_LOCK_MUTEX)) != 0) { +#ifdef ERROR_PRINT printf("\nFalied to destroy lock\n"); +#endif } #endif @@ -7668,7 +7690,9 @@ Buffer *buf ret = SUnlock(&dptr->dBufLock) ; if((SDestroyLock(&dptr->dBufLock)) != 0) { +#ifdef ERROR_PRINT printf("\nFalied to destroy lock\n"); +#endif } #endif #ifdef SS_HISTOGRAM_SUPPORT @@ -7789,7 +7813,9 @@ Buffer** mBuf #ifndef SS_DBUF_REFLOCK_DISABLE if((SInitLock (&(dptr->dBufLock), SS_LOCK_MUTEX)) != 0) { +#ifdef ERROR_PRINT printf("\nFalied to destroy lock\n"); +#endif } #endif @@ -7936,7 +7962,9 @@ Buffer** mBuf #ifndef SS_DBUF_REFLOCK_DISABLE if((SInitLock (&(dptr->dBufLock), SS_LOCK_MUTEX)) != 0) { +#ifdef ERROR_PRINT printf("\nFalied to destroy lock\n"); +#endif } #endif diff --git a/src/phy_stub/phy_stub_msg_hdl.c b/src/phy_stub/phy_stub_msg_hdl.c index 269d44463..b88a260d3 100644 --- a/src/phy_stub/phy_stub_msg_hdl.c +++ b/src/phy_stub/phy_stub_msg_hdl.c @@ -1158,6 +1158,34 @@ S16 l1HdlUlTtiReq(uint16_t msgLen, void *msg) if(ulTtiReq->pdus[numPdus-1].pduType == 0) { DU_LOG("\nINFO --> PHY STUB: PRACH PDU"); + + /* Send RACH Ind to L2 for first UE */ + if(phyDb.ueDb.ueCb[UE_IDX_0].rachIndSent == false) + { + phyDb.ueDb.ueCb[UE_IDX_0].isCFRA = false; + phyDb.ueDb.ueCb[UE_IDX_0].rachIndSent = true; + l1BuildAndSendRachInd(ulTtiReq->slot, ulTtiReq->sfn, CB_RA_PREAMBLE_IDX); + phyDb.ueDb.numActvUe++; + } +#if 0 + /* Send RACH Ind to L2 for second UE */ + if(phyDb.ueDb.ueCb[UE_IDX_1].rachIndSent == false && phyDb.ueDb.ueCb[UE_IDX_0].msgRrcReconfigComp == true) + { + phyDb.ueDb.ueCb[UE_IDX_0].isCFRA = false; + phyDb.ueDb.ueCb[UE_IDX_1].rachIndSent = true; + l1BuildAndSendRachInd(ulTtiReq->slot, ulTtiReq->sfn, CB_RA_PREAMBLE_IDX); + phyDb.ueDb.numActvUe++; + } + + /* Send RACH Ind to L2 for third UE */ + if(phyDb.ueDb.ueCb[UE_IDX_2].rachIndSent == false && phyDb.ueDb.ueCb[UE_IDX_1].msgRrcReconfigComp == true) + { + phyDb.ueDb.ueCb[UE_IDX_0].isCFRA = false; + phyDb.ueDb.ueCb[UE_IDX_2].rachIndSent = true; + l1BuildAndSendRachInd(ulTtiReq->slot, ulTtiReq->sfn, CB_RA_PREAMBLE_IDX); + phyDb.ueDb.numActvUe++; + } +#endif } if(ulTtiReq->pdus[numPdus-1].pduType == 1) { @@ -1181,36 +1209,6 @@ S16 l1HdlUlTtiReq(uint16_t msgLen, void *msg) numPdus--; } - /* TODO: [SFN:SLOT] at which RACH Indication is sent should be calculated - * based on PRACH cfg index */ - /* Send RACH Ind to L2 for first UE */ - if(phyDb.ueDb.ueCb[UE_IDX_0].rachIndSent == false && ulTtiReq->sfn == 16 && ulTtiReq->slot == 6) - { - phyDb.ueDb.ueCb[UE_IDX_0].isCFRA = false; - phyDb.ueDb.ueCb[UE_IDX_0].rachIndSent = true; - l1BuildAndSendRachInd(ulTtiReq->slot, ulTtiReq->sfn, CB_RA_PREAMBLE_IDX); - phyDb.ueDb.numActvUe++; - } - -#if 0 - /* Send RACH Ind to L2 for second UE */ - if(phyDb.ueDb.ueCb[UE_IDX_1].rachIndSent == false && ulTtiReq->sfn == 304 && ulTtiReq->slot == 0) - { - phyDb.ueDb.ueCb[UE_IDX_0].isCFRA = false; - phyDb.ueDb.ueCb[UE_IDX_1].rachIndSent = true; - l1BuildAndSendRachInd(ulTtiReq->slot, ulTtiReq->sfn, CB_RA_PREAMBLE_IDX); - phyDb.ueDb.numActvUe++; - } - - /* Send RACH Ind to L2 for third UE */ - if(phyDb.ueDb.ueCb[UE_IDX_2].rachIndSent == false && ulTtiReq->sfn == 526 && ulTtiReq->slot == 0) - { - phyDb.ueDb.ueCb[UE_IDX_0].isCFRA = false; - phyDb.ueDb.ueCb[UE_IDX_2].rachIndSent = true; - l1BuildAndSendRachInd(ulTtiReq->slot, ulTtiReq->sfn, CB_RA_PREAMBLE_IDX); - phyDb.ueDb.numActvUe++; - } -#endif MAC_FREE(msg, msgLen); #endif return ROK;