rrc_gNB_reconfig.c 145 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */

/*! \file rrc_gNB_reconfig.c
 * \brief rrc gNB RRCreconfiguration support routines
 * \author Raymond Knopp
 * \date 2019
 * \version 1.0
 * \company Eurecom
 * \email: raymond.knopp@eurecom.fr
 */
30
#ifndef RRC_GNB_NSA_C
31 32
#define RRC_GNB_NSA_C

33
#include "NR_ServingCellConfigCommon.h"
34
#include "NR_RRCReconfiguration.h"
35 36 37 38 39 40 41 42 43
#include "NR_RRCReconfiguration-IEs.h"
#include "NR_CellGroupConfig.h"
#include "NR_MAC-CellGroupConfig.h"
#include "NR_BSR-Config.h"
#include "NR_PDSCH-ServingCellConfig.h"
#include "NR_RLC-BearerConfig.h"
#include "BOOLEAN.h"
#include "assertions.h"
#include "common/utils/nr/nr_common.h"
44 45 46

#include "executables/softmodem-common.h"

47 48
#define false 0
#define true 1
49

50

51
void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
52 53 54 55 56
				     NR_CellGroupConfig_t *secondaryCellGroup,
				     int scg_id,
				     int servCellIndex,
				     int n_physical_antenna_ports,
				     int initial_csi_index) {
57 58 59 60 61 62
  AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n");
  AssertFatal(secondaryCellGroup!=NULL,"secondaryCellGroup is null\n");

  memset(secondaryCellGroup,0,sizeof(NR_CellGroupConfig_t));
  secondaryCellGroup->cellGroupId = scg_id;

Cedric Roux's avatar
Cedric Roux committed
63
  NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig));
64 65

  RLC_BearerConfig->logicalChannelIdentity = 4;
Cedric Roux's avatar
Cedric Roux committed
66
  RLC_BearerConfig->servedRadioBearer = calloc(1,sizeof(*RLC_BearerConfig->servedRadioBearer));
67 68
  RLC_BearerConfig->servedRadioBearer->present = 	NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity;

Cedric Roux's avatar
Cedric Roux committed
69
  RLC_BearerConfig->servedRadioBearer->choice.drb_Identity=1;
Cedric Roux's avatar
Cedric Roux committed
70
  RLC_BearerConfig->reestablishRLC=calloc(1,sizeof(*RLC_BearerConfig->reestablishRLC));
71
  *RLC_BearerConfig->reestablishRLC=NR_RLC_BearerConfig__reestablishRLC_true;
Cedric Roux's avatar
Cedric Roux committed
72
  RLC_BearerConfig->rlc_Config=calloc(1,sizeof(*RLC_BearerConfig->rlc_Config));
73
  RLC_BearerConfig->rlc_Config->present = NR_RLC_Config_PR_am;
Cedric Roux's avatar
Cedric Roux committed
74 75
  RLC_BearerConfig->rlc_Config->choice.am = calloc(1,sizeof(*RLC_BearerConfig->rlc_Config->choice.am));
  RLC_BearerConfig->rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength = calloc(1,sizeof(*RLC_BearerConfig->rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength));
76 77 78 79
  *RLC_BearerConfig->rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength   =	NR_SN_FieldLengthAM_size18;
  RLC_BearerConfig->rlc_Config->choice.am->ul_AM_RLC.t_PollRetransmit = NR_T_PollRetransmit_ms45;
  RLC_BearerConfig->rlc_Config->choice.am->ul_AM_RLC.pollPDU          = NR_PollPDU_p64;
  RLC_BearerConfig->rlc_Config->choice.am->ul_AM_RLC.pollByte         = NR_PollByte_kB500;
80
  RLC_BearerConfig->rlc_Config->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t32;
81

Cedric Roux's avatar
Cedric Roux committed
82
  RLC_BearerConfig->rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = calloc(1,sizeof(*RLC_BearerConfig->rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength));
83 84
  *RLC_BearerConfig->rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = NR_SN_FieldLengthAM_size18;
  RLC_BearerConfig->rlc_Config->choice.am->dl_AM_RLC.t_Reassembly   = NR_T_Reassembly_ms15;
85
  RLC_BearerConfig->rlc_Config->choice.am->dl_AM_RLC.t_StatusProhibit = NR_T_StatusProhibit_ms15;
86

Cedric Roux's avatar
Cedric Roux committed
87
  RLC_BearerConfig->mac_LogicalChannelConfig = calloc(1,sizeof(*RLC_BearerConfig->mac_LogicalChannelConfig));
88 89 90 91 92 93 94 95
  RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters = calloc(1,sizeof(*RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters));
  RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->priority            = 1;
  RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->prioritisedBitRate  = NR_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity;
  RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->bucketSizeDuration  = NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50;
  RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->allowedServingCells = NULL;
  RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->allowedSCS_List     = NULL;
  RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->maxPUSCH_Duration   = NULL;
  RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->configuredGrantType1Allowed = NULL;
Cedric Roux's avatar
Cedric Roux committed
96
  RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->logicalChannelGroup   = calloc(1,sizeof(*RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->logicalChannelGroup));
97 98 99 100 101
  *RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->logicalChannelGroup  = 1;
  RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->schedulingRequestID   = NULL;
  RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->logicalChannelSR_Mask = false;
  RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = false;
  RLC_BearerConfig->mac_LogicalChannelConfig->ul_SpecificParameters->bitRateQueryProhibitTimer   = NULL;
102

Cedric Roux's avatar
Cedric Roux committed
103
  secondaryCellGroup->rlc_BearerToAddModList = calloc(1,sizeof(*secondaryCellGroup->rlc_BearerToAddModList));
104 105
  ASN_SEQUENCE_ADD(&secondaryCellGroup->rlc_BearerToAddModList->list, RLC_BearerConfig);

Cedric Roux's avatar
Cedric Roux committed
106
  secondaryCellGroup->mac_CellGroupConfig=calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig));
107 108
  secondaryCellGroup->mac_CellGroupConfig->drx_Config = NULL;
  secondaryCellGroup->mac_CellGroupConfig->schedulingRequestConfig = NULL;
Cedric Roux's avatar
Cedric Roux committed
109
  secondaryCellGroup->mac_CellGroupConfig->bsr_Config=calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->bsr_Config));
110
  secondaryCellGroup->mac_CellGroupConfig->bsr_Config->periodicBSR_Timer = NR_BSR_Config__periodicBSR_Timer_sf80;
111
  secondaryCellGroup->mac_CellGroupConfig->bsr_Config->retxBSR_Timer     = NR_BSR_Config__retxBSR_Timer_sf320;
Cedric Roux's avatar
Cedric Roux committed
112
  secondaryCellGroup->mac_CellGroupConfig->tag_Config=calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->tag_Config));
113
  secondaryCellGroup->mac_CellGroupConfig->tag_Config->tag_ToReleaseList = NULL;
Cedric Roux's avatar
Cedric Roux committed
114 115
  secondaryCellGroup->mac_CellGroupConfig->tag_Config->tag_ToAddModList  = calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->tag_Config->tag_ToAddModList));
  struct NR_TAG *tag=calloc(1,sizeof(*tag));
116 117
  tag->tag_Id             = 0;
  tag->timeAlignmentTimer = NR_TimeAlignmentTimer_infinity;
118
  ASN_SEQUENCE_ADD(&secondaryCellGroup->mac_CellGroupConfig->tag_Config->tag_ToAddModList->list,tag);
119
#if 1
Cedric Roux's avatar
Cedric Roux committed
120
  secondaryCellGroup->mac_CellGroupConfig->phr_Config  = calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->phr_Config));
121
  secondaryCellGroup->mac_CellGroupConfig->phr_Config->present = NR_SetupRelease_PHR_Config_PR_setup;
Cedric Roux's avatar
Cedric Roux committed
122
  secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup  = calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup));
123 124 125 126 127 128 129
  secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->phr_PeriodicTimer = NR_PHR_Config__phr_PeriodicTimer_sf20;
  secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->phr_ProhibitTimer = NR_PHR_Config__phr_ProhibitTimer_sf0;
  secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->phr_Tx_PowerFactorChange = NR_PHR_Config__phr_Tx_PowerFactorChange_dB3;
  secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->multiplePHR=false;
  secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->dummy=false;
  secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->phr_Type2OtherCell = false;
  secondaryCellGroup->mac_CellGroupConfig->phr_Config->choice.setup->phr_ModeOtherCG = NR_PHR_Config__phr_ModeOtherCG_real;
130
#endif
131 132 133 134

  secondaryCellGroup->mac_CellGroupConfig->skipUplinkTxDynamic=false;
  secondaryCellGroup->mac_CellGroupConfig->ext1 = NULL;

135

Cedric Roux's avatar
Cedric Roux committed
136
  secondaryCellGroup->physicalCellGroupConfig = calloc(1,sizeof(*secondaryCellGroup->physicalCellGroupConfig));
137 138 139

  secondaryCellGroup->physicalCellGroupConfig->harq_ACK_SpatialBundlingPUCCH=NULL;
  secondaryCellGroup->physicalCellGroupConfig->harq_ACK_SpatialBundlingPUSCH=NULL;
Cedric Roux's avatar
Cedric Roux committed
140
  secondaryCellGroup->physicalCellGroupConfig->p_NR_FR1=calloc(1,sizeof(*secondaryCellGroup->physicalCellGroupConfig->p_NR_FR1));
141 142 143 144 145 146 147 148 149
  *secondaryCellGroup->physicalCellGroupConfig->p_NR_FR1=20;
  secondaryCellGroup->physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook=NR_PhysicalCellGroupConfig__pdsch_HARQ_ACK_Codebook_dynamic;  
  secondaryCellGroup->physicalCellGroupConfig->tpc_SRS_RNTI=NULL;
  secondaryCellGroup->physicalCellGroupConfig->tpc_PUCCH_RNTI=NULL;
  secondaryCellGroup->physicalCellGroupConfig->tpc_PUSCH_RNTI=NULL;
  secondaryCellGroup->physicalCellGroupConfig->sp_CSI_RNTI=NULL;
  secondaryCellGroup->physicalCellGroupConfig->cs_RNTI=NULL;
  secondaryCellGroup->physicalCellGroupConfig->ext1=NULL;

Cedric Roux's avatar
Cedric Roux committed
150 151
  secondaryCellGroup->spCellConfig = calloc(1,sizeof(*secondaryCellGroup->spCellConfig));
  secondaryCellGroup->spCellConfig->servCellIndex = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->servCellIndex));
152
  *secondaryCellGroup->spCellConfig->servCellIndex = servCellIndex;
Cedric Roux's avatar
Cedric Roux committed
153
  secondaryCellGroup->spCellConfig->reconfigurationWithSync=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->reconfigurationWithSync));
154
  secondaryCellGroup->spCellConfig->reconfigurationWithSync->spCellConfigCommon=servingcellconfigcommon;
155
  secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity=(get_softmodem_params()->phy_test==1) ? 0x1234 : 0x3456; //(taus()&0xffff);
156 157 158 159
  secondaryCellGroup->spCellConfig->reconfigurationWithSync->t304=NR_ReconfigurationWithSync__t304_ms2000;
  secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated = NULL;
  secondaryCellGroup->spCellConfig->reconfigurationWithSync->ext1                 = NULL;

160
  secondaryCellGroup->spCellConfig->rlf_TimersAndConstants = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->rlf_TimersAndConstants));
161
  secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->present = NR_SetupRelease_RLF_TimersAndConstants_PR_setup;
Cedric Roux's avatar
Cedric Roux committed
162
  secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup));
163 164 165
  secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup->t310 = NR_RLF_TimersAndConstants__t310_ms2000;
  secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup->n310 = NR_RLF_TimersAndConstants__n310_n10;
  secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup->n311 = NR_RLF_TimersAndConstants__n311_n1;
Cedric Roux's avatar
Cedric Roux committed
166
  secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup->ext1 = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup->ext1));
167 168 169 170 171 172
  secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup->ext1->t311_v1530 = NR_RLF_TimersAndConstants__ext1__t311_v1530_ms30000;

  secondaryCellGroup->spCellConfig->rlmInSyncOutOfSyncThreshold                   = NULL;
 


Cedric Roux's avatar
Cedric Roux committed
173
  secondaryCellGroup->spCellConfig->spCellConfigDedicated = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated));
174
  secondaryCellGroup->spCellConfig->spCellConfigDedicated->tdd_UL_DL_ConfigurationDedicated = NULL;
Cedric Roux's avatar
Cedric Roux committed
175
  secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP));
176

177
  secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdcch_Config=NULL;
Cedric Roux's avatar
Cedric Roux committed
178
  secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config));
179
  secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->present = NR_SetupRelease_PDSCH_Config_PR_setup;
Cedric Roux's avatar
Cedric Roux committed
180
  secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup));
181
  secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dataScramblingIdentityPDSCH = NULL;
Cedric Roux's avatar
Cedric Roux committed
182
  secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA));
183
  secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->present= NR_SetupRelease_DMRS_DownlinkConfig_PR_setup;
Cedric Roux's avatar
Cedric Roux committed
184
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup));
185

186 187 188 189 190
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->maxLength=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->scramblingID0=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->scramblingID1=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS=NULL;
191

Cedric Roux's avatar
Cedric Roux committed
192
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition));
193
 *secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0;
194
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NULL;
195

196 197 198
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList=NULL;

#if 0
199
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList));
200

Cedric Roux's avatar
Cedric Roux committed
201
 NR_TCI_State_t*tci0=calloc(1,sizeof(*tci0));
202 203
 tci0->tci_StateId=0;
 tci0->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
204
 tci0->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci0->qcl_Type1.bwp_Id));
205 206 207 208
 *tci0->qcl_Type1.bwp_Id=1;
 tci0->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tci0->qcl_Type1.referenceSignal.choice.csi_rs = 2;
 tci0->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
209
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci0);
210

Cedric Roux's avatar
Cedric Roux committed
211
 NR_TCI_State_t*tci1=calloc(1,sizeof(*tci1));
212 213
 tci1->tci_StateId=1;
 tci1->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
214
 tci1->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci1->qcl_Type1.bwp_Id));
215 216 217 218
 *tci1->qcl_Type1.bwp_Id=1;
 tci1->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tci1->qcl_Type1.referenceSignal.choice.csi_rs = 6;
 tci1->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
219
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci1);
220

Cedric Roux's avatar
Cedric Roux committed
221
 NR_TCI_State_t*tci2=calloc(1,sizeof(*tci2));
222 223
 tci2->tci_StateId=2;
 tci2->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
224
 tci2->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci2->qcl_Type1.bwp_Id));
225 226 227 228
 *tci2->qcl_Type1.bwp_Id=1;
 tci2->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tci2->qcl_Type1.referenceSignal.choice.csi_rs = 10;
 tci2->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
229
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci2);
230

Cedric Roux's avatar
Cedric Roux committed
231
 NR_TCI_State_t *tci3=calloc(1,sizeof(*tci3));
232 233
 tci3->tci_StateId=3;
 tci3->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
234
 tci3->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci3->qcl_Type1.bwp_Id));
235 236 237 238
 *tci3->qcl_Type1.bwp_Id=1;
 tci3->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tci3->qcl_Type1.referenceSignal.choice.csi_rs = 14;
 tci3->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
239
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci3);
240

Cedric Roux's avatar
Cedric Roux committed
241
 NR_TCI_State_t*tci4=calloc(1,sizeof(*tci4));
242 243
 tci4->tci_StateId=4;
 tci4->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
244
 tci4->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci4->qcl_Type1.bwp_Id));
245 246 247 248
 *tci4->qcl_Type1.bwp_Id=1;
 tci4->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tci4->qcl_Type1.referenceSignal.choice.csi_rs = 18;
 tci4->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
249
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci4);
250

Cedric Roux's avatar
Cedric Roux committed
251
 NR_TCI_State_t*tci5=calloc(1,sizeof(*tci5));
252 253
 tci5->tci_StateId=5;
 tci5->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
254
 tci5->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci5->qcl_Type1.bwp_Id));
255 256 257 258
 *tci5->qcl_Type1.bwp_Id=1;
 tci5->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tci5->qcl_Type1.referenceSignal.choice.csi_rs = 22;
 tci5->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
259
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci5);
260

Cedric Roux's avatar
Cedric Roux committed
261
 NR_TCI_State_t*tci6=calloc(1,sizeof(*tci6));
262 263
 tci6->tci_StateId=6;
 tci6->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
264
 tci6->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci6->qcl_Type1.bwp_Id));
265 266 267 268
 *tci6->qcl_Type1.bwp_Id=1;
 tci6->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tci6->qcl_Type1.referenceSignal.choice.csi_rs = 26;
 tci6->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
269
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci6);
270

Cedric Roux's avatar
Cedric Roux committed
271
 NR_TCI_State_t*tci7=calloc(1,sizeof(*tci7));
272 273
 tci7->tci_StateId=7;
 tci7->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
274
 tci7->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci7->qcl_Type1.bwp_Id));
275 276 277 278
 *tci7->qcl_Type1.bwp_Id=1;
 tci7->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tci7->qcl_Type1.referenceSignal.choice.csi_rs = 30;
 tci7->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
279
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci7);
280

Cedric Roux's avatar
Cedric Roux committed
281
 NR_TCI_State_t*tci8=calloc(1,sizeof(*tci8));
282 283
 tci8->tci_StateId=8;
 tci8->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
284
 tci8->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci8->qcl_Type1.bwp_Id));
285 286 287 288
 *tci8->qcl_Type1.bwp_Id=1;
 tci8->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tci8->qcl_Type1.referenceSignal.choice.ssb = 0;
 tci8->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
289
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci8);
290

Cedric Roux's avatar
Cedric Roux committed
291
 NR_TCI_State_t*tci9=calloc(1,sizeof(*tci9));
292 293
 tci9->tci_StateId=9;
 tci9->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
294
 tci9->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci9->qcl_Type1.bwp_Id));
295 296 297 298
 *tci9->qcl_Type1.bwp_Id=1;
 tci9->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tci9->qcl_Type1.referenceSignal.choice.ssb = 1;
 tci9->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
299
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci9);
300

Cedric Roux's avatar
Cedric Roux committed
301
 NR_TCI_State_t*tci10=calloc(1,sizeof(*tci10));
302 303
 tci10->tci_StateId=10;
 tci10->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
304
 tci10->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci10->qcl_Type1.bwp_Id));
305 306 307 308
 *tci10->qcl_Type1.bwp_Id=1;
 tci10->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tci10->qcl_Type1.referenceSignal.choice.ssb = 2;
 tci10->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
309
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci10);
310

Cedric Roux's avatar
Cedric Roux committed
311
 NR_TCI_State_t*tci11=calloc(1,sizeof(*tci11));
312 313
 tci11->tci_StateId=11;
 tci11->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
314
 tci11->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci11->qcl_Type1.bwp_Id));
315 316 317 318
 *tci11->qcl_Type1.bwp_Id=1;
 tci11->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tci11->qcl_Type1.referenceSignal.choice.ssb = 3;
 tci11->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
319
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci11);
320

Cedric Roux's avatar
Cedric Roux committed
321
 NR_TCI_State_t*tci12=calloc(1,sizeof(*tci12));
322 323
 tci12->tci_StateId=12;
 tci12->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
324
 tci12->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci12->qcl_Type1.bwp_Id));
325 326 327 328
 *tci12->qcl_Type1.bwp_Id=1;
 tci12->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tci12->qcl_Type1.referenceSignal.choice.ssb = 4;
 tci12->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
329
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci12);
330

Cedric Roux's avatar
Cedric Roux committed
331
 NR_TCI_State_t*tci13=calloc(1,sizeof(*tci13));
332 333
 tci13->tci_StateId=13;
 tci13->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
334
 tci13->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci13->qcl_Type1.bwp_Id));
335 336 337 338
 *tci13->qcl_Type1.bwp_Id=1;
 tci13->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tci13->qcl_Type1.referenceSignal.choice.ssb = 5;
 tci13->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
339
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci13);
340

Cedric Roux's avatar
Cedric Roux committed
341
 NR_TCI_State_t*tci14=calloc(1,sizeof(*tci14));
342 343
 tci14->tci_StateId=14;
 tci14->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
344
 tci14->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci14->qcl_Type1.bwp_Id));
345 346 347 348
 *tci14->qcl_Type1.bwp_Id=1;
 tci14->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tci14->qcl_Type1.referenceSignal.choice.ssb = 6;
 tci14->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
349
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci14);
350

Cedric Roux's avatar
Cedric Roux committed
351
 NR_TCI_State_t*tci15=calloc(1,sizeof(*tci15));
352 353
 tci15->tci_StateId=15;
 tci15->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
354
 tci15->qcl_Type1.bwp_Id=calloc(1,sizeof(*tci15->qcl_Type1.bwp_Id));
355 356 357 358
 *tci15->qcl_Type1.bwp_Id=1;
 tci15->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tci15->qcl_Type1.referenceSignal.choice.ssb = 7;
 tci15->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
359
 ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tci15);
360
#endif
361 362 363

 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToReleaseList=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->vrb_ToPRB_Interleaver=NULL;
364
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->resourceAllocation=NR_PDSCH_Config__resourceAllocation_resourceAllocationType1;
365 366 367 368 369 370 371 372
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->pdsch_AggregationFactor=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rateMatchPatternToAddModList=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rateMatchPatternToReleaseList=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table=NULL;
Cedric Roux's avatar
Cedric Roux committed
373
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI));
374 375
 *secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling;
Cedric Roux's avatar
Cedric Roux committed
376
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling));
377
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize =
Cedric Roux's avatar
Cedric Roux committed
378
   calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize));
379 380 381 382 383 384 385 386
 *secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize = NR_PDSCH_Config__prb_BundlingType__staticBundling__bundleSize_wideband;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->zp_CSI_RS_ResourceToAddModList=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->zp_CSI_RS_ResourceToReleaseList=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->aperiodic_ZP_CSI_RS_ResourceSetsToAddModList=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->aperiodic_ZP_CSI_RS_ResourceSetsToReleaseList=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->sp_ZP_CSI_RS_ResourceSetsToAddModList=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->sp_ZP_CSI_RS_ResourceSetsToReleaseList=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->p_ZP_CSI_RS_ResourceSet=NULL;
387
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->sps_Config = NULL; //calloc(1,sizeof(struct NR_SetupRelease_SPS_Config));
388

389 390
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig = NULL;
#if 0
Cedric Roux's avatar
Cedric Roux committed
391
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig));
392 393
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->present = NR_SetupRelease_RadioLinkMonitoringConfig_PR_setup;

Cedric Roux's avatar
Cedric Roux committed
394
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup));
395 396
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->failureDetectionResourcesToAddModList=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->failureDetectionResourcesToReleaseList=NULL;
Cedric Roux's avatar
Cedric Roux committed
397
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->beamFailureInstanceMaxCount = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->beamFailureInstanceMaxCount));
398
 *secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->beamFailureInstanceMaxCount = NR_RadioLinkMonitoringConfig__beamFailureInstanceMaxCount_n3;
Cedric Roux's avatar
Cedric Roux committed
399
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->beamFailureDetectionTimer = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->beamFailureDetectionTimer));
400
 *secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->beamFailureDetectionTimer = NR_RadioLinkMonitoringConfig__beamFailureDetectionTimer_pbfd2;
401
#endif
402 403

 secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToReleaseList= NULL;
404
// secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList = NULL;
Cedric Roux's avatar
Cedric Roux committed
405
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList));
406

Cedric Roux's avatar
Cedric Roux committed
407
 NR_BWP_Downlink_t *bwp=calloc(1,sizeof(*bwp));
408
 bwp->bwp_Id=1;
Cedric Roux's avatar
Cedric Roux committed
409
 bwp->bwp_Common=calloc(1,sizeof(*bwp->bwp_Common));
410
 // copy common BWP size from initial BWP except for bandwdith
411 412
 memcpy((void*)&bwp->bwp_Common->genericParameters,
	&servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters,
413
	sizeof(bwp->bwp_Common->genericParameters));
414
 bwp->bwp_Common->genericParameters.locationAndBandwidth=6407; //PRBalloc_to_locationandbandwidth(servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,0);
415
 bwp->bwp_Common->genericParameters.locationAndBandwidth=PRBalloc_to_locationandbandwidth(servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,0);
416

417
 
Cedric Roux's avatar
Cedric Roux committed
418
 bwp->bwp_Common->pdcch_ConfigCommon=calloc(1,sizeof(*bwp->bwp_Common->pdcch_ConfigCommon));
419
 bwp->bwp_Common->pdcch_ConfigCommon->present = NR_SetupRelease_PDCCH_ConfigCommon_PR_setup;
Cedric Roux's avatar
Cedric Roux committed
420
 bwp->bwp_Common->pdcch_ConfigCommon->choice.setup = calloc(1,sizeof(*bwp->bwp_Common->pdcch_ConfigCommon->choice.setup));
421
 bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->controlResourceSetZero=NULL;
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449
 bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonControlResourceSet=calloc(1,sizeof(*bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonControlResourceSet));

 NR_ControlResourceSet_t *coreset = calloc(1,sizeof(*coreset));
 coreset->controlResourceSetId=1;
 // frequencyDomainResources '11111111 11111111 00000000 00000000 00000000 00000'B,
 coreset->frequencyDomainResources.buf = calloc(1,6);
 coreset->frequencyDomainResources.buf[0] = 0xff;
 coreset->frequencyDomainResources.buf[1] = 0xff;
 coreset->frequencyDomainResources.buf[2] = 0;
 coreset->frequencyDomainResources.buf[3] = 0;
 coreset->frequencyDomainResources.buf[4] = 0;
 coreset->frequencyDomainResources.buf[5] = 0;
 coreset->frequencyDomainResources.size = 6;
 coreset->frequencyDomainResources.bits_unused = 3;
 coreset->duration=1;
 coreset->cce_REG_MappingType.present = NR_ControlResourceSet__cce_REG_MappingType_PR_nonInterleaved;
 coreset->precoderGranularity = NR_ControlResourceSet__precoderGranularity_sameAsREG_bundle;

 coreset->tci_StatesPDCCH_ToAddList=calloc(1,sizeof(*coreset->tci_StatesPDCCH_ToAddList));
 NR_TCI_StateId_t *tci[8];
 for (int i=0;i<8;i++) {
   tci[i]=calloc(1,sizeof(*tci[i]));
   *tci[i] = i;
   ASN_SEQUENCE_ADD(&coreset->tci_StatesPDCCH_ToAddList->list,tci[i]);
 }
 coreset->tci_StatesPDCCH_ToReleaseList = NULL;
 coreset->tci_PresentInDCI = NULL;
 coreset->pdcch_DMRS_ScramblingID = NULL;
450

451 452 453
 bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonControlResourceSet = coreset;

 bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->searchSpaceZero=NULL;
454
 bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList=NULL;
Cedric Roux's avatar
Cedric Roux committed
455
 bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList=calloc(1,sizeof(*bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList));
456

Cedric Roux's avatar
Cedric Roux committed
457
 NR_SearchSpace_t *ss=calloc(1,sizeof(*ss));
458
 ss->searchSpaceId = 1;
Cedric Roux's avatar
Cedric Roux committed
459
 ss->controlResourceSetId=calloc(1,sizeof(*ss->controlResourceSetId));
460
 *ss->controlResourceSetId=1;
Cedric Roux's avatar
Cedric Roux committed
461
 ss->monitoringSlotPeriodicityAndOffset = calloc(1,sizeof(*ss->monitoringSlotPeriodicityAndOffset));
462 463
 ss->monitoringSlotPeriodicityAndOffset->present = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
 ss->duration=NULL; 
Cedric Roux's avatar
Cedric Roux committed
464
 ss->monitoringSymbolsWithinSlot = calloc(1,sizeof(*ss->monitoringSymbolsWithinSlot));
465 466 467
 ss->monitoringSymbolsWithinSlot->buf = calloc(1,2);
 // should be '1100 0000 0000 00'B (LSB first!), first two symols in slot, adjust if needed
 ss->monitoringSymbolsWithinSlot->buf[1] = 0;
468
 ss->monitoringSymbolsWithinSlot->buf[0] = (1<<7); // | (1<<6);
469 470
 ss->monitoringSymbolsWithinSlot->size = 2;
 ss->monitoringSymbolsWithinSlot->bits_unused = 2;
Cedric Roux's avatar
Cedric Roux committed
471
 ss->nrofCandidates = calloc(1,sizeof(*ss->nrofCandidates));
472 473 474 475 476
 ss->nrofCandidates->aggregationLevel1 = NR_SearchSpace__nrofCandidates__aggregationLevel1_n0;
 ss->nrofCandidates->aggregationLevel2 = NR_SearchSpace__nrofCandidates__aggregationLevel2_n0;
 ss->nrofCandidates->aggregationLevel4 = NR_SearchSpace__nrofCandidates__aggregationLevel4_n1;
 ss->nrofCandidates->aggregationLevel8 = NR_SearchSpace__nrofCandidates__aggregationLevel8_n0;
 ss->nrofCandidates->aggregationLevel16 = NR_SearchSpace__nrofCandidates__aggregationLevel16_n0;
Cedric Roux's avatar
Cedric Roux committed
477
 ss->searchSpaceType = calloc(1,sizeof(*ss->searchSpaceType));
478
 ss->searchSpaceType->present = NR_SearchSpace__searchSpaceType_PR_common;
Cedric Roux's avatar
Cedric Roux committed
479 480
 ss->searchSpaceType->choice.common=calloc(1,sizeof(*ss->searchSpaceType->choice.common));
 ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0 = calloc(1,sizeof(*ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0));
481 482

 ASN_SEQUENCE_ADD(&bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list,ss);
483 484
 

485 486 487
 bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1=NULL;
 bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation=NULL;
 bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->pagingSearchSpace=NULL;
Cedric Roux's avatar
Cedric Roux committed
488
 bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->ra_SearchSpace=calloc(1,sizeof(*bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->ra_SearchSpace));
489
 *bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->ra_SearchSpace=1;
490
 bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->ext1=NULL;
491
//bwp->bwp_Common->pdcch_ConfigCommon=NULL;
492

Cedric Roux's avatar
Cedric Roux committed
493
 bwp->bwp_Common->pdsch_ConfigCommon=calloc(1,sizeof(*bwp->bwp_Common->pdsch_ConfigCommon));
494
 bwp->bwp_Common->pdsch_ConfigCommon->present = NR_SetupRelease_PDSCH_ConfigCommon_PR_setup;
Cedric Roux's avatar
Cedric Roux committed
495 496
 bwp->bwp_Common->pdsch_ConfigCommon->choice.setup = calloc(1,sizeof(*bwp->bwp_Common->pdsch_ConfigCommon->choice.setup));
 bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList = calloc(1,sizeof(*bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList));
497 498

 // copy PDSCH TimeDomainResourceAllocation from InitialBWP
499
 
500
 NR_PDSCH_TimeDomainResourceAllocation_t *pdschi;
501
 for (int i=0;i<servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count;i++) {
502
   pdschi= calloc(1,sizeof(*pdschi));
503 504 505 506
   AssertFatal(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0!=NULL,"element %d is null\n",i);
 
   pdschi->k0 = calloc(1,sizeof(*pdschi->k0));
   *pdschi->k0 = *servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0;
507 508 509 510 511
   pdschi->mappingType = servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->mappingType;
   pdschi->startSymbolAndLength = servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength;
   ASN_SEQUENCE_ADD(&bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,pdschi);
 }

Cedric Roux's avatar
Cedric Roux committed
512
 bwp->bwp_Dedicated=calloc(1,sizeof(*bwp->bwp_Dedicated));
513

Cedric Roux's avatar
Cedric Roux committed
514
 bwp->bwp_Dedicated->pdcch_Config=calloc(1,sizeof(*bwp->bwp_Dedicated->pdcch_Config));
515
 bwp->bwp_Dedicated->pdcch_Config->present = NR_SetupRelease_PDCCH_Config_PR_setup;
Cedric Roux's avatar
Cedric Roux committed
516 517
 bwp->bwp_Dedicated->pdcch_Config->choice.setup = calloc(1,sizeof(*bwp->bwp_Dedicated->pdcch_Config->choice.setup));
 bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList = calloc(1,sizeof(*bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList));
518

519
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list,
520
		  coreset);
521

Cedric Roux's avatar
Cedric Roux committed
522
 bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList = calloc(1,sizeof(*bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList));
523

Cedric Roux's avatar
Cedric Roux committed
524
 NR_SearchSpace_t *ss2 = calloc(1,sizeof(*ss2));
525 526

 ss2->searchSpaceId=2;
Cedric Roux's avatar
Cedric Roux committed
527
 ss2->controlResourceSetId=calloc(1,sizeof(*ss2->controlResourceSetId));
528 529 530 531 532
 *ss2->controlResourceSetId=1;
 ss2->monitoringSlotPeriodicityAndOffset=calloc(1,sizeof(*ss2->monitoringSlotPeriodicityAndOffset));
 ss2->monitoringSlotPeriodicityAndOffset->present = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1;
 ss2->monitoringSlotPeriodicityAndOffset->choice.sl1=(NULL_t)0;
 ss2->duration=NULL;
Cedric Roux's avatar
Cedric Roux committed
533
 ss2->monitoringSymbolsWithinSlot = calloc(1,sizeof(*ss2->monitoringSymbolsWithinSlot));
534 535 536
 ss2->monitoringSymbolsWithinSlot->buf = calloc(1,2);
 ss2->monitoringSymbolsWithinSlot->size = 2;
 ss2->monitoringSymbolsWithinSlot->bits_unused = 2;
537
 ss2->monitoringSymbolsWithinSlot->buf[0]=0x80; //0xc0;
538
 ss2->monitoringSymbolsWithinSlot->buf[1]=0x0;
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554
 ss2->nrofCandidates=calloc(1,sizeof(*ss2->nrofCandidates));
 ss2->nrofCandidates->aggregationLevel1 = NR_SearchSpace__nrofCandidates__aggregationLevel1_n0;
 ss2->nrofCandidates->aggregationLevel2 = NR_SearchSpace__nrofCandidates__aggregationLevel2_n0;
 ss2->nrofCandidates->aggregationLevel4 = NR_SearchSpace__nrofCandidates__aggregationLevel4_n4;
 ss2->nrofCandidates->aggregationLevel8 = NR_SearchSpace__nrofCandidates__aggregationLevel8_n0;
 ss2->nrofCandidates->aggregationLevel16 = NR_SearchSpace__nrofCandidates__aggregationLevel16_n0;
 ss2->searchSpaceType=calloc(1,sizeof(*ss2->searchSpaceType));
 ss2->searchSpaceType->present = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
 ss2->searchSpaceType->choice.ue_Specific = calloc(1,sizeof(*ss2->searchSpaceType->choice.ue_Specific));
 ss2->searchSpaceType->choice.ue_Specific->dci_Formats=NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0;

 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list,
		  ss2);


 bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToReleaseList = NULL;
555

Raymond Knopp's avatar
Raymond Knopp committed
556
 bwp->bwp_Dedicated->pdsch_Config = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config));
557 558

  bwp->bwp_Dedicated->pdsch_Config->present = NR_SetupRelease_PDSCH_Config_PR_setup;
Cedric Roux's avatar
Cedric Roux committed
559
  bwp->bwp_Dedicated->pdsch_Config->choice.setup = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup));
560
  bwp->bwp_Dedicated->pdsch_Config->choice.setup->dataScramblingIdentityPDSCH = NULL;
Cedric Roux's avatar
Cedric Roux committed
561
  bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA));
562
  bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->present= NR_SetupRelease_DMRS_DownlinkConfig_PR_setup;
Cedric Roux's avatar
Cedric Roux committed
563
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup));
564

565 566 567 568 569
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->maxLength=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->scramblingID0=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->scramblingID1=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS=NULL;
570

Cedric Roux's avatar
Cedric Roux committed
571
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition));
572
 *bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0;
573
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NULL;
574

575 576
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList=NULL;
#if 0
Cedric Roux's avatar
Cedric Roux committed
577
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList=calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList));
578

Cedric Roux's avatar
Cedric Roux committed
579
 NR_TCI_State_t*tcid0=calloc(1,sizeof(*tcid0));
580 581
 tcid0->tci_StateId=0;
 tcid0->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
582
 tcid0->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid0->qcl_Type1.bwp_Id));
583 584 585 586
 *tcid0->qcl_Type1.bwp_Id=1;
 tcid0->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tcid0->qcl_Type1.referenceSignal.choice.csi_rs = 2;
 tcid0->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
587
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid0);
588

Cedric Roux's avatar
Cedric Roux committed
589
 NR_TCI_State_t*tcid1=calloc(1,sizeof(*tcid1));
590 591
 tcid1->tci_StateId=0;
 tcid1->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
592
 tcid1->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid1->qcl_Type1.bwp_Id));
593 594 595 596
 *tcid1->qcl_Type1.bwp_Id=1;
 tcid1->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tcid1->qcl_Type1.referenceSignal.choice.csi_rs = 6;
 tcid1->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
597
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid1);
598

Cedric Roux's avatar
Cedric Roux committed
599
 NR_TCI_State_t*tcid2=calloc(1,sizeof(*tcid2));
600 601
 tcid2->tci_StateId=2;
 tcid2->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
602
 tcid2->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid2->qcl_Type1.bwp_Id));
603 604 605 606
 *tcid2->qcl_Type1.bwp_Id=1;
 tcid2->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tcid2->qcl_Type1.referenceSignal.choice.csi_rs = 10;
 tcid2->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
607
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid2);
608

Cedric Roux's avatar
Cedric Roux committed
609
 NR_TCI_State_t*tcid3=calloc(1,sizeof(*tcid3));
610 611
 tcid3->tci_StateId=3;
 tcid3->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
612
 tcid3->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid3->qcl_Type1.bwp_Id));
613 614 615 616
 *tcid3->qcl_Type1.bwp_Id=1;
 tcid3->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tcid3->qcl_Type1.referenceSignal.choice.csi_rs = 14;
 tcid3->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
617
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid3);
618

Cedric Roux's avatar
Cedric Roux committed
619
 NR_TCI_State_t*tcid4=calloc(1,sizeof(*tcid4));
620 621
 tcid4->tci_StateId=4;
 tcid4->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
622
 tcid4->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid4->qcl_Type1.bwp_Id));
623 624 625 626
 *tcid4->qcl_Type1.bwp_Id=1;
 tcid4->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tcid4->qcl_Type1.referenceSignal.choice.csi_rs = 18;
 tcid4->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
627
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid4);
628

Cedric Roux's avatar
Cedric Roux committed
629
 NR_TCI_State_t*tcid5=calloc(1,sizeof(*tcid5));
630 631
 tcid5->tci_StateId=5;
 tcid5->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
632
 tcid5->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid5->qcl_Type1.bwp_Id));
633 634 635 636
 *tcid5->qcl_Type1.bwp_Id=1;
 tcid5->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tcid5->qcl_Type1.referenceSignal.choice.csi_rs = 22;
 tcid5->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
637
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid5);
638

Cedric Roux's avatar
Cedric Roux committed
639
 NR_TCI_State_t*tcid6=calloc(1,sizeof(*tcid6));
640 641
 tcid6->tci_StateId=6;
 tcid6->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
642
 tcid6->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid6->qcl_Type1.bwp_Id));
643 644 645 646
 *tcid6->qcl_Type1.bwp_Id=1;
 tcid6->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tcid6->qcl_Type1.referenceSignal.choice.csi_rs = 26;
 tcid6->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
647
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid6);
648

Cedric Roux's avatar
Cedric Roux committed
649
 NR_TCI_State_t*tcid7=calloc(1,sizeof(*tcid7));
650 651
 tcid7->tci_StateId=7;
 tcid7->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
652
 tcid7->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid7->qcl_Type1.bwp_Id));
653 654 655 656
 *tcid7->qcl_Type1.bwp_Id=1;
 tcid7->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_csi_rs;
 tcid7->qcl_Type1.referenceSignal.choice.csi_rs = 30;
 tcid7->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeA;
657
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid7);
658

Cedric Roux's avatar
Cedric Roux committed
659
 NR_TCI_State_t*tcid8=calloc(1,sizeof(*tcid8));
660 661
 tcid8->tci_StateId=8;
 tcid8->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
662
 tcid8->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid8->qcl_Type1.bwp_Id));
663 664 665 666
 *tcid8->qcl_Type1.bwp_Id=1;
 tcid8->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tcid8->qcl_Type1.referenceSignal.choice.ssb = 0;
 tcid8->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
667
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid8);
668

Cedric Roux's avatar
Cedric Roux committed
669
 NR_TCI_State_t*tcid9=calloc(1,sizeof(*tcid9));
670 671
 tcid9->tci_StateId=9;
 tcid9->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
672
 tcid9->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid9->qcl_Type1.bwp_Id));
673 674 675 676
 *tcid9->qcl_Type1.bwp_Id=1;
 tcid9->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tcid9->qcl_Type1.referenceSignal.choice.ssb = 1;
 tcid9->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
677
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid9);
678

Cedric Roux's avatar
Cedric Roux committed
679
 NR_TCI_State_t*tcid10=calloc(1,sizeof(*tcid10));
680 681
 tcid10->tci_StateId=10;
 tcid10->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
682
 tcid10->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid10->qcl_Type1.bwp_Id));
683 684 685 686
 *tcid10->qcl_Type1.bwp_Id=1;
 tcid10->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tcid10->qcl_Type1.referenceSignal.choice.ssb = 2;
 tcid10->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
687
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid10);
688

Cedric Roux's avatar
Cedric Roux committed
689
 NR_TCI_State_t*tcid11=calloc(1,sizeof(*tcid11));
690 691
 tcid11->tci_StateId=11;
 tcid11->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
692
 tcid11->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid11->qcl_Type1.bwp_Id));
693 694 695 696
 *tcid11->qcl_Type1.bwp_Id=1;
 tcid11->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tcid11->qcl_Type1.referenceSignal.choice.ssb = 3;
 tcid11->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
697
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid11);
698

Cedric Roux's avatar
Cedric Roux committed
699
 NR_TCI_State_t*tcid12=calloc(1,sizeof(*tcid12));
700 701
 tcid12->tci_StateId=12;
 tcid12->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
702
 tcid12->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid12->qcl_Type1.bwp_Id));
703 704 705 706
 *tcid12->qcl_Type1.bwp_Id=1;
 tcid12->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tcid12->qcl_Type1.referenceSignal.choice.ssb = 4;
 tcid12->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
707
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid12);
708

Cedric Roux's avatar
Cedric Roux committed
709
 NR_TCI_State_t*tcid13=calloc(1,sizeof(*tcid13));
710 711
 tcid13->tci_StateId=13;
 tcid13->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
712
 tcid13->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid13->qcl_Type1.bwp_Id));
713 714 715 716
 *tcid13->qcl_Type1.bwp_Id=1;
 tcid13->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tcid13->qcl_Type1.referenceSignal.choice.ssb = 5;
 tcid13->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
717
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid13);
718

Cedric Roux's avatar
Cedric Roux committed
719
 NR_TCI_State_t*tcid14=calloc(1,sizeof(*tcid14));
720 721
 tcid14->tci_StateId=14;
 tcid14->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
722
 tcid14->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid14->qcl_Type1.bwp_Id));
723 724 725 726
 *tcid14->qcl_Type1.bwp_Id=1;
 tcid14->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tcid14->qcl_Type1.referenceSignal.choice.ssb = 6;
 tcid14->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
727
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid14);
728

Cedric Roux's avatar
Cedric Roux committed
729
 NR_TCI_State_t*tcid15=calloc(1,sizeof(*tcid15));
730 731
 tcid15->tci_StateId=15;
 tcid15->qcl_Type1.cell=NULL;
Cedric Roux's avatar
Cedric Roux committed
732
 tcid15->qcl_Type1.bwp_Id=calloc(1,sizeof(*tcid15->qcl_Type1.bwp_Id));
733 734 735 736
 *tcid15->qcl_Type1.bwp_Id=1;
 tcid15->qcl_Type1.referenceSignal.present = NR_QCL_Info__referenceSignal_PR_ssb;
 tcid15->qcl_Type1.referenceSignal.choice.ssb = 7;
 tcid15->qcl_Type1.qcl_Type=NR_QCL_Info__qcl_Type_typeC;
737
 ASN_SEQUENCE_ADD(&bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList->list,tcid15);
738
#endif
739 740 741

 bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToReleaseList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->vrb_ToPRB_Interleaver=NULL;
742
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->resourceAllocation=NR_PDSCH_Config__resourceAllocation_resourceAllocationType1;
743 744 745 746 747 748 749 750
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_AggregationFactor=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternToAddModList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternToReleaseList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table=NULL;
Cedric Roux's avatar
Cedric Roux committed
751
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI));
752 753
 *bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling;
Cedric Roux's avatar
Cedric Roux committed
754
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling));
755
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize =
Cedric Roux's avatar
Cedric Roux committed
756
   calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize));
757 758 759 760 761 762 763 764 765 766 767
 *bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize = NR_PDSCH_Config__prb_BundlingType__staticBundling__bundleSize_wideband;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->zp_CSI_RS_ResourceToAddModList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->zp_CSI_RS_ResourceToReleaseList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->aperiodic_ZP_CSI_RS_ResourceSetsToAddModList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->aperiodic_ZP_CSI_RS_ResourceSetsToReleaseList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->sp_ZP_CSI_RS_ResourceSetsToAddModList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->sp_ZP_CSI_RS_ResourceSetsToReleaseList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->p_ZP_CSI_RS_ResourceSet=NULL;

 bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToReleaseList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->vrb_ToPRB_Interleaver=NULL;
768
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->resourceAllocation=NR_PDSCH_Config__resourceAllocation_resourceAllocationType1;
769 770 771 772 773 774 775 776
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_AggregationFactor=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternToAddModList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternToReleaseList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table=NULL;
Cedric Roux's avatar
Cedric Roux committed
777
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI));
778 779
 *bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling;
Cedric Roux's avatar
Cedric Roux committed
780
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling));
781
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize =
Cedric Roux's avatar
Cedric Roux committed
782
   calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize));
783 784 785 786 787 788 789 790
 *bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize = NR_PDSCH_Config__prb_BundlingType__staticBundling__bundleSize_wideband;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->zp_CSI_RS_ResourceToAddModList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->zp_CSI_RS_ResourceToReleaseList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->aperiodic_ZP_CSI_RS_ResourceSetsToAddModList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->aperiodic_ZP_CSI_RS_ResourceSetsToReleaseList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->sp_ZP_CSI_RS_ResourceSetsToAddModList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->sp_ZP_CSI_RS_ResourceSetsToReleaseList=NULL;
 bwp->bwp_Dedicated->pdsch_Config->choice.setup->p_ZP_CSI_RS_ResourceSet=NULL;
791
 bwp->bwp_Dedicated->sps_Config = NULL; //calloc(1,sizeof(struct NR_SetupRelease_SPS_Config));
792

793 794
 bwp->bwp_Dedicated->radioLinkMonitoringConfig = NULL;
#if 0
Cedric Roux's avatar
Cedric Roux committed
795
 bwp->bwp_Dedicated->radioLinkMonitoringConfig = calloc(1,sizeof(*bwp->bwp_Dedicated->radioLinkMonitoringConfig));
796 797
 bwp->bwp_Dedicated->radioLinkMonitoringConfig->present = NR_SetupRelease_RadioLinkMonitoringConfig_PR_setup;

Cedric Roux's avatar
Cedric Roux committed
798
 bwp->bwp_Dedicated->radioLinkMonitoringConfig->choice.setup = calloc(1,sizeof(*bwp->bwp_Dedicated->radioLinkMonitoringConfig->choice.setup));
799 800
 bwp->bwp_Dedicated->radioLinkMonitoringConfig->choice.setup->failureDetectionResourcesToAddModList=NULL;
 bwp->bwp_Dedicated->radioLinkMonitoringConfig->choice.setup->failureDetectionResourcesToReleaseList=NULL;
Cedric Roux's avatar
Cedric Roux committed
801
 bwp->bwp_Dedicated->radioLinkMonitoringConfig->choice.setup->beamFailureInstanceMaxCount = calloc(1,sizeof(*bwp->bwp_Dedicated->radioLinkMonitoringConfig->choice.setup->beamFailureInstanceMaxCount));
802
 *bwp->bwp_Dedicated->radioLinkMonitoringConfig->choice.setup->beamFailureInstanceMaxCount = NR_RadioLinkMonitoringConfig__beamFailureInstanceMaxCount_n3;
Cedric Roux's avatar
Cedric Roux committed
803
 bwp->bwp_Dedicated->radioLinkMonitoringConfig->choice.setup->beamFailureDetectionTimer = calloc(1,sizeof(*bwp->bwp_Dedicated->radioLinkMonitoringConfig->choice.setup->beamFailureDetectionTimer));
804
 *bwp->bwp_Dedicated->radioLinkMonitoringConfig->choice.setup->beamFailureDetectionTimer = NR_RadioLinkMonitoringConfig__beamFailureDetectionTimer_pbfd2;
805
#endif
806
 
807
   ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list,bwp);
808

809
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id));
810
 
811
 *secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id=1; //0; //1;
812 813
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->bwp_InactivityTimer = NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id = NULL;
814 815
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id = calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id));
 *secondaryCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id = 1;
816
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig));
817

Cedric Roux's avatar
Cedric Roux committed
818
 NR_BWP_UplinkDedicated_t *initialUplinkBWP = calloc(1,sizeof(*initialUplinkBWP));
819
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP = initialUplinkBWP;
820
 initialUplinkBWP->pucch_Config = NULL;
821
 initialUplinkBWP->pusch_Config = calloc(1,sizeof(*initialUplinkBWP->pusch_Config));
822
 initialUplinkBWP->pusch_Config->present = NR_SetupRelease_PUSCH_Config_PR_setup;
Cedric Roux's avatar
Cedric Roux committed
823
 NR_PUSCH_Config_t *pusch_Config = calloc(1,sizeof(*pusch_Config));
824 825
 initialUplinkBWP->pusch_Config->choice.setup = pusch_Config;
 pusch_Config->txConfig=calloc(1,sizeof(*pusch_Config->txConfig));
826 827 828 829
 *pusch_Config->txConfig= NR_PUSCH_Config__txConfig_codebook;
 pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA = NULL;
 pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB = calloc(1,sizeof(*pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB));
 pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->present = NR_SetupRelease_DMRS_UplinkConfig_PR_setup;
830 831
 pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup = calloc(1,sizeof(*pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup));
 NR_DMRS_UplinkConfig_t *NR_DMRS_UplinkConfig = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup;
832 833 834 835 836 837 838 839 840 841
 NR_DMRS_UplinkConfig->dmrs_Type = NULL;
 NR_DMRS_UplinkConfig->dmrs_AdditionalPosition =NR_DMRS_UplinkConfig__dmrs_AdditionalPosition_pos0;
 NR_DMRS_UplinkConfig->phaseTrackingRS=NULL;
 NR_DMRS_UplinkConfig->maxLength=NULL;
 NR_DMRS_UplinkConfig->transformPrecodingDisabled = calloc(1,sizeof(*NR_DMRS_UplinkConfig->transformPrecodingDisabled));
 NR_DMRS_UplinkConfig->transformPrecodingDisabled->scramblingID0 = NULL;
 NR_DMRS_UplinkConfig->transformPrecodingDisabled->scramblingID1 = NULL;
 NR_DMRS_UplinkConfig->transformPrecodingEnabled = NULL;
 pusch_Config->pusch_PowerControl = calloc(1,sizeof(*pusch_Config->pusch_PowerControl));
 pusch_Config->pusch_PowerControl->tpc_Accumulation = NULL;
842 843
 pusch_Config->pusch_PowerControl->msg3_Alpha = calloc(1,sizeof(*pusch_Config->pusch_PowerControl->msg3_Alpha));
 *pusch_Config->pusch_PowerControl->msg3_Alpha = NR_Alpha_alpha1;
844
 pusch_Config->pusch_PowerControl->p0_NominalWithoutGrant = NULL;
Cedric Roux's avatar
Cedric Roux committed
845 846
 pusch_Config->pusch_PowerControl->p0_AlphaSets = calloc(1,sizeof(*pusch_Config->pusch_PowerControl->p0_AlphaSets));
 NR_P0_PUSCH_AlphaSet_t *aset = calloc(1,sizeof(*aset));
847 848 849
 aset->p0_PUSCH_AlphaSetId=0;
 aset->p0=calloc(1,sizeof(*aset->p0));
 *aset->p0 = 0;
850
 aset->alpha=calloc(1,sizeof(*aset->alpha));
851
 *aset->alpha=NR_Alpha_alpha1;
852
 ASN_SEQUENCE_ADD(&pusch_Config->pusch_PowerControl->p0_AlphaSets->list,aset);
Cedric Roux's avatar
Cedric Roux committed
853 854
 pusch_Config->pusch_PowerControl->pathlossReferenceRSToAddModList = calloc(1,sizeof(*pusch_Config->pusch_PowerControl->pathlossReferenceRSToAddModList));
 NR_PUSCH_PathlossReferenceRS_t *pl = calloc(1,sizeof(*pl));
855 856 857 858 859 860 861 862 863 864 865 866
 pl->pusch_PathlossReferenceRS_Id=0;
 pl->referenceSignal.present = NR_PUSCH_PathlossReferenceRS__referenceSignal_PR_csi_RS_Index;
 pl->referenceSignal.choice.csi_RS_Index=0;
 ASN_SEQUENCE_ADD(&pusch_Config->pusch_PowerControl->pathlossReferenceRSToAddModList->list,pl);
 pusch_Config->pusch_PowerControl->pathlossReferenceRSToReleaseList = NULL;
 pusch_Config->pusch_PowerControl->twoPUSCH_PC_AdjustmentStates = NULL;
 pusch_Config->pusch_PowerControl->deltaMCS = NULL;
 pusch_Config->pusch_PowerControl->sri_PUSCH_MappingToAddModList = NULL;
 pusch_Config->pusch_PowerControl->sri_PUSCH_MappingToReleaseList = NULL;
 pusch_Config->frequencyHopping=NULL;
 pusch_Config->frequencyHoppingOffsetLists=NULL;
 pusch_Config->resourceAllocation = NR_PUSCH_Config__resourceAllocation_resourceAllocationType1;
867
 pusch_Config->pusch_TimeDomainAllocationList = NULL;
868 869 870 871 872
 pusch_Config->pusch_AggregationFactor=NULL;
 pusch_Config->mcs_Table=NULL;
 pusch_Config->mcs_TableTransformPrecoder=NULL;
 pusch_Config->transformPrecoder=calloc(1,sizeof(*pusch_Config->transformPrecoder));
 *pusch_Config->transformPrecoder = NR_PUSCH_Config__transformPrecoder_disabled;
873 874 875 876
 pusch_Config->codebookSubset=calloc(1,sizeof(*pusch_Config->codebookSubset));
 *pusch_Config->codebookSubset = NR_PUSCH_Config__codebookSubset_nonCoherent;
 pusch_Config->maxRank=calloc(1,sizeof(*pusch_Config->maxRank));
 *pusch_Config->maxRank= 1;
877 878 879 880
 pusch_Config->rbg_Size=NULL;
 pusch_Config->uci_OnPUSCH=NULL;
 pusch_Config->tp_pi2BPSK=NULL;

881
 initialUplinkBWP->srs_Config = calloc(1,sizeof(*initialUplinkBWP->srs_Config));
882
 initialUplinkBWP->srs_Config->present = NR_SetupRelease_SRS_Config_PR_setup;
Cedric Roux's avatar
Cedric Roux committed
883
 NR_SRS_Config_t *srs_Config = calloc(1,sizeof(*srs_Config));
884
 initialUplinkBWP->srs_Config->choice.setup=srs_Config;
885 886 887 888 889 890 891 892 893 894
 srs_Config->srs_ResourceSetToReleaseList=NULL;
 srs_Config->srs_ResourceSetToAddModList=calloc(1,sizeof(*srs_Config->srs_ResourceSetToAddModList));
 NR_SRS_ResourceSet_t *srs_resset0=calloc(1,sizeof(*srs_resset0));
 srs_resset0->srs_ResourceSetId = 0;
 srs_resset0->srs_ResourceIdList=calloc(1,sizeof(*srs_resset0->srs_ResourceIdList));
 NR_SRS_ResourceId_t *srs_resset0_id=calloc(1,sizeof(*srs_resset0_id));
 *srs_resset0_id=0;
 ASN_SEQUENCE_ADD(&srs_resset0->srs_ResourceIdList->list,srs_resset0_id);
 srs_Config->srs_ResourceToReleaseList=NULL;
 srs_resset0->resourceType.present =  NR_SRS_ResourceSet__resourceType_PR_aperiodic;
895 896
 srs_resset0->resourceType.choice.aperiodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic));
 srs_resset0->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger=1;
897
 srs_resset0->resourceType.choice.aperiodic->csi_RS=NULL;
Raymond Knopp's avatar
Raymond Knopp committed
898
 srs_resset0->resourceType.choice.aperiodic->slotOffset= calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic->slotOffset));
899 900 901
 *srs_resset0->resourceType.choice.aperiodic->slotOffset=2;
 srs_resset0->resourceType.choice.aperiodic->ext1=NULL;
 srs_resset0->usage=NR_SRS_ResourceSet__usage_codebook;
902 903
 srs_resset0->alpha = calloc(1,sizeof(*srs_resset0->alpha));
 *srs_resset0->alpha = NR_Alpha_alpha1;
904 905 906 907 908 909 910 911 912 913
 srs_resset0->p0=calloc(1,sizeof(*srs_resset0->p0));
 *srs_resset0->p0=-80;
 srs_resset0->pathlossReferenceRS=NULL;
 srs_resset0->srs_PowerControlAdjustmentStates=NULL;
 ASN_SEQUENCE_ADD(&srs_Config->srs_ResourceSetToAddModList->list,srs_resset0);
 srs_Config->srs_ResourceToReleaseList=NULL;
 srs_Config->srs_ResourceToAddModList=calloc(1,sizeof(*srs_Config->srs_ResourceToAddModList));
 NR_SRS_Resource_t *srs_res0=calloc(1,sizeof(*srs_res0));
 srs_res0->srs_ResourceId=0;
 srs_res0->nrofSRS_Ports=NR_SRS_Resource__nrofSRS_Ports_port1;
914
 srs_res0->ptrs_PortIndex=NULL;
915 916 917 918 919
 srs_res0->transmissionComb.present=NR_SRS_Resource__transmissionComb_PR_n2; 
 srs_res0->transmissionComb.choice.n2=calloc(1,sizeof(*srs_res0->transmissionComb.choice.n2));
 srs_res0->transmissionComb.choice.n2->combOffset_n2=0;
 srs_res0->transmissionComb.choice.n2->cyclicShift_n2=0;
 srs_res0->resourceMapping.startPosition=2;
920 921
 srs_res0->resourceMapping.nrofSymbols=NR_SRS_Resource__resourceMapping__nrofSymbols_n1;
 srs_res0->resourceMapping.repetitionFactor=NR_SRS_Resource__resourceMapping__repetitionFactor_n1;
922 923 924
 srs_res0->freqDomainPosition=0;
 srs_res0->freqDomainShift=0;
 srs_res0->freqHopping.c_SRS = 61;
925 926
 srs_res0->freqHopping.b_SRS=0;
 srs_res0->freqHopping.b_hop=0;
927 928 929 930 931
 srs_res0->groupOrSequenceHopping=NR_SRS_Resource__groupOrSequenceHopping_neither;
 srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_aperiodic;
 srs_res0->resourceType.choice.aperiodic=calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic));
 srs_res0->sequenceId=40;
 srs_res0->spatialRelationInfo=calloc(1,sizeof(*srs_res0->spatialRelationInfo));
932 933 934
 srs_res0->spatialRelationInfo->servingCellId=NULL;
 srs_res0->spatialRelationInfo->referenceSignal.present=NR_SRS_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
 srs_res0->spatialRelationInfo->referenceSignal.choice.csi_RS_Index=0;
935 936
 ASN_SEQUENCE_ADD(&srs_Config->srs_ResourceToAddModList->list,srs_res0);

937
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToReleaseList = NULL;
938
// secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList = NULL;
939
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList));
Cedric Roux's avatar
Cedric Roux committed
940
 NR_BWP_Uplink_t *ubwp = calloc(1,sizeof(*ubwp));
941 942 943 944
 ubwp->bwp_Id=1;
 ubwp->bwp_Common = calloc(1,sizeof(*ubwp->bwp_Common));
 // copy bwp_Common from Initial UL BWP except for bandwidth
 memcpy((void*)&ubwp->bwp_Common->genericParameters,
945 946
	(void*)&servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->genericParameters,
	sizeof(servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->genericParameters));
947
 ubwp->bwp_Common->genericParameters.locationAndBandwidth=6407; //PRBalloc_to_locationandbandwidth(servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,0);
948
 ubwp->bwp_Common->genericParameters.locationAndBandwidth=PRBalloc_to_locationandbandwidth(servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,0);
949

950
servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig = 0;
951 952 953 954 955 956 957
 ubwp->bwp_Common->rach_ConfigCommon  = servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon;
 ubwp->bwp_Common->pusch_ConfigCommon = servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon;
 ubwp->bwp_Common->pucch_ConfigCommon = servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon;
 
 ubwp->bwp_Dedicated = calloc(1,sizeof(*ubwp->bwp_Dedicated));
 ubwp->bwp_Dedicated->pucch_Config = calloc(1,sizeof(*ubwp->bwp_Dedicated->pucch_Config));
 ubwp->bwp_Dedicated->pucch_Config->present = NR_SetupRelease_PUCCH_Config_PR_setup;
Cedric Roux's avatar
Cedric Roux committed
958
 NR_PUCCH_Config_t *pucch_Config = calloc(1,sizeof(*pucch_Config));
959
 ubwp->bwp_Dedicated->pucch_Config->choice.setup=pucch_Config;
960 961
 pucch_Config->resourceSetToAddModList = calloc(1,sizeof(*pucch_Config->resourceSetToAddModList));
 pucch_Config->resourceSetToReleaseList = NULL;
Cedric Roux's avatar
Cedric Roux committed
962 963
 NR_PUCCH_ResourceSet_t *pucchresset0=calloc(1,sizeof(*pucchresset0));
 NR_PUCCH_ResourceSet_t *pucchresset1=calloc(1,sizeof(*pucchresset1));
964
 pucchresset0->pucch_ResourceSetId = 0;
Cedric Roux's avatar
Cedric Roux committed
965 966
 NR_PUCCH_ResourceId_t *pucchresset0id0=calloc(1,sizeof(*pucchresset0id0));
 NR_PUCCH_ResourceId_t *pucchresset0id1=calloc(1,sizeof(*pucchresset0id1));
967
 *pucchresset0id0=1;
968
 ASN_SEQUENCE_ADD(&pucchresset0->resourceList.list,pucchresset0id0);
969
 *pucchresset0id1=2;
970
 ASN_SEQUENCE_ADD(&pucchresset0->resourceList.list,pucchresset0id1);
971 972
 pucchresset0->maxPayloadMinus1=NULL;

973
 ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset0);
974

975
 pucchresset1->pucch_ResourceSetId = 1;
Cedric Roux's avatar
Cedric Roux committed
976 977
 NR_PUCCH_ResourceId_t *pucchresset1id0=calloc(1,sizeof(*pucchresset1id0));
 NR_PUCCH_ResourceId_t *pucchresset1id1=calloc(1,sizeof(*pucchresset1id1));
978
 *pucchresset1id0=3;
979
 ASN_SEQUENCE_ADD(&pucchresset1->resourceList.list,pucchresset1id0);
980
 *pucchresset1id1=4;
981
 ASN_SEQUENCE_ADD(&pucchresset1->resourceList.list,pucchresset1id1);
982
 pucchresset1->maxPayloadMinus1=NULL;
983
 ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset1);
984 985 986

 pucch_Config->resourceToAddModList = calloc(1,sizeof(*pucch_Config->resourceToAddModList));
 pucch_Config->resourceToReleaseList = NULL;
987 988 989 990
 NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
 NR_PUCCH_Resource_t *pucchres1=calloc(1,sizeof(*pucchres1));
 NR_PUCCH_Resource_t *pucchres2=calloc(1,sizeof(*pucchres2));
 NR_PUCCH_Resource_t *pucchres3=calloc(1,sizeof(*pucchres3));
991 992 993
 pucchres0->pucch_ResourceId=1;
 pucchres0->startingPRB=48;
 pucchres0->intraSlotFrequencyHopping=NULL;
994
 pucchres0->secondHopPRB=NULL;
995 996 997 998 999
 pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0;
 pucchres0->format.choice.format0=calloc(1,sizeof(*pucchres0->format.choice.format0));
 pucchres0->format.choice.format0->initialCyclicShift=0;
 pucchres0->format.choice.format0->nrofSymbols=1;
 pucchres0->format.choice.format0->startingSymbolIndex=13;
1000
 ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres0);
1001 1002 1003 1004

 pucchres1->pucch_ResourceId=2;
 pucchres1->startingPRB=48;
 pucchres1->intraSlotFrequencyHopping=NULL;
1005
 pucchres1->secondHopPRB=NULL;
1006 1007 1008 1009 1010
 pucchres1->format.present= NR_PUCCH_Resource__format_PR_format0;
 pucchres1->format.choice.format0=calloc(1,sizeof(*pucchres1->format.choice.format0));
 pucchres1->format.choice.format0->initialCyclicShift=0;
 pucchres1->format.choice.format0->nrofSymbols=1;
 pucchres1->format.choice.format0->startingSymbolIndex=12;
1011
 ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres1);
1012 1013 1014 1015

 pucchres2->pucch_ResourceId=3;
 pucchres2->startingPRB=40;
 pucchres2->intraSlotFrequencyHopping=NULL;
1016
 pucchres2->secondHopPRB=NULL;
1017 1018
 pucchres2->format.present= NR_PUCCH_Resource__format_PR_format2;
 pucchres2->format.choice.format2=calloc(1,sizeof(*pucchres2->format.choice.format2));
1019
 pucchres2->format.choice.format2->nrofPRBs=16;
1020 1021
 pucchres2->format.choice.format2->nrofSymbols=1;
 pucchres2->format.choice.format2->startingSymbolIndex=13;
1022
 ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres2);
1023 1024 1025 1026

 pucchres3->pucch_ResourceId=4;
 pucchres3->startingPRB=40;
 pucchres3->intraSlotFrequencyHopping=NULL;
1027
 pucchres3->secondHopPRB=NULL;
1028 1029
 pucchres3->format.present= NR_PUCCH_Resource__format_PR_format2;
 pucchres3->format.choice.format2=calloc(1,sizeof(*pucchres3->format.choice.format2));
1030
 pucchres3->format.choice.format2->nrofPRBs=16;
1031 1032
 pucchres3->format.choice.format2->nrofSymbols=1;
 pucchres3->format.choice.format2->startingSymbolIndex=12;
1033
 ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres3);
1034 1035 1036

 pucch_Config->format2=calloc(1,sizeof(*pucch_Config->format2));
 pucch_Config->format2->present=NR_SetupRelease_PUCCH_FormatConfig_PR_setup;
Cedric Roux's avatar
Cedric Roux committed
1037
 NR_PUCCH_FormatConfig_t *pucchfmt2 = calloc(1,sizeof(*pucchfmt2));
1038
 pucch_Config->format2->choice.setup = pucchfmt2;
1039 1040
 pucchfmt2->interslotFrequencyHopping=NULL;
 pucchfmt2->additionalDMRS=NULL;
1041
 pucchfmt2->maxCodeRate=calloc(1,sizeof(*pucchfmt2->maxCodeRate));
1042 1043 1044 1045 1046 1047 1048
 *pucchfmt2->maxCodeRate=NR_PUCCH_MaxCodeRate_zeroDot15;
 pucchfmt2->nrofSlots=NULL;
 pucchfmt2->pi2BPSK=NULL;
 pucchfmt2->simultaneousHARQ_ACK_CSI=NULL;
 pucch_Config->schedulingRequestResourceToAddModList=NULL;
 pucch_Config->schedulingRequestResourceToReleaseList=NULL;
 pucch_Config->multi_CSI_PUCCH_ResourceList=NULL;
1049
 pucch_Config->dl_DataToUL_ACK = calloc(1,sizeof(*pucch_Config->dl_DataToUL_ACK));
1050 1051
 long *delay[8];
 for (int i=0;i<8;i++) {
Cedric Roux's avatar
Cedric Roux committed
1052
   delay[i] = calloc(1,sizeof(*delay[i]));
1053
   *delay[i] = (i<6) ? (i+2) : 0;
1054
   ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
1055
 }
1056 1057
 pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList));
 NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial));
1058 1059
 pucchspatial->pucch_SpatialRelationInfoId = 1;
 pucchspatial->servingCellId = NULL;
1060 1061
 pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
 pucchspatial->referenceSignal.choice.csi_RS_Index = 0;
1062
 pucchspatial->pucch_PathlossReferenceRS_Id = 0;
1063
 pucchspatial->p0_PUCCH_Id = 1;
1064
 pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0;
1065
 ASN_SEQUENCE_ADD(&pucch_Config->spatialRelationInfoToAddModList->list,pucchspatial);
1066 1067
 pucch_Config->spatialRelationInfoToReleaseList=NULL;
 pucch_Config->pucch_PowerControl=calloc(1,sizeof(*pucch_Config->pucch_PowerControl));
Cedric Roux's avatar
Cedric Roux committed
1068
 pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0));
1069
 *pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = 0;
Cedric Roux's avatar
Cedric Roux committed
1070
 pucch_Config->pucch_PowerControl->deltaF_PUCCH_f1 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f1));
1071
 *pucch_Config->pucch_PowerControl->deltaF_PUCCH_f1 = 0;
Cedric Roux's avatar
Cedric Roux committed
1072
 pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2));
1073
 *pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = 0;
Cedric Roux's avatar
Cedric Roux committed
1074
 pucch_Config->pucch_PowerControl->deltaF_PUCCH_f3 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f3));
1075
 *pucch_Config->pucch_PowerControl->deltaF_PUCCH_f3 = 0;
Cedric Roux's avatar
Cedric Roux committed
1076
 pucch_Config->pucch_PowerControl->deltaF_PUCCH_f4 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f4));
1077
 *pucch_Config->pucch_PowerControl->deltaF_PUCCH_f4 = 0;
Cedric Roux's avatar
Cedric Roux committed
1078
 pucch_Config->pucch_PowerControl->p0_Set = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->p0_Set));
1079 1080 1081 1082 1083
 NR_P0_PUCCH_t *p00 = calloc(1,sizeof(*p00));
 p00->p0_PUCCH_Id=1;
 p00->p0_PUCCH_Value = 0;
 ASN_SEQUENCE_ADD(&pucch_Config->pucch_PowerControl->p0_Set->list,p00);
 pucch_Config->pucch_PowerControl->pathlossReferenceRSs = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->pathlossReferenceRSs));
1084 1085 1086 1087
 NR_PUCCH_PathlossReferenceRS_t *pucchPLRef=calloc(1,sizeof(*pucchPLRef));
 pucchPLRef->pucch_PathlossReferenceRS_Id=0;
 pucchPLRef->referenceSignal.present = NR_PUCCH_PathlossReferenceRS__referenceSignal_PR_csi_RS_Index;
 pucchPLRef->referenceSignal.choice.csi_RS_Index=0;
1088
 ASN_SEQUENCE_ADD(&pucch_Config->pucch_PowerControl->pathlossReferenceRSs->list,pucchPLRef);
1089 1090

 // copy pusch_Config from dedicated initialBWP
1091 1092 1093 1094
 ubwp->bwp_Dedicated->pusch_Config = calloc(1,sizeof(*ubwp->bwp_Dedicated->pusch_Config));
 ubwp->bwp_Dedicated->pusch_Config->present = NR_SetupRelease_PUSCH_Config_PR_setup;
 ubwp->bwp_Dedicated->pusch_Config->choice.setup = pusch_Config;

1095
 ubwp->bwp_Dedicated->configuredGrantConfig = NULL;
1096 1097 1098 1099
 ubwp->bwp_Dedicated->srs_Config = calloc(1,sizeof(*ubwp->bwp_Dedicated->srs_Config));
 ubwp->bwp_Dedicated->srs_Config->present = NR_SetupRelease_SRS_Config_PR_setup;
 ubwp->bwp_Dedicated->srs_Config->choice.setup = srs_Config;

1100 1101
 ubwp->bwp_Dedicated->beamFailureRecoveryConfig = NULL;

1102
   ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list,ubwp);
1103

Cedric Roux's avatar
Cedric Roux committed
1104
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id));
1105
 *secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id = 1; //0; //1;
1106 1107
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig = NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->carrierSwitching = NULL;
1108

1109
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->supplementaryUplink=NULL;
1110

1111
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->pdcch_ServingCellConfig=NULL;
1112

1113
#if 0
1114
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig));
Cedric Roux's avatar
Cedric Roux committed
1115
 NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig = calloc(1,sizeof(*pdsch_servingcellconfig));
1116 1117
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->present = NR_SetupRelease_PDSCH_ServingCellConfig_PR_setup;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup = pdsch_servingcellconfig;
1118 1119 1120
#endif
 NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig = calloc(1,sizeof(*pdsch_servingcellconfig));
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig=NULL;
1121 1122 1123 1124
 pdsch_servingcellconfig->codeBlockGroupTransmission = NULL;
 pdsch_servingcellconfig->xOverhead = NULL;
 pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = NULL;
 pdsch_servingcellconfig->pucch_Cell= NULL;
1125 1126 1127 1128
 pdsch_servingcellconfig->ext1=calloc(1,sizeof(*pdsch_servingcellconfig->ext1));
 pdsch_servingcellconfig->ext1->maxMIMO_Layers = calloc(1,sizeof(*pdsch_servingcellconfig->ext1->maxMIMO_Layers));
 *pdsch_servingcellconfig->ext1->maxMIMO_Layers = 2;
 pdsch_servingcellconfig->ext1->processingType2Enabled = NULL;
1129
 
1130 1131 1132
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig=NULL;
 //secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig));
 //secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->present = NR_SetupRelease_CSI_MeasConfig_PR_setup;
1133

1134

Cedric Roux's avatar
Cedric Roux committed
1135
 NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig));
1136
// secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig;
1137 1138
 csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList));

1139
 NR_NZP_CSI_RS_Resource_t *nzpres0 = calloc(1,sizeof(*nzpres0));
1140 1141 1142 1143 1144
 nzpres0->nzp_CSI_RS_ResourceId=0;
 nzpres0->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other;
 nzpres0->resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(1,1);
 nzpres0->resourceMapping.frequencyDomainAllocation.choice.other.size = 1;
 nzpres0->resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2;
1145
 nzpres0->resourceMapping.frequencyDomainAllocation.choice.other.buf[0]=1<<2;
1146 1147 1148 1149 1150 1151 1152 1153
 nzpres0->resourceMapping.nrofPorts = (n_physical_antenna_ports==1)? NR_CSI_RS_ResourceMapping__nrofPorts_p1 : NR_CSI_RS_ResourceMapping__nrofPorts_p2;
 nzpres0->resourceMapping.firstOFDMSymbolInTimeDomain=7;
 nzpres0->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
 nzpres0->resourceMapping.cdm_Type = (n_physical_antenna_ports==1)? NR_CSI_RS_ResourceMapping__cdm_Type_noCDM : NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2;
 nzpres0->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_one;
 nzpres0->resourceMapping.density.choice.one=(NULL_t)0;
 nzpres0->resourceMapping.freqBand.startingRB=0;
 nzpres0->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
1154 1155 1156 1157 1158 1159 1160 1161 1162
 nzpres0->powerControlOffset=13;
 nzpres0->powerControlOffsetSS=NULL;
 nzpres0->scramblingID=40;
 nzpres0->periodicityAndOffset = calloc(1,sizeof(*nzpres0->periodicityAndOffset));
 nzpres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
 nzpres0->periodicityAndOffset->choice.slots320 = 2;
 nzpres0->qcl_InfoPeriodicCSI_RS=NULL;
 ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres0);

1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584
 if (n_physical_antenna_ports > 1) {
   NR_NZP_CSI_RS_Resource_t *nzpres2 = calloc(1,sizeof(*nzpres2));
   nzpres2->nzp_CSI_RS_ResourceId=2;
   nzpres2->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres2->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres2->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres2->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres2->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=1;
   nzpres2->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres2->resourceMapping.firstOFDMSymbolInTimeDomain=4;
   nzpres2->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres2->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres2->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres2->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres2->resourceMapping.freqBand.startingRB=0;
   nzpres2->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres2->powerControlOffset=0;
   nzpres2->powerControlOffsetSS=calloc(1,sizeof(*nzpres2->powerControlOffsetSS));
   *nzpres2->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres2->scramblingID=40;
   nzpres2->periodicityAndOffset = calloc(1,sizeof(*nzpres2->periodicityAndOffset));
   nzpres2->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres2->periodicityAndOffset->choice.slots160 = 25;
   nzpres2->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres2->qcl_InfoPeriodicCSI_RS));
   *nzpres2->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres2);
   
   
   NR_NZP_CSI_RS_Resource_t *nzpres3 = calloc(1,sizeof(*nzpres3));
   nzpres3->nzp_CSI_RS_ResourceId=3;
   nzpres3->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres3->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres3->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres3->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres3->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=1;
   nzpres3->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres3->resourceMapping.firstOFDMSymbolInTimeDomain=8;
   nzpres3->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres3->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres3->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres3->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres3->resourceMapping.freqBand.startingRB=0;
   nzpres3->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres3->powerControlOffset=0;
   nzpres3->powerControlOffsetSS=calloc(1,sizeof(*nzpres3->powerControlOffsetSS));
   *nzpres3->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres3->scramblingID=40;
   nzpres3->periodicityAndOffset = calloc(1,sizeof(*nzpres3->periodicityAndOffset));
   nzpres3->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres3->periodicityAndOffset->choice.slots160 = 25;
   nzpres3->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres3->qcl_InfoPeriodicCSI_RS));
   *nzpres3->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres3);
 }
 if (n_physical_antenna_ports > 3) {
   NR_NZP_CSI_RS_Resource_t *nzpres4 = calloc(1,sizeof(*nzpres4));
   nzpres4->nzp_CSI_RS_ResourceId=4;
   nzpres4->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres4->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres4->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres4->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres4->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=1;
   nzpres4->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres4->resourceMapping.firstOFDMSymbolInTimeDomain=4;
   nzpres4->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres4->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres4->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres4->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres4->resourceMapping.freqBand.startingRB=0;
   nzpres4->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres4->powerControlOffset=0;
   nzpres4->powerControlOffsetSS=calloc(1,sizeof(*nzpres4->powerControlOffsetSS));
   *nzpres4->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres4->scramblingID=40;
   nzpres4->periodicityAndOffset = calloc(1,sizeof(*nzpres4->periodicityAndOffset));
   nzpres4->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres4->periodicityAndOffset->choice.slots160 = 26;
   nzpres4->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres4->qcl_InfoPeriodicCSI_RS));
   *nzpres4->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres4);
   
   NR_NZP_CSI_RS_Resource_t *nzpres5 = calloc(1,sizeof(*nzpres5));
   nzpres5->nzp_CSI_RS_ResourceId=5;
   nzpres5->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres5->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres5->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres5->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres5->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=1;
   nzpres5->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres5->resourceMapping.firstOFDMSymbolInTimeDomain=8;
   nzpres5->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres5->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres5->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres5->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres5->resourceMapping.freqBand.startingRB=0;
   nzpres5->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres5->powerControlOffset=0;
   nzpres5->powerControlOffsetSS=calloc(1,sizeof(*nzpres5->powerControlOffsetSS));
   *nzpres5->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres5->scramblingID=40;
   nzpres5->periodicityAndOffset = calloc(1,sizeof(*nzpres5->periodicityAndOffset));
   nzpres5->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres5->periodicityAndOffset->choice.slots160 = 26;
   nzpres5->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres5->qcl_InfoPeriodicCSI_RS));
   *nzpres5->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres5);
 }
 if (n_physical_antenna_ports > 7) {
   NR_NZP_CSI_RS_Resource_t *nzpres6 = calloc(1,sizeof(*nzpres6));
   nzpres6->nzp_CSI_RS_ResourceId=6;
   nzpres6->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres6->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres6->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres6->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres6->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=4;
   nzpres6->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres6->resourceMapping.firstOFDMSymbolInTimeDomain=4;
   nzpres6->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres6->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres6->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres6->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres6->resourceMapping.freqBand.startingRB=0;
   nzpres6->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres6->powerControlOffset=0;
   nzpres6->powerControlOffsetSS=calloc(1,sizeof(*nzpres6->powerControlOffsetSS));
   *nzpres6->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres6->scramblingID=40;
   nzpres6->periodicityAndOffset = calloc(1,sizeof(*nzpres6->periodicityAndOffset));
   nzpres6->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres6->periodicityAndOffset->choice.slots160 = 25;
   nzpres6->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres6->qcl_InfoPeriodicCSI_RS));
   *nzpres6->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres6);
   
   NR_NZP_CSI_RS_Resource_t *nzpres7 = calloc(1,sizeof(*nzpres7));
   nzpres7->nzp_CSI_RS_ResourceId=7;
   nzpres7->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres7->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres7->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres7->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres7->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=4;
   nzpres7->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres7->resourceMapping.firstOFDMSymbolInTimeDomain=8;
   nzpres7->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres7->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres7->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres7->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres7->resourceMapping.freqBand.startingRB=0;
   nzpres7->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres7->powerControlOffset=0;
   nzpres7->powerControlOffsetSS=calloc(1,sizeof(*nzpres7->powerControlOffsetSS));
   *nzpres7->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres7->scramblingID=40;
   nzpres7->periodicityAndOffset = calloc(1,sizeof(*nzpres7->periodicityAndOffset));
   nzpres7->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres7->periodicityAndOffset->choice.slots160 = 25;
   nzpres7->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres7->qcl_InfoPeriodicCSI_RS));
   *nzpres7->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres7);
   NR_NZP_CSI_RS_Resource_t *nzpres8 = calloc(1,sizeof(*nzpres8));
   nzpres8->nzp_CSI_RS_ResourceId=8;
   nzpres8->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres8->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres8->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres8->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres8->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=4;
   nzpres8->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres8->resourceMapping.firstOFDMSymbolInTimeDomain=4;
   nzpres8->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres8->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres8->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres8->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres8->resourceMapping.freqBand.startingRB=0;
   nzpres8->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres8->powerControlOffset=0;
   nzpres8->powerControlOffsetSS=calloc(1,sizeof(*nzpres8->powerControlOffsetSS));
   *nzpres8->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres8->scramblingID=40;
   nzpres8->periodicityAndOffset = calloc(1,sizeof(*nzpres8->periodicityAndOffset));
   nzpres8->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres8->periodicityAndOffset->choice.slots160 = 26;
   nzpres8->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres8->qcl_InfoPeriodicCSI_RS));
   *nzpres8->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres8);
   
   NR_NZP_CSI_RS_Resource_t *nzpres9 = calloc(1,sizeof(*nzpres9));
   nzpres9->nzp_CSI_RS_ResourceId=9;
   nzpres9->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres9->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres9->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres9->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres9->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=4;
   nzpres9->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres9->resourceMapping.firstOFDMSymbolInTimeDomain=8;
   nzpres9->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres9->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres9->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres9->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres9->resourceMapping.freqBand.startingRB=0;
   nzpres9->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres9->powerControlOffset=0;
   nzpres9->powerControlOffsetSS=calloc(1,sizeof(*nzpres9->powerControlOffsetSS));
   *nzpres9->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres9->scramblingID=40;
   nzpres9->periodicityAndOffset = calloc(1,sizeof(*nzpres9->periodicityAndOffset));
   nzpres9->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres9->periodicityAndOffset->choice.slots160 = 26;
   nzpres9->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres9->qcl_InfoPeriodicCSI_RS));
   *nzpres9->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres9);
 }
 if (n_physical_antenna_ports > 15) {
   NR_NZP_CSI_RS_Resource_t *nzpres10 = calloc(1,sizeof(*nzpres10));
   nzpres10->nzp_CSI_RS_ResourceId=10;
   nzpres10->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres10->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres10->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres10->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres10->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=2;
   nzpres10->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres10->resourceMapping.firstOFDMSymbolInTimeDomain=4;
   nzpres10->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres10->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres10->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres10->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres10->resourceMapping.freqBand.startingRB=0;
   nzpres10->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres10->powerControlOffset=0;
   nzpres10->powerControlOffsetSS=calloc(1,sizeof(*nzpres10->powerControlOffsetSS));
   *nzpres10->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres10->scramblingID=40;
   nzpres10->periodicityAndOffset = calloc(1,sizeof(*nzpres10->periodicityAndOffset));
   nzpres10->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres10->periodicityAndOffset->choice.slots160 = 25;
   nzpres10->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres10->qcl_InfoPeriodicCSI_RS));
   *nzpres10->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres10);
   
   NR_NZP_CSI_RS_Resource_t *nzpres11 = calloc(1,sizeof(*nzpres11));
   nzpres11->nzp_CSI_RS_ResourceId=11;
   nzpres11->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres11->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres11->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres11->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres11->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=2;
   nzpres11->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres11->resourceMapping.firstOFDMSymbolInTimeDomain=8;
   nzpres11->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres11->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres11->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres11->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres11->resourceMapping.freqBand.startingRB=0;
   nzpres11->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres11->powerControlOffset=0;
   nzpres11->powerControlOffsetSS=calloc(1,sizeof(*nzpres11->powerControlOffsetSS));
   *nzpres11->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres11->scramblingID=40;
   nzpres11->periodicityAndOffset = calloc(1,sizeof(*nzpres11->periodicityAndOffset));
   nzpres11->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres11->periodicityAndOffset->choice.slots160 = 25;
   nzpres11->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres11->qcl_InfoPeriodicCSI_RS));
   *nzpres11->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres11);
   NR_NZP_CSI_RS_Resource_t *nzpres12 = calloc(1,sizeof(*nzpres12));
   nzpres12->nzp_CSI_RS_ResourceId=12;
   nzpres12->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres12->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres12->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres12->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres12->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=2;
   nzpres12->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres12->resourceMapping.firstOFDMSymbolInTimeDomain=4;
   nzpres12->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres12->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres12->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres12->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres12->resourceMapping.freqBand.startingRB=0;
   nzpres12->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres12->powerControlOffset=0;
   nzpres12->powerControlOffsetSS=calloc(1,sizeof(*nzpres12->powerControlOffsetSS));
   *nzpres12->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres12->scramblingID=40;
   nzpres12->periodicityAndOffset = calloc(1,sizeof(*nzpres12->periodicityAndOffset));
   nzpres12->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres12->periodicityAndOffset->choice.slots160 = 26;
   nzpres12->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres12->qcl_InfoPeriodicCSI_RS));
   *nzpres12->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres12);
   
   NR_NZP_CSI_RS_Resource_t *nzpres13 = calloc(1,sizeof(*nzpres13));
   nzpres13->nzp_CSI_RS_ResourceId=13;
   nzpres13->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres13->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres13->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres13->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres13->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=2;
   nzpres13->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres13->resourceMapping.firstOFDMSymbolInTimeDomain=8;
   nzpres13->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres13->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres13->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres13->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres13->resourceMapping.freqBand.startingRB=0;
   nzpres13->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres13->powerControlOffset=0;
   nzpres13->powerControlOffsetSS=calloc(1,sizeof(*nzpres13->powerControlOffsetSS));
   *nzpres13->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres13->scramblingID=40;
   nzpres13->periodicityAndOffset = calloc(1,sizeof(*nzpres13->periodicityAndOffset));
   nzpres13->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres13->periodicityAndOffset->choice.slots160 = 26;
   nzpres13->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres13->qcl_InfoPeriodicCSI_RS));
   *nzpres13->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres13);
   NR_NZP_CSI_RS_Resource_t *nzpres14 = calloc(1,sizeof(*nzpres14));
   nzpres14->nzp_CSI_RS_ResourceId=14;
   nzpres14->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres14->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres14->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres14->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres14->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=8;
   nzpres14->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres14->resourceMapping.firstOFDMSymbolInTimeDomain=4;
   nzpres14->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres14->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres14->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres14->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres14->resourceMapping.freqBand.startingRB=0;
   nzpres14->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres14->powerControlOffset=0;
   nzpres14->powerControlOffsetSS=calloc(1,sizeof(*nzpres14->powerControlOffsetSS));
   *nzpres14->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres14->scramblingID=40;
   nzpres14->periodicityAndOffset = calloc(1,sizeof(*nzpres14->periodicityAndOffset));
   nzpres14->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres14->periodicityAndOffset->choice.slots160 = 25;
   nzpres14->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres14->qcl_InfoPeriodicCSI_RS));
   *nzpres14->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres14);
   
   NR_NZP_CSI_RS_Resource_t *nzpres15 = calloc(1,sizeof(*nzpres15));
   nzpres15->nzp_CSI_RS_ResourceId=15;
   nzpres15->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres15->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres15->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres15->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres15->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=8;
   nzpres15->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres15->resourceMapping.firstOFDMSymbolInTimeDomain=8;
   nzpres15->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres15->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres15->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres15->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres15->resourceMapping.freqBand.startingRB=0;
   nzpres15->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres15->powerControlOffset=0;
   nzpres15->powerControlOffsetSS=calloc(1,sizeof(*nzpres15->powerControlOffsetSS));
   *nzpres15->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres15->scramblingID=40;
   nzpres15->periodicityAndOffset = calloc(1,sizeof(*nzpres15->periodicityAndOffset));
   nzpres15->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres15->periodicityAndOffset->choice.slots160 = 25;
   nzpres15->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres15->qcl_InfoPeriodicCSI_RS));
   *nzpres15->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres15);
   NR_NZP_CSI_RS_Resource_t *nzpres16 = calloc(1,sizeof(*nzpres16));
   nzpres16->nzp_CSI_RS_ResourceId=16;
   nzpres16->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres16->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres16->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres16->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres16->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=8;
   nzpres16->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres16->resourceMapping.firstOFDMSymbolInTimeDomain=5;
   nzpres16->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres16->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres16->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres16->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres16->resourceMapping.freqBand.startingRB=0;
   nzpres16->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres16->powerControlOffset=0;
   nzpres16->powerControlOffsetSS=calloc(1,sizeof(*nzpres16->powerControlOffsetSS));
   *nzpres16->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres16->scramblingID=40;
   nzpres16->periodicityAndOffset = calloc(1,sizeof(*nzpres16->periodicityAndOffset));
   nzpres16->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres16->periodicityAndOffset->choice.slots160 = 26;
   nzpres16->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres16->qcl_InfoPeriodicCSI_RS));
   *nzpres16->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres16);
   
   NR_NZP_CSI_RS_Resource_t *nzpres17 = calloc(1,sizeof(*nzpres17));
   nzpres17->nzp_CSI_RS_ResourceId=9;
   nzpres17->resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1;
   nzpres17->resourceMapping.frequencyDomainAllocation.choice.row1.buf = calloc(1,1);
   nzpres17->resourceMapping.frequencyDomainAllocation.choice.row1.size = 1;
   nzpres17->resourceMapping.frequencyDomainAllocation.choice.row1.bits_unused = 4;
   nzpres17->resourceMapping.frequencyDomainAllocation.choice.row1.buf[0]=8;
   nzpres17->resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
   nzpres17->resourceMapping.firstOFDMSymbolInTimeDomain=9;
   nzpres17->resourceMapping.firstOFDMSymbolInTimeDomain2=NULL;
   nzpres17->resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
   nzpres17->resourceMapping.density.present=NR_CSI_RS_ResourceMapping__density_PR_three;
   nzpres17->resourceMapping.density.choice.three=(NULL_t)0;
   nzpres17->resourceMapping.freqBand.startingRB=0;
   nzpres17->resourceMapping.freqBand.nrofRBs= servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
   nzpres17->powerControlOffset=0;
   nzpres17->powerControlOffsetSS=calloc(1,sizeof(*nzpres17->powerControlOffsetSS));
   *nzpres17->powerControlOffsetSS=NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
   nzpres17->scramblingID=40;
   nzpres17->periodicityAndOffset = calloc(1,sizeof(*nzpres17->periodicityAndOffset));
   nzpres17->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
   nzpres17->periodicityAndOffset->choice.slots160 = 26;
   nzpres17->qcl_InfoPeriodicCSI_RS=calloc(1,sizeof(*nzpres17->qcl_InfoPeriodicCSI_RS));
   *nzpres17->qcl_InfoPeriodicCSI_RS=8;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpres17);
 }

 if (n_physical_antenna_ports > 16) AssertFatal(1==0,"Fill in for more than 16 antenna elements\n");
 
 csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList  = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList));
 csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL;
Cedric Roux's avatar
Cedric Roux committed
1585
 NR_NZP_CSI_RS_ResourceSet_t *nzpresset0=calloc(1,sizeof(*nzpresset0));
1586
 nzpresset0->nzp_CSI_ResourceSetId=0;
Cedric Roux's avatar
Cedric Roux committed
1587
 NR_NZP_CSI_RS_ResourceSetId_t *nzpresset00=calloc(1,sizeof(*nzpresset00));
1588 1589 1590 1591 1592 1593 1594
 *nzpresset00=0;
 ASN_SEQUENCE_ADD(&nzpresset0->nzp_CSI_RS_Resources.list,nzpresset00);
 nzpresset0->repetition=NULL;
 nzpresset0->aperiodicTriggeringOffset=NULL;
 nzpresset0->trs_Info=NULL;
 ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpresset0);
 if (n_physical_antenna_ports > 1) {
Cedric Roux's avatar
Cedric Roux committed
1595
   NR_NZP_CSI_RS_ResourceSet_t *nzpresset3=calloc(1,sizeof(*nzpresset3));
1596
   nzpresset3->nzp_CSI_ResourceSetId=3;
Cedric Roux's avatar
Cedric Roux committed
1597
   NR_NZP_CSI_RS_ResourceSetId_t *nzpresset30=calloc(1,sizeof(*nzpresset30));
1598 1599 1600
   *nzpresset30=2;
   ASN_SEQUENCE_ADD(&nzpresset3->nzp_CSI_RS_Resources.list,nzpresset30);
   if (n_physical_antenna_ports > 3) {
Cedric Roux's avatar
Cedric Roux committed
1601
   NR_NZP_CSI_RS_ResourceSetId_t *nzpresset31=calloc(1,sizeof(*nzpresset31));
1602 1603
   *nzpresset31=3;
   ASN_SEQUENCE_ADD(&nzpresset3->nzp_CSI_RS_Resources.list,nzpresset31);
Cedric Roux's avatar
Cedric Roux committed
1604
   NR_NZP_CSI_RS_ResourceSetId_t *nzpresset32=calloc(1,sizeof(*nzpresset32));
1605 1606
   *nzpresset32=4;
   ASN_SEQUENCE_ADD(&nzpresset3->nzp_CSI_RS_Resources.list,nzpresset32);
Cedric Roux's avatar
Cedric Roux committed
1607
   NR_NZP_CSI_RS_ResourceSetId_t *nzpresset33=calloc(1,sizeof(*nzpresset33));
1608 1609 1610 1611 1612 1613 1614 1615 1616
   *nzpresset33=5;
   ASN_SEQUENCE_ADD(&nzpresset3->nzp_CSI_RS_Resources.list,nzpresset33);
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpresset3);
   }
   nzpresset3->repetition=calloc(1,sizeof(*nzpresset3->repetition));
   *nzpresset3->repetition=NR_NZP_CSI_RS_ResourceSet__repetition_off;
   nzpresset3->aperiodicTriggeringOffset=NULL;
   nzpresset3->trs_Info=calloc(1,sizeof(*nzpresset3->trs_Info));
   *nzpresset3->trs_Info=NR_NZP_CSI_RS_ResourceSet__trs_Info_true;
1617
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpresset3);
1618 1619 1620
 }

 if (n_physical_antenna_ports > 7) {
Cedric Roux's avatar
Cedric Roux committed
1621
   NR_NZP_CSI_RS_ResourceSet_t *nzpresset4=calloc(1,sizeof(*nzpresset4));
1622
   nzpresset4->nzp_CSI_ResourceSetId=4;
Cedric Roux's avatar
Cedric Roux committed
1623
   NR_NZP_CSI_RS_ResourceSetId_t *nzpresset40=calloc(1,sizeof(*nzpresset40));
1624 1625
   *nzpresset40=6;
   ASN_SEQUENCE_ADD(&nzpresset4->nzp_CSI_RS_Resources.list,nzpresset40);
Cedric Roux's avatar
Cedric Roux committed
1626
   NR_NZP_CSI_RS_ResourceSetId_t *nzpresset41=calloc(1,sizeof(*nzpresset41));
1627 1628
   *nzpresset41=7;
   ASN_SEQUENCE_ADD(&nzpresset4->nzp_CSI_RS_Resources.list,nzpresset41);
Cedric Roux's avatar
Cedric Roux committed
1629
   NR_NZP_CSI_RS_ResourceSetId_t *nzpresset42=calloc(1,sizeof(*nzpresset42));
1630 1631
   *nzpresset42=8;
   ASN_SEQUENCE_ADD(&nzpresset4->nzp_CSI_RS_Resources.list,nzpresset42);
Cedric Roux's avatar
Cedric Roux committed
1632
   NR_NZP_CSI_RS_ResourceSetId_t *nzpresset43=calloc(1,sizeof(*nzpresset43));
1633 1634 1635 1636 1637 1638 1639 1640 1641 1642
   *nzpresset43=9;
   ASN_SEQUENCE_ADD(&nzpresset4->nzp_CSI_RS_Resources.list,nzpresset43);
   nzpresset4->repetition=calloc(1,sizeof(*nzpresset4->repetition));
   *nzpresset4->repetition=NR_NZP_CSI_RS_ResourceSet__repetition_off;
   nzpresset4->aperiodicTriggeringOffset=NULL;
   nzpresset4->trs_Info=calloc(1,sizeof(*nzpresset4->trs_Info));
   *nzpresset4->trs_Info=NR_NZP_CSI_RS_ResourceSet__trs_Info_true;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpresset4);
 }
 if (n_physical_antenna_ports > 15) {
Cedric Roux's avatar
Cedric Roux committed
1643
   NR_NZP_CSI_RS_ResourceSet_t *nzpresset5=calloc(1,sizeof(*nzpresset5));
1644
   nzpresset5->nzp_CSI_ResourceSetId=5;
Cedric Roux's avatar
Cedric Roux committed
1645
   NR_NZP_CSI_RS_ResourceSetId_t *nzpresset50=calloc(1,sizeof(*nzpresset50));
1646 1647
   *nzpresset50=10;
   ASN_SEQUENCE_ADD(&nzpresset5->nzp_CSI_RS_Resources.list,nzpresset50);
Cedric Roux's avatar
Cedric Roux committed
1648
   NR_NZP_CSI_RS_ResourceSetId_t *nzpresset51=calloc(1,sizeof(*nzpresset51));
1649 1650
   *nzpresset51=11;
   ASN_SEQUENCE_ADD(&nzpresset5->nzp_CSI_RS_Resources.list,nzpresset51);
Cedric Roux's avatar
Cedric Roux committed
1651
   NR_NZP_CSI_RS_ResourceSetId_t *nzpresset52=calloc(1,sizeof(*nzpresset52));
1652 1653
   *nzpresset52=12;
   ASN_SEQUENCE_ADD(&nzpresset5->nzp_CSI_RS_Resources.list,nzpresset52);
Cedric Roux's avatar
Cedric Roux committed
1654
   NR_NZP_CSI_RS_ResourceSetId_t *nzpresset53=calloc(1,sizeof(*nzpresset53));
1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675
   *nzpresset53=13;
   ASN_SEQUENCE_ADD(&nzpresset5->nzp_CSI_RS_Resources.list,nzpresset53);
   nzpresset5->repetition=calloc(1,sizeof(*nzpresset5->repetition));
   *nzpresset5->repetition=NR_NZP_CSI_RS_ResourceSet__repetition_off;
   nzpresset5->aperiodicTriggeringOffset=NULL;
   nzpresset5->trs_Info=calloc(1,sizeof(*nzpresset5->trs_Info));
   *nzpresset5->trs_Info=NR_NZP_CSI_RS_ResourceSet__trs_Info_true;
   ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpresset5);
 }

 csi_MeasConfig->csi_IM_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceToAddModList));
 csi_MeasConfig->csi_IM_ResourceToReleaseList = NULL;
 NR_CSI_IM_Resource_t *imres0 = calloc(1,sizeof(*imres0));
 imres0->csi_IM_ResourceId=0;
 imres0->csi_IM_ResourceElementPattern=calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern));
 imres0->csi_IM_ResourceElementPattern->present = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1 ;
 imres0->csi_IM_ResourceElementPattern->choice.pattern1=calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern->choice.pattern1));
 imres0->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1 = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1__subcarrierLocation_p1_s4;
 imres0->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1=7;
 imres0->freqBand=calloc(1,sizeof(*imres0->freqBand));
 imres0->freqBand->startingRB=0;
1676
 imres0->freqBand->nrofRBs=106;
1677
 imres0->periodicityAndOffset=calloc(1,sizeof(*imres0->periodicityAndOffset));
1678
 imres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
1679 1680 1681 1682 1683 1684 1685 1686 1687
 imres0->periodicityAndOffset->choice.slots320 = 2;
 ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceToAddModList->list,imres0);
 csi_MeasConfig->csi_IM_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceSetToAddModList));
 csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL;
 NR_CSI_IM_ResourceSet_t *imresset0 = calloc(1,sizeof(*imresset0));
 imresset0->csi_IM_ResourceSetId=0;
 NR_CSI_IM_ResourceId_t *imresset00=calloc(1,sizeof(*imresset00));
 *imresset00=0;
 ASN_SEQUENCE_ADD(&imresset0->csi_IM_Resources.list,imresset00);
1688
 ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceSetToAddModList->list,imresset0);
1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749
 
 csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList));
 csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL;
 NR_CSI_SSB_ResourceSet_t *ssbresset0 = calloc(1,sizeof(*ssbresset0));
 ssbresset0->csi_SSB_ResourceSetId=0; 
 NR_SSB_Index_t *ssbresset00=calloc(1,sizeof(*ssbresset00));
 *ssbresset00=0;
 ASN_SEQUENCE_ADD(&ssbresset0->csi_SSB_ResourceList.list,ssbresset00);
 if (n_physical_antenna_ports > 1) {
   NR_SSB_Index_t *ssbresset01=calloc(1,sizeof(*ssbresset01));
   *ssbresset01=1;
   ASN_SEQUENCE_ADD(&ssbresset0->csi_SSB_ResourceList.list,ssbresset01);
 }
 if (n_physical_antenna_ports > 3) {
   NR_SSB_Index_t *ssbresset02=calloc(1,sizeof(*ssbresset02));
   *ssbresset02=2;
   ASN_SEQUENCE_ADD(&ssbresset0->csi_SSB_ResourceList.list,ssbresset02);
   NR_SSB_Index_t *ssbresset03=calloc(1,sizeof(*ssbresset03));
   *ssbresset03=3;
   ASN_SEQUENCE_ADD(&ssbresset0->csi_SSB_ResourceList.list,ssbresset03);
 }
 if (n_physical_antenna_ports > 7) {
   NR_SSB_Index_t *ssbresset04=calloc(1,sizeof(*ssbresset04));
   *ssbresset04=4;
   ASN_SEQUENCE_ADD(&ssbresset0->csi_SSB_ResourceList.list,ssbresset04);
   NR_SSB_Index_t *ssbresset05=calloc(1,sizeof(*ssbresset05));
   *ssbresset05=5;
   ASN_SEQUENCE_ADD(&ssbresset0->csi_SSB_ResourceList.list,ssbresset05);
   NR_SSB_Index_t *ssbresset06=calloc(1,sizeof(*ssbresset06));
   *ssbresset06=6;
   ASN_SEQUENCE_ADD(&ssbresset0->csi_SSB_ResourceList.list,ssbresset06);
   NR_SSB_Index_t *ssbresset07=calloc(1,sizeof(*ssbresset07));
   *ssbresset07=7;
   ASN_SEQUENCE_ADD(&ssbresset0->csi_SSB_ResourceList.list,ssbresset07);
 }
 ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0);

 csi_MeasConfig->csi_ResourceConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ResourceConfigToAddModList));
 csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL;
 NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0));
 csires0->csi_ResourceConfigId=0;
 csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
 csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
 csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
 csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = NULL;
 NR_NZP_CSI_RS_ResourceSetId_t *csires00 = calloc(1,sizeof(*csires00));
 *csires00 = 0;
 ASN_SEQUENCE_ADD(&csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,csires00);
 csires0->bwp_Id = 1;
 csires0->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
 ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires0);

 NR_CSI_ResourceConfig_t *csires11 = calloc(1,sizeof(*csires11));
 csires11->csi_ResourceConfigId=11;
 csires11->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_csi_IM_ResourceSetList;
 csires11->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csires11->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList));
 NR_NZP_CSI_RS_ResourceSetId_t *csires110 = calloc(1,sizeof(*csires110));
 *csires110 = 0;
 ASN_SEQUENCE_ADD(&csires11->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csires110);
 csires11->bwp_Id = 1;
 csires11->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
1750
 //ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires11);
1751 1752 1753 1754 1755 1756 1757 1758 1759

 NR_CSI_ResourceConfig_t *csires10 = calloc(1,sizeof(*csires10));
 csires10->csi_ResourceConfigId=10;
 csires10->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
 csires10->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires10->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
 csires10->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires10->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
 csires10->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = NULL;
 NR_NZP_CSI_RS_ResourceSetId_t *csires100 = calloc(1,sizeof(*csires100));
 *csires100 = 0;
1760
 ASN_SEQUENCE_ADD(&csires10->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,csires100);
1761 1762
 csires10->bwp_Id = 1;
 csires10->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
1763
 //ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires10);
1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775

 NR_CSI_ResourceConfig_t *csires2 = calloc(1,sizeof(*csires2));
 csires2->csi_ResourceConfigId=2;
 csires2->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
 csires2->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires2->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
 csires2->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires2->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
 csires2->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = NULL;
 NR_NZP_CSI_RS_ResourceSetId_t *csires20 = calloc(1,sizeof(*csires20));
 *csires20 = 0;
 ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,csires20);
 csires2->bwp_Id = 1;
 csires2->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
1776
 //ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2);
1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788

 NR_CSI_ResourceConfig_t *csires3 = calloc(1,sizeof(*csires3));
 csires3->csi_ResourceConfigId=3;
 csires3->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
 csires3->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires3->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
 csires3->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires3->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
 csires3->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = NULL;
 NR_NZP_CSI_RS_ResourceSetId_t *csires30 = calloc(1,sizeof(*csires30));
 *csires30 = 0;
 ASN_SEQUENCE_ADD(&csires3->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,csires30);
 csires3->bwp_Id = 1;
 csires3->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
1789
 //ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires3);
1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801

 NR_CSI_ResourceConfig_t *csires4 = calloc(1,sizeof(*csires4));
 csires4->csi_ResourceConfigId=4;
 csires4->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
 csires4->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires4->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
 csires4->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires4->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
 csires4->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = NULL;
 NR_NZP_CSI_RS_ResourceSetId_t *csires40 = calloc(1,sizeof(*csires40));
 *csires40 = 0;
 ASN_SEQUENCE_ADD(&csires4->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,csires40);
 csires4->bwp_Id = 1;
 csires4->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
1802
 //ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires4);
1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814

 NR_CSI_ResourceConfig_t *csires5 = calloc(1,sizeof(*csires5));
 csires5->csi_ResourceConfigId=5;
 csires5->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
 csires5->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires5->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
 csires5->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires5->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
 csires5->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = NULL;
 NR_NZP_CSI_RS_ResourceSetId_t *csires50 = calloc(1,sizeof(*csires50));
 *csires50 = 0;
 ASN_SEQUENCE_ADD(&csires5->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,csires50);
 csires5->bwp_Id = 1;
 csires5->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
1815
 //ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires5);
1816 1817 1818 1819 1820 1821 1822 1823 1824

 NR_CSI_ResourceConfig_t *csires6 = calloc(1,sizeof(*csires6));
 csires6->csi_ResourceConfigId=6;
 csires6->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
 csires6->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires6->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
 csires6->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires6->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
 csires6->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = NULL;
 NR_NZP_CSI_RS_ResourceSetId_t *csires60 = calloc(1,sizeof(*csires60));
 *csires60 = 0;
1825
 ASN_SEQUENCE_ADD(&csires6->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,csires60);
1826 1827
 csires6->bwp_Id = 1;
 csires6->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
1828
 //ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires6);
1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840

 NR_CSI_ResourceConfig_t *csires7 = calloc(1,sizeof(*csires7));
 csires7->csi_ResourceConfigId=7;
 csires7->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
 csires7->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires7->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
 csires7->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires7->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
 csires7->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = NULL;
 NR_NZP_CSI_RS_ResourceSetId_t *csires70 = calloc(1,sizeof(*csires70));
 *csires70 = 0;
 ASN_SEQUENCE_ADD(&csires7->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,csires70);
 csires7->bwp_Id = 1;
 csires7->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
1841
 //ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires7);
1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853

 NR_CSI_ResourceConfig_t *csires8 = calloc(1,sizeof(*csires8));
 csires8->csi_ResourceConfigId=8;
 csires8->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
 csires8->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires8->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
 csires8->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires8->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
 csires8->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = NULL;
 NR_NZP_CSI_RS_ResourceSetId_t *csires80 = calloc(1,sizeof(*csires80));
 *csires80 = 0;
 ASN_SEQUENCE_ADD(&csires8->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,csires80);
 csires8->bwp_Id = 1;
 csires8->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
1854
 //ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires8);
1855

Cedric Roux's avatar
Cedric Roux committed
1856
 NR_CSI_ResourceConfig_t *csires9 = calloc(1,sizeof(*csires9));
1857 1858 1859 1860 1861 1862 1863 1864 1865 1866
 csires9->csi_ResourceConfigId=9;
 csires9->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
 csires9->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires9->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
 csires9->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires9->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
 csires9->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = NULL;
 NR_NZP_CSI_RS_ResourceSetId_t *csires90 = calloc(1,sizeof(*csires90));
 *csires90 = 0;
 ASN_SEQUENCE_ADD(&csires9->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,csires90);
 csires9->bwp_Id = 1; 
 csires9->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
1867
 //ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires9);
1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894

 csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList));
 csi_MeasConfig->csi_ReportConfigToReleaseList = NULL;
 NR_CSI_ReportConfig_t *csirep0 = calloc(1,sizeof(*csirep0));
 csirep0->reportConfigId=0;
 csirep0->carrier=NULL;
 csirep0->resourcesForChannelMeasurement=0;
 csirep0->csi_IM_ResourcesForInterference=calloc(1,sizeof(*csirep0->csi_IM_ResourcesForInterference));
 *csirep0->csi_IM_ResourcesForInterference=11;
 csirep0->nzp_CSI_RS_ResourcesForInterference=NULL;
 csirep0->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic;
 csirep0->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep0->reportConfigType.choice.periodic));
 csirep0->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320;
 csirep0->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 9;

 NR_PUCCH_CSI_Resource_t *pucchcsires0 = calloc(1,sizeof(*pucchcsires0));
 pucchcsires0->uplinkBandwidthPartId=1;
 pucchcsires0->pucch_Resource=11;
 ASN_SEQUENCE_ADD(&csirep0->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires0);
 csirep0->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI;
 csirep0->reportQuantity.choice.cri_RI_PMI_CQI = (NULL_t)0;
 csirep0->reportFreqConfiguration = calloc(1,sizeof(*csirep0->reportFreqConfiguration));
 csirep0->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI;
 csirep0->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI;
 csirep0->reportFreqConfiguration->csi_ReportingBand=calloc(1,sizeof(*csirep0->reportFreqConfiguration->csi_ReportingBand));
 
 
1895
 //AssertFatal(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id>0,"firstActiveDownlinkBWP_Id %d\n",(int)*secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id);
1896
 int NPRB  = NRRIV2BW(secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[*secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id-1]->bwp_Common->genericParameters.locationAndBandwidth,275);
1897
 //int NPRB  = NRRIV2BW(28875,275);
1898 1899 1900 1901 1902 1903 1904 1905 1906 1907
 int sbsize = get_subband_size(NPRB,0);
 int numsb = NPRB/sbsize;
 if (NPRB%sbsize == 0) numsb++;
 csirep0->reportFreqConfiguration->csi_ReportingBand->present= 	NR_CSI_ReportConfig__reportFreqConfiguration__csi_ReportingBand_PR_NOTHING+(numsb-2);
 csirep0->reportFreqConfiguration->csi_ReportingBand->choice.subbands18.size=numsb/8;
 if ((numsb&7) > 0) csirep0->reportFreqConfiguration->csi_ReportingBand->choice.subbands18.size++;
 csirep0->reportFreqConfiguration->csi_ReportingBand->choice.subbands18.bits_unused = (8-(numsb&7))&7;
 csirep0->reportFreqConfiguration->csi_ReportingBand->choice.subbands18.buf=malloc(csirep0->reportFreqConfiguration->csi_ReportingBand->choice.subbands18.size);
 for (int i=0;i<csirep0->reportFreqConfiguration->csi_ReportingBand->choice.subbands18.size;i++) 
   csirep0->reportFreqConfiguration->csi_ReportingBand->choice.subbands18.buf[i]=0xff;
1908 1909
 csirep0->reportFreqConfiguration->csi_ReportingBand->choice.subbands18.buf[csirep0->reportFreqConfiguration->csi_ReportingBand->choice.subbands18.size-1]&=~((1<<csirep0->reportFreqConfiguration->csi_ReportingBand->choice.subbands18.bits_unused)-1);

1910 1911 1912 1913 1914
 csirep0->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured;
 csirep0->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured;
 csirep0->codebookConfig=calloc(1,sizeof(*csirep0->codebookConfig));
 csirep0->codebookConfig->codebookType.present = NR_CodebookConfig__codebookType_PR_type1;
 csirep0->codebookConfig->codebookType.choice.type1 = calloc(1,sizeof(*csirep0->codebookConfig->codebookType.choice.type1));
1915
 csirep0->codebookConfig->codebookType.choice.type1->subType.present = NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel; 
1916
 csirep0->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel=calloc(1,sizeof(*csirep0->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel));
1917
 csirep0->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present=NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two;
1918 1919 1920 1921 1922
 csirep0->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two=
   calloc(1,sizeof(*csirep0->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two));
 csirep0->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size=1;
 csirep0->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused=2;
 csirep0->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf=malloc(1);
1923
 csirep0->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0]=0xfc;
1924 1925 1926 1927
 //'111111'B


 csirep0->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.size=1; 
1928
 csirep0->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.bits_unused=0;
1929
 csirep0->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf=malloc(1); 
1930
 csirep0->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]=0xc0; //'00000011'B
1931 1932 1933 1934

 csirep0->codebookConfig->codebookType.choice.type1->codebookMode=1;
 csirep0->dummy = NULL;
 csirep0->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled;
1935 1936
 csirep0->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep0->groupBasedBeamReporting.choice.disabled));
 csirep0->groupBasedBeamReporting.choice.disabled->nrofReportedRS = NULL;
1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969
 csirep0->cqi_Table = calloc(1,sizeof(*csirep0->cqi_Table));
 *csirep0->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1;
 csirep0->subbandSize = NR_CSI_ReportConfig__subbandSize_value1;
 csirep0->non_PMI_PortIndication = NULL;
 csirep0->ext1 = NULL;

 ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep0);

 NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1));
 csirep1->reportConfigId=2;
 csirep1->carrier=NULL;
 csirep1->resourcesForChannelMeasurement=initial_csi_index;
 csirep1->csi_IM_ResourcesForInterference=NULL;
 csirep1->nzp_CSI_RS_ResourcesForInterference=NULL;
 csirep1->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic;
 csirep1->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep1->reportConfigType.choice.periodic));
 csirep1->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320;
 csirep1->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 49;
 NR_PUCCH_CSI_Resource_t *pucchcsires1 = calloc(1,sizeof(*pucchcsires1));
 pucchcsires1->uplinkBandwidthPartId=1;
 pucchcsires1->pucch_Resource=12;
 ASN_SEQUENCE_ADD(&csirep1->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1);
 csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP;
 csirep1->reportQuantity.choice.ssb_Index_RSRP=(NULL_t)0;
 csirep1->reportFreqConfiguration = calloc(1,sizeof(*csirep1->reportFreqConfiguration));
 csirep1->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI;
 csirep1->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI;
 csirep1->reportFreqConfiguration->csi_ReportingBand=NULL;
 csirep1->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured;
 csirep1->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured;
 csirep1->codebookConfig=calloc(1,sizeof(*csirep1->codebookConfig));
 csirep1->codebookConfig->codebookType.present = NR_CodebookConfig__codebookType_PR_type1;
 csirep1->codebookConfig->codebookType.choice.type1 = calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1));
1970
 csirep1->codebookConfig->codebookType.choice.type1->subType.present=NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel;
1971
 csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel=calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel));
1972
 csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present=NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two;
1973 1974 1975 1976 1977
 csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two=
   calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two));
 csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size=1;
 csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused=2;
 csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf=malloc(1);
1978
 csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0]=0xfc;
1979 1980 1981 1982
 //'111111'B


 csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.size=1; 
1983
 csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.bits_unused=0;
1984
 csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf=malloc(1); 
1985
 csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]=0xc0; //'00000011'B
1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010

 csirep1->codebookConfig->codebookType.choice.type1->codebookMode=1;
 csirep1->dummy = NULL;
 csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled;
 csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled));
 csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS));
 *csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n2;
 // this corresponds to:
 //if the UE is configured with the higher layer parameter groupBasedBeamReporting set to 'disabled', the UE is not required to update measurements for more than 64 CSI-RS and/or SSB resources, and the UE shall report in a single report nrofReportedRS (higher layer configured) different CRI or SSBRI for each report setting. 

 csirep1->cqi_Table = calloc(1,sizeof(*csirep1->cqi_Table));
 *csirep1->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1;
 csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value1;
 csirep1->non_PMI_PortIndication = NULL;
 csirep1->ext1 = NULL;

 ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep1);


 secondaryCellGroup->spCellConfig->spCellConfigDedicated->sCellDeactivationTimer=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->crossCarrierSchedulingConfig=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->tag_Id=0;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->dummy=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->pathlossReferenceLinking=NULL;
 secondaryCellGroup->spCellConfig->spCellConfigDedicated->servingCellMO=NULL;
2011 2012 2013

}
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
2014 2015 2016 2017
			   NR_RRCReconfiguration_IEs_t *reconfig,
			   NR_CellGroupConfig_t *secondaryCellGroup,
			   int n_physical_antenna_ports,
			   int initial_csi_index) {
2018 2019 2020 2021 2022 2023 2024 2025

  AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n");
  AssertFatal(reconfig!=NULL,"reconfig is null\n");
  AssertFatal(secondaryCellGroup!=NULL,"secondaryCellGroup is null\n");

  // radioBearerConfig
  reconfig->radioBearerConfig=NULL;
  // secondaryCellGroup
2026 2027 2028 2029 2030 2031 2032 2033
#if 0
NR_ServingCellConfigCommon_t z = *servingcellconfigcommon;
NR_ARFCN_ValueNR_t ssb_freq = 641272; //642208; //642208 is for SSB position = ptA + 82 RBs with ptA at 3600MHz //642256; //642016; //642256;
z.downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB = &ssb_freq;
fill_default_secondaryCellGroup(&z,secondaryCellGroup,1,1,n_physical_antenna_ports,initial_csi_index);
#else
  fill_default_secondaryCellGroup(servingcellconfigcommon,secondaryCellGroup,1,1,n_physical_antenna_ports,initial_csi_index);
#endif
2034 2035
  xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup);

2036 2037
//void *x = secondaryCellGroup->spCellConfig->reconfigurationWithSync->spCellConfigCommon->tdd_UL_DL_ConfigurationCommon;
//secondaryCellGroup->spCellConfig->reconfigurationWithSync->spCellConfigCommon->tdd_UL_DL_ConfigurationCommon = NULL;
2038 2039
  char scg_buffer[1024];
  asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, (void *)secondaryCellGroup, scg_buffer, 1024);
2040
  AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n", enc_rval.failed_type->name, enc_rval.encoded);
2041
//secondaryCellGroup->spCellConfig->reconfigurationWithSync->spCellConfigCommon->tdd_UL_DL_ConfigurationCommon = x;
2042 2043
  
 
Cedric Roux's avatar
Cedric Roux committed
2044
  reconfig->secondaryCellGroup = calloc(1,sizeof(*reconfig->secondaryCellGroup));
2045 2046 2047
  OCTET_STRING_fromBuf(reconfig->secondaryCellGroup,
		       (const char*)scg_buffer,
		       (enc_rval.encoded+7)>>3);
2048 2049 2050 2051 2052 2053 2054 2055
  // measConfig
  reconfig->measConfig=NULL;
  // lateNonCriticalExtension
  reconfig->lateNonCriticalExtension = NULL;
  // nonCriticalExtension
  reconfig->nonCriticalExtension = NULL;
}

Raymond Knopp's avatar
Raymond Knopp committed
2056 2057 2058 2059 2060 2061 2062 2063 2064
void fill_default_rbconfig(NR_RadioBearerConfig_t *rbconfig) {

  rbconfig->srb_ToAddModList = NULL;
  rbconfig->srb3_ToRelease = NULL;
  rbconfig->drb_ToAddModList = calloc(1,sizeof(*rbconfig->drb_ToAddModList));
  NR_DRB_ToAddMod_t *drb_ToAddMod = calloc(1,sizeof(*drb_ToAddMod));
  drb_ToAddMod->cnAssociation = calloc(1,sizeof(*drb_ToAddMod->cnAssociation));
  drb_ToAddMod->cnAssociation->present = NR_DRB_ToAddMod__cnAssociation_PR_eps_BearerIdentity;
  drb_ToAddMod->cnAssociation->choice.eps_BearerIdentity=5;
Cedric Roux's avatar
Cedric Roux committed
2065
  drb_ToAddMod->drb_Identity = 1;
Raymond Knopp's avatar
Raymond Knopp committed
2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086
  drb_ToAddMod->reestablishPDCP = NULL;
  drb_ToAddMod->recoverPDCP = NULL;
  drb_ToAddMod->pdcp_Config = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config));
  drb_ToAddMod->pdcp_Config->drb = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb));
  drb_ToAddMod->pdcp_Config->drb->discardTimer = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->discardTimer));
  *drb_ToAddMod->pdcp_Config->drb->discardTimer=NR_PDCP_Config__drb__discardTimer_ms30;
  drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL));
  *drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = NR_PDCP_Config__drb__pdcp_SN_SizeUL_len18bits;
  drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL));
  *drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = NR_PDCP_Config__drb__pdcp_SN_SizeDL_len18bits;
  drb_ToAddMod->pdcp_Config->drb->headerCompression.present = NR_PDCP_Config__drb__headerCompression_PR_notUsed;
  drb_ToAddMod->pdcp_Config->drb->headerCompression.choice.notUsed = 0;

  drb_ToAddMod->pdcp_Config->drb->integrityProtection=NULL;	
  drb_ToAddMod->pdcp_Config->drb->statusReportRequired=NULL;	
  drb_ToAddMod->pdcp_Config->drb->outOfOrderDelivery=NULL;
  drb_ToAddMod->pdcp_Config->moreThanOneRLC = NULL;

  drb_ToAddMod->pdcp_Config->t_Reordering = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->t_Reordering));
  *drb_ToAddMod->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms0;
  drb_ToAddMod->pdcp_Config->ext1 = NULL;
Raymond Knopp's avatar
Raymond Knopp committed
2087 2088
  
  ASN_SEQUENCE_ADD(&rbconfig->drb_ToAddModList->list,drb_ToAddMod);
Raymond Knopp's avatar
Raymond Knopp committed
2089 2090 2091 2092 2093

  rbconfig->drb_ToReleaseList = NULL;

  rbconfig->securityConfig = calloc(1,sizeof(*rbconfig->securityConfig));
  rbconfig->securityConfig->securityAlgorithmConfig = calloc(1,sizeof(*rbconfig->securityConfig->securityAlgorithmConfig));
Cedric Roux's avatar
Cedric Roux committed
2094
  rbconfig->securityConfig->securityAlgorithmConfig->cipheringAlgorithm = NR_CipheringAlgorithm_nea0;
Raymond Knopp's avatar
Raymond Knopp committed
2095 2096 2097
  rbconfig->securityConfig->securityAlgorithmConfig->integrityProtAlgorithm=NULL;
  rbconfig->securityConfig->keyToUse = calloc(1,sizeof(*rbconfig->securityConfig->keyToUse));
  *rbconfig->securityConfig->keyToUse = NR_SecurityConfig__keyToUse_master;
2098 2099

  xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)rbconfig);
Raymond Knopp's avatar
Raymond Knopp committed
2100
}
2101
#endif