asn1_msg.c 177 KB
Newer Older
1 2 3 4 5
/*
 * 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
Cedric Roux's avatar
Cedric Roux committed
6
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
7 8 9 10 11 12 13 14 15 16 17 18 19 20
 * 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
 */
21 22

/*! \file asn1_msg.c
23
* \brief primitives to build the asn1 messages
24 25
* \author Raymond Knopp and Navid Nikaein
* \date 2011
26
* \version 1.0
27 28
* \company Eurecom
* \email: raymond.knopp@eurecom.fr and  navid.nikaein@eurecom.fr
29
*/
30

31 32
#include <stdio.h>
#include <sys/types.h>
33 34 35 36 37
#include <stdlib.h> /* for atoi(3) */
#include <unistd.h> /* for getopt(3) */
#include <string.h> /* for strerror(3) */
#include <sysexits.h> /* for EX_* exit codes */
#include <errno.h>  /* for errno */
38
#include "common/utils/LOG/log.h"
39
#include <asn_application.h>
40
#include <asn_internal.h> /* for _ASN_DEFAULT_STACK_MAX */
41
#include <per_encoder.h>
42
#include "targets/RT/USER/lte-softmodem.h"
43
#include "assertions.h"
44 45 46 47 48 49
#include "LTE_RRCConnectionRequest.h"
#include "LTE_UL-CCCH-Message.h"
#include "LTE_UL-DCCH-Message.h"
#include "LTE_DL-CCCH-Message.h"
#include "LTE_DL-DCCH-Message.h"
#include "LTE_PCCH-Message.h"
50
#include "openair3/UTILS/conversions.h"
51 52 53 54 55
#include "LTE_EstablishmentCause.h"
#include "LTE_RRCConnectionSetup.h"
#include "LTE_SRB-ToAddModList.h"
#include "LTE_DRB-ToAddModList.h"
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
56 57
  #include "LTE_MCCH-Message.h"
  //#define MRB1 1
58 59
#endif

60 61
#include "RRC/LTE/rrc_defs.h"
#include "RRC/LTE/rrc_extern.h"
62 63 64 65 66
#include "LTE_RRCConnectionSetupComplete.h"
#include "LTE_RRCConnectionReconfigurationComplete.h"
#include "LTE_RRCConnectionReconfiguration.h"
#include "LTE_MasterInformationBlock.h"
#include "LTE_SystemInformation.h"
67

68
#include "LTE_SystemInformationBlockType1.h"
69

70
#include "LTE_SIB-Type.h"
71

72 73 74
#include "LTE_BCCH-DL-SCH-Message.h"
#include "LTE_SBCCH-SL-BCH-MessageType.h"
#include "LTE_SBCCH-SL-BCH-Message.h"
75

76
//#include "PHY/defs.h"
77

78 79 80
#include "LTE_MeasObjectToAddModList.h"
#include "LTE_ReportConfigToAddModList.h"
#include "LTE_MeasIdToAddModList.h"
81
#include "enb_config.h"
82

83
#if defined(ENABLE_ITTI)
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
84
  #include "intertask_interface.h"
85 86
#endif

87
#include "common/ran_context.h"
88
#include "secu_defs.h"
89

Mongazon's avatar
Mongazon committed
90
#if !defined (msg)
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
91
  #define msg printf
92 93
#endif

94

95 96 97 98
typedef struct xer_sprint_string_s {
  char *string;
  size_t string_size;
  size_t string_index;
99 100
} xer_sprint_string_t;

101
extern unsigned char NB_eNB_INST;
102

103

104 105
extern RAN_CONTEXT_t RC;

106 107
uint16_t two_tier_hexagonal_cellIds[7] = {0,1,2,4,5,7,8};
uint16_t two_tier_hexagonal_adjacent_cellIds[7][6] = {{1,2,4,5,7,8},    // CellId 0
108 109 110 111 112 113 114
  {11,18,2,0,8,15}, // CellId 1
  {18,13,3,4,0,1},  // CellId 2
  {2,3,14,6,5,0},   // CellId 4
  {0,4,6,16,9,7},   // CellId 5
  {8,0,5,9,17,12},  // CellId 7
  {15,1,0,7,12,10}
};// CellId 8
115

116 117 118 119
/*
 * This is a helper function for xer_sprint, which directs all incoming data
 * into the provided string.
 */
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
120
static int xer__print2s (const void *buffer, size_t size, void *app_key) {
121 122 123 124 125 126
  xer_sprint_string_t *string_buffer = (xer_sprint_string_t *) app_key;
  size_t string_remaining = string_buffer->string_size - string_buffer->string_index;

  if (string_remaining > 0) {
    if (size > string_remaining) {
      size = string_remaining;
127
    }
128

129 130 131 132 133
    memcpy(&string_buffer->string[string_buffer->string_index], buffer, size);
    string_buffer->string_index += size;
  }

  return 0;
134 135
}

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
136
int xer_sprint (char *string, size_t string_size, asn_TYPE_descriptor_t *td, void *sptr) {
137 138 139 140 141 142 143 144
  asn_enc_rval_t er;
  xer_sprint_string_t string_buffer;
  string_buffer.string = string;
  string_buffer.string_size = string_size;
  string_buffer.string_index = 0;
  er = xer_encode(td, sptr, XER_F_BASIC, xer__print2s, &string_buffer);

  if (er.encoded < 0) {
Cedric Roux's avatar
Cedric Roux committed
145
    LOG_E(RRC, "xer_sprint encoding error (%zd)!", er.encoded);
146 147 148
    er.encoded = string_buffer.string_size;
  } else {
    if (er.encoded > string_buffer.string_size) {
Cedric Roux's avatar
Cedric Roux committed
149
      LOG_E(RRC, "xer_sprint string buffer too small, got %zd need %zd!", string_buffer.string_size, er.encoded);
150
      er.encoded = string_buffer.string_size;
151
    }
152
  }
153

154
  return er.encoded;
155
}
156

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
157
uint16_t get_adjacent_cell_id(uint8_t Mod_id,uint8_t index) {
158 159
  return(two_tier_hexagonal_adjacent_cellIds[Mod_id][index]);
}
160
/* This only works for the hexagonal topology...need a more general function for other topologies */
winckel's avatar
RRC:  
winckel committed
161

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
162
uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId) {
winckel's avatar
RRC:  
winckel committed
163
  uint8_t i;
164 165

  for(i=0; i<7; i++) {
166
    if(two_tier_hexagonal_cellIds[i] == phyCellId) {
167
      return i;
168
    }
169
  }
170

171 172 173
  LOG_E(RRC,"\nCannot get adjacent cell mod id! Fatal error!\n");
  return 0xFF; //error!
}
winckel's avatar
RRC:  
winckel committed
174

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
175
uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich_Resource, uint32_t phich_duration, uint32_t frame) {
176
  asn_enc_rval_t enc_rval;
177
  LTE_BCCH_BCH_Message_t *mib=&carrier->mib ;
178
  uint8_t sfn = (uint8_t)((frame>>2)&0xff);
179
  uint16_t *spare = calloc(1, sizeof(uint16_t));
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
180

Cedric Roux's avatar
Cedric Roux committed
181
  if (spare == NULL) abort();
182

183
  switch (N_RB_DL) {
184
    case 6:
185
      mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n6;
186 187 188
      break;

    case 15:
189
      mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n15;
190 191 192
      break;

    case 25:
193
      mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n25;
194 195 196
      break;

    case 50:
197
      mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n50;
198 199 200
      break;

    case 75:
201
      mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n75;
202 203 204
      break;

    case 100:
205
      mib->message.dl_Bandwidth = LTE_MasterInformationBlock__dl_Bandwidth_n100;
206
      break;
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
207

208 209
    default:
      AssertFatal(1==0,"Unknown dl_Bandwidth %d\n",N_RB_DL);
210 211
  }

212
  AssertFatal(phich_Resource <= LTE_PHICH_Config__phich_Resource_two,"Illegal phich_Resource\n");
213
  mib->message.phich_Config.phich_Resource = phich_Resource;
214
  AssertFatal(phich_duration <= LTE_PHICH_Config__phich_Duration_extended,"Illegal phich_Duration\n");
215
  mib->message.phich_Config.phich_Duration = phich_duration;
216
  LOG_I(RRC,"[MIB] systemBandwidth %x, phich_duration %x, phich_resource %x, sfn %x\n",
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
217 218 219 220
        (uint32_t)mib->message.dl_Bandwidth,
        (uint32_t)phich_duration,
        (uint32_t)phich_Resource,
        (uint32_t)sfn);
221 222 223
  mib->message.systemFrameNumber.buf = &sfn;
  mib->message.systemFrameNumber.size = 1;
  mib->message.systemFrameNumber.bits_unused=0;
Cedric Roux's avatar
Cedric Roux committed
224
  mib->message.spare.buf = (uint8_t *)spare;
225
#if (LTE_RRC_VERSION < MAKE_VERSION(14, 0, 0))
226 227
  mib->message.spare.size = 2;
  mib->message.spare.bits_unused = 6;  // This makes a spare of 10 bits
228 229 230 231 232
#else
  mib->message.spare.size = 1;
  mib->message.spare.bits_unused = 3;  // This makes a spare of 5 bits
  mib->message.schedulingInfoSIB1_BR_r13 = 0; // turn off eMTC
#endif
233
  enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_BCH_Message,
234
                                   NULL,
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
235
                                   (void *)mib,
Cedric Roux's avatar
Cedric Roux committed
236 237
                                   carrier->MIB,
                                   24);
knopp's avatar
 
knopp committed
238
  AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
239
               enc_rval.failed_type->name, enc_rval.encoded);
240

241
  if (enc_rval.encoded==-1) {
242
    return(-1);
243
  }
244

245 246
  return((enc_rval.encoded+7)/8);
}
winckel's avatar
RRC:  
winckel committed
247

248 249
//TTN for D2D
// 3GPP 36.331 (Section 5.10.7.4)
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
250 251 252 253 254
uint8_t do_MIB_SL(const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index, uint32_t frame, uint8_t subframe, uint8_t in_coverage, uint8_t mode) {
  asn_enc_rval_t enc_rval;
  LTE_SBCCH_SL_BCH_MessageType_t *mib_sl = &UE_rrc_inst[ctxt_pP->module_id].mib_sl[eNB_index];
  uint8_t sfn = (uint8_t)((frame>>2)&0xff);
  UE_rrc_inst[ctxt_pP->module_id].MIB = (uint8_t *) malloc16(4);
255

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
256 257 258 259
  if (in_coverage > 0 ) {
    //in coverage
    mib_sl->inCoverage_r12 = TRUE;
    mib_sl->sl_Bandwidth_r12 = *UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->freqInfo.ul_Bandwidth;
260

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
261 262 263 264 265
    if (UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->tdd_Config) {
      mib_sl->tdd_ConfigSL_r12.subframeAssignmentSL_r12 = UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->tdd_Config->subframeAssignment;
    } else {
      mib_sl->tdd_ConfigSL_r12.subframeAssignmentSL_r12 = LTE_TDD_ConfigSL_r12__subframeAssignmentSL_r12_none;
    }
266

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
267 268 269 270 271 272 273 274 275
    //if triggered by sl communication
    if (UE_rrc_inst[ctxt_pP->module_id].sib18[eNB_index]->commConfig_r12->commSyncConfig_r12->list.array[0]->txParameters_r12->syncInfoReserved_r12) {
      mib_sl->reserved_r12 = *UE_rrc_inst[ctxt_pP->module_id].sib18[eNB_index]->commConfig_r12->commSyncConfig_r12->list.array[0]->txParameters_r12->syncInfoReserved_r12;
    }

    //if triggered by sl discovery
    if (UE_rrc_inst[ctxt_pP->module_id].sib19[eNB_index]->discConfig_r12->discSyncConfig_r12->list.array[0]->txParameters_r12->syncInfoReserved_r12) {
      mib_sl->reserved_r12 = *UE_rrc_inst[ctxt_pP->module_id].sib19[eNB_index]->discConfig_r12->discSyncConfig_r12->list.array[0]->txParameters_r12->syncInfoReserved_r12;
    }
276

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
277 278 279 280 281 282 283
    //Todo - if triggered by v2x
  } else {
    //Todo - out of coverage for V2X
    // Todo - UE has a selected SyncRef UE
    mib_sl->inCoverage_r12 = FALSE;
    //set sl-Bandwidth, subframeAssignmentSL and reserved from the pre-configured parameters
  }
284

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
285 286 287 288 289 290
  //set FrameNumber, subFrameNumber
  mib_sl->directFrameNumber_r12.buf =  &sfn;
  mib_sl->directFrameNumber_r12.size = 1;
  mib_sl->directFrameNumber_r12.bits_unused=0;
  mib_sl->directSubframeNumber_r12 = subframe;
  LOG_I(RRC,"[MIB-SL] sfn %x, subframe %x\n", (uint32_t)sfn, (uint8_t)subframe);
291
  enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_SBCCH_SL_BCH_Message,
292
                                   NULL,
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
293
                                   (void *)mib_sl,
294 295 296 297 298 299 300 301 302 303 304 305 306
                                   UE_rrc_inst[ctxt_pP->module_id].MIB,
                                   24);
  AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
               enc_rval.failed_type->name, enc_rval.encoded);

  if (enc_rval.encoded==-1) {
    return(-1);
  }

  return((enc_rval.encoded+7)/8);
}


307
uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier,
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
308
                int Mod_id,int CC_id
winckel's avatar
winckel committed
309
#if defined(ENABLE_ITTI)
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
310
  , RrcConfigurationReq *configuration
winckel's avatar
winckel committed
311
#endif
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
312
               ) {
313
  //  SystemInformation_t systemInformation;
314 315 316 317 318
#if defined(ENABLE_ITTI)
  int num_plmn = configuration->num_plmn;
#else
  int num_plmn = 1;
#endif
319 320
  LTE_PLMN_IdentityInfo_t PLMN_identity_info[num_plmn];
  LTE_MCC_MNC_Digit_t dummy_mcc[num_plmn][3], dummy_mnc[num_plmn][3];
321
  asn_enc_rval_t enc_rval;
322 323
  LTE_SchedulingInfo_t schedulingInfo;
  LTE_SIB_Type_t sib_type;
324
  uint8_t *buffer                      = carrier->SIB1;
325 326
  LTE_BCCH_DL_SCH_Message_t *bcch_message  = &carrier->siblock1;
  LTE_SystemInformationBlockType1_t **sib1 = &carrier->sib1;
327
  int i;
328 329 330
  memset(bcch_message,0,sizeof(LTE_BCCH_DL_SCH_Message_t));
  bcch_message->message.present = LTE_BCCH_DL_SCH_MessageType_PR_c1;
  bcch_message->message.choice.c1.present = LTE_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1;
331 332
  //  memcpy(&bcch_message.message.choice.c1.choice.systemInformationBlockType1,sib1,sizeof(SystemInformationBlockType1_t));
  *sib1 = &bcch_message->message.choice.c1.choice.systemInformationBlockType1;
333 334 335
  memset(PLMN_identity_info,0,num_plmn * sizeof(LTE_PLMN_IdentityInfo_t));
  memset(&schedulingInfo,0,sizeof(LTE_SchedulingInfo_t));
  memset(&sib_type,0,sizeof(LTE_SIB_Type_t));
336

337 338 339 340 341
  /* as per TS 36.311, up to 6 PLMN_identity_info are allowed in list -> add one by one */
  for (i = 0; i < configuration->num_plmn; ++i) {
    PLMN_identity_info[i].plmn_Identity.mcc = CALLOC(1,sizeof(*PLMN_identity_info[i].plmn_Identity.mcc));
    memset(PLMN_identity_info[i].plmn_Identity.mcc,0,sizeof(*PLMN_identity_info[i].plmn_Identity.mcc));
    asn_set_empty(&PLMN_identity_info[i].plmn_Identity.mcc->list);//.size=0;
winckel's avatar
winckel committed
342
#if defined(ENABLE_ITTI)
343 344 345
    dummy_mcc[i][0] = (configuration->mcc[i] / 100) % 10;
    dummy_mcc[i][1] = (configuration->mcc[i] / 10) % 10;
    dummy_mcc[i][2] = (configuration->mcc[i] / 1) % 10;
winckel's avatar
winckel committed
346
#else
347 348 349
    dummy_mcc[i][0] = 0;
    dummy_mcc[i][1] = 0;
    dummy_mcc[i][2] = 1;
winckel's avatar
winckel committed
350
#endif
351 352 353 354 355
    ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mcc->list,&dummy_mcc[i][0]);
    ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mcc->list,&dummy_mcc[i][1]);
    ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mcc->list,&dummy_mcc[i][2]);
    PLMN_identity_info[i].plmn_Identity.mnc.list.size=0;
    PLMN_identity_info[i].plmn_Identity.mnc.list.count=0;
winckel's avatar
winckel committed
356
#if defined(ENABLE_ITTI)
357

358 359 360 361
    if (configuration->mnc[i] >= 100) {
      dummy_mnc[i][0] = (configuration->mnc[i] / 100) % 10;
      dummy_mnc[i][1] = (configuration->mnc[i] / 10) % 10;
      dummy_mnc[i][2] = (configuration->mnc[i] / 1) % 10;
362
    } else {
363 364 365 366 367 368 369 370 371
      if (configuration->mnc_digit_length[i] == 2) {
        dummy_mnc[i][0] = (configuration->mnc[i] / 10) % 10;
        dummy_mnc[i][1] = (configuration->mnc[i] / 1) % 10;
        dummy_mnc[i][2] = 0xf;
      } else {
        dummy_mnc[i][0] = (configuration->mnc[i] / 100) % 100;
        dummy_mnc[i][1] = (configuration->mnc[i] / 10) % 10;
        dummy_mnc[i][2] = (configuration->mnc[i] / 1) % 10;
      }
372 373
    }

winckel's avatar
winckel committed
374
#else
375 376 377
    dummy_mnc[i][0] = 0;
    dummy_mnc[i][1] = 1;
    dummy_mnc[i][2] = 0xf;
winckel's avatar
winckel committed
378
#endif
379 380
    ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mnc.list,&dummy_mnc[i][0]);
    ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mnc.list,&dummy_mnc[i][1]);
381

382 383 384
    if (dummy_mnc[i][2] != 0xf) {
      ASN_SEQUENCE_ADD(&PLMN_identity_info[i].plmn_Identity.mnc.list,&dummy_mnc[i][2]);
    }
winckel's avatar
winckel committed
385

386
    //assign_enum(&PLMN_identity_info.cellReservedForOperatorUse,PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved);
387
    PLMN_identity_info[i].cellReservedForOperatorUse=LTE_PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
388 389
    ASN_SEQUENCE_ADD(&(*sib1)->cellAccessRelatedInfo.plmn_IdentityList.list,&PLMN_identity_info[i]);
  }
390 391 392

  // 16 bits
  (*sib1)->cellAccessRelatedInfo.trackingAreaCode.buf = MALLOC(2);
winckel's avatar
winckel committed
393 394 395 396 397 398 399
#if defined(ENABLE_ITTI)
  (*sib1)->cellAccessRelatedInfo.trackingAreaCode.buf[0] = (configuration->tac >> 8) & 0xff;
  (*sib1)->cellAccessRelatedInfo.trackingAreaCode.buf[1] = (configuration->tac >> 0) & 0xff;
#else
  (*sib1)->cellAccessRelatedInfo.trackingAreaCode.buf[0] = 0x00;
  (*sib1)->cellAccessRelatedInfo.trackingAreaCode.buf[1] = 0x01;
#endif
400 401 402 403
  (*sib1)->cellAccessRelatedInfo.trackingAreaCode.size=2;
  (*sib1)->cellAccessRelatedInfo.trackingAreaCode.bits_unused=0;
  // 28 bits
  (*sib1)->cellAccessRelatedInfo.cellIdentity.buf = MALLOC(8);
winckel's avatar
winckel committed
404 405 406 407 408 409 410 411 412 413 414
#if defined(ENABLE_ITTI)
  (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[0] = (configuration->cell_identity >> 20) & 0xff;
  (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[1] = (configuration->cell_identity >> 12) & 0xff;
  (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[2] = (configuration->cell_identity >>  4) & 0xff;
  (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[3] = (configuration->cell_identity <<  4) & 0xf0;
#else
  (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[0] = 0x00;
  (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[1] = 0x00;
  (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[2] = 0x00;
  (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[3] = 0x10;
#endif
415 416 417
  (*sib1)->cellAccessRelatedInfo.cellIdentity.size=4;
  (*sib1)->cellAccessRelatedInfo.cellIdentity.bits_unused=4;
  //  assign_enum(&(*sib1)->cellAccessRelatedInfo.cellBarred,SystemInformationBlockType1__cellAccessRelatedInfo__cellBarred_notBarred);
418
  (*sib1)->cellAccessRelatedInfo.cellBarred=LTE_SystemInformationBlockType1__cellAccessRelatedInfo__cellBarred_notBarred;
419
  //  assign_enum(&(*sib1)->cellAccessRelatedInfo.intraFreqReselection,SystemInformationBlockType1__cellAccessRelatedInfo__intraFreqReselection_allowed);
420
  (*sib1)->cellAccessRelatedInfo.intraFreqReselection=LTE_SystemInformationBlockType1__cellAccessRelatedInfo__intraFreqReselection_notAllowed;
421 422 423
  (*sib1)->cellAccessRelatedInfo.csg_Indication=0;
  (*sib1)->cellSelectionInfo.q_RxLevMin=-65;
  (*sib1)->cellSelectionInfo.q_RxLevMinOffset=NULL;
424
  //(*sib1)->p_Max = CALLOC(1, sizeof(P_Max_t));
425
  // *((*sib1)->p_Max) = 23;
426 427
  (*sib1)->freqBandIndicator =
#if defined(ENABLE_ITTI)
428
    configuration->eutra_band[CC_id];
429
#else
430
    7;
431
#endif
432
  schedulingInfo.si_Periodicity=LTE_SchedulingInfo__si_Periodicity_rf8;
433
  // This is for SIB2/3
434
  sib_type=LTE_SIB_Type_sibType3;
435 436 437
  ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,&sib_type);
  ASN_SEQUENCE_ADD(&(*sib1)->schedulingInfoList.list,&schedulingInfo);
  //  ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,NULL);
438
#if defined(ENABLE_ITTI)
439

440
  if (configuration->frame_type[CC_id] == TDD)
441 442
#endif
  {
443
    (*sib1)->tdd_Config =                             CALLOC(1,sizeof(struct LTE_TDD_Config));
444
    (*sib1)->tdd_Config->subframeAssignment =
445
#if defined(ENABLE_ITTI)
446
      configuration->tdd_config[CC_id];
447
#else
448
      3;
449
#endif
450
    (*sib1)->tdd_Config->specialSubframePatterns =
451
#if defined(ENABLE_ITTI)
452
      configuration->tdd_config_s[CC_id];
453
#else
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
454
      0;
455
#endif
456
  }
457

458
  (*sib1)->si_WindowLength=LTE_SystemInformationBlockType1__si_WindowLength_ms20;
459 460 461
  (*sib1)->systemInfoValueTag=0;
  //  (*sib1).nonCriticalExtension = calloc(1,sizeof(*(*sib1).nonCriticalExtension));

462
  if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
463
    xer_fprint(stdout, &asn_DEF_LTE_BCCH_DL_SCH_Message, (void *)bcch_message);
464 465
  }

466
  enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_DL_SCH_Message,
467
                                   NULL,
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
468
                                   (void *)bcch_message,
winckel's avatar
winckel committed
469 470
                                   buffer,
                                   100);
knopp's avatar
 
knopp committed
471
  AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
472
               enc_rval.failed_type->name, enc_rval.encoded);
Cedric Roux's avatar
Cedric Roux committed
473
  LOG_D(RRC,"[eNB] SystemInformationBlockType1 Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
474

475
  if (enc_rval.encoded==-1) {
476
    return(-1);
477
  }
478

479 480 481 482
  return((enc_rval.encoded+7)/8);
}

uint8_t do_SIB23(uint8_t Mod_id,
483

484
                 int CC_id
485
#if defined(ENABLE_ITTI)
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
486
  , RrcConfigurationReq *configuration
487
#endif
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
488
                ) {
489 490
  struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib2_part,*sib3_part;
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
491
  //TTN - for D2D
492 493 494 495 496
  struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib18_part, *sib19_part, *sib21_part;
  LTE_SL_CommRxPoolList_r12_t *SL_CommRxPoolList; //for SIB18
  struct LTE_SL_CommResourcePool_r12 *SL_CommResourcePool; //for SIB18
  LTE_SL_DiscRxPoolList_r12_t *SL_DiscRxPoolList; //for SIB19 (discRxPool)
  struct LTE_SL_DiscResourcePool_r12 *SL_DiscResourcePool; //for SIB19 (discRxPool)
497 498 499 500
  //SL_DiscRxPoolList_r12_t *SL_DiscRxPoolPSList; //for SIB19 (discRxPoolPS)
  //struct SL_DiscResourcePool_r12 *SL_DiscResourcePoolPS; //for SIB19 (discRxPoolPS)
  //struct SL_V2X_ConfigCommon_r14 *SL_V2X_ConfigCommon;
#endif
501 502 503 504 505
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
  struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib13_part;
  LTE_MBSFN_SubframeConfigList_t *MBSFNSubframeConfigList;
  LTE_MBSFN_AreaInfoList_r9_t *MBSFNArea_list;
  struct LTE_MBSFN_AreaInfo_r9 *MBSFN_Area1, *MBSFN_Area2;
506 507
#endif
  asn_enc_rval_t enc_rval;
508
  uint8_t                           *buffer       = RC.rrc[Mod_id]->carrier[CC_id].SIB23;
509 510 511 512 513
  LTE_BCCH_DL_SCH_Message_t             *bcch_message = &RC.rrc[Mod_id]->carrier[CC_id].systemInformation;
  LTE_SystemInformationBlockType2_t     **sib2        = &RC.rrc[Mod_id]->carrier[CC_id].sib2;
  LTE_SystemInformationBlockType3_t     **sib3        = &RC.rrc[Mod_id]->carrier[CC_id].sib3;
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
  LTE_SystemInformationBlockType13_r9_t **sib13       = &RC.rrc[Mod_id]->carrier[CC_id].sib13;
514 515
  uint8_t                           MBMS_flag     = RC.rrc[Mod_id]->carrier[CC_id].MBMS_flag;
#endif
516
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
517
  //TTN - for D2D
518 519 520
  LTE_SystemInformationBlockType18_r12_t     **sib18        = &RC.rrc[Mod_id]->carrier[CC_id].sib18;
  LTE_SystemInformationBlockType19_r12_t     **sib19        = &RC.rrc[Mod_id]->carrier[CC_id].sib19;
  LTE_SystemInformationBlockType21_r14_t     **sib21        = &RC.rrc[Mod_id]->carrier[CC_id].sib21;
521 522
#endif

523
  if (bcch_message) {
524
    memset(bcch_message,0,sizeof(LTE_BCCH_DL_SCH_Message_t));
525
  } else {
winckel's avatar
winckel committed
526
    LOG_E(RRC,"[eNB %d] BCCH_MESSAGE is null, exiting\n", Mod_id);
527 528 529 530
    exit(-1);
  }

  if (!sib2) {
winckel's avatar
winckel committed
531
    LOG_E(RRC,"[eNB %d] sib2 is null, exiting\n", Mod_id);
532 533 534 535
    exit(-1);
  }

  if (!sib3) {
winckel's avatar
winckel committed
536
    LOG_E(RRC,"[eNB %d] sib3 is null, exiting\n", Mod_id);
537 538
    exit(-1);
  }
539

540
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
winckel's avatar
winckel committed
541
  LOG_I(RRC,"[eNB %d] Configuration SIB2/3, MBMS = %d\n", Mod_id, MBMS_flag);
542
#else
winckel's avatar
winckel committed
543
  LOG_I(RRC,"[eNB %d] Configuration SIB2/3\n", Mod_id);
544
#endif
545 546 547 548 549 550
  sib2_part = CALLOC(1,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
  sib3_part = CALLOC(1,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
  memset(sib2_part,0,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
  memset(sib3_part,0,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
  sib2_part->present = LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2;
  sib3_part->present = LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3;
551 552
  *sib2 = &sib2_part->choice.sib2;
  *sib3 = &sib3_part->choice.sib3;
553
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
554

555
  if (MBMS_flag > 0) {
556 557 558
    sib13_part = CALLOC(1,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
    memset(sib13_part,0,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
    sib13_part->present = LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920;
559 560
    *sib13 = &sib13_part->choice.sib13_v920;
  }
561

562
#endif
563
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
564
  //TTN - for D2D
565 566 567 568 569 570 571 572 573
  sib18_part = CALLOC(1,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
  sib19_part = CALLOC(1,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
  sib21_part = CALLOC(1,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
  memset(sib18_part,0,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
  memset(sib19_part,0,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
  memset(sib21_part,0,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
  sib18_part->present = LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib18_v1250;
  sib19_part->present = LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib19_v1250;
  sib21_part->present = LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib21_v1430;
574 575 576 577
  *sib18 = &sib18_part->choice.sib18_v1250;
  *sib19 = &sib19_part->choice.sib19_v1250;
  *sib21 = &sib21_part->choice.sib21_v1430;
#endif
578 579
  // sib2
  (*sib2)->ac_BarringInfo = NULL;
580
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
581 582 583
  (*sib2)->ext1 = NULL;
  (*sib2)->ext2 = NULL;
#endif
knopp's avatar
knopp committed
584
#if defined(ENABLE_ITTI)
585
  (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.numberOfRA_Preambles                         = configuration->rach_numberOfRA_Preambles[CC_id];
knopp's avatar
knopp committed
586
  (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.preamblesGroupAConfig                        = NULL;
587

588
  if (configuration->rach_preamblesGroupAConfig[CC_id]) {
589
    (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.preamblesGroupAConfig
590
      = CALLOC(1,sizeof(struct LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig));
591
    (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.preamblesGroupAConfig->sizeOfRA_PreamblesGroupA
592
      = configuration->rach_sizeOfRA_PreamblesGroupA[CC_id];
593
    (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.preamblesGroupAConfig->messageSizeGroupA
594
      = configuration->rach_messageSizeGroupA[CC_id];
knopp's avatar
knopp committed
595
    (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.preamblesGroupAConfig->messagePowerOffsetGroupB
596
      = configuration->rach_messagePowerOffsetGroupB[CC_id];
knopp's avatar
knopp committed
597
  }
598

599
  (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.powerRampingParameters.powerRampingStep                   = configuration->rach_powerRampingStep[CC_id];
600
  (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.powerRampingParameters.preambleInitialReceivedTargetPower =
601 602 603
    configuration->rach_preambleInitialReceivedTargetPower[CC_id];
  (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ra_SupervisionInfo.preambleTransMax                       = configuration->rach_preambleTransMax[CC_id];
  (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ra_SupervisionInfo.ra_ResponseWindowSize                  = configuration->rach_raResponseWindowSize[CC_id];
604
  (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ra_SupervisionInfo.mac_ContentionResolutionTimer          =
605 606
    configuration->rach_macContentionResolutionTimer[CC_id];
  (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.maxHARQ_Msg3Tx                                            = configuration->rach_maxHARQ_Msg3Tx[CC_id];
knopp's avatar
knopp committed
607
  // BCCH-Config
608
  (*sib2)->radioResourceConfigCommon.bcch_Config.modificationPeriodCoeff
609
    = configuration->bcch_modificationPeriodCoeff[CC_id];
knopp's avatar
knopp committed
610
  // PCCH-Config
611
  (*sib2)->radioResourceConfigCommon.pcch_Config.defaultPagingCycle
612
    = configuration->pcch_defaultPagingCycle[CC_id];
613
  (*sib2)->radioResourceConfigCommon.pcch_Config.nB
614
    = configuration->pcch_nB[CC_id];
615
  LOG_I(RRC,"[SIB2] With ITTI. Basic config of paging cycle DRX: radio frame cycle length %x, paging occasion number %x\n",
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
616 617
        (uint32_t)configuration->pcch_defaultPagingCycle[CC_id],
        (uint32_t)configuration->pcch_nB[CC_id]);
knopp's avatar
knopp committed
618
  // PRACH-Config
619
  (*sib2)->radioResourceConfigCommon.prach_Config.rootSequenceIndex
620
    = configuration->prach_root[CC_id];
621
  (*sib2)->radioResourceConfigCommon.prach_Config.prach_ConfigInfo.prach_ConfigIndex
622
    = configuration->prach_config_index[CC_id];
623
  (*sib2)->radioResourceConfigCommon.prach_Config.prach_ConfigInfo.highSpeedFlag
624
    = configuration->prach_high_speed[CC_id];
625
  (*sib2)->radioResourceConfigCommon.prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig
626
    = configuration->prach_zero_correlation[CC_id];
627
  (*sib2)->radioResourceConfigCommon.prach_Config.prach_ConfigInfo.prach_FreqOffset
628
    = configuration->prach_freq_offset[CC_id];
knopp's avatar
knopp committed
629 630
  // PDSCH-Config
  (*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.referenceSignalPower
631
    = configuration->pdsch_referenceSignalPower[CC_id];
knopp's avatar
knopp committed
632
  (*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.p_b
633
    = configuration->pdsch_p_b[CC_id];
knopp's avatar
knopp committed
634
  // PUSCH-Config
635
  (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.n_SB
636
    = configuration->pusch_n_SB[CC_id];
knopp's avatar
knopp committed
637
  (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode
638
    = configuration->pusch_hoppingMode[CC_id];
knopp's avatar
knopp committed
639
  (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset
640
    = configuration->pusch_hoppingOffset[CC_id];
knopp's avatar
knopp committed
641
  (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM
642
    = configuration->pusch_enable64QAM[CC_id];
knopp's avatar
knopp committed
643
  (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled
644
    = configuration->pusch_groupHoppingEnabled[CC_id];
knopp's avatar
knopp committed
645
  (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH
646
    = configuration->pusch_groupAssignment[CC_id];
knopp's avatar
knopp committed
647
  (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled
648
    = configuration->pusch_sequenceHoppingEnabled[CC_id];
knopp's avatar
knopp committed
649
  (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift
650
    = configuration->pusch_nDMRS1[CC_id];
knopp's avatar
knopp committed
651 652
  // PUCCH-Config
  (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.deltaPUCCH_Shift
653
    = configuration->pucch_delta_shift[CC_id];
654
  (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.nRB_CQI
655
    = configuration->pucch_nRB_CQI[CC_id];
656
  (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.nCS_AN
657
    = configuration->pucch_nCS_AN[CC_id];
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
658
  //#if (LTE_RRC_VERSION < MAKE_VERSION(10, 0, 0))
659
  (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.n1PUCCH_AN
660
    = configuration->pucch_n1_AN[CC_id];
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
661
  //#endif
knopp's avatar
knopp committed
662 663

  // SRS Config
664
  if (configuration->srs_enable[CC_id]==1) {
knopp's avatar
knopp committed
665
    (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.present
666
      = LTE_SoundingRS_UL_ConfigCommon_PR_setup;
knopp's avatar
knopp committed
667
    (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig
668
      = configuration->srs_BandwidthConfig[CC_id];
knopp's avatar
knopp committed
669
    (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig
670
      = configuration->srs_SubframeConfig[CC_id];
knopp's avatar
knopp committed
671
    (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission
672
      = configuration->srs_ackNackST[CC_id];
673

674
    if (configuration->srs_MaxUpPts[CC_id]) {
knopp's avatar
knopp committed
675
      (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts
676
        = CALLOC(1,sizeof(long));
knopp's avatar
knopp committed
677
      *(*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts=1;
678
    } else {
knopp's avatar
knopp committed
679 680
      (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts = NULL;
    }
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
681

682
    RC.rrc[Mod_id]->srs_enable[CC_id] = 1;
683
  } else {
684
    RC.rrc[Mod_id]->srs_enable[CC_id] = 0;
685
    (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.present=LTE_SoundingRS_UL_ConfigCommon_PR_release;
knopp's avatar
knopp committed
686 687 688 689
    (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.release=0;
  }

  // uplinkPowerControlCommon
690
  (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.p0_NominalPUSCH
691
    = configuration->pusch_p0_Nominal[CC_id];
692
  (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.p0_NominalPUCCH
693
    = configuration->pucch_p0_Nominal[CC_id];
694
  (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.alpha
695
    = configuration->pusch_alpha[CC_id];
knopp's avatar
knopp committed
696
  (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1
697
    = configuration->pucch_deltaF_Format1[CC_id];
knopp's avatar
knopp committed
698
  (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1b
699
    = configuration->pucch_deltaF_Format1b[CC_id];
knopp's avatar
knopp committed
700
  (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2
701
    = configuration->pucch_deltaF_Format2[CC_id];
knopp's avatar
knopp committed
702
  (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2a
703
    = configuration->pucch_deltaF_Format2a[CC_id];
knopp's avatar
knopp committed
704
  (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2b
705
    = configuration->pucch_deltaF_Format2b[CC_id];
knopp's avatar
knopp committed
706
  (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaPreambleMsg3
707
    = configuration->msg3_delta_Preamble[CC_id];
knopp's avatar
knopp committed
708
  (*sib2)->radioResourceConfigCommon.ul_CyclicPrefixLength
709
    = configuration->ul_CyclicPrefixLength[CC_id];
knopp's avatar
knopp committed
710 711
  // UE Timers and Constants
  (*sib2)->ue_TimersAndConstants.t300
712
    = configuration->ue_TimersAndConstants_t300[CC_id];
knopp's avatar
knopp committed
713
  (*sib2)->ue_TimersAndConstants.t301
714
    = configuration->ue_TimersAndConstants_t301[CC_id];
knopp's avatar
knopp committed
715
  (*sib2)->ue_TimersAndConstants.t310
716
    = configuration->ue_TimersAndConstants_t310[CC_id];
knopp's avatar
knopp committed
717
  (*sib2)->ue_TimersAndConstants.n310
718
    = configuration->ue_TimersAndConstants_n310[CC_id];
knopp's avatar
knopp committed
719
  (*sib2)->ue_TimersAndConstants.t311
720
    = configuration->ue_TimersAndConstants_t311[CC_id];
knopp's avatar
knopp committed
721
  (*sib2)->ue_TimersAndConstants.n311
722
    = configuration->ue_TimersAndConstants_n311[CC_id];
knopp's avatar
knopp committed
723
#else
724
  (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.numberOfRA_Preambles=LTE_RACH_ConfigCommon__preambleInfo__numberOfRA_Preambles_n64;