Commit c4e0f475 authored by WEI-TAI CHEN's avatar WEI-TAI CHEN

upload RRC file

parent 0339b49b
......@@ -50,15 +50,20 @@
#include "PHY/defs_L1_NB_IoT.h"
#include "RRC/LITE/defs_NB_IoT.h"
#include "RRC/NR/defs_NR.h"
typedef struct {
/// RAN context config file name
char *config_file_name;
/// Number of RRC instances in this node
int nb_inst;
/// Number of NB_IoT RRC instances in this node
int nb_nb_iot_rrc_inst;
/// Number of NR RRC instances in this node
int nb_nr_inst;
/// Number of Component Carriers per instance in this node
int *nb_CC;
/// Number of NB_IoT instances in this node
int nb_nb_iot_rrc_inst;
/// Number of NR Component Carriers per instance in this node
int *nb_nr_CC;
/// Number of MACRLC instances in this node
int nb_macrlc_inst;
/// Number of NB_IoT MACRLC instances in this node
......@@ -85,6 +90,8 @@ typedef struct {
struct eNB_RRC_INST_s **rrc;
/// NB_IoT RRC context variables
//struct eNB_RRC_INST_NB_IoT_s **nb_iot_rrc;
/// NR RRC context variables
struct gNB_RRC_INST_s **nr_rrc;
/// MAC context variables
struct eNB_MAC_INST_s **mac;
/// NB_IoT MAC context variables
......
/*
* 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 l2_interface.c
* \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
*/
#include "platform_types.h"
//#include "openair_defs.h"
//#include "openair_proto.h"
#include "defs.h"
#include "extern.h"
//#include "mac_lchan_interface.h"
//#include "openair_rrc_utils.h"
//#include "openair_rrc_main.h"
#include "UTIL/LOG/log.h"
#include "rrc_eNB_UE_context.h"
#include "pdcp.h"
#include "msc.h"
#include "common/ran_context.h"
#ifdef PHY_EMUL
#include "SIMULATION/simulation_defs.h"
extern EMULATION_VARS *Emul_vars;
extern eNB_MAC_INST *eNB_mac_inst;
extern UE_MAC_INST *UE_mac_inst;
#endif
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
#include "flexran_agent_extern.h"
//#define RRC_DATA_REQ_DEBUG
//#define DEBUG_RRC 1
extern RAN_CONTEXT_t RC;
//------------------------------------------------------------------------------
int8_t
mac_rrc_data_req(
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,
uint8_t* const buffer_pP,
const uint8_t mbsfn_sync_area
)
//--------------------------------------------------------------------------
{
asn_enc_rval_t enc_rval;
SRB_INFO *Srb_info;
uint8_t Sdu_size = 0;
uint8_t sfn = (uint8_t)((frameP>>2)&0xff);
#ifdef DEBUG_RRC
int i;
LOG_I(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id);
#endif
eNB_RRC_INST *rrc;
rrc_eNB_carrier_data_t *carrier;
BCCH_BCH_Message_t *mib;
rrc = RC.rrc[Mod_idP];
carrier = &rrc->carrier[0];
mib = &carrier->mib;
if((Srb_id & RAB_OFFSET) == BCCH) {
if(RC.rrc[Mod_idP]->carrier[CC_id].SI.Active==0) {
return 0;
}
// All even frames transmit SIB in SF 5
AssertFatal(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1 != 255,
"[eNB %d] MAC Request for SIB1 and SIB1 not initialized\n",Mod_idP);
if ((frameP%2) == 0) {
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB1,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1);
#if 0 //defined(ENABLE_ITTI)
{
MessageDef *message_p;
int sib1_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1;
int sdu_size = sizeof(RRC_MAC_BCCH_DATA_REQ (message_p).sdu);
if (sib1_size > sdu_size) {
LOG_E(RRC, "SIB1 SDU larger than BCCH SDU buffer size (%d, %d)", sib1_size, sdu_size);
sib1_size = sdu_size;
}
message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_BCCH_DATA_REQ);
RRC_MAC_BCCH_DATA_REQ (message_p).frame = frameP;
RRC_MAC_BCCH_DATA_REQ (message_p).sdu_size = sib1_size;
memset (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, 0, BCCH_SDU_SIZE);
memcpy (RRC_MAC_BCCH_DATA_REQ (message_p).sdu,
RC.rrc[Mod_idP]->carrier[CC_id].SIB1,
sib1_size);
RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
}
#endif
#ifdef DEBUG_RRC
LOG_T(RRC,"[eNB %d] Frame %d : BCCH request => SIB 1\n",Mod_idP,frameP);
for (i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1; i++) {
LOG_T(RRC,"%x.",buffer_pP[i]);
}
LOG_T(RRC,"\n");
#endif
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1);
} // All RFN mod 8 transmit SIB2-3 in SF 5
else if ((frameP%8) == 1) {
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB23,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
#if 0 //defined(ENABLE_ITTI)
{
MessageDef *message_p;
int sib23_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23;
int sdu_size = sizeof(RRC_MAC_BCCH_DATA_REQ (message_p).sdu);
if (sib23_size > sdu_size) {
LOG_E(RRC, "SIB23 SDU larger than BCCH SDU buffer size (%d, %d)", sib23_size, sdu_size);
sib23_size = sdu_size;
}
message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_BCCH_DATA_REQ);
RRC_MAC_BCCH_DATA_REQ (message_p).frame = frameP;
RRC_MAC_BCCH_DATA_REQ (message_p).sdu_size = sib23_size;
memset (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, 0, BCCH_SDU_SIZE);
memcpy (RRC_MAC_BCCH_DATA_REQ (message_p).sdu,
RC.rrc[Mod_idP]->carrier[CC_id].SIB23,
sib23_size);
RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
}
#endif
#ifdef DEBUG_RRC
LOG_T(RRC,"[eNB %d] Frame %d BCCH request => SIB 2-3\n",Mod_idP,frameP);
for (i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23; i++) {
LOG_T(RRC,"%x.",buffer_pP[i]);
}
LOG_T(RRC,"\n");
#endif
return(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
} else {
return(0);
}
}
if( (Srb_id & RAB_OFFSET ) == MIBCH) {
mib->message.systemFrameNumber.buf = &sfn;
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message,
(void*)mib,
carrier->MIB,
24);
LOG_D(RRC,"Encoded MIB for frame %d (%p), bits %lu\n",sfn,carrier->MIB,enc_rval.encoded);
buffer_pP[0]=carrier->MIB[0];
buffer_pP[1]=carrier->MIB[1];
buffer_pP[2]=carrier->MIB[2];
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
return(3);
}
if( (Srb_id & RAB_OFFSET ) == CCCH) {
LOG_T(RRC,"[eNB %d] Frame %d CCCH request (Srb_id %d)\n",Mod_idP,frameP, Srb_id);
if(RC.rrc[Mod_idP]->carrier[CC_id].Srb0.Active==0) {
LOG_E(RRC,"[eNB %d] CCCH Not active\n",Mod_idP);
return -1;
}
Srb_info=&RC.rrc[Mod_idP]->carrier[CC_id].Srb0;
// check if data is there for MAC
if(Srb_info->Tx_buffer.payload_size>0) { //Fill buffer
LOG_D(RRC,"[eNB %d] CCCH (%p) has %d bytes (dest: %p, src %p)\n",Mod_idP,Srb_info,Srb_info->Tx_buffer.payload_size,buffer_pP,Srb_info->Tx_buffer.Payload);
#if 0 // defined(ENABLE_ITTI)
{
MessageDef *message_p;
int ccch_size = Srb_info->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;
}
message_p = itti_alloc_new_message (TASK_RRC_ENB, 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, Srb_info->Tx_buffer.Payload, ccch_size);
RRC_MAC_CCCH_DATA_REQ (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
}
#endif
memcpy(buffer_pP,Srb_info->Tx_buffer.Payload,Srb_info->Tx_buffer.payload_size);
Sdu_size = Srb_info->Tx_buffer.payload_size;
Srb_info->Tx_buffer.payload_size=0;
}
return (Sdu_size);
}
if( (Srb_id & RAB_OFFSET ) == PCCH) {
LOG_T(RRC,"[eNB %d] Frame %d PCCH request (Srb_id %d)\n",Mod_idP,frameP, Srb_id);
// check if data is there for MAC
if(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] > 0) { //Fill buffer
LOG_D(RRC,"[eNB %d] PCCH (%p) has %d bytes\n",Mod_idP,&RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area],
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]);
#if 0 //defined(ENABLE_ITTI)
{
MessageDef *message_p;
int pcch_size = RC.rrc[Mod_idP]->arrier[CC_id].sizeof_paging[mbsfn_sync_area];
int sdu_size = sizeof(RRC_MAC_PCCH_DATA_REQ (message_p).sdu);
if (pcch_size > sdu_size) {
LOG_E(RRC, "SDU larger than PCCH SDU buffer size (%d, %d)", pcch_size, sdu_size);
pcch_size = sdu_size;
}
message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_PCCH_DATA_REQ);
RRC_MAC_PCCH_DATA_REQ (message_p).frame = frameP;
RRC_MAC_PCCH_DATA_REQ (message_p).sdu_size = pcch_size;
memset (RRC_MAC_PCCH_DATA_REQ (message_p).sdu, 0, PCCH_SDU_SIZE);
memcpy (RRC_MAC_PCCH_DATA_REQ (message_p).sdu, RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], pcch_size);
RRC_MAC_PCCH_DATA_REQ (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
}
#endif
memcpy(buffer_pP, RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]);
Sdu_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area];
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] = 0;
}
return (Sdu_size);
}
#if defined(Rel10) || defined(Rel14)
if((Srb_id & RAB_OFFSET) == MCCH) {
if(RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESS[mbsfn_sync_area].Active==0) {
return 0; // this parameter is set in function init_mcch in rrc_eNB.c
}
#if 0 // defined(ENABLE_ITTI)
{
MessageDef *message_p;
int mcch_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area];
int sdu_size = sizeof(RRC_MAC_MCCH_DATA_REQ (message_p).sdu);
if (mcch_size > sdu_size) {
LOG_E(RRC, "SDU larger than MCCH SDU buffer size (%d, %d)", mcch_size, sdu_size);
mcch_size = sdu_size;
}
message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_MCCH_DATA_REQ);
RRC_MAC_MCCH_DATA_REQ (message_p).frame = frameP;
RRC_MAC_MCCH_DATA_REQ (message_p).sdu_size = mcch_size;
memset (RRC_MAC_MCCH_DATA_REQ (message_p).sdu, 0, MCCH_SDU_SIZE);
memcpy (RRC_MAC_MCCH_DATA_REQ (message_p).sdu,
RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
mcch_size);
RRC_MAC_MCCH_DATA_REQ (message_p).enb_index = eNB_index;
RRC_MAC_MCCH_DATA_REQ (message_p).mbsfn_sync_area = mbsfn_sync_area;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
}
#endif
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
#ifdef DEBUG_RRC
LOG_D(RRC,"[eNB %d] Frame %d : MCCH request => MCCH_MESSAGE \n",Mod_idP,frameP);
for (i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]; i++) {
LOG_T(RRC,"%x.",buffer_pP[i]);
}
LOG_T(RRC,"\n");
#endif
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
// }
//else
//return(0);
}
#endif //Rel10 || Rel14
#ifdef Rel14
if ((Srb_id & RAB_OFFSET) == BCCH_SIB1_BR){
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB1_BR,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
}
if ((Srb_id & RAB_OFFSET) == BCCH_SI_BR){ // First SI message with SIB2/3
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB23_BR,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR);
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR);
}
#endif
return(0);
}
//------------------------------------------------------------------------------
int8_t
mac_rrc_data_ind(
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,
const uint8_t* sduP,
const sdu_size_t sdu_lenP,
const uint8_t mbsfn_sync_areaP
)
//--------------------------------------------------------------------------
{
SRB_INFO *Srb_info;
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, ENB_FLAG_YES, rntiP, frameP, sub_frameP,0);
Srb_info = &RC.rrc[module_idP]->carrier[CC_id].Srb0;
LOG_D(RRC,"[eNB %d] Received SDU for CCCH on SRB %d\n",module_idP,Srb_info->Srb_id);
#if 0 //defined(ENABLE_ITTI)
{
MessageDef *message_p;
int msg_sdu_size = sizeof(RRC_MAC_CCCH_DATA_IND (message_p).sdu);
if (sdu_lenP > msg_sdu_size) {
LOG_E(RRC, "SDU larger than CCCH 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_ENB, RRC_MAC_CCCH_DATA_IND);
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).rnti = rntiP;
RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = sdu_size;
RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
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);
LOG_D(RRC,"[eNB %d] Sending message to RRC task\n",module_idP);
itti_send_msg_to_task (TASK_RRC_ENB, ctxt.instance, message_p);
}
#else
// msg("\n******INST %d Srb_info %p, Srb_id=%d****\n\n",Mod_id,Srb_info,Srb_info->Srb_id);
if (sdu_lenP > 0) {
memcpy(Srb_info->Rx_buffer.Payload,sduP,sdu_lenP);
Srb_info->Rx_buffer.payload_size = sdu_lenP;
rrc_eNB_decode_ccch(&ctxt, Srb_info, CC_id);
}
#endif
return(0);
}
//------------------------------------------------------------------------------
int
mac_eNB_get_rrc_status(
const module_id_t Mod_idP,
const rnti_t rntiP
)
//------------------------------------------------------------------------------
{
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
ue_context_p = rrc_eNB_get_ue_context(
RC.rrc[Mod_idP],
rntiP);
if (ue_context_p != NULL) {
return(ue_context_p->ue_context.Status);
} else {
return RRC_INACTIVE;
}
}
void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
const int CC_idP,
const frame_t frameP,
const sub_frame_t subframeP,
const rnti_t rntiP)
{
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
ue_context_p = rrc_eNB_get_ue_context(
RC.rrc[Mod_instP],
rntiP);
if (ue_context_p != NULL) {
LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",frameP,subframeP,rntiP);
if(ue_context_p->ue_context.ul_failure_timer == 0)
ue_context_p->ue_context.ul_failure_timer=1;
}
else {
LOG_W(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP);
}
if (rrc_agent_registered[Mod_instP]) {
agent_rrc_xface[Mod_instP]->flexran_agent_notify_ue_state_change(Mod_instP,
rntiP,
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
}
// rrc_mac_remove_ue(Mod_instP,rntiP);
}
void mac_eNB_rrc_uplane_failure(const module_id_t Mod_instP,
const int CC_idP,
const frame_t frameP,
const sub_frame_t subframeP,
const rnti_t rntiP)
{
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
ue_context_p = rrc_eNB_get_ue_context(
RC.rrc[Mod_instP],
rntiP);
if (ue_context_p != NULL) {
LOG_I(RRC,"Frame %d, Subframe %d: UE %x U-Plane failure, activating timer\n",frameP,subframeP,rntiP);
if(ue_context_p->ue_context.ul_failure_timer == 0)
ue_context_p->ue_context.ul_failure_timer=19999;
}
else {
LOG_W(RRC,"Frame %d, Subframe %d: U-Plane failure: UE %x unknown \n",frameP,subframeP,rntiP);
}
}
void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP,
const int CC_idP,
const frame_t frameP,
const sub_frame_t subframeP,
const rnti_t rntiP)
{
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
ue_context_p = rrc_eNB_get_ue_context(
RC.rrc[Mod_instP],
rntiP);
if (ue_context_p != NULL) {
LOG_I(RRC,"Frame %d, Subframe %d: UE %x to UL in synch\n",
frameP, subframeP, rntiP);
ue_context_p->ue_context.ul_failure_timer = 0;
} else {
LOG_E(RRC,"Frame %d, Subframe %d: UE %x unknown \n",
frameP, subframeP, rntiP);
}
}
NR-InterNodeDefinitions DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- TAG-HANDOVER-COMMAND-START
HandoverCommand ::= SEQUENCE {
criticalExtensions CHOICE {
c1 CHOICE{
handoverCommand HandoverCommand-IEs,
spare3 NULL, spare2 NULL, spare1 NULL
},
criticalExtensionsFuture SEQUENCE {}
}
}
HandoverCommand-IEs ::= SEQUENCE {
handoverCommandMessage OCTET STRING (CONTAINING RRCReconfiguration),
nonCriticalExtension SEQUENCE {} OPTIONAL
}
-- TAG-HANDOVER-COMMAND-STOP
-- TAG-HANDOVER-PREPARATION-INFORMATION-START
HandoverPreparationInformation ::= SEQUENCE {
criticalExtensions CHOICE {
c1 CHOICE{
handoverPreparationInformation HandoverPreparationInformation-IEs,
spare3 NULL, spare2 NULL, spare1 NULL
},
criticalExtensionsFuture SEQUENCE {}
}
}
HandoverPreparationInformation-IEs ::= SEQUENCE {
ue-CapabilityRAT-List UE-CapabilityRAT-ContainerList,
sourceConfig OCTET STRING (CONTAINING RRCReconfiguration),
rrm-Config RRM-Config OPTIONAL,
as-Context AS-Context OPTIONAL,
nonCriticalExtension SEQUENCE {} OPTIONAL
}
AS-Context ::= SEQUENCE {
reestablishmentInfo SEQUENCE {
sourcePhysCellId PhysCellId,
targetCellShortMAC-I ShortMAC-I,
additionalReestabInfoList ReestabNCellInfoList OPTIONAL
} OPTIONAL,
-- FFS Whether to change e.g. move all re-establishment info to Xx
configRestrictInfo ConfigRestrictInfoSCG OPTIONAL,
...
}
ReestabNCellInfoList ::= SEQUENCE ( SIZE (1..maxCellPrep) ) OF ReestabNCellInfo
ReestabNCellInfo::= SEQUENCE{
cellIdentity CellIdentity,
key-gNodeB-Star BIT STRING (SIZE (256)),
shortMAC-I ShortMAC-I
}
RRM-Config ::= SEQUENCE {
ue-InactiveTime ENUMERATED {
s1, s2, s3, s5, s7, s10, s15, s20,
s25, s30, s40, s50, min1, min1s20c, min1s40,
min2, min2s30, min3, min3s30, min4, min5, min6,
min7, min8, min9, min10, min12, min14, min17, min20,
min24, min28, min33, min38, min44, min50, hr1,
hr1min30, hr2, hr2min30, hr3, hr3min30, hr4, hr5, hr6,
hr8, hr10, hr13, hr16, hr20, day1, day1hr12, day2,
day2hr12, day3, day4, day5, day7, day10, day14, day19,
day24, day30, dayMoreThan30} OPTIONAL ,
candidateCellInfoList CandidateCellInfoList OPTIONAL,
...
}
-- TAG-HANDOVER-PREPARATION-INFORMATION-STOP
-- TAG-CG-CONFIG-START
CG-Config ::= SEQUENCE {
criticalExtensions CHOICE {
c1 CHOICE{
cg-Config CG-Config-IEs,
spare3 NULL, spare2 NULL, spare1 NULL
},
criticalExtensionsFuture SEQUENCE {}
}
}
CG-Config-IEs ::= SEQUENCE {
scg-CellGroupConfig OCTET STRING (CONTAINING RRCReconfiguration) OPTIONAL,
scg-RB-Config OCTET STRING (CONTAINING RadioBearerConfig) OPTIONAL,
configRestrictModReq ConfigRestrictModReqSCG OPTIONAL,
drx-InfoSCG DRX-Info OPTIONAL,
candidateCellInfoListSN OCTET STRING (CONTAINING CandidateCellInfoList) OPTIONAL,
measConfigSN MeasConfigSN OPTIONAL,
selectedBandCombinationNR BandCombinationIndex OPTIONAL,
nonCriticalExtension SEQUENCE {} OPTIONAL
}
MeasConfigSN ::= SEQUENCE {
measuredFrequenciesFR1 SEQUENCE (SIZE (1..maxMeasFreqsMN)) OF NR-FreqInfo OPTIONAL,
...
}
NR-FreqInfo ::= SEQUENCE {
measuredFrequency ARFCN-ValueNR OPTIONAL,
...
}
ConfigRestrictModReqSCG ::= SEQUENCE {
requestedBC-MRDC BandCombinationIndex OPTIONAL,
requestedBPC-ListMRDC BPC-IndexList OPTIONAL,
requestedP-MaxFR1 P-Max OPTIONAL,
...
}
BandCombinationIndex ::= INTEGER (1..maxBandComb)
-- TAG-CG-CONFIG-STOP
-- TAG-CG-CONFIG-INFO-START
CG-ConfigInfo ::= SEQUENCE {
criticalExtensions CHOICE {
c1 CHOICE{
cg-ConfigInfo CG-ConfigInfo-IEs,
spare3 NULL, spare2 NULL, spare1 NULL
},
criticalExtensionsFuture SEQUENCE {}
}
}
CG-ConfigInfo-IEs ::= SEQUENCE {
ue-CapabilityInfo OCTET STRING (CONTAINING UE-CapabilityRAT-ContainerList) OPTIONAL,-- Cond SN-Addition
candidateCellInfoListMN CandidateCellInfoList OPTIONAL,
candidateCellInfoListSN OCTET STRING (CONTAINING CandidateCellInfoList) OPTIONAL,
measResultCellListSFTD MeasResultCellListSFTD OPTIONAL,
scgFailureInfo SEQUENCE {
failureType ENUMERATED { t310-Expiry, randomAccessProblem,
rlc-MaxNumRetx, scg-ChangeFailure,
scg-reconfigFailure,
srb3-IntegrityFailure},
measResultSCG OCTET STRING (CONTAINING MeasResultSCG-Failure)
} OPTIONAL,
configRestrictInfo ConfigRestrictInfoSCG OPTIONAL,
drx-InfoMCG DRX-Info OPTIONAL,
measConfigMN MeasConfigMN OPTIONAL,
sourceConfigSCG OCTET STRING (CONTAINING RRCReconfiguration) OPTIONAL,
scg-RB-Config OCTET STRING (CONTAINING RadioBearerConfig) OPTIONAL,
mcg-RB-Config OCTET STRING (CONTAINING RadioBearerConfig) OPTIONAL,
nonCriticalExtension SEQUENCE {} OPTIONAL
}
ConfigRestrictInfoSCG ::= SEQUENCE {
allowedBC-ListMRDC BandCombinationIndexList OPTIONAL,
allowedBPC-ListMRDC BPC-IndexList OPTIONAL,
powerCoordination-FR1 SEQUENCE {
p-maxNR P-Max OPTIONAL,
p-maxEUTRA P-Max OPTIONAL
} OPTIONAL,
servCellIndexRangeSCG SEQUENCE {
lowBound ServCellIndex,
upBound ServCellIndex
} OPTIONAL, -- Cond SN-Addition
maxMeasFreqsSCG-NR INTEGER(1..maxMeasFreqsMN) OPTIONAL,
...
}
BandCombinationIndexList ::= SEQUENCE (SIZE (1..maxBandComb)) OF BandCombinationIndex
BPC-IndexList ::= SEQUENCE (SIZE (1..maxBasebandProcComb)) OF BPC-Index
BPC-Index ::= INTEGER (1..maxBasebandProcComb)
DRX-Info ::= SEQUENCE {
drx-LongCycleStartOffset CHOICE {
ms10 INTEGER(0..9),
ms20 INTEGER(0..19),
ms32 INTEGER(0..31),
ms40 INTEGER(0..39),
ms60 INTEGER(0..59),
ms64 INTEGER(0..63),
ms70 INTEGER(0..69),
ms80 INTEGER(0..79),
ms128 INTEGER(0..127),
ms160 INTEGER(0..159),
ms256 INTEGER(0..255),
ms320 INTEGER(0..319),
ms512 INTEGER(0..511),
ms640 INTEGER(0..639),
ms1024 INTEGER(0..1023),
ms1280 INTEGER(0..1279),
ms2048 INTEGER(0..2047),
ms2560 INTEGER(0..2559),
ms5120 INTEGER(0..5119),
ms10240 INTEGER(0..10239)
},
shortDRX SEQUENCE {
drx-ShortCycle ENUMERATED {
ms2, ms3, ms4, ms5, ms6, ms7, ms8, ms10, ms14, ms16, ms20, ms30, ms32,
ms35, ms40, ms64, ms80, ms128, ms160, ms256, ms320, ms512, ms640, spare9,
spare8, spare7, spare6, spare5, spare4, spare3, spare2, spare1 },
drx-ShortCycleTimer INTEGER (1..16)
} OPTIONAL
}
MeasConfigMN ::= SEQUENCE {
measuredFrequenciesMN SEQUENCE (SIZE (1..maxMeasFreqsMN)) OF NR-FreqInfo OPTIONAL,
measGapConfigFR1 GapConfig OPTIONAL,
gapPurpose ENUMERATED {perUE, perFR1} OPTIONAL,
...
}
-- TAG-CG-CONFIG-INFO-STOP
-- TAG-MEASUREMENT-TIMING-CONFIGURATION-START
MeasurementTimingConfiguration ::= SEQUENCE {
criticalExtensions CHOICE {
c1 CHOICE{
measTimingConf MeasurementTimingConfiguration-IEs,
spare3 NULL, spare2 NULL, spare1 NULL
},
criticalExtensionsFuture SEQUENCE {}
}
}
MeasurementTimingConfiguration-IEs ::= SEQUENCE {
measTiming MeasTimingList OPTIONAL,
nonCriticalExtension SEQUENCE {} OPTIONAL
}
MeasTimingList ::= SEQUENCE (SIZE (1..maxMeasFreqsMN)) OF MeasTiming
MeasTiming ::= SEQUENCE {
carrierFreq ARFCN-ValueNR OPTIONAL,
ssb-MeasurementTimingConfiguration ENUMERATED {ffsTypeAndValue} OPTIONAL,
...
}
-- TAG-MEASUREMENT-TIMING-CONFIGURATION-STOP
-- TAG-CANDIDATE-CELL-INFO-LIST-START
CandidateCellInfoList ::= SEQUENCE (SIZE (1.. maxNrofSCells)) OF CandidateCellInfo
CandidateCellInfo ::= SEQUENCE {
cellIdentification SEQUENCE {
physCellId PhysCellId,
dl-CarrierFreq ARFCN-ValueNR
},
measResultCell MeasQuantityResults OPTIONAL,
candidateRS-IndexListSSB CandidateRS-IndexInfoListSSB OPTIONAL,
candidateRS-IndexListCSI-RS CandidateRS-IndexInfoListCSI-RS OPTIONAL,
...
}
CandidateRS-IndexInfoListSSB ::= SEQUENCE (SIZE (1..maxNrofIndexesToReport)) OF CandidateRS-IndexInfoSSB
CandidateRS-IndexInfoSSB ::= SEQUENCE {
ssb-Index SSB-Index,
measResultSSB MeasQuantityResults OPTIONAL,
...
}
CandidateRS-IndexInfoListCSI-RS ::= SEQUENCE (SIZE (1..maxNrofIndexesToReport)) OF CandidateRS-IndexInfoCSI-RS
CandidateRS-IndexInfoCSI-RS ::= SEQUENCE {
csi-RS-Index CSI-RS-Index,
measResultCSI-RS MeasQuantityResults OPTIONAL,
...
}
-- TAG-CANDIDATE-CELL-INFO-LIST-STOP
-- TAG_NR-MULTIPLICITY-AND-CONSTRAINTS-START
maxMeasFreqsMN INTEGER ::= 32 -- Maximum number of MN-configured measurement frequencies
maxCellPrep INTEGER ::= 32 -- Maximum number of cells prepared for handover
-- TAG_NR-MULTIPLICITY-AND-CONSTRAINTS-STOP
-- TAG_NR-INTER-NODE-DEFINITIONS-END-START
END
This source diff could not be displayed because it is too large. You can view the blob instead.
NR-UE-Variables DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- TAG-VAR-MEAS-CONFIG-START
VarMeasConfig ::= SEQUENCE {
-- Measurement identities
measIdList MeasIdToAddModList OPTIONAL,
-- Measurement objects
measObjectList MeasObjectToAddModList OPTIONAL,
-- Reporting configurations
reportConfigList ReportConfigToAddModList OPTIONAL,
-- Other parameters
quantityConfig QuantityConfig OPTIONAL,
s-MeasureConfig CHOICE {
ssb-RSRP RSRP-Range,
csi-RSRP RSRP-Range
} OPTIONAL
}
-- TAG-VAR-MEAS-CONFIG-STOP
-- TAG-VAR-MEAS-REPORT-START
VarMeasReportList ::= SEQUENCE (SIZE (1..maxNrofMeasId)) OF VarMeasReport
VarMeasReport ::= SEQUENCE {
-- List of measurement that have been triggered
measId MeasId,
cellsTriggeredList CellsTriggeredList OPTIONAL,
numberOfReportsSent INTEGER
}
CellsTriggeredList ::= SEQUENCE (SIZE (1..maxNrofCellMeas)) OF CHOICE {
physCellId PhysCellId,
-- Not needed for EN-DC.
physCellIdEUTRA ENUMERATED {ffsTypeAndValue}
}
-- TAG-VAR-MEAS-REPORT-STOP
END
#!/usr/bin/perl
# This script extracts the ASN1 definition from and TS 38.331 and generates 3 output files that can be processed by asn2wrs
# First download the specification from 3gpp.org as a word document and open it
# Then in "view" menu, select normal or web layout (needed to removed page header and footers)
# Finally save the document as a text file
# Call the script: "perl extract_asn1_from_spec.pl 38331-xxx.txt"
# It should generate: NR-RRC-Definitions.asn, NR-UE-Variables.asn and NR-InterNodeDefinitions
use warnings;
$input_file = $ARGV[0];
$NR_def_output_file = "NR-RRC-Definitions.asn";
$NR_var_output_file = "NR-UE-Variables.asn";
$NR_internode_output_file = "NR-InterNodeDefinitions.asn";
sub extract_asn1;
open(INPUT_FILE, "< $input_file") or die "Can not open file $input_file";
while (<INPUT_FILE>) {
# Process the NR-RRC-Definitions section
if( m/NR-RRC-Definitions DEFINITIONS AUTOMATIC TAGS ::=/){
open(OUTPUT_FILE, "> $NR_def_output_file") or die "Can not open file $def_output_file";
syswrite OUTPUT_FILE,"$_ \n";
syswrite OUTPUT_FILE,"BEGIN\n\n";
# Get all the text delimited by -- ASN1START and -- ASN1STOP
extract_asn1();
syswrite OUTPUT_FILE,"END\n\n";
close(OUTPUT_FILE);
}
# Process the NR-UE-Variables section
if( m/NR-UE-Variables DEFINITIONS AUTOMATIC TAGS ::=/){
open(OUTPUT_FILE, "> $NR_var_output_file") or die "Can not open file $def_output_file";
syswrite OUTPUT_FILE,"$_ \n";
syswrite OUTPUT_FILE,"BEGIN\n\n";
# Get all the text delimited by -- ASN1START and -- ASN1STOP
extract_asn1();
syswrite OUTPUT_FILE,"END\n\n";
close(OUTPUT_FILE);
}
# Process the NR-InterNodeDefinitions section
if( m/NR-InterNodeDefinitions DEFINITIONS AUTOMATIC TAGS ::=/){
open(OUTPUT_FILE, "> $NR_internode_output_file") or die "Can not open file $def_output_file";
syswrite OUTPUT_FILE,"$_ \n";
syswrite OUTPUT_FILE,"BEGIN\n\n";
# Get all the text delimited by -- ASN1START and -- ASN1STOP
extract_asn1();
syswrite OUTPUT_FILE,"END\n\n";
close(OUTPUT_FILE);
}
}
close(INPUT_FILE);
# This subroutine copies the text delimited by -- ASN1START and -- ASN1STOP in INPUT_FILE
# and copies it into OUTPUT_FILE.
# It stops when it meets the keyword "END"
sub extract_asn1 {
my $line = <INPUT_FILE>;
my $is_asn1 = 0;
while(($line ne "END\n") && ($line ne "END\r\n")){
if ($line =~ m/-- ASN1STOP/) {
$is_asn1 = 0;
}
if ($is_asn1 == 1){
syswrite OUTPUT_FILE,"$line";
}
if ($line =~ m/-- ASN1START/) {
$is_asn1 = 1;
}
$line = <INPUT_FILE>;
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/* 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/LITE/defs_NR.h
* \brief NR RRC struct definitions and function prototypes
* \author Navid Nikaein, Raymond Knopp and WEI-TAI CHEN
* \date 2010 - 2014, 2018
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr, kroempa@gmail.com.tw
*/
#ifndef __OPENAIR_RRC_DEFS_NR_H__
#define __OPENAIR_RRC_DEFS_NR_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "collection/tree.h"
#include "rrc_types_NR.h"
#include "COMMON/platform_constants.h"
#include "COMMON/platform_types.h"
//#include "COMMON/mac_rrc_primitives.h"
#if defined(Rel15)
#include "SIB1.h"
//#include "SystemInformation.h"
//#include "RRCConnectionReconfiguration.h"
//#include "RRCConnectionReconfigurationComplete.h"
//#include "RRCConnectionSetup.h"
//#include "RRCConnectionSetupComplete.h"
//#include "RRCConnectionRequest.h"
//#include "RRCConnectionReestablishmentRequest.h"
//#include "BCCH-DL-SCH-Message.h"
#include "BCCH-BCH-Message.h"
//#include "MCCH-Message.h"
//#include "MBSFNAreaConfiguration-r9.h"
//#include "SCellToAddMod-r10.h"
//#include "AS-Config.h"
//#include "AS-Context.h"
#include "UE-NR-Capability.h"
#include "MeasResults.h"
#endif
//-------------------
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
/* TODO: be sure this include is correct.
* It solves a problem of compilation of the RRH GW,
* issue #186.
*/
#if !defined(ENABLE_ITTI)
# include "as_message.h"
#endif
#if defined(ENABLE_USE_MME)
# include "commonDef.h"
#endif
#if ENABLE_RAL
# include "collection/hashtable/obj_hashtable.h"
#endif
/*I will change the name of the structure for compile purposes--> hope not to undo this process*/
typedef unsigned int uid_NR_t;
#define UID_LINEAR_ALLOCATOR_BITMAP_SIZE_NR (((NUMBER_OF_UE_MAX_NR/8)/sizeof(unsigned int)) + 1)
typedef struct uid_linear_allocator_NR_s {
unsigned int bitmap[UID_LINEAR_ALLOCATOR_BITMAP_SIZE_NR];
} uid_allocator_NR_t;
#define PROTOCOL_RRC_CTXT_UE_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_RRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
#define PROTOCOL_RRC_CTXT_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_RRC_CTXT_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
#define UE_MODULE_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!!
#define UE_INDEX_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! used to be -1
typedef enum {
RRC_OK=0,
RRC_ConnSetup_failed,
RRC_PHY_RESYNCH,
RRC_Handover_failed,
RRC_HO_STARTED
} RRC_status_NR_t;
typedef enum UE_STATE_NR_e {
RRC_INACTIVE=0,
RRC_IDLE,
RRC_SI_RECEIVED,
RRC_CONNECTED,
RRC_RECONFIGURED,
RRC_HO_EXECUTION
} UE_STATE_NR_t;
typedef enum HO_STATE_NR_e {
HO_IDLE=0,
HO_MEASURMENT,
HO_PREPARE,
HO_CMD, // initiated by the src eNB
HO_COMPLETE // initiated by the target eNB
} HO_STATE_NR_t;
//#define NUMBER_OF_UE_MAX MAX_MOBILES_PER_RG
#define RRM_FREE(p) if ( (p) != NULL) { free(p) ; p=NULL ; }
#define RRM_MALLOC(t,n) (t *) malloc16( sizeof(t) * n )
#define RRM_CALLOC(t,n) (t *) malloc16( sizeof(t) * n)
#define RRM_CALLOC2(t,s) (t *) malloc16( s )
#define MAX_MEAS_OBJ 6
#define MAX_MEAS_CONFIG 6
#define MAX_MEAS_ID 6
#define PAYLOAD_SIZE_MAX 1024
#define RRC_BUF_SIZE 255
#define UNDEF_SECURITY_MODE 0xff
#define NO_SECURITY_MODE 0x20
/* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */
#define RRC_TRANSACTION_IDENTIFIER_NUMBER 3
typedef struct {
unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */
unsigned short max_transport_blocks; /*!< \brief Maximum PDU size in bytes provided by RLC to MAC layer interface */
unsigned long Guaranteed_bit_rate; /*!< \brief Guaranteed Bit Rate (average) to be offered by MAC layer scheduling*/
unsigned long Max_bit_rate; /*!< \brief Maximum Bit Rate that can be offered by MAC layer scheduling*/
uint8_t Delay_class; /*!< \brief Delay class offered by MAC layer scheduling*/
uint8_t Target_bler; /*!< \brief Target Average Transport Block Error rate*/
uint8_t Lchan_t; /*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/
} __attribute__ ((__packed__)) LCHAN_DESC_NR;
typedef struct UE_RRC_INFO_NR_s {
UE_STATE_NR_t State;
uint8_t SIB1systemInfoValueTag;
uint32_t SIStatus;
uint32_t SIcnt;
#if defined(Rel10) || defined(Rel14)
uint8_t MCCHStatus[8]; // MAX_MBSFN_AREA
#endif
uint8_t SIwindowsize; //!< Corresponds to the SIB1 si-WindowLength parameter. The unit is ms. Possible values are (final): 1,2,5,10,15,20,40
uint8_t handoverTarget;
//HO_STATE_t ho_state;
uint16_t SIperiod; //!< Corresponds to the SIB1 si-Periodicity parameter (multiplied by 10). Possible values are (final): 80,160,320,640,1280,2560,5120
unsigned short UE_index;
uint32_t T300_active;
uint32_t T300_cnt;
uint32_t T304_active;
uint32_t T304_cnt;
uint32_t T310_active;
uint32_t T310_cnt;
uint32_t N310_cnt;
uint32_t N311_cnt;
rnti_t rnti;
} __attribute__ ((__packed__)) UE_RRC_INFO_NR;
typedef struct UE_S_TMSI_NR_s {
boolean_t presence;
mme_code_t mme_code;
m_tmsi_t m_tmsi;
} __attribute__ ((__packed__)) UE_S_TMSI_NR;
typedef enum e_rab_satus_NR_e {
E_RAB_STATUS_NEW_NR,
E_RAB_STATUS_DONE_NR, // from the eNB perspective
E_RAB_STATUS_ESTABLISHED_NR, // get the reconfigurationcomplete form UE
E_RAB_STATUS_FAILED_NR,
} e_rab_status_NR_t;
typedef struct e_rab_param_NR_s {
e_rab_t param;
uint8_t status;
uint8_t xid; // transaction_id
} __attribute__ ((__packed__)) e_rab_param_NR_t;
typedef struct HANDOVER_INFO_NR_s {
uint8_t ho_prepare;
uint8_t ho_complete;
uint8_t modid_s; //module_idP of serving cell
uint8_t modid_t; //module_idP of target cell
uint8_t ueid_s; //UE index in serving cell
uint8_t ueid_t; //UE index in target cell
// NR not define at this moment
//AS_Config_t as_config; /* these two parameters are taken from 36.331 section 10.2.2: HandoverPreparationInformation-r8-IEs */
//AS_Context_t as_context; /* They are mandatory for HO */
uint8_t buf[RRC_BUF_SIZE]; /* ASN.1 encoded handoverCommandMessage */
int size; /* size of above message in bytes */
} HANDOVER_INFO_NR;
#define RRC_HEADER_SIZE_MAX 64
#define RRC_BUFFER_SIZE_MAX 1024
typedef struct {
char Payload[RRC_BUFFER_SIZE_MAX];
char Header[RRC_HEADER_SIZE_MAX];
char payload_size;
} RRC_BUFFER_NR;
#define RRC_BUFFER_SIZE_NR sizeof(RRC_BUFFER_NR)
typedef struct RB_INFO_NR_s {
uint16_t Rb_id; //=Lchan_id
LCHAN_DESC Lchan_desc[2];
//MAC_MEAS_REQ_ENTRY *Meas_entry; //may not needed for NB-IoT
} RB_INFO_NR;
typedef struct SRB_INFO_NR_s {
uint16_t Srb_id; //=Lchan_id
RRC_BUFFER Rx_buffer;
RRC_BUFFER Tx_buffer;
LCHAN_DESC Lchan_desc[2];
unsigned int Trans_id;
uint8_t Active;
} SRB_INFO_NR;
typedef struct RB_INFO_TABLE_ENTRY_NR_s {
RB_INFO_NR Rb_info;
uint8_t Active;
uint32_t Next_check_frame;
uint8_t Status;
} RB_INFO_TABLE_ENTRY_NR;
typedef struct SRB_INFO_TABLE_ENTRY_NR_s {
SRB_INFO_NR Srb_info;
uint8_t Active;
uint8_t Status;
uint32_t Next_check_frame;
} SRB_INFO_TABLE_ENTRY_NR;
typedef struct MEAS_REPORT_LIST_NR_s {
MeasId_t measId;
//CellsTriggeredList cellsTriggeredList;//OPTIONAL
uint32_t numberOfReportsSent;
} MEAS_REPORT_LIST_NR;
typedef struct HANDOVER_INFO_UE_NR_s {
PhysCellId_t targetCellId;
uint8_t measFlag;
} HANDOVER_INFO_UE_NR;
//NB-IoT eNB_RRC_UE_NB_IoT_s--(used as a context in eNB --> ue_context in rrc_eNB_ue_context)------
typedef struct gNB_RRC_UE_s {
uint8_t primaryCC_id;
//SCellToAddMod_t sCell_config[2];
SRB_ToAddModList_t* SRB_configList;//for SRB1 and SRB1bis
SRB_ToAddModList_t* SRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
DRB_ToAddModList_t* DRB_configList; //for all the DRBs
DRB_ToAddModList_t* DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER]; //for the configured DRBs of a xid
uint8_t DRB_active[8];//in LTE was 8
// NR not define at this moment
//struct PhysicalConfigDedicated* physicalConfigDedicated_NR;
struct SPS_Config* sps_Config;
MeasObjectToAddMod_t* MeasObj[MAX_MEAS_OBJ];
struct ReportConfigToAddMod* ReportConfig[MAX_MEAS_CONFIG];
struct QuantityConfig* QuantityConfig;
struct MeasIdToAddMod* MeasId[MAX_MEAS_ID];
// NR not define at this moment
//MAC_MainConfig_t* mac_MainConfig_NR;
MeasGapConfig_t* measGapConfig;
SRB_INFO_NR SI;
SRB_INFO_NR Srb0;
SRB_INFO_TABLE_ENTRY_NR Srb1;
SRB_INFO_TABLE_ENTRY_NR Srb2;
MeasConfig_t* measConfig;
HANDOVER_INFO_NR* handover_info;
#if defined(ENABLE_SECURITY)
/* KeNB as derived from KASME received from EPC */
uint8_t kenb[32];
#endif
/* Used integrity/ciphering algorithms */
//Specs. TS 38.331 V15.1.0 pag 432 Change position of chipering enumerative w.r.t previous version
e_CipheringAlgorithm ciphering_algorithm;
e_IntegrityProtAlgorithm integrity_algorithm;
uint8_t Status;
rnti_t rnti;
uint64_t random_ue_identity;
/* Information from UE RRC ConnectionRequest */
UE_S_TMSI_NR Initialue_identity_s_TMSI;
/* NR not define at this moment
EstablishmentCause_t establishment_cause_NR; //different set for NB-IoT
/* NR not define at this moment
/* Information from UE RRC ConnectionReestablishmentRequest */
//ReestablishmentCause_t reestablishment_cause_NR; //different set for NB_IoT
/* UE id for initial connection to S1AP */
uint16_t ue_initial_id;
/* Information from S1AP initial_context_setup_req */
uint32_t eNB_ue_s1ap_id :24;
security_capabilities_t security_capabilities;
/* Total number of e_rab already setup in the list */ //NAS list?
uint8_t setup_e_rabs;
/* Number of e_rab to be setup in the list */ //NAS list?
uint8_t nb_of_e_rabs;
/* list of e_rab to be setup by RRC layers */
e_rab_param_NR_t e_rab[NB_RB_MAX_NB_IOT];//[S1AP_MAX_E_RAB];
// LG: For GTPV1 TUNNELS
uint32_t enb_gtp_teid[S1AP_MAX_E_RAB];
transport_layer_addr_t enb_gtp_addrs[S1AP_MAX_E_RAB];
rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB];
//Which timers are referring to?
uint32_t ul_failure_timer;
uint32_t ue_release_timer;
//threshold of the release timer--> set in RRCConnectionRelease
uint32_t ue_release_timer_thres;
} gNB_RRC_UE_t;
//--------------------------------------------------------------------------------
typedef uid_NR_t ue_uid_t;
//generally variable called: ue_context_pP
typedef struct rrc_gNB_ue_context_s {
/* Tree related data */
RB_ENTRY(rrc_gNB_ue_context_s) entries;
/* Uniquely identifies the UE between MME and eNB within the eNB.
* This id is encoded on 24bits.
*/
rnti_t ue_id_rnti;
// another key for protocol layers but should not be used as a key for RB tree
ue_uid_t local_uid;
/* UE id for initial connection to S1AP */
struct gNB_RRC_UE_s ue_context; //context of ue in the e-nB
} rrc_gNB_ue_context_t;
//called "carrier"--> data from PHY layer
typedef struct {
// buffer that contains the encoded messages
uint8_t *MIB_NR;
uint8_t sizeof_MIB_NR;
/*
uint8_t *SIB1_NB_IoT;
uint8_t sizeof_SIB1_NB_IoT;
uint8_t *SIB23_NB_IoT;
uint8_t sizeof_SIB23_NB_IoT;
*/
/*
//not actually implemented in OAI
uint8_t *SIB4_NB_IoT;
uint8_t sizeof_SIB4_NB_IoT;
uint8_t *SIB5_NB_IoT;
uint8_t sizeof_SIB5_NB_IoT;
uint8_t *SIB14_NB_IoT;
uint8_t sizeof_SIB14_NB_IoT;
uint8_t *SIB16_NB_IoT;
uint8_t sizeof_SIB16_NB_IoT;
*/
//TS 36.331 V14.2.1
// uint8_t *SIB15_NB;
// uint8_t sizeof_SIB15_NB;
// uint8_t *SIB20_NB;
// uint8_t sizeof_SIB20_NB;
// uint8_t *SIB22_NB;
// uint8_t sizeof_SIB22_NB;
//implicit parameters needed
int Ncp; //cyclic prefix for DL
int Ncp_UL; //cyclic prefix for UL
int p_eNB; //number of tx antenna port
int p_rx_eNB; //number of receiving antenna ports
uint32_t dl_CarrierFreq; //detected by the UE
uint32_t ul_CarrierFreq; //detected by the UE
uint16_t physCellId; //not stored in the MIB-NB but is getting through NPSS/NSSS
//are the only static one (memory has been already allocated)
BCCH_BCH_Message_t mib_NR;
/*
BCCH_DL_SCH_Message_NR_t siblock1_NB_IoT; //SIB1-NB
BCCH_DL_SCH_Message_NR_t systemInformation_NB_IoT; //SI
*/
SIB1_t *sib1_NR;
/*
SIB2_t *sib2_NR;
SIB3_t *sib3_NR;
//not implemented yet
SIB4_t *sib4_NR;
SIB5_t *sib5_NR;
*/
SRB_INFO_NR SI;
SRB_INFO_NR Srb0;
uint8_t **MCCH_MESSAGE; // probably not needed , but added to remove errors
uint8_t sizeof_MCCH_MESSAGE[8];// but added to remove errors
SRB_INFO_NR MCCH_MESS[8];// MAX_MBSFN_AREA
/*future implementation TS 36.331 V14.2.1
SystemInformationBlockType15_NB_r14_t *sib15;
SystemInformationBlockType20_NB_r14_t *sib20;
SystemInformationBlockType22_NB_r14_t *sib22;
uint8_t SCPTM_flag;
uint8_t sizeof_SC_MCHH_MESS[];
SC_MCCH_Message_NR_t scptm;*/
} rrc_gNB_carrier_data_t;
//---------------------------------------------------
//---NR---(completely change)---------------------
typedef struct gNB_RRC_INST_s {
eth_params_t eth_params_s;
rrc_gNB_carrier_data_t carrier[MAX_NUM_CCs];
uid_allocator_NR_t uid_allocator; // for rrc_ue_head
RB_HEAD(rrc_ue_tree_NR_s, rrc_gNB_ue_context_s) rrc_ue_head; // ue_context tree key search by rnti
uint8_t HO_flag;
uint8_t Nb_ue;
hash_table_t *initial_id2_s1ap_ids; // key is content is rrc_ue_s1ap_ids_t
hash_table_t *s1ap_id2_s1ap_ids ; // key is content is rrc_ue_s1ap_ids_t
//RRC configuration
#if defined(ENABLE_ITTI)
gNB_RrcConfigurationReq configuration;//rrc_messages_types.h
#endif
// other PLMN parameters
/// Mobile country code
int mcc;
/// Mobile network code
int mnc;
/// number of mnc digits
int mnc_digit_length;
// other RAN parameters
int srb1_timer_poll_retransmit;
int srb1_poll_pdu;
int srb1_poll_byte;
int srb1_max_retx_threshold;
int srb1_timer_reordering;
int srb1_timer_status_prohibit;
int srs_enable[MAX_NUM_CCs];
} gNB_RRC_INST;
//#define RRC_HEADER_SIZE_MAX_NR 64
#define MAX_UE_CAPABILITY_SIZE_NR 255
//not needed for the moment
typedef struct OAI_UECapability_NR_s {
uint8_t sdu[MAX_UE_CAPABILITY_SIZE_NR];
uint8_t sdu_size;
////NR------
UE_NR_Capability_t UE_Capability_NR; //replace the UE_EUTRA_Capability of LTE
} OAI_UECapability_NR_t;
typedef struct UE_RRC_INST_NR_s {
Rrc_State_NR_t RrcState;
Rrc_Sub_State_NR_t RrcSubState;
# if defined(ENABLE_USE_MME)
plmn_t plmnID;
Byte_t rat;
as_nas_info_t initialNasMsg;
# endif
OAI_UECapability_NR_t *UECap;
uint8_t *UECapability;
uint8_t UECapability_size;
UE_RRC_INFO_NR Info[NB_SIG_CNX_UE];
SRB_INFO_NR Srb0[NB_SIG_CNX_UE];
SRB_INFO_TABLE_ENTRY_NR Srb1[NB_CNX_UE];
SRB_INFO_TABLE_ENTRY_NR Srb2[NB_CNX_UE];
HANDOVER_INFO_UE_NR HandoverInfoUe;
/*
uint8_t *SIB1[NB_CNX_UE];
uint8_t sizeof_SIB1[NB_CNX_UE];
uint8_t *SI[NB_CNX_UE];
uint8_t sizeof_SI[NB_CNX_UE];
uint8_t SIB1Status[NB_CNX_UE];
uint8_t SIStatus[NB_CNX_UE];
SIB1_t *sib1[NB_CNX_UE];
SystemInformation_t *si[NB_CNX_UE]; //!< Temporary storage for an SI message. Decoding happens in decode_SI().
SystemInformationBlockType2_t *sib2[NB_CNX_UE];
/*
SystemInformationBlockType3_t *sib3[NB_CNX_UE];
SystemInformationBlockType4_t *sib4[NB_CNX_UE];
SystemInformationBlockType5_t *sib5[NB_CNX_UE];
SystemInformationBlockType6_t *sib6[NB_CNX_UE];
SystemInformationBlockType7_t *sib7[NB_CNX_UE];
SystemInformationBlockType8_t *sib8[NB_CNX_UE];
SystemInformationBlockType9_t *sib9[NB_CNX_UE];
SystemInformationBlockType10_t *sib10[NB_CNX_UE];
SystemInformationBlockType11_t *sib11[NB_CNX_UE];
#if defined(Rel10) || defined(Rel14)
uint8_t MBMS_flag;
uint8_t *MCCH_MESSAGE[NB_CNX_UE];
uint8_t sizeof_MCCH_MESSAGE[NB_CNX_UE];
uint8_t MCCH_MESSAGEStatus[NB_CNX_UE];
MBSFNAreaConfiguration_r9_t *mcch_message[NB_CNX_UE];
SystemInformationBlockType12_r9_t *sib12[NB_CNX_UE];
SystemInformationBlockType13_r9_t *sib13[NB_CNX_UE];
#endif
#ifdef CBA
uint8_t num_active_cba_groups;
uint16_t cba_rnti[NUM_MAX_CBA_GROUP];
#endif
uint8_t num_srb;
struct SRB_ToAddMod *SRB1_config[NB_CNX_UE];
struct SRB_ToAddMod *SRB2_config[NB_CNX_UE];
struct DRB_ToAddMod *DRB_config[NB_CNX_UE][8];
rb_id_t *defaultDRB; // remember the ID of the default DRB
MeasObjectToAddMod_t *MeasObj[NB_CNX_UE][MAX_MEAS_OBJ];
struct ReportConfigToAddMod *ReportConfig[NB_CNX_UE][MAX_MEAS_CONFIG];
*/
struct QuantityConfig *QuantityConfig[NB_CNX_UE];
/*
struct MeasIdToAddMod *MeasId[NB_CNX_UE][MAX_MEAS_ID];
MEAS_REPORT_LIST *measReportList[NB_CNX_UE][MAX_MEAS_ID];
uint32_t measTimer[NB_CNX_UE][MAX_MEAS_ID][6]; // 6 neighboring cells
RSRP_Range_t s_measure;
struct MeasConfig__speedStatePars *speedStatePars;
struct PhysicalConfigDedicated *physicalConfigDedicated[NB_CNX_UE];
struct SPS_Config *sps_Config[NB_CNX_UE];
MAC_MainConfig_t *mac_MainConfig[NB_CNX_UE];
MeasGapConfig_t *measGapConfig[NB_CNX_UE];
double filter_coeff_rsrp; // [7] ???
double filter_coeff_rsrq; // [7] ???
float rsrp_db[7];
float rsrq_db[7];
float rsrp_db_filtered[7];
float rsrq_db_filtered[7];
#if ENABLE_RAL
obj_hash_table_t *ral_meas_thresholds;
ral_transaction_id_t scan_transaction_id;
#endif
#if defined(ENABLE_SECURITY)
// KeNB as computed from parameters within USIM card //
uint8_t kenb[32];
#endif
// Used integrity/ciphering algorithms //
CipheringAlgorithm_r12_t ciphering_algorithm;
e_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
*/
}UE_RRC_INST_NR;
#include "proto_NR.h" //should be put here otherwise compilation error
#endif
/** @} */
/*
* 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 vars.h
* \brief rrc external vars
* \author Navid Nikaein and Raymond Knopp
* \date 2011
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr
*/
#ifndef __OPENAIR_RRC_EXTERN_H__
#define __OPENAIR_RRC_EXTERN_H__
#include "defs.h"
#include "COMMON/mac_rrc_primitives.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/RLC/rlc.h"
extern UE_RRC_INST *UE_rrc_inst;
#include "LAYER2/MAC/extern.h"
extern uint8_t DRB2LCHAN[8];
extern LogicalChannelConfig_t SRB1_logicalChannelConfig_defaultValue;
extern LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue;
#ifndef PHY_EMUL
#ifndef PHYSIM
//#define NB_INST 1
#else
extern unsigned char NB_INST;
#endif
extern unsigned char NB_eNB_INST;
extern unsigned char NB_UE_INST;
extern unsigned short NODE_ID[1];
extern void* bigphys_malloc(int);
#endif
//CONSTANTS
extern rlc_info_t Rlc_info_um,Rlc_info_am_config;
//uint8_t RACH_TIME_ALLOC;
extern uint16_t RACH_FREQ_ALLOC;
//uint8_t NB_RACH;
extern LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC,DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
extern MAC_MEAS_T BCCH_MEAS_TRIGGER,CCCH_MEAS_TRIGGER,DCCH_MEAS_TRIGGER,DTCH_MEAS_TRIGGER;
extern MAC_AVG_T BCCH_MEAS_AVG,CCCH_MEAS_AVG,DCCH_MEAS_AVG, DTCH_MEAS_AVG;
extern uint16_t T300[8];
extern uint16_t T310[8];
extern uint16_t N310[8];
extern uint16_t N311[8];
extern uint32_t T304[8];
extern uint32_t timeToTrigger_ms[16];
extern float RSRP_meas_mapping[98];
extern float RSRQ_meas_mapping[35];
extern UE_PF_PO_t UE_PF_PO[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
extern pthread_mutex_t ue_pf_po_mutex;
extern uint16_t reestablish_rnti_map[NUMBER_OF_UE_MAX][2];
#endif
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* 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_types.h
* \brief rrc types and subtypes
* \author Navid Nikaein and Raymond Knopp
* \date 2011 - 2014, 2018
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr
*/
#ifndef RRC_TYPES_NR_H_
#define RRC_TYPES_NR_H_
typedef enum Rrc_State_NR_e {
RRC_STATE_INACTIVE_NR=0,
RRC_STATE_IDLE_NR,
RRC_STATE_CONNECTED_NR,
RRC_STATE_FIRST_NR = RRC_STATE_INACTIVE_NR,
RRC_STATE_LAST_NR = RRC_STATE_CONNECTED_NR,
} Rrc_State_NR_t;
typedef enum Rrc_Sub_State_NR_e {
RRC_SUB_STATE_INACTIVE_NR=0,
RRC_SUB_STATE_IDLE_SEARCHING_NR,
RRC_SUB_STATE_IDLE_RECEIVING_SIB_NR,
RRC_SUB_STATE_IDLE_SIB_COMPLETE_NR,
RRC_SUB_STATE_IDLE_CONNECTING_NR,
RRC_SUB_STATE_IDLE_NR,
RRC_SUB_STATE_CONNECTED_NR,
RRC_SUB_STATE_INACTIVE_FIRST_NB_IoT = RRC_SUB_STATE_INACTIVE_NR,
RRC_SUB_STATE_INACTIVE_LAST_NB_IoT = RRC_SUB_STATE_INACTIVE_NR,
RRC_SUB_STATE_IDLE_FIRST_NB_IoT = RRC_SUB_STATE_IDLE_SEARCHING_NR,
RRC_SUB_STATE_IDLE_LAST_NB_IoT = RRC_SUB_STATE_IDLE_NR,
RRC_SUB_STATE_CONNECTED_FIRST_NB_IoT = RRC_SUB_STATE_CONNECTED_NR,
RRC_SUB_STATE_CONNECTED_LAST_NB_IoT = RRC_SUB_STATE_CONNECTED_NR,
} Rrc_Sub_State_NR_t;
#endif /* RRC_TYPES_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment