L2_interface_ue.c 16.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
 * 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
 */

22
/*! \file l2_interface_ue.c
23 24 25 26 27 28 29 30
 * \brief layer 2 interface, used to support different RRC sublayer
 * \author Raymond Knopp and Navid Nikaein
 * \date 2010-2014
 * \version 1.0
 * \company Eurecom
 * \email: raymond.knopp@eurecom.fr
 */

31 32 33 34 35 36 37 38 39 40

/*! \file l2_interface_ue.c
 * \brief layer 2 interface, added support for FeMBMS RRC sublayer
 * \author J. Morgade
 * \date 2020
 * \version 1.0
 * \email: javier.morgade@ieee.org
 */


41
#include "platform_types.h"
42 43
#include "rrc_defs.h"
#include "rrc_extern.h"
44
#include "common/utils/LOG/log.h"
45 46 47 48 49
#include "rrc_eNB_UE_context.h"
#include "pdcp.h"
#include "msc.h"


50
#include "intertask_interface.h"
51 52 53 54 55 56 57 58 59 60 61 62 63

//#define RRC_DATA_REQ_DEBUG



//------------------------------------------------------------------------------
int8_t
mac_rrc_data_req_ue(
  const module_id_t Mod_idP,
  const int         CC_id,
  const frame_t     frameP,
  const rb_id_t     Srb_id,
  const uint8_t     Nb_tb,
64
  uint8_t    *const buffer_pP,
65 66 67 68 69
  const uint8_t     eNB_index,
  const uint8_t     mbsfn_sync_area
)
//--------------------------------------------------------------------------
{
laurent's avatar
laurent committed
70 71
  LOG_D(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%ld\n",Mod_idP,Srb_id);
  LOG_D(RRC,"[UE %d] Frame %d Filling SL DISCOVERY SRB_ID %ld\n",Mod_idP,frameP,Srb_id);
72 73 74 75 76 77 78 79 80 81
  LOG_D(RRC,"[UE %d] Frame %d buffer_pP status %d,\n",Mod_idP,frameP, UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size);

  //TTN (for D2D)
  if (Srb_id  == SL_DISCOVERY && UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size > 0) {
    memcpy(&buffer_pP[0],&UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.Payload[0],UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size);
    uint8_t Ret_size=UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size;
    LOG_I(RRC,"[UE %d] Sending SL_Discovery, size %d bytes\n",Mod_idP,Ret_size);
    UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size = 0;
    return(Ret_size);
  }
82

laurent's avatar
laurent committed
83
  LOG_D(RRC,"[UE %d] Frame %d Filling CCCH SRB_ID %ld\n",Mod_idP,frameP,Srb_id);
84 85 86
  LOG_D(RRC,"[UE %d] Frame %d buffer_pP status %d,\n",Mod_idP,frameP, UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size);

  if( (UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size > 0) ) {
87 88 89 90 91 92 93 94
    {
      MessageDef *message_p;
      int ccch_size = UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size;
      int sdu_size = sizeof(RRC_MAC_CCCH_DATA_REQ (message_p).sdu);

      if (ccch_size > sdu_size) {
        LOG_E(RRC, "SDU larger than CCCH SDU buffer size (%d, %d)", ccch_size, sdu_size);
        ccch_size = sdu_size;
95 96
      }

97 98 99 100 101 102 103 104
      message_p = itti_alloc_new_message (TASK_RRC_UE, RRC_MAC_CCCH_DATA_REQ);
      RRC_MAC_CCCH_DATA_REQ (message_p).frame = frameP;
      RRC_MAC_CCCH_DATA_REQ (message_p).sdu_size = ccch_size;
      memset (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, 0, CCCH_SDU_SIZE);
      memcpy (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.Payload, ccch_size);
      RRC_MAC_CCCH_DATA_REQ (message_p).enb_index = eNB_index;

      itti_send_msg_to_task (TASK_MAC_UE, UE_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
105
    }
106 107 108 109 110 111 112 113 114 115
    memcpy(&buffer_pP[0],&UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.Payload[0],UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size);
    uint8_t Ret_size=UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size;
    //   UE_rrc_inst[Mod_id].Srb0[eNB_index].Tx_buffer.payload_size=0;
    UE_rrc_inst[Mod_idP].Info[eNB_index].T300_active = 1;
    UE_rrc_inst[Mod_idP].Info[eNB_index].T300_cnt = 0;
    //      msg("[RRC][UE %d] Sending rach\n",Mod_id);
    return(Ret_size);
  } else {
    return 0;
  }
116 117 118

  return(0);
}
119
extern UE_MAC_INST *UE_mac_inst;
120 121 122 123 124 125 126 127 128
//------------------------------------------------------------------------------
int8_t
mac_rrc_data_ind_ue(
  const module_id_t     module_idP,
  const int             CC_id,
  const frame_t         frameP,
  const sub_frame_t     sub_frameP,
  const rnti_t          rntiP,
  const rb_id_t         srb_idP,
129
  const uint8_t        *sduP,
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
  const sdu_size_t      sdu_lenP,
  const mac_enb_index_t eNB_indexP,
  const uint8_t         mbsfn_sync_areaP
)
//--------------------------------------------------------------------------
{
  protocol_ctxt_t ctxt;
  sdu_size_t      sdu_size = 0;
  /* for no gcc warnings */
  (void)sdu_size;
  /*
  int si_window;
   */
  PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, 0, rntiP, frameP, sub_frameP,eNB_indexP);

145
  if(srb_idP == BCCH_SI_MBMS) {
laurent's avatar
laurent committed
146
    LOG_D(RRC,"[UE %d] Received SDU for BCCH on MBMS SRB %ld from eNB %d\n",module_idP,srb_idP,eNB_indexP);
147 148 149
    {
      MessageDef *message_p;
      int msg_sdu_size = sizeof(RRC_MAC_BCCH_MBMS_DATA_IND (message_p).sdu);
150

151 152 153 154 155
      if (sdu_lenP > msg_sdu_size) {
        LOG_E(RRC, "SDU larger than BCCH SDU buffer size (%d, %d)", sdu_lenP, msg_sdu_size);
        sdu_size = msg_sdu_size;
      } else {
        sdu_size = sdu_lenP;
156
      }
157 158 159 160 161 162 163 164 165 166 167

      message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_BCCH_MBMS_DATA_IND);
      memset (RRC_MAC_BCCH_MBMS_DATA_IND (message_p).sdu, 0, BCCH_SDU_MBMS_SIZE);
      RRC_MAC_BCCH_MBMS_DATA_IND (message_p).frame     = frameP;
      RRC_MAC_BCCH_MBMS_DATA_IND (message_p).sub_frame = sub_frameP;
      RRC_MAC_BCCH_MBMS_DATA_IND (message_p).sdu_size  = sdu_size;
      memcpy (RRC_MAC_BCCH_MBMS_DATA_IND (message_p).sdu, sduP, sdu_size);
      RRC_MAC_BCCH_MBMS_DATA_IND (message_p).enb_index = eNB_indexP;
      RRC_MAC_BCCH_MBMS_DATA_IND (message_p).rsrq      = 30 /* TODO change phy to report rspq */;
      RRC_MAC_BCCH_MBMS_DATA_IND (message_p).rsrp      = 45 /* TODO change phy to report rspp */;
      itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p);
168
    }
169
  }
170

171 172 173
  if(srb_idP == BCCH
      && (!UE_mac_inst[ctxt.instance].SI_Decoded
          || !UE_mac_inst[ctxt.instance].SIB_Decoded)) {
laurent's avatar
laurent committed
174
    LOG_D(RRC,"[UE %d] Received SDU for BCCH on SRB %ld from eNB %d\n",module_idP,srb_idP,eNB_indexP);
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
    {
      MessageDef *message_p;
      int msg_sdu_size = sizeof(RRC_MAC_BCCH_DATA_IND (message_p).sdu);

      if (sdu_lenP > msg_sdu_size) {
        LOG_E(RRC, "SDU larger than BCCH SDU buffer size (%d, %d)", sdu_lenP, msg_sdu_size);
        sdu_size = msg_sdu_size;
      } else {
        sdu_size = sdu_lenP;
      }

      message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_BCCH_DATA_IND);
      memset (RRC_MAC_BCCH_DATA_IND (message_p).sdu, 0, BCCH_SDU_SIZE);
      RRC_MAC_BCCH_DATA_IND (message_p).frame     = frameP;
      RRC_MAC_BCCH_DATA_IND (message_p).sub_frame = sub_frameP;
      RRC_MAC_BCCH_DATA_IND (message_p).sdu_size  = sdu_size;
      memcpy (RRC_MAC_BCCH_DATA_IND (message_p).sdu, sduP, sdu_size);
      RRC_MAC_BCCH_DATA_IND (message_p).enb_index = eNB_indexP;
      RRC_MAC_BCCH_DATA_IND (message_p).rsrq      = 30 /* TODO change phy to report rspq */;
      RRC_MAC_BCCH_DATA_IND (message_p).rsrp      = 45 /* TODO change phy to report rspp */;
      itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p);
    }
  }
198

199
  if(srb_idP == PCCH) {
laurent's avatar
laurent committed
200
    LOG_D(RRC,"[UE %d] Received SDU for PCCH on SRB %ld from eNB %d\n",module_idP,srb_idP,eNB_indexP);
201 202
    decode_PCCH_DLSCH_Message(&ctxt,eNB_indexP,(uint8_t *)sduP,sdu_lenP);
  }
203

204 205
  if((srb_idP & RAB_OFFSET) == CCCH) {
    if (sdu_lenP>0) {
laurent's avatar
laurent committed
206
      LOG_T(RRC,"[UE %d] Received SDU for CCCH on SRB %ld from eNB %d\n",module_idP,srb_idP & RAB_OFFSET,eNB_indexP);
207 208
      {
        MessageDef *message_p;
209
        int msg_sdu_size = CCCH_SDU_SIZE;
210 211

        if (sdu_lenP > msg_sdu_size) {
212
          LOG_E(RRC, "SDU larger than CCCH SDU buffer size (%d, %d)", sdu_size, msg_sdu_size);
213 214
          sdu_size = msg_sdu_size;
        } else {
215
          sdu_size =  sdu_lenP;
216 217
        }

218 219 220 221 222 223 224 225
        message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_CCCH_DATA_IND);
        memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
        memcpy (RRC_MAC_CCCH_DATA_IND (message_p).sdu, sduP, sdu_size);
        RRC_MAC_CCCH_DATA_IND (message_p).frame     = frameP;
        RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = sub_frameP;
        RRC_MAC_CCCH_DATA_IND (message_p).sdu_size  = sdu_size;
        RRC_MAC_CCCH_DATA_IND (message_p).enb_index = eNB_indexP;
        RRC_MAC_CCCH_DATA_IND (message_p).rnti      = rntiP;
226 227 228
        itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p);
      }
    }
229
  }
230

231
  if ((srb_idP & RAB_OFFSET) == MCCH) {
232
    LOG_T(RRC,"[UE %d] Frame %d: Received SDU on MBSFN sync area %d for MCCH on SRB %ld from eNB %d\n",
233
          module_idP,frameP, mbsfn_sync_areaP, srb_idP & RAB_OFFSET,eNB_indexP);
234

235 236 237
    {
      MessageDef *message_p;
      int msg_sdu_size = sizeof(RRC_MAC_MCCH_DATA_IND (message_p).sdu);
238

239 240 241
      if (sdu_size > msg_sdu_size) {
        LOG_E(RRC, "SDU larger than MCCH SDU buffer size (%d, %d)", sdu_size, msg_sdu_size);
        sdu_size = msg_sdu_size;
242
      }
243 244 245 246 247 248 249 250 251 252 253 254

      message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_MCCH_DATA_IND);
      RRC_MAC_MCCH_DATA_IND (message_p).frame           = frameP;
      RRC_MAC_MCCH_DATA_IND (message_p).sub_frame       = sub_frameP;
      RRC_MAC_MCCH_DATA_IND (message_p).sdu_size        = sdu_lenP;
      memset (RRC_MAC_MCCH_DATA_IND (message_p).sdu, 0, MCCH_SDU_SIZE);
      memcpy (RRC_MAC_MCCH_DATA_IND (message_p).sdu, sduP, sdu_lenP);
      RRC_MAC_MCCH_DATA_IND (message_p).enb_index       = eNB_indexP;
      RRC_MAC_MCCH_DATA_IND (message_p).mbsfn_sync_area = mbsfn_sync_areaP;
      itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p);
    }
  }
255

256 257
  //TTN (for D2D)
  if(srb_idP == SL_DISCOVERY) {
laurent's avatar
laurent committed
258
    LOG_I(RRC,"[UE %d] Received SDU (%d bytes) for SL_DISCOVERY on SRB %ld from eNB %d\n",module_idP, sdu_lenP, srb_idP,eNB_indexP);
259 260
    decode_SL_Discovery_Message(&ctxt, eNB_indexP, sduP, sdu_lenP);
  }
261 262 263 264 265 266 267 268

  return(0);
}


//------------------------------------------------------------------------------
uint8_t
rrc_data_req_ue(
269
  const protocol_ctxt_t   *const ctxt_pP,
270 271 272 273
  const rb_id_t                  rb_idP,
  const mui_t                    muiP,
  const confirm_t                confirmP,
  const sdu_size_t               sdu_sizeP,
274
  uint8_t                 *const buffer_pP,
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320
  const pdcp_transmission_mode_t modeP
)
//------------------------------------------------------------------------------
{
  MSC_LOG_TX_MESSAGE(
    ctxt_pP->enb_flag ? MSC_RRC_ENB : MSC_RRC_UE,
    ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE,
    buffer_pP,
    sdu_sizeP,
    MSC_AS_TIME_FMT"RRC_DCCH_DATA_REQ UE %x MUI %d size %u",
    MSC_AS_TIME_ARGS(ctxt_pP),
    ctxt_pP->rnti,
    muiP,
    sdu_sizeP);
  {
    MessageDef *message_p;
    // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
    uint8_t *message_buffer;
    message_buffer = itti_malloc (
                       ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE,
                       ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
                       sdu_sizeP);
    memcpy (message_buffer, buffer_pP, sdu_sizeP);
    message_p = itti_alloc_new_message (ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, RRC_DCCH_DATA_REQ);
    RRC_DCCH_DATA_REQ (message_p).frame     = ctxt_pP->frame;
    RRC_DCCH_DATA_REQ (message_p).enb_flag  = ctxt_pP->enb_flag;
    RRC_DCCH_DATA_REQ (message_p).rb_id     = rb_idP;
    RRC_DCCH_DATA_REQ (message_p).muip      = muiP;
    RRC_DCCH_DATA_REQ (message_p).confirmp  = confirmP;
    RRC_DCCH_DATA_REQ (message_p).sdu_size  = sdu_sizeP;
    RRC_DCCH_DATA_REQ (message_p).sdu_p     = message_buffer;
    RRC_DCCH_DATA_REQ (message_p).mode      = modeP;
    RRC_DCCH_DATA_REQ (message_p).module_id = ctxt_pP->module_id;
    RRC_DCCH_DATA_REQ (message_p).rnti      = ctxt_pP->rnti;
    RRC_DCCH_DATA_REQ (message_p).eNB_index = ctxt_pP->eNB_index;
    itti_send_msg_to_task (
      TASK_PDCP_UE,
      ctxt_pP->instance,
      message_p);
    return TRUE; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
  }
}

//------------------------------------------------------------------------------
void
rrc_data_ind_ue(
321
  const protocol_ctxt_t *const ctxt_pP,
322 323
  const rb_id_t                Srb_id,
  const sdu_size_t             sdu_sizeP,
324
  const uint8_t   *const       buffer_pP
325 326 327 328
)
//------------------------------------------------------------------------------
{
  rb_id_t    DCCH_index = Srb_id;
laurent's avatar
laurent committed
329
  LOG_I(RRC, "[UE %x] Frame %d: received a DCCH %ld message on SRB %ld with Size %d from eNB %d\n",
330
        ctxt_pP->module_id, ctxt_pP->frame, DCCH_index,Srb_id,sdu_sizeP,  ctxt_pP->eNB_index);
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349
  {
    MessageDef *message_p;
    // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
    uint8_t *message_buffer;
    message_buffer = itti_malloc (ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, sdu_sizeP);
    memcpy (message_buffer, buffer_pP, sdu_sizeP);
    message_p = itti_alloc_new_message (ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, RRC_DCCH_DATA_IND);
    RRC_DCCH_DATA_IND (message_p).frame      = ctxt_pP->frame;
    RRC_DCCH_DATA_IND (message_p).dcch_index = DCCH_index;
    RRC_DCCH_DATA_IND (message_p).sdu_size   = sdu_sizeP;
    RRC_DCCH_DATA_IND (message_p).sdu_p      = message_buffer;
    RRC_DCCH_DATA_IND (message_p).rnti       = ctxt_pP->rnti;
    RRC_DCCH_DATA_IND (message_p).module_id  = ctxt_pP->module_id;
    RRC_DCCH_DATA_IND (message_p).eNB_index  = ctxt_pP->eNB_index;
    itti_send_msg_to_task (TASK_RRC_UE, ctxt_pP->instance, message_p);
  }
}

//-------------------------------------------------------------------------------------------//
350
void rrc_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) {
351 352 353 354 355 356 357 358 359 360 361 362
  //-------------------------------------------------------------------------------------------//
  {
    MessageDef *message_p;
    //LOG_I(RRC,"sending a message to task_mac_ue\n");
    message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_IN_SYNC_IND);
    RRC_MAC_IN_SYNC_IND (message_p).frame = frameP;
    RRC_MAC_IN_SYNC_IND (message_p).enb_index = eNB_index;
    itti_send_msg_to_task (TASK_RRC_UE, UE_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
  }
}

//-------------------------------------------------------------------------------------------//
363
void rrc_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) {
364 365 366
  //-------------------------------------------------------------------------------------------//
  if (UE_rrc_inst[Mod_idP].Info[eNB_index].N310_cnt>10)
    LOG_I(RRC,"[UE %d] Frame %d: OUT OF SYNC FROM eNB %d (T310 active %d : T310 %d, N310 %d, N311 %d)\n ",
367 368 369 370 371 372
          Mod_idP,frameP,eNB_index,
          UE_rrc_inst[Mod_idP].Info[eNB_index].T300_active,
          UE_rrc_inst[Mod_idP].Info[eNB_index].T310_cnt,
          UE_rrc_inst[Mod_idP].Info[eNB_index].N310_cnt,
          UE_rrc_inst[Mod_idP].Info[eNB_index].N311_cnt);

373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396
  {
    MessageDef *message_p;
    message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_OUT_OF_SYNC_IND);
    RRC_MAC_OUT_OF_SYNC_IND (message_p).frame = frameP;
    RRC_MAC_OUT_OF_SYNC_IND (message_p).enb_index = eNB_index;
    itti_send_msg_to_task (TASK_RRC_UE, UE_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
  }
}

//------------------------------------------------------------------------------
int
mac_UE_get_rrc_status(
  const module_id_t Mod_idP,
  const uint8_t     indexP
)
//------------------------------------------------------------------------------
{
  if (UE_rrc_inst)
    return(UE_rrc_inst[Mod_idP].Info[indexP].State);
  else
    return(-1);
}

//-------------------------------------------------------------------------------------------//
397
int mac_ue_ccch_success_ind(module_id_t Mod_idP, uint8_t eNB_index) {
398 399 400 401 402 403 404 405 406
  //-------------------------------------------------------------------------------------------//
  {
    MessageDef *message_p;
    message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_CCCH_DATA_CNF);
    RRC_MAC_CCCH_DATA_CNF (message_p).enb_index = eNB_index;
    itti_send_msg_to_task (TASK_RRC_UE, UE_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
  }
  return 0;
}