From 954e6c640d8a9ca7776f135a003ad3b3789906e3 Mon Sep 17 00:00:00 2001 From: yilmazt Date: Mon, 14 Oct 2019 12:14:12 +0200 Subject: [PATCH] compilation error fix and some more cppcheck work --- openair2/COMMON/mac_rrc_primitives.h | 7 +- openair2/COMMON/rrc_messages_types.h | 4 +- openair2/LAYER2/MAC/eNB_scheduler_bch.c | 8 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 180 ++++++++++++------------ openair2/RRC/NR/MESSAGES/asn1_msg.h | 32 ++--- 5 files changed, 116 insertions(+), 115 deletions(-) diff --git a/openair2/COMMON/mac_rrc_primitives.h b/openair2/COMMON/mac_rrc_primitives.h index 8a58d07d65..4a0a6027bc 100644 --- a/openair2/COMMON/mac_rrc_primitives.h +++ b/openair2/COMMON/mac_rrc_primitives.h @@ -20,15 +20,14 @@ */ #ifndef __MAC_RRC_PRIMITIVES_H__ -# define __MAC_RRC_PRIMITIVES_H__ - - +#define __MAC_RRC_PRIMITIVES_H__ #ifndef OPENAIR2_IN #include "LAYER2/RLC/rlc.h" #endif #include "COMMON/platform_types.h" #include "COMMON/platform_constants.h" +#include "openair2/RRC/LTE/rrc_defs.h" #include "LTE_RadioResourceConfigCommonSIB.h" #include "LTE_RadioResourceConfigDedicated.h" @@ -398,5 +397,3 @@ typedef struct { #define REMOVE_LC 1 #endif - - diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index bac2f4dc62..8f85d5e770 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -429,9 +429,9 @@ typedef struct NRRrcConfigurationReq_s { long DL_absoluteFrequencyPointA[MAX_NUM_CCs]; //NR DL SCS-SpecificCarrier - uint32_t DL_offsetToCarrier[MAX_NUM_CCs]; + long DL_offsetToCarrier[MAX_NUM_CCs]; long DL_SCS_SubcarrierSpacing[MAX_NUM_CCs]; - uint32_t DL_carrierBandwidth[MAX_NUM_CCs]; + long DL_carrierBandwidth[MAX_NUM_CCs]; //NR BWP-DownlinkCommon uint32_t DL_locationAndBandwidth[MAX_NUM_CCs]; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index c69d533558..469aade040 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -200,7 +200,8 @@ schedule_SIB1_MBMS(module_id_t module_idP, // Note: definition of k above and rvidx from 36.321 section 5.3.1 rvidx = (((3 * k) >> 1) + (k & 1)) & 3; i = cc->SIB1_BR_cnt & (m - 1); - n_NB = Sj[((cc->physCellId % N_S_NB) + (i * N_S_NB / m)) % N_S_NB]; + if(Sj) + n_NB = Sj[((cc->physCellId % N_S_NB) + (i * N_S_NB / m)) % N_S_NB]; bcch_sdu_length = mac_rrc_data_req(module_idP, CC_id, frameP, BCCH_SIB1_BR, 1, &cc->BCCH_BR_pdu[0].payload[0], 0); // not used in this case AssertFatal(cc->mib->message.schedulingInfoSIB1_BR_r13 < 19, "schedulingInfoSIB1_BR_r13 %d > 18\n", @@ -429,7 +430,8 @@ schedule_SIB1_BR(module_id_t module_idP, // Note: definition of k above and rvidx from 36.321 section 5.3.1 rvidx = (((3 * k) >> 1) + (k & 1)) & 3; i = cc->SIB1_BR_cnt & (m - 1); - n_NB = Sj[((cc->physCellId % N_S_NB) + (i * N_S_NB / m)) % N_S_NB]; + if(Sj) + n_NB = Sj[((cc->physCellId % N_S_NB) + (i * N_S_NB / m)) % N_S_NB]; bcch_sdu_length = mac_rrc_data_req(module_idP, CC_id, frameP, BCCH_SIB1_BR, 0xFFFF, 1, &cc->BCCH_BR_pdu[0].payload[0], 0); // not used in this case AssertFatal(cc->mib->message.schedulingInfoSIB1_BR_r13 < 19, "schedulingInfoSIB1_BR_r13 %d > 18\n", @@ -595,7 +597,7 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP, long si_Narrowband_r13 = schedulingInfoList_BR_r13->list.array[i]->si_Narrowband_r13; long si_TBS_r13 = si_TBS_r13tab[schedulingInfoList_BR_r13->list.array[i]->si_TBS_r13]; // check if the SI is to be scheduled now - int period_in_sf; + int period_in_sf = 0; if ((si_Periodicity >= 0) && (si_Periodicity < 25)) { // 2^i * 80 subframes, note: si_Periodicity is 2^i * 80ms diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index e63a75d84f..ee21f4e966 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -25,7 +25,7 @@ * \date 2011, 2018 * \version 1.0 * \company Eurecom, NTUST -* \email: raymond.knopp@eurecom.fr and navid.nikaein@eurecom.fr, kroempa@gmail.com +* \email: {raymond.knopp, navid.nikaein}@eurecom.fr and kroempa@gmail.com */ #include @@ -216,7 +216,6 @@ uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier, uint32_t subCarrierSpacingCommon, uint32_t dmrs_TypeA_Position) { - asn_enc_rval_t enc_rval; NR_BCCH_BCH_Message_t *mib = &carrier->mib; @@ -260,9 +259,10 @@ uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier, break; default: - AssertFatal(1==0,"Unknown subCarrierSpacingCommon %d\n",subCarrierSpacingCommon); + AssertFatal(1==0, "Unknown subCarrierSpacingCommon %u\n", subCarrierSpacingCommon); } -mib->message.choice.mib->subCarrierSpacingCommon = 1; + + mib->message.choice.mib->subCarrierSpacingCommon = 1; switch (dmrs_TypeA_Position) { case 2: mib->message.choice.mib->dmrs_TypeA_Position = NR_MIB__dmrs_TypeA_Position_pos2; @@ -273,8 +273,7 @@ mib->message.choice.mib->subCarrierSpacingCommon = 1; break; default: - AssertFatal(1==0,"Unknown dmrs_TypeA_Position %d\n",dmrs_TypeA_Position); - + AssertFatal(1==0, "Unknown dmrs_TypeA_Position %u\n", dmrs_TypeA_Position); } // assign_enum @@ -282,8 +281,6 @@ mib->message.choice.mib->subCarrierSpacingCommon = 1; // assign_enum mib->message.choice.mib->intraFreqReselection = NR_MIB__intraFreqReselection_notAllowed; - - //encode MIB to data enc_rval = uper_encode_to_buffer(&asn_DEF_NR_BCCH_BCH_Message, NULL, @@ -293,7 +290,6 @@ mib->message.choice.mib->subCarrierSpacingCommon = 1; AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", enc_rval.failed_type->name, enc_rval.encoded); - if (enc_rval.encoded==-1) { return(-1); } @@ -301,6 +297,7 @@ mib->message.choice.mib->subCarrierSpacingCommon = 1; return((enc_rval.encoded+7)/8); } + void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, int CC_id, #if defined(ENABLE_ITTI) @@ -308,21 +305,32 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, #endif int initial_flag ) -{ - NR_ServingCellConfigCommon_t **servingcellconfigcommon = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon; - NR_FreqBandIndicatorNR_t *dl_frequencyBandList; - struct NR_SCS_SpecificCarrier *dl_scs_SpecificCarrierList; - NR_TCI_StateId_t *TCI_StateId; - struct NR_ControlResourceSet *bwp_dl_controlresourceset; - NR_SearchSpace_t *bwp_dl_searchspace; - struct NR_PDSCH_TimeDomainResourceAllocation *bwp_dl_timedomainresourceallocation; - NR_FreqBandIndicatorNR_t *ul_frequencyBandList; - struct NR_SCS_SpecificCarrier *ul_scs_SpecificCarrierList; - struct NR_PUSCH_TimeDomainResourceAllocation *pusch_configcommontimedomainresourceallocation; - struct NR_RateMatchPattern *ratematchpattern; - NR_RateMatchPatternId_t *ratematchpatternid; +{ + NR_ServingCellConfigCommon_t **servingcellconfigcommon = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon; + NR_FreqBandIndicatorNR_t *dl_frequencyBandList; + NR_SCS_SpecificCarrier_t *dl_scs_SpecificCarrierList; + NR_TCI_StateId_t *TCI_StateId; + NR_ControlResourceSet_t *bwp_dl_controlresourceset; + NR_SearchSpace_t *bwp_dl_searchspace; + NR_PDSCH_TimeDomainResourceAllocation_t *bwp_dl_timedomainresourceallocation; + NR_FreqBandIndicatorNR_t *ul_frequencyBandList; + NR_SCS_SpecificCarrier_t *ul_scs_SpecificCarrierList; + NR_PUSCH_TimeDomainResourceAllocation_t *pusch_configcommontimedomainresourceallocation; + NR_RateMatchPattern_t *ratematchpattern; + NR_RateMatchPatternId_t *ratematchpatternid; - if(initial_flag == 1){ + dl_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t)); + ul_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t)); + dl_scs_SpecificCarrierList = CALLOC(1,sizeof(NR_SCS_SpecificCarrier_t)); + ul_scs_SpecificCarrierList = CALLOC(1,sizeof(NR_SCS_SpecificCarrier_t)); + TCI_StateId = CALLOC(1,sizeof(NR_TCI_StateId_t)); + bwp_dl_searchspace = CALLOC(1,sizeof(NR_SearchSpace_t)); + bwp_dl_timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); + pusch_configcommontimedomainresourceallocation = CALLOC(1,sizeof(NR_PUSCH_TimeDomainResourceAllocation_t)); + ratematchpattern = CALLOC(1,sizeof(NR_RateMatchPattern_t)); + ratematchpatternid = CALLOC(1,sizeof(NR_RateMatchPatternId_t)); + + if(initial_flag == 1) { (*servingcellconfigcommon) = CALLOC(1,sizeof(NR_ServingCellConfigCommon_t)); (*servingcellconfigcommon)->physCellId = CALLOC(1,sizeof(NR_PhysCellId_t)); (*servingcellconfigcommon)->downlinkConfigCommon = CALLOC(1,sizeof(struct NR_DownlinkConfigCommon)); @@ -342,16 +350,14 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, (*servingcellconfigcommon)->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB = CALLOC(1,sizeof(NR_ARFCN_ValueNR_t)); - - dl_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t)); - dl_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier)); + (*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long)); (*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PDCCH_ConfigCommon)); (*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon)); (*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero = CALLOC(1,sizeof(long)); (*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero = CALLOC(1,sizeof(long)); - (*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourceSet = CALLOC(1,sizeof(struct NR_ControlResourceSet)); + (*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourceSet = CALLOC(1,sizeof(NR_ControlResourceSet_t)); (*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon__commonSearchSpaceList)); (*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = CALLOC(1,sizeof(NR_SearchSpaceId_t)); (*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation = CALLOC(1,sizeof(NR_SearchSpaceId_t)); @@ -361,7 +367,7 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, (*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDSCH_ConfigCommon)); (*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList = CALLOC(1,sizeof(struct NR_PDSCH_TimeDomainResourceAllocationList)); - (*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->frequencyBandList = CALLOC(1,sizeof(struct NR_MultiFrequencyBandListNR)); + (*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->frequencyBandList = CALLOC(1,sizeof(NR_MultiFrequencyBandListNR_t)); (*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA = CALLOC(1,sizeof(NR_ARFCN_ValueNR_t)); (*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->additionalSpectrumEmission = CALLOC(1,sizeof(NR_AdditionalSpectrumEmission_t)); (*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->p_Max = CALLOC(1,sizeof(NR_P_Max_t)); @@ -381,7 +387,7 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PUSCH_ConfigCommon)); (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding = CALLOC(1,sizeof(long)); - (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocationList)); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList = CALLOC(1,sizeof(NR_PUSCH_TimeDomainResourceAllocationList_t)); (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble = CALLOC(1,sizeof(long)); (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant = CALLOC(1,sizeof(long)); @@ -402,8 +408,7 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, bwp_dl_controlresourceset->tci_StatesPDCCH_ToAddList = CALLOC(1,sizeof(struct NR_ControlResourceSet__tci_StatesPDCCH_ToAddList)); bwp_dl_controlresourceset->tci_PresentInDCI = CALLOC(1,sizeof(long)); bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID = CALLOC(1,sizeof(long)); - TCI_StateId = CALLOC(1,sizeof(NR_TCI_StateId_t)); - bwp_dl_searchspace = CALLOC(1,sizeof(NR_SearchSpace_t)); + bwp_dl_searchspace->controlResourceSetId = CALLOC(1,sizeof(NR_ControlResourceSetId_t)); bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset = CALLOC(1,sizeof(struct NR_SearchSpace__monitoringSlotPeriodicityAndOffset)); bwp_dl_searchspace->duration = CALLOC(1,sizeof(long)); @@ -412,33 +417,26 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, bwp_dl_searchspace->nrofCandidates = CALLOC(1,sizeof(struct NR_SearchSpace__nrofCandidates)); bwp_dl_searchspace->searchSpaceType = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType)); bwp_dl_searchspace->searchSpaceType->choice.common = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__common)); - bwp_dl_searchspace->searchSpaceType->choice.ue_Specific = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__ue_Specific)); + bwp_dl_searchspace->searchSpaceType->choice.ue_Specific = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__ue_Specific)); - bwp_dl_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PDSCH_TimeDomainResourceAllocation)); - bwp_dl_timedomainresourceallocation->k0 = CALLOC(1,sizeof(long)); - - ul_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t)); - ul_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier)); + bwp_dl_timedomainresourceallocation->k0 = CALLOC(1,sizeof(long)); - pusch_configcommontimedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); pusch_configcommontimedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); - ratematchpattern = CALLOC(1,sizeof(struct NR_RateMatchPattern)); - ratematchpattern->patternType.choice.bitmaps = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps)); - ratematchpattern->patternType.choice.bitmaps->resourceBlocks.buf = MALLOC(35); - ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.oneSlot.buf = MALLOC(2); - ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.buf = MALLOC(4); - ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern)); - ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n2.buf = MALLOC(1); - ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n4.buf = MALLOC(1); - ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n5.buf = MALLOC(1); - ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n8.buf = MALLOC(1); - ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n10.buf = MALLOC(2); - ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.buf = MALLOC(3); - ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf = MALLOC(5); - ratematchpattern->subcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t)); - ratematchpatternid = CALLOC(1,sizeof(NR_RateMatchPatternId_t)); - }else{ + ratematchpattern->patternType.choice.bitmaps = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps)); + ratematchpattern->patternType.choice.bitmaps->resourceBlocks.buf = MALLOC(35); + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.oneSlot.buf = MALLOC(2); + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.buf = MALLOC(4); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern)); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n2.buf = MALLOC(1); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n4.buf = MALLOC(1); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n5.buf = MALLOC(1); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n8.buf = MALLOC(1); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n10.buf = MALLOC(2); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.buf = MALLOC(3); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf = MALLOC(5); + ratematchpattern->subcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t)); + } else { bwp_dl_controlresourceset =(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourceSet; } @@ -447,7 +445,7 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, //physCellId *((*servingcellconfigcommon)->physCellId) = configuration->Nid_cell[CC_id]; - //NR_DownlinkConfigCommon + //NR_DownlinkConfigCommon *((*servingcellconfigcommon)->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB) = configuration->absoluteFrequencySSB[CC_id]; *(dl_frequencyBandList) = configuration->DL_FreqBandIndicatorNR[CC_id]; @@ -549,37 +547,37 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl2560 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_value[CC_id]; } - *(bwp_dl_searchspace->duration) = configuration->SearchSpace_duration[CC_id]; + *(bwp_dl_searchspace->duration) = configuration->SearchSpace_duration[CC_id]; - bwp_dl_searchspace->monitoringSymbolsWithinSlot->size=2; - bwp_dl_searchspace->monitoringSymbolsWithinSlot->bits_unused=2; - bwp_dl_searchspace->monitoringSymbolsWithinSlot->buf[0]=0x3f; - bwp_dl_searchspace->monitoringSymbolsWithinSlot->buf[1]=0xff; + bwp_dl_searchspace->monitoringSymbolsWithinSlot->size = 2; + bwp_dl_searchspace->monitoringSymbolsWithinSlot->bits_unused = 2; + bwp_dl_searchspace->monitoringSymbolsWithinSlot->buf[0] = 0x3f; + bwp_dl_searchspace->monitoringSymbolsWithinSlot->buf[1] = 0xff; - bwp_dl_searchspace->nrofCandidates->aggregationLevel1 = configuration->SearchSpace_nrofCandidates_aggregationLevel1[CC_id]; - bwp_dl_searchspace->nrofCandidates->aggregationLevel2 = configuration->SearchSpace_nrofCandidates_aggregationLevel2[CC_id]; - bwp_dl_searchspace->nrofCandidates->aggregationLevel4 = configuration->SearchSpace_nrofCandidates_aggregationLevel4[CC_id]; - bwp_dl_searchspace->nrofCandidates->aggregationLevel8 = configuration->SearchSpace_nrofCandidates_aggregationLevel8[CC_id]; + bwp_dl_searchspace->nrofCandidates->aggregationLevel1 = configuration->SearchSpace_nrofCandidates_aggregationLevel1[CC_id]; + bwp_dl_searchspace->nrofCandidates->aggregationLevel2 = configuration->SearchSpace_nrofCandidates_aggregationLevel2[CC_id]; + bwp_dl_searchspace->nrofCandidates->aggregationLevel4 = configuration->SearchSpace_nrofCandidates_aggregationLevel4[CC_id]; + bwp_dl_searchspace->nrofCandidates->aggregationLevel8 = configuration->SearchSpace_nrofCandidates_aggregationLevel8[CC_id]; bwp_dl_searchspace->nrofCandidates->aggregationLevel16 = configuration->SearchSpace_nrofCandidates_aggregationLevel16[CC_id]; bwp_dl_searchspace->searchSpaceType->present = configuration->SearchSpace_searchSpaceType[CC_id]; if(bwp_dl_searchspace->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_common){ - bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0 = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__common__dci_Format2_0)); - bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel1 = CALLOC(1,sizeof(long)); - bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel2 = CALLOC(1,sizeof(long)); - bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel4 = CALLOC(1,sizeof(long)); - bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel8 = CALLOC(1,sizeof(long)); - bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel16 = CALLOC(1,sizeof(long)); - bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3 = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__common__dci_Format2_3)); - bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->dummy1 = CALLOC(1,sizeof(long)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0 = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__common__dci_Format2_0)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel1 = CALLOC(1,sizeof(long)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel2 = CALLOC(1,sizeof(long)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel4 = CALLOC(1,sizeof(long)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel8 = CALLOC(1,sizeof(long)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel16 = CALLOC(1,sizeof(long)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3 = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__common__dci_Format2_3)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->dummy1 = CALLOC(1,sizeof(long)); *(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel1) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1[CC_id]; *(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel2) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2[CC_id]; *(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel4) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4[CC_id]; *(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel8) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8[CC_id]; *(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel16) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16[CC_id]; - *(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->dummy1) = configuration->Common_dci_Format2_3_monitoringPeriodicity[CC_id]; - bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->dummy2 = configuration->Common_dci_Format2_3_nrofPDCCH_Candidates[CC_id]; + *(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->dummy1) = configuration->Common_dci_Format2_3_monitoringPeriodicity[CC_id]; + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->dummy2 = configuration->Common_dci_Format2_3_nrofPDCCH_Candidates[CC_id]; }else if (bwp_dl_searchspace->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific){ bwp_dl_searchspace->searchSpaceType->choice.ue_Specific->dci_Formats = configuration->ue_Specific__dci_Formats[CC_id]; } @@ -692,9 +690,9 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding = NR_PUSCH_ConfigCommon__groupHoppingEnabledTransformPrecoding_enabled; } - *(pusch_configcommontimedomainresourceallocation->k2) = configuration->PUSCH_TimeDomainResourceAllocation_k2[CC_id]; - pusch_configcommontimedomainresourceallocation->mappingType = configuration->PUSCH_TimeDomainResourceAllocation_mappingType[CC_id]; - pusch_configcommontimedomainresourceallocation->startSymbolAndLength = configuration->PUSCH_TimeDomainResourceAllocation_startSymbolAndLength[CC_id]; + *(pusch_configcommontimedomainresourceallocation->k2) = configuration->PUSCH_TimeDomainResourceAllocation_k2[CC_id]; + pusch_configcommontimedomainresourceallocation->mappingType = configuration->PUSCH_TimeDomainResourceAllocation_mappingType[CC_id]; + pusch_configcommontimedomainresourceallocation->startSymbolAndLength = configuration->PUSCH_TimeDomainResourceAllocation_startSymbolAndLength[CC_id]; ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,&pusch_configcommontimedomainresourceallocation); *((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble) = configuration->msg3_DeltaPreamble[CC_id]; @@ -846,11 +844,12 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, } + void do_RLC_BEARER(uint8_t Mod_id, int CC_id, struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_BearerToAddModList, - rlc_bearer_config_t *rlc_config){ - + rlc_bearer_config_t *rlc_config) +{ struct NR_RLC_BearerConfig *rlc_bearer; rlc_bearer = CALLOC(1,sizeof(struct NR_RLC_BearerConfig)); @@ -945,11 +944,12 @@ void do_RLC_BEARER(uint8_t Mod_id, ASN_SEQUENCE_ADD(&(rlc_BearerToAddModList->list),&rlc_bearer); } -void do_MAC_CELLGROUP(uint8_t Mod_id, - int CC_id, - struct NR_MAC_CellGroupConfig *mac_CellGroupConfig, - mac_cellgroup_t *mac_cellgroup_config){ +void do_MAC_CELLGROUP(uint8_t Mod_id, + int CC_id, + NR_MAC_CellGroupConfig_t *mac_CellGroupConfig, + mac_cellgroup_t *mac_cellgroup_config) +{ mac_CellGroupConfig->drx_Config = CALLOC(1,sizeof(struct NR_SetupRelease_DRX_Config)); mac_CellGroupConfig->schedulingRequestConfig = CALLOC(1,sizeof(struct NR_SchedulingRequestConfig)); mac_CellGroupConfig->bsr_Config = CALLOC(1,sizeof(struct NR_BSR_Config)); @@ -1059,11 +1059,12 @@ void do_MAC_CELLGROUP(uint8_t Mod_id, } + void do_PHYSICALCELLGROUP(uint8_t Mod_id, int CC_id, - struct NR_PhysicalCellGroupConfig *physicalCellGroupConfig, - physicalcellgroup_t *physicalcellgroup_config){ - + NR_PhysicalCellGroupConfig_t *physicalCellGroupConfig, + physicalcellgroup_t *physicalcellgroup_config) +{ physicalCellGroupConfig->harq_ACK_SpatialBundlingPUCCH = CALLOC(1,sizeof(long)); physicalCellGroupConfig->harq_ACK_SpatialBundlingPUSCH = CALLOC(1,sizeof(long)); physicalCellGroupConfig->p_NR_FR1 = CALLOC(1,sizeof(NR_P_Max_t)); @@ -1090,10 +1091,11 @@ void do_PHYSICALCELLGROUP(uint8_t Mod_id, } -void do_SpCellConfig(uint8_t Mod_id, - int CC_id, - struct NR_SpCellConfig *spconfig){ +void do_SpCellConfig(uint8_t Mod_id, + int CC_id, + NR_SpCellConfig_t *spconfig) +{ //spconfig->servCellIndex = CALLOC(1,sizeof(NR_ServCellIndex_t)); //*(spconfig->servCellIndex)= diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index f4d7a30bbb..3f5fadae63 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -91,21 +91,21 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, #endif int initial_flag); -void do_RLC_BEARER(uint8_t Mod_id, - int CC_id, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_BearerToAddModList, - rlc_bearer_config_t *rlc_config); +void do_RLC_BEARER(uint8_t Mod_id, + int CC_id, + struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_BearerToAddModList, + rlc_bearer_config_t *rlc_config); -void do_MAC_CELLGROUP(uint8_t Mod_id, - int CC_id, - struct NR_MAC_CellGroupConfig *mac_CellGroupConfig, - mac_cellgroup_t *mac_cellgroup_config); - -void do_PHYSICALCELLGROUP(uint8_t Mod_id, - int CC_id, - struct NR_PhysicalCellGroupConfig *physicalCellGroupConfig, - physicalcellgroup_t *physicalcellgroup_config); - -void do_SpCellConfig(uint8_t Mod_id, +void do_MAC_CELLGROUP(uint8_t Mod_id, int CC_id, - struct NR_SpCellConfig *spconfig); + NR_MAC_CellGroupConfig_t *mac_CellGroupConfig, + mac_cellgroup_t *mac_cellgroup_config); + +void do_PHYSICALCELLGROUP(uint8_t Mod_id, + int CC_id, + NR_PhysicalCellGroupConfig_t *physicalCellGroupConfig, + physicalcellgroup_t *physicalcellgroup_config); + +void do_SpCellConfig(uint8_t Mod_id, + int CC_id, + NR_SpCellConfig_t *spconfig);