diff --git a/openair2/F1AP/f1ap_du_rrc_message_transfer.c b/openair2/F1AP/f1ap_du_rrc_message_transfer.c index 046d0011fc..ea22ce7672 100644 --- a/openair2/F1AP/f1ap_du_rrc_message_transfer.c +++ b/openair2/F1AP/f1ap_du_rrc_message_transfer.c @@ -399,25 +399,34 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, LTE_SRB_ToAddModList_t *SRB_configList = rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->srb_ToAddModList; LTE_DRB_ToReleaseList_t *DRB_ReleaseList = rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->drb_ToReleaseList; LTE_MAC_MainConfig_t *mac_MainConfig = NULL; + for (i = 0; i< 8; i++){ DRB2LCHAN[i] = 0; } + if (rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->mac_MainConfig) { mac_MainConfig = &rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->mac_MainConfig->choice.explicitValue; + + /* CDRX Configuration */ + // Need to check if UE is a BR UE int UE_id = find_UE_id(ctxt.module_id, ctxt.rnti); + if (UE_id != -1) { eNB_RRC_INST *rrc_inst = RC.rrc[ctxt.module_id]; uint8_t cc_id = ue_context_p->ue_context.primaryCC_id; eNB_MAC_INST *mac = RC.mac[ctxt.module_id]; UE_list_t *UE_list = &(mac->UE_list); - if (rrc_inst->carrier[cc_id].sib1->tdd_Config == NULL && - UE_list->UE_template[cc_id][UE_id].rach_resource_type == 0) { + if (rrc_inst->carrier[cc_id].sib1->tdd_Config == NULL && UE_list->UE_template[cc_id][UE_id].rach_resource_type == 0) { + // CDRX can be only configured in case of FDD and non BR UE (27/09/19) + + LOG_D(F1AP, "Processing the DRX configuration in DU RRC Connection Reconfiguration\n"); + + /* Process the IE drx_Config */ if (cc_id < MAX_NUM_CCs) { LTE_UE_EUTRA_Capability_t *UEcap = ue_context_p->ue_context.UE_Capability; - mac_MainConfig->drx_Config = do_DrxConfig(cc_id, - &rrc_inst->configuration, - UEcap); + mac_MainConfig->drx_Config = do_DrxConfig(cc_id, &rrc_inst->configuration, UEcap); // drx_Config IE + if (mac_MainConfig->drx_Config == NULL) { LOG_E(F1AP, "drx_Configuration parameter is NULL, cannot configure local UE parameters\n"); } else { @@ -426,12 +435,15 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, LOG_D(F1AP, "DRX configured in mac main config for RRC Connection Reconfiguration\n"); } } else { - LOG_E(F1AP, "Invalid CC_id for DRX configuration\n"); + LOG_E(F1AP, "Invalid CC_id for DRX configuration\n"); } + } else { // CDRX not implemented for TDD and LTE-M (09/04/19) + LOG_I(F1AP, "CDRX not implemented for TDD and LTE-M\n"); } } else { // UE_id invalid LOG_E(F1AP, "Invalid UE_id found!\n"); } + /* End of CDRX configuration */ } LTE_MeasGapConfig_t *measGapConfig = NULL; @@ -736,7 +748,25 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, break; case LTE_UL_DCCH_MessageType__c1_PR_rrcConnectionReconfigurationComplete: - + LOG_I(F1AP, "[MSG] RRC UL rrcConnectionReconfigurationComplete\n"); + + /* CDRX: (under test) activated when RRC Connection Reconfiguration was sent */ + int UE_id_mac = find_UE_id(instance, rnti); + + if (UE_id_mac == -1) { + LOG_E(F1AP, "Can't find UE_id(MAC) of UE rnti %x\n", rnti); + break; + } + + UE_sched_ctrl_t *UE_scheduling_control = &(RC.mac[instance]->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; // Set to TRUE when RRC Connection Reconfiguration is sent (under test) + LOG_I(F1AP, "CDRX configuration after first RRC Connection Reconfiguration Complete reception\n"); + } + /* End of CDRX processing */ + break; case LTE_UL_DCCH_MessageType__c1_PR_rrcConnectionReestablishmentComplete: @@ -744,18 +774,13 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, case LTE_UL_DCCH_MessageType__c1_PR_rrcConnectionSetupComplete: LOG_I(F1AP, "[MSG] RRC UL rrcConnectionSetupComplete \n"); - if(!ue_context_p){ + + if(!ue_context_p){ LOG_E(F1AP, "Did not find the UE context associated with UE RNTOI %x, ue_context_p is NULL\n", rnti); - }else { + + } else { LOG_I(F1AP, "Processing RRCConnectionSetupComplete UE %x\n", rnti); ue_context_p->ue_context.Status = RRC_CONNECTED; - - int UE_id_mac = find_UE_id(instance, rnti); - UE_sched_ctrl_t *UE_scheduling_control = &(RC.mac[instance]->UE_list.UE_sched_ctrl[UE_id_mac]); - if (UE_scheduling_control->cdrx_waiting_ack == TRUE) { - UE_scheduling_control->cdrx_waiting_ack = FALSE; - } - } break; diff --git a/openair2/F1AP/f1ap_du_task.c b/openair2/F1AP/f1ap_du_task.c index d287e1e5bf..566391ac7a 100644 --- a/openair2/F1AP/f1ap_du_task.c +++ b/openair2/F1AP/f1ap_du_task.c @@ -175,7 +175,7 @@ void *F1AP_DU_task(void *arg) { &received_msg->ittiMsg.sctp_data_ind); break; - case F1AP_UL_RRC_MESSAGE: // from rrc + case F1AP_UL_RRC_MESSAGE: // to rrc LOG_I(F1AP, "DU Task Received F1AP_UL_RRC_MESSAGE\n"); DU_send_UL_RRC_MESSAGE_TRANSFER(ITTI_MESSAGE_GET_INSTANCE(received_msg), &F1AP_UL_RRC_MESSAGE(received_msg)); diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 06e0ae4444..7891183323 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -3202,11 +3202,11 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange = LTE_MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB3; // Value dB1 =1 dB, dB3 = 3 dB mac_MainConfig->drx_Config = NULL; - /* rnti_t rnti = ue_context_pP->ue_id_rnti; module_id_t module_id = ctxt_pP->module_id; - if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) { - // CDRX Configuration + + if (NODE_IS_MONOLITHIC(RC.rrc[ctxt_pP->module_id]->node_type)) { + /* CDRX Configuration */ // Need to check if UE is a BR UE int UE_id = find_UE_id(module_id, rnti); @@ -3220,30 +3220,29 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t LOG_D(RRC, "Processing the DRX configuration in RRC Connection Reconfiguration\n"); - // Process the IE drx_Config + /* Process the IE drx_Config */ if (cc_id < MAX_NUM_CCs) { mac_MainConfig->drx_Config = do_DrxConfig(cc_id, &rrc_inst->configuration, UEcap); // drx_Config IE + if (mac_MainConfig->drx_Config == NULL) { - LOG_E(MAC, "drx_Configuration parameter is NULL, cannot configure local UE parameters\n"); + LOG_E(RRC, "drx_Configuration parameter is NULL, cannot configure local UE parameters\n"); + } else { + /* Set timers and thresholds values in local MAC context of UE */ + eNB_Config_Local_DRX(module_id, rnti, mac_MainConfig->drx_Config); + LOG_D(RRC, "DRX configured in mac main config for RRC Connection Reconfiguration\n"); } } else { LOG_E(RRC, "Invalid CC_id for DRX configuration\n"); } } else { // CDRX not implemented for TDD and LTE-M (09/04/19) - LOG_D(RRC, "CDRX not implemented for TDD and LTE-M\n"); + LOG_I(RRC, "CDRX not implemented for TDD and LTE-M\n"); } } 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"); } - if (mac_MainConfig->drx_Config != NULL) { - // Set timers and thresholds values in local MAC context of UE - eNB_Config_Local_DRX(module_id, rnti, mac_MainConfig->drx_Config); - LOG_D(RRC, "DRX configured in mac main config for RRC Connection Reconfiguration\n"); - } -*/ + /* End of CDRX configuration */ + #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 @@ -6494,24 +6493,25 @@ 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 -/* - if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) { - // CDRX: activated if ack was expected + + if (NODE_IS_MONOLITHIC(RC.rrc[ctxt_pP->module_id]->node_type)) { + /* CDRX: (under test) activated when RRC Connection Reconfiguration was sent */ int UE_id_mac = find_UE_id(ctxt_pP->module_id, ue_context_pP->ue_context.rnti); - if (UE_id_mac == -1){ - LOG_E(RRC,PROTOCOL_RRC_CTXT_UE_FMT" rrc_eNB_process_RRCConnectionReconfigurationComplete without UE_id(MAC) rnti %x, let's return\n", - PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), ue_context_pP->ue_context.rnti); + if (UE_id_mac == -1) { + LOG_E(RRC, "Can't find UE_id(MAC) of UE rnti %x\n", ue_context_pP->ue_context.rnti); return; } + UE_sched_ctrl_t *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 after first RRC Connection Reconfiguration Complete reception\n"); + // UE_scheduling_control->cdrx_configured = TRUE; // Set to TRUE when RRC Connection Reconfiguration is sent (under test) + 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 -*/ + /* End of CDRX processing */ + } + T(T_ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),