Commit 652e52b7 authored by Florian Kaltenberger's avatar Florian Kaltenberger

TM3 still WIP but regression tests are already ok

parent 4bda0839
......@@ -169,7 +169,7 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint8_
//UCI_format fmt;
//uint8_t N_RB_DL = 25;
uint8_t i;
LOG_I(PHY,"[eNB][UCI] N_RB_DL %d uci format %d\n", N_RB_DL,uci_format);
LOG_D(PHY,"[eNB][UCI] N_RB_DL %d uci format %d\n", N_RB_DL,uci_format);
switch(N_RB_DL) {
case 6:
......
......@@ -505,6 +505,17 @@ int16_t get_hundred_times_delta_IF_mac(module_id_t module_idP, uint8_t CC_id, rn
int16_t get_target_pusch_rx_power(module_id_t module_idP, uint8_t CC_id);
int16_t get_target_pucch_rx_power(module_id_t module_idP, uint8_t CC_id);
/*! \brief This function is typically called from the MAC and asks the PHY for a harq_pid for rnti to use in frame.subframe. The function will also return the current round (round is a vector of size 2 for the 2 TBs for DL) correspoing to this harq_pid. If the round (rounds) is (are) 0 then the harq_pid is free.
@param Mod_id
@param CC_id
@param rnti
@param frame
@param subframe
@param harq_pid
@param round
@param ul_flag
@returns 0 on succes, -1 for error
*/
int get_ue_active_harq_pid(uint8_t Mod_id,uint8_t CC_id,uint16_t rnti,int frame, uint8_t subframe,uint8_t *harq_pid,uint8_t *round,uint8_t ul_flag);
void dump_dlsch(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
......
......@@ -235,7 +235,7 @@ int8_t find_next_ue_index(PHY_VARS_eNB *eNB)
int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16_t rnti, const int frame, const uint8_t subframe,uint8_t *harq_pid,uint8_t *round,const uint8_t harq_flag)
{
LTE_eNB_DLSCH_t *DLSCH_ptr;
LTE_eNB_DLSCH_t *DLSCH_ptr[2];
LTE_eNB_ULSCH_t *ULSCH_ptr;
uint8_t ulsch_subframe,ulsch_frame;
int i;
......@@ -244,17 +244,19 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
if (UE_id==-1) {
LOG_D(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id);
*round=0;
*(round+1)=0;
return(-1);
}
if ((harq_flag == openair_harq_DL) || (harq_flag == openair_harq_RA)) {// this is a DL request
DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch[(uint32_t)UE_id][0];
DLSCH_ptr[0] = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch[(uint32_t)UE_id][0];
DLSCH_ptr[1] = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch[(uint32_t)UE_id][1];
if (harq_flag == openair_harq_RA) {
if (DLSCH_ptr->harq_processes[0] != NULL) {
if (DLSCH_ptr[0]->harq_processes[0] != NULL) {
*harq_pid = 0;
*round = DLSCH_ptr->harq_processes[0]->round;
*round = DLSCH_ptr[0]->harq_processes[0]->round;
return 0;
} else {
return -1;
......@@ -264,12 +266,17 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
/* let's go synchronous for the moment - maybe we can change at some point */
i = (frame * 10 + subframe) % 8;
if (DLSCH_ptr->harq_processes[i]->status == ACTIVE) {
if ((DLSCH_ptr[0]->harq_processes[i]->status == ACTIVE) ||
(DLSCH_ptr[1]->harq_processes[i]->status == ACTIVE)) { //at least one of the two TBs is active
*harq_pid = i;
*round = DLSCH_ptr->harq_processes[i]->round;
} else if (DLSCH_ptr->harq_processes[i]->status == SCH_IDLE) {
*round = DLSCH_ptr[0]->harq_processes[i]->round;
*(round+1) = DLSCH_ptr[1]->harq_processes[i]->round;
} else if ((DLSCH_ptr[0]->harq_processes[i]->status == SCH_IDLE) &&
(DLSCH_ptr[1]->harq_processes[i]->status == SCH_IDLE)){ //none of the two TBs is active
*harq_pid = i;
*round = 0;
*(round+1) = 0;
} else {
printf("%s:%d: bad state for harq process - PLEASE REPORT!!\n", __FILE__, __LINE__);
abort();
......@@ -1586,21 +1593,20 @@ void process_HARQ_feedback(uint8_t UE_id,
dlsch_ACK[0][0] = eNB->ulsch[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[0];
dlsch_ACK[1][0] = eNB->ulsch[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[1];
if (dlsch->subframe_tx[subframe_m4]==1)
LOG_D(PHY,"[eNB %d] Frame %d: Received ACK/NAK %d on PUSCH for subframe %d\n",eNB->Mod_id,
frame,dlsch_ACK[0],subframe_m4);
LOG_I(PHY,"[eNB %d] Frame %d: Received ACK/NAK %d,%d on PUSCH for harq_pid %d, subframe %d\n",eNB->Mod_id,
frame,dlsch_ACK[0][0],dlsch_ACK[1][0],dl_harq_pid[0],subframe_m4);
}
else {
dlsch_ACK[0][0] = pucch_payload[0];
dlsch_ACK[1][0] = pucch_payload[1];
LOG_D(PHY,"[eNB %d] Frame %d: Received ACK/NAK %d on PUCCH for subframe %d\n",eNB->Mod_id,
frame,dlsch_ACK[0],subframe_m4);
LOG_I(PHY,"[eNB %d] Frame %d: Received ACK/NAK %d,%d on PUCCH for harq_pid %d, subframe %d\n",eNB->Mod_id,
frame,dlsch_ACK[0][0],dlsch_ACK[1][0],dl_harq_pid[0],subframe_m4);
/*
if (dlsch_ACK[0]==0)
AssertFatal(0,"Exiting on NAK on PUCCH\n");
*/
}
#if defined(MESSAGE_CHART_GENERATOR_PHY)
MSC_LOG_RX_MESSAGE(
MSC_PHY_ENB,MSC_PHY_UE,
......@@ -1765,10 +1771,10 @@ void process_HARQ_feedback(uint8_t UE_id,
if (dlsch_harq_proc->round == dlsch->Mlimit) {
// This was the last round for DLSCH so reset round and increment l2_error counter
#ifdef DEBUG_PHY_PROC
//#ifdef DEBUG_PHY_PROC
LOG_W(PHY,"[eNB %d][PDSCH %x/%d] DLSCH retransmissions exhausted, dropping packet\n",eNB->Mod_id,
dlsch->rnti,dl_harq_pid[m]);
#endif
//#endif
#if defined(MESSAGE_CHART_GENERATOR_PHY)
MSC_LOG_EVENT(MSC_PHY_ENB, "0 HARQ DLSCH Failed RNTI %"PRIx16" round %u",
dlsch->rnti,
......
......@@ -775,7 +775,7 @@ typedef struct {
// resource scheduling information
uint8_t harq_pid[MAX_NUM_CCs];
uint8_t round[MAX_NUM_CCs];
uint8_t round[MAX_NUM_CCs][2];
uint8_t dl_pow_off[MAX_NUM_CCs];
uint16_t pre_nb_available_rbs[MAX_NUM_CCs];
unsigned char rballoc_sub_UE[MAX_NUM_CCs][N_RBG_MAX];
......
......@@ -433,7 +433,7 @@ schedule_ue_spec(
uint16_t nb_rb,nb_rb_temp,total_nb_available_rb[MAX_NUM_CCs],nb_available_rb;
uint16_t TBS,j,sdu_lengths[NB_RB_MAX],rnti,padding=0,post_padding=0;
unsigned char dlsch_buffer[MAX_DLSCH_PAYLOAD_BYTES];
unsigned char round = 0;
unsigned char round[2] = {0,0};
unsigned char harq_pid = 0;
void *DLSCH_dci = NULL;
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
......@@ -571,11 +571,13 @@ schedule_ue_spec(
nb_available_rb = ue_sched_ctl->pre_nb_available_rbs[CC_id];
harq_pid = ue_sched_ctl->harq_pid[CC_id];
round = ue_sched_ctl->round[CC_id];
round[0] = ue_sched_ctl->round[CC_id][0];
round[1] = ue_sched_ctl->round[CC_id][1];
UE_list->eNB_UE_stats[CC_id][UE_id].crnti= rnti;
UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status=mac_eNB_get_rrc_status(module_idP,rnti);
UE_list->eNB_UE_stats[CC_id][UE_id].harq_pid = harq_pid;
UE_list->eNB_UE_stats[CC_id][UE_id].harq_round = round;
//TODO: update eNB_UE_stats for two rounds
UE_list->eNB_UE_stats[CC_id][UE_id].harq_round = round[0];
sdu_length_total=0;
num_sdus=0;
......@@ -602,8 +604,8 @@ schedule_ue_spec(
UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = 0;
}
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,CC_id,rnti,harq_pid, round,nb_available_rb,
LOG_D(MAC,"[eNB %d] Frame %d: Scheduling UE %d on CC_id %d (rnti %x, harq_pid %d, round (%d,%d), rb %d, cqi %d, mcs %d, rrc %d)\n",
module_idP, frameP, UE_id,CC_id,rnti,harq_pid, round[0], round[1],nb_available_rb,
eNB_UE_stats->DL_cqi[0], eNB_UE_stats->dlsch_mcs1,
UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status);
......@@ -614,7 +616,7 @@ schedule_ue_spec(
/* process retransmission */
if (round > 0) {
if ((round[0] > 0) || (round[1]>0)) {
if (frame_parms[CC_id]->frame_type == TDD) {
UE_list->UE_template[CC_id][UE_id].DAI++;
......@@ -671,17 +673,17 @@ schedule_ue_spec(
if (frame_parms[CC_id]->frame_type == TDD) {
// ((DCI1_1_5MHz_TDD_t*)DLSCH_dci)->ndi = 0;
((DCI1_1_5MHz_TDD_t*)DLSCH_dci)->harq_pid = harq_pid;
((DCI1_1_5MHz_TDD_t*)DLSCH_dci)->rv = round&3;
((DCI1_1_5MHz_TDD_t*)DLSCH_dci)->rv = round[0]&3;
((DCI1_1_5MHz_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
LOG_D(MAC,"[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, dai %d, mcs %d\n",
module_idP,CC_id,harq_pid,round,(UE_list->UE_template[CC_id][UE_id].DAI-1),
module_idP,CC_id,harq_pid,round[0],(UE_list->UE_template[CC_id][UE_id].DAI-1),
((DCI1_1_5MHz_TDD_t*)DLSCH_dci)->mcs);
} else {
// ((DCI1_1_5MHz_FDD_t*)DLSCH_dci)->ndi = 0;
((DCI1_1_5MHz_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
((DCI1_1_5MHz_FDD_t*)DLSCH_dci)->rv = round&3;
((DCI1_1_5MHz_FDD_t*)DLSCH_dci)->rv = round[0]&3;
LOG_D(MAC,"[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, mcs %d\n",
module_idP,CC_id,harq_pid,round,((DCI1_1_5MHz_FDD_t*)DLSCH_dci)->mcs);
module_idP,CC_id,harq_pid,round[0],((DCI1_1_5MHz_FDD_t*)DLSCH_dci)->mcs);
}
......@@ -691,17 +693,17 @@ schedule_ue_spec(
if (frame_parms[CC_id]->frame_type == TDD) {
// ((DCI1_5MHz_TDD_t*)DLSCH_dci)->ndi = 0;
((DCI1_5MHz_TDD_t*)DLSCH_dci)->harq_pid = harq_pid;
((DCI1_5MHz_TDD_t*)DLSCH_dci)->rv = round&3;
((DCI1_5MHz_TDD_t*)DLSCH_dci)->rv = round[0]&3;
((DCI1_5MHz_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
LOG_D(MAC,"[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, dai %d, mcs %d\n",
module_idP,CC_id,harq_pid,round,(UE_list->UE_template[CC_id][UE_id].DAI-1),
module_idP,CC_id,harq_pid,round[0],(UE_list->UE_template[CC_id][UE_id].DAI-1),
((DCI1_5MHz_TDD_t*)DLSCH_dci)->mcs);
} else {
// ((DCI1_5MHz_FDD_t*)DLSCH_dci)->ndi = 0;
((DCI1_5MHz_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
((DCI1_5MHz_FDD_t*)DLSCH_dci)->rv = round&3;
((DCI1_5MHz_FDD_t*)DLSCH_dci)->rv = round[0]&3;
LOG_D(MAC,"[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, mcs %d\n",
module_idP,CC_id,harq_pid,round,((DCI1_5MHz_FDD_t*)DLSCH_dci)->mcs);
module_idP,CC_id,harq_pid,round[0],((DCI1_5MHz_FDD_t*)DLSCH_dci)->mcs);
}
......@@ -711,17 +713,17 @@ schedule_ue_spec(
if (frame_parms[CC_id]->frame_type == TDD) {
// ((DCI1_10MHz_TDD_t*)DLSCH_dci)->ndi = 0;
((DCI1_10MHz_TDD_t*)DLSCH_dci)->harq_pid = harq_pid;
((DCI1_10MHz_TDD_t*)DLSCH_dci)->rv = round&3;
((DCI1_10MHz_TDD_t*)DLSCH_dci)->rv = round[0]&3;
((DCI1_10MHz_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
LOG_D(MAC,"[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, dai %d, mcs %d\n",
module_idP,CC_id,harq_pid,round,(UE_list->UE_template[CC_id][UE_id].DAI-1),
module_idP,CC_id,harq_pid,round[0],(UE_list->UE_template[CC_id][UE_id].DAI-1),
((DCI1_10MHz_TDD_t*)DLSCH_dci)->mcs);
} else {
// ((DCI1_10MHz_FDD_t*)DLSCH_dci)->ndi = 0;
((DCI1_10MHz_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
((DCI1_10MHz_FDD_t*)DLSCH_dci)->rv = round&3;
((DCI1_10MHz_FDD_t*)DLSCH_dci)->rv = round[0]&3;
LOG_D(MAC,"[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, mcs %d\n",
module_idP,CC_id,harq_pid,round,((DCI1_10MHz_FDD_t*)DLSCH_dci)->mcs);
module_idP,CC_id,harq_pid,round[0],((DCI1_10MHz_FDD_t*)DLSCH_dci)->mcs);
}
......@@ -731,17 +733,17 @@ schedule_ue_spec(
if (frame_parms[CC_id]->frame_type == TDD) {
// ((DCI1_20MHz_TDD_t*)DLSCH_dci)->ndi = 0;
((DCI1_20MHz_TDD_t*)DLSCH_dci)->harq_pid = harq_pid;
((DCI1_20MHz_TDD_t*)DLSCH_dci)->rv = round&3;
((DCI1_20MHz_TDD_t*)DLSCH_dci)->rv = round[0]&3;
((DCI1_20MHz_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
LOG_D(MAC,"[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, dai %d, mcs %d\n",
module_idP,CC_id,harq_pid,round,(UE_list->UE_template[CC_id][UE_id].DAI-1),
module_idP,CC_id,harq_pid,round[0],(UE_list->UE_template[CC_id][UE_id].DAI-1),
((DCI1_20MHz_TDD_t*)DLSCH_dci)->mcs);
} else {
// ((DCI1_20MHz_FDD_t*)DLSCH_dci)->ndi = 0;
((DCI1_20MHz_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
((DCI1_20MHz_FDD_t*)DLSCH_dci)->rv = round&3;
((DCI1_20MHz_FDD_t*)DLSCH_dci)->rv = round[0]&3;
LOG_D(MAC,"[eNB %d] Retransmission CC_id %d : harq_pid %d, round %d, mcs %d\n",
module_idP,CC_id,harq_pid,round,((DCI1_20MHz_FDD_t*)DLSCH_dci)->mcs);
module_idP,CC_id,harq_pid,round[0],((DCI1_20MHz_FDD_t*)DLSCH_dci)->mcs);
}
......@@ -749,32 +751,57 @@ schedule_ue_spec(
}
break;
/*
case 3:
if (eNB_UE_stats->rank==0) {
if (0) {
//one codeword, format 1A
switch (frame_parms[CC_id]->N_RB_DL) {
case 25:
break;
default:
LOG_E(MAC,"TODO\n");
break;
switch (frame_parms[CC_id]->N_RB_DL) {
case 25:
if (frame_parms[CC_id]->frame_type == TDD) {
LOG_E(MAC,"TODO\n");
}
else {
}
break;
default:
LOG_E(MAC,"TODO\n");
break;
}
}
else {
LOG_I(MAC,"[eNB %d] CC_id %d Retransmission format 2A : harq_pid %d, round %d,%d\n",
module_idP,CC_id,harq_pid,round[0],round[1]);
//two codewords, format 2A
switch (frame_parms[CC_id]->N_RB_DL) {
case 25:
if (frame_parms[CC_id]->frame_type == TDD) {
LOG_E(MAC,"TODO\n");
switch (frame_parms[CC_id]->N_RB_DL) {
case 25:
if (frame_parms[CC_id]->frame_type == TDD) {
LOG_E(MAC,"TODO\n");
}
else {
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
if (round[0]==0) {//deactivate TB0
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 1;
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->mcs1 = 0;
}
else {
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->rv1 = round[0]&3;
}
if (round[1]==0) {//deactivate TB1
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->rv2 = 1;
}
else {
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->rv2 = round[1]&3;
}
}
break;
default:
LOG_E(MAC,"TODO\n");
break;
}
else {
}
break;
default:
LOG_E(MAC,"TODO\n");
break;
}
*/
break;
/*
// this code is disabled for now - needs to be done properly
case 4:
......@@ -839,12 +866,12 @@ schedule_ue_spec(
UE_list->UE_template[CC_id][UE_id].TB_active[0][harq_pid]=0;
UE_list->UE_template[CC_id][UE_id].TB_active[1][harq_pid]=0;
UE_list->UE_template[CC_id][UE_id].mcs[0][harq_pid]=0;
UE_list->UE_template[CC_id][UE_id].mcs[1][harq_pid]=0;\
UE_list->UE_template[CC_id][UE_id].mcs[1][harq_pid]=0;
LOG_I(MAC,"Rank Indicator%d\n",eNB_UE_stats->rank+1);
// loop over all transport blocks
for (tb=0;tb<1/*eNB_UE_stats->rank+1*/;tb++) {
for (tb=0;tb<2/*eNB_UE_stats->rank+1*/;tb++) {
rlc_status.bytes_in_buffer = 0;
// Now check RLC information to compute number of required RBs
......@@ -1112,6 +1139,9 @@ schedule_ue_spec(
TBS = mac_xface->get_TBS_DL(mcs,nb_rb);
}
if (TBS>SCH_PAYLOAD_SIZE_MAX)
LOG_E(MAC,"DLSCH buffer size too small! Expect Segmentation fault soon!\n");
LOG_D(MAC,"dlsch_mcs before and after the rate matching = (%d, %d)\n",eNB_UE_stats->dlsch_mcs1, mcs);
//#ifdef DEBUG_eNB_SCHEDULER
......@@ -1138,8 +1168,7 @@ schedule_ue_spec(
}
offset = generate_dlsch_header((unsigned char*)UE_list->DLSCH_pdu[CC_id][tb][UE_id].payload[0],
// offset = generate_dlsch_header((unsigned char*)eNB_mac_inst[0].DLSCH_pdu[0][0].payload[0],
offset = generate_dlsch_header((unsigned char*)&UE_list->DLSCH_pdu[CC_id][tb][UE_id].payload[0][0],
num_sdus, //num_sdus
sdu_lengths, //
sdu_lcids,
......@@ -1167,8 +1196,7 @@ schedule_ue_spec(
LOG_T(MAC,"\n");
#endif
// cycle through SDUs and place in dlsch_buffer
memcpy(&UE_list->DLSCH_pdu[CC_id][tb][UE_id].payload[0][offset],dlsch_buffer,sdu_length_total);
// memcpy(&eNB_mac_inst[0].DLSCH_pdu[0][0].payload[0][offset],dcch_buffer,sdu_lengths[0]);
memcpy(&UE_list->DLSCH_pdu[CC_id][tb][UE_id].payload[0][offset],dlsch_buffer,sdu_length_total);
// fill remainder of DLSCH with random data
for (j=0; j<(TBS-sdu_length_total-offset); j++) {
......@@ -1213,7 +1241,7 @@ schedule_ue_spec(
UE_list->UE_template[CC_id][UE_id].TB_active[tb][harq_pid]=1;
UE_list->UE_template[CC_id][UE_id].mcs[tb][harq_pid]=mcs;
LOG_I(MAC,"CC_id %d Frame %d, subframeP %d, TB %d: Toggling Format1 NDI for UE %d (rnti %x/%d) oldNDI %d\n",
LOG_I(MAC,"CC_id %d Frame %d, subframeP %d, TB %d: Toggling NDI for UE %d (rnti %x/%d) oldNDI %d\n",
CC_id, frameP,subframeP,tb,UE_id,
UE_list->UE_template[CC_id][UE_id].rnti,harq_pid,UE_list->UE_template[CC_id][UE_id].oldNDI[tb][harq_pid]);
......@@ -1884,8 +1912,8 @@ fill_DLSCH_dci(
/* TODO: fix log, what is 'rb alloc'? */
/*LOG_D(MAC,"[eNB %d] CC_id %d Adding Format 2A UE %d spec DCI for %d PRBS (rb alloc: %x) \n",
module_idP, CC_id, UE_id, nb_rb);*/
LOG_D(MAC,"[eNB %d] CC_id %d Adding Format 2A UE %d spec DCI for %d PRBS\n",
module_idP, CC_id, UE_id, nb_rb);
LOG_I(MAC,"[eNB %d] CC_id %d frame %d.%d. Adding Format 2A UE %d spec DCI for %d PRBS\n",
module_idP, CC_id, frameP, subframeP, UE_id, nb_rb);
if (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.frame_type == TDD) {
switch (PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL) {
......@@ -2024,7 +2052,6 @@ fill_DLSCH_dci(
}
}
}
}
stop_meas(&eNB->fill_DLSCH_dci);
......@@ -2056,7 +2083,7 @@ get_dlsch_sdu(
if (UE_id != -1) {
LOG_D(MAC,"[eNB %d] Frame %d: CC_id %d Get DLSCH sdu for rnti %x => UE_id %d\n",module_idP,frameP,CC_id,rntiP,UE_id);
return((unsigned char *)eNB->UE_list.DLSCH_pdu[CC_id][TBindex][UE_id].payload[0]);
return((unsigned char *)&eNB->UE_list.DLSCH_pdu[CC_id][TBindex][UE_id].payload[0][0]);
} else {
LOG_E(MAC,"[eNB %d] Frame %d: CC_id %d UE with RNTI %x does not exist\n", module_idP,frameP,CC_id,rntiP);
return NULL;
......
......@@ -671,7 +671,7 @@ void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_si
DCI_pdu->Num_ue_spec_dci++;
LOG_I(MAC,"add ue specific dci format %d for rnti %x \n",dci_fmt,rnti);
LOG_D(MAC,"add ue specific dci format %d for rnti %x \n",dci_fmt,rnti);
}
......
......@@ -267,18 +267,18 @@ int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uin
{
uint8_t round,round_max=0,UE_id;
int CC_id;
int CC_id,tb;
UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list;
UE_id = find_UE_id(Mod_id,rnti);
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
UE_id = find_UE_id(Mod_id,rnti);
round = UE_list->UE_sched_ctrl[UE_id].round[CC_id];
if (round > round_max) {
round_max = round;
for (tb=0;tb<2;tb++) {
round = UE_list->UE_sched_ctrl[UE_id].round[CC_id][tb];
if (round > round_max) {
round_max = round;
}
}
}
return round_max;
}
......@@ -505,8 +505,9 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
int *mbsfn_flag)
{
unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX],harq_pid=0,round=0,total_ue_count;
unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX];
unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX];
unsigned char harq_pid=0,round[2]={0,0},total_ue_count;
int UE_id, i;
uint16_t ii,j;
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
......@@ -601,7 +602,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
CC_id = UE_list->ordered_CCids[ii][UE_id];
ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
harq_pid = ue_sched_ctl->harq_pid[CC_id];
round = ue_sched_ctl->round[CC_id];
round[0] = ue_sched_ctl->round[CC_id][0];
round[1] = ue_sched_ctl->round[CC_id][1];
// if there is no available harq_process, skip the UE
if (UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id]<0)
......@@ -613,7 +615,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
// mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0);
if(round>0) {
if ((round[1]>0) || (round[1]>0)) {
nb_rbs_required[CC_id][UE_id] = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid];
}
......@@ -704,7 +706,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
CC_id = UE_list->ordered_CCids[ii][UE_id];
ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
harq_pid = ue_sched_ctl->harq_pid[CC_id];
round = ue_sched_ctl->round[CC_id];
round[0] = ue_sched_ctl->round[CC_id][0];
round[1] = ue_sched_ctl->round[CC_id][1];
rnti = UE_RNTI(Mod_id,UE_id);
......@@ -921,7 +924,7 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,
frameP,subframeP,
&ue_sched_ctl->harq_pid[CC_id],
&ue_sched_ctl->round[CC_id],
&ue_sched_ctl->round[CC_id][0],
openair_harq_DL);
if (ue_sched_ctl->ta_timer == 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