From 81f04d29820986427d8a155fecf37c1c9cfb8997 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Thu, 4 Apr 2019 08:17:26 +0200 Subject: [PATCH 01/44] Apply diff between ssr (CDRX) branch and develop --- common/utils/LOG/vcd_signal_dumper.c | 10 +- common/utils/LOG/vcd_signal_dumper.h | 8 + common/utils/T/T_defs.h | 2 +- common/utils/T/T_messages.txt | 40 + openair1/PHY/LTE_TRANSPORT/edci.c | 4 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 19 +- openair1/PHY/LTE_TRANSPORT/transport_eNB.h | 2 +- openair1/SCHED/fapi_l1.c | 12 +- openair1/SCHED/phy_procedures_lte_eNb.c | 292 +++-- openair2/COMMON/rrc_messages_types.h | 9 + openair2/ENB_APP/enb_config.c | 347 ++++- openair2/ENB_APP/enb_config_eMTC.c | 9 +- openair2/ENB_APP/enb_paramdef.h | 61 +- openair2/ENB_APP/enb_paramdef_emtc.h | 6 + openair2/LAYER2/MAC/config.c | 355 ++++++ openair2/LAYER2/MAC/eNB_scheduler.c | 1111 +++++++++++------ openair2/LAYER2/MAC/eNB_scheduler_RA.c | 3 + openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 104 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 204 ++- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 333 +++-- openair2/LAYER2/MAC/mac.h | 48 + openair2/LAYER2/MAC/mac_proto.h | 4 + openair2/LAYER2/MAC/pre_processor.c | 34 +- openair2/RRC/LTE/L2_interface_common.c | 35 +- openair2/RRC/LTE/L2_interface_ue.c | 320 +++-- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 180 ++- openair2/RRC/LTE/MESSAGES/asn1_msg.h | 9 + openair2/RRC/LTE/rrc_UE.c | 6 +- openair2/RRC/LTE/rrc_UE_ral.c | 210 ++-- openair2/RRC/LTE/rrc_common.c | 26 +- openair2/RRC/LTE/rrc_defs.h | 2 + openair2/RRC/LTE/rrc_eNB.c | 592 +++++---- openair2/RRC/LTE/rrc_eNB_UE_context.c | 37 +- openair2/RRC/LTE/rrc_eNB_ral.c | 208 ++- openair2/RRC/LTE/rrc_rrm_interface.c | 65 +- openair2/RRC/LTE/rrm_2_rrc_msg.c | 199 ++- openair2/RRC/LTE/utils.c | 24 +- 37 files changed, 3210 insertions(+), 1720 deletions(-) diff --git a/common/utils/LOG/vcd_signal_dumper.c b/common/utils/LOG/vcd_signal_dumper.c index 666bf46d44..2b18e75806 100644 --- a/common/utils/LOG/vcd_signal_dumper.c +++ b/common/utils/LOG/vcd_signal_dumper.c @@ -189,7 +189,15 @@ const char* eurecomVariablesNames[] = { "ue0_trx_write_ns_missing", "enb_thread_rxtx_CPUID", "ru_thread_CPUID", - "ru_thread_tx_CPUID" + "ru_thread_tx_CPUID", + "ue0_on_duration_timer", + "ue0_drx_inactivity", + "ue0_drx_short_cycle", + "ue0_short_drx_cycle_number", + "ue0_drx_long_cycle", + "ue0_drx_retransmission_harq0", + "ue0_drx_active_time", + "ue0_drx_active_time_condition" }; const char* eurecomFunctionsNames[] = { diff --git a/common/utils/LOG/vcd_signal_dumper.h b/common/utils/LOG/vcd_signal_dumper.h index 749978bb48..cb98da3e82 100644 --- a/common/utils/LOG/vcd_signal_dumper.h +++ b/common/utils/LOG/vcd_signal_dumper.h @@ -167,6 +167,14 @@ typedef enum { VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX, VCD_SIGNAL_DUMPER_VARIABLES_CPUID_RU_THREAD, VCD_SIGNAL_DUMPER_VARIABLES_CPUID_RU_THREAD_TX, + VCD_SIGNAL_DUMPER_VARIABLES_ON_DURATION_TIMER, + VCD_SIGNAL_DUMPER_VARIABLES_DRX_INACTIVITY, + VCD_SIGNAL_DUMPER_VARIABLES_DRX_SHORT_CYCLE, + VCD_SIGNAL_DUMPER_VARIABLES_SHORT_DRX_CYCLE_NUMBER, + VCD_SIGNAL_DUMPER_VARIABLES_DRX_LONG_CYCLE, + VCD_SIGNAL_DUMPER_VARIABLES_DRX_RETRANSMISSION_HARQ0, + VCD_SIGNAL_DUMPER_VARIABLES_DRX_ACTIVE_TIME, + VCD_SIGNAL_DUMPER_VARIABLES_DRX_ACTIVE_TIME_CONDITION, VCD_SIGNAL_DUMPER_VARIABLES_END } vcd_signal_dump_variables; diff --git a/common/utils/T/T_defs.h b/common/utils/T/T_defs.h index 83a380662d..908a94f532 100644 --- a/common/utils/T/T_defs.h +++ b/common/utils/T/T_defs.h @@ -44,7 +44,7 @@ typedef struct { #define VCD_NUM_FUNCTIONS 190 /* number of VCD variables (to be kept up to date! see in T_messages.txt) */ -#define VCD_NUM_VARIABLES 128 +#define VCD_NUM_VARIABLES 136 /* first VCD function (to be kept up to date! see in T_messages.txt) */ #define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index 1dbfe64a2a..3e3b5052e1 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -1676,6 +1676,46 @@ ID = VCD_VARIABLE_CPUID_RU_THREAD_TX GROUP = ALL:VCD:ENB:VCD_VARIABLE FORMAT = ulong,value VCD_NAME = ru_thread_tx_CPUID +ID = VCD_VARIABLE_ON_DURATION_TIMER + DESC = VCD variable ON_DURATION_TIMER + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = ue0_on_duration_timer +ID = VCD_VARIABLE_DRX_INACTIVITY + DESC = VCD variable DRX_INACTIVITY + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = ue0_drx_inactivity +ID = VCD_VARIABLE_DRX_SHORT_CYCLE + DESC = VCD variable DRX_SHORT_CYCLE + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = ue0_drx_short_cycle +ID = VCD_VARIABLE_SHORT_DRX_CYCLE_NUMBER + DESC = VCD variable SHORT_DRX_CYCLE_NUMBER + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = ue0_short_drx_cycle_number +ID = VCD_VARIABLE_DRX_LONG_CYCLE + DESC = VCD variable DRX_LONG_CYCLE + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = ue0_drx_long_cycle +ID = VCD_VARIABLE_DRX_RETRANSMISSION_HARQ0 + DESC = VCD variable DRX_RETRANSMISSION_HARQ0 + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = ue0_drx_retransmission_harq0 +ID = VCD_VARIABLE_DRX_ACTIVE_TIME + DESC = VCD variable DRX_ACTIVE_TIME + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = ue0_drx_active_time +ID = VCD_VARIABLE_DRX_ACTIVE_TIME_CONDITION + DESC = VCD variable DRX_ACTIVE_TIME_CONDITION + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value + VCD_NAME = ue0_drx_active_time_condition #functions diff --git a/openair1/PHY/LTE_TRANSPORT/edci.c b/openair1/PHY/LTE_TRANSPORT/edci.c index f1b5c356c7..b438953e83 100644 --- a/openair1/PHY/LTE_TRANSPORT/edci.c +++ b/openair1/PHY/LTE_TRANSPORT/edci.c @@ -115,8 +115,8 @@ void init_mpdcch5ss1tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB * eNB) for (k = 0; k < 72; k++) { kmod = k % 12; if (((l != 5) && (l != 6) && (l != 12) && (l != 13)) || (kmod == 2) || (kmod == 3) || (kmod == 4) || (kmod == 7) || (kmod == 8) || (kmod == 9)) { - mpdcch5ss1tab[re] = (l * eNB->frame_parms.ofdm_symbol_size) + k; - re++; + mpdcch5ss1tab[re] = (l * eNB->frame_parms.ofdm_symbol_size) + k; + re++; } else if ((kmod == 0) || (kmod == 5) || (kmod == 10)) { mpdcch5ss1tab[re++] = (l * eNB->frame_parms.ofdm_symbol_size) + k; } diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index f9eee10b2a..676d753ab5 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -722,17 +722,13 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) ,uint8_t br_flag #endif - ) +) +//----------------------------------------------------------------------------- { - - - static int first_call=1; - LTE_eNB_COMMON *common_vars = &eNB->common_vars; - LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; - // PUCCH_CONFIG_DEDICATED *pucch_config_dedicated = &eNB->pucch_config_dedicated[UE_id]; - - int8_t sigma2_dB = max(eNB->measurements.n0_subband_power_tot_dB[0], - eNB->measurements.n0_subband_power_tot_dB[eNB->frame_parms.N_RB_UL-1]); + static int first_call = 1; + LTE_eNB_COMMON *common_vars = &eNB->common_vars; + LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; + int8_t sigma2_dB = max(eNB->measurements.n0_subband_power_tot_dB[0], eNB->measurements.n0_subband_power_tot_dB[eNB->frame_parms.N_RB_UL-1]); uint32_t u,v,n,aa; uint32_t z[12*14]; @@ -770,7 +766,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, uint16_t Ret = 0; int16_t SubCarrierDeMapData[NB_ANTENNAS_RX][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex] int16_t CshData_fmt3[NB_ANTENNAS_RX][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex] - double delta_theta[NB_ANTENNAS_RX][12]; //[Antenna][Subcarrier][Complex] + double delta_theta[NB_ANTENNAS_RX][12]; //[Antenna][Subcarrier][Complex] int16_t ChestValue[NB_ANTENNAS_RX][2][12][2]; //[Antenna][Slot][Subcarrier][Complex] int16_t ChdetAfterValue_fmt3[NB_ANTENNAS_RX][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex] int16_t RemoveFrqDev_fmt3[NB_ANTENNAS_RX][2][5][12][2]; //[Antenna][Slot][PUCCH_Symbol][Subcarrier][Complex] @@ -779,7 +775,6 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, int16_t Fmt3xDataAvgSym[2][12][2]; //[Slot][Subcarrier][Complex] int16_t IFFTOutData_Fmt3[2][12][2]; //[Slot][Subcarrier][Complex] int16_t b[48]; //[bit] - //int16_t IP_CsData_allavg[NB_ANTENNAS_RX][12][4][2]; //[Antenna][Symbol][Nouse Cyclic Shift][Complex] int16_t payload_entity = -1; int16_t Interpw; int16_t payload_max; diff --git a/openair1/PHY/LTE_TRANSPORT/transport_eNB.h b/openair1/PHY/LTE_TRANSPORT/transport_eNB.h index 35e7beeeab..6c1f674788 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_eNB.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_eNB.h @@ -329,7 +329,7 @@ typedef struct { uint8_t subframe; /// corresponding UE RNTI uint16_t rnti; - /// Type (SR,HARQ,CQI,HARQ_SR,HARQ_CQI,SR_CQI,HARQ_SR_CQI) + /// Type (SR, HARQ, CQI, HARQ_SR, HARQ_CQI, SR_CQI, HARQ_SR_CQI) UCI_type_t type; /// SRS active flag uint8_t srs_active; diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index 094f972253..1935f98579 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -598,7 +598,12 @@ void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_co } } -void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) +void handle_uci_sr_pdu(PHY_VARS_eNB *eNB, + int UE_id, + nfapi_ul_config_request_pdu_t *ul_config_pdu, + uint16_t frame, + uint8_t subframe, + uint8_t srs_active) { LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; @@ -620,7 +625,10 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t uci->total_repetitions = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel13.total_number_of_repetitions; #endif LOG_D(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", - uci->rnti,uci->n_pucch_1_0_sr[0],frame,subframe); + uci->rnti, + uci->n_pucch_1_0_sr[0], + frame, + subframe); } void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 2dc16ef110..25b4a46a96 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -684,54 +684,69 @@ void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,u pthread_mutex_unlock(&eNB->UL_INFO_mutex); } -void uci_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) +//----------------------------------------------------------------------------- +/* + * Main handler of PUCCH received + */ +void +uci_procedures(PHY_VARS_eNB *eNB, + L1_rxtx_proc_t *proc) +//----------------------------------------------------------------------------- { - LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; - uint8_t SR_payload = 0,pucch_b0b1[4][2]= {{0,0},{0,0},{0,0},{0,0}},harq_ack[4]={0,0,0,0}; - int32_t metric[4]={0,0,0,0},metric_SR=0,max_metric=0; + uint8_t SR_payload = 0; + uint8_t pucch_b0b1[4][2] = {{0,0},{0,0},{0,0},{0,0}}; + uint8_t harq_ack[4] = {0,0,0,0}; + uint16_t tdd_multiplexing_mask = 0; + int32_t metric[4] = {0,0,0,0}; + int32_t metric_SR = 0; + int32_t max_metric = 0; const int subframe = proc->subframe_rx; const int frame = proc->frame_rx; - int i; - LTE_eNB_UCI *uci; - uint16_t tdd_multiplexing_mask=0; - - for (i=0;iuci_vars[i]; + LTE_eNB_UCI *uci = NULL; + LTE_DL_FRAME_PARMS *fp = &(eNB->frame_parms); + + for (int i = 0; i < NUMBER_OF_UE_MAX; i++) { + uci = &(eNB->uci_vars[i]); + if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) { + LOG_D(PHY,"Frame %d, subframe %d: Running uci procedures (type %d) for %d \n", + frame, + subframe, + uci->type, + i); - LOG_D (PHY, "Frame %d, subframe %d: Running uci procedures (type %d) for %d \n", frame, subframe, uci->type, i); uci->active = 0; - + // Null out PUCCH PRBs for noise measurement switch (fp->N_RB_UL) { - case 6: - eNB->rb_mask_ul[0] |= (0x1 | (1 << 5)); //position 5 - break; - case 15: - eNB->rb_mask_ul[0] |= (0x1 | (1 << 14)); // position 14 - break; - case 25: - eNB->rb_mask_ul[0] |= (0x1 | (1 << 24)); // position 24 - break; - case 50: - eNB->rb_mask_ul[0] |= 0x1; - eNB->rb_mask_ul[1] |= (1 << 17); // position 49 (49-32) - break; - case 75: - eNB->rb_mask_ul[0] |= 0x1; - eNB->rb_mask_ul[2] |= (1 << 10); // position 74 (74-64) - break; - case 100: - eNB->rb_mask_ul[0] |= 0x1; - eNB->rb_mask_ul[3] |= (1 << 3); // position 99 (99-96) - break; - default: - LOG_E (PHY, "Unknown number for N_RB_UL %d\n", fp->N_RB_UL); - break; + case 6: + eNB->rb_mask_ul[0] |= (0x1 | (1 << 5)); // position 5 + break; + case 15: + eNB->rb_mask_ul[0] |= (0x1 | (1 << 14)); // position 14 + break; + case 25: + eNB->rb_mask_ul[0] |= (0x1 | (1 << 24)); // position 24 + break; + case 50: + eNB->rb_mask_ul[0] |= 0x1; + eNB->rb_mask_ul[1] |= (1 << 17); // position 49 (49-32) + break; + case 75: + eNB->rb_mask_ul[0] |= 0x1; + eNB->rb_mask_ul[2] |= (1 << 10); // position 74 (74-64) + break; + case 100: + eNB->rb_mask_ul[0] |= 0x1; + eNB->rb_mask_ul[3] |= (1 << 3); // position 99 (99-96) + break; + default: + LOG_E(PHY,"Unknown number for N_RB_UL %d\n", fp->N_RB_UL); + break; } + SR_payload = 0; + switch (uci->type) { case SR: case HARQ_SR: @@ -1236,8 +1251,8 @@ void uci_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) } } } - } - } + } // end if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) { + } // end loop for (int i = 0; i < NUMBER_OF_UE_MAX; i++) { } void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) @@ -1602,87 +1617,152 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) { pthread_mutex_unlock(&eNB->UL_INFO_mutex); } -/* release the harq if its round is >= 'after_rounds' */ -static void do_release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subframe,uint16_t mask, int after_rounds) { - - LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; - LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; +//----------------------------------------------------------------------------- +/* + * Release the harq if its round is >= 'after_rounds' + */ +static void do_release_harq(PHY_VARS_eNB *eNB, + int UE_id, + int tb, + uint16_t frame, + uint8_t subframe, + uint16_t mask, + int after_rounds) +//----------------------------------------------------------------------------- +{ + LTE_eNB_DLSCH_t *dlsch0 = NULL; + LTE_eNB_DLSCH_t *dlsch1 = NULL; + LTE_DL_eNB_HARQ_t *dlsch0_harq = NULL; + LTE_DL_eNB_HARQ_t *dlsch1_harq = NULL; + int UE_id_mac = -1; + UE_sched_ctrl *UE_scheduling_control = NULL; int harq_pid; - int subframe_tx,frame_tx; - int M,m; - AssertFatal (UE_id != -1, "no existing dlsch context\n"); - AssertFatal (UE_id < NUMBER_OF_UE_MAX, "returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n", UE_id, NUMBER_OF_UE_MAX); + int subframe_tx; + int frame_tx; + + AssertFatal(UE_id != -1, "No existing dlsch context\n"); + AssertFatal(UE_id < NUMBER_OF_UE_MAX, "Returned UE_id %d >= %d (NUMBER_OF_UE_MAX)\n", UE_id, NUMBER_OF_UE_MAX); + dlsch0 = eNB->dlsch[UE_id][0]; dlsch1 = eNB->dlsch[UE_id][1]; - - if (eNB->frame_parms.frame_type == FDD) { - subframe_tx = (subframe+6)%10; - frame_tx = ul_ACK_subframe2_dl_frame(&eNB->frame_parms,frame,subframe,subframe_tx); - harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx]; // or just use 0 for fdd? - - AssertFatal((harq_pid>=0) && (harq_pid<10),"harq_pid %d not in 0...9\n",harq_pid); - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; - AssertFatal(dlsch0_harq!=NULL,"dlsch0_harq is null\n"); + + UE_id_mac = find_UE_id(eNB->Mod_id, dlsch0->rnti); + UE_scheduling_control = &(RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[UE_id_mac]); + + if (eNB->frame_parms.frame_type == FDD) { + subframe_tx = (subframe + 6) % 10; + frame_tx = ul_ACK_subframe2_dl_frame(&eNB->frame_parms, + frame, + subframe, + subframe_tx); + + harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx]; + + AssertFatal((harq_pid >= 0) && (harq_pid < 8),"harq_pid %d not in 0...7\n", harq_pid); + + dlsch0_harq = dlsch0->harq_processes[harq_pid]; + dlsch1_harq = dlsch1->harq_processes[harq_pid]; + AssertFatal(dlsch0_harq != NULL, "dlsch0_harq is null\n"); + #if T_TRACER if (after_rounds != -1) { - T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(0), T_INT(frame), T_INT(subframe), - T_INT(dlsch0->rnti), T_INT(harq_pid)); + T(T_ENB_PHY_DLSCH_UE_NACK, + T_INT(0), + T_INT(frame), + T_INT(subframe), + T_INT(dlsch0->rnti), + T_INT(harq_pid)); } else { - T(T_ENB_PHY_DLSCH_UE_ACK, T_INT(0), T_INT(frame), T_INT(subframe), - T_INT(dlsch0->rnti), T_INT(harq_pid)); + T(T_ENB_PHY_DLSCH_UE_ACK, + T_INT(0), + T_INT(frame), + T_INT(subframe), + T_INT(dlsch0->rnti), + T_INT(harq_pid)); } #endif - + + /* + LOG_I(PHY, "UE_id = %d; Frame %d, subframe %d: Releasing harq %d for UE %x, CC_id = %d; HARQ RTT Timer = %d,%d,%d,%d,%d,%d,%d,%d, drx-ReTX = %d, cdrx-configured = %d\n", + UE_id_mac, + frame, + subframe, + harq_pid, + dlsch0->rnti, + eNB->CC_id, + UE_scheduling_control->harq_rtt_timer[eNB->CC_id][0], + UE_scheduling_control->harq_rtt_timer[eNB->CC_id][1], + UE_scheduling_control->harq_rtt_timer[eNB->CC_id][2], + UE_scheduling_control->harq_rtt_timer[eNB->CC_id][3], + UE_scheduling_control->harq_rtt_timer[eNB->CC_id][4], + UE_scheduling_control->harq_rtt_timer[eNB->CC_id][5], + UE_scheduling_control->harq_rtt_timer[eNB->CC_id][6], + UE_scheduling_control->harq_rtt_timer[eNB->CC_id][7], + UE_scheduling_control->drx_retransmission_timer[harq_pid], + UE_scheduling_control->cdrx_configured); + */ + if (dlsch0_harq->round >= after_rounds) { dlsch0_harq->status = SCH_IDLE; - /*if ((dlsch1_harq == NULL)|| - ((dlsch1_harq!=NULL)&& - (dlsch1_harq->status == SCH_IDLE)))*/ - dlsch0->harq_mask &= ~(1<harq_mask &= ~(1 << harq_pid); + + /* CDRX: PUCCH gives an ACK or no more repetitions, so reset corresponding HARQ RTT */ + UE_scheduling_control->harq_rtt_timer[eNB->CC_id][harq_pid] = 0; } - LOG_D(PHY,"Frame %d, subframe %d: Releasing harq %d for UE %x\n",frame,subframe,harq_pid,dlsch0->rnti); - - } - else { // release all processes in the bundle that was acked, based on mask - // This is at most 4 for multiplexing and 9 for bundling/special bundling - M=ul_ACK_subframe2_M(&eNB->frame_parms, - subframe); - - for (m=0; mframe_parms, subframe); + + for (int m=0; m < M; m++) { subframe_tx = ul_ACK_subframe2_dl_subframe(&eNB->frame_parms, - subframe, - m); - frame_tx = ul_ACK_subframe2_dl_frame(&eNB->frame_parms,frame,subframe,subframe_tx); - if (((1< 0) { - harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx]; - if ((harq_pid>=0) && (harq_pidMdlharq)) { - dlsch0_harq = dlsch0->harq_processes[harq_pid]; - dlsch1_harq = dlsch1->harq_processes[harq_pid]; - AssertFatal(dlsch0_harq!=NULL,"dlsch0_harq is null\n"); - + subframe, + m); + + frame_tx = ul_ACK_subframe2_dl_frame(&eNB->frame_parms, + frame, + subframe, + subframe_tx); + + if (((1 << m) & mask) > 0) { + harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx]; + + if ((harq_pid >= 0) && (harq_pid < dlsch0->Mdlharq)) { + dlsch0_harq = dlsch0->harq_processes[harq_pid]; + dlsch1_harq = dlsch1->harq_processes[harq_pid]; + + AssertFatal(dlsch0_harq != NULL, "Dlsch0_harq is null\n"); + #if T_TRACER - if (after_rounds != -1) { - T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(0), T_INT(frame), T_INT(subframe), - T_INT(dlsch0->rnti), T_INT(harq_pid)); - } else { - T(T_ENB_PHY_DLSCH_UE_ACK, T_INT(0), T_INT(frame), T_INT(subframe), - T_INT(dlsch0->rnti), T_INT(harq_pid)); - } + if (after_rounds != -1) { + T(T_ENB_PHY_DLSCH_UE_NACK, + T_INT(0), + T_INT(frame), + T_INT(subframe), + T_INT(dlsch0->rnti), + T_INT(harq_pid)); + } else { + T(T_ENB_PHY_DLSCH_UE_ACK, + T_INT(0), + T_INT(frame), + T_INT(subframe), + T_INT(dlsch0->rnti), + T_INT(harq_pid)); + } #endif - if (dlsch0_harq->round >= after_rounds) { - dlsch0_harq->status = SCH_IDLE; - if ((dlsch1_harq == NULL)|| - ((dlsch1_harq!=NULL)&& - (dlsch1_harq->status == SCH_IDLE))) - dlsch0->harq_mask &= ~(1<round >= after_rounds) { + dlsch0_harq->status = SCH_IDLE; + + if ((dlsch1_harq == NULL) || ((dlsch1_harq != NULL) && (dlsch1_harq->status == SCH_IDLE))) { + dlsch0->harq_mask &= ~(1 << harq_pid); + } + } + } // end if ((harq_pid >= 0) && (harq_pid < dlsch0->Mdlharq)) + } // end if (((1 << m) & mask) > 0) + } // end for (int m=0; m < M; m++) + } // end if TDD } static void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subframe,uint16_t mask, int is_ack) { diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 5b33923b92..e8cabe5bf5 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -36,6 +36,7 @@ #include "LTE_SystemInformationBlockType2.h" #include "LTE_SL-OffsetIndicator-r12.h" #include "LTE_SubframeBitmapSL-r12.h" +#include "LTE_DRX-Config.h" // Add DRX SSR 2018-10 #include "LTE_SL-CP-Len-r12.h" #include "LTE_SL-PeriodComm-r12.h" #include "LTE_SL-DiscResourcePool-r12.h" @@ -141,6 +142,14 @@ typedef struct RadioResourceConfig_s { long bcch_modificationPeriodCoeff; long pcch_defaultPagingCycle; long pcch_nB; + LTE_DRX_Config_PR drx_Config_present; // Add DRX SSR 2018-10 + long drx_onDurationTimer; // Add DRX SSR 2018-10 + long drx_InactivityTimer; // Add DRX SSR 2018-10 + long drx_RetransmissionTimer; // Add DRX SSR 2018-10 + LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR drx_longDrx_CycleStartOffset_present; // Add DRX SSR 2018-10 + long drx_longDrx_CycleStartOffset; // Add DRX SSR 2018-10 + long drx_shortDrx_Cycle; // Add DRX SSR 2018-10 + long drx_shortDrx_ShortCycleTimer; // Add DRX SSR 2018-10 long ue_TimersAndConstants_t300; long ue_TimersAndConstants_t301; long ue_TimersAndConstants_t310; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 189cf01e0e..f8f8d1bd76 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -55,7 +55,7 @@ #include "RRC_config_tools.h" #include "enb_paramdef.h" -#define RRC_INACTIVITY_THRESH 0 +#define RRC_INACTIVITY_THRESH 0 // set to '0' to deactivate (in ms) extern uint16_t sf_ahead; extern void set_parallel_conf(char *parallel_conf); @@ -285,8 +285,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { int j,k = 0; int32_t enb_id = 0; int nb_cc = 0; + int32_t offsetMaxLimit = 0; + int32_t cycleNb = 0; MessageDef *msg_p = itti_alloc_new_message(TASK_RRC_ENB, RRC_CONFIGURATION_REQ); - ccparams_lte_t ccparams_lte; ccparams_sidelink_t SLconfig; ccparams_eMTC_t eMTCconfig; @@ -1149,28 +1150,328 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { break; } - if (strcmp(ccparams_lte.pcch_nB, "fourT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_fourT; - } else if (strcmp(ccparams_lte.pcch_nB, "twoT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_twoT; - } else if (strcmp(ccparams_lte.pcch_nB, "oneT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneT; - } else if (strcmp(ccparams_lte.pcch_nB, "halfT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_halfT; - } else if (strcmp(ccparams_lte.pcch_nB, "quarterT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_quarterT; - } else if (strcmp(ccparams_lte.pcch_nB, "oneEighthT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneEighthT; - } else if (strcmp(ccparams_lte.pcch_nB, "oneSixteenthT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneSixteenthT; - } else if (strcmp(ccparams_lte.pcch_nB, "oneThirtySecondT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneThirtySecondT; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pcch_nB choice: fourT,twoT,oneT,halfT,quarterT,oneighthT,oneSixteenthT,oneThirtySecondT !\n", - RC.config_file_name, i, ccparams_lte.pcch_nB); + if (strcmp(ccparams_lte.pcch_nB, "fourT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_fourT; + } + else if (strcmp(ccparams_lte.pcch_nB, "twoT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_twoT; + } + else if (strcmp(ccparams_lte.pcch_nB, "oneT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneT; + } + else if (strcmp(ccparams_lte.pcch_nB, "halfT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_halfT; + } + else if (strcmp(ccparams_lte.pcch_nB, "quarterT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_quarterT; + } + else if (strcmp(ccparams_lte.pcch_nB, "oneEighthT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneEighthT; + } + else if (strcmp(ccparams_lte.pcch_nB, "oneSixteenthT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneSixteenthT; + } + else if (strcmp(ccparams_lte.pcch_nB, "oneThirtySecondT") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneThirtySecondT; + } + else { + AssertFatal (0, "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pcch_nB choice: fourT,twoT,oneT,halfT,quarterT,oneighthT,oneSixteenthT,oneThirtySecondT !\n", + RC.config_file_name, + i, + ccparams_lte.pcch_nB); + } - switch (ccparams_lte.bcch_modificationPeriodCoeff) { + if (strcmp(ccparams_lte.drx_Config_present, "prNothing") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_Config_present = LTE_DRX_Config_PR_NOTHING; + } else if (strcmp(ccparams_lte.drx_Config_present, "prRelease") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_Config_present = LTE_DRX_Config_PR_release; + } else if (strcmp(ccparams_lte.drx_Config_present, "prSetup") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_Config_present = LTE_DRX_Config_PR_setup; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for drx_Config_present choice: prNothing,prRelease,prSetup !\n", + RC.config_file_name, i, ccparams_lte.drx_Config_present); + } + + if (strcmp(ccparams_lte.drx_onDurationTimer, "psf1") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf1; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf2") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf2; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf3") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf3; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf4") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf4; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf5") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf5; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf6") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf6; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf8") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf8; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf10") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf10; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf20") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf20; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf30") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf30; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf40") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf40; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf50") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf50; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf60") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf60; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf80") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf80; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf100") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf100; + } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf200") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf200; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for drx_onDurationTimer choice !\n", + RC.config_file_name, i, ccparams_lte.drx_onDurationTimer); + break; + } + + if (strcmp(ccparams_lte.drx_InactivityTimer, "psf1") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf1; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf2") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf2; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf3") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf3; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf4") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf4; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf5") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf5; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf6") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf6; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf8") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf8; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf10") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf10; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf20") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf20; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf30") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf30; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf40") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf40; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf50") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf50; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf60") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf60; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf80") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf80; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf100") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf100; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf200") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf200; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf300") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf300; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf500") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf500; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf750") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf750; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf1280") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf1280; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf1920") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf1920; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf2560") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf2560; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf0-v1020") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf0_v1020; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare9") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare9; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare8") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare8; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare7") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare7; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare6") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare6; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare5") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare5; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare4") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare4; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare3") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare3; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare2") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare2; + } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare1") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare1; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for drx_InactivityTimer choice !\n", + RC.config_file_name, i, ccparams_lte.drx_InactivityTimer); + break; + } + + if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf1") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf1; + } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf2") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf2; + } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf4") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf4; + } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf6") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf6; + } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf8") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf8; + } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf16") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf16; + } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf24") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf24; + } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf33") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf33; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for drx_RetransmissionTimer choice !\n", + RC.config_file_name, i, ccparams_lte.drx_RetransmissionTimer); + break; + } + + if (ccparams_lte.drx_longDrx_CycleStartOffset_present == NULL || strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prNothing") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_NOTHING; + } else { + if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf10") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf10; + offsetMaxLimit = 10; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf20") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf20; + offsetMaxLimit = 20; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf32") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf32; + offsetMaxLimit = 32; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf40") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf40; + offsetMaxLimit = 40; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf64") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf64; + offsetMaxLimit = 64; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf80") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf80; + offsetMaxLimit = 80; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf128") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf128; + offsetMaxLimit = 128; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf160") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf160; + offsetMaxLimit = 160; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf256") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf256; + offsetMaxLimit = 256; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf320") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf320; + offsetMaxLimit = 320; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf512") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf512; + offsetMaxLimit = 512; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf640") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf640; + offsetMaxLimit = 640; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf1024") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1024; + offsetMaxLimit = 1024; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf1280") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1280; + offsetMaxLimit = 1280; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf2048") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2048; + offsetMaxLimit = 2048; + } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf2560") == 0) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2560; + offsetMaxLimit = 2560; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file \"%s\", enb %d unknown string value \"%s\" for drx_longDrx_CycleStartOffset_present choice !\n", + RC.config_file_name, i, ccparams_lte.drx_longDrx_CycleStartOffset_present); + } + + if (ccparams_lte.drx_longDrx_CycleStartOffset >= 0 && ccparams_lte.drx_longDrx_CycleStartOffset < offsetMaxLimit) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset = ccparams_lte.drx_longDrx_CycleStartOffset; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d incoherent value \"%d\" for drx_longDrx_CycleStartOffset !\n", + RC.config_file_name, i, ccparams_lte.drx_longDrx_CycleStartOffset); + } + } + + if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "") == 0 || ccparams_lte.drx_shortDrx_ShortCycleTimer == 0) { + if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "") != 0 || ccparams_lte.drx_shortDrx_ShortCycleTimer != 0) { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d incoherent values \"%s\" - \"%d\" for drx_shortDrx_Cycle or drx_shortDrx_ShortCycleTimer choice !\n", + RC.config_file_name, i, ccparams_lte.drx_shortDrx_Cycle, ccparams_lte.drx_shortDrx_ShortCycleTimer); + } else { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = -1; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_ShortCycleTimer = 0; + } + } else { + if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf2") == 0) { + cycleNb = 2; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf2; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf5") == 0) { + cycleNb = 5; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf5; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf8") == 0) { + cycleNb = 8; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf8; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf10") == 0) { + cycleNb = 10; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf10; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf16") == 0) { + cycleNb = 16; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf16; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf20") == 0) { + cycleNb = 20; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf20; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf32") == 0) { + cycleNb = 32; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf32; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf40") == 0) { + cycleNb = 40; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf40; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf64") == 0) { + cycleNb = 64; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf64; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf80") == 0) { + cycleNb = 80; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf80; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf128") == 0) { + cycleNb = 128; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf128; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf160") == 0) { + cycleNb = 160; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf160; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf256") == 0) { + cycleNb = 256; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf256; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf320") == 0) { + cycleNb = 320; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf320; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf512") == 0) { + cycleNb = 512; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf512; + } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf640") == 0) { + cycleNb = 640; + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf640; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d incoherent value \"%s\" for drx_shortDrx_Cycle !\n", + RC.config_file_name, i, ccparams_lte.drx_shortDrx_Cycle); + } + + if (cycleNb > 0 && (offsetMaxLimit % cycleNb != 0 || cycleNb == offsetMaxLimit)) { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d incompatible (not multiple) values \"%d\" - \"%d\" for drx_shortDrx_Cycle and drx_longDrx_CycleStartOffset choice !\n", + RC.config_file_name, i, cycleNb, offsetMaxLimit); + } + + if (ccparams_lte.drx_shortDrx_ShortCycleTimer >= 1 && ccparams_lte.drx_shortDrx_ShortCycleTimer <= 16 ) { + RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_ShortCycleTimer = ccparams_lte.drx_shortDrx_ShortCycleTimer; + } else { + AssertFatal (0, + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for drx_shortDrx_ShortCycleTimer choice !\n", + RC.config_file_name, i, ccparams_lte.drx_shortDrx_ShortCycleTimer ); + } + } + + switch (ccparams_lte.bcch_modificationPeriodCoeff) { case 2: RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n2; break; diff --git a/openair2/ENB_APP/enb_config_eMTC.c b/openair2/ENB_APP/enb_config_eMTC.c index 5a8362300e..effc93d244 100644 --- a/openair2/ENB_APP/enb_config_eMTC.c +++ b/openair2/ENB_APP/enb_config_eMTC.c @@ -932,8 +932,9 @@ void fill_eMTC_configuration(MessageDef *msg_p, ccparams_eMTC_t *eMTCconfig, in break; } RRC_CONFIGURATION_REQ (msg_p).rar_HoppingConfig_r13[cc_idx][rachCEInfoIndex] = eMTCconfig->rar_HoppingConfig_r13; + AssertFatal(eMTCconfig->rar_HoppingConfig_r13 == 0 || eMTCconfig->rar_HoppingConfig_r13 == 1, - "illegal rar_HoppingConfig_r13 %d\n",eMTCconfig->rar_HoppingConfig_r13); + "illegal rar_HoppingConfig_r13 %d\n",eMTCconfig->rar_HoppingConfig_r13); } // end for loop (rach ce level info) char rsrpRangeListPath[MAX_OPTNAME_SIZE * 2]; @@ -1101,11 +1102,12 @@ void fill_eMTC_configuration(MessageDef *msg_p, ccparams_eMTC_t *eMTCconfig, in /** PCCH CONFIG V1310 */ - RRC_CONFIGURATION_REQ(msg_p).pcch_config_v1310[cc_idx] = TRUE; RRC_CONFIGURATION_REQ(msg_p).paging_narrowbands_r13[cc_idx] = eMTCconfig->paging_narrowbands_r13; RRC_CONFIGURATION_REQ(msg_p).mpdcch_numrepetition_paging_r13[cc_idx] = eMTCconfig->mpdcch_numrepetition_paging_r13; - AssertFatal (eMTCconfig->mpdcch_numrepetition_paging_r13 == 1 || + + AssertFatal (eMTCconfig->mpdcch_numrepetition_paging_r13 == 0 || + eMTCconfig->mpdcch_numrepetition_paging_r13 == 1 || eMTCconfig->mpdcch_numrepetition_paging_r13 == 2 || eMTCconfig->mpdcch_numrepetition_paging_r13 == 4 || eMTCconfig->mpdcch_numrepetition_paging_r13 == 8 || @@ -1117,7 +1119,6 @@ void fill_eMTC_configuration(MessageDef *msg_p, ccparams_eMTC_t *eMTCconfig, in "illegal mpdcch_numrepetition_paging_r13 %d\n", eMTCconfig->mpdcch_numrepetition_paging_r13); - // RRC_CONFIGURATION_REQ(msg_p).nb_v1310[cc_idx] = CALLOC(1, sizeof(long)); // if (!strcmp(nb_v1310, "one64thT")) { // *RRC_CONFIGURATION_REQ(msg_p).nb_v1310[cc_idx] = 0; diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 54d6decfee..ba26f4e3d9 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -321,8 +321,7 @@ typedef enum { #define ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL2 "pucch_NumRepetitionCE_Msg4_Level2_r13" #define ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL3 "pucch_NumRepetitionCE_Msg4_Level3_r13" -#define ENB_CONFIG_STRING_FREQ_HOPPING_PARAMETERS_R13 "sib2_freq_hoppingParameters_r13" - +#define ENB_CONFIG_STRING_FREQ_HOPPING_PARAMETERS_R13 "sib2_freq_hoppingParameters_r13" #define ENB_CONFIG_STRING_PDSCH_RS_EPRE "pdsch_referenceSignalPower" #define ENB_CONFIG_STRING_PDSCH_PB "pdsch_p_b" @@ -364,6 +363,14 @@ typedef enum { #define ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX "rach_maxHARQ_Msg3Tx" #define ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE "pcch_default_PagingCycle" #define ENB_CONFIG_STRING_PCCH_NB "pcch_nB" +#define ENB_CONFIG_STRING_DRX_CONFIG_PRESENT "drx_Config_present" // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_ONDURATIONTIMER "drx_onDurationTimer" // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_INACTIVITYTIMER "drx_InactivityTimer" // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER "drx_RetransmissionTimer" // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_PRESENT "drx_longDrx_CycleStartOffset_present" // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET "drx_longDrx_CycleStartOffset" // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE "drx_shortDrx_Cycle" // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER "drx_shortDrx_ShortCycleTimer" // Add DRX SSR 2018-10 #define ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF "bcch_modificationPeriodCoeff" #define ENB_CONFIG_STRING_UETIMERS_T300 "ue_TimersAndConstants_t300" #define ENB_CONFIG_STRING_UETIMERS_T301 "ue_TimersAndConstants_t301" @@ -496,6 +503,14 @@ typedef struct ccparams_lte_s { int32_t rach_maxHARQ_Msg3Tx; int32_t pcch_defaultPagingCycle; char *pcch_nB; + char *drx_Config_present; + char *drx_onDurationTimer; + char *drx_InactivityTimer; + char *drx_RetransmissionTimer; + char *drx_longDrx_CycleStartOffset_present; + int32_t drx_longDrx_CycleStartOffset; + char *drx_shortDrx_Cycle; + int32_t drx_shortDrx_ShortCycleTimer; int32_t bcch_modificationPeriodCoeff; int32_t ue_TimersAndConstants_t300; int32_t ue_TimersAndConstants_t301; @@ -574,6 +589,14 @@ typedef struct ccparams_lte_s { { .s5= {NULL }} , \ { .s5= {NULL }} , \ { .s5= {NULL }} , \ + { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ + { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ + { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ + { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ + { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ + { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ + { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ + { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ { .s5= {NULL }} , \ { .s1a= { config_check_modify_integer, UETIMER_T300_OKVALUES, UETIMER_T300_MODVALUES,8}} , \ { .s1a= { config_check_modify_integer, UETIMER_T301_OKVALUES, UETIMER_T301_MODVALUES,8}} , \ @@ -688,6 +711,14 @@ typedef struct ccparams_lte_s { {ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, NULL, 0, iptr:&ccparams.rach_maxHARQ_Msg3Tx, defintval:4, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE, NULL, 0, iptr:&ccparams.pcch_defaultPagingCycle, defintval:128, TYPE_INT, 0}, \ {ENB_CONFIG_STRING_PCCH_NB, NULL, 0, strptr:&ccparams.pcch_nB, defstrval:"oneT", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_DRX_CONFIG_PRESENT, NULL, 0, strptr:&ccparams.drx_Config_present, defstrval:"prNothing", TYPE_STRING, 0}, /* Add DRX SSR 2018-10 */ \ +{ENB_CONFIG_STRING_DRX_ONDURATIONTIMER, NULL, 0, strptr:&ccparams.drx_onDurationTimer, defstrval:"psf10", TYPE_STRING, 0}, /* Add DRX SSR 2018-10 */ \ +{ENB_CONFIG_STRING_DRX_INACTIVITYTIMER, NULL, 0, strptr:&ccparams.drx_InactivityTimer, defstrval:"psf10", TYPE_STRING, 0}, /* Add DRX SSR 2018-10 */ \ +{ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER, NULL, 0, strptr:&ccparams.drx_RetransmissionTimer, defstrval:"psf8", TYPE_STRING, 0}, /* Add DRX SSR 2018-10 */ \ +{ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_PRESENT, NULL, 0, strptr:&ccparams.drx_longDrx_CycleStartOffset_present, defstrval:"prSf128", TYPE_STRING, 0}, /* Add DRX SSR 2018-10 */ \ +{ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET, NULL, 0, iptr:&ccparams.drx_longDrx_CycleStartOffset, defintval:0, TYPE_UINT, 0}, /* Add DRX SSR 2018-10 */ \ +{ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE, NULL, 0, strptr:&ccparams.drx_shortDrx_Cycle, defstrval:"sf32", TYPE_STRING, 0}, /* Add DRX SSR 2018-10 */ \ +{ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER, NULL, 0, iptr:&ccparams.drx_shortDrx_ShortCycleTimer, defintval:3, TYPE_UINT, 0}, /* Add DRX SSR 2018-10 */ \ {ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF, NULL, 0, iptr:&ccparams.bcch_modificationPeriodCoeff, defintval:2, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_UETIMERS_T300, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_t300, defintval:1000, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_UETIMERS_T301, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_t301, defintval:1000, TYPE_UINT, 0}, \ @@ -696,7 +727,7 @@ typedef struct ccparams_lte_s { {ENB_CONFIG_STRING_UETIMERS_N310, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_n310, defintval:20, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_UETIMERS_N311, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_n311, defintval:1, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_UE_TRANSMISSION_MODE, NULL, 0, iptr:&ccparams.ue_TransmissionMode, defintval:1, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_UE_MULTIPLE_MAX, NULL, 0, iptr:&ccparams.ue_multiple_max, defintval:4, TYPE_UINT, 0} \ +{ENB_CONFIG_STRING_UE_MULTIPLE_MAX, NULL, 0, iptr:&ccparams.ue_multiple_max, defintval:4, TYPE_UINT, 0} \ } @@ -761,14 +792,22 @@ typedef struct ccparams_lte_s { #define ENB_CONFIG_RACH_MAXHARQMSG3TX_IDX 57 #define ENB_CONFIG_PCCH_DEFAULT_PAGING_CYCLE_IDX 58 #define ENB_CONFIG_PCCH_NB_IDX 59 -#define ENB_CONFIG_BCCH_MODIFICATIONPERIODCOEFF_IDX 60 -#define ENB_CONFIG_UETIMERS_T300_IDX 61 -#define ENB_CONFIG_UETIMERS_T301_IDX 62 -#define ENB_CONFIG_UETIMERS_T310_IDX 63 -#define ENB_CONFIG_UETIMERS_T311_IDX 64 -#define ENB_CONFIG_UETIMERS_N310_IDX 65 -#define ENB_CONFIG_UETIMERS_N311_IDX 66 -#define ENB_CONFIG_UE_TRANSMISSION_MODE_IDX 67 +#define ENB_CONFIG_STRING_DRX_CONFIG_PRESENT_IDX 60 // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_ONDURATIONTIMER_IDX 61 // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_INACTIVITYTIMER_IDX 62 // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER_IDX 63 // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_PRESENT_IDX 64 // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_IDX 65 // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE_IDX 66 // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER_IDX 67 // Add DRX SSR 2018-10 +#define ENB_CONFIG_BCCH_MODIFICATIONPERIODCOEFF_IDX 68 // Modif DRX SSR 2018-10 +#define ENB_CONFIG_UETIMERS_T300_IDX 69 // Modif DRX SSR 2018-10 +#define ENB_CONFIG_UETIMERS_T301_IDX 70 // Modif DRX SSR 2018-10 +#define ENB_CONFIG_UETIMERS_T310_IDX 71 // Modif DRX SSR 2018-10 +#define ENB_CONFIG_UETIMERS_T311_IDX 72 // Modif DRX SSR 2018-10 +#define ENB_CONFIG_UETIMERS_N310_IDX 73 // Modif DRX SSR 2018-10 +#define ENB_CONFIG_UETIMERS_N311_IDX 74 // Modif DRX SSR 2018-10 +#define ENB_CONFIG_UE_TRANSMISSION_MODE_IDX 75 // Modif DRX SSR 2018-10 /*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* SRB1 configuration parameters section name */ diff --git a/openair2/ENB_APP/enb_paramdef_emtc.h b/openair2/ENB_APP/enb_paramdef_emtc.h index 9f76bac2fa..25ab43ccf6 100644 --- a/openair2/ENB_APP/enb_paramdef_emtc.h +++ b/openair2/ENB_APP/enb_paramdef_emtc.h @@ -61,7 +61,10 @@ #define ENB_CONFIG_STRING_PREAMBLE_TRANSMAX_CE_R13 "preamble_TransMax_ce_r13" #define ENB_CONFIG_STRING_PREAMBLE_TRANSMAX_CE_R13_VAL "preamble_TransMax_ce_r13_val" #define ENB_CONFIG_STRING_PDSCH_MAX_NUM_REPETITION_CE_MODE_A_R13 "pdsch_maxNumRepetitionCEmodeA_r13" +#define ENB_CONFIG_STRING_PDSCH_MAX_NUM_REPETITION_CE_MODE_B_R13 "pdsch_maxNumRepetitionCEmodeB_r13" #define ENB_CONFIG_STRING_PUSCH_MAX_NUM_REPETITION_CE_MODE_A_R13 "pusch_maxNumRepetitionCEmodeA_r13" +#define ENB_CONFIG_STRING_PUSCH_MAX_NUM_REPETITION_CE_MODE_B_R13 "pusch_maxNumRepetitionCEmodeB_r13" +#define ENB_CONFIG_STRING_PUSCH_HOPPING_OFFSET_V1310 "pusch_HoppingOffset_v1310" #define ENB_CONFIG_STRING_SYSTEM_INFO_VALUE_TAG_LIST "system_info_value_tag_SI" #define ENB_CONFIG_STRING_FIRST_PREAMBLE_R13 "firstPreamble_r13" #define ENB_CONFIG_STRING_LAST_PREAMBLE_R13 "lastPreamble_r13" @@ -81,6 +84,9 @@ #define ENB_CONFIG_STRING_PUCCH_INFO_VALUE "pucch_info_value" #define ENB_CONFIG_STRING_N1PUCCH_AN_INFOLIST_R13 "n1PUCCH_AN_InfoList_r13" #define ENB_CONFIG_STRING_PCCH_CONFIG_V1310 "pcch_config_v1310" +#define ENB_CONFIG_STRING_PAGING_NARROWBANDS_R13 "paging_narrowbands_r13" +#define ENB_CONFIG_STRING_MPDCCH_NUMREPETITION_PAGING_R13 "mpdcch_numrepetition_paging_r13" +#define ENB_CONFIG_STRING_NB_V1310 "nb_v1310" #define ENB_CONFIG_STRING_SIB2_FREQ_HOPPINGPARAMETERS_R13 "sib2_freq_hoppingParameters_r13" typedef struct ccparams_eMTC_s { diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 73d73c3556..00a4e44ff6 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -1009,3 +1009,358 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP, return(0); } + + +//----------------------------------------------------------------------------- +/* +* Configure local DRX timers and thresholds following the drx_configuration input +*/ +void eNB_Config_Local_DRX( + module_id_t Mod_id, + rnti_t rnti, + LTE_DRX_Config_t *const drx_Configuration +) +//----------------------------------------------------------------------------- +{ + UE_list_t *UE_list_mac = NULL; + int UE_id = -1; + UE_sched_ctrl *UE_scheduling_control = NULL; + + UE_list_mac = &(RC.mac[Mod_id]->UE_list); + + UE_id = find_UE_id(Mod_id, rnti); + + /* Check UE_id */ + if (UE_id == -1) { + LOG_E(MAC, "%s:%d:%s: ERROR, UE_id == -1\n", + __FILE__, + __LINE__, + __FUNCTION__); + return; + } + + /* Get struct to modify */ + UE_scheduling_control = &(UE_list_mac->UE_sched_ctrl[UE_id]); + + /* Check drx_Configuration */ + if (drx_Configuration == NULL) { + LOG_E(MAC, "drx_Configuration parameter is NULL, cannot configure local UE parameters\n"); + + UE_scheduling_control->cdrx_configured = FALSE; + return; + } + + /* Check if drx config present */ + if (drx_Configuration->present != LTE_DRX_Config_PR_setup) { + LOG_I(MAC, "No drx_Configuration present, don't configure local UE parameters\n"); + + UE_scheduling_control->cdrx_configured = FALSE; + return; + } + + /* Modify scheduling control structure according to DRX configuration */ + UE_scheduling_control->cdrx_configured = TRUE; + UE_scheduling_control->bypass_cdrx = TRUE; + UE_scheduling_control->in_active_time = FALSE; + + UE_scheduling_control->on_duration_timer = 0; + switch (drx_Configuration->choice.setup.onDurationTimer) { + case 0: + UE_scheduling_control->on_duration_timer_thres = 1; + break; + case 1: + UE_scheduling_control->on_duration_timer_thres = 2; + break; + case 2: + UE_scheduling_control->on_duration_timer_thres = 3; + break; + case 3: + UE_scheduling_control->on_duration_timer_thres = 4; + break; + case 4: + UE_scheduling_control->on_duration_timer_thres = 5; + break; + case 5: + UE_scheduling_control->on_duration_timer_thres = 6; + break; + case 6: + UE_scheduling_control->on_duration_timer_thres = 8; + break; + case 7: + UE_scheduling_control->on_duration_timer_thres = 10; + break; + case 8: + UE_scheduling_control->on_duration_timer_thres = 20; + break; + case 9: + UE_scheduling_control->on_duration_timer_thres = 30; + break; + case 10: + UE_scheduling_control->on_duration_timer_thres = 40; + break; + case 11: + UE_scheduling_control->on_duration_timer_thres = 50; + break; + case 12: + UE_scheduling_control->on_duration_timer_thres = 60; + break; + case 13: + UE_scheduling_control->on_duration_timer_thres = 80; + break; + case 14: + UE_scheduling_control->on_duration_timer_thres = 100; + break; + case 15: + UE_scheduling_control->on_duration_timer_thres = 200; + break; + default: + LOG_E(MAC, "Error in local DRX configuration, the on duration timer value specified is unknown\n"); + break; + } + + UE_scheduling_control->drx_inactivity_timer = 0; + switch (drx_Configuration->choice.setup.drx_InactivityTimer) { + case 0: + UE_scheduling_control->drx_inactivity_timer_thres = 1; + break; + case 1: + UE_scheduling_control->drx_inactivity_timer_thres = 2; + break; + case 2: + UE_scheduling_control->drx_inactivity_timer_thres = 3; + break; + case 3: + UE_scheduling_control->drx_inactivity_timer_thres = 4; + break; + case 4: + UE_scheduling_control->drx_inactivity_timer_thres = 5; + break; + case 5: + UE_scheduling_control->drx_inactivity_timer_thres = 6; + break; + case 6: + UE_scheduling_control->drx_inactivity_timer_thres = 8; + break; + case 7: + UE_scheduling_control->drx_inactivity_timer_thres = 10; + break; + case 8: + UE_scheduling_control->drx_inactivity_timer_thres = 20; + break; + case 9: + UE_scheduling_control->drx_inactivity_timer_thres = 30; + break; + case 10: + UE_scheduling_control->drx_inactivity_timer_thres = 40; + break; + case 11: + UE_scheduling_control->drx_inactivity_timer_thres = 50; + break; + case 12: + UE_scheduling_control->drx_inactivity_timer_thres = 60; + break; + case 13: + UE_scheduling_control->drx_inactivity_timer_thres = 80; + break; + case 14: + UE_scheduling_control->drx_inactivity_timer_thres = 100; + break; + case 15: + UE_scheduling_control->drx_inactivity_timer_thres = 200; + break; + case 16: + UE_scheduling_control->drx_inactivity_timer_thres = 300; + break; + case 17: + UE_scheduling_control->drx_inactivity_timer_thres = 500; + break; + case 18: + UE_scheduling_control->drx_inactivity_timer_thres = 750; + break; + case 19: + UE_scheduling_control->drx_inactivity_timer_thres = 1280; + break; + case 20: + UE_scheduling_control->drx_inactivity_timer_thres = 1920; + break; + case 21: + UE_scheduling_control->drx_inactivity_timer_thres = 2560; + break; + case 22: + UE_scheduling_control->drx_inactivity_timer_thres = 0; + break; + default: + LOG_E(MAC, "Error in local DRX configuration, the drx inactivity timer value specified is unknown\n"); + break; + } + + if (drx_Configuration->choice.setup.shortDRX == NULL) { + UE_scheduling_control->in_short_drx_cycle = FALSE; + UE_scheduling_control->drx_shortCycle_timer_value = 0; + UE_scheduling_control->short_drx_cycle_duration = 0; + UE_scheduling_control->drx_shortCycle_timer = 0; + UE_scheduling_control->drx_shortCycle_timer_thres = -1; + } else { + UE_scheduling_control->in_short_drx_cycle = FALSE; + UE_scheduling_control->drx_shortCycle_timer_value = (uint8_t) drx_Configuration->choice.setup.shortDRX->drxShortCycleTimer; + switch (drx_Configuration->choice.setup.shortDRX->shortDRX_Cycle) { + case 0: + UE_scheduling_control->short_drx_cycle_duration = 2; + break; + case 1: + UE_scheduling_control->short_drx_cycle_duration = 5; + break; + case 2: + UE_scheduling_control->short_drx_cycle_duration = 8; + break; + case 3: + UE_scheduling_control->short_drx_cycle_duration = 10; + break; + case 4: + UE_scheduling_control->short_drx_cycle_duration = 16; + break; + case 5: + UE_scheduling_control->short_drx_cycle_duration = 20; + break; + case 6: + UE_scheduling_control->short_drx_cycle_duration = 32; + break; + case 7: + UE_scheduling_control->short_drx_cycle_duration = 40; + break; + case 8: + UE_scheduling_control->short_drx_cycle_duration = 64; + break; + case 9: + UE_scheduling_control->short_drx_cycle_duration = 80; + break; + case 10: + UE_scheduling_control->short_drx_cycle_duration = 128; + break; + case 11: + UE_scheduling_control->short_drx_cycle_duration = 160; + break; + case 12: + UE_scheduling_control->short_drx_cycle_duration = 256; + break; + case 13: + UE_scheduling_control->short_drx_cycle_duration = 320; + break; + case 14: + UE_scheduling_control->short_drx_cycle_duration = 512; + break; + case 15: + UE_scheduling_control->short_drx_cycle_duration = 640; + break; + default: + LOG_E(MAC, "Error in local DRX configuration, the short drx timer value specified is unknown\n"); + break; + } + + UE_scheduling_control->drx_shortCycle_timer = 0; + UE_scheduling_control->drx_shortCycle_timer_thres = UE_scheduling_control->drx_shortCycle_timer_value * UE_scheduling_control->short_drx_cycle_duration; + } + + UE_scheduling_control->in_long_drx_cycle = FALSE; + UE_scheduling_control->drx_longCycle_timer = 0; + switch (drx_Configuration->choice.setup.longDRX_CycleStartOffset.present) { + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf10: + UE_scheduling_control->drx_longCycle_timer_thres = 10; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf10; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf20: + UE_scheduling_control->drx_longCycle_timer_thres = 20; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf20; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf32: + UE_scheduling_control->drx_longCycle_timer_thres = 32; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf32; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf40: + UE_scheduling_control->drx_longCycle_timer_thres = 40; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf40; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf64: + UE_scheduling_control->drx_longCycle_timer_thres = 64; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf64; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf80: + UE_scheduling_control->drx_longCycle_timer_thres = 80; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf80; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf128: + UE_scheduling_control->drx_longCycle_timer_thres = 128; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf128; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf160: + UE_scheduling_control->drx_longCycle_timer_thres = 160; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf160; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf256: + UE_scheduling_control->drx_longCycle_timer_thres = 256; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf256; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf320: + UE_scheduling_control->drx_longCycle_timer_thres = 320; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf320; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf512: + UE_scheduling_control->drx_longCycle_timer_thres = 512; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf512; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf640: + UE_scheduling_control->drx_longCycle_timer_thres = 640; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf640; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1024: + UE_scheduling_control->drx_longCycle_timer_thres = 1024; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf1024; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1280: + UE_scheduling_control->drx_longCycle_timer_thres = 1280; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf1280; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2048: + UE_scheduling_control->drx_longCycle_timer_thres = 2048; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf2048; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2560: + UE_scheduling_control->drx_longCycle_timer_thres = 2560; + UE_scheduling_control->drx_start_offset = (uint16_t) drx_Configuration->choice.setup.longDRX_CycleStartOffset.choice.sf2560; + break; + default: + LOG_E(MAC, "Invalid long_DRX value in DRX local configuration\n"); + break; + } + + memset(UE_scheduling_control->drx_retransmission_timer, 0, sizeof(UE_scheduling_control->drx_retransmission_timer)); + switch (drx_Configuration->choice.setup.drx_RetransmissionTimer) { + case 0: + memset(UE_scheduling_control->drx_retransmission_timer_thres, 1, sizeof(UE_scheduling_control->drx_retransmission_timer_thres)); + break; + case 1: + memset(UE_scheduling_control->drx_retransmission_timer_thres, 2, sizeof(UE_scheduling_control->drx_retransmission_timer_thres)); + break; + case 2: + memset(UE_scheduling_control->drx_retransmission_timer_thres, 4, sizeof(UE_scheduling_control->drx_retransmission_timer_thres)); + break; + case 3: + memset(UE_scheduling_control->drx_retransmission_timer_thres, 6, sizeof(UE_scheduling_control->drx_retransmission_timer_thres)); + break; + case 4: + memset(UE_scheduling_control->drx_retransmission_timer_thres, 8, sizeof(UE_scheduling_control->drx_retransmission_timer_thres)); + break; + case 5: + memset(UE_scheduling_control->drx_retransmission_timer_thres, 16, sizeof(UE_scheduling_control->drx_retransmission_timer_thres)); + break; + case 6: + memset(UE_scheduling_control->drx_retransmission_timer_thres, 24, sizeof(UE_scheduling_control->drx_retransmission_timer_thres)); + break; + case 7: + memset(UE_scheduling_control->drx_retransmission_timer_thres, 33, sizeof(UE_scheduling_control->drx_retransmission_timer_thres)); + break; + default: + LOG_E(MAC, "Error in local DRX configuration, the drx retransmission timer value specified is unknown\n"); + break; + } +} \ No newline at end of file diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index ab2856c40c..0f8945ab94 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -55,7 +55,7 @@ #include "eNB_scheduler_fairRR.h" #if defined(ENABLE_ITTI) -#include "intertask_interface.h" + #include "intertask_interface.h" #endif #include "assertions.h" @@ -68,289 +68,369 @@ extern RAN_CONTEXT_t RC; uint16_t pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 }; - -void -schedule_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) +//----------------------------------------------------------------------------- +/* + * Schedule periodic SRS + */ +void schedule_SRS(module_id_t module_idP, + frame_t frameP, + sub_frame_t subframeP) +//----------------------------------------------------------------------------- { - - - eNB_MAC_INST *eNB = RC.mac[module_idP]; - UE_list_t *UE_list = &eNB->UE_list; - nfapi_ul_config_request_body_t *ul_req; - int CC_id, UE_id; - COMMON_channels_t *cc = RC.mac[module_idP]->common_channels; - LTE_SoundingRS_UL_ConfigCommon_t *soundingRS_UL_ConfigCommon; - struct LTE_SoundingRS_UL_ConfigDedicated *soundingRS_UL_ConfigDedicated; - uint8_t TSFC; - uint16_t deltaTSFC; // bitmap - uint8_t srs_SubframeConfig; - + int CC_id = 0; + int UE_id = -1; + uint8_t TSFC = 0; + uint8_t srs_SubframeConfig = 0; + uint16_t srsPeriodicity = 0; + uint16_t srsOffset = 0; + uint16_t deltaTSFC = 0; // bitmap // table for TSFC (Period) and deltaSFC (offset) - const uint16_t deltaTSFCTabType1[15][2] = { {1, 1}, {1, 2}, {2, 2}, {1, 5}, {2, 5}, {4, 5}, {8, 5}, {3, 5}, {12, 5}, {1, 10}, {2, 10}, {4, 10}, {8, 10}, {351, 10}, {383, 10} }; // Table 5.5.3.3-2 3GPP 36.211 FDD - const uint16_t deltaTSFCTabType2[14][2] = { {2, 5}, {6, 5}, {10, 5}, {18, 5}, {14, 5}, {22, 5}, {26, 5}, {30, 5}, {70, 10}, {74, 10}, {194, 10}, {326, 10}, {586, 10}, {210, 10} }; // Table 5.5.3.3-2 3GPP 36.211 TDD - - uint16_t srsPeriodicity, srsOffset; - + const uint16_t deltaTSFCTabType1[15][2] = { {1, 1}, {1, 2}, {2, 2}, {1, 5}, {2, 5}, {4, 5}, {8, 5}, {3, 5}, {12, 5}, {1, 10}, {2, 10}, {4, 10}, {8, 10}, {351, 10}, {383, 10} }; // Table 5.5.3.3-2 3GPP 36.211 FDD + const uint16_t deltaTSFCTabType2[14][2] = { {2, 5}, {6, 5}, {10, 5}, {18, 5}, {14, 5}, {22, 5}, {26, 5}, {30, 5}, {70, 10}, {74, 10}, {194, 10}, {326, 10}, {586, 10}, {210, 10} }; // Table 5.5.3.3-2 3GPP 36.211 TDD + eNB_MAC_INST *eNB = RC.mac[module_idP]; + UE_list_t *UE_list = &(eNB->UE_list); + nfapi_ul_config_request_body_t *ul_req = NULL; + UE_sched_ctrl *UE_scheduling_control = NULL; + COMMON_channels_t *cc = eNB->common_channels; + LTE_SoundingRS_UL_ConfigCommon_t *soundingRS_UL_ConfigCommon = NULL; + struct LTE_SoundingRS_UL_ConfigDedicated *soundingRS_UL_ConfigDedicated = NULL; + for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { - soundingRS_UL_ConfigCommon = &cc[CC_id].radioResourceConfigCommon->soundingRS_UL_ConfigCommon; - // check if SRS is enabled in this frame/subframe + soundingRS_UL_ConfigCommon = &(cc[CC_id].radioResourceConfigCommon->soundingRS_UL_ConfigCommon); + + /* Check if SRS is enabled in this frame/subframe */ if (soundingRS_UL_ConfigCommon) { srs_SubframeConfig = soundingRS_UL_ConfigCommon->choice.setup.srs_SubframeConfig; - if (cc[CC_id].tdd_Config == NULL) { // FDD - deltaTSFC = deltaTSFCTabType1[srs_SubframeConfig][0]; - TSFC = deltaTSFCTabType1[srs_SubframeConfig][1]; - } else { // TDD - deltaTSFC = deltaTSFCTabType2[srs_SubframeConfig][0]; - TSFC = deltaTSFCTabType2[srs_SubframeConfig][1]; + + if (cc[CC_id].tdd_Config == NULL) { // FDD + deltaTSFC = deltaTSFCTabType1[srs_SubframeConfig][0]; + TSFC = deltaTSFCTabType1[srs_SubframeConfig][1]; + } else { // TDD + deltaTSFC = deltaTSFCTabType2[srs_SubframeConfig][0]; + TSFC = deltaTSFCTabType2[srs_SubframeConfig][1]; } - // Sounding reference signal subframes are the subframes satisfying ns/2 mod TSFC (- deltaTSFC + + /* Sounding reference signal subframes are the subframes satisfying ns/2 mod TSFC (- deltaTSFC) */ uint16_t tmp = (subframeP % TSFC); - + if ((1 << tmp) & deltaTSFC) { - // This is an SRS subframe, loop over UEs - for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { - if (!RC.mac[module_idP]->UE_list.active[UE_id]) continue; - ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; - // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet - if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue; - - AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, - "physicalConfigDedicated is null for UE %d\n", - UE_id); - - if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated) != NULL) { - if (soundingRS_UL_ConfigDedicated->present == LTE_SoundingRS_UL_ConfigDedicated_PR_setup) { - get_srs_pos(&cc[CC_id], - soundingRS_UL_ConfigDedicated->choice. - setup.srs_ConfigIndex, - &srsPeriodicity, &srsOffset); - if (((10 * frameP + subframeP) % srsPeriodicity) == srsOffset) { - // Program SRS - ul_req->srs_present = 1; - nfapi_ul_config_request_pdu_t * ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; - memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t)); - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_SRS_PDU_TYPE; - ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_srs_pdu)); - ul_config_pdu->srs_pdu.srs_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG; - ul_config_pdu->srs_pdu.srs_pdu_rel8.size = (uint8_t)sizeof(nfapi_ul_config_srs_pdu); - ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; - ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth; - ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position = soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition; - ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;; - ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb = soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb; - ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs = soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex; - ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift = soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; // ul_config_pdu->srs_pdu.srs_pdu_rel10.antenna_port = ;// - // ul_config_pdu->srs_pdu.srs_pdu_rel13.number_of_combs = ;// - RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP; - RC.mac[module_idP]->UL_req[CC_id].header.message_id = NFAPI_UL_CONFIG_REQUEST; - ul_req->number_of_pdus++; - } // if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset) - } // if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) - } // if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL) - } // for (UE_id ... - } // if((1<active[UE_id]) { + continue; + } + + /* Drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet */ + if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) { + continue; + } + + AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, + "physicalConfigDedicated is null for UE %d\n", + UE_id); + + /* CDRX condition on Active Time and SRS type-0 report (36.321 5.7) */ + UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]); + + /* Test if Active Time not running since 6+ subframes */ + if (UE_scheduling_control->cdrx_configured == TRUE && UE_scheduling_control->in_active_time == FALSE) { + /* + * TODO: 6+ subframes condition not checked here + */ + continue; + } + + ul_req = &(eNB->UL_req[CC_id].ul_config_request_body); + + if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated) != NULL) { + if (soundingRS_UL_ConfigDedicated->present == LTE_SoundingRS_UL_ConfigDedicated_PR_setup) { + get_srs_pos(&cc[CC_id], + soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex, + &srsPeriodicity, + &srsOffset); + + if (((10 * frameP + subframeP) % srsPeriodicity) == srsOffset) { + // Program SRS + ul_req->srs_present = 1; + nfapi_ul_config_request_pdu_t *ul_config_pdu = &(ul_req->ul_config_pdu_list[ul_req->number_of_pdus]); + memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t)); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_SRS_PDU_TYPE; + ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_srs_pdu)); + ul_config_pdu->srs_pdu.srs_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG; + ul_config_pdu->srs_pdu.srs_pdu_rel8.size = (uint8_t)sizeof(nfapi_ul_config_srs_pdu); + ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth; + ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position = soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition; + ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;; + ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb = soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb; + ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs = soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex; + ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift = soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; + + eNB->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP; + eNB->UL_req[CC_id].header.message_id = NFAPI_UL_CONFIG_REQUEST; + ul_req->number_of_pdus++; + } // if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset) + } // if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) + } // if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL) + } // end for loop on UE_id + } // if((1<UE_list; - COMMON_channels_t *cc; - nfapi_ul_config_request_body_t *ul_req; - int CC_id, UE_id; - struct LTE_CQI_ReportPeriodic *cqi_ReportPeriodic; - uint16_t Npd, N_OFFSET_CQI; - int H; + COMMON_channels_t *cc = NULL; + nfapi_ul_config_request_body_t *ul_req = NULL; + UE_sched_ctrl *UE_scheduling_control = NULL; for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { - cc = &eNB->common_channels[CC_id]; + for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { - if (!UE_list->active[UE_id]) continue; + if (UE_list->active[UE_id] == FALSE) { + continue; + } - ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; + /* Drop the allocation if the UE hasn't sent RRCConnectionSetupComplete yet */ + if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) { + continue; + } - // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet - if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue; + AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, + "physicalConfigDedicated is null for UE %d\n", + UE_id); + /* + * CDRX condition on Active Time and CSI report on PUCCH (36.321 5.7). + * Here we consider classic periodic reports on PUCCH without PUSCH simultaneous transmission condition. + * TODO: add the handling or test on simultaneous PUCCH/PUSCH transmission + */ + UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]); - AssertFatal(UE_list-> - UE_template[CC_id][UE_id].physicalConfigDedicated - != NULL, - "physicalConfigDedicated is null for UE %d\n", - UE_id); + if (UE_scheduling_control->cdrx_configured == TRUE) { + /* Test if CQI masking activated */ + if (UE_scheduling_control->cqi_mask_boolean == TRUE) { + // CQI masking => test if onDurationTime not running since 6+ subframe + if (UE_scheduling_control->on_duration_timer == 0) { + /* + * TODO: 6+ subframes condition not checked here + */ + continue; + } + } else { // No CQI masking => test if Active Time not running since 6+ subframe + if (UE_scheduling_control->in_active_time == FALSE) { + /* + * TODO: 6+ subframes condition not checked here + */ + continue; + } + } + } - if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig) { - if ((cqi_ReportPeriodic = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) != NULL - && (cqi_ReportPeriodic->present != LTE_CQI_ReportPeriodic_PR_release)) { - //Rel8 Periodic CQI/PMI/RI reporting + ul_req = &(eNB->UL_req[CC_id].ul_config_request_body); - get_csi_params(cc, cqi_ReportPeriodic, &Npd, - &N_OFFSET_CQI, &H); + if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig != NULL) { + cqi_ReportPeriodic = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic; - if ((((frameP * 10) + subframeP) % Npd) == N_OFFSET_CQI) { // CQI opportunity - UE_list->UE_sched_ctrl[UE_id].feedback_cnt[CC_id] = (((frameP * 10) + subframeP) / Npd) % H; - // Program CQI - nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; - memset((void *) ul_config_pdu, 0, - sizeof(nfapi_ul_config_request_pdu_t)); - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE; - ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu)); - ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; - ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; - ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG; - ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex; - ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = get_rel8_dl_cqi_pmi_size(&UE_list->UE_sched_ctrl[UE_id], CC_id, cc, - get_tmode(module_idP, CC_id, UE_id), - cqi_ReportPeriodic); - ul_req->number_of_pdus++; - ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; + if (cqi_ReportPeriodic != NULL) { + /* Rel8 Periodic CSI (CQI/PMI/RI) reporting */ + if (cqi_ReportPeriodic->present != LTE_CQI_ReportPeriodic_PR_release) { + get_csi_params(cc, cqi_ReportPeriodic, &Npd, &N_OFFSET_CQI, &H); + + if ((((frameP * 10) + subframeP) % Npd) == N_OFFSET_CQI) { // CQI periodic opportunity + UE_scheduling_control->feedback_cnt[CC_id] = (((frameP * 10) + subframeP) / Npd) % H; + + // Program CQI + nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t)); + + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE; + ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu)); + ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; + ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = get_rel8_dl_cqi_pmi_size(&UE_list->UE_sched_ctrl[UE_id], CC_id, cc, get_tmode(module_idP, CC_id, UE_id), cqi_ReportPeriodic); + ul_req->number_of_pdus++; + ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) - // PUT rel10-13 UCI options here + // PUT rel10-13 UCI options here #endif - } else - if ((cqi_ReportPeriodic->choice.setup.ri_ConfigIndex) - && ((((frameP * 10) + subframeP) % ((H * Npd) << (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex / 161))) == N_OFFSET_CQI + (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex % 161))) { // RI opportunity - // Program RI - nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; - memset((void *) ul_config_pdu, 0, - sizeof(nfapi_ul_config_request_pdu_t)); - ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE; - ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu)); - ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; - ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; - ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG; - ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex; - ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = (cc->p_eNB == 2) ? 1 : 2; - RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP; - ul_req->number_of_pdus++; - ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; - } - } // if ((cqi_ReportPeriodic = cqi_ReportConfig->cqi_ReportPeriodic)!=NULL) { - } // if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig) - } // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { - } // for (CC_id=0; CC_idchoice.setup.ri_ConfigIndex != NULL) { + if ((((frameP * 10) + subframeP) % ((H * Npd) << (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex / 161))) == + N_OFFSET_CQI + (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex % 161)) { // RI opportunity + + // Program RI + nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t)); + + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE; + ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu)); + ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; + ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = (cc->p_eNB == 2) ? 1 : 2; + RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP; + ul_req->number_of_pdus++; + ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; + } + } + } // if CSI Periodic is not release state + } // if (cqi_ReportPeriodic != NULL) + } // if cqi_ReportConfig != NULL + } // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { + } // for (CC_id=0; CC_idUE_list; - nfapi_ul_config_request_t *ul_req; - nfapi_ul_config_request_body_t *ul_req_body; - int CC_id; - int UE_id; - LTE_SchedulingRequestConfig_t *SRconfig; - int skip_ue; - int is_harq; + int skip_ue = 0; + int is_harq = 0; + int pdu_list_index = 0; + eNB_MAC_INST *eNB = RC.mac[module_idP]; + UE_list_t *UE_list = &eNB->UE_list; + nfapi_ul_config_request_t *ul_req = NULL; + nfapi_ul_config_request_body_t *ul_req_body = NULL; + LTE_SchedulingRequestConfig_t *SRconfig = NULL; nfapi_ul_config_sr_information sr; - int i; - for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { - RC.mac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP; + for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + eNB->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP; - for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { - if (!RC.mac[module_idP]->UE_list.active[UE_id]) continue; + for (int UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { + if (!UE_list->active[UE_id]) { + continue; + } - ul_req = &RC.mac[module_idP]->UL_req[CC_id]; - ul_req_body = &ul_req->ul_config_request_body; - - // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet - //if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue; - - if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated== NULL) continue; + if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated == NULL) continue; if ((SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig) != NULL) { - if (SRconfig->present == LTE_SchedulingRequestConfig_PR_setup) { - if (SRconfig->choice.setup.sr_ConfigIndex <= 4) { // 5 ms SR period - if ((subframeP % 5) != SRconfig->choice.setup.sr_ConfigIndex) continue; - } else if (SRconfig->choice.setup.sr_ConfigIndex <= 14) { // 10 ms SR period - if (subframeP != (SRconfig->choice.setup.sr_ConfigIndex - 5)) continue; - } else if (SRconfig->choice.setup.sr_ConfigIndex <= 34) { // 20 ms SR period - if ((10 * (frameP & 1) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 15)) continue; - } else if (SRconfig->choice.setup.sr_ConfigIndex <= 74) { // 40 ms SR period - if ((10 * (frameP & 3) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 35)) continue; - } else if (SRconfig->choice.setup.sr_ConfigIndex <= 154) { // 80 ms SR period - if ((10 * (frameP & 7) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 75)) continue; - } - } // SRconfig->present == SchedulingRequestConfig_PR_setup) - } // SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL) - - // if we get here there is some PUCCH1 reception to schedule for SR + if (SRconfig->present == LTE_SchedulingRequestConfig_PR_setup) { + if (SRconfig->choice.setup.sr_ConfigIndex <= 4) { // 5 ms SR period + if ((subframeP % 5) != SRconfig->choice.setup.sr_ConfigIndex) continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 14) { // 10 ms SR period + if (subframeP != (SRconfig->choice.setup.sr_ConfigIndex - 5)) continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 34) { // 20 ms SR period + if ((10 * (frameP & 1) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 15)) continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 74) { // 40 ms SR period + if ((10 * (frameP & 3) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 35)) continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 154) { // 80 ms SR period + if ((10 * (frameP & 7) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 75)) continue; + } + } // SRconfig->present == SchedulingRequestConfig_PR_setup) + } // SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL) + /* If we get here there is some PUCCH1 reception to schedule for SR */ + ul_req = &(eNB->UL_req[CC_id]); + ul_req_body = &(ul_req->ul_config_request_body); skip_ue = 0; is_harq = 0; - // check that there is no existing UL grant for ULSCH which overrides the SR - for (i = 0; i < ul_req_body->number_of_pdus; i++) { - if (((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) || - (ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) || - (ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) || - (ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE)) && - (ul_req_body->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) { - skip_ue = 1; - break; - } - /* if there is already an HARQ pdu, convert to SR_HARQ */ - else if ((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) && - (ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) { - is_harq = 1; - break; - } + pdu_list_index = 0; + + /* Check that there is no existing UL grant for ULSCH which overrides the SR */ + for (int i = 0; i < ul_req_body->number_of_pdus; i++) { + if (((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) || + (ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) || + (ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) || + (ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE)) && + (ul_req_body->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) { + skip_ue = 1; + pdu_list_index = i; + break; + } + /* If there is already an HARQ pdu, convert to SR_HARQ */ + else if ((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) && + (ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) { + is_harq = 1; + pdu_list_index = i; + break; + } } - // drop the allocation because ULSCH with handle it with BSR + /* Drop the allocation because ULSCH will handle it with BSR */ if (skip_ue == 1) continue; - LOG_D(MAC,"Frame %d, Subframe %d : Scheduling SR for UE %d/%x is_harq:%d\n",frameP,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].rnti, is_harq); + LOG_D(MAC, "Frame %d, Subframe %d : Scheduling SR for UE %d/%x is_harq:%d \n", + frameP, + subframeP, + UE_id, + UE_list->UE_template[CC_id][UE_id].rnti, + is_harq); - // check Rel10 or Rel8 SR + /* Check Rel10 or Rel8 SR */ #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) - if ((UE_list-> UE_template[CC_id][UE_id].physicalConfigDedicated->ext2) - && (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020) - && (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)) { - sr.sr_information_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG; - sr.sr_information_rel10.number_of_pucch_resources = 1; - sr.sr_information_rel10.pucch_index_p1 = *UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10; - LOG_D(MAC,"REL10 PUCCH INDEX P1:%d\n", sr.sr_information_rel10.pucch_index_p1); + if ((UE_list-> UE_template[CC_id][UE_id].physicalConfigDedicated->ext2) && + (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020) && + (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)) { + sr.sr_information_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG; + sr.sr_information_rel10.number_of_pucch_resources = 1; + sr.sr_information_rel10.pucch_index_p1 = *UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10; + + LOG_D(MAC, "REL10 PUCCH INDEX P1:%d \n", + sr.sr_information_rel10.pucch_index_p1); + } else #endif - { - sr.sr_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG; - sr.sr_information_rel8.pucch_index = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex; - LOG_D(MAC,"REL8 PUCCH INDEX:%d\n", sr.sr_information_rel8.pucch_index); - } + { + sr.sr_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG; + sr.sr_information_rel8.pucch_index = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex; - /* if there is already an HARQ pdu, convert to SR_HARQ */ + LOG_D(MAC, "REL8 PUCCH INDEX:%d\n", + sr.sr_information_rel8.pucch_index); + } + + /* If there is already an HARQ pdu, convert to SR_HARQ */ if (is_harq) { - nfapi_ul_config_harq_information h = ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.harq_information; - ul_req_body->ul_config_pdu_list[i].pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE; - ul_req_body->ul_config_pdu_list[i].uci_sr_harq_pdu.sr_information = sr; - ul_req_body->ul_config_pdu_list[i].uci_sr_harq_pdu.harq_information = h; + nfapi_ul_config_harq_information harq = ul_req_body->ul_config_pdu_list[pdu_list_index].uci_harq_pdu.harq_information; + ul_req_body->ul_config_pdu_list[pdu_list_index].pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE; + ul_req_body->ul_config_pdu_list[pdu_list_index].uci_sr_harq_pdu.sr_information = sr; + ul_req_body->ul_config_pdu_list[pdu_list_index].uci_sr_harq_pdu.harq_information = harq; } else { - ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE; - ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; - ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; - ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel11.tl.tag = 0; - ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel13.tl.tag = 0; - ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.sr_information = sr; - ul_req_body->number_of_pdus++; - } /* if (is_harq) */ - ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; - } // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) - } // for (CC_id=0; CC_idul_config_pdu_list[ul_req_body->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE; + ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; + ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel11.tl.tag = 0; + ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel13.tl.tag = 0; + ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.sr_information = sr; + ul_req_body->number_of_pdus++; + } // if (is_harq) + + ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; + + } // for (int UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) + } // for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) } extern uint8_t nfapi_mode; void check_ul_failure(module_id_t module_idP, int CC_id, int UE_id, - frame_t frameP, sub_frame_t subframeP) -{ + frame_t frameP, sub_frame_t subframeP) { UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; nfapi_dl_config_request_t *DL_req = &RC.mac[module_idP]->DL_req[0]; uint16_t rnti = UE_RNTI(module_idP, UE_id); @@ -362,9 +442,9 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id, if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 1) LOG_I(MAC, "UE %d rnti %x: UL Failure timer %d \n", UE_id, rnti, UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); + if (UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent == 0) { UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 1; - // add a format 1A dci for this UE to request an RA procedure (only one UE per subframe) nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req[CC_id].dl_config_request_body.dl_config_pdu_list[DL_req[CC_id].dl_config_request_body.number_pdu]; memset((void *) dl_config_pdu, 0,sizeof(nfapi_dl_config_request_pdu_t)); @@ -373,34 +453,35 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP, CC_id), - UE_list->UE_sched_ctrl[UE_id]. - dl_cqi[CC_id], format1A); + UE_list->UE_sched_ctrl[UE_id]. + dl_cqi[CC_id], format1A); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power - + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power AssertFatal((cc[CC_id].mib->message.dl_Bandwidth >= 0) && (cc[CC_id].mib->message.dl_Bandwidth < 6), - "illegal dl_Bandwidth %d\n", - (int) cc[CC_id].mib->message.dl_Bandwidth); + "illegal dl_Bandwidth %d\n", + (int) cc[CC_id].mib->message.dl_Bandwidth); dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = pdcch_order_table[cc[CC_id].mib->message.dl_Bandwidth]; DL_req[CC_id].dl_config_request_body.number_dci++; DL_req[CC_id].dl_config_request_body.number_pdu++; DL_req[CC_id].dl_config_request_body.tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; LOG_D(MAC, - "UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d), resource_block_coding %d \n", - UE_id, rnti, - UE_list->UE_sched_ctrl[UE_id].ul_failure_timer, - dl_config_pdu->dci_dl_pdu. - dci_dl_pdu_rel8.resource_block_coding); - } else { // ra_pdcch_sent==1 + "UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d), resource_block_coding %d \n", + UE_id, rnti, + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer, + dl_config_pdu->dci_dl_pdu. + dci_dl_pdu_rel8.resource_block_coding); + } else { // ra_pdcch_sent==1 LOG_D(MAC, - "UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n", - UE_id, rnti, - UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); - if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer % 80) == 0) UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 0; // resend every 8 frames + "UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n", + UE_id, rnti, + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); + + if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer % 80) == 0) UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 0; // resend every 8 frames } UE_list->UE_sched_ctrl[UE_id].ul_failure_timer++; + // check threshold if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer > 4000) { // note: probably ul_failure_timer should be less than UE radio link failure time(see T310/N310/N311) @@ -414,30 +495,31 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id, itti_send_msg_to_task(TASK_DU_F1, module_idP, m); } else { // inform RRC of failure and clear timer - LOG_I(MAC, - "UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n", - UE_id, rnti); - mac_eNB_rrc_ul_failure(module_idP, CC_id, frameP, subframeP,rnti); + LOG_I(MAC, "UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n", + UE_id, + rnti); + mac_eNB_rrc_ul_failure(module_idP, + CC_id, + frameP, + subframeP, + rnti); } UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0; UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 1; } - } // ul_failure_timer>0 + } // ul_failure_timer>0 } void -clear_nfapi_information(eNB_MAC_INST * eNB, int CC_idP, - frame_t frameP, sub_frame_t subframeP) -{ +clear_nfapi_information(eNB_MAC_INST *eNB, int CC_idP, + frame_t frameP, sub_frame_t subframeP) { nfapi_dl_config_request_t *DL_req = &eNB->DL_req[0]; nfapi_ul_config_request_t *UL_req = &eNB->UL_req[0]; nfapi_hi_dci0_request_t *HI_DCI0_req = &eNB->HI_DCI0_req[CC_idP][subframeP]; nfapi_tx_request_t *TX_req = &eNB->TX_req[0]; - eNB->pdu_index[CC_idP] = 0; if (nfapi_mode==0 || nfapi_mode == 1) { // monolithic or PNF - DL_req[CC_idP].dl_config_request_body.number_pdcch_ofdm_symbols = 1; DL_req[CC_idP].dl_config_request_body.number_dci = 0; DL_req[CC_idP].dl_config_request_body.number_pdu = 0; @@ -447,186 +529,386 @@ clear_nfapi_information(eNB_MAC_INST * eNB, int CC_idP, HI_DCI0_req->hi_dci0_request_body.sfnsf = subframeP + (frameP<<4); HI_DCI0_req->hi_dci0_request_body.number_of_dci = 0; - - UL_req[CC_idP].ul_config_request_body.number_of_pdus = 0; UL_req[CC_idP].ul_config_request_body.rach_prach_frequency_resources = 0; // ignored, handled by PHY for now UL_req[CC_idP].ul_config_request_body.srs_present = 0; // ignored, handled by PHY for now - TX_req[CC_idP].tx_request_body.number_of_pdus = 0; - } } void -copy_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) -{ +copy_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) { int CC_id; eNB_MAC_INST *mac = RC.mac[module_idP]; for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { - nfapi_ul_config_request_t *ul_req_tmp = &mac->UL_req_tmp[CC_id][subframeP]; nfapi_ul_config_request_t *ul_req = &mac->UL_req[CC_id]; nfapi_ul_config_request_pdu_t *ul_req_pdu = ul_req->ul_config_request_body.ul_config_pdu_list; - *ul_req = *ul_req_tmp; - // Restore the pointer ul_req->ul_config_request_body.ul_config_pdu_list = ul_req_pdu; ul_req->sfn_sf = (frameP<<4) + subframeP; ul_req_tmp->ul_config_request_body.number_of_pdus = 0; - if (ul_req->ul_config_request_body.number_of_pdus>0) - { - LOG_D(PHY, "%s() active NOW (frameP:%d subframeP:%d) pdus:%d\n", __FUNCTION__, frameP, subframeP, ul_req->ul_config_request_body.number_of_pdus); - } + if (ul_req->ul_config_request_body.number_of_pdus>0) { + LOG_D(PHY, "%s() active NOW (frameP:%d subframeP:%d) pdus:%d\n", __FUNCTION__, frameP, subframeP, ul_req->ul_config_request_body.number_of_pdus); + } - memcpy((void*)ul_req->ul_config_request_body.ul_config_pdu_list, - (void*)ul_req_tmp->ul_config_request_body.ul_config_pdu_list, - ul_req->ul_config_request_body.number_of_pdus*sizeof(nfapi_ul_config_request_pdu_t)); + memcpy((void *)ul_req->ul_config_request_body.ul_config_pdu_list, + (void *)ul_req_tmp->ul_config_request_body.ul_config_pdu_list, + ul_req->ul_config_request_body.number_of_pdus*sizeof(nfapi_ul_config_request_pdu_t)); } } void -eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, - sub_frame_t subframeP) +eNB_dlsch_ulsch_scheduler(module_id_t module_idP, + frame_t frameP, + sub_frame_t subframeP) { - int mbsfn_status[MAX_NUM_CCs]; protocol_ctxt_t ctxt; + rnti_t rnti = 0; + int CC_id = 0; + int UE_id = -1; + eNB_MAC_INST *eNB = RC.mac[module_idP]; + UE_list_t *UE_list = &(eNB->UE_list); + COMMON_channels_t *cc = eNB->common_channels; + UE_sched_ctrl *UE_scheduling_control = NULL; - int CC_id, i = -1; - UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; - rnti_t rnti; + start_meas(&(eNB->eNB_scheduler)); - COMMON_channels_t *cc = RC.mac[module_idP]->common_channels; + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, VCD_FUNCTION_IN); - start_meas(&RC.mac[module_idP]->eNB_scheduler); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME - (VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, - VCD_FUNCTION_IN); - - RC.mac[module_idP]->frame = frameP; - RC.mac[module_idP]->subframe = subframeP; + eNB->frame = frameP; + eNB->subframe = subframeP; for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { mbsfn_status[CC_id] = 0; - // clear vrb_maps + /* Clear vrb_maps */ memset(cc[CC_id].vrb_map, 0, 100); memset(cc[CC_id].vrb_map_UL, 0, 100); - #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) - cc[CC_id].mcch_active = 0; + cc[CC_id].mcch_active = 0; #endif clear_nfapi_information(RC.mac[module_idP], CC_id, frameP, subframeP); } - // refresh UE list based on UEs dropped by PHY in previous subframe - for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { - if (UE_list->active[i]) { - rnti = UE_RNTI(module_idP, i); - CC_id = UE_PCCID(module_idP, i); - - if (((frameP&127) == 0) && (subframeP == 0)) { - LOG_I(MAC, - "UE rnti %x : %s, PHR %d dB DL CQI %d PUSCH SNR %d PUCCH SNR %d\n", - rnti, - UE_list->UE_sched_ctrl[i].ul_out_of_sync == - 0 ? "in synch" : "out of sync", - UE_list->UE_template[CC_id][i].phr_info, - UE_list->UE_sched_ctrl[i].dl_cqi[CC_id], - (5*UE_list->UE_sched_ctrl[i].pusch_snr[CC_id] - 640) / 10, - (5*UE_list->UE_sched_ctrl[i].pucch1_snr[CC_id] - 640) / 10); + /* Refresh UE list based on UEs dropped by PHY in previous subframe */ + for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { + if (UE_list->active[UE_id]) { + rnti = UE_RNTI(module_idP, UE_id); + CC_id = UE_PCCID(module_idP, UE_id); + + UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]); + + if (((frameP & 127) == 0) && (subframeP == 0)) { + LOG_I(MAC,"UE rnti %x : %s, PHR %d dB DL CQI %d PUSCH SNR %d PUCCH SNR %d\n", + rnti, + UE_scheduling_control->ul_out_of_sync == 0 ? "in synch" : "out of sync", + UE_list->UE_template[CC_id][UE_id].phr_info, + UE_scheduling_control->dl_cqi[CC_id], + (5 * UE_scheduling_control->pusch_snr[CC_id] - 640) / 10, + (5 * UE_scheduling_control->pucch1_snr[CC_id] - 640) / 10); } + + RC.eNB[module_idP][CC_id]->pusch_stats_bsr[UE_id][(frameP * 10) + subframeP] = -63; + + if (UE_id == UE_list->head) { + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR, RC.eNB[module_idP][CC_id]->pusch_stats_bsr[UE_id][(frameP * 10) + subframeP]); + } + + /* Set and increment CDRX related timers */ + if (UE_scheduling_control->cdrx_configured == TRUE) { + boolean_t harq_active_time_condition = FALSE; + UE_TEMPLATE *UE_template = NULL; + + unsigned long active_time_condition = 0; // variable used only for tracing purpose + + /* (UL and DL) HARQ RTT timers and DRX retransmission timers */ + for (int harq_process_id = 0; harq_process_id < 8; harq_process_id++) { + /* DL asynchronous HARQ process */ + if (UE_scheduling_control->drx_retransmission_timer[harq_process_id] > 0) { + UE_scheduling_control->drx_retransmission_timer[harq_process_id]++; + + if (UE_scheduling_control->drx_retransmission_timer[harq_process_id] > UE_scheduling_control->drx_retransmission_timer_thres[harq_process_id]) { + UE_scheduling_control->drx_retransmission_timer[harq_process_id] = 0; + } + } + + if (UE_scheduling_control->harq_rtt_timer[CC_id][harq_process_id] > 0) { + UE_scheduling_control->harq_rtt_timer[CC_id][harq_process_id]++; + + if (UE_scheduling_control->harq_rtt_timer[CC_id][harq_process_id] > 8) { + /* Note: here drx_retransmission_timer is restarted instead of started in the specification */ + UE_scheduling_control->drx_retransmission_timer[harq_process_id] = 1; // started when HARQ RTT timer expires + UE_scheduling_control->harq_rtt_timer[CC_id][harq_process_id] = 0; + } + } + + /* UL synchronous HARQ process */ + if (UE_scheduling_control->ul_harq_rtt_timer[CC_id][harq_process_id] > 0) { + UE_scheduling_control->ul_harq_rtt_timer[CC_id][harq_process_id]++; + + if (UE_scheduling_control->ul_harq_rtt_timer[CC_id][harq_process_id] > 4) { + // drx_ULRetransmissionTimer should be started here + UE_scheduling_control->ul_harq_rtt_timer[CC_id][harq_process_id] = 0; + } + } + + if (UE_scheduling_control->ul_synchronous_harq_timer[CC_id][harq_process_id] > 0) { + UE_scheduling_control->ul_synchronous_harq_timer[CC_id][harq_process_id]++; + + if (UE_scheduling_control->ul_synchronous_harq_timer[CC_id][harq_process_id] > 5) { + harq_active_time_condition = TRUE; + UE_scheduling_control->ul_synchronous_harq_timer[CC_id][harq_process_id] = 0; + active_time_condition = 5; // for tracing purpose + } + } + } + + /* On duration timer */ + if (UE_scheduling_control->on_duration_timer > 0) { + UE_scheduling_control->on_duration_timer++; + + if (UE_scheduling_control->on_duration_timer > UE_scheduling_control->on_duration_timer_thres) { + UE_scheduling_control->on_duration_timer = 0; + } + } + + /* DRX inactivity timer */ + if (UE_scheduling_control->drx_inactivity_timer > 0) { + UE_scheduling_control->drx_inactivity_timer++; + + if (UE_scheduling_control->drx_inactivity_timer > (UE_scheduling_control->drx_inactivity_timer_thres + 1)) { + UE_scheduling_control->drx_inactivity_timer = 0; + + /* When timer expires switch into short or long DRX cycle */ + if (UE_scheduling_control->drx_shortCycle_timer_thres > 0) { + UE_scheduling_control->in_short_drx_cycle = TRUE; + UE_scheduling_control->drx_shortCycle_timer = 0; + UE_scheduling_control->in_long_drx_cycle = FALSE; + } else { + UE_scheduling_control->in_long_drx_cycle = TRUE; + } + } + } + + /* Short DRX Cycle */ + if (UE_scheduling_control->in_short_drx_cycle == TRUE) { + UE_scheduling_control->drx_shortCycle_timer++; + + /* When the Short DRX cycles are over */ + if (UE_scheduling_control->drx_shortCycle_timer > UE_scheduling_control->drx_shortCycle_timer_thres) { + UE_scheduling_control->drx_shortCycle_timer = 0; + UE_scheduling_control->in_short_drx_cycle = FALSE; + UE_scheduling_control->in_long_drx_cycle = TRUE; + UE_scheduling_control->drx_longCycle_timer = 0; + } + } else { + UE_scheduling_control->drx_shortCycle_timer = 0; + } + + /* Long DRX Cycle */ + if (UE_scheduling_control->in_long_drx_cycle == TRUE) { + UE_scheduling_control->drx_longCycle_timer++; + + if (UE_scheduling_control->drx_longCycle_timer > UE_scheduling_control->drx_longCycle_timer_thres) { + UE_scheduling_control->drx_longCycle_timer = 1; + } + } else { + UE_scheduling_control->drx_longCycle_timer = 0; + } + + /* Check for error case */ + if ((UE_scheduling_control->in_short_drx_cycle == TRUE) && (UE_scheduling_control->in_long_drx_cycle == TRUE)) { + LOG_E(MAC, "Error in C-DRX: UE id %d is in both short and long DRX cycle. Should not happen. Back it to long cycle only\n", UE_id); + UE_scheduling_control->in_short_drx_cycle = FALSE; + } + + /* Condition to start On Duration Timer */ + if (UE_scheduling_control->in_short_drx_cycle == TRUE && UE_scheduling_control->on_duration_timer == 0) { + if (((frameP * 10) + subframeP) % (UE_scheduling_control->short_drx_cycle_duration) == + (UE_scheduling_control->drx_start_offset) % (UE_scheduling_control->short_drx_cycle_duration)) { + + UE_scheduling_control->on_duration_timer = 1; + } + } else if (UE_scheduling_control->in_long_drx_cycle == TRUE && UE_scheduling_control->on_duration_timer == 0) { + if (((frameP * 10) + subframeP) % (UE_scheduling_control->drx_longCycle_timer_thres) == + (UE_scheduling_control->drx_start_offset)) { + + UE_scheduling_control->on_duration_timer = 1; + } + } + + /* Update Active Time status of UE + * Based on 36.321 5.7 the differents conditions for the UE to be in Acttive Should be check ONLY + * here for the current subframe. The variable 'UE_scheduling_control->in_active_time' should be updated + * ONLY here. The variable can then be used for testing the actual state of the UE for scheduling purpose. + */ + UE_template = &(UE_list->UE_template[CC_id][UE_id]); + /* (a)synchronous HARQ Processes handling for Active Time */ + for (int harq_process_id = 0; harq_process_id < 8; harq_process_id++) { + if (UE_scheduling_control->drx_retransmission_timer[harq_process_id] > 0) { + harq_active_time_condition = TRUE; + active_time_condition = 2; + break; + } + } + + if (UE_scheduling_control->on_duration_timer > 0 || + UE_scheduling_control->drx_inactivity_timer > 1 || + harq_active_time_condition || + UE_template->ul_SR > 0) { + + UE_scheduling_control->in_active_time = TRUE; + } else { + UE_scheduling_control->in_active_time = FALSE; + } + + /* BEGIN VCD */ + if (UE_id == 0) { + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_ON_DURATION_TIMER, (unsigned long) UE_scheduling_control->on_duration_timer); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_INACTIVITY, (unsigned long) UE_scheduling_control->drx_inactivity_timer); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_SHORT_CYCLE, (unsigned long) UE_scheduling_control->drx_shortCycle_timer); + //VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SHORT_DRX_CYCLE_NUMBER, (unsigned long) UE_scheduling_control->short_drx_cycle); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_LONG_CYCLE, (unsigned long) UE_scheduling_control->drx_longCycle_timer); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_RETRANSMISSION_HARQ0, (unsigned long) UE_scheduling_control->drx_retransmission_timer[0]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_ACTIVE_TIME, (unsigned long) UE_scheduling_control->in_active_time); + + if (UE_template->ul_SR > 0) { + active_time_condition = 1; + } else if ((UE_scheduling_control->on_duration_timer > 0) && (active_time_condition == 0)) { + active_time_condition = 3; + } else if ((UE_scheduling_control->drx_inactivity_timer > 0) && (active_time_condition == 0)) { + active_time_condition = 4; + } + + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_ACTIVE_TIME_CONDITION, (unsigned long) active_time_condition); + } + /* END VCD */ + } else { // end if CDRX is configured + /* HARQ RTT timers */ + for (int harq_process_id = 0; harq_process_id < 8; harq_process_id++) { + if (UE_scheduling_control->harq_rtt_timer[CC_id][harq_process_id] > 0) { + UE_scheduling_control->harq_rtt_timer[CC_id][harq_process_id]++; + + if (UE_scheduling_control->harq_rtt_timer[CC_id][harq_process_id] > 8) { + UE_scheduling_control->harq_rtt_timer[CC_id][harq_process_id] = 0; + } + } + + if (UE_scheduling_control->ul_harq_rtt_timer[CC_id][harq_process_id] > 0) { + UE_scheduling_control->ul_harq_rtt_timer[CC_id][harq_process_id]++; + + if (UE_scheduling_control->ul_harq_rtt_timer[CC_id][harq_process_id] > 4) { + UE_scheduling_control->ul_harq_rtt_timer[CC_id][harq_process_id] = 0; + } + } + } // end loop harq process + } // end else CDRX not configured + + /* Increment these timers, they are cleared when we receive an sdu */ + UE_scheduling_control->ul_inactivity_timer++; + UE_scheduling_control->cqi_req_timer++; - RC.eNB[module_idP][CC_id]->pusch_stats_bsr[i][(frameP * 10) + - subframeP] = -63; - if (i == UE_list->head) - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME - (VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR, - RC.eNB[module_idP][CC_id]-> - pusch_stats_bsr[i][(frameP * 10) + subframeP]); - // increment this, it is cleared when we receive an sdu - RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer++; - - RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer++; - LOG_D(MAC, "UE %d/%x : ul_inactivity %d, cqi_req %d\n", i, rnti, - RC.mac[module_idP]->UE_list.UE_sched_ctrl[i]. - ul_inactivity_timer, - RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer); - check_ul_failure(module_idP, CC_id, i, frameP, subframeP); - - if (RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer > 0) { - RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer++; - if(RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer >= - RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer_thres) { - RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer = 0; - //clear reestablish_rnti_map - if(RC.mac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer_thres >20){ - for (int ue_id_l = 0; ue_id_l < MAX_MOBILES_PER_ENB; ue_id_l++) { - if (reestablish_rnti_map[ue_id_l][0] == rnti) { - // clear currentC-RNTI from map - reestablish_rnti_map[ue_id_l][0] = 0; - reestablish_rnti_map[ue_id_l][1] = 0; - break; - } - } + LOG_D(MAC, "UE %d/%x : ul_inactivity %d, cqi_req %d\n", + UE_id, + rnti, + UE_scheduling_control->ul_inactivity_timer, + UE_scheduling_control->cqi_req_timer); + + check_ul_failure(module_idP, CC_id, UE_id, frameP, subframeP); + + if (UE_scheduling_control->ue_reestablishment_reject_timer > 0) { + UE_scheduling_control->ue_reestablishment_reject_timer++; + + if (UE_scheduling_control->ue_reestablishment_reject_timer >= UE_scheduling_control->ue_reestablishment_reject_timer_thres) { + UE_scheduling_control->ue_reestablishment_reject_timer = 0; + + /* Clear reestablish_rnti_map */ + if (UE_scheduling_control->ue_reestablishment_reject_timer_thres > 20) { + for (int ue_id_l = 0; ue_id_l < MAX_MOBILES_PER_ENB; ue_id_l++) { + if (reestablish_rnti_map[ue_id_l][0] == rnti) { + /* Clear currentC-RNTI from map */ + reestablish_rnti_map[ue_id_l][0] = 0; + reestablish_rnti_map[ue_id_l][1] = 0; + break; + } + } PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, rnti, 0, 0,module_idP); rrc_rlc_remove_ue(&ctxt); pdcp_remove_UE(&ctxt); } - // Note: This should not be done in the MAC! - for (int ii=0; iiulsch[ii]; - if((ulsch != NULL) && (ulsch->rnti == rnti)){ + + /* Note: This should not be done in the MAC! */ + for (int ii=0; iiulsch[ii]; + + if((ulsch != NULL) && (ulsch->rnti == rnti)) { void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch); - LOG_I(MAC, "clean_eNb_ulsch UE %x \n", rnti); - clean_eNb_ulsch(ulsch); - } - } - for (int ii=0; iidlsch[ii][0]; - if((dlsch != NULL) && (dlsch->rnti == rnti)){ + + LOG_I(MAC, "clean_eNb_ulsch UE %x \n", rnti); + + clean_eNb_ulsch(ulsch); + } + } + + for (int ii=0; iidlsch[ii][0]; + + if((dlsch != NULL) && (dlsch->rnti == rnti)) { void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch); - LOG_I(MAC, "clean_eNb_dlsch UE %x \n", rnti); - clean_eNb_dlsch(dlsch); - } - } - - for(int j = 0; j < 10; j++){ - nfapi_ul_config_request_body_t *ul_req_tmp = NULL; - ul_req_tmp = &RC.mac[module_idP]->UL_req_tmp[CC_id][j].ul_config_request_body; - if(ul_req_tmp){ - int pdu_number = ul_req_tmp->number_of_pdus; - for(int pdu_index = pdu_number-1; pdu_index >= 0; pdu_index--){ - if(ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti){ - LOG_I(MAC, "remove UE %x from ul_config_pdu_list %d/%d\n", rnti, pdu_index, pdu_number); - if(pdu_index < pdu_number -1){ - memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index+1], (pdu_number-1-pdu_index) * sizeof(nfapi_ul_config_request_pdu_t)); - } - ul_req_tmp->number_of_pdus--; - } - } - } - } - rrc_mac_remove_ue(module_idP,rnti); - } - } - } - } + + LOG_I(MAC, "clean_eNb_dlsch UE %x \n", rnti); + + clean_eNb_dlsch(dlsch); + } + } + + for (int j = 0; j < 10; j++) { + nfapi_ul_config_request_body_t *ul_req_tmp = NULL; + ul_req_tmp = &(eNB->UL_req_tmp[CC_id][j].ul_config_request_body); + + if (ul_req_tmp) { + int pdu_number = ul_req_tmp->number_of_pdus; + + for (int pdu_index = pdu_number-1; pdu_index >= 0; pdu_index--) { + if (ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti) { + LOG_I(MAC, "remove UE %x from ul_config_pdu_list %d/%d\n", + rnti, + pdu_index, + pdu_number); + + if (pdu_index < pdu_number -1) { + memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], + &ul_req_tmp->ul_config_pdu_list[pdu_index+1], + (pdu_number-1-pdu_index) * sizeof(nfapi_ul_config_request_pdu_t)); + } + + ul_req_tmp->number_of_pdus--; + } + } // end for pdu_index + } // end if (ul_req_tmp) + } // end for j + + rrc_mac_remove_ue(module_idP,rnti); + + } // end if (UE_scheduling_control->ue_reestablishment_reject_timer >= UE_scheduling_control->ue_reestablishment_reject_timer_thres) + } // end if (UE_scheduling_control->ue_reestablishment_reject_timer > 0) + } // end if UE active + } // end for loop on UE_id #if (!defined(PRE_SCD_THREAD)) - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, - NOT_A_RNTI, frameP, subframeP, - module_idP); - pdcp_run(&ctxt); + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, subframeP, module_idP); + pdcp_run(&ctxt); rrc_rx_tx(&ctxt, CC_id); + #endif #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) @@ -641,76 +923,83 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, #endif - static int debug_flag=0; - void (*schedule_ulsch_p)(module_id_t module_idP, frame_t frameP, sub_frame_t subframe)=NULL; - void (*schedule_ue_spec_p)(module_id_t module_idP, frame_t frameP, sub_frame_t subframe, int *mbsfn_flag)=NULL; - if(RC.mac[module_idP]->scheduler_mode == SCHED_MODE_DEFAULT){ + static int debug_flag = 0; + void (*schedule_ulsch_p)(module_id_t module_idP, frame_t frameP, sub_frame_t subframe) = NULL; + void (*schedule_ue_spec_p)(module_id_t module_idP, frame_t frameP, sub_frame_t subframe, int *mbsfn_flag) = NULL; + + if (eNB->scheduler_mode == SCHED_MODE_DEFAULT) { schedule_ulsch_p = schedule_ulsch; schedule_ue_spec_p = schedule_dlsch; - }else if(RC.mac[module_idP]->scheduler_mode == SCHED_MODE_FAIR_RR){ + } else if (eNB->scheduler_mode == SCHED_MODE_FAIR_RR) { memset(dlsch_ue_select, 0, sizeof(dlsch_ue_select)); schedule_ulsch_p = schedule_ulsch_fairRR; schedule_ue_spec_p = schedule_ue_spec_fairRR; } - if(debug_flag==0){ - LOG_E(MAC,"SCHED_MODE=%d\n",RC.mac[module_idP]->scheduler_mode); - debug_flag=1; + + if(debug_flag == 0){ + LOG_E(MAC,"SCHED_MODE = %d\n", eNB->scheduler_mode); + debug_flag = 1; } - // This schedules MIB + /* This schedules MIB */ if ((subframeP == 0) && (frameP & 3) == 0) - schedule_mib(module_idP, frameP, subframeP); - if (get_softmodem_params()->phy_test == 0){ - // This schedules SI for legacy LTE and eMTC starting in subframeP + schedule_mib(module_idP, frameP, subframeP); + + if (get_softmodem_params()->phy_test == 0) { + /* This schedules SI for legacy LTE and eMTC starting in subframeP */ schedule_SI(module_idP, frameP, subframeP); - // This schedules Paging in subframeP + /* This schedules Paging in subframeP */ schedule_PCH(module_idP,frameP,subframeP); - // This schedules Random-Access for legacy LTE and eMTC starting in subframeP + /* This schedules Random-Access for legacy LTE and eMTC starting in subframeP */ schedule_RA(module_idP, frameP, subframeP); - // copy previously scheduled UL resources (ULSCH + HARQ) + /* Copy previously scheduled UL resources (ULSCH + HARQ) */ copy_ulreq(module_idP, frameP, subframeP); - // This schedules SRS in subframeP + /* This schedules SRS in subframeP */ schedule_SRS(module_idP, frameP, subframeP); - // This schedules ULSCH in subframeP (dci0) + + /* This schedules ULSCH in subframeP (dci0) */ if (schedule_ulsch_p != NULL) { - schedule_ulsch_p(module_idP, frameP, subframeP); + schedule_ulsch_p(module_idP, frameP, subframeP); } else { - LOG_E(MAC," %s %d: schedule_ulsch_p is NULL, function not called\n",__FILE__,__LINE__); + LOG_E(MAC," %s %d: schedule_ulsch_p is NULL, function not called\n", + __FILE__, + __LINE__); } - // This schedules UCI_SR in subframeP + + /* This schedules UCI_SR in subframeP */ schedule_SR(module_idP, frameP, subframeP); - // This schedules UCI_CSI in subframeP + /* This schedules UCI_CSI in subframeP */ schedule_CSI(module_idP, frameP, subframeP); #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) - // This schedules DLSCH in subframeP + /* This schedules DLSCH in subframeP for BR UE*/ schedule_ue_spec_br(module_idP, frameP, subframeP); #endif - // This schedules DLSCH in subframeP + /* This schedules DLSCH in subframeP */ if (schedule_ue_spec_p != NULL) { - schedule_ue_spec_p(module_idP, frameP, subframeP, mbsfn_status); + schedule_ue_spec_p(module_idP, frameP, subframeP, mbsfn_status); } else { - LOG_E(MAC," %s %d: schedule_ue_spec_p is NULL, function not called\n",__FILE__,__LINE__); + LOG_E(MAC," %s %d: schedule_ue_spec_p is NULL, function not called\n", + __FILE__, + __LINE__); } - } - else{ + } else { schedule_ulsch_phy_test(module_idP,frameP,subframeP); schedule_ue_spec_phy_test(module_idP,frameP,subframeP,mbsfn_status); } // Allocate CCEs for good after scheduling is done for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { - if(cc[CC_id].tdd_Config == NULL || !(is_UL_sf(&cc[CC_id],subframeP))) + if (cc[CC_id].tdd_Config == NULL || !(is_UL_sf(&cc[CC_id],subframeP))) { allocate_CCEs(module_idP, CC_id, frameP, subframeP, 2); + } } if (flexran_agent_get_mac_xface(module_idP) && subframeP == 9) { flexran_agent_slice_update(module_idP); } - stop_meas(&RC.mac[module_idP]->eNB_scheduler); + stop_meas(&(eNB->eNB_scheduler)); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME - (VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, - VCD_FUNCTION_OUT); -} + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, VCD_FUNCTION_OUT); +} \ No newline at end of file diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 79d791c558..25e412e8df 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -353,6 +353,9 @@ void generate_Msg2(module_id_t module_idP, AssertFatal (cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 != NULL, "cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n"); dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; + + LOG_E(MAC, "start_symbol = %d \n", dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol); + dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 24; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4 dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti_type = 2; // RA-RNTI diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 274b169bf6..59d4b3f157 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -477,7 +477,7 @@ schedule_ue_spec(module_id_t module_idP, int TBS, j, padding = 0, post_padding = 0; rnti_t rnti; unsigned char dlsch_buffer[MAX_DLSCH_PAYLOAD_BYTES]; - int round = 0; + int round_DL = 0; int harq_pid = 0; uint16_t release_num; uint8_t ra_ii; @@ -636,12 +636,15 @@ schedule_ue_spec(module_id_t module_idP, LOG_D(MAC, "doing schedule_ue_spec for CC_id %d UE %d\n", CC_id, UE_id); + continue_flag = 0; // reset the flag to allow allocation for the remaining UEs rnti = UE_RNTI(module_idP, UE_id); ue_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id]; ue_template = &UE_list->UE_template[CC_id][UE_id]; - if (ue_template->rach_resource_type > 0) continue_flag = 1; + if (ue_template->rach_resource_type > 0) { + continue_flag = 1; + } if (&(UE_list->eNB_UE_stats[CC_id][UE_id]) == NULL) { LOG_D(MAC, "[eNB] Cannot find eNB_UE_stats\n"); @@ -722,11 +725,11 @@ schedule_ue_spec(module_id_t module_idP, harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config, frameP, subframeP); - round = ue_sched_ctrl->round[CC_id][harq_pid]; + round_DL = ue_sched_ctrl->round[CC_id][harq_pid]; eNB_UE_stats->crnti = rnti; eNB_UE_stats->rrc_status = mac_eNB_get_rrc_status(module_idP, rnti); eNB_UE_stats->harq_pid = harq_pid; - eNB_UE_stats->harq_round = round; + eNB_UE_stats->harq_round = round_DL; if (eNB_UE_stats->rrc_status < RRC_CONNECTED) { LOG_D(MAC, "UE %d is not in RRC_CONNECTED\n", @@ -760,24 +763,55 @@ schedule_ue_spec(module_id_t module_idP, LOG_D(MAC, "[eNB %d] Frame %d: Scheduling UE %d on CC_id %d (rnti %x, harq_pid %d, round %d, rb %d, cqi %d, mcs %d, rrc %d)\n", module_idP, - frameP, UE_id, + frameP, + UE_id, CC_id, rnti, harq_pid, - round, + round_DL, nb_available_rb, ue_sched_ctrl->dl_cqi[CC_id], eNB_UE_stats->dlsch_mcs1, eNB_UE_stats->rrc_status); - /* process retransmission */ - if (round != 8) { + /* Process retransmission */ + if (round_DL != 8) { + //if (round_DL > 0) { // get freq_allocation nb_rb = ue_template->nb_rb[harq_pid]; TBS = get_TBS_DL(ue_template->oldmcs1[harq_pid], nb_rb); if (nb_rb <= nb_available_rb) { + /* CDRX */ + ue_sched_ctrl->harq_rtt_timer[CC_id][harq_pid] = 1; // restart HARQ RTT timer + /* + LOG_W(MAC, "HELLO : round!=8 UE_id = %d, frame = %d; subframe = %d; CC_id %d, harq_pid = %d , RTT_timer = %d,%d,%d,%d,%d,%d,%d,%d\n", + UE_id, + frameP, + subframeP, + CC_id, + harq_pid, + ue_sched_ctrl->harq_rtt_timer[CC_id][0], + ue_sched_ctrl->harq_rtt_timer[CC_id][1], + ue_sched_ctrl->harq_rtt_timer[CC_id][2], + ue_sched_ctrl->harq_rtt_timer[CC_id][3], + ue_sched_ctrl->harq_rtt_timer[CC_id][4], + ue_sched_ctrl->harq_rtt_timer[CC_id][5], + ue_sched_ctrl->harq_rtt_timer[CC_id][6], + ue_sched_ctrl->harq_rtt_timer[CC_id][7]); + */ + + if (ue_sched_ctrl->cdrx_configured) { + ue_sched_ctrl->drx_retransmission_timer[harq_pid] = 0; // stop drx retransmission + /* May be a problem with drx_retransmission_timer[harq_pid]. Here the timer is reset not stop. + * Can create a problem with several CC_id with the same UE?? + */ + if (harq_pid == 0) { + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_RETRANSMISSION_HARQ0, (unsigned long) ue_sched_ctrl->drx_retransmission_timer[0]); + } + } + if (cc[CC_id].tdd_Config != NULL) { ue_template->DAI++; update_ul_dci(module_idP, @@ -852,7 +886,7 @@ schedule_ue_spec(module_id_t module_idP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // Don't adjust power when retransmitting dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = ue_template->oldNDI[harq_pid]; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = ue_template->oldmcs1[harq_pid]; - dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = round & 3; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = round_DL & 3; // TDD if (cc[CC_id].tdd_Config != NULL) { @@ -861,7 +895,7 @@ schedule_ue_spec(module_id_t module_idP, module_idP, CC_id, harq_pid, - round, + round_DL, ue_template->DAI - 1, ue_template->oldmcs1[harq_pid]); } else { @@ -869,7 +903,7 @@ schedule_ue_spec(module_id_t module_idP, module_idP, CC_id, harq_pid, - round, + round_DL, ue_template->oldmcs1[harq_pid]); } @@ -893,7 +927,7 @@ schedule_ue_spec(module_id_t module_idP, 0, // virtual_resource_block_assignment_flag, unused here 0, // resource_block_coding, to be filled in later getQm(ue_template->oldmcs1[harq_pid]), - round & 3, // redundancy version + round_DL & 3, // redundancy version 1, // transport blocks 0, // transport block to codeword swap flag cc[CC_id].p_eNB == 1 ? 0 : 1, // transmission_scheme @@ -911,7 +945,7 @@ schedule_ue_spec(module_id_t module_idP, LOG_D(MAC, "Filled NFAPI configuration for DCI/DLSCH %d, retransmission round %d\n", eNB->pdu_index[CC_id], - round); + round_DL); program_dlsch_acknak(module_idP, CC_id, UE_id, @@ -946,7 +980,8 @@ schedule_ue_spec(module_id_t module_idP, CC_id, UE_id); } - } else { /* This is a potentially new SDU opportunity */ + } else { + /* This is a potentially new SDU opportunity */ rlc_status.bytes_in_buffer = 0; // Now check RLC information to compute number of required RBs // get maximum TBS size for RLC request @@ -1265,7 +1300,7 @@ schedule_ue_spec(module_id_t module_idP, } } - /* last header does not have length field */ + /* Last header does not have length field */ if (header_length_total) { header_length_total -= header_length_last; header_length_total++; @@ -1569,6 +1604,38 @@ schedule_ue_spec(module_id_t module_idP, dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; eNB->DL_req[CC_id].sfn_sf = frameP << 4 | subframeP; eNB->DL_req[CC_id].header.message_id = NFAPI_DL_CONFIG_REQUEST; + + /* CDRX */ + ue_sched_ctrl->harq_rtt_timer[CC_id][harq_pid] = 1; // restart HARQ RTT timer + /* + LOG_W(MAC, "HELLO : round=8, UE_id = %d, frame = %d; subframe = %d ; CC_id %d, harq_pid = %d , RTT_timer = %d,%d,%d,%d,%d,%d,%d,%d\n", + UE_id, + frameP, + subframeP, + CC_id, + harq_pid, + ue_sched_ctrl->harq_rtt_timer[CC_id][0], + ue_sched_ctrl->harq_rtt_timer[CC_id][1], + ue_sched_ctrl->harq_rtt_timer[CC_id][2], + ue_sched_ctrl->harq_rtt_timer[CC_id][3], + ue_sched_ctrl->harq_rtt_timer[CC_id][4], + ue_sched_ctrl->harq_rtt_timer[CC_id][5], + ue_sched_ctrl->harq_rtt_timer[CC_id][6], + ue_sched_ctrl->harq_rtt_timer[CC_id][7]); + */ + + if (ue_sched_ctrl->cdrx_configured) { + ue_sched_ctrl->drx_inactivity_timer = 1; // restart drx inactivity timer when new transmission + ue_sched_ctrl->drx_retransmission_timer[harq_pid] = 0; // stop drx retransmission + /* May be a problem with drx_retransmission_timer[harq_pid]. Here the timer is reset not stop. + * Can create a problem with several CC_id with the same UE?? + */ + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_INACTIVITY, (unsigned long) ue_sched_ctrl->drx_inactivity_timer); + if (harq_pid == 0) { + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_RETRANSMISSION_HARQ0, (unsigned long) ue_sched_ctrl->drx_retransmission_timer[0]); + } + } + // Toggle NDI for next time LOG_D(MAC, "CC_id %d Frame %d, subframeP %d: Toggling Format1 NDI for UE %d (rnti %x/%d) oldNDI %d\n", CC_id, @@ -1983,6 +2050,13 @@ schedule_ue_spec_br(module_id_t module_idP, continue; } + /* CDRX LTE-M */ + if (ue_sched_ctl->cdrx_configured == TRUE) { + if ((ue_sched_ctl->bypass_cdrx == FALSE) && (ue_sched_ctl->in_active_time == FALSE)) { + continue; + } + } + round_DL = ue_sched_ctl->round[CC_id][harq_pid]; AssertFatal (UE_template->physicalConfigDedicated != NULL, "UE_template->physicalConfigDedicated is null\n"); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 1488209dd7..26fcf8ec0f 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -343,9 +343,10 @@ subframe2harqpid(COMMON_channels_t *cc, sub_frame_t subframe) //------------------------------------------------------------------------------ { - uint8_t ret = 255; AssertFatal(cc != NULL, "cc is null\n"); + uint8_t ret = 255; + if (cc->tdd_Config == NULL) { // FDD ret = (((frame << 1) + subframe) & 7); } else { @@ -582,39 +583,27 @@ is_UL_sf(COMMON_channels_t *ccP, break; case 3: - if ((subframeP <= 1) || (subframeP >= 5)) - return (0); - else if ((subframeP > 1) && (subframeP < 5)) - return (1); - else - AssertFatal(1 == 0, "Unknown subframe number\n"); + if (subframeP <= 1 || subframeP >= 5) + return 0; - break; + return 1; case 4: - if ((subframeP <= 1) || (subframeP >= 4)) - return (0); - else if ((subframeP > 1) && (subframeP < 4)) - return (1); - else - AssertFatal(1 == 0, "Unknown subframe number\n"); + if (subframeP <= 1 || subframeP >= 4) + return 0; - break; + return 1; case 5: - if ((subframeP <= 1) || (subframeP >= 3)) - return (0); - else if ((subframeP > 1) && (subframeP < 3)) - return (1); - else - AssertFatal(1 == 0, "Unknown subframe number\n"); + if (subframeP <= 1 || subframeP >= 3) + return 0; - break; + return 1; default: - AssertFatal(1 == 0, - "subframe %d Unsupported TDD configuration %d\n", - subframeP, (int) ccP->tdd_Config->subframeAssignment); + AssertFatal(1 == 0, "subframe %d Unsupported TDD configuration %d\n", + subframeP, + (int) ccP->tdd_Config->subframeAssignment); break; } return 0; @@ -841,6 +830,10 @@ get_srs_pos(COMMON_channels_t *cc, } //------------------------------------------------------------------------------ +/* +* Get some CSI (CQI/PMI/RI) parameters for SFN and subframe number calculation +* with periodic report. +*/ void get_csi_params(COMMON_channels_t *cc, struct LTE_CQI_ReportPeriodic *cqi_ReportPeriodic, @@ -877,19 +870,22 @@ get_csi_params(COMMON_channels_t *cc, *Npd = 160; *N_OFFSET_CQI = cqi_PMI_ConfigIndex - 157; } else if (cqi_PMI_ConfigIndex > 317) { - if (cqi_PMI_ConfigIndex <= 349) { // 32 ms CQI_PMI period - *Npd = 32; - *N_OFFSET_CQI = cqi_PMI_ConfigIndex - 318; - } else if (cqi_PMI_ConfigIndex <= 413) { // 64 ms CQI_PMI period - *Npd = 64; - *N_OFFSET_CQI = cqi_PMI_ConfigIndex - 350; - } else if (cqi_PMI_ConfigIndex <= 541) { // 128 ms CQI_PMI period - *Npd = 128; - *N_OFFSET_CQI = cqi_PMI_ConfigIndex - 414; + + if (cqi_PMI_ConfigIndex <= 349) { // 32 ms CQI_PMI period + *Npd = 32; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex - 318; + } else if (cqi_PMI_ConfigIndex <= 413) { // 64 ms CQI_PMI period + *Npd = 64; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex - 350; + } else if (cqi_PMI_ConfigIndex <= 541) { // 128 ms CQI_PMI period + *Npd = 128; + *N_OFFSET_CQI = cqi_PMI_ConfigIndex - 414; } + } - } else { // TDD - if (cqi_PMI_ConfigIndex == 0) { // all UL subframes + + } else { // TDD + if (cqi_PMI_ConfigIndex == 0) { // all UL subframes *Npd = 1; *N_OFFSET_CQI = 0; } else if (cqi_PMI_ConfigIndex <= 6) { // 5 ms CQI_PMI period @@ -1114,7 +1110,7 @@ fill_nfapi_dl_dci_1A(nfapi_dl_config_request_pdu_t *dl_config_pdu, uint8_t vrb_flag) //------------------------------------------------------------------------------ { - memset((void *) dl_config_pdu, 0,sizeof(nfapi_dl_config_request_pdu_t)); + memset((void *) dl_config_pdu, 0, sizeof(nfapi_dl_config_request_pdu_t)); dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu)); @@ -1395,7 +1391,6 @@ fill_nfapi_ulsch_harq_information(module_id_t module_ else harq_information_rel10->harq_size = 1; } - break; default: // for any other TM we need 2 bits harq @@ -1410,7 +1405,6 @@ fill_nfapi_ulsch_harq_information(module_id_t module_ else harq_information_rel10->harq_size = 2; } - break; } // get Tmode return; @@ -1459,10 +1453,8 @@ fill_nfapi_harq_information(module_id_t module_idP, eNB_MAC_INST *eNB = RC.mac[module_idP]; COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; UE_list_t *UE_list = &eNB->UE_list; - int UE_id = find_UE_id(module_idP, rntiP); - AssertFatal(UE_id >= 0, "UE_id cannot be found, impossible\n"); AssertFatal(UE_list != NULL, "UE_list is null\n"); harq_information->harq_information_rel11.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG; @@ -1554,7 +1546,7 @@ fill_nfapi_uci_acknak(module_id_t module_idP, ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE; ul_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_ul_config_uci_harq_pdu)); ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; - ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0; // don't know how to use this + ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0; // don't know how to use this ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti = rntiP; fill_nfapi_harq_information(module_idP, @@ -1575,6 +1567,7 @@ fill_nfapi_uci_acknak(module_id_t module_idP, ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; ul_req->header.message_id = NFAPI_UL_CONFIG_REQUEST; ul_req->sfn_sf = (ackNAK_absSF/10) << 4 | ackNAK_absSF%10; + return (((ackNAK_absSF / 10) << 4) + (ackNAK_absSF % 10)); } @@ -1654,7 +1647,6 @@ fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body, LOG_D(MAC, "Filling TX_req %d for pdu length %d\n", tx_req_body->number_of_pdus, pdu_length); - TX_req->pdu_length = pdu_length; TX_req->pdu_index = pdu_index; TX_req->num_segments = 1; @@ -1687,6 +1679,7 @@ fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *ul_config_pd uint8_t current_tx_nb, uint8_t n_srs, uint16_t size) +//------------------------------------------------------------------------------ { uint8_t ri_size = 0; @@ -2081,22 +2074,23 @@ get_aggregation(uint8_t bw_index, } //------------------------------------------------------------------------------ +/* + * Dump the UL or DL UE_list into LOG_T(MAC) + */ void dump_ue_list(UE_list_t *listP, int ul_flag) //------------------------------------------------------------------------------ { - int j; - if (ul_flag == 0) { - for (j = listP->head; j >= 0; j = listP->next[j]) { - LOG_T(MAC, "node %d => %d\n", + for (int j = listP->head; j >= 0; j = listP->next[j]) { + LOG_T(MAC, "DL list node %d => %d\n", j, listP->next[j]); } } else { - for (j = listP->head_ul; j >= 0; j = listP->next_ul[j]) { - LOG_T(MAC, "node %d => %d\n", + for (int j = listP->head_ul; j >= 0; j = listP->next_ul[j]) { + LOG_T(MAC, "UL list node %d => %d\n", j, listP->next_ul[j]); } @@ -2192,17 +2186,18 @@ add_new_ue(module_id_t mod_idP, } //------------------------------------------------------------------------------ +/* + * Remove MAC context of UE + */ int rrc_mac_remove_ue(module_id_t mod_idP, rnti_t rntiP) //------------------------------------------------------------------------------ { - int j; UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; - int UE_id = find_UE_id(mod_idP, - rntiP); - int pCC_id; - eNB_UE_STATS *ue_stats; + int UE_id = find_UE_id(mod_idP, rntiP); + eNB_UE_STATS *ue_stats = NULL; + int pCC_id = -1; if (UE_id == -1) { LOG_W(MAC,"rrc_mac_remove_ue: UE %x not found\n", @@ -2210,38 +2205,42 @@ rrc_mac_remove_ue(module_id_t mod_idP, return 0; } - pCC_id = UE_PCCID(mod_idP, - UE_id); + pCC_id = UE_PCCID(mod_idP, UE_id); + LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n", UE_id, pCC_id, rntiP); - dump_ue_list(UE_list, - 0); + + dump_ue_list(UE_list, 0); // DL list displayed in LOG_T(MAC) + UE_list->active[UE_id] = FALSE; UE_list->num_UEs--; - if (UE_list->head == UE_id) UE_list->head = UE_list->next[UE_id]; - else UE_list->next[prev(UE_list, - UE_id, - 0)] = UE_list->next[UE_id]; + /* If present, remove UE from DL list */ + if (UE_list->head == UE_id) { + UE_list->head = UE_list->next[UE_id]; + } else { + int previous = prev(UE_list, UE_id, 0); - if (UE_list->head_ul == UE_id) UE_list->head_ul = UE_list->next_ul[UE_id]; - else UE_list->next_ul[prev(UE_list, - UE_id, - 0)] = UE_list->next_ul[UE_id]; + if (previous != -1) { + UE_list->next[previous] = UE_list->next[UE_id]; + } + } - // clear all remaining pending transmissions - /* UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID0] = 0; - UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID1] = 0; - UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID2] = 0; - UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID3] = 0; + /* If present, remove UE from UL list */ + if (UE_list->head_ul == UE_id) { + UE_list->head_ul = UE_list->next_ul[UE_id]; + } else { + int previous = prev(UE_list, UE_id, 1); - UE_list->UE_template[pCC_id][UE_id].ul_SR = 0; - UE_list->UE_template[pCC_id][UE_id].rnti = NOT_A_RNTI; - UE_list->UE_template[pCC_id][UE_id].ul_active = FALSE; - */ - memset (&UE_list->UE_template[pCC_id][UE_id], + if (previous != -1) { + UE_list->next_ul[previous] = UE_list->next_ul[UE_id]; + } + } + + /* Clear all remaining pending transmissions */ + memset(&UE_list->UE_template[pCC_id][UE_id], 0, sizeof(UE_TEMPLATE)); @@ -2249,7 +2248,7 @@ rrc_mac_remove_ue(module_id_t mod_idP, ue_stats->total_rbs_used = 0; ue_stats->total_rbs_used_retx = 0; - for ( j = 0; j < NB_RB_MAX; j++ ) { + for (int j = 0; j < NB_RB_MAX; j++ ) { ue_stats->num_pdu_tx[j] = 0; ue_stats->num_bytes_tx[j] = 0; } @@ -2260,7 +2259,7 @@ rrc_mac_remove_ue(module_id_t mod_idP, ue_stats->total_num_pdus = 0; ue_stats->total_rbs_used_rx = 0; - for ( j = 0; j < NB_RB_MAX; j++ ) { + for (int j = 0; j < NB_RB_MAX; j++ ) { ue_stats->num_pdu_rx[j] = 0; ue_stats->num_bytes_rx[j] = 0; } @@ -2269,11 +2268,13 @@ rrc_mac_remove_ue(module_id_t mod_idP, ue_stats->total_pdu_bytes_rx = 0; ue_stats->total_num_pdus_rx = 0; ue_stats->total_num_errors_rx = 0; - eNB_ulsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; - eNB_ulsch_info[mod_idP][pCC_id][UE_id].status = S_UL_NONE; - eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; - eNB_dlsch_info[mod_idP][pCC_id][UE_id].status = S_DL_NONE; + + eNB_ulsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; + eNB_ulsch_info[mod_idP][pCC_id][UE_id].status = S_UL_NONE; eNB_ulsch_info[mod_idP][pCC_id][UE_id].serving_num = 0; + + eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; + eNB_dlsch_info[mod_idP][pCC_id][UE_id].status = S_DL_NONE; eNB_dlsch_info[mod_idP][pCC_id][UE_id].serving_num = 0; // check if this has an RA process active @@ -2315,20 +2316,21 @@ rrc_mac_remove_ue(module_id_t mod_idP, } //------------------------------------------------------------------------------ +/* + * Returns the previous UE_id in the scheduling list in UL or DL + */ int prev(UE_list_t *listP, int nodeP, int ul_flag) //------------------------------------------------------------------------------ { - int j; - if (ul_flag == 0) { if (nodeP == listP->head) { return nodeP; } - for (j = listP->head; j >= 0; j = listP->next[j]) { + for (int j = listP->head; j >= 0; j = listP->next[j]) { if (listP->next[j] == nodeP) { return j; } @@ -2338,7 +2340,7 @@ prev(UE_list_t *listP, return nodeP; } - for (j = listP->head_ul; j >= 0; j = listP->next_ul[j]) { + for (int j = listP->head_ul; j >= 0; j = listP->next_ul[j]) { if (listP->next_ul[j] == nodeP) { return j; } @@ -2492,8 +2494,8 @@ UE_is_to_be_scheduled(module_id_t module_idP, if (UE_sched_ctl->ul_failure_timer > 0 || UE_sched_ctl->ul_out_of_sync > 0) return 0; - rnti_t ue_rnti = UE_RNTI(module_idP, - UE_id); + rnti_t ue_rnti = UE_RNTI(module_idP, UE_id); + LOG_D(MAC, "[eNB %d][PUSCH] Checking UL requirements UE %d/%x\n", module_idP, UE_id, @@ -2510,7 +2512,9 @@ UE_is_to_be_scheduled(module_id_t module_idP, module_idP, UE_id, ue_rnti, - UE_template->ul_buffer_info[LCGID0], UE_template->ul_SR); + UE_template->ul_buffer_info[LCGID0], + UE_template->ul_SR); + return 1; } return 0; @@ -2537,7 +2541,7 @@ get_tmode(module_id_t module_idP, "antennaInfo (mod_id %d) is null for CCId %d, UEid %d, physicalConfigDedicated %p\n", module_idP, CC_idP, - UE_idP, + UE_idP, physicalConfigDedicated); AssertFatal(physicalConfigDedicated->antennaInfo->present != LTE_PhysicalConfigDedicated__antennaInfo_PR_NOTHING, @@ -2877,18 +2881,11 @@ get_nb_subband(int N_RB_DL) return nb_sb; } -/* -void -init_CCE_table(int module_idP, - int CC_idP) -{ - memset(RC.mac[module_idP]->CCE_table[CC_idP], - 0, - 800 * sizeof(int)); -} -*/ + +//------------------------------------------------------------------------------ void init_CCE_table(int *CCE_table) +//------------------------------------------------------------------------------ { memset(CCE_table, 0, 800 * sizeof(int)); } @@ -3313,7 +3310,7 @@ try_again: } } // for i = 0 ... num_DL_DCIs - // no try to allocate UL DCIs + // now try to allocate UL DCIs for (i = 0; i < HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi; i++) { hi_dci0_pduLoop = &hi_dci0_pdu[i]; // allocate UL DCIs @@ -4066,6 +4063,7 @@ extract_harq(module_id_t mod_idP, ra[ra_i].rnti); } } + break; } } @@ -4966,9 +4964,7 @@ SR_indication(module_id_t mod_idP, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION, 1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION, 0); } else { - // AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP); - // AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP); - LOG_D(MAC, "[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d (unknown UEid) on CC_id %d\n", + LOG_D(MAC, "[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d (unknown UE_id) on CC_id %d\n", mod_idP, rntiP, frameP, diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index efe60be84f..52b5f7eff7 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -120,6 +120,8 @@ rx_sdu(const module_id_t enb_mod_idP, eNB_MAC_INST *mac = NULL; UE_list_t *UE_list = NULL; rrc_eNB_ue_context_t *ue_contextP = NULL; + UE_sched_ctrl *UE_scheduling_control = NULL; + UE_TEMPLATE *UE_template_ptr = NULL; /* Init */ current_rnti = rntiP; @@ -146,44 +148,47 @@ rx_sdu(const module_id_t enb_mod_idP, } if (UE_id != -1) { + UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]); + UE_template_ptr = &(UE_list->UE_template[CC_idP][UE_id]); + LOG_D(MAC, "[eNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n", enb_mod_idP, harq_pid, CC_idP, frameP, subframeP, - UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid], + UE_scheduling_control->round_UL[CC_idP][harq_pid], current_rnti, UE_id, ul_cqi); - AssertFatal(UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] < 8, "round >= 8\n"); + AssertFatal(UE_scheduling_control->round_UL[CC_idP][harq_pid] < 8, "round >= 8\n"); if (sduP != NULL) { - UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer = 0; - UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0; - UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1 << harq_pid)); + UE_scheduling_control->ul_inactivity_timer = 0; + UE_scheduling_control->ul_failure_timer = 0; + UE_scheduling_control->ul_scheduled &= (~(1 << harq_pid)); /* Update with smoothing: 3/4 of old value and 1/4 of new. * This is the logic that was done in the function * lte_est_timing_advance_pusch, maybe it's not necessary? * maybe it's even not correct at all? */ - UE_list->UE_sched_ctrl[UE_id].ta_update = (UE_list->UE_sched_ctrl[UE_id].ta_update * 3 + timing_advance) / 4; - UE_list->UE_sched_ctrl[UE_id].pusch_snr[CC_idP] = ul_cqi; - UE_list->UE_sched_ctrl[UE_id].ul_consecutive_errors = 0; + UE_scheduling_control->ta_update = (UE_scheduling_control->ta_update * 3 + timing_advance) / 4; + UE_scheduling_control->pusch_snr[CC_idP] = ul_cqi; + UE_scheduling_control->ul_consecutive_errors = 0; - first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; + first_rb = UE_template_ptr->first_rb_ul[harq_pid]; - if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { - UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 0; + if (UE_scheduling_control->ul_out_of_sync > 0) { + UE_scheduling_control->ul_out_of_sync = 0; mac_eNB_rrc_ul_in_sync(enb_mod_idP, CC_idP, frameP, subframeP, current_rnti); } /* Update bytes to schedule */ - UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes -= UE_list->UE_template[CC_idP][UE_id].TBS_UL[harq_pid]; + UE_template_ptr->scheduled_ul_bytes -= UE_template_ptr->TBS_UL[harq_pid]; - if (UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes < 0) { - UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes = 0; + if (UE_template_ptr->scheduled_ul_bytes < 0) { + UE_template_ptr->scheduled_ul_bytes = 0; } } else { // sduP == NULL => error @@ -193,29 +198,29 @@ rx_sdu(const module_id_t enb_mod_idP, CC_idP, frameP, subframeP, - UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid], + UE_scheduling_control->round_UL[CC_idP][harq_pid], ul_cqi, UE_id, current_rnti); if (ul_cqi > 200) { // too high energy pattern - UE_list->UE_sched_ctrl[UE_id].pusch_snr[CC_idP] = ul_cqi; + UE_scheduling_control->pusch_snr[CC_idP] = ul_cqi; LOG_W(MAC, "[MAC] Too high energy pattern\n"); } - if (UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] == 3) { - UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1 << harq_pid)); - UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] = 0; + if (UE_scheduling_control->round_UL[CC_idP][harq_pid] == 3) { + UE_scheduling_control->ul_scheduled &= (~(1 << harq_pid)); + UE_scheduling_control->round_UL[CC_idP][harq_pid] = 0; - if (UE_list->UE_sched_ctrl[UE_id].ul_consecutive_errors++ == 10) { - UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 1; + if (UE_scheduling_control->ul_consecutive_errors++ == 10) { + UE_scheduling_control->ul_failure_timer = 1; } /* Update scheduled bytes */ - UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes -= UE_list->UE_template[CC_idP][UE_id].TBS_UL[harq_pid]; + UE_template_ptr->scheduled_ul_bytes -= UE_template_ptr->TBS_UL[harq_pid]; - if (UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes < 0) { - UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes = 0; + if (UE_template_ptr->scheduled_ul_bytes < 0) { + UE_template_ptr->scheduled_ul_bytes = 0; } if (find_RA_id(enb_mod_idP, CC_idP, current_rnti) != -1) { @@ -223,16 +228,27 @@ rx_sdu(const module_id_t enb_mod_idP, } } else { - UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid]++; + UE_scheduling_control->round_UL[CC_idP][harq_pid]++; } - first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; + /* CDRX UL HARQ timers */ + if (UE_scheduling_control->cdrx_configured == TRUE) { + /* Synchronous UL HARQ */ + UE_scheduling_control->ul_synchronous_harq_timer[CC_idP][harq_pid] = 5; + /* In case of asynchronous UL HARQ process restart here relevant RTT timer + * Stop corresponding CDRX ULRetransmission timer + */ + } + + first_rb = UE_template_ptr->first_rb_ul[harq_pid]; /* Program NACK for PHICH */ - LOG_D(MAC, "Programming PHICH NACK for rnti %x harq_pid %d (first_rb %d)\n", + LOG_D(MAC, "Programming PHICH NACK for rnti %x harq_pid %d (first_rb %d), frame %d, subframe %d\n", current_rnti, harq_pid, - first_rb); + first_rb, + frameP, + subframeP); nfapi_hi_dci0_request_t *hi_dci0_req = NULL; uint8_t sf_ahead_dl = ul_subframe2_k_phich(&mac->common_channels[CC_idP], subframeP); @@ -250,9 +266,9 @@ rx_sdu(const module_id_t enb_mod_idP, hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; hi_dci0_req_body->number_of_hi++; - hi_dci0_req_body->sfnsf = sfnsf_add_subframe(frameP,subframeP, 0); + hi_dci0_req_body->sfnsf = sfnsf_add_subframe(frameP, subframeP, 0); hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG; - hi_dci0_req->sfn_sf = sfnsf_add_subframe(frameP,subframeP, sf_ahead_dl); + hi_dci0_req->sfn_sf = sfnsf_add_subframe(frameP, subframeP, sf_ahead_dl); hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST; return; } @@ -293,7 +309,7 @@ rx_sdu(const module_id_t enb_mod_idP, if (ra->msg3_round >= mac->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx - 1) { cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti); } else { - // first_rb = UE_list->UE_template[CC_idP][UE_id].first_rb_ul[harq_pid]; // UE_id = -1 !!!! + // first_rb = UE_template_ptr->first_rb_ul[harq_pid]; // UE_id = -1 !!!! ra->msg3_round++; /* Prepare handling of retransmission */ @@ -356,7 +372,7 @@ rx_sdu(const module_id_t enb_mod_idP, mac->eNB_stats[CC_idP].total_ulsch_bytes_rx += sdu_lenP; mac->eNB_stats[CC_idP].total_ulsch_pdus_rx += 1; if (UE_id != -1) { - UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] = 0; + UE_scheduling_control->round_UL[CC_idP][harq_pid] = 0; } /* Control element */ @@ -372,20 +388,20 @@ rx_sdu(const module_id_t enb_mod_idP, switch (rx_ces[i]) { // implement and process PHR + CRNTI + BSR case POWER_HEADROOM: if (UE_id != -1) { - UE_list->UE_template[CC_idP][UE_id].phr_info = (payload_ptr[0] & 0x3f) - PHR_MAPPING_OFFSET + (int8_t)(hundred_times_log10_NPRB[UE_list->UE_template[CC_idP][UE_id].nb_rb_ul[harq_pid] - 1] / 100); + UE_template_ptr->phr_info = (payload_ptr[0] & 0x3f) - PHR_MAPPING_OFFSET + (int8_t)(hundred_times_log10_NPRB[UE_template_ptr->nb_rb_ul[harq_pid] - 1] / 100); - if (UE_list->UE_template[CC_idP][UE_id].phr_info > 40) { - UE_list->UE_template[CC_idP][UE_id].phr_info = 40; + if (UE_template_ptr->phr_info > 40) { + UE_template_ptr->phr_info = 40; } 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_template_ptr->phr_info); - UE_list->UE_template[CC_idP][UE_id].phr_info_configured = 1; - UE_list->UE_sched_ctrl[UE_id].phr_received = 1; + UE_template_ptr->phr_info_configured = 1; + UE_scheduling_control->phr_received = 1; } payload_ptr += sizeof(POWER_HEADROOM_CMD); @@ -410,26 +426,39 @@ rx_sdu(const module_id_t enb_mod_idP, /* Receiving CRNTI means that the current rnti has to go away */ if (old_UE_id != -1) { if (mac_eNB_get_rrc_status(enb_mod_idP,old_rnti) == RRC_HO_EXECUTION) { - LOG_I(MAC, - "[eNB %d] Frame %d, Subframe %d CC_id %d : (rnti %x UE_id %d) Handover case\n", - enb_mod_idP, frameP, subframeP, CC_idP, old_rnti, old_UE_id); + LOG_I(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d : (rnti %x UE_id %d) Handover case\n", + enb_mod_idP, + frameP, + subframeP, + CC_idP, + old_rnti, + old_UE_id); + UE_id = old_UE_id; current_rnti = old_rnti; - //clear timer - UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0; - UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer = 0; - UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0; + /* Clear timer */ + UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]); + UE_template_ptr = &(UE_list->UE_template[CC_idP][UE_id]); - if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { - UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 0; - mac_eNB_rrc_ul_in_sync(enb_mod_idP, CC_idP, frameP, - subframeP, old_rnti); + UE_scheduling_control->uplane_inactivity_timer = 0; + UE_scheduling_control->ul_inactivity_timer = 0; + UE_scheduling_control->ul_failure_timer = 0; + + if (UE_scheduling_control->ul_out_of_sync > 0) { + UE_scheduling_control->ul_out_of_sync = 0; + mac_eNB_rrc_ul_in_sync(enb_mod_idP, + CC_idP, + frameP, + subframeP, + old_rnti); } - - UE_list->UE_template[CC_idP][UE_id].ul_SR = 1; - UE_list->UE_sched_ctrl[UE_id].crnti_reconfigurationcomplete_flag = 1; + UE_template_ptr->ul_SR = 1; + UE_scheduling_control->crnti_reconfigurationcomplete_flag = 1; UE_list->UE_template[UE_PCCID(enb_mod_idP, UE_id)][UE_id].configured = 1; - cancel_ra_proc(enb_mod_idP, CC_idP, frameP,current_rnti); + cancel_ra_proc(enb_mod_idP, + CC_idP, + frameP, + current_rnti); } else { /* TODO: if the UE did random access (followed by a MAC uplink with * CRNTI) because none of its scheduling request was granted, then @@ -473,19 +502,21 @@ rx_sdu(const module_id_t enb_mod_idP, ra->rnti = old_rnti; ra->crnti_rrc_mui = rrc_eNB_mui-1; ra->crnti_harq_pid = -1; - /* Clear timer */ - UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0; - UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0; - UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer = 0; - UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0; - if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { - UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 0; + /* Clear timer */ + UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]); + UE_template_ptr = &(UE_list->UE_template[CC_idP][UE_id]); + + UE_scheduling_control->uplane_inactivity_timer = 0; + UE_scheduling_control->ul_inactivity_timer = 0; + UE_scheduling_control->ul_failure_timer = 0; + + if (UE_scheduling_control->ul_out_of_sync > 0) { + UE_scheduling_control->ul_out_of_sync = 0; mac_eNB_rrc_ul_in_sync(enb_mod_idP, CC_idP, frameP, subframeP, old_rnti); } - - UE_list->UE_template[CC_idP][UE_id].ul_SR = 1; - UE_list->UE_sched_ctrl[UE_id].crnti_reconfigurationcomplete_flag = 1; + UE_template_ptr->ul_SR = 1; + UE_scheduling_control->crnti_reconfigurationcomplete_flag = 1; // break; } } @@ -518,12 +549,12 @@ rx_sdu(const module_id_t enb_mod_idP, lcgid_updated[lcgid] = 1; /* Update buffer info */ - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid] = BSR_TABLE[bsr]; - UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer = - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0] + - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1] + - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2] + - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3]; + UE_template_ptr->ul_buffer_info[lcgid] = BSR_TABLE[bsr]; + UE_template_ptr->estimated_ul_buffer = + UE_template_ptr->ul_buffer_info[LCGID0] + + UE_template_ptr->ul_buffer_info[LCGID1] + + UE_template_ptr->ul_buffer_info[LCGID2] + + UE_template_ptr->ul_buffer_info[LCGID3]; RC.eNB[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP * 10) + subframeP] = (payload_ptr[0] & 0x3f); @@ -531,8 +562,8 @@ rx_sdu(const module_id_t enb_mod_idP, VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR, (payload_ptr[0] & 0x3f)); } - if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] == 0) { - UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] = frameP; + if (UE_template_ptr->ul_buffer_creation_time[lcgid] == 0) { + UE_template_ptr->ul_buffer_creation_time[lcgid] = frameP; } if (mac_eNB_get_rrc_status(enb_mod_idP,UE_RNTI(enb_mod_idP, UE_id)) < RRC_CONNECTED) { @@ -540,8 +571,8 @@ rx_sdu(const module_id_t enb_mod_idP, enb_mod_idP, CC_idP, rx_ces[i], - UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer, - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]); + UE_template_ptr->estimated_ul_buffer, + UE_template_ptr->ul_buffer_info[lcgid]); } } else { @@ -565,25 +596,25 @@ rx_sdu(const module_id_t enb_mod_idP, lcgid_updated[LCGID3] = 1; /* Update buffer info */ - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0] = BSR_TABLE[bsr0]; - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1] = BSR_TABLE[bsr1]; - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2] = BSR_TABLE[bsr2]; - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3] = BSR_TABLE[bsr3]; + UE_template_ptr->ul_buffer_info[LCGID0] = BSR_TABLE[bsr0]; + UE_template_ptr->ul_buffer_info[LCGID1] = BSR_TABLE[bsr1]; + UE_template_ptr->ul_buffer_info[LCGID2] = BSR_TABLE[bsr2]; + UE_template_ptr->ul_buffer_info[LCGID3] = BSR_TABLE[bsr3]; - UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer = - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0] + - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1] + - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2] + - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3]; + UE_template_ptr->estimated_ul_buffer = + UE_template_ptr->ul_buffer_info[LCGID0] + + UE_template_ptr->ul_buffer_info[LCGID1] + + UE_template_ptr->ul_buffer_info[LCGID2] + + UE_template_ptr->ul_buffer_info[LCGID3]; LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d: Received long BSR. Size is LCGID0 = %u LCGID1 = %u LCGID2 = %u LCGID3 = %u\n", enb_mod_idP, CC_idP, rx_ces[i], - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0], - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1], - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2], - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3]); + UE_template_ptr->ul_buffer_info[LCGID0], + UE_template_ptr->ul_buffer_info[LCGID1], + UE_template_ptr->ul_buffer_info[LCGID2], + UE_template_ptr->ul_buffer_info[LCGID3]); if (crnti_rx == 1) { LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d: Received CRNTI.\n", @@ -593,10 +624,10 @@ rx_sdu(const module_id_t enb_mod_idP, } for(int lcgid = 0; lcgid <= LCGID3; lcgid++) { - if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid] == 0) { - UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] = 0; - } else if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] == 0) { - UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] = frameP; + if (UE_template_ptr->ul_buffer_info[lcgid] == 0) { + UE_template_ptr->ul_buffer_creation_time[lcgid] = 0; + } else if (UE_template_ptr->ul_buffer_creation_time[lcgid] == 0) { + UE_template_ptr->ul_buffer_creation_time[lcgid] = frameP; } } } @@ -705,6 +736,9 @@ rx_sdu(const module_id_t enb_mod_idP, frameP, ra->rnti, UE_id); + + UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]); + UE_template_ptr = &(UE_list->UE_template[CC_idP][UE_id]); } } else { LOG_D(MAC, "[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3 from already registered UE %d: length %d, offset %ld\n", @@ -758,7 +792,7 @@ rx_sdu(const module_id_t enb_mod_idP, ra->Msg4_subframe = (subframeP + 4) % 10; } - UE_list->UE_sched_ctrl[UE_id].crnti_reconfigurationcomplete_flag = 0; + UE_scheduling_control->crnti_reconfigurationcomplete_flag = 0; } // if RA process is active break; @@ -778,19 +812,19 @@ rx_sdu(const module_id_t enb_mod_idP, #endif if (UE_id != -1) { - if (lcgid_updated[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] == 0) { + if (lcgid_updated[UE_template_ptr->lcgidmap[rx_lcids[i]]] == 0) { /* Adjust buffer occupancy of the correponding logical channel group */ - if (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]) - 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]; + if (UE_template_ptr->ul_buffer_info[UE_template_ptr->lcgidmap[rx_lcids[i]]] >= rx_lengths[i]) + UE_template_ptr->ul_buffer_info[UE_template_ptr->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; + UE_template_ptr->ul_buffer_info[UE_template_ptr->lcgidmap[rx_lcids[i]]] = 0; - UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer = - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[0] + - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[1] + - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[2] + - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[3]; - //UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer += UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer / 4; + UE_template_ptr->estimated_ul_buffer = + UE_template_ptr->ul_buffer_info[0] + + UE_template_ptr->ul_buffer_info[1] + + UE_template_ptr->ul_buffer_info[2] + + UE_template_ptr->ul_buffer_info[3]; + //UE_template_ptr->estimated_ul_buffer += UE_template_ptr->estimated_ul_buffer / 4; } LOG_D(MAC, @@ -836,21 +870,21 @@ rx_sdu(const module_id_t enb_mod_idP, rx_lengths[i], UE_id, rx_lcids[i], - UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]], - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]]); + UE_template_ptr->lcgidmap[rx_lcids[i]], + UE_template_ptr->ul_buffer_info[UE_template_ptr->lcgidmap[rx_lcids[i]]]); - if (lcgid_updated[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] == 0) { - if (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]) { - 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]; + if (lcgid_updated[UE_template_ptr->lcgidmap[rx_lcids[i]]] == 0) { + if (UE_template_ptr->ul_buffer_info[UE_template_ptr->lcgidmap[rx_lcids[i]]] >= rx_lengths[i]) { + UE_template_ptr->ul_buffer_info[UE_template_ptr->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; + UE_template_ptr->ul_buffer_info[UE_template_ptr->lcgidmap[rx_lcids[i]]] = 0; } - UE_list->UE_template[CC_idP][UE_id].estimated_ul_buffer = - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[0] + - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[1] + - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[2] + - UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[3]; + UE_template_ptr->estimated_ul_buffer = + UE_template_ptr->ul_buffer_info[0] + + UE_template_ptr->ul_buffer_info[1] + + UE_template_ptr->ul_buffer_info[2] + + UE_template_ptr->ul_buffer_info[3]; } if ((rx_lengths[i] < SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0)) { // MAX SIZE OF transport block @@ -859,7 +893,7 @@ rx_sdu(const module_id_t enb_mod_idP, UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]] += rx_lengths[i]; /* Clear uplane_inactivity_timer */ - UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0; + UE_scheduling_control->uplane_inactivity_timer = 0; /* Reset RRC inactivity timer after uplane activity */ ue_contextP = rrc_eNB_get_ue_context(RC.rrc[enb_mod_idP], current_rnti); @@ -897,11 +931,24 @@ rx_sdu(const module_id_t enb_mod_idP, payload_ptr += rx_lengths[i]; } + /* CDRX UL HARQ timers */ + if (UE_id != -1) { + if (UE_scheduling_control->cdrx_configured == TRUE) { + /* Synchronous UL HARQ */ + UE_scheduling_control->ul_synchronous_harq_timer[CC_idP][harq_pid] = 5; + /* Note: in case of asynchronous UL HARQ process restart here relevant RTT timer + * Stop corresponding CDRX ULRetransmission timer + */ + } + } + /* Program ACK for PHICH */ - LOG_D(MAC, "Programming PHICH ACK for rnti %x harq_pid %d (first_rb %d)\n", - current_rnti, - harq_pid, - first_rb); + LOG_D(MAC, "Programming PHICH ACK for rnti %x harq_pid %d (first_rb %d) frame %d subframe %d\n", + current_rnti, + harq_pid, + first_rb, + frameP, + subframeP); nfapi_hi_dci0_request_t *hi_dci0_req; @@ -1303,15 +1350,15 @@ schedule_ulsch(module_id_t module_idP, //----------------------------------------------------------------------------- /* - * Default scheduler for ULSCH (DCI0) - */ +* Schedule the DCI0 for ULSCH +*/ void -schedule_ulsch_rnti(module_id_t module_idP, - int slice_idx, - frame_t frameP, - sub_frame_t subframeP, - unsigned char sched_subframeP, - uint16_t *first_rb) +schedule_ulsch_rnti(module_id_t module_idP, + int slice_idx, + frame_t frameP, + sub_frame_t subframeP, + unsigned char sched_subframeP, + uint16_t *first_rb) //----------------------------------------------------------------------------- { rnti_t rnti = -1; @@ -1473,7 +1520,7 @@ schedule_ulsch_rnti(module_id_t module_idP, VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO, UE_template_ptr->estimated_ul_buffer); /* - * If there is information on bsr of DCCH, DTCH or if there is UL_SR, + * If there is information on BSR of DCCH, DTCH or if there is UL_SR, * or if there is a packet to retransmit, or we want to schedule a periodic feedback */ /* Shouldn't this test be done earlier?? */ @@ -1491,14 +1538,14 @@ schedule_ulsch_rnti(module_id_t module_idP, UE_sched_ctrl_ptr->ul_failure_timer, UE_sched_ctrl_ptr->cqi_req_timer); - // reset the scheduling request + /* Reset the scheduling request */ UE_template_ptr->ul_SR = 0; status = mac_eNB_get_rrc_status(module_idP, rnti); cqi_req = 0; /* Handle the aperiodic CQI report */ /* These aperiodic reports behave as periodic ones... */ - if (status >= RRC_CONNECTED && UE_sched_ctrl_ptr->cqi_req_timer > 30) { + if (status >= RRC_CONNECTED && UE_sched_ctrl_ptr->cqi_req_timer > 200) { if (UE_sched_ctrl_ptr->cqi_received == 0) { if (nfapi_mode) { cqi_req = 0; @@ -1521,7 +1568,7 @@ schedule_ulsch_rnti(module_id_t module_idP, break; default: - LOG_E(MAC," TDD config not supported\n"); + LOG_E(MAC, "TDD config not supported\n"); break; } } @@ -1593,6 +1640,12 @@ schedule_ulsch_rnti(module_id_t module_idP, UE_template_ptr->mcs_UL[harq_pid] = cmin(UE_template_ptr->pre_assigned_mcs_ul, sli->ul[slice_idx].maxmcs); UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1= UE_template_ptr->mcs_UL[harq_pid]; + /* CDRX */ + if (UE_sched_ctrl_ptr->cdrx_configured) { + UE_sched_ctrl_ptr->drx_inactivity_timer = 1; // reset drx inactivity timer when new transmission + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_INACTIVITY, (unsigned long) UE_sched_ctrl_ptr->drx_inactivity_timer); + } + if (UE_template_ptr->pre_allocated_rb_table_index_ul >= 0) { rb_table_index = UE_template_ptr->pre_allocated_rb_table_index_ul; } else { @@ -1739,7 +1792,6 @@ schedule_ulsch_rnti(module_id_t module_idP, 1, // repetition_number (frameP * 10) + subframeP); } - #endif if (dlsch_flag == 1) { @@ -1854,7 +1906,6 @@ schedule_ulsch_rnti(module_id_t module_idP, UE_template_ptr->TBS_UL[harq_pid]); #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) - /* This is a BL/CE UE allocation */ if (UE_template_ptr->rach_resource_type > 0) { fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp_body->ul_config_pdu_list[ul_req_index], @@ -1863,7 +1914,6 @@ schedule_ulsch_rnti(module_id_t module_idP, 1, // repetition_number (frameP * 10) + subframeP); } - #endif if(dlsch_flag == 1) { @@ -1964,7 +2014,9 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP, UE_template = &(UE_list->UE_template[UE_PCCID(module_idP, UE_id)][UE_id]); /* LTE-M device */ - if (UE_template->rach_resource_type == 0) continue; + if (UE_template->rach_resource_type == 0) { + continue; + } /* Don't schedule if Msg4 is not received yet */ if (UE_template->configured == FALSE) { @@ -1988,6 +2040,14 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP, continue; } + /* CDRX LTE-M */ + UE_sched_ctrl = &(UE_list->UE_sched_ctrl[UE_id]); + if (UE_sched_ctrl->cdrx_configured == TRUE) { + if ((UE_sched_ctrl->bypass_cdrx == FALSE) && (UE_sched_ctrl->in_active_time == FALSE)) { + continue; + } + } + /* Loop over all active UL CC_ids for this UE */ for (n = 0; n < UE_list->numactiveULCCs[UE_id]; n++) { /* This is the actual CC_id in the list */ @@ -2087,6 +2147,13 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP, /* New transmission */ if (round_UL == 0) { + + /* CDRX LTE-M */ + if (UE_sched_ctrl->cdrx_configured == TRUE) { + UE_sched_ctrl->drx_inactivity_timer = 1; // reset drx inactivity timer when new transmission + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_INACTIVITY, (unsigned long) UE_sched_ctrl->drx_inactivity_timer); + } + ndi = 1 - UE_template->oldNDI_UL[harq_pid]; UE_template->oldNDI_UL[harq_pid] = ndi; diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h index fc457c2ee7..a00e5ec4e6 100644 --- a/openair2/LAYER2/MAC/mac.h +++ b/openair2/LAYER2/MAC/mac.h @@ -553,6 +553,7 @@ typedef struct { uint16_t serving_num; UE_ULSCH_STATUS status; } eNB_ULSCH_INFO; + /*! \brief temp struct for DLSCH sched */ typedef struct { rnti_t rnti; @@ -561,6 +562,7 @@ typedef struct { uint16_t serving_num; UE_DLSCH_STATUS status; } eNB_DLSCH_INFO; + /*! \brief eNB overall statistics */ typedef struct { /// num BCCH PDU per CC @@ -635,6 +637,7 @@ typedef struct { int missed_deadlines; } eNB_STATS; + /*! \brief eNB statistics for the connected UEs*/ typedef struct { /// CRNTI of UE @@ -778,6 +781,7 @@ typedef struct { } eNB_UE_STATS; /*! \brief eNB template for UE context information */ + typedef struct { /// C-RNTI of UE rnti_t rnti; @@ -995,6 +999,49 @@ typedef struct { int32_t uplane_inactivity_timer; uint8_t crnti_reconfigurationcomplete_flag; uint8_t cqi_req_flag; + + /* HARQ RRT Timers */ + /// (UL) HARQ RTT timers, especially used for CDRX operations, one timer per cell per harq process (and per user) + uint8_t harq_rtt_timer[NFAPI_CC_MAX][8]; + uint8_t ul_harq_rtt_timer[NFAPI_CC_MAX][8]; // Note: UL HARQ RTT timers are only for asynchronous HARQ processes!! + uint8_t ul_synchronous_harq_timer[NFAPI_CC_MAX][8]; + + /* C-DRX related timers */ + /* Note: only valid for FDD when this comment is written (11-01-19)*/ + /// is TRUE if the cqi mask feature is activated by RRC configuration + boolean_t cqi_mask_boolean; + /// is TRUE if the following drx parameters are configured for UE + boolean_t cdrx_configured; + /// if TRUE, the scheduler should bypass in_active_time and consider the UE as active + boolean_t bypass_cdrx; + /// is TRUE if the UE is in "Active Time", hence listening to PDCCH + boolean_t in_active_time; + /// OnDurationTimer + uint16_t on_duration_timer; + uint16_t on_duration_timer_thres; + /// drx-InactivityTimer + uint16_t drx_inactivity_timer; + uint16_t drx_inactivity_timer_thres; + /// is TRUE if UE is currently in short DRX cycle + boolean_t in_short_drx_cycle; + /// drxShortCycleTimer int (1..16) (number of short DRX cycles duration before long DRX cycles) + uint8_t drx_shortCycle_timer_value; + /// shortDRX-Cycle (duration of a short DRX cycle) + uint16_t short_drx_cycle_duration; + /// DRX short cycle timer before switching to long DRX cycle = drx_shortCycle_timer_value * short_drx_cycle_duration + uint16_t drx_shortCycle_timer; + uint16_t drx_shortCycle_timer_thres; + /// is TRUE if UE is currently in long DRX cycle + boolean_t in_long_drx_cycle; + /// longDRX-CycleStartOffset (long DRX cycle timer) + uint16_t drx_longCycle_timer; + uint16_t drx_longCycle_timer_thres; + /// longDRX-CycleStartOffset (offset value) + uint16_t drx_start_offset; + /// DRX retransmission timer, one per DL HARQ process + uint8_t drx_retransmission_timer[8]; + uint8_t drx_retransmission_timer_thres[8]; + /* End of C-DRX related timers */ } UE_sched_ctrl; /*! \brief eNB template for the Random access information */ @@ -1482,6 +1529,7 @@ typedef struct { int16_t bucket_size[MAX_NUM_LCID]; } UE_SCHEDULING_INFO; /*!\brief Top level UE MAC structure */ + typedef struct { uint16_t Node_id; /// RX frame counter diff --git a/openair2/LAYER2/MAC/mac_proto.h b/openair2/LAYER2/MAC/mac_proto.h index 8943a21d60..6e2a00fd30 100644 --- a/openair2/LAYER2/MAC/mac_proto.h +++ b/openair2/LAYER2/MAC/mac_proto.h @@ -1280,6 +1280,10 @@ uint16_t nb_rbs_allowed_slice(float rb_percentage, int total_rbs); int ue_dl_slice_membership(module_id_t mod_id, int UE_id, int slice_idx); int ue_ul_slice_membership(module_id_t mod_id, int UE_id, int slice_idx); +/* DRX Configuration */ +/* Configure local DRX timers and thresh following the drx_configuration input */ +void eNB_Config_Local_DRX(module_id_t Mod_id, rnti_t rnti, LTE_DRX_Config_t *drx_Configuration); + /* from here: prototypes to get rid of compilation warnings: doc to be written by function author */ uint8_t ul_subframe2_k_phich(COMMON_channels_t * cc, sub_frame_t ul_subframe); #endif diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 89756e7baa..ea49cfa81e 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -459,7 +459,7 @@ void decode_slice_positioning(module_id_t Mod_idP, } -// This fuction sorts the UE in order their dlsch buffer and CQI +// This function sorts the UE in order their dlsch buffer and CQI void sort_UEs(module_id_t Mod_idP, int slice_idx, @@ -471,9 +471,19 @@ sort_UEs(module_id_t Mod_idP, int list_size = 0; struct sort_ue_dl_params params = {Mod_idP, frameP, subframeP, slice_idx}; UE_list_t *UE_list = &RC.mac[Mod_idP]->UE_list; + UE_sched_ctrl *UE_scheduling_control = NULL; for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { + UE_scheduling_control = &(UE_list->UE_sched_ctrl[i]); + + if (UE_scheduling_control->cdrx_configured == TRUE) { + + if ((UE_scheduling_control->bypass_cdrx == FALSE) && (UE_scheduling_control->in_active_time == FALSE)) { + continue; + } + } + if (UE_list->active[i] == TRUE && UE_RNTI(Mod_idP, i) != NOT_A_RNTI && UE_list->UE_sched_ctrl[i].ul_out_of_sync != 1 && @@ -1636,8 +1646,9 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, uint16_t average_rbs_per_user[NFAPI_CC_MAX]; int16_t total_remaining_rbs[NFAPI_CC_MAX]; uint16_t total_ue_count[NFAPI_CC_MAX]; - UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; - slice_info_t *sli = &RC.mac[module_idP]->slice_info; + eNB_MAC_INST *eNB = RC.mac[module_idP]; + UE_list_t *UE_list = &eNB->UE_list; + slice_info_t *sli = &eNB->slice_info; UE_TEMPLATE *UE_template = 0; UE_sched_ctrl *ue_sched_ctl; int N_RB_UL = 0; @@ -1695,7 +1706,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, nCCE_to_be_used[CC_id] = nCCE_to_be_used[CC_id] + (1<common_channels[CC_id].ul_Bandwidth); + N_RB_UL = to_prb(eNB->common_channels[CC_id].ul_Bandwidth); ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; ue_sched_ctl->max_rbs_allowed_slice_uplink[CC_id][slice_idx] = nb_rbs_allowed_slice(sli->ul[slice_idx].pct, N_RB_UL); @@ -1740,7 +1751,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, // This is the actual CC_id in the list CC_id = UE_list->ordered_ULCCids[n][UE_id]; UE_template = &UE_list->UE_template[CC_id][UE_id]; - harq_pid = subframe2harqpid(&RC.mac[module_idP]->common_channels[CC_id], + harq_pid = subframe2harqpid(&eNB->common_channels[CC_id], frameP, sched_subframeP); // mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL); @@ -1772,7 +1783,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, // This is the actual CC_id in the list CC_id = UE_list->ordered_ULCCids[n][UE_id]; UE_template = &UE_list->UE_template[CC_id][UE_id]; - N_RB_UL = to_prb(RC.mac[module_idP]->common_channels[CC_id].ul_Bandwidth); + N_RB_UL = to_prb(eNB->common_channels[CC_id].ul_Bandwidth); first_rb_offset = UE_list->first_rb_offset[CC_id][slice_idx]; available_rbs = cmin(ue_sched_ctl->max_rbs_allowed_slice_uplink[CC_id][slice_idx], N_RB_UL - first_rb[CC_id] - first_rb_offset); total_remaining_rbs[CC_id] = available_rbs - total_allocated_rbs[CC_id]; @@ -1993,8 +2004,19 @@ sort_ue_ul(module_id_t module_idP, int list_size = 0; struct sort_ue_ul_params params = { module_idP, frameP, subframeP }; UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; + UE_sched_ctrl *UE_scheduling_control = NULL; for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { + + UE_scheduling_control = &(UE_list->UE_sched_ctrl[i]); + + if (UE_scheduling_control->cdrx_configured == TRUE) { + + if ((UE_scheduling_control->bypass_cdrx == FALSE) && (UE_scheduling_control->in_active_time == FALSE)) { + continue; + } + } + rntiTable[i] = UE_RNTI(module_idP, i); // Valid element and is not the actual CC_id in the list if (UE_list->active[i] == TRUE && diff --git a/openair2/RRC/LTE/L2_interface_common.c b/openair2/RRC/LTE/L2_interface_common.c index c17318d601..0afa6cd18f 100644 --- a/openair2/RRC/LTE/L2_interface_common.c +++ b/openair2/RRC/LTE/L2_interface_common.c @@ -38,7 +38,7 @@ #include "common/ran_context.h" #if defined(ENABLE_ITTI) -# include "intertask_interface.h" + #include "intertask_interface.h" #endif //#define RRC_DATA_REQ_DEBUG @@ -49,21 +49,21 @@ extern RAN_CONTEXT_t RC; //------------------------------------------------------------------------------ uint8_t rrc_data_req( - const protocol_ctxt_t* const ctxt_pP, + const protocol_ctxt_t *const ctxt_pP, const rb_id_t rb_idP, const mui_t muiP, const confirm_t confirmP, const sdu_size_t sdu_sizeP, - uint8_t* const buffer_pP, + uint8_t *const buffer_pP, const pdcp_transmission_mode_t modeP ) //------------------------------------------------------------------------------ { - if(sdu_sizeP == 255) - { + if(sdu_sizeP == 255) { LOG_I(RRC,"sdu_sizeP == 255"); return FALSE; } + MSC_LOG_TX_MESSAGE( ctxt_pP->enb_flag ? MSC_RRC_ENB : MSC_RRC_UE, ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE, @@ -74,20 +74,16 @@ rrc_data_req( ctxt_pP->rnti, muiP, sdu_sizeP); - #if defined(ENABLE_ITTI) { MessageDef *message_p; // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). uint8_t *message_buffer; - message_buffer = itti_malloc ( ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, sdu_sizeP); - memcpy (message_buffer, buffer_pP, sdu_sizeP); - message_p = itti_alloc_new_message (ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, RRC_DCCH_DATA_REQ); RRC_DCCH_DATA_REQ (message_p).frame = ctxt_pP->frame; RRC_DCCH_DATA_REQ (message_p).enb_flag = ctxt_pP->enb_flag; @@ -102,7 +98,6 @@ rrc_data_req( RRC_DCCH_DATA_REQ (message_p).module_id = ctxt_pP->module_id; RRC_DCCH_DATA_REQ (message_p).rnti = ctxt_pP->rnti; RRC_DCCH_DATA_REQ (message_p).eNB_index = ctxt_pP->eNB_index; - itti_send_msg_to_task ( ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, ctxt_pP->instance, @@ -117,7 +112,6 @@ rrc_data_req( #endif return TRUE; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway. - } #else return pdcp_data_req ( @@ -135,10 +129,10 @@ rrc_data_req( //------------------------------------------------------------------------------ void rrc_data_ind( - const protocol_ctxt_t* const ctxt_pP, + const protocol_ctxt_t *const ctxt_pP, const rb_id_t Srb_id, const sdu_size_t sdu_sizeP, - const uint8_t* const buffer_pP + const uint8_t *const buffer_pP ) //------------------------------------------------------------------------------ { @@ -162,10 +156,8 @@ rrc_data_ind( MessageDef *message_p; // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). uint8_t *message_buffer; - message_buffer = itti_malloc (ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, sdu_sizeP); memcpy (message_buffer, buffer_pP, sdu_sizeP); - message_p = itti_alloc_new_message (ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, RRC_DCCH_DATA_IND); RRC_DCCH_DATA_IND (message_p).frame = ctxt_pP->frame; RRC_DCCH_DATA_IND (message_p).dcch_index = DCCH_index; @@ -174,16 +166,13 @@ rrc_data_ind( RRC_DCCH_DATA_IND (message_p).rnti = ctxt_pP->rnti; RRC_DCCH_DATA_IND (message_p).module_id = ctxt_pP->module_id; RRC_DCCH_DATA_IND (message_p).eNB_index = ctxt_pP->eNB_index; - itti_send_msg_to_task (ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, ctxt_pP->instance, message_p); } #else - - rrc_eNB_decode_dcch( - ctxt_pP, - DCCH_index, - buffer_pP, - sdu_sizeP); - + rrc_eNB_decode_dcch( + ctxt_pP, + DCCH_index, + buffer_pP, + sdu_sizeP); #endif } diff --git a/openair2/RRC/LTE/L2_interface_ue.c b/openair2/RRC/LTE/L2_interface_ue.c index 9dfbeed61e..94a0f175d0 100644 --- a/openair2/RRC/LTE/L2_interface_ue.c +++ b/openair2/RRC/LTE/L2_interface_ue.c @@ -38,7 +38,7 @@ #if defined(ENABLE_ITTI) -# include "intertask_interface.h" + #include "intertask_interface.h" #endif //#define RRC_DATA_REQ_DEBUG @@ -53,67 +53,62 @@ mac_rrc_data_req_ue( const frame_t frameP, const rb_id_t Srb_id, const uint8_t Nb_tb, - uint8_t* const buffer_pP, + uint8_t *const buffer_pP, const uint8_t eNB_index, const uint8_t mbsfn_sync_area ) //-------------------------------------------------------------------------- { - LOG_D(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id); - - #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) - LOG_D(RRC,"[UE %d] Frame %d Filling SL DISCOVERY 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[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size); + LOG_D(RRC,"[UE %d] Frame %d Filling SL DISCOVERY 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[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size); + + //TTN (for D2D) + if (Srb_id == SL_DISCOVERY && UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size > 0) { + memcpy(&buffer_pP[0],&UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.Payload[0],UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size); + uint8_t Ret_size=UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size; + LOG_I(RRC,"[UE %d] Sending SL_Discovery, size %d bytes\n",Mod_idP,Ret_size); + UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size = 0; + return(Ret_size); + } - //TTN (for D2D) - if (Srb_id == SL_DISCOVERY && UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size > 0){ - memcpy(&buffer_pP[0],&UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.Payload[0],UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size); - uint8_t Ret_size=UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size; - LOG_I(RRC,"[UE %d] Sending SL_Discovery, size %d bytes\n",Mod_idP,Ret_size); - UE_rrc_inst[Mod_idP].SL_Discovery[eNB_index].Tx_buffer.payload_size = 0; - return(Ret_size); - } #endif - 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[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size); if( (UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size > 0) ) { - #if defined(ENABLE_ITTI) - { - MessageDef *message_p; - int ccch_size = UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size; - int sdu_size = sizeof(RRC_MAC_CCCH_DATA_REQ (message_p).sdu); + { + MessageDef *message_p; + int ccch_size = UE_rrc_inst[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[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); + 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; } -#endif - memcpy(&buffer_pP[0],&UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.Payload[0],UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size); - uint8_t Ret_size=UE_rrc_inst[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[Mod_idP].Info[eNB_index].T300_active = 1; - UE_rrc_inst[Mod_idP].Info[eNB_index].T300_cnt = 0; - // msg("[RRC][UE %d] Sending rach\n",Mod_id); - return(Ret_size); - } else { - return 0; + 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[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[Mod_idP].Srb0[eNB_index].Tx_buffer.Payload[0],UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size); + uint8_t Ret_size=UE_rrc_inst[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[Mod_idP].Info[eNB_index].T300_active = 1; + UE_rrc_inst[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); } @@ -127,7 +122,7 @@ mac_rrc_data_ind_ue( const sub_frame_t sub_frameP, const rnti_t rntiP, const rb_id_t srb_idP, - const uint8_t* sduP, + const uint8_t *sduP, const sdu_size_t sdu_lenP, const mac_enb_index_t eNB_indexP, const uint8_t mbsfn_sync_areaP @@ -136,139 +131,133 @@ mac_rrc_data_ind_ue( { protocol_ctxt_t ctxt; sdu_size_t sdu_size = 0; - /* for no gcc warnings */ (void)sdu_size; - /* int si_window; */ PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, 0, rntiP, frameP, sub_frameP,eNB_indexP); - if(srb_idP == BCCH) { - LOG_D(RRC,"[UE %d] Received SDU for BCCH on SRB %d from eNB %d\n",module_idP,srb_idP,eNB_indexP); + if(srb_idP == BCCH) { + LOG_D(RRC,"[UE %d] Received SDU for BCCH on SRB %d from eNB %d\n",module_idP,srb_idP,eNB_indexP); +#if defined(ENABLE_ITTI) + { + MessageDef *message_p; + int msg_sdu_size = sizeof(RRC_MAC_BCCH_DATA_IND (message_p).sdu); + if (sdu_lenP > msg_sdu_size) { + LOG_E(RRC, "SDU larger than BCCH SDU buffer size (%d, %d)", sdu_lenP, msg_sdu_size); + sdu_size = msg_sdu_size; + } else { + sdu_size = sdu_lenP; + } + + message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_BCCH_DATA_IND); + memset (RRC_MAC_BCCH_DATA_IND (message_p).sdu, 0, BCCH_SDU_SIZE); + RRC_MAC_BCCH_DATA_IND (message_p).frame = frameP; + RRC_MAC_BCCH_DATA_IND (message_p).sub_frame = sub_frameP; + RRC_MAC_BCCH_DATA_IND (message_p).sdu_size = sdu_size; + memcpy (RRC_MAC_BCCH_DATA_IND (message_p).sdu, sduP, sdu_size); + RRC_MAC_BCCH_DATA_IND (message_p).enb_index = eNB_indexP; + RRC_MAC_BCCH_DATA_IND (message_p).rsrq = 30 /* TODO change phy to report rspq */; + RRC_MAC_BCCH_DATA_IND (message_p).rsrp = 45 /* TODO change phy to report rspp */; + itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p); + } +#else + decode_BCCH_DLSCH_Message(&ctxt,eNB_indexP,(uint8_t *)sduP,sdu_lenP, 0, 0); +#endif + } + + if(srb_idP == PCCH) { + LOG_D(RRC,"[UE %d] Received SDU for PCCH on SRB %d from eNB %d\n",module_idP,srb_idP,eNB_indexP); + decode_PCCH_DLSCH_Message(&ctxt,eNB_indexP,(uint8_t *)sduP,sdu_lenP); + } + + if((srb_idP & RAB_OFFSET) == CCCH) { + if (sdu_lenP>0) { + LOG_T(RRC,"[UE %d] Received SDU for CCCH on SRB %d from eNB %d\n",module_idP,srb_idP & RAB_OFFSET,eNB_indexP); #if defined(ENABLE_ITTI) { MessageDef *message_p; - int msg_sdu_size = sizeof(RRC_MAC_BCCH_DATA_IND (message_p).sdu); + int msg_sdu_size = CCCH_SDU_SIZE; if (sdu_lenP > msg_sdu_size) { - LOG_E(RRC, "SDU larger than BCCH SDU buffer size (%d, %d)", sdu_lenP, msg_sdu_size); + LOG_E(RRC, "SDU larger than CCCH SDU buffer size (%d, %d)", sdu_size, msg_sdu_size); sdu_size = msg_sdu_size; } else { - sdu_size = sdu_lenP; + sdu_size = sdu_lenP; } - message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_BCCH_DATA_IND); - memset (RRC_MAC_BCCH_DATA_IND (message_p).sdu, 0, BCCH_SDU_SIZE); - RRC_MAC_BCCH_DATA_IND (message_p).frame = frameP; - RRC_MAC_BCCH_DATA_IND (message_p).sub_frame = sub_frameP; - RRC_MAC_BCCH_DATA_IND (message_p).sdu_size = sdu_size; - memcpy (RRC_MAC_BCCH_DATA_IND (message_p).sdu, sduP, sdu_size); - RRC_MAC_BCCH_DATA_IND (message_p).enb_index = eNB_indexP; - RRC_MAC_BCCH_DATA_IND (message_p).rsrq = 30 /* TODO change phy to report rspq */; - RRC_MAC_BCCH_DATA_IND (message_p).rsrp = 45 /* TODO change phy to report rspp */; - + message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_CCCH_DATA_IND); + memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE); + memcpy (RRC_MAC_CCCH_DATA_IND (message_p).sdu, sduP, sdu_size); + RRC_MAC_CCCH_DATA_IND (message_p).frame = frameP; + RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = sub_frameP; + RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = sdu_size; + RRC_MAC_CCCH_DATA_IND (message_p).enb_index = eNB_indexP; + RRC_MAC_CCCH_DATA_IND (message_p).rnti = rntiP; itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p); } #else - decode_BCCH_DLSCH_Message(&ctxt,eNB_indexP,(uint8_t*)sduP,sdu_lenP, 0, 0); + SRB_INFO *Srb_info; + Srb_info = &UE_rrc_inst[module_idP].Srb0[eNB_indexP]; + memcpy(Srb_info->Rx_buffer.Payload,sduP,sdu_lenP); + Srb_info->Rx_buffer.payload_size = sdu_lenP; + rrc_ue_decode_ccch(&ctxt, Srb_info, eNB_indexP); #endif } - - if(srb_idP == PCCH) { - LOG_D(RRC,"[UE %d] Received SDU for PCCH on SRB %d from eNB %d\n",module_idP,srb_idP,eNB_indexP); - decode_PCCH_DLSCH_Message(&ctxt,eNB_indexP,(uint8_t*)sduP,sdu_lenP); - } - if((srb_idP & RAB_OFFSET) == CCCH) { - if (sdu_lenP>0) { - LOG_T(RRC,"[UE %d] Received SDU for CCCH on SRB %d from eNB %d\n",module_idP,srb_idP & RAB_OFFSET,eNB_indexP); - -#if defined(ENABLE_ITTI) - { - MessageDef *message_p; - int msg_sdu_size = CCCH_SDU_SIZE; - - if (sdu_lenP > msg_sdu_size) { - LOG_E(RRC, "SDU larger than CCCH SDU buffer size (%d, %d)", sdu_size, msg_sdu_size); - sdu_size = msg_sdu_size; - } else { - sdu_size = sdu_lenP; - } - - message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_CCCH_DATA_IND); - memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE); - memcpy (RRC_MAC_CCCH_DATA_IND (message_p).sdu, sduP, sdu_size); - RRC_MAC_CCCH_DATA_IND (message_p).frame = frameP; - RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = sub_frameP; - RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = sdu_size; - RRC_MAC_CCCH_DATA_IND (message_p).enb_index = eNB_indexP; - RRC_MAC_CCCH_DATA_IND (message_p).rnti = rntiP; - itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p); - } -#else - SRB_INFO *Srb_info; - Srb_info = &UE_rrc_inst[module_idP].Srb0[eNB_indexP]; - memcpy(Srb_info->Rx_buffer.Payload,sduP,sdu_lenP); - Srb_info->Rx_buffer.payload_size = sdu_lenP; - rrc_ue_decode_ccch(&ctxt, Srb_info, eNB_indexP); -#endif - } - } + } #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) - if ((srb_idP & RAB_OFFSET) == MCCH) { - LOG_T(RRC,"[UE %d] Frame %d: Received SDU on MBSFN sync area %d for MCCH on SRB %d from eNB %d\n", - module_idP,frameP, mbsfn_sync_areaP, srb_idP & RAB_OFFSET,eNB_indexP); - + if ((srb_idP & RAB_OFFSET) == MCCH) { + LOG_T(RRC,"[UE %d] Frame %d: Received SDU on MBSFN sync area %d for MCCH on SRB %d from eNB %d\n", + module_idP,frameP, mbsfn_sync_areaP, srb_idP & RAB_OFFSET,eNB_indexP); #if defined(ENABLE_ITTI) - { - MessageDef *message_p; - int msg_sdu_size = sizeof(RRC_MAC_MCCH_DATA_IND (message_p).sdu); + { + MessageDef *message_p; + int msg_sdu_size = sizeof(RRC_MAC_MCCH_DATA_IND (message_p).sdu); - if (sdu_size > msg_sdu_size) { - LOG_E(RRC, "SDU larger than MCCH SDU buffer size (%d, %d)", sdu_size, msg_sdu_size); - sdu_size = msg_sdu_size; - } - - message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_MCCH_DATA_IND); - RRC_MAC_MCCH_DATA_IND (message_p).frame = frameP; - RRC_MAC_MCCH_DATA_IND (message_p).sub_frame = sub_frameP; - RRC_MAC_MCCH_DATA_IND (message_p).sdu_size = sdu_lenP; - memset (RRC_MAC_MCCH_DATA_IND (message_p).sdu, 0, MCCH_SDU_SIZE); - memcpy (RRC_MAC_MCCH_DATA_IND (message_p).sdu, sduP, sdu_lenP); - RRC_MAC_MCCH_DATA_IND (message_p).enb_index = eNB_indexP; - RRC_MAC_MCCH_DATA_IND (message_p).mbsfn_sync_area = mbsfn_sync_areaP; - itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p); + if (sdu_size > msg_sdu_size) { + LOG_E(RRC, "SDU larger than MCCH SDU buffer size (%d, %d)", sdu_size, msg_sdu_size); + sdu_size = msg_sdu_size; } + + message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_MCCH_DATA_IND); + RRC_MAC_MCCH_DATA_IND (message_p).frame = frameP; + RRC_MAC_MCCH_DATA_IND (message_p).sub_frame = sub_frameP; + RRC_MAC_MCCH_DATA_IND (message_p).sdu_size = sdu_lenP; + memset (RRC_MAC_MCCH_DATA_IND (message_p).sdu, 0, MCCH_SDU_SIZE); + memcpy (RRC_MAC_MCCH_DATA_IND (message_p).sdu, sduP, sdu_lenP); + RRC_MAC_MCCH_DATA_IND (message_p).enb_index = eNB_indexP; + RRC_MAC_MCCH_DATA_IND (message_p).mbsfn_sync_area = mbsfn_sync_areaP; + itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p); + } #else - decode_MCCH_Message(&ctxt, eNB_indexP, sduP, sdu_lenP, mbsfn_sync_areaP); + decode_MCCH_Message(&ctxt, eNB_indexP, sduP, sdu_lenP, mbsfn_sync_areaP); #endif - } - //TTN (for D2D) - if(srb_idP == SL_DISCOVERY) { - LOG_I(RRC,"[UE %d] Received SDU (%d bytes) for SL_DISCOVERY on SRB %d from eNB %d\n",module_idP, sdu_lenP, srb_idP,eNB_indexP); - decode_SL_Discovery_Message(&ctxt, eNB_indexP, sduP, sdu_lenP); - } + } + + //TTN (for D2D) + if(srb_idP == SL_DISCOVERY) { + LOG_I(RRC,"[UE %d] Received SDU (%d bytes) for SL_DISCOVERY on SRB %d from eNB %d\n",module_idP, sdu_lenP, srb_idP,eNB_indexP); + decode_SL_Discovery_Message(&ctxt, eNB_indexP, sduP, sdu_lenP); + } #endif // #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) - return(0); - } //------------------------------------------------------------------------------ uint8_t rrc_data_req_ue( - const protocol_ctxt_t* const ctxt_pP, + const protocol_ctxt_t *const ctxt_pP, const rb_id_t rb_idP, const mui_t muiP, const confirm_t confirmP, const sdu_size_t sdu_sizeP, - uint8_t* const buffer_pP, + uint8_t *const buffer_pP, const pdcp_transmission_mode_t modeP ) //------------------------------------------------------------------------------ @@ -283,20 +272,16 @@ rrc_data_req_ue( ctxt_pP->rnti, muiP, sdu_sizeP); - #if defined(ENABLE_ITTI) { MessageDef *message_p; // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). uint8_t *message_buffer; - message_buffer = itti_malloc ( ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, sdu_sizeP); - memcpy (message_buffer, buffer_pP, sdu_sizeP); - message_p = itti_alloc_new_message (ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, RRC_DCCH_DATA_REQ); RRC_DCCH_DATA_REQ (message_p).frame = ctxt_pP->frame; RRC_DCCH_DATA_REQ (message_p).enb_flag = ctxt_pP->enb_flag; @@ -309,13 +294,11 @@ rrc_data_req_ue( RRC_DCCH_DATA_REQ (message_p).module_id = ctxt_pP->module_id; RRC_DCCH_DATA_REQ (message_p).rnti = ctxt_pP->rnti; RRC_DCCH_DATA_REQ (message_p).eNB_index = ctxt_pP->eNB_index; - itti_send_msg_to_task ( TASK_PDCP_UE, ctxt_pP->instance, message_p); return TRUE; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway. - } #else return pdcp_data_req ( @@ -330,34 +313,30 @@ rrc_data_req_ue( #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) ,NULL, NULL #endif - ); + ); #endif } //------------------------------------------------------------------------------ void rrc_data_ind_ue( - const protocol_ctxt_t* const ctxt_pP, + const protocol_ctxt_t *const ctxt_pP, const rb_id_t Srb_id, const sdu_size_t sdu_sizeP, - const uint8_t* const buffer_pP + const uint8_t *const buffer_pP ) //------------------------------------------------------------------------------ { rb_id_t DCCH_index = Srb_id; - - LOG_I(RRC, "[UE %x] Frame %d: received a DCCH %d message on SRB %d with Size %d from eNB %d\n", - ctxt_pP->module_id, ctxt_pP->frame, DCCH_index,Srb_id,sdu_sizeP, ctxt_pP->eNB_index); - + LOG_I(RRC, "[UE %x] Frame %d: received a DCCH %d message on SRB %d with Size %d from eNB %d\n", + ctxt_pP->module_id, ctxt_pP->frame, DCCH_index,Srb_id,sdu_sizeP, ctxt_pP->eNB_index); #if defined(ENABLE_ITTI) { MessageDef *message_p; // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). uint8_t *message_buffer; - message_buffer = itti_malloc (ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, sdu_sizeP); memcpy (message_buffer, buffer_pP, sdu_sizeP); - message_p = itti_alloc_new_message (ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, RRC_DCCH_DATA_IND); RRC_DCCH_DATA_IND (message_p).frame = ctxt_pP->frame; RRC_DCCH_DATA_IND (message_p).dcch_index = DCCH_index; @@ -366,24 +345,20 @@ rrc_data_ind_ue( RRC_DCCH_DATA_IND (message_p).rnti = ctxt_pP->rnti; RRC_DCCH_DATA_IND (message_p).module_id = ctxt_pP->module_id; RRC_DCCH_DATA_IND (message_p).eNB_index = ctxt_pP->eNB_index; - itti_send_msg_to_task (TASK_RRC_UE, ctxt_pP->instance, message_p); } #else - -//#warning "LG put 0 to arg4 that is eNB index" - rrc_ue_decode_dcch( - ctxt_pP, - DCCH_index, - buffer_pP, - 0); - + //#warning "LG put 0 to arg4 that is eNB index" + rrc_ue_decode_dcch( + ctxt_pP, + DCCH_index, + buffer_pP, + 0); #endif } //-------------------------------------------------------------------------------------------// -void rrc_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) -{ +void rrc_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) { //-------------------------------------------------------------------------------------------// #if defined(ENABLE_ITTI) { @@ -392,7 +367,6 @@ void rrc_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_IN_SYNC_IND); RRC_MAC_IN_SYNC_IND (message_p).frame = frameP; RRC_MAC_IN_SYNC_IND (message_p).enb_index = eNB_index; - itti_send_msg_to_task (TASK_RRC_UE, UE_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); } #else @@ -406,25 +380,22 @@ void rrc_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) } //-------------------------------------------------------------------------------------------// -void rrc_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) -{ +void rrc_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) { //-------------------------------------------------------------------------------------------// if (UE_rrc_inst[Mod_idP].Info[eNB_index].N310_cnt>10) LOG_I(RRC,"[UE %d] Frame %d: OUT OF SYNC FROM eNB %d (T310 active %d : T310 %d, N310 %d, N311 %d)\n ", - Mod_idP,frameP,eNB_index, - UE_rrc_inst[Mod_idP].Info[eNB_index].T300_active, - UE_rrc_inst[Mod_idP].Info[eNB_index].T310_cnt, - UE_rrc_inst[Mod_idP].Info[eNB_index].N310_cnt, - UE_rrc_inst[Mod_idP].Info[eNB_index].N311_cnt); - + Mod_idP,frameP,eNB_index, + UE_rrc_inst[Mod_idP].Info[eNB_index].T300_active, + UE_rrc_inst[Mod_idP].Info[eNB_index].T310_cnt, + UE_rrc_inst[Mod_idP].Info[eNB_index].N310_cnt, + UE_rrc_inst[Mod_idP].Info[eNB_index].N311_cnt); + #if defined(ENABLE_ITTI) { MessageDef *message_p; - message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_OUT_OF_SYNC_IND); RRC_MAC_OUT_OF_SYNC_IND (message_p).frame = frameP; RRC_MAC_OUT_OF_SYNC_IND (message_p).enb_index = eNB_index; - itti_send_msg_to_task (TASK_RRC_UE, UE_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); } #else @@ -447,16 +418,13 @@ mac_UE_get_rrc_status( } //-------------------------------------------------------------------------------------------// -int mac_ue_ccch_success_ind(module_id_t Mod_idP, uint8_t eNB_index) -{ +int mac_ue_ccch_success_ind(module_id_t Mod_idP, uint8_t eNB_index) { //-------------------------------------------------------------------------------------------// #if defined(ENABLE_ITTI) { MessageDef *message_p; - message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_CCCH_DATA_CNF); RRC_MAC_CCCH_DATA_CNF (message_p).enb_index = eNB_index; - itti_send_msg_to_task (TASK_RRC_UE, UE_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); } #else diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index 53e94ab828..14aeb895e8 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -317,6 +317,110 @@ uint8_t do_MIB_SL(const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index, return((enc_rval.encoded+7)/8); } +// Begin add DRX SSR 2018-11 +LTE_DRX_Config_t *do_DrxConfig(uint8_t Mod_id, int CC_id, RrcConfigurationReq *configuration, LTE_UE_EUTRA_Capability_t *UEcap) +{ + // Begin add DRX SSR 2018-12 + LTE_DRX_Config_t *drxConfig = NULL; + BIT_STRING_t *featureGroupIndicators = NULL; + bool ueSupportCdrxShortFlag = false; + bool ueSupportCdrxLongFlag = false; + if (UEcap) { + featureGroupIndicators = UEcap->featureGroupIndicators; + if (featureGroupIndicators) { + if (featureGroupIndicators->size > 1 || (featureGroupIndicators->size == 1 && featureGroupIndicators->bits_unused < 4)) { + ueSupportCdrxShortFlag = ((featureGroupIndicators->buf[0] & (uint8_t) 0x10) > 0); + ueSupportCdrxLongFlag = ((featureGroupIndicators->buf[0] & (uint8_t) 0x08) > 0); + LOG_I(RRC,"[do_DrxConfig] featureGroupIndicators->buf[0]: %x\n", featureGroupIndicators->buf[0]); + } else LOG_W(RRC,"[do_DrxConfig] Not enough featureGroupIndicators bits\n"); + } else LOG_W(RRC,"[do_DrxConfig] No featureGroupIndicators pointer\n"); + } else LOG_W(RRC,"[do_DrxConfig] No UEcap pointer\n"); + // End add DRX SSR 2018-12 + + drxConfig = (LTE_DRX_Config_t *) malloc(sizeof(LTE_DRX_Config_t)); + if (drxConfig == NULL) return NULL; + memset(drxConfig, 0, sizeof(LTE_DRX_Config_t)); + + if (!ueSupportCdrxLongFlag || configuration == NULL) { + drxConfig->present = LTE_DRX_Config_PR_release; + } else { + drxConfig->present = configuration->radioresourceconfig[CC_id].drx_Config_present; + } + + if (drxConfig->present != LTE_DRX_Config_PR_NOTHING) { + if (drxConfig->present == LTE_DRX_Config_PR_release) { + drxConfig->choice.release = (NULL_t) 0; + } else { + drxConfig->choice.setup.onDurationTimer = configuration->radioresourceconfig[CC_id].drx_onDurationTimer; + drxConfig->choice.setup.drx_InactivityTimer = configuration->radioresourceconfig[CC_id].drx_InactivityTimer; + drxConfig->choice.setup.drx_RetransmissionTimer = configuration->radioresourceconfig[CC_id].drx_RetransmissionTimer; + drxConfig->choice.setup.longDRX_CycleStartOffset.present = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset_present; + switch (drxConfig->choice.setup.longDRX_CycleStartOffset.present) { + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf10: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf10 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf20: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf20 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf32: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf32 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf40: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf40 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf64: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf64 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf80: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf80 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf128: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf128 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf160: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf160 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf256: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf256 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf320: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf320 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf512: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf512 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf640: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf640 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1024: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf1024 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1280: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf1280 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2048: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf2048 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2560: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf2560 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + default: + break; + } + if (!ueSupportCdrxShortFlag || configuration->radioresourceconfig[CC_id].drx_shortDrx_ShortCycleTimer == 0) { + drxConfig->choice.setup.shortDRX = NULL; + } else { + drxConfig->choice.setup.shortDRX = MALLOC(sizeof(struct LTE_DRX_Config__setup__shortDRX)); + memset(drxConfig->choice.setup.shortDRX, 0, sizeof(struct LTE_DRX_Config__setup__shortDRX)); + drxConfig->choice.setup.shortDRX->shortDRX_Cycle = configuration->radioresourceconfig[CC_id].drx_shortDrx_Cycle; + drxConfig->choice.setup.shortDRX->drxShortCycleTimer = configuration->radioresourceconfig[CC_id].drx_shortDrx_ShortCycleTimer; + } + } + } + return drxConfig; +} +// End add DRX SSR 2018-11 + uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, int Mod_id,int CC_id @@ -911,7 +1015,7 @@ uint8_t do_SIB23(uint8_t Mod_id, struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib2_part,*sib3_part; #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) - int eMTC_configured=configuration->eMTC_configured; + int eMTC_configured = configuration->eMTC_configured; struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib18_part, *sib19_part, *sib21_part; LTE_SL_CommRxPoolList_r12_t *SL_CommRxPoolList; //for SIB18 struct LTE_SL_CommResourcePool_r12 *SL_CommResourcePool; //for SIB18 @@ -2357,6 +2461,7 @@ do_RRCConnectionSetup( dl_ccch_msg.message.present = LTE_DL_CCCH_MessageType_PR_c1; dl_ccch_msg.message.choice.c1.present = LTE_DL_CCCH_MessageType__c1_PR_rrcConnectionSetup; rrcConnectionSetup = &dl_ccch_msg.message.choice.c1.choice.rrcConnectionSetup; + LTE_MAC_MainConfig_t *mac_MainConfig = NULL; // RRCConnectionSetup // Configure SRB1 @@ -2475,30 +2580,34 @@ do_RRCConnectionSetup( physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->choice.setup.tpc_RNTI.buf[0]=0x22; physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->choice.setup.tpc_RNTI.buf[1]=0x34+ue_context_pP->local_uid; physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->choice.setup.tpc_RNTI.bits_unused=0; - // CQI ReportConfig - physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic=CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic)); -#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) - *physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic= LTE_CQI_ReportModeAperiodic_rm30; -#else - *physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic=LTE_CQI_ReportConfig__cqi_ReportModeAperiodic_rm30; // HLC CQI, no PMI -#endif - physicalConfigDedicated2->cqi_ReportConfig->nomPDSCH_RS_EPRE_Offset = 0; // 0 dB - //physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic=NULL; - physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic=CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic)); - physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->present = LTE_CQI_ReportPeriodic_PR_release; - /* - physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->present = CQI_ReportPeriodic_PR_setup; - physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex = 0; // n2_pucch - physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex = 0; // Icqi/pmi - physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present = CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI; // subband CQI - physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.choice.subbandCQI.k=4; - physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex=NULL; - physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.simultaneousAckNackAndCQI=0; + /* CQI ReportConfig */ + // Aperiodic configuration + physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic = CALLOC(1, sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic)); + +#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) + *physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic = LTE_CQI_ReportModeAperiodic_rm30; // HLC CQI, no PMI +#else + *physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic = LTE_CQI_ReportConfig__cqi_ReportModeAperiodic_rm30; // HLC CQI, no PMI +#endif + + physicalConfigDedicated2->cqi_ReportConfig->nomPDSCH_RS_EPRE_Offset = 0; // 0 dB (int -1...6) + + // Periodic configuration + physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic = CALLOC(1, sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic)); + physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->present = LTE_CQI_ReportPeriodic_PR_release; + /* + physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->present = CQI_ReportPeriodic_PR_setup; + physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex = 0; // n2_pucch + physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex = 0; // Icqi/pmi + physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present = CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI; // subband CQI + physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.choice.subbandCQI.k = 4; + physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex = NULL; + physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.simultaneousAckNackAndCQI = 0; */ //soundingRS-UL-ConfigDedicated - if (rrc->srs_enable[CC_id]==1) { + if (rrc->srs_enable[CC_id] == 1) { physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->present = LTE_SoundingRS_UL_ConfigDedicated_PR_setup; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth = LTE_SoundingRS_UL_ConfigDedicated__setup__srs_Bandwidth_bw0; @@ -2667,22 +2776,33 @@ do_RRCConnectionSetup( rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.physicalConfigDedicated = physicalConfigDedicated2; rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.mac_MainConfig = CALLOC(1,sizeof(struct LTE_RadioResourceConfigDedicated__mac_MainConfig)); rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.mac_MainConfig->present = LTE_RadioResourceConfigDedicated__mac_MainConfig_PR_explicitValue; - LTE_MAC_MainConfig_t *mac_MainConfig = &rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.mac_MainConfig->choice.explicitValue; + + /* MAC MainConfig */ + mac_MainConfig = &rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.mac_MainConfig->choice.explicitValue; + + //* ul_SCH_Config *// mac_MainConfig->ul_SCH_Config = CALLOC(1, sizeof(*mac_MainConfig->ul_SCH_Config)); long *maxHARQ_Tx = CALLOC(1, sizeof(long)); *maxHARQ_Tx = LTE_MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5; long *periodicBSR_Timer = CALLOC(1, sizeof(long)); - *periodicBSR_Timer = LTE_PeriodicBSR_Timer_r12_sf64; - mac_MainConfig->ul_SCH_Config->maxHARQ_Tx = maxHARQ_Tx; + *periodicBSR_Timer = LTE_PeriodicBSR_Timer_r12_sf64; // LTE_PeriodicBSR_Timer_r12_infinity + + mac_MainConfig->ul_SCH_Config->maxHARQ_Tx = maxHARQ_Tx; // max number of UL HARQ transmission mac_MainConfig->ul_SCH_Config->periodicBSR_Timer = periodicBSR_Timer; - mac_MainConfig->ul_SCH_Config->retxBSR_Timer = LTE_RetxBSR_Timer_r12_sf320; + mac_MainConfig->ul_SCH_Config->retxBSR_Timer = LTE_RetxBSR_Timer_r12_sf320; // LTE_RetxBSR_Timer_r12_sf5120 // regular BSR timer mac_MainConfig->ul_SCH_Config->ttiBundling = 0; // FALSE + + //* timeAlignmentTimerDedicated *// mac_MainConfig->timeAlignmentTimerDedicated = LTE_TimeAlignmentTimer_infinity; + + //* DRX Config *// mac_MainConfig->drx_Config = NULL; + + //* PHR Config *// mac_MainConfig->phr_Config = CALLOC(1, sizeof(*mac_MainConfig->phr_Config)); mac_MainConfig->phr_Config->present = LTE_MAC_MainConfig__phr_Config_PR_setup; - mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20; // sf20 = 20 subframes - mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20; // sf20 = 20 subframes + mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20; // sf20 = 20 subframes // LTE_MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_infinity + mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20; // sf20 = 20 subframes // LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf1000 mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange = LTE_MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1; // Value dB1 =1 dB, dB3 = 3 dB if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { @@ -2703,11 +2823,7 @@ do_RRCConnectionSetup( LOG_D(RRC,"RRCConnectionSetup Encoded %zd bits (%zd bytes) \n", enc_rval.encoded,(enc_rval.encoded+7)/8); - // FREEMEM(SRB_list); - // free(SRB1_config); - // free(SRB1_rlc_config); - // free(SRB1_lchan_config); - // free(SRB1_ul_SpecificParameters); + return((enc_rval.encoded+7)/8); } diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.h b/openair2/RRC/LTE/MESSAGES/asn1_msg.h index eb9572f4d2..7022f9e6e0 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.h +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.h @@ -70,6 +70,15 @@ uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich #endif ); +/** +\brief Generate configuration for DRX_Config (Add DRX SSR 2018-11) +@param Mod_id Instance of eNB +@param CC_id Id of component to configure +@param configuration Pointer Configuration Request structure +@param UEcap Pointer Configuration UE capablities +@return DRX_Config structure pointer or NULL => error*/ +LTE_DRX_Config_t *do_DrxConfig(uint8_t Mod_id, int CC_id, RrcConfigurationReq *configuration, LTE_UE_EUTRA_Capability_t *UEcap); + /** \brief Generate configuration for SIB1 (eNB). @param carrier pointer to Carrier information diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index a00bc53759..a0eab1c249 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -140,9 +140,9 @@ static uint8_t check_trigger_meas_event( LTE_Q_OffsetRange_t ofs, LTE_Q_OffsetRange_t ocs, long a3_offset, LTE_TimeToTrigger_t ttt); #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) -static void decode_MBSFNAreaConfiguration(module_id_t module_idP, uint8_t eNB_index, frame_t frameP,uint8_t mbsfn_sync_area); -uint8_t rrc_ue_generate_SidelinkUEInformation( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index,LTE_SL_DestinationInfoList_r12_t *destinationInfoList, long *discTxResourceReq, - SL_TRIGGER_t mode); + static void decode_MBSFNAreaConfiguration(module_id_t module_idP, uint8_t eNB_index, frame_t frameP,uint8_t mbsfn_sync_area); + uint8_t rrc_ue_generate_SidelinkUEInformation( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index,LTE_SL_DestinationInfoList_r12_t *destinationInfoList, long *discTxResourceReq, + SL_TRIGGER_t mode); #endif diff --git a/openair2/RRC/LTE/rrc_UE_ral.c b/openair2/RRC/LTE/rrc_UE_ral.c index c972d280d5..d7ace8c242 100644 --- a/openair2/RRC/LTE/rrc_UE_ral.c +++ b/openair2/RRC/LTE/rrc_UE_ral.c @@ -46,8 +46,7 @@ int rrc_ue_ral_delete_all_thresholds_type(unsigned int mod_idP, ral_link_param_t rrc_ral_threshold_key_t *keys = NULL; unsigned int num_keys = 0; int return_code = 0; - - rc = obj_hashtable_get_keys(UE_rrc_inst[mod_idP].ral_meas_thresholds, (void*)&keys, &num_keys); + rc = obj_hashtable_get_keys(UE_rrc_inst[mod_idP].ral_meas_thresholds, (void *)&keys, &num_keys); if (rc == HASH_TABLE_OK) { key = keys; @@ -82,10 +81,9 @@ int rrc_ue_ral_delete_threshold(unsigned int mod_idP, ral_link_param_type_t *par { hashtable_rc_t rc; rrc_ral_threshold_key_t ref_key; - memcpy(&ref_key.link_param_type, param_type_pP, sizeof(ral_link_param_type_t)); memcpy(&ref_key.threshold, threshold_pP, sizeof(ral_threshold_t)); - rc = obj_hashtable_remove (UE_rrc_inst[mod_idP].ral_meas_thresholds, (void*)&ref_key, sizeof(rrc_ral_threshold_key_t)); + rc = obj_hashtable_remove (UE_rrc_inst[mod_idP].ral_meas_thresholds, (void *)&ref_key, sizeof(rrc_ral_threshold_key_t)); if (rc == HASH_TABLE_OK) { return 0; @@ -106,135 +104,131 @@ int rrc_ue_ral_handle_configure_threshold_request(unsigned int mod_idP, MessageD MessageDef *message_p = NULL; unsigned int ix_param = 0; unsigned int ix_thresholds = 0; - DevAssert(msg_pP != NULL); - LOG_I(RRC, "[UE %d] Received %s\n", mod_idP, ITTI_MSG_NAME (msg_pP)); configure_threshold_req_p = &RRC_RAL_CONFIGURE_THRESHOLD_REQ(msg_pP); - transaction_id = configure_threshold_req_p->transaction_id; for (ix_param = 0; ix_param < configure_threshold_req_p->num_link_cfg_params; ix_param++) { link_cfg_param_p = &configure_threshold_req_p->link_cfg_params[ix_param]; switch (link_cfg_param_p->th_action) { - case RAL_TH_ACTION_SET_NORMAL_THRESHOLD: - case RAL_TH_ACTION_SET_ONE_SHOT_THRESHOLD: - switch (link_cfg_param_p->link_param_type.choice) { + case RAL_TH_ACTION_SET_NORMAL_THRESHOLD: + case RAL_TH_ACTION_SET_ONE_SHOT_THRESHOLD: + switch (link_cfg_param_p->link_param_type.choice) { + case RAL_LINK_PARAM_TYPE_CHOICE_GEN: + switch (link_cfg_param_p->link_param_type._union.link_param_gen) { + case RAL_LINK_PARAM_GEN_DATA_RATE: + case RAL_LINK_PARAM_GEN_SIGNAL_STRENGTH: + case RAL_LINK_PARAM_GEN_SINR: + case RAL_LINK_PARAM_GEN_THROUGHPUT: + case RAL_LINK_PARAM_GEN_PACKET_ERROR_RATE: + message_p = itti_alloc_new_message (TASK_RRC_UE, PHY_MEAS_THRESHOLD_REQ); + PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; + memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); + itti_send_msg_to_task (TASK_PHY_UE, ITTI_MSG_INSTANCE(msg_pP), message_p); + break; - case RAL_LINK_PARAM_TYPE_CHOICE_GEN: - switch (link_cfg_param_p->link_param_type._union.link_param_gen) { - case RAL_LINK_PARAM_GEN_DATA_RATE: - case RAL_LINK_PARAM_GEN_SIGNAL_STRENGTH: - case RAL_LINK_PARAM_GEN_SINR: - case RAL_LINK_PARAM_GEN_THROUGHPUT: - case RAL_LINK_PARAM_GEN_PACKET_ERROR_RATE: - message_p = itti_alloc_new_message (TASK_RRC_UE, PHY_MEAS_THRESHOLD_REQ); - PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; - memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); - itti_send_msg_to_task (TASK_PHY_UE, ITTI_MSG_INSTANCE(msg_pP), message_p); - break; + default: + LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_gen %d\n", link_cfg_param_p->link_param_type._union.link_param_gen); + return -1; + } - default: - LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_gen %d\n", link_cfg_param_p->link_param_type._union.link_param_gen); - return -1; - } + break; - break; + case RAL_LINK_PARAM_TYPE_CHOICE_QOS: + switch (link_cfg_param_p->link_param_type._union.link_param_qos) { + case RAL_LINK_PARAM_QOS_MAX_NUM_DIF_COS_SUPPORTED: + case RAL_LINK_PARAM_QOS_MIN_PACKET_TRANSFER_DELAY_ALL_COS: + case RAL_LINK_PARAM_QOS_AVG_PACKET_TRANSFER_DELAY_ALL_COS: + case RAL_LINK_PARAM_QOS_MAX_PACKET_TRANSFER_DELAY_ALL_COS: + case RAL_LINK_PARAM_QOS_STD_DEVIATION_PACKET_TRANSFER_DELAY: + case RAL_LINK_PARAM_QOS_PACKET_LOSS_RATE_ALL_COS_FRAME_RATIO: + message_p = itti_alloc_new_message (TASK_RRC_UE, PHY_MEAS_THRESHOLD_REQ); + PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; + memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); + itti_send_msg_to_task (TASK_MAC_UE, ITTI_MSG_INSTANCE(msg_pP), message_p); + break; - case RAL_LINK_PARAM_TYPE_CHOICE_QOS: - switch (link_cfg_param_p->link_param_type._union.link_param_qos) { - case RAL_LINK_PARAM_QOS_MAX_NUM_DIF_COS_SUPPORTED: - case RAL_LINK_PARAM_QOS_MIN_PACKET_TRANSFER_DELAY_ALL_COS: - case RAL_LINK_PARAM_QOS_AVG_PACKET_TRANSFER_DELAY_ALL_COS: - case RAL_LINK_PARAM_QOS_MAX_PACKET_TRANSFER_DELAY_ALL_COS: - case RAL_LINK_PARAM_QOS_STD_DEVIATION_PACKET_TRANSFER_DELAY: - case RAL_LINK_PARAM_QOS_PACKET_LOSS_RATE_ALL_COS_FRAME_RATIO: - message_p = itti_alloc_new_message (TASK_RRC_UE, PHY_MEAS_THRESHOLD_REQ); - PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; - memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); - itti_send_msg_to_task (TASK_MAC_UE, ITTI_MSG_INSTANCE(msg_pP), message_p); - break; + default: + LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_qos %d\n", link_cfg_param_p->link_param_type._union.link_param_qos); + return -1; + } - default: - LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_qos %d\n", link_cfg_param_p->link_param_type._union.link_param_qos); - return -1; - } + break; - break; + case RAL_LINK_PARAM_TYPE_CHOICE_LTE: + switch (link_cfg_param_p->link_param_type._union.link_param_lte) { + // group by dest task id + case RAL_LINK_PARAM_LTE_UE_RSRP: + case RAL_LINK_PARAM_LTE_UE_RSRQ: + case RAL_LINK_PARAM_LTE_UE_CQI: + message_p = itti_alloc_new_message (TASK_RRC_UE, PHY_MEAS_THRESHOLD_REQ); + PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; + memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); + itti_send_msg_to_task (TASK_PHY_UE, ITTI_MSG_INSTANCE(msg_pP), message_p); + break; - case RAL_LINK_PARAM_TYPE_CHOICE_LTE: - switch (link_cfg_param_p->link_param_type._union.link_param_lte) { - // group by dest task id - case RAL_LINK_PARAM_LTE_UE_RSRP: - case RAL_LINK_PARAM_LTE_UE_RSRQ: - case RAL_LINK_PARAM_LTE_UE_CQI: - message_p = itti_alloc_new_message (TASK_RRC_UE, PHY_MEAS_THRESHOLD_REQ); - PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; - memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); - itti_send_msg_to_task (TASK_PHY_UE, ITTI_MSG_INSTANCE(msg_pP), message_p); - break; + case RAL_LINK_PARAM_LTE_AVAILABLE_BW: + case RAL_LINK_PARAM_LTE_PACKET_LOSS_RATE: + case RAL_LINK_PARAM_LTE_L2_BUFFER_STATUS: + case RAL_LINK_PARAM_LTE_PACKET_DELAY: + message_p = itti_alloc_new_message (TASK_RRC_UE, PHY_MEAS_THRESHOLD_REQ); + PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; + memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); + itti_send_msg_to_task (TASK_MAC_UE, ITTI_MSG_INSTANCE(msg_pP), message_p); + break; - case RAL_LINK_PARAM_LTE_AVAILABLE_BW: - case RAL_LINK_PARAM_LTE_PACKET_LOSS_RATE: - case RAL_LINK_PARAM_LTE_L2_BUFFER_STATUS: - case RAL_LINK_PARAM_LTE_PACKET_DELAY: - message_p = itti_alloc_new_message (TASK_RRC_UE, PHY_MEAS_THRESHOLD_REQ); - PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; - memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); - itti_send_msg_to_task (TASK_MAC_UE, ITTI_MSG_INSTANCE(msg_pP), message_p); - break; - - case RAL_LINK_PARAM_LTE_MOBILE_NODE_CAPABILITIES: - case RAL_LINK_PARAM_LTE_EMBMS_CAPABILITY: - case RAL_LINK_PARAM_LTE_JUMBO_FEASIBILITY: - case RAL_LINK_PARAM_LTE_JUMBO_SETUP_STATUS: - case RAL_LINK_PARAM_LTE_NUM_ACTIVE_EMBMS_RECEIVERS_PER_FLOW: + case RAL_LINK_PARAM_LTE_MOBILE_NODE_CAPABILITIES: + case RAL_LINK_PARAM_LTE_EMBMS_CAPABILITY: + case RAL_LINK_PARAM_LTE_JUMBO_FEASIBILITY: + case RAL_LINK_PARAM_LTE_JUMBO_SETUP_STATUS: + case RAL_LINK_PARAM_LTE_NUM_ACTIVE_EMBMS_RECEIVERS_PER_FLOW: #warning "TO DO MIH LTE LINK PARAMS IN RRC UE" - break; + break; - default: - LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_lte %d\n", link_cfg_param_p->link_param_type._union.link_param_lte); - return -1; + default: + LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_lte %d\n", link_cfg_param_p->link_param_type._union.link_param_lte); + return -1; + } + + break; + + default: + LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_type choice %d\n", link_cfg_param_p->link_param_type.choice); + return -1; } + for (ix_thresholds=0; ix_thresholds < link_cfg_param_p->num_thresholds; ix_thresholds++) { + threshold_p = &link_cfg_param_p->thresholds[ix_thresholds]; + } + + break; + + case RAL_TH_ACTION_CANCEL_THRESHOLD: + + // IEEE Std 802.21-2008, Table F4, Data type name=LINK_CFG_PARAM (page 228): + // When “Cancel threshold” is selected and no thresholds are specified, then all + // currently configured thresholds for the given LINK_PARAM_TYPE are cancelled. + if (link_cfg_param_p->num_thresholds == 0) { + rrc_ue_ral_delete_all_thresholds_type(mod_idP, &link_cfg_param_p->link_param_type); + } else { + // + // When “Cancel threshold” is selected and thresholds are specified only those + // configured thresholds for the given LINK_PARAM_TYPE and whose threshold value match what was + // specified are cancelled. + for (ix_thresholds=0; ix_thresholds < link_cfg_param_p->num_thresholds; ix_thresholds++) { + threshold_p = &link_cfg_param_p->thresholds[ix_thresholds]; + rrc_ue_ral_delete_threshold(mod_idP, &link_cfg_param_p->link_param_type, threshold_p); + } + } + + LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ with RAL_TH_ACTION_CANCEL_THRESHOLD\n"); break; default: - LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_type choice %d\n", link_cfg_param_p->link_param_type.choice); + LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown th_action %d\n", link_cfg_param_p->th_action); return -1; - } - - for (ix_thresholds=0; ix_thresholds < link_cfg_param_p->num_thresholds; ix_thresholds++) { - threshold_p = &link_cfg_param_p->thresholds[ix_thresholds]; - } - - break; - - case RAL_TH_ACTION_CANCEL_THRESHOLD: - - // IEEE Std 802.21-2008, Table F4, Data type name=LINK_CFG_PARAM (page 228): - // When “Cancel threshold” is selected and no thresholds are specified, then all - // currently configured thresholds for the given LINK_PARAM_TYPE are cancelled. - if (link_cfg_param_p->num_thresholds == 0) { - rrc_ue_ral_delete_all_thresholds_type(mod_idP, &link_cfg_param_p->link_param_type); - } else { - // - // When “Cancel threshold” is selected and thresholds are specified only those - // configured thresholds for the given LINK_PARAM_TYPE and whose threshold value match what was - // specified are cancelled. - for (ix_thresholds=0; ix_thresholds < link_cfg_param_p->num_thresholds; ix_thresholds++) { - threshold_p = &link_cfg_param_p->thresholds[ix_thresholds]; - rrc_ue_ral_delete_threshold(mod_idP, &link_cfg_param_p->link_param_type, threshold_p); - } - } - - LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ with RAL_TH_ACTION_CANCEL_THRESHOLD\n"); - break; - - default: - LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown th_action %d\n", link_cfg_param_p->th_action); - return -1; } } diff --git a/openair2/RRC/LTE/rrc_common.c b/openair2/RRC/LTE/rrc_common.c index cf0196441e..1744719308 100644 --- a/openair2/RRC/LTE/rrc_common.c +++ b/openair2/RRC/LTE/rrc_common.c @@ -55,9 +55,7 @@ rrc_init_global_param( ) //----------------------------------------------------------------------------- { - rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc - DCCH_LCHAN_DESC.transport_block_size = 4; DCCH_LCHAN_DESC.max_transport_blocks = 16; DCCH_LCHAN_DESC.Delay_class = 1; @@ -67,13 +65,11 @@ rrc_init_global_param( DTCH_UL_LCHAN_DESC.transport_block_size = 52; DTCH_UL_LCHAN_DESC.max_transport_blocks = 20; DTCH_UL_LCHAN_DESC.Delay_class = 1; - Rlc_info_um.rlc_mode = RLC_MODE_UM; Rlc_info_um.rlc.rlc_um_info.timer_reordering = 5; Rlc_info_um.rlc.rlc_um_info.sn_field_length = 10; Rlc_info_um.rlc.rlc_um_info.is_mXch = 0; //Rlc_info_um.rlc.rlc_um_info.sdu_discard_mode=16; - Rlc_info_am_config.rlc_mode = RLC_MODE_AM; Rlc_info_am_config.rlc.rlc_am_info.max_retx_threshold = 50; Rlc_info_am_config.rlc.rlc_am_info.poll_pdu = 8; @@ -81,20 +77,18 @@ rrc_init_global_param( Rlc_info_am_config.rlc.rlc_am_info.t_poll_retransmit = 15; Rlc_info_am_config.rlc.rlc_am_info.t_reordering = 50; Rlc_info_am_config.rlc.rlc_am_info.t_status_prohibit = 10; - return 0; } //----------------------------------------------------------------------------- void rrc_config_buffer( - SRB_INFO* Srb_info, + SRB_INFO *Srb_info, uint8_t Lchan_type, uint8_t Role ) //----------------------------------------------------------------------------- { - Srb_info->Rx_buffer.payload_size = 0; Srb_info->Tx_buffer.payload_size = 0; } @@ -200,7 +194,7 @@ static band_freq bands[] = { { BAND_TYPE_FDD, 3, 1710000000UL, 1785000000UL, 1805000000UL, 1880000000UL }, { BAND_TYPE_FDD, 4, 1710000000UL, 1755000000UL, 2110000000UL, 2155000000UL }, { BAND_TYPE_FDD, 5, 824000000UL, 849000000UL, 869000000UL, 894000000UL }, - /* to remove? */{ BAND_TYPE_FDD, 6, 830000000UL, 840000000UL, 875000000UL, 885000000UL }, + /* to remove? */{ BAND_TYPE_FDD, 6, 830000000UL, 840000000UL, 875000000UL, 885000000UL }, { BAND_TYPE_FDD, 7, 2500000000UL, 2570000000UL, 2620000000UL, 2690000000UL }, { BAND_TYPE_FDD, 8, 880000000UL, 915000000UL, 925000000UL, 960000000UL }, { BAND_TYPE_FDD, 9, 1749900000UL, 1784900000UL, 1844900000UL, 1879900000UL }, @@ -278,17 +272,17 @@ static earfcn earfcn_table[] = { { 42, 3400000000UL, 41590, 41590, 43589, 3400000000UL, 41590, 41590, 43589 }, { 43, 3600000000UL, 43590, 43590, 45589, 3600000000UL, 43590, 43590, 45589 }, }; - -int freq_to_arfcn10(int band, unsigned long freq) -{ - int N = sizeof(earfcn_table) / sizeof(earfcn_table[0]); + +int freq_to_arfcn10(int band, unsigned long freq) { + int N = sizeof(earfcn_table) / sizeof(earfcn_table[0]); int i; - - for (i = 0; i < N; i++) if (bands[i].band == band) break; + + for (i = 0; i < N; i++) if (bands[i].band == band) break; + if (i == N) return -1; - + if (!(bands[i].dl_minfreq < freq && freq < bands[i].dl_maxfreq)) return -1; - + return (freq - earfcn_table[i].dl_flow) / 100000UL + earfcn_table[i].dl_off; } diff --git a/openair2/RRC/LTE/rrc_defs.h b/openair2/RRC/LTE/rrc_defs.h index 9cbef536fc..6019ae2529 100644 --- a/openair2/RRC/LTE/rrc_defs.h +++ b/openair2/RRC/LTE/rrc_defs.h @@ -200,6 +200,8 @@ void *send_UE_status_notification(void *); /* for ImsiMobileIdentity_t */ #include "MobileIdentity.h" +#include "LTE_DRX-Config.h" // Add DRX SSR 2018-11 + /* correct Rel(8|10)/Rel14 differences * the code is in favor of Rel14, those defines do the translation */ diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index f330399901..b70846cc30 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -1118,14 +1118,18 @@ rrc_eNB_process_RRCConnectionSetupComplete( ) //----------------------------------------------------------------------------- { - LOG_I(RRC, - PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing LTE_RRCConnectionSetupComplete from UE (SRB1 Active)\n", + LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing LTE_RRCConnectionSetupComplete from UE (SRB1 Active)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); + ue_context_pP->ue_context.Srb1.Active = 1; ue_context_pP->ue_context.Status = RRC_CONNECTED; - ue_context_pP->ue_context.ue_rrc_inactivity_timer = 1; // set rrc inactivity when UE goes into RRC_CONNECTED - T(T_ENB_RRC_CONNECTION_SETUP_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), - T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + ue_context_pP->ue_context.ue_rrc_inactivity_timer = 1; // set rrc inactivity timer when UE goes into RRC_CONNECTED + + T(T_ENB_RRC_CONNECTION_SETUP_COMPLETE, + T_INT(ctxt_pP->module_id), + T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), + T_INT(ctxt_pP->rnti)); if (EPC_MODE_ENABLED == 1) { // Forward message to S1AP layer @@ -1272,15 +1276,17 @@ rrc_eNB_generate_RRCConnectionReject( } //----------------------------------------------------------------------------- +/* + * Generate a RCC Connection Reestablishment after requested + */ void rrc_eNB_generate_RRCConnectionReestablishment( - const protocol_ctxt_t *const ctxt_pP, - rrc_eNB_ue_context_t *const ue_context_pP, - const int CC_id -) + const protocol_ctxt_t *const ctxt_pP, + rrc_eNB_ue_context_t *const ue_context_pP, + const int CC_id) //----------------------------------------------------------------------------- { - LTE_LogicalChannelConfig_t *SRB1_logicalChannelConfig; +LTE_LogicalChannelConfig_t *SRB1_logicalChannelConfig; LTE_SRB_ToAddModList_t **SRB_configList; LTE_SRB_ToAddMod_t *SRB1_config; int cnt; @@ -1396,6 +1402,7 @@ rrc_eNB_generate_RRCConnectionReestablishment( ue_context_pP->ue_context.ue_reestablishment_timer = 1; // remove UE after 100 frames after LTE_RRCConnectionReestablishmentRelease is triggered ue_context_pP->ue_context.ue_reestablishment_timer_thres = 1000; + } //----------------------------------------------------------------------------- @@ -2775,6 +2782,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons LTE_C_RNTI_t *cba_RNTI = NULL; int x2_enabled; uint8_t xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); //Transaction_id, + uint8_t cc_id = ue_context_pP->ue_context.primaryCC_id; // Add DRX SSR 2018-11 => CC id + LTE_UE_EUTRA_Capability_t *UEcap = ue_context_pP->ue_context.UE_Capability; // Add DRX SSR 2018-12 #ifdef CBA //struct PUSCH_CBAConfigDedicated_vlola *pusch_CBAConfigDedicated_vlola; uint8_t *cba_RNTI_buf; @@ -2931,21 +2940,87 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons maxHARQ_Tx = CALLOC(1, sizeof(long)); *maxHARQ_Tx = LTE_MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5; mac_MainConfig->ul_SCH_Config->maxHARQ_Tx = maxHARQ_Tx; + + /* BSR reconfiguration */ periodicBSR_Timer = CALLOC(1, sizeof(long)); - *periodicBSR_Timer = LTE_PeriodicBSR_Timer_r12_sf64; + *periodicBSR_Timer = LTE_PeriodicBSR_Timer_r12_sf64; //LTE_PeriodicBSR_Timer_r12_infinity; // LTE_PeriodicBSR_Timer_r12_sf64; // LTE_PeriodicBSR_Timer_r12_sf20 mac_MainConfig->ul_SCH_Config->periodicBSR_Timer = periodicBSR_Timer; - mac_MainConfig->ul_SCH_Config->retxBSR_Timer = LTE_RetxBSR_Timer_r12_sf320; + mac_MainConfig->ul_SCH_Config->retxBSR_Timer = LTE_RetxBSR_Timer_r12_sf320; // LTE_RetxBSR_Timer_r12_sf320; // LTE_RetxBSR_Timer_r12_sf5120 mac_MainConfig->ul_SCH_Config->ttiBundling = 0; // FALSE mac_MainConfig->timeAlignmentTimerDedicated = LTE_TimeAlignmentTimer_infinity; - mac_MainConfig->drx_Config = NULL; + + /* PHR reconfiguration */ mac_MainConfig->phr_Config = CALLOC(1, sizeof(*mac_MainConfig->phr_Config)); mac_MainConfig->phr_Config->present = LTE_MAC_MainConfig__phr_Config_PR_setup; - mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20; // sf20 = 20 subframes - mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20; // sf20 = 20 subframes - mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange = LTE_MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1; // Value dB1 =1 dB, dB3 = 3 dB + mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf500; // sf20 = 20 subframes // LTE_MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_infinity + mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf200; // sf20 = 20 subframes // LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf1000 + mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange = LTE_MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB3; // Value dB1 =1 dB, dB3 = 3 dB + + // Begin add DRX SSR 2018-11 + if (rrc_inst->carrier[cc_id].sib1->tdd_Config == NULL) { // CDRX configured in case of FDD + LOG_D(RRC, "Processing the DRX configuration in RRC Connection Reconfiguration\n"); + + /* Process the IE drx_Config */ + if (cc_id < MAX_NUM_CCs) { + mac_MainConfig->drx_Config = do_DrxConfig(ctxt_pP->module_id, cc_id, &rrc_inst->configuration, UEcap); // drx_Config IE + } else { + LOG_E(RRC, "Invalid CC_id for DRX configuration\n"); + } + + /* Set timers and thresholds values in local MAC context of UE */ + eNB_Config_Local_DRX(ctxt_pP->module_id, ue_context_pP->ue_id_rnti, mac_MainConfig->drx_Config); + + /* BEGIN DEBUG LAD*/ + eNB_MAC_INST *eNB_mac = NULL; + UE_list_t *UE_list_mac = NULL; + int UE_id = -1; + UE_sched_ctrl *UE_scheduling_control = NULL; + + eNB_mac = RC.mac[ctxt_pP->module_id]; + UE_list_mac = &eNB_mac->UE_list; + UE_id = find_UE_id(ctxt_pP->module_id, ue_context_pP->ue_id_rnti); + UE_scheduling_control = &(UE_list_mac->UE_sched_ctrl[UE_id]); + + LOG_W(MAC, "Values to check: on_duration_timer = %d ; on_duration_timer_thres = %d \n \ + drx_inactivity_timer = %d ; drx_inactivity_timer_thres = %d \n \ + drx_shortCycle_timer = %d ; drx_shortCycle_timer_thres = %d \n \ + short_drx_cycle_duration = %d ; drx_shortCycle_timer_value = %d \n \ + drx_long_timer = %d ; drx_long_timer_thres = %d \n \ + drx_start_offset = %d ; \n \ + drx_retransmission_timer0 = %d ; drx_retransmission_timer2 = %d ; drx_retransmission_timer4 = %d ; drx_retransmission_timer7 = %d ; \n \ + drx_retransmission_timer_thres0 = %d ; drx_retransmission_timer_thres2 = %d ; drx_retransmission_timer_thres4 = %d ; drx_retransmission_timer_thres7 = %d; \n \ + cqi_mask_boolean = %d ; cdrx_configured = %d\n", + UE_scheduling_control->on_duration_timer, + UE_scheduling_control->on_duration_timer_thres, + UE_scheduling_control->drx_inactivity_timer, + UE_scheduling_control->drx_inactivity_timer_thres, + UE_scheduling_control->drx_shortCycle_timer, + UE_scheduling_control->drx_shortCycle_timer_thres, + UE_scheduling_control->short_drx_cycle_duration, + UE_scheduling_control->drx_shortCycle_timer_value, + UE_scheduling_control->drx_longCycle_timer, + UE_scheduling_control->drx_longCycle_timer_thres, + UE_scheduling_control->drx_start_offset, + UE_scheduling_control->drx_retransmission_timer[0], + UE_scheduling_control->drx_retransmission_timer[2], + UE_scheduling_control->drx_retransmission_timer[4], + UE_scheduling_control->drx_retransmission_timer[7], + UE_scheduling_control->drx_retransmission_timer_thres[0], + UE_scheduling_control->drx_retransmission_timer_thres[2], + UE_scheduling_control->drx_retransmission_timer_thres[4], + UE_scheduling_control->drx_retransmission_timer_thres[7], + UE_scheduling_control->cqi_mask_boolean, + UE_scheduling_control->cdrx_configured); + /* END DEBUG LAD */ + + } else { // CDRX not ready for TDD + mac_MainConfig->drx_Config = NULL; + } + // End add DRX SSR 2018-11 + #if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0)) sr_ProhibitTimer_r9 = CALLOC(1, sizeof(long)); - *sr_ProhibitTimer_r9 = 0; // SR tx on PUCCH, Value in number of SR period(s). Value 0 = no timer for SR, Value 2= 2*SR + *sr_ProhibitTimer_r9 = 0; // SR tx on PUCCH, Value in number of SR period(s). Value 0 = no timer for SR, Value 2 = 2*SR mac_MainConfig->ext1 = CALLOC(1, sizeof(struct LTE_MAC_MainConfig__ext1)); mac_MainConfig->ext1->sr_ProhibitTimer_r9 = sr_ProhibitTimer_r9; //sps_RA_ConfigList_rlola = NULL; @@ -3000,18 +3075,34 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons LOG_E(RRC,"antenna_info not present in physical_config_dedicated. Not reconfiguring!\n"); } - if ((*physicalConfigDedicated)->cqi_ReportConfig) { - if ((rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode==LTE_AntennaInfoDedicated__transmissionMode_tm4) || - (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode==LTE_AntennaInfoDedicated__transmissionMode_tm5) || - (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode==LTE_AntennaInfoDedicated__transmissionMode_tm6)) { - //feedback mode needs to be set as well - //TODO: I think this is taken into account in the PHY automatically based on the transmission mode variable - printf("setting cqi reporting mode to rm31\n"); + /* CSI RRC Reconfiguration */ + if ((*physicalConfigDedicated)->cqi_ReportConfig != NULL) { + if ((rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode == LTE_AntennaInfoDedicated__transmissionMode_tm4) || + (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode == LTE_AntennaInfoDedicated__transmissionMode_tm5) || + (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode == LTE_AntennaInfoDedicated__transmissionMode_tm6)) { + + // feedback mode needs to be set as well + // TODO: I think this is taken into account in the PHY automatically based on the transmission mode variable + LOG_I(RRC, "Setting cqi reporting mode to rm31 (hardcoded)\n"); + #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) - *((*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportModeAperiodic)=LTE_CQI_ReportModeAperiodic_rm31; + *((*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportModeAperiodic) = LTE_CQI_ReportModeAperiodic_rm31; // HLC CQI, single PMI #else - *((*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportModeAperiodic)=LTE_CQI_ReportConfig__cqi_ReportModeAperiodic_rm31; // HLC CQI, no PMI + *((*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportModeAperiodic) = LTE_CQI_ReportConfig__cqi_ReportModeAperiodic_rm31; // HLC CQI, single PMI #endif + /* For testing with CDRX */ + /* Periodic report can't work because NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE is not supported yet! */ + /* + (*physicalConfigDedicated)->cqi_ReportConfig->nomPDSCH_RS_EPRE_Offset = 0; // 0 dB + (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic = CALLOC(1, sizeof((*(*physicalConfigDedicated)).cqi_ReportConfig->cqi_ReportPeriodic)); + (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->present = LTE_CQI_ReportPeriodic_PR_setup; + (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex = 0; // n2_pucch + (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex = 17; // I_cqi/pmi: 17 => 20ms + (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present = LTE_CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI; // subband CQI + (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.choice.subbandCQI.k = 4; + (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex = NULL; + (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.simultaneousAckNackAndCQI = 0; + */ } } else { LOG_E(RRC,"cqi_ReportConfig not present in physical_config_dedicated. Not reconfiguring!\n"); @@ -3635,13 +3726,15 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt LOG_E(RRC,"antenna_info not present in physical_config_dedicated. Not reconfiguring!\n"); } - if ((*physicalConfigDedicated)->cqi_ReportConfig) { - if ((rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode==LTE_AntennaInfoDedicated__transmissionMode_tm4) || - (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode==LTE_AntennaInfoDedicated__transmissionMode_tm5) || - (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode==LTE_AntennaInfoDedicated__transmissionMode_tm6)) { - //feedback mode needs to be set as well - //TODO: I think this is taken into account in the PHY automatically based on the transmission mode variable - printf("setting cqi reporting mode to rm31\n"); + /* CSI Configuration through RRC */ + if ((*physicalConfigDedicated)->cqi_ReportConfig != NULL) { + if ((rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode == LTE_AntennaInfoDedicated__transmissionMode_tm4) || + (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode == LTE_AntennaInfoDedicated__transmissionMode_tm5) || + (rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode == LTE_AntennaInfoDedicated__transmissionMode_tm6)) { + //feedback mode needs to be set as well + //TODO: I think this is taken into account in the PHY automatically based on the transmission mode variable + LOG_I(RRC, "Setting cqi aperiodic reporting mode to rm31 (hardcoded)\n"); + #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) *((*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportModeAperiodic)=LTE_CQI_ReportModeAperiodic_rm31; #else @@ -5378,88 +5471,93 @@ rrc_eNB_configure_rbs_handover(struct rrc_eNB_ue_context_s *ue_context_p, protoc //----------------------------------------------------------------------------- /* -* TODO: * add function description -* * format the function correctly +* Process the RRC Connection Reconfiguration Complete from the UE */ void rrc_eNB_process_RRCConnectionReconfigurationComplete( const protocol_ctxt_t *const ctxt_pP, - rrc_eNB_ue_context_t *ue_context_pP, + rrc_eNB_ue_context_t *ue_context_pP, const uint8_t xid ) //----------------------------------------------------------------------------- { - int i, drb_id; + int drb_id; int oip_ifup = 0; int dest_ip_offset = 0; uint8_t *kRRCenc = NULL; uint8_t *kRRCint = NULL; uint8_t *kUPenc = NULL; + LTE_DRB_ToAddModList_t *DRB_configList = ue_context_pP->ue_context.DRB_configList2[xid]; + LTE_SRB_ToAddModList_t *SRB_configList = ue_context_pP->ue_context.SRB_configList2[xid]; + LTE_DRB_ToReleaseList_t *DRB_Release_configList2 = ue_context_pP->ue_context.DRB_Release_configList2[xid]; + LTE_DRB_Identity_t *drb_id_p = NULL; + ue_context_pP->ue_context.ue_reestablishment_timer = 0; - LTE_DRB_ToAddModList_t *DRB_configList = ue_context_pP->ue_context.DRB_configList2[xid]; - LTE_SRB_ToAddModList_t *SRB_configList = ue_context_pP->ue_context.SRB_configList2[xid]; - LTE_DRB_ToReleaseList_t *DRB_Release_configList2 = ue_context_pP->ue_context.DRB_Release_configList2[xid]; - LTE_DRB_Identity_t *drb_id_p = NULL; - T(T_ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), - T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + ue_context_pP->ue_context.ue_rrc_inactivity_timer = 1; // reset rrc inactivity timer + + /* CDRX: activated */ + int UE_id_mac = find_UE_id(ctxt_pP->module_id, ue_context_pP->ue_context.rnti); + RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id_mac].bypass_cdrx = FALSE; + + T(T_ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE, + T_INT(ctxt_pP->module_id), + T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), + T_INT(ctxt_pP->rnti)); /* Derive the keys from kenb */ if (DRB_configList != NULL) { derive_key_up_enc(ue_context_pP->ue_context.ciphering_algorithm, - ue_context_pP->ue_context.kenb, &kUPenc); + ue_context_pP->ue_context.kenb, + &kUPenc); } derive_key_rrc_enc(ue_context_pP->ue_context.ciphering_algorithm, - ue_context_pP->ue_context.kenb, &kRRCenc); - derive_key_rrc_int(ue_context_pP->ue_context.integrity_algorithm, - ue_context_pP->ue_context.kenb, &kRRCint); - // Refresh SRBs/DRBs - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_PDCP_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security unchanged)", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti); - rrc_pdcp_config_asn1_req( - ctxt_pP, - SRB_configList, //NULL, //LG-RK 14/05/2014 SRB_configList, - DRB_configList, - // (LTE_DRB_ToReleaseList_t *) NULL, - DRB_Release_configList2, - /*RC.rrc[ctxt_pP->module_id]->ciphering_algorithm[ue_mod_idP] | - (RC.rrc[ctxt_pP->module_id]->integrity_algorithm[ue_mod_idP] << 4), - */ - 0xff, // already configured during the securitymodecommand - kRRCenc, - kRRCint, - kUPenc -#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0)) - , (LTE_PMCH_InfoList_r9_t *) NULL -#endif - ,NULL); - // Refresh SRBs/DRBs - rrc_rlc_config_asn1_req( - ctxt_pP, - SRB_configList, // NULL, //LG-RK 14/05/2014 SRB_configList, - DRB_configList, - // (LTE_DRB_ToReleaseList_t *) NULL - DRB_Release_configList2 -#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0)) - , (LTE_PMCH_InfoList_r9_t *) NULL - , 0, 0 -#endif - ); + ue_context_pP->ue_context.kenb, + &kRRCenc); - // set the SRB active in Ue context + derive_key_rrc_int(ue_context_pP->ue_context.integrity_algorithm, + ue_context_pP->ue_context.kenb, + &kRRCint); + + /* Refresh SRBs/DRBs */ + MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_PDCP_ENB, NULL, 0, MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security unchanged)", + MSC_AS_TIME_ARGS(ctxt_pP), + ue_context_pP->ue_context.rnti); + + rrc_pdcp_config_asn1_req(ctxt_pP, + SRB_configList, // NULL, + DRB_configList, + DRB_Release_configList2, + 0xff, // already configured during the securitymodecommand + kRRCenc, + kRRCint, + kUPenc +#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0)) + , (LTE_PMCH_InfoList_r9_t *) NULL +#endif + , NULL); + + /* Refresh SRBs/DRBs */ + rrc_rlc_config_asn1_req(ctxt_pP, + SRB_configList, // NULL, + DRB_configList, + DRB_Release_configList2 +#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0)) + , (LTE_PMCH_InfoList_r9_t *) NULL, + 0, + 0 +#endif + ); + + /* Set the SRB active in UE context */ if (SRB_configList != NULL) { - for (i = 0; (i < SRB_configList->list.count) && (i < 3); i++) { - if (SRB_configList->list.array[i]->srb_Identity == 1 ) { - ue_context_pP->ue_context.Srb1.Active=1; - } else if (SRB_configList->list.array[i]->srb_Identity == 2 ) { - ue_context_pP->ue_context.Srb2.Active=1; - ue_context_pP->ue_context.Srb2.Srb_info.Srb_id=2; + for (int i = 0; (i < SRB_configList->list.count) && (i < 3); i++) { + if (SRB_configList->list.array[i]->srb_Identity == 1) { + ue_context_pP->ue_context.Srb1.Active = 1; + } else if (SRB_configList->list.array[i]->srb_Identity == 2) { + ue_context_pP->ue_context.Srb2.Active = 1; + ue_context_pP->ue_context.Srb2.Srb_info.Srb_id = 2; LOG_I(RRC,"[eNB %d] Frame %d CC %d : SRB2 is now active\n", ctxt_pP->module_id, ctxt_pP->frame, @@ -5477,22 +5575,21 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ue_context_pP->ue_context.SRB_configList2[xid] = NULL; } - // Loop through DRBs and establish if necessary - + /* Loop through DRBs and establish if necessary */ if (DRB_configList != NULL) { - for (i = 0; i < DRB_configList->list.count; i++) { // num max DRB (11-3-8) + for (int i = 0; i < DRB_configList->list.count; i++) { // num max DRB (11-3-8) if (DRB_configList->list.array[i]) { drb_id = (int)DRB_configList->list.array[i]->drb_Identity; - LOG_I(RRC, - "[eNB %d] Frame %d : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete from UE rnti %x, reconfiguring DRB %d/LCID %d\n", + + LOG_I(RRC, "[eNB %d] Frame %d : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete from UE rnti %x, reconfiguring DRB %d/LCID %d\n", ctxt_pP->module_id, ctxt_pP->frame, ctxt_pP->rnti, (int)DRB_configList->list.array[i]->drb_Identity, (int)*DRB_configList->list.array[i]->logicalChannelIdentity); - // for pre-ci tests - LOG_I(RRC, - "[eNB %d] Frame %d : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete from UE %u, reconfiguring DRB %d/LCID %d\n", + + /* For pre-ci tests */ + LOG_I(RRC, "[eNB %d] Frame %d : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete from UE %u, reconfiguring DRB %d/LCID %d\n", ctxt_pP->module_id, ctxt_pP->frame, oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[ctxt_pP->module_id][ue_context_pP->local_uid], @@ -5500,13 +5597,6 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( (int)*DRB_configList->list.array[i]->logicalChannelIdentity); if (ue_context_pP->ue_context.DRB_active[drb_id] == 0) { - /* - rrc_pdcp_config_req (ctxt_pP->module_id, frameP, 1, CONFIG_ACTION_ADD, - (ue_mod_idP * NB_RB_MAX) + *DRB_configList->list.array[i]->logicalChannelIdentity,UNDEF_SECURITY_MODE); - rrc_rlc_config_req(ctxt_pP->module_id,frameP,1,CONFIG_ACTION_ADD, - (ue_mod_idP * NB_RB_MAX) + (int)*RC.rrc[ctxt_pP->module_id]->DRB_config[ue_mod_idP][i]->logicalChannelIdentity, - RADIO_ACCESS_BEARER,Rlc_info_um); - */ ue_context_pP->ue_context.DRB_active[drb_id] = 1; LOG_D(RRC, "[eNB %d] Frame %d: Establish RLC UM Bidirectional, DRB %d Active\n", @@ -5550,67 +5640,14 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->logicalChannelIdentity; } - if (NODE_IS_MONOLITHIC(RC.rrc[ctxt_pP->module_id]->node_type)) { - rrc_mac_config_req_eNB(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - 0,0,0,0,0, -#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) - 0, -#endif - ue_context_pP->ue_context.rnti, - (LTE_BCCH_BCH_Message_t *) NULL, - (LTE_RadioResourceConfigCommonSIB_t *) NULL, -#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) - (LTE_RadioResourceConfigCommonSIB_t *) NULL, -#endif - ue_context_pP->ue_context.physicalConfigDedicated, -#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) - (LTE_SCellToAddMod_r10_t *)NULL, - //(struct LTE_PhysicalConfigDedicatedSCell_r10 *)NULL, -#endif - (LTE_MeasObjectToAddMod_t **) NULL, - ue_context_pP->ue_context.mac_MainConfig, - DRB2LCHAN[i], - DRB_configList->list.array[i]->logicalChannelConfig, - ue_context_pP->ue_context.measGapConfig, - (LTE_TDD_Config_t *) NULL, - NULL, - (LTE_SchedulingInfoList_t *) NULL, - 0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL -#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0)) - , 0, (LTE_MBSFN_AreaInfoList_r9_t *) NULL, (LTE_PMCH_InfoList_r9_t *) NULL -#endif -#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0)) - , - (LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL -#endif - ); - } - } else { // remove LCHAN from MAC/PHY - - if (ue_context_pP->ue_context.DRB_active[drb_id] == 1) { - // DRB has just been removed so remove RLC + PDCP for DRB - /* rrc_pdcp_config_req (ctxt_pP->module_id, frameP, 1, CONFIG_ACTION_REMOVE, - (ue_mod_idP * NB_RB_MAX) + DRB2LCHAN[i],UNDEF_SECURITY_MODE); - */ - if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) { - rrc_rlc_config_req(ctxt_pP, - SRB_FLAG_NO, - MBMS_FLAG_NO, - CONFIG_ACTION_REMOVE, - DRB2LCHAN[i], - Rlc_info_um); - } - } - - ue_context_pP->ue_context.DRB_active[drb_id] = 0; - LOG_D(RRC, - PROTOCOL_RRC_CTXT_UE_FMT" RRC_eNB --- MAC_CONFIG_REQ (DRB) ---> MAC_eNB\n", - PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); - if (NODE_IS_MONOLITHIC(RC.rrc[ctxt_pP->module_id]->node_type)) { + if (NODE_IS_MONOLITHIC(RC.rrc[ctxt_pP->module_id]->node_type)) { rrc_mac_config_req_eNB(ctxt_pP->module_id, ue_context_pP->ue_context.primaryCC_id, - 0,0,0,0,0, + 0, + 0, + 0, + 0, + 0, #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) 0, #endif @@ -5623,7 +5660,70 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ue_context_pP->ue_context.physicalConfigDedicated, #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) (LTE_SCellToAddMod_r10_t *)NULL, - //(struct LTE_PhysicalConfigDedicatedSCell_r10 *)NULL, +#endif + (LTE_MeasObjectToAddMod_t **) NULL, + ue_context_pP->ue_context.mac_MainConfig, + DRB2LCHAN[i], + DRB_configList->list.array[i]->logicalChannelConfig, + ue_context_pP->ue_context.measGapConfig, + (LTE_TDD_Config_t *) NULL, + NULL, + (LTE_SchedulingInfoList_t *) NULL, + 0, + NULL, + NULL, + (LTE_MBSFN_SubframeConfigList_t *) NULL +#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0)) + , 0, + (LTE_MBSFN_AreaInfoList_r9_t *) NULL, + (LTE_PMCH_InfoList_r9_t *) NULL +#endif +#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0)) + , + (LTE_SystemInformationBlockType1_v1310_IEs_t *) NULL +#endif + ); + } + } else { // end if (ue_context_pP->ue_context.DRB_active[drb_id] == 0) // remove LCHAN from MAC/PHY + if (ue_context_pP->ue_context.DRB_active[drb_id] == 1) { + // DRB has just been removed so remove RLC + PDCP for DRB + /* rrc_pdcp_config_req (ctxt_pP->module_id, frameP, 1, CONFIG_ACTION_REMOVE, + (ue_mod_idP * NB_RB_MAX) + DRB2LCHAN[i],UNDEF_SECURITY_MODE); + */ + if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) { + rrc_rlc_config_req(ctxt_pP, + SRB_FLAG_NO, + MBMS_FLAG_NO, + CONFIG_ACTION_REMOVE, + DRB2LCHAN[i], + Rlc_info_um); + } + } + + ue_context_pP->ue_context.DRB_active[drb_id] = 0; + + LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RRC_eNB --- MAC_CONFIG_REQ (DRB) ---> MAC_eNB\n", + PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); + if (NODE_IS_MONOLITHIC(RC.rrc[ctxt_pP->module_id]->node_type)) { + rrc_mac_config_req_eNB(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + 0, + 0, + 0, + 0, + 0, +#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) + 0, +#endif + ue_context_pP->ue_context.rnti, + (LTE_BCCH_BCH_Message_t *) NULL, + (LTE_RadioResourceConfigCommonSIB_t *) NULL, +#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) + (LTE_RadioResourceConfigCommonSIB_t *) NULL, +#endif + ue_context_pP->ue_context.physicalConfigDedicated, +#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) + (LTE_SCellToAddMod_r10_t *) NULL, #endif (LTE_MeasObjectToAddMod_t **) NULL, ue_context_pP->ue_context.mac_MainConfig, @@ -5633,25 +5733,32 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( (LTE_TDD_Config_t *) NULL, NULL, (LTE_SchedulingInfoList_t *) NULL, - 0, NULL, NULL, NULL + 0, + NULL, + NULL, + NULL #if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0)) - , 0, (LTE_MBSFN_AreaInfoList_r9_t *) NULL, (LTE_PMCH_InfoList_r9_t *) NULL + , + 0, + (LTE_MBSFN_AreaInfoList_r9_t *) NULL, + (LTE_PMCH_InfoList_r9_t *) NULL #endif #if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0)) , - (LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL + (LTE_SystemInformationBlockType1_v1310_IEs_t *) NULL #endif - ); + ); } - } - } - } + } // end else of if (ue_context_pP->ue_context.DRB_active[drb_id] == 0) + } // end if (DRB_configList->list.array[i]) + } // end for (int i = 0; i < DRB_configList->list.count; i++) + free(DRB_configList); ue_context_pP->ue_context.DRB_configList2[xid] = NULL; - } + } // end if DRB_configList != NULL if(DRB_Release_configList2 != NULL) { - for (i = 0; i < DRB_Release_configList2->list.count; i++) { + for (int i = 0; i < DRB_Release_configList2->list.count; i++) { if (DRB_Release_configList2->list.array[i]) { drb_id_p = DRB_Release_configList2->list.array[i]; drb_id = *drb_id_p; @@ -5668,10 +5775,12 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( } //----------------------------------------------------------------------------- -void rrc_eNB_generate_RRCConnectionSetup(const protocol_ctxt_t *const ctxt_pP, - rrc_eNB_ue_context_t *const ue_context_pP, - const int CC_id - ) +void +rrc_eNB_generate_RRCConnectionSetup( + const protocol_ctxt_t *const ctxt_pP, + rrc_eNB_ue_context_t *const ue_context_pP, + const int CC_id +) //----------------------------------------------------------------------------- { #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) @@ -5680,27 +5789,30 @@ void rrc_eNB_generate_RRCConnectionSetup(const protocol_ctxt_t *const ctxt_pP, LTE_LogicalChannelConfig_t *SRB1_logicalChannelConfig; //,*SRB2_logicalChannelConfig; LTE_SRB_ToAddModList_t **SRB_configList; LTE_SRB_ToAddMod_t *SRB1_config; - int cnt; - MessageDef *message_p; + + MessageDef *message_p; - 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)); + 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)); eNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context; - SRB_configList = &ue_p->SRB_configList; + #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) if (is_mtc) { ue_p->Srb0.Tx_buffer.payload_size = do_RRCConnectionSetup_BR(ctxt_pP, - ue_context_pP, - CC_id, - (uint8_t *) ue_p->Srb0.Tx_buffer.Payload, - (const uint8_t) RC.rrc[ctxt_pP->module_id]->carrier[CC_id].p_eNB, //at this point we do not have the UE capability information, so it can only be TM1 or TM2 - rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id), - SRB_configList, - &ue_context_pP->ue_context.physicalConfigDedicated); + ue_context_pP, + CC_id, + (uint8_t *) ue_p->Srb0.Tx_buffer.Payload, + (const uint8_t) RC.rrc[ctxt_pP->module_id]->carrier[CC_id].p_eNB, //at this point we do not have the UE capability information, so it can only be TM1 or TM2 + rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id), + SRB_configList, + &ue_context_pP->ue_context.physicalConfigDedicated); } else #endif { @@ -5749,66 +5861,66 @@ void rrc_eNB_generate_RRCConnectionSetup(const protocol_ctxt_t *const ctxt_pP, case ngran_ng_eNB : case ngran_gNB : - if (*SRB_configList != NULL) { - for (cnt = 0; cnt < (*SRB_configList)->list.count; cnt++) { - if ((*SRB_configList)->list.array[cnt]->srb_Identity == 1) { - SRB1_config = (*SRB_configList)->list.array[cnt]; + if (*SRB_configList != NULL) { + for (int cnt = 0; cnt < (*SRB_configList)->list.count; cnt++) { + if ((*SRB_configList)->list.array[cnt]->srb_Identity == 1) { + SRB1_config = (*SRB_configList)->list.array[cnt]; - if (SRB1_config->logicalChannelConfig) { - if (SRB1_config->logicalChannelConfig->present == - LTE_SRB_ToAddMod__logicalChannelConfig_PR_explicitValue) { - SRB1_logicalChannelConfig = &SRB1_config->logicalChannelConfig->choice.explicitValue; - } else { - SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue; - } - } else { - SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue; - } + if (SRB1_config->logicalChannelConfig) { + if (SRB1_config->logicalChannelConfig->present == + LTE_SRB_ToAddMod__logicalChannelConfig_PR_explicitValue) { + SRB1_logicalChannelConfig = &SRB1_config->logicalChannelConfig->choice.explicitValue; + } else { + SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue; + } + } else { + SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue; + } - LOG_D(RRC, - PROTOCOL_RRC_CTXT_UE_FMT" RRC_eNB --- MAC_CONFIG_REQ (SRB1) ---> MAC_eNB\n", - PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); - if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB) { - rrc_mac_config_req_eNB(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - 0,0,0,0,0, + LOG_D(RRC, + PROTOCOL_RRC_CTXT_UE_FMT" RRC_eNB --- MAC_CONFIG_REQ (SRB1) ---> MAC_eNB\n", + PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); + if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB) { + rrc_mac_config_req_eNB(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + 0,0,0,0,0, #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) - 0, + 0, #endif - ue_context_pP->ue_context.rnti, - (LTE_BCCH_BCH_Message_t *) NULL, - (LTE_RadioResourceConfigCommonSIB_t *) NULL, + ue_context_pP->ue_context.rnti, + (LTE_BCCH_BCH_Message_t *) NULL, + (LTE_RadioResourceConfigCommonSIB_t *) NULL, #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) - (LTE_RadioResourceConfigCommonSIB_t *) NULL, + (LTE_RadioResourceConfigCommonSIB_t *) NULL, #endif - ue_context_pP->ue_context.physicalConfigDedicated, + ue_context_pP->ue_context.physicalConfigDedicated, #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) - (LTE_SCellToAddMod_r10_t *)NULL, - //(struct LTE_PhysicalConfigDedicatedSCell_r10 *)NULL, + (LTE_SCellToAddMod_r10_t *)NULL, + //(struct LTE_PhysicalConfigDedicatedSCell_r10 *)NULL, #endif - (LTE_MeasObjectToAddMod_t **) NULL, - ue_context_pP->ue_context.mac_MainConfig, - 1, - SRB1_logicalChannelConfig, - ue_context_pP->ue_context.measGapConfig, - (LTE_TDD_Config_t *) NULL, - NULL, - (LTE_SchedulingInfoList_t *) NULL, - 0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL + (LTE_MeasObjectToAddMod_t **) NULL, + ue_context_pP->ue_context.mac_MainConfig, + 1, + SRB1_logicalChannelConfig, + ue_context_pP->ue_context.measGapConfig, + (LTE_TDD_Config_t *) NULL, + NULL, + (LTE_SchedulingInfoList_t *) NULL, + 0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL #if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0)) - , 0, (LTE_MBSFN_AreaInfoList_r9_t *) NULL, (LTE_PMCH_InfoList_r9_t *) NULL + , 0, (LTE_MBSFN_AreaInfoList_r9_t *) NULL, (LTE_PMCH_InfoList_r9_t *) NULL #endif #if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0)) - , - (LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL + , + (LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL #endif ); } } } - break; - default : + break; + default : LOG_W(RRC, "Unknown node type %d\n", RC.rrc[ctxt_pP->module_id]->node_type); } @@ -5828,11 +5940,13 @@ void rrc_eNB_generate_RRCConnectionSetup(const protocol_ctxt_t *const ctxt_pP, PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), ue_p->Srb0.Tx_buffer.payload_size); - //ue_context_pP->ue_context.ue_release_timer_thres=100; // activate release timer, if RRCSetupComplete not received after 100 frames, remove UE - ue_context_pP->ue_context.ue_release_timer=1; - // remove UE after 10 frames after RRCConnectionRelease is triggered - ue_context_pP->ue_context.ue_release_timer_thres=1000; + ue_context_pP->ue_context.ue_release_timer = 1; + // remove UE after 10 frames after RRCConnectionRelease is triggered + ue_context_pP->ue_context.ue_release_timer_thres = 1000; + + /* init timers */ + ue_context_pP->ue_context.ue_rrc_inactivity_timer = 0; } } diff --git a/openair2/RRC/LTE/rrc_eNB_UE_context.c b/openair2/RRC/LTE/rrc_eNB_UE_context.c index 646939b8dc..197aedae51 100644 --- a/openair2/RRC/LTE/rrc_eNB_UE_context.c +++ b/openair2/RRC/LTE/rrc_eNB_UE_context.c @@ -41,7 +41,7 @@ //------------------------------------------------------------------------------ void uid_linear_allocator_init( - uid_allocator_t* const uid_pP + uid_allocator_t *const uid_pP ) //------------------------------------------------------------------------------ { @@ -51,14 +51,14 @@ uid_linear_allocator_init( //------------------------------------------------------------------------------ uid_t uid_linear_allocator_new( - eNB_RRC_INST* const rrc_instance_pP + eNB_RRC_INST *const rrc_instance_pP ) //------------------------------------------------------------------------------ { unsigned int i; unsigned int bit_index = 1; uid_t uid = 0; - uid_allocator_t* uia_p = &rrc_instance_pP->uid_allocator; + uid_allocator_t *uia_p = &rrc_instance_pP->uid_allocator; for (i=0; i < UID_LINEAR_ALLOCATOR_BITMAP_SIZE; i++) { if (uia_p->bitmap[i] != UINT_MAX) { @@ -82,7 +82,7 @@ uid_linear_allocator_new( //------------------------------------------------------------------------------ void uid_linear_allocator_free( - eNB_RRC_INST* rrc_instance_pP, + eNB_RRC_INST *rrc_instance_pP, uid_t uidP ) //------------------------------------------------------------------------------ @@ -99,7 +99,7 @@ uid_linear_allocator_free( //------------------------------------------------------------------------------ int rrc_eNB_compare_ue_rnti_id( - struct rrc_eNB_ue_context_s* c1_pP, struct rrc_eNB_ue_context_s* c2_pP) + struct rrc_eNB_ue_context_s *c1_pP, struct rrc_eNB_ue_context_s *c2_pP) //------------------------------------------------------------------------------ { if (c1_pP->ue_id_rnti > c2_pP->ue_id_rnti) { @@ -120,14 +120,14 @@ RB_GENERATE(rrc_ue_tree_s, rrc_eNB_ue_context_s, entries, //------------------------------------------------------------------------------ -struct rrc_eNB_ue_context_s* +struct rrc_eNB_ue_context_s * rrc_eNB_allocate_new_UE_context( - eNB_RRC_INST* rrc_instance_pP + eNB_RRC_INST *rrc_instance_pP ) //------------------------------------------------------------------------------ { - struct rrc_eNB_ue_context_s* new_p; - new_p = (struct rrc_eNB_ue_context_s* )malloc(sizeof(struct rrc_eNB_ue_context_s)); + struct rrc_eNB_ue_context_s *new_p; + new_p = (struct rrc_eNB_ue_context_s * )malloc(sizeof(struct rrc_eNB_ue_context_s)); if (new_p == NULL) { LOG_E(RRC, "Cannot allocate new ue context\n"); @@ -136,18 +136,20 @@ rrc_eNB_allocate_new_UE_context( memset(new_p, 0, sizeof(struct rrc_eNB_ue_context_s)); new_p->local_uid = uid_linear_allocator_new(rrc_instance_pP); + for(int i = 0; i < NB_RB_MAX; i++) { - new_p->ue_context.e_rab[i].xid = -1; - new_p->ue_context.modify_e_rab[i].xid = -1; + new_p->ue_context.e_rab[i].xid = -1; + new_p->ue_context.modify_e_rab[i].xid = -1; } + return new_p; } //------------------------------------------------------------------------------ -struct rrc_eNB_ue_context_s* +struct rrc_eNB_ue_context_s * rrc_eNB_get_ue_context( - eNB_RRC_INST* rrc_instance_pP, + eNB_RRC_INST *rrc_instance_pP, rnti_t rntiP) //------------------------------------------------------------------------------ { @@ -157,6 +159,7 @@ rrc_eNB_get_ue_context( temp.ue_id_rnti = rntiP; struct rrc_eNB_ue_context_s *ue_context_p = NULL; ue_context_p = RB_FIND(rrc_ue_tree_s, &rrc_instance_pP->rrc_ue_head, &temp); + if ( ue_context_p != NULL) { return ue_context_p; } else { @@ -172,9 +175,9 @@ rrc_eNB_get_ue_context( //------------------------------------------------------------------------------ void rrc_eNB_remove_ue_context( - const protocol_ctxt_t* const ctxt_pP, - eNB_RRC_INST* rrc_instance_pP, - struct rrc_eNB_ue_context_s* ue_context_pP) + const protocol_ctxt_t *const ctxt_pP, + eNB_RRC_INST *rrc_instance_pP, + struct rrc_eNB_ue_context_s *ue_context_pP) //------------------------------------------------------------------------------ { if (rrc_instance_pP == NULL) { @@ -190,12 +193,10 @@ void rrc_eNB_remove_ue_context( } RB_REMOVE(rrc_ue_tree_s, &rrc_instance_pP->rrc_ue_head, ue_context_pP); - MSC_LOG_EVENT( MSC_RRC_ENB, "0 Removed UE %"PRIx16" ", ue_context_pP->ue_context.rnti); - rrc_eNB_free_mem_UE_context(ctxt_pP, ue_context_pP); uid_linear_allocator_free(rrc_instance_pP, ue_context_pP->local_uid); free(ue_context_pP); diff --git a/openair2/RRC/LTE/rrc_eNB_ral.c b/openair2/RRC/LTE/rrc_eNB_ral.c index db20eb4a28..4820e84dc0 100644 --- a/openair2/RRC/LTE/rrc_eNB_ral.c +++ b/openair2/RRC/LTE/rrc_eNB_ral.c @@ -46,8 +46,7 @@ int rrc_enb_ral_delete_all_thresholds_type(unsigned int mod_idP, ral_link_param_ rrc_ral_threshold_key_t *keys = NULL; unsigned int num_keys = 0; int return_code = 0; - - rc = obj_hashtable_get_keys(eNB_rrc_inst[mod_idP].ral_meas_thresholds, (void*)&keys, &num_keys); + rc = obj_hashtable_get_keys(eNB_rrc_inst[mod_idP].ral_meas_thresholds, (void *)&keys, &num_keys); if (rc == HASH_TABLE_OK) { key = keys; @@ -82,10 +81,9 @@ int rrc_enb_ral_delete_threshold(unsigned int mod_idP, ral_link_param_type_t *pa { hashtable_rc_t rc; rrc_ral_threshold_key_t ref_key; - memcpy(&ref_key.link_param_type, param_type_pP, sizeof(ral_link_param_type_t)); memcpy(&ref_key.threshold, threshold_pP, sizeof(ral_threshold_t)); - rc = obj_hashtable_remove (eNB_rrc_inst[mod_idP].ral_meas_thresholds, (void*)&ref_key, sizeof(rrc_ral_threshold_key_t)); + rc = obj_hashtable_remove (eNB_rrc_inst[mod_idP].ral_meas_thresholds, (void *)&ref_key, sizeof(rrc_ral_threshold_key_t)); if (rc == HASH_TABLE_OK) { return 0; @@ -106,134 +104,130 @@ int rrc_enb_ral_handle_configure_threshold_request(unsigned int mod_idP, Message MessageDef *message_p = NULL; unsigned int ix_param = 0; unsigned int ix_thresholds = 0; - DevAssert(msg_pP != NULL); - LOG_I(RRC, "[eNB %d] Received %s\n", mod_idP, ITTI_MSG_NAME (msg_pP)); configure_threshold_req_p = &RRC_RAL_CONFIGURE_THRESHOLD_REQ(msg_pP); - transaction_id = configure_threshold_req_p->transaction_id; for (ix_param = 0; ix_param < configure_threshold_req_p->num_link_cfg_params; ix_param++) { link_cfg_param_p = &configure_threshold_req_p->link_cfg_params[ix_param]; switch (link_cfg_param_p->th_action) { - case RAL_TH_ACTION_SET_NORMAL_THRESHOLD: - case RAL_TH_ACTION_SET_ONE_SHOT_THRESHOLD: - switch (link_cfg_param_p->link_param_type.choice) { + case RAL_TH_ACTION_SET_NORMAL_THRESHOLD: + case RAL_TH_ACTION_SET_ONE_SHOT_THRESHOLD: + switch (link_cfg_param_p->link_param_type.choice) { + case RAL_LINK_PARAM_TYPE_CHOICE_GEN: + switch (link_cfg_param_p->link_param_type._union.link_param_gen) { + case RAL_LINK_PARAM_GEN_DATA_RATE: + case RAL_LINK_PARAM_GEN_SIGNAL_STRENGTH: + case RAL_LINK_PARAM_GEN_SINR: + case RAL_LINK_PARAM_GEN_THROUGHPUT: + case RAL_LINK_PARAM_GEN_PACKET_ERROR_RATE: + message_p = itti_alloc_new_message (TASK_RRC_ENB, PHY_MEAS_THRESHOLD_REQ); + PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; + memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); + itti_send_msg_to_task (TASK_PHY_ENB, ITTI_MSG_INSTANCE(msg_pP), message_p); + break; - case RAL_LINK_PARAM_TYPE_CHOICE_GEN: - switch (link_cfg_param_p->link_param_type._union.link_param_gen) { - case RAL_LINK_PARAM_GEN_DATA_RATE: - case RAL_LINK_PARAM_GEN_SIGNAL_STRENGTH: - case RAL_LINK_PARAM_GEN_SINR: - case RAL_LINK_PARAM_GEN_THROUGHPUT: - case RAL_LINK_PARAM_GEN_PACKET_ERROR_RATE: - message_p = itti_alloc_new_message (TASK_RRC_ENB, PHY_MEAS_THRESHOLD_REQ); - PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; - memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); - itti_send_msg_to_task (TASK_PHY_ENB, ITTI_MSG_INSTANCE(msg_pP), message_p); - break; + default: + LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_gen %d\n", link_cfg_param_p->link_param_type._union.link_param_gen); + return -1; + } - default: - LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_gen %d\n", link_cfg_param_p->link_param_type._union.link_param_gen); - return -1; - } + break; - break; + case RAL_LINK_PARAM_TYPE_CHOICE_QOS: + switch (link_cfg_param_p->link_param_type._union.link_param_qos) { + case RAL_LINK_PARAM_QOS_MAX_NUM_DIF_COS_SUPPORTED: + case RAL_LINK_PARAM_QOS_MIN_PACKET_TRANSFER_DELAY_ALL_COS: + case RAL_LINK_PARAM_QOS_AVG_PACKET_TRANSFER_DELAY_ALL_COS: + case RAL_LINK_PARAM_QOS_MAX_PACKET_TRANSFER_DELAY_ALL_COS: + case RAL_LINK_PARAM_QOS_STD_DEVIATION_PACKET_TRANSFER_DELAY: + case RAL_LINK_PARAM_QOS_PACKET_LOSS_RATE_ALL_COS_FRAME_RATIO: + message_p = itti_alloc_new_message (TASK_RRC_ENB, PHY_MEAS_THRESHOLD_REQ); + PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; + memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); + itti_send_msg_to_task (TASK_MAC_ENB, ITTI_MSG_INSTANCE(msg_pP), message_p); + break; - case RAL_LINK_PARAM_TYPE_CHOICE_QOS: - switch (link_cfg_param_p->link_param_type._union.link_param_qos) { - case RAL_LINK_PARAM_QOS_MAX_NUM_DIF_COS_SUPPORTED: - case RAL_LINK_PARAM_QOS_MIN_PACKET_TRANSFER_DELAY_ALL_COS: - case RAL_LINK_PARAM_QOS_AVG_PACKET_TRANSFER_DELAY_ALL_COS: - case RAL_LINK_PARAM_QOS_MAX_PACKET_TRANSFER_DELAY_ALL_COS: - case RAL_LINK_PARAM_QOS_STD_DEVIATION_PACKET_TRANSFER_DELAY: - case RAL_LINK_PARAM_QOS_PACKET_LOSS_RATE_ALL_COS_FRAME_RATIO: - message_p = itti_alloc_new_message (TASK_RRC_ENB, PHY_MEAS_THRESHOLD_REQ); - PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; - memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); - itti_send_msg_to_task (TASK_MAC_ENB, ITTI_MSG_INSTANCE(msg_pP), message_p); - break; + default: + LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_qos %d\n", link_cfg_param_p->link_param_type._union.link_param_qos); + return -1; + } - default: - LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_qos %d\n", link_cfg_param_p->link_param_type._union.link_param_qos); - return -1; - } + break; - break; + case RAL_LINK_PARAM_TYPE_CHOICE_LTE: + switch (link_cfg_param_p->link_param_type._union.link_param_lte) { + // group by dest task id + case RAL_LINK_PARAM_LTE_UE_RSRP: + case RAL_LINK_PARAM_LTE_UE_RSRQ: + case RAL_LINK_PARAM_LTE_UE_CQI: + message_p = itti_alloc_new_message (TASK_RRC_ENB, PHY_MEAS_THRESHOLD_REQ); + PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; + memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); + itti_send_msg_to_task (TASK_PHY_ENB, ITTI_MSG_INSTANCE(msg_pP), message_p); + break; - case RAL_LINK_PARAM_TYPE_CHOICE_LTE: - switch (link_cfg_param_p->link_param_type._union.link_param_lte) { - // group by dest task id - case RAL_LINK_PARAM_LTE_UE_RSRP: - case RAL_LINK_PARAM_LTE_UE_RSRQ: - case RAL_LINK_PARAM_LTE_UE_CQI: - message_p = itti_alloc_new_message (TASK_RRC_ENB, PHY_MEAS_THRESHOLD_REQ); - PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; - memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); - itti_send_msg_to_task (TASK_PHY_ENB, ITTI_MSG_INSTANCE(msg_pP), message_p); - break; + case RAL_LINK_PARAM_LTE_AVAILABLE_BW: + case RAL_LINK_PARAM_LTE_PACKET_LOSS_RATE: + case RAL_LINK_PARAM_LTE_L2_BUFFER_STATUS: + case RAL_LINK_PARAM_LTE_PACKET_DELAY: + message_p = itti_alloc_new_message (TASK_RRC_ENB, PHY_MEAS_THRESHOLD_REQ); + PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; + memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); + itti_send_msg_to_task (TASK_MAC_ENB, ITTI_MSG_INSTANCE(msg_pP), message_p); + break; - case RAL_LINK_PARAM_LTE_AVAILABLE_BW: - case RAL_LINK_PARAM_LTE_PACKET_LOSS_RATE: - case RAL_LINK_PARAM_LTE_L2_BUFFER_STATUS: - case RAL_LINK_PARAM_LTE_PACKET_DELAY: - message_p = itti_alloc_new_message (TASK_RRC_ENB, PHY_MEAS_THRESHOLD_REQ); - PHY_MEAS_THRESHOLD_REQ(message_p).transaction_id = transaction_id; - memcpy (&PHY_MEAS_THRESHOLD_REQ(message_p).cfg_param, (void *) link_cfg_param_p, sizeof(ral_link_cfg_param_t)); - itti_send_msg_to_task (TASK_MAC_ENB, ITTI_MSG_INSTANCE(msg_pP), message_p); - break; - - case RAL_LINK_PARAM_LTE_MOBILE_NODE_CAPABILITIES: - case RAL_LINK_PARAM_LTE_EMBMS_CAPABILITY: - case RAL_LINK_PARAM_LTE_JUMBO_FEASIBILITY: - case RAL_LINK_PARAM_LTE_JUMBO_SETUP_STATUS: - case RAL_LINK_PARAM_LTE_NUM_ACTIVE_EMBMS_RECEIVERS_PER_FLOW: + case RAL_LINK_PARAM_LTE_MOBILE_NODE_CAPABILITIES: + case RAL_LINK_PARAM_LTE_EMBMS_CAPABILITY: + case RAL_LINK_PARAM_LTE_JUMBO_FEASIBILITY: + case RAL_LINK_PARAM_LTE_JUMBO_SETUP_STATUS: + case RAL_LINK_PARAM_LTE_NUM_ACTIVE_EMBMS_RECEIVERS_PER_FLOW: #warning "TO DO MIH LTE LINK PARAMS IN RRC ENB" - break; + break; - default: - LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_lte %d\n", link_cfg_param_p->link_param_type._union.link_param_lte); - return -1; + default: + LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_lte %d\n", link_cfg_param_p->link_param_type._union.link_param_lte); + return -1; + } + + break; + + default: + LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_type choice %d\n", link_cfg_param_p->link_param_type.choice); + return -1; + } + + for (ix_thresholds=0; ix_thresholds < link_cfg_param_p->num_thresholds; ix_thresholds++) { + threshold_p = &link_cfg_param_p->thresholds[ix_thresholds]; + } + + break; + + case RAL_TH_ACTION_CANCEL_THRESHOLD: + + // IEEE Std 802.21-2008, Table F4, Data type name=LINK_CFG_PARAM (page 228): + // When “Cancel threshold” is selected and no thresholds are specified, then all + // currently configured thresholds for the given LINK_PARAM_TYPE are cancelled. + if (link_cfg_param_p->num_thresholds == 0) { + rrc_enb_ral_delete_all_thresholds_type(mod_idP, &link_cfg_param_p->link_param_type); + } else { + // + // When “Cancel threshold” is selected and thresholds are specified only those + // configured thresholds for the given LINK_PARAM_TYPE and whose threshold value match what was + // specified are cancelled. + for (ix_thresholds=0; ix_thresholds < link_cfg_param_p->num_thresholds; ix_thresholds++) { + threshold_p = &link_cfg_param_p->thresholds[ix_thresholds]; + rrc_enb_ral_delete_threshold(mod_idP, &link_cfg_param_p->link_param_type, threshold_p); + } } break; default: - LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown link_param_type choice %d\n", link_cfg_param_p->link_param_type.choice); + LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown th_action %d\n", link_cfg_param_p->th_action); return -1; - } - - for (ix_thresholds=0; ix_thresholds < link_cfg_param_p->num_thresholds; ix_thresholds++) { - threshold_p = &link_cfg_param_p->thresholds[ix_thresholds]; - } - - break; - - case RAL_TH_ACTION_CANCEL_THRESHOLD: - - // IEEE Std 802.21-2008, Table F4, Data type name=LINK_CFG_PARAM (page 228): - // When “Cancel threshold” is selected and no thresholds are specified, then all - // currently configured thresholds for the given LINK_PARAM_TYPE are cancelled. - if (link_cfg_param_p->num_thresholds == 0) { - rrc_enb_ral_delete_all_thresholds_type(mod_idP, &link_cfg_param_p->link_param_type); - } else { - // - // When “Cancel threshold” is selected and thresholds are specified only those - // configured thresholds for the given LINK_PARAM_TYPE and whose threshold value match what was - // specified are cancelled. - for (ix_thresholds=0; ix_thresholds < link_cfg_param_p->num_thresholds; ix_thresholds++) { - threshold_p = &link_cfg_param_p->thresholds[ix_thresholds]; - rrc_enb_ral_delete_threshold(mod_idP, &link_cfg_param_p->link_param_type, threshold_p); - } - } - - break; - - default: - LOG_E(RRC, "Message RRC_RAL_CONFIGURE_THRESHOLD_REQ malformed, unknown th_action %d\n", link_cfg_param_p->th_action); - return -1; } } diff --git a/openair2/RRC/LTE/rrc_rrm_interface.c b/openair2/RRC/LTE/rrc_rrm_interface.c index 9f4270be89..fe15dae46d 100644 --- a/openair2/RRC/LTE/rrc_rrm_interface.c +++ b/openair2/RRC/LTE/rrc_rrm_interface.c @@ -44,18 +44,18 @@ */ #ifndef RRC_RRM_FIFOS_XFACE -#include -#include -#include -#include -#include + #include + #include + #include + #include + #include -#include -#include + #include + #include #else -#include + #include #endif @@ -78,12 +78,11 @@ \return The return value is a socket handle */ int open_socket( - sock_rrm_t *s , ///< socket descriptor + sock_rrm_t *s, ///< socket descriptor char *path_local, ///< local socket path if unix socket - char *path_dest , ///< host Socket path if unix socket + char *path_dest, ///< host Socket path if unix socket int rrm_inst ///< instance of the rrm entity -) -{ +) { /* Unix socket */ int socket_fd ; int len ; @@ -109,8 +108,6 @@ int open_socket( s->un_dest_addr.sun_family = AF_UNIX; sprintf(s->un_dest_addr.sun_path,"%s%d", path_dest, rrm_inst ); msg("Dest %s\n",s->un_dest_addr.sun_path); - - s->s = socket_fd ; return socket_fd ; } @@ -121,8 +118,7 @@ int open_socket( */ void close_socket( sock_rrm_t *sock ///< the socket handle -) -{ +) { shutdown(sock->s, SHUT_RDWR); close(sock->s); } @@ -134,10 +130,9 @@ void close_socket( */ char BUFF[2048]; int send_msg_sock( - sock_rrm_t *s ,///< socket descriptor + sock_rrm_t *s, ///< socket descriptor msg_t *smsg ///< the message to send -) -{ +) { /* Unix socket */ int ret = 0 ; // char *buf = NULL; @@ -156,13 +151,10 @@ int send_msg_sock( //buf = RRM_MALLOC(char, taille); //if (buf ==NULL) //return -1 ; - - memcpy( BUFF , &(smsg->head) , sizeof(msg_head_t) ) ; + memcpy( BUFF, &(smsg->head), sizeof(msg_head_t) ) ; memcpy( BUFF+sizeof(msg_head_t), smsg->data, smsg->head.size ) ; - iov.iov_base = (void *)BUFF; iov.iov_len = taille ; - msghd.msg_name = (void *)&(s->un_dest_addr); msghd.msg_namelen = sizeof(s->un_dest_addr); msghd.msg_iov = &iov; @@ -179,7 +171,6 @@ int send_msg_sock( //RRM_FREE(buf) ; //RRM_FREE(msg->data) ; //RRM_FREE(msg) ; - return ret ; } @@ -191,8 +182,7 @@ int send_msg_sock( */ char *recv_msg( sock_rrm_t *s ///< socket descriptor -) -{ +) { /* Unix socket */ char *buf = NULL; char *smsg = NULL; @@ -201,9 +191,7 @@ char *recv_msg( int size_msg ; msg_head_t *head ; int ret ; - int taille = SIZE_MAX_PAYLOAD ; - buf = RRM_CALLOC( char,taille); if ( buf == NULL ) { @@ -218,8 +206,7 @@ char *recv_msg( msghd.msg_iovlen = 1; msghd.msg_control = NULL ; msghd.msg_controllen= 0 ; - - ret = recvmsg(s->s, &msghd , 0 ) ; + ret = recvmsg(s->s, &msghd, 0 ) ; if ( ret <= 0 ) { // non-blocking socket @@ -236,22 +223,19 @@ char *recv_msg( head = (msg_head_t *) buf ; size_msg = sizeof(msg_head_t) + head->size ; - - smsg = RRM_CALLOC(char , size_msg ) ; + smsg = RRM_CALLOC(char, size_msg ) ; if ( smsg != NULL ) { - memcpy( smsg , buf , size_msg ) ; + memcpy( smsg, buf, size_msg ) ; } RRM_FREE( buf ) ; - return smsg ; } #else //XFACE -int send_msg_fifo(int *s, msg_t *fmsg) -{ +int send_msg_fifo(int *s, msg_t *fmsg) { int ret = 0, ret1; int taille = sizeof(msg_head_t) ; msg("write on fifos %d, msg %p\n",*s,fmsg); @@ -261,9 +245,7 @@ int send_msg_fifo(int *s, msg_t *fmsg) } // envoi le header - - - ret1 = rtf_put (*s,(char*) &(fmsg->head) , taille); + ret1 = rtf_put (*s,(char *) &(fmsg->head), taille); if(ret1 <0) { msg("rtf_put H ERR %d\n",ret1); @@ -275,7 +257,7 @@ int send_msg_fifo(int *s, msg_t *fmsg) // envoi les datas si elles sont definis if ( fmsg->data != NULL ) { - ret1 += rtf_put (*s,(char*) fmsg->data, fmsg->head.size); + ret1 += rtf_put (*s,(char *) fmsg->data, fmsg->head.size); if(ret1 <0) { msg("rtf_put D ERR %d\n",ret1); @@ -290,7 +272,6 @@ int send_msg_fifo(int *s, msg_t *fmsg) #endif //XFACE -int send_msg(void *s, msg_t *smsg) -{ +int send_msg(void *s, msg_t *smsg) { send_msg_sock((sock_rrm_t *)s, smsg); } diff --git a/openair2/RRC/LTE/rrm_2_rrc_msg.c b/openair2/RRC/LTE/rrm_2_rrc_msg.c index 3ed3a9d859..79cdc74e2b 100644 --- a/openair2/RRC/LTE/rrm_2_rrc_msg.c +++ b/openair2/RRC/LTE/rrm_2_rrc_msg.c @@ -51,26 +51,22 @@ //#include "openair_rrc_utils.h" //#include "openair_rrc_main.h" #ifdef PHY_EMUL -#include "SIMULATION/simulation_defs.h" -extern EMULATION_VARS *Emul_vars; -extern CH_MAC_INST *CH_mac_inst; -extern UE_MAC_INST *UE_mac_inst; + #include "SIMULATION/simulation_defs.h" + extern EMULATION_VARS *Emul_vars; + extern CH_MAC_INST *CH_mac_inst; + extern UE_MAC_INST *UE_mac_inst; #endif /******************************************************************************/ -void fn_rrc (void) -{ +void fn_rrc (void) { /******************************************************************************/ - msg_head_t *Header ; char *Data; - L2_ID Mac_id; while(1) { - Header = (msg_head_t *) recv_msg(&S_rrc) ; if(Header==NULL) { @@ -86,118 +82,107 @@ void fn_rrc (void) msg("Got MSG of Type %d on Inst %d\n",Header->msg_type,Header->inst); switch ( Header->msg_type ) { - case RRM_INIT_CH_REQ: { - rrm_init_ch_req_t *p = (rrm_init_ch_req_t *) Data; - msg( "[RRM]>[RRC][Inst %d]:RRM_INIT_CH_REQ\n",Header->inst); - rrc_init_ch_req(Header->inst,p); - break; - } + case RRM_INIT_CH_REQ: { + rrm_init_ch_req_t *p = (rrm_init_ch_req_t *) Data; + msg( "[RRM]>[RRC][Inst %d]:RRM_INIT_CH_REQ\n",Header->inst); + rrc_init_ch_req(Header->inst,p); + break; + } - case RRCI_INIT_MR_REQ: { - rrci_init_mr_req_t *p = (rrci_init_mr_req_t *) Data; - msg( "[RRM]>[RRC][Inst %d]:RRCI_INIT_MR_REQ\n",Header->inst); - rrc_init_mr_req(Header->inst,p); - break; - } + case RRCI_INIT_MR_REQ: { + rrci_init_mr_req_t *p = (rrci_init_mr_req_t *) Data; + msg( "[RRM]>[RRC][Inst %d]:RRCI_INIT_MR_REQ\n",Header->inst); + rrc_init_mr_req(Header->inst,p); + break; + } - case RRM_RB_ESTABLISH_REQ: { - send_msg((void *)&S_rrc,msg_rrc_rb_establish_resp(Header->inst,Header->Trans_id)); - msg( "[RRM]>[RRC][Inst %d]:RRM_RB_ESTABLISH_REQ, size %d\n",Header->inst,sizeof(rrm_rb_establish_req_t)); - rrc_config_req(Header->inst,(void*)Data,Header->msg_type,Header->Trans_id); - break ; - } + case RRM_RB_ESTABLISH_REQ: { + send_msg((void *)&S_rrc,msg_rrc_rb_establish_resp(Header->inst,Header->Trans_id)); + msg( "[RRM]>[RRC][Inst %d]:RRM_RB_ESTABLISH_REQ, size %d\n",Header->inst,sizeof(rrm_rb_establish_req_t)); + rrc_config_req(Header->inst,(void *)Data,Header->msg_type,Header->Trans_id); + break ; + } - case RRM_RB_MODIFY_REQ: { - send_msg((void *)&S_rrc,msg_rrc_rb_modify_resp(Header->inst,Header->Trans_id)); - msg( "[RRM]>[RRC][Inst %d]:RRM_RB_MODIFY_REQ\n",Header->inst); - rrc_config_req(Header->inst,Data,Header->msg_type,Header->Trans_id); - } + case RRM_RB_MODIFY_REQ: { + send_msg((void *)&S_rrc,msg_rrc_rb_modify_resp(Header->inst,Header->Trans_id)); + msg( "[RRM]>[RRC][Inst %d]:RRM_RB_MODIFY_REQ\n",Header->inst); + rrc_config_req(Header->inst,Data,Header->msg_type,Header->Trans_id); + } - case RRM_RB_RELEASE_REQ: { - send_msg((void *)&S_rrc,msg_rrc_rb_release_resp(Header->inst,Header->Trans_id)); - msg( "[RRM]>[RRC][Inst %d]:RRM_RB_RELEASE_REQ\n",Header->inst); - rrc_config_req(Header->inst,Data,Header->msg_type,Header->Trans_id); - } + case RRM_RB_RELEASE_REQ: { + send_msg((void *)&S_rrc,msg_rrc_rb_release_resp(Header->inst,Header->Trans_id)); + msg( "[RRM]>[RRC][Inst %d]:RRM_RB_RELEASE_REQ\n",Header->inst); + rrc_config_req(Header->inst,Data,Header->msg_type,Header->Trans_id); + } - case RRCI_CX_ESTABLISH_RESP: { - rrci_cx_establish_resp_t *p = (rrci_cx_establish_resp_t *) Data; - unsigned char CH_index,i; - msg( "[RRCI]>[RRC][Inst %d]:RRCI_CX_ESTABLISH_RESP\n",Header->inst); + case RRCI_CX_ESTABLISH_RESP: { + rrci_cx_establish_resp_t *p = (rrci_cx_establish_resp_t *) Data; + unsigned char CH_index,i; + msg( "[RRCI]>[RRC][Inst %d]:RRCI_CX_ESTABLISH_RESP\n",Header->inst); - for(i=0; iinst-NB_CH_INST].Info[i].CH_mac_id,&p->L2_id,sizeof(L2_ID))) { - CH_index=i; - break; + for(i=0; iinst-NB_CH_INST].Info[i].CH_mac_id,&p->L2_id,sizeof(L2_ID))) { + CH_index=i; + break; + } + + if(i==NB_SIG_CNX_UE) { + msg("[RRC] FATAL: CH_INDEX NOT FOUND\n"); + return; } - if(i==NB_SIG_CNX_UE) { - msg("[RRC] FATAL: CH_INDEX NOT FOUND\n"); - return; + UE_rrc_inst[Header->inst-NB_CH_INST].Srb2[CH_index].Srb_info.IP_addr_type=p->L3_info_t; + + if(p->L3_info_t == IPv4_ADDR) { + memcpy(&UE_rrc_inst[Header->inst-NB_CH_INST].Srb2[CH_index].Srb_info.IP_addr,p->L3_info,4); + } else { + memcpy(&UE_rrc_inst[Header->inst-NB_CH_INST].Srb2[CH_index].Srb_info.IP_addr,p->L3_info,16); + } } + break ; - UE_rrc_inst[Header->inst-NB_CH_INST].Srb2[CH_index].Srb_info.IP_addr_type=p->L3_info_t; - - if(p->L3_info_t == IPv4_ADDR) { - memcpy(&UE_rrc_inst[Header->inst-NB_CH_INST].Srb2[CH_index].Srb_info.IP_addr,p->L3_info,4); + case RRM_SENSING_MEAS_REQ: { + // rrm_sensing_meas_req_t *p = (rrm_sensing_meas_req_t *) sock_msg ; + send_msg((void *)&S_rrc,msg_rrc_sensing_meas_resp(Header->inst,Header->Trans_id)); + msg( "[RRM]>[RRC][Inst %d]:RRM_SENSING_MEAS_REQ\n",Header->inst); + // rrc_meas_req(header->inst,p,RRC_MEAS_ADD); } + break ; - else { - memcpy(&UE_rrc_inst[Header->inst-NB_CH_INST].Srb2[CH_index].Srb_info.IP_addr,p->L3_info,16); + case RRM_SENSING_MEAS_RESP: { + msg( "[RRM]>[RRC][Inst %d]:RRM_SENSING_MEAS_RESP\n",Header->inst); + //rrm_rrc_meas_resp(header->inst,header->Trans_id); } + break ; + + case RRM_SCAN_ORD: + msg( "[RRM]>[RRC][Inst %d]:RRM_SCAN_ORD\n",Header->inst); + //memcpy(&CH_rrc_inst[0].Rrm_init_scan_req,(rrm_init_scan_req_t *) Data,sizeof(rrm_init_scan_req_t)); + //CH_rrc_inst[0].Last_scan_req=Rrc_xface->Frame_index; + ///send over air + break; + + case RRM_INIT_SCAN_REQ: + msg( "[RRM]>[RRC][Inst %d]:RRM_INIT_SCAN_REQ\n",Header->inst); + memcpy(&CH_rrc_inst[0].Rrm_init_scan_req,(rrm_init_scan_req_t *) Data,sizeof(rrm_init_scan_req_t)); + CH_rrc_inst[0].Last_scan_req=Rrc_xface->Frame_index; + ///send over air + break; + + case RRM_END_SCAN_REQ: + msg( "[RRM]>[RRC][Inst %d]:RRM_END_SCAN_REQ\n",Header->inst); + memcpy(&Mac_id.L2_id[0],Data,sizeof(L2_ID)); + unsigned char UE_index=Mac_id.L2_id[0]-NB_CH_MAX+1; + UE_rrc_inst[0].Srb2[UE_index].Srb_info.Tx_buffer.Payload[0]=100; + msg("SRB_ID %d\n",CH_rrc_inst[0].Srb2[UE_index].Srb_info.Srb_id); + Mac_rlc_xface->rrc_rlc_data_req(0,CH_rrc_inst[0].Srb2[UE_index].Srb_info.Srb_id,0,0,1,CH_rrc_inst[0].Srb2[UE_index].Srb_info.Tx_buffer.Payload); + //CH_rrc_inst[0].Last_scan_req=Rrc_xface->Frame_index; + ///send over air + break; + + default : + msg("[L3_xface]WARNING: msg unknown %d\n",Header->msg_type) ; } - break ; - - case RRM_SENSING_MEAS_REQ: { - // rrm_sensing_meas_req_t *p = (rrm_sensing_meas_req_t *) sock_msg ; - send_msg((void *)&S_rrc,msg_rrc_sensing_meas_resp(Header->inst,Header->Trans_id)); - msg( "[RRM]>[RRC][Inst %d]:RRM_SENSING_MEAS_REQ\n",Header->inst); - // rrc_meas_req(header->inst,p,RRC_MEAS_ADD); - } - break ; - - - case RRM_SENSING_MEAS_RESP: { - msg( "[RRM]>[RRC][Inst %d]:RRM_SENSING_MEAS_RESP\n",Header->inst); - //rrm_rrc_meas_resp(header->inst,header->Trans_id); - } - break ; - - - case RRM_SCAN_ORD: - msg( "[RRM]>[RRC][Inst %d]:RRM_SCAN_ORD\n",Header->inst); - //memcpy(&CH_rrc_inst[0].Rrm_init_scan_req,(rrm_init_scan_req_t *) Data,sizeof(rrm_init_scan_req_t)); - //CH_rrc_inst[0].Last_scan_req=Rrc_xface->Frame_index; - ///send over air - - break; - - case RRM_INIT_SCAN_REQ: - msg( "[RRM]>[RRC][Inst %d]:RRM_INIT_SCAN_REQ\n",Header->inst); - memcpy(&CH_rrc_inst[0].Rrm_init_scan_req,(rrm_init_scan_req_t *) Data,sizeof(rrm_init_scan_req_t)); - CH_rrc_inst[0].Last_scan_req=Rrc_xface->Frame_index; - ///send over air - - break; - - case RRM_END_SCAN_REQ: - - msg( "[RRM]>[RRC][Inst %d]:RRM_END_SCAN_REQ\n",Header->inst); - memcpy(&Mac_id.L2_id[0],Data,sizeof(L2_ID)); - unsigned char UE_index=Mac_id.L2_id[0]-NB_CH_MAX+1; - - - UE_rrc_inst[0].Srb2[UE_index].Srb_info.Tx_buffer.Payload[0]=100; - msg("SRB_ID %d\n",CH_rrc_inst[0].Srb2[UE_index].Srb_info.Srb_id); - Mac_rlc_xface->rrc_rlc_data_req(0,CH_rrc_inst[0].Srb2[UE_index].Srb_info.Srb_id,0,0,1,CH_rrc_inst[0].Srb2[UE_index].Srb_info.Tx_buffer.Payload); - //CH_rrc_inst[0].Last_scan_req=Rrc_xface->Frame_index; - ///send over air - - break; - - default : - msg("[L3_xface]WARNING: msg unknown %d\n",Header->msg_type) ; - } - } } diff --git a/openair2/RRC/LTE/utils.c b/openair2/RRC/LTE/utils.c index bbf97046bf..08637e0e67 100644 --- a/openair2/RRC/LTE/utils.c +++ b/openair2/RRC/LTE/utils.c @@ -34,8 +34,7 @@ ________________________________________________________________*/ //------------------------------------------------------------------------------------------------------------------// -uint16_t find_free_dtch_position(uint8_t Mod_id, uint16_t UE_CH_index) -{ +uint16_t find_free_dtch_position(uint8_t Mod_id, uint16_t UE_CH_index) { uint16_t i,j; if(UE_CH_index==0) { @@ -45,22 +44,18 @@ uint16_t find_free_dtch_position(uint8_t Mod_id, uint16_t UE_CH_index) } for(i=j; imacphy_exit("NO FREE DTCH LCHAN, exit"); - return 0; } //-------------------------------------------------------------------------------------------// -uint8_t rrc_find_free_ue_index(uint8_t Mod_id) -{ +uint8_t rrc_find_free_ue_index(uint8_t Mod_id) { //-------------------------------------------------------------------------------------------// uint16_t i; @@ -78,8 +73,7 @@ uint8_t rrc_find_free_ue_index(uint8_t Mod_id) //-------------------------------------------------------------------------------------------// -unsigned short rrc_find_ue_index(unsigned char Mod_id, L2_ID Mac_id) -{ +unsigned short rrc_find_ue_index(unsigned char Mod_id, L2_ID Mac_id) { //-------------------------------------------------------------------------------------------// unsigned char i; /* @@ -90,8 +84,7 @@ unsigned short rrc_find_ue_index(unsigned char Mod_id, L2_ID Mac_id) */ } //-------------------------------------------------------------------------------------------// -uint8_t rrc_is_node_isolated(uint8_t Mod_id) -{ +uint8_t rrc_is_node_isolated(uint8_t Mod_id) { //-------------------------------------------------------------------------------------------// /*uint8_t i; for(i=0;iHeader->Rv_tb_idx=0; // Rrc_buffer->W_idx=0; From 42e0929a0cf4f79eb54384ac00da8570187940e5 Mon Sep 17 00:00:00 2001 From: Stefan Schaffelder Date: Thu, 4 Apr 2019 10:15:38 +0200 Subject: [PATCH 02/44] apply last diff from ssr to local orange_cdrx branch. Remove SSR comments --- openair2/COMMON/rrc_messages_types.h | 18 +-- openair2/ENB_APP/enb_paramdef.h | 80 ++++++------- openair2/LAYER2/MAC/pre_processor.c | 2 +- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 6 +- openair2/RRC/LTE/MESSAGES/asn1_msg.h | 2 +- openair2/RRC/LTE/rrc_defs.h | 2 +- openair2/RRC/LTE/rrc_eNB.c | 170 ++++++++++++++------------- 7 files changed, 144 insertions(+), 136 deletions(-) diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index e8cabe5bf5..64810e644a 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -36,7 +36,7 @@ #include "LTE_SystemInformationBlockType2.h" #include "LTE_SL-OffsetIndicator-r12.h" #include "LTE_SubframeBitmapSL-r12.h" -#include "LTE_DRX-Config.h" // Add DRX SSR 2018-10 +#include "LTE_DRX-Config.h" #include "LTE_SL-CP-Len-r12.h" #include "LTE_SL-PeriodComm-r12.h" #include "LTE_SL-DiscResourcePool-r12.h" @@ -142,14 +142,14 @@ typedef struct RadioResourceConfig_s { long bcch_modificationPeriodCoeff; long pcch_defaultPagingCycle; long pcch_nB; - LTE_DRX_Config_PR drx_Config_present; // Add DRX SSR 2018-10 - long drx_onDurationTimer; // Add DRX SSR 2018-10 - long drx_InactivityTimer; // Add DRX SSR 2018-10 - long drx_RetransmissionTimer; // Add DRX SSR 2018-10 - LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR drx_longDrx_CycleStartOffset_present; // Add DRX SSR 2018-10 - long drx_longDrx_CycleStartOffset; // Add DRX SSR 2018-10 - long drx_shortDrx_Cycle; // Add DRX SSR 2018-10 - long drx_shortDrx_ShortCycleTimer; // Add DRX SSR 2018-10 + LTE_DRX_Config_PR drx_Config_present; + long drx_onDurationTimer; + long drx_InactivityTimer; + long drx_RetransmissionTimer; + LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR drx_longDrx_CycleStartOffset_present; + long drx_longDrx_CycleStartOffset; + long drx_shortDrx_Cycle; + long drx_shortDrx_ShortCycleTimer; long ue_TimersAndConstants_t300; long ue_TimersAndConstants_t301; long ue_TimersAndConstants_t310; diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index ba26f4e3d9..dff16ff9d7 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -363,14 +363,14 @@ typedef enum { #define ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX "rach_maxHARQ_Msg3Tx" #define ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE "pcch_default_PagingCycle" #define ENB_CONFIG_STRING_PCCH_NB "pcch_nB" -#define ENB_CONFIG_STRING_DRX_CONFIG_PRESENT "drx_Config_present" // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_ONDURATIONTIMER "drx_onDurationTimer" // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_INACTIVITYTIMER "drx_InactivityTimer" // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER "drx_RetransmissionTimer" // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_PRESENT "drx_longDrx_CycleStartOffset_present" // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET "drx_longDrx_CycleStartOffset" // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE "drx_shortDrx_Cycle" // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER "drx_shortDrx_ShortCycleTimer" // Add DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_CONFIG_PRESENT "drx_Config_present" +#define ENB_CONFIG_STRING_DRX_ONDURATIONTIMER "drx_onDurationTimer" +#define ENB_CONFIG_STRING_DRX_INACTIVITYTIMER "drx_InactivityTimer" +#define ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER "drx_RetransmissionTimer" +#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_PRESENT "drx_longDrx_CycleStartOffset_present" +#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET "drx_longDrx_CycleStartOffset" +#define ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE "drx_shortDrx_Cycle" +#define ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER "drx_shortDrx_ShortCycleTimer" #define ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF "bcch_modificationPeriodCoeff" #define ENB_CONFIG_STRING_UETIMERS_T300 "ue_TimersAndConstants_t300" #define ENB_CONFIG_STRING_UETIMERS_T301 "ue_TimersAndConstants_t301" @@ -589,14 +589,14 @@ typedef struct ccparams_lte_s { { .s5= {NULL }} , \ { .s5= {NULL }} , \ { .s5= {NULL }} , \ - { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ - { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ - { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ - { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ - { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ - { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ - { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ - { .s5= {NULL }} , /* Add DRX SSR 2018-10 */ \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ { .s5= {NULL }} , \ { .s1a= { config_check_modify_integer, UETIMER_T300_OKVALUES, UETIMER_T300_MODVALUES,8}} , \ { .s1a= { config_check_modify_integer, UETIMER_T301_OKVALUES, UETIMER_T301_MODVALUES,8}} , \ @@ -711,14 +711,14 @@ typedef struct ccparams_lte_s { {ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, NULL, 0, iptr:&ccparams.rach_maxHARQ_Msg3Tx, defintval:4, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE, NULL, 0, iptr:&ccparams.pcch_defaultPagingCycle, defintval:128, TYPE_INT, 0}, \ {ENB_CONFIG_STRING_PCCH_NB, NULL, 0, strptr:&ccparams.pcch_nB, defstrval:"oneT", TYPE_STRING, 0}, \ -{ENB_CONFIG_STRING_DRX_CONFIG_PRESENT, NULL, 0, strptr:&ccparams.drx_Config_present, defstrval:"prNothing", TYPE_STRING, 0}, /* Add DRX SSR 2018-10 */ \ -{ENB_CONFIG_STRING_DRX_ONDURATIONTIMER, NULL, 0, strptr:&ccparams.drx_onDurationTimer, defstrval:"psf10", TYPE_STRING, 0}, /* Add DRX SSR 2018-10 */ \ -{ENB_CONFIG_STRING_DRX_INACTIVITYTIMER, NULL, 0, strptr:&ccparams.drx_InactivityTimer, defstrval:"psf10", TYPE_STRING, 0}, /* Add DRX SSR 2018-10 */ \ -{ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER, NULL, 0, strptr:&ccparams.drx_RetransmissionTimer, defstrval:"psf8", TYPE_STRING, 0}, /* Add DRX SSR 2018-10 */ \ -{ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_PRESENT, NULL, 0, strptr:&ccparams.drx_longDrx_CycleStartOffset_present, defstrval:"prSf128", TYPE_STRING, 0}, /* Add DRX SSR 2018-10 */ \ -{ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET, NULL, 0, iptr:&ccparams.drx_longDrx_CycleStartOffset, defintval:0, TYPE_UINT, 0}, /* Add DRX SSR 2018-10 */ \ -{ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE, NULL, 0, strptr:&ccparams.drx_shortDrx_Cycle, defstrval:"sf32", TYPE_STRING, 0}, /* Add DRX SSR 2018-10 */ \ -{ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER, NULL, 0, iptr:&ccparams.drx_shortDrx_ShortCycleTimer, defintval:3, TYPE_UINT, 0}, /* Add DRX SSR 2018-10 */ \ +{ENB_CONFIG_STRING_DRX_CONFIG_PRESENT, NULL, 0, strptr:&ccparams.drx_Config_present, defstrval:"prNothing", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_DRX_ONDURATIONTIMER, NULL, 0, strptr:&ccparams.drx_onDurationTimer, defstrval:"psf10", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_DRX_INACTIVITYTIMER, NULL, 0, strptr:&ccparams.drx_InactivityTimer, defstrval:"psf10", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER, NULL, 0, strptr:&ccparams.drx_RetransmissionTimer, defstrval:"psf8", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_PRESENT, NULL, 0, strptr:&ccparams.drx_longDrx_CycleStartOffset_present, defstrval:"prSf128", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET, NULL, 0, iptr:&ccparams.drx_longDrx_CycleStartOffset, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE, NULL, 0, strptr:&ccparams.drx_shortDrx_Cycle, defstrval:"sf32", TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER, NULL, 0, iptr:&ccparams.drx_shortDrx_ShortCycleTimer, defintval:3, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF, NULL, 0, iptr:&ccparams.bcch_modificationPeriodCoeff, defintval:2, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_UETIMERS_T300, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_t300, defintval:1000, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_UETIMERS_T301, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_t301, defintval:1000, TYPE_UINT, 0}, \ @@ -792,22 +792,22 @@ typedef struct ccparams_lte_s { #define ENB_CONFIG_RACH_MAXHARQMSG3TX_IDX 57 #define ENB_CONFIG_PCCH_DEFAULT_PAGING_CYCLE_IDX 58 #define ENB_CONFIG_PCCH_NB_IDX 59 -#define ENB_CONFIG_STRING_DRX_CONFIG_PRESENT_IDX 60 // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_ONDURATIONTIMER_IDX 61 // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_INACTIVITYTIMER_IDX 62 // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER_IDX 63 // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_PRESENT_IDX 64 // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_IDX 65 // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE_IDX 66 // Add DRX SSR 2018-10 -#define ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER_IDX 67 // Add DRX SSR 2018-10 -#define ENB_CONFIG_BCCH_MODIFICATIONPERIODCOEFF_IDX 68 // Modif DRX SSR 2018-10 -#define ENB_CONFIG_UETIMERS_T300_IDX 69 // Modif DRX SSR 2018-10 -#define ENB_CONFIG_UETIMERS_T301_IDX 70 // Modif DRX SSR 2018-10 -#define ENB_CONFIG_UETIMERS_T310_IDX 71 // Modif DRX SSR 2018-10 -#define ENB_CONFIG_UETIMERS_T311_IDX 72 // Modif DRX SSR 2018-10 -#define ENB_CONFIG_UETIMERS_N310_IDX 73 // Modif DRX SSR 2018-10 -#define ENB_CONFIG_UETIMERS_N311_IDX 74 // Modif DRX SSR 2018-10 -#define ENB_CONFIG_UE_TRANSMISSION_MODE_IDX 75 // Modif DRX SSR 2018-10 +#define ENB_CONFIG_STRING_DRX_CONFIG_PRESENT_IDX 60 +#define ENB_CONFIG_STRING_DRX_ONDURATIONTIMER_IDX 61 +#define ENB_CONFIG_STRING_DRX_INACTIVITYTIMER_IDX 62 +#define ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER_IDX 63 +#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_PRESENT_IDX 64 +#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_IDX 65 +#define ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE_IDX 66 +#define ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER_IDX 67 +#define ENB_CONFIG_BCCH_MODIFICATIONPERIODCOEFF_IDX 68 +#define ENB_CONFIG_UETIMERS_T300_IDX 69 +#define ENB_CONFIG_UETIMERS_T301_IDX 70 +#define ENB_CONFIG_UETIMERS_T310_IDX 71 +#define ENB_CONFIG_UETIMERS_T311_IDX 72 +#define ENB_CONFIG_UETIMERS_N310_IDX 73 +#define ENB_CONFIG_UETIMERS_N311_IDX 74 +#define ENB_CONFIG_UE_TRANSMISSION_MODE_IDX 75 /*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* SRB1 configuration parameters section name */ diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index ea49cfa81e..3e04e601d3 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -1653,7 +1653,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, UE_sched_ctrl *ue_sched_ctl; int N_RB_UL = 0; uint16_t available_rbs, first_rb_offset; - rnti_t rntiTable[MAX_MOBILES_PER_ENB]; // Rnti array => Add SSR 12-2018 + rnti_t rntiTable[MAX_MOBILES_PER_ENB]; // sort ues LOG_D(MAC, "In ulsch_preprocessor: sort ue \n"); diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index 14aeb895e8..278ea40fed 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -317,10 +317,9 @@ uint8_t do_MIB_SL(const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index, return((enc_rval.encoded+7)/8); } -// Begin add DRX SSR 2018-11 + LTE_DRX_Config_t *do_DrxConfig(uint8_t Mod_id, int CC_id, RrcConfigurationReq *configuration, LTE_UE_EUTRA_Capability_t *UEcap) { - // Begin add DRX SSR 2018-12 LTE_DRX_Config_t *drxConfig = NULL; BIT_STRING_t *featureGroupIndicators = NULL; bool ueSupportCdrxShortFlag = false; @@ -335,7 +334,6 @@ LTE_DRX_Config_t *do_DrxConfig(uint8_t Mod_id, int CC_id, RrcConfigurationReq *c } else LOG_W(RRC,"[do_DrxConfig] Not enough featureGroupIndicators bits\n"); } else LOG_W(RRC,"[do_DrxConfig] No featureGroupIndicators pointer\n"); } else LOG_W(RRC,"[do_DrxConfig] No UEcap pointer\n"); - // End add DRX SSR 2018-12 drxConfig = (LTE_DRX_Config_t *) malloc(sizeof(LTE_DRX_Config_t)); if (drxConfig == NULL) return NULL; @@ -419,8 +417,6 @@ LTE_DRX_Config_t *do_DrxConfig(uint8_t Mod_id, int CC_id, RrcConfigurationReq *c } return drxConfig; } -// End add DRX SSR 2018-11 - uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, int Mod_id,int CC_id diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.h b/openair2/RRC/LTE/MESSAGES/asn1_msg.h index 7022f9e6e0..331a3ca312 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.h +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.h @@ -71,7 +71,7 @@ uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich ); /** -\brief Generate configuration for DRX_Config (Add DRX SSR 2018-11) +\brief Generate configuration for DRX_Config @param Mod_id Instance of eNB @param CC_id Id of component to configure @param configuration Pointer Configuration Request structure diff --git a/openair2/RRC/LTE/rrc_defs.h b/openair2/RRC/LTE/rrc_defs.h index 6019ae2529..1da374dd42 100644 --- a/openair2/RRC/LTE/rrc_defs.h +++ b/openair2/RRC/LTE/rrc_defs.h @@ -200,7 +200,7 @@ void *send_UE_status_notification(void *); /* for ImsiMobileIdentity_t */ #include "MobileIdentity.h" -#include "LTE_DRX-Config.h" // Add DRX SSR 2018-11 +#include "LTE_DRX-Config.h" /* correct Rel(8|10)/Rel14 differences * the code is in favor of Rel14, those defines do the translation diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index b70846cc30..26eefcaec5 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -1286,123 +1286,136 @@ rrc_eNB_generate_RRCConnectionReestablishment( const int CC_id) //----------------------------------------------------------------------------- { -LTE_LogicalChannelConfig_t *SRB1_logicalChannelConfig; - LTE_SRB_ToAddModList_t **SRB_configList; - LTE_SRB_ToAddMod_t *SRB1_config; - int cnt; - T(T_ENB_RRC_CONNECTION_REESTABLISHMENT, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), - T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + int UE_id = -1; + LTE_LogicalChannelConfig_t *SRB1_logicalChannelConfig = NULL; + LTE_SRB_ToAddModList_t **SRB_configList; + LTE_SRB_ToAddMod_t *SRB1_config = NULL; + rrc_eNB_carrier_data_t *carrier = NULL; + eNB_RRC_UE_t *ue_context = NULL; - eNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context; + module_id_t module_id = ctxt_pP->module_id; + uint16_t rnti = ctxt_pP->rnti; - SRB_configList = &ue_p->SRB_configList; + T(T_ENB_RRC_CONNECTION_REESTABLISHMENT, + T_INT(module_id), + T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), + T_INT(rnti)); - ue_p->Srb0.Tx_buffer.payload_size = - do_RRCConnectionReestablishment(ctxt_pP, - ue_context_pP, - CC_id, - (uint8_t *) ue_p->Srb0.Tx_buffer.Payload, - (uint8_t) RC.rrc[ctxt_pP->module_id]->carrier[CC_id].p_eNB, //at this point we do not have the UE capability information, so it can only be TM1 or TM2 - rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id), - SRB_configList, - &ue_context_pP->ue_context.physicalConfigDedicated); - LOG_DUMPMSG(RRC,DEBUG_RRC, - (char *)(ue_p->Srb0.Tx_buffer.Payload), - ue_p->Srb0.Tx_buffer.payload_size, - "[MSG] RRCConnectionReestablishment\n" - ); - // configure SRB1 for UE + SRB_configList = &(ue_context_pP->ue_context.SRB_configList); + carrier = &(RC.rrc[ctxt_pP->module_id]->carrier[CC_id]); + ue_context = &(ue_context_pP->ue_context); + carrier->Srb0.Tx_buffer.payload_size = do_RRCConnectionReestablishment(ctxt_pP, + ue_context_pP, + CC_id, + (uint8_t *) carrier->Srb0.Tx_buffer.Payload, + (uint8_t) carrier->p_eNB, // at this point we do not have the UE capability information, so it can only be TM1 or TM2 + rrc_eNB_get_next_transaction_identifier(module_id), + SRB_configList, + &(ue_context->physicalConfigDedicated)); + + LOG_DUMPMSG(RRC, DEBUG_RRC, + (char *)(carrier->Srb0.Tx_buffer.Payload), + carrier->Srb0.Tx_buffer.payload_size, + "[MSG] RRCConnectionReestablishment \n"); + + /* Configure SRB1 for UE */ if (*SRB_configList != NULL) { - for (cnt = 0; cnt < (*SRB_configList)->list.count; cnt++) { + for (int cnt = 0; cnt < (*SRB_configList)->list.count; cnt++) { if ((*SRB_configList)->list.array[cnt]->srb_Identity == 1) { SRB1_config = (*SRB_configList)->list.array[cnt]; if (SRB1_config->logicalChannelConfig) { - if (SRB1_config->logicalChannelConfig->present == - LTE_SRB_ToAddMod__logicalChannelConfig_PR_explicitValue) { - SRB1_logicalChannelConfig = &SRB1_config->logicalChannelConfig->choice.explicitValue; + if (SRB1_config->logicalChannelConfig->present == LTE_SRB_ToAddMod__logicalChannelConfig_PR_explicitValue) { + SRB1_logicalChannelConfig = &(SRB1_config->logicalChannelConfig->choice.explicitValue); } else { - SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue; + SRB1_logicalChannelConfig = &(SRB1_logicalChannelConfig_defaultValue); } } else { - SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue; + SRB1_logicalChannelConfig = &(SRB1_logicalChannelConfig_defaultValue); } - LOG_D(RRC, - PROTOCOL_RRC_CTXT_UE_FMT" RRC_eNB --- MAC_CONFIG_REQ (SRB1) ---> MAC_eNB\n", + LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RRC_eNB --- MAC_CONFIG_REQ (SRB1) ---> MAC_eNB\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); if (NODE_IS_MONOLITHIC(RC.rrc[ctxt_pP->module_id]->node_type)) { - rrc_mac_config_req_eNB(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - 0,0,0,0,0, + rrc_mac_config_req_eNB(module_id, + ue_context->primaryCC_id, + 0, + 0, + 0, + 0, + 0, #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) 0, #endif - ctxt_pP->rnti, + rnti, (LTE_BCCH_BCH_Message_t *) NULL, (LTE_RadioResourceConfigCommonSIB_t *) NULL, #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) (LTE_RadioResourceConfigCommonSIB_t *) NULL, #endif - (struct LTE_PhysicalConfigDedicated * ) ue_context_pP->ue_context.physicalConfigDedicated, + (struct LTE_PhysicalConfigDedicated * ) ue_context->physicalConfigDedicated, #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) (LTE_SCellToAddMod_r10_t *)NULL, - //(struct LTE_PhysicalConfigDedicatedSCell_r10 *)NULL, #endif (LTE_MeasObjectToAddMod_t **) NULL, - ue_context_pP->ue_context.mac_MainConfig, + ue_context->mac_MainConfig, 1, SRB1_logicalChannelConfig, - ue_context_pP->ue_context.measGapConfig, + ue_context->measGapConfig, (LTE_TDD_Config_t *) NULL, NULL, (LTE_SchedulingInfoList_t *) NULL, - 0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL + 0, + NULL, + NULL, + (LTE_MBSFN_SubframeConfigList_t *) NULL #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) - , 0, (LTE_MBSFN_AreaInfoList_r9_t *) NULL, (LTE_PMCH_InfoList_r9_t *) NULL + , 0, + (LTE_MBSFN_AreaInfoList_r9_t *) NULL, + (LTE_PMCH_InfoList_r9_t *) NULL #endif #if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0)) - ,(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL + ,(LTE_SystemInformationBlockType1_v1310_IEs_t *) NULL #endif - ); + ); break; } - } - } - } + } // if ((*SRB_configList)->list.array[cnt]->srb_Identity == 1) + } // for (int cnt = 0; cnt < (*SRB_configList)->list.count; cnt++) + } // if (*SRB_configList != NULL) MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_RRC_UE, - ue_p->Srb0.Tx_buffer.Header, - ue_p->Srb0.Tx_buffer.payload_size, + carrier->Srb0.Tx_buffer.Header, + carrier->Srb0.Tx_buffer.payload_size, MSC_AS_TIME_FMT" LTE_RRCConnectionReestablishment UE %x size %u", MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - ue_p->Srb0.Tx_buffer.payload_size); + ue_context->rnti, + carrier->Srb0.Tx_buffer.payload_size); - LOG_I(RRC, - PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating LTE_RRCConnectionReestablishment (bytes %d)\n", + LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating LTE_RRCConnectionReestablishment (bytes %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), - ue_p->Srb0.Tx_buffer.payload_size); - if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) { - int UE_id = find_UE_id(ctxt_pP->module_id, ctxt_pP->rnti); - if(UE_id != -1){ - // activate release timer, if RRCComplete not received after 100 frames, remove UE - RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 1; - // remove UE after 100 frames after RRCConnectionReestablishmentRelease is triggered - RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer_thres = 1000; - } else{ - LOG_E(RRC, - PROTOCOL_RRC_CTXT_UE_FMT" Generating LTE_RRCConnectionReestablishment without UE_id(MAC) rnti %x\n", - PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), ctxt_pP->rnti); - } - } - // activate release timer, if RRCComplete not received after 100 frames, remove UE - ue_context_pP->ue_context.ue_reestablishment_timer = 1; - // remove UE after 100 frames after LTE_RRCConnectionReestablishmentRelease is triggered - ue_context_pP->ue_context.ue_reestablishment_timer_thres = 1000; + carrier->Srb0.Tx_buffer.payload_size); + UE_id = find_UE_id(module_id, rnti); + + if (UE_id != -1) { + /* Activate reject timer, if RRCComplete not received after 10 frames, reject UE */ + RC.mac[module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 1; + /* Reject UE after 10 frames, LTE_RRCConnectionReestablishmentReject is triggered */ + RC.mac[module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer_thres = 100; + } else { + LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Generating LTE_RRCConnectionReestablishment without UE_id(MAC) rnti %x\n", + PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), + rnti); + } + + /* Activate release timer, if RRCComplete not received after 100 frames, remove UE */ + ue_context_pP->ue_context.ue_reestablishment_timer = 1; + /* Remove UE after 100 frames after LTE_RRCConnectionReestablishmentReject is triggered */ + ue_context_pP->ue_context.ue_reestablishment_timer_thres = 1000; } //----------------------------------------------------------------------------- @@ -2782,8 +2795,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons LTE_C_RNTI_t *cba_RNTI = NULL; int x2_enabled; uint8_t xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); //Transaction_id, - uint8_t cc_id = ue_context_pP->ue_context.primaryCC_id; // Add DRX SSR 2018-11 => CC id - LTE_UE_EUTRA_Capability_t *UEcap = ue_context_pP->ue_context.UE_Capability; // Add DRX SSR 2018-12 + uint8_t cc_id = ue_context_pP->ue_context.primaryCC_id; + LTE_UE_EUTRA_Capability_t *UEcap = ue_context_pP->ue_context.UE_Capability; #ifdef CBA //struct PUSCH_CBAConfigDedicated_vlola *pusch_CBAConfigDedicated_vlola; uint8_t *cba_RNTI_buf; @@ -2956,7 +2969,6 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf200; // sf20 = 20 subframes // LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf1000 mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange = LTE_MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB3; // Value dB1 =1 dB, dB3 = 3 dB - // Begin add DRX SSR 2018-11 if (rrc_inst->carrier[cc_id].sib1->tdd_Config == NULL) { // CDRX configured in case of FDD LOG_D(RRC, "Processing the DRX configuration in RRC Connection Reconfiguration\n"); @@ -3016,7 +3028,6 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons } else { // CDRX not ready for TDD mac_MainConfig->drx_Config = NULL; } - // End add DRX SSR 2018-11 #if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0)) sr_ProhibitTimer_r9 = CALLOC(1, sizeof(long)); @@ -5481,7 +5492,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ) //----------------------------------------------------------------------------- { - int drb_id; + int i, drb_id; int oip_ifup = 0; int dest_ip_offset = 0; uint8_t *kRRCenc = NULL; @@ -5505,6 +5516,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); +#if defined(ENABLE_SECURITY) /* Derive the keys from kenb */ if (DRB_configList != NULL) { derive_key_up_enc(ue_context_pP->ue_context.ciphering_algorithm, @@ -5826,10 +5838,10 @@ rrc_eNB_generate_RRCConnectionSetup( SRB_configList, &ue_context_pP->ue_context.physicalConfigDedicated); } - LOG_DUMPMSG(RRC,DEBUG_RRC, - (char *)(ue_p->Srb0.Tx_buffer.Payload), - ue_p->Srb0.Tx_buffer.payload_size, - "[MSG] RRC Connection Setup\n"); + LOG_DUMPMSG(RRC,DEBUG_RRC, + (char *)(ue_p->Srb0.Tx_buffer.Payload), + ue_p->Srb0.Tx_buffer.payload_size, + "[MSG] RRC Connection Setup\n"); // configure SRB1/SRB2, PhysicalConfigDedicated, MAC_MainConfig for UE switch (RC.rrc[ctxt_pP->module_id]->node_type){ From ca11800087ff3ef0944a296049be9415467fc8ae Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Fri, 5 Apr 2019 08:14:27 +0200 Subject: [PATCH 03/44] Cleanup of eNB_scheduler.c --- openair1/PHY/LTE_TRANSPORT/edci.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler.c | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/edci.c b/openair1/PHY/LTE_TRANSPORT/edci.c index b438953e83..0df94e55e5 100644 --- a/openair1/PHY/LTE_TRANSPORT/edci.c +++ b/openair1/PHY/LTE_TRANSPORT/edci.c @@ -118,7 +118,7 @@ void init_mpdcch5ss1tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB * eNB) mpdcch5ss1tab[re] = (l * eNB->frame_parms.ofdm_symbol_size) + k; re++; } else if ((kmod == 0) || (kmod == 5) || (kmod == 10)) { - mpdcch5ss1tab[re++] = (l * eNB->frame_parms.ofdm_symbol_size) + k; + mpdcch5ss1tab[re++] = (l * eNB->frame_parms.ofdm_symbol_size) + k; } } } diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 0f8945ab94..b55a5cf1e1 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -649,16 +649,20 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, } } - /* UL synchronous HARQ process */ + /* UL asynchronous HARQ process: only UL HARQ RTT timer is implemented (hence not implemented) */ if (UE_scheduling_control->ul_harq_rtt_timer[CC_id][harq_process_id] > 0) { UE_scheduling_control->ul_harq_rtt_timer[CC_id][harq_process_id]++; if (UE_scheduling_control->ul_harq_rtt_timer[CC_id][harq_process_id] > 4) { - // drx_ULRetransmissionTimer should be started here + /* + * TODO: implement the handling of UL asynchronous HARQ + * drx_ULRetransmissionTimer should be (re)started here + */ UE_scheduling_control->ul_harq_rtt_timer[CC_id][harq_process_id] = 0; } } + /* UL synchronous HARQ process */ if (UE_scheduling_control->ul_synchronous_harq_timer[CC_id][harq_process_id] > 0) { UE_scheduling_control->ul_synchronous_harq_timer[CC_id][harq_process_id]++; @@ -684,6 +688,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, UE_scheduling_control->drx_inactivity_timer++; if (UE_scheduling_control->drx_inactivity_timer > (UE_scheduling_control->drx_inactivity_timer_thres + 1)) { + /* Note: the +1 on the threshold is due to information in table C-1 of 36.321 */ UE_scheduling_control->drx_inactivity_timer = 0; /* When timer expires switch into short or long DRX cycle */ @@ -701,7 +706,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, if (UE_scheduling_control->in_short_drx_cycle == TRUE) { UE_scheduling_control->drx_shortCycle_timer++; - /* When the Short DRX cycles are over */ + /* When the Short DRX cycles are over, switch to long DRX cycle */ if (UE_scheduling_control->drx_shortCycle_timer > UE_scheduling_control->drx_shortCycle_timer_thres) { UE_scheduling_control->drx_shortCycle_timer = 0; UE_scheduling_control->in_short_drx_cycle = FALSE; @@ -723,7 +728,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, UE_scheduling_control->drx_longCycle_timer = 0; } - /* Check for error case */ + /* Check for error cases */ if ((UE_scheduling_control->in_short_drx_cycle == TRUE) && (UE_scheduling_control->in_long_drx_cycle == TRUE)) { LOG_E(MAC, "Error in C-DRX: UE id %d is in both short and long DRX cycle. Should not happen. Back it to long cycle only\n", UE_id); UE_scheduling_control->in_short_drx_cycle = FALSE; @@ -750,21 +755,23 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, * ONLY here. The variable can then be used for testing the actual state of the UE for scheduling purpose. */ UE_template = &(UE_list->UE_template[CC_id][UE_id]); - /* (a)synchronous HARQ Processes handling for Active Time */ + /* (a)synchronous HARQ processes handling for Active Time */ for (int harq_process_id = 0; harq_process_id < 8; harq_process_id++) { if (UE_scheduling_control->drx_retransmission_timer[harq_process_id] > 0) { harq_active_time_condition = TRUE; - active_time_condition = 2; + active_time_condition = 2; // for tracing purpose break; } } + /* Active time conditions */ if (UE_scheduling_control->on_duration_timer > 0 || UE_scheduling_control->drx_inactivity_timer > 1 || harq_active_time_condition || UE_template->ul_SR > 0) { UE_scheduling_control->in_active_time = TRUE; + } else { UE_scheduling_control->in_active_time = FALSE; } @@ -774,11 +781,11 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_ON_DURATION_TIMER, (unsigned long) UE_scheduling_control->on_duration_timer); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_INACTIVITY, (unsigned long) UE_scheduling_control->drx_inactivity_timer); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_SHORT_CYCLE, (unsigned long) UE_scheduling_control->drx_shortCycle_timer); - //VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SHORT_DRX_CYCLE_NUMBER, (unsigned long) UE_scheduling_control->short_drx_cycle); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_LONG_CYCLE, (unsigned long) UE_scheduling_control->drx_longCycle_timer); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_RETRANSMISSION_HARQ0, (unsigned long) UE_scheduling_control->drx_retransmission_timer[0]); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_ACTIVE_TIME, (unsigned long) UE_scheduling_control->in_active_time); + /* For tracing purpose */ if (UE_template->ul_SR > 0) { active_time_condition = 1; } else if ((UE_scheduling_control->on_duration_timer > 0) && (active_time_condition == 0)) { @@ -790,7 +797,9 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_ACTIVE_TIME_CONDITION, (unsigned long) active_time_condition); } /* END VCD */ - } else { // end if CDRX is configured + + } else { // else: CDRX not configured + /* Note: (UL) HARQ RTT timers processing is done here and can be used by other features than CDRX */ /* HARQ RTT timers */ for (int harq_process_id = 0; harq_process_id < 8; harq_process_id++) { if (UE_scheduling_control->harq_rtt_timer[CC_id][harq_process_id] > 0) { @@ -988,7 +997,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, schedule_ue_spec_phy_test(module_idP,frameP,subframeP,mbsfn_status); } - // Allocate CCEs for good after scheduling is done + /* Allocate CCEs for good after scheduling is done */ for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { if (cc[CC_id].tdd_Config == NULL || !(is_UL_sf(&cc[CC_id],subframeP))) { allocate_CCEs(module_idP, CC_id, frameP, subframeP, 2); From 8359b9684ed1e3f7d9f7f85bb1a3de5e8ef69806 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Fri, 5 Apr 2019 08:28:23 +0200 Subject: [PATCH 04/44] Cleanup of mac.h and mac_proto.h --- openair2/LAYER2/MAC/mac.h | 14 ++++++++++---- openair2/LAYER2/MAC/mac_proto.h | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h index a00e5ec4e6..8a956bd7b9 100644 --- a/openair2/LAYER2/MAC/mac.h +++ b/openair2/LAYER2/MAC/mac.h @@ -1003,8 +1003,8 @@ typedef struct { /* HARQ RRT Timers */ /// (UL) HARQ RTT timers, especially used for CDRX operations, one timer per cell per harq process (and per user) uint8_t harq_rtt_timer[NFAPI_CC_MAX][8]; - uint8_t ul_harq_rtt_timer[NFAPI_CC_MAX][8]; // Note: UL HARQ RTT timers are only for asynchronous HARQ processes!! - uint8_t ul_synchronous_harq_timer[NFAPI_CC_MAX][8]; + uint8_t ul_harq_rtt_timer[NFAPI_CC_MAX][8]; // Note: UL HARQ RTT timers are only for asynchronous HARQ processes + uint8_t ul_synchronous_harq_timer[NFAPI_CC_MAX][8]; // These timers are used for UL synchronous HARQ processes /* C-DRX related timers */ /* Note: only valid for FDD when this comment is written (11-01-19)*/ @@ -1012,7 +1012,11 @@ typedef struct { boolean_t cqi_mask_boolean; /// is TRUE if the following drx parameters are configured for UE boolean_t cdrx_configured; - /// if TRUE, the scheduler should bypass in_active_time and consider the UE as active + /* + * if TRUE, the scheduler should bypass in_active_time and consider the UE as active + * This can be needed, especially during the RRC configuration process, when the context is + * configured on the eNB side, but not yet on the UE side... + */ boolean_t bypass_cdrx; /// is TRUE if the UE is in "Active Time", hence listening to PDCCH boolean_t in_active_time; @@ -1026,7 +1030,7 @@ typedef struct { boolean_t in_short_drx_cycle; /// drxShortCycleTimer int (1..16) (number of short DRX cycles duration before long DRX cycles) uint8_t drx_shortCycle_timer_value; - /// shortDRX-Cycle (duration of a short DRX cycle) + /// shortDRX-Cycle (duration of one short DRX cycle) uint16_t short_drx_cycle_duration; /// DRX short cycle timer before switching to long DRX cycle = drx_shortCycle_timer_value * short_drx_cycle_duration uint16_t drx_shortCycle_timer; @@ -1041,6 +1045,8 @@ typedef struct { /// DRX retransmission timer, one per DL HARQ process uint8_t drx_retransmission_timer[8]; uint8_t drx_retransmission_timer_thres[8]; + /// DRX UL retransmission timer, one per UL HARQ process + /* Not implemented yet */ /* End of C-DRX related timers */ } UE_sched_ctrl; diff --git a/openair2/LAYER2/MAC/mac_proto.h b/openair2/LAYER2/MAC/mac_proto.h index 6e2a00fd30..93b1cd3134 100644 --- a/openair2/LAYER2/MAC/mac_proto.h +++ b/openair2/LAYER2/MAC/mac_proto.h @@ -1275,13 +1275,13 @@ void pre_scd_nb_rbs_required( module_id_t module_idP, uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX]); #endif -/*Slice related functions */ +/* Slice related functions */ uint16_t nb_rbs_allowed_slice(float rb_percentage, int total_rbs); int ue_dl_slice_membership(module_id_t mod_id, int UE_id, int slice_idx); int ue_ul_slice_membership(module_id_t mod_id, int UE_id, int slice_idx); /* DRX Configuration */ -/* Configure local DRX timers and thresh following the drx_configuration input */ +/* Configure local DRX timers and thresholds in UE context, following the drx_configuration input */ void eNB_Config_Local_DRX(module_id_t Mod_id, rnti_t rnti, LTE_DRX_Config_t *drx_Configuration); /* from here: prototypes to get rid of compilation warnings: doc to be written by function author */ From 7817358197a9e93791c407cb2cde0f93ed676e71 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Fri, 5 Apr 2019 11:56:29 +0200 Subject: [PATCH 05/44] Cleanup of enb_config.c config.c asn1_msg.c asn1_msg.h --- openair2/ENB_APP/enb_config.c | 2 +- openair2/LAYER2/MAC/config.c | 4 ++-- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 16 ++++++++++++++-- openair2/RRC/LTE/MESSAGES/asn1_msg.h | 4 ++-- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index f8f8d1bd76..45cb590893 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -1189,7 +1189,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_Config_present = LTE_DRX_Config_PR_setup; } else { AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for drx_Config_present choice: prNothing,prRelease,prSetup !\n", + "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for drx_Config_present choice: prNothing, prRelease, prSetup!\n", RC.config_file_name, i, ccparams_lte.drx_Config_present); } diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 00a4e44ff6..e7373ff843 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -1058,9 +1058,9 @@ void eNB_Config_Local_DRX( return; } - /* Modify scheduling control structure according to DRX configuration */ + /* Modify scheduling control structure according to DRX configuration: doesn't support every configurations! */ UE_scheduling_control->cdrx_configured = TRUE; - UE_scheduling_control->bypass_cdrx = TRUE; + UE_scheduling_control->bypass_cdrx = TRUE; // set to true first, waiting for the UE to configure CDRX on its side UE_scheduling_control->in_active_time = FALSE; UE_scheduling_control->on_duration_timer = 0; diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index 278ea40fed..0dea3c5e2c 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -317,13 +317,22 @@ uint8_t do_MIB_SL(const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index, return((enc_rval.encoded+7)/8); } - -LTE_DRX_Config_t *do_DrxConfig(uint8_t Mod_id, int CC_id, RrcConfigurationReq *configuration, LTE_UE_EUTRA_Capability_t *UEcap) +//----------------------------------------------------------------------------- +/* + * Generate the configuration structure for CDRX feature + */ +LTE_DRX_Config_t *do_DrxConfig(uint8_t Mod_id, + int CC_id, + RrcConfigurationReq *configuration, + LTE_UE_EUTRA_Capability_t *UEcap) +//----------------------------------------------------------------------------- { LTE_DRX_Config_t *drxConfig = NULL; BIT_STRING_t *featureGroupIndicators = NULL; bool ueSupportCdrxShortFlag = false; bool ueSupportCdrxLongFlag = false; + + /* Check the UE capabilities for short and long CDRX cycles support */ if (UEcap) { featureGroupIndicators = UEcap->featureGroupIndicators; if (featureGroupIndicators) { @@ -339,6 +348,7 @@ LTE_DRX_Config_t *do_DrxConfig(uint8_t Mod_id, int CC_id, RrcConfigurationReq *c if (drxConfig == NULL) return NULL; memset(drxConfig, 0, sizeof(LTE_DRX_Config_t)); + /* Long DRX cycle support is mandatory for CDRX activation */ if (!ueSupportCdrxLongFlag || configuration == NULL) { drxConfig->present = LTE_DRX_Config_PR_release; } else { @@ -405,6 +415,8 @@ LTE_DRX_Config_t *do_DrxConfig(uint8_t Mod_id, int CC_id, RrcConfigurationReq *c default: break; } + + /* Short DRX cycle configuration */ if (!ueSupportCdrxShortFlag || configuration->radioresourceconfig[CC_id].drx_shortDrx_ShortCycleTimer == 0) { drxConfig->choice.setup.shortDRX = NULL; } else { diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.h b/openair2/RRC/LTE/MESSAGES/asn1_msg.h index 331a3ca312..6e3fa6dd60 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.h +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.h @@ -71,12 +71,12 @@ uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich ); /** -\brief Generate configuration for DRX_Config +\brief Generate configuration structure for DRX_Config @param Mod_id Instance of eNB @param CC_id Id of component to configure @param configuration Pointer Configuration Request structure @param UEcap Pointer Configuration UE capablities -@return DRX_Config structure pointer or NULL => error*/ +@return DRX_Config structure pointer or NULL => error */ LTE_DRX_Config_t *do_DrxConfig(uint8_t Mod_id, int CC_id, RrcConfigurationReq *configuration, LTE_UE_EUTRA_Capability_t *UEcap); /** From a73f639d8a7ff28561a1cc5dd8075ebcee8707ff Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Tue, 9 Apr 2019 10:01:48 +0200 Subject: [PATCH 06/44] Cleanup of rrc_eNB.c --- openair2/ENB_APP/enb_config.c | 2 +- openair2/RRC/LTE/rrc_eNB.c | 389 ++++++++++++++-------------------- 2 files changed, 166 insertions(+), 225 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 45cb590893..78f6d31e67 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -1395,7 +1395,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "") == 0 || ccparams_lte.drx_shortDrx_ShortCycleTimer == 0) { if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "") != 0 || ccparams_lte.drx_shortDrx_ShortCycleTimer != 0) { AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d incoherent values \"%s\" - \"%d\" for drx_shortDrx_Cycle or drx_shortDrx_ShortCycleTimer choice !\n", + "Failed to parse eNB configuration file %s, enb %d incoherent values \"%s\" - \"%d\" for drx_shortDrx_Cycle or drx_shortDrx_ShortCycleTimer choice !\n", RC.config_file_name, i, ccparams_lte.drx_shortDrx_Cycle, ccparams_lte.drx_shortDrx_ShortCycleTimer); } else { RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = -1; diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 26eefcaec5..346d8b7ff7 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -2737,19 +2737,22 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_release( const protocol_ buffer, PDCP_TRANSMISSION_MODE_CONTROL); } + //----------------------------------------------------------------------------- -void -rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP, - rrc_eNB_ue_context_t *const ue_context_pP, - const uint8_t ho_state - ) +/* + * Generate the basic (first) RRC Connection Reconfiguration (non BR UE) + */ +void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP, + rrc_eNB_ue_context_t *const ue_context_pP, + const uint8_t ho_state) //----------------------------------------------------------------------------- { - uint8_t buffer[RRC_BUF_SIZE]; - uint16_t size; - int i; - // configure SRB1/SRB2, PhysicalConfigDedicated, LTE_MAC_MainConfig for UE - eNB_RRC_INST *rrc_inst = RC.rrc[ctxt_pP->module_id]; + uint8_t buffer[RRC_BUF_SIZE]; + uint16_t size; + int i; + + /* Configure SRB1/SRB2, PhysicalConfigDedicated, LTE_MAC_MainConfig for UE */ + eNB_RRC_INST *rrc_inst = RC.rrc[ctxt_pP->module_id]; struct LTE_PhysicalConfigDedicated **physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated; struct LTE_SRB_ToAddMod *SRB2_config = NULL; struct LTE_SRB_ToAddMod__rlc_Config *SRB2_rlc_config = NULL; @@ -2757,7 +2760,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons struct LTE_LogicalChannelConfig__ul_SpecificParameters *SRB2_ul_SpecificParameters = NULL; LTE_SRB_ToAddModList_t *SRB_configList = ue_context_pP->ue_context.SRB_configList; - LTE_SRB_ToAddModList_t **SRB_configList2 = NULL; + LTE_SRB_ToAddModList_t **SRB_configList2 = NULL; struct LTE_DRB_ToAddMod *DRB_config = NULL; struct LTE_RLC_Config *DRB_rlc_config = NULL; struct LTE_PDCP_Config *DRB_pdcp_config = NULL; @@ -2767,7 +2770,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons struct LTE_LogicalChannelConfig__ul_SpecificParameters *DRB_ul_SpecificParameters = NULL; LTE_DRB_ToAddModList_t **DRB_configList = &ue_context_pP->ue_context.DRB_configList; - LTE_DRB_ToAddModList_t **DRB_configList2 = NULL; + LTE_DRB_ToAddModList_t **DRB_configList2 = NULL; LTE_MAC_MainConfig_t *mac_MainConfig = NULL; LTE_MeasObjectToAddModList_t *MeasObj_list = NULL; LTE_MeasObjectToAddMod_t *MeasObj = NULL; @@ -2776,29 +2779,31 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons *ReportConfig_A2, *ReportConfig_A3, *ReportConfig_A4, *ReportConfig_A5; LTE_MeasIdToAddModList_t *MeasId_list = NULL; LTE_MeasIdToAddMod_t *MeasId0, *MeasId1, *MeasId2, *MeasId3, *MeasId4, *MeasId5; + #if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0)) - long *sr_ProhibitTimer_r9 = NULL; - // uint8_t sCellIndexToAdd = rrc_find_free_SCell_index(enb_mod_idP, ue_mod_idP, 1); - //uint8_t sCellIndexToAdd = 0; + long *sr_ProhibitTimer_r9 = NULL; #endif - long *logicalchannelgroup, *logicalchannelgroup_drb; - long *maxHARQ_Tx, *periodicBSR_Timer; + + long *logicalchannelgroup = NULL; + long *logicalchannelgroup_drb = NULL; + long *maxHARQ_Tx = NULL; + long *periodicBSR_Timer = NULL; LTE_RSRP_Range_t *rsrp = NULL; struct LTE_MeasConfig__speedStatePars *Sparams = NULL; LTE_QuantityConfig_t *quantityConfig = NULL; - //LTE_CellsToAddMod_t *CellToAdd = NULL; - //LTE_CellsToAddModList_t *CellsToAddModList = NULL; - struct LTE_RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *dedicatedInfoNASList = NULL; + struct LTE_RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList + *dedicatedInfoNASList = NULL; LTE_DedicatedInfoNAS_t *dedicatedInfoNas = NULL; - /* for no gcc warnings */ - (void)dedicatedInfoNas; + + /* For no gcc warnings */ + (void) dedicatedInfoNas; LTE_C_RNTI_t *cba_RNTI = NULL; int x2_enabled; uint8_t xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); //Transaction_id, uint8_t cc_id = ue_context_pP->ue_context.primaryCC_id; LTE_UE_EUTRA_Capability_t *UEcap = ue_context_pP->ue_context.UE_Capability; -#ifdef CBA - //struct PUSCH_CBAConfigDedicated_vlola *pusch_CBAConfigDedicated_vlola; + +#ifdef CBA // Contention Based Access uint8_t *cba_RNTI_buf; cba_RNTI = CALLOC(1, sizeof(LTE_C_RNTI_t)); cba_RNTI_buf = CALLOC(1, 2 * sizeof(uint8_t)); @@ -2806,27 +2811,33 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons cba_RNTI->size = 2; cba_RNTI->bits_unused = 0; - // associate UEs to the CBa groups as a function of their UE id + /* Associate UEs to the CBA groups as a function of their UE id */ if (rrc_inst->num_active_cba_groups) { cba_RNTI->buf[0] = rrc_inst->cba_rnti[ue_mod_idP % rrc_inst->num_active_cba_groups] & 0xff; cba_RNTI->buf[1] = 0xff; - LOG_D(RRC, - "[eNB %d] Frame %d: cba_RNTI = %x in group %d is attribued to UE %d\n", - enb_mod_idP, frameP, + LOG_D(RRC, "[eNB %d] Frame %d: cba_RNTI = %x in group %d is attribued to UE %d\n", + enb_mod_idP, + frameP, rrc_inst->cba_rnti[ue_mod_idP % rrc_inst->num_active_cba_groups], ue_mod_idP % rrc_inst->num_active_cba_groups, ue_mod_idP); } else { cba_RNTI->buf[0] = 0x0; cba_RNTI->buf[1] = 0x0; - LOG_D(RRC, "[eNB %d] Frame %d: no cba_RNTI is configured for UE %d\n", enb_mod_idP, frameP, ue_mod_idP); + LOG_D(RRC, "[eNB %d] Frame %d: no cba_RNTI is configured for UE %d\n", + enb_mod_idP, + frameP, + ue_mod_idP); } - #endif - T(T_ENB_RRC_CONNECTION_RECONFIGURATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), - T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); - // Configure SRB2 - /// SRB2 - SRB_configList2=&ue_context_pP->ue_context.SRB_configList2[xid]; + + T(T_ENB_RRC_CONNECTION_RECONFIGURATION, + T_INT(ctxt_pP->module_id), + T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), + T_INT(ctxt_pP->rnti)); + + /* Configure SRB2 */ + SRB_configList2 = &(ue_context_pP->ue_context.SRB_configList2[xid]); if (*SRB_configList2) { free(*SRB_configList2); @@ -2851,22 +2862,19 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons SRB2_lchan_config->present = LTE_SRB_ToAddMod__logicalChannelConfig_PR_explicitValue; SRB2_ul_SpecificParameters = CALLOC(1, sizeof(*SRB2_ul_SpecificParameters)); SRB2_ul_SpecificParameters->priority = 3; // let some priority for SRB1 and dedicated DRBs - SRB2_ul_SpecificParameters->prioritisedBitRate = - LTE_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity; - SRB2_ul_SpecificParameters->bucketSizeDuration = - LTE_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50; - // LCG for CCCH and DCCH is 0 as defined in 36331 + SRB2_ul_SpecificParameters->prioritisedBitRate = LTE_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity; + SRB2_ul_SpecificParameters->bucketSizeDuration = LTE_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50; + + /* LCG for CCCH and DCCH is 0 as defined in 36331 */ logicalchannelgroup = CALLOC(1, sizeof(long)); *logicalchannelgroup = 0; SRB2_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup; SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters = SRB2_ul_SpecificParameters; - // this list has the configuration for SRB1 and SRB2 - ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config); - // this list has only the configuration for SRB2 - ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config); + + ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config); // this list has the configuration for SRB1 and SRB2 + ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config); // this list has only the configuration for SRB2 - // Configure DRB - //*DRB_configList = CALLOC(1, sizeof(*DRB_configList)); + /* Configure DRB */ // list for all the configured DRB if (*DRB_configList) { free(*DRB_configList); @@ -2874,8 +2882,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons *DRB_configList = CALLOC(1, sizeof(**DRB_configList)); memset(*DRB_configList, 0, sizeof(**DRB_configList)); - // list for the configured DRB for a this xid - DRB_configList2=&ue_context_pP->ue_context.DRB_configList2[xid]; + + DRB_configList2=&ue_context_pP->ue_context.DRB_configList2[xid]; // list for the configured DRB for a this xid if (*DRB_configList2) { free(*DRB_configList2); @@ -2883,17 +2891,17 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons *DRB_configList2 = CALLOC(1, sizeof(**DRB_configList2)); memset(*DRB_configList2, 0, sizeof(**DRB_configList2)); - /// DRB + DRB_config = CALLOC(1, sizeof(*DRB_config)); DRB_config->eps_BearerIdentity = CALLOC(1, sizeof(long)); *(DRB_config->eps_BearerIdentity) = 5L; // LW set to first value, allowed value 5..15, value : x+4 - // DRB_config->drb_Identity = (LTE_DRB_Identity_t) 1; //allowed values 1..32 // NN: this is the 1st DRB for this ue, so set it to 1 DRB_config->drb_Identity = (LTE_DRB_Identity_t) 1; // (ue_mod_idP+1); //allowed values 1..32, value: x DRB_config->logicalChannelIdentity = CALLOC(1, sizeof(long)); *(DRB_config->logicalChannelIdentity) = (long)3; // value : x+2 DRB_rlc_config = CALLOC(1, sizeof(*DRB_rlc_config)); DRB_config->rlc_Config = DRB_rlc_config; + #ifdef RRC_DEFAULT_RAB_IS_AM DRB_rlc_config->present = LTE_RLC_Config_PR_am; DRB_rlc_config->choice.am.ul_AM_RLC.t_PollRetransmit = LTE_T_PollRetransmit_ms50; @@ -2906,21 +2914,25 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons DRB_rlc_config->present = LTE_RLC_Config_PR_um_Bi_Directional; DRB_rlc_config->choice.um_Bi_Directional.ul_UM_RLC.sn_FieldLength = LTE_SN_FieldLength_size10; DRB_rlc_config->choice.um_Bi_Directional.dl_UM_RLC.sn_FieldLength = LTE_SN_FieldLength_size10; + #ifdef CBA - DRB_rlc_config->choice.um_Bi_Directional.dl_UM_RLC.t_Reordering = LTE_T_Reordering_ms5;//T_Reordering_ms25; + DRB_rlc_config->choice.um_Bi_Directional.dl_UM_RLC.t_Reordering = LTE_T_Reordering_ms5; //T_Reordering_ms25; #else DRB_rlc_config->choice.um_Bi_Directional.dl_UM_RLC.t_Reordering = LTE_T_Reordering_ms35; #endif + #endif + DRB_pdcp_config = CALLOC(1, sizeof(*DRB_pdcp_config)); DRB_config->pdcp_Config = DRB_pdcp_config; DRB_pdcp_config->discardTimer = CALLOC(1, sizeof(long)); *DRB_pdcp_config->discardTimer = LTE_PDCP_Config__discardTimer_infinity; DRB_pdcp_config->rlc_AM = NULL; DRB_pdcp_config->rlc_UM = NULL; - /* avoid gcc warnings */ + /* Avoid gcc warnings */ (void)PDCP_rlc_AM; (void)PDCP_rlc_UM; + #ifdef RRC_DEFAULT_RAB_IS_AM // EXMIMO_IOT PDCP_rlc_AM = CALLOC(1, sizeof(*PDCP_rlc_AM)); DRB_pdcp_config->rlc_AM = PDCP_rlc_AM; @@ -2930,23 +2942,25 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons DRB_pdcp_config->rlc_UM = PDCP_rlc_UM; PDCP_rlc_UM->pdcp_SN_Size = LTE_PDCP_Config__rlc_UM__pdcp_SN_Size_len12bits; #endif + DRB_pdcp_config->headerCompression.present = LTE_PDCP_Config__headerCompression_PR_notUsed; DRB_lchan_config = CALLOC(1, sizeof(*DRB_lchan_config)); DRB_config->logicalChannelConfig = DRB_lchan_config; DRB_ul_SpecificParameters = CALLOC(1, sizeof(*DRB_ul_SpecificParameters)); DRB_lchan_config->ul_SpecificParameters = DRB_ul_SpecificParameters; - DRB_ul_SpecificParameters->priority = 12; // lower priority than srb1, srb2 and other dedicated bearer - DRB_ul_SpecificParameters->prioritisedBitRate =LTE_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_kBps8 ; - //LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity; - DRB_ul_SpecificParameters->bucketSizeDuration = - LTE_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50; + DRB_ul_SpecificParameters->priority = 12; // lower priority than srb1, srb2 and other dedicated bearer + DRB_ul_SpecificParameters->prioritisedBitRate = LTE_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_kBps8; // LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity; + DRB_ul_SpecificParameters->bucketSizeDuration = LTE_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50; // LCG for DTCH can take the value from 1 to 3 as defined in 36331: normally controlled by upper layers (like RRM) logicalchannelgroup_drb = CALLOC(1, sizeof(long)); *logicalchannelgroup_drb = 1; DRB_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup_drb; + ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config); ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config); - //ue_context_pP->ue_context.DRB_configList2[0] = &(*DRB_configList); + + /* MAC Main Config */ + // The different parts of MAC main config are set below mac_MainConfig = CALLOC(1, sizeof(*mac_MainConfig)); ue_context_pP->ue_context.mac_MainConfig = mac_MainConfig; mac_MainConfig->ul_SCH_Config = CALLOC(1, sizeof(*mac_MainConfig->ul_SCH_Config)); @@ -2969,7 +2983,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf200; // sf20 = 20 subframes // LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf1000 mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange = LTE_MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB3; // Value dB1 =1 dB, dB3 = 3 dB - if (rrc_inst->carrier[cc_id].sib1->tdd_Config == NULL) { // CDRX configured in case of FDD + if (rrc_inst->carrier[cc_id].sib1->tdd_Config == NULL) { // CDRX can be only configured in case of FDD (09/04/19) LOG_D(RRC, "Processing the DRX configuration in RRC Connection Reconfiguration\n"); /* Process the IE drx_Config */ @@ -2982,50 +2996,9 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons /* Set timers and thresholds values in local MAC context of UE */ eNB_Config_Local_DRX(ctxt_pP->module_id, ue_context_pP->ue_id_rnti, mac_MainConfig->drx_Config); - /* BEGIN DEBUG LAD*/ - eNB_MAC_INST *eNB_mac = NULL; - UE_list_t *UE_list_mac = NULL; - int UE_id = -1; - UE_sched_ctrl *UE_scheduling_control = NULL; + LOG_D(RRC, "DRX configured in mac main config for RRC Connection Reconfiguration\n"); - eNB_mac = RC.mac[ctxt_pP->module_id]; - UE_list_mac = &eNB_mac->UE_list; - UE_id = find_UE_id(ctxt_pP->module_id, ue_context_pP->ue_id_rnti); - UE_scheduling_control = &(UE_list_mac->UE_sched_ctrl[UE_id]); - - LOG_W(MAC, "Values to check: on_duration_timer = %d ; on_duration_timer_thres = %d \n \ - drx_inactivity_timer = %d ; drx_inactivity_timer_thres = %d \n \ - drx_shortCycle_timer = %d ; drx_shortCycle_timer_thres = %d \n \ - short_drx_cycle_duration = %d ; drx_shortCycle_timer_value = %d \n \ - drx_long_timer = %d ; drx_long_timer_thres = %d \n \ - drx_start_offset = %d ; \n \ - drx_retransmission_timer0 = %d ; drx_retransmission_timer2 = %d ; drx_retransmission_timer4 = %d ; drx_retransmission_timer7 = %d ; \n \ - drx_retransmission_timer_thres0 = %d ; drx_retransmission_timer_thres2 = %d ; drx_retransmission_timer_thres4 = %d ; drx_retransmission_timer_thres7 = %d; \n \ - cqi_mask_boolean = %d ; cdrx_configured = %d\n", - UE_scheduling_control->on_duration_timer, - UE_scheduling_control->on_duration_timer_thres, - UE_scheduling_control->drx_inactivity_timer, - UE_scheduling_control->drx_inactivity_timer_thres, - UE_scheduling_control->drx_shortCycle_timer, - UE_scheduling_control->drx_shortCycle_timer_thres, - UE_scheduling_control->short_drx_cycle_duration, - UE_scheduling_control->drx_shortCycle_timer_value, - UE_scheduling_control->drx_longCycle_timer, - UE_scheduling_control->drx_longCycle_timer_thres, - UE_scheduling_control->drx_start_offset, - UE_scheduling_control->drx_retransmission_timer[0], - UE_scheduling_control->drx_retransmission_timer[2], - UE_scheduling_control->drx_retransmission_timer[4], - UE_scheduling_control->drx_retransmission_timer[7], - UE_scheduling_control->drx_retransmission_timer_thres[0], - UE_scheduling_control->drx_retransmission_timer_thres[2], - UE_scheduling_control->drx_retransmission_timer_thres[4], - UE_scheduling_control->drx_retransmission_timer_thres[7], - UE_scheduling_control->cqi_mask_boolean, - UE_scheduling_control->cdrx_configured); - /* END DEBUG LAD */ - - } else { // CDRX not ready for TDD + } else { // CDRX not implemented for TDD (09/04/19) mac_MainConfig->drx_Config = NULL; } @@ -3034,12 +3007,11 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons *sr_ProhibitTimer_r9 = 0; // SR tx on PUCCH, Value in number of SR period(s). Value 0 = no timer for SR, Value 2 = 2*SR mac_MainConfig->ext1 = CALLOC(1, sizeof(struct LTE_MAC_MainConfig__ext1)); mac_MainConfig->ext1->sr_ProhibitTimer_r9 = sr_ProhibitTimer_r9; - //sps_RA_ConfigList_rlola = NULL; #endif - //change the transmission mode for the primary component carrier - //TODO: add codebook subset restriction here - //TODO: change TM for secondary CC in SCelltoaddmodlist + // change the transmission mode for the primary component carrier + // TODO: add codebook subset restriction here + // TODO: change TM for secondary CC in SCelltoaddmodlist if (*physicalConfigDedicated) { if ((*physicalConfigDedicated)->antennaInfo) { (*physicalConfigDedicated)->antennaInfo->choice.explicitValue.transmissionMode = rrc_inst->configuration.radioresourceconfig[0].ue_TransmissionMode; @@ -3101,19 +3073,6 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons #else *((*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportModeAperiodic) = LTE_CQI_ReportConfig__cqi_ReportModeAperiodic_rm31; // HLC CQI, single PMI #endif - /* For testing with CDRX */ - /* Periodic report can't work because NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE is not supported yet! */ - /* - (*physicalConfigDedicated)->cqi_ReportConfig->nomPDSCH_RS_EPRE_Offset = 0; // 0 dB - (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic = CALLOC(1, sizeof((*(*physicalConfigDedicated)).cqi_ReportConfig->cqi_ReportPeriodic)); - (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->present = LTE_CQI_ReportPeriodic_PR_setup; - (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex = 0; // n2_pucch - (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex = 17; // I_cqi/pmi: 17 => 20ms - (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present = LTE_CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI; // subband CQI - (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.choice.subbandCQI.k = 4; - (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex = NULL; - (*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.simultaneousAckNackAndCQI = 0; - */ } } else { LOG_E(RRC,"cqi_ReportConfig not present in physical_config_dedicated. Not reconfiguring!\n"); @@ -3326,30 +3285,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons CALLOC(1, sizeof(*(quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ))); *quantityConfig->quantityConfigEUTRA->filterCoefficientRSRP = LTE_FilterCoefficient_fc4; *quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ = LTE_FilterCoefficient_fc4; -#if 0 - LOG_I(RRC, - "[eNB %d] Frame %d: potential handover preparation: store the information in an intermediate structure in case of failure\n", - ctxt_pP->module_id, ctxt_pP->frame); - // store the information in an intermediate structure for Hanodver management - //rrc_inst->handover_info.as_config.sourceRadioResourceConfig.srb_ToAddModList = CALLOC(1,sizeof()); - ue_context_pP->ue_context.handover_info = CALLOC(1, sizeof(*(ue_context_pP->ue_context.handover_info))); - //memcpy((void *)rrc_inst->handover_info[ue_mod_idP]->as_config.sourceRadioResourceConfig.srb_ToAddModList,(void *)SRB_list,sizeof(LTE_SRB_ToAddModList_t)); - ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.srb_ToAddModList = *SRB_configList2; - //memcpy((void *)rrc_inst->handover_info[ue_mod_idP]->as_config.sourceRadioResourceConfig.drb_ToAddModList,(void *)DRB_list,sizeof(LTE_DRB_ToAddModList_t)); - ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.drb_ToAddModList = *DRB_configList; - ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.drb_ToReleaseList = NULL; - ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.mac_MainConfig = - CALLOC(1, sizeof(*ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.mac_MainConfig)); - memcpy((void *)ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.mac_MainConfig, - (void *)mac_MainConfig, sizeof(LTE_MAC_MainConfig_t)); - ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.physicalConfigDedicated = - CALLOC(1, sizeof(LTE_PhysicalConfigDedicated_t)); - memcpy((void *)ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.physicalConfigDedicated, - (void *)ue_context_pP->ue_context.physicalConfigDedicated, sizeof(LTE_PhysicalConfigDedicated_t)); - ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.sps_Config = NULL; - //memcpy((void *)rrc_inst->handover_info[ue_mod_idP]->as_config.sourceRadioResourceConfig.sps_Config,(void *)rrc_inst->sps_Config[ue_mod_idP],sizeof(SPS_Config_t)); -#endif - //} + /* Initialize NAS list */ dedicatedInfoNASList = CALLOC(1, sizeof(struct LTE_RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList)); @@ -3370,7 +3306,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons // ue_context_pP->ue_context.e_rab[i].param.sgw_addr; // ue_context_pP->ue_context.e_rab[i].param.gtp_teid; } - /* TODO should test if e RAB are Ok before! */ + + /* TODO should test if e RAB are OK before! */ ue_context_pP->ue_context.e_rab[i].status = E_RAB_STATUS_DONE; LOG_D(RRC, "setting the status for the default DRB (index %d) to (%d,%s)\n", i, ue_context_pP->ue_context.e_rab[i].status, "E_RAB_STATUS_DONE"); @@ -3385,38 +3322,35 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons x2_enabled = is_x2ap_enabled(); memset(buffer, 0, RRC_BUF_SIZE); + size = do_RRCConnectionReconfiguration(ctxt_pP, buffer, - xid, //Transaction_id, - (LTE_SRB_ToAddModList_t *)*SRB_configList2, // SRB_configList - (LTE_DRB_ToAddModList_t *)*DRB_configList, - (LTE_DRB_ToReleaseList_t *)NULL, // DRB2_list, - (struct LTE_SPS_Config *)NULL, // *sps_Config, - (struct LTE_PhysicalConfigDedicated *)*physicalConfigDedicated, - //#ifdef EXMIMO_IOT - // NULL, NULL, NULL,NULL, - //#else - x2_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, - x2_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, - x2_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, - x2_enabled ? (LTE_MeasIdToAddModList_t *)MeasId_list : NULL, - //#endif - (LTE_MAC_MainConfig_t *)mac_MainConfig, - (LTE_MeasGapConfig_t *)NULL, - (LTE_MobilityControlInfo_t *)NULL, - (LTE_SecurityConfigHO_t *)NULL, - (struct LTE_MeasConfig__speedStatePars *)Sparams, - (LTE_RSRP_Range_t *)rsrp, - (LTE_C_RNTI_t *)cba_RNTI, - (struct LTE_RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *)dedicatedInfoNASList, - (LTE_SL_CommConfig_r12_t *)NULL, - (LTE_SL_DiscConfig_r12_t *)NULL + xid, // Transaction_id, + (LTE_SRB_ToAddModList_t *) *SRB_configList2, // SRB_configList + (LTE_DRB_ToAddModList_t *) *DRB_configList, + (LTE_DRB_ToReleaseList_t *) NULL, // DRB2_list, + (struct LTE_SPS_Config *) NULL, // *sps_Config, + (struct LTE_PhysicalConfigDedicated *) *physicalConfigDedicated, + x2_enabled ? (LTE_MeasObjectToAddModList_t *) MeasObj_list : NULL, + x2_enabled ? (LTE_ReportConfigToAddModList_t *) ReportConfig_list : NULL, + x2_enabled ? (LTE_QuantityConfig_t *) quantityConfig : NULL, + x2_enabled ? (LTE_MeasIdToAddModList_t *) MeasId_list : NULL, + (LTE_MAC_MainConfig_t *) mac_MainConfig, + (LTE_MeasGapConfig_t *) NULL, + (LTE_MobilityControlInfo_t *) NULL, + (LTE_SecurityConfigHO_t *) NULL, + (struct LTE_MeasConfig__speedStatePars *) Sparams, + (LTE_RSRP_Range_t *) rsrp, + (LTE_C_RNTI_t *) cba_RNTI, + (struct LTE_RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *) dedicatedInfoNASList, + (LTE_SL_CommConfig_r12_t *) NULL, + (LTE_SL_DiscConfig_r12_t *) NULL #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) - , (LTE_SCellToAddMod_r10_t *)NULL + , (LTE_SCellToAddMod_r10_t *) NULL #endif ); - LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)buffer,size, - "[MSG] RRC Connection Reconfiguration\n"); + + LOG_DUMPMSG(RRC, DEBUG_RRC,(char *)buffer, size, "[MSG] RRC Connection Reconfiguration\n"); /* Free all NAS PDUs */ for (i = 0; i < ue_context_pP->ue_context.nb_of_e_rabs; i++) { @@ -3427,30 +3361,38 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons } } - LOG_I(RRC, - "[eNB %d] Frame %d, Hello there! Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes %d, UE id %x)\n", - ctxt_pP->module_id, ctxt_pP->frame, size, ue_context_pP->ue_context.rnti); - 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, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); - rrc_data_req( - ctxt_pP, - DCCH, - rrc_eNB_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + LOG_I(RRC, "[eNB %d] Frame %d, Hello there! Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes %d, UE id %x)\n", + ctxt_pP->module_id, + ctxt_pP->frame, + size, + ue_context_pP->ue_context.rnti); + + 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, + ctxt_pP->module_id, + DCCH); + + MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, + MSC_RRC_UE, + buffer, + size, + MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", + MSC_AS_TIME_ARGS(ctxt_pP), + ue_context_pP->ue_context.rnti, + rrc_eNB_mui, + size); + + rrc_data_req(ctxt_pP, + DCCH, + rrc_eNB_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } //----------------------------------------------------------------------------- @@ -5506,7 +5448,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ue_context_pP->ue_context.ue_reestablishment_timer = 0; ue_context_pP->ue_context.ue_rrc_inactivity_timer = 1; // reset rrc inactivity timer - /* CDRX: activated */ + /* CDRX: activated because acknowledged */ int UE_id_mac = find_UE_id(ctxt_pP->module_id, ue_context_pP->ue_context.rnti); RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id_mac].bypass_cdrx = FALSE; @@ -5610,37 +5552,36 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( if (ue_context_pP->ue_context.DRB_active[drb_id] == 0) { ue_context_pP->ue_context.DRB_active[drb_id] = 1; - LOG_D(RRC, - "[eNB %d] Frame %d: Establish RLC UM Bidirectional, DRB %d Active\n", + LOG_D(RRC, "[eNB %d] Frame %d: Establish RLC UM Bidirectional, DRB %d Active\n", ctxt_pP->module_id, ctxt_pP->frame, (int)DRB_configList->list.array[i]->drb_Identity); if (!EPC_MODE_ENABLED && !ENB_NAS_USE_TUN) { - LOG_I(OIP, "[eNB %d] trying to bring up the OAI interface oai%d\n", - ctxt_pP->module_id, - ctxt_pP->module_id); - oip_ifup = nas_config( - ctxt_pP->module_id, // interface index - ctxt_pP->module_id + 1, // thrid octet - ctxt_pP->module_id + 1, // fourth octet - "oai"); + LOG_I(OIP, "[eNB %d] trying to bring up the OAI interface oai%d\n", + ctxt_pP->module_id, + ctxt_pP->module_id); - if (oip_ifup == 0) { // interface is up --> send a config the DRB - module_id_t ue_module_id; - dest_ip_offset = 8; - LOG_I(OIP, - "[eNB %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n", - ctxt_pP->module_id, ctxt_pP->module_id, - (long int)((ue_context_pP->local_uid * LTE_maxDRB) + DRB_configList->list.array[i]->drb_Identity)); - ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[ctxt_pP->module_id][ue_context_pP->local_uid]; - rb_conf_ipv4(0, //add - ue_module_id, //cx - ctxt_pP->module_id, //inst - (ue_module_id * LTE_maxDRB) + DRB_configList->list.array[i]->drb_Identity, // RB - 0, //dscp - ipv4_address(ctxt_pP->module_id + 1, ctxt_pP->module_id + 1), //saddr - ipv4_address(ctxt_pP->module_id + 1, dest_ip_offset + ue_module_id + 1)); //daddr - LOG_D(RRC, "[eNB %d] State = Attached (UE rnti %x module id %u)\n", - ctxt_pP->module_id, ue_context_pP->ue_context.rnti, ue_module_id); + oip_ifup = nas_config(ctxt_pP->module_id, // interface index + ctxt_pP->module_id + 1, // third octet + ctxt_pP->module_id + 1, // fourth octet + "oai"); + + if (oip_ifup == 0) { // interface is up --> send a config the DRB + module_id_t ue_module_id; + dest_ip_offset = 8; + LOG_I(OIP, + "[eNB %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n", + ctxt_pP->module_id, ctxt_pP->module_id, + (long int)((ue_context_pP->local_uid * LTE_maxDRB) + DRB_configList->list.array[i]->drb_Identity)); + ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[ctxt_pP->module_id][ue_context_pP->local_uid]; + rb_conf_ipv4(0, //add + ue_module_id, //cx + ctxt_pP->module_id, //inst + (ue_module_id * LTE_maxDRB) + DRB_configList->list.array[i]->drb_Identity, // RB + 0, //dscp + ipv4_address(ctxt_pP->module_id + 1, ctxt_pP->module_id + 1), //saddr + ipv4_address(ctxt_pP->module_id + 1, dest_ip_offset + ue_module_id + 1)); //daddr + LOG_D(RRC, "[eNB %d] State = Attached (UE rnti %x module id %u)\n", + ctxt_pP->module_id, ue_context_pP->ue_context.rnti, ue_module_id); } /* oip_ifup */ } /* !EPC_MODE_ENABLED && ENB_NAS_USE_TUN*/ @@ -7626,7 +7567,7 @@ void rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) pthread_mutex_unlock(&rrc_release_freelist); if ((ue_context_p->ue_context.ue_rrc_inactivity_timer > 0) && (RC.rrc[ctxt_pP->module_id]->configuration.rrc_inactivity_timer_thres > 0)) { - ue_context_p->ue_context.ue_rrc_inactivity_timer++; // (un)comment this line to (de)activate the RRC inactivity timer + ue_context_p->ue_context.ue_rrc_inactivity_timer++; if (ue_context_p->ue_context.ue_rrc_inactivity_timer >= RC.rrc[ctxt_pP->module_id]->configuration.rrc_inactivity_timer_thres) { LOG_I(RRC, "Removing UE %x instance because of rrc_inactivity_timer timeout\n", From 3406634b6b48cb648b8e58c829f88d2b8138c8fa Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Wed, 10 Apr 2019 08:48:37 +0200 Subject: [PATCH 07/44] This is version 1.0. To test. Cleanup of phy_procedures_lte_eNb.c eNB_scheduler_dlsch.c eNB_scheduler_ulsch.c pre_processor.c and asn1_msg.c --- openair1/SCHED/phy_procedures_lte_eNb.c | 25 +------- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 75 ++++------------------- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 36 +++++------ openair2/LAYER2/MAC/pre_processor.c | 56 +++++++++-------- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 16 +++-- 5 files changed, 71 insertions(+), 137 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 25b4a46a96..77d9e82d20 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1619,7 +1619,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) { //----------------------------------------------------------------------------- /* - * Release the harq if its round is >= 'after_rounds' + * Release the harq process if its round is >= 'after_rounds' */ static void do_release_harq(PHY_VARS_eNB *eNB, int UE_id, @@ -1683,26 +1683,6 @@ static void do_release_harq(PHY_VARS_eNB *eNB, } #endif - /* - LOG_I(PHY, "UE_id = %d; Frame %d, subframe %d: Releasing harq %d for UE %x, CC_id = %d; HARQ RTT Timer = %d,%d,%d,%d,%d,%d,%d,%d, drx-ReTX = %d, cdrx-configured = %d\n", - UE_id_mac, - frame, - subframe, - harq_pid, - dlsch0->rnti, - eNB->CC_id, - UE_scheduling_control->harq_rtt_timer[eNB->CC_id][0], - UE_scheduling_control->harq_rtt_timer[eNB->CC_id][1], - UE_scheduling_control->harq_rtt_timer[eNB->CC_id][2], - UE_scheduling_control->harq_rtt_timer[eNB->CC_id][3], - UE_scheduling_control->harq_rtt_timer[eNB->CC_id][4], - UE_scheduling_control->harq_rtt_timer[eNB->CC_id][5], - UE_scheduling_control->harq_rtt_timer[eNB->CC_id][6], - UE_scheduling_control->harq_rtt_timer[eNB->CC_id][7], - UE_scheduling_control->drx_retransmission_timer[harq_pid], - UE_scheduling_control->cdrx_configured); - */ - if (dlsch0_harq->round >= after_rounds) { dlsch0_harq->status = SCH_IDLE; dlsch0->harq_mask &= ~(1 << harq_pid); @@ -1766,7 +1746,8 @@ static void do_release_harq(PHY_VARS_eNB *eNB, } static void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subframe,uint16_t mask, int is_ack) { - /* Maximum number of DL transmissions = 4. + /* + * Maximum number of DL transmissions = 4. * TODO: get the value from configuration. * If is_ack is true then we release immediately. The value -1 can be used for that. */ diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 59d4b3f157..b5ef7bb751 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -457,6 +457,9 @@ void getRepetition(UE_TEMPLATE * pue_template,unsigned int *maxRep , unsigned i } //------------------------------------------------------------------------------ +/* +* Schedule the DLSCH +*/ void schedule_ue_spec(module_id_t module_idP, int slice_idxP, @@ -564,14 +567,13 @@ schedule_ue_spec(module_id_t module_idP, } } - //weight = get_ue_weight(module_idP,UE_id); aggregation = 2; for (CC_id = 0, eNB_stats = &eNB->eNB_stats[0]; CC_id < nb_mac_CC; CC_id++, eNB_stats++) { dl_Bandwidth = cc[CC_id].mib->message.dl_Bandwidth; N_RB_DL[CC_id] = to_prb(dl_Bandwidth); - min_rb_unit[CC_id] = get_min_rb_unit(module_idP, - CC_id); + min_rb_unit[CC_id] = get_min_rb_unit(module_idP, CC_id); + // get number of PRBs less those used by common channels total_nb_available_rb[CC_id] = N_RB_DL[CC_id]; @@ -603,14 +605,6 @@ schedule_ue_spec(module_id_t module_idP, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PREPROCESSOR, VCD_FUNCTION_OUT); - //RC.mac[module_idP]->slice_info.slice_counter--; - // Do the multiplexing and actual allocation only when all slices have been pre-processed. - //if (RC.mac[module_idP]->slice_info.slice_counter > 0) { - //stop_meas(&eNB->schedule_dlsch); - //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH, VCD_FUNCTION_OUT); - //return; - //} - if (RC.mac[module_idP]->slice_info.interslice_share_active) { dlsch_scheduler_interslice_multiplexing(module_idP, frameP, @@ -776,7 +770,6 @@ schedule_ue_spec(module_id_t module_idP, /* Process retransmission */ if (round_DL != 8) { - //if (round_DL > 0) { // get freq_allocation nb_rb = ue_template->nb_rb[harq_pid]; TBS = get_TBS_DL(ue_template->oldmcs1[harq_pid], @@ -785,28 +778,12 @@ schedule_ue_spec(module_id_t module_idP, if (nb_rb <= nb_available_rb) { /* CDRX */ ue_sched_ctrl->harq_rtt_timer[CC_id][harq_pid] = 1; // restart HARQ RTT timer - /* - LOG_W(MAC, "HELLO : round!=8 UE_id = %d, frame = %d; subframe = %d; CC_id %d, harq_pid = %d , RTT_timer = %d,%d,%d,%d,%d,%d,%d,%d\n", - UE_id, - frameP, - subframeP, - CC_id, - harq_pid, - ue_sched_ctrl->harq_rtt_timer[CC_id][0], - ue_sched_ctrl->harq_rtt_timer[CC_id][1], - ue_sched_ctrl->harq_rtt_timer[CC_id][2], - ue_sched_ctrl->harq_rtt_timer[CC_id][3], - ue_sched_ctrl->harq_rtt_timer[CC_id][4], - ue_sched_ctrl->harq_rtt_timer[CC_id][5], - ue_sched_ctrl->harq_rtt_timer[CC_id][6], - ue_sched_ctrl->harq_rtt_timer[CC_id][7]); - */ if (ue_sched_ctrl->cdrx_configured) { ue_sched_ctrl->drx_retransmission_timer[harq_pid] = 0; // stop drx retransmission - /* May be a problem with drx_retransmission_timer[harq_pid]. Here the timer is reset not stop. - * Can create a problem with several CC_id with the same UE?? - */ + /* + * Note: contrary to the spec drx_retransmission_timer[harq_pid] is reset not stop. + */ if (harq_pid == 0) { VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_RETRANSMISSION_HARQ0, (unsigned long) ue_sched_ctrl->drx_retransmission_timer[0]); } @@ -850,14 +827,6 @@ schedule_ue_spec(module_id_t module_idP, } nb_available_rb -= nb_rb; - /* - eNB->mu_mimo_mode[UE_id].pre_nb_available_rbs = nb_rb; - eNB->mu_mimo_mode[UE_id].dl_pow_off = ue_sched_ctrl->dl_pow_off[CC_id]; - - for(j = 0; j < N_RBG[CC_id]; ++j) { - eNB->mu_mimo_mode[UE_id].rballoc_sub[j] = ue_template->rballoc_subband[harq_pid][j]; - } - */ switch (get_tmode(module_idP, CC_id, UE_id)) { case 1: @@ -1283,6 +1252,7 @@ schedule_ue_spec(module_id_t module_idP, header_length_total += header_length_last; num_sdus++; ue_sched_ctrl->uplane_inactivity_timer = 0; + // reset RRC inactivity timer after uplane activity ue_contextP = rrc_eNB_get_ue_context(RC.rrc[module_idP], rnti); @@ -1607,28 +1577,12 @@ schedule_ue_spec(module_id_t module_idP, /* CDRX */ ue_sched_ctrl->harq_rtt_timer[CC_id][harq_pid] = 1; // restart HARQ RTT timer - /* - LOG_W(MAC, "HELLO : round=8, UE_id = %d, frame = %d; subframe = %d ; CC_id %d, harq_pid = %d , RTT_timer = %d,%d,%d,%d,%d,%d,%d,%d\n", - UE_id, - frameP, - subframeP, - CC_id, - harq_pid, - ue_sched_ctrl->harq_rtt_timer[CC_id][0], - ue_sched_ctrl->harq_rtt_timer[CC_id][1], - ue_sched_ctrl->harq_rtt_timer[CC_id][2], - ue_sched_ctrl->harq_rtt_timer[CC_id][3], - ue_sched_ctrl->harq_rtt_timer[CC_id][4], - ue_sched_ctrl->harq_rtt_timer[CC_id][5], - ue_sched_ctrl->harq_rtt_timer[CC_id][6], - ue_sched_ctrl->harq_rtt_timer[CC_id][7]); - */ if (ue_sched_ctrl->cdrx_configured) { ue_sched_ctrl->drx_inactivity_timer = 1; // restart drx inactivity timer when new transmission ue_sched_ctrl->drx_retransmission_timer[harq_pid] = 0; // stop drx retransmission - /* May be a problem with drx_retransmission_timer[harq_pid]. Here the timer is reset not stop. - * Can create a problem with several CC_id with the same UE?? + /* + * Note: contrary to the spec drx_retransmission_timer[harq_pid] is reset not stop. */ VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_INACTIVITY, (unsigned long) ue_sched_ctrl->drx_inactivity_timer); if (harq_pid == 0) { @@ -2050,13 +2004,6 @@ schedule_ue_spec_br(module_id_t module_idP, continue; } - /* CDRX LTE-M */ - if (ue_sched_ctl->cdrx_configured == TRUE) { - if ((ue_sched_ctl->bypass_cdrx == FALSE) && (ue_sched_ctl->in_active_time == FALSE)) { - continue; - } - } - round_DL = ue_sched_ctl->round[CC_id][harq_pid]; AssertFatal (UE_template->physicalConfigDedicated != NULL, "UE_template->physicalConfigDedicated is null\n"); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 52b5f7eff7..6247400ceb 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -235,8 +235,11 @@ rx_sdu(const module_id_t enb_mod_idP, if (UE_scheduling_control->cdrx_configured == TRUE) { /* Synchronous UL HARQ */ UE_scheduling_control->ul_synchronous_harq_timer[CC_idP][harq_pid] = 5; - /* In case of asynchronous UL HARQ process restart here relevant RTT timer - * Stop corresponding CDRX ULRetransmission timer + /* + * The NACK is programmed in n+4 subframes, so UE will have drxRetransmission running. + * Setting ul_synchronous_harq_timer = 5 will trigger drxRetransmission timer. + * Note: in case of asynchronous UL HARQ process restart here relevant RTT timer. + * Start corresponding CDRX ULRetransmission timer. */ } @@ -897,6 +900,7 @@ rx_sdu(const module_id_t enb_mod_idP, /* Reset RRC inactivity timer after uplane activity */ ue_contextP = rrc_eNB_get_ue_context(RC.rrc[enb_mod_idP], current_rnti); + if (ue_contextP != NULL) { ue_contextP->ue_context.ue_rrc_inactivity_timer = 1; } else { @@ -936,9 +940,12 @@ rx_sdu(const module_id_t enb_mod_idP, if (UE_scheduling_control->cdrx_configured == TRUE) { /* Synchronous UL HARQ */ UE_scheduling_control->ul_synchronous_harq_timer[CC_idP][harq_pid] = 5; - /* Note: in case of asynchronous UL HARQ process restart here relevant RTT timer - * Stop corresponding CDRX ULRetransmission timer - */ + /* + * The ACK is programmed in n+4 subframes, so UE will have drxRetransmission running. + * Setting ul_synchronous_harq_timer = 5 will trigger drxRetransmission timer. + * Note: in case of asynchronous UL HARQ process restart here relevant RTT timer + * Stop corresponding CDRX ULRetransmission timer + */ } } @@ -1418,7 +1425,8 @@ schedule_ulsch_rnti(module_id_t module_idP, UE_list->first_rb_offset[CC_id][slice_idx] = cmin(n_rb_ul_tab[CC_id], sli->ul[slice_idx].first_rb); } - /* ULSCH preprocessor: set UE_template-> + /* + * ULSCH preprocessor: set UE_template-> * pre_allocated_nb_rb_ul[slice_idx] * pre_assigned_mcs_ul * pre_allocated_rb_table_index_ul @@ -1434,6 +1442,7 @@ schedule_ulsch_rnti(module_id_t module_idP, if (!ue_ul_slice_membership(module_idP, UE_id, slice_idx)) { continue; } + if (UE_list->UE_template[UE_PCCID(module_idP, UE_id)][UE_id].rach_resource_type > 0) continue; // don't schedule if Msg5 is not received yet @@ -2040,14 +2049,6 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP, continue; } - /* CDRX LTE-M */ - UE_sched_ctrl = &(UE_list->UE_sched_ctrl[UE_id]); - if (UE_sched_ctrl->cdrx_configured == TRUE) { - if ((UE_sched_ctrl->bypass_cdrx == FALSE) && (UE_sched_ctrl->in_active_time == FALSE)) { - continue; - } - } - /* Loop over all active UL CC_ids for this UE */ for (n = 0; n < UE_list->numactiveULCCs[UE_id]; n++) { /* This is the actual CC_id in the list */ @@ -2147,13 +2148,6 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP, /* New transmission */ if (round_UL == 0) { - - /* CDRX LTE-M */ - if (UE_sched_ctrl->cdrx_configured == TRUE) { - UE_sched_ctrl->drx_inactivity_timer = 1; // reset drx inactivity timer when new transmission - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_INACTIVITY, (unsigned long) UE_sched_ctrl->drx_inactivity_timer); - } - ndi = 1 - UE_template->oldNDI_UL[harq_pid]; UE_template->oldNDI_UL[harq_pid] = ndi; diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 3e04e601d3..a25505bab4 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -458,27 +458,28 @@ void decode_slice_positioning(module_id_t Mod_idP, } } - -// This function sorts the UE in order their dlsch buffer and CQI -void -sort_UEs(module_id_t Mod_idP, - int slice_idx, - int frameP, - sub_frame_t subframeP) +//----------------------------------------------------------------------------- +/* + * This function sorts the UEs in order, depending on their dlsch buffer and CQI + */ +void sort_UEs(module_id_t Mod_idP, + int slice_idx, + int frameP, + sub_frame_t subframeP) +//----------------------------------------------------------------------------- { - int i; int list[MAX_MOBILES_PER_ENB]; int list_size = 0; struct sort_ue_dl_params params = {Mod_idP, frameP, subframeP, slice_idx}; - UE_list_t *UE_list = &RC.mac[Mod_idP]->UE_list; + UE_list_t *UE_list = &(RC.mac[Mod_idP]->UE_list); UE_sched_ctrl *UE_scheduling_control = NULL; - for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { + for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) { UE_scheduling_control = &(UE_list->UE_sched_ctrl[i]); + /* Check CDRX configuration and if UE is in active time for this subframe */ if (UE_scheduling_control->cdrx_configured == TRUE) { - if ((UE_scheduling_control->bypass_cdrx == FALSE) && (UE_scheduling_control->in_active_time == FALSE)) { continue; } @@ -496,8 +497,9 @@ sort_UEs(module_id_t Mod_idP, qsort_r(list, list_size, sizeof(int), ue_dl_compare, ¶ms); if (list_size) { - for (i = 0; i < list_size - 1; ++i) + for (int i = 0; i < list_size - 1; ++i) { UE_list->next[list[i]] = list[i + 1]; + } UE_list->next[list[list_size - 1]] = -1; UE_list->head = list[0]; @@ -1992,26 +1994,29 @@ static int ue_ul_compare(const void *_a, const void *_b, void *_params) { return 0; } -void -sort_ue_ul(module_id_t module_idP, - int slice_idx, - int frameP, - sub_frame_t subframeP, - rnti_t *rntiTable) +//----------------------------------------------------------------------------- +/* + * This function sorts the UEs in order, depending on their ulsch buffer and CQI + */ +void sort_ue_ul(module_id_t module_idP, + int slice_idx, + int frameP, + sub_frame_t subframeP, + rnti_t *rntiTable) +//----------------------------------------------------------------------------- { - int i; int list[MAX_MOBILES_PER_ENB]; int list_size = 0; struct sort_ue_ul_params params = { module_idP, frameP, subframeP }; UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; UE_sched_ctrl *UE_scheduling_control = NULL; - for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { + for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) { UE_scheduling_control = &(UE_list->UE_sched_ctrl[i]); + /* Check CDRX configuration and if UE is in active time for this subframe */ if (UE_scheduling_control->cdrx_configured == TRUE) { - if ((UE_scheduling_control->bypass_cdrx == FALSE) && (UE_scheduling_control->in_active_time == FALSE)) { continue; } @@ -2029,13 +2034,16 @@ sort_ue_ul(module_id_t module_idP, qsort_r(list, list_size, sizeof(int), ue_ul_compare, ¶ms); - if (list_size) { // At mimimum one list element - for (i = 0; i < list_size - 1; i++) + if (list_size) { // At mimimum one list element + + for (int i = 0; i < list_size - 1; i++) { UE_list->next_ul[list[i]] = list[i + 1]; + } UE_list->next_ul[list[list_size - 1]] = -1; UE_list->head_ul = list[0]; - } else { // No element + + } else { // No element UE_list->head_ul = -1; } } diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index 0dea3c5e2c..3ae6fbaea6 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -3546,9 +3546,12 @@ uint16_t do_RRCConnectionReconfiguration_BR(const protocol_ctxt_t* const #endif //------------------------------------------------------------------------------ -uint16_t do_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP, - uint8_t *buffer, - uint8_t Transaction_id, +/* + * Copy the different Information Elements in the RRC structure + */ +uint16_t do_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP, + uint8_t *buffer, + uint8_t Transaction_id, LTE_SRB_ToAddModList_t *SRB_list, LTE_DRB_ToAddModList_t *DRB_list, LTE_DRB_ToReleaseList_t *DRB_list2, @@ -3561,7 +3564,7 @@ uint16_t do_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctx LTE_MAC_MainConfig_t *mac_MainConfig, LTE_MeasGapConfig_t *measGapConfig, LTE_MobilityControlInfo_t *mobilityInfo, - LTE_SecurityConfigHO_t *securityConfigHO, + LTE_SecurityConfigHO_t *securityConfigHO, struct LTE_MeasConfig__speedStatePars *speedStatePars, LTE_RSRP_Range_t *rsrp, LTE_C_RNTI_t *cba_rnti, @@ -3570,7 +3573,7 @@ uint16_t do_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctx LTE_SL_CommConfig_r12_t *sl_CommConfig, LTE_SL_DiscConfig_r12_t *sl_DiscConfig #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) - , LTE_SCellToAddMod_r10_t *SCell_config + , LTE_SCellToAddMod_r10_t *SCell_config #endif ) //------------------------------------------------------------------------------ @@ -3582,7 +3585,8 @@ uint16_t do_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctx dl_dcch_msg.message.present = LTE_DL_DCCH_MessageType_PR_c1; dl_dcch_msg.message.choice.c1.present = LTE_DL_DCCH_MessageType__c1_PR_rrcConnectionReconfiguration; rrcConnectionReconfiguration = &dl_dcch_msg.message.choice.c1.choice.rrcConnectionReconfiguration; - // RRCConnectionReconfiguration + + /* RRC Connection Reconfiguration */ rrcConnectionReconfiguration->rrc_TransactionIdentifier = Transaction_id; rrcConnectionReconfiguration->criticalExtensions.present = LTE_RRCConnectionReconfiguration__criticalExtensions_PR_c1; rrcConnectionReconfiguration->criticalExtensions.choice.c1.present = LTE_RRCConnectionReconfiguration__criticalExtensions__c1_PR_rrcConnectionReconfiguration_r8 ; From 62fba7c03d4a100090c03f6a580295814922efe1 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Wed, 10 Apr 2019 10:19:36 +0200 Subject: [PATCH 08/44] To clean and test: in rrc_eNB.c RRC Connection reconfiguration: CAT-M1 should not be configured --- openair2/RRC/LTE/rrc_eNB.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 346d8b7ff7..19dbd0f6eb 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -2983,22 +2983,48 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf200; // sf20 = 20 subframes // LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf1000 mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange = LTE_MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB3; // Value dB1 =1 dB, dB3 = 3 dB - if (rrc_inst->carrier[cc_id].sib1->tdd_Config == NULL) { // CDRX can be only configured in case of FDD (09/04/19) + /* CDRX Configuration */ + // Need to check if UE is a BR UE + rnti_t rnti = ue_context_pP->ue_id_rnti + module_id_t module_id = ctxt_pP->module_id + int UE_id = find_UE_id(module_id, rnti); + struct eNB_MAC_INST_s mac = RC.mac[module_id]; + UE_list_t UE_list = &(mac->UE_list); + + LOG_W(RRC, "Check equality rnti = %d/%d/%d and UE_id = %d/%d/%d and PCCID = %d/%d\n", + ue_context_pP->ue_id_rnti, + ctxt_pP->rnti, + ue_context_pP->ue_context.rnti, + ue_context_pP->ue_context.ue_initial_id, + find_UE_id(module_id, rnti), + ue_context_pP->local_uid, + UE_PCCID(module_idP, UE_id), + ue_context_pP->ue_context.primaryCC_id); + + if (UE_id != -1) { + if ((rrc_inst->carrier[cc_id].sib1->tdd_Config == NULL) && + (UE_list->UE_template[ue_context_pP->ue_context.primaryCC_id][UE_id].rach_resource_type == 0)) { + // CDRX can be only configured in case of FDD and non BR UE (09/04/19) + LOG_D(RRC, "Processing the DRX configuration in RRC Connection Reconfiguration\n"); /* Process the IE drx_Config */ if (cc_id < MAX_NUM_CCs) { - mac_MainConfig->drx_Config = do_DrxConfig(ctxt_pP->module_id, cc_id, &rrc_inst->configuration, UEcap); // drx_Config IE + mac_MainConfig->drx_Config = do_DrxConfig(module_id, cc_id, &rrc_inst->configuration, UEcap); // drx_Config IE } else { LOG_E(RRC, "Invalid CC_id for DRX configuration\n"); } /* Set timers and thresholds values in local MAC context of UE */ - eNB_Config_Local_DRX(ctxt_pP->module_id, ue_context_pP->ue_id_rnti, mac_MainConfig->drx_Config); + eNB_Config_Local_DRX(module_id, ue_context_pP->ue_id_rnti, mac_MainConfig->drx_Config); LOG_D(RRC, "DRX configured in mac main config for RRC Connection Reconfiguration\n"); - } else { // CDRX not implemented for TDD (09/04/19) + } else { // CDRX not implemented for TDD and LTE-M (09/04/19) + mac_MainConfig->drx_Config = NULL; + } + } else { // UE_id invalid + LOG_E(RRC, "Invalid UE_id found!\n"); mac_MainConfig->drx_Config = NULL; } From 46b0a9fb38feb47286c8f35b2b1d143fee6c5cd0 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Thu, 11 Apr 2019 07:36:05 +0200 Subject: [PATCH 09/44] Remove bypass_cdrx variable and add cdrx_waiting_ack. The CDRX is now activated at RRC COnnection Reconfiguration Complete reception. To Test --- openair2/LAYER2/MAC/config.c | 4 ++-- openair2/LAYER2/MAC/mac.h | 6 +++--- openair2/LAYER2/MAC/pre_processor.c | 4 ++-- openair2/RRC/LTE/rrc_eNB.c | 9 +++++++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index e7373ff843..d55b205cab 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -1059,8 +1059,8 @@ void eNB_Config_Local_DRX( } /* Modify scheduling control structure according to DRX configuration: doesn't support every configurations! */ - UE_scheduling_control->cdrx_configured = TRUE; - UE_scheduling_control->bypass_cdrx = TRUE; // set to true first, waiting for the UE to configure CDRX on its side + UE_scheduling_control->cdrx_configured = FALSE; // will be set to true when ACK is received + UE_scheduling_control->cdrx_waiting_ack = TRUE; // set to true first, waiting for the UE to configure CDRX on its side UE_scheduling_control->in_active_time = FALSE; UE_scheduling_control->on_duration_timer = 0; diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h index 8a956bd7b9..538d174355 100644 --- a/openair2/LAYER2/MAC/mac.h +++ b/openair2/LAYER2/MAC/mac.h @@ -1013,11 +1013,11 @@ typedef struct { /// is TRUE if the following drx parameters are configured for UE boolean_t cdrx_configured; /* - * if TRUE, the scheduler should bypass in_active_time and consider the UE as active - * This can be needed, especially during the RRC configuration process, when the context is + * if TRUE, the eNB has configured the CDRX locally, but is waiting for the UE to acknowledge + * the activation. This is needed, during the RRC configuration process, when the context is * configured on the eNB side, but not yet on the UE side... */ - boolean_t bypass_cdrx; + boolean_t cdrx_waiting_ack; /// is TRUE if the UE is in "Active Time", hence listening to PDCCH boolean_t in_active_time; /// OnDurationTimer diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index a25505bab4..7be70edc43 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -480,7 +480,7 @@ void sort_UEs(module_id_t Mod_idP, /* Check CDRX configuration and if UE is in active time for this subframe */ if (UE_scheduling_control->cdrx_configured == TRUE) { - if ((UE_scheduling_control->bypass_cdrx == FALSE) && (UE_scheduling_control->in_active_time == FALSE)) { + if (UE_scheduling_control->in_active_time == FALSE) { continue; } } @@ -2017,7 +2017,7 @@ void sort_ue_ul(module_id_t module_idP, /* Check CDRX configuration and if UE is in active time for this subframe */ if (UE_scheduling_control->cdrx_configured == TRUE) { - if ((UE_scheduling_control->bypass_cdrx == FALSE) && (UE_scheduling_control->in_active_time == FALSE)) { + if (UE_scheduling_control->in_active_time == FALSE) { continue; } } diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 19dbd0f6eb..923ad83829 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -5474,9 +5474,14 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ue_context_pP->ue_context.ue_reestablishment_timer = 0; ue_context_pP->ue_context.ue_rrc_inactivity_timer = 1; // reset rrc inactivity timer - /* CDRX: activated because acknowledged */ + /* CDRX: activated if ack was expected */ int UE_id_mac = find_UE_id(ctxt_pP->module_id, ue_context_pP->ue_context.rnti); - RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id_mac].bypass_cdrx = FALSE; + UE_sched_ctrl *UE_scheduling_control = &(RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id_mac]) + + if (UE_scheduling_control.cdrx_waiting_ack) == TRUE { + UE_scheduling_control.cdrx_waiting_ack = FALSE; + UE_scheduling_control.cdrx_configured = TRUE; + } T(T_ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE, T_INT(ctxt_pP->module_id), From 85ebe2d261e5c388557e4cfcc7f3d29215e98b3c Mon Sep 17 00:00:00 2001 From: OAI-admin Date: Thu, 11 Apr 2019 08:16:41 +0200 Subject: [PATCH 10/44] Build fix --- openair2/RRC/LTE/rrc_eNB.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 923ad83829..e0fe968f43 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -1306,18 +1306,18 @@ rrc_eNB_generate_RRCConnectionReestablishment( carrier = &(RC.rrc[ctxt_pP->module_id]->carrier[CC_id]); ue_context = &(ue_context_pP->ue_context); - carrier->Srb0.Tx_buffer.payload_size = do_RRCConnectionReestablishment(ctxt_pP, + ue_context->Srb0.Tx_buffer.payload_size = do_RRCConnectionReestablishment(ctxt_pP, ue_context_pP, CC_id, - (uint8_t *) carrier->Srb0.Tx_buffer.Payload, + (uint8_t *) ue_context->Srb0.Tx_buffer.Payload, (uint8_t) carrier->p_eNB, // at this point we do not have the UE capability information, so it can only be TM1 or TM2 rrc_eNB_get_next_transaction_identifier(module_id), SRB_configList, &(ue_context->physicalConfigDedicated)); LOG_DUMPMSG(RRC, DEBUG_RRC, - (char *)(carrier->Srb0.Tx_buffer.Payload), - carrier->Srb0.Tx_buffer.payload_size, + (char *)(ue_context->Srb0.Tx_buffer.Payload), + ue_context->Srb0.Tx_buffer.payload_size, "[MSG] RRCConnectionReestablishment \n"); /* Configure SRB1 for UE */ @@ -1388,16 +1388,16 @@ rrc_eNB_generate_RRCConnectionReestablishment( MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_RRC_UE, - carrier->Srb0.Tx_buffer.Header, - carrier->Srb0.Tx_buffer.payload_size, + ue_context->Srb0.Tx_buffer.Header, + ue_context->Srb0.Tx_buffer.payload_size, MSC_AS_TIME_FMT" LTE_RRCConnectionReestablishment UE %x size %u", MSC_AS_TIME_ARGS(ctxt_pP), ue_context->rnti, - carrier->Srb0.Tx_buffer.payload_size); + ue_context->Srb0.Tx_buffer.payload_size); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating LTE_RRCConnectionReestablishment (bytes %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), - carrier->Srb0.Tx_buffer.payload_size); + ue_context->Srb0.Tx_buffer.payload_size); UE_id = find_UE_id(module_id, rnti); @@ -2985,11 +2985,11 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t /* CDRX Configuration */ // Need to check if UE is a BR UE - rnti_t rnti = ue_context_pP->ue_id_rnti - module_id_t module_id = ctxt_pP->module_id + rnti_t rnti = ue_context_pP->ue_id_rnti; + module_id_t module_id = ctxt_pP->module_id; int UE_id = find_UE_id(module_id, rnti); - struct eNB_MAC_INST_s mac = RC.mac[module_id]; - UE_list_t UE_list = &(mac->UE_list); + eNB_MAC_INST *mac = RC.mac[module_id]; + UE_list_t *UE_list = &(mac->UE_list); LOG_W(RRC, "Check equality rnti = %d/%d/%d and UE_id = %d/%d/%d and PCCID = %d/%d\n", ue_context_pP->ue_id_rnti, @@ -2998,7 +2998,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t ue_context_pP->ue_context.ue_initial_id, find_UE_id(module_id, rnti), ue_context_pP->local_uid, - UE_PCCID(module_idP, UE_id), + UE_PCCID(module_id, UE_id), ue_context_pP->ue_context.primaryCC_id); if (UE_id != -1) { @@ -5460,7 +5460,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ) //----------------------------------------------------------------------------- { - int i, drb_id; + int drb_id; int oip_ifup = 0; int dest_ip_offset = 0; uint8_t *kRRCenc = NULL; @@ -5476,11 +5476,11 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( /* CDRX: activated if ack was expected */ int UE_id_mac = find_UE_id(ctxt_pP->module_id, ue_context_pP->ue_context.rnti); - UE_sched_ctrl *UE_scheduling_control = &(RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id_mac]) + UE_sched_ctrl *UE_scheduling_control = &(RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id_mac]); - if (UE_scheduling_control.cdrx_waiting_ack) == TRUE { - UE_scheduling_control.cdrx_waiting_ack = FALSE; - UE_scheduling_control.cdrx_configured = TRUE; + if (UE_scheduling_control->cdrx_waiting_ack == TRUE) { + UE_scheduling_control->cdrx_waiting_ack = FALSE; + UE_scheduling_control->cdrx_configured = TRUE; } T(T_ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE, @@ -5489,7 +5489,6 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); -#if defined(ENABLE_SECURITY) /* Derive the keys from kenb */ if (DRB_configList != NULL) { derive_key_up_enc(ue_context_pP->ue_context.ciphering_algorithm, From 58082d84b834e0d5fdc26b18186d199abca284c0 Mon Sep 17 00:00:00 2001 From: OAI-admin Date: Thu, 11 Apr 2019 08:37:52 +0200 Subject: [PATCH 11/44] Clean version. Check if there is a bug to fix. --- openair2/RRC/LTE/rrc_eNB.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index e0fe968f43..7aad820408 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -2991,16 +2991,6 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t eNB_MAC_INST *mac = RC.mac[module_id]; UE_list_t *UE_list = &(mac->UE_list); - LOG_W(RRC, "Check equality rnti = %d/%d/%d and UE_id = %d/%d/%d and PCCID = %d/%d\n", - ue_context_pP->ue_id_rnti, - ctxt_pP->rnti, - ue_context_pP->ue_context.rnti, - ue_context_pP->ue_context.ue_initial_id, - find_UE_id(module_id, rnti), - ue_context_pP->local_uid, - UE_PCCID(module_id, UE_id), - ue_context_pP->ue_context.primaryCC_id); - if (UE_id != -1) { if ((rrc_inst->carrier[cc_id].sib1->tdd_Config == NULL) && (UE_list->UE_template[ue_context_pP->ue_context.primaryCC_id][UE_id].rach_resource_type == 0)) { @@ -5481,6 +5471,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( if (UE_scheduling_control->cdrx_waiting_ack == TRUE) { UE_scheduling_control->cdrx_waiting_ack = FALSE; UE_scheduling_control->cdrx_configured = TRUE; + LOG_I(RRC, "CDRX configuration activated after RRC Connection Reconfiguration Complete reception\n"); } T(T_ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE, From 7dc2b231154356322648ebc1beb46f98e8be844c Mon Sep 17 00:00:00 2001 From: OAI-admin Date: Thu, 11 Apr 2019 08:45:27 +0200 Subject: [PATCH 12/44] minor modification in print info --- openair2/RRC/LTE/rrc_eNB.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 7aad820408..2f765e0030 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -3377,7 +3377,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t } } - LOG_I(RRC, "[eNB %d] Frame %d, Hello there! Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes %d, UE id %x)\n", + LOG_I(RRC, "[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes %d, UE id %x)\n", ctxt_pP->module_id, ctxt_pP->frame, size, From 4c931888e6ed5802677b5e0372b2da9617c4f64f Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Mon, 15 Apr 2019 08:54:00 +0200 Subject: [PATCH 13/44] Add dci0_ongoing_timer. Commit to build and test. --- openair2/LAYER2/MAC/config.c | 1 + openair2/LAYER2/MAC/eNB_scheduler.c | 11 ++++++- .../LAYER2/MAC/eNB_scheduler_primitives.c | 29 ++++++++++++++----- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 ++ openair2/LAYER2/MAC/mac.h | 9 +++++- 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index d55b205cab..68777544a0 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -1062,6 +1062,7 @@ void eNB_Config_Local_DRX( UE_scheduling_control->cdrx_configured = FALSE; // will be set to true when ACK is received UE_scheduling_control->cdrx_waiting_ack = TRUE; // set to true first, waiting for the UE to configure CDRX on its side UE_scheduling_control->in_active_time = FALSE; + UE_scheduling_control->dci0_ongoing_timer = 0; UE_scheduling_control->on_duration_timer = 0; switch (drx_Configuration->choice.setup.onDurationTimer) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index b55a5cf1e1..f9a6a4b197 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -790,7 +790,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, active_time_condition = 1; } else if ((UE_scheduling_control->on_duration_timer > 0) && (active_time_condition == 0)) { active_time_condition = 3; - } else if ((UE_scheduling_control->drx_inactivity_timer > 0) && (active_time_condition == 0)) { + } else if ((UE_scheduling_control->drx_inactivity_timer > 1) && (active_time_condition == 0)) { active_time_condition = 4; } @@ -798,6 +798,15 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, } /* END VCD */ + /* DCI0 ongoing timer */ + if (UE_scheduling_control->dci0_ongoing_timer > 1) { + UE_scheduling_control->dci0_ongoing_timer++; + + if (UE_scheduling_control->dci0_ongoing_timer > 3) { + UE_scheduling_control->dci0_ongoing_timer = 0; + } + } + } else { // else: CDRX not configured /* Note: (UL) HARQ RTT timers processing is done here and can be used by other features than CDRX */ /* HARQ RTT timers */ diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 26fcf8ec0f..d245d22486 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -4948,21 +4948,35 @@ SR_indication(module_id_t mod_idP, T_INT(rntiP)); int UE_id = find_UE_id(mod_idP, rntiP); UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; + UE_sched_ctrl *UE_scheduling_ctrl = NULL; if (UE_id != -1) { - if (mac_eNB_get_rrc_status(mod_idP, UE_RNTI(mod_idP, UE_id)) < RRC_CONNECTED) { - LOG_D(MAC, "[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n", + UE_scheduling_ctrl = &(UE_list->UE_sched_ctrl[UE_id]); + + if ((UE_scheduling_ctrl->cdrx_configured == TRUE) && (UE_scheduling_ctrl->dci0_ongoing_timer > 0)) { + LOG_D(MAC, "[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d. \ + The SR is not set do to ongoing DCI0 with CDRX activated\n", mod_idP, rntiP, frameP, subframeP, UE_id, - cc_idP); + cc_idP);) + } else { + if (mac_eNB_get_rrc_status(mod_idP, UE_RNTI(mod_idP, UE_id)) < RRC_CONNECTED) { + LOG_D(MAC, "[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n", + mod_idP, + rntiP, + frameP, + subframeP, + UE_id, + cc_idP); + } + UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; + UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION, 1); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION, 0); } - UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; - UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION, 1); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION, 0); } else { LOG_D(MAC, "[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d (unknown UE_id) on CC_id %d\n", mod_idP, @@ -4972,6 +4986,7 @@ SR_indication(module_id_t mod_idP, UE_id, cc_idP); } + return; } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 6247400ceb..141cba5a6e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1653,6 +1653,8 @@ schedule_ulsch_rnti(module_id_t module_idP, if (UE_sched_ctrl_ptr->cdrx_configured) { UE_sched_ctrl_ptr->drx_inactivity_timer = 1; // reset drx inactivity timer when new transmission VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_INACTIVITY, (unsigned long) UE_sched_ctrl_ptr->drx_inactivity_timer); + UE_sched_ctrl_ptr->dci0_ongoing_timer = 1; // when set the UE_template_ptr->ul_SR cannot be set to 1, + // see definition for more information } if (UE_template_ptr->pre_allocated_rb_table_index_ul >= 0) { diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h index 538d174355..0bc7fafdb8 100644 --- a/openair2/LAYER2/MAC/mac.h +++ b/openair2/LAYER2/MAC/mac.h @@ -1007,7 +1007,7 @@ typedef struct { uint8_t ul_synchronous_harq_timer[NFAPI_CC_MAX][8]; // These timers are used for UL synchronous HARQ processes /* C-DRX related timers */ - /* Note: only valid for FDD when this comment is written (11-01-19)*/ + /* Note: only valid for FDD and LTE UE when this comment is written (11-01-19)*/ /// is TRUE if the cqi mask feature is activated by RRC configuration boolean_t cqi_mask_boolean; /// is TRUE if the following drx parameters are configured for UE @@ -1018,6 +1018,13 @@ typedef struct { * configured on the eNB side, but not yet on the UE side... */ boolean_t cdrx_waiting_ack; + /* + * Is set when a ULSCH scheduling is done and run until the first corresponding transmission is done (4 subframes). + * When set, SR cannot be set for the UE. This allows OAI to avoid concidering a SR as uncompleted if the UE sends + * a SR just after a periodic DCI0 ULSCH scheduling. Without CDRX there is no problem, but with CDRX this case would + * create a lost in timers synchronization. + */ + uint8_t dci0_ongoing_timer; /// is TRUE if the UE is in "Active Time", hence listening to PDCCH boolean_t in_active_time; /// OnDurationTimer From d7cddc28253745675a24a0c3519be07c725cee40 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Mon, 15 Apr 2019 10:57:39 +0200 Subject: [PATCH 14/44] Bug fix of drx_config == PrNothing is now handled. Bug fix for dci0_ongoing not working. To investigate --- openair2/LAYER2/MAC/config.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler.c | 10 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 6 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 3 + openair2/RRC/LTE/MESSAGES/asn1_msg.c | 141 +++++++++--------- 5 files changed, 85 insertions(+), 77 deletions(-) diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 68777544a0..36fff56f08 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -1044,7 +1044,7 @@ void eNB_Config_Local_DRX( /* Check drx_Configuration */ if (drx_Configuration == NULL) { - LOG_E(MAC, "drx_Configuration parameter is NULL, cannot configure local UE parameters\n"); + LOG_I(MAC, "drx_Configuration parameter is NULL, cannot configure local UE parameters\n"); UE_scheduling_control->cdrx_configured = FALSE; return; diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index f9a6a4b197..55007af708 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -799,11 +799,11 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, /* END VCD */ /* DCI0 ongoing timer */ - if (UE_scheduling_control->dci0_ongoing_timer > 1) { - UE_scheduling_control->dci0_ongoing_timer++; - - if (UE_scheduling_control->dci0_ongoing_timer > 3) { - UE_scheduling_control->dci0_ongoing_timer = 0; + if (UE_scheduling_control->dci0_ongoing_timer > 0) { + if (UE_scheduling_control->dci0_ongoing_timer > 7) { + UE_scheduling_control->dci0_ongoing_timer = 0; + } else { + UE_scheduling_control->dci0_ongoing_timer++; } } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index d245d22486..8d59bf0ca1 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -4953,7 +4953,9 @@ SR_indication(module_id_t mod_idP, if (UE_id != -1) { UE_scheduling_ctrl = &(UE_list->UE_sched_ctrl[UE_id]); - if ((UE_scheduling_ctrl->cdrx_configured == TRUE) && (UE_scheduling_ctrl->dci0_ongoing_timer > 0)) { + if ((UE_scheduling_ctrl->cdrx_configured == TRUE) && + (UE_scheduling_ctrl->dci0_ongoing_timer > 4) && + (UE_scheduling_ctrl->dci0_ongoing_timer < 8)) { LOG_D(MAC, "[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d. \ The SR is not set do to ongoing DCI0 with CDRX activated\n", mod_idP, @@ -4961,7 +4963,7 @@ SR_indication(module_id_t mod_idP, frameP, subframeP, UE_id, - cc_idP);) + cc_idP); } else { if (mac_eNB_get_rrc_status(mod_idP, UE_RNTI(mod_idP, UE_id)) < RRC_CONNECTED) { LOG_D(MAC, "[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n", diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 141cba5a6e..b635a8cf99 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -241,6 +241,9 @@ rx_sdu(const module_id_t enb_mod_idP, * Note: in case of asynchronous UL HARQ process restart here relevant RTT timer. * Start corresponding CDRX ULRetransmission timer. */ + + unsigned long active_time_condition = 10; + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_ACTIVE_TIME_CONDITION, (unsigned long) active_time_condition); } first_rb = UE_template_ptr->first_rb_ul[harq_pid]; diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index 3ae6fbaea6..ef43b15584 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -344,6 +344,10 @@ LTE_DRX_Config_t *do_DrxConfig(uint8_t Mod_id, } else LOG_W(RRC,"[do_DrxConfig] No featureGroupIndicators pointer\n"); } else LOG_W(RRC,"[do_DrxConfig] No UEcap pointer\n"); + if (configuration->radioresourceconfig[CC_id].drx_Config_present == LTE_DRX_Config_PR_NOTHING) { + return NULL; + } + drxConfig = (LTE_DRX_Config_t *) malloc(sizeof(LTE_DRX_Config_t)); if (drxConfig == NULL) return NULL; memset(drxConfig, 0, sizeof(LTE_DRX_Config_t)); @@ -355,78 +359,77 @@ LTE_DRX_Config_t *do_DrxConfig(uint8_t Mod_id, drxConfig->present = configuration->radioresourceconfig[CC_id].drx_Config_present; } - if (drxConfig->present != LTE_DRX_Config_PR_NOTHING) { - if (drxConfig->present == LTE_DRX_Config_PR_release) { - drxConfig->choice.release = (NULL_t) 0; - } else { - drxConfig->choice.setup.onDurationTimer = configuration->radioresourceconfig[CC_id].drx_onDurationTimer; - drxConfig->choice.setup.drx_InactivityTimer = configuration->radioresourceconfig[CC_id].drx_InactivityTimer; - drxConfig->choice.setup.drx_RetransmissionTimer = configuration->radioresourceconfig[CC_id].drx_RetransmissionTimer; - drxConfig->choice.setup.longDRX_CycleStartOffset.present = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset_present; - switch (drxConfig->choice.setup.longDRX_CycleStartOffset.present) { - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf10: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf10 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf20: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf20 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf32: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf32 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf40: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf40 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf64: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf64 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf80: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf80 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf128: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf128 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf160: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf160 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf256: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf256 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf320: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf320 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf512: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf512 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf640: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf640 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1024: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf1024 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1280: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf1280 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2048: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf2048 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2560: - drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf2560 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; - break; - default: - break; - } + if (drxConfig->present == LTE_DRX_Config_PR_release) { + drxConfig->choice.release = (NULL_t) 0; + } else { + drxConfig->choice.setup.onDurationTimer = configuration->radioresourceconfig[CC_id].drx_onDurationTimer; + drxConfig->choice.setup.drx_InactivityTimer = configuration->radioresourceconfig[CC_id].drx_InactivityTimer; + drxConfig->choice.setup.drx_RetransmissionTimer = configuration->radioresourceconfig[CC_id].drx_RetransmissionTimer; + drxConfig->choice.setup.longDRX_CycleStartOffset.present = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset_present; + switch (drxConfig->choice.setup.longDRX_CycleStartOffset.present) { + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf10: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf10 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf20: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf20 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf32: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf32 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf40: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf40 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf64: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf64 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf80: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf80 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf128: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf128 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf160: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf160 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf256: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf256 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf320: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf320 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf512: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf512 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf640: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf640 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1024: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf1024 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1280: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf1280 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2048: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf2048 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + case LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2560: + drxConfig->choice.setup.longDRX_CycleStartOffset.choice.sf2560 = configuration->radioresourceconfig[CC_id].drx_longDrx_CycleStartOffset; + break; + default: + break; + } - /* Short DRX cycle configuration */ - if (!ueSupportCdrxShortFlag || configuration->radioresourceconfig[CC_id].drx_shortDrx_ShortCycleTimer == 0) { - drxConfig->choice.setup.shortDRX = NULL; - } else { - drxConfig->choice.setup.shortDRX = MALLOC(sizeof(struct LTE_DRX_Config__setup__shortDRX)); - memset(drxConfig->choice.setup.shortDRX, 0, sizeof(struct LTE_DRX_Config__setup__shortDRX)); - drxConfig->choice.setup.shortDRX->shortDRX_Cycle = configuration->radioresourceconfig[CC_id].drx_shortDrx_Cycle; - drxConfig->choice.setup.shortDRX->drxShortCycleTimer = configuration->radioresourceconfig[CC_id].drx_shortDrx_ShortCycleTimer; - } + /* Short DRX cycle configuration */ + if (!ueSupportCdrxShortFlag || configuration->radioresourceconfig[CC_id].drx_shortDrx_ShortCycleTimer == 0) { + drxConfig->choice.setup.shortDRX = NULL; + } else { + drxConfig->choice.setup.shortDRX = MALLOC(sizeof(struct LTE_DRX_Config__setup__shortDRX)); + memset(drxConfig->choice.setup.shortDRX, 0, sizeof(struct LTE_DRX_Config__setup__shortDRX)); + drxConfig->choice.setup.shortDRX->shortDRX_Cycle = configuration->radioresourceconfig[CC_id].drx_shortDrx_Cycle; + drxConfig->choice.setup.shortDRX->drxShortCycleTimer = configuration->radioresourceconfig[CC_id].drx_shortDrx_ShortCycleTimer; } } + return drxConfig; } From 36cd05bcbaaeaeb5995b812884c7f94812b8f18e Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Tue, 16 Apr 2019 08:22:54 +0200 Subject: [PATCH 15/44] Bug fix: dci0_ongoing timer ok, now impossible to set ul_SR when dci0 is ongoing. --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 8d59bf0ca1..8aba7e779d 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -4954,7 +4954,7 @@ SR_indication(module_id_t mod_idP, UE_scheduling_ctrl = &(UE_list->UE_sched_ctrl[UE_id]); if ((UE_scheduling_ctrl->cdrx_configured == TRUE) && - (UE_scheduling_ctrl->dci0_ongoing_timer > 4) && + (UE_scheduling_ctrl->dci0_ongoing_timer > 0) && (UE_scheduling_ctrl->dci0_ongoing_timer < 8)) { LOG_D(MAC, "[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d. \ The SR is not set do to ongoing DCI0 with CDRX activated\n", diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index b635a8cf99..141cba5a6e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -241,9 +241,6 @@ rx_sdu(const module_id_t enb_mod_idP, * Note: in case of asynchronous UL HARQ process restart here relevant RTT timer. * Start corresponding CDRX ULRetransmission timer. */ - - unsigned long active_time_condition = 10; - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_ACTIVE_TIME_CONDITION, (unsigned long) active_time_condition); } first_rb = UE_template_ptr->first_rb_ul[harq_pid]; From 7b6ac826ffbf656453119bd16ecf7264af009b35 Mon Sep 17 00:00:00 2001 From: OAI-admin Date: Tue, 16 Apr 2019 09:24:38 +0200 Subject: [PATCH 16/44] End of merge from develop --- openair2/ENB_APP/enb_config.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index aed5f7c169..84c2f8e6a7 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -54,13 +54,8 @@ #include "common/config/config_userapi.h" #include "RRC_config_tools.h" #include "enb_paramdef.h" -<<<<<<< HEAD - -#define RRC_INACTIVITY_THRESH 0 // set to '0' to deactivate (in ms) -======= #include "proto_agent.h" #define RRC_INACTIVITY_THRESH 0 ->>>>>>> develop extern uint16_t sf_ahead; extern void set_parallel_conf(char *parallel_conf); @@ -1144,7 +1139,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { break; } -<<<<<<< HEAD if (strcmp(ccparams_lte.pcch_nB, "fourT") == 0) { RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_fourT; } @@ -1452,25 +1446,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { } if (cycleNb > 0 && (offsetMaxLimit % cycleNb != 0 || cycleNb == offsetMaxLimit)) { -======= - if (strcmp(ccparams_lte.pcch_nB, "fourT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_fourT; - } else if (strcmp(ccparams_lte.pcch_nB, "twoT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_twoT; - } else if (strcmp(ccparams_lte.pcch_nB, "oneT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneT; - } else if (strcmp(ccparams_lte.pcch_nB, "halfT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_halfT; - } else if (strcmp(ccparams_lte.pcch_nB, "quarterT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_quarterT; - } else if (strcmp(ccparams_lte.pcch_nB, "oneEighthT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneEighthT; - } else if (strcmp(ccparams_lte.pcch_nB, "oneSixteenthT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneSixteenthT; - } else if (strcmp(ccparams_lte.pcch_nB, "oneThirtySecondT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneThirtySecondT; - } else ->>>>>>> develop AssertFatal (0, "Failed to parse eNB configuration file %s, enb %d incompatible (not multiple) values \"%d\" - \"%d\" for drx_shortDrx_Cycle and drx_longDrx_CycleStartOffset choice !\n", RC.config_file_name, i, cycleNb, offsetMaxLimit); @@ -1485,17 +1460,10 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { } } -<<<<<<< HEAD switch (ccparams_lte.bcch_modificationPeriodCoeff) { case 2: RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n2; break; -======= - switch (ccparams_lte.bcch_modificationPeriodCoeff) { - case 2: - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n2; - break; ->>>>>>> develop case 4: RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n4; From 93fb04ea5f4c7f1c7fb4f226d36427a3470b003e Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Tue, 16 Apr 2019 09:29:20 +0200 Subject: [PATCH 17/44] End of merge from develop --- openair2/ENB_APP/enb_config.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index aed5f7c169..84c2f8e6a7 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -54,13 +54,8 @@ #include "common/config/config_userapi.h" #include "RRC_config_tools.h" #include "enb_paramdef.h" -<<<<<<< HEAD - -#define RRC_INACTIVITY_THRESH 0 // set to '0' to deactivate (in ms) -======= #include "proto_agent.h" #define RRC_INACTIVITY_THRESH 0 ->>>>>>> develop extern uint16_t sf_ahead; extern void set_parallel_conf(char *parallel_conf); @@ -1144,7 +1139,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { break; } -<<<<<<< HEAD if (strcmp(ccparams_lte.pcch_nB, "fourT") == 0) { RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_fourT; } @@ -1452,25 +1446,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { } if (cycleNb > 0 && (offsetMaxLimit % cycleNb != 0 || cycleNb == offsetMaxLimit)) { -======= - if (strcmp(ccparams_lte.pcch_nB, "fourT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_fourT; - } else if (strcmp(ccparams_lte.pcch_nB, "twoT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_twoT; - } else if (strcmp(ccparams_lte.pcch_nB, "oneT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneT; - } else if (strcmp(ccparams_lte.pcch_nB, "halfT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_halfT; - } else if (strcmp(ccparams_lte.pcch_nB, "quarterT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_quarterT; - } else if (strcmp(ccparams_lte.pcch_nB, "oneEighthT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneEighthT; - } else if (strcmp(ccparams_lte.pcch_nB, "oneSixteenthT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneSixteenthT; - } else if (strcmp(ccparams_lte.pcch_nB, "oneThirtySecondT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneThirtySecondT; - } else ->>>>>>> develop AssertFatal (0, "Failed to parse eNB configuration file %s, enb %d incompatible (not multiple) values \"%d\" - \"%d\" for drx_shortDrx_Cycle and drx_longDrx_CycleStartOffset choice !\n", RC.config_file_name, i, cycleNb, offsetMaxLimit); @@ -1485,17 +1460,10 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { } } -<<<<<<< HEAD switch (ccparams_lte.bcch_modificationPeriodCoeff) { case 2: RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n2; break; -======= - switch (ccparams_lte.bcch_modificationPeriodCoeff) { - case 2: - RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n2; - break; ->>>>>>> develop case 4: RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n4; From 49ba4e56696da88282f956931a6ee84f886bfda9 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Tue, 16 Apr 2019 11:51:28 +0200 Subject: [PATCH 18/44] Fix phy_sim build --- openair1/SCHED/phy_procedures_lte_eNb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 65e7011031..80767c0c20 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -40,6 +40,8 @@ #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" +#include "openair2/LAYER2/MAC/mac_proto.h" + #include "assertions.h" #include "msc.h" From 2774e516643c38cd6a385f4e315f89e5118fe3e2 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 16 Apr 2019 14:52:29 +0200 Subject: [PATCH 19/44] DOC: fix some images broken links and also align formatting Signed-off-by: Raphael Defosseux --- doc/BUILD.md | 65 +++++++++++------- doc/FEATURE_SET.md | 4 +- doc/GET_SOURCES.md | 62 +++++++++-------- doc/RUNMODEM.md | 28 +++++--- .../L2-sim-single-server-deployment.png | Bin 0 -> 10803 bytes doc/{ => images}/oai_enb_block_diagram.png | Bin .../oai_lte_enb_func_split_arch.png | Bin 7 files changed, 95 insertions(+), 64 deletions(-) create mode 100644 doc/images/L2-sim-single-server-deployment.png rename doc/{ => images}/oai_enb_block_diagram.png (100%) rename doc/{ => images}/oai_lte_enb_func_split_arch.png (100%) diff --git a/doc/BUILD.md b/doc/BUILD.md index 6d3645948f..1f971b7776 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -1,21 +1,38 @@ -# OAI build procedures + + + + + +
+ + + + + + OAI Build Procedures +
-## soft modem Build script +This page is valid on tags starting from **`2019.w09`**. -oai EPC is developed in a distinct project with it's own [documentation](https://github.com/OPENAIRINTERFACE/openair-cn/wiki) , it is not described here. OAI UE and eNodeB sources can be downloaded from the Eurecom [gitlab repository](./GET_SOURCES.md). Sources come with a build script [build_oai](../cmake_targets/build_oai) located at the root of the `openairinterface5g/cmake_targets` directory. This script is developed to build the oai binaries (executables,shared libraries) for different hardware platforms, and use cases. +# Soft Modem Build Script -the main oai binaries, which are tested by the Continuous Integration process are: +oai EPC is developed in a distinct project with it's own [documentation](https://github.com/OPENAIRINTERFACE/openair-cn/wiki) , it is not described here. -- The LTE UE: `lte-uesoftmodem` +OAI UE and eNodeB sources can be downloaded from the Eurecom [gitlab repository](./GET_SOURCES.md). + +Sources come with a build script [build_oai](../cmake_targets/build_oai) located at the root of the `openairinterface5g/cmake_targets` directory. This script is developed to build the oai binaries (executables,shared libraries) for different hardware platforms, and use cases. + +The main oai binaries, which are tested by the Continuous Integration process are: + +- The LTE UE: `lte-uesoftmodem` - The LTE eNodeB: `lte-softmodem` -- The PHY simulators: `dlsim` and `ulsim` +- The PHY simulators: `dlsim` and `ulsim` The build system for OAI uses [cmake](https://cmake.org/) which is a tool to generate makefiles. The `build_oai` script is a wrapper using cmake, make and standard linux shell commands to ease the oai build and use . The file describing how to build the executables from source files is the [CMakeLists.txt](../cmake_targets/CMakeLists.txt), it is used as input by cmake to generate the makefiles. The oai softmodem supports many use cases, and new ones are regularly added. Most of them are accessible using the configuration file or the command line options and continuous effort is done to avoid introducing build options as it makes tests and usage more complicated than run-time options. The following functionalities, originally requiring a specific build are now accessible by configuration or command line options: - s1, noS1 - - all simulators, with exception of PHY simulators, which are distinct executables. @@ -23,15 +40,13 @@ Calling the `build_oai` script with the -h option gives the list of all availabl [table]: BUILD.md "`build_oai` options" - at the end of this page to know the status of `buid_oai` options which are not described hereafter. +At the end of this page to know the status of `buid_oai` options which are not described hereafter. +# Building PHY Simulators +Detailed information about these simulators can be found [in this dedicated page](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/OpenAirLTEPhySimul) -## building PHY simulators - -detailed information about these simulators can be found [in this dedicated page](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/OpenAirLTEPhySimul - -## building UE and eNodeB executables +# Building UE and eNodeB Executables After downloading the source files, a single build command can be used to get the binaries supporting all the oai softmodem use cases (UE and eNodeB): @@ -42,34 +57,32 @@ cd ../cmake_targets/ ./build_oai -I -w USRP --eNB --UE ``` -- The -I option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed. -- The -w option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one,`liboai_usrpdevif.so` . USRP is the only hardware tested today in the Continuous Integration process. -- --eNB is to build the `lte-softmodem` executable and all required shared libraries -- --UE is to build the `lte-uesoftmodem` executable and all required shared libraries +- The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed. +- The `-w` option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one,`liboai_usrpdevif.so` . USRP is the only hardware tested today in the Continuous Integration process. +- `--eNB` is to build the `lte-softmodem` executable and all required shared libraries +- `--UE` is to build the `lte-uesoftmodem` executable and all required shared libraries You can build the eNodeB and the UE separately, you may not need both of them depending on your oai usage. After completing the build, the binaries are available in the `cmake_targets/lte_build_oai/build` directory. A copy is also available in the `target/bin` directory, with all binaries suffixed by the 3GPP release number, today .Rel14 by default. It must be noticed that the option for building for a specific 3GPP release number is not tested by the CI and may be removed in the future. -## building optional binaries +# Building Optional Binaries -### Telnet server +## Telnet Server -​ The telnet server can be built with the --build-telnet option, after building the softmodem or while building it. +The telnet server can be built with the --build-telnet option, after building the softmodem or while building it. `./build_oai -I -w USRP --eNB --UE --build-telnetsrv` -​ or +or `./build_oai --build-telnetsrv` -### USRP record player +## USRP record player -​ The USRP record player today needs a specific build. Work to make it available as a run time option is under consideration +The USRP record player today needs a specific build. Work to make it available as a run time option is under consideration - - -## `build_oai` options +# `build_oai` options | Option | Status | Description | | ----------------------------------------------------------- | ------------------------------------------- | :----------------------------------------------------------- | diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index 7e2cc30388..043d47f7db 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -18,7 +18,7 @@ # OpenAirInterface Block diagram # -![Block Diagram](./oai_enb_block_diagram.png) +![Block Diagram](./images/oai_enb_block_diagram.png) # OpenAirInterface eNB Feature Set # @@ -141,7 +141,7 @@ The X2AP layer is based on **3GPP 36.423** v14.6.0 and implements the following - RAU: Radio-Access Unit - RRU: Remote Radio-Unit -![Functional Split Architecture](./oai_lte_enb_func_split_arch.png) +![Functional Split Architecture](./images/oai_lte_enb_func_split_arch.png) - IF4.5 / IF5 : similar to IEEE P1914.1 - FAPI (IF2) : specified by Small Cell Forum (open-nFAPI implementation) diff --git a/doc/GET_SOURCES.md b/doc/GET_SOURCES.md index bd85c8a926..e27e9dbb74 100644 --- a/doc/GET_SOURCES.md +++ b/doc/GET_SOURCES.md @@ -1,10 +1,22 @@ -# The OpenAirInterface repository + + + + + +
+ + + + + + The OpenAirInterface repository: the sources +
The OpenAirInterface software can be obtained from our gitLab server. You will need a git client to get the sources. The repository is currently used for main developments. -## Prerequisite +# Prerequisites You need to install the subversion/git using the following commands: @@ -13,17 +25,23 @@ sudo apt-get update sudo apt-get install subversion git ``` -## Using EURECOM Gitlab +# Using EURECOM Gitlab The [openairinterface5g repository](https://gitlab.eurecom.fr/oai/openairinterface5g.git) holds the source code for (eNB RAN + UE RAN). For legal issues (licenses), the core network (EPC) source code is now moved away from -the above openairinterface5g git repository. This EPC code is now splitted into two git -projects ([openair-cn](https://gitlab.eurecom.fr/oai/openair-cn.git) with apache license -and [xtables-addons-oai](https://gitlab.eurecom.fr/oai/xtables-addons-oai.git) with GPL license). +the above openairinterface5g git repository. -Configure git with your name/email address (only important if you are developer and want to checkin code to Git): +* A very old version of the EPC is located under the same GitLab Eurecom server (splitted into 2 Git repos): + * [openair-cn](https://gitlab.eurecom.fr/oai/openair-cn.git) with apache license + * [xtables-addons-oai](https://gitlab.eurecom.fr/oai/xtables-addons-oai.git) with GPL license + * **These repositories are no more maintained.** +* A more recent version is available under our GitHub domain: + * [OAI GitHub openair-cn](https://github.com/OPENAIRINTERFACE/openair-cn) + * Check its wiki pages for more details + +Configure git with your name/email address (only important if you are developer and want to contribute/push code to Git Repository): ```shell git config --global user.name "Your Name" @@ -42,42 +60,30 @@ echo -n | openssl s_client -showcerts -connect gitlab.eurecom.fr:443 2>/dev/null git config --global http.sslverify false ``` -### In order to checkout the Git repository (for OAI Users without login to gitlab server) +## In order to clone the Git repository (for OAI Users without login to gitlab server) -Checkout RAN repository (eNB RAN + UE RAN): +Cloning RAN repository (eNB RAN + UE RAN): ```shell git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git ``` -Checkout EPC (Core Network) repository: +## In order to contribute to the Git RAN repository (for OAI Developers/admins with login to gitlab server) -```shell -git clone https://gitlab.eurecom.fr/oai/openair-cn.git -``` - -Optionally (openair-cn build script can install it for you): - -```shell -git clone https://gitlab.eurecom.fr/oai/xtables-addons-oai.git -``` - -### In order to checkout the Git repository (for OAI Developers/admins with login to gitlab server) - -Please send email to {openair_tech (AT) eurecom (DOT) fr} to be added to the repository +Please send email to [contact@openairinterface.org](mailto:contact@openairinterface.org) to be added to the repository as a developer (only important for users who want to commit code to the repository). If -you do not have account on gitlab.eurecom.fr, please register yourself to gitlab.eurecom.fr. +you do not have account on gitlab.eurecom.fr, please register yourself to gitlab.eurecom.fr and provide the identifiant in the email. -* Checkout with using ssh keys: +* Clone with using ssh keys: * You will need to put your ssh keys in https://gitlab.eurecom.fr/profile/keys - to access to the git repo. Once that is done, checkout the git repository using: + to access to the git repo. Once that is done, clone the git repository using: * `git clone git@gitlab.eurecom.fr:oai/openairinterface5g.git` -* Checkout with user name/password prompt: +* Clone with user name/password prompt: * `git clone https://YOUR_USERNAME@gitlab.eurecom.fr/oai/openairinterface5g.git` * `git clone https://YOUR_USERNAME@gitlab.eurecom.fr/oai/openair-cn.git` * `git clone https://YOUR_USERNAME@gitlab.eurecom.fr/oai/xtables-addons-oai.git` (optional, openair-cn build script can do it for you) -## Which branch to checkout? +# Which branch to checkout? On the RAN side: diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index de2c53074b..314c2cc78b 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -1,10 +1,22 @@ -# Running OAI softmodem + + + + + +
+ + + + + + Running OAI Softmodem +
After you have [built the softmodem executables](BUILD.md) you can set your default directory to the build directory `cmake_targets/lte_build_oai/build/` and start testing some use cases. Below, the description of the different oai functionalities should help you choose the oai configuration that suits your need. -## rf simulator +# RF Simulator - The rf simulator is a oai device replacing the radio heads (for example the USRP device). It allows connecting the oai UE and the oai eNodeB through a network interface carrying the time-domain samples, getting rid of over the air unpredictable perturbations. This is the ideal tool to check signal processing algorithms and protocols implementation. +The rf simulator is a oai device replacing the radio heads (for example the USRP device). It allows connecting the oai UE and the oai eNodeB through a network interface carrying the time-domain samples, getting rid of over the air unpredictable perturbations. This is the ideal tool to check signal processing algorithms and protocols implementation. It is planned to enhance this simulator with the following functionalities: @@ -14,15 +26,15 @@ It is planned to enhance this simulator with the following functionalities: This is an easy use-case to setup and test, as no specific hardware is required. The [rfsimulator page](../targets/ARCH/rfsimulator/README.md ) contains the detailed documentation. -## l2 nfapi simulator +# L2 nFAPI Simulator This simulator connects a eNodeB and UEs through a nfapi interface, short-cutting the L1 layer. The objective of this simulator is to allow multi UEs simulation, with a large number of UEs (ideally up to 255 ) .Here to ease the platform setup, UEs are simulated via a single `lte-uesoftmodem` instance. Today the CI tests just with one UE and architecture has to be reviewed to allow a number of UE above about 16. This work is on-going. - As for the rf simulator, no specific hardware is required. The [L2 nfapi simlator page](L2NFAPI.md) contains the detailed documentation. +As for the rf simulator, no specific hardware is required. The [L2 nfapi simlator page](L2NFAPI.md) contains the detailed documentation. -## l1 simulator +# L1 Simulator -The l1 simulator is using the ethernet fronthaul protocol, as used to connect a RRU and a RAU to connect UEs and a eNodeB. UEs are simulated in a single `lte-uesoftmodem` process, as for the nfapi simulator. +The L1 simulator is using the ethernet fronthaul protocol, as used to connect a RRU and a RAU to connect UEs and a eNodeB. UEs are simulated in a single `lte-uesoftmodem` process, as for the nfapi simulator. The [L1 simulator page](L1SIM.md) contains the detailed documentation. @@ -34,7 +46,7 @@ By default the noS1 mode is using linux tun interfaces to send or receive ip pac noS1 code has been revisited, it has been tested with the rf simulator, and tun interfaces. More tests are on going and CI will soon include noS1 tests. -## Running with a true radio head +# Running with a true radio head oai supports [number of deployment](FEATURE_SET.md) model, the following are tested in the CI: diff --git a/doc/images/L2-sim-single-server-deployment.png b/doc/images/L2-sim-single-server-deployment.png new file mode 100644 index 0000000000000000000000000000000000000000..d59efb73f3929e1710b3cd8c011733a3da4bbb8d GIT binary patch literal 10803 zcmd6Nd03KZ+qczFleXv5V*1o%E|8{8E@jeGwwabYE(mGlq?x0JTcV9KPN_|dDUxNH zm6o!Ini?(;6_H?Bny6vQR^di#6A1YG`OIK6qfSn})_bgoehPUEj|K|0zg$69azDiE`V&TZ8&s{{#5&UGPuN zKWS)`;kA^<0X=p5Yr2d)13BP+>L&Nmx!M#6u#0Ct$8OD=Eae5zBwWEub zYau$G2gu{|P0e=WSZhhb#by?|Y3G`k9n&lL>q*It4~M*d_{aQ}3;ln0TyfFnzE^Wk z=B7Ve+RL0zaUKOkjlPa*s+TuDAIRCdLyk*wX!Z{7Q*3K`-m$eUp{WAyq6yzgVg_{2WNa}Zzn#su%}cnIU8Dx9OS>+<>0KM8sYKH7*<-+ z&q>Pb^1Ve)2}ARutR{~4T}k@1m$l-9$^1o)yn)P|pvjjjAx^h%t=h81qToeTxO53|VZO*)r|JmY8*wK2$Z%c`yHeciN(r*qGBZ9k7iJv}L zQLq~((!g;J;t`&PIBpG(H(0e9Aqz_H)EU78vpcfV3YI-ue|mozS0K3Uv4m*5 z&uqb=MOP4d_?3bANAr&0CTsPfZ4C%ZG&-PGn|wv9FtX}+$3jVPy}i8D>8J^QWh&jh zsgA#>M%*sG9JM)X;<4o+VO)y8A^2kh-N7wSR1_qPyW?+u9IvhM4=k=QtRHBWCKehYzP+7#Rt)Nn<8oZva*O6dAv)Y~SR&zis!_p&*IV_Szr zHMv{k;48UyYobcFrCYB%i|ikv5=$q>9u`Gebgk{gl5Jh$PzL6}hdD!MY23LhyV>_T ztrzUFTQqb?zhWC~w*lOZ@k{mm!#ls@Mtxta@ATv%@bl~FQNq+5qN(U0ZikjD-F}kX z$~pBcFHFm8a~q+-&igszDbf%Xn*W!$N6DS4>l~$DKL00BsEC>DX@=SxgLC~;?|l}J zpNfqbh`rcZ)oDC`kI#+BI481S3~aRph`Uf?a_i--l-zK;&_I`Lo?n#F5D|0RvuHF9 z0=+EKi=3);U>wyWw;MOr+Y^y_(71LGKaYvuds#fpiGBHO>fLK2VdAw*h8FFVIhlL@ zG2cU(!yAtJvbX1R{C4cg3pqLhBG|jozv?uDdUoKitpg5Qp`(i>u`#%Wf;^&day_vN zOCAT(r%$_MTcMGhGG#nOEjXI=fmL(4>hy!&Wf!nQ`Wq3#Dqzv7D{WO3rLdJ08TRDU zIK9ZYQ0npJ=>j1cx^f~VK9RtwX=*eRDS&BA4B;#Bt4+09sZ9iXe~^b(Z{+Bdgm;_6 zOPwgP4f+-j3L}w=Zn!PE?L2SO`Cau&2hQa(b;4C$$7R5_7v`cYE&7|6rI_{}J~fEa zE#X^Q$r!SPkaat<1bd~qZi-k+P%lT%x1xS>)z)j5DnImOJ$j1HM0-wSI63k{6_uhgxIi- zeeTz|87R4lPCcUyk`Xi7(D*-IYz1uF<_ImmTP)oH2?n+BcL478&}(Oc2vosG#!?b?Sj$8X5O-1RqD7^6eR7MkGw-dZ#j z%dSM!Ipd9^o&Z5j5!0Awb%w=-x>2yMXm0b$g|0O>l?lTf5`OupC#~CZw=zeBAnwfY zQtO>;G_Cg@J+g_tYXYAFE#2T)z@4C|9*&qGWO4SP0r7(`yQ?SPNA^FCdJ%tm-vy8y zZnS9xJ^nt~Q}3D;rXVc~QViQgcj)w_h0v)E_;zb8e^TR4r<-VHb9hqJf3tEdxsqC! z#V+!^dozJhXmXroCbW(qJA2a(3GGY~6ZmAv#RII%YFy4N(DL#x)TCfB>(k(E4TFyu zjJ>o*26KTE%Z+x<@~gsWj|q3jHC+Q-&8mxet^uuF!|3IC`&ns^88Z1X_UJW(aHKX2 zqO~e>M&(C(-61nXCCn4p_5j&}0u7CE{M!+ZtgEJ)*+8;} z*@_WLGeKzTZrL}Sp0cYHRuwjlso2P93@6WnCnwRmExV0g0kmY?H53XzG8np%Gg zJ?DpScAkJCB*EIn@z)M$mztm{*rn@$vKg~+%|~|xv$$ctMo_M&?UTzus&CiU>XNfz zh#U_+igXpnKMV3LQg%+_r+%KMEUwRN`|)GD4kjQkXTF!a*3&o9is3;cYLb=l`8`sEHtC~egZ zwVxqQCsLCghqcM9z;kB6&mc{WGJgDYdC}e5CCg zI6QBLh;uBdG*5HJIhyYMkQO)s0y3OZ3)XOhf-}-En1UJ-8uN}f(TviD#ow91N$gz! z5Le=naTutk=iBf>J!>8Ec!;}CvozNA?QYO9EEER)Ui1DS%9Zy1`V11c6=?E{pt}I5 z?0wmgoaJ~|x#A&>ie^iXnnQW+xUMt@QJu}}8#x2#*m|(iNFD`h6Kh|&f8DXjsCsFwKg-Nruh_n{7Ibr%X3&yO zTQ&u}+}i&nas|)n9tf>tu8X*w z$flr=$}xLfRgiuO+Oa#t)hBR6M5}3*;CKi3RhNa1wa#@=Ua=Wzk5#l{beP$N=Ka%W zE!Kq>;hr0|yiI7SlAe$>=$z}vbrP^V?>Auo)jR9sANeKtv~aII7G7)huU0sR-o+

Ics9{7s(+pfjbTP?u1Y1X zfO6_5`X5<`Zx6bL4fppm*j?LJP~qp){w zid^(9c0Bi_Wryz~qPz(7#GtB#OfQ&4*UMIMcEgkqh0COmjumWoQ7n@s9+|R9Jl|u% zgo{4Z+~HVUDw71!%STt~H-E~%6EPgXK@@%?;tRV{bm5e|!Gan-r`}gSjQAG4Ms&%s z?xXpWB0P0?PJLPuhXP8#SM^@lX?bOnN^v6%!%1_-b*3))89DuJIf#9K$I0$HaJ`I6 znN!)~zptiidLgNMkCU^E#4jMw#Ilb_=0-&H5&P28I>~+dP~2?}b3Y{gttsL+j9|`H zW(xcsUlh(;N{1zpk|wiN+a=dzJee>kt6w#G-A6M!(#UFm`SEq-XvaAh+LU#M)qbTa zA^CgD1^r=F2XVQ}*f%;i1s@Vy1`6EbhUh4|3Yn_n1r2NkwRIvl1}c$9cQJ|Q(>`Ni zc__=*=EokkEk9*dLK$p<%iZdxcdNuBDG8`Y$J!c?(z2i#^c7QYr<#^JoMM=tx`x#B z+PSuWLMV-;;01OIhN7^W+-4mD;UxZBoRXfy=>1oI_=hAH8+pZLU}0ykI%bazcmC4Q>t6F;o# zC`6~kE^e9-YkFOG76=DSgf(HBUexesH{yNl1VdLH3+?6c+3d1FWSSuE`Fe*T`v8^x zD?BPc^i;moRyLv?IbmDsrjTcGTx8O^q=A`$joyri*pX%N!g5u&Bf}up?#D>nX~TsP zi$L)$(%*6@`>B3vl1MVF@(J$3_3hb&n&M$7r{aGw6mxr?SVjfB8Yyzo-#UsHP*!`u zPt#RJJ|54>SYFiBc;eH+Jr0Q~|5iLIFI2z6e)uoBpJ<&x#L-C&+v5;kX5KsASe2B- zS@GH5LWg_z@uW$e&(cp_ zvw2^}NEkugf$3&MM)%g45~7L|l=0S%{XyqD8J-?i*kh)|whFSpVdVUMfr5m(ae9fo zw5jqieb^em))Zeo)Gp+->;dY-Cp(PWs{d(gg7{7703qpnNgn1tDl!NZY9%QGk&GK) zDth#8SxzxJrRI2L;y}fPPnlkH&GRsX-2yA@$-9}Qa?FQfcc!B2$8hdFK06U}?7~E$ zGvtnozA=Gk{j7W$ZzPefqC!Z~-mH@RTT)4XP;hr=U~Rmj?1Ug$#+)1oPG?R`bRm_p zF4btaAx<^X=Jf6z$N?Y@bcIEoVs5U*E7?(Kn{ZOH+dyh7{Ojc6^Lvh0CF^i6Lq1VF zsSg2anh*)4Q&?%G!{jMS)2r~wo@iLQfU<&+%0U`e`*_1P2%g_8|Gje?Z?{5{E#Tw} zqdbR!V>->N!=82c>n#-a?CbBT%sVet#y>?u#0%gmMYqjV2QxsI)L5z#@WhoLKZ159 zvMX7~;;AVy%nXqcyMC##T z&Jbu-vEh#DrXC7ZHzO?A)&7ZtrkB1koO+;hiBQFl6LGQ(L&bKf925Myi9hO42BnQP zOlHutnq-;8n2AtMwleW3MRSZ7x3w!?@{GNI)`rO zgd^Ve$8mf@Tab$#hpFtEOpt`4=yjgt$+z&S-`FS>Cww!!sxZBR-O$kB4Ehz~qj^Bh z&m+S2l7)sVVcV0AAXmB;Q8F>s*@?5tXGwB?clac!b+}@U>BS?U0iB*yK>z5}Td*RZgi>W1zEyrd`tsq}-?~?! zKHe};LSoAMD3@2ji&Uk(ax^l}!sUpIo=B1TT0F7;hJDPFJLtu_po-3YavRi)V$m41 zD=}QsZIeV(MhswF6`|g#h5`dPL)D)2)G_Yu^zmQ%-{z}562%nJ5LYwy#@lf7jV`<9CzM0uL8KRzz zvmc8>R0P?U{knjQ_qnDIMMp$?{!G1k zNJ;lan1gP#us<>)F@C>YNY!;xP;RdI>1cJcnk^4MRr{uBWF44@n_abGYBHc=FYEPN zWQtI#JmbuYcVoO(^+!w6ICN}oST)oHvHvjW3U1A6z#p~N%ieLwLm~Vv#RP+m2+^qo zZ<(s!@-<{G;0@12%=9?n%?c5CAbcV3Qx~(vY00vIX+Kq=uIvW{@3hrS5CT7MM7A*a znNEqYm4t z+>B9o@0fEZ-YvuwlxTTr7s8xeY20pY0ipX!nLXG2slewpH>eF?QL1JNzNEr@9&W+U zCh13tVIE>Cn&3^3^tlkJGtpbt!}S?5OzLYTRsDVML_hUtb2&7t|SgXO?@YYaBw4d$|?Nw3Q_R1}V^NqW6>0)&HVF^tryJ^aIm# ztz*AxPiX#8z2f^NI?@t8LruK=>!|+$bW%>GJAD}rY5Hfoqbetro;1KNZbNjZ6nkzz zamaoFMRekKH5RCelVnH0e1Ah0Y3hOthHuCsfCg%s;tSh!ON}MpvQ7Uf8%#3|kf3ky zPt8b8ix1{w0A}jjm1*h0?aH^>&mf_iD4JIOGZOx%FRpS~yzkzOO1bL;t z+gf)Nu&L7)n|p4F3E*!*dV-s;T?^DC@U(3-Zp;HENgpCUhRnSVb5S!LJC6|4M_Ndn z?QvIIMtEZEyTAxtp7(Rihyzh{r`0kK4*7D(iRG9NXUeEcH}jf1I=Vmg4wQrx8bib< zMe%MAr3@gzk7^E8n~Y19x@Koe6LCiGKSYy^gbfZNZ(gK8n%pc6X?tc#jf_vk_BI!( zY;?%}-g+hDlbKOZM?7g7=hU>=rQ}MBwVHf($7_pubx0aD&Gq!!38AHVlinSh6tk*O zLgC^G6tS@U#+zKXxB)^GMbqn)w>|Zn(>spRva4^s$`a@QjAVrv1c{R?hxDapt^TnKhSD=Kp3Kbu^KPjc-1{?sIGhs#c)Z|A1U1y>xl#q<=1a_K< zQC}Sf{6m&Oj>e)*3y`DUmMvD1P)sL&?I z_KZ6*Rn8f=jwDd49M0>IJrkd@zev3dlD>Raq6^9F?`Or|%L@E%=FHVM(Ux;(qJNPq zZPl+cDfWj6;^M9uTkO$>?YlAKnDv^vKTP`#jDF!e6Q{;q^FzYq-K1ey8+%k%vrH@& z=BNqQZdr9#ZKd)zJRDgkebOTw9IMb3i*d(uXZKZ8Ym#E8!`cNOAM(0fRV)HK&w+ZrdovLZ76N> zn^We9n5?_oP$hbhyXGzww|j%pB80znvY+k&+JoV=5@sb%yz*GOz=f=Mr|a!& zbXQiGBsfj9&TBz`4Z7FPBs9C+**n#maHDYiyeE0$osQsijF1|&=FhKTC-BkD?&jRe zKVIgOog0sgs0^Vqurjm64QN+>wl_V`py#Ab4JSJ0dds=5TmSFk*`NenFB?;_#o^30 z|2DsXScM-?WCgeb;(7c`x;y|u1lt%lMX)ija2OkFA%tykeehP*u-``Rr@mnz;H-`8 z@ov>ltP*(9`9t<1LEgysvw0MIA=#675vj>HPw7AUp$z>@cQ!Q7gSg$og&v$RN0d36 z%2PQPIB9~2fiWw#ZDQJ>lE1ex|3jOtpn|Ag_b$m%wgPZ7-a`NM~GH_Q^et_baS9pt&k0(Mlrn{IJ*4kIs zpxHgWgX6X`j&|yVu-u+_|2l^%H(ekL7ig1*>n1ALrAe|{n-rlIDp4H&OyWlC zo9-emz0>qkoq)TeOcx3h1-D`IFsXObUBvp_!JcUKVVH#>xCEhUJc5Ud^4a*Q!rP74e`O|=M zhL!d^OkY@Dei$>yq?$Awo+<5r4nV!#y2&E_&=4y7hBTVYi@YpC>Jks@-?1m!R(BRT z1VDwO8TZ$5!>ranFPx0!;kUWv1tb3%f0%@>mx2)prED5DPZTN(pF4KAqlJ(e}D*A*KxO^F=(DfKadeE()^ zy0r7NhSTxC)^6x=mnZVV9^^T^oezy69bc-KB!V7cHkCAXO}*a1gL>~Qv`_jXnb0$b zzuk`U%DcL%z9jmvVgahwf12CqCNl5)mh98)nJ&sp0s2u$8zOTXc6;`J==b~*ngyEK zPuFklCw`xOEMd0DU4}rna+lK4)1d?!%hhgr}jW%i{qOxak>Ticmi``p?43 zad+0Ct~hycI%=xFWw>elA+f6_U>@fuby;lmpmiH}5t#PgeGS$SXu@cElOBrcJGrAP z_Fn9WmGQaz!Et!B{m(*vq z8vdo0!Vto8lb?LDZZ2w#L?SQrTX`Ao7}cWVkhBf!dDk14&z=uTe;lFM+!@2yDS;h` zV|oN!_w}Z6N$9WVUaCj4iQiQnKN+&F_97IqVipl?`;rM0t>6w#a6a-{Brc~0-HM7d ziTdKaD_UOSe)o+|ZV5SEREU^5h-v)NFx*71bLSK6R_~Y8#nHWB4$x>{2|`^1t(NgW<3V8A a*i`CSfA%u=Ks=CA Date: Wed, 17 Apr 2019 08:06:37 +0200 Subject: [PATCH 20/44] Remove MAC layer context from phy_procedures_lte_eNb.c to prevent phy-sim build from fail --- openair1/SCHED/phy_procedures_lte_eNb.c | 32 ++++++++++++++++++------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 80767c0c20..ae1c4bce3d 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -40,8 +40,6 @@ #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" -#include "openair2/LAYER2/MAC/mac_proto.h" - #include "assertions.h" #include "msc.h" @@ -1238,7 +1236,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { //compute the expected ULSCH RX power (for the stats) ulsch_harq->delta_TF = get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered - if (RC.mac != NULL) { /* ulsim dose not use RC.mac context. */ + if (RC.mac != NULL) { /* ulsim does not use RC.mac context. */ if (ulsch_harq->cqi_crc_status == 1) { #ifdef DEBUG_PHY_PROC //if (((frame%10) == 0) || (frame < 50)) @@ -1501,10 +1499,11 @@ static void do_release_harq(PHY_VARS_eNB *eNB, LTE_DL_eNB_HARQ_t *dlsch0_harq = NULL; LTE_DL_eNB_HARQ_t *dlsch1_harq = NULL; int UE_id_mac = -1; - UE_sched_ctrl *UE_scheduling_control = NULL; int harq_pid; int subframe_tx; int frame_tx; + UE_sched_ctrl *UE_scheduling_control = NULL; + UE_list_t *UE_list = NULL AssertFatal(UE_id != -1, "No existing dlsch context\n"); AssertFatal(UE_id < NUMBER_OF_UE_MAX, "Returned UE_id %d >= %d (NUMBER_OF_UE_MAX)\n", UE_id, NUMBER_OF_UE_MAX); @@ -1512,8 +1511,23 @@ static void do_release_harq(PHY_VARS_eNB *eNB, dlsch0 = eNB->dlsch[UE_id][0]; dlsch1 = eNB->dlsch[UE_id][1]; - UE_id_mac = find_UE_id(eNB->Mod_id, dlsch0->rnti); - UE_scheduling_control = &(RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[UE_id_mac]); + if (RC.mac != NULL) { /* dlsim does not use RC.mac context */ + UE_list = &(RC.mac[eNB->Mod_id]->UE_list); + + /* Replicate "find_UE_id" from openair2/LAYER2/MAC/mac_proto.h */ + for (int UE_id_temp = 0; UE_id_temp < MAX_MOBILES_PER_ENB; UE_id_temp++) { + if (UE_list->active[UE_id_temp] == TRUE) { + if (UE_list->UE_template[UE_list->pCC_id[UE_id_temp]][UE_id_temp].rnti == dlsch0->rnti) { + UE_id_mac = UE_id_temp; + break; + } + } + } + + if (UE_id_mac != -1) { + UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id_mac]); + } + } if (eNB->frame_parms.frame_type == FDD) { subframe_tx = (subframe + 6) % 10; @@ -1555,8 +1569,10 @@ static void do_release_harq(PHY_VARS_eNB *eNB, dlsch0_harq->status = SCH_IDLE; dlsch0->harq_mask &= ~(1 << harq_pid); - /* CDRX: PUCCH gives an ACK or no more repetitions, so reset corresponding HARQ RTT */ - UE_scheduling_control->harq_rtt_timer[eNB->CC_id][harq_pid] = 0; + if (UE_scheduling_control != NULL) { + /* CDRX: PUCCH gives an ACK or no more repetitions, so reset corresponding HARQ RTT */ + UE_scheduling_control->harq_rtt_timer[eNB->CC_id][harq_pid] = 0; + } } } else { From 34447c0eefd36491a64923b5843bd94ca06c8bb3 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Wed, 17 Apr 2019 08:29:54 +0200 Subject: [PATCH 21/44] build fix --- openair1/SCHED/phy_procedures_lte_eNb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index ae1c4bce3d..9e4f23fb9e 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1503,7 +1503,7 @@ static void do_release_harq(PHY_VARS_eNB *eNB, int subframe_tx; int frame_tx; UE_sched_ctrl *UE_scheduling_control = NULL; - UE_list_t *UE_list = NULL + UE_list_t *UE_list = NULL; AssertFatal(UE_id != -1, "No existing dlsch context\n"); AssertFatal(UE_id < NUMBER_OF_UE_MAX, "Returned UE_id %d >= %d (NUMBER_OF_UE_MAX)\n", UE_id, NUMBER_OF_UE_MAX); From 363dc1cb6fbfc1d78085f9e78d7f7d2f366ccc52 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 17 Apr 2019 15:06:32 +0200 Subject: [PATCH 22/44] CI: adding cdrx parameters to one scenario (FDD-Monolithic-10MHz) -> slight increase on the ping RTT by 10 ms -> notification in the HTML report that CDRX was activated Signed-off-by: Raphael Defosseux --- ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf | 8 ++++++++ ci-scripts/main.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf index 87beafad6b..92a6e6f0bc 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf @@ -94,6 +94,14 @@ eNBs = pcch_default_PagingCycle = 128; pcch_nB = "oneT"; + drx_Config_present = "prSetup"; //"prSetup" "prRelease" + drx_onDurationTimer = "psf1"; // "psfX": X=1,2,3,4,5,6,8,10,20,30,40,50,60,80,100 + drx_InactivityTimer = "psf1"; // "psfX": X=1,2,3,4,5,6,8,10,20,30,40,50,60,80,100,200,300,500,750,1280,1920,2560 + drx_RetransmissionTimer = "psf1"; // "psfX": X=1,2,4,6,8,16,24,33 + drx_longDrx_CycleStartOffset_present = "prSf128"; // "psfX": X=10,20,32,40,64,80,128,160,256,320,512,640,1024,1280,2048,2560 + drx_longDrx_CycleStartOffset = 0; // X >= 0 && X < drx_longDrx_CycleStartOffset_present + drx_shortDrx_Cycle = "sf16"; // "sfX": X=2,5,8,10,16,20,32,40,64,80,128,160,256,320,512,640 + drx_shortDrx_ShortCycleTimer = 3; // 1..16 integer. Total duration in short cycle = drx_shortDrx_Cycle*drx_shortDrx_ShortCycleTimer [subframe] bcch_modificationPeriodCoeff = 2; ue_TimersAndConstants_t300 = 1000; ue_TimersAndConstants_t301 = 1000; diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 9846dabc0f..d45f0d5c57 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -2137,6 +2137,7 @@ class SSHConnection(): uciStatMsgCount = 0 pdcpFailure = 0 ulschFailure = 0 + cdrxActivationMessageCount = 0 self.htmleNBFailureMsg = '' for line in enb_log_file.readlines(): if self.rruOptions != '': @@ -2188,6 +2189,9 @@ class SSHConnection(): result = re.search('LTE_RRCConnectionReestablishmentReject', str(line)) if result is not None: rrcReestablishReject += 1 + result = re.search('CDRX configuration activated after RRC Connection', str(line)) + if result is not None: + cdrxActivationMessageCount += 1 result = re.search('uci->stat', str(line)) if result is not None: uciStatMsgCount += 1 @@ -2242,6 +2246,10 @@ class SSHConnection(): rrcMsg = ' -- ' + str(rrcReestablishReject) + ' were rejected' logging.debug('\u001B[1;30;43m ' + rrcMsg + ' \u001B[0m') self.htmleNBFailureMsg += rrcMsg + '\n' + if cdrxActivationMessageCount > 0: + rrcMsg = 'eNB activated the CDRX Configuration for ' + str(cdrxActivationMessageCount) + ' time(s)' + logging.debug('\u001B[1;30;43m ' + rrcMsg + ' \u001B[0m') + self.htmleNBFailureMsg += rrcMsg + '\n' if rachCanceledProcedure > 0: rachMsg = 'eNB cancelled ' + str(rachCanceledProcedure) + ' RA procedure(s)' logging.debug('\u001B[1;30;43m ' + rachMsg + ' \u001B[0m') From 5da3dd5df6f8bcc9ed9d0c9b3189bbb7ea281fd6 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Thu, 18 Apr 2019 10:59:17 +0200 Subject: [PATCH 23/44] Some formats + CDRX added to feature_set.md --- doc/FEATURE_SET.md | 1 + openair2/PHY_INTERFACE/IF_Module.c | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index 7e2cc30388..bf50be357a 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -72,6 +72,7 @@ The MAC layer implements a subset of the **3GPP 36.321** release v8.6 in support - RLC interface (AM, UM) - UL power control - Link adaptation +- Connected DRX (CDRX) support for FDD LTE UE. Compatible with R13 from 3GPP. Support for Cat-M1 UE comming soon. ## eNB RLC Layer ## diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index fb2baa9511..ad49a16cec 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -114,26 +114,25 @@ void handle_cqi(UL_IND_t *UL_info) { } void handle_harq(UL_IND_t *UL_info) { - int i; - - if (NFAPI_MODE == NFAPI_MODE_PNF && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) { // PNF + if (NFAPI_MODE == NFAPI_MODE_PNF && UL_info->harq_ind.harq_indication_body.number_of_harqs > 0) { // PNF //LOG_D(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs); int retval = oai_nfapi_harq_indication(&UL_info->harq_ind); - if (retval!=0) { + if (retval != 0) { LOG_E(PHY, "Failed to encode NFAPI HARQ_IND retval:%d\n", retval); } UL_info->harq_ind.harq_indication_body.number_of_harqs = 0; + } else { - for (i=0; iharq_ind.harq_indication_body.number_of_harqs; i++) + for (int i=0; i < UL_info->harq_ind.harq_indication_body.number_of_harqs; i++) harq_indication(UL_info->module_id, UL_info->CC_id, NFAPI_SFNSF2SFN(UL_info->harq_ind.sfn_sf), NFAPI_SFNSF2SF(UL_info->harq_ind.sfn_sf), &UL_info->harq_ind.harq_indication_body.harq_pdu_list[i]); - UL_info->harq_ind.harq_indication_body.number_of_harqs=0; + UL_info->harq_ind.harq_indication_body.number_of_harqs = 0; } } From 0e6431a7b97f25e8405eb33eab87ba940e8ca9fe Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Thu, 18 Apr 2019 11:51:20 +0200 Subject: [PATCH 24/44] Moved code for HARQ process from PHY layer to MAC layer --- openair1/SCHED/phy_procedures_lte_eNb.c | 26 ------------------- .../LAYER2/MAC/eNB_scheduler_primitives.c | 21 ++++++++++++++- openair2/PHY_INTERFACE/IF_Module.c | 3 ++- 3 files changed, 22 insertions(+), 28 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 9e4f23fb9e..3b3b9336d4 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1498,12 +1498,9 @@ static void do_release_harq(PHY_VARS_eNB *eNB, LTE_eNB_DLSCH_t *dlsch1 = NULL; LTE_DL_eNB_HARQ_t *dlsch0_harq = NULL; LTE_DL_eNB_HARQ_t *dlsch1_harq = NULL; - int UE_id_mac = -1; int harq_pid; int subframe_tx; int frame_tx; - UE_sched_ctrl *UE_scheduling_control = NULL; - UE_list_t *UE_list = NULL; AssertFatal(UE_id != -1, "No existing dlsch context\n"); AssertFatal(UE_id < NUMBER_OF_UE_MAX, "Returned UE_id %d >= %d (NUMBER_OF_UE_MAX)\n", UE_id, NUMBER_OF_UE_MAX); @@ -1511,24 +1508,6 @@ static void do_release_harq(PHY_VARS_eNB *eNB, dlsch0 = eNB->dlsch[UE_id][0]; dlsch1 = eNB->dlsch[UE_id][1]; - if (RC.mac != NULL) { /* dlsim does not use RC.mac context */ - UE_list = &(RC.mac[eNB->Mod_id]->UE_list); - - /* Replicate "find_UE_id" from openair2/LAYER2/MAC/mac_proto.h */ - for (int UE_id_temp = 0; UE_id_temp < MAX_MOBILES_PER_ENB; UE_id_temp++) { - if (UE_list->active[UE_id_temp] == TRUE) { - if (UE_list->UE_template[UE_list->pCC_id[UE_id_temp]][UE_id_temp].rnti == dlsch0->rnti) { - UE_id_mac = UE_id_temp; - break; - } - } - } - - if (UE_id_mac != -1) { - UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id_mac]); - } - } - if (eNB->frame_parms.frame_type == FDD) { subframe_tx = (subframe + 6) % 10; frame_tx = ul_ACK_subframe2_dl_frame(&eNB->frame_parms, @@ -1568,11 +1547,6 @@ static void do_release_harq(PHY_VARS_eNB *eNB, if (dlsch0_harq->round >= after_rounds) { dlsch0_harq->status = SCH_IDLE; dlsch0->harq_mask &= ~(1 << harq_pid); - - if (UE_scheduling_control != NULL) { - /* CDRX: PUCCH gives an ACK or no more repetitions, so reset corresponding HARQ RTT */ - UE_scheduling_control->harq_rtt_timer[eNB->CC_id][harq_pid] = 0; - } } } else { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index db6e23bcc7..0385ae6730 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -4153,18 +4153,25 @@ extract_harq(module_id_t mod_idP, if (pdu[0] == 1) { // ACK sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process sched_ctl->tbcnt[CC_idP][harq_pid] = 0; + + /* CDRX: PUCCH gives an ACK, so reset corresponding HARQ RTT */ + sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0; + } else if (pdu[0] == 2 || pdu[0] == 4) { // NAK (treat DTX as NAK) sched_ctl->round[CC_idP][harq_pid]++; // increment round if (sched_ctl->round[CC_idP][harq_pid] == 4) { sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process sched_ctl->tbcnt[CC_idP][harq_pid] = 0; + + /* CDRX: PUCCH gives an NACK and max number of repetitions reached so reset corresponding HARQ RTT */ + sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0; } if (sched_ctl->round[CC_idP][harq_pid] == 8) { for (uint8_t ra_i = 0; ra_i < NB_RA_PROC_MAX; ra_i++) { if((ra[ra_i].rnti == rnti) && (ra[ra_i].state == WAITMSG4ACK)) { - //Msg NACK num to MAC ,remove UE + // Msg NACK num to MAC ,remove UE // add UE info to freeList LOG_I(RRC, "put UE %x into freeList\n", rnti); @@ -4183,6 +4190,9 @@ extract_harq(module_id_t mod_idP, if (num_ack_nak == 2 && sched_ctl->round[CC_idP][harq_pid] < 8 && sched_ctl->tbcnt[CC_idP][harq_pid] == 1 && pdu[0] == 1 && pdu[1] == 1) { sched_ctl->round[CC_idP][harq_pid] = 8; sched_ctl->tbcnt[CC_idP][harq_pid] = 0; + + /* CDRX: PUCCH gives an ACK, so reset corresponding HARQ RTT */ + sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0; } if ((num_ack_nak == 2) @@ -4194,6 +4204,9 @@ extract_harq(module_id_t mod_idP, if (sched_ctl->round[CC_idP][harq_pid] == 4) { sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process sched_ctl->tbcnt[CC_idP][harq_pid] = 0; + + /* CDRX: PUCCH gives an NACK and max number of repetitions reached so reset corresponding HARQ RTT */ + sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0; } } else if (((num_ack_nak == 2) && (sched_ctl->round[CC_idP][harq_pid] < 8) @@ -4209,6 +4222,9 @@ extract_harq(module_id_t mod_idP, if (sched_ctl->round[CC_idP][harq_pid] == 4) { sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process sched_ctl->tbcnt[CC_idP][harq_pid] = 0; /* TODO: do we have to set it to 0? */ + + /* CDRX: PUCCH gives an NACK and max number of repetitions reached so reset corresponding HARQ RTT */ + sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0; } } else if ((num_ack_nak == 2) && (sched_ctl->round[CC_idP][harq_pid] < 8) @@ -4219,6 +4235,9 @@ extract_harq(module_id_t mod_idP, if (sched_ctl->round[CC_idP][harq_pid] == 4) { sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process sched_ctl->tbcnt[CC_idP][harq_pid] = 0; + + /* CDRX: PUCCH gives an NACK and max number of repetitions reached so reset corresponding HARQ RTT */ + sched_ctl->harq_rtt_timer[CC_idP][harq_pid] = 0; } } else AssertFatal(1 == 0, "Illegal ACK/NAK/round combination (%d,%d,%d,%d,%d) for harq_pid %d, UE %d/%x\n", diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index ad49a16cec..308c21c680 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -115,7 +115,7 @@ void handle_cqi(UL_IND_t *UL_info) { void handle_harq(UL_IND_t *UL_info) { if (NFAPI_MODE == NFAPI_MODE_PNF && UL_info->harq_ind.harq_indication_body.number_of_harqs > 0) { // PNF - //LOG_D(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs); + LOG_E(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs); int retval = oai_nfapi_harq_indication(&UL_info->harq_ind); if (retval != 0) { @@ -125,6 +125,7 @@ void handle_harq(UL_IND_t *UL_info) { UL_info->harq_ind.harq_indication_body.number_of_harqs = 0; } else { + LOG_E(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Received by VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs); for (int i=0; i < UL_info->harq_ind.harq_indication_body.number_of_harqs; i++) harq_indication(UL_info->module_id, UL_info->CC_id, From f515213dbee23bcb483ef6d03a0adcd3e6947714 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 18 Apr 2019 12:34:55 +0200 Subject: [PATCH 25/44] CI: adding back TCP iperf tests in TDD Signed-off-by: Raphael Defosseux --- .../enb_usrp210_band40_test_05mhz_tm1.xml | 32 ++++++++++++++++++- .../enb_usrp210_band40_test_10mhz_tm1.xml | 32 ++++++++++++++++++- .../enb_usrp210_band40_test_20mhz_tm1.xml | 32 ++++++++++++++++++- 3 files changed, 93 insertions(+), 3 deletions(-) diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml index d5a25c7fa7..6ac6dc980a 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml @@ -26,7 +26,7 @@ tasks 040101 - 030104 040301 040501 040602 040601 040603 040642 040641 040643 040401 040201 030201 + 030104 040301 040501 040602 040601 040603 040604 040605 040642 040641 040643 040644 040645 040401 040201 030201 @@ -92,6 +92,21 @@ unbalanced + + Iperf + iperf (5MHz - DL/TCP)(30 sec)(single-ue profile) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (5MHz - DL/TCP)(30 sec) + -t 30 -i 1 -fm + 50 + + Iperf iperf (5MHz - UL/2Mbps/UDP)(30 sec)(balanced) @@ -116,4 +131,19 @@ unbalanced + + Iperf + iperf (5MHz - UL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (5MHz - UL/TCP)(30 sec) + -t 30 -i 1 -fm -R + 50 + + diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml index ef50933d4a..c5e4321b89 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml @@ -26,7 +26,7 @@ tasks 040101 - 030114 040301 040511 040612 040611 040613 040652 040651 040653 040401 040201 030201 + 030114 040301 040511 040612 040611 040613 040614 040615 040652 040651 040653 040654 040655 040401 040201 030201 @@ -92,6 +92,21 @@ unbalanced + + Iperf + iperf (10MHz - DL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (10MHz - DL/TCP)(30 sec) + -t 30 -i 1 -fm + 50 + + Iperf iperf (10MHz - UL/2Mbps/UDP)(30 sec)(balanced) @@ -116,4 +131,19 @@ unbalanced + + Iperf + iperf (10MHz - UL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (10MHz - UL/TCP)(30 sec) + -t 30 -i 1 -fm -R + 50 + + diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml index 9a96baac3f..2dc1efd994 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml @@ -26,7 +26,7 @@ tasks 040101 - 030124 040301 040521 040622 040621 040623 040662 040661 040663 040401 040201 030201 + 030124 040301 040521 040622 040621 040623 040624 040625 040662 040661 040663 040664 040665 040401 040201 030201 @@ -92,6 +92,21 @@ unbalanced + + Iperf + iperf (20MHz - DL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (20MHz - DL/TCP)(30 sec) + -t 30 -i 1 -fm + 50 + + Iperf iperf (20MHz - UL/2Mbps/UDP)(30 sec)(balanced) @@ -116,4 +131,19 @@ unbalanced + + Iperf + iperf (20MHz - UL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/TCP)(30 sec) + -t 30 -i 1 -fm -R + 50 + + From 3f6ab59010bb771715454739bfbad0db7974d4a8 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Thu, 18 Apr 2019 13:28:36 +0200 Subject: [PATCH 26/44] remove debug --- openair2/PHY_INTERFACE/IF_Module.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index 308c21c680..ad49a16cec 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -115,7 +115,7 @@ void handle_cqi(UL_IND_t *UL_info) { void handle_harq(UL_IND_t *UL_info) { if (NFAPI_MODE == NFAPI_MODE_PNF && UL_info->harq_ind.harq_indication_body.number_of_harqs > 0) { // PNF - LOG_E(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs); + //LOG_D(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs); int retval = oai_nfapi_harq_indication(&UL_info->harq_ind); if (retval != 0) { @@ -125,7 +125,6 @@ void handle_harq(UL_IND_t *UL_info) { UL_info->harq_ind.harq_indication_body.number_of_harqs = 0; } else { - LOG_E(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Received by VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs); for (int i=0; i < UL_info->harq_ind.harq_indication_body.number_of_harqs; i++) harq_indication(UL_info->module_id, UL_info->CC_id, From b4f462b9c816e1ef91226c486a3420a70df1edbf Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 18 Apr 2019 13:41:14 +0200 Subject: [PATCH 27/44] Align PROTO_AGENT functions with PDCP/RLC function pointers --- openair2/LAYER2/PROTO_AGENT/proto_agent.c | 10 +++++----- openair2/LAYER2/PROTO_AGENT/proto_agent.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent.c b/openair2/LAYER2/PROTO_AGENT/proto_agent.c index 7cc0db24a7..a39ebc6c84 100644 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent.c +++ b/openair2/LAYER2/PROTO_AGENT/proto_agent.c @@ -191,14 +191,14 @@ rlc_op_status_t proto_agent_send_rlc_data_req(const protocol_ctxt_t *const ctxt proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, proto_agent[mod_id].channel->channel_info); free_mem_block(sdu_pP, __func__); - return 0; + return RLC_OP_STATUS_OK; error: LOG_E(PROTO_AGENT, "PROTO_AGENT there was an error\n"); - return -1; + return RLC_OP_STATUS_INTERNAL_ERROR; } -void +boolean_t proto_agent_send_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP, const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP) { uint8_t *msg = NULL; @@ -225,10 +225,10 @@ proto_agent_send_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP, const srb_f proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, proto_agent[mod_id].channel->channel_info); free_mem_block(sdu_pP, __func__); - return; + return TRUE; error: LOG_E(PROTO_AGENT, "there was an error in %s\n", __func__); - return; + return FALSE; } void * diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent.h b/openair2/LAYER2/PROTO_AGENT/proto_agent.h index 674bd245e2..927b714b2c 100644 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent.h +++ b/openair2/LAYER2/PROTO_AGENT/proto_agent.h @@ -51,7 +51,7 @@ rlc_op_status_t proto_agent_send_rlc_data_req( const protocol_ctxt_t *const ctxt const rb_id_t rb_idP, const mui_t muiP, confirm_t confirmP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP); -void proto_agent_send_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP, +boolean_t proto_agent_send_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP, const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP); From de1dc5c9d753346ed475ebac0cda3f653216e3d5 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 18 Apr 2019 16:03:01 +0200 Subject: [PATCH 28/44] Correct if before call free() --- openair2/ENB_APP/flexran_agent_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c index 539c7f2a5c..72b0866fd6 100644 --- a/openair2/ENB_APP/flexran_agent_common.c +++ b/openair2/ENB_APP/flexran_agent_common.c @@ -298,7 +298,7 @@ int flexran_agent_destroy_enb_config_reply(Protocol__FlexranMessage *msg) { free(reply->cell_config[i]->mbsfn_subframe_config_rfoffset); if (reply->cell_config[i]->mbsfn_subframe_config_rfperiod) free(reply->cell_config[i]->mbsfn_subframe_config_rfperiod); - if (reply->cell_config[i]->mbsfn_subframe_config_sfalloc); + if (reply->cell_config[i]->mbsfn_subframe_config_sfalloc) free(reply->cell_config[i]->mbsfn_subframe_config_sfalloc); if (reply->cell_config[i]->si_config) { From 151bbd08326a3c9b8779e500544cec729ba5430e Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 18 Apr 2019 17:02:41 +0200 Subject: [PATCH 29/44] CI/DOC: more detailed documentation on how CI works Signed-off-by: Raphael Defosseux --- ci-scripts/doc/ci_dev_home.md | 31 +++ ci-scripts/doc/vm_based_simulator_build.md | 262 ++++++++++++++++++ .../doc/vm_based_simulator_check_build.md | 44 +++ ci-scripts/doc/vm_based_simulator_create.md | 111 ++++++++ ci-scripts/doc/vm_based_simulator_destroy.md | 71 +++++ ci-scripts/doc/vm_based_simulator_env.md | 123 ++++++++ .../doc/vm_based_simulator_main_scripts.md | 87 ++++++ ci-scripts/doc/vm_based_simulator_sources.md | 85 ++++++ ci-scripts/doc/vm_based_simulator_test.md | 260 +++++++++++++++++ doc/FEATURE_SET.md | 19 +- 10 files changed, 1084 insertions(+), 9 deletions(-) create mode 100644 ci-scripts/doc/ci_dev_home.md create mode 100644 ci-scripts/doc/vm_based_simulator_build.md create mode 100644 ci-scripts/doc/vm_based_simulator_check_build.md create mode 100644 ci-scripts/doc/vm_based_simulator_create.md create mode 100644 ci-scripts/doc/vm_based_simulator_destroy.md create mode 100644 ci-scripts/doc/vm_based_simulator_env.md create mode 100644 ci-scripts/doc/vm_based_simulator_main_scripts.md create mode 100644 ci-scripts/doc/vm_based_simulator_sources.md create mode 100644 ci-scripts/doc/vm_based_simulator_test.md diff --git a/ci-scripts/doc/ci_dev_home.md b/ci-scripts/doc/ci_dev_home.md new file mode 100644 index 0000000000..f6cf3a1cf0 --- /dev/null +++ b/ci-scripts/doc/ci_dev_home.md @@ -0,0 +1,31 @@ + + + + + +
+ + + + + + OAI CI Dev documentation +
+ +VM-based RF-Less Environment: + +* [How to setup your test env](vm_based_simulator_env) +* [How to deal with OAI source files](vm_based_simulator_sources) +* [The main script](vm_based_simulator_main_scripts) +* [How to create one or several VM instances](vm_based_simulator_create) +* [How to build an OAI variant](vm_based_simulator_build) +* [How the build is checked](vm_based_simulator_check_build) +* [How to test an OAI variant](vm_based_simulator_test) +* [How to destroy all VM instances](vm_based_simulator_destroy) + +Currently missing documentation: +* How to generate a build report +* How to generate a test report + +--- + diff --git a/ci-scripts/doc/vm_based_simulator_build.md b/ci-scripts/doc/vm_based_simulator_build.md new file mode 100644 index 0000000000..a064c7c1ff --- /dev/null +++ b/ci-scripts/doc/vm_based_simulator_build.md @@ -0,0 +1,262 @@ + + + + + +
+ + + + + + OAI CI Virtual-Machine-based: build an OAI variant +
+ +## Table of Contents ## + +1. [Introduction](#1-introduction) +2. [Detailed Description](#2-detailed-description) +3. [Typical Usage](#3-typical-usage) + +# 1. Introduction # + +```bash +$ cd /tmp/CI-raphael +$ ls *.zip +localZip.zip +$ ./ci-scripts/oai-ci-vm-tool build --help +OAI CI VM script + Original Author: Raphael Defosseux + Requirements: + -- uvtool uvtool-libvirt apt-cacher + -- xenial image already synced + Default: + -- eNB with USRP + +Usage: +------ + oai-ci-vm-tool build [OPTIONS] + +Mandatory Options: +-------- + --job-name #### OR -jn #### + Specify the name of the Jenkins job. + + --build-id #### OR -id #### + Specify the build ID of the Jenkins job. + + --workspace #### OR -ws #### + Specify the workspace. + +Options: +-------- + # OpenAirInterface Build Variants + --variant enb-usrp OR -v1 + --variant basic-sim OR -v2 + --variant phy-sim OR -v3 + --variant cppcheck OR -v4 + --variant enb-ethernet OR -v7 + --variant ue-ethernet OR -v8 + # non-OSA Build Variants + --variant flexran-rtc OR -v10 + # OpenAirInterface Test Variants + --variant l1-sim OR -v20 + --variant rf-sim OR -v21 + --variant l2-sim OR -v22 + Specify the variant to build. + + --keep-vm-alive OR -k + Keep the VM alive after the build. + + --daemon OR -D + Run as daemon + + --help OR -h + Print this help message. +``` + +# 2. Detailed Description # + +Source file concerned: `ci-scripts/buildOnVM.sh` + +## 2.1. build_on_vm function ## + +* First check if the ZIP file is available and if the apt-cacher proxy configuration file is present. If not, it will stop. +* Check if the VM instance is alive. If not, create it. +* Once the VM is alive, retrieve the IP address with VM_IP_ADDR=`uvt-kvm ip $VM_NAME` +* We copy the ZIP file to the VM : `scp localZip.zip ubuntu@$VM_IP_ADDR:/home/ubuntu` +* apt-cacher proxy file: `scp etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu` + +Then we open a SSH session on the VM : `ssh ubuntu@$VM_IP_ADDR` + +* We copy the apt-cacher proxy file to its destination space: `sudo cp 01proxy /etc/apt/apt.conf.d/` +* We create an hush login file to eliminate the ssh opening session messages. +* We unzip the ZIP file into `/home/ubuntu/tmp/` folder +* and we work from there. + +# 3. Typical Usage # + +## 3.1. Build in the foreground, check the results and destroy the VM at the end ## + +```bash +$ cd /tmp/CI-raphael +$ ls *.zip +localZip.zip +$ ./ci-scripts/oai-ci-vm-tool build --workspace /tmp/CI-raphael --job-name RAN-CI-develop --build-id 47 --variant enb-usrp +############################################################ +OAI CI VM script +############################################################ +VM_NAME = RAN-CI-develop-b47-enb-usrp +VM_CMD_FILE = RAN-CI-develop-b47-enb-usrp_cmds.txt +JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop +ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/enb_usrp +BUILD_OPTIONS = --eNB -w USRP --mu +VM_MEMORY = 2048 MBytes +VM_CPU = 4 +############################################################ +Creating VM (RAN-CI-develop-b47-enb-usrp) on Ubuntu Cloud Image base +############################################################ +Waiting for VM to be started +Warning: Permanently added '192.168.122.2' (ECDSA) to the list of known hosts. +RAN-CI-develop-b47-enb-usrp has for IP addr = 192.168.122.2 +############################################################ +Copying GIT repo into VM (RAN-CI-develop-b47-enb-usrp) +############################################################ +Warning: Permanently added '192.168.122.2' (ECDSA) to the list of known hosts. +############################################################ +Running install and build script on VM (RAN-CI-develop-b47-enb-usrp) +############################################################ +Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-145-generic x86_64) + + * Documentation: https://help.ubuntu.com + * Management: https://landscape.canonical.com + * Support: https://ubuntu.com/advantage + + Get cloud support with Ubuntu Advantage Cloud Guest: + http://www.ubuntu.com/business/services/cloud + +0 packages can be updated. +0 updates are security updates. + +New release '18.04.2 LTS' available. +Run 'do-release-upgrade' to upgrade to it. + + +sudo apt-get --yes --quiet install zip subversion libboost-dev +unzip -qq -DD ../localZip.zip +cd /home/ubuntu/tmp +source oaienv +cd cmake_targets +./build_oai -I --eNB -w USRP --mu + +# Here wait for a few minutes 8 to 12 minutes # + +############################################################ +Creating a tmp folder to store results and artifacts +############################################################ +############################################################ +Destroying VM +############################################################ +# Host 192.168.122.2 found: line 19 +/home/eurecom/.ssh/known_hosts updated. +Original contents retained as /home/eurecom/.ssh/known_hosts.old +############################################################ +Checking build status +############################################################ +STATUS seems OK +``` + +If you are adding the `-k` or `--keep-vm-alive` option, the VM instance will not be destroyed and you explore what happenned. + +## 3.2. Build in the background ## + +This is how it is done in the CI master job pipeline. + +```bash +$ cd /tmp/CI-raphael +$ ls *.zip +localZip.zip +$ ./ci-scripts/oai-ci-vm-tool build --workspace /tmp/CI-raphael --job-name RAN-CI-develop --build-id 47 --variant phy-sim --daemon +12:44:24 ############################################################ +12:44:24 OAI CI VM script +12:44:24 ############################################################ +12:44:24 VM_NAME = RAN-CI-develop-b47-phy-sim +12:44:24 VM_CMD_FILE = RAN-CI-develop-b47-phy-sim_cmds.txt +12:44:24 JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop +12:44:24 ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/phy_sim +12:44:24 BUILD_OPTIONS = --phy_simulators +12:44:24 VM_MEMORY = 2048 MBytes +12:44:24 VM_CPU = 4 +12:44:24 ############################################################ +12:44:24 Creating VM (RAN-CI-develop-b47-phy-sim) on Ubuntu Cloud Image base +12:44:24 ############################################################ +12:44:27 Waiting for VM to be started +12:46:34 Warning: Permanently added '192.168.122.220' (ECDSA) to the list of known hosts. +12:46:34 RAN-CI-develop-b47-phy-sim has for IP addr = 192.168.122.220 +12:46:34 ############################################################ +12:46:34 Copying GIT repo into VM (RAN-CI-develop-b47-phy-sim) +12:46:34 ############################################################ +12:46:34 Warning: Permanently added '192.168.122.220' (ECDSA) to the list of known hosts. +12:46:34 ############################################################ +12:46:34 Running install and build script on VM (RAN-CI-develop-b47-phy-sim) +12:46:34 ############################################################ +12:46:34 Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-145-generic x86_64) +12:46:34 +12:46:34 * Documentation: https://help.ubuntu.com +12:46:34 * Management: https://landscape.canonical.com +12:46:34 * Support: https://ubuntu.com/advantage +12:46:34 +12:46:34 Get cloud support with Ubuntu Advantage Cloud Guest: +12:46:34 http://www.ubuntu.com/business/services/cloud +12:46:34 +12:46:34 0 packages can be updated. +12:46:34 0 updates are security updates. +12:46:34 +12:46:34 New release '18.04.2 LTS' available. +12:46:34 Run 'do-release-upgrade' to upgrade to it. +12:46:34 +12:46:34 +12:46:34 sudo apt-get --yes --quiet install zip daemon subversion libboost-dev +12:46:46 unzip -qq -DD ../localZip.zip +12:46:48 source oaienv +12:46:48 sudo -E daemon --inherit --unsafe --name=build_daemon --chdir=/home/ubuntu/tmp/cmake_targets -o /home/ubuntu/tmp/cmake_targets/log/install-build.txt ./my-vm-build.sh +12:46:48 STATUS seems OK +``` + +So here is 2.5 minutes, a VM was created, source files copied and the build process is started in the background. + +```bash +$ cd /tmp/raphael +$ ./ci-scripts/oai-ci-vm-tool wait --workspace /var/jenkins/workspace/RAN-CI-develop --variant phy-sim --job-name RAN-CI-develop --build-id 47 --keep-vm-alive +12:49:14 ############################################################ +12:49:14 OAI CI VM script +12:49:14 ############################################################ +12:49:14 VM_NAME = RAN-CI-develop-b47-phy-sim +12:49:14 VM_CMD_FILE = RAN-CI-develop-b47-phy-sim_cmds.txt +12:49:14 JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop +12:49:14 ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/phy_sim +12:49:14 BUILD_OPTIONS = --phy_simulators +12:49:15 Waiting for VM to be started +12:49:15 Warning: Permanently added '192.168.122.220' (ECDSA) to the list of known hosts. +12:49:16 RAN-CI-develop-b47-phy-sim has for IP addr = 192.168.122.220 +12:49:16 ############################################################ +12:49:16 Waiting build process to end on VM (RAN-CI-develop-b47-phy-sim) +12:49:16 ############################################################ +12:49:16 ps -aux | grep build +12:54:23 ############################################################ +12:54:23 Creating a tmp folder to store results and artifacts +12:54:23 ############################################################ +12:54:23 ############################################################ +12:54:23 Checking build status +12:54:23 ############################################################ +12:54:23 STATUS seems OK +``` + +Here the `--keep-vm-alive` option is used to keep the VM alive and performs some testing. + +--- + +Next step: [how the build is checked](vm_based_simulator_check_build) + +You can also go back to the [CI dev main page](./ci_dev_home) + diff --git a/ci-scripts/doc/vm_based_simulator_check_build.md b/ci-scripts/doc/vm_based_simulator_check_build.md new file mode 100644 index 0000000000..7bef5f3b15 --- /dev/null +++ b/ci-scripts/doc/vm_based_simulator_check_build.md @@ -0,0 +1,44 @@ + + + + + +
+ + + + + + OAI CI Virtual-Machine-based: checking the build result +
+ +## Table of Contents ## + +1. [Introduction](#1-introduction) +2. [Detailed Description](#2-detailed-description) + +# 1. Introduction # + +Function is called: + +- when building in foreground +- when waiting for the background build process is finished + +# 2. Detailed Description # + +Source file concerned: `ci-scripts/waitBuildOnVM.sh` + +## 2.1. check_on_vm_build function ## + +* Retrieve the build log files from the VM instance `ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.txt` +* and copy them locally in the workspace at $ARCHIVES_LOC +* List all log files that match the pattern. Each should have + * the `Built target` pattern (the library/executable SHALL link) +* The number of patterned log files SHALL match $NB_PATTERN_FILES defined in `ci-scripts/oai-ci-vm-tool` script for the variant + +--- + +Next step: [how to test a function](vm_based_simulator_test) + +You can also go back to the [CI dev main page](./ci_dev_home) + diff --git a/ci-scripts/doc/vm_based_simulator_create.md b/ci-scripts/doc/vm_based_simulator_create.md new file mode 100644 index 0000000000..5d7bad4310 --- /dev/null +++ b/ci-scripts/doc/vm_based_simulator_create.md @@ -0,0 +1,111 @@ + + + + + +
+ + + + + + OAI CI Virtual-Machine-based: create a VM instance +
+ +## Table of Contents ## + +1. [Introduction](#1-introduction) +2. [Detailed Description](#2-detailed-description) +3. [Typical Usage](#3-typical-usage) + +# 1. Introduction # + +```bash +$ cd /tmp/CI-raphael +$ ./ci-scripts/oai-ci-vm-tool create --help +OAI CI VM script + Original Author: Raphael Defosseux + Requirements: + -- uvtool uvtool-libvirt apt-cacher + -- xenial image already synced + Default: + -- eNB with USRP + +Usage: +------ + oai-ci-vm-tool create [OPTIONS] + +Mandatory Options: +-------- + --job-name #### OR -jn #### + Specify the name of the Jenkins job. + + --build-id #### OR -id #### + Specify the build ID of the Jenkins job. + + # OpenAirInterface Build Variants + --variant enb-usrp OR -v1 + --variant basic-sim OR -v2 + --variant phy-sim OR -v3 + --variant cppcheck OR -v4 + --variant enb-ethernet OR -v7 + --variant ue-ethernet OR -v8 + # non-OSA Build Variants + --variant flexran-rtc OR -v10 + # OpenAirInterface Test Variants + --variant l1-sim OR -v20 + --variant rf-sim OR -v21 + --variant l2-sim OR -v22 + Specify the variant to build. + + --help OR -h + Print this help message. +``` + +# 2. Detailed Description # + +Source file concerned: `ci-scripts/createVM.sh` + +## 2.1. create_vm function ## + +This is the function that is being called from the main oai-vm-tool script. + +The main purpose is to start a VM instance: + +```bash +uvt-kvm create $VM_NAME release=xenial --memory $VM_MEMORY --cpu $VM_CPU --unsafe-caching --template ci-scripts/template-host.xml +``` + +Variables are set in the main script based on the options. + +`--unsafe-caching` option is used because our VM instances are throw-away's. + +`--template ci-scripts/template-host.xml` is used to duplicate the CPU properties to the VM instance. **VERY IMPORTANT to build OAI** + +## 2.2. Lock / Unlock functions ## + +There are `acquire_vm_create_lock` and `release_vm_create_lock` functions. + +Creating Virtual Machines instances in parallel **creates a lot of stress** on the host server HW. If you launch creations in parallel (Jenkins pipeline could do it) or you are several people working on the same host server, this mechanism atomizes the creation process and wait until the previous VM creation is finished. + +# 3. Typical Usage # + +```bash +$ cd /tmp/CI-raphael +$ ./ci-scripts/oai-ci-vm-tool create --job-name raphael --build-id 1 --variant phy-sim +# or a more **unique approach** +$ ./ci-scripts/oai-ci-vm-tool create -jn toto -id 1 -v2 +``` + +The Jenkins pipeline uses the master job name as `job-name` option and the job-build ID. + +Try to be unique if you are several developers working on the same host server. + +Finally, typically I never use the `create` command. I use directly the build command that checks if VM is created and if not, will create it. See next step. + +--- + +Next step: [how to build an OAI variant](vm_based_simulator_build) + +You can also go back to the [CI dev main page](./ci_dev_home) + diff --git a/ci-scripts/doc/vm_based_simulator_destroy.md b/ci-scripts/doc/vm_based_simulator_destroy.md new file mode 100644 index 0000000000..d35d4062be --- /dev/null +++ b/ci-scripts/doc/vm_based_simulator_destroy.md @@ -0,0 +1,71 @@ + + + + + +
+ + + + + + OAI CI Virtual-Machine-based: Properly Destroy all VM instances +
+ +## Table of Contents ## + +1. [Introduction](#1-introduction) +2. [Detailed Description](#2-detailed-description) +3. [Typical Usage](#3-typical-usage) + +# 1. Introduction # + +```bash +$ cd /tmp/CI-raphael +$ ./ci-scripts/oai-ci-vm-tool destroy --help +OAI CI VM script + Original Author: Raphael Defosseux + Requirements: + -- uvtool uvtool-libvirt apt-cacher + +Usage: +------ + oai-ci-vm-tool destroy [OPTIONS] + +Mandatory Options: +-------- + --job-name #### OR -jn #### + Specify the name of the Jenkins job. + + --build-id #### OR -id #### + Specify the build ID of the Jenkins job. + +Options: +-------- + --help OR -h + Print this help message. +``` + +# 2. Detailed Description # + +Source file concerned: `ci-scripts/destroyAllRunningVM.sh` + +## 2.1. destroy_vm function ## + +This is the function that is being called from the main oai-vm-tool script. + +The main purpose is to destroy all VM instances whose name matches a pattern. + +It also cleans up the `.ssh/known_hosts` file. + +# 3. Typical Usage # + +```bash +$ cd /tmp/CI-raphael +$ ./ci-scripts/oai-ci-vm-tool destroy --job-name raphael --build-id 1 +``` + +--- + +You can go back to the [CI dev main page](./ci_dev_home) + diff --git a/ci-scripts/doc/vm_based_simulator_env.md b/ci-scripts/doc/vm_based_simulator_env.md new file mode 100644 index 0000000000..000f749946 --- /dev/null +++ b/ci-scripts/doc/vm_based_simulator_env.md @@ -0,0 +1,123 @@ + + + + + +
+ + + + + + OAI CI Virtual-Machine-based Simulator Test Environment +
+ +## Table of Contents ## + +1. [Introduction](#1-introduction) +2. [Prerequisites](#2-prerequisites) + 1. [uvtool installation](#21-uvtool-installation) + 2. [apt-cacher-server installation](#22-apt-cacher-server-installation) + +# 1. Introduction # + +This document explains how the master pipeline works and how any developer could contribute to add testing. + +It is an extension to the wiki [page](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/ci/enb-master-job). + +The purpose of this master pipeline is to: + +* Validate that a Merge Request is mergeable +* Validate that a Merge Request is following coding guidelines +* Validate that a Merge Request is not breaking any typical build variant +* Validate that a Merge Request is not breaking any legacy simulator-based test + +We will mainly focused on the 2 last items. + +Last point, this documentation is valid for all CI-supported branches: + +* `master` +* `develop` +* `develop-nr` + +But the feature set may not be aligned. **The principles still apply.** + +# 2. Prerequisites # + +Some details are available on this wiki [section](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/ci/enb-ci-architecture#22-pipeline-executor). + +Currently we have a host server (`bellatrix`) with the current parameters: + +* 40 x Intel(R) Xeon(R) CPU E5-2640 v4 @ 2.40GHz +* 64 Gbytes RAM +* Ubuntu 16.04.3 LTS (xenial) + +For you to replicate this environment, you need a strong server: + +* At least 16 cores +* Ubuntu 16 (xenial) or higher (such as bionic, not tested) + +Also we are using a Virtual Machine (VM for the rest of document) based strategy for the moment. + +So you need to install 2 tools: + +* uvt-kvm +* apt-cacher + +We are planning to also add: + +* A Red Hat Linux Entreprise 7.6 host environment +* A Container-based strategy (such as Docket and Kubernetes) + +## 2.1. uvtool installation ## + +```bash +$ sudo apt-get install uvtool +# if you don't have already, create an ssh key +$ ssh-keygen -b 2048 +# retrieve an image +$ sudo uvt-simplestreams-libvirt sync arch=amd64 release=xenial +# we might soon switch to an Ubuntu 18.04 version +$ sudo uvt-simplestreams-libvirt sync arch=amd64 release=bionic +$ uvt-simplestreams-libvirt query +release=bionic arch=amd64 label=release (20190402) +release=xenial arch=amd64 label=release (20190406) +``` + +On our server, I don't update (sync) that often (every 2-4 months). + +For more details: + +* uvtool syntax is [here](http://manpages.ubuntu.com/manpages/trusty/man1/uvt-kvm.1.html) +* more readable tutorial is [here](https://help.ubuntu.com/lts/serverguide/cloud-images-and-uvtool.html) + +## 2.2. apt-cacher-server installation ## + +I recommend to follow to the letter this [tutorial](https://help.ubuntu.com/community/Apt-Cacher-Server). + +The reason: we are creating/using/destroying a lot of VM instances and we are always installing the same packages. +This service allows to cache on the host and, doing so, **decreases the pressure on your internet bandwith usage**. +It also optimizes time at build stage. + +```bash +$ sudo apt-get install apt-cacher apache2 +$ sudo vi /etc/default/apt-cache +$ sudo service apache2 restart + +# Server configuration +$ sudo vi /etc/apt-cacher/apt-cacher.conf + --> allowed_hosts = * + --> fix the installer_files_regexp +$ sudo vi /etc/apt/apt.conf.d/01proxy +--> add `Acquire::http::Proxy "http://:3142";` +$ sudo service apt-cacher restart +``` + +This last file (/etc/apt/apt.conf.d/01proxy) is very important since it is tested in any CI script. + +--- + +We can now switch to the next step: [how to deal with oai sources](./vm_based_simulator_sources) + +You can also go back to the [CI dev main page](./ci_dev_home) + diff --git a/ci-scripts/doc/vm_based_simulator_main_scripts.md b/ci-scripts/doc/vm_based_simulator_main_scripts.md new file mode 100644 index 0000000000..96a35b1fdb --- /dev/null +++ b/ci-scripts/doc/vm_based_simulator_main_scripts.md @@ -0,0 +1,87 @@ + + + + + +
+ + + + + + OAI CI Virtual-Machine-based Main Script +
+ +## Table of Contents ## + +1. [Introduction](#1-introduction) +2. [Sub BASH scripts](#2-sub-bash-scripts) +3. [Main script features](#3-main-script-features) + +# 1. Introduction # + +The file name is `./ci-scripts/oai-ci-vm-tool` from the workspace root. + +```bash +$ cd /tmp/CI-raphael +$ ./ci-scripts/oai-ci-vm-tool --help +OAI CI VM script + Original Author: Raphael Defosseux + Requirements: + -- uvtool uvtool-libvirt apt-cacher + -- xenial image already synced + +Usage: +------ + oai-ci-vm-tool (-h|--help) {create,destroy,build,wait,test,report-build,report-test} ... + +``` + +This is a **BASH** script. + + +# 2. Sub BASH scripts # + +The main script is including a bunch of sub BASH scripts. + +* ci-scripts/createVM.sh +* ci-scripts/buildOnVM.sh +* ci-scripts/waitBuildOnVM.sh +* ci-scripts/destroyAllRunningVM.sh +* ci-scripts/runTestOnVM.sh +* ci-scripts/reportBuildLocally.sh +* ci-scripts/reportTestLocally.sh + +**NOTE: ci-scripts/runTestOnVM.sh is getting big and will certainly be split to facilate maintenance. Start functions will be also factorized.** + +# 3. Main script features # + +The main purpose of the main script is decipher the options and launch the requested function. + +It is also **testing if uvtool and apt-cacher are installed.** + +It finally provides parameters to the requested functions. Parameter definition is centralized there. + +For example: + +for VM instance creation: + +* the instance name: VM_NAME +* the RAM and number of CPUs: VM_MEMORY, VM_CPU + +for OAI variant build: + +* build options: BUILD_OPTIONS +* build log file to parse: LOG_PATTERN +* the number of log files to parse: NB_PATTERN_FILES + +These last 2 variables are very important if you change the build options or if you modify the build system and add more targets to build (especially true for physical simulator). + +There are many more variables. + +--- + +Next step: [how to create one or several VM instances](vm_based_simulator_create) + +You can also go back to the [CI dev main page](./ci_dev_home) + diff --git a/ci-scripts/doc/vm_based_simulator_sources.md b/ci-scripts/doc/vm_based_simulator_sources.md new file mode 100644 index 0000000000..0e59a5ca04 --- /dev/null +++ b/ci-scripts/doc/vm_based_simulator_sources.md @@ -0,0 +1,85 @@ + + + + + +
+ + + + + + OAI CI Virtual-Machine-based Simulator OAI source management +
+ +## Table of Contents ## + +1. [Introduction](#1-introduction) +2. [Centralized Workspace](#2-centralized-workspace) +3. [Create the ZIP file](#3-create-the-zip-file) + +# 1. Introduction # + +The idea of this section is to optimize/uniform source management for several VM instances. + +If we were cloning the same repository in each VM we are creating, we would put so much pressure on the central GitLab repository. + +The solution: + +* clone/fetch on a given clean workspace and tar/zip only the source files without any artifacts. +* we then copy the tar/zip file to each VM instance +* and within each VM instance, unzip + +# 2. Centralized Workspace # + +You can create a brand new workspace by cloning: + +```bash +$ mkdir /tmp/CI-raphael +$ cd /tmp/CI-raphael +$ git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git . +$ git checkout develop +``` + +You can also use your current cloned workspace and any `develop`-based branch. + +```bash +$ cd /home/raphael/openairinterface5g +$ git fetch +$ git checkout develop-improved-documentation +# CAUTION: the following command will remove any file that has not already been added to GIT +$ sudo git clean -x -d -ff +$ git status +On branch develop-improved-documentation +Your branch is up-to-date with 'origin/develop-improved-documentation'. +nothing to commit, working directory clean +``` + +You can also have modified files. + +**The main point is to have NO ARTIFACTS from a previous build in your workspace.** + +Last point, the workspace folder name is not necesseraly `openairinterface5g`. But all the following commands will be run for the root of the workspace. + +For clarity, I will always use `/tmp/CI-raphael` as $WORKSPACE. + +# 3. Create the ZIP file # + +```bash +# go to root of workspace +$ cd /tmp/CI-raphael +$ zip -r -qq localZip.zip . +``` + +The **Jenkins Pipeline** performs automatically these operations. + +In addition, in case of a merge request, it tries to merge with the target branch and might create a dummy local commit. + +See [section](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/ci/enb-master-job#32-verify-guidelines-stage) + +--- + +Next step: [the main scripts](vm_based_simulator_main_scripts) + +You can also go back to the [CI dev main page](./ci_dev_home) + diff --git a/ci-scripts/doc/vm_based_simulator_test.md b/ci-scripts/doc/vm_based_simulator_test.md new file mode 100644 index 0000000000..e8b9975317 --- /dev/null +++ b/ci-scripts/doc/vm_based_simulator_test.md @@ -0,0 +1,260 @@ + + + + + +
+ + + + + + OAI CI Virtual-Machine-based: Testing an OAI variant +
+ +## Table of Contents ## + +1. [Introduction](#1-introduction) +2. [Detailed Description](#2-detailed-description) +3. [Typical Usage](#3-typical-usage) + 1. [Testing the physical simulators](#31-testing-the-physicals-simulators) + 2. [Testing the basic simulator](#32-testing-the-basic-simulator) + 3. [Testing the RF simulator](#33-testing-the-rf-simulator) + 4. [Testing the L2-nFAPI simulator](#33-testing-the-l2-nfapi-simulator) + +# 1. Introduction # + +Currently 2 build variants can be directly tested: + +* Physical Simulators +* Basic Simulator + +In addition, 2 build variants are used: + +* OAI eNB with ETHERNET transport +* OAI UE with ETHERNET transport + +for the following scenarios: + +* L1 simulator w/ a channel simulator (NOT IMPLEMENTED) +* RF simulator : (IMPLEMENTED but not working as of 2019.w15) +* L2 nFAPI simulator + +Tests are run sequentially in the Jenkins pipeline because: + +* We want to mutualize the VM creation for an EPC +* We have seen performance issues when running in parallel. + + +```bash +./ci-scripts/oai-ci-vm-tool test --help +OAI CI VM script + Original Author: Raphael Defosseux + Requirements: + -- uvtool uvtool-libvirt apt-cacher + -- xenial image already synced + Default: + -- eNB with USRP + +Usage: +------ + oai-ci-vm-tool test [OPTIONS] + +Options: +-------- + --job-name #### OR -jn #### + Specify the name of the Jenkins job. + + --build-id #### OR -id #### + Specify the build ID of the Jenkins job. + + --workspace #### OR -ws #### + Specify the workspace. + + # OpenAirInterface Build Variants + --variant enb-usrp OR -v1 + --variant basic-sim OR -v2 + --variant phy-sim OR -v3 + --variant cppcheck OR -v4 + --variant enb-ethernet OR -v7 + --variant ue-ethernet OR -v8 + # non-OSA Build Variants + --variant flexran-rtc OR -v10 + # OpenAirInterface Test Variants + --variant l1-sim OR -v20 + --variant rf-sim OR -v21 + --variant l2-sim OR -v22 + Specify the variant to build. + + --keep-vm-alive OR -k + Keep the VM alive after the build. + + --help OR -h + Print this help message. +``` + +# 2. Detailed Description # + +Source file concerned: `ci-scripts/run_test_on_vm.sh` + +**TBD when file is re-structured.** + +# 3. Typical Usage # + +## 3.1. Testing the physical simulators ## + +```bash +$ ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant phy-sim --job-name RAN-CI-develop --build-id 47 +12:54:29 ############################################################ +12:54:29 OAI CI VM script +12:54:29 ############################################################ +12:54:29 VM_NAME = RAN-CI-develop-b47-phy-sim +12:54:29 VM_CMD_FILE = RAN-CI-develop-b47-phy-sim_cmds.txt +12:54:29 JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop +12:54:29 ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/phy_sim/test +12:54:29 ############################################################ +12:54:29 Waiting for VM to be started +12:54:29 ############################################################ +12:54:29 Warning: Permanently added '192.168.122.220' (ECDSA) to the list of known hosts. +12:54:30 RAN-CI-develop-b47-phy-sim has for IP addr = 192.168.122.220 +... +13:04:48 Test Results are written to /home/ubuntu/tmp/cmake_targets/autotests/log/results_autotests.xml +13:05:00 ############################################################ +13:05:00 Creating a tmp folder to store results and artifacts +13:05:00 ############################################################ +13:05:00 /var/jenkins/workspace/RAN-CI-develop/archives/phy_sim/test /var/jenkins/workspace/RAN-CI-develop +13:05:04 /var/jenkins/workspace/RAN-CI-develop +13:05:04 ############################################################ +13:05:04 Destroying VM +13:05:04 ############################################################ +13:05:06 # Host 192.168.122.220 found: line 21 +13:05:06 /home/eurecom/.ssh/known_hosts updated. +13:05:06 Original contents retained as /home/eurecom/.ssh/known_hosts.old +13:05:06 ############################################################ +13:05:06 Checking run status +13:05:06 ############################################################ +13:05:06 NB_FOUND_FILES = 1 +13:05:06 NB_RUNS = 20 +13:05:06 NB_FAILURES = 0 +13:05:06 STATUS seems OK +``` + +Note that the VM instance is destroyed. You do that when you are sure your test is passing. + +## 3.2. Testing the basic simulator ## + +```bash +$ ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant basic-sim --job-name RAN-CI-develop --build-id 48 +15:11:13 ############################################################ +15:11:13 OAI CI VM script +15:11:13 ############################################################ +15:11:13 VM_NAME = RAN-CI-develop-b48-basic-sim +15:11:13 VM_CMD_FILE = RAN-CI-develop-b48-basic-sim_cmds.txt +15:11:13 JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop +15:11:13 ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/basic_sim/test +15:11:13 ############################################################ +15:11:13 Waiting for VM to be started +15:11:13 ############################################################ +15:11:14 Warning: Permanently added '192.168.122.29' (ECDSA) to the list of known hosts. +15:11:15 RAN-CI-develop-b48-basic-sim has for IP addr = 192.168.122.29 +15:11:15 ############################################################ +15:11:15 Test EPC on VM (RAN-CI-develop-b48-epc) will be using ltebox +15:11:15 ############################################################ +15:11:15 EPC_VM_CMD_FILE = RAN-CI-develop-b48-epc_cmds.txt +15:11:15 ############################################################ +15:11:15 Creating test EPC VM (RAN-CI-develop-b48-epc) on Ubuntu Cloud Image base +15:11:15 ############################################################ +15:11:18 Waiting for VM to be started +15:13:25 Warning: Permanently added '192.168.122.156' (ECDSA) to the list of known hosts. +15:13:25 RAN-CI-develop-b48-epc has for IP addr = 192.168.122.156 +15:13:25 Warning: Permanently added '192.168.122.156' (ECDSA) to the list of known hosts. +15:13:25 ls: cannot access '/opt/ltebox/tools/start_ltebox': No such file or directory +15:13:25 ############################################################ +15:13:25 Copying ltebox archives into EPC VM (RAN-CI-develop-b48-epc) +15:13:25 ############################################################ +15:13:25 ############################################################ +15:13:25 Install EPC on EPC VM (RAN-CI-develop-b48-epc) +15:13:25 ############################################################ +.... +15:24:39 ############################################################ +15:24:39 Terminate EPC +15:24:39 ############################################################ +15:24:39 cd /opt/ltebox/tools +15:24:39 sudo ./stop_ltebox +15:24:40 sudo daemon --name=simulated_hss --stop +15:24:40 sudo killall --signal SIGKILL hss_sim +15:24:40 ############################################################ +15:24:40 Destroying VMs +15:24:40 ############################################################ +15:24:41 # Host 192.168.122.29 found: line 18 +15:24:41 /home/eurecom/.ssh/known_hosts updated. +15:24:41 Original contents retained as /home/eurecom/.ssh/known_hosts.old +15:24:43 # Host 192.168.122.60 found: line 20 +15:24:43 /home/eurecom/.ssh/known_hosts updated. +15:24:43 Original contents retained as /home/eurecom/.ssh/known_hosts.old +15:24:43 ############################################################ +15:24:43 Checking run status +15:24:43 ############################################################ +15:24:43 STATUS seems OK +``` + +## 3.3. Test the RF simulator ## + +```bash +./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant rf-sim --job-name RAN-CI-develop --build-id 48 --keep-vm-alive +15:24:45 Currently RF-Simulator Testing is not implemented / enabled +15:24:45 Comment out these lines in ./ci-scripts/oai-ci-vm-tool if you want to run it +15:24:45 STATUS seems OK +``` + +## 3.4. Testing the L2-nFAPI simulator + +```bash +./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant l2-sim --job-name RAN-CI-develop --build-id 48 +15:24:47 ############################################################ +15:24:47 OAI CI VM script +15:24:47 ############################################################ +15:24:47 ENB_VM_NAME = RAN-CI-develop-b48-enb-ethernet +15:24:47 ENB_VM_CMD_FILE = RAN-CI-develop-b48-enb-ethernet_cmds.txt +15:24:47 UE_VM_NAME = RAN-CI-develop-b48-ue-ethernet +15:24:47 UE_VM_CMD_FILE = RAN-CI-develop-b48-ue-ethernet_cmds.txt +15:24:47 JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop +15:24:47 ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/l2_sim/test +15:24:47 ############################################################ +15:24:47 Waiting for ENB VM to be started +15:24:47 ############################################################ +15:24:47 Warning: Permanently added '192.168.122.110' (ECDSA) to the list of known hosts. +15:24:48 RAN-CI-develop-b48-enb-ethernet has for IP addr = 192.168.122.110 +15:24:48 ############################################################ +15:24:48 Waiting for UE VM to be started +15:24:48 ############################################################ +15:24:49 Warning: Permanently added '192.168.122.90' (ECDSA) to the list of known hosts. +15:24:50 RAN-CI-develop-b48-ue-ethernet has for IP addr = 192.168.122.90 +15:24:50 ############################################################ +15:24:50 Test EPC on VM (RAN-CI-develop-b48-epc) will be using ltebox +15:24:50 ############################################################ +15:24:50 EPC_VM_CMD_FILE = RAN-CI-develop-b48-epc_cmds.txt +15:24:50 Waiting for VM to be started +15:24:50 Warning: Permanently added '192.168.122.156' (ECDSA) to the list of known hosts. +15:24:51 RAN-CI-develop-b48-epc has for IP addr = 192.168.122.156 +... +15:42:44 ############################################################ +15:42:44 Destroying VMs +15:42:44 ############################################################ +15:42:46 # Host 192.168.122.110 found: line 18 +15:42:46 /home/eurecom/.ssh/known_hosts updated. +15:42:46 Original contents retained as /home/eurecom/.ssh/known_hosts.old +15:42:47 # Host 192.168.122.90 found: line 18 +15:42:47 /home/eurecom/.ssh/known_hosts updated. +15:42:47 Original contents retained as /home/eurecom/.ssh/known_hosts.old +15:42:47 ############################################################ +15:42:47 Checking run status +15:42:47 ############################################################ +15:42:47 STATUS failed? +``` +--- + +Final step: [how to properly destroy all VM instances](vm_based_simulator_destroy) + +You can also go back to the [CI dev main page](./ci_dev_home) + diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index 043d47f7db..c0c7fbfefd 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -43,22 +43,23 @@ The Physical layer implements **3GPP 36.211**, **36.212**, **36.213** and provid **Transmission Mode, Bandwidth** | **Expected Throughput** | **Measured Throughput** | **Measurement Conditions** -------------------------------- | ----------------------- | ------------------------| ----------------: FDD DL: 5 MHz, 25 PRBS/ MCS 28 | 16 - 17 Mbit/s | TM1: 17.0 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) -FDD DL: 10 MHz, 50 PRBS/ MCS 28 | 34 - 35 Mbit/s | TM1: 32.8 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) +FDD DL: 10 MHz, 50 PRBS/ MCS 28 | 34 - 35 Mbit/s | TM1: 34.0 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) FDD DL: 20 MHz, 100 PRBS/ MCS 28 | 70 Mbit/s | TM1: 69.9 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) | | | FDD UL: 5 MHz, 25 PRBS/ MCS 20 | 9 Mbit/s | TM1: 8.28 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) -FDD UL: 10 MHz, 50 PRBS/ MCS 20 | 17 Mbit/s | TM1: 15.2 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) +FDD UL: 10 MHz, 50 PRBS/ MCS 20 | 17 Mbit/s | TM1: 18.3 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) FDD UL: 20 MHz, 100 PRBS/ MCS 20 | 35 Mbit/s | TM1: 18.6 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) | | -TDD DL: 5 MHz, 25 PRBS/ MCS **XX** | **TBC** Mbit/s | 3.33 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) -TDD DL: 10 MHz, 50 PRBS/ MCS **XX** | **TBC** Mbit/s | 8.90 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) -TDD DL: 20 MHz, 100 PRBS/ MCS **XX** | **TBC** Mbit/s | N/A | COTS-UE Cat 4 (150/50 Mbps) +TDD DL: 5 MHz, 25 PRBS/ MCS **XX** | 6.5 Mbit/s | TM1: 6.71 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) +TDD DL: 10 MHz, 50 PRBS/ MCS **XX** | 13.5 Mbit/s | TM1: 13.6 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) +TDD DL: 20 MHz, 100 PRBS/ MCS **XX** | 28.0 Mbit/s | TM1: 27.2 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) | | | -TDD UL: 5 MHz, 25 PRBS/ MCS **XX** | **TBC** Mbit/s | 1.66 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) -TDD UL: 10 MHz, 50 PRBS/ MCS **XX** | **TBC** Mbit/s | 1.89 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) -TDD UL: 20 MHz, 100 PRBS/ MCS **XX** | **TBC** Mbit/s | N/A | COTS-UE Cat 4 (150/50 Mbps) +TDD UL: 5 MHz, 25 PRBS/ MCS **XX** | 2.0 Mbit/s | TM1: 1.66 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) +TDD UL: 10 MHz, 50 PRBS/ MCS **XX** | 2.0 Mbit/s | TM1: 1.89 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) +TDD UL: 20 MHz, 100 PRBS/ MCS **XX** | 3.0 Mbit/s | TM1: 2.70 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) -- Number of supported UEs: **To Be Completed** +- Number of supported UEs: 16 by default, up to 256 when compiling with dedicated compile flag + Was tested with 40 COTS-UE ## eNB MAC Layer ## From b5008bf48add663ee6ea036032d32541312fee3c Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 18 Apr 2019 17:11:50 +0200 Subject: [PATCH 30/44] DOC: fix links in GitLab Signed-off-by: Raphael Defosseux --- ci-scripts/doc/ci_dev_home.md | 16 ++++++++-------- ci-scripts/doc/vm_based_simulator_build.md | 4 ++-- ci-scripts/doc/vm_based_simulator_check_build.md | 4 ++-- ci-scripts/doc/vm_based_simulator_create.md | 4 ++-- ci-scripts/doc/vm_based_simulator_destroy.md | 2 +- ci-scripts/doc/vm_based_simulator_env.md | 4 ++-- .../doc/vm_based_simulator_main_scripts.md | 4 ++-- ci-scripts/doc/vm_based_simulator_sources.md | 4 ++-- ci-scripts/doc/vm_based_simulator_test.md | 4 ++-- doc/FEATURE_SET.md | 7 +++++-- 10 files changed, 28 insertions(+), 25 deletions(-) diff --git a/ci-scripts/doc/ci_dev_home.md b/ci-scripts/doc/ci_dev_home.md index f6cf3a1cf0..3bfc36d3f4 100644 --- a/ci-scripts/doc/ci_dev_home.md +++ b/ci-scripts/doc/ci_dev_home.md @@ -14,14 +14,14 @@ VM-based RF-Less Environment: -* [How to setup your test env](vm_based_simulator_env) -* [How to deal with OAI source files](vm_based_simulator_sources) -* [The main script](vm_based_simulator_main_scripts) -* [How to create one or several VM instances](vm_based_simulator_create) -* [How to build an OAI variant](vm_based_simulator_build) -* [How the build is checked](vm_based_simulator_check_build) -* [How to test an OAI variant](vm_based_simulator_test) -* [How to destroy all VM instances](vm_based_simulator_destroy) +* [How to setup your test env](./vm_based_simulator_env.md) +* [How to deal with OAI source files](./vm_based_simulator_sources.md) +* [The main script](./vm_based_simulator_main_scripts.md) +* [How to create one or several VM instances](./vm_based_simulator_create.md) +* [How to build an OAI variant](./vm_based_simulator_build.md) +* [How the build is checked](./vm_based_simulator_check_build.md) +* [How to test an OAI variant](./vm_based_simulator_test.md) +* [How to destroy all VM instances](./vm_based_simulator_destroy.md) Currently missing documentation: * How to generate a build report diff --git a/ci-scripts/doc/vm_based_simulator_build.md b/ci-scripts/doc/vm_based_simulator_build.md index a064c7c1ff..826be457be 100644 --- a/ci-scripts/doc/vm_based_simulator_build.md +++ b/ci-scripts/doc/vm_based_simulator_build.md @@ -256,7 +256,7 @@ Here the `--keep-vm-alive` option is used to keep the VM alive and performs some --- -Next step: [how the build is checked](vm_based_simulator_check_build) +Next step: [how the build is checked](./vm_based_simulator_check_build.md) -You can also go back to the [CI dev main page](./ci_dev_home) +You can also go back to the [CI dev main page](./ci_dev_home.md) diff --git a/ci-scripts/doc/vm_based_simulator_check_build.md b/ci-scripts/doc/vm_based_simulator_check_build.md index 7bef5f3b15..0d9058377d 100644 --- a/ci-scripts/doc/vm_based_simulator_check_build.md +++ b/ci-scripts/doc/vm_based_simulator_check_build.md @@ -38,7 +38,7 @@ Source file concerned: `ci-scripts/waitBuildOnVM.sh` --- -Next step: [how to test a function](vm_based_simulator_test) +Next step: [how to test a function](./vm_based_simulator_test.md) -You can also go back to the [CI dev main page](./ci_dev_home) +You can also go back to the [CI dev main page](./ci_dev_home.md) diff --git a/ci-scripts/doc/vm_based_simulator_create.md b/ci-scripts/doc/vm_based_simulator_create.md index 5d7bad4310..c75221f6db 100644 --- a/ci-scripts/doc/vm_based_simulator_create.md +++ b/ci-scripts/doc/vm_based_simulator_create.md @@ -105,7 +105,7 @@ Finally, typically I never use the `create` command. I use directly the build co --- -Next step: [how to build an OAI variant](vm_based_simulator_build) +Next step: [how to build an OAI variant](./vm_based_simulator_build.md) -You can also go back to the [CI dev main page](./ci_dev_home) +You can also go back to the [CI dev main page](./ci_dev_home.md) diff --git a/ci-scripts/doc/vm_based_simulator_destroy.md b/ci-scripts/doc/vm_based_simulator_destroy.md index d35d4062be..ad87d18fa9 100644 --- a/ci-scripts/doc/vm_based_simulator_destroy.md +++ b/ci-scripts/doc/vm_based_simulator_destroy.md @@ -67,5 +67,5 @@ $ ./ci-scripts/oai-ci-vm-tool destroy --job-name raphael --build-id 1 --- -You can go back to the [CI dev main page](./ci_dev_home) +You can go back to the [CI dev main page](./ci_dev_home.md) diff --git a/ci-scripts/doc/vm_based_simulator_env.md b/ci-scripts/doc/vm_based_simulator_env.md index 000f749946..5dbcfbd931 100644 --- a/ci-scripts/doc/vm_based_simulator_env.md +++ b/ci-scripts/doc/vm_based_simulator_env.md @@ -117,7 +117,7 @@ This last file (/etc/apt/apt.conf.d/01proxy) is very important since it is teste --- -We can now switch to the next step: [how to deal with oai sources](./vm_based_simulator_sources) +We can now switch to the next step: [how to deal with oai sources](./vm_based_simulator_sources.md) -You can also go back to the [CI dev main page](./ci_dev_home) +You can also go back to the [CI dev main page](./ci_dev_home.md) diff --git a/ci-scripts/doc/vm_based_simulator_main_scripts.md b/ci-scripts/doc/vm_based_simulator_main_scripts.md index 96a35b1fdb..e810585757 100644 --- a/ci-scripts/doc/vm_based_simulator_main_scripts.md +++ b/ci-scripts/doc/vm_based_simulator_main_scripts.md @@ -81,7 +81,7 @@ There are many more variables. --- -Next step: [how to create one or several VM instances](vm_based_simulator_create) +Next step: [how to create one or several VM instances](./vm_based_simulator_create.md) -You can also go back to the [CI dev main page](./ci_dev_home) +You can also go back to the [CI dev main page](./ci_dev_home.md) diff --git a/ci-scripts/doc/vm_based_simulator_sources.md b/ci-scripts/doc/vm_based_simulator_sources.md index 0e59a5ca04..4bba6a8a09 100644 --- a/ci-scripts/doc/vm_based_simulator_sources.md +++ b/ci-scripts/doc/vm_based_simulator_sources.md @@ -79,7 +79,7 @@ See [section](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/ci/enb-mast --- -Next step: [the main scripts](vm_based_simulator_main_scripts) +Next step: [the main scripts](./vm_based_simulator_main_scripts.md) -You can also go back to the [CI dev main page](./ci_dev_home) +You can also go back to the [CI dev main page](./ci_dev_home.md) diff --git a/ci-scripts/doc/vm_based_simulator_test.md b/ci-scripts/doc/vm_based_simulator_test.md index e8b9975317..bc5a38b628 100644 --- a/ci-scripts/doc/vm_based_simulator_test.md +++ b/ci-scripts/doc/vm_based_simulator_test.md @@ -254,7 +254,7 @@ $ ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-dev ``` --- -Final step: [how to properly destroy all VM instances](vm_based_simulator_destroy) +Final step: [how to properly destroy all VM instances](./vm_based_simulator_destroy.md) -You can also go back to the [CI dev main page](./ci_dev_home) +You can also go back to the [CI dev main page](./ci_dev_home.md) diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index c0c7fbfefd..77c628dda8 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -58,8 +58,11 @@ TDD UL: 5 MHz, 25 PRBS/ MCS **XX** | 2.0 Mbit/s | TM1: 1.66 Mbits/s TDD UL: 10 MHz, 50 PRBS/ MCS **XX** | 2.0 Mbit/s | TM1: 1.89 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) TDD UL: 20 MHz, 100 PRBS/ MCS **XX** | 3.0 Mbit/s | TM1: 2.70 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) -- Number of supported UEs: 16 by default, up to 256 when compiling with dedicated compile flag - Was tested with 40 COTS-UE +### Number of supported UEs ### + +* 16 by default +* up to 256 when compiling with dedicated compile flag +* was tested with 40 COTS-UE ## eNB MAC Layer ## From 8418bec3a305acbb563dec751c1b1bf6ee056817 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 18 Apr 2019 17:20:01 +0200 Subject: [PATCH 31/44] DOC: fix some page headers Signed-off-by: Raphael Defosseux --- ci-scripts/doc/vm_based_simulator_build.md | 2 +- ci-scripts/doc/vm_based_simulator_check_build.md | 2 +- ci-scripts/doc/vm_based_simulator_create.md | 2 +- ci-scripts/doc/vm_based_simulator_destroy.md | 2 +- ci-scripts/doc/vm_based_simulator_main_scripts.md | 2 +- ci-scripts/doc/vm_based_simulator_test.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci-scripts/doc/vm_based_simulator_build.md b/ci-scripts/doc/vm_based_simulator_build.md index 826be457be..ca3ab356ea 100644 --- a/ci-scripts/doc/vm_based_simulator_build.md +++ b/ci-scripts/doc/vm_based_simulator_build.md @@ -7,7 +7,7 @@ - OAI CI Virtual-Machine-based: build an OAI variant + OAI CI Virtual-Machine-based Test Environment: build an OAI variant diff --git a/ci-scripts/doc/vm_based_simulator_check_build.md b/ci-scripts/doc/vm_based_simulator_check_build.md index 0d9058377d..d66b8ff2a0 100644 --- a/ci-scripts/doc/vm_based_simulator_check_build.md +++ b/ci-scripts/doc/vm_based_simulator_check_build.md @@ -7,7 +7,7 @@ - OAI CI Virtual-Machine-based: checking the build result + OAI CI Virtual-Machine-based Test Environment: checking the build result diff --git a/ci-scripts/doc/vm_based_simulator_create.md b/ci-scripts/doc/vm_based_simulator_create.md index c75221f6db..c54d69ca14 100644 --- a/ci-scripts/doc/vm_based_simulator_create.md +++ b/ci-scripts/doc/vm_based_simulator_create.md @@ -7,7 +7,7 @@ - OAI CI Virtual-Machine-based: create a VM instance + OAI CI Virtual-Machine-based Test Environment: create a VM instance diff --git a/ci-scripts/doc/vm_based_simulator_destroy.md b/ci-scripts/doc/vm_based_simulator_destroy.md index ad87d18fa9..d69e82a005 100644 --- a/ci-scripts/doc/vm_based_simulator_destroy.md +++ b/ci-scripts/doc/vm_based_simulator_destroy.md @@ -7,7 +7,7 @@ - OAI CI Virtual-Machine-based: Properly Destroy all VM instances + OAI CI Virtual-Machine-based Test Environment: Properly Destroy all VM instances diff --git a/ci-scripts/doc/vm_based_simulator_main_scripts.md b/ci-scripts/doc/vm_based_simulator_main_scripts.md index e810585757..91aa88b7ec 100644 --- a/ci-scripts/doc/vm_based_simulator_main_scripts.md +++ b/ci-scripts/doc/vm_based_simulator_main_scripts.md @@ -7,7 +7,7 @@ - OAI CI Virtual-Machine-based Main Script + OAI CI Virtual-Machine-based Test Environment: the Main Script diff --git a/ci-scripts/doc/vm_based_simulator_test.md b/ci-scripts/doc/vm_based_simulator_test.md index bc5a38b628..0be7ae5d3a 100644 --- a/ci-scripts/doc/vm_based_simulator_test.md +++ b/ci-scripts/doc/vm_based_simulator_test.md @@ -7,7 +7,7 @@ - OAI CI Virtual-Machine-based: Testing an OAI variant + OAI CI Virtual-Machine-based Test Environment: Testing an OAI variant From b39cb4e5860935a529a73a0d25b6e682b61e97bc Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 19 Apr 2019 10:55:27 +0200 Subject: [PATCH 32/44] CI: fix end of scenario when UE IP address retrieving fails during ping tests Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 9846dabc0f..9bb438378a 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -1134,7 +1134,7 @@ class SSHConnection(): logging.debug('\u001B[1mUE (' + device_id + ') IP Address is ' + UE_IPAddress + '\u001B[0m') for ueipaddress in self.UEIPAddresses: if ueipaddress == UE_IPAddress: - logging.debug('\u001B[1mUE (' + device_id + ') IP Address ' + UE_IPAddress + 'has been existed!' + '\u001B[0m') + logging.debug('\u001B[1mUE (' + device_id + ') IP Address ' + UE_IPAddress + ': has already been allocated to another device !' + '\u001B[0m') ue_ip_status -= 1 continue self.UEIPAddresses.append(UE_IPAddress) @@ -1323,6 +1323,7 @@ class SSHConnection(): ueIpStatus = self.GetAllUEIPAddresses() if (ueIpStatus < 0): self.CreateHtmlTestRow(self.ping_args, 'KO', UE_IP_ADDRESS_ISSUE) + self.AutoTerminateUEandeNB() self.CreateHtmlTabFooter(False) sys.exit(1) multi_jobs = [] From 42713b95fcc2ffe8dfebaf45efd6592c23107a67 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 18 Apr 2019 11:35:21 +0200 Subject: [PATCH 33/44] Configure complete PDCP in lte-(ue)softmodem * Instead of partly initializing in read_config_and_init(), everything of PDCP is initialized in main() of lte-softmodem * Omit RC.rrc access in RRU through checking of RC.nb_inst > 0 * Includes FlexRAN, i.e. do not start FlexRAN in RRU * Function pointers to PDCP functions have to be set explicitly (avoid confusion of multiply setting function pointers) --- openair2/ENB_APP/enb_config.c | 8 ----- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 3 -- openair2/LAYER2/RLC/rlc.c | 4 --- targets/RT/USER/lte-softmodem.c | 46 +++++++++++++++++++---------- targets/RT/USER/lte-softmodem.h | 1 + targets/RT/USER/lte-uesoftmodem.c | 24 ++++++++++----- 6 files changed, 48 insertions(+), 38 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 341981fcf0..98ca565216 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -2569,12 +2569,4 @@ void read_config_and_init(void) { memset((void *)RC.rrc[enb_id], 0, sizeof(eNB_RRC_INST)); RCconfig_RRC(enb_id, RC.rrc[enb_id],macrlc_has_f1[enb_id]); } - - if (!NODE_IS_DU(RC.rrc[0]->node_type)) { - pdcp_layer_init(); - - if ( NODE_IS_CU(RC.rrc[0]->node_type) ) { - pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req, (pdcp_data_ind_func_t)proto_agent_send_pdcp_data_ind); - } - } } diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 016b626738..3687f25fda 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -2175,9 +2175,6 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) { netlink_init(); } } - - /* default interface with rlc (will be modified if CU) */ - pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)rlc_data_req, (pdcp_data_ind_func_t) pdcp_data_ind); return pdcp_params.optmask ; } diff --git a/openair2/LAYER2/RLC/rlc.c b/openair2/LAYER2/RLC/rlc.c index 7454e253b5..70e0ecd20a 100644 --- a/openair2/LAYER2/RLC/rlc.c +++ b/openair2/LAYER2/RLC/rlc.c @@ -52,10 +52,6 @@ extern boolean_t pdcp_data_ind( //#define TRACE_RLC_PAYLOAD 1 #define DEBUG_RLC_DATA_REQ 1 - - -#include "proto_agent.h" - //----------------------------------------------------------------------------- void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char *dataP, const signed long sizeP) //----------------------------------------------------------------------------- diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index fbfcf9020b..cd8cf3cf38 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -575,6 +575,27 @@ int restart_L1L2(module_id_t enb_id) { return 0; } +void init_pdcp(void) { + if (!NODE_IS_DU(RC.rrc[0]->node_type)) { + pdcp_layer_init(); + uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? + (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; + if (IS_SOFTMODEM_NOS1) + pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ; + pdcp_module_init(pdcp_initmask); + + if (NODE_IS_CU(RC.rrc[0]->node_type)) { + pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req, + (pdcp_data_ind_func_t)proto_agent_send_pdcp_data_ind); + } else { + pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)rlc_data_req, + (pdcp_data_ind_func_t) pdcp_data_ind); + } + } else { + pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req, + (pdcp_data_ind_func_t)proto_agent_send_pdcp_data_ind); + } +} static void wait_nfapi_init(char *thread_name) { printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name); @@ -654,24 +675,19 @@ int main( int argc, char **argv ) { fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx); /* Read configuration */ - if (RC.nb_inst > 0) + if (RC.nb_inst > 0) { read_config_and_init(); - /* Start the agent. If it is turned off in the configuration, it won't start */ - RCconfig_flexran(); + /* Start the agent. If it is turned off in the configuration, it won't start */ + RCconfig_flexran(); + for (i = 0; i < RC.nb_inst; i++) { + flexran_agent_start(i); + } - for (i = 0; i < RC.nb_inst; i++) { - flexran_agent_start(i); - } + /* initializes PDCP and sets correct RLC Request/PDCP Indication callbacks + * for monolithic/F1 modes */ + init_pdcp(); - uint32_t pdcp_initmask = ( IS_SOFTMODEM_NOS1 )? ( PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; - - if ( IS_SOFTMODEM_NOS1) - pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ; - - pdcp_module_init(pdcp_initmask); - - if (RC.nb_inst > 0) { if (create_tasks(1) < 0) { printf("cannot create ITTI tasks\n"); exit(-1); @@ -683,7 +699,7 @@ int main( int argc, char **argv ) { itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p); } } else { - printf("No ITTI, Initializing L1\n"); + printf("RC.nb_inst = 0, Initializing L1\n"); RCconfig_L1(); } diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 2d05ca174e..5900889e6d 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -35,6 +35,7 @@ #include "flexran_agent.h" #include "s1ap_eNB.h" #include "SIMULATION/ETH_TRANSPORT/proto.h" +#include "proto_agent.h" /* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */ #define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n" diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index 3ae3e22ef0..c6e716306f 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -659,6 +659,21 @@ int restart_L1L2(module_id_t enb_id) { return 0; } +void init_pdcp(void) { + uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT); + + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) { + pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT; + } + + if (IS_SOFTMODEM_NOKRNMOD) + pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT; + + pdcp_module_init(pdcp_initmask); + pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)rlc_data_req, + (pdcp_data_ind_func_t) pdcp_data_ind); +} + int main( int argc, char **argv ) { #if defined (XFORMS) void *status; @@ -734,16 +749,9 @@ int main( int argc, char **argv ) { MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX); init_opt(); - uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1 )? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT); - if ( IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF) ) { - pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT; - } + init_pdcp(); - if ( IS_SOFTMODEM_NOKRNMOD) - pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT; - - pdcp_module_init( pdcp_initmask ); //TTN for D2D printf ("RRC control socket\n"); rrc_control_socket_init(); From 82db43219143dacfc8818710e1942b377cd3df07 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 18 Apr 2019 16:21:44 +0200 Subject: [PATCH 34/44] Make separate func_ptr setters for PDCP Ind/RLC Req --- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 6 ++++-- openair2/LAYER2/PDCP_v10.1.0/pdcp.h | 4 ++-- targets/RT/USER/lte-softmodem.c | 10 ++++------ targets/RT/USER/lte-uesoftmodem.c | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 3687f25fda..d1252c8d5a 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -2140,9 +2140,11 @@ pdcp_data_ind_func_t get_pdcp_data_ind_func() { return pdcp_params.pdcp_data_ind_func; } -void pdcp_set_rlc_funcptr(send_rlc_data_req_func_t send_rlc_data_req, - pdcp_data_ind_func_t pdcp_data_ind) { +void pdcp_set_rlc_data_req_func(send_rlc_data_req_func_t send_rlc_data_req) { pdcp_params.send_rlc_data_req_func = send_rlc_data_req; +} + +void pdcp_set_pdcp_data_ind_func(pdcp_data_ind_func_t pdcp_data_ind) { pdcp_params.pdcp_data_ind_func = pdcp_data_ind; } diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h index 305b8ab2b4..860f90bf34 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h @@ -412,8 +412,8 @@ int pdcp_fifo_flush_sdus ( const protocol_ctxt_t *const ct int pdcp_fifo_read_input_sdus_remaining_bytes ( const protocol_ctxt_t *const ctxt_pP); int pdcp_fifo_read_input_sdus ( const protocol_ctxt_t *const ctxt_pP); void pdcp_fifo_read_input_sdus_from_otg ( const protocol_ctxt_t *const ctxt_pP); -void pdcp_set_rlc_funcptr(send_rlc_data_req_func_t send_rlc_data_req, - pdcp_data_ind_func_t pdcp_data_ind); +void pdcp_set_rlc_data_req_func(send_rlc_data_req_func_t send_rlc_data_req); +void pdcp_set_pdcp_data_ind_func(pdcp_data_ind_func_t pdcp_data_ind); pdcp_data_ind_func_t get_pdcp_data_ind_func(void); //----------------------------------------------------------------------------- diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index cd8cf3cf38..c87ebb0af3 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -585,15 +585,13 @@ void init_pdcp(void) { pdcp_module_init(pdcp_initmask); if (NODE_IS_CU(RC.rrc[0]->node_type)) { - pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req, - (pdcp_data_ind_func_t)proto_agent_send_pdcp_data_ind); + pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req); } else { - pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)rlc_data_req, - (pdcp_data_ind_func_t) pdcp_data_ind); + pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req); + pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind); } } else { - pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req, - (pdcp_data_ind_func_t)proto_agent_send_pdcp_data_ind); + pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind); } } diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index c6e716306f..fdfdbfc1dd 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -670,8 +670,8 @@ void init_pdcp(void) { pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT; pdcp_module_init(pdcp_initmask); - pdcp_set_rlc_funcptr((send_rlc_data_req_func_t)rlc_data_req, - (pdcp_data_ind_func_t) pdcp_data_ind); + pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req); + pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind); } int main( int argc, char **argv ) { From 9bf9c2fe9728397932c98bc9ecc2638bb2214e74 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 23 Apr 2019 15:41:46 +0200 Subject: [PATCH 35/44] CI: made UE cell synchro more reliable --> looping during the initOAIUE stage Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 87 ++++++++++++++++--- .../xml_files/ue_band20_test_10mhz_orange.xml | 2 +- 2 files changed, 75 insertions(+), 14 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 9846dabc0f..6fe1b996f8 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -629,27 +629,88 @@ class SSHConnection(): # Launch UE with the modified config file self.command('echo "ulimit -c unlimited && ./lte-uesoftmodem ' + self.Initialize_OAI_UE_args + '" > ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5) self.command('chmod 775 ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5) - self.command('echo ' + self.UEPassword + ' | sudo -S rm -Rf ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log', '\$', 5) - self.command('echo ' + self.UEPassword + ' | sudo -S -E daemon --inherit --unsafe --name=ue' + str(self.UE_instance) + '_daemon --chdir=' + self.UESourceCodePath + '/cmake_targets/lte_build_oai/build -o ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5) self.UELogFile = 'ue_' + self.testCase_id + '.log' - time.sleep(6) - self.command('cd ../..', '\$', 5) - doLoop = True - loopCounter = 10 - while (doLoop): - loopCounter = loopCounter - 1 - if (loopCounter == 0): - sys.exit(1) - else: + + # We are now looping several times to hope we really sync w/ an eNB + doOutterLoop = True + outterLoopCounter = 5 + gotSyncStatus = True + fullSyncStatus = True + while (doOutterLoop): + self.command('cd ' + self.UESourceCodePath + '/cmake_targets/lte_build_oai/build', '\$', 5) + self.command('echo ' + self.UEPassword + ' | sudo -S rm -Rf ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log', '\$', 5) + self.command('echo ' + self.UEPassword + ' | sudo -S -E daemon --inherit --unsafe --name=ue' + str(self.UE_instance) + '_daemon --chdir=' + self.UESourceCodePath + '/cmake_targets/lte_build_oai/build -o ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5) + time.sleep(6) + self.command('cd ../..', '\$', 5) + doLoop = True + loopCounter = 10 + gotSyncStatus = True + # the 'got sync' message is for the UE threads synchronization + while (doLoop): + loopCounter = loopCounter - 1 + if (loopCounter == 0): + # Here should never occur + logging.error('"got sync" message never showed!') + gotSyncStatus = False + doLoop = False + continue self.command('stdbuf -o0 cat ue_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync"', '\$', 4) result = re.search('got sync', str(self.ssh.before)) if result is None: time.sleep(6) else: doLoop = False - self.CreateHtmlTestRow(self.Initialize_OAI_UE_args, 'OK', ALL_PROCESSES_OK, 'OAI UE') - logging.debug('\u001B[1m Initialize OAI UE Completed\u001B[0m') + logging.debug('Found "got sync" message!') + if gotSyncStatus == False: + # we certainly need to stop the lte-uesoftmodem process if it is still running! + self.command('ps -aux | grep --text --color=never softmodem | grep -v grep', '\$', 4) + result = re.search('lte-uesoftmodem', str(self.ssh.before)) + if result is not None: + self.command('echo ' + self.UEPassword + ' | sudo -S killall --signal=SIGINT lte-uesoftmodem', '\$', 4) + time.sleep(3) + # We are now checking if sync w/ eNB DOES NOT OCCUR + # Usually during the cell synchronization stage, the UE returns with No cell synchronization message + doLoop = True + loopCounter = 10 + while (doLoop): + loopCounter = loopCounter - 1 + if (loopCounter == 0): + # Here we do have a great chance that the UE did cell-sync w/ eNB + doLoop = False + doOutterLoop = False + fullSyncStatus = True + continue + self.command('stdbuf -o0 cat ue_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync"', '\$', 4) + result = re.search('No cell synchronization found', str(self.ssh.before)) + if result is None: + time.sleep(6) + else: + doLoop = False + fullSyncStatus = False + logging.debug('Found: "No cell synchronization" message! --> try again') + time.sleep(6) + self.command('ps -aux | grep --text --color=never softmodem | grep -v grep', '\$', 4) + result = re.search('lte-uesoftmodem', str(self.ssh.before)) + if result is not None: + self.command('echo ' + self.UEPassword + ' | sudo -S killall --signal=SIGINT lte-uesoftmodem', '\$', 4) + outterLoopCounter = outterLoopCounter - 1 + if (outterLoopCounter == 0): + doOutterLoop = False + + if fullSyncStatus and gotSyncStatus: + result = re.search('--no-L2-connect', str(self.Initialize_OAI_UE_args)) + if result is None: + self.command('ifconfig oaitun_ue1', '\$', 4) + result = re.search('inet addr', str(self.ssh.before)) + if result is not None: + logging.debug('\u001B[1m oaitun_ue1 interface is mounted and configured\u001B[0m') + else: + logging.error('\u001B[1m oaitun_ue1 interface is either NOT mounted or NOT configured\u001B[0m') + self.close() + # For the moment we are always OK!!! + self.CreateHtmlTestRow(self.Initialize_OAI_UE_args, 'OK', ALL_PROCESSES_OK, 'OAI UE') + logging.debug('\u001B[1m Initialize OAI UE Completed\u001B[0m') def checkDevTTYisUnlocked(self): self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) diff --git a/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml index 23567643a1..9a83311c6d 100644 --- a/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml +++ b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml @@ -32,7 +32,7 @@ Initialize_OAI_UE Initialize OAI UE -- sniffing Orange frequency - -C 816000000 -r 50 --ue-rxgain 130 --ue-scan-carrier --no-L2-connect --nokrnmod 1 + -C 816000000 -r 50 --ue-rxgain 135 --ue-scan-carrier --no-L2-connect --nokrnmod 1 From 489726d0de98b7bf647ab73589cd9e697b7f39eb Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 23 Apr 2019 17:21:58 +0200 Subject: [PATCH 36/44] CI: fixing some gains in the CI bench conf files for TDD Signed-off-by: Raphael Defosseux --- .../enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf | 6 +++--- .../enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf | 6 +++--- .../enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf index 1fc3114754..370697660e 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf @@ -37,7 +37,7 @@ eNBs = nb_antennas_tx = 1; nb_antennas_rx = 1; tx_gain = 90; - rx_gain = 125; + rx_gain = 115; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; @@ -183,8 +183,8 @@ MACRLCs = ( tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; scheduler_mode = "fairRR"; - puSch10xSnr = 200; - puCch10xSnr = 200; + puSch10xSnr = 150; + puCch10xSnr = 150; } ); diff --git a/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf index 2ef30ea4c2..fbbc2f1154 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf @@ -183,8 +183,8 @@ MACRLCs = ( tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; scheduler_mode = "fairRR"; - puSch10xSnr = 200; - puCch10xSnr = 200; + puSch10xSnr = 150; + puCch10xSnr = 150; } ); @@ -204,7 +204,7 @@ RUs = ( att_rx = 0; bands = [38]; max_pdschReferenceSignalPower = -27; - max_rxgain = 115; + max_rxgain = 125; eNB_instances = [0]; } diff --git a/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf index fbbade22f3..f49d860a51 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf @@ -37,7 +37,7 @@ eNBs = nb_antennas_tx = 1; nb_antennas_rx = 1; tx_gain = 90; - rx_gain = 125; + rx_gain = 120; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; @@ -183,8 +183,8 @@ MACRLCs = ( tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; scheduler_mode = "fairRR"; - puSch10xSnr = 200; - puCch10xSnr = 200; + puSch10xSnr = 150; + puCch10xSnr = 150; } ); @@ -204,7 +204,7 @@ RUs = ( att_rx = 0; bands = [38]; max_pdschReferenceSignalPower = -27; - max_rxgain = 115; + max_rxgain = 120; eNB_instances = [0]; } From 52023590e4e92d5da720f8c5a62cc67ffa79be01 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 24 Apr 2019 13:44:22 +0200 Subject: [PATCH 37/44] DOC: remeasured TDD performances Signed-off-by: Raphael Defosseux --- doc/FEATURE_SET.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index 77c628dda8..fc869d517c 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -54,9 +54,9 @@ TDD DL: 5 MHz, 25 PRBS/ MCS **XX** | 6.5 Mbit/s | TM1: 6.71 Mbits/s TDD DL: 10 MHz, 50 PRBS/ MCS **XX** | 13.5 Mbit/s | TM1: 13.6 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) TDD DL: 20 MHz, 100 PRBS/ MCS **XX** | 28.0 Mbit/s | TM1: 27.2 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) | | | -TDD UL: 5 MHz, 25 PRBS/ MCS **XX** | 2.0 Mbit/s | TM1: 1.66 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) -TDD UL: 10 MHz, 50 PRBS/ MCS **XX** | 2.0 Mbit/s | TM1: 1.89 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) -TDD UL: 20 MHz, 100 PRBS/ MCS **XX** | 3.0 Mbit/s | TM1: 2.70 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) +TDD UL: 5 MHz, 25 PRBS/ MCS **XX** | 2.0 Mbit/s | TM1: 3.31 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) +TDD UL: 10 MHz, 50 PRBS/ MCS **XX** | 2.0 Mbit/s | TM1: 7.25 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) +TDD UL: 20 MHz, 100 PRBS/ MCS **XX** | 3.0 Mbit/s | TM1: 4.21 Mbits/s | COTS-UE Cat 4 (150/50 Mbps) ### Number of supported UEs ### From 4ecc3c1e1f19af8ae2b411b7f5af184a1af003b1 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 24 Apr 2019 18:03:31 +0200 Subject: [PATCH 38/44] CI: OAI-UE USRP testing supports S1 configuration and testing Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 140 +++++++++++++----- .../enb_ue_usrp210_band7_epc_closure.xml | 48 ++++++ .../enb_ue_usrp210_band7_epc_start.xml | 47 ++++++ ...enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml | 103 +++++++++++++ 4 files changed, 305 insertions(+), 33 deletions(-) create mode 100644 ci-scripts/xml_files/enb_ue_usrp210_band7_epc_closure.xml create mode 100644 ci-scripts/xml_files/enb_ue_usrp210_band7_epc_start.xml create mode 100644 ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 6fe1b996f8..3136df7575 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -888,24 +888,28 @@ class SSHConnection(): if ping_status < 0: message = 'Ping with UE (' + str(moduleIPAddr) + ') crashed due to TIMEOUT!' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.close() self.ping_iperf_wrong_exit(lock, moduleIPAddr, device_id, statusQueue, message) return result = re.search(', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', str(self.ssh.before)) if result is None: message = 'Packet Loss Not Found!' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.close() self.ping_iperf_wrong_exit(lock, moduleIPAddr, device_id, statusQueue, message) return packetloss = result.group('packetloss') if float(packetloss) == 100: message = 'Packet Loss is 100%' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.close() self.ping_iperf_wrong_exit(lock, moduleIPAddr, device_id, statusQueue, message) return result = re.search('rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', str(self.ssh.before)) if result is None: message = 'Ping RTT_Min RTT_Avg RTT_Max Not Found!' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.close() self.ping_iperf_wrong_exit(lock, moduleIPAddr, device_id, statusQueue, message) return rtt_min = result.group('rtt_min') @@ -1176,6 +1180,18 @@ class SSHConnection(): sys.exit('Insufficient Parameter') ue_ip_status = 0 self.UEIPAddresses = [] + if (len(self.UEDevices) == 1) and (self.UEDevices[0] == 'OAI-UE'): + if self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '' or self.UESourceCodePath == '': + Usage() + sys.exit('Insufficient Parameter') + self.open(self.UEIPAddress, self.UEUserName, self.UEPassword) + self.command('ifconfig oaitun_ue1', '\$', 4) + result = re.search('inet addr:(?P[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)', str(self.ssh.before)) + UE_IPAddress = result.group('ueipaddress') + logging.debug('\u001B[1mUE (' + self.UEDevices[0] + ') IP Address is ' + UE_IPAddress + '\u001B[0m') + self.UEIPAddresses.append(UE_IPAddress) + self.close() + return ue_ip_status self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) for device_id in self.UEDevices: count = 0 @@ -1221,24 +1237,28 @@ class SSHConnection(): if ping_status < 0: message = 'Ping with UE (' + str(UE_IPAddress) + ') crashed due to TIMEOUT!' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.close() self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, message) return result = re.search(', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', str(self.ssh.before)) if result is None: message = 'Packet Loss Not Found!' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.close() self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, message) return packetloss = result.group('packetloss') if float(packetloss) == 100: message = 'Packet Loss is 100%' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.close() self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, message) return result = re.search('rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', str(self.ssh.before)) if result is None: message = 'Ping RTT_Min RTT_Avg RTT_Max Not Found!' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.close() self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, message) return rtt_min = result.group('rtt_min') @@ -1375,15 +1395,20 @@ class SSHConnection(): Usage() sys.exit('Insufficient Parameter') check_eNB = True - check_OAI_UE = False + if (len(self.UEDevices) == 1) and (self.UEDevices[0] == 'OAI-UE'): + check_OAI_UE = True + else: + check_OAI_UE = False pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE) if (pStatus < 0): self.CreateHtmlTestRow(self.ping_args, 'KO', pStatus) + self.AutoTerminateUEandeNB() self.CreateHtmlTabFooter(False) sys.exit(1) ueIpStatus = self.GetAllUEIPAddresses() if (ueIpStatus < 0): self.CreateHtmlTestRow(self.ping_args, 'KO', UE_IP_ADDRESS_ISSUE) + self.AutoTerminateUEandeNB() self.CreateHtmlTabFooter(False) sys.exit(1) multi_jobs = [] @@ -1724,8 +1749,12 @@ class SSHConnection(): self.close() # Launch iperf client on UE - self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) - self.command('cd ' + self.EPCSourceCodePath + '/scripts', '\$', 5) + if (device_id == 'OAI-UE'): + self.open(self.UEIPAddress, self.UEUserName, self.UEPassword) + self.command('cd ' + self.UESourceCodePath + '/cmake_targets', '\$', 5) + else: + self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + self.command('cd ' + self.EPCSourceCodePath + '/scripts', '\$', 5) iperf_time = self.Iperf_ComputeTime() time.sleep(0.5) @@ -1737,12 +1766,16 @@ class SSHConnection(): time.sleep(0.5) self.command('rm -f iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', 5) - iperf_status = self.command('stdbuf -o0 adb -s ' + device_id + ' shell "/data/local/tmp/iperf -c ' + EPC_Iperf_UE_IPAddress + ' ' + modified_options + ' -p ' + str(port) + '" 2>&1 | stdbuf -o0 tee iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) + if (device_id == 'OAI-UE'): + iperf_status = self.command('iperf -c ' + EPC_Iperf_UE_IPAddress + ' ' + modified_options + ' -p ' + str(port) + ' -B ' + UE_IPAddress + ' 2>&1 | stdbuf -o0 tee iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) + else: + iperf_status = self.command('stdbuf -o0 adb -s ' + device_id + ' shell "/data/local/tmp/iperf -c ' + EPC_Iperf_UE_IPAddress + ' ' + modified_options + ' -p ' + str(port) + '" 2>&1 | stdbuf -o0 tee iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) # TIMEOUT Case if iperf_status < 0: self.close() message = 'iperf on UE (' + str(UE_IPAddress) + ') crashed due to TIMEOUT !' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.close() self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, message) return clientStatus = self.Iperf_analyzeV2Output(lock, UE_IPAddress, device_id, statusQueue, modified_options) @@ -1759,6 +1792,10 @@ class SSHConnection(): os.remove('iperf_server_' + self.testCase_id + '_' + device_id + '.log') self.copyin(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, self.EPCSourceCodePath + '/scripts/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.') self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, modified_options) + # in case of OAI-UE + if (device_id == 'OAI-UE'): + self.copyin(self.UEIPAddress, self.UEUserName, self.UEPassword, self.UESourceCodePath + '/cmake_targets/iperf_' + self.testCase_id + '_' + device_id + '.log', '.') + self.copyout(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, 'iperf_' + self.testCase_id + '_' + device_id + '.log', self.EPCSourceCodePath + '/scripts') def Iperf_common(self, lock, UE_IPAddress, device_id, idx, ue_num, statusQueue): try: @@ -1767,43 +1804,60 @@ class SSHConnection(): return useIperf3 = False udpIperf = True - self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) - # if by chance ADB server and EPC are on the same remote host, at least log collection will take care of it - self.command('if [ ! -d ' + self.EPCSourceCodePath + '/scripts ]; then mkdir -p ' + self.EPCSourceCodePath + '/scripts ; fi', '\$', 5) - self.command('cd ' + self.EPCSourceCodePath + '/scripts', '\$', 5) - # Checking if iperf / iperf3 are installed - self.command('adb -s ' + device_id + ' shell "ls /data/local/tmp"', '\$', 5) - result = re.search('iperf3', str(self.ssh.before)) - if result is None: - result = re.search('iperf', str(self.ssh.before)) + if (device_id != 'OAI-UE'): + self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + # if by chance ADB server and EPC are on the same remote host, at least log collection will take care of it + self.command('if [ ! -d ' + self.EPCSourceCodePath + '/scripts ]; then mkdir -p ' + self.EPCSourceCodePath + '/scripts ; fi', '\$', 5) + self.command('cd ' + self.EPCSourceCodePath + '/scripts', '\$', 5) + # Checking if iperf / iperf3 are installed + self.command('adb -s ' + device_id + ' shell "ls /data/local/tmp"', '\$', 5) + result = re.search('iperf3', str(self.ssh.before)) if result is None: - message = 'Neither iperf nor iperf3 installed on UE!' - logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') - self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, message) - return - else: - useIperf3 = True + result = re.search('iperf', str(self.ssh.before)) + if result is None: + message = 'Neither iperf nor iperf3 installed on UE!' + logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.close() + self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, message) + return + else: + useIperf3 = True + self.close() # in case of iperf, UL has its own function if (not useIperf3): result = re.search('-R', str(self.iperf_args)) if result is not None: - self.close() self.Iperf_UL_common(lock, UE_IPAddress, device_id, idx, ue_num, statusQueue) return - if (useIperf3): - self.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/iperf3 -s &', '\$', 5) - else: + # Launch the IPERF server on the UE side for DL + if (device_id == 'OAI-UE'): + self.open(self.UEIPAddress, self.UEUserName, self.UEPassword) + self.command('cd ' + self.UESourceCodePath + '/cmake_targets', '\$', 5) self.command('rm -f iperf_server_' + self.testCase_id + '_' + device_id + '.log', '\$', 5) result = re.search('-u', str(self.iperf_args)) if result is None: - self.command('echo $USER; nohup adb -s ' + device_id + ' shell "/data/local/tmp/iperf -s -i 1" > iperf_server_' + self.testCase_id + '_' + device_id + '.log &', self.ADBUserName, 5) + self.command('echo $USER; nohup iperf -B ' + UE_IPAddress + ' -s -i 1 > iperf_server_' + self.testCase_id + '_' + device_id + '.log &', self.UEUserName, 5) udpIperf = False else: - self.command('echo $USER; nohup adb -s ' + device_id + ' shell "/data/local/tmp/iperf -u -s -i 1" > iperf_server_' + self.testCase_id + '_' + device_id + '.log &', self.ADBUserName, 5) + self.command('echo $USER; nohup iperf -B ' + UE_IPAddress + ' -u -s -i 1 > iperf_server_' + self.testCase_id + '_' + device_id + '.log &', self.UEUserName, 5) + else: + self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + self.command('cd ' + self.EPCSourceCodePath + '/scripts', '\$', 5) + if (useIperf3): + self.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/iperf3 -s &', '\$', 5) + else: + self.command('rm -f iperf_server_' + self.testCase_id + '_' + device_id + '.log', '\$', 5) + result = re.search('-u', str(self.iperf_args)) + if result is None: + self.command('echo $USER; nohup adb -s ' + device_id + ' shell "/data/local/tmp/iperf -s -i 1" > iperf_server_' + self.testCase_id + '_' + device_id + '.log &', self.ADBUserName, 5) + udpIperf = False + else: + self.command('echo $USER; nohup adb -s ' + device_id + ' shell "/data/local/tmp/iperf -u -s -i 1" > iperf_server_' + self.testCase_id + '_' + device_id + '.log &', self.ADBUserName, 5) time.sleep(0.5) self.close() + # Launch the IPERF client on the EPC side for DL self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) self.command('cd ' + self.EPCSourceCodePath + '/scripts', '\$', 5) iperf_time = self.Iperf_ComputeTime() @@ -1832,19 +1886,36 @@ class SSHConnection(): clientStatus = self.Iperf_analyzeV2Output(lock, UE_IPAddress, device_id, statusQueue, modified_options) self.close() - self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) - self.command('stdbuf -o0 adb -s ' + device_id + ' shell ps | grep --color=never iperf | grep -v grep', '\$', 5) - result = re.search('shell +(?P\d+)', str(self.ssh.before)) - if result is not None: - pid_iperf = result.group('pid') - self.command('stdbuf -o0 adb -s ' + device_id + ' shell kill -KILL ' + pid_iperf, '\$', 5) + # Kill the IPERF server that runs in background + if (device_id == 'OAI-UE'): + self.open(self.UEIPAddress, self.UEUserName, self.UEPassword) + self.command('killall iperf', '\$', 5) + else: + self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + self.command('stdbuf -o0 adb -s ' + device_id + ' shell ps | grep --color=never iperf | grep -v grep', '\$', 5) + result = re.search('shell +(?P\d+)', str(self.ssh.before)) + if result is not None: + pid_iperf = result.group('pid') + self.command('stdbuf -o0 adb -s ' + device_id + ' shell kill -KILL ' + pid_iperf, '\$', 5) self.close() + # if the client report is absent, try to analyze the server log file if (clientStatus == -1): time.sleep(1) if (os.path.isfile('iperf_server_' + self.testCase_id + '_' + device_id + '.log')): os.remove('iperf_server_' + self.testCase_id + '_' + device_id + '.log') - self.copyin(self.ADBIPAddress, self.ADBUserName, self.ADBPassword, self.EPCSourceCodePath + '/scripts/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.') + if (device_id == 'OAI-UE'): + self.copyin(self.UEIPAddress, self.UEUserName, self.UEPassword, self.UESourceCodePath + '/cmake_targets/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.') + else: + self.copyin(self.ADBIPAddress, self.ADBUserName, self.ADBPassword, self.EPCSourceCodePath + '/scripts/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.') self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, modified_options) + + # in case of OAI UE: + if (device_id == 'OAI-UE'): + if (os.path.isfile('iperf_server_' + self.testCase_id + '_' + device_id + '.log')): + pass + else: + self.copyin(self.UEIPAddress, self.UEUserName, self.UEPassword, self.UESourceCodePath + '/cmake_targets/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.') + self.copyout(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, 'iperf_server_' + self.testCase_id + '_' + device_id + '.log', self.EPCSourceCodePath + '/scripts') except: os.kill(os.getppid(),signal.SIGUSR1) @@ -1958,7 +2029,10 @@ class SSHConnection(): Usage() sys.exit('Insufficient Parameter') check_eNB = True - check_OAI_UE = False + if (len(self.UEDevices) == 1) and (self.UEDevices[0] == 'OAI-UE'): + check_OAI_UE = True + else: + check_OAI_UE = False pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE) if (pStatus < 0): self.CreateHtmlTestRow(self.iperf_args, 'KO', pStatus) diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_closure.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_closure.xml new file mode 100644 index 0000000000..8587db959d --- /dev/null +++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_closure.xml @@ -0,0 +1,48 @@ + + + epc-closure + EPC-Closure + log-out + + 050201 060201 070201 + + + + + + Terminate_HSS + Terminate HSS + + + + Terminate_MME + Terminate MME + + + + Terminate_SPGW + Terminate SPGW + + + diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_start.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_start.xml new file mode 100644 index 0000000000..e22c5b4da2 --- /dev/null +++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_start.xml @@ -0,0 +1,47 @@ + + + epc-start + EPC-Start + log-in + + 050101 060101 070101 + + + + + Initialize_HSS + Initialize HSS + + + + Initialize_MME + Initialize MME + + + + Initialize_SPGW + Initialize SPGW + + + diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml new file mode 100644 index 0000000000..21f059d250 --- /dev/null +++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml @@ -0,0 +1,103 @@ + + + test-05-tm1-tunnel + Test-05MHz-TM1-tunnel + tasks + + 030102 000001 090102 000002 040503 000001 040603 040643 040644 000001 090109 030201 + + + + + IdleSleep + Sleep + 10 + + + + IdleSleep + Sleep + 5 + + + + Initialize_eNB + Initialize eNB (FDD/Band7/5MHz) + -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf + + + + Terminate_eNB + Terminate eNB + + + + Initialize_OAI_UE + Initialize OAI UE (FDD/Band7/5MHz) + -C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 + + + + Terminate_OAI_UE + Terminate OAI UE + + + + Ping + ping (5MHz - 20 sec) + -c 20 + 5 + + + + Iperf + iperf (5MHz - DL/1Mbps/UDP)(30 sec) + -u -b 1M -t 30 -i 1 -fm + 50 + + + + Iperf + iperf (5MHz - DL/1.2Mbps/UDP)(30 sec) + -b 1.2M -t 30 -i 1 -fm + 50 + + + + Iperf + iperf (5MHz - UL/1Mbps/UDP)(30 sec) + -u -b 1M -t 30 -i 1 -fm -R + 50 + balanced + + + + Iperf + iperf (5MHz - UL/8Mbps/UDP)(30 sec) + -u -b 8M -t 30 -i 1 -fm -R + 50 + balanced + + + From fef0f7320d1c68901a4e2288fba64ac9361e044e Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 25 Apr 2019 17:08:37 +0200 Subject: [PATCH 39/44] CI: separate 2 stages Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-gitlab | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index d6959c8fa3..994e6bedfd 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -513,18 +513,36 @@ pipeline { } } } - stage ("Test OAI UE - FDD - Bands 20/7 - B200") { + stage ("Test OAI UE - FDD - Band 20 - B200") { steps { script { triggerSlaveJobNoGitLab ('UE-CI-FDD-Band20-B200') - // calling a second job sequentially - triggerSlaveJob ('eNB-UE-CI-MONO-FDD-Band7-B200', 'Test-eNB-OAI-UE-FDD-Band7') } } post { always { script { finalizeSlaveJob('UE-CI-FDD-Band20-B200') + } + } + failure { + script { + currentBuild.result = 'FAILURE' + } + } + } + } + stage ("Test OAI UE - OAI eNB - FDD - Band 7 - B200") { + steps { + script { + // Delayed trigger on slave job, so it is always the last one to run + sh "sleep 240" + triggerSlaveJob ('eNB-UE-CI-MONO-FDD-Band7-B200', 'Test-eNB-OAI-UE-FDD-Band7') + } + } + post { + always { + script { finalizeSlaveJob('eNB-UE-CI-MONO-FDD-Band7-B200') } } From 0701784daa3585770c05515eb01cd3b5d4b77ff2 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 25 Apr 2019 17:44:53 +0200 Subject: [PATCH 40/44] CI: adding EPC log collection in the OAI-UE + OAI-eNB USRP pipeline template Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-tmp-full-ran | 54 +++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/ci-scripts/Jenkinsfile-tmp-full-ran b/ci-scripts/Jenkinsfile-tmp-full-ran index abe53321f9..4ade6086e8 100644 --- a/ci-scripts/Jenkinsfile-tmp-full-ran +++ b/ci-scripts/Jenkinsfile-tmp-full-ran @@ -334,6 +334,60 @@ pipeline { } } } + stage('Log Collection (SPGW)') { + steps { + withCredentials([ + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] + ]) { + echo '\u2705 \u001B[32mLog Collection (SPGW)\u001B[0m' + sh "python3 ci-scripts/main.py --mode=LogCollectSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" + + echo '\u2705 \u001B[32mLog Transfer (SPGW)\u001B[0m' + sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/spgw.log.zip ./spgw.log.${env.BUILD_ID}.zip || true" + } + script { + if(fileExists("spgw.log.${env.BUILD_ID}.zip")) { + archiveArtifacts "spgw.log.${env.BUILD_ID}.zip" + } + } + } + } + stage('Log Collection (MME)') { + steps { + withCredentials([ + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] + ]) { + echo '\u2705 \u001B[32mLog Collection (MME)\u001B[0m' + sh "python3 ci-scripts/main.py --mode=LogCollectMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" + + echo '\u2705 \u001B[32mLog Transfer (MME)\u001B[0m' + sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/mme.log.zip ./mme.log.${env.BUILD_ID}.zip || true" + } + script { + if(fileExists("mme.log.${env.BUILD_ID}.zip")) { + archiveArtifacts "mme.log.${env.BUILD_ID}.zip" + } + } + } + } + stage('Log Collection (HSS)') { + steps { + withCredentials([ + [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] + ]) { + echo '\u2705 \u001B[32mLog Collection (HSS)\u001B[0m' + sh "python3 ci-scripts/main.py --mode=LogCollectHSS --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" + + echo '\u2705 \u001B[32mLog Transfer (HSS)\u001B[0m' + sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/hss.log.zip ./hss.log.${env.BUILD_ID}.zip || true" + } + script { + if(fileExists("hss.log.${env.BUILD_ID}.zip")) { + archiveArtifacts "hss.log.${env.BUILD_ID}.zip" + } + } + } + } } } } From 5261ccd34d36128afe44e9f01f71936e587a02ad Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 25 Apr 2019 17:54:47 +0200 Subject: [PATCH 41/44] CI: making sure in all test scenarios that eNB/UE are OFF Signed-off-by: Raphael Defosseux --- ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml | 1 + .../xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml | 1 + ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml | 1 + ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml | 1 + ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml | 1 + ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml | 1 + ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml | 1 + ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml | 1 + ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml | 1 + ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml | 1 + ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml | 1 + ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml | 1 + ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml | 1 + ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml | 1 + ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml | 1 + ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml | 1 + ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml | 1 + ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml | 1 + ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml | 3 ++- ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml | 3 ++- 20 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml index f3b575fcf6..cded08284a 100644 --- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml @@ -25,6 +25,7 @@ Test-05MHz-TM1-noS1-tunnel tasks + 030201 090109 030101 000001 090101 000002 040501 040502 000001 040601 040641 040642 000001 090109 030201 diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml index 21f059d250..15735d94db 100644 --- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml +++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml @@ -25,6 +25,7 @@ Test-05MHz-TM1-tunnel tasks + 030201 090109 030102 000001 090102 000002 040503 000001 040603 040643 040644 000001 090109 030201 diff --git a/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml index ad543403d6..5425428bc2 100644 --- a/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml @@ -25,6 +25,7 @@ Test-10MHz-TM1 tasks + 030201 040102 030121 000001 040302 000001 040502 000001 040402 040202 000001 030201 diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml index 6ac6dc980a..7fa7814238 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml @@ -25,6 +25,7 @@ Test-05MHz-TM1 tasks + 030201 040101 030104 040301 040501 040602 040601 040603 040604 040605 040642 040641 040643 040644 040645 040401 040201 030201 diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml index c5e4321b89..7c1b4dc85c 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml @@ -25,6 +25,7 @@ Test-10MHz-TM1 tasks + 030201 040101 030114 040301 040511 040612 040611 040613 040614 040615 040652 040651 040653 040654 040655 040401 040201 030201 diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml index 2dc1efd994..bcbf742ef7 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml @@ -25,6 +25,7 @@ Test-20MHz-TM1 tasks + 030201 040101 030124 040301 040521 040622 040621 040623 040624 040625 040662 040661 040663 040664 040665 040401 040201 030201 diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml index 0057eaefa4..edc87c90ff 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml @@ -25,6 +25,7 @@ Test-05MHz-TM1 tasks + 030201 040101 030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml index 92ec1efa6e..ccbe71cd14 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml @@ -25,6 +25,7 @@ Test-10MHz-TM1 tasks + 030201 040101 030111 040301 040511 040613 040614 040615 040616 040617 040651 040652 040653 040654 040401 040201 030201 diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml index b6c441b19a..03263bb86f 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml @@ -25,6 +25,7 @@ Test-20MHz-TM1 tasks + 030201 040101 030121 040301 040521 040623 040624 040625 040662 040401 040201 030201 diff --git a/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml b/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml index 7a5c2c2511..fdf795fb30 100644 --- a/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml +++ b/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml @@ -25,6 +25,7 @@ Test-F1-CU/DU-05MHz tasks + 030201 040101 030142 030141 040301 040541 040601 040641 040401 040201 030201 030202 diff --git a/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml b/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml index ba5e00b024..3592759fc6 100644 --- a/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml +++ b/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml @@ -25,6 +25,7 @@ Test-F1-CU/DU-10MHz tasks + 030201 040101 030152 030151 040301 040551 040611 040651 040401 040201 030201 030202 diff --git a/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml b/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml index ef3828a37e..f2cb155127 100644 --- a/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml +++ b/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml @@ -25,6 +25,7 @@ Test-F1-CU/DU-20MHz tasks + 030201 040101 030162 030161 040301 040561 040621 040661 040401 040201 030201 030202 diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml index 5e7f4e48c8..daa5c6fa43 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml @@ -25,6 +25,7 @@ Test-05MHz tasks + 030201 040101 030104 030105 040301 040501 040602 040642 040401 040201 030201 030202 diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml index 645de11fe3..2638814cf6 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml @@ -25,6 +25,7 @@ Test-10MHz tasks + 030201 040101 030114 030115 040301 040511 040612 040652 040401 040201 030201 030202 diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml index cd732294ec..a2356891f1 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml @@ -25,6 +25,7 @@ Test-20MHz tasks + 030201 040101 030124 030125 040301 040521 040622 040662 040401 040201 030201 030202 diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml index 71098cb34e..1464a4a624 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml @@ -25,6 +25,7 @@ Test-IF4.5-05MHz tasks + 030201 040101 030101 030102 040301 040501 040604 040642 040401 040201 030201 030202 diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml index 05da4c1d21..1649e91b3e 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml @@ -25,6 +25,7 @@ Test-IF4.5-10MHz tasks + 030201 040101 030111 030112 040301 040511 040614 040652 040401 040201 030201 030202 diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml index ef41a3ced1..d98fce2e83 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml @@ -25,6 +25,7 @@ Test-IF4.5-20MHz tasks + 030201 040101 030121 030122 040301 040521 040624 040662 040401 040201 030201 030202 diff --git a/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml index 9a83311c6d..594ea7b923 100644 --- a/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml +++ b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml @@ -25,7 +25,8 @@ Test-10Mhz-Orange tasks -090110 000001 090109 + 090109 + 090110 000001 090109 diff --git a/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml b/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml index ea4766a8f3..89370be983 100644 --- a/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml +++ b/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml @@ -25,7 +25,8 @@ Test-10MHz-SFR tasks -090111 000001 090109 + 090109 + 090111 000001 090109 From e5eb58d227c15444022263e33381c974c3253019 Mon Sep 17 00:00:00 2001 From: Louis Adrien Dufrene Date: Fri, 26 Apr 2019 08:37:46 +0200 Subject: [PATCH 42/44] Fix for CU/DU split error. To test. --- openair2/RRC/LTE/rrc_eNB.c | 75 +++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 2f765e0030..60a9f76a14 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -2983,38 +2983,43 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf200; // sf20 = 20 subframes // LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf1000 mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange = LTE_MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB3; // Value dB1 =1 dB, dB3 = 3 dB - /* CDRX Configuration */ - // Need to check if UE is a BR UE - rnti_t rnti = ue_context_pP->ue_id_rnti; - module_id_t module_id = ctxt_pP->module_id; - int UE_id = find_UE_id(module_id, rnti); - eNB_MAC_INST *mac = RC.mac[module_id]; - UE_list_t *UE_list = &(mac->UE_list); + if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) { + /* CDRX Configuration */ + // Need to check if UE is a BR UE + rnti_t rnti = ue_context_pP->ue_id_rnti; + module_id_t module_id = ctxt_pP->module_id; + int UE_id = find_UE_id(module_id, rnti); + eNB_MAC_INST *mac = RC.mac[module_id]; + UE_list_t *UE_list = &(mac->UE_list); - if (UE_id != -1) { - if ((rrc_inst->carrier[cc_id].sib1->tdd_Config == NULL) && - (UE_list->UE_template[ue_context_pP->ue_context.primaryCC_id][UE_id].rach_resource_type == 0)) { - // CDRX can be only configured in case of FDD and non BR UE (09/04/19) - - LOG_D(RRC, "Processing the DRX configuration in RRC Connection Reconfiguration\n"); + if (UE_id != -1) { + if ((rrc_inst->carrier[cc_id].sib1->tdd_Config == NULL) && + (UE_list->UE_template[ue_context_pP->ue_context.primaryCC_id][UE_id].rach_resource_type == 0)) { + // CDRX can be only configured in case of FDD and non BR UE (09/04/19) + + LOG_D(RRC, "Processing the DRX configuration in RRC Connection Reconfiguration\n"); - /* Process the IE drx_Config */ - if (cc_id < MAX_NUM_CCs) { - mac_MainConfig->drx_Config = do_DrxConfig(module_id, cc_id, &rrc_inst->configuration, UEcap); // drx_Config IE - } else { - LOG_E(RRC, "Invalid CC_id for DRX configuration\n"); - } + /* Process the IE drx_Config */ + if (cc_id < MAX_NUM_CCs) { + mac_MainConfig->drx_Config = do_DrxConfig(module_id, cc_id, &rrc_inst->configuration, UEcap); // drx_Config IE + } else { + LOG_E(RRC, "Invalid CC_id for DRX configuration\n"); + } - /* Set timers and thresholds values in local MAC context of UE */ - eNB_Config_Local_DRX(module_id, ue_context_pP->ue_id_rnti, mac_MainConfig->drx_Config); + /* Set timers and thresholds values in local MAC context of UE */ + eNB_Config_Local_DRX(module_id, ue_context_pP->ue_id_rnti, mac_MainConfig->drx_Config); - LOG_D(RRC, "DRX configured in mac main config for RRC Connection Reconfiguration\n"); + LOG_D(RRC, "DRX configured in mac main config for RRC Connection Reconfiguration\n"); - } else { // CDRX not implemented for TDD and LTE-M (09/04/19) + } else { // CDRX not implemented for TDD and LTE-M (09/04/19) + mac_MainConfig->drx_Config = NULL; + } + } else { // UE_id invalid + LOG_E(RRC, "Invalid UE_id found!\n"); mac_MainConfig->drx_Config = NULL; } - } else { // UE_id invalid - LOG_E(RRC, "Invalid UE_id found!\n"); + } else { // No CDRX with the CU/DU split in this version + LOG_E(RRC, "CU/DU split activated\n"); mac_MainConfig->drx_Config = NULL; } @@ -5464,15 +5469,17 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ue_context_pP->ue_context.ue_reestablishment_timer = 0; ue_context_pP->ue_context.ue_rrc_inactivity_timer = 1; // reset rrc inactivity timer - /* CDRX: activated if ack was expected */ - int UE_id_mac = find_UE_id(ctxt_pP->module_id, ue_context_pP->ue_context.rnti); - UE_sched_ctrl *UE_scheduling_control = &(RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id_mac]); - - if (UE_scheduling_control->cdrx_waiting_ack == TRUE) { - UE_scheduling_control->cdrx_waiting_ack = FALSE; - UE_scheduling_control->cdrx_configured = TRUE; - LOG_I(RRC, "CDRX configuration activated after RRC Connection Reconfiguration Complete reception\n"); - } + if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) { + /* CDRX: activated if ack was expected */ + int UE_id_mac = find_UE_id(ctxt_pP->module_id, ue_context_pP->ue_context.rnti); + UE_sched_ctrl *UE_scheduling_control = &(RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id_mac]); + + if (UE_scheduling_control->cdrx_waiting_ack == TRUE) { + UE_scheduling_control->cdrx_waiting_ack = FALSE; + UE_scheduling_control->cdrx_configured = TRUE; + LOG_I(RRC, "CDRX configuration activated after RRC Connection Reconfiguration Complete reception\n"); + } + } // No CDRX with the CU/DU split in this version of the code T(T_ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE, T_INT(ctxt_pP->module_id), From d8096787c3f103b4b74358b360ec39eef6ad64d0 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 26 Apr 2019 11:12:55 +0200 Subject: [PATCH 43/44] CI: forced marker output by fflush at the end of eNB initialization Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 1 + targets/RT/USER/lte-softmodem.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 2edbab6389..3732655898 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -560,6 +560,7 @@ class SSHConnection(): self.rruOptions = extra_options self.CreateHtmlTestRow('-O ' + config_file + extra_options, 'OK', ALL_PROCESSES_OK) logging.debug('\u001B[1m Initialize eNB Completed\u001B[0m') + time.sleep(10) self.close() diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index c87ebb0af3..9b4abf8ee0 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -805,8 +805,10 @@ int main( int argc, char **argv ) { } printf("wait RUs\n"); + // CI -- Flushing the std outputs for the previous marker to show on the eNB / RRU log file fflush(stdout); fflush(stderr); + // end of CI modifications wait_RUs(); LOG_I(ENB_APP,"RC.nb_RU:%d\n", RC.nb_RU); // once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration) @@ -832,6 +834,10 @@ int main( int argc, char **argv ) { // wait for end of program LOG_UI(ENB_APP,"TYPE TO TERMINATE\n"); + // CI -- Flushing the std outputs for the previous marker to show on the eNB / DU / CU log file + fflush(stdout); + fflush(stderr); + // end of CI modifications //getchar(); itti_wait_tasks_end(); oai_exit=1; From f31694533ec5f5423f23635b69b6962baecb9272 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 26 Apr 2019 13:53:06 +0200 Subject: [PATCH 44/44] fix a few cppcheck errors. Signed-off-by: Raphael Defosseux --- openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 2 +- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 2 +- targets/RT/USER/lte-softmodem.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index 2730d65f6c..b44a04eb74 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -705,7 +705,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, // if (dlsch->harq_processes[harq_pid]->Ndi == 1) { // this is a new packet if (dlsch->harq_processes[harq_pid]->round == 0) { // this is a new packet #ifdef DEBUG_DLSCH_CODING - printf("encoding thinks this is a new packet for harq_pid %d (%p), A %d \n",harq_pid,dlsch,A); + printf("encoding thinks this is a new packet for harq_pid %d (%p), A %u \n",harq_pid,dlsch,A); #endif /* int i; diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index ef43b15584..9f12e99d9c 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -353,7 +353,7 @@ LTE_DRX_Config_t *do_DrxConfig(uint8_t Mod_id, memset(drxConfig, 0, sizeof(LTE_DRX_Config_t)); /* Long DRX cycle support is mandatory for CDRX activation */ - if (!ueSupportCdrxLongFlag || configuration == NULL) { + if (!ueSupportCdrxLongFlag) { drxConfig->present = LTE_DRX_Config_PR_release; } else { drxConfig->present = configuration->radioresourceconfig[CC_id].drx_Config_present; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 9b4abf8ee0..80b9c3a3fd 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -611,7 +611,7 @@ int main( int argc, char **argv ) { #if defined (XFORMS) void *status; #endif - int CC_id; + int CC_id = 0; int ru_id; #if defined (XFORMS) int ret;