diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 2c0db37750d9a1b2ad142af4cb7b5b080e224a57..c29f422213bc32fd3abce948aea35aa3d1c3df83 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2131,8 +2131,10 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, if (dci_alloc[i].L == (uint8_t)L) { //#ifdef DEBUG_DCI_ENCODING - LOG_D(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L, - *(unsigned int*)dci_alloc[i].dci_pdu); + if (dci_alloc[i].rnti!=0xFFFF) + LOG_I(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L, + *(unsigned int*)dci_alloc[i].dci_pdu, + dci_alloc[i].rnti); //dump_dci(frame_parms,&dci_alloc[i]); //#endif diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index b94a442076ed560c8a7ca7d34f574f02810f105a..66f86e44afec0f662ec31079399c5c154fb3b4b1 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -891,20 +891,29 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci 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]; - + + beamforming_mode = eNB->transmission_mode[(uint8_t)UE_id]<7?0:eNB->transmission_mode[(uint8_t)UE_id]; dlsch0_harq = dlsch0->harq_processes[rel8->harq_process]; dlsch0_harq->codeword = 0; dlsch1_harq = dlsch1->harq_processes[rel8->harq_process]; dlsch1_harq->codeword = 1; - dlsch0->subframe_tx[subframe] = 1; - dlsch0->harq_mask |= (1<<rel8->harq_process); + dlsch0->subframe_tx[subframe] = 1; + if ((dlsch0->harq_mask & (1<<rel8->harq_process)) > 0 ) { + if (rel8->new_data_indicator_1 != dlsch0_harq->ndi) + dlsch0_harq->round=0; + } + else { // process is inactive, so activate and set round to 0 + dlsch0->harq_mask |= (1<<rel8->harq_process); + dlsch0_harq->round=0; + } + switch (rel8->dci_format) { case NFAPI_DL_DCI_FORMAT_1A: dci_alloc->format = format1A; dlsch0->active = 1; - dlsch0->harq_mask |= (1<<rel8->harq_process); + switch (fp->N_RB_DL) { case 6: @@ -1069,7 +1078,6 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci dci_alloc->format = format1; dlsch0->active = 1; - dlsch0->harq_mask |= (1<<rel8->harq_process); LOG_D(PHY,"Frame %d, Subframe %d: Programming DLSCH for Format 1 DCI, harq_pid %d\n",proc->frame_tx,subframe,rel8->harq_process); @@ -2234,6 +2242,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, uint32_t cshift = pdu->dci_pdu_rel8.cyclic_shift_2_for_drms; uint32_t TPC = pdu->dci_pdu_rel8.tpc; uint32_t mcs = pdu->dci_pdu_rel8.mcs_1; + uint32_t hopping = pdu->dci_pdu_rel8.frequency_hopping_enabled_flag; uint32_t rballoc = computeRIV(frame_parms->N_RB_DL, pdu->dci_pdu_rel8.resource_block_start, pdu->dci_pdu_rel8.number_of_resource_block); @@ -2242,13 +2251,14 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, void *dci_pdu = (void*)dci_alloc->dci_pdu; - LOG_I(PHY,"Filling DCI0 with cqi %d\n",cqi_req); + LOG_I(PHY,"Filling DCI0 with cqi %d, mcs %d, hopping %d, rballoc %x (%d,%d) ndi %d TPC %d cshift %d\n",cqi_req, + mcs,hopping,rballoc,pdu->dci_pdu_rel8.resource_block_start,pdu->dci_pdu_rel8.number_of_resource_block, + ndi,TPC,cshift); dci_alloc->format = format0; dci_alloc->firstCCE = pdu->dci_pdu_rel8.cce_index; dci_alloc->L = pdu->dci_pdu_rel8.aggregation_level; dci_alloc->rnti = pdu->dci_pdu_rel8.rnti; - // dci_alloc->harq_pid = pdu->dci_pdu_rel8.harq_process; dci_alloc->ra_flag = 0; switch (frame_parms->N_RB_DL) { @@ -2261,9 +2271,9 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->mcs = mcs; ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->ndi = ndi; ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping; + ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping; ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->type = 0; - dci_alloc->dci_length = sizeof_DCI0_1_5MHz_TDD_1_6_t; + dci_alloc->dci_length = sizeof_DCI0_1_5MHz_TDD_1_6_t; } else { ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cqi_req = cqi_req; ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cshift = cshift; @@ -2271,9 +2281,9 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_1_5MHz_FDD_t *)dci_pdu)->mcs = mcs; ((DCI0_1_5MHz_FDD_t *)dci_pdu)->ndi = ndi; ((DCI0_1_5MHz_FDD_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping; + ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping = hopping; ((DCI0_1_5MHz_FDD_t *)dci_pdu)->type = 0; - dci_alloc->dci_length = sizeof_DCI0_1_5MHz_FDD_t; + dci_alloc->dci_length = sizeof_DCI0_1_5MHz_FDD_t; } break; @@ -2287,7 +2297,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->mcs = mcs; ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->ndi = ndi; ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->hopping; + ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping; ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->type = 0; dci_alloc->dci_length = sizeof_DCI0_5MHz_TDD_1_6_t; } else { @@ -2297,7 +2307,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_5MHz_FDD_t *)dci_pdu)->mcs = mcs; ((DCI0_5MHz_FDD_t *)dci_pdu)->ndi = ndi; ((DCI0_5MHz_FDD_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_5MHz_FDD_t *)dci_pdu)->hopping; + ((DCI0_5MHz_FDD_t *)dci_pdu)->hopping = hopping; ((DCI0_5MHz_FDD_t *)dci_pdu)->type = 0; dci_alloc->dci_length = sizeof_DCI0_5MHz_FDD_t; } @@ -2313,7 +2323,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->mcs = mcs; ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->ndi = ndi; ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->hopping; + ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping; ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->type = 0; dci_alloc->dci_length = sizeof_DCI0_10MHz_TDD_1_6_t; } else { @@ -2323,8 +2333,8 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_10MHz_FDD_t *)dci_pdu)->mcs = mcs; ((DCI0_10MHz_FDD_t *)dci_pdu)->ndi = ndi; ((DCI0_10MHz_FDD_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_10MHz_FDD_t *)dci_pdu)->hopping; - ((DCI0_10MHz_FDD_t *)dci_pdu)->type = 0; + ((DCI0_10MHz_FDD_t *)dci_pdu)->hopping = hopping; + ((DCI0_10MHz_FDD_t *)dci_pdu)->type = 0; dci_alloc->dci_length = sizeof_DCI0_10MHz_FDD_t; } @@ -2339,7 +2349,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->mcs = mcs; ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->ndi = ndi; ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->hopping; + ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->hopping = hopping; ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->type = 0; dci_alloc->dci_length = sizeof_DCI0_20MHz_TDD_1_6_t; } else { @@ -2349,7 +2359,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc, ((DCI0_20MHz_FDD_t *)dci_pdu)->mcs = mcs; ((DCI0_20MHz_FDD_t *)dci_pdu)->ndi = ndi; ((DCI0_20MHz_FDD_t *)dci_pdu)->rballoc = rballoc; - // hopping = ((DCI0_20MHz_FDD_t *)dci_pdu)->hopping; + ((DCI0_20MHz_FDD_t *)dci_pdu)->hopping = hopping; ((DCI0_20MHz_FDD_t *)dci_pdu)->type = 0; dci_alloc->dci_length = sizeof_DCI0_20MHz_FDD_t; } @@ -6896,7 +6906,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->ndi; mcs = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->mcs; rballoc = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping; + // hopping = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->type; } else { cqi_req = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cqi_req; @@ -6905,7 +6915,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->ndi; mcs = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->mcs; rballoc = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping; + // hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->type; } @@ -6924,7 +6934,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->ndi; mcs = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->mcs; rballoc = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->hopping; + // hopping = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->type; } else { cqi_req = ((DCI0_5MHz_FDD_t *)dci_pdu)->cqi_req; @@ -6933,7 +6943,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_5MHz_FDD_t *)dci_pdu)->ndi; mcs = ((DCI0_5MHz_FDD_t *)dci_pdu)->mcs; rballoc = ((DCI0_5MHz_FDD_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_5MHz_FDD_t *)dci_pdu)->hopping; + // hopping = ((DCI0_5MHz_FDD_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_5MHz_FDD_t *)dci_pdu)->type; } @@ -6952,7 +6962,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->ndi; mcs = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->mcs; rballoc = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->hopping; + // hopping = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->type; } else { cqi_req = ((DCI0_10MHz_FDD_t *)dci_pdu)->cqi_req; @@ -6961,7 +6971,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_10MHz_FDD_t *)dci_pdu)->ndi; mcs = ((DCI0_10MHz_FDD_t *)dci_pdu)->mcs; rballoc = ((DCI0_10MHz_FDD_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_10MHz_FDD_t *)dci_pdu)->hopping; + // hopping = ((DCI0_10MHz_FDD_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_10MHz_FDD_t *)dci_pdu)->type; } @@ -6980,7 +6990,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->ndi; mcs = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->mcs; rballoc = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->hopping; + // hopping = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->type; } else { cqi_req = ((DCI0_20MHz_FDD_t *)dci_pdu)->cqi_req; @@ -6989,7 +6999,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ndi = ((DCI0_20MHz_FDD_t *)dci_pdu)->ndi; mcs = ((DCI0_20MHz_FDD_t *)dci_pdu)->mcs; rballoc = ((DCI0_20MHz_FDD_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_20MHz_FDD_t *)dci_pdu)->hopping; + // hopping = ((DCI0_20MHz_FDD_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_20MHz_FDD_t *)dci_pdu)->type; } @@ -7821,7 +7831,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, TPC = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->TPC; mcs = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->mcs; rballoc = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping; + // hopping = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->type; } else { cqi_req = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cqi_req; @@ -7829,7 +7839,7 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, TPC = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->TPC; mcs = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->mcs; rballoc = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->rballoc; - // hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping; + // hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping=hopping; // type = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->type; } diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index 7a76514fe38f26c5625d98394c3b53596deb1b84..7053a8b5bccba716bec8f8066c8acaebfd3614eb 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -146,6 +146,8 @@ typedef struct { uint32_t cqi_alloc2; /// Current Number of RBs uint16_t nb_rb; + /// Current NDI + uint8_t ndi; /// downlink power offset field uint8_t dl_power_off; /// start symbold of pdsch diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index fb2a65c2405703aeda9aeba80b9831ce01a6a6a3..201c027089da3f2cf422871e18ba55006442ee97 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -2389,7 +2389,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, } // aa - LOG_D(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im, + LOG_I(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im, (subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])); diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index 202380a640725fc5c234d33d1bd877a91624d19a..ac810cc91f68b62c5d51306801979cb9ebe02c97 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -162,12 +162,17 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU - LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch, rnti %x, UE_id %d, harq_pid %d\n", - proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); + if (rel8->rnti != 0xFFFF) LOG_I(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d\n", + proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); if (codeword_index == 0) dlsch0_harq->pdu = sdu; else dlsch1_harq->pdu = sdu; } - + else { + if (rel8->rnti != 0xFFFF) LOG_I(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n", + proc->frame_tx,proc->subframe_tx,dlsch0_harq->round, + rel8->rnti,UE_id,harq_pid); + } + #ifdef Rel14 dlsch0->sib1_br_flag=0; @@ -296,7 +301,7 @@ void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_co if (eNB->frame_parms.frame_type == FDD) { uci->num_pucch_resources = harq_information->harq_information_rel9_fdd.number_of_pucch_resources; - LOG_D(PHY,"Programming UCI HARQ mode %d : size %d in (%d,%d)\n", + LOG_I(PHY,"Programming UCI HARQ mode %d : size %d in (%d,%d)\n", harq_information->harq_information_rel9_fdd.ack_nack_mode, harq_information->harq_information_rel9_fdd.harq_size, uci->frame,uci->subframe); @@ -401,7 +406,7 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t uci->srs_active = srs_active; uci->active = 1; - LOG_D(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", + LOG_I(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", uci->rnti,uci->n_pucch_1_0_sr[0],frame,subframe); @@ -420,7 +425,7 @@ void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_ uci->type = HARQ_SR; uci->num_antenna_ports = 1; uci->num_pucch_resources = 1; - uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_harq_pdu.sr_information.sr_information_rel8.pucch_index; + uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_harq_pdu.sr_information.sr_information_rel8.pucch_index; uci->srs_active = srs_active; uci->active = 1; @@ -432,6 +437,7 @@ void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; + LOG_I(PHY,"Frame %d, Subframe %d: Programming UCI_HARQ process (type %d)\n",frame,subframe,HARQ); uci->frame = frame; uci->subframe = subframe; uci->rnti = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti; @@ -632,10 +638,12 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { // handle_nfapi_mch_dl_pdu(eNB,dl_config_pdu); break; case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: + /* AssertFatal(dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus, "dlsch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n", dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index, TX_req->tx_request_body.number_of_pdus); + */ AssertFatal((dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks<3) && (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks>0), "dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = %d not in [1,2]\n", diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index b6381273ba9013e864b49bd665570d261b0daaa9..ffa41898b34537bc84c4ec3ad54919ad9cb72fd7 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -378,6 +378,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, stop_meas(&eNB->dlsch_modulation_stats); dlsch->active = 0; + dlsch_harq->round++; } @@ -781,6 +782,8 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) { + + LOG_I(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 @@ -843,7 +846,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } case HARQ: if (fp->frame_type == FDD) { - LOG_D(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n", + LOG_I(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n", frame,subframe,i, uci->pucch_fmt,uci->type, uci->frame,uci->subframe,uci->n_pucch_1[0][0], @@ -881,13 +884,13 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) PUCCH1a_THRES); } -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", + + LOG_I(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", eNB->Mod_id, uci->rnti, frame,subframe, - pucch_b0b1[0][0],metric0); -#endif + pucch_b0b1[0][0],metric[0]); + fill_uci_harq_indication(eNB,uci,frame,subframe,pucch_b0b1[0],0,0xffff); @@ -1391,7 +1394,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ulsch->Mlimit, ulsch_harq->o_ACK[0], ulsch_harq->o_ACK[1]); - /* + /* if (dB_fixed_times10(eNB->pusch_vars[i]->ulsch_power[0]) > 300) { dump_ulsch(eNB,frame,subframe,i); exit(-1); }*/ diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 0b04229c49702b69fb195ed8f58794312f1cdd5a..8f879d8859362c88af00a6e0afe1a9cfd7c8c104 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -268,7 +268,10 @@ void schedule_SR(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) { // drop the allocation because ULSCH with handle it with BSR if (ul_ulsch_only==1) 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; + // if we get here then there is no UL grant so program the SR ul_req->ul_config_pdu_list[ul_req->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE; ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; @@ -472,7 +475,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame 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_I(MAC,"UE %d/%x : ul_inactivity %d, cqi_req %d\n",i,rnti, + 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); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index daad3527bd45eeb69a7431033ba098d136dcfb2c..0e4d6510b42f9ed980dbda9e3985dda42a16ce48 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -1050,12 +1050,12 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, 4, // aggregation_level RA_template->rnti, // rnti 1, // rnti_type, CRNTI - 0, // harq_process + RA_template->harq_pid, // harq_process 1, // tpc, none getRIV(N_RB_DL,first_rb,4), // resource_block_coding RA_template->msg4_mcs, // mcs 1, // ndi - round, // rv + round&3, // rv 0); // vrb_flag if (!CCE_allocation_infeasible(module_idP,CC_idP,0,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,RA_template->rnti)) { @@ -1063,11 +1063,36 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP, dl_req->number_pdu++; LOG_D(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d\n", RA_template->rnti, round, frameP, subframeP); + // DLSCH Config + fill_nfapi_dlsch_config(eNB, + dl_req, + RA_template->msg4_TBsize, + eNB->pdu_index[CC_idP]++, + RA_template->rnti, + 2, // resource_allocation_type : format 1A/1B/1D + 0, // virtual_resource_block_assignment_flag : localized + getRIV(N_RB_DL,first_rb,4), // resource_block_coding : RIV, 4 PRB + 2, // modulation: QPSK + round&3, // redundancy version + 1, // transport_blocks + 0, // transport_block_to_codeword_swap_flag (0) + (cc->p_eNB==1 ) ? 0 : 1, // transmission_scheme + 1, // number of layers + 1, // number of subbands + //0, // codebook index + 1, // ue_category_capacity + 4, // pa: 0 dB + 0, // delta_power_offset_index + 0, // ngap + 1, // NPRB = 3 like in DCI + (cc->p_eNB==1 ) ? 1 : 2, // transmission mode + 1, // num_bf_prb_per_subband + 1); // num_bf_vector } else LOG_D(MAC,"msg4 retransmission for rnti %x (round %d) fsf %d/%d CCE allocation failed!\n", RA_template->rnti, round, frameP, subframeP); - LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission)\n", - module_idP,CC_idP,frameP,subframeP,RA_template->rnti); + LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission round %d)\n", + module_idP,CC_idP,frameP,subframeP,RA_template->rnti,round); // Program PUCCH1a for ACK/NAK @@ -1159,7 +1184,7 @@ void initiate_ra_proc(module_id_t module_idP, ext4_prach=cc->radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; prach_ParametersListCE_r13= &ext4_prach->prach_ParametersListCE_r13; } - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,subframeP,preamble_index); + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,subframeP,preamble_index); #ifdef Rel14 LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d PRACH resource type %d\n",module_idP,CC_id,frameP,subframeP,rach_resource_type); #endif diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index d19c5e14b90b228ca3384bf32417734857ebc389..dc45eeefd1177ab4f7cd2b83c90141ca3bd0e8d1 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -2107,7 +2107,7 @@ uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) // every Frame when not RRC_CONNECTED { - LOG_I(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled (BSR0 %d,SR %d)\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id), + LOG_D(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled (BSR0 %d,SR %d)\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id), UE_template->bsr_info[LCGID0], UE_template->ul_SR); return(1); @@ -3594,7 +3594,7 @@ void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, sub_frame_t 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",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + LOG_I(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); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 7afb490e7c6dd11d9b92f780e19fefd4fe1eb324..520497cdb4cc2efe767fbc70d1b22915c55d02c9 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -963,7 +963,7 @@ abort(); if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0) && harq_pid == 0) || (round>0))// || ((frameP%10)==0)) // 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 every 10 frames { - LOG_D(MAC,"[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", + LOG_I(MAC,"[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", module_idP,harq_pid,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR, UE_sched_ctrl->ul_inactivity_timer, @@ -1053,14 +1053,12 @@ abort(); T_INT(TBS), T_INT(ndi)); if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) - LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", + LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,UE_template->mcs_UL[harq_pid], first_rb[CC_id],rb_table[rb_table_index], rb_table_index,UE_template->TBS_UL[harq_pid],harq_pid); // bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB) - // increment for next UE allocation - first_rb[CC_id]+=rb_table[rb_table_index]; //store for possible retransmission UE_template->nb_rb_ul[harq_pid] = rb_table[rb_table_index]; UE_template->first_rb_ul[harq_pid] = first_rb[CC_id]; @@ -1149,6 +1147,9 @@ abort(); S_UL_SCHEDULED); LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id); + + // increment first rb for next UE allocation + first_rb[CC_id]+=rb_table[rb_table_index]; } else { // round > 0 => retransmission