Commit f1fcabbf authored by kaltenbe's avatar kaltenbe

bugfix in TPC for TDD


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7603 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 7c0b6fcf
...@@ -657,6 +657,10 @@ typedef struct { ...@@ -657,6 +657,10 @@ typedef struct {
/// UE tx power /// UE tx power
int32_t ue_tx_power; int32_t ue_tx_power;
/// stores the frame where the last TPC was transmitted
uint32_t tpc_tx_frame;
uint32_t tpc_tx_subframe;
#ifdef LOCALIZATION #ifdef LOCALIZATION
eNB_UE_estimated_distances distance; eNB_UE_estimated_distances distance;
#endif #endif
......
...@@ -225,12 +225,14 @@ void rx_sdu( ...@@ -225,12 +225,14 @@ void rx_sdu(
if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,eNB->common_channels[CC_idP].RA_template[ii].rnti,harq_pidP)) == -1 ) { if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,eNB->common_channels[CC_idP].RA_template[ii].rnti,harq_pidP)) == -1 ) {
mac_xface->macphy_exit("[MAC][eNB] Max user count reached\n"); mac_xface->macphy_exit("[MAC][eNB] Max user count reached\n");
// kill RA procedure
} else } else
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Added user with rnti %x => UE %d\n", LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Added user with rnti %x => UE %d\n",
enb_mod_idP,CC_idP,frameP,eNB->common_channels[CC_idP].RA_template[ii].rnti,UE_id); enb_mod_idP,CC_idP,frameP,eNB->common_channels[CC_idP].RA_template[ii].rnti,UE_id);
} else { } else {
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received RRCConnectionReestablishment from UE %d: length %d, offset %d\n", LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received RRCConnectionReestablishment from UE %d: length %d, offset %d\n",
enb_mod_idP,CC_idP,frameP,UE_id,rx_lengths[ii],payload_ptr-sduP); enb_mod_idP,CC_idP,frameP,UE_id,rx_lengths[ii],payload_ptr-sduP);
// kill RA procedure
} }
if (Is_rrc_registered == 1) if (Is_rrc_registered == 1)
...@@ -742,7 +744,10 @@ void schedule_ulsch_rnti(module_id_t module_idP, ...@@ -742,7 +744,10 @@ void schedule_ulsch_rnti(module_id_t module_idP,
target_rx_power = mac_xface->get_target_ul_rx_power(module_idP,CC_id); target_rx_power = mac_xface->get_target_ul_rx_power(module_idP,CC_id);
// this assumes accumulated tpc // this assumes accumulated tpc
if (subframeP==0) { // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out
if (((UE_template->tpc_tx_frame*10+UE_template->tpc_tx_subframe)%10240)<(frameP*10+subframeP+10)) {
UE_template->tpc_tx_frame=frameP;
UE_template->tpc_tx_subframe=subframeP;
if (normalized_rx_power>(target_rx_power+1)) { if (normalized_rx_power>(target_rx_power+1)) {
tpc = 0; //-1 tpc = 0; //-1
tpc_accumulated--; tpc_accumulated--;
...@@ -752,15 +757,13 @@ void schedule_ulsch_rnti(module_id_t module_idP, ...@@ -752,15 +757,13 @@ void schedule_ulsch_rnti(module_id_t module_idP,
} else { } else {
tpc = 1; //0 tpc = 1; //0
} }
LOG_D(MAC,"[eNB %d] ULSCH scheduler: subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n",
module_idP,subframeP,harq_pid,tpc,
tpc_accumulated,normalized_rx_power,target_rx_power);
} else { } else {
tpc = 1; //0 tpc = 1; //0
} }
LOG_D(MAC,"[eNB %d] ULSCH scheduler: subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n",module_idP,subframeP,harq_pid,tpc,
tpc_accumulated,normalized_rx_power,target_rx_power);
// new transmission // new transmission
if (round==0) { if (round==0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment