diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index dc7cbd409c4db13361bf2e1b7f1137179f7fcb48..a2988f26d8c27b34265fe94635d625e2858935c0 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -538,8 +538,8 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, 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], - (UE_list->UE_sched_ctrl[i].pusch_snr[CC_id] - 128) / 2, - (UE_list->UE_sched_ctrl[i].pucch1_snr[CC_id] - 128) / 2); + (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); } RC.eNB[module_idP][CC_id]->pusch_stats_bsr[i][(frameP * 10) + diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c index 1acf65722099af3c1cf4df99251ebbcbbe591355..eda84adbab3093892feab22f49f0b4d3ba233fb2 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c @@ -1696,9 +1696,9 @@ schedule_ue_spec_fairRR(module_id_t module_idP, // this is the normalized RX power eNB_UE_stats = &UE_list->eNB_UE_stats[CC_id][UE_id]; - /* TODO: fix how we deal with power, unit is not dBm, it's special from nfapi */ - normalized_rx_power = ue_sched_ctl->pucch1_snr[CC_id]; - target_rx_power = 208; + /* Unit is not dBm, it's special from nfapi */ + normalized_rx_power = (5*ue_sched_ctl->pucch1_snr[CC_id]-640)/10+30;//(+eNB->measurements.n0_power_dB[0]) + target_rx_power= eNB->puCch10xSnr/10 + 30;//(+eNB->measurements.n0_power_dB[0]) // this assumes accumulated tpc // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out @@ -2690,9 +2690,25 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP, if (status < RRC_CONNECTED) cqi_req = 0; else if (UE_sched_ctrl->cqi_req_timer>30) { - cqi_req = 1; - UE_sched_ctrl->cqi_req_timer=0; - UE_sched_ctrl->cqi_req_flag |= 1 << sched_subframeP; + cqi_req = 1; + // To be safe , do not ask CQI in special SFs:36.213/7.2.3 CQI definition + if (cc->tdd_Config) { + switch (cc->tdd_Config->subframeAssignment) { + case 1: + if( subframeP == 1 || subframeP == 6 ) cqi_req=0; + break; + case 3: + if( subframeP == 1 ) cqi_req=0; + break; + default: + LOG_E(MAC," TDD config not supported\n"); + break; + } + } + if(cqi_req == 1){ + UE_sched_ctrl->cqi_req_timer=0; + UE_sched_ctrl->cqi_req_flag |= 1 << sched_subframeP; + } } else cqi_req = 0; @@ -2701,8 +2717,8 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP, //compute the expected ULSCH RX power (for the stats) // this is the normalized RX power and this should be constant (regardless of mcs - normalized_rx_power = UE_sched_ctrl->pusch_snr[CC_id]; - target_rx_power = 178; + normalized_rx_power = (5*UE_sched_ctrl->pusch_snr[CC_id]-640)/10+30; //(+eNB->measurements.n0_power_dB[0]) + target_rx_power= eNB->puSch10xSnr/10 + 30; //(+eNB->measurements.n0_power_dB[0]) // this assumes accumulated tpc // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out diff --git a/openair2/LAYER2/MAC/eNB_scheduler_phytest.c b/openair2/LAYER2/MAC/eNB_scheduler_phytest.c index 49cc68b06a65505bd24db81ed945efa4952978af..24333a06a565230dc6fbe25dbb89ab55e7da39e9 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_phytest.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_phytest.c @@ -211,7 +211,6 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s int sched_frame=frameP; int sched_subframe = (subframeP+4)%10; uint16_t ul_req_index; - uint8_t dlsch_flag; if (sched_subframe<subframeP) sched_frame++; @@ -306,10 +305,8 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s hi_dci0_req_body->number_of_dci++; ul_req_index = 0; - dlsch_flag = 0; for(ul_req_index = 0;ul_req_index < ul_req->number_of_pdus;ul_req_index++){ if(ul_req->ul_config_pdu_list[ul_req_index].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE){ - dlsch_flag = 1; LOG_D(MAC,"Frame %d, Subframe %d:rnti %x ul_req_index %d Switched UCI HARQ to ULSCH HARQ(first)\n",frameP,subframeP,rnti,ul_req_index); break; } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 04415a838626df5e9f91b59dd599b7d94245faad..caed575b48185ab58e824968646f4a0a470e25f9 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1337,10 +1337,24 @@ schedule_ulsch_rnti(module_id_t module_idP, if (status >= RRC_CONNECTED && UE_sched_ctrl->cqi_req_timer > 30) { if (UE_sched_ctrl->cqi_received == 0) { if (nfapi_mode) { - cqi_req = 0; + cqi_req = 0; } else { - cqi_req = 1; - UE_sched_ctrl->cqi_req_flag |= 1 << sched_subframeP; + cqi_req = 1; + // To be safe , do not ask CQI in special Subframes:36.213/7.2.3 CQI definition + if (cc[CC_id].tdd_Config) { + switch (cc[CC_id].tdd_Config->subframeAssignment) { + case 1: + if( subframeP == 1 || subframeP == 6 ) cqi_req=0; + break; + case 3: + if( subframeP == 1 ) cqi_req=0; + break; + default: + LOG_E(MAC," TDD config not supported\n"); + break; + } + } + if(cqi_req == 1) UE_sched_ctrl->cqi_req_flag |= 1 << sched_subframeP; } } else if (UE_sched_ctrl->cqi_received == 1) { diff --git a/openair2/RRC/LTE/L2_interface.c b/openair2/RRC/LTE/L2_interface.c index a7c96a8a22f201d19fe1dc2e63eaa59009745a92..efbcf0f1422eaaa08de3be6606e9258f2b8cbb80 100644 --- a/openair2/RRC/LTE/L2_interface.c +++ b/openair2/RRC/LTE/L2_interface.c @@ -329,7 +329,7 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, rntiP, PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED); } -// rrc_mac_remove_ue(Mod_instP,rntiP); + rrc_mac_remove_ue(Mod_instP,rntiP); } void mac_eNB_rrc_uplane_failure(const module_id_t Mod_instP,