Commit 4729dd67 authored by Michele Paffetti's avatar Michele Paffetti

start implementation of initialization path for nb-iot and if-module

parent 7c5585fb
...@@ -567,6 +567,12 @@ add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchang ...@@ -567,6 +567,12 @@ add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchang
add_boolean_option(FLEXRAN_AGENT_SB_IF False "enable FlexRAN agent to inteface with a SDN controller") add_boolean_option(FLEXRAN_AGENT_SB_IF False "enable FlexRAN agent to inteface with a SDN controller")
################################################################
# NB-IOT
################################################################
add_boolean_option(NB_IOT True "Enabling NB-IoT code")
######################## ########################
# Include order # Include order
########################## ##########################
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "PHY/defs.h" #include "PHY/defs.h"
#include "PHY_INTERFACE/defs.h" #include "PHY_INTERFACE/defs.h"
#include "PHY_INTERFACE/IF_Module_nb_iot.h"
extern char* namepointer_chMag ; extern char* namepointer_chMag ;
extern char* namepointer_log2; extern char* namepointer_log2;
...@@ -53,6 +54,7 @@ extern PHY_VARS_eNB * PHY_vars_eNB_g[MAX_eNB][MAX_NUM_CCs]; ...@@ -53,6 +54,7 @@ extern PHY_VARS_eNB * PHY_vars_eNB_g[MAX_eNB][MAX_NUM_CCs];
#endif #endif
extern MAC_xface *mac_xface; extern MAC_xface *mac_xface;
extern IF_Module_t *if_inst;
extern short primary_synch0[144]; extern short primary_synch0[144];
......
...@@ -263,19 +263,18 @@ void NB_rx_sdu(const module_id_t enb_mod_idP, ...@@ -263,19 +263,18 @@ void NB_rx_sdu(const module_id_t enb_mod_idP,
// kill RA procedure // kill RA procedure
} }
if (Is_rrc_registered == 1) if (Is_rrc_nb_iot_registered == 1)
/* In RRC branch //MP: send directly the information to the RRC in case of CCCH (SRB0)
NB_mac_rrc_data_ind(
NB_mac_rrc_data_ind_eNB(
enb_mod_idP, enb_mod_idP,
CC_idP, CC_idP,
frameP,subframeP, frameP,
subframeP,
rntiP, rntiP,
CCCH, CCCH,
(uint8_t*)payload_ptr, (uint8_t*)payload_ptr,
rx_lengths[i], rx_lengths[i]);
ENB_FLAG_YES,
enb_mod_idP,
0);*/
if (num_ce >0) { // handle msg3 which is not RRCConnectionRequest if (num_ce >0) { // handle msg3 which is not RRCConnectionRequest
......
...@@ -69,9 +69,6 @@ extern UE_MAC_INST *ue_mac_inst; ...@@ -69,9 +69,6 @@ extern UE_MAC_INST *ue_mac_inst;
extern MAC_RLC_XFACE *Mac_rlc_xface; extern MAC_RLC_XFACE *Mac_rlc_xface;
extern uint8_t Is_rrc_registered; 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_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_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
...@@ -127,6 +124,14 @@ extern DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu1; ...@@ -127,6 +124,14 @@ extern DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu1;
extern DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu2; extern DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu2;
extern DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu1E; extern DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu1E;
//NB-IoT---------------------------------
extern eNB_MAC_INST_NB *eNB_mac_inst_NB;
extern uint8_t Is_rrc_nb_iot_registered;
#endif //DEF_H #endif //DEF_H
...@@ -399,8 +399,12 @@ int mac_init_global_param(void) ...@@ -399,8 +399,12 @@ int mac_init_global_param(void)
// Mac_rlc_xface->mrbch_phy_sync_failure=mrbch_phy_sync_failure; // Mac_rlc_xface->mrbch_phy_sync_failure=mrbch_phy_sync_failure;
// Mac_rlc_xface->dl_phy_sync_success=dl_phy_sync_success; // Mac_rlc_xface->dl_phy_sync_success=dl_phy_sync_success;
#ifndef NB_IOT
LOG_I(MAC,"[MAIN] RLC interface setup and init\n"); LOG_I(MAC,"[MAIN] RLC interface setup and init\n");
rrc_init_global_param(); rrc_init_global_param();
//MP: otherwise we call the initialization of the RRC NB-IoT module (see mac_init_global_param_NB)
#endif
#ifdef USER_MODE #ifdef USER_MODE
pdcp_layer_init (); pdcp_layer_init ();
......
...@@ -65,7 +65,8 @@ uint8_t *NB_get_dlsch_sdu(module_id_t module_idP,int CC_id,frame_t frameP,rnti_t ...@@ -65,7 +65,8 @@ uint8_t *NB_get_dlsch_sdu(module_id_t module_idP,int CC_id,frame_t frameP,rnti_t
int NB_rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP); int NB_rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP);
int NB_l2_init_eNB(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,uint8_t cba_group_active, uint8_t HO_active); int NB_l2_init_eNB(void);
int mac_init_global_param_NB(void);
...@@ -103,9 +103,6 @@ MAC_RLC_XFACE *Mac_rlc_xface; ...@@ -103,9 +103,6 @@ MAC_RLC_XFACE *Mac_rlc_xface;
/// Primary component carrier index of eNB /// Primary component carrier index of eNB
int pCC_id[NUMBER_OF_eNB_MAX]; 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 eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8 eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
...@@ -157,6 +154,14 @@ DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu2; ...@@ -157,6 +154,14 @@ DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu2;
DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu1E; DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu1E;
//NB-IoT--------------------------------------
eNB_MAC_INST_NB *eNB_mac_inst_NB;
//should be utilized in: NB_schedule_RA,NB_rx_sdu, mac_top_init_NB,
uint8_t Is_rrc_nb_iot_registered;
#endif #endif
...@@ -69,6 +69,15 @@ extern int otg_enabled; ...@@ -69,6 +69,15 @@ extern int otg_enabled;
#endif #endif
#ifdef NB_IOT
#include "openair2/RRC/LITE/proto_nb_iot.h"
#undef maxDRB
#define maxDRB maxDRB_NB_r13
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/* /*
* If PDCP_UNIT_TEST is set here then data flow between PDCP and RLC is broken * If PDCP_UNIT_TEST is set here then data flow between PDCP and RLC is broken
...@@ -1972,6 +1981,7 @@ void pdcp_layer_init(void) ...@@ -1972,6 +1981,7 @@ void pdcp_layer_init(void)
memset(Pdcp_stats_rx_rate, 0, sizeof(Pdcp_stats_rx_rate)); memset(Pdcp_stats_rx_rate, 0, sizeof(Pdcp_stats_rx_rate));
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void pdcp_layer_cleanup (void) void pdcp_layer_cleanup (void)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -375,6 +375,12 @@ protected_pdcp_fifo(int pdcp_fifo_read_input_sdus ( ...@@ -375,6 +375,12 @@ protected_pdcp_fifo(int pdcp_fifo_read_input_sdus (
protected_pdcp_fifo(void pdcp_fifo_read_input_sdus_from_otg ( protected_pdcp_fifo(void pdcp_fifo_read_input_sdus_from_otg (
const protocol_ctxt_t* const ctxt_pP);) const protocol_ctxt_t* const ctxt_pP);)
//NB-IoT
public_pdcp(void pdcp_layer_init_NB(void);)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/* /*
......
...@@ -134,7 +134,16 @@ typedef struct rlc_am_entity_s { ...@@ -134,7 +134,16 @@ 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 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. */ 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. */ 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. */
uint32_t enableStatusReportSN_Gap;
//----------------------------------------------------
// NB-IOT RLC Parameters
//----------------------------------------------------
//DL-AM-RLC Config NB-IoT parameter
uint32_t* enableStatusReportSN_Gap;
//UL-AM-RLC Config. NB-IoT parameter
uint16_t max_retx_threshold_NB;
rlc_am_timer_t t_poll_retransmit_NB; //TIMER
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// STATISTICS // STATISTICS
......
...@@ -71,9 +71,11 @@ typedef volatile struct { ...@@ -71,9 +71,11 @@ typedef volatile struct {
} rlc_am_info_t; } rlc_am_info_t;
typedef volatile struct { typedef volatile struct {
uint16_t max_retx_threshold; //UL-AM-RLC Configurations
uint32_t t_poll_retransmit; uint16_t max_retx_threshold_NB;
uint32_t enableStatusReportSN_Gap; uint32_t t_poll_retransmit_NB;
//DL-AM-RLC Configurations
uint32_t* enableStatusReportSN_Gap; /*OPTIONAL*/
}rlc_am_info_NB_t; }rlc_am_info_NB_t;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -48,6 +48,13 @@ extern boolean_t pdcp_data_ind( ...@@ -48,6 +48,13 @@ extern boolean_t pdcp_data_ind(
//#define TRACE_RLC_PAYLOAD 1 //#define TRACE_RLC_PAYLOAD 1
#define DEBUG_RLC_DATA_REQ 1 #define DEBUG_RLC_DATA_REQ 1
#ifdef NB_IOT
#include "openair2/RRC/LITE/proto_nb_iot.h"
#undef maxDRB
#define maxDRB maxDRB_NB_r13
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char* dataP, const signed long sizeP) void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char* dataP, const signed long sizeP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -613,6 +620,11 @@ rlc_module_init (void) ...@@ -613,6 +620,11 @@ rlc_module_init (void)
rlc_rrc_data_ind = NULL; rlc_rrc_data_ind = NULL;
rlc_rrc_data_conf = NULL; rlc_rrc_data_conf = NULL;
//NB-IOT---------------------------------------------------------------
//MP: change variable maxDRB for NB-IoT --> see ifdef at the beginning
rlc_rrc_data_ind_NB = NULL;
//-------------------------------------------------------------------
rlc_coll_p = hashtable_create ((maxDRB + 2) * 16, NULL, rb_free_rlc_union); rlc_coll_p = hashtable_create ((maxDRB + 2) * 16, NULL, rb_free_rlc_union);
AssertFatal(rlc_coll_p != NULL, "UNRECOVERABLE error, RLC hashtable_create failed"); AssertFatal(rlc_coll_p != NULL, "UNRECOVERABLE error, RLC hashtable_create failed");
...@@ -650,6 +662,8 @@ rlc_module_init (void) ...@@ -650,6 +662,8 @@ rlc_module_init (void)
return(0); return(0);
} }
//-----------------------------------------------------------------------------
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rlc_module_cleanup (void) rlc_module_cleanup (void)
......
...@@ -137,7 +137,7 @@ typedef volatile struct { ...@@ -137,7 +137,7 @@ typedef volatile struct {
rlc_mode_t rlc_mode; rlc_mode_t rlc_mode;
union { union {
rlc_am_info_t rlc_am_info; /*!< \sa rlc_am.h. */ rlc_am_info_t rlc_am_info; /*!< \sa rlc_am.h. */
rlc_am_info_NB_t rlc_am_info_NB; rlc_am_info_NB_t rlc_am_info_NB; //integrate NB-IoT
rlc_tm_info_t rlc_tm_info; /*!< \sa rlc_tm.h. */ rlc_tm_info_t rlc_tm_info; /*!< \sa rlc_tm.h. */
rlc_um_info_t rlc_um_info; /*!< \sa rlc_um.h. */ rlc_um_info_t rlc_um_info; /*!< \sa rlc_um.h. */
} rlc; } rlc;
...@@ -177,6 +177,8 @@ typedef struct { ...@@ -177,6 +177,8 @@ typedef struct {
#define RLC_MAX_MBMS_LC (maxSessionPerPMCH * maxServiceCount) #define RLC_MAX_MBMS_LC (maxSessionPerPMCH * maxServiceCount)
#define RLC_MAX_LC ((max_val_DRB_Identity+1)* NUMBER_OF_UE_MAX) #define RLC_MAX_LC ((max_val_DRB_Identity+1)* NUMBER_OF_UE_MAX)
//pointer functions
protected_rlc(void (*rlc_rrc_data_ind)( protected_rlc(void (*rlc_rrc_data_ind)(
const protocol_ctxt_t* const ctxtP, const protocol_ctxt_t* const ctxtP,
const rb_id_t rb_idP, const rb_id_t rb_idP,
...@@ -189,6 +191,7 @@ protected_rlc(void (*rlc_rrc_data_conf)( ...@@ -189,6 +191,7 @@ protected_rlc(void (*rlc_rrc_data_conf)(
const mui_t muiP, const mui_t muiP,
const rlc_tx_status_t statusP);) const rlc_tx_status_t statusP);)
//define the type of the function that return void and take in input that parameters
typedef void (rrc_data_ind_cb_t)( typedef void (rrc_data_ind_cb_t)(
const protocol_ctxt_t* const ctxtP, const protocol_ctxt_t* const ctxtP,
const rb_id_t rb_idP, const rb_id_t rb_idP,
...@@ -202,6 +205,28 @@ typedef void (rrc_data_conf_cb_t)( ...@@ -202,6 +205,28 @@ typedef void (rrc_data_conf_cb_t)(
const rlc_tx_status_t statusP); const rlc_tx_status_t statusP);
//------------------------------------------------
// NB-IoT (may this stuff are no more used)
//------------------------------------------------
//pointer functions
protected_rlc(void (*rlc_rrc_data_ind_NB)(
const protocol_ctxt_t* const ctxtP,
const rb_id_t rb_idP,
const sdu_size_t sdu_sizeP,
const uint8_t * const sduP,
const srb1bis_flag_t srb1bis_flag);)
typedef void (rrc_data_ind_cb_NB_t)(
const protocol_ctxt_t* const ctxtP,
const rb_id_t rb_idP,
const sdu_size_t sdu_sizeP,
const uint8_t * const sduP,
const srb1bis_flag_t srb1bis_flag);
//------------------------------------------------
/*! \struct rlc_t /*! \struct rlc_t
* \brief Structure to be instanciated to allocate memory for RLC protocol instances. * \brief Structure to be instanciated to allocate memory for RLC protocol instances.
*/ */
......
...@@ -800,6 +800,7 @@ rlc_op_status_t rrc_rlc_data_req ( ...@@ -800,6 +800,7 @@ rlc_op_status_t rrc_rlc_data_req (
void rrc_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_data_conf_cb_t rrc_data_confP) void rrc_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_data_conf_cb_t rrc_data_confP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
rlc_rrc_data_ind = rrc_data_indP; rlc_rrc_data_ind = rrc_data_indP;
rlc_rrc_data_conf = rrc_data_confP; rlc_rrc_data_conf = rrc_data_confP;
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
//called at initialization of L2 //called at initialization of L2
IF_Module_t* IF_Module_init_L2(void) //southbound IF-Module Interface IF_Module_t* IF_Module_init_L2(void) // northbound IF-Module Interface
{ {
//mapping the IF-Module function to L2 definition //mapping the IF-Module function to L2 definition
if_inst->UL_indication = UL_indication; if_inst->UL_indication = UL_indication;
...@@ -15,7 +15,7 @@ IF_Module_t* IF_Module_init_L2(void) //southbound IF-Module Interface ...@@ -15,7 +15,7 @@ IF_Module_t* IF_Module_init_L2(void) //southbound IF-Module Interface
} }
//called at initialization of L1 (phy_init_lte_eNB) //called at initialization of L1 (phy_init_lte_eNB)
IF_Module_t* IF_Module_init_L1(void) //northbound IF-Module Interface IF_Module_t* IF_Module_init_L1(void) //southbound IF-Module Interface
{ {
//mapping the IF-module function to L1 definition //mapping the IF-module function to L1 definition
if_inst->schedule_response = schedule_response; if_inst->schedule_response = schedule_response;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
unsigned int mac_debug; unsigned int mac_debug;
//MAC_xface *mac_xface; //MAC_xface *mac_xface;
IF_Module_t* if_inst;
//MACPHY_PARAMS MACPHY_params; //MACPHY_PARAMS MACPHY_params;
......
...@@ -108,6 +108,20 @@ extern void rlc_am_init_timer_poll_retransmit( ...@@ -108,6 +108,20 @@ extern void rlc_am_init_timer_poll_retransmit(
rlc_am_entity_t* const rlc_pP, rlc_am_entity_t* const rlc_pP,
const uint32_t time_outP); const uint32_t time_outP);
//pointer function in rlc.h file
extern void (*rlc_rrc_data_ind_NB)(
const protocol_ctxt_t* const ctxtP,
const rb_id_t rb_idP,
const sdu_size_t sdu_sizeP,
const uint8_t * const sduP,
const srb1bis_flag_t srb1bis_flag);
extern void (*rlc_rrc_data_conf)(
const protocol_ctxt_t* const ctxtP,
const rb_id_t rb_idP,
const mui_t muiP,
const rlc_tx_status_t statusP);
/*---------------------------------RRC-MAC-----------------------------------*/ /*---------------------------------RRC-MAC-----------------------------------*/
...@@ -404,7 +418,7 @@ int NB_rrc_mac_config_req_eNB( ...@@ -404,7 +418,7 @@ int NB_rrc_mac_config_req_eNB(
/*NPUSCH ConfigCommon*/ /*NPUSCH ConfigCommon*/
//a pointer to the first element of the list //a pointer to the first element of the list
config_INFO->extra_phy_parms.ack_nack_numRepetitions_MSG4 = &radioResourceConfigCommon->npusch_ConfigCommon_r13.ack_NACK_NumRepetitions_Msg4_r13.list.array[0]; config_INFO->extra_phy_parms.ack_nack_numRepetitions_MSG4 = radioResourceConfigCommon->npusch_ConfigCommon_r13.ack_NACK_NumRepetitions_Msg4_r13.list.array[0];
if(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13 != NULL)/* OPTIONAL */ if(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13 != NULL)/* OPTIONAL */
...@@ -929,7 +943,7 @@ int8_t NB_mac_rrc_data_req_eNB( ...@@ -929,7 +943,7 @@ int8_t NB_mac_rrc_data_req_eNB(
} }
//defined in L2_interface //defined in L2_interface
//called by rx_sdu only in case of CCCH message (e.g RRCConnectionRequest-NB) //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 NB_mac_rrc_data_ind_eNB(
const module_id_t module_idP, const module_id_t module_idP,
const int CC_id, const int CC_id,
...@@ -948,8 +962,7 @@ int8_t NB_mac_rrc_data_ind_eNB( ...@@ -948,8 +962,7 @@ int8_t NB_mac_rrc_data_ind_eNB(
/* for no gcc warnings */ /* for no gcc warnings */
(void)sdu_size; (void)sdu_size;
//MP: XXX eNB_index (last parameter) set = 0 (verify) PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, rntiP, frameP, sub_frameP,module_idP);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, rntiP, frameP, sub_frameP,0);
Srb_info = &eNB_rrc_inst_NB[module_idP].carrier[CC_id].Srb0; Srb_info = &eNB_rrc_inst_NB[module_idP].carrier[CC_id].Srb0;
LOG_T(RRC,"[eNB %d] Received SDU for CCCH on SRB %d\n",module_idP,Srb_info->Srb_id); LOG_T(RRC,"[eNB %d] Received SDU for CCCH on SRB %d\n",module_idP,Srb_info->Srb_id);
...@@ -2200,6 +2213,8 @@ boolean_t NB_pdcp_data_req( ...@@ -2200,6 +2213,8 @@ boolean_t NB_pdcp_data_req(
//defined in L2_interface //defined in L2_interface
//called by the PDCP in the pdcp_data_ind
//mapped to rlc_rrc_data_ind (but maybe no more used for this purpose)
void NB_rrc_data_ind( void NB_rrc_data_ind(
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t* const ctxt_pP,
const rb_id_t Srb_id, const rb_id_t Srb_id,
...@@ -2475,7 +2490,7 @@ void NB_config_req_rlc_am_asn1 ( ...@@ -2475,7 +2490,7 @@ void NB_config_req_rlc_am_asn1 (
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
l_rlc_p = &rlc_union_p->rlc.am; l_rlc_p = &rlc_union_p->rlc.am;
//MP: TODO: check if this conditions are correct //MP: check if this conditions are correct
if ((config_am_pP->ul_AM_RLC_r13.maxRetxThreshold_r13 <= UL_AM_RLC_NB_r13__maxRetxThreshold_r13_t32) && if ((config_am_pP->ul_AM_RLC_r13.maxRetxThreshold_r13 <= UL_AM_RLC_NB_r13__maxRetxThreshold_r13_t32) &&
(config_am_pP->ul_AM_RLC_r13.t_PollRetransmit_r13 < T_PollRetransmit_NB_r13_spare1) (config_am_pP->ul_AM_RLC_r13.t_PollRetransmit_r13 < T_PollRetransmit_NB_r13_spare1)
&&(config_am_pP->dl_AM_RLC_r13.enableStatusReportSN_Gap_r13 == NULL)) &&(config_am_pP->dl_AM_RLC_r13.enableStatusReportSN_Gap_r13 == NULL))
...@@ -2546,10 +2561,10 @@ NB_rlc_am_configure( ...@@ -2546,10 +2561,10 @@ NB_rlc_am_configure(
//FIXME: rlc_am_entity_t should be modified?? //FIXME: rlc_am_entity_t should be modified??
rlc_pP->max_retx_threshold = max_retx_thresholdP; rlc_pP->max_retx_threshold_NB = max_retx_thresholdP;
rlc_pP->protocol_state = RLC_DATA_TRANSFER_READY_STATE; rlc_pP->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
rlc_pP->t_poll_retransmit.ms_duration = t_poll_retransmitP; rlc_pP->t_poll_retransmit_NB.ms_duration = t_poll_retransmitP;
rlc_pP->enableStatusReportSN_Gap = *enableStatusReportSN_Gap; rlc_pP->enableStatusReportSN_Gap = enableStatusReportSN_Gap;
} else { } else {
...@@ -2560,9 +2575,9 @@ NB_rlc_am_configure( ...@@ -2560,9 +2575,9 @@ NB_rlc_am_configure(
//enableStatusReportSN_Gap //enableStatusReportSN_Gap
); );
rlc_pP->max_retx_threshold = max_retx_thresholdP; rlc_pP->max_retx_threshold_NB = max_retx_thresholdP;
rlc_pP->protocol_state = RLC_DATA_TRANSFER_READY_STATE; rlc_pP->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
rlc_pP->enableStatusReportSN_Gap = *enableStatusReportSN_Gap; rlc_pP->enableStatusReportSN_Gap = enableStatusReportSN_Gap;
rlc_am_init_timer_poll_retransmit(ctxt_pP, rlc_pP, t_poll_retransmitP); rlc_am_init_timer_poll_retransmit(ctxt_pP, rlc_pP, t_poll_retransmitP);
...@@ -2842,17 +2857,17 @@ NB_config_req_rlc_am ( ...@@ -2842,17 +2857,17 @@ NB_config_req_rlc_am (
LOG_D(RLC, LOG_D(RLC,
PROTOCOL_RLC_AM_CTXT_FMT" CONFIG_REQ (max_retx_threshold=%d t_poll_retransmit=%d)\n", PROTOCOL_RLC_AM_CTXT_FMT" CONFIG_REQ (max_retx_threshold=%d t_poll_retransmit=%d)\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p), PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
config_am_pP->max_retx_threshold, config_am_pP->max_retx_threshold_NB,
config_am_pP->t_poll_retransmit config_am_pP->t_poll_retransmit_NB
//enableStatusReportSN_Gap_r13 //enableStatusReportSN_Gap_r13
); );
rlc_am_init(ctxt_pP, l_rlc_p); rlc_am_init(ctxt_pP, l_rlc_p);
rlc_am_set_debug_infos(ctxt_pP, l_rlc_p, srb_flagP, rb_idP, chan_idP); rlc_am_set_debug_infos(ctxt_pP, l_rlc_p, srb_flagP, rb_idP, chan_idP);
NB_rlc_am_configure(ctxt_pP, NB_rlc_am_configure(ctxt_pP,
l_rlc_p, l_rlc_p,
config_am_pP->max_retx_threshold, config_am_pP->max_retx_threshold_NB,
config_am_pP->t_poll_retransmit, config_am_pP->t_poll_retransmit_NB,
&config_am_pP->enableStatusReportSN_Gap); config_am_pP->enableStatusReportSN_Gap);
} else { } else {
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" CONFIG_REQ RLC NOT FOUND\n", LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" CONFIG_REQ RLC NOT FOUND\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p)); PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p));
...@@ -2917,7 +2932,8 @@ rlc_op_status_t NB_rrc_rlc_remove_ue ( ...@@ -2917,7 +2932,8 @@ rlc_op_status_t NB_rrc_rlc_remove_ue (
} }
} }
for (rb_id = 1; rb_id <= maxDRB_NB_r13; rb_id++) { //FIXME: maxDRB_NB_r13 +3 ?? //XXX possible BUG here???
for (rb_id = 1; rb_id <= maxDRB_NB_r13 + 3; rb_id++) {
if(rb_id != 2){ if(rb_id != 2){
NB_rrc_rlc_remove_rlc(ctxt_pP, NB_rrc_rlc_remove_rlc(ctxt_pP,
SRB_FLAG_NO, SRB_FLAG_NO,
...@@ -2932,10 +2948,15 @@ rlc_op_status_t NB_rrc_rlc_remove_ue ( ...@@ -2932,10 +2948,15 @@ rlc_op_status_t NB_rrc_rlc_remove_ue (
} }
//defined in rlc_rrc.c --> NO MORE USED PROBABLY //defined in rlc_rrc.c --> NO MORE USED PROBABLY
//void NB_rrc_rlc_register_rrc ( //------------------------------------------------------------------------------
// rrc_data_ind_cb_t rrc_data_indP, void rrc_rlc_register_rrc_NB (rrc_data_ind_cb_NB_t NB_rrc_data_indP, rrc_data_conf_cb_t rrc_data_confP)
// rrc_data_conf_cb_t rrc_data_confP {
// ); //his function is called by RRC to register its DATA-INDICATE and DATA-CONFIRM handlers to RLC laye
//map the function pointer to the function in input
//rlc_rrc_data_ind and rlc_rrc_data_conf are protected internal functions in the rlc.c file
rlc_rrc_data_ind_NB = NB_rrc_data_indP;
rlc_rrc_data_conf = rrc_data_confP;
}
/*--------------------------------------------RLC-PDCP--------------------------------------------------*/ /*--------------------------------------------RLC-PDCP--------------------------------------------------*/
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
extern eNB_RRC_INST_NB *eNB_rrc_inst_NB; extern eNB_RRC_INST_NB *eNB_rrc_inst_NB;
extern rlc_info_t Rlc_info_um,Rlc_info_am_config,Rlc_info_am; extern rlc_info_t Rlc_info_am_NB,Rlc_info_am_config_NB;
extern uint8_t DRB2LCHAN_NB[2]; extern uint8_t DRB2LCHAN_NB[2];
extern LogicalChannelConfig_NB_r13_t SRB1bis_NB_logicalChannelConfig_defaultValue; extern LogicalChannelConfig_NB_r13_t SRB1bis_NB_logicalChannelConfig_defaultValue;
extern LogicalChannelConfig_NB_r13_t SRB1_NB_logicalChannelConfig_defaultValue; extern LogicalChannelConfig_NB_r13_t SRB1_NB_logicalChannelConfig_defaultValue;
......
...@@ -384,6 +384,13 @@ rlc_op_status_t NB_rlc_data_req (const protocol_ctxt_t* const ctxt_pP, ...@@ -384,6 +384,13 @@ rlc_op_status_t NB_rlc_data_req (const protocol_ctxt_t* const ctxt_pP,
mem_block_t *sdu_pP); mem_block_t *sdu_pP);
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
//defined in rlc_rrc.c --> NO MORE USED PROBABLY
//------------------------------------------------------------------------------
void rrc_rlc_register_rrc_NB (rrc_data_ind_cb_NB_t NB_rrc_data_indP, rrc_data_conf_cb_t rrc_data_confP);
//defined in pdcp.c //defined in pdcp.c
//FIXME: should go transparent through the PDCP //FIXME: should go transparent through the PDCP
//-------------------------------------------- //--------------------------------------------
......
...@@ -191,6 +191,7 @@ L3_xface_init( ...@@ -191,6 +191,7 @@ L3_xface_init(
#else #else
//MP: rtf_create(fifo ID, size in bytes) --> for creating FIFO
ret=rtf_create(RRC2RRM_FIFO,32768); ret=rtf_create(RRC2RRM_FIFO,32768);
if (ret < 0) { if (ret < 0) {
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "defs_nb_iot.h" #include "defs_nb_iot.h"
#include "extern.h" #include "extern.h"
#include "extern_nb_iot.h"
#include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/extern.h"
#include "COMMON/openair_defs.h" #include "COMMON/openair_defs.h"
#include "COMMON/platform_types.h" #include "COMMON/platform_types.h"
...@@ -41,6 +42,7 @@ ...@@ -41,6 +42,7 @@
#include "pdcp.h" #include "pdcp.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "rrc_eNB_UE_context.h" #include "rrc_eNB_UE_context.h"
#include "proto_nb_iot.h"
#ifdef LOCALIZATION #ifdef LOCALIZATION
#include <sys/time.h> #include <sys/time.h>
...@@ -92,7 +94,7 @@ rrc_t310_expiration_NB( ...@@ -92,7 +94,7 @@ rrc_t310_expiration_NB(
SRB_FLAG_YES, SRB_FLAG_YES,
CONFIG_ACTION_REMOVE, CONFIG_ACTION_REMOVE,
UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Srb_info.Srb_id, UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Srb_info.Srb_id,
Rlc_info_am); Rlc_info_am_NB);
UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Active = 0; UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Active = 0;
...@@ -157,28 +159,23 @@ rrc_init_global_param_NB( ...@@ -157,28 +159,23 @@ rrc_init_global_param_NB(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc //may no more used (defined in rlc_rrc.c)
rrc_rlc_register_rrc_NB (NB_rrc_data_ind, NULL); //register with rlc
//XXX MP: most probably ALL of this stuff are no more needed (also the one not commented) //XXX MP: most probably ALL of this stuff are no more needed (also the one not commented)
// DCCH_LCHAN_DESC.transport_block_size = 4; //DCCH_LCHAN_DESC.transport_block_size = 4;....
// DCCH_LCHAN_DESC.max_transport_blocks = 16;
// DCCH_LCHAN_DESC.Delay_class = 1; //Setting of this values????
// DTCH_DL_LCHAN_DESC.transport_block_size = 52; Rlc_info_am_config_NB.rlc_mode = RLC_MODE_AM; //only allowed for NB-IoT
// DTCH_DL_LCHAN_DESC.max_transport_blocks = 20; Rlc_info_am_config_NB.rlc.rlc_am_info_NB.max_retx_threshold_NB = 50;
// DTCH_DL_LCHAN_DESC.Delay_class = 1; Rlc_info_am_config_NB.rlc.rlc_am_info_NB.t_poll_retransmit_NB = 15;
// DTCH_UL_LCHAN_DESC.transport_block_size = 52; Rlc_info_am_config_NB.rlc.rlc_am_info_NB.enableStatusReportSN_Gap = NULL; //should be disabled
// DTCH_UL_LCHAN_DESC.max_transport_blocks = 20;
// DTCH_UL_LCHAN_DESC.Delay_class = 1;
Rlc_info_am_config.rlc_mode = RLC_MODE_AM;
Rlc_info_am_config.rlc.rlc_am_info_NB.max_retx_threshold = 50;
Rlc_info_am_config.rlc.rlc_am_info_NB.t_poll_retransmit = 15;
Rlc_info_am_config.rlc.rlc_am_info_NB.enableStatusReportSN_Gap = 0; //FIXME MP: should be disabled
#ifndef NO_RRM #ifndef NO_RRM
if (L3_xface_init_NB ()) { if (L3_xface_init_NB ()) { //XXX to be modified???
return (-1); return (-1);
} }
...@@ -187,11 +184,11 @@ rrc_init_global_param_NB( ...@@ -187,11 +184,11 @@ rrc_init_global_param_NB(
return 0; return 0;
} }
//shoudl be changed?
#ifndef NO_RRM #ifndef NO_RRM
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int int
L3_xface_init_NB( L3_xface_init_NB( //Exact copy of the LTE implementation
void void
) )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -271,6 +268,8 @@ openair_rrc_top_init_eNB_NB(void)//MP: XXX Raymond put this directly the definit ...@@ -271,6 +268,8 @@ openair_rrc_top_init_eNB_NB(void)//MP: XXX Raymond put this directly the definit
eNB_rrc_inst_NB = NULL; eNB_rrc_inst_NB = NULL;
} }
//this stuff below i think are no more used
#ifndef NO_RRM #ifndef NO_RRM
#ifndef USER_MODE #ifndef USER_MODE
......
...@@ -35,10 +35,12 @@ ...@@ -35,10 +35,12 @@
#include "LAYER2/MAC/defs_nb_iot.h" #include "LAYER2/MAC/defs_nb_iot.h"
#include "LogicalChannelConfig-NB-r13.h" #include "LogicalChannelConfig-NB-r13.h"
//-----------------------------------------------------------------------
//UE_RRC_INST *UE_rrc_inst; //MP: may not used for the moment // ALL what is defined here should be shared through extern_nb_iot.h file
//------------------------------------------------------------------------
//UE_RRC_INST *UE_rrc_inst; //MP: may not used for the moment
#ifndef USER_MODE #ifndef USER_MODE
#ifndef NO_RRM #ifndef NO_RRM
...@@ -83,8 +85,7 @@ struct LogicalChannelConfig_NB_r13 SRB1_NB_logicalChannelConfig_defaultValue = { ...@@ -83,8 +85,7 @@ struct LogicalChannelConfig_NB_r13 SRB1_NB_logicalChannelConfig_defaultValue = {
//CONSTANTS //CONSTANTS
rlc_info_t Rlc_info_um,Rlc_info_am_config, Rlc_info_am; rlc_info_t Rlc_info_am_NB, Rlc_info_am_config_NB;
//MP: LCHAN_DESC (mac_rrc_primitives) is not needed, was only an old implementation for storing LCH information //MP: LCHAN_DESC (mac_rrc_primitives) is not needed, was only an old implementation for storing LCH information
......
...@@ -1736,12 +1736,24 @@ int main( int argc, char **argv ) { ...@@ -1736,12 +1736,24 @@ int main( int argc, char **argv ) {
int eMBMS_active=0; int eMBMS_active=0;
if (node_function[0] <= NGFI_RAU_IF4p5) { // don't initialize L2 for RRU if (node_function[0] <= NGFI_RAU_IF4p5) { // don't initialize L2 for RRU
// MP, Nick: Initialization of IF module for NB-IoT should be here----------
if_inst = malloc(sizeof(IF_Module_t));
LOG_I(PHY,"Allocate IF-Module for NB-IoT\n");
//---------------------------
LOG_I(PHY,"Intializing L2\n"); LOG_I(PHY,"Intializing L2\n");
// Initialization of IF module for NB-IoT should be here
mac_xface = malloc(sizeof(MAC_xface)); mac_xface = malloc(sizeof(MAC_xface));
l2_init(frame_parms[0],eMBMS_active,(uecap_xer_in==1)?uecap_xer:NULL, l2_init(frame_parms[0],eMBMS_active,(uecap_xer_in==1)?uecap_xer:NULL,
0,// cba_group_active 0,// cba_group_active
0); // HO flag 0); // HO flag
//initialize L2 for NB-IoT stuff (complementary to legacy OAI initialization)
#ifdef NB_IOT
l2_init_eNB_NB();
#endif
mac_xface->macphy_exit = &exit_fun; mac_xface->macphy_exit = &exit_fun;
} else if (node_function[0] == NGFI_RRU_IF4p5) { // Initialize PRACH in this case } else if (node_function[0] == NGFI_RRU_IF4p5) { // Initialize PRACH in this case
......
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