Commit f19315aa authored by Michele Paffetti's avatar Michele Paffetti

Merge branch 'develop-nb-iot-RRC' into develop-nb-iot

parents a6f98a8b 106f3135
Develop_nb_iot_RRC Records
2017_05_16
*for the moment all the interfaces are in L2_interface_nb_iot.c
*pdcp_primitives.c --> pdcp_serialize_user_plane_data_pdu_with_short_sn_buffer (new function) --> used in NB_pdcp_data_req interface
included also in the proper header file pdcp_primitives.h
*management of SecurityModeFailure message (rrc_eNB_nb_iot.c) --> we call the NB_rrc_pdcp_config_asn1_req with a particular case for securityMode =-1;
modify NB_rrc_pdcp_config_asn1_req function in L2_interface_nb_iot.c
modify pdcp_config_set_security this particular case "else if(security_modeP == -1)"
*modified rrc_eNB_process_RRCConnectionReconfigurationComplete_NB function ---> DRBs are never deleted and ue_cuontext_pP->ue_context.DRB_active[drb_id] == 1 called only once
*modified rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB--> no need of qci switch case since only RLC-AM mode in NB-IoT (no GBR)
*LCHAN_DESC Lchan_desc[2] --> old structure and is mainly a "good practice" but non used anymore so deleted from the rrc_eNB_nb_iot.c file
*update picures in DOC/RRC_images for NB-IoT protocol stack and signalling
\ No newline at end of file
......@@ -308,6 +308,7 @@ if (NOT ${ret} STREQUAL 0)
endif (NOT ${ret} STREQUAL 0)
file(GLOB rrc_source ${RRC_FULL_DIR}/*.c)
set(rrc_source ${rrc_source} ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1_msg.c)
set(rrc_source ${rrc_source} ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1_msg_nb_iot.c)
file(GLOB rrc_h ${RRC_FULL_DIR}/*.h)
set(rrc_h ${rrc_h} ${RRC_FULL_DIR}/asn1_constants.h)
set_source_files_properties(${rrc_source} PROPERTIES COMPILE_FLAGS -w) # suppress warnings from generated code
......@@ -1112,12 +1113,16 @@ set(L2_SRC
${RLC_DIR}/rlc.c
${RLC_DIR}/rlc_rrc.c
${RLC_DIR}/rlc_mpls.c
${RRC_DIR}/vars_nb_iot.c
${RRC_DIR}/rrc_UE.c
${RRC_DIR}/rrc_eNB.c
${RRC_DIR}/rrc_eNB_nb_iot.c
${RRC_DIR}/rrc_eNB_S1AP.c
${RRC_DIR}/rrc_eNB_UE_context.c
${RRC_DIR}/rrc_common.c
${RRC_DIR}/rrc_common_nb_iot.c
${RRC_DIR}/L2_interface.c
${RRC_DIR}/L2_interface_nb_iot.c
)
set (MAC_SRC
${MAC_DIR}/lte_transport_init.c
......
......@@ -223,6 +223,8 @@ typedef struct {
/*! \brief MAC Logical Channel Descriptor
* XXX MP: is an old structure no more used actually in the code
* we left it just because it could be useful for future development
*/
typedef struct {
unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */
......
......@@ -83,8 +83,11 @@
#define MAX_MANAGED_ENB_PER_MOBILE 2
#define DEFAULT_RAB_ID 1
///NB-IOT
#define NB_RB_MAX_NB_IOT (maxDRB_NB_r13 + 3) //MP: NB_IoT --> 2(DRB)+3(SRBs - 2 is not used) = 5
#define DEFAULT_RAB_ID 1
#define NB_RB_MAX (maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */
#if defined(Rel10) || defined(Rel14)
#define NB_RB_MBMS_MAX (maxSessionPerPMCH*maxServiceCount)
......
......@@ -87,6 +87,16 @@ typedef boolean_t srb_flag_t;
#define SRB_FLAG_NO FALSE
#define SRB_FLAG_YES TRUE
///NB-IoT
typedef boolean_t srb1bis_flag_t;
#define SRB1BIS_FLAG_NO FALSE
#define SRB1BIS_FLAG_YES TRUE
typedef boolean_t mib_flag_t;
#define MIB_FLAG_YES TRUE
#define MIB_FLAG_NO FALSE
typedef enum link_direction_e {
UNKNOWN_DIR = 0,
DIR_UPLINK = 1,
......
......@@ -83,7 +83,9 @@ typedef struct RrcStateInd_s {
Rrc_Sub_State_t sub_state;
} RrcStateInd;
// eNB: ENB_APP -> RRC messages
// eNB: ENB_APP -> RRC messages---------------------------------------------------
//these parameters are set by the configuration files?
typedef struct RrcConfigurationReq_s {
uint32_t cell_identity;
......@@ -112,21 +114,29 @@ typedef struct RrcConfigurationReq_s {
int16_t Nid_cell[MAX_NUM_CCs];// for testing, change later
int16_t N_RB_DL[MAX_NUM_CCs];// for testing, change later
int nb_antennas_tx[MAX_NUM_CCs];
int nb_antennas_rx[MAX_NUM_CCs];
int nb_antennas_tx[MAX_NUM_CCs]; //MP: may no more used
int nb_antennas_rx[MAX_NUM_CCs]; //MP: may no more used
int nb_antenna_ports[MAX_NUM_CCs];
//PRACH
long prach_root[MAX_NUM_CCs];
long prach_config_index[MAX_NUM_CCs];
BOOLEAN_t prach_high_speed[MAX_NUM_CCs];
long prach_zero_correlation[MAX_NUM_CCs];
long prach_freq_offset[MAX_NUM_CCs];
//PUCCH
long pucch_delta_shift[MAX_NUM_CCs];
long pucch_nRB_CQI[MAX_NUM_CCs];
long pucch_nCS_AN[MAX_NUM_CCs];
#if !defined(Rel10) && !defined(Rel14)
long pucch_n1_AN[MAX_NUM_CCs];
#endif
//PDSCH
long pdsch_referenceSignalPower[MAX_NUM_CCs];
long pdsch_p_b[MAX_NUM_CCs];
//PUSCH
long pusch_n_SB[MAX_NUM_CCs];
long pusch_hoppingMode[MAX_NUM_CCs];
long pusch_hoppingOffset[MAX_NUM_CCs];
......@@ -137,35 +147,44 @@ typedef struct RrcConfigurationReq_s {
long pusch_nDMRS1[MAX_NUM_CCs];
long phich_duration[MAX_NUM_CCs];
long phich_resource[MAX_NUM_CCs];
//SRS
BOOLEAN_t srs_enable[MAX_NUM_CCs];
long srs_BandwidthConfig[MAX_NUM_CCs];
long srs_SubframeConfig[MAX_NUM_CCs];
BOOLEAN_t srs_ackNackST[MAX_NUM_CCs];
BOOLEAN_t srs_MaxUpPts[MAX_NUM_CCs];
//uplink power control
long pusch_p0_Nominal[MAX_NUM_CCs];
long pusch_alpha[MAX_NUM_CCs];
long pucch_p0_Nominal[MAX_NUM_CCs];
long msg3_delta_Preamble[MAX_NUM_CCs];
long ul_CyclicPrefixLength[MAX_NUM_CCs];
//related to UplinkPowerControl IE
e_DeltaFList_PUCCH__deltaF_PUCCH_Format1 pucch_deltaF_Format1[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format1b pucch_deltaF_Format1b[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format2 pucch_deltaF_Format2[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format2a pucch_deltaF_Format2a[MAX_NUM_CCs];
e_DeltaFList_PUCCH__deltaF_PUCCH_Format2b pucch_deltaF_Format2b[MAX_NUM_CCs];
long rach_numberOfRA_Preambles[MAX_NUM_CCs];
BOOLEAN_t rach_preamblesGroupAConfig[MAX_NUM_CCs];
long rach_sizeOfRA_PreamblesGroupA[MAX_NUM_CCs];
long rach_messageSizeGroupA[MAX_NUM_CCs];
e_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB rach_messagePowerOffsetGroupB[MAX_NUM_CCs];
e_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB rach_messagePowerOffsetGroupB[MAX_NUM_CCs];// not presen in NB-IoT SIB2
long rach_powerRampingStep[MAX_NUM_CCs];
long rach_preambleInitialReceivedTargetPower[MAX_NUM_CCs];
long rach_preambleTransMax[MAX_NUM_CCs];
long rach_raResponseWindowSize[MAX_NUM_CCs];
long rach_macContentionResolutionTimer[MAX_NUM_CCs];
long rach_maxHARQ_Msg3Tx[MAX_NUM_CCs];
//BCCH
long bcch_modificationPeriodCoeff[MAX_NUM_CCs];
//PCCH
long pcch_defaultPagingCycle[MAX_NUM_CCs];
long pcch_nB[MAX_NUM_CCs];
long ue_TimersAndConstants_t300[MAX_NUM_CCs];
long ue_TimersAndConstants_t301[MAX_NUM_CCs];
long ue_TimersAndConstants_t310[MAX_NUM_CCs];
......@@ -173,6 +192,66 @@ typedef struct RrcConfigurationReq_s {
long ue_TimersAndConstants_n310[MAX_NUM_CCs];
long ue_TimersAndConstants_n311[MAX_NUM_CCs];
long ue_TransmissionMode[MAX_NUM_CCs];
//NB-IoT------------------------------------------------------------
//RACH
long rach_raResponseWindowSize_NB[MAX_NUM_CCs];
long rach_macContentionResolutionTimer_NB[MAX_NUM_CCs];
long rach_powerRampingStep_NB[MAX_NUM_CCs];
long rach_preambleInitialReceivedTargetPower_NB[MAX_NUM_CCs];
long preambleTransMax_CE_NB[MAX_NUM_CCs]; //da ricontrollare se va bene il tipo
//BCCH
long bcch_modificationPeriodCoeff_NB[MAX_NUM_CCs];
//PCCH
long pcch_defaultPagingCycle_NB[MAX_NUM_CCs];
long pcch_nB_NB[MAX_NUM_CCs];
long pcch_npdcch_NumRepetitionPaging_NB[MAX_NUM_CCs];
//NPRACH
long nprach_CP_Length[MAX_NUM_CCs];
long nprach_rsrp_range_NB[MAX_NUM_CCs];
long nprach_Periodicity[MAX_NUM_CCs];
long nprach_StartTime[MAX_NUM_CCs];
long nprach_SubcarrierOffset[MAX_NUM_CCs];
long nprach_NumSubcarriers[MAX_NUM_CCs];
long nprach_SubcarrierMSG3_RangeStart[MAX_NUM_CCs];
long maxNumPreambleAttemptCE_NB[MAX_NUM_CCs];
long numRepetitionsPerPreambleAttempt_NB[MAX_NUM_CCs];
long npdcch_NumRepetitions_RA[MAX_NUM_CCs];
long npdcch_StartSF_CSS_RA[MAX_NUM_CCs];
long npdcch_Offset_RA[MAX_NUM_CCs];
//NPDSCH
long npdsch_nrs_Power[MAX_NUM_CCs];
//NPUSCH
long npusch_ack_nack_numRepetitions_NB[MAX_NUM_CCs];
long npusch_srs_SubframeConfig_NB[MAX_NUM_CCs];
long npusch_threeTone_CyclicShift_r13[MAX_NUM_CCs];
long npusch_sixTone_CyclicShift_r13[MAX_NUM_CCs];
BOOLEAN_t npusch_groupHoppingEnabled[MAX_NUM_CCs];
long npusch_groupAssignmentNPUSCH_r13[MAX_NUM_CCs];
/*NPUCCH
* all data are sent over the NPUSCH. This includes also the UL control information (UCI), which is transmitted using a different format.
* Consequently there is no equivalent to the PUCCH of LTE in NB-IoT.
*/
//DL_GapConfig
long dl_GapThreshold_NB[MAX_NUM_CCs];
long dl_GapPeriodicity_NB[MAX_NUM_CCs];
long dl_GapDurationCoeff_NB[MAX_NUM_CCs];
//Uplink power control Common
long npusch_p0_NominalNPUSCH_r13[MAX_NUM_CCs];
long npusch_alpha_r13[MAX_NUM_CCs];
long deltaPreambleMsg3_r13[MAX_NUM_CCs];
//UE timers and constants
long ue_TimersAndConstants_t300_NB[MAX_NUM_CCs];
long ue_TimersAndConstants_t301_NB[MAX_NUM_CCs];
long ue_TimersAndConstants_t310_NB[MAX_NUM_CCs];
long ue_TimersAndConstants_t311_NB[MAX_NUM_CCs];
long ue_TimersAndConstants_n310_NB[MAX_NUM_CCs];
long ue_TimersAndConstants_n311_NB[MAX_NUM_CCs];
//---------------------------------------------------------------------------
} RrcConfigurationReq;
// UE: NAS -> RRC messages
......
......@@ -130,13 +130,13 @@ rrc_mac_config_req(
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
if (eNB_flagP==0) {
if (eNB_flagP==0) { //is UE
LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_idP,eNB_index);
if (tdd_Config != NULL) {
UE_mac_inst[Mod_idP].tdd_Config = tdd_Config;
}
} else {
} else { //is eNB
UE_id = find_UE_id(Mod_idP, rntiP);
if (physicalConfigDedicated == NULL) {
LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY\n", Mod_idP, CC_idP);
......@@ -173,7 +173,7 @@ rrc_mac_config_req(
// SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup
if (logicalChannelConfig!= NULL) {
if (eNB_flagP==0) {
if (eNB_flagP==0) { //is UE
LOG_I(MAC,"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",Mod_idP,eNB_index);
UE_mac_inst[Mod_idP].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig;
UE_mac_inst[Mod_idP].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid
......
This diff is collapsed.
......@@ -69,6 +69,14 @@ schedule_SI(
//------------------------------------------------------------------------------
{
/*
* Major changes for NB-IoT needed:
* - any DCI message is transmitted for the SI-Message deconding, but all the information are inside the SIB1
* (once know the SIB1 the UE in principle should also know the TBS of the SI-Message (given by the si-TB field in schedulingInfoList)
* -given the TBS of the SI-Message the corresponding number of consecutive DL subframes for the broadcast of the SI is given (TS 36.331 si-TB):
* if TBS = 56 or 120 bits --> transmission over 2-subframes
* for every other TBS size --> transmission over 8 subframe
*/
int8_t bcch_sdu_length;
......
......@@ -38,6 +38,7 @@
#endif //USER_MODE
#include "PHY/defs.h"
#include "defs.h"
#include "defs_nb_iot.h"
#include "COMMON/mac_rrc_primitives.h"
#ifdef PHY_EMUL
//#include "SIMULATION/simulation_defs.h"
......@@ -64,6 +65,9 @@ extern UE_MAC_INST *ue_mac_inst;
extern MAC_RLC_XFACE *Mac_rlc_xface;
extern uint8_t Is_rrc_registered;
//NB-IoT
extern eNB_MAC_INST_NB *eNB_mac_inst_NB;
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
......
......@@ -37,6 +37,7 @@
#endif //USER_MODE
#include "PHY/defs.h"
#include "defs.h"
#include "defs_nb_iot.h"
#include "PHY_INTERFACE/defs.h"
#include "COMMON/mac_rrc_primitives.h"
......@@ -98,6 +99,8 @@ MAC_RLC_XFACE *Mac_rlc_xface;
/// Primary component carrier index of eNB
int pCC_id[NUMBER_OF_eNB_MAX];
//NB-IoT
eNB_MAC_INST_NB *eNB_mac_inst_NB;
eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
......
......@@ -1668,7 +1668,16 @@ pdcp_config_set_security(
pdcp_pP->cipheringAlgorithm,
pdcp_pP->integrityProtAlgorithm,
ctxt_pP->rnti);
} else {
}
/*particular case activated by SecurityModeFailure*/
else if(security_modeP == -1){
// in this way in NB_pdcp_data_req function you never call "pdcp_apply_security"
// and we never call pdcp_validate_security in NB_pdcp_data_indi
pdcp_pP->security_activated = 0;
pdcp_pP->cipheringAlgorithm = 0;
pdcp_pP->integrityProtAlgorithm = 0;
}
else {
MSC_LOG_EVENT(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
"0 Set security failed UE %"PRIx16" ",
......@@ -1680,6 +1689,7 @@ pdcp_config_set_security(
}
//-----------------------------------------------------------------------------
// MP: seems to be no more used (old code)
void
rrc_pdcp_config_req (
const protocol_ctxt_t* const ctxt_pP,
......
......@@ -160,7 +160,7 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char*
uint16_t sequence_number = pdu->sn;
pdu_buffer[1] = sequence_number & 0xFF;
sequence_number >>= 8;
pdu_buffer[0] = sequence_number & 0xFF;
pdu_buffer[0] = sequence_number & 0xFF; // sequence_number & 0x0F
/*
* Fill Data or Control field
......@@ -173,6 +173,41 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char*
return TRUE;
}
/*
* Fills the incoming buffer with the fields of the header for short SN
*
* Created for Nb-IoT purpose
*
* @param pdu_buffer PDCP PDU buffer
* @return TRUE on success, FALSE otherwise
*/
boolean_t pdcp_serialize_user_plane_data_pdu_with_short_sn_buffer(unsigned char* pdu_buffer, \
pdcp_user_plane_data_pdu_header_with_short_sn* pdu)
{
if (pdu_buffer == NULL || pdu == NULL) {
return FALSE;
}
/*
* Fill the Sequence Number field
*/
uint16_t sequence_number = pdu->sn;
pdu_buffer[0] = sequence_number & 0x7F; //is a mask that set the octec; 0111 1111 --> so the first bit (D/C field) is set to 0 (Control PDU)
/*
* Fill Data or Control field
* DC field =1 for Data PDU, and =0 for Control PDU (status report, ROCH feedback ecc..)
*/
if (pdu->dc == PDCP_DATA_PDU_BIT_SET) { //if required Data PDU
LOG_D(PDCP, "Setting PDU as a DATA PDU\n");
pdu_buffer[0] |= 0x80; // set the first bit as 1 (0x80 = 1000 0000)
}
return TRUE;
}
/*
* Fills the incoming PDU buffer with with given control PDU
*
......
......@@ -155,6 +155,18 @@ boolean_t pdcp_serialize_control_plane_data_pdu_with_SRB_sn_buffer(unsigned char
boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char* pdu_buffer, \
pdcp_user_plane_data_pdu_header_with_long_sn* pdu);
/*
* Fills the incoming buffer with the fields of the header for Short SN (RLC AM)
*
* Created for NB-IoT purposes
*
* @param pdu_buffer PDCP PDU buffer
* @return TRUE on success, FALSE otherwise
*/
boolean_t pdcp_serialize_user_plane_data_pdu_with_short_sn_buffer(unsigned char* pdu_buffer, \
pdcp_user_plane_data_pdu_header_with_short_sn* pdu);
/*
* Fills the incoming status report header with given value of bitmap
* and 'first missing pdu' sequence number
......
......@@ -134,6 +134,7 @@ typedef struct rlc_am_entity_s {
uint16_t max_retx_threshold; /*!< \brief This parameter is used by the transmitting side of each AM RLC entity to limit the number of retransmissions of an AMD PDU. */
uint16_t poll_pdu; /*!< \brief This parameter is used by the transmitting side of each AM RLC entity to trigger a poll for every pollPDU PDUs. */
uint32_t poll_byte; /*!< \brief This parameter is used by the transmitting side of each AM RLC entity to trigger a poll for every pollByte bytes. */
uint16_t enableStatusReportSN_Gap;
//---------------------------------------------------------------------
// STATISTICS
......
......@@ -70,6 +70,12 @@ typedef volatile struct {
uint32_t t_status_prohibit; /*!< \brief t-StatusProhibit timer initial value. */
} rlc_am_info_t;
typedef volatile struct {
uint16_t max_retx_threshold;
uint32_t t_poll_retransmit;
uint32_t enableStatusReportSN_Gap;
}rlc_am_info_NB_t;
//-----------------------------------------------------------------------------
/*! \fn void rlc_am_init (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP)
* \brief Initialize the RLC AM protocol instance, reset variables, allocate buffers, lists, then, the next step in order have a running RLC AM instance is to configure and set debug informations for this RLC instance.
......
......@@ -137,6 +137,7 @@ typedef volatile struct {
rlc_mode_t rlc_mode;
union {
rlc_am_info_t rlc_am_info; /*!< \sa rlc_am.h. */
rlc_am_info_NB_t rlc_am_info_NB;
rlc_tm_info_t rlc_tm_info; /*!< \sa rlc_tm.h. */
rlc_um_info_t rlc_um_info; /*!< \sa rlc_um.h. */
} rlc;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -36,6 +36,10 @@
#include "LAYER2/MAC/extern.h"
#include "LAYER2/RLC/rlc.h"
///NB_IoT
#include "defs_nb_iot.h"
extern eNB_RRC_INST_NB *eNB_rrc_inst_NB;
extern UE_RRC_INST *UE_rrc_inst;
extern eNB_RRC_INST *eNB_rrc_inst;
//extern RRC_XFACE *Rrc_xface;
......
/*
* 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 vars.h
* \brief rrc external vars
* \author Navid Nikaein and Raymond Knopp, Michele Paffetti
* \date 2011-2017
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, michele.paffetti@studio.unibo.it
*/
#ifndef __OPENAIR_RRC_EXTERN_NB_IOT_H__
#define __OPENAIR_RRC_EXTERN_NB_IOT_H__
#include "defs_nb_iot.h"
#include "COMMON/mac_rrc_primitives.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/RLC/rlc.h"
#include "LogicalChannelConfig-NB-r13.h"
//MP: NOTE:XXX some of the parameters defined in vars_nb_iot are called by the extern.h file so not replicated here
extern eNB_RRC_INST_NB *eNB_rrc_inst_NB;
extern rlc_info_t Rlc_info_um,Rlc_info_am_config,Rlc_info_am;
extern uint8_t DRB2LCHAN_NB[2];
extern LogicalChannelConfig_NB_r13_t SRB1bis_NB_logicalChannelConfig_defaultValue;
extern LogicalChannelConfig_NB_r13_t SRB1_NB_logicalChannelConfig_defaultValue;
#endif
This diff is collapsed.
......@@ -979,8 +979,6 @@ rrc_ue_update_radioResourceConfigDedicated(RadioResourceConfigDedicated_t* radio
physicalConfigDedicated2->pusch_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->pusch_ConfigDedicated));
physicalConfigDedicated2->pucch_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->pucch_ConfigDedicated));
physicalConfigDedicated2->cqi_ReportConfig = CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig));
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic
= CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic));
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->soundingRS_UL_ConfigDedicated));
physicalConfigDedicated2->schedulingRequestConfig = CALLOC(1,sizeof(*physicalConfigDedicated2->schedulingRequestConfig));
physicalConfigDedicated2->antennaInfo = CALLOC(1,sizeof(*physicalConfigDedicated2->antennaInfo));
......
This diff is collapsed.
......@@ -175,7 +175,7 @@ init_SI(
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sizeof_SIB1 = 0;
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sizeof_SIB23 = 0;
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SIB1 = (uint8_t*) malloc16(32);
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SIB1 = (uint8_t*) malloc16(32);//allocation of buffer memory
/*
printf ("before SIB1 init : Nid_cell %d\n", mac_xface->lte_frame_parms->Nid_cell);
......@@ -189,9 +189,9 @@ init_SI(
ctxt_pP->module_id,
CC_id,
mac_xface->frame_parms,
(uint8_t*)eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SIB1,
&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].siblock1,
&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib1
(uint8_t*)eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SIB1, //buffer
&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].siblock1, //BCCH_DL_SCH message (parametro in un array)
&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib1 //SystemInformationBlockType1 (puntatore dentro un array)
#if defined(ENABLE_ITTI)
, configuration
#endif
......@@ -856,7 +856,7 @@ rrc_eNB_process_RRCConnectionSetupComplete(
PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing RRCConnectionSetupComplete from UE (SRB1 Active)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
ue_context_pP->ue_context.Srb1.Active=1;
ue_context_pP->ue_context.Srb1.Active=1; //attivo SRB1
T(T_ENB_RRC_CONNECTION_SETUP_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
......@@ -1446,8 +1446,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
struct SRB_ToAddMod *SRB2_config = NULL;
struct SRB_ToAddMod__rlc_Config *SRB2_rlc_config = NULL;
struct SRB_ToAddMod__logicalChannelConfig *SRB2_lchan_config = NULL;
struct LogicalChannelConfig__ul_SpecificParameters
*SRB2_ul_SpecificParameters = NULL;
struct LogicalChannelConfig__ul_SpecificParameters *SRB2_ul_SpecificParameters = NULL;
SRB_ToAddModList_t* SRB_configList = ue_context_pP->ue_context.SRB_configList;
SRB_ToAddModList_t **SRB_configList2 = NULL;
......@@ -1523,7 +1522,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
// Configure SRB2
/// SRB2
SRB_configList2=&ue_context_pP->ue_context.SRB_configList2[xid];
SRB_configList2=&ue_context_pP->ue_context.SRB_configList2[xid]; //why no asterix?
if (*SRB_configList2) {
free(*SRB_configList2);
}
......@@ -1575,6 +1574,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
if (*DRB_configList) {
free(*DRB_configList);
}
//DRB_ConfigList era gi� stato linkato a ue_context al momento della dichiarazione
*DRB_configList = CALLOC(1, sizeof(**DRB_configList));
memset(*DRB_configList, 0, sizeof(**DRB_configList));
......@@ -2082,7 +2082,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
size = do_RRCConnectionReconfiguration(ctxt_pP,
buffer,
xid, //Transaction_id,
(SRB_ToAddModList_t*)*SRB_configList2, // SRB_configList
(SRB_ToAddModList_t*)*SRB_configList2,
(DRB_ToAddModList_t*)*DRB_configList,
(DRB_ToReleaseList_t*)NULL, // DRB2_list,
(struct SPS_Config*)NULL, // *sps_Config,
......@@ -2542,6 +2542,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
struct MeasConfig__speedStatePars *Sparams;
CellsToAddMod_t *CellToAdd;
CellsToAddModList_t *CellsToAddModList;
// srb 1: for HO
struct SRB_ToAddMod *SRB1_config;
struct SRB_ToAddMod__rlc_Config *SRB1_rlc_config;
......@@ -3447,6 +3448,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
uint8_t *kRRCint = NULL;
uint8_t *kUPenc = NULL;
DRB_ToAddModList_t* DRB_configList = ue_context_pP->ue_context.DRB_configList2[xid];
SRB_ToAddModList_t* SRB_configList = ue_context_pP->ue_context.SRB_configList2[xid];
......@@ -3562,7 +3564,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
// Loop through DRBs and establish if necessary
if (DRB_configList != NULL) {
for (i = 0; i < DRB_configList->list.count; i++) { // num max DRB (11-3-8)
for (i = 0; i < DRB_configList->list.count; i++) { // num max DRB (11-3-8) (for NB_IoT is 2 DRB)
if (DRB_configList->list.array[i]) {
drb_id = (int)DRB_configList->list.array[i]->drb_Identity;
LOG_I(RRC,
......@@ -3674,7 +3676,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
} else { // remove LCHAN from MAC/PHY
if (ue_context_pP->ue_context.DRB_active[drb_id] == 1) {
if (ue_context_pP->ue_context.DRB_active[drb_id] == 1) { //???
// DRB has just been removed so remove RLC + PDCP for DRB
/* rrc_pdcp_config_req (ctxt_pP->module_id, frameP, 1, CONFIG_ACTION_REMOVE,
(ue_mod_idP * NB_RB_MAX) + DRB2LCHAN[i],UNDEF_SECURITY_MODE);
......@@ -3751,7 +3753,7 @@ rrc_eNB_generate_RRCConnectionSetup(
(fp->nb_antenna_ports_eNB==2)?2:1, //at this point we do not have the UE capability information, so it can only be TM1 or TM2
rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id),
fp,
SRB_configList,
SRB_configList, //qui le mando come argomento puntatore di puntatore cos� vengono configurate
&ue_context_pP->ue_context.physicalConfigDedicated);
#ifdef RRC_MSG_PRINT
......@@ -3769,6 +3771,7 @@ rrc_eNB_generate_RRCConnectionSetup(
if (*SRB_configList != NULL) {
for (cnt = 0; cnt < (*SRB_configList)->list.count; cnt++) {
//sta lavorando solo con SRB1--> perch� RRCConnectionSetup setta solo SRB1 (per NB_IoT??)
if ((*SRB_configList)->list.array[cnt]->srb_Identity == 1) {
SRB1_config = (*SRB_configList)->list.array[cnt];
......@@ -3776,9 +3779,10 @@ rrc_eNB_generate_RRCConnectionSetup(
if (SRB1_config->logicalChannelConfig->present ==
SRB_ToAddMod__logicalChannelConfig_PR_explicitValue) {
SRB1_logicalChannelConfig = &SRB1_config->logicalChannelConfig->choice.explicitValue;
} else {
SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
}
else {
SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
}
} else {
SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
}
......@@ -4128,6 +4132,10 @@ rrc_eNB_decode_ccch(
((rrcConnectionReestablishmentRequest->reestablishmentCause == ReestablishmentCause_otherFailure) ? "Other Failure" :
(rrcConnectionReestablishmentRequest->reestablishmentCause == ReestablishmentCause_handoverFailure) ? "Handover Failure" :
"reconfigurationFailure"));
//qui in realt� andr� gestita diversamente senza reject sempre
/*{
uint64_t c_rnti = 0;
......@@ -4147,6 +4155,7 @@ rrc_eNB_decode_ccch(
rrc_eNB_generate_RRCConnectionReestablishmentReject(ctxt_pP,
rrc_eNB_get_ue_context(&eNB_rrc_inst[ctxt_pP->module_id], ctxt_pP->rnti),
CC_id);
break;
case UL_CCCH_MessageType__c1_PR_rrcConnectionRequest:
......@@ -4313,7 +4322,7 @@ rrc_eNB_decode_ccch(
Idx = DCCH;
// SRB1
ue_context_p->ue_context.Srb1.Active = 1;
ue_context_p->ue_context.Srb1.Srb_info.Srb_id = Idx;
ue_context_p->ue_context.Srb1.Srb_info.Srb_id = Idx; //module_id
memcpy(&ue_context_p->ue_context.Srb1.Srb_info.Lchan_desc[0],
&DCCH_LCHAN_DESC,
LCHAN_DESC_SIZE);
......@@ -4321,7 +4330,7 @@ rrc_eNB_decode_ccch(
&DCCH_LCHAN_DESC,
LCHAN_DESC_SIZE);
// SRB2: set it to go through SRB1 with id 1 (DCCH)
// SRB2: set it to go through SRB1 with id 1 (DCCH) ????
ue_context_p->ue_context.Srb2.Active = 1;
ue_context_p->ue_context.Srb2.Srb_info.Srb_id = Idx;
memcpy(&ue_context_p->ue_context.Srb2.Srb_info.Lchan_desc[0],
......@@ -4929,6 +4938,8 @@ rrc_eNB_decode_dcch(
}
#if defined(ENABLE_ITTI)
// This function triggers the establishemnt of dedicated bearer in the absence of EPC
// to emulate it only establish 3 bearers but it can also establish 10 dedicated bearers.
void rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_t* ue_context_pP){
......
......@@ -48,6 +48,17 @@ uid_linear_allocator_init(
memset(uid_pP, 0, sizeof(uid_allocator_t));
}
//------------------------------------------------------------------------------
void
uid_linear_allocator_init_NB(
uid_allocator_NB_t* const uid_pP
)
//------------------------------------------------------------------------------
{
memset(uid_pP, 0, sizeof(uid_allocator_NB_t));
}
//------------------------------------------------------------------------------
uid_t
uid_linear_allocator_new(
......@@ -155,6 +166,21 @@ rrc_eNB_get_ue_context(
}
//--(NB-IoT implementation)-----------------------------------------------------
struct rrc_eNB_ue_context_NB_s*
rrc_eNB_get_ue_context_NB(
eNB_RRC_INST_NB* rrc_instance_pP,
rnti_t rntiP)
//------------------------------------------------------------------------------
{
rrc_eNB_ue_context_NB_t temp;
memset(&temp, 0, sizeof(struct rrc_eNB_ue_context_NB_s));
/* eNB ue rrc id = 24 bits wide */
temp.ue_id_rnti = rntiP;
return RB_FIND(rrc_ue_tree_s, &rrc_instance_pP->rrc_ue_head, &temp);
}
//------------------------------------------------------------------------------
void rrc_eNB_remove_ue_context(
const protocol_ctxt_t* const ctxt_pP,
......
......@@ -31,6 +31,7 @@
#include "collection/tree.h"
#include "COMMON/platform_types.h"
#include "defs.h"
#include "defs_nb_iot.h"
void
......@@ -71,6 +72,12 @@ rrc_eNB_get_ue_context(
rnti_t rntiP
);
//NB-IoT
struct rrc_eNB_ue_context_NB_s*
rrc_eNB_get_ue_context_NB(
eNB_RRC_INST_NB* rrc_instance_pP,
rnti_t rntiP);
void rrc_eNB_remove_ue_context(
const protocol_ctxt_t* const ctxt_pP,
eNB_RRC_INST* rrc_instance_pP,
......
This diff is collapsed.
......@@ -64,7 +64,6 @@ unsigned short Data_to_read;
#define MAX_U32 0xFFFFFFFF
uint8_t DRB2LCHAN[8];
long logicalChannelGroup0 = 0;
long logicalChannelSR_Mask_r9=0;
......@@ -102,7 +101,10 @@ LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue = {ul_SpecificPara
};
//CONSTANTS
rlc_info_t Rlc_info_um,Rlc_info_am_config;
rlc_info_t Rlc_info_um,Rlc_info_am_config,
//NB-IoT
Rlc_info_am;
uint16_t RACH_FREQ_ALLOC;
//uint8_t NB_RACH;
LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC,DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
......
This diff is collapsed.
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