X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_sys_info_hdl.c;h=ecf04e73f18298cd677859197cd131db513ac9f3;hb=0b405462775bb65021e41dc4494ed38ce3a9c4f4;hp=2bb528f81528108b3e13bd044458cda151228866;hpb=082b269b31990bb7ddc3b387e921bf7c68bf4292;p=o-du%2Fl2.git diff --git a/src/du_app/du_sys_info_hdl.c b/src/du_app/du_sys_info_hdl.c index 2bb528f81..ecf04e73f 100644 --- a/src/du_app/du_sys_info_hdl.c +++ b/src/du_app/du_sys_info_hdl.c @@ -162,7 +162,6 @@ void FreeMibPdu(BCCH_BCH_Message_t *bcchMsg) * ****************************************************************/ uint8_t BuildMibPdu() { - uint8_t BuildMibret; uint8_t ret = RFAILED; BCCH_BCH_Message_t *bcchMsg; asn_enc_rval_t encRetVal; /* Encoder return value */ @@ -182,8 +181,7 @@ uint8_t BuildMibPdu() DU_LOG("\nERROR --> Memory allocation failure in BuildMibPdu"); break; } - BuildMibret = BuildMib(bcchMsg->message.choice.mib); - if(BuildMibret != ROK) + if(BuildMib(bcchMsg->message.choice.mib) != ROK) { break; } @@ -193,7 +191,7 @@ uint8_t BuildMibPdu() encRetVal = aper_encode(&asn_DEF_BCCH_BCH_Message, 0, bcchMsg, PrepFinalEncBuf, encBuf); printf("\nencbufSize:%d\n", encBufSize); - if(encRetVal.encoded == -1) + if(encRetVal.encoded == -1) { DU_LOG("\nERROR --> DU APP: Could not encode BCCH BCH Message Type structure(at %s)\n", encRetVal.failed_type?\ @@ -269,7 +267,6 @@ uint8_t BuildMibMsg() MIB_t *mibMsg; asn_enc_rval_t encRetVal; /* Encoder return value */ uint8_t ret = RFAILED; - uint8_t BuildMibret; while(true) { DU_ALLOC(mibMsg, sizeof(MIB_t)); @@ -278,8 +275,7 @@ uint8_t BuildMibMsg() DU_LOG("\nERROR --> DU APP: MIB msg memory allocation failure"); return RFAILED; } - BuildMibret = BuildMib(mibMsg); - if(BuildMibret != ROK) + if(BuildMib(mibMsg) != ROK) { break; } @@ -341,8 +337,9 @@ uint8_t BuildCellIdentity(CellIdentity_t *cellIdentity) { DU_LOG("\nERROR --> DU APP: CellIdentity memory allocation failure"); return RFAILED; - } - *cellIdentity->buf = duCfgParam.sib1Params.cellIdentity; + } + memset(cellIdentity->buf, 0, cellIdentity->size); + cellIdentity->buf[4] = duCfgParam.sib1Params.cellIdentity; return ROK; } @@ -1155,7 +1152,7 @@ uint8_t BuildPdschCfgCommon(struct BWP_DownlinkCommon__pdsch_ConfigCommon *pdsch DU_LOG("\nERROR --> DU APP : PDCCH Config memory alloc failed"); return RFAILED; } - elementCnt = ODU_VALUE_ONE; + elementCnt = duPdschCfg.numTimeDomRsrcAlloc; pdschSetup->pdsch_TimeDomainAllocationList->list.count = elementCnt; pdschSetup->pdsch_TimeDomainAllocationList->list.size = elementCnt * sizeof(PDSCH_TimeDomainResourceAllocation_t *); @@ -1178,21 +1175,22 @@ uint8_t BuildPdschCfgCommon(struct BWP_DownlinkCommon__pdsch_ConfigCommon *pdsch } } - idx = 0; - timeDomRsrcAllocInfo = pdschSetup->pdsch_TimeDomainAllocationList->list.array[idx]; - - /* K0 */ - DU_ALLOC(timeDomRsrcAllocInfo->k0, sizeof(long)); - if(!timeDomRsrcAllocInfo->k0) - { - DU_LOG("\nERROR --> DU APP : PDCCH Config memory alloc failed"); - return RFAILED; - } - *timeDomRsrcAllocInfo->k0 = duPdschCfg.k0; - - timeDomRsrcAllocInfo->mappingType = duPdschCfg.mapType; - timeDomRsrcAllocInfo->startSymbolAndLength = duPdschCfg.sliv; - + for(idx = 0; idx < pdschSetup->pdsch_TimeDomainAllocationList->list.count; idx++) + { + timeDomRsrcAllocInfo = pdschSetup->pdsch_TimeDomainAllocationList->list.array[idx]; + + /* K0 */ + DU_ALLOC(timeDomRsrcAllocInfo->k0, sizeof(long)); + if(!timeDomRsrcAllocInfo->k0) + { + DU_LOG("\nERROR --> DU APP : PDCCH Config memory alloc failed"); + return RFAILED; + } + *timeDomRsrcAllocInfo->k0 = duPdschCfg.timeDomAlloc[idx].k0; + + timeDomRsrcAllocInfo->mappingType = duPdschCfg.timeDomAlloc[idx].mapType; + timeDomRsrcAllocInfo->startSymbolAndLength = duPdschCfg.timeDomAlloc[idx].sliv; + } break; } default: @@ -1800,7 +1798,7 @@ uint8_t BuildPuschCfgCommon(struct BWP_UplinkCommon__pusch_ConfigCommon *puschCf duPuschCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.puschCfg; - puschCfg->present = duPuschCfg.present; + puschCfg->present = duPuschCfg.puschCfgPresent; switch(puschCfg->present) { case BWP_UplinkCommon__pusch_ConfigCommon_PR_NOTHING: @@ -1831,7 +1829,7 @@ uint8_t BuildPuschCfgCommon(struct BWP_UplinkCommon__pusch_ConfigCommon *puschCf DU_LOG("\nERROR --> DU APP : PUSCH Config memory alloc failed"); return RFAILED; } - elementCnt = ODU_VALUE_ONE; + elementCnt = duPuschCfg.numTimeDomRsrcAlloc; setup->pusch_TimeDomainAllocationList->list.count = elementCnt; setup->pusch_TimeDomainAllocationList->list.size = \ elementCnt * sizeof(PUSCH_TimeDomainResourceAllocation_t *); @@ -1855,21 +1853,21 @@ uint8_t BuildPuschCfgCommon(struct BWP_UplinkCommon__pusch_ConfigCommon *puschCf } } - idx = 0; - timeDomRsrcAllocInfo = setup->pusch_TimeDomainAllocationList->list.array[idx]; - - /* K2 */ - DU_ALLOC(timeDomRsrcAllocInfo->k2, sizeof(long)); - if(!timeDomRsrcAllocInfo->k2) - { - DU_LOG("\nERROR --> DU APP : PUSCH Config memory alloc failed"); - return RFAILED; - } - *timeDomRsrcAllocInfo->k2 = duPuschCfg.k2; - - timeDomRsrcAllocInfo->mappingType = duPuschCfg.mapType; - timeDomRsrcAllocInfo->startSymbolAndLength = duPuschCfg.sliv; - + for(idx = 0; idx < elementCnt; idx++) + { + timeDomRsrcAllocInfo = setup->pusch_TimeDomainAllocationList->list.array[idx]; + + /* K2 */ + DU_ALLOC(timeDomRsrcAllocInfo->k2, sizeof(long)); + if(!timeDomRsrcAllocInfo->k2) + { + DU_LOG("\nERROR --> DU APP : PUSCH Config memory alloc failed"); + return RFAILED; + } + *timeDomRsrcAllocInfo->k2 = duPuschCfg.timeDomAllocList[idx].k2; + timeDomRsrcAllocInfo->mappingType = duPuschCfg.timeDomAllocList[idx].mapType; + timeDomRsrcAllocInfo->startSymbolAndLength = duPuschCfg.timeDomAllocList[idx].sliv; + } /* Msg3 Delta Preamble */ DU_ALLOC(setup->msg3_DeltaPreamble, sizeof(long)); if(!setup->msg3_DeltaPreamble)