Commit a9089927 authored by Matthieu Kanj's avatar Matthieu Kanj

creation of new MAC_xface for NB-IoT (MAC_xface_NB_IoT)

+ creation of new file :openair2/PHY_INTERFACE/defs_NB_IoT.h
+ additional warnings because of the new MAC_xface_NB_IoT (126 remaining)
parent 7a704567
......@@ -380,6 +380,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
uint8_t subframe2harq_pid_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t subframe)
{
MAC_xface_NB_IoT *mac_xface_NB_IoT; //test_xface
/*
#ifdef DEBUG_DCI
if (frame_parms->frame_type == TDD)
......@@ -424,7 +425,7 @@ uint8_t subframe2harq_pid_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,uint32_t fra
case 2:
if ((subframe!=2) && (subframe!=7)) {
LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config);
mac_xface->macphy_exit("subframe2_harq_pid_NB_IoT, Illegal subframe");
mac_xface_NB_IoT->macphy_exit("subframe2_harq_pid_NB_IoT, Illegal subframe");
ret = (255);
}
......@@ -467,7 +468,7 @@ uint8_t subframe2harq_pid_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,uint32_t fra
if (ret == 255) {
LOG_E(PHY, "invalid harq_pid(%d) at SFN/SF = %d/%d\n", ret, frame, subframe);
mac_xface->macphy_exit("invalid harq_pid");
mac_xface_NB_IoT->macphy_exit("invalid harq_pid");
}
return ret;
}
......
......@@ -42,7 +42,7 @@
/*
#ifdef OPENAIR2
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/extern_NB_IoT.h"
#include "RRC/LITE/extern.h"
#include "PHY_INTERFACE/extern.h"
#endif
......@@ -932,6 +932,8 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
uint8_t Nbundled,
uint8_t llr8_flag)
{
MAC_xface_NB_IoT *mac_xface_NB_IoT; //test_xface
int16_t *ulsch_llr = eNB->pusch_vars[UE_id]->llr;
NB_IoT_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
NB_IoT_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id];
......@@ -1042,7 +1044,7 @@ unsigned int ulsch_decoding_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
ulsch_harq->O_ACK,
G,
subframe);
mac_xface->macphy_exit("ulsch_decoding.c: FATAL sumKr is 0!");
mac_xface_NB_IoT->macphy_exit("ulsch_decoding.c: FATAL sumKr is 0!");
return(-1);
}
// Compute Q_ri
......
......@@ -129,7 +129,7 @@ static inline void* malloc16_clear( size_t size )
#ifdef OPENAIR_LTE
#include "PHY/LTE_TRANSPORT/defs.h"
#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
//#include "PHY/LTE_TRANSPORT/defs_NB_IoT.h"
#include <pthread.h>
#include "targets/ARCH/COMMON/common_lib.h"
......@@ -570,7 +570,7 @@ typedef struct PHY_VARS_eNB_s {
struct PhysicalConfigDedicated *physicalConfigDedicated[NUMBER_OF_UE_MAX];
//Pointers for actve physicalConfigDedicated for NB-IoT to be applied in current subframe
struct PhysicalConfigDedicated_NB_r13 *phy_config_dedicated_NB[NUMBER_OF_UE_MAX];
//struct PhysicalConfigDedicated_NB_r13 *phy_config_dedicated_NB[NUMBER_OF_UE_MAX];
uint32_t rb_mask_ul[4];
......
......@@ -24,7 +24,7 @@
//#include "PHY/defs.h"
#include "PHY/defs_NB_IoT.h"
#include "openair2/PHY_INTERFACE/defs.h"
#include "openair2/PHY_INTERFACE/defs_NB_IoT.h"
//#include "PHY_INTERFACE/IF_Module_NB_IoT.h"
/*
extern char* namepointer_chMag ;
......@@ -55,7 +55,7 @@ extern PHY_VARS_eNB_NB_IoT * PHY_vars_eNB_NB_IoT_g[MAX_eNB_NB_IoT][MAX_NUM_CCs];
#endif
extern MAC_xface *mac_xface;
extern MAC_xface_NB_IoT *mac_xface_NB_IoT;
/*
extern IF_Module_t *if_inst;
......
......@@ -38,6 +38,7 @@
typedef enum {TDD_NB_IoT=1,FDD_NB_IoT=0} NB_IoT_frame_type_t;
typedef enum {EXTENDED_NB_IoT=1,NORMAL_NB_IoT=0} NB_IoT_prefix_type_t;
typedef enum {SF_DL_NB_IoT, SF_UL_NB_IoT, SF_S_NB_IoT} NB_IoT_subframe_t;
#define A_SEQUENCE_OF(type) A_SET_OF(type)
......
......@@ -38,6 +38,8 @@ void phy_procedures_eNB_TX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_
int8_t find_ue_NB_IoT(uint16_t rnti, PHY_VARS_eNB_NB_IoT *eNB);
NB_IoT_DL_FRAME_PARMS *get_NB_IoT_frame_parms(module_id_t Mod_id, uint8_t CC_id);
int16_t get_hundred_times_delta_IF_eNB_NB_IoT(PHY_VARS_eNB_NB_IoT *phy_vars_eNB,uint8_t UE_id,uint8_t harq_pid, uint8_t bw_factor);
#endif
......
......@@ -11,7 +11,7 @@
* \warning
*/
#include "PHY/defs_NB_IoT.h"
//#include "PHY/extern_NB_IoT.h"
#include "PHY/extern_NB_IoT.h"
//#include "SCHED/defs_nb_iot.h"
//#include "SCHED/extern.h"
......@@ -1108,7 +1108,12 @@ int8_t find_ue_NB_IoT(uint16_t rnti, PHY_VARS_eNB_NB_IoT *eNB)
return(-1);
}
NB_IoT_DL_FRAME_PARMS* get_NB_IoT_frame_parms(module_id_t Mod_id, uint8_t CC_id)
{
return(&PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->frame_parms);
}
/*
......
......@@ -337,6 +337,16 @@ typedef struct {
eNB_UE_STATS_NB_IoT eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX_NB_IoT];
/// scheduling control info
UE_sched_ctrl_NB_IoT UE_sched_ctrl[NUMBER_OF_UE_MAX_NB_IoT];
/// sorted downlink component carrier for the scheduler
int ordered_CCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX_NB_IoT];
/// number of downlink active component carrier
int numactiveCCs[NUMBER_OF_UE_MAX_NB_IoT];
/// sorted uplink component carrier for the scheduler
int ordered_ULCCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX_NB_IoT];
/// number of uplink active component carrier
int numactiveULCCs[NUMBER_OF_UE_MAX_NB_IoT];
int next[NUMBER_OF_UE_MAX_NB_IoT];
int head;
int next_ul[NUMBER_OF_UE_MAX_NB_IoT];
......@@ -346,6 +356,16 @@ typedef struct {
boolean_t active[NUMBER_OF_UE_MAX_NB_IoT];
} UE_list_NB_IoT_t;
/*!\brief MCCH logical channel */
#define MCCH_NB_IoT 4
/*!\brief The power headroom reporting range is from -23 ...+40 dB and beyond, with step 1 */
#define PHR_MAPPING_OFFSET_NB_IoT 23 // if ( x>= -23 ) val = floor (x + 23)
/*!\brief Values of BCCH logical channel */
#define BCCH_NB_IoT 3 // SI
/*!\brief Value of CCCH / SRB0 logical channel */
#define CCCH_NB_IoT 0 // srb0
/*!\brief DCCH / SRB1 logical channel */
#define DCCH_NB_IoT 1 // srb1
/*!\brief Values of BCCH0 logical channel for MIB*/
#define BCCH0_NB_IoT 11 // MIB-NB
/*!\brief Values of BCCH1 logical channel for SIBs */
......@@ -364,12 +384,35 @@ typedef struct {
#define DTCH1_NB_IoT 5 // DRB1
/*!\brief size of buffer status report table */
#define BSR_TABLE_SIZE_NB_IoT 64
/*!\brief LCID of short BSR for ULSCH */
#define SHORT_BSR_NB_IoT 29
/*!\brief LCID of CRNTI for ULSCH */
#define CRNTI_NB_IoT 27
/*!\brief Maximum number od control elemenets */
#define MAX_NUM_CE_NB_IoT 5
/*!\brief LCID of power headroom for ULSCH */
#define POWER_HEADROOM_NB_IoT 26
/*!\brief LCID of extended power headroom for ULSCH */
#define EXTENDED_POWER_HEADROOM_NB_IoT 25
/*!\brief LCID of padding LCID for DLSCH */
#define SHORT_PADDING_NB_IoT 31
/*!\brief LCID of long BSR for ULSCH */
#define LONG_BSR_NB_IoT 30
/*!\brief LCID of truncated BSR for ULSCH */
#define TRUNCATED_BSR_NB_IoT 28
// DLSCH LCHAN ID all the same as NB-IoT
/*!\brief DCI PDU filled by MAC for the PHY */
/*
* eNB part
*/
/*!\brief UE layer 2 status */
typedef enum {
CONNECTION_OK_NB_IoT=0,
CONNECTION_LOST_NB_IoT,
PHY_RESYNCH_NB_IoT,
PHY_HO_PRACH_NB_IoT
} UE_L2_STATE_NB_IoT_t;
/*
* UE/ENB common part
......@@ -442,6 +485,8 @@ typedef struct {
typedef struct {
uint8_t payload[CCCH_PAYLOAD_SIZE_MAX_NB_IoT] ;
} __attribute__((__packed__))CCCH_PDU_NB_IoT;
/*! \brief eNB template for the Random access information */
typedef struct {
/// Flag to indicate this process is active
......@@ -624,4 +669,137 @@ typedef struct {
/// processing time of eNB ULSCH reception
time_stats_t rx_ulsch_sdu; // include rlc_data_ind
} eNB_MAC_INST_NB_IoT;
/*!\brief Top level UE MAC structure */
typedef struct {
uint16_t Node_id;
/// RX frame counter
frame_t rxFrame;
/// RX subframe counter
sub_frame_t rxSubframe;
/// TX frame counter
frame_t txFrame;
/// TX subframe counter
sub_frame_t txSubframe;
/// C-RNTI of UE
uint16_t crnti;
/// C-RNTI of UE before HO
rnti_t crnti_before_ho; ///user id (rnti) of connected UEs
/// uplink active flag
uint8_t ul_active;
/// pointer to RRC PHY configuration
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon;
/// pointer to RACH_ConfigDedicated (NULL when not active, i.e. upon HO completion or T304 expiry)
struct RACH_ConfigDedicated *rach_ConfigDedicated;
/// pointer to RRC PHY configuration
struct PhysicalConfigDedicated *physicalConfigDedicated;
#if defined(Rel10) || defined(Rel14)
/// pointer to RRC PHY configuration SCEll
struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10;
#endif
/// pointer to TDD Configuration (NULL for FDD)
TDD_Config_t *tdd_Config;
/// Number of adjacent cells to measure
uint8_t n_adj_cells;
/// Array of adjacent physical cell ids
uint32_t adj_cell_id[6];
/// Pointer to RRC MAC configuration
MAC_MainConfig_t *macConfig;
/// Pointer to RRC Measurement gap configuration
MeasGapConfig_t *measGapConfig;
/// Pointers to LogicalChannelConfig indexed by LogicalChannelIdentity. Note NULL means LCHAN is inactive.
//////////////////////////////////////////////////////LogicalChannelConfig_t *logicalChannelConfig[MAX_NUM_LCID];
/// Scheduling Information
/////////////////////////////////////////////UE_SCHEDULING_INFO_NB_IoT scheduling_info;
/// Outgoing CCCH pdu for PHY
CCCH_PDU_NB_IoT CCCH_pdu;
/// Incoming DLSCH pdu for PHY
//DLSCH_PDU DLSCH_pdu[NUMBER_OF_UE_MAX][2];
/// number of attempt for rach
uint8_t RA_attempt_number;
/// Random-access procedure flag
uint8_t RA_active;
/// Random-access window counter
int8_t RA_window_cnt;
/// Random-access Msg3 size in bytes
uint8_t RA_Msg3_size;
/// Random-access prachMaskIndex
uint8_t RA_prachMaskIndex;
/// Flag indicating Preamble set (A,B) used for first Msg3 transmission
uint8_t RA_usedGroupA;
/// Random-access Resources
/////////////////////////////////////////////////////////////////////PRACH_RESOURCES_NB_IoT_t RA_prach_resources;
/// Random-access PREAMBLE_TRANSMISSION_COUNTER
uint8_t RA_PREAMBLE_TRANSMISSION_COUNTER;
/// Random-access backoff counter
int16_t RA_backoff_cnt;
/// Random-access variable for window calculation (frame of last change in window counter)
uint32_t RA_tx_frame;
/// Random-access variable for window calculation (subframe of last change in window counter)
uint8_t RA_tx_subframe;
/// Random-access Group B maximum path-loss
/// Random-access variable for backoff (frame of last change in backoff counter)
uint32_t RA_backoff_frame;
/// Random-access variable for backoff (subframe of last change in backoff counter)
uint8_t RA_backoff_subframe;
/// Random-access Group B maximum path-loss
uint16_t RA_maxPL;
/// Random-access Contention Resolution Timer active flag
uint8_t RA_contention_resolution_timer_active;
/// Random-access Contention Resolution Timer count value
uint8_t RA_contention_resolution_cnt;
/// power headroom reporitng reconfigured
uint8_t PHR_reconfigured;
/// power headroom state as configured by the higher layers
uint8_t PHR_state;
/// power backoff due to power management (as allowed by P-MPRc) for this cell
uint8_t PHR_reporting_active;
/// power backoff due to power management (as allowed by P-MPRc) for this cell
uint8_t power_backoff_db[NUMBER_OF_eNB_MAX];
/// BSR report falg management
uint8_t BSR_reporting_active;
/// retxBSR-Timer expires flag
uint8_t retxBSRTimer_expires_flag;
/// periodBSR-Timer expires flag
uint8_t periodBSRTimer_expires_flag;
/// MBSFN_Subframe Configuration
struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8]; // FIXME replace 8 by MAX_MBSFN_AREA?
/// number of subframe allocation pattern available for MBSFN sync area
uint8_t num_sf_allocation_pattern;
// #if defined(Rel10) || defined(Rel14)
// /// number of active MBSFN area
// uint8_t num_active_mbsfn_area;
// /// MBSFN Area Info
// struct MBSFN_AreaInfo_r9 *mbsfn_AreaInfo[MAX_MBSFN_AREA];
// /// PMCH Config
// struct PMCH_Config_r9 *pmch_Config[MAX_PMCH_perMBSFN];
// /// MCCH status
// uint8_t mcch_status;
// /// MSI status
// uint8_t msi_status;// could be an array if there are >1 MCH in one MBSFN area
// #endif
//#ifdef CBA
/// CBA RNTI for each group
uint16_t cba_rnti[NUM_MAX_CBA_GROUP];
/// last SFN for CBA channel access
uint8_t cba_last_access[NUM_MAX_CBA_GROUP];
//#endif
/// total UE scheduler processing time
time_stats_t ue_scheduler; // total
/// UE ULSCH tx processing time inlcuding RLC interface (rlc_data_req) and mac header generation
time_stats_t tx_ulsch_sdu;
/// UE DLSCH rx processing time inlcuding RLC interface (mac_rrc_data_ind or mac_rlc_status_ind+mac_rlc_data_ind) and mac header parser
time_stats_t rx_dlsch_sdu ;
/// UE query for MCH subframe processing time
time_stats_t ue_query_mch;
/// UE MCH rx processing time
time_stats_t rx_mch_sdu;
/// UE BCCH rx processing time including RLC interface (mac_rrc_data_ind)
time_stats_t rx_si;
/// UE PCCH rx processing time including RLC interface (mac_rrc_data_ind)
time_stats_t rx_p;
} UE_MAC_INST_NB_IoT;
#endif /*__LAYER2_MAC_DEFS_NB_IoT_H__ */
......@@ -48,7 +48,7 @@
//#include "UTIL/OPT/opt.h"
//#include "OCG.h"
//#include "OCG_extern.h"
#include "RRC/LITE/proto_NB_IoT.h"
//#include "RRC/LITE/extern.h"
//#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
......@@ -90,7 +90,7 @@ void schedule_RA_NB_IoT(module_id_t module_idP,frame_t frameP, sub_frame_t subfr
for (i=0; i<NB_RA_PROC_MAX; i++) {
for (i=0; i<RA_PROC_MAX_NB_IoT; i++) {
RA_template = (RA_TEMPLATE_NB_IoT *)&eNB->common_channels[CC_id].RA_template[i];
......@@ -120,24 +120,24 @@ void schedule_RA_NB_IoT(module_id_t module_idP,frame_t frameP, sub_frame_t subfr
else if (RA_template->generate_Msg4 == 1) {
// check for Msg4 Message
UE_id = find_UE_id(module_idP,RA_template->rnti);
UE_id = find_UE_id_NB_IoT(module_idP,RA_template->rnti);
if (UE_id == -1) { printf("%s:%d:%s: FATAL ERROR\n", __FILE__, __LINE__, __FUNCTION__); abort(); }
if (Is_rrc_registered == 1) {//Fixed mac_rrc_data_req
// Get RRCConnectionSetup for Piggyback
rrc_sdu_length = mac_rrc_data_req(module_idP,
CC_id,
frameP,
CCCH,
1, // 1 transport block
&eNB->common_channels[CC_id].CCCH_pdu.payload[0],
ENB_FLAG_YES,
module_idP,
0); // not used in this case
rrc_sdu_length = mac_rrc_data_req_NB_IoT(module_idP,
CC_id,
frameP,
CCCH_NB_IoT,
1, // 1 transport block
&eNB->common_channels[CC_id].CCCH_pdu.payload[0],
ENB_FLAG_YES,
module_idP,
0); // not used in this case
if (rrc_sdu_length == -1) {
mac_xface->macphy_exit("[MAC][eNB Scheduler] CCCH not allocated\n");
mac_xface_NB_IoT->macphy_exit("[MAC][eNB Scheduler] CCCH not allocated\n");
return; // not reached
} else {
//msg("[MAC][eNB %d] Frame %d, subframeP %d: got %d bytes from RRC\n",module_idP,frameP, subframeP,rrc_sdu_length);
......@@ -188,7 +188,7 @@ void schedule_RA_NB_IoT(module_id_t module_idP,frame_t frameP, sub_frame_t subfr
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged: \n",
module_idP,CC_id,frameP,subframeP);
// Get candidate harq_pid from PHY
mac_xface->get_ue_active_harq_pid(module_idP,CC_id,RA_template->rnti,frameP,subframeP,&harq_pid,&round,openair_harq_RA_NB_IoT);
mac_xface_NB_IoT->get_ue_active_harq_pid(module_idP,CC_id,RA_template->rnti,frameP,subframeP,&harq_pid,&round,openair_harq_RA_NB_IoT);
if (round>0) {
//RA_template->wait_ack_Msg4++;
......@@ -220,9 +220,9 @@ printf("MAC: msg4 acknowledged for rnti %x fsf %d/%d, let's configure it\n", RA_
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_id,frameP,subframeP);
RA_template->wait_ack_Msg4=0;
RA_template->RA_active=FALSE;
UE_id = find_UE_id(module_idP,RA_template->rnti);
UE_id = find_UE_id_NB_IoT(module_idP,RA_template->rnti);
DevAssert( UE_id != -1 );
eNB_mac_inst_NB_IoT[module_idP].UE_list.UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured=TRUE;
eNB_mac_inst_NB_IoT[module_idP].UE_list.UE_template[UE_PCCID_NB_IoT(module_idP,UE_id)][UE_id].configured=TRUE;
}
......@@ -246,7 +246,7 @@ void initiate_ra_proc_NB_IoT(module_id_t module_idP, int CC_id,frame_t frameP, u
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,1);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,0);
/*May up to 48 RA Procdeure MAX at the moment*/
for (i=0; i<NB_RA_PROC_MAX; i++) {
for (i=0; i<RA_PROC_MAX_NB_IoT; i++) {
if (RA_template[i].RA_active==FALSE &&
RA_template[i].wait_ack_Msg4 == 0) {
int loop = 0;
......@@ -263,7 +263,7 @@ void initiate_ra_proc_NB_IoT(module_id_t module_idP, int CC_id,frame_t frameP, u
/* TODO: this is not correct, the rnti may be in use without
* being in the MAC yet. To be refined.
*/
!(find_UE_id(module_idP, RA_template[i].rnti) == -1 &&
!(find_UE_id_NB_IoT(module_idP, RA_template[i].rnti) == -1 &&
/* 1024 and 60000 arbirarily chosen, not coming from standard */
RA_template[i].rnti >= 1024 && RA_template[i].rnti < 60000));
if (loop == 100) { printf("%s:%d:%s: FATAL ERROR! contact the authors\n", __FILE__, __LINE__, __FUNCTION__); abort(); }
......
......@@ -45,7 +45,7 @@
//#include "UTIL/OPT/opt.h"
//#include "OCG.h"
//#include "OCG_extern.h"
#include "RRC/LITE/proto_NB_IoT.h"
//#include "RRC/LITE/extern.h"
//#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
//NB-IoT
......@@ -108,6 +108,49 @@ rnti_t UE_RNTI_NB_IoT(module_id_t mod_idP, int ue_idP)
return(NOT_A_RNTI);
}
int add_new_ue_NB_IoT(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP)
{
int UE_id;
int i, j;
UE_list_NB_IoT_t *UE_list = &eNB_mac_inst_NB_IoT[mod_idP].UE_list;
LOG_D(MAC,"[eNB %d, CC_id %d] Adding UE with rnti %x (next avail %d, num_UEs %d)\n",mod_idP,cc_idP,rntiP,UE_list->avail,UE_list->num_UEs);
dump_ue_list_NB_IoT(UE_list,0);
for (i = 0; i < NUMBER_OF_UE_MAX_NB_IoT; i++) {
if (UE_list->active[i] == TRUE) continue;
printf("MAC: new UE id %d rnti %x\n", i, rntiP);
UE_id = i;
UE_list->UE_template[cc_idP][UE_id].rnti = rntiP;
UE_list->UE_template[cc_idP][UE_id].configured = FALSE;
UE_list->numactiveCCs[UE_id] = 1;
UE_list->numactiveULCCs[UE_id] = 1;
UE_list->pCC_id[UE_id] = cc_idP;
UE_list->ordered_CCids[0][UE_id] = cc_idP;
UE_list->ordered_ULCCids[0][UE_id] = cc_idP;
UE_list->num_UEs++;
UE_list->active[UE_id] = TRUE;
memset((void*)&UE_list->UE_sched_ctrl[UE_id],0,sizeof(UE_sched_ctrl_NB_IoT));
for (j=0; j<8; j++) {
UE_list->UE_template[cc_idP][UE_id].oldNDI[j] = (j==0)?1:0; // 1 because first transmission is with format1A (Msg4) for harq_pid 0
UE_list->UE_template[cc_idP][UE_id].oldNDI_UL[j] = (j==harq_pidP)?0:1; // 1st transmission is with Msg3;
}
eNB_ulsch_info_NB_IoT[mod_idP][cc_idP][UE_id].status = S_UL_WAITING_NB_IoT;
eNB_dlsch_info_NB_IoT[mod_idP][cc_idP][UE_id].status = S_DL_WAITING_NB_IoT;
LOG_D(MAC,"[eNB %d] Add UE_id %d on Primary CC_id %d: rnti %x\n",mod_idP,UE_id,cc_idP,rntiP);
dump_ue_list_NB_IoT(UE_list,0);
return(UE_id);
}
printf("MAC: cannot add new UE for rnti %x\n", rntiP);
LOG_E(MAC,"error in add_new_ue(), could not find space in UE_list, Dumping UE list\n");
dump_ue_list_NB_IoT(UE_list,0);
return(-1);
}
//--------------------------------------------------------------------------------------------------------
int rrc_mac_remove_ue_NB_IoT(
module_id_t mod_idP,
......@@ -154,7 +197,7 @@ printf("MAC: remove UE %d rnti %x\n", UE_id, rntiP);
// check if this has an RA process active
RA_TEMPLATE_NB_IoT *RA_template;
for (i=0;i<NB_RA_PROC_MAX;i++) {
for (i=0;i<RA_PROC_MAX_NB_IoT;i++) {
RA_template = (RA_TEMPLATE_NB_IoT *)&eNB_mac_inst_NB_IoT[mod_idP].common_channels[pCC_id].RA_template[i];
if (RA_template->rnti == rntiP){
RA_template->RA_active=FALSE;
......
......@@ -65,6 +65,78 @@
#define ENABLE_MAC_PAYLOAD_DEBUG
//#define DEBUG_eNB_SCHEDULER 1
unsigned char *parse_ulsch_header_NB_IoT(unsigned char *mac_header,
unsigned char *num_ce,
unsigned char *num_sdu,
unsigned char *rx_ces,
unsigned char *rx_lcids,
unsigned short *rx_lengths,
unsigned short tb_length)
{
//MAC_xface_NB_IoT *mac_xface_NB_IoT; //test_xface
unsigned char not_done=1,num_ces=0,num_sdus=0,lcid,num_sdu_cnt;
unsigned char *mac_header_ptr = mac_header;
unsigned short length, ce_len=0;
while (not_done==1) {
if (((SCH_SUBHEADER_FIXED_NB_IoT*)mac_header_ptr)->E == 0) {
not_done = 0;
}
lcid = ((SCH_SUBHEADER_FIXED_NB_IoT *)mac_header_ptr)->LCID;
if (lcid < EXTENDED_POWER_HEADROOM_NB_IoT) {
if (not_done==0) { // last MAC SDU, length is implicit
mac_header_ptr++;
length = tb_length-(mac_header_ptr-mac_header)-ce_len;
for (num_sdu_cnt=0; num_sdu_cnt < num_sdus ; num_sdu_cnt++) {
length -= rx_lengths[num_sdu_cnt];
}
} else {
if (((SCH_SUBHEADER_SHORT_NB_IoT *)mac_header_ptr)->F == 0) {
length = ((SCH_SUBHEADER_SHORT_NB_IoT *)mac_header_ptr)->L;
mac_header_ptr += 2;//sizeof(SCH_SUBHEADER_SHORT);
} else { // F = 1
length = ((((SCH_SUBHEADER_LONG_NB_IoT *)mac_header_ptr)->L_MSB & 0x7f ) << 8 ) | (((SCH_SUBHEADER_LONG_NB_IoT *)mac_header_ptr)->L_LSB & 0xff);
mac_header_ptr += 3;//sizeof(SCH_SUBHEADER_LONG);
}
}
LOG_D(MAC,"[eNB] sdu %d lcid %d tb_length %d length %d (offset now %ld)\n",
num_sdus,lcid,tb_length, length,mac_header_ptr-mac_header);
rx_lcids[num_sdus] = lcid;
rx_lengths[num_sdus] = length;
num_sdus++;
} else { // This is a control element subheader POWER_HEADROOM, BSR and CRNTI
if (lcid == SHORT_PADDING_NB_IoT) {
mac_header_ptr++;
} else {
rx_ces[num_ces] = lcid;
num_ces++;
mac_header_ptr++;
if (lcid==LONG_BSR_NB_IoT) {
ce_len+=3;
} else if (lcid==CRNTI_NB_IoT) {
ce_len+=2;
} else if ((lcid==POWER_HEADROOM_NB_IoT) || (lcid==TRUNCATED_BSR_NB_IoT)|| (lcid== SHORT_BSR_NB_IoT)) {
ce_len++;
} else {
LOG_E(MAC,"unknown CE %d \n", lcid);
mac_xface_NB_IoT->macphy_exit("unknown CE");
}
}
}
}
*num_ce = num_ces;
*num_sdu = num_sdus;
return(mac_header_ptr);
}
void rx_sdu_NB_IoT(const module_id_t enb_mod_idP,
......@@ -78,7 +150,7 @@ void rx_sdu_NB_IoT(const module_id_t enb_mod_idP,
)
{
unsigned char rx_ces[MAX_NUM_CE],num_ce,num_sdu,i,*payload_ptr;
unsigned char rx_ces[MAX_NUM_CE_NB_IoT],num_ce,num_sdu,i,*payload_ptr;
unsigned char rx_lcids[NB_RB_MAX];//for NB-IoT, NB_RB_MAX should be fixed to 5 (2 DRB+ 3SRB)
unsigned short rx_lengths[NB_RB_MAX];
int UE_id = find_UE_id_NB_IoT(enb_mod_idP,rntiP);
......@@ -122,7 +194,7 @@ void rx_sdu_NB_IoT(const module_id_t enb_mod_idP,
}
payload_ptr = parse_ulsch_header(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP);
payload_ptr = parse_ulsch_header_NB_IoT(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP);
T(T_ENB_MAC_UE_UL_PDU, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP),
T_INT(harq_pidP), T_INT(sdu_lenP), T_INT(num_ce), T_INT(num_sdu));
......@@ -139,18 +211,18 @@ void rx_sdu_NB_IoT(const module_id_t enb_mod_idP,
T_INT(rx_ces[i]));
/*rx_ces = lcid in parse_ulsch_header() if not short padding*/
switch (rx_ces[i]) { // implement and process BSR + CRNTI + PHR
case POWER_HEADROOM:
case POWER_HEADROOM_NB_IoT:
if (UE_id != -1) {
UE_list->UE_template[CC_idP][UE_id].phr_info = (payload_ptr[0] & 0x3f) - PHR_MAPPING_OFFSET;
UE_list->UE_template[CC_idP][UE_id].phr_info = (payload_ptr[0] & 0x3f) - PHR_MAPPING_OFFSET_NB_IoT;
LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : Received PHR PH = %d (db)\n",
enb_mod_idP, CC_idP, rx_ces[i], UE_list->UE_template[CC_idP][UE_id].phr_info);
UE_list->UE_template[CC_idP][UE_id].phr_info_configured=1;
UE_list->UE_sched_ctrl[UE_id].phr_received = 1;
}
payload_ptr+=sizeof(POWER_HEADROOM_CMD);
payload_ptr+=sizeof(POWER_HEADROOM_CMD_NB_IoT);
break;
case CRNTI:
case CRNTI_NB_IoT:
UE_id = find_UE_id_NB_IoT(enb_mod_idP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]);
LOG_I(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n",
frameP,subframeP,enb_mod_idP, CC_idP, rx_ces[i], i,num_ce,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id);
......@@ -171,7 +243,7 @@ void rx_sdu_NB_IoT(const module_id_t enb_mod_idP,
//case TRUNCATED_BSR:
/*DV lcid =???*/
//case DATA_VOLUME_INDICATOR
case SHORT_BSR: {
case SHORT_BSR_NB_IoT: {
uint8_t lcgid;
lcgid = (payload_ptr[0] >> 6);
......@@ -205,7 +277,7 @@ void rx_sdu_NB_IoT(const module_id_t enb_mod_idP,
else {
}
payload_ptr += 1;//sizeof(SHORT_BSR); // fixme
payload_ptr += 1;//sizeof(SHORT_BSR_NB_IoT); // fixme
}
break;
......@@ -237,7 +309,7 @@ void rx_sdu_NB_IoT(const module_id_t enb_mod_idP,
payload_ptr[0],payload_ptr[1],payload_ptr[2],payload_ptr[3],payload_ptr[4], payload_ptr[5], rntiP);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,1);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,0);
for (ii=0; ii<NB_RA_PROC_MAX; ii++) {
for (ii=0; ii<RA_PROC_MAX_NB_IoT; ii++) {
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Checking proc %d : rnti (%x, %x), active %d\n",
enb_mod_idP, CC_idP, ii,
eNB->common_channels[CC_idP].RA_template[ii].rnti, rntiP,
......@@ -253,8 +325,8 @@ void rx_sdu_NB_IoT(const module_id_t enb_mod_idP,
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3: length %d, offset %ld\n",
enb_mod_idP,CC_idP,frameP,rx_lengths[i],payload_ptr-sduP);
if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,eNB->common_channels[CC_idP].RA_template[ii].rnti,harq_pidP)) == -1 ) {
mac_xface->macphy_exit("[MAC][eNB] Max user count reached\n");
if ((UE_id=add_new_ue_NB_IoT(enb_mod_idP,CC_idP,eNB->common_channels[CC_idP].RA_template[ii].rnti,harq_pidP)) == -1 ) {
mac_xface_NB_IoT->macphy_exit("[MAC][eNB] Max user count reached\n");
// kill RA procedure
} else
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Added user with rnti %x => UE %d\n",
......@@ -274,7 +346,7 @@ void rx_sdu_NB_IoT(const module_id_t enb_mod_idP,
frameP,
subframeP,
rntiP,
CCCH,
CCCH_NB_IoT,
(uint8_t*)payload_ptr,
rx_lengths[i]);
......@@ -359,7 +431,7 @@ void rx_sdu_NB_IoT(const module_id_t enb_mod_idP,
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i];
else
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0;*/
if ((rx_lengths[i] <SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0) ) { // MAX SIZE OF transport block
if ((rx_lengths[i] <SCH_PAYLOAD_SIZE_MAX_NB_IoT) && (rx_lengths[i] > 0) ) { // MAX SIZE OF transport block
mac_rlc_data_ind_NB_IoT(
enb_mod_idP,
......@@ -412,4 +484,28 @@ void rx_sdu_NB_IoT(const module_id_t enb_mod_idP,
}
}
/* This function is called by PHY layer when it schedules some
* uplink for a random access message 3.
* The MAC scheduler has to skip the RBs used by this message 3
* (done below in schedule_ulsch).
*/
void set_msg3_subframe_NB_IoT(module_id_t Mod_id,
int CC_id,
int frame,
int subframe,
int rnti,
int Msg3_frame,
int Msg3_subframe)
{
eNB_MAC_INST_NB_IoT *eNB=&eNB_mac_inst_NB_IoT[Mod_id];
int i;
for (i=0; i<RA_PROC_MAX_NB_IoT; i++) {
if (eNB->common_channels[CC_id].RA_template[i].RA_active == TRUE &&
eNB->common_channels[CC_id].RA_template[i].rnti == rnti) {
eNB->common_channels[CC_id].RA_template[i].Msg3_subframe = Msg3_subframe;
break;
}
}
}
......@@ -29,8 +29,8 @@
*/
#ifndef __MAC_EXTERN_NB_IoT_H__
#define __MAC_EXTERN_NB_IoT_H__
#ifndef __MAC_EXTERN_NB_IOT_H__
#define __MAC_EXTERN_NB_IOT_H__
// #ifdef USER_MODE
......@@ -42,7 +42,7 @@
// #ifdef PHY_EMUL
// //#include "SIMULATION/simulation_defs.h"
// #endif //PHY_EMUL
#include "PHY_INTERFACE/defs.h" // should be replaced by PHY_INTERFACE/defs_NB_IoT.h (create MAC_xface for NB_IoT)
#include "openair2/PHY_INTERFACE/defs_NB_IoT.h"
//#include "RRC/LITE/defs_NB_IoT.h"
//#ifdef NB_IOT
......@@ -78,8 +78,8 @@ extern eNB_DLSCH_INFO_NB_IoT eNB_dlsch_info_NB_IoT[NUMBER_OF_eNB_MAX][MAX_NUM_CC
// //#ifndef USER_MODE
extern MAC_xface *mac_xface;
//#ifndef USER_MODE
extern MAC_xface_NB_IoT *mac_xface_NB_IoT;
// extern RRC_XFACE *Rrc_xface;
extern uint8_t Is_rrc_registered;
......
......@@ -36,7 +36,6 @@
#include "LAYER2/MAC/extern_NB_IoT.h"
#include "RRC/LITE/proto_NB_IoT.h"
int mac_init_global_param_NB_IoT(void)
{
......@@ -107,7 +106,7 @@ int mac_top_init_NB_IoT()
LOG_I(MAC,"[MAC][MAIN] not enough memory for eNB \n");
exit(1);
} else {
LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST),NB_eNB_INST,eNB_mac_inst_NB_IoT);
LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST_NB_IoT),NB_eNB_INST,eNB_mac_inst_NB_IoT);
bzero(eNB_mac_inst_NB_IoT,NB_eNB_INST*sizeof(eNB_MAC_INST_NB_IoT));
}
} else {
......@@ -152,7 +151,7 @@ int mac_top_init_NB_IoT()
RA_template = (RA_TEMPLATE_NB_IoT *)&eNB_mac_inst_NB_IoT[i].common_channels[CC_id].RA_template[0];
for (j=0; j<NB_RA_PROC_MAX; j++) {
for (j=0; j<RA_PROC_MAX_NB_IoT; j++) {
size_bytes1 = sizeof(DCIN1_RAR_t);
size_bytes2 = sizeof(DCIN1_t);
size_bits1 = sizeof_DCIN1_RAR_t;
......
......@@ -31,6 +31,7 @@
#define __LAYER2_MAC_PROTO_NB_IoT_H__
#include "openair1/PHY/LTE_TRANSPORT/defs_NB_IoT.h"
#include "LAYER2/MAC/defs_NB_IoT.h"
#include "COMMON/platform_types.h"
/** \addtogroup _mac
* @{
......@@ -75,4 +76,66 @@ int find_UE_id_NB_IoT (module_id_t module_idP, rnti_t rnti) ;
int UE_PCCID_NB_IoT (module_id_t module_idP, int UE_id);
rnti_t UE_RNTI_NB_IoT (module_id_t module_idP, int UE_id);
/*! \fn UE_L2_state_t ue_scheduler(const module_id_t module_idP,const frame_t frameP, const sub_frame_t subframe, const lte_subframe_t direction,const uint8_t eNB_index)
\brief UE scheduler where all the ue background tasks are done. This function performs the following: 1) Trigger PDCP every 5ms 2) Call RRC for link status return to PHY3) Perform SR/BSR procedures for scheduling feedback 4) Perform PHR procedures.
\param[in] module_idP instance of the UE
\param[in] rxFrame the RX frame number
\param[in] rxSubframe the RX subframe number
\param[in] txFrame the TX frame number
\param[in] txSubframe the TX subframe number
\param[in] direction subframe direction
\param[in] eNB_index instance of eNB
@returns L2 state (CONNETION_OK or CONNECTION_LOST or PHY_RESYNCH)
*/
UE_L2_STATE_NB_IoT_t ue_scheduler_NB_IoT(
const module_id_t module_idP,
const frame_t rxFrameP,
const sub_frame_t rxSubframe,
const frame_t txFrameP,
const sub_frame_t txSubframe,
const NB_IoT_subframe_t direction,
const uint8_t eNB_index,
const int CC_id);
/* \brief Function used by PHY to inform MAC that an uplink is scheduled
for Msg3 in given subframe. This is used so that the MAC
scheduler marks as busy the RBs used by the Msg3.
@param Mod_id Instance ID of eNB
@param CC_id CC ID of eNB
@param frame current frame
@param subframe current subframe
@param rnti UE rnti concerned
@param Msg3_frame frame where scheduling takes place
@param Msg3_subframe subframe where scheduling takes place
*/
void set_msg3_subframe_NB_IoT(module_id_t Mod_id,
int CC_id,
int frame,
int subframe,
int rnti,
int Msg3_frame,
int Msg3_subframe);
/* \brief Parse header for UL-SCH. This function parses the received UL-SCH header as described
in 36-321 MAC layer specifications. It returns the number of bytes used for the header to be used as an offset for the payload
in the ULSCH buffer.
@param mac_header Pointer to the first byte of the MAC header (UL-SCH buffer)
@param num_ces Number of SDUs in the payload
@param num_sdu Number of SDUs in the payload
@param rx_ces Pointer to received CEs in the header
@param rx_lcids Pointer to array of LCIDs (the order must be the same as the SDU length array)
@param rx_lengths Pointer to array of SDU lengths
@returns Pointer to payload following header
*/
uint8_t *parse_ulsch_header_NB_IoT(uint8_t *mac_header,
uint8_t *num_ce,
uint8_t *num_sdu,
uint8_t *rx_ces,
uint8_t *rx_lcids,
uint16_t *rx_lengths,
uint16_t tx_lenght);
int add_new_ue_NB_IoT(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid);
//void dump_ue_list_NB_IoT(UE_list_t *listP, int ul_flag);
#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 PHY_INTERFACE/defs.h
* \brief mac phy interface primitives
* \author Raymond Knopp and Navid Nikaein
* \date 2011
* \version 0.5
* \mail navid.nikaein@eurecom.fr or openair_tech@eurecom.fr
*/
#ifndef __MAC_PHY_PRIMITIVES_NB_IOT_H__
#define __MAC_PHY_PRIMITIVES_NB_IOT_H__
#include "LAYER2/MAC/defs_NB_IoT.h"
//#include "LAYER2/MAC/defs.h"
#define MAX_NUMBER_OF_MAC_INSTANCES 16
#define NULL_PDU 255
#define DCI 0
#define DLSCH 1
#define ULSCH 2
/*
#define mac_exit_wrapper(sTRING) \
do { \
char temp[300]; \
snprintf(temp, sizeof(temp), "%s in file "__FILE__" at line %d\n", sTRING, __LINE__); \
mac_xface->macphy_exit(temp); \
} while(0)
*/
/** @defgroup _phy_if MAC-PHY interface
* @ingroup _oai2
* @{
*/
/*! \brief MACPHY Interface */
typedef struct {
/// Pointer function that initializes L2
int (*macphy_init)(int eMBMS_active, char *uecap_xer, uint8_t CBA_active,uint8_t HO_active);
/// Pointer function that stops the low-level scheduler due an exit condition
void (*macphy_exit)(const char *);
// eNB functions
/// Invoke dlsch/ulsch scheduling procedure for new subframe
void (*eNB_dlsch_ulsch_scheduler)(module_id_t Mod_id,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP);//, int calibration_flag);
/// Fill random access response sdu, passing timing advance
uint16_t (*fill_rar)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t *dlsch_buffer,uint16_t N_RB_UL, uint8_t input_buffer_length);
/// Initiate the RA procedure upon reception (hypothetical) of a valid preamble
void (*initiate_ra_proc)(module_id_t Mod_id,int CC_id,frame_t frameP,uint16_t preamble,int16_t timing_offset,uint8_t sect_id,sub_frame_t subframe,uint8_t f_id);
/// cancel an ongoing RA procedure
void (*cancel_ra_proc)(module_id_t Mod_id,int CC_id,frame_t frameP,uint16_t preamble);
/// Inform MAC layer that an uplink is scheduled for Msg3 in given subframe.
/// This is used so that the MAC scheduler marks as busy the RBs used by the Msg3.
void (*set_msg3_subframe)(module_id_t Mod_id,
int CC_id,
int frame,
int subframe,
int rnti,
int Msg3_frame,
int Msg3_subframe);
/// Get DCI for current subframe from MAC
DCI_PDU_NB_IoT* (*get_dci_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,sub_frame_t subframe);
/// Get DLSCH sdu for particular RNTI and Transport block index
uint8_t* (*get_dlsch_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,uint8_t TB_index);
/// Send ULSCH sdu to MAC for given rnti
void (*rx_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP, sub_frame_t sub_frameP,rnti_t rnti, uint8_t *sdu,uint16_t sdu_len, int harq_pid,uint8_t *msg3_flag);
/// Indicate failure to synch to external source
void (*mrbch_phy_sync_failure) (module_id_t Mod_id,frame_t frameP, uint8_t free_eNB_index);
/// Indicate Scheduling Request from UE
void (*SR_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe);
/// Indicate UL Failure to eNodeB MAC
void (*UL_failure_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe);
/// Configure Common PHY parameters from SIB1
void (*phy_config_sib1_eNB)(module_id_t Mod_id,int CC_id,
TDD_Config_t *tdd_config,
uint8_t SIwindowsize,
uint16_t SIperiod);
/// Configure Common PHY parameters from SIB2
void (*phy_config_sib2_eNB)(module_id_t Mod_id, int CC_id,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
ARFCN_ValueEUTRA_t *ul_CArrierFreq,
long *ul_Bandwidth,
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList);
#if defined(Rel10) || defined(Rel14)
/// Configure Common PHY parameters from SIB13
void (*phy_config_sib13_eNB)(module_id_t Mod_id,int CC_id, int mbsfn_Area_idx,
long mbsfn_AreaId_r9);
void (*phy_config_dedicated_scell_eNB)(uint8_t Mod_id,
uint16_t rnti,
SCellToAddMod_r10_t *sCellToAddMod_r10,
int CC_id);
#endif
/// PHY-Config-Dedicated eNB
void (*phy_config_dedicated_eNB)(module_id_t Mod_id,int CC_id,rnti_t rnti,
struct PhysicalConfigDedicated *physicalConfigDedicated);
/////////////////////////////////////////////
/*
#if defined(Rel10) || defined(Rel14)
/// Get MCH sdu and corresponding MCS for particular MBSFN subframe
MCH_PDU* (*get_mch_sdu)(module_id_t Mod_id, int CC_id, frame_t frameP,sub_frame_t subframe);
#endif
*/
//////////////////////////////////////////////////////
// configure the cba rnti at the physical layer
void (*phy_config_cba_rnti)(module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uint8_t index, uint16_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups);
/// get delta mcs for fast UL AMC
int16_t (*estimate_ue_tx_power)(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
int (*mac_phy_remove_ue)(module_id_t Mod_idP,rnti_t rntiP);
/// UE functions
/// reset the ue phy
void (*phy_reset_ue)(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
/// Indicate loss of synchronization of PBCH for this eNB to MAC layer
void (*out_of_sync_ind)(module_id_t Mod_id,frame_t frameP,uint16_t eNB_index);
/// Send a received SI sdu
void (*ue_decode_si)(module_id_t Mod_id,int CC_id,frame_t frameP, uint8_t CH_index, void *pdu, uint16_t len);
/// Send a received Paging sdu
void (*ue_decode_p)(module_id_t Mod_id,int CC_id,frame_t frameP, uint8_t CH_index, void *pdu, uint16_t len);
/// Send a received DLSCH sdu to MAC
void (*ue_send_sdu)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,sub_frame_t subframe,uint8_t *sdu,uint16_t sdu_len,uint8_t CH_index);
#if defined(Rel10) || defined(Rel14)
/// Send a received MCH sdu to MAC
void (*ue_send_mch_sdu)(module_id_t Mod_id,uint8_t CC_id, frame_t frameP,uint8_t *sdu,uint16_t sdu_len,uint8_t eNB_index,uint8_t sync_area);
/// Function to check if UE PHY needs to decode MCH for MAC
/// get the sync area id, and return MCS value if need to decode, otherwise -1
int (*ue_query_mch)(module_id_t Mod_id, uint8_t CC_id,frame_t frameP,sub_frame_t subframe,uint8_t eNB_index,uint8_t *sync_area, uint8_t *mcch_active);
#endif
/// Retrieve ULSCH sdu from MAC
void (*ue_get_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,sub_frame_t subframe, uint8_t CH_index,uint8_t *ulsch_buffer,uint16_t buflen,uint8_t *access_mode);
/// Retrieve RRCConnectionReq from MAC
PRACH_RESOURCES_t* (*ue_get_rach)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t Msg3_flag,sub_frame_t subframe);
/// Process Random-Access Response
uint16_t (*ue_process_rar)(module_id_t Mod_id,int CC_id,frame_t frameP, uint16_t ra_rnti, uint8_t *dlsch_buffer, uint16_t *t_crnti,uint8_t preamble_index, uint8_t* selected_rar_buffer);
/// Get SR payload (0,1) from UE MAC
uint32_t (*ue_get_SR)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t eNB_id,rnti_t rnti,sub_frame_t subframe);
/// Indicate synchronization with valid PBCH
void (*dl_phy_sync_success) (module_id_t Mod_id,frame_t frameP, uint8_t CH_index,uint8_t first_sync);
/// Only calls the PDCP for now
UE_L2_STATE_NB_IoT_t (*ue_scheduler_NB_IoT)(module_id_t Mod_id, frame_t rxFrameP,sub_frame_t rxSubframe, frame_t txFrameP,sub_frame_t txSubframe, lte_subframe_t direction, uint8_t eNB_id, int CC_id);
/// PHY-Config-Dedicated UE
void (*phy_config_dedicated_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
struct PhysicalConfigDedicated *physicalConfigDedicated);
/// PHY-Config-harq UE
void (*phy_config_harq_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
uint16_t max_harq_tx);
/// Configure Common PHY parameters from SIB1
void (*phy_config_sib1_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
TDD_Config_t *tdd_config,
uint8_t SIwindowsize,
uint16_t SIperiod);
/// Configure Common PHY parameters from SIB2
void (*phy_config_sib2_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
ARFCN_ValueEUTRA_t *ul_CArrierFreq,
long *ul_Bandwidth,
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList);
#if defined(Rel10) || defined(Rel14)
/// Configure Common PHY parameters from SIB13
void (*phy_config_sib13_ue)(uint8_t Mod_id,int CC_id, uint8_t eNB_index,int mbsfn_Area_idx,
long mbsfn_AreaId_r9);
void (*phy_config_dedicated_scell_ue)(uint8_t Mod_id,
uint8_t eNB_index,
SCellToAddMod_r10_t *sCellToAddMod_r10,
int CC_id);
#endif
/// Configure Common PHY parameters from mobilityControlInfo
void (*phy_config_afterHO_ue)(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index,
MobilityControlInfo_t *mobilityControlInfo,
uint8_t ho_failed);
/// Function to indicate failure of contention resolution or RA procedure
void (*ra_failed)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
/// Function to indicate success of contention resolution or RA procedure
void (*ra_succeeded)(module_id_t Mod_id,uint8_t CC_id, uint8_t eNB_index);
/// Function to indicate the transmission of msg1/rach to MAC
void (*Msg1_transmitted)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,uint8_t eNB_id);
/// Function to indicate Msg3 transmission/retransmission which initiates/reset Contention Resolution Timer
void (*Msg3_transmitted)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,uint8_t eNB_id);
/// Function to pass inter-cell measurement parameters to PHY (cell Ids)
void (*phy_config_meas_ue)(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,uint8_t n_adj_cells,uint32_t *adj_cell_id);
// PHY Helper Functions
/// RIV computation from PHY
uint16_t (*computeRIV)(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
/// Downlink TBS table lookup from PHY
uint32_t (*get_TBS_DL)(uint8_t mcs, uint16_t nb_rb);
/// Uplink TBS table lookup from PHY
uint32_t (*get_TBS_UL)(uint8_t mcs, uint16_t nb_rb);
/// Function to retrieve the HARQ round index for a particular UL/DLSCH and harq_pid
int (*get_ue_active_harq_pid)(module_id_t Mod_id, uint8_t CC_id,rnti_t rnti, int frame, uint8_t subframe, uint8_t *harq_pid, uint8_t *round, uint8_t ul_flag);
/// Function to retrieve number of CCE
uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe);
int (*get_nCCE_offset)(int *CCE_table,
const unsigned char L,
const int nCCE,
const int common_dci,
const unsigned short rnti,
const unsigned char subframe);
/// Function to retrieve number of PRB in an rb_alloc
uint32_t (*get_nb_rb)(uint8_t ra_header, uint32_t rb_alloc, int n_rb_dl);
/// Function to convert VRB to PRB for distributed allocation
uint32_t (*get_prb)(int N_RB_DL,int odd_slot,int vrb,int Ngap);
/// Function to retrieve transmission mode for UE
uint8_t (*get_transmission_mode)(module_id_t Mod_id,uint8_t CC_id,rnti_t rnti);
/// Function to retrieve rb_alloc bitmap from dci rballoc field and VRB type
uint32_t (*get_rballoc)(vrb_t vrb_type, uint16_t rb_alloc_dci);
/// Function for UE MAC to retrieve current PHY connectivity mode (PRACH,RA_RESPONSE,PUSCH)
UE_MODE_t (*get_ue_mode)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
/// Function for UE MAC to retrieve measured Path Loss
int16_t (*get_PL)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
/// Function for UE MAC to retrieve the rssi
uint32_t (*get_RSSI)(uint8_t Mod_id,uint8_t CC_id);
/// Function for UE MAC to retrieve the total gain
uint32_t (*get_rx_total_gain_dB)(uint8_t Mod_id,uint8_t CC_id);
/// Function for UE MAC to retrieve the number of adjustent cells
uint8_t (*get_n_adj_cells)(uint8_t Mod_id,uint8_t CC_id);
/// Function for UE MAC to retrieve RSRP/RSRQ measurements
uint32_t (*get_RSRP)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
/// Function for UE MAC to retrieve RSRP/RSRQ measurements
uint32_t (*get_RSRQ)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
/// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements
uint8_t (*set_RSRP_filtered)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
/// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements
uint8_t (*set_RSRQ_filtered)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
/// Function for UE/eNB MAC to retrieve number of PRACH in TDD
uint8_t (*get_num_prach_tdd)(NB_IoT_DL_FRAME_PARMS *frame_parms);
/// Function for UE/eNB MAC to retrieve f_id of particular PRACH resource in TDD
uint8_t (*get_fid_prach_tdd)(NB_IoT_DL_FRAME_PARMS *frame_parms,uint8_t tdd_map_index);
/// Function for eNB MAC to retrieve subframe direction
lte_subframe_t (*get_subframe_direction)(module_id_t Mod_id, uint8_t CC_id, uint8_t subframe);
// MAC Helper functions
/// Function for UE/PHY to compute PUSCH transmit power in power-control procedure (Po_NOMINAL_PUSCH parameter)
int8_t (*get_Po_NOMINAL_PUSCH)(module_id_t Mod_id,uint8_t CC_id);
/// Function for UE/PHY to compute PUSCH transmit power in power-control procedure (deltaP_rampup parameter)
int8_t (*get_deltaP_rampup)(module_id_t Mod_id,uint8_t CC_id);
/// Function for UE/PHY to compute PHR
int8_t (*get_PHR)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
/// Function for UE to process the timing advance command
void (*process_timing_advance)(module_id_t Mod_id,uint8_t CC_id, int16_t timing_advance);
/// Function for MAC to get the UE stats from the PHY
NB_IoT_eNB_UE_stats* (*get_eNB_UE_stats)(module_id_t Mod_id, uint8_t CC_id, rnti_t rnti);
/// get the frame parameters from the PHY
NB_IoT_DL_FRAME_PARMS* (*get_NB_IoT_frame_parms)(module_id_t Mod_id, uint8_t CC_id);
/// get the Multiuser mimo mode
MU_MIMO_mode* (*get_mu_mimo_mode) (module_id_t Mod_id, uint8_t CC_id, rnti_t rnti);
/// get the delta TF for Uplink Power Control Calculation
int16_t (*get_hundred_times_delta_TF) (module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid);
/// get target PUSCH received power
int16_t (*get_target_pusch_rx_power) (module_id_t module_idP, uint8_t CC_id);
/// get target PUSCH received power
int16_t (*get_target_pucch_rx_power) (module_id_t module_idP, uint8_t CC_id);
unsigned char is_cluster_head;
unsigned char is_primary_cluster_head;
unsigned char is_secondary_cluster_head;
unsigned char cluster_head_index;
/// PHY Frame Configuration
NB_IoT_DL_FRAME_PARMS *frame_parms;
uint8_t (*get_prach_prb_offset)(NB_IoT_DL_FRAME_PARMS *frame_parms, uint8_t tdd_mapindex, uint16_t Nf);
int (*is_prach_subframe)(NB_IoT_DL_FRAME_PARMS *frame_parms,frame_t frame, uint8_t subframe);
/// ICIC algos
uint8_t (*get_SB_size)(uint8_t n_rb_dl);
///end ALU's algo
} MAC_xface_NB_IoT;
#endif
/** @} */
......@@ -1100,6 +1100,8 @@ int8_t mac_rrc_data_req_eNB_NB_IoT(
mib_flag_t mib_flag
)
{
MAC_xface_NB_IoT *mac_xface_NB_IoT;
SRB_INFO_NB_IoT *Srb_info;
uint8_t Sdu_size=0;
......@@ -1110,7 +1112,7 @@ int8_t mac_rrc_data_req_eNB_NB_IoT(
#endif
if((Srb_id & RAB_OFFSET) == BCCH){
if((Srb_id & RAB_OFFSET) == BCCH_NB_IoT){
// Requesting for the MIB-NB
......@@ -1119,7 +1121,7 @@ int8_t mac_rrc_data_req_eNB_NB_IoT(
//XXX to be check when MIB-NB should be initialized
if (eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_MIB_NB_IoT == 255) {
LOG_E(RRC,"[eNB %d] MAC Request for MIB-NB and MIB-NB not initialized\n",Mod_idP);
mac_xface->macphy_exit("mac_rrc_data_req_eNB_NB_IoT: MAC Request for MIB-NB and MIB-NB not initialized");
mac_xface_NB_IoT->macphy_exit("mac_rrc_data_req_eNB_NB_IoT: MAC Request for MIB-NB and MIB-NB not initialized");
}
memcpy(&buffer_pP[0],
......@@ -1158,12 +1160,12 @@ int8_t mac_rrc_data_req_eNB_NB_IoT(
//FIXME to be check when both are initialize and if make sense to have it
if (eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_SIB1_NB_IoT == 255) {
LOG_E(RRC,"[eNB %d] MAC Request for SIB1-NB and SIB1-NB_IoT not initialized\n",Mod_idP);
mac_xface->macphy_exit("mac_rrc_data_req_eNB_NB_IoT: MAC Request for SIB1-NB_IoT and SIB1-NB_IoT not initialized");
mac_xface_NB_IoT->macphy_exit("mac_rrc_data_req_eNB_NB_IoT: MAC Request for SIB1-NB_IoT and SIB1-NB_IoT not initialized");
}
if (eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_SIB23_NB_IoT == 255) {
LOG_E(RRC,"[eNB %d] MAC Request for SIB23-NB and SIB23-NB_IoT not initialized\n",Mod_idP);
mac_xface->macphy_exit("mac_rrc_data_req_eNB_NB_IoT: MAC Request for SIB23-NB_IoT and SIB23-NB_IoT not initialized");
mac_xface_NB_IoT->macphy_exit("mac_rrc_data_req_eNB_NB_IoT: MAC Request for SIB23-NB_IoT and SIB23-NB_IoT not initialized");
}
......@@ -1223,7 +1225,7 @@ int8_t mac_rrc_data_req_eNB_NB_IoT(
}
//called when is requested the Msg4 transmission (RRCConnectionSetup)
if( (Srb_id & RAB_OFFSET ) == CCCH) {
if( (Srb_id & RAB_OFFSET ) == CCCH_NB_IoT) {
LOG_T(RRC,"[eNB %d] Frame %d CCCH request (Srb_id %d)\n",Mod_idP,frameP, Srb_id);
if(eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].Srb0.Active==0) {
......@@ -1356,7 +1358,276 @@ void dump_ue_list_NB_IoT(UE_list_NB_IoT_t *listP, int ul_flag)
}
}
//------------------------------------------------------------------------------
int8_t mac_rrc_data_req_NB_IoT(
const module_id_t Mod_idP,
const int CC_id,
const frame_t frameP,
const rb_id_t Srb_id,
const uint8_t Nb_tb,
uint8_t* const buffer_pP,
const eNB_flag_t enb_flagP,
const uint8_t eNB_index,
const uint8_t mbsfn_sync_area
)
//--------------------------------------------------------------------------
{
MAC_xface_NB_IoT *mac_xface_NB_IoT; //test_xface
SRB_INFO_NB_IoT *Srb_info;
uint8_t Sdu_size=0;
#ifdef DEBUG_RRC
int i;
LOG_T(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id);
#endif
if( enb_flagP == ENB_FLAG_YES) {
if((Srb_id & RAB_OFFSET) == BCCH_NB_IoT) {
if(eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].SI.Active==0) {
return 0;
}
// All even frames transmit SIB in SF 5
if (eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_SIB1_NB_IoT == 255) {
LOG_E(RRC,"[eNB %d] MAC Request for SIB1 and SIB1 not initialized\n",Mod_idP);
mac_xface_NB_IoT->macphy_exit("mac_rrc_data_req: MAC Request for SIB1 and SIB1 not initialized");
}
if ((frameP%2) == 0) {
memcpy(&buffer_pP[0],
eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].SIB1_NB_IoT,
eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_SIB1_NB_IoT);
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
int sib1_size = eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_SIB1_NB_IoT;
int sdu_size = sizeof(RRC_MAC_BCCH_DATA_REQ (message_p).sdu);
if (sib1_size > sdu_size) {
LOG_E(RRC, "SIB1 SDU larger than BCCH SDU buffer size (%d, %d)", sib1_size, sdu_size);
sib1_size = sdu_size;
}
message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_BCCH_DATA_REQ);
RRC_MAC_BCCH_DATA_REQ (message_p).frame = frameP;
RRC_MAC_BCCH_DATA_REQ (message_p).sdu_size = sib1_size;
memset (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, 0, BCCH_SDU_SIZE);
memcpy (RRC_MAC_BCCH_DATA_REQ (message_p).sdu,
eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].SIB1_NB_IoT,
sib1_size);
RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
}
#endif
#ifdef DEBUG_RRC
LOG_T(RRC,"[eNB %d] Frame %d : BCCH request => SIB 1\n",Mod_idP,frameP);
for (i=0; i<eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_SIB1_NB_IoT; i++) {
LOG_T(RRC,"%x.",buffer_pP[i]);
}
LOG_T(RRC,"\n");
#endif
return (eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_SIB1_NB_IoT);
} // All RFN mod 8 transmit SIB2-3 in SF 5
else if ((frameP%8) == 1) {
memcpy(&buffer_pP[0],
eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].SIB23_NB_IoT,
eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_SIB23_NB_IoT);
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
int sib23_size = eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_SIB23_NB_IoT;
int sdu_size = sizeof(RRC_MAC_BCCH_DATA_REQ (message_p).sdu);
if (sib23_size > sdu_size) {
LOG_E(RRC, "SIB23 SDU larger than BCCH SDU buffer size (%d, %d)", sib23_size, sdu_size);
sib23_size = sdu_size;
}
message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_BCCH_DATA_REQ);
RRC_MAC_BCCH_DATA_REQ (message_p).frame = frameP;
RRC_MAC_BCCH_DATA_REQ (message_p).sdu_size = sib23_size;
memset (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, 0, BCCH_SDU_SIZE);
memcpy (RRC_MAC_BCCH_DATA_REQ (message_p).sdu,
eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].SIB23_NB_IoT,
sib23_size);
RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
}
#endif
#ifdef DEBUG_RRC
LOG_T(RRC,"[eNB %d] Frame %d BCCH request => SIB 2-3\n",Mod_idP,frameP);
for (i=0; i<eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_SIB23_NB_IoT; i++) {
LOG_T(RRC,"%x.",buffer_pP[i]);
}
LOG_T(RRC,"\n");
#endif
return(eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_SIB23_NB_IoT);
} else {
return(0);
}
}
if( (Srb_id & RAB_OFFSET ) == CCCH_NB_IoT) {
LOG_T(RRC,"[eNB %d] Frame %d CCCH request (Srb_id %d)\n",Mod_idP,frameP, Srb_id);
if(eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].Srb0.Active==0) {
LOG_E(RRC,"[eNB %d] CCCH Not active\n",Mod_idP);
return -1;
}
Srb_info=&eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].Srb0;
// check if data is there for MAC
if(Srb_info->Tx_buffer.payload_size>0) { //Fill buffer
LOG_D(RRC,"[eNB %d] CCCH (%p) has %d bytes (dest: %p, src %p)\n",Mod_idP,Srb_info,Srb_info->Tx_buffer.payload_size,buffer_pP,Srb_info->Tx_buffer.Payload);
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
int ccch_size = Srb_info->Tx_buffer.payload_size;
int sdu_size = sizeof(RRC_MAC_CCCH_DATA_REQ (message_p).sdu);
if (ccch_size > sdu_size) {
LOG_E(RRC, "SDU larger than CCCH SDU buffer size (%d, %d)", ccch_size, sdu_size);
ccch_size = sdu_size;
}
message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_CCCH_DATA_REQ);
RRC_MAC_CCCH_DATA_REQ (message_p).frame = frameP;
RRC_MAC_CCCH_DATA_REQ (message_p).sdu_size = ccch_size;
memset (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, 0, CCCH_SDU_SIZE);
memcpy (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, Srb_info->Tx_buffer.Payload, ccch_size);
RRC_MAC_CCCH_DATA_REQ (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
}
#endif
memcpy(buffer_pP,Srb_info->Tx_buffer.Payload,Srb_info->Tx_buffer.payload_size);
Sdu_size = Srb_info->Tx_buffer.payload_size;
Srb_info->Tx_buffer.payload_size=0;
}
return (Sdu_size);
}
#if defined(Rel10) || defined(Rel14)
if((Srb_id & RAB_OFFSET) == MCCH_NB_IoT) {
if(eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].MCCH_MESS[mbsfn_sync_area].Active==0) {
return 0; // this parameter is set in function init_mcch in rrc_eNB.c
}
// this part not needed as it is done in init_mcch
/* if (eNB_rrc_inst[Mod_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area] == 255) {
LOG_E(RRC,"[eNB %d] MAC Request for MCCH MESSAGE and MCCH MESSAGE is not initialized\n",Mod_id);
mac_xface->macphy_exit("");
}*/
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
int mcch_size = eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area];
int sdu_size = sizeof(RRC_MAC_MCCH_DATA_REQ (message_p).sdu);
if (mcch_size > sdu_size) {
LOG_E(RRC, "SDU larger than MCCH SDU buffer size (%d, %d)", mcch_size, sdu_size);
mcch_size = sdu_size;
}
message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_MCCH_DATA_REQ);
RRC_MAC_MCCH_DATA_REQ (message_p).frame = frameP;
RRC_MAC_MCCH_DATA_REQ (message_p).sdu_size = mcch_size;
memset (RRC_MAC_MCCH_DATA_REQ (message_p).sdu, 0, MCCH_SDU_SIZE);
memcpy (RRC_MAC_MCCH_DATA_REQ (message_p).sdu,
eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
mcch_size);
RRC_MAC_MCCH_DATA_REQ (message_p).enb_index = eNB_index;
RRC_MAC_MCCH_DATA_REQ (message_p).mbsfn_sync_area = mbsfn_sync_area;
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
}
#endif
memcpy(&buffer_pP[0],
eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
#ifdef DEBUG_RRC
LOG_D(RRC,"[eNB %d] Frame %d : MCCH request => MCCH_MESSAGE \n",Mod_idP,frameP);
for (i=0; i<eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]; i++) {
LOG_T(RRC,"%x.",buffer_pP[i]);
}
LOG_T(RRC,"\n");
#endif
return (eNB_rrc_inst_NB_IoT[Mod_idP].carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
// }
//else
//return(0);
}
#endif //Rel10 || Rel14
} else { //This is an UE
LOG_D(RRC,"[UE %d] Frame %d Filling CCCH SRB_ID %d\n",Mod_idP,frameP,Srb_id);
LOG_D(RRC,"[UE %d] Frame %d buffer_pP status %d,\n",Mod_idP,frameP, UE_rrc_inst_NB_IoT[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size);
if( (UE_rrc_inst_NB_IoT[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size > 0) ) {
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
int ccch_size = UE_rrc_inst_NB_IoT[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size;
int sdu_size = sizeof(RRC_MAC_CCCH_DATA_REQ (message_p).sdu);
if (ccch_size > sdu_size) {
LOG_E(RRC, "SDU larger than CCCH SDU buffer size (%d, %d)", ccch_size, sdu_size);
ccch_size = sdu_size;
}
message_p = itti_alloc_new_message (TASK_RRC_UE, RRC_MAC_CCCH_DATA_REQ);
RRC_MAC_CCCH_DATA_REQ (message_p).frame = frameP;
RRC_MAC_CCCH_DATA_REQ (message_p).sdu_size = ccch_size;
memset (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, 0, CCCH_SDU_SIZE);
memcpy (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, UE_rrc_inst_NB_IoT[Mod_idP].Srb0[eNB_index].Tx_buffer.Payload, ccch_size);
RRC_MAC_CCCH_DATA_REQ (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_MAC_UE, UE_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
}
#endif
memcpy(&buffer_pP[0],&UE_rrc_inst_NB_IoT[Mod_idP].Srb0[eNB_index].Tx_buffer.Payload[0],UE_rrc_inst_NB_IoT[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size);
uint8_t Ret_size=UE_rrc_inst_NB_IoT[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size;
// UE_rrc_inst[Mod_id].Srb0[eNB_index].Tx_buffer.payload_size=0;
UE_rrc_inst_NB_IoT[Mod_idP].Info[eNB_index].T300_active = 1;
UE_rrc_inst_NB_IoT[Mod_idP].Info[eNB_index].T300_cnt = 0;
// msg("[RRC][UE %d] Sending rach\n",Mod_id);
return(Ret_size);
} else {
return 0;
}
}
return(0);
}
//defined in eNB_scheduler_primitives.c
/*
......@@ -1402,7 +1673,7 @@ printf("MAC: remove UE %d rnti %x\n", UE_id, rntiP);
// check if this has an RA process active
RA_TEMPLATE_NB_IoT *RA_template;
for (i=0;i<NB_RA_PROC_MAX;i++) {
for (i=0;i<RA_PROC_MAX_NB_IoT;i++) {
RA_template = (RA_TEMPLATE_NB_IoT *)&eNB_mac_inst[mod_idP].common_channels[pCC_id].RA_template[i];
if (RA_template->rnti == rntiP){
......@@ -1620,7 +1891,7 @@ boolean_t rrc_pdcp_config_asn1_req_NB_IoT (
else
{
//is SRB1
srb_id = DCCH1;
srb_id = DCCH1_NB_IoT;
lc_id = srb_id;
}
......@@ -2177,6 +2448,7 @@ boolean_t pdcp_data_req_NB_IoT(
const pdcp_transmission_mode_t modeP
)
{
MAC_xface_NB_IoT *mac_xface_NB_IoT; //test_xface
pdcp_t *pdcp_p = NULL;
uint8_t i = 0;
......@@ -2217,7 +2489,7 @@ boolean_t pdcp_data_req_NB_IoT(
LOG_E(PDCP, "Requested SDU size (%d) is bigger than that can be handled by PDCP (%u)!\n",
sdu_buffer_sizeP, MAX_IP_PACKET_SIZE);
// XXX What does following call do?
mac_xface->macphy_exit("PDCP sdu buffer size > MAX_IP_PACKET_SIZE");
mac_xface_NB_IoT->macphy_exit("PDCP sdu buffer size > MAX_IP_PACKET_SIZE");
}
//check for MBMS not needed for NB-IoT*/
......
......@@ -513,6 +513,9 @@ typedef struct {
SRB_INFO_NB_IoT SI;
SRB_INFO_NB_IoT Srb0;
uint8_t **MCCH_MESSAGE; // probably not needed , but added to remove errors
uint8_t sizeof_MCCH_MESSAGE[8];// but added to remove errors
SRB_INFO_NB_IoT MCCH_MESS[8];// MAX_MBSFN_AREA
/*future implementation TS 36.331 V14.2.1
SystemInformationBlockType15_NB_r14_t *sib15;
SystemInformationBlockType20_NB_r14_t *sib20;
......
......@@ -581,4 +581,20 @@ int rrc_init_global_param_NB_IoT(void);
uint32_t from_earfcn_NB_IoT(int eutra_bandP,uint32_t dl_earfcn, float m_dl);
int32_t get_uldl_offset_NB_IoT(int eutra_band);
\ No newline at end of file
int32_t get_uldl_offset_NB_IoT(int eutra_band);
//L2_interface.c
int8_t mac_rrc_data_req_NB_IoT(
const module_id_t Mod_idP,
const int CC_id,
const frame_t frameP,
const rb_id_t Srb_id,
const uint8_t Nb_tb,
uint8_t* const buffer_pP,
const eNB_flag_t enb_flagP,
const uint8_t eNB_index,
const uint8_t mbsfn_sync_area
);
......@@ -30,6 +30,8 @@
#define RRC_ENB_C
/*NB-IoT include files*/
//#include "PHY/extern_NB_IoT.h"
#include "LAYER2/MAC/extern_NB_IoT.h"
//#include "RRC/LITE/proto_NB_IoT.h"
#include "defs_NB_IoT.h"
#include "RRC/LITE/MESSAGES/asn1_msg_NB_IoT.h"
......@@ -42,13 +44,14 @@
#include "DL-DCCH-Message-NB.h"
#include "SRB-ToAddMod-NB-r13.h"
#include "extern.h"
//#include "extern.h"
#include "extern_NB_IoT.h"
#include "assertions.h"
#include "asn1_conversions.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "LAYER2/RLC/rlc.h"
#include "LAYER2/MAC/proto.h"
//#include "LAYER2/MAC/proto.h"
//#include "LAYER2/MAC/proto_NB_IoT.h"
#include "UTIL/LOG/log.h"
#include "COMMON/mac_rrc_primitives.h"
#include "rlc.h"
......@@ -58,7 +61,7 @@
#include "msc.h"
#include "T.h"
#include "LAYER2/MAC/defs.h"
//#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/defs_NB_IoT.h"
......@@ -88,7 +91,7 @@
# include "intertask_interface.h"
#endif
#include "SIMULATION/TOOLS/defs.h" // for taus
//#include "SIMULATION/TOOLS/defs.h" // for taus
#if defined(FLEXRAN_AGENT_SB_IF)
#include "flexran_agent_extern.h"
......@@ -98,13 +101,15 @@
#ifdef PHY_EMUL
extern EMULATION_VARS *Emul_vars;
#endif
extern eNB_MAC_INST *eNB_mac_inst;
extern UE_MAC_INST *UE_mac_inst;
extern eNB_MAC_INST_NB_IoT *eNB_mac_inst;
extern UE_MAC_INST_NB_IoT *UE_mac_inst;
#ifdef BIGPHYSAREA
extern void* bigphys_malloc(int);
extern void* bigphys_malloc(int);
#endif
//#include "PHY_INTERFACE/defs_NB_IoT.h"
/*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)
*/
......@@ -155,7 +160,7 @@ void rrc_eNB_free_UE_NB_IoT(const module_id_t enb_mod_idP,const struct rrc_eNB_u
#endif
#endif
rrc_mac_remove_ue(enb_mod_idP,rnti);
rrc_mac_remove_ue_NB_IoT(enb_mod_idP,rnti);
rrc_rlc_remove_ue(&ctxt);
pdcp_remove_UE(&ctxt);
......@@ -202,7 +207,7 @@ void rrc_eNB_generate_RRCConnectionRelease_NB_IoT(
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
size,
rrc_eNB_mui_NB_IoT,
DCCH1);//Through SRB1/or SRB1bis
DCCH1_NB_IoT);//Through SRB1/or SRB1bis
MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB,
......@@ -215,9 +220,9 @@ void rrc_eNB_generate_RRCConnectionRelease_NB_IoT(
rrc_eNB_mui_NB_IoT,
size);
rrc_data_req(
rrc_data_req_NB_IoT(
ctxt_pP,
DCCH1,//Through SRB1/or SRB1bis
DCCH1_NB_IoT,//Through SRB1/or SRB1bis
rrc_eNB_mui_NB_IoT++,
SDU_CONFIRM_NO,
size,
......@@ -484,7 +489,7 @@ void rrc_eNB_generate_RRCConnectionSetup_NB_IoT(
)
//-----------------------------------------------------------------------------
{
MAC_xface_NB_IoT *mac_xface_NB_IoT;
//connection setup involve the establishment of SRB1 and SRB1bis (but srb1bis is established implicitly)
//XXX: this message should go through SRB0 to see this--> uper_encode
//XXX: they are assuming that 2 RLC-AM entities are used for SRB1 and SRB1bis
......@@ -494,8 +499,8 @@ void rrc_eNB_generate_RRCConnectionSetup_NB_IoT(
// SRB_ToAddMod_NB_r13_t *SRB1_config; //may not needed now
// LogicalChannelConfig_NB_r13_t *SRB1_logicalChannelConfig;
SRB_ToAddModList_NB_r13_t **SRB_configList; //for both SRB1 and SRB1bis
SRB_ToAddMod_NB_r13_t *SRB1bis_config;
SRB_ToAddModList_NB_r13_t **SRB_configList; //for both SRB1 and SRB1bis
SRB_ToAddMod_NB_r13_t *SRB1bis_config;
LogicalChannelConfig_NB_r13_t *SRB1bis_logicalChannelConfig;
int cnt;
......@@ -503,7 +508,7 @@ void rrc_eNB_generate_RRCConnectionSetup_NB_IoT(
//XXX MP:warning due to function still not completed at PHY (get_lte_frame_parms)
//XXX this approach is gone most probably
NB_IoT_DL_FRAME_PARMS *fp = mac_xface->get_lte_frame_parms(ctxt_pP->module_id,CC_id);
NB_IoT_DL_FRAME_PARMS *fp = mac_xface_NB_IoT->get_NB_IoT_frame_parms(ctxt_pP->module_id,CC_id);
T(T_ENB_RRC_CONNECTION_SETUP, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
......@@ -514,7 +519,7 @@ void rrc_eNB_generate_RRCConnectionSetup_NB_IoT(
ue_context_pP,
CC_id,
(uint8_t*) eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.Payload,
rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id),
rrc_eNB_get_next_transaction_identifier_NB_IoT(ctxt_pP->module_id),
fp,
SRB_configList, //MP:should contain only SRb1bis for the moment
&ue_context_pP->ue_context.physicalConfigDedicated_NB_IoT);
......@@ -682,7 +687,7 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete_NB_IoT(
kRRCint,
kUPenc,
NULL,
DCCH1); //SRB1
DCCH1_NB_IoT); //SRB1
// Refresh SRBs/DRBs for RLC
rrc_rlc_config_asn1_req_NB_IoT(
......@@ -702,7 +707,7 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete_NB_IoT(
//no need of checking the srb-Identity
//we should have only SRB1 in the list
ue_context_pP->ue_context.Srb1.Active=1;
ue_context_pP->ue_context.Srb1.Srb_info.Srb_id=DCCH1; //LCHAN_iD
ue_context_pP->ue_context.Srb1.Srb_info.Srb_id=DCCH1_NB_IoT; //LCHAN_iD
LOG_I(RRC,"[eNB %d] Frame %d CC %d : SRB1 is now active\n",
ctxt_pP->module_id,
ctxt_pP->frame,
......@@ -1108,7 +1113,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_IoT, 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_NB_IoT); //through SRB1
MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB,
......@@ -1124,7 +1129,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB_IoT(
//transmit the RRCConnectionReconfiguration-NB
rrc_data_req_NB_IoT(
ctxt_pP,
DCCH1,//through SRB1
DCCH1_NB_IoT,//through SRB1
rrc_eNB_mui_NB_IoT++,
SDU_CONFIRM_NO,
size,
......@@ -1258,7 +1263,7 @@ void rrc_eNB_generate_UECapabilityEnquiry_NB_IoT(
size = do_UECapabilityEnquiry_NB_IoT(
ctxt_pP,
buffer,
rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id));
rrc_eNB_get_next_transaction_identifier_NB_IoT(ctxt_pP->module_id));
LOG_I(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" Logical Channel DL-DCCH, Generate UECapabilityEnquiry-NB (bytes %d)\n",
......@@ -1285,7 +1290,7 @@ void rrc_eNB_generate_UECapabilityEnquiry_NB_IoT(
rrc_data_req_NB_IoT( //to PDCP
ctxt_pP,
DCCH1, //MP: send over SRB1
DCCH1_NB_IoT, //MP: send over SRB1
rrc_eNB_mui_NB_IoT++,
SDU_CONFIRM_NO,
size,
......@@ -1310,11 +1315,11 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
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;
struct SRB_ToAddMod_NB_r13__logicalChannelConfig_r13 *SRB1_lchan_config = NULL;
struct SRB_ToAddMod_NB_r13 *SRB1_config = NULL;
struct SRB_ToAddMod_NB_r13__rlc_Config_r13 *SRB1_rlc_config = NULL;
struct SRB_ToAddMod_NB_r13__logicalChannelConfig_r13 *SRB1_lchan_config = NULL;
SRB_ToAddModList_NB_r13_t *SRB_configList = ue_context_pP->ue_context.SRB_configList; //both SRB1 and SRB1bis
SRB_ToAddModList_NB_r13_t *SRB_configList = ue_context_pP->ue_context.SRB_configList; //both SRB1 and SRB1bis
SRB_ToAddModList_NB_r13_t **SRB_configList2 = NULL; //only SRB1
struct DRB_ToAddMod_NB_r13 *DRB_config = NULL;
......@@ -1322,19 +1327,19 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
struct PDCP_Config_NB_r13 *DRB_pdcp_config = NULL;
struct LogicalChannelConfig_NB_r13 *DRB_lchan_config = NULL;
DRB_ToAddModList_NB_r13_t** DRB_configList = &ue_context_pP->ue_context.DRB_configList;
DRB_ToAddModList_NB_r13_t** DRB_configList2 = NULL;
DRB_ToAddModList_NB_r13_t** DRB_configList = &ue_context_pP->ue_context.DRB_configList;
DRB_ToAddModList_NB_r13_t** DRB_configList2 = NULL;
MAC_MainConfig_NB_r13_t *mac_MainConfig_NB_IoT = NULL;
MAC_MainConfig_NB_r13_t *mac_MainConfig_NB_IoT = NULL;
long *periodicBSR_Timer;
long *enableStatusReportSN_Gap = NULL; //should be disabled
long *priority= NULL; //1 for SRB1 and 1 for SRB1bis
BOOLEAN_t *logicalChannelSR_Prohibit = NULL;
long *periodicBSR_Timer;
long *enableStatusReportSN_Gap = NULL; //should be disabled
long *priority = NULL; //1 for SRB1 and 1 for SRB1bis
BOOLEAN_t *logicalChannelSR_Prohibit = NULL;
//RSRP_Range_t *rsrp = NULL; //may not used
struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13 *dedicatedInfoNASList_NB_IoT = NULL;
DedicatedInfoNAS_t *dedicatedInfoNas = NULL;
struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13 *dedicatedInfoNASList_NB_IoT = NULL;
DedicatedInfoNAS_t *dedicatedInfoNas = NULL;
/* for no gcc warnings */
(void)dedicatedInfoNas;
......@@ -1456,7 +1461,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
//no maxARQtx
periodicBSR_Timer = CALLOC(1, sizeof(long));
periodicBSR_Timer = CALLOC(1, sizeof(long));
*periodicBSR_Timer = PeriodicBSR_Timer_NB_r13_pp8;
mac_MainConfig_NB_IoT->ul_SCH_Config_r13->periodicBSR_Timer_r13 = periodicBSR_Timer;
mac_MainConfig_NB_IoT->ul_SCH_Config_r13->retxBSR_Timer_r13 = RetxBSR_Timer_NB_r13_infinity;
......@@ -1573,7 +1578,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_IoT, 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_NB_IoT);//through SRB1
MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB,
......@@ -1588,7 +1593,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
rrc_data_req_NB_IoT( //to PDCP
ctxt_pP,
DCCH1,//through SRB1
DCCH1_NB_IoT,//through SRB1
rrc_eNB_mui_NB_IoT++,
SDU_CONFIRM_NO,
size,
......@@ -1600,14 +1605,14 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration_NB_IoT(const protocol_
/*-----------------CONFIGURATION-------------------*/
//-----------------------------------------------------------------------------
static void
init_SI_NB(
static void init_SI_NB_IoT(
const protocol_ctxt_t* const ctxt_pP,
const int CC_id,
RrcConfigurationReq* configuration //openair2/COMMON/rrc_messages_types
)
//-----------------------------------------------------------------------------
{
{
MAC_xface_NB_IoT *mac_xface_NB_IoT; //test_xface
/*WE should allocate memory for PHY_Config structure
* is declared in vars_nb_iot.c and put also in the extern_nb_iot
......@@ -1618,18 +1623,18 @@ init_SI_NB(
//copy basic parameters
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].physCellId = configuration->Nid_cell[CC_id];
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].p_eNB = configuration->nb_antenna_ports[CC_id];
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].p_rx_eNB = configuration->nb_antenna_ports_rx[CC_id];
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].p_rx_eNB = configuration->nb_antenna_ports_rx[CC_id];
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].Ncp = configuration->prefix_type[CC_id]; //DL Cyclic prefix
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].Ncp_UL = configuration->prefix_type_UL[CC_id];//UL cyclic prefix
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].Ncp_UL = configuration->prefix_type_UL[CC_id];//UL cyclic prefix
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].dl_CarrierFreq = configuration->downlink_frequency[CC_id];
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].ul_CarrierFreq = configuration->downlink_frequency[CC_id]+ configuration->uplink_frequency_offset[CC_id];
//TODO: verify who allocate memory for sib1_NB_IoT, sib2_NB_IoT, sib3_NB and mib_nb in the carrier before being passed as parameter
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].sizeof_SIB1_NB_IoT = 0;
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].sizeof_SIB1_NB_IoT = 0;
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].sizeof_SIB23_NB_IoT = 0;
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].sizeof_MIB_NB_IoT = 0;
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].sizeof_MIB_NB_IoT = 0;
//MIB
eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].MIB_NB_IoT = (uint8_t*) malloc16(32); //MIB is 34 bits=5bytes needed
......@@ -1646,12 +1651,12 @@ init_SI_NB(
else {
LOG_E(RRC, PROTOCOL_RRC_CTXT_FMT" init_SI: FATAL, no memory for MIB_NB_IoT allocated\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
mac_xface->macphy_exit("[RRC][init_SI] FATAL, no memory for MIB_NB_IoT allocated");
mac_xface_NB_IoT->macphy_exit("[RRC][init_SI] FATAL, no memory for MIB_NB_IoT allocated");
}
if (eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].sizeof_MIB_NB_IoT == 255) {
mac_xface->macphy_exit("[RRC][init_SI] FATAL, eNB_rrc_inst_NB[enb_mod_idP].carrier[CC_id].sizeof_MIB_NB_IoT == 255");
mac_xface_NB_IoT->macphy_exit("[RRC][init_SI] FATAL, eNB_rrc_inst_NB[enb_mod_idP].carrier[CC_id].sizeof_MIB_NB_IoT == 255");
}
//SIB1_NB_IoT
......@@ -1669,11 +1674,11 @@ init_SI_NB(
else {
LOG_E(RRC, PROTOCOL_RRC_CTXT_FMT" init_SI: FATAL, no memory for SIB1_NB_IoT allocated\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
mac_xface->macphy_exit("[RRC][init_SI] FATAL, no memory for SIB1_NB_IoT allocated");
mac_xface_NB_IoT->macphy_exit("[RRC][init_SI] FATAL, no memory for SIB1_NB_IoT allocated");
}
if (eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].sizeof_SIB1_NB_IoT == 255) {
mac_xface->macphy_exit("[RRC][init_SI] FATAL, eNB_rrc_inst_NB[enb_mod_idP].carrier[CC_id].sizeof_SIB1_NB_IoT == 255");
mac_xface_NB_IoT->macphy_exit("[RRC][init_SI] FATAL, eNB_rrc_inst_NB[enb_mod_idP].carrier[CC_id].sizeof_SIB1_NB_IoT == 255");
}
//SIB23_NB_IoT
......@@ -1688,7 +1693,7 @@ init_SI_NB(
);
if (eNB_rrc_inst_NB_IoT[ctxt_pP->module_id].carrier[CC_id].sizeof_SIB23_NB_IoT == 255) {
mac_xface->macphy_exit("[RRC][init_SI] FATAL, eNB_rrc_inst_NB[mod].carrier[CC_id].sizeof_SIB23_NB_IoT == 255");
mac_xface_NB_IoT->macphy_exit("[RRC][init_SI] FATAL, eNB_rrc_inst_NB[mod].carrier[CC_id].sizeof_SIB23_NB_IoT == 255");
}
LOG_T(RRC, PROTOCOL_RRC_CTXT_FMT" SIB2/3 Contents (partial)\n",
......@@ -1742,7 +1747,7 @@ init_SI_NB(
} else {
LOG_E(RRC, PROTOCOL_RRC_CTXT_FMT" init_SI: FATAL, no memory for SIB2/3_NB allocated\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
mac_xface->macphy_exit("[RRC][init_SI] FATAL, no memory for SIB2/3_NB allocated");
mac_xface_NB_IoT->macphy_exit("[RRC][init_SI] FATAL, no memory for SIB2/3_NB allocated");
}
}
......@@ -1796,7 +1801,7 @@ while ( eNB_rrc_inst_NB_IoT == NULL ) {
//init SI
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
init_SI_NB(&ctxt, CC_id,configuration);
init_SI_NB_IoT(&ctxt, CC_id,configuration);
}
/*New implementation Raymond*/
......@@ -1826,7 +1831,7 @@ int rrc_eNB_decode_ccch_NB_IoT(
//-----------------------------------------------------------------------------
{
asn_dec_rval_t dec_rval;
UL_CCCH_Message_NB_t *ul_ccch_msg_NB = NULL;
UL_CCCH_Message_NB_t *ul_ccch_msg_NB_IoT = NULL;
RRCConnectionRequest_NB_r13_IEs_t *rrcConnectionRequest_NB_IoT = NULL;
RRCConnectionReestablishmentRequest_NB_r13_IEs_t* rrcConnectionReestablishmentRequest_NB_IoT = NULL;
RRCConnectionResumeRequest_NB_r13_IEs_t *rrcConnectionResumeRequest_NB_IoT= NULL;
......@@ -1852,7 +1857,7 @@ int rrc_eNB_decode_ccch_NB_IoT(
dec_rval = uper_decode(
NULL,
&asn_DEF_UL_CCCH_Message_NB,
(void**)&ul_ccch_msg_NB,
(void**)&ul_ccch_msg_NB_IoT,
(uint8_t*) Srb_info->Rx_buffer.Payload,
100,
0,
......@@ -1863,7 +1868,7 @@ int rrc_eNB_decode_ccch_NB_IoT(
for (i = 0; i < 8; i++) { //MP: FIXME why 8?
LOG_T(RRC, "%x.", ((uint8_t *) & ul_ccch_msg_NB)[i]);
LOG_T(RRC, "%x.", ((uint8_t *) & ul_ccch_msg_NB_IoT)[i]);
}
if (dec_rval.consumed == 0) {
......@@ -1873,9 +1878,9 @@ int rrc_eNB_decode_ccch_NB_IoT(
return -1;
}
if (ul_ccch_msg_NB->message.present == UL_CCCH_MessageType_NB_PR_c1) {
if (ul_ccch_msg_NB_IoT->message.present == UL_CCCH_MessageType_NB_PR_c1) {
switch (ul_ccch_msg_NB->message.choice.c1.present) {
switch (ul_ccch_msg_NB_IoT->message.choice.c1.present) {
case UL_CCCH_MessageType_NB__c1_PR_NOTHING:
LOG_I(RRC,
......@@ -1900,7 +1905,7 @@ int rrc_eNB_decode_ccch_NB_IoT(
PROTOCOL_RRC_CTXT_UE_FMT"MAC_eNB--- MAC_DATA_IND (rrcConnectionReestablishmentRequest-NB on SRB0) --> RRC_eNB\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
rrcConnectionReestablishmentRequest_NB_IoT =
&ul_ccch_msg_NB->message.choice.c1.choice.rrcConnectionReestablishmentRequest_r13.criticalExtensions.choice.rrcConnectionReestablishmentRequest_r13;
&ul_ccch_msg_NB_IoT->message.choice.c1.choice.rrcConnectionReestablishmentRequest_r13.criticalExtensions.choice.rrcConnectionReestablishmentRequest_r13;
//for NB-IoT only "reconfiguration Failure" and "other failure" are allowed as reestablishment cause
LOG_I(RRC,
......@@ -1971,7 +1976,7 @@ int rrc_eNB_decode_ccch_NB_IoT(
dec_rval.consumed);
}
else {
rrcConnectionRequest_NB_IoT = &ul_ccch_msg_NB->message.choice.c1.choice.rrcConnectionRequest_r13.criticalExtensions.choice.rrcConnectionRequest_r13;
rrcConnectionRequest_NB_IoT = &ul_ccch_msg_NB_IoT->message.choice.c1.choice.rrcConnectionRequest_r13.criticalExtensions.choice.rrcConnectionRequest_r13;
{
if (InitialUE_Identity_PR_randomValue == rrcConnectionRequest_NB_IoT->ue_Identity_r13.present) {
......@@ -2140,7 +2145,7 @@ int rrc_eNB_decode_ccch_NB_IoT(
NULL,
NULL,
NULL,
DCCH1);
DCCH1_NB_IoT);
///MP: Configure RLC for SRB1bis
rrc_rlc_config_asn1_req_NB_IoT(ctxt_pP,
......@@ -2179,7 +2184,7 @@ int rrc_eNB_decode_ccch_NB_IoT(
LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT"MAC_eNB--- MAC_DATA_IND (rrcConnectionResumeRequest-NB on SRB0) --> RRC_eNB\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
rrcConnectionResumeRequest_NB_IoT=
&ul_ccch_msg_NB->message.choice.c1.choice.rrcConnectionResumeRequest_r13.criticalExtensions.choice.rrcConnectionResumeRequest_r13;
&ul_ccch_msg_NB_IoT->message.choice.c1.choice.rrcConnectionResumeRequest_r13.criticalExtensions.choice.rrcConnectionResumeRequest_r13;
LOG_I(RRC,PROTOCOL_RRC_CTXT_UE_FMT" RRCConnectionResumeRequest-NB cause %s\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
......@@ -2223,7 +2228,7 @@ int rrc_eNB_decode_dcch_NB_IoT(
{
asn_dec_rval_t dec_rval;
UL_DCCH_Message_NB_t *ul_dcch_msg_NB = NULL;
UL_DCCH_Message_NB_t *ul_dcch_msg_NB_IoT = NULL;
UE_Capability_NB_r13_t *UE_Capability_NB = NULL;
int i;
struct rrc_eNB_ue_context_NB_IoT_s* ue_context_p = NULL;
......@@ -2248,7 +2253,7 @@ int rrc_eNB_decode_dcch_NB_IoT(
dec_rval = uper_decode(
NULL,
&asn_DEF_UL_DCCH_Message_NB,
(void**)&ul_dcch_msg_NB,
(void**)&ul_dcch_msg_NB_IoT,
Rx_sdu,
sdu_sizeP,
0,
......@@ -2276,9 +2281,9 @@ int rrc_eNB_decode_dcch_NB_IoT(
&eNB_rrc_inst_NB_IoT[ctxt_pP->module_id],
ctxt_pP->rnti);
if (ul_dcch_msg_NB->message.present == UL_DCCH_MessageType_NB_PR_c1) {
if (ul_dcch_msg_NB_IoT->message.present == UL_DCCH_MessageType_NB_PR_c1) {
switch (ul_dcch_msg_NB->message.choice.c1.present) {
switch (ul_dcch_msg_NB_IoT->message.choice.c1.present) {
case UL_DCCH_MessageType_NB__c1_PR_NOTHING: /* No components present */
break;
......@@ -2309,10 +2314,10 @@ int rrc_eNB_decode_dcch_NB_IoT(
PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
"(RRCConnectionReconfigurationComplete-NB) ---> RRC_eNB]\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
DCCH1, //through SRB1
DCCH1_NB_IoT, //through SRB1
sdu_sizeP);
if (ul_dcch_msg_NB->message.choice.c1.choice.rrcConnectionReconfigurationComplete_r13.criticalExtensions.
if (ul_dcch_msg_NB_IoT->message.choice.c1.choice.rrcConnectionReconfigurationComplete_r13.criticalExtensions.
present == RRCConnectionReconfigurationComplete_NB__criticalExtensions_PR_rrcConnectionReconfigurationComplete_r13) {
/*NN: revise the condition */
......@@ -2322,18 +2327,18 @@ int rrc_eNB_decode_dcch_NB_IoT(
dedicated_DRB = 1;
LOG_I(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED_NB_IoT (dedicated DRB, xid %ld)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg_NB->message.choice.c1.choice.rrcConnectionReconfigurationComplete_r13.rrc_TransactionIdentifier);
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg_NB_IoT->message.choice.c1.choice.rrcConnectionReconfigurationComplete_r13.rrc_TransactionIdentifier);
}else { //a default bearer has been established
dedicated_DRB = 0;
ue_context_p->ue_context.Status = RRC_RECONFIGURED_NB_IoT;
LOG_I(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED_NB_IoT (default DRB, xid %ld)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg_NB->message.choice.c1.choice.rrcConnectionReconfigurationComplete_r13.rrc_TransactionIdentifier);
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg_NB_IoT->message.choice.c1.choice.rrcConnectionReconfigurationComplete_r13.rrc_TransactionIdentifier);
}
rrc_eNB_process_RRCConnectionReconfigurationComplete_NB_IoT(
ctxt_pP,
ue_context_p,
ul_dcch_msg_NB->message.choice.c1.choice.rrcConnectionReconfigurationComplete_r13.rrc_TransactionIdentifier);
ul_dcch_msg_NB_IoT->message.choice.c1.choice.rrcConnectionReconfigurationComplete_r13.rrc_TransactionIdentifier);
#if defined(FLEXRAN_AGENT_SB_IF)
//WARNING:Inform the controller about the UE activation. Should be moved to RRC agent in the future
......@@ -2351,7 +2356,7 @@ int rrc_eNB_decode_dcch_NB_IoT(
if (dedicated_DRB == 1){
rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(ctxt_pP,
ue_context_p,
ul_dcch_msg_NB->message.choice.c1.choice.rrcConnectionReconfigurationComplete_r13.rrc_TransactionIdentifier);
ul_dcch_msg_NB_IoT->message.choice.c1.choice.rrcConnectionReconfigurationComplete_r13.rrc_TransactionIdentifier);
}else {
rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(ctxt_pP,
ue_context_p);
......@@ -2396,7 +2401,7 @@ int rrc_eNB_decode_dcch_NB_IoT(
PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
"(rrcConnectionReestablishmentComplete-NB) ---> RRC_eNB\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
DCCH,
DCCH_NB_IoT,
sdu_sizeP);
break;
......@@ -2430,13 +2435,13 @@ int rrc_eNB_decode_dcch_NB_IoT(
DCCH0_NB_IoT,//SRB1bis
sdu_sizeP);
if (ul_dcch_msg_NB->message.choice.c1.choice.rrcConnectionSetupComplete_r13.criticalExtensions.present ==
if (ul_dcch_msg_NB_IoT->message.choice.c1.choice.rrcConnectionSetupComplete_r13.criticalExtensions.present ==
RRCConnectionSetupComplete_NB__criticalExtensions_PR_rrcConnectionSetupComplete_r13) {
rrc_eNB_process_RRCConnectionSetupComplete_NB_IoT(
ctxt_pP,
ue_context_p,
&ul_dcch_msg_NB->message.choice.c1.choice.rrcConnectionSetupComplete_r13.criticalExtensions.choice.rrcConnectionSetupComplete_r13);
&ul_dcch_msg_NB_IoT->message.choice.c1.choice.rrcConnectionSetupComplete_r13.criticalExtensions.choice.rrcConnectionSetupComplete_r13);
//set Ue status CONNECTED
ue_context_p->ue_context.Status = RRC_CONNECTED_NB_IoT;
......@@ -2491,7 +2496,7 @@ int rrc_eNB_decode_dcch_NB_IoT(
LOG_I(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" received securityModeComplete-NB on UL-DCCH %d from UE\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
DCCH);
DCCH_NB_IoT);
LOG_D(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
"(securityModeComplete-NB) ---> RRC_eNB\n",
......@@ -2499,7 +2504,7 @@ int rrc_eNB_decode_dcch_NB_IoT(
DCCH0_NB_IoT,//through SRB1bis
sdu_sizeP);
#ifdef XER_PRINT
xer_fprint(stdout, &asn_DEF_UL_DCCH_Message_NB, (void *)ul_dcch_msg_NB);
xer_fprint(stdout, &asn_DEF_UL_DCCH_Message_NB, (void *)ul_dcch_msg_NB_IoT);
#endif
......@@ -2560,7 +2565,7 @@ int rrc_eNB_decode_dcch_NB_IoT(
sdu_sizeP);
#ifdef XER_PRINT
xer_fprint(stdout, &asn_DEF_UL_DCCH_Message_NB, (void *)ul_dcch_msg_NB);
xer_fprint(stdout, &asn_DEF_UL_DCCH_Message_NB, (void *)ul_dcch_msg_NB_IoT);
#endif
......@@ -2585,7 +2590,7 @@ int rrc_eNB_decode_dcch_NB_IoT(
NULL,
NULL,
NULL,
DCCH1//its only for check purposes (if correctly called could be deleted)
DCCH1_NB_IoT//its only for check purposes (if correctly called could be deleted)
);
rrc_eNB_generate_UECapabilityEnquiry_NB_IoT(ctxt_pP, ue_context_p);
......@@ -2622,12 +2627,12 @@ int rrc_eNB_decode_dcch_NB_IoT(
LOG_I(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" received ueCapabilityInformation-NB on UL-DCCH %d from UE\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
DCCH1);
DCCH1_NB_IoT);
LOG_D(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
"(UECapabilityInformation) ---> RRC_eNB\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
DCCH1,
DCCH1_NB_IoT,
sdu_sizeP);
#ifdef XER_PRINT
xer_fprint(stdout, &asn_DEF_UL_DCCH_Message_NB, (void *)ul_dcch_msg);
......@@ -2649,7 +2654,7 @@ int rrc_eNB_decode_dcch_NB_IoT(
if (EPC_MODE_ENABLED == 1) {
rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(ctxt_pP,
ue_context_p,
ul_dcch_msg_NB);
ul_dcch_msg_NB_IoT);
}
#else
ue_context_p->ue_context.nb_of_e_rabs = 1;
......@@ -2698,7 +2703,7 @@ int rrc_eNB_decode_dcch_NB_IoT(
if (EPC_MODE_ENABLED == 1) {
rrc_eNB_send_S1AP_UPLINK_NAS(ctxt_pP,
ue_context_p,
ul_dcch_msg_NB);
ul_dcch_msg_NB_IoT);
}
#endif
......@@ -2737,7 +2742,7 @@ int rrc_eNB_decode_dcch_NB_IoT(
PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
"(rrcConnectionResumeComplete-NB) ---> RRC_eNB\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
DCCH, //check
DCCH_NB_IoT, //check
sdu_sizeP);
break;
......
......@@ -51,7 +51,7 @@
#include "LAYER2/MAC/proto.h"
#include "RRC/LITE/vars.h"
#include "PHY_INTERFACE/vars.h"
#include "PHY_INTERFACE/defs_nb_iot.h"
#include "PHY_INTERFACE/defs.h"
#ifdef SMBV
#include "PHY/TOOLS/smbv.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment