Commit 3a156e01 authored by Matthieu Kanj's avatar Matthieu Kanj

code separation + renaming + creation of two new files:

openair2/RRC/LITE/rrc_eNB_UE_context_NB_IoT.c
openair2/RRC/LITE/rrc_eNB_UE_context_NB_IoT.h
parent 037eb931
......@@ -1151,6 +1151,7 @@ set(L2_SRC
${RRC_DIR}/rrc_eNB_NB_IoT.c
${RRC_DIR}/rrc_eNB_S1AP.c
${RRC_DIR}/rrc_eNB_UE_context.c
${RRC_DIR}/rrc_eNB_UE_context_NB_IoT.c
${RRC_DIR}/rrc_common.c
${RRC_DIR}/rrc_common_NB_IoT.c
${RRC_DIR}/L2_interface.c
......
......@@ -1071,7 +1071,7 @@ int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *eNB)
uint8_t i;
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
for (i=0; i<NUMBER_OF_UE_MAX_NB_IoT; i++) {
if ((eNB->dlsch[i]) &&
(eNB->dlsch[i][0]) &&
(eNB->dlsch[i][0]->rnti==rnti)) {
......
......@@ -66,6 +66,40 @@
/*!\brief Maximum number of logical chanels */
#define MAX_NUM_LCID_NB_IoT 11
/*!\brief UE ULSCH scheduling states*/
typedef enum {
S_UL_NONE_NB_IoT =0,
S_UL_WAITING_NB_IoT,
S_UL_SCHEDULED_NB_IoT,
S_UL_BUFFERED_NB_IoT,
S_UL_NUM_STATUS_NB_IoT
} UE_ULSCH_STATUS_NB_IoT;
/*!\brief UE DLSCH scheduling states*/
typedef enum {
S_DL_NONE_NB_IoT =0,
S_DL_WAITING_NB_IoT,
S_DL_SCHEDULED_NB_IoT,
S_DL_BUFFERED_NB_IoT,
S_DL_NUM_STATUS_NB_IoT
} UE_DLSCH_STATUS_NB_IoT;
/*! \brief temporary struct for ULSCH sched */
typedef struct {
rnti_t rnti;
uint16_t subframe;
uint16_t serving_num;
UE_ULSCH_STATUS_NB_IoT status;
} eNB_ULSCH_INFO_NB_IoT;
/*! \brief temp struct for DLSCH sched */
typedef struct {
rnti_t rnti;
uint16_t weight;
uint16_t subframe;
uint16_t serving_num;
UE_DLSCH_STATUS_NB_IoT status;
} eNB_DLSCH_INFO_NB_IoT;
/*! \brief Downlink SCH PDU Structure */
typedef struct {
int8_t payload[8][SCH_PAYLOAD_SIZE_MAX_NB_IoT];
......
......@@ -53,6 +53,8 @@
#include "LAYER2/MAC/defs_NB_IoT.h"
#include "LAYER2/MAC/proto_NB_IoT.h"
#include "LAYER2/MAC/extern_NB_IoT.h"
#include "LAYER2/MAC/vars_NB_IoT.h" //////////////////// to comment during test
//#include "openair2/COMMON/platform_types.h"
//#include "LAYER2/MAC/pre_processor.c"
//#include "pdcp.h"
......@@ -139,12 +141,14 @@ printf("MAC: remove UE %d rnti %x\n", UE_id, rntiP);
UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID3] = 0;*/
//UE_list->UE_template[pCC_id][UE_id].ul_SR = 0;
UE_list->UE_template[pCC_id][UE_id].rnti = NOT_A_RNTI;
UE_list->UE_template[pCC_id][UE_id].ul_active = FALSE;
eNB_ulsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI;
eNB_ulsch_info[mod_idP][pCC_id][UE_id].status = S_UL_NONE;
eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI;
eNB_dlsch_info[mod_idP][pCC_id][UE_id].status = S_DL_NONE;
eNB_ulsch_info_NB_IoT[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI;
eNB_ulsch_info_NB_IoT[mod_idP][pCC_id][UE_id].status = S_UL_NONE_NB_IoT;
eNB_dlsch_info_NB_IoT[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI;
eNB_dlsch_info_NB_IoT[mod_idP][pCC_id][UE_id].status = S_DL_NONE_NB_IoT;
//NB_mac_phy_remove_ue(mod_idP,rntiP);
......
......@@ -265,7 +265,7 @@ void rx_sdu_NB_IoT(const module_id_t enb_mod_idP,
// kill RA procedure
}
if (Is_rrc_nb_iot_registered == 1)
if (Is_rrc_registered_NB_IoT == 1)
//MP: send directly the information to the RRC in case of CCCH (SRB0)
mac_rrc_data_ind_eNB_NB_IoT(
......
......@@ -45,13 +45,13 @@
#include "PHY_INTERFACE/defs.h" // should be replaced by PHY_INTERFACE/defs_NB_IoT.h (create MAC_xface for NB_IoT)
//#include "RRC/LITE/defs_NB_IoT.h"
#ifdef NB_IOT
//#ifdef NB_IOT
#include "LAYER2/MAC/defs_NB_IoT.h"
//NB-IoT
extern IF_Module_t *if_inst;
extern eNB_MAC_INST_NB_IoT *eNB_mac_inst_NB_IoT;
#endif
//#endif
extern const uint32_t BSR_TABLE_NB_IoT[BSR_TABLE_SIZE_NB_IoT];
// //extern uint32_t EBSR_Level[63];
......@@ -73,8 +73,8 @@ extern const uint32_t BSR_TABLE_NB_IoT[BSR_TABLE_SIZE_NB_IoT];
// extern uint8_t Is_rrc_registered;
extern eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
extern eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
extern eNB_ULSCH_INFO_NB_IoT eNB_ulsch_info_NB_IoT[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX_NB_IoT]; // eNBxUE = 8x8
extern eNB_DLSCH_INFO_NB_IoT eNB_dlsch_info_NB_IoT[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX_NB_IoT]; // eNBxUE = 8x8
......@@ -132,7 +132,7 @@ extern EMULATION_VARS *Emul_vars;
//NB-IoT---------------------------------
extern eNB_MAC_INST_NB_IoT *eNB_mac_inst_NB_IoT;
extern uint8_t Is_rrc_nb_iot_registered;
extern uint8_t Is_rrc_registered_NB_IoT;
......
......@@ -30,10 +30,10 @@
*/
#include "asn1_constants.h"
#include "defs_NB_IoT.h"
#include "proto_NB_IoT.h"
//#include "extern.h"
//#include "asn1_constants.h"
#include "LAYER2/MAC/defs_NB_IoT.h"
#include "LAYER2/MAC/proto_NB_IoT.h"
#include "LAYER2/MAC/extern_NB_IoT.h"
#include "RRC/LITE/proto_NB_IoT.h"
......@@ -134,7 +134,7 @@ int mac_top_init_NB_IoT()
}
if (Is_rrc_nb_iot_registered == 1) {
if (Is_rrc_registered_NB_IoT == 1) {
LOG_I(MAC,"[MAIN] calling RRC NB-IoT\n");
#ifndef CELLULAR //nothing to be done yet for cellular
openair_rrc_top_init_eNB_NB_IoT();
......@@ -198,9 +198,9 @@ int l2_init_eNB_NB_IoT()
LOG_I(MAC,"[MAIN] MAC_INIT_GLOBAL_PARAM NB-IoT IN...\n");
Is_rrc_nb_iot_registered=0;
Is_rrc_registered_NB_IoT=0;
mac_init_global_param_NB_IoT();
Is_rrc_nb_iot_registered=1;
Is_rrc_registered_NB_IoT=1;
LOG_D(MAC,"[MAIN][NB-IoT] ALL INIT OK\n");
......
......@@ -53,6 +53,9 @@ const uint32_t BSR_TABLE_NB_IoT[BSR_TABLE_SIZE_NB_IoT]= {0,10,12,14,17,19,22,26,
16507,19325,22624,26487,31009,36304,42502,49759,58255,68201,79846,93479,109439, 128125,150000, 300000
};
eNB_ULSCH_INFO_NB_IoT eNB_ulsch_info_NB_IoT[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX_NB_IoT]; // eNBxUE = 8x8
eNB_DLSCH_INFO_NB_IoT eNB_dlsch_info_NB_IoT[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX_NB_IoT]; // eNBxUE = 8x8
#endif
......
......@@ -376,7 +376,7 @@ protected_pdcp_fifo(void pdcp_fifo_read_input_sdus_from_otg (
const protocol_ctxt_t* const ctxt_pP);)
//NB-IoT
public_pdcp(void pdcp_layer_init_NB(void);)
public_pdcp(void pdcp_layer_init_NB_IoT(void);)
......
......@@ -39,7 +39,7 @@
#include "LAYER2/MAC/extern.h"
#include "UTIL/LOG/log.h"
#include "UTIL/OCG/OCG_vars.h"
#include "rrc_eNB_UE_context.h"
#include "RRC/LITE/rrc_eNB_UE_context_NB_IoT.h"
#include "pdcp_primitives.h"
#include "pdcp.h"
#include "pdcp_util.h"
......@@ -83,7 +83,7 @@ typedef boolean_t mib_flag_t;
//XXX access of protected variables in pdcp.h
extern unsigned int pdcp_eNB_UE_instance_to_rnti_index;
extern rnti_t pdcp_eNB_UE_instance_to_rnti[NUMBER_OF_UE_MAX];
extern rnti_t pdcp_eNB_UE_instance_to_rnti[NUMBER_OF_UE_MAX_NB_IoT];
extern list_t pdcp_sdu_list;
//extern struct mac_data_req rlc_am_mac_data_request (const protocol_ctxt_t* const ctxtP,void * const rlc_pP);
//extern eNB_MAC_INST_NB_IoT *eNB;
......@@ -147,18 +147,18 @@ typedef struct eutra_bandentry_NB_s {
uint32_t dl_min;
uint32_t dl_max;
uint32_t N_OFFs_DL;
} eutra_bandentry_NB_t;
} eutra_bandentry_NB_IoT_t;
typedef struct band_info_s {
int nbands;
eutra_bandentry_NB_t band_info[100];
eutra_bandentry_NB_IoT_t band_info[100];
} band_info_t;
//TS 36.101 Table 7.7.3-1 for the EARFCN values (Last column of the table Noff_DL = lowest defined EARFCN value for the corresponding band)
//TS 36.101 Table 5.5-1 for the Operating bands + 5.5F for the operating bands of category NB1 and NB2
//frequency are in 100KHz in order to consider all unsigned int
static const eutra_bandentry_NB_t eutra_bandtable[] = {
static const eutra_bandentry_NB_IoT_t eutra_bandtable[] = {
//[BAND] [FUL_low] [FUL_hi] [FDL_low] [FDL_hig] [NOFF_DL]
{ 1, 19200, 19800, 21100, 21700, 0},
{ 2, 18500, 19100, 19300, 19900, 6000},
......@@ -338,7 +338,7 @@ void config_mib_fapi_NB_IoT(
}
void config_sib2_NB_fapi(
void config_sib2_fapi_NB_IoT(
int physCellId,
RadioResourceConfigCommonSIB_NB_r13_t *radioResourceConfigCommon
)
......@@ -678,7 +678,7 @@ int rrc_mac_config_req_eNB_NB_IoT(
if (ul_CarrierFreq>0) eNB_mac_inst_NB_IoT[Mod_idP].common_channels[CC_idP].ul_CarrierFreq = ul_CarrierFreq;
config_sib2_NB_fapi(physCellId,radioResourceConfigCommon);
config_sib2_fapi_NB_IoT(physCellId,radioResourceConfigCommon);
}
......@@ -710,7 +710,7 @@ int rrc_mac_config_req_eNB_NB_IoT(
//XXX this parameters seems to be not defined by FAPi specs
//this are UE specific information that should be transmitted to the PHY layer
//use UE-specific structure at phy layer where to store this information (NPDCCH structure) this structure will be scrambled based on the rnti
config_INFO->rnti = UE_RNTI(Mod_idP, UE_id);
config_INFO->rnti = UE_RNTI_NB_IoT(Mod_idP, UE_id);
config_INFO->extra_phy_parms.npdcch_NumRepetitions = physicalConfigDedicated->npdcch_ConfigDedicated_r13->npdcch_NumRepetitions_r13; //Rmax
config_INFO->extra_phy_parms.npdcch_Offset_USS = physicalConfigDedicated->npdcch_ConfigDedicated_r13->npdcch_Offset_USS_r13;
config_INFO->extra_phy_parms.npdcch_StartSF_USS = physicalConfigDedicated->npdcch_ConfigDedicated_r13->npdcch_StartSF_USS_r13;
......@@ -748,7 +748,7 @@ uint32_t is_SIB1_NB_IoT(
{
uint8_t nb_rep=0; // number of sib1-nb repetitions within the 256 radio frames
uint32_t sib1_startFrame;
uint32_t sib1_NB_period = 256;//from specs TS 36.331 (rf)
uint32_t sib1_period_NB_IoT = 256;//from specs TS 36.331 (rf)
uint8_t index;
int offset;
int period_nb; // the number of the actual period over the 1024 frames
......@@ -787,7 +787,7 @@ uint32_t is_SIB1_NB_IoT(
//SIB1-NB period number
period_nb = (int) frameP/sib1_NB_period;
period_nb = (int) frameP/sib1_period_NB_IoT;
//number of repetitions
......@@ -824,7 +824,7 @@ uint32_t is_SIB1_NB_IoT(
//calculate offset between SIB1-NB repetitions (repetitions are equally spaced)
offset = (sib1_NB_period-(16*nb_rep))/nb_rep;
offset = (sib1_period_NB_IoT-(16*nb_rep))/nb_rep;
/*
* possible offset results (even numbers):
* nb_rep= 4 ---> offset = 48
......@@ -909,7 +909,7 @@ uint8_t is_SIB1_start_NB_IoT(
{
uint8_t nb_rep=0; // number of sib1-nb repetitions within the 256 radio frames
uint32_t sib1_startFrame;
// uint32_t sib1_NB_period = 256;//from specs TS 36.331 (rf)
// uint32_t sib1_period_NB_IoT = 256;//from specs TS 36.331 (rf)
// uint8_t index;
// int offset;
// int period_nb; // the number of the actual period over the 1024 frames
......@@ -1267,7 +1267,7 @@ int8_t mac_rrc_data_req_eNB_NB_IoT(
//defined in L2_interface
//called by rx_sdu only in case of CCCH message (e.g RRCConnectionRequest-NB - SRB0) --> is used for a direct communication between MAC and RRC
int8_t NB_mac_rrc_data_ind_eNB(
int8_t mac_rrc_data_ind_eNB_NB_IoT(
const module_id_t module_idP,
const int CC_id,
const frame_t frameP,
......@@ -1406,10 +1406,10 @@ printf("MAC: remove UE %d rnti %x\n", UE_id, rntiP);
UE_list->UE_template[pCC_id][UE_id].rnti = NOT_A_RNTI;
UE_list->UE_template[pCC_id][UE_id].ul_active = FALSE;
eNB_ulsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI;
eNB_ulsch_info[mod_idP][pCC_id][UE_id].status = S_UL_NONE;
eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI;
eNB_dlsch_info[mod_idP][pCC_id][UE_id].status = S_DL_NONE;
eNB_ulsch_info_NB_IoT[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI;
eNB_ulsch_info_NB_IoT[mod_idP][pCC_id][UE_id].status = S_UL_NONE;
eNB_dlsch_info_NB_IoT[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI;
eNB_dlsch_info_NB_IoT[mod_idP][pCC_id][UE_id].status = S_DL_NONE;
mac_phy_remove_ue(mod_idP,rntiP); //PHY/defs.h
......@@ -1480,11 +1480,11 @@ int mac_eNB_get_rrc_status_NB_IoT(
//defined in pdcp_security.c
static
uint32_t pdcp_get_next_count_tx_NB(pdcp_t *const pdcp_pP, const srb_flag_t srb_flagP, const uint16_t pdcp_sn);
uint32_t pdcp_get_next_count_tx_NB_IoT(pdcp_t *const pdcp_pP, const srb_flag_t srb_flagP, const uint16_t pdcp_sn);
//-----------------------------------------------------------------------------
static
uint32_t pdcp_get_next_count_tx_NB(
uint32_t pdcp_get_next_count_tx_NB_IoT(
pdcp_t * const pdcp_pP,
const srb_flag_t srb_flagP,
const uint16_t pdcp_sn
......@@ -1533,7 +1533,7 @@ int pdcp_apply_security_NB_IoT(
encrypt_params.direction = (pdcp_pP->is_ue == 1) ? SECU_DIRECTION_UPLINK : SECU_DIRECTION_DOWNLINK;
encrypt_params.bearer = rb_id - 1;
encrypt_params.count = pdcp_get_next_count_tx_NB(pdcp_pP, srb_flagP, current_sn); //XXX (warning) because static defined in pdcp_security.c
encrypt_params.count = pdcp_get_next_count_tx_NB_IoT(pdcp_pP, srb_flagP, current_sn); //XXX (warning) because static defined in pdcp_security.c
encrypt_params.key_length = 16;
if (srb_flagP) {
......
......@@ -173,10 +173,10 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
asn_enc_rval_t enc_rval;
PLMN_IdentityInfo_NB_r13_t PLMN_identity_info_NB;
PLMN_IdentityInfo_NB_r13_t PLMN_identity_info_NB_IoT;
MCC_MNC_Digit_t dummy_mcc[3],dummy_mnc[3];
SchedulingInfo_NB_r13_t schedulingInfo_NB;
SIB_Type_NB_r13_t sib_type_NB;
SchedulingInfo_NB_r13_t schedulingInfo_NB_IoT;
SIB_Type_NB_r13_t sib_type_NB_IoT;
long* attachWithoutPDN_Connectivity = NULL;
......@@ -208,15 +208,15 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
sib1_NB_IoT->hyperSFN_MSB_r13.size = 1;
sib1_NB_IoT->hyperSFN_MSB_r13.bits_unused = 0;
memset(&PLMN_identity_info_NB,0,sizeof(PLMN_IdentityInfo_NB_r13_t));
memset(&schedulingInfo_NB,0,sizeof(SchedulingInfo_NB_r13_t));
memset(&sib_type_NB,0,sizeof(SIB_Type_NB_r13_t));
memset(&PLMN_identity_info_NB_IoT,0,sizeof(PLMN_IdentityInfo_NB_r13_t));
memset(&schedulingInfo_NB_IoT,0,sizeof(SchedulingInfo_NB_r13_t));
memset(&sib_type_NB_IoT,0,sizeof(SIB_Type_NB_r13_t));
PLMN_identity_info_NB.plmn_Identity_r13.mcc = CALLOC(1,sizeof(*PLMN_identity_info_NB.plmn_Identity_r13.mcc));
memset(PLMN_identity_info_NB.plmn_Identity_r13.mcc,0,sizeof(*PLMN_identity_info_NB.plmn_Identity_r13.mcc));
PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc = CALLOC(1,sizeof(*PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc));
memset(PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc,0,sizeof(*PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc));
asn_set_empty(&PLMN_identity_info_NB.plmn_Identity_r13.mcc->list);//.size=0;
asn_set_empty(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list);//.size=0;
//left as it is???
#if defined(ENABLE_ITTI)
......@@ -228,12 +228,12 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
dummy_mcc[1] = 0;
dummy_mcc[2] = 1;
#endif
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB.plmn_Identity_r13.mcc->list,&dummy_mcc[0]);
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB.plmn_Identity_r13.mcc->list,&dummy_mcc[1]);
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB.plmn_Identity_r13.mcc->list,&dummy_mcc[2]);
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list,&dummy_mcc[0]);
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list,&dummy_mcc[1]);
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mcc->list,&dummy_mcc[2]);
PLMN_identity_info_NB.plmn_Identity_r13.mnc.list.size=0;
PLMN_identity_info_NB.plmn_Identity_r13.mnc.list.count=0;
PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list.size=0;
PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list.count=0;
#if defined(ENABLE_ITTI)
......@@ -259,20 +259,20 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
dummy_mnc[1] = 1;
dummy_mnc[2] = 0xf;
#endif
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB.plmn_Identity_r13.mnc.list,&dummy_mnc[0]);
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB.plmn_Identity_r13.mnc.list,&dummy_mnc[1]);
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list,&dummy_mnc[0]);
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list,&dummy_mnc[1]);
if (dummy_mnc[2] != 0xf) {
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB.plmn_Identity_r13.mnc.list,&dummy_mnc[2]);
ASN_SEQUENCE_ADD(&PLMN_identity_info_NB_IoT.plmn_Identity_r13.mnc.list,&dummy_mnc[2]);
}
//still set to "notReserved" as in the previous case
PLMN_identity_info_NB.cellReservedForOperatorUse_r13=PLMN_IdentityInfo_NB_r13__cellReservedForOperatorUse_r13_notReserved;
PLMN_identity_info_NB_IoT.cellReservedForOperatorUse_r13=PLMN_IdentityInfo_NB_r13__cellReservedForOperatorUse_r13_notReserved;
*attachWithoutPDN_Connectivity = 0;
PLMN_identity_info_NB.attachWithoutPDN_Connectivity_r13 = attachWithoutPDN_Connectivity;
PLMN_identity_info_NB_IoT.attachWithoutPDN_Connectivity_r13 = attachWithoutPDN_Connectivity;
ASN_SEQUENCE_ADD(&sib1_NB_IoT->cellAccessRelatedInfo_r13.plmn_IdentityList_r13.list,&PLMN_identity_info_NB);
ASN_SEQUENCE_ADD(&sib1_NB_IoT->cellAccessRelatedInfo_r13.plmn_IdentityList_r13.list,&PLMN_identity_info_NB_IoT);
// 16 bits = 2 byte
sib1_NB_IoT->cellAccessRelatedInfo_r13.trackingAreaCode_r13.buf = MALLOC(2); //MALLOC works in byte
......@@ -346,9 +346,9 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
//FIXME which value to set?
schedulingInfo_NB.si_Periodicity_r13=SchedulingInfo_NB_r13__si_Periodicity_r13_rf64;
schedulingInfo_NB.si_RepetitionPattern_r13=SchedulingInfo_NB_r13__si_RepetitionPattern_r13_every2ndRF; //This Indicates the starting radio frames within the SI window used for SI message transmission.
schedulingInfo_NB.si_TB_r13= SchedulingInfo_NB_r13__si_TB_r13_b208;//208 bits
schedulingInfo_NB_IoT.si_Periodicity_r13=SchedulingInfo_NB_r13__si_Periodicity_r13_rf64;
schedulingInfo_NB_IoT.si_RepetitionPattern_r13=SchedulingInfo_NB_r13__si_RepetitionPattern_r13_every2ndRF; //This Indicates the starting radio frames within the SI window used for SI message transmission.
schedulingInfo_NB_IoT.si_TB_r13= SchedulingInfo_NB_r13__si_TB_r13_b208;//208 bits
//from ASN1 tools we have seen that sib2 + sib3 we are always below 200 bits so we use this si_TB size.
//from the specs the SI-message will be transmitted in 8 subframe = 8ms (pag 590 TS 36.331)
......@@ -357,10 +357,10 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
* in the first SystemInformation message
* listed in the schedulingInfoList list.
* */
sib_type_NB=SIB_Type_NB_r13_sibType3_NB_r13;
sib_type_NB_IoT=SIB_Type_NB_r13_sibType3_NB_r13;
ASN_SEQUENCE_ADD(&schedulingInfo_NB.sib_MappingInfo_r13.list,&sib_type_NB);
ASN_SEQUENCE_ADD(&sib1_NB_IoT->schedulingInfoList_r13.list,&schedulingInfo_NB);
ASN_SEQUENCE_ADD(&schedulingInfo_NB_IoT.sib_MappingInfo_r13.list,&sib_type_NB_IoT);
ASN_SEQUENCE_ADD(&sib1_NB_IoT->schedulingInfoList_r13.list,&schedulingInfo_NB_IoT);
#if defined(ENABLE_ITTI)
......@@ -426,7 +426,7 @@ uint8_t do_SIB23_NB_IoT(uint8_t Mod_id,
SystemInformationBlockType3_NB_r13_t *sib3_NB_IoT;
asn_enc_rval_t enc_rval;
RACH_Info_NB_r13_t rach_Info_NB;
RACH_Info_NB_r13_t rach_Info_NB_IoT;
NPRACH_Parameters_NB_r13_t nprach_parameters;
//optional
......@@ -491,10 +491,10 @@ uint8_t do_SIB23_NB_IoT(uint8_t Mod_id,
sib2_NB_IoT->radioResourceConfigCommon_r13.rach_ConfigCommon_r13.powerRampingParameters_r13.preambleInitialReceivedTargetPower =
configuration->rach_preambleInitialReceivedTargetPower_NB[CC_id];
rach_Info_NB.ra_ResponseWindowSize_r13 = configuration->rach_raResponseWindowSize_NB[CC_id];
rach_Info_NB.mac_ContentionResolutionTimer_r13 = configuration-> rach_macContentionResolutionTimer_NB[CC_id];
rach_Info_NB_IoT.ra_ResponseWindowSize_r13 = configuration->rach_raResponseWindowSize_NB[CC_id];
rach_Info_NB_IoT.mac_ContentionResolutionTimer_r13 = configuration-> rach_macContentionResolutionTimer_NB[CC_id];
//rach_infoList max size = maxNPRACH-Resources-NB-r13 = 3
ASN_SEQUENCE_ADD(&sib2_NB_IoT->radioResourceConfigCommon_r13.rach_ConfigCommon_r13.rach_InfoList_r13.list,&rach_Info_NB);
ASN_SEQUENCE_ADD(&sib2_NB_IoT->radioResourceConfigCommon_r13.rach_ConfigCommon_r13.rach_InfoList_r13.list,&rach_Info_NB_IoT);
//TS 36.331 pag 614 --> if not present the value to infinity sould be used
*connEstFailOffset = 0;
......@@ -665,8 +665,8 @@ uint8_t do_RRCConnectionSetup_NB_IoT(
uint8_t* const buffer, //Srb0.Tx_buffer.Payload
const uint8_t Transaction_id,
const NB_IoT_DL_FRAME_PARMS* const frame_parms, // maybe not used
SRB_ToAddModList_NB_r13_t** SRB_configList_NB, //for both SRB1bis and SRB1
struct PhysicalConfigDedicated_NB_r13** physicalConfigDedicated_NB
SRB_ToAddModList_NB_r13_t** SRB_configList_NB_IoT, //for both SRB1bis and SRB1
struct PhysicalConfigDedicated_NB_r13** physicalConfigDedicated_NB_IoT
)
{
......@@ -686,26 +686,26 @@ uint8_t do_RRCConnectionSetup_NB_IoT(
// struct SRB_ToAddMod_NB_r13__rlc_Config_r13* SRB1_rlc_config_NB = NULL;
// struct SRB_ToAddMod_NB_r13__logicalChannelConfig_r13* SRB1_lchan_config_NB = NULL;
struct SRB_ToAddMod_NB_r13* SRB1bis_config_NB = NULL;
struct SRB_ToAddMod_NB_r13__rlc_Config_r13* SRB1bis_rlc_config_NB = NULL;
struct SRB_ToAddMod_NB_r13__logicalChannelConfig_r13* SRB1bis_lchan_config_NB = NULL;
struct SRB_ToAddMod_NB_r13* SRB1bis_config_NB_IoT = NULL;
struct SRB_ToAddMod_NB_r13__rlc_Config_r13* SRB1bis_rlc_config_NB_IoT = NULL;
struct SRB_ToAddMod_NB_r13__logicalChannelConfig_r13* SRB1bis_lchan_config_NB_IoT = NULL;
//No UL_specific parameters for NB-IoT in LogicalChanelConfig-NB
PhysicalConfigDedicated_NB_r13_t* physicalConfigDedicated2_NB = NULL;
PhysicalConfigDedicated_NB_r13_t* physicalConfigDedicated2_NB_IoT = NULL;
DL_CCCH_Message_NB_t dl_ccch_msg_NB_IoT;
RRCConnectionSetup_NB_t* rrcConnectionSetup_NB = NULL;
RRCConnectionSetup_NB_t* rrcConnectionSetup_NB_IoT = NULL;
memset((void *)&dl_ccch_msg_NB_IoT,0,sizeof(DL_CCCH_Message_NB_t));
dl_ccch_msg_NB_IoT.message.present = DL_CCCH_MessageType_NB_PR_c1;
dl_ccch_msg_NB_IoT.message.choice.c1.present = DL_CCCH_MessageType_NB__c1_PR_rrcConnectionSetup_r13;
rrcConnectionSetup_NB = &dl_ccch_msg_NB_IoT.message.choice.c1.choice.rrcConnectionSetup_r13;
rrcConnectionSetup_NB_IoT = &dl_ccch_msg_NB_IoT.message.choice.c1.choice.rrcConnectionSetup_r13;
if (*SRB_configList_NB) {
free(*SRB_configList_NB);
if (*SRB_configList_NB_IoT) {
free(*SRB_configList_NB_IoT);
}
*SRB_configList_NB = CALLOC(1,sizeof(SRB_ToAddModList_NB_r13_t));
*SRB_configList_NB_IoT = CALLOC(1,sizeof(SRB_ToAddModList_NB_r13_t));
/// SRB1--------------------
{
......@@ -746,53 +746,53 @@ uint8_t do_RRCConnectionSetup_NB_IoT(
// SRB1_lchan_config_NB->choice.explicitValue.logicalChannelSR_Prohibit_r13 = logicalChannelSR_Prohibit;
//
// //ADD SRB1
// ASN_SEQUENCE_ADD(&(*SRB_configList_NB)->list,SRB1_config_NB);
// ASN_SEQUENCE_ADD(&(*SRB_configList_NB_IoT)->list,SRB1_config_NB);
}
///SRB1bis (The configuration for SRB1 and SRB1bis is the same) the only difference is the logical channel identity = 3 but not set here
SRB1bis_config_NB = CALLOC(1,sizeof(*SRB1bis_config_NB));
SRB1bis_config_NB_IoT = CALLOC(1,sizeof(*SRB1bis_config_NB_IoT));
//no srb_Identity in SRB_ToAddMod_NB
SRB1bis_rlc_config_NB = CALLOC(1,sizeof(*SRB1bis_rlc_config_NB));
SRB1bis_config_NB->rlc_Config_r13 = SRB1bis_rlc_config_NB;
SRB1bis_rlc_config_NB_IoT = CALLOC(1,sizeof(*SRB1bis_rlc_config_NB_IoT));
SRB1bis_config_NB_IoT->rlc_Config_r13 = SRB1bis_rlc_config_NB_IoT;
SRB1bis_rlc_config_NB->present = SRB_ToAddMod_NB_r13__rlc_Config_r13_PR_explicitValue;
SRB1bis_rlc_config_NB->choice.explicitValue.present=RLC_Config_NB_r13_PR_am;//MP: the only possible RLC config in NB_IoT
SRB1bis_rlc_config_NB_IoT->present = SRB_ToAddMod_NB_r13__rlc_Config_r13_PR_explicitValue;
SRB1bis_rlc_config_NB_IoT->choice.explicitValue.present=RLC_Config_NB_r13_PR_am;//MP: the only possible RLC config in NB_IoT
SRB1bis_rlc_config_NB->choice.explicitValue.choice.am.ul_AM_RLC_r13.t_PollRetransmit_r13 = T_PollRetransmit_NB_r13_ms25000;
SRB1bis_rlc_config_NB->choice.explicitValue.choice.am.ul_AM_RLC_r13.maxRetxThreshold_r13 = UL_AM_RLC_NB_r13__maxRetxThreshold_r13_t8;
SRB1bis_rlc_config_NB_IoT->choice.explicitValue.choice.am.ul_AM_RLC_r13.t_PollRetransmit_r13 = T_PollRetransmit_NB_r13_ms25000;
SRB1bis_rlc_config_NB_IoT->choice.explicitValue.choice.am.ul_AM_RLC_r13.maxRetxThreshold_r13 = UL_AM_RLC_NB_r13__maxRetxThreshold_r13_t8;
//(musT be disabled--> SRB1 config pag 640 specs )
SRB1bis_rlc_config_NB->choice.explicitValue.choice.am.dl_AM_RLC_r13.enableStatusReportSN_Gap_r13 =NULL;
SRB1bis_rlc_config_NB_IoT->choice.explicitValue.choice.am.dl_AM_RLC_r13.enableStatusReportSN_Gap_r13 =NULL;
SRB1bis_lchan_config_NB = CALLOC(1,sizeof(*SRB1bis_lchan_config_NB));
SRB1bis_config_NB->logicalChannelConfig_r13 = SRB1bis_lchan_config_NB;
SRB1bis_lchan_config_NB_IoT = CALLOC(1,sizeof(*SRB1bis_lchan_config_NB_IoT));
SRB1bis_config_NB_IoT->logicalChannelConfig_r13 = SRB1bis_lchan_config_NB_IoT;
SRB1bis_lchan_config_NB->present = SRB_ToAddMod_NB_r13__logicalChannelConfig_r13_PR_explicitValue;
SRB1bis_lchan_config_NB_IoT->present = SRB_ToAddMod_NB_r13__logicalChannelConfig_r13_PR_explicitValue;
prioritySRB1bis = CALLOC(1, sizeof(long));
*prioritySRB1bis = 1; //same as SRB1?
SRB1bis_lchan_config_NB->choice.explicitValue.priority_r13 = prioritySRB1bis;
SRB1bis_lchan_config_NB_IoT->choice.explicitValue.priority_r13 = prioritySRB1bis;
logicalChannelSR_Prohibit = CALLOC(1, sizeof(BOOLEAN_t));
*logicalChannelSR_Prohibit = 1; //schould be set to TRUE (specs pag 641)
SRB1bis_lchan_config_NB->choice.explicitValue.logicalChannelSR_Prohibit_r13 = logicalChannelSR_Prohibit;
SRB1bis_lchan_config_NB_IoT->choice.explicitValue.logicalChannelSR_Prohibit_r13 = logicalChannelSR_Prohibit;
//ADD SRB1bis
//MP: Actually there is no way to distinguish SRB1 and SRB1bis once put in the list
//MP: SRB_ToAddModList_NB_r13_t size = 1
ASN_SEQUENCE_ADD(&(*SRB_configList_NB)->list,SRB1bis_config_NB);
ASN_SEQUENCE_ADD(&(*SRB_configList_NB_IoT)->list,SRB1bis_config_NB_IoT);
// PhysicalConfigDedicated (NPDCCH, NPUSCH, CarrierConfig, UplinkPowerControl)
physicalConfigDedicated2_NB = CALLOC(1,sizeof(*physicalConfigDedicated2_NB));
*physicalConfigDedicated_NB = physicalConfigDedicated2_NB;
physicalConfigDedicated2_NB_IoT = CALLOC(1,sizeof(*physicalConfigDedicated2_NB_IoT));
*physicalConfigDedicated_NB_IoT = physicalConfigDedicated2_NB_IoT;
physicalConfigDedicated2_NB->carrierConfigDedicated_r13= CALLOC(1, sizeof(*physicalConfigDedicated2_NB->carrierConfigDedicated_r13));
physicalConfigDedicated2_NB->npdcch_ConfigDedicated_r13 = CALLOC(1,sizeof(*physicalConfigDedicated2_NB->npdcch_ConfigDedicated_r13));
physicalConfigDedicated2_NB->npusch_ConfigDedicated_r13 = CALLOC(1,sizeof(*physicalConfigDedicated2_NB->npusch_ConfigDedicated_r13));
physicalConfigDedicated2_NB->uplinkPowerControlDedicated_r13 = CALLOC(1,sizeof(*physicalConfigDedicated2_NB->uplinkPowerControlDedicated_r13));
physicalConfigDedicated2_NB_IoT->carrierConfigDedicated_r13= CALLOC(1, sizeof(*physicalConfigDedicated2_NB_IoT->carrierConfigDedicated_r13));
physicalConfigDedicated2_NB_IoT->npdcch_ConfigDedicated_r13 = CALLOC(1,sizeof(*physicalConfigDedicated2_NB_IoT->npdcch_ConfigDedicated_r13));
physicalConfigDedicated2_NB_IoT->npusch_ConfigDedicated_r13 = CALLOC(1,sizeof(*physicalConfigDedicated2_NB_IoT->npusch_ConfigDedicated_r13));
physicalConfigDedicated2_NB_IoT->uplinkPowerControlDedicated_r13 = CALLOC(1,sizeof(*physicalConfigDedicated2_NB_IoT->uplinkPowerControlDedicated_r13));
//no tpc, no cqi and no pucch, no pdsch, no soundingRS, no AntennaInfo, no scheduling request config
......@@ -806,47 +806,47 @@ uint8_t do_RRCConnectionSetup_NB_IoT(
//DL
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->dl_CarrierConfig_r13.dl_CarrierFreq_r13.carrierFreq_r13=0;//random value set
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->dl_CarrierConfig_r13.downlinkBitmapNonAnchor_r13= CALLOC(1,sizeof(struct DL_CarrierConfigDedicated_NB_r13__downlinkBitmapNonAnchor_r13));
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->dl_CarrierConfig_r13.downlinkBitmapNonAnchor_r13->present=
physicalConfigDedicated2_NB_IoT->carrierConfigDedicated_r13->dl_CarrierConfig_r13.dl_CarrierFreq_r13.carrierFreq_r13=0;//random value set
physicalConfigDedicated2_NB_IoT->carrierConfigDedicated_r13->dl_CarrierConfig_r13.downlinkBitmapNonAnchor_r13= CALLOC(1,sizeof(struct DL_CarrierConfigDedicated_NB_r13__downlinkBitmapNonAnchor_r13));
physicalConfigDedicated2_NB_IoT->carrierConfigDedicated_r13->dl_CarrierConfig_r13.downlinkBitmapNonAnchor_r13->present=
DL_CarrierConfigDedicated_NB_r13__downlinkBitmapNonAnchor_r13_PR_useNoBitmap_r13;
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->dl_CarrierConfig_r13.dl_GapNonAnchor_r13 = CALLOC(1,sizeof(struct DL_CarrierConfigDedicated_NB_r13__dl_GapNonAnchor_r13));
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->dl_CarrierConfig_r13.dl_GapNonAnchor_r13->present =
physicalConfigDedicated2_NB_IoT->carrierConfigDedicated_r13->dl_CarrierConfig_r13.dl_GapNonAnchor_r13 = CALLOC(1,sizeof(struct DL_CarrierConfigDedicated_NB_r13__dl_GapNonAnchor_r13));
physicalConfigDedicated2_NB_IoT->carrierConfigDedicated_r13->dl_CarrierConfig_r13.dl_GapNonAnchor_r13->present =
DL_CarrierConfigDedicated_NB_r13__dl_GapNonAnchor_r13_PR_useNoGap_r13;
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->dl_CarrierConfig_r13.inbandCarrierInfo_r13= NULL;
physicalConfigDedicated2_NB_IoT->carrierConfigDedicated_r13->dl_CarrierConfig_r13.inbandCarrierInfo_r13= NULL;
//UL
physicalConfigDedicated2_NB->carrierConfigDedicated_r13->ul_CarrierConfig_r13.ul_CarrierFreq_r13= NULL;
physicalConfigDedicated2_NB_IoT->carrierConfigDedicated_r13->ul_CarrierConfig_r13.ul_CarrierFreq_r13= NULL;
// NPDCCH
physicalConfigDedicated2_NB->npdcch_ConfigDedicated_r13->npdcch_NumRepetitions_r13 =0;
physicalConfigDedicated2_NB->npdcch_ConfigDedicated_r13->npdcch_Offset_USS_r13 =0;
physicalConfigDedicated2_NB->npdcch_ConfigDedicated_r13->npdcch_StartSF_USS_r13=0;
physicalConfigDedicated2_NB_IoT->npdcch_ConfigDedicated_r13->npdcch_NumRepetitions_r13 =0;
physicalConfigDedicated2_NB_IoT->npdcch_ConfigDedicated_r13->npdcch_Offset_USS_r13 =0;
physicalConfigDedicated2_NB_IoT->npdcch_ConfigDedicated_r13->npdcch_StartSF_USS_r13=0;
// NPUSCH //(specs TS 36.331 v14.2.1 pag 643) /* OPTIONAL */
physicalConfigDedicated2_NB->npusch_ConfigDedicated_r13->ack_NACK_NumRepetitions_r13= NULL;
physicalConfigDedicated2_NB_IoT->npusch_ConfigDedicated_r13->ack_NACK_NumRepetitions_r13= NULL;
npusch_AllSymbols= CALLOC(1, sizeof(BOOLEAN_t));
*npusch_AllSymbols= 1; //TRUE
physicalConfigDedicated2_NB->npusch_ConfigDedicated_r13->npusch_AllSymbols_r13= npusch_AllSymbols; /* OPTIONAL */
physicalConfigDedicated2_NB->npusch_ConfigDedicated_r13->groupHoppingDisabled_r13=NULL; /* OPTIONAL */
physicalConfigDedicated2_NB_IoT->npusch_ConfigDedicated_r13->npusch_AllSymbols_r13= npusch_AllSymbols; /* OPTIONAL */
physicalConfigDedicated2_NB_IoT->npusch_ConfigDedicated_r13->groupHoppingDisabled_r13=NULL; /* OPTIONAL */
// UplinkPowerControlDedicated
physicalConfigDedicated2_NB->uplinkPowerControlDedicated_r13->p0_UE_NPUSCH_r13 = 0; // 0 dB (specs TS36.331 v14.2.1 pag 643)
physicalConfigDedicated2_NB_IoT->uplinkPowerControlDedicated_r13->p0_UE_NPUSCH_r13 = 0; // 0 dB (specs TS36.331 v14.2.1 pag 643)
//Fill the rrcConnectionSetup-NB message
rrcConnectionSetup_NB->rrc_TransactionIdentifier = Transaction_id; //input value
rrcConnectionSetup_NB->criticalExtensions.present = RRCConnectionSetup_NB__criticalExtensions_PR_c1;
rrcConnectionSetup_NB->criticalExtensions.choice.c1.present =RRCConnectionSetup_NB__criticalExtensions__c1_PR_rrcConnectionSetup_r13 ;
rrcConnectionSetup_NB_IoT->rrc_TransactionIdentifier = Transaction_id; //input value
rrcConnectionSetup_NB_IoT->criticalExtensions.present = RRCConnectionSetup_NB__criticalExtensions_PR_c1;
rrcConnectionSetup_NB_IoT->criticalExtensions.choice.c1.present =RRCConnectionSetup_NB__criticalExtensions__c1_PR_rrcConnectionSetup_r13 ;
//MP: carry only SRB1bis at the moment and phyConfigDedicated
rrcConnectionSetup_NB->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r13.radioResourceConfigDedicated_r13.srb_ToAddModList_r13 = *SRB_configList_NB;
rrcConnectionSetup_NB->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r13.radioResourceConfigDedicated_r13.drb_ToAddModList_r13 = NULL;
rrcConnectionSetup_NB->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r13.radioResourceConfigDedicated_r13.drb_ToReleaseList_r13 = NULL;
rrcConnectionSetup_NB->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r13.radioResourceConfigDedicated_r13.rlf_TimersAndConstants_r13 = NULL;
rrcConnectionSetup_NB->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r13.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13 = physicalConfigDedicated2_NB;
rrcConnectionSetup_NB->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r13.radioResourceConfigDedicated_r13.mac_MainConfig_r13 = NULL;
rrcConnectionSetup_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r13.radioResourceConfigDedicated_r13.srb_ToAddModList_r13 = *SRB_configList_NB_IoT;
rrcConnectionSetup_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r13.radioResourceConfigDedicated_r13.drb_ToAddModList_r13 = NULL;
rrcConnectionSetup_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r13.radioResourceConfigDedicated_r13.drb_ToReleaseList_r13 = NULL;
rrcConnectionSetup_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r13.radioResourceConfigDedicated_r13.rlf_TimersAndConstants_r13 = NULL;
rrcConnectionSetup_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r13.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13 = physicalConfigDedicated2_NB_IoT;
rrcConnectionSetup_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r13.radioResourceConfigDedicated_r13.mac_MainConfig_r13 = NULL;
#ifdef XER_PRINT
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
......@@ -875,33 +875,33 @@ uint8_t do_SecurityModeCommand_NB_IoT(
const uint8_t cipheringAlgorithm,
const uint8_t integrityProtAlgorithm)
{
DL_DCCH_Message_NB_t dl_dcch_msg_NB;
DL_DCCH_Message_NB_t dl_dcch_msg_NB_IoT;
asn_enc_rval_t enc_rval;
memset(&dl_dcch_msg_NB,0,sizeof(DL_DCCH_Message_NB_t));
memset(&dl_dcch_msg_NB_IoT,0,sizeof(DL_DCCH_Message_NB_t));
dl_dcch_msg_NB.message.present = DL_DCCH_MessageType_NB_PR_c1;
dl_dcch_msg_NB.message.choice.c1.present = DL_DCCH_MessageType_NB__c1_PR_securityModeCommand_r13;
dl_dcch_msg_NB_IoT.message.present = DL_DCCH_MessageType_NB_PR_c1;
dl_dcch_msg_NB_IoT.message.choice.c1.present = DL_DCCH_MessageType_NB__c1_PR_securityModeCommand_r13;
dl_dcch_msg_NB.message.choice.c1.choice.securityModeCommand_r13.rrc_TransactionIdentifier = Transaction_id;
dl_dcch_msg_NB.message.choice.c1.choice.securityModeCommand_r13.criticalExtensions.present = SecurityModeCommand__criticalExtensions_PR_c1;
dl_dcch_msg_NB_IoT.message.choice.c1.choice.securityModeCommand_r13.rrc_TransactionIdentifier = Transaction_id;
dl_dcch_msg_NB_IoT.message.choice.c1.choice.securityModeCommand_r13.criticalExtensions.present = SecurityModeCommand__criticalExtensions_PR_c1;
dl_dcch_msg_NB.message.choice.c1.choice.securityModeCommand_r13.criticalExtensions.choice.c1.present =
dl_dcch_msg_NB_IoT.message.choice.c1.choice.securityModeCommand_r13.criticalExtensions.choice.c1.present =
SecurityModeCommand__criticalExtensions__c1_PR_securityModeCommand_r8;
// the two following information could be based on the mod_id
dl_dcch_msg_NB.message.choice.c1.choice.securityModeCommand_r13.criticalExtensions.choice.c1.choice.securityModeCommand_r8.securityConfigSMC.securityAlgorithmConfig.cipheringAlgorithm
dl_dcch_msg_NB_IoT.message.choice.c1.choice.securityModeCommand_r13.criticalExtensions.choice.c1.choice.securityModeCommand_r8.securityConfigSMC.securityAlgorithmConfig.cipheringAlgorithm
= (CipheringAlgorithm_r12_t)cipheringAlgorithm; //bug solved
dl_dcch_msg_NB.message.choice.c1.choice.securityModeCommand_r13.criticalExtensions.choice.c1.choice.securityModeCommand_r8.securityConfigSMC.securityAlgorithmConfig.integrityProtAlgorithm
dl_dcch_msg_NB_IoT.message.choice.c1.choice.securityModeCommand_r13.criticalExtensions.choice.c1.choice.securityModeCommand_r8.securityConfigSMC.securityAlgorithmConfig.integrityProtAlgorithm
= (e_SecurityAlgorithmConfig__integrityProtAlgorithm)integrityProtAlgorithm;
//only changed "asn_DEF_DL_DCCH_Message_NB"
#ifdef XER_PRINT
xer_fprint(stdout, &asn_DEF_DL_DCCH_Message_NB, (void*)&dl_dcch_msg_NB);
xer_fprint(stdout, &asn_DEF_DL_DCCH_Message_NB, (void*)&dl_dcch_msg_NB_IoT);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB,
(void*)&dl_dcch_msg_NB,
(void*)&dl_dcch_msg_NB_IoT,
buffer,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
......@@ -938,29 +938,29 @@ uint8_t do_UECapabilityEnquiry_NB_IoT(
{
DL_DCCH_Message_NB_t dl_dcch_msg_NB;
DL_DCCH_Message_NB_t dl_dcch_msg_NB_IoT;
//no RAT type in NB-IoT
asn_enc_rval_t enc_rval;
memset(&dl_dcch_msg_NB,0,sizeof(DL_DCCH_Message_NB_t));
memset(&dl_dcch_msg_NB_IoT,0,sizeof(DL_DCCH_Message_NB_t));
dl_dcch_msg_NB.message.present = DL_DCCH_MessageType_NB_PR_c1;
dl_dcch_msg_NB.message.choice.c1.present = DL_DCCH_MessageType_NB__c1_PR_ueCapabilityEnquiry_r13;
dl_dcch_msg_NB_IoT.message.present = DL_DCCH_MessageType_NB_PR_c1;
dl_dcch_msg_NB_IoT.message.choice.c1.present = DL_DCCH_MessageType_NB__c1_PR_ueCapabilityEnquiry_r13;
dl_dcch_msg_NB.message.choice.c1.choice.ueCapabilityEnquiry_r13.rrc_TransactionIdentifier = Transaction_id;
dl_dcch_msg_NB_IoT.message.choice.c1.choice.ueCapabilityEnquiry_r13.rrc_TransactionIdentifier = Transaction_id;
dl_dcch_msg_NB.message.choice.c1.choice.ueCapabilityEnquiry_r13.criticalExtensions.present = UECapabilityEnquiry_NB__criticalExtensions_PR_c1;
dl_dcch_msg_NB.message.choice.c1.choice.ueCapabilityEnquiry_r13.criticalExtensions.choice.c1.present =
dl_dcch_msg_NB_IoT.message.choice.c1.choice.ueCapabilityEnquiry_r13.criticalExtensions.present = UECapabilityEnquiry_NB__criticalExtensions_PR_c1;
dl_dcch_msg_NB_IoT.message.choice.c1.choice.ueCapabilityEnquiry_r13.criticalExtensions.choice.c1.present =
UECapabilityEnquiry_NB__criticalExtensions__c1_PR_ueCapabilityEnquiry_r13;
//no ue_CapabilityRequest (list of RAT_Type)
//only changed "asn_DEF_DL_DCCH_Message_NB"
#ifdef XER_PRINT
xer_fprint(stdout, &asn_DEF_DL_DCCH_Message_NB, (void*)&dl_dcch_msg_NB);
xer_fprint(stdout, &asn_DEF_DL_DCCH_Message_NB, (void*)&dl_dcch_msg_NB_IoT);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB,
(void*)&dl_dcch_msg_NB,
(void*)&dl_dcch_msg_NB_IoT,
buffer,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
......@@ -995,26 +995,26 @@ uint16_t do_RRCConnectionReconfiguration_NB_IoT(
uint8_t *buffer,
uint8_t Transaction_id,
SRB_ToAddModList_NB_r13_t *SRB1_list_NB, //SRB_ConfigList2 (default)--> only SRB1
DRB_ToAddModList_NB_r13_t *DRB_list_NB, //DRB_ConfigList (default)
DRB_ToReleaseList_NB_r13_t *DRB_list2_NB, //is NULL when passed
struct PhysicalConfigDedicated_NB_r13 *physicalConfigDedicated_NB,
DRB_ToAddModList_NB_r13_t *DRB_list_NB_IoT, //DRB_ConfigList (default)
DRB_ToReleaseList_NB_r13_t *DRB_list2_NB_IoT, //is NULL when passed
struct PhysicalConfigDedicated_NB_r13 *physicalConfigDedicated_NB_IoT,
MAC_MainConfig_NB_r13_t *mac_MainConfig_NB,
struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13* dedicatedInfoNASList_NB)
struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13* dedicatedInfoNASList_NB_IoT)
{
//check on DRB_list if contains more than 2 DRB?
asn_enc_rval_t enc_rval;
DL_DCCH_Message_NB_t dl_dcch_msg_NB;
DL_DCCH_Message_NB_t dl_dcch_msg_NB_IoT;
RRCConnectionReconfiguration_NB_t *rrcConnectionReconfiguration_NB;
memset(&dl_dcch_msg_NB,0,sizeof(DL_DCCH_Message_NB_t));
memset(&dl_dcch_msg_NB_IoT,0,sizeof(DL_DCCH_Message_NB_t));
dl_dcch_msg_NB.message.present = DL_DCCH_MessageType_NB_PR_c1;
dl_dcch_msg_NB.message.choice.c1.present = DL_DCCH_MessageType_NB__c1_PR_rrcConnectionReconfiguration_r13;
rrcConnectionReconfiguration_NB = &dl_dcch_msg_NB.message.choice.c1.choice.rrcConnectionReconfiguration_r13;
dl_dcch_msg_NB_IoT.message.present = DL_DCCH_MessageType_NB_PR_c1;
dl_dcch_msg_NB_IoT.message.choice.c1.present = DL_DCCH_MessageType_NB__c1_PR_rrcConnectionReconfiguration_r13;
rrcConnectionReconfiguration_NB = &dl_dcch_msg_NB_IoT.message.choice.c1.choice.rrcConnectionReconfiguration_r13;
// RRCConnectionReconfiguration
rrcConnectionReconfiguration_NB->rrc_TransactionIdentifier = Transaction_id;
......@@ -1025,9 +1025,9 @@ uint16_t do_RRCConnectionReconfiguration_NB_IoT(
rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.radioResourceConfigDedicated_r13 =
CALLOC(1,sizeof(*rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.radioResourceConfigDedicated_r13));
rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.radioResourceConfigDedicated_r13->srb_ToAddModList_r13 = SRB1_list_NB; //only SRB1
rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.radioResourceConfigDedicated_r13->drb_ToAddModList_r13 = DRB_list_NB;
rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.radioResourceConfigDedicated_r13->drb_ToReleaseList_r13 = DRB_list2_NB; //NULL
rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.radioResourceConfigDedicated_r13->physicalConfigDedicated_r13 = physicalConfigDedicated_NB;
rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.radioResourceConfigDedicated_r13->drb_ToAddModList_r13 = DRB_list_NB_IoT;
rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.radioResourceConfigDedicated_r13->drb_ToReleaseList_r13 = DRB_list2_NB_IoT; //NULL
rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.radioResourceConfigDedicated_r13->physicalConfigDedicated_r13 = physicalConfigDedicated_NB_IoT;
//FIXME may not used now
//rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.radioResourceConfigDedicated_r13->rlf_TimersAndConstants_r13
......@@ -1047,12 +1047,12 @@ uint16_t do_RRCConnectionReconfiguration_NB_IoT(
//no measConfig, measIDlist
//no mobilityControlInfo
rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.dedicatedInfoNASList_r13 = dedicatedInfoNASList_NB;
rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.dedicatedInfoNASList_r13 = dedicatedInfoNASList_NB_IoT;
//mainly used for cell-reselection/handover purposes??
rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.fullConfig_r13 = NULL;
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB,
(void*)&dl_dcch_msg_NB,
(void*)&dl_dcch_msg_NB_IoT,
buffer,
RRC_BUF_SIZE);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %l)!\n",
......@@ -1060,7 +1060,7 @@ uint16_t do_RRCConnectionReconfiguration_NB_IoT(
//changed only asn_DEF_DL_DCCH_Message_NB
#ifdef XER_PRINT
xer_fprint(stdout,&asn_DEF_DL_DCCH_Message_NB,(void*)&dl_dcch_msg_NB);
xer_fprint(stdout,&asn_DEF_DL_DCCH_Message_NB,(void*)&dl_dcch_msg_NB_IoT);
#endif
//#if defined(ENABLE_ITTI)
......@@ -1212,19 +1212,19 @@ uint8_t do_DLInformationTransfer_NB_IoT(
{
ssize_t encoded;
DL_DCCH_Message_NB_t dl_dcch_msg_NB;
DL_DCCH_Message_NB_t dl_dcch_msg_NB_IoT;
memset(&dl_dcch_msg_NB, 0, sizeof(DL_DCCH_Message_NB_t));
memset(&dl_dcch_msg_NB_IoT, 0, sizeof(DL_DCCH_Message_NB_t));
dl_dcch_msg_NB.message.present = DL_DCCH_MessageType_NB_PR_c1;
dl_dcch_msg_NB.message.choice.c1.present = DL_DCCH_MessageType_NB__c1_PR_dlInformationTransfer_r13;
dl_dcch_msg_NB.message.choice.c1.choice.dlInformationTransfer_r13.rrc_TransactionIdentifier = transaction_id;
dl_dcch_msg_NB.message.choice.c1.choice.dlInformationTransfer_r13.criticalExtensions.present = DLInformationTransfer_NB__criticalExtensions_PR_c1;
dl_dcch_msg_NB.message.choice.c1.choice.dlInformationTransfer_r13.criticalExtensions.choice.c1.present = DLInformationTransfer_NB__criticalExtensions__c1_PR_dlInformationTransfer_r13;
dl_dcch_msg_NB.message.choice.c1.choice.dlInformationTransfer_r13.criticalExtensions.choice.c1.choice.dlInformationTransfer_r13.dedicatedInfoNAS_r13.size = pdu_length;
dl_dcch_msg_NB.message.choice.c1.choice.dlInformationTransfer_r13.criticalExtensions.choice.c1.choice.dlInformationTransfer_r13.dedicatedInfoNAS_r13.buf = pdu_buffer;
dl_dcch_msg_NB_IoT.message.present = DL_DCCH_MessageType_NB_PR_c1;
dl_dcch_msg_NB_IoT.message.choice.c1.present = DL_DCCH_MessageType_NB__c1_PR_dlInformationTransfer_r13;
dl_dcch_msg_NB_IoT.message.choice.c1.choice.dlInformationTransfer_r13.rrc_TransactionIdentifier = transaction_id;
dl_dcch_msg_NB_IoT.message.choice.c1.choice.dlInformationTransfer_r13.criticalExtensions.present = DLInformationTransfer_NB__criticalExtensions_PR_c1;
dl_dcch_msg_NB_IoT.message.choice.c1.choice.dlInformationTransfer_r13.criticalExtensions.choice.c1.present = DLInformationTransfer_NB__criticalExtensions__c1_PR_dlInformationTransfer_r13;
dl_dcch_msg_NB_IoT.message.choice.c1.choice.dlInformationTransfer_r13.criticalExtensions.choice.c1.choice.dlInformationTransfer_r13.dedicatedInfoNAS_r13.size = pdu_length;
dl_dcch_msg_NB_IoT.message.choice.c1.choice.dlInformationTransfer_r13.criticalExtensions.choice.c1.choice.dlInformationTransfer_r13.dedicatedInfoNAS_r13.buf = pdu_buffer;
encoded = uper_encode_to_new_buffer (&asn_DEF_DL_DCCH_Message_NB, NULL, (void*) &dl_dcch_msg_NB, (void **) buffer);
encoded = uper_encode_to_new_buffer (&asn_DEF_DL_DCCH_Message_NB, NULL, (void*) &dl_dcch_msg_NB_IoT, (void **) buffer);
//only change in "asn_DEF_DL_DCCH_Message_NB"
#if defined(ENABLE_ITTI)
......@@ -1233,7 +1233,7 @@ uint8_t do_DLInformationTransfer_NB_IoT(
char message_string[10000];
size_t message_string_size;
if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_DCCH_Message_NB, (void *)&dl_dcch_msg_NB)) > 0) {
if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_DCCH_Message_NB, (void *)&dl_dcch_msg_NB_IoT)) > 0) {
MessageDef *msg_p;
msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_DCCH, message_string_size + sizeof (IttiMsgText));
......@@ -1260,7 +1260,7 @@ uint8_t do_RRCConnectionReestablishment_NB_IoT(
uint8_t* const buffer,
const uint8_t Transaction_id,
const NB_IoT_DL_FRAME_PARMS* const frame_parms, //to be changed
SRB_ToAddModList_NB_r13_t* SRB_list_NB) //should contain SRB1 already configured?
SRB_ToAddModList_NB_r13_t* SRB_list_NB_IoT) //should contain SRB1 already configured?
{
asn_enc_rval_t enc_rval;
......@@ -1278,7 +1278,7 @@ uint8_t do_RRCConnectionReestablishment_NB_IoT(
rrcConnectionReestablishment_NB->criticalExtensions.present = RRCConnectionReestablishment_NB__criticalExtensions_PR_c1;
rrcConnectionReestablishment_NB->criticalExtensions.choice.c1.present = RRCConnectionReestablishment_NB__criticalExtensions__c1_PR_rrcConnectionReestablishment_r13;
rrcConnectionReestablishment_NB->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.radioResourceConfigDedicated_r13.srb_ToAddModList_r13 = SRB_list_NB;
rrcConnectionReestablishment_NB->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.radioResourceConfigDedicated_r13.srb_ToAddModList_r13 = SRB_list_NB_IoT;
rrcConnectionReestablishment_NB->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.radioResourceConfigDedicated_r13.drb_ToAddModList_r13 = NULL;
rrcConnectionReestablishment_NB->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.radioResourceConfigDedicated_r13.drb_ToReleaseList_r13 = NULL;
rrcConnectionReestablishment_NB->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.radioResourceConfigDedicated_r13.rlf_TimersAndConstants_r13= NULL;
......@@ -1331,31 +1331,31 @@ uint8_t do_RRCConnectionRelease_NB_IoT(
asn_enc_rval_t enc_rval;
DL_DCCH_Message_NB_t dl_dcch_msg_NB;
RRCConnectionRelease_NB_t *rrcConnectionRelease_NB;
DL_DCCH_Message_NB_t dl_dcch_msg_NB_IoT;
RRCConnectionRelease_NB_t *rrcConnectionRelease_NB_IoT;
memset(&dl_dcch_msg_NB,0,sizeof(DL_DCCH_Message_NB_t));
memset(&dl_dcch_msg_NB_IoT,0,sizeof(DL_DCCH_Message_NB_t));
dl_dcch_msg_NB.message.present = DL_DCCH_MessageType_NB_PR_c1;
dl_dcch_msg_NB.message.choice.c1.present = DL_DCCH_MessageType_NB__c1_PR_rrcConnectionRelease_r13;
rrcConnectionRelease_NB = &dl_dcch_msg_NB.message.choice.c1.choice.rrcConnectionRelease_r13;
dl_dcch_msg_NB_IoT.message.present = DL_DCCH_MessageType_NB_PR_c1;
dl_dcch_msg_NB_IoT.message.choice.c1.present = DL_DCCH_MessageType_NB__c1_PR_rrcConnectionRelease_r13;
rrcConnectionRelease_NB_IoT = &dl_dcch_msg_NB_IoT.message.choice.c1.choice.rrcConnectionRelease_r13;
// RRCConnectionRelease
rrcConnectionRelease_NB->rrc_TransactionIdentifier = Transaction_id;
rrcConnectionRelease_NB->criticalExtensions.present = RRCConnectionRelease_NB__criticalExtensions_PR_c1;
rrcConnectionRelease_NB->criticalExtensions.choice.c1.present =RRCConnectionRelease_NB__criticalExtensions__c1_PR_rrcConnectionRelease_r13 ;
rrcConnectionRelease_NB_IoT->rrc_TransactionIdentifier = Transaction_id;
rrcConnectionRelease_NB_IoT->criticalExtensions.present = RRCConnectionRelease_NB__criticalExtensions_PR_c1;
rrcConnectionRelease_NB_IoT->criticalExtensions.choice.c1.present =RRCConnectionRelease_NB__criticalExtensions__c1_PR_rrcConnectionRelease_r13 ;
rrcConnectionRelease_NB->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r13.releaseCause_r13 = ReleaseCause_NB_r13_other;
rrcConnectionRelease_NB->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r13.redirectedCarrierInfo_r13 = NULL;
rrcConnectionRelease_NB->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r13.extendedWaitTime_r13 = NULL;
rrcConnectionRelease_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r13.releaseCause_r13 = ReleaseCause_NB_r13_other;
rrcConnectionRelease_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r13.redirectedCarrierInfo_r13 = NULL;
rrcConnectionRelease_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r13.extendedWaitTime_r13 = NULL;
//Why allocate memory for non critical extension?
rrcConnectionRelease_NB->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r13.nonCriticalExtension=CALLOC(1,
sizeof(*rrcConnectionRelease_NB->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r13.nonCriticalExtension));
rrcConnectionRelease_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r13.nonCriticalExtension=CALLOC(1,
sizeof(*rrcConnectionRelease_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r13.nonCriticalExtension));
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB,
(void*)&dl_dcch_msg_NB,
(void*)&dl_dcch_msg_NB_IoT,
buffer,
RRC_BUF_SIZE);//check
......
......@@ -155,8 +155,8 @@ uint8_t do_RRCConnectionSetup_NB_IoT(
uint8_t* const buffer, //carrier[CC_id].Srb0.Tx_buffer.Payload
const uint8_t Transaction_id,
const NB_IoT_DL_FRAME_PARMS* const frame_parms, //to be changed but not deleted
SRB_ToAddModList_NB_r13_t** SRB_configList_NB, //in order to be configured--> stanno puntando alla SRB_configlist dell ue_context
struct PhysicalConfigDedicated_NB_r13** physicalConfigDedicated_NB //in order to be configured--> stanno puntando alla physicalConfigDedicated dell ue_context
SRB_ToAddModList_NB_r13_t** SRB_configList_NB_IoT, //in order to be configured--> stanno puntando alla SRB_configlist dell ue_context
struct PhysicalConfigDedicated_NB_r13** physicalConfigDedicated_NB_IoT //in order to be configured--> stanno puntando alla physicalConfigDedicated dell ue_context
);
......@@ -182,12 +182,12 @@ do_RRCConnectionReconfiguration_NB_IoT(
const protocol_ctxt_t* const ctxt_pP,
uint8_t *buffer,
uint8_t Transaction_id,
SRB_ToAddModList_NB_r13_t *SRB_list_NB,
DRB_ToAddModList_NB_r13_t *DRB_list_NB,
DRB_ToReleaseList_NB_r13_t *DRB_list2_NB,
SRB_ToAddModList_NB_r13_t *SRB_list_NB_IoT,
DRB_ToAddModList_NB_r13_t *DRB_list_NB_IoT,
DRB_ToReleaseList_NB_r13_t *DRB_list2_NB_IoT,
struct PhysicalConfigDedicated_NB_r13 *physicalConfigDedicated,
MAC_MainConfig_t *mac_MainConfig,
struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13* dedicatedInfoNASList_NB);
struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13* dedicatedInfoNASList_NB_IoT);
/**
* E-UTRAN applies the procedure as follows: when only for NB-IoT SRB1 and SRB1bis is established
......@@ -279,7 +279,7 @@ uint8_t do_RRCConnectionReestablishment_NB_IoT(
uint8_t* const buffer,
const uint8_t Transaction_id,
const NB_IoT_DL_FRAME_PARMS* const frame_parms, //to be changed
SRB_ToAddModList_NB_r13_t** SRB_configList_NB
SRB_ToAddModList_NB_r13_t** SRB_configList_NB_IoT
);
/**
......
......@@ -197,10 +197,10 @@
/*I will change the name of the structure for compile purposes--> hope not to undo this process*/
typedef unsigned int uid_NB_IoT_t;
#define UID_LINEAR_ALLOCATOR_BITMAP_SIZE (((NUMBER_OF_UE_MAX/8)/sizeof(unsigned int)) + 1)
#define UID_LINEAR_ALLOCATOR_BITMAP_SIZE_NB_IoT (((NUMBER_OF_UE_MAX_NB_IoT/8)/sizeof(unsigned int)) + 1)
typedef struct uid_linear_allocator_NB_IoT_s {
unsigned int bitmap[UID_LINEAR_ALLOCATOR_BITMAP_SIZE];
unsigned int bitmap[UID_LINEAR_ALLOCATOR_BITMAP_SIZE_NB_IoT];
} uid_allocator_NB_IoT_t;
......@@ -369,7 +369,7 @@ typedef struct eNB_RRC_UE_NB_IoT_s {
DRB_ToAddModList_NB_r13_t* DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER]; //for the configured DRBs of a xid
uint8_t DRB_active[2];//in LTE was 8 --> at most 2 for NB-IoT
struct PhysicalConfigDedicated_NB_r13* physicalConfigDedicated_NB;
struct PhysicalConfigDedicated_NB_r13* physicalConfigDedicated_NB_IoT;
MAC_MainConfig_NB_r13_t* mac_MainConfig_NB;
//No SPS(semi-persistent scheduling) in NB-IoT
......
......@@ -53,7 +53,7 @@
#include "COMMON/mac_rrc_primitives.h"
#include "rlc.h"
#include "SIMULATION/ETH_TRANSPORT/extern.h"
#include "rrc_eNB_UE_context.h"
#include "rrc_eNB_UE_context_NB_IoT.h"
#include "platform_types.h"
#include "msc.h"
#include "T.h"
......@@ -108,7 +108,7 @@ extern void* bigphys_malloc(int);
/*the Message Unit Identifieer (MUI) is an Identity of the RLC SDU, whic is used to indicate which RLC SDU that is confirmed
* with the RLC-AM-Data-conf. e.g. ((struct rlc_am_data_req *) (new_sdu_p->data))->mui (rlc_data_req_NB_IoT)
*/
mui_t rrc_eNB_mui_NB = 0;
mui_t rrc_eNB_mui_NB_IoT = 0;
......@@ -147,9 +147,9 @@ void rrc_eNB_free_UE_NB_IoT(const module_id_t enb_mod_idP,const struct rrc_eNB_u
*/
#else
#if defined(OAI_EMU)
AssertFatal(ue_context_pP->local_uid < NUMBER_OF_UE_MAX, "local_uid invalid (%d<%d) for UE %x!", ue_context_pP->local_uid, NUMBER_OF_UE_MAX, rnti);
AssertFatal(ue_context_pP->local_uid < NUMBER_OF_UE_MAX_NB_IoT, "local_uid invalid (%d<%d) for UE %x!", ue_context_pP->local_uid, NUMBER_OF_UE_MAX_NB_IoT, rnti);
ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_pP->local_uid];
AssertFatal(ue_module_id < NUMBER_OF_UE_MAX, "ue_module_id invalid (%d<%d) for UE %x!", ue_module_id, NUMBER_OF_UE_MAX, rnti);
AssertFatal(ue_module_id < NUMBER_OF_UE_MAX_NB_IoT, "ue_module_id invalid (%d<%d) for UE %x!", ue_module_id, NUMBER_OF_UE_MAX_NB_IoT, rnti);
oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_pP->local_uid] = -1;
oai_emulation.info.eNB_ue_module_id_to_rnti[enb_mod_idP][ue_module_id] = NOT_A_RNTI;
#endif
......@@ -169,8 +169,7 @@ void rrc_eNB_free_UE_NB_IoT(const module_id_t enb_mod_idP,const struct rrc_eNB_u
//-----------------------------------------------------------------------------
//actually is not used
void
rrc_eNB_generate_RRCConnectionRelease_NB(
void rrc_eNB_generate_RRCConnectionRelease_NB_IoT(
const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_NB_IoT_t* const ue_context_pP
)
......@@ -202,7 +201,7 @@ rrc_eNB_generate_RRCConnectionRelease_NB(
PROTOCOL_RRC_CTXT_UE_FMT" --- PDCP_DATA_REQ/%d Bytes (rrcConnectionRelease-NB MUI %d) --->[PDCP][RB %u]\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
size,
rrc_eNB_mui_NB,
rrc_eNB_mui_NB_IoT,
DCCH1);//Through SRB1/or SRB1bis
MSC_LOG_TX_MESSAGE(
......@@ -213,13 +212,13 @@ rrc_eNB_generate_RRCConnectionRelease_NB(
MSC_AS_TIME_FMT" rrcConnectionRelease-NB UE %x MUI %d size %u",
MSC_AS_TIME_ARGS(ctxt_pP),
ue_context_pP->ue_context.rnti,
rrc_eNB_mui_NB,
rrc_eNB_mui_NB_IoT,
size);
rrc_data_req(
ctxt_pP,
DCCH1,//Through SRB1/or SRB1bis
rrc_eNB_mui_NB++,
rrc_eNB_mui_NB_IoT++,
SDU_CONFIRM_NO,
size,
buffer,
......@@ -299,9 +298,9 @@ void rrc_eNB_free_mem_UE_context_NB_IoT(
memset(ue_context_pP->ue_context.DRB_active, 0, sizeof(ue_context_pP->ue_context.DRB_active));
if (ue_context_pP->ue_context.physicalConfigDedicated_NB) {
ASN_STRUCT_FREE(asn_DEF_PhysicalConfigDedicated_NB_r13, ue_context_pP->ue_context.physicalConfigDedicated_NB);
ue_context_pP->ue_context.physicalConfigDedicated_NB = NULL;
if (ue_context_pP->ue_context.physicalConfigDedicated_NB_IoT) {
ASN_STRUCT_FREE(asn_DEF_PhysicalConfigDedicated_NB_r13, ue_context_pP->ue_context.physicalConfigDedicated_NB_IoT);
ue_context_pP->ue_context.physicalConfigDedicated_NB_IoT = NULL;
}
......@@ -518,7 +517,7 @@ void rrc_eNB_generate_RRCConnectionSetup_NB_IoT(
rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id),
fp,
SRB_configList, //MP:should contain only SRb1bis for the moment
&ue_context_pP->ue_context.physicalConfigDedicated_NB);
&ue_context_pP->ue_context.physicalConfigDedicated_NB_IoT);
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"[MSG] RRC Connection Setup\n");
......@@ -581,7 +580,7 @@ void rrc_eNB_generate_RRCConnectionSetup_NB_IoT(
0, //ul_carrierFrequency
(BCCH_BCH_Message_NB_t*) NULL,
(RadioResourceConfigCommonSIB_NB_r13_t *) NULL,
(PhysicalConfigDedicated_NB_r13_t*) ue_context_pP->ue_context.physicalConfigDedicated_NB,
(PhysicalConfigDedicated_NB_r13_t*) ue_context_pP->ue_context.physicalConfigDedicated_NB_IoT,
ue_context_pP->ue_context.mac_MainConfig_NB, //XXX most probably is not needed since is only at UE side
DCCH0_NB_IoT, //LCID = 3 of SRB1bis
SRB1bis_logicalChannelConfig
......@@ -810,7 +809,7 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete_NB_IoT(
0, //ul_CarrierFreq
(BCCH_BCH_Message_NB_t*)NULL,
(RadioResourceConfigCommonSIB_NB_r13_t*)NULL,
ue_context_pP->ue_context.physicalConfigDedicated_NB,
ue_context_pP->ue_context.physicalConfigDedicated_NB_IoT,
ue_context_pP->ue_context.mac_MainConfig_NB,
DRB2LCHAN_NB_IoT[i], //over the logical channel id of the DRB (>=4)
DRB_configList2->list.array[i]->logicalChannelConfig_r13
......@@ -854,7 +853,7 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete_NB_IoT(
0, //ul_CarrierFreq
(BCCH_BCH_Message_NB_t*)NULL,
(RadioResourceConfigCommonSIB_NB_r13_t*)NULL,
ue_context_pP->ue_context.physicalConfigDedicated_NB,
ue_context_pP->ue_context.physicalConfigDedicated_NB_IoT,
ue_context_pP->ue_context.mac_MainConfig_NB,
DRB2LCHAN_NB_IoT[i], //over the logical channel id of the DRB (>=4)
(LogicalChannelConfig_NB_r13_t*)NULL
......@@ -932,7 +931,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB_IoT(
DRB_ToAddModList_NB_r13_t* DRB_configList=ue_context_pP->ue_context.DRB_configList;
DRB_ToAddModList_NB_r13_t** DRB_configList2=NULL;
struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13 *dedicatedInfoNASList_NB = NULL;
struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13 *dedicatedInfoNASList_NB_IoT = NULL;
DedicatedInfoNAS_t *dedicatedInfoNas = NULL;
/* for no gcc warnings */
(void)dedicatedInfoNas;
......@@ -951,7 +950,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB_IoT(
*DRB_configList2 = CALLOC(1, sizeof(**DRB_configList2));
/* Initialize NAS list */
dedicatedInfoNASList_NB = CALLOC(1, sizeof(struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13));
dedicatedInfoNASList_NB_IoT = CALLOC(1, sizeof(struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13));
//MP:add a check on number of setup e_rabs
if(ue_context_pP->ue_context.setup_e_rabs > 2){
......@@ -1042,7 +1041,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB_IoT(
OCTET_STRING_fromBuf(dedicatedInfoNas,
(char*)ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer,
ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length);
ASN_SEQUENCE_ADD(&dedicatedInfoNASList_NB->list, dedicatedInfoNas);
ASN_SEQUENCE_ADD(&dedicatedInfoNASList_NB_IoT->list, dedicatedInfoNas);
LOG_I(RRC,"add NAS info with size %d (rab id %d)\n",ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length, i);
}
else {
......@@ -1059,10 +1058,10 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB_IoT(
}
/* If list is empty free the list and reset the address */
if (dedicatedInfoNASList_NB != NULL) {
if (dedicatedInfoNASList_NB->list.count == 0) {
free(dedicatedInfoNASList_NB);
dedicatedInfoNASList_NB = NULL;
if (dedicatedInfoNASList_NB_IoT != NULL) {
if (dedicatedInfoNASList_NB_IoT->list.count == 0) {
free(dedicatedInfoNASList_NB_IoT);
dedicatedInfoNASList_NB_IoT = NULL;
LOG_W(RRC,"dedicated NAS list is empty, free the list and reset the address\n");
}
} else {
......@@ -1078,7 +1077,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB_IoT(
(DRB_ToAddModList_NB_r13_t*)*DRB_configList2,
(DRB_ToReleaseList_NB_r13_t*)NULL, // DRB2_list,
NULL, NULL, //physical an MAC config dedicated
(struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13*)dedicatedInfoNASList_NB
(struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13*)dedicatedInfoNASList_NB_IoT
);
......@@ -1109,7 +1108,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB_IoT(
LOG_D(RRC,
"[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui_NB, ctxt_pP->module_id, DCCH1); //through SRB1
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui_NB_IoT, ctxt_pP->module_id, DCCH1); //through SRB1
MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB,
......@@ -1119,14 +1118,14 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB_IoT(
MSC_AS_TIME_FMT" dedicated rrcConnectionReconfiguration-NB UE %x MUI %d size %u",
MSC_AS_TIME_ARGS(ctxt_pP),
ue_context_pP->ue_context.rnti,
rrc_eNB_mui_NB,
rrc_eNB_mui_NB_IoT,
size);
//transmit the RRCConnectionReconfiguration-NB
rrc_data_req_NB_IoT(
ctxt_pP,
DCCH1,//through SRB1
rrc_eNB_mui_NB++,
rrc_eNB_mui_NB_IoT++,
SDU_CONFIRM_NO,
size,
buffer,
......@@ -1216,7 +1215,7 @@ void rrc_eNB_generate_SecurityModeCommand_NB_IoT(
PROTOCOL_RRC_CTXT_UE_FMT" --- PDCP_DATA_REQ/%d Bytes (securityModeCommand to UE MUI %d) --->[PDCP][RB %02d]\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
size,
rrc_eNB_mui_NB,
rrc_eNB_mui_NB_IoT,
DCCH0_NB_IoT); //MP: SRB1bis
MSC_LOG_TX_MESSAGE(
......@@ -1227,13 +1226,13 @@ void rrc_eNB_generate_SecurityModeCommand_NB_IoT(
MSC_AS_TIME_FMT" securityModeCommand UE %x MUI %d size %u",
MSC_AS_TIME_ARGS(ctxt_pP),
ue_context_pP->ue_context.rnti,
rrc_eNB_mui_NB,
rrc_eNB_mui_NB_IoT,
size);
rrc_data_req_NB_IoT( //to PDCP
ctxt_pP,
DCCH0_NB_IoT,//MP:through SRB1bis
rrc_eNB_mui_NB++,
rrc_eNB_mui_NB_IoT++,
SDU_CONFIRM_NO,
size,
buffer,
......@@ -1270,7 +1269,7 @@ void rrc_eNB_generate_UECapabilityEnquiry_NB_IoT(
PROTOCOL_RRC_CTXT_UE_FMT" --- PDCP_DATA_REQ/%d Bytes (UECapabilityEnquiry-NB MUI %d) --->[PDCP][RB %02d]\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
size,
rrc_eNB_mui_NB,
rrc_eNB_mui_NB_IoT,
DCCH0_NB_IoT);//through SRB1bis
MSC_LOG_TX_MESSAGE(
......@@ -1281,13 +1280,13 @@ void rrc_eNB_generate_UECapabilityEnquiry_NB_IoT(
MSC_AS_TIME_FMT" rrcUECapabilityEnquiry UE %x MUI %d size %u",
MSC_AS_TIME_ARGS(ctxt_pP),
ue_context_pP->ue_context.rnti,
rrc_eNB_mui_NB,
rrc_eNB_mui_NB_IoT,
size);
rrc_data_req_NB_IoT( //to PDCP
ctxt_pP,
DCCH1, //MP: send over SRB1
rrc_eNB_mui_NB++,
rrc_eNB_mui_NB_IoT++,
SDU_CONFIRM_NO,
size,
buffer,
......@@ -1309,7 +1308,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
// configure SRB1, PhysicalConfigDedicated, MAC_MainConfig for UE
//eNB_RRC_INST_NB_IoT* rrc_inst = &eNB_rrc_inst_NB_IoT[ctxt_pP->module_id];
struct PhysicalConfigDedicated_NB_r13** physicalConfigDedicated_NB = &ue_context_pP->ue_context.physicalConfigDedicated_NB;
struct PhysicalConfigDedicated_NB_r13** physicalConfigDedicated_NB_IoT = &ue_context_pP->ue_context.physicalConfigDedicated_NB_IoT;
struct SRB_ToAddMod_NB_r13 *SRB1_config = NULL;
struct SRB_ToAddMod_NB_r13__rlc_Config_r13 *SRB1_rlc_config = NULL;
......@@ -1334,7 +1333,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
BOOLEAN_t *logicalChannelSR_Prohibit = NULL;
//RSRP_Range_t *rsrp = NULL; //may not used
struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13 *dedicatedInfoNASList_NB = NULL;
struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13 *dedicatedInfoNASList_NB_IoT = NULL;
DedicatedInfoNAS_t *dedicatedInfoNas = NULL;
/* for no gcc warnings */
(void)dedicatedInfoNas;
......@@ -1475,7 +1474,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
MAC_MainConfig_NB_r13__logicalChannelSR_Config_r13__setup__logicalChannelSR_ProhibitTimer_r13_pp2; //value in PP=PDCCH periods
if (*physicalConfigDedicated_NB) {
if (*physicalConfigDedicated_NB_IoT) {
//DL_CarrierConfigDedicated_NB_r13_t cio;
//UL_CarrierConfigDedicated_NB_r13_t c;
......@@ -1502,7 +1501,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
//#if defined(ENABLE_ITTI).....
/* Initialize NAS list */
dedicatedInfoNASList_NB = CALLOC(1, sizeof(struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13));
dedicatedInfoNASList_NB_IoT = CALLOC(1, sizeof(struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13));
/* Add all NAS PDUs to the list */
for (i = 0; i < ue_context_pP->ue_context.nb_of_e_rabs; i++) {
......@@ -1512,7 +1511,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
OCTET_STRING_fromBuf(dedicatedInfoNas,
(char*)ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer,
ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length);
ASN_SEQUENCE_ADD(&dedicatedInfoNASList_NB->list, dedicatedInfoNas);
ASN_SEQUENCE_ADD(&dedicatedInfoNASList_NB_IoT->list, dedicatedInfoNas);
}
/*OLD TODO parameters yet to process ... */
......@@ -1529,9 +1528,9 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
}
/* If list is empty free the list and reset the address */
if (dedicatedInfoNASList_NB->list.count == 0) {
free(dedicatedInfoNASList_NB);
dedicatedInfoNASList_NB = NULL;
if (dedicatedInfoNASList_NB_IoT->list.count == 0) {
free(dedicatedInfoNASList_NB_IoT);
dedicatedInfoNASList_NB_IoT = NULL;
}
......@@ -1543,9 +1542,9 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
(SRB_ToAddModList_NB_r13_t*)*SRB_configList2, //only SRB1
(DRB_ToAddModList_NB_r13_t*)*DRB_configList,
(DRB_ToReleaseList_NB_r13_t*)NULL, // DRB2_list,
(struct PhysicalConfigDedicated_NB_r13*)*physicalConfigDedicated_NB,
(struct PhysicalConfigDedicated_NB_r13*)*physicalConfigDedicated_NB_IoT,
(MAC_MainConfig_t*)mac_MainConfig_NB,
(struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13*)dedicatedInfoNASList_NB
(struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13*)dedicatedInfoNASList_NB_IoT
);
#ifdef RRC_MSG_PRINT
......@@ -1574,7 +1573,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
LOG_D(RRC,
"[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration-NB to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui_NB, ctxt_pP->module_id, DCCH1);//through SRB1
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui_NB_IoT, ctxt_pP->module_id, DCCH1);//through SRB1
MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB,
......@@ -1584,13 +1583,13 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
MSC_AS_TIME_FMT" rrcConnectionReconfiguration-NB UE %x MUI %d size %u",
MSC_AS_TIME_ARGS(ctxt_pP),
ue_context_pP->ue_context.rnti,
rrc_eNB_mui_NB,
rrc_eNB_mui_NB_IoT,
size);
rrc_data_req_NB_IoT( //to PDCP
ctxt_pP,
DCCH1,//through SRB1
rrc_eNB_mui_NB++,
rrc_eNB_mui_NB_IoT++,
SDU_CONFIRM_NO,
size,
buffer,
......@@ -1770,7 +1769,7 @@ while ( eNB_rrc_inst_NB_IoT == NULL ) {
}
#endif
AssertFatal(eNB_rrc_inst_NB_IoT != NULL, "eNB_rrc_nb_iot_inst not initialized!");
AssertFatal(NUMBER_OF_UE_MAX < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow");
AssertFatal(NUMBER_OF_UE_MAX_NB_IoT < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow");
eNB_rrc_inst_NB_IoT[ctxt.module_id].Nb_ue = 0;
......@@ -1781,8 +1780,8 @@ while ( eNB_rrc_inst_NB_IoT == NULL ) {
uid_linear_allocator_init_NB_IoT(&eNB_rrc_inst_NB_IoT[ctxt.module_id].uid_allocator); //rrc_eNB_UE_context
RB_INIT(&eNB_rrc_inst_NB_IoT[ctxt.module_id].rrc_ue_head);
eNB_rrc_inst_NB_IoT[ctxt.module_id].initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
eNB_rrc_inst_NB_IoT[ctxt.module_id].s1ap_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
eNB_rrc_inst_NB_IoT[ctxt.module_id].initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX_NB_IoT * 2, NULL, NULL);
eNB_rrc_inst_NB_IoT[ctxt.module_id].s1ap_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX_NB_IoT * 2, NULL, NULL);
memcpy(&eNB_rrc_inst_NB_IoT[ctxt.module_id].configuration,configuration,sizeof(RrcConfigurationReq));
......@@ -2850,7 +2849,7 @@ void* rrc_enb_task_NB_IoT(
/* Messages from S1AP */
case S1AP_DOWNLINK_NAS:
rrc_eNB_process_S1AP_DOWNLINK_NAS(msg_p, msg_name_p, instance, &rrc_eNB_mui_NB);
rrc_eNB_process_S1AP_DOWNLINK_NAS(msg_p, msg_name_p, instance, &rrc_eNB_mui_NB_IoT);
break;
case S1AP_INITIAL_CONTEXT_SETUP_REQ:
......
......@@ -190,161 +190,3 @@ void rrc_eNB_remove_ue_context(
}
//--------------------NB-IoT version----------------------------
//------------------------------------------------------------------------------
void
uid_linear_allocator_init_NB_IoT(
uid_allocator_NB_IoT_t* const uid_pP
)
//------------------------------------------------------------------------------
{
memset(uid_pP, 0, sizeof(uid_allocator_NB_IoT_t));
}
//------------------------------------------------------------------------------
uid_t
uid_linear_allocator_new_NB_IoT(
eNB_RRC_INST_NB_IoT* const rrc_instance_pP
)
//------------------------------------------------------------------------------
{
unsigned int i;
unsigned int bit_index = 1;
uid_t uid = 0;
uid_allocator_NB_IoT_t* uia_p = &rrc_instance_pP->uid_allocator;
for (i=0; i < UID_LINEAR_ALLOCATOR_BITMAP_SIZE; i++) {
if (uia_p->bitmap[i] != UINT_MAX) {
bit_index = 1;
uid = 0;
while ((uia_p->bitmap[i] & bit_index) == bit_index) {
bit_index = bit_index << 1;
uid += 1;
}
uia_p->bitmap[i] |= bit_index;
return uid + (i*sizeof(unsigned int)*8);
}
}
return UINT_MAX;
}
//------------------------------------------------------------------------------
void
uid_linear_allocator_free_NB_IoT(
eNB_RRC_INST_NB_IoT* rrc_instance_pP,
uid_t uidP
)
//------------------------------------------------------------------------------
{
unsigned int i = uidP/sizeof(unsigned int)/8;
unsigned int bit = uidP % (sizeof(unsigned int) * 8);
unsigned int value = ~(0x00000001 << bit);
if (i < UID_LINEAR_ALLOCATOR_BITMAP_SIZE) {
rrc_instance_pP->uid_allocator.bitmap[i] &= value;
}
}
int rrc_eNB_compare_ue_rnti_id_NB_IoT(
struct rrc_eNB_ue_context_NB_IoT_s* c1_pP, struct rrc_eNB_ue_context_NB_IoT_s* c2_pP)
//------------------------------------------------------------------------------
{
if (c1_pP->ue_id_rnti > c2_pP->ue_id_rnti) {
return 1;
}
if (c1_pP->ue_id_rnti < c2_pP->ue_id_rnti) {
return -1;
}
return 0;
}
/* Generate the tree management functions for NB-IoT structures */
RB_GENERATE(rrc_ue_tree_NB_IoT_s, rrc_eNB_ue_context_NB_IoT_s, entries,
rrc_eNB_compare_ue_rnti_id_NB_IoT);
//------------------------------------------------------------------------------
struct rrc_eNB_ue_context_NB_IoT_s*
rrc_eNB_allocate_new_UE_context_NB_IoT(
eNB_RRC_INST_NB_IoT* rrc_instance_pP
)
//------------------------------------------------------------------------------
{
struct rrc_eNB_ue_context_NB_IoT_s* new_p;
new_p = malloc(sizeof(struct rrc_eNB_ue_context_NB_IoT_s));
if (new_p == NULL) {
LOG_E(RRC, "Cannot allocate new ue context\n");
return NULL;
}
memset(new_p, 0, sizeof(struct rrc_eNB_ue_context_NB_IoT_s));
new_p->local_uid = uid_linear_allocator_new_NB_IoT(rrc_instance_pP);
return new_p;
}
struct rrc_eNB_ue_context_NB_IoT_s*
rrc_eNB_get_ue_context_NB_IoT(
eNB_RRC_INST_NB_IoT* rrc_instance_pP,
rnti_t rntiP)
//------------------------------------------------------------------------------
{
rrc_eNB_ue_context_NB_IoT_t temp;
memset(&temp, 0, sizeof(struct rrc_eNB_ue_context_NB_IoT_s));
/* eNB ue rrc id = 24 bits wide */
temp.ue_id_rnti = rntiP;
return RB_FIND(rrc_ue_tree_NB_IoT_s, &rrc_instance_pP->rrc_ue_head, &temp);
}
//------------------------------------------------------------------------------
void rrc_eNB_remove_ue_context_NB_IoT(
const protocol_ctxt_t* const ctxt_pP,
eNB_RRC_INST_NB_IoT* rrc_instance_pP,
struct rrc_eNB_ue_context_NB_IoT_s* ue_context_pP)
//------------------------------------------------------------------------------
{
if (rrc_instance_pP == NULL) {
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Bad RRC instance\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
return;
}
if (ue_context_pP == NULL) {
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Trying to free a NULL UE context\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
return;
}
RB_REMOVE(rrc_ue_tree_NB_IoT_s, &rrc_instance_pP->rrc_ue_head, ue_context_pP);
MSC_LOG_EVENT(
MSC_RRC_ENB,
"0 Removed UE %"PRIx16" ",
ue_context_pP->ue_context.rnti);
rrc_eNB_free_mem_UE_context_NB_IoT(ctxt_pP, ue_context_pP);
uid_linear_allocator_free_NB_IoT(rrc_instance_pP, ue_context_pP->local_uid);
free(ue_context_pP);
LOG_I(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" Removed UE context\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
}
......@@ -31,7 +31,7 @@
#include "collection/tree.h"
#include "COMMON/platform_types.h"
#include "defs.h"
#include "defs_NB_IoT.h"
//#include "defs_NB_IoT.h"
void
......@@ -80,46 +80,4 @@ void rrc_eNB_remove_ue_context(
struct rrc_eNB_ue_context_s* ue_context_pP
);
//-----NB-IoT-----------------------
void
uid_linear_allocator_init_NB_IoT(
uid_allocator_NB_IoT_t* const uid_pP
);
uid_t
uid_linear_allocator_new_NB_IoT(
eNB_RRC_INST_NB_IoT* const rrc_instance_pP
);
void
uid_linear_allocator_free_NB_IoT(
eNB_RRC_INST_NB_IoT* rrc_instance_pP,
uid_t uidP
);
int rrc_eNB_compare_ue_rnti_id_NB_IoT(
struct rrc_eNB_ue_context_NB_IoT_s* c1_pP, struct rrc_eNB_ue_context_NB_IoT_s* c2_pP);
RB_PROTOTYPE(rrc_ue_tree_NB_IoT_s, rrc_eNB_ue_context_NB_IoT_s, entries, rrc_eNB_compare_ue_rnti_id_NB_IoT);
struct rrc_eNB_ue_context_NB_IoT_s*
rrc_eNB_allocate_new_UE_context_NB_IoT(
eNB_RRC_INST_NB_IoT* rrc_instance_pP
);
struct rrc_eNB_ue_context_NB_IoT_s*
rrc_eNB_get_ue_context_NB_IoT(
eNB_RRC_INST_NB_IoT* rrc_instance_pP,
rnti_t rntiP);
void rrc_eNB_remove_ue_context_NB_IoT(
const protocol_ctxt_t* const ctxt_pP,
eNB_RRC_INST_NB_IoT* rrc_instance_pP,
struct rrc_eNB_ue_context_NB_IoT_s* ue_context_pP);
#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.0 (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_eNB_UE_context.h
* \brief rrc procedures for UE context
* \author Lionel GAUTHIER
* \date 2015
* \version 1.0
* \company Eurecom
* \email: lionel.gauthier@eurecom.fr
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include "UTIL/LOG/log.h"
#include "rrc_eNB_UE_context_NB_IoT.h"
#include "msc.h"
//------------------------------------------------------------------------------
void
uid_linear_allocator_init_NB_IoT(
uid_allocator_NB_IoT_t* const uid_pP
)
//------------------------------------------------------------------------------
{
memset(uid_pP, 0, sizeof(uid_allocator_NB_IoT_t));
}
//------------------------------------------------------------------------------
uid_t
uid_linear_allocator_new_NB_IoT(
eNB_RRC_INST_NB_IoT* const rrc_instance_pP
)
//------------------------------------------------------------------------------
{
unsigned int i;
unsigned int bit_index = 1;
uid_t uid = 0;
uid_allocator_NB_IoT_t* uia_p = &rrc_instance_pP->uid_allocator;
for (i=0; i < UID_LINEAR_ALLOCATOR_BITMAP_SIZE; i++) {
if (uia_p->bitmap[i] != UINT_MAX) {
bit_index = 1;
uid = 0;
while ((uia_p->bitmap[i] & bit_index) == bit_index) {
bit_index = bit_index << 1;
uid += 1;
}
uia_p->bitmap[i] |= bit_index;
return uid + (i*sizeof(unsigned int)*8);
}
}
return UINT_MAX;
}
//------------------------------------------------------------------------------
void
uid_linear_allocator_free_NB_IoT(
eNB_RRC_INST_NB_IoT* rrc_instance_pP,
uid_t uidP
)
//------------------------------------------------------------------------------
{
unsigned int i = uidP/sizeof(unsigned int)/8;
unsigned int bit = uidP % (sizeof(unsigned int) * 8);
unsigned int value = ~(0x00000001 << bit);
if (i < UID_LINEAR_ALLOCATOR_BITMAP_SIZE) {
rrc_instance_pP->uid_allocator.bitmap[i] &= value;
}
}
int rrc_eNB_compare_ue_rnti_id_NB_IoT(
struct rrc_eNB_ue_context_NB_IoT_s* c1_pP, struct rrc_eNB_ue_context_NB_IoT_s* c2_pP)
//------------------------------------------------------------------------------
{
if (c1_pP->ue_id_rnti > c2_pP->ue_id_rnti) {
return 1;
}
if (c1_pP->ue_id_rnti < c2_pP->ue_id_rnti) {
return -1;
}
return 0;
}
/* Generate the tree management functions for NB-IoT structures */
RB_GENERATE(rrc_ue_tree_NB_IoT_s, rrc_eNB_ue_context_NB_IoT_s, entries,
rrc_eNB_compare_ue_rnti_id_NB_IoT);
//------------------------------------------------------------------------------
struct rrc_eNB_ue_context_NB_IoT_s*
rrc_eNB_allocate_new_UE_context_NB_IoT(
eNB_RRC_INST_NB_IoT* rrc_instance_pP
)
//------------------------------------------------------------------------------
{
struct rrc_eNB_ue_context_NB_IoT_s* new_p;
new_p = malloc(sizeof(struct rrc_eNB_ue_context_NB_IoT_s));
if (new_p == NULL) {
LOG_E(RRC, "Cannot allocate new ue context\n");
return NULL;
}
memset(new_p, 0, sizeof(struct rrc_eNB_ue_context_NB_IoT_s));
new_p->local_uid = uid_linear_allocator_new_NB_IoT(rrc_instance_pP);
return new_p;
}
struct rrc_eNB_ue_context_NB_IoT_s*
rrc_eNB_get_ue_context_NB_IoT(
eNB_RRC_INST_NB_IoT* rrc_instance_pP,
rnti_t rntiP)
//------------------------------------------------------------------------------
{
rrc_eNB_ue_context_NB_IoT_t temp;
memset(&temp, 0, sizeof(struct rrc_eNB_ue_context_NB_IoT_s));
/* eNB ue rrc id = 24 bits wide */
temp.ue_id_rnti = rntiP;
return RB_FIND(rrc_ue_tree_NB_IoT_s, &rrc_instance_pP->rrc_ue_head, &temp);
}
//------------------------------------------------------------------------------
void rrc_eNB_remove_ue_context_NB_IoT(
const protocol_ctxt_t* const ctxt_pP,
eNB_RRC_INST_NB_IoT* rrc_instance_pP,
struct rrc_eNB_ue_context_NB_IoT_s* ue_context_pP)
//------------------------------------------------------------------------------
{
if (rrc_instance_pP == NULL) {
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Bad RRC instance\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
return;
}
if (ue_context_pP == NULL) {
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Trying to free a NULL UE context\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
return;
}
RB_REMOVE(rrc_ue_tree_NB_IoT_s, &rrc_instance_pP->rrc_ue_head, ue_context_pP);
MSC_LOG_EVENT(
MSC_RRC_ENB,
"0 Removed UE %"PRIx16" ",
ue_context_pP->ue_context.rnti);
rrc_eNB_free_mem_UE_context_NB_IoT(ctxt_pP, ue_context_pP);
uid_linear_allocator_free_NB_IoT(rrc_instance_pP, ue_context_pP->local_uid);
free(ue_context_pP);
LOG_I(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" Removed UE context\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
}
/*
* 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.0 (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_eNB_UE_context.h
* \brief rrc procedures for UE context
* \author Lionel GAUTHIER
* \date 2015
* \version 1.0
* \company Eurecom
* \email: lionel.gauthier@eurecom.fr
*/
#ifndef __RRC_ENB_UE_CONTEXT_NB_IoT_H__
#define __RRC_ENB_UE_CONTEXT_NB_IoT_H__
#include "collection/tree.h"
#include "COMMON/platform_types.h"
//#include "defs.h"
#include "defs_NB_IoT.h"
void
uid_linear_allocator_init_NB_IoT(
uid_allocator_NB_IoT_t* const uid_pP
);
uid_t
uid_linear_allocator_new_NB_IoT(
eNB_RRC_INST_NB_IoT* const rrc_instance_pP
);
void
uid_linear_allocator_free_NB_IoT(
eNB_RRC_INST_NB_IoT* rrc_instance_pP,
uid_t uidP
);
int rrc_eNB_compare_ue_rnti_id_NB_IoT(
struct rrc_eNB_ue_context_NB_IoT_s* c1_pP, struct rrc_eNB_ue_context_NB_IoT_s* c2_pP);
RB_PROTOTYPE(rrc_ue_tree_NB_IoT_s, rrc_eNB_ue_context_NB_IoT_s, entries, rrc_eNB_compare_ue_rnti_id_NB_IoT);
struct rrc_eNB_ue_context_NB_IoT_s*
rrc_eNB_allocate_new_UE_context_NB_IoT(
eNB_RRC_INST_NB_IoT* rrc_instance_pP
);
struct rrc_eNB_ue_context_NB_IoT_s*
rrc_eNB_get_ue_context_NB_IoT(
eNB_RRC_INST_NB_IoT* rrc_instance_pP,
rnti_t rntiP);
void rrc_eNB_remove_ue_context_NB_IoT(
const protocol_ctxt_t* const ctxt_pP,
eNB_RRC_INST_NB_IoT* rrc_instance_pP,
struct rrc_eNB_ue_context_NB_IoT_s* ue_context_pP);
#endif
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