From 9c820805fab88a6e457fb43f92480c54390d6927 Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Mon, 5 Feb 2018 15:43:20 +0800 Subject: [PATCH 01/63] TDD config1 initial merge --- nfapi/oai_integration/nfapi_pnf.c | 2 +- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 17 +- openair1/PHY/LTE_TRANSPORT/defs.h | 2 +- openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 12 +- openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c | 7 +- openair1/PHY/LTE_TRANSPORT/proto.h | 1 + openair1/SCHED/fapi_l1.c | 47 +++-- openair1/SCHED/phy_procedures_lte_common.c | 24 +++ openair1/SCHED/phy_procedures_lte_eNb.c | 30 ++- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 1 + openair1/SIMULATION/LTE_PHY/dlsim_tm7.c | 1 + openair2/LAYER2/MAC/defs.h | 4 +- openair2/LAYER2/MAC/eNB_scheduler.c | 2 +- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 50 +++-- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 18 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 195 +++++++++++++++--- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 51 +++-- .../MAC/flexran_agent_scheduler_dlsch_ue.c | 4 +- openair2/LAYER2/MAC/main.c | 7 +- openair2/LAYER2/MAC/pre_processor.c | 25 ++- openair2/LAYER2/MAC/proto.h | 11 +- openair2/PHY_INTERFACE/IF_Module.c | 16 +- 22 files changed, 372 insertions(+), 155 deletions(-) diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index c63d504e43..628acf2e77 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -839,7 +839,7 @@ int pnf_phy_dl_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); LTE_eNB_DLSCH_t *dlsch0 = eNB->dlsch[UE_id][0]; //LTE_eNB_DLSCH_t *dlsch1 = eNB->dlsch[UE_id][1]; - int harq_pid = dlsch0->harq_ids[sf]; + int harq_pid = dlsch0->harq_ids[sfn%2][sf]; uint8_t *dlsch_sdu = tx_pdus[UE_id][harq_pid]; memcpy(dlsch_sdu, tx_pdu->segments[0].segment_data, tx_pdu->segments[0].segment_length); diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index e0c9c043c5..722341ea65 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -1266,14 +1266,14 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t dlsch0_harq->mcs = rel8->mcs_1; dlsch0_harq->Qm = 2; dlsch0_harq->TBS = TBStable[I_mcs][NPRB-1]; - dlsch0->harq_ids[subframe] = rel8->harq_process; + dlsch0->harq_ids[frame%2][subframe] = rel8->harq_process; #ifdef UE_EXPANSION dlsch0->active[subframe] = 1; #else dlsch0->active = 1; #endif dlsch0->rnti = rel8->rnti; - dlsch0->harq_ids[subframe] = rel8->harq_process; + //dlsch0->harq_ids[subframe] = rel8->harq_process; if (dlsch0_harq->round == 0) dlsch0_harq->status = ACTIVE; @@ -1454,7 +1454,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t } LOG_D(PHY,"DCI: Set harq_ids[%d] to %d (%p)\n",subframe,rel8->harq_process,dlsch0); - dlsch0->harq_ids[subframe] = rel8->harq_process; + dlsch0->harq_ids[frame%2][subframe] = rel8->harq_process; dlsch0->harq_mask |= (1<harq_process); @@ -1621,8 +1621,8 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t dlsch0->subframe_tx[subframe] = 1; - dlsch0->harq_ids[subframe] = rel8->harq_process; - dlsch1->harq_ids[subframe] = rel8->harq_process; + dlsch0->harq_ids[frame%2][subframe] = rel8->harq_process; + dlsch1->harq_ids[frame%2][subframe] = rel8->harq_process; // printf("Setting DLSCH harq id %d to subframe %d\n",harq_pid,subframe); @@ -2076,11 +2076,11 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t if (dlsch0 != NULL){ dlsch0->subframe_tx[subframe] = 1; - dlsch0->harq_ids[subframe] = rel8->harq_process; + dlsch0->harq_ids[frame%2][subframe] = rel8->harq_process; } if (dlsch1_harq != NULL){ - dlsch1->harq_ids[subframe] = rel8->harq_process; + dlsch1->harq_ids[frame%2][subframe] = rel8->harq_process; } @@ -2290,6 +2290,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL; int UE_id; int subframe = proc->subframe_tx; + int frame = proc->frame_tx; dci_alloc->firstCCE = rel13->ecce_index; dci_alloc->L = rel13->aggregation_level; @@ -2533,7 +2534,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d } - dlsch0->harq_ids[subframe] = rel13->harq_process; + dlsch0->harq_ids[frame%2][subframe] = rel13->harq_process; diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index b293e56b87..293f931363 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -291,7 +291,7 @@ typedef struct { /// First CCE of last PDSCH scheduling per subframe. Again used during PUCCH detection for ACK/NAK. uint8_t nCCE[10]; /// Process ID's per subframe. Used to associate received ACKs on PUSCH/PUCCH to DLSCH harq process ids - uint8_t harq_ids[10]; + uint8_t harq_ids[2][10]; /// Window size (in outgoing transport blocks) for fine-grain rate adaptation uint8_t ra_window_size; /// First-round error threshold for fine-grain rate adaptation diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index bd5c1b05c2..69e7d7424a 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -167,8 +167,8 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_ }*/ - for (i=0; i<10; i++) - dlsch->harq_ids[i] = Mdlharq; + for (i=0; i<20; i++) + dlsch->harq_ids[i/10][i%10] = Mdlharq; for (i=0; iharq_processes[i] = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t)); @@ -254,8 +254,8 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch) #endif dlsch->harq_mask = 0; - for (i=0; i<10; i++) - dlsch->harq_ids[i] = Mdlharq; + for (i=0; i<20; i++) + dlsch->harq_ids[i/10][i%10] = Mdlharq; for (i=0; iharq_processes[i]) { @@ -399,7 +399,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, unsigned int crc=1; unsigned short iind; - unsigned char harq_pid = dlsch->harq_ids[subframe]; + unsigned char harq_pid = dlsch->harq_ids[frame%2][subframe]; unsigned short nb_rb = dlsch->harq_processes[harq_pid]->nb_rb; unsigned int A; unsigned char mod_order; @@ -583,7 +583,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, unsigned short iind; LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; - unsigned char harq_pid = dlsch->harq_ids[subframe]; + unsigned char harq_pid = dlsch->harq_ids[frame%2][subframe]; unsigned short nb_rb = dlsch->harq_processes[harq_pid]->nb_rb; unsigned int A; unsigned char mod_order; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c index 49b41615f4..9fef0f1f4f 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c @@ -1990,6 +1990,7 @@ inline int check_skip_dc(int rb,LTE_DL_FRAME_PARMS *frame_parms) { int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, int32_t **txdataF, int16_t amp, + int frame, uint32_t subframe_offset, uint8_t num_pdcch_symbols, LTE_eNB_DLSCH_t *dlsch0, @@ -2062,7 +2063,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, if ((dlsch0 != NULL) && (dlsch1 != NULL)){ - harq_pid = dlsch0->harq_ids[subframe_offset]; + harq_pid = dlsch0->harq_ids[frame%2][subframe_offset]; dlsch0_harq = dlsch0->harq_processes[harq_pid]; mimo_mode = dlsch0_harq->mimo_mode; mod_order0 = dlsch0_harq->Qm; @@ -2079,7 +2080,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, }else if ((dlsch0 != NULL) && (dlsch1 == NULL)){ - harq_pid = dlsch0->harq_ids[subframe_offset]; + harq_pid = dlsch0->harq_ids[frame%2][subframe_offset]; dlsch0_harq = dlsch0->harq_processes[harq_pid]; mimo_mode = dlsch0_harq->mimo_mode; mod_order0 = dlsch0_harq->Qm; @@ -2096,7 +2097,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, }else if ((dlsch0 == NULL) && (dlsch1 != NULL)){ - harq_pid = dlsch1->harq_ids[subframe_offset]; + harq_pid = dlsch1->harq_ids[frame%2][subframe_offset]; dlsch1_harq = dlsch1->harq_processes[harq_pid]; mimo_mode = dlsch1_harq->mimo_mode; mod_order0 = dlsch1_harq->Qm; diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index be13e5938d..10e45af9b1 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -290,6 +290,7 @@ int32_t allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB, int32_t dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, int32_t **txdataF, int16_t amp, + int frame, uint32_t sub_frame_offset, uint8_t num_pdcch_symbols, LTE_eNB_DLSCH_t *dlsch0, diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index d4f4bec4b3..dd02154e9c 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -161,24 +161,24 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr dlsch1 = eNB->dlsch[UE_id][1]; #ifdef Rel14 - if ((rel13->pdsch_payload_type < 2) && (rel13->ue_type>0)) dlsch0->harq_ids[subframe] = 0; + if ((rel13->pdsch_payload_type < 2) && (rel13->ue_type>0)) dlsch0->harq_ids[frame%2][subframe] = 0; #endif - harq_pid = dlsch0->harq_ids[subframe]; + harq_pid = dlsch0->harq_ids[frame%2][subframe]; AssertFatal((harq_pid>=0) && (harq_pid<8),"harq_pid %d not in 0...7 frame:%d subframe:%d subframe(TX):%d rnti:%x UE_id:%d dlsch0[harq_ids:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d]\n", harq_pid, frame,subframe, proc->subframe_tx,rel8->rnti,UE_id, - dlsch0->harq_ids[0], - dlsch0->harq_ids[1], - dlsch0->harq_ids[2], - dlsch0->harq_ids[3], - dlsch0->harq_ids[4], - dlsch0->harq_ids[5], - dlsch0->harq_ids[6], - dlsch0->harq_ids[7], - dlsch0->harq_ids[8], - dlsch0->harq_ids[9] + dlsch0->harq_ids[frame%2][0], + dlsch0->harq_ids[frame%2][1], + dlsch0->harq_ids[frame%2][2], + dlsch0->harq_ids[frame%2][3], + dlsch0->harq_ids[frame%2][4], + dlsch0->harq_ids[frame%2][5], + dlsch0->harq_ids[frame%2][6], + dlsch0->harq_ids[frame%2][7], + dlsch0->harq_ids[frame%2][8], + dlsch0->harq_ids[frame%2][9] ); dlsch0_harq = dlsch0->harq_processes[harq_pid]; dlsch1_harq = dlsch1->harq_processes[harq_pid]; @@ -331,6 +331,9 @@ void handle_ulsch_harq_pdu( ulsch_harq->subframe = subframe; ulsch_harq->O_ACK = harq_information->harq_information_rel10.harq_size; ulsch->beta_offset_harqack_times8 = to_beta_offset_harqack[harq_information->harq_information_rel10.delta_offset_harq]; + if (harq_information->harq_information_rel10.ack_nack_mode==0) //bundling + ulsch->bundling = 1; + } uint16_t to_beta_offset_ri[16]={9,13,16,20,25,32,40,50,64,80,101,127,160,0,0,0}; @@ -678,13 +681,19 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) eNB->pdcch_vars[subframe&1].num_dci = 0; eNB->phich_vars[subframe&1].num_hi = 0; - LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SF:%04d%d DL_req:SFN/SF:%04d%d:dl_pdu:%d tx_req:SFN/SF:%04d%d:pdus:%d hi_dci0:SFN/SF:%04d%d:pdus:%d ul_cfg:SFN/SF:%04d%d:pdus:%d num_pdcch_symbols:%d\n", - frame,subframe, - NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),number_dl_pdu, - NFAPI_SFNSF2SFN(TX_req->sfn_sf),NFAPI_SFNSF2SF(TX_req->sfn_sf),TX_req->tx_request_body.number_of_pdus, - NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),number_hi_dci0_pdu, - NFAPI_SFNSF2SFN(UL_req->sfn_sf),NFAPI_SFNSF2SF(UL_req->sfn_sf),number_ul_pdu, - eNB->pdcch_vars[subframe&1].num_pdcch_symbols); + LOG_I(PHY,"NFAPI: Sched_INFO:SFN/SF:%04d%d DL_req:SFN/SF:%04d%d:dl_pdu:%d tx_req:SFN/SF:%04d%d:pdus:%d\n", + frame,subframe, + NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),number_dl_pdu, + NFAPI_SFNSF2SFN(TX_req->sfn_sf),NFAPI_SFNSF2SF(TX_req->sfn_sf),TX_req->tx_request_body.number_of_pdus + ); + LOG_I(PHY,"NFAPI: hi_dci0:SFN/SF:%04d%d:pdus:%d\n", + NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),number_hi_dci0_pdu + ); + if(UL_req!=NULL) + LOG_I(PHY,"NFAPI: ul_cfg:SFN/SF:%04d%d:pdus:%d num_pdcch_symbols:%d\n", + NFAPI_SFNSF2SFN(UL_req->sfn_sf),NFAPI_SFNSF2SF(UL_req->sfn_sf),number_ul_pdu, + eNB->pdcch_vars[subframe&1].num_pdcch_symbols); + int do_oai =0; int dont_send =0; diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c index bbb6986ce9..fc63c12b8e 100644 --- a/openair1/SCHED/phy_procedures_lte_common.c +++ b/openair1/SCHED/phy_procedures_lte_common.c @@ -336,6 +336,29 @@ unsigned char ul_ACK_subframe2_dl_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsig return(0); } +unsigned char ul_ACK_subframe2_dl_frame(LTE_DL_FRAME_PARMS *frame_parms,int frame, unsigned char subframe,unsigned char subframe_tx) +{ + + if (frame_parms->frame_type == FDD) { + return (((subframe_tx > subframe ) ? frame-1 : frame)+1024)%1024; + } else { + switch (frame_parms->tdd_config) { + case 3: + //TODO + break; + case 4: + //TODO + break; + case 1: + return(((subframe_tx > subframe ) ? frame-1 : frame)+1024)%1024; + break; + } + } + + return(0); +} + + unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char subframe) { @@ -383,6 +406,7 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s break; case 1: + return 1; // don't ACK special subframe for now if (subframe == 2) { // ACK subframes 5 and 6 return(2); } else if (subframe == 3) { // ACK subframe 9 diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index d53ddf7c96..79758c884c 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -379,6 +379,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, dlsch_modulation(eNB, eNB->common_vars.txdataF, AMP, + frame, subframe, dlsch_harq->pdsch_start, dlsch, @@ -540,7 +541,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, #endif // get harq_pid - harq_pid = dlsch0->harq_ids[subframe]; + harq_pid = dlsch0->harq_ids[frame%2][subframe]; AssertFatal(harq_pid>=0,"harq_pid is negative\n"); if (harq_pid>=8) @@ -1341,7 +1342,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) const int frame = proc->frame_rx; if (fp->frame_type == FDD) harq_pid = ((10*frame) + subframe)&7; - else harq_pid = subframe%10; + else harq_pid = subframe2harq_pid(&eNB->frame_parms,frame,subframe); for (i=0; iulsch[i]; @@ -1638,7 +1639,7 @@ void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subf LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; int harq_pid; - int subframe_tx; + int subframe_tx,frame_tx; int M,m; AssertFatal(UE_id!=-1,"no existing dlsch context\n"); @@ -1648,7 +1649,9 @@ void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subf if (eNB->frame_parms.frame_type == FDD) { subframe_tx = (subframe+6)%10; - harq_pid = dlsch0->harq_ids[subframe_tx]; + frame_tx = ul_ACK_subframe2_dl_frame(&eNB->frame_parms,frame,subframe,subframe_tx); + harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx]; // or just use 0 for fdd? + AssertFatal((harq_pid>=0) && (harq_pid<10),"harq_pid %d not in 0...9\n",harq_pid); dlsch0_harq = dlsch0->harq_processes[harq_pid]; dlsch1_harq = dlsch1->harq_processes[harq_pid]; @@ -1671,8 +1674,9 @@ void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subf subframe_tx = ul_ACK_subframe2_dl_subframe(&eNB->frame_parms, subframe, m); + frame_tx = ul_ACK_subframe2_dl_frame(&eNB->frame_parms,frame,subframe,subframe_tx); if (((1< 0) { - harq_pid = dlsch0->harq_ids[subframe_tx]; + harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx]; if ((harq_pid>=0) && (harq_pid<10)) { dlsch0_harq = dlsch0->harq_processes[harq_pid]; dlsch1_harq = dlsch1->harq_processes[harq_pid]; @@ -1695,7 +1699,7 @@ int getM(PHY_VARS_eNB *eNB,int frame,int subframe) { LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; int harq_pid; - int subframe_tx; + int subframe_tx,frame_tx; int m; M=ul_ACK_subframe2_M(&eNB->frame_parms, @@ -1705,7 +1709,10 @@ int getM(PHY_VARS_eNB *eNB,int frame,int subframe) { subframe_tx = ul_ACK_subframe2_dl_subframe(&eNB->frame_parms, subframe, m); - harq_pid = dlsch0->harq_ids[subframe_tx]; + frame_tx = ul_ACK_subframe2_dl_frame(&eNB->frame_parms,frame, + subframe,subframe_tx); + harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx]; + if (harq_pid>=0 && harq_pid<10) { dlsch0_harq = dlsch0->harq_processes[harq_pid]; dlsch1_harq = dlsch1->harq_processes[harq_pid]; @@ -1813,7 +1820,7 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq, for (i=0;iO_ACK;i++) { AssertFatal(ulsch_harq->o_ACK[i] == 0 || ulsch_harq->o_ACK[i] == 1, "harq_ack[%d] is %d, should be 1,2 or 4\n",i,ulsch_harq->o_ACK[i]); - pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = 2-ulsch_harq->o_ACK[i]; + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 2-ulsch_harq->o_ACK[i]; // release DLSCH if needed if (ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,i,frame,subframe,0xffff); if (M==1 && ulsch_harq->O_ACK==1 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff); @@ -1915,7 +1922,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB, pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; pdu->harq_indication_tdd_rel13.mode = tdd_mapping_mode; - + LOG_D(PHY,"%s(eNB, uci_harq format %d, rnti:%04x, frame:%d, subframe:%d, tdd_mapping_mode:%d) harq_ack[0]:%d harq_ack[1]:%d\n", __FUNCTION__, uci->pucch_fmt,uci->rnti, frame, subframe, tdd_mapping_mode,harq_ack[0],harq_ack[1]); switch (tdd_mapping_mode) { case 0: // bundling @@ -1977,15 +1984,18 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB, case 2: // special bundling (SR collision) pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; + pdu->harq_indication_tdd_rel13.mode = 0; int tdd_config5_sf2scheds=0; if (eNB->frame_parms.tdd_config==5) tdd_config5_sf2scheds = getM(eNB,frame,subframe); switch (harq_ack[0]) { case 0: + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0;// anaake break; case 1: // check if M=1,4,7 if (uci->num_pucch_resources == 1 || uci->num_pucch_resources == 4 || tdd_config5_sf2scheds == 1 || tdd_config5_sf2scheds == 4 || tdd_config5_sf2scheds == 7) { + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;// anaake release_harq(eNB,UE_id,0,frame,subframe,0xffff); release_harq(eNB,UE_id,1,frame,subframe,0xffff); } @@ -1993,6 +2003,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB, case 2: // check if M=2,5,8 if (uci->num_pucch_resources == 2 || tdd_config5_sf2scheds == 2 || tdd_config5_sf2scheds == 5 || tdd_config5_sf2scheds == 8) { + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;// anaake release_harq(eNB,UE_id,0,frame,subframe,0xffff); release_harq(eNB,UE_id,1,frame,subframe,0xffff); } @@ -2000,6 +2011,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB, case 3: // check if M=3,6,9 if (uci->num_pucch_resources == 3 || tdd_config5_sf2scheds == 3 || tdd_config5_sf2scheds == 6 || tdd_config5_sf2scheds == 9) { + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;// anaake release_harq(eNB,UE_id,0,frame,subframe,0xffff); release_harq(eNB,UE_id,1,frame,subframe,0xffff); } diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 90ba1ec804..20682a57be 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -3426,6 +3426,7 @@ int main(int argc, char **argv) re_allocated = dlsch_modulation(eNB, eNB->common_vars.txdataF[eNB_id], AMP, + frame, subframe, num_pdcch_symbols, ((TB0_active == 1)? eNB->dlsch[k][0]: NULL), diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c index 3c4b3d0cd3..e1385e68f1 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm7.c @@ -2679,6 +2679,7 @@ PMI_FEEDBACK: re_allocated = dlsch_modulation(eNB, eNB->common_vars.txdataF[eNB_id], AMP, + frame, subframe, num_pdcch_symbols, eNB->dlsch[k][0], diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 884efc4433..fbf2c4316e 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -1094,9 +1094,9 @@ typedef struct eNB_MAC_INST_s { nfapi_ul_config_request_t UL_req_tmp[MAX_NUM_CCs][10]; /// Preallocated HI_DCI0 pdu list nfapi_hi_dci0_request_pdu_t - hi_dci0_pdu_list[MAX_NUM_CCs][MAX_NUM_HI_DCI0_PDU]; + hi_dci0_pdu_list[MAX_NUM_CCs][10][MAX_NUM_HI_DCI0_PDU]; /// NFAPI HI/DCI0 Config Request Structure - nfapi_hi_dci0_request_t HI_DCI0_req[MAX_NUM_CCs]; + nfapi_hi_dci0_request_t HI_DCI0_req[MAX_NUM_CCs][10]; /// Prealocated TX pdu list nfapi_tx_request_pdu_t tx_request_pdu[MAX_NUM_CCs][MAX_NUM_TX_REQUEST_PDU]; diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index b307db29b7..adf81a3f92 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -573,7 +573,7 @@ clear_nfapi_information(eNB_MAC_INST * eNB, int CC_idP, { nfapi_dl_config_request_t *DL_req = &eNB->DL_req[0]; nfapi_ul_config_request_t *UL_req = &eNB->UL_req[0]; - nfapi_hi_dci0_request_t *HI_DCI0_req = &eNB->HI_DCI0_req[0]; + nfapi_hi_dci0_request_t *HI_DCI0_req = &eNB->HI_DCI0_req[0][subframeP]; nfapi_tx_request_t *TX_req = &eNB->TX_req[0]; eNB->pdu_index[CC_idP] = 0; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 3fd7504a8e..f14cce1707 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -106,10 +106,10 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP, nfapi_ul_config_request_t *ul_req; nfapi_ul_config_request_body_t *ul_req_body; nfapi_ul_config_request_pdu_t *ul_config_pdu; - nfapi_hi_dci0_request_t *hi_dci0_req = &mac->HI_DCI0_req[CC_id]; - nfapi_hi_dci0_request_body_t *hi_dci0_req_body = &hi_dci0_req->hi_dci0_request_body; + nfapi_hi_dci0_request_t *hi_dci0_req; + nfapi_hi_dci0_request_body_t *hi_dci0_req_body; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu; - + uint8_t sf_ahead_dl; uint8_t rvseq[4] = { 0, 2, 3, 1 }; @@ -234,6 +234,9 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP, LOG_D(MAC, "MSG3: UL_CONFIG SFN/SF:%d number_of_pdus:%d ra->msg3_round:%d\n", NFAPI_SFNSF2DEC(ul_req->sfn_sf), ul_req_body->number_of_pdus, ra->msg3_round); if (ra->msg3_round != 0) { // program HI too + sf_ahead_dl = ul_subframe2_k_phich(cc, subframeP); + hi_dci0_req = &mac->HI_DCI0_req[CC_id][(subframeP+sf_ahead_dl)%10]; + hi_dci0_req_body = &hi_dci0_req->hi_dci0_request_body; hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci + hi_dci0_req_body->number_of_hi]; memset((void *) hi_dci0_pdu, 0, sizeof(nfapi_hi_dci0_request_pdu_t)); @@ -249,7 +252,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP, hi_dci0_req_body->sfnsf = sfnsf_add_subframe(ra->Msg3_frame, ra->Msg3_subframe, 0); hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG; - hi_dci0_req->sfn_sf = sfnsf_add_subframe(ra->Msg3_frame, ra->Msg3_subframe, 4); + hi_dci0_req->sfn_sf = hi_dci0_req->sfn_sf = sfnsf_add_subframe(frameP, subframeP, sf_ahead_dl); hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST; if (nfapi_mode) { @@ -307,7 +310,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP, LOG_D(MAC,"absSF:%d absSF_Msg2:%d ra->rach_resource_type:%d\n",absSF,absSF_Msg2,ra->rach_resource_type); - if (absSF > absSF_Msg2) + if (absSF < absSF_Msg2) return; // we're not ready yet, need to be to start == if (cc[CC_idP].radioResourceConfigCommon_BR) { @@ -851,7 +854,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, // set HARQ process round to 0 for this UE if (cc->tdd_Config) - ra->harq_pid = ((frameP * 10) + subframeP) % 10; + ra->harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); else ra->harq_pid = ((frameP * 10) + subframeP) & 7; @@ -1298,10 +1301,8 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, "Frame %d, Subframe %d: Preparing for Msg4 retransmission currently %d.%d\n", frameP, subframeP, ra->Msg4_frame, ra->Msg4_subframe); - if (ra->Msg4_subframe > 1) - ra->Msg4_frame++; - ra->Msg4_frame &= 1023; - ra->Msg4_subframe = (ra->Msg4_subframe + 8) % 10; + get_retransmission_timing(mac->common_channels[CC_idP].tdd_Config,&ra->Msg4_frame,&ra->Msg4_subframe); + LOG_D(MAC, "Frame %d, Subframe %d: Msg4 retransmission in %d.%d\n", frameP, subframeP, ra->Msg4_frame, @@ -1310,7 +1311,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, // put HARQ process round to 0 if (cc->tdd_Config) - ra->harq_pid = ((frameP * 10) + subframeP) % 10; + ra->harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); else ra->harq_pid = ((frameP * 10) + subframeP) & 7; UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid] = @@ -1592,10 +1593,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP, dci_dl_pdu_rel8.cce_idx); // prepare frame for retransmission - if (ra->Msg4_subframe > 1) - ra->Msg4_frame++; - ra->Msg4_frame &= 1023; - ra->Msg4_subframe = (ra->Msg4_subframe + 8) % 10; + get_retransmission_timing(mac->common_channels[CC_idP].tdd_Config,&ra->Msg4_frame,&ra->Msg4_subframe); 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 in %d.%d)\n", @@ -1645,7 +1643,7 @@ schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) if (ra->state == MSG2) generate_Msg2(module_idP, CC_id, frameP, subframeP, ra); - else if (ra->state == MSG4) + else if (ra->state == MSG4 && ra->Msg4_frame == frameP && ra->Msg4_subframe == subframeP ) generate_Msg4(module_idP, CC_id, frameP, subframeP, ra); else if (ra->state == WAITMSG4ACK) check_Msg4_retransmission(module_idP, CC_id, frameP, @@ -1729,11 +1727,21 @@ initiate_ra_proc(module_id_t module_idP, ra[i].msg4_mpdcch_repetition_cnt = 0; #endif - // DJP - this is because VNF is 2 subframes ahead of PNF and TX needs 4 subframes - if (nfapi_mode) - offset = 7; - else - offset = 5; + + //TODO Fill in other TDD config. What about nfapi_mode? + if(cc->tdd_Config!=NULL){ + switch(cc->tdd_Config->subframeAssignment){ + case 1 : + offset = 6; + break; + } + }else{//FDD + // DJP - this is because VNF is 2 subframes ahead of PNF and TX needs 4 subframes + if (nfapi_mode) + offset = 7; + else + offset = 5; + } add_subframe(&msg2_frame, &msg2_subframe, offset); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 05dbd76d14..bed93bbde5 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -499,8 +499,7 @@ schedule_ue_spec(module_id_t module_idP, break; case 6: case 7: - if ((tdd_sfa != 1) && (tdd_sfa != 2) && (tdd_sfa != 4) - && (tdd_sfa != 5)) + if ((tdd_sfa != 3)&& (tdd_sfa != 4) && (tdd_sfa != 5)) return; break; case 8: @@ -509,8 +508,7 @@ schedule_ue_spec(module_id_t module_idP, return; break; case 9: - if ((tdd_sfa != 1) && (tdd_sfa != 3) && (tdd_sfa != 4) - && (tdd_sfa != 6)) + if (tdd_sfa == 0) return; break; @@ -690,7 +688,7 @@ schedule_ue_spec(module_id_t module_idP, nb_available_rb = ue_sched_ctl->pre_nb_available_rbs[CC_id]; if (cc->tdd_Config) - harq_pid = ((frameP * 10) + subframeP) % 10; + harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); else harq_pid = ((frameP * 10) + subframeP) & 7; @@ -758,7 +756,7 @@ schedule_ue_spec(module_id_t module_idP, UE_list->UE_template[CC_id][UE_id].DAI++; update_ul_dci(module_idP, CC_id, rnti, UE_list->UE_template[CC_id][UE_id]. - DAI); + DAI,subframeP); LOG_D(MAC, "DAI update: CC_id %d subframeP %d: UE %d, DAI %d\n", CC_id, subframeP, UE_id, @@ -1389,7 +1387,7 @@ schedule_ue_spec(module_id_t module_idP, if (cc[CC_id].tdd_Config != NULL) { // TDD UE_list->UE_template[CC_id][UE_id].DAI++; - update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI); + update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI,subframeP); } // do PUCCH power control @@ -1609,7 +1607,7 @@ fill_DLSCH_dci( // clear scheduling flag eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_WAITING; rnti = UE_RNTI(module_idP,UE_id); - if (cc->tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; + if (cc->tdd_Config) harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); else harq_pid = ((frameP*10)+subframeP)&7; nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; @@ -1691,12 +1689,12 @@ unsigned char *get_dlsch_sdu(module_id_t module_idP, //------------------------------------------------------------------------------ void update_ul_dci(module_id_t module_idP, - uint8_t CC_idP, rnti_t rntiP, uint8_t daiP) + uint8_t CC_idP, rnti_t rntiP, uint8_t daiP, sub_frame_t subframe) //------------------------------------------------------------------------------ { nfapi_hi_dci0_request_t *HI_DCI0_req = - &RC.mac[module_idP]->HI_DCI0_req[CC_idP]; + &RC.mac[module_idP]->HI_DCI0_req[CC_idP][subframe]; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list[0]; COMMON_channels_t *cc = &RC.mac[module_idP]->common_channels[CC_idP]; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 17bd5398d9..1d6c60c5df 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -60,6 +60,7 @@ #define ENABLE_MAC_PAYLOAD_DEBUG #define DEBUG_eNB_SCHEDULER 1 +extern uint16_t frame_cnt; int choose(int n, int k) { @@ -579,6 +580,32 @@ int is_UL_sf(COMMON_channels_t * ccP, sub_frame_t subframeP) } } +uint8_t ul_subframe2_k_phich(COMMON_channels_t * cc, sub_frame_t ul_subframe){ + + if(cc->tdd_Config){//TODO fill other tdd config + switch(cc->tdd_Config->subframeAssignment){ + case 0: + break; + case 1: + if(ul_subframe == 2 || ul_subframe == 7) + return 4; + else if(ul_subframe == 3 || ul_subframe == 8) + return 6; + else return 255; + break; + case 2: + break; + case 3: + break; + case 4: + break; + case 5: + break; + } + } + return 4; //idk sf_ahead? +} + uint16_t get_pucch1_absSF(COMMON_channels_t * cc, uint16_t dlsch_absSF) { uint16_t sf, f, nextf; @@ -592,40 +619,52 @@ uint16_t get_pucch1_absSF(COMMON_channels_t * cc, uint16_t dlsch_absSF) switch (cc->tdd_Config->subframeAssignment) { case 0: - AssertFatal(1 == 0, "SFA 0 to be filled in now, :-)\n"); + if ((sf == 0) || (sf == 5)) + return ((10 * f) + sf + 4)% 10240; // ACK/NAK in SF 4,9 same frame + else if (sf == 6) + return ((10 * nextf) + 2)% 10240; // ACK/NAK in SF 2 next frame + else if (sf == 1) + return ((10 * f) + 7)% 10240; // ACK/NAK in SF 7 same frame + else + AssertFatal(1 == 0, + "Impossible dlsch subframe %d for TDD configuration 0\n", + sf); + break; case 1: if ((sf == 5) || (sf == 6)) - return ((10 * nextf) + 2); // ACK/NAK in SF 2 next frame + return ((10 * nextf) + 2)% 10240; // ACK/NAK in SF 2 next frame else if (sf == 9) - return ((10 * nextf) + 3); // ACK/NAK in SF 3 next frame + return ((10 * nextf) + 3)% 10240; // ACK/NAK in SF 3 next frame else if ((sf == 0) || (sf == 1)) - return ((10 * f) + 2); // ACK/NAK in SF 7 same frame + return ((10 * f) + 7)% 10240; // ACK/NAK in SF 7 same frame + else if (sf == 4) + return ((10 * f) + 8)% 10240; // ACK/NAK in SF 8 same frame else AssertFatal(1 == 0, - "Impossible dlsch subframe %d for TDD configuration 3\n", + "Impossible dlsch subframe %d for TDD configuration 1\n", sf); break; case 2: if ((sf == 4) || (sf == 5) || (sf == 6) || (sf == 8)) - return ((10 * nextf) + 2); // ACK/NAK in SF 2 next frame + return ((10 * nextf) + 2)% 10240; // ACK/NAK in SF 2 next frame else if (sf == 9) - return ((10 * nextf) + 7); // ACK/NAK in SF 7 next frame + return ((10 * nextf) + 7)% 10240; // ACK/NAK in SF 7 next frame else if ((sf == 0) || (sf == 1) || (sf == 3)) - return ((10 * f) + 7); // ACK/NAK in SF 7 same frame + return ((10 * f) + 7)% 10240; // ACK/NAK in SF 7 same frame else AssertFatal(1 == 0, - "Impossible dlsch subframe %d for TDD configuration 3\n", + "Impossible dlsch subframe %d for TDD configuration 2\n", sf); break; case 3: if ((sf == 5) || (sf == 6) || (sf == 7) || (sf == 8) || (sf == 9)) - return ((10 * nextf) + (sf >> 1)); // ACK/NAK in 2,3,4 resp. next frame + return ((10 * nextf) + ((sf-1) >> 1))% 10240; // ACK/NAK in 2,3,4 resp. next frame else if (sf == 1) - return ((10 * nextf) + 2); // ACK/NAK in 2 next frame + return ((10 * nextf) + 2)% 10240; // ACK/NAK in 2 next frame else if (sf == 0) - return ((10 * f) + 4); // ACK/NAK in 4 same frame + return ((10 * f) + 4)% 10240; // ACK/NAK in 4 same frame else AssertFatal(1 == 0, "Impossible dlsch subframe %d for TDD configuration 3\n", @@ -653,7 +692,16 @@ uint16_t get_pucch1_absSF(COMMON_channels_t * cc, uint16_t dlsch_absSF) sf); break; case 6: - AssertFatal(1 == 0, "SFA 6 To be filled in now, :-)\n"); + if ((sf == 5) || (sf == 6)) + return ((10 * f) + sf + 7)% 10240; // ACK/NAK in SF 2,3 next frame + else if (sf == 9) + return ((10 * nextf) + 4)% 10240; // ACK/NAK in SF 4 next frame + else if ((sf == 1) || (sf == 0)) + return ((10 * f) + sf + 7)% 10240; // ACK/NAK in SF 7 same frame + else + AssertFatal(1 == 0, + "Impossible dlsch subframe %d for TDD configuration 6\n", + sf); break; default: AssertFatal(1 == 0, "Illegal TDD subframe Assigment %d\n", @@ -1228,7 +1276,7 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP, if (ulsch_harq_information) fill_nfapi_ulsch_harq_information(module_idP, CC_idP, - rnti, ulsch_harq_information); + rnti, ulsch_harq_information,subframeP); if (harq_information) fill_nfapi_harq_information(module_idP, CC_idP, @@ -1237,10 +1285,10 @@ program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP, harq_information, cce_idx); } -uint8_t get_V_UL_DAI(module_id_t module_idP, int CC_idP, uint16_t rntiP) +uint8_t get_V_UL_DAI(module_id_t module_idP, int CC_idP, uint16_t rntiP,sub_frame_t subframeP) { nfapi_hi_dci0_request_body_t *HI_DCI0_req = - &RC.mac[module_idP]->HI_DCI0_req[CC_idP].hi_dci0_request_body; + &RC.mac[module_idP]->HI_DCI0_req[CC_idP][subframeP].hi_dci0_request_body; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[0]; @@ -1258,7 +1306,8 @@ fill_nfapi_ulsch_harq_information(module_id_t module_idP, int CC_idP, uint16_t rntiP, nfapi_ul_config_ulsch_harq_information - * harq_information) + * harq_information, + sub_frame_t subframeP) { eNB_MAC_INST *eNB = RC.mac[module_idP]; COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; @@ -1318,7 +1367,7 @@ fill_nfapi_ulsch_harq_information(module_id_t module_idP, if (harq_information->harq_information_rel10.ack_nack_mode == 1) harq_information->harq_information_rel10.harq_size = - get_V_UL_DAI(module_idP, CC_idP, rntiP); + get_V_UL_DAI(module_idP, CC_idP, rntiP,subframeP); else harq_information->harq_information_rel10.harq_size = 1; } @@ -1330,7 +1379,7 @@ fill_nfapi_ulsch_harq_information(module_id_t module_idP, if (harq_information->harq_information_rel10.ack_nack_mode == 1) harq_information->harq_information_rel10.harq_size = - get_V_UL_DAI(module_idP, CC_idP, rntiP); + get_V_UL_DAI(module_idP, CC_idP, rntiP,subframeP); else harq_information->harq_information_rel10.harq_size = 2; } @@ -3110,7 +3159,7 @@ allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, nfapi_dl_config_request_body_t *DL_req = &RC.mac[module_idP]->DL_req[CC_idP].dl_config_request_body; nfapi_hi_dci0_request_body_t *HI_DCI0_req = - &RC.mac[module_idP]->HI_DCI0_req[CC_idP].hi_dci0_request_body; + &RC.mac[module_idP]->HI_DCI0_req[CC_idP][subframeP].hi_dci0_request_body; nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req->dl_config_pdu_list[0]; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = @@ -3575,7 +3624,7 @@ CCE_allocation_infeasible(int module_idP, nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req->dl_config_pdu_list[DL_req->number_pdu]; nfapi_hi_dci0_request_body_t *HI_DCI0_req = - &RC.mac[module_idP]->HI_DCI0_req[CC_idP].hi_dci0_request_body; + &RC.mac[module_idP]->HI_DCI0_req[CC_idP][subframe].hi_dci0_request_body; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi]; @@ -3630,6 +3679,73 @@ CCE_allocation_infeasible(int module_idP, return res; } +void get_retransmission_timing(TDD_Config_t *tdd_Config, frame_t *frameP, + sub_frame_t *subframeP) +{ + + if (tdd_Config == NULL) + { + if (*subframeP > 1) + *frameP = (*frameP + 1) % 1024; + *subframeP = (*subframeP + 8) % 10; + } + else + { + switch (tdd_Config->subframeAssignment)//TODO fill in other TDD configs + { + case 1: + if (*subframeP == 0 || *subframeP == 5) + { + *subframeP += 19; + *frameP = (*frameP + *subframeP/10) % 1024; + *subframeP %= 10; + } + else if (*subframeP == 4 || *subframeP == 9) + { + *subframeP += 16; + *frameP = (*frameP + *subframeP/10) % 1024; + *subframeP %= 10; + } + else + { + AssertFatal(2 == 1, + "Illegal dl subframe %d for tdd config %d\n", *subframeP, + tdd_Config->subframeAssignment); + } + break; + } + } +} + +uint8_t get_dl_subframe_count(int tdd_config_sfa, sub_frame_t subframeP){ + + uint8_t tdd1[10] = {1,-1,-1,-1,2,3,-1,-1,-1,4}; // special subframes 1,6 are excluded + + switch(tdd_config_sfa){// TODO fill in other tdd configs + case 1 : + return tdd1[subframeP]; + break; + } + return -1; +} + +uint8_t frame_subframe2_dl_harq_pid(TDD_Config_t *tdd_Config, int abs_frameP, sub_frame_t subframeP){ + int harq_pid; + if(tdd_Config){ + + switch(tdd_Config->subframeAssignment){ //TODO fill in other tdd config + case 1: + harq_pid = ((frame_cnt*1024 + abs_frameP) * 4 + get_dl_subframe_count(tdd_Config->subframeAssignment,subframeP))%7;//4 dl subframe in a frame + LOG_I(MAC,"[frame_subframe2_dl_harq_pid] (%d,%d) calculate harq_pid (( %d * 1024 + %d) *4 + %d)%7 = %d \n", + (abs_frameP+1024)%1024,subframeP,frame_cnt,abs_frameP, + get_dl_subframe_count(tdd_Config->subframeAssignment,subframeP),harq_pid); + return harq_pid; + break; + } + } + return -1; +} + void extract_harq(module_id_t mod_idP, int CC_idP, int UE_id, @@ -3647,8 +3763,12 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id, int pCCid = UE_list->pCC_id[UE_id]; int spatial_bundling = 0; int tmode[5]; - int i, j; + int i, j, m; uint8_t *pdu; + LTE_DL_FRAME_PARMS *fp; + sub_frame_t subframe_tx; + int frame_tx; + uint8_t harq_pid; #ifdef Rel14 if (UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated != NULL && @@ -3668,22 +3788,37 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id, && (format == 1)))) spatial_bundling = 1; #endif - + fp=&(RC.eNB[mod_idP][CC_idP]->frame_parms); for (i = 0; i < numCC; i++) tmode[i] = get_tmode(mod_idP, i, UE_id); if (cc->tdd_Config) { - harq_indication_tdd = - (nfapi_harq_indication_tdd_rel13_t *) harq_indication; + harq_indication_tdd = (nfapi_harq_indication_tdd_rel13_t *) harq_indication; // pdu = &harq_indication_tdd->harq_tb_n[0]; num_ack_nak = harq_indication_tdd->number_of_ack_nack; switch (harq_indication_tdd->mode) { - case 0: // Format 1a/b - AssertFatal(numCC == 1, - "numCC %d > 1, should not be using Format1a/b\n", - numCC); + case 0: // Format 1a/b bundling + AssertFatal(numCC == 1, "numCC %d > 1, should not be using Format1a/b\n", numCC); + int M = ul_ACK_subframe2_M(fp,subframeP); + for(m=0;m5) + frame_tx= -1; + else + frame_tx = subframeP < 5 ? frameP-1:frameP; // not formal + harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame_tx,subframe_tx); + if(num_ack_nak==1){ + if(harq_indication_tdd->harq_data[0].bundling.value_0==1){ //ack + sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process + sched_ctl->tbcnt[CC_idP][harq_pid] = 0; + }else{ //nack + if( sched_ctl->round[CC_idP][harq_pid]<8) + sched_ctl->round[CC_idP][harq_pid]++; + } + } + } break; case 1: // Channel Selection break; @@ -3700,7 +3835,7 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id, num_ack_nak = harq_indication_fdd->number_of_ack_nack; pdu = &harq_indication_fdd->harq_tb_n[0]; - uint8_t harq_pid = ((10 * frameP) + subframeP + 10236) & 7; + harq_pid = ((10 * frameP) + subframeP + 10236) & 7; LOG_D(MAC,"frame %d subframe %d harq_pid %d mode %d tmode[0] %d num_ack_nak %d round %d\n",frameP,subframeP,harq_pid,harq_indication_fdd->mode,tmode[0],num_ack_nak,sched_ctl->round[CC_idP][harq_pid]); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index fc08dd585f..09c7bc84e2 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -216,8 +216,9 @@ rx_sdu(const module_id_t enb_mod_idP, first_rb_ul[harq_pid]; ra[RA_id].msg3_round++; // prepare handling of retransmission - ra[RA_id].Msg3_frame = (ra[RA_id].Msg3_frame + ((ra[RA_id].Msg3_subframe > 1) ? 1 : 0)) % 1024; - ra[RA_id].Msg3_subframe = (ra[RA_id].Msg3_subframe + 8) % 10; + get_Msg3allocret(&mac->common_channels[CC_idP], + ra[RA_id].Msg3_subframe, ra[RA_id].Msg3_frame, + &ra[RA_id].Msg3_frame, &ra[RA_id].Msg3_subframe); add_msg3(enb_mod_idP, CC_idP, &ra[RA_id], frameP, subframeP); } @@ -659,9 +660,15 @@ rx_sdu(const module_id_t enb_mod_idP, + if(mac->common_channels[CC_idP].tdd_Config!=NULL){ + ra->Msg4_frame = frameP + ((subframeP > 2) ? 1 : 0); + ra->Msg4_subframe = (subframeP + 7) % 10; // TODO need to be complete for other tdd configs. + }else{ // Program Msg4 PDCCH+DLSCH/MPDCCH transmission 4 subframes from now, // Check if this is ok for BL/CE, or if the rule is different - ra->Msg4_frame = frameP + ((subframeP > 5) ? 1 : 0); - ra->Msg4_subframe = (subframeP + 4) % 10; + ra->Msg4_frame = frameP + ((subframeP > 5) ? 1 : 0); + ra->Msg4_subframe = (subframeP + 4) % 10; + } + UE_list->UE_sched_ctrl[UE_id].crnti_reconfigurationcomplete_flag = 0; } // if process is active } // loop on RA processes @@ -793,7 +800,10 @@ rx_sdu(const module_id_t enb_mod_idP, LOG_D(MAC, "Programming PHICH ACK for rnti %x harq_pid %d (first_rb %d)\n", current_rnti, harq_pid, first_rb); - nfapi_hi_dci0_request_t *hi_dci0_req = &mac->HI_DCI0_req[CC_idP]; + nfapi_hi_dci0_request_t *hi_dci0_req; + uint8_t sf_ahead_dl = ul_subframe2_k_phich(&mac->common_channels[CC_idP] , subframeP); + hi_dci0_req = &mac->HI_DCI0_req[CC_idP][(subframeP+sf_ahead_dl)%10]; + nfapi_hi_dci0_request_body_t *hi_dci0_req_body = &hi_dci0_req->hi_dci0_request_body; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci + hi_dci0_req_body->number_of_hi]; @@ -807,7 +817,7 @@ rx_sdu(const module_id_t enb_mod_idP, hi_dci0_req_body->number_of_hi++; hi_dci0_req_body->sfnsf = sfnsf_add_subframe(frameP,subframeP, 0); hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG; - hi_dci0_req->sfn_sf = sfnsf_add_subframe(frameP,subframeP, 4); + hi_dci0_req->sfn_sf = sfnsf_add_subframe(frameP,subframeP,sf_ahead_dl); hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST; /* NN--> FK: we could either check the payload, or use a phy helper to detect a false msg3 */ @@ -1002,10 +1012,8 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, if ((tdd_sfa==0)|| (tdd_sfa==1)) sched_subframe = 7; else if (tdd_sfa==6) sched_subframe = 8; + else return; break; - default: - return; - case 2: // Don't schedule UL in subframe 2 for TDD return; case 3: @@ -1029,7 +1037,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, case 7: return; case 8: - if ((tdd_sfa>=2) || (tdd_sfa<=5)) sched_subframe=2; + if ((tdd_sfa>=2) && (tdd_sfa<=5)) sched_subframe=2; else return; break; case 9: @@ -1153,7 +1161,7 @@ schedule_ulsch_rnti(module_id_t module_idP, if (sched_subframeP < subframeP) sched_frame++; - nfapi_hi_dci0_request_t *hi_dci0_req = &mac->HI_DCI0_req[CC_id]; + nfapi_hi_dci0_request_t *hi_dci0_req = &mac->HI_DCI0_req[CC_id][subframeP]; nfapi_hi_dci0_request_body_t *hi_dci0_req_body = &hi_dci0_req->hi_dci0_request_body; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu; @@ -1465,7 +1473,7 @@ schedule_ulsch_rnti(module_id_t module_idP, UE_template->DAI_ul[sched_subframeP]; hi_dci0_req_body->number_of_dci++; - hi_dci0_req_body->sfnsf = sfnsf_add_subframe(frameP, subframeP, 4); + hi_dci0_req_body->sfnsf = sfnsf_add_subframe(sched_frame, sched_subframeP, 0); //(frameP, subframeP, 4) hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG; hi_dci0_req->sfn_sf = frameP<<4|subframeP; // sfnsf_add_subframe(sched_frame, sched_subframeP, 0); // sunday! @@ -1661,23 +1669,28 @@ void schedule_ulsch_rnti(module_id_t module_idP, if (sched_subframeP < subframeP) sched_frame++; - nfapi_hi_dci0_request_body_t *hi_dci0_req = &eNB->HI_DCI0_req[module_idP].hi_dci0_request_body; + nfapi_hi_dci0_request_body_t *hi_dci0_req; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu; - nfapi_ul_config_request_body_t *ul_req_tmp = &eNB->UL_req_tmp[module_idP][sched_subframeP].ul_config_request_body; + nfapi_ul_config_request_body_t *ul_req_tmp; LOG_D(MAC,"entering ulsch preprocesor\n"); ulsch_scheduler_pre_processor(module_idP, frameP, subframeP, + sched_subframeP, ulsch_ue_select); LOG_D(MAC,"exiting ulsch preprocesor\n"); - eNB->HI_DCI0_req[module_idP].sfn_sf = (frameP<<4)+subframeP; + // loop over all active UEs for (CC_id=0; CC_idHI_DCI0_req[CC_id][subframeP].hi_dci0_request_body; + eNB->HI_DCI0_req[CC_id][subframeP].sfn_sf = (frameP<<4)+subframeP; + ul_req_tmp = &eNB->UL_req_tmp[CC_id][sched_subframeP].ul_config_request_body; + ULSCH_first_end = 0; cc = &eNB->common_channels[CC_id]; // This is the actual CC_id in the list @@ -1827,7 +1840,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, // save it for a potential retransmission UE_template->cshift[harq_pid] = cshift; - hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci+eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi]; + hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE; hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_dci_pdu); @@ -1845,7 +1858,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = cqi_req; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframeP]; - eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci++; + hi_dci0_req->number_of_dci++; LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP); @@ -1941,7 +1954,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, // Cyclic shift for DM RS cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1) - hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci+eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi]; + hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_DCI_PDU_TYPE; hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_dci_pdu); @@ -1959,7 +1972,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = cqi_req; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframeP]; - eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci++; + hi_dci0_req->number_of_dci++; // fill in NAK information hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]; memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t)); diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c index 3a491bd7ea..bf1db6c613 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c @@ -1277,7 +1277,7 @@ flexran_schedule_ue_spec_common(mid_t mod_id, PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD) { UE_list->UE_template[CC_id][UE_id].DAI++; update_ul_dci(mod_id, CC_id, rnti, - UE_list->UE_template[CC_id][UE_id].DAI); + UE_list->UE_template[CC_id][UE_id].DAI,subframe); LOG_D(MAC, "DAI update: CC_id %d subframeP %d: UE %d, DAI %d\n", CC_id, subframe, UE_id, @@ -1642,7 +1642,7 @@ flexran_schedule_ue_spec_common(mid_t mod_id, //#warning only for 5MHz channel update_ul_dci(mod_id, CC_id, rnti, UE_list->UE_template[CC_id][UE_id]. - DAI); + DAI,frame); } // do PUCCH power control // this is the normalized RX power diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index 2ad3e6a038..b067d87cd4 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -158,9 +158,10 @@ void mac_top_init_eNB(void) RC.mac[i]->UL_req_tmp[j][k]. ul_config_request_body.ul_config_pdu_list = RC.mac[i]->ul_config_pdu_list_tmp[j][k]; - RC.mac[i]->HI_DCI0_req[j]. - hi_dci0_request_body.hi_dci0_pdu_list = - RC.mac[i]->hi_dci0_pdu_list[j]; + for(int sf=0;sf<10;sf++){ + RC.mac[i]->HI_DCI0_req[j][sf].hi_dci0_request_body.hi_dci0_pdu_list =RC.mac[i]->hi_dci0_pdu_list[j][sf]; + } + RC.mac[i]->TX_req[j].tx_request_body.tx_pdu_list = RC.mac[i]->tx_request_pdu[j]; RC.mac[i]->ul_handle = 0; diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 49cdbb1769..ae4f9b8112 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -300,7 +300,7 @@ maxround(module_id_t Mod_id, uint16_t rnti, int frame, UE_id = find_UE_id(Mod_id, rnti); if (cc->tdd_Config) - harq_pid = ((frame * 10) + subframe) % 10; + harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame ,subframe); else harq_pid = ((frame * 10) + subframe) & 7; @@ -1128,7 +1128,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, rnti = dlsch_ue_select[CC_id].list[i].rnti; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; - if (cc->tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; + if (cc->tdd_Config) harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); else harq_pid = ((frameP*10)+subframeP)&7; Round = ue_sched_ctl->round[CC_id][harq_pid]; @@ -1866,6 +1866,7 @@ dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id, void ulsch_scheduler_pre_processor(module_id_t module_idP, int frameP, sub_frame_t subframeP, + unsigned char sched_subframeP, uint16_t *first_rb) { @@ -1997,7 +1998,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, harq_pid = subframe2harqpid(&RC.mac[module_idP]-> common_channels[CC_id], frameP, - subframeP); + sched_subframeP); // mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL); @@ -2396,6 +2397,7 @@ void ulsch_scheduler_pre_ue_select( module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, + sub_frame_t sched_subframeP, ULSCH_UE_SELECT ulsch_ue_select[MAX_NUM_CCs]) { eNB_MAC_INST *eNB=RC.mac[module_idP]; @@ -2426,7 +2428,7 @@ void ulsch_scheduler_pre_ue_select( for ( CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++ ) { //save ulsch dci number - saved_ulsch_dci[CC_id] = eNB->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_dci; + saved_ulsch_dci[CC_id] = eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body.number_of_dci; // maximum multiplicity number ulsch_ue_max_num[CC_id] =RC.rrc[module_idP]->configuration.ue_multiple_max[CC_id]; @@ -2452,7 +2454,7 @@ void ulsch_scheduler_pre_ue_select( continue; // UL DCI - HI_DCI0_req = &eNB->HI_DCI0_req[CC_id].hi_dci0_request_body; + HI_DCI0_req = &eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body; if ( (ulsch_ue_select[CC_id].ue_num >= ulsch_ue_max_num[CC_id]) || (cc_id_flag[CC_id] == 1) ) { cc_id_flag[CC_id] = 1; HI_DCI0_req->number_of_dci = saved_ulsch_dci[CC_id]; @@ -2467,7 +2469,7 @@ void ulsch_scheduler_pre_ue_select( cc = &eNB->common_channels[CC_id]; //harq_pid - harq_pid = subframe2harqpid(cc,(frameP+(subframeP>=6 ? 1 : 0)),((subframeP+4)%10)); + harq_pid = subframe2harqpid(cc,(frameP+(sched_subframePUE_sched_ctrl[UE_id].round_UL[CC_id][harq_pid]; @@ -2519,7 +2521,7 @@ void ulsch_scheduler_pre_ue_select( } for ( CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++ ) { - HI_DCI0_req = &eNB->HI_DCI0_req[CC_id].hi_dci0_request_body; + HI_DCI0_req = &eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body; for ( int temp = 0; temp < ue_first_num[CC_id]; temp++ ) { if ( (ulsch_ue_select[CC_id].ue_num >= ulsch_ue_max_num[CC_id]) || (cc_id_flag[CC_id] == 1) ) { cc_id_flag[CC_id] = 1; @@ -2586,7 +2588,7 @@ void ulsch_scheduler_pre_ue_select( if(i < ulsch_ue_select[CC_id].ue_num) continue; - HI_DCI0_req = &eNB->HI_DCI0_req[CC_id].hi_dci0_request_body; + HI_DCI0_req = &eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body; //SR BSR if ( (UE_list->UE_template[CC_id][UE_id].ul_total_buffer > 0) || (UE_list->UE_template[CC_id][UE_id].ul_SR > 0) ) { hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi]; @@ -2623,10 +2625,10 @@ void ulsch_scheduler_pre_ue_select( } for ( CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++ ) { - HI_DCI0_req = &eNB->HI_DCI0_req[CC_id].hi_dci0_request_body; + HI_DCI0_req = &eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body; for ( int temp = 0; temp < ul_inactivity_num[CC_id]; temp++ ) { if ( (ulsch_ue_select[CC_id].ue_num >= ulsch_ue_max_num[CC_id]) || (cc_id_flag[CC_id] == 1) ) { - HI_DCI0_req = &eNB->HI_DCI0_req[CC_id].hi_dci0_request_body; + HI_DCI0_req = &eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body; cc_id_flag[CC_id] = 1; break; } @@ -2668,6 +2670,7 @@ uint8_t find_rb_table_index(uint8_t average_rbs) void ulsch_scheduler_pre_processor(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, + sub_frame_t sched_subframeP, ULSCH_UE_SELECT ulsch_ue_select[MAX_NUM_CCs]) { int CC_id,ulsch_ue_num; @@ -2687,7 +2690,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, rnti_t rnti; LOG_D(MAC,"In ulsch_preprocessor: ulsch ue select\n"); //ue select - ulsch_scheduler_pre_ue_select(module_idP,frameP,subframeP,ulsch_ue_select); + ulsch_scheduler_pre_ue_select(module_idP,frameP,subframeP,sched_subframeP,ulsch_ue_select); // MCS and RB assgin for ( CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++ ) { diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index d42c8f38dc..dd3c06fc97 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -640,10 +640,10 @@ rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP); uint8_t find_rb_table_index(uint8_t average_rbs); #ifndef UE_EXPANSION -void ulsch_scheduler_pre_processor(module_id_t module_idP, int frameP, sub_frame_t subframeP, uint16_t *first_rb); +void ulsch_scheduler_pre_processor(module_id_t module_idP, int frameP, sub_frame_t subframeP, unsigned char sched_subframeP,uint16_t *first_rb); #else -void ulsch_scheduler_pre_processor(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, ULSCH_UE_SELECT ulsch_ue_select[MAX_NUM_CCs]); -void ulsch_scheduler_pre_ue_select(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP,ULSCH_UE_SELECT ulsch_ue_select[MAX_NUM_CCs]); +void ulsch_scheduler_pre_processor(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, sub_frame_t sched_subframeP,ULSCH_UE_SELECT ulsch_ue_select[MAX_NUM_CCs]); +void ulsch_scheduler_pre_ue_select(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP,sub_frame_t sched_subframeP,ULSCH_UE_SELECT ulsch_ue_select[MAX_NUM_CCs]); #endif void set_ul_DAI( @@ -822,7 +822,7 @@ uint32_t allocate_prbs_sub(int nb_rb, int N_RB_DL, int N_RBG, uint8_t * rballoc); void update_ul_dci(module_id_t module_idP, uint8_t CC_id, rnti_t rnti, - uint8_t dai); + uint8_t dai, sub_frame_t subframe); int get_bw_index(module_id_t module_id, uint8_t CC_id); @@ -1121,7 +1121,8 @@ void fill_nfapi_ulsch_harq_information(module_id_t module_idP, int CC_idP, uint16_t rntiP, nfapi_ul_config_ulsch_harq_information - * harq_information); + * harq_information, + sub_frame_t subframeP); uint16_t fill_nfapi_uci_acknak(module_id_t module_idP, int CC_idP, diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index d0b8e57558..6152e439eb 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -17,7 +17,7 @@ extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind); extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind); extern uint8_t nfapi_mode; extern uint16_t sf_ahead; - +uint16_t frame_cnt=0; void handle_rach(UL_IND_t *UL_info) { int i; @@ -546,6 +546,10 @@ void UL_indication(UL_IND_t *UL_info) UL_info->frame,UL_info->subframe, module_id,CC_id, UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis, UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs); + if(UL_info->frame==1023&&UL_info->subframe==6){ // dl scheduling 0,0 + frame_cnt++; + LOG_D(MAC,"current (%d,%d) frame count dl is %d\n",UL_info->frame,UL_info->subframe,frame_cnt); + } if (nfapi_mode != 1) { @@ -574,7 +578,11 @@ void UL_indication(UL_IND_t *UL_info) handle_harq(UL_info); // clear HI prior to handling ULSCH - mac->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi = 0; + uint8_t sf_ahead_dl = ul_subframe2_k_phich(&mac->common_channels[CC_id] , UL_info->subframe); + if(sf_ahead_dl!=255){ + mac->HI_DCI0_req[CC_id][(UL_info->subframe+sf_ahead_dl)%10].hi_dci0_request_body.number_of_hi = 0; + LOG_D(MAC,"current (%d,%d) clear HI_DCI0_req[0][%d]\n",UL_info->frame,UL_info->subframe,(UL_info->subframe+sf_ahead_dl)%10); + } handle_ulsch(UL_info); @@ -593,9 +601,9 @@ void UL_indication(UL_IND_t *UL_info) sched_info->frame = (UL_info->frame + ((UL_info->subframe>(9-sf_ahead)) ? 1 : 0)) % 1024; sched_info->subframe = (UL_info->subframe+sf_ahead)%10; sched_info->DL_req = &mac->DL_req[CC_id]; - sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id]; + sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id][sched_info->subframe]; if ((mac->common_channels[CC_id].tdd_Config==NULL) || - (is_UL_sf(&mac->common_channels[CC_id],(sched_info->subframe+sf_ahead)%10)>0)) + (is_UL_sf(&mac->common_channels[CC_id],sched_info->subframe)>0)) sched_info->UL_req = &mac->UL_req[CC_id]; else sched_info->UL_req = NULL; From 4387070cda914ac3cd605df46309722d3718066c Mon Sep 17 00:00:00 2001 From: Xu Bo Date: Mon, 5 Feb 2018 17:25:57 +0900 Subject: [PATCH 02/63] fix merge bug --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 09c7bc84e2..ab3f32c83c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1169,7 +1169,7 @@ schedule_ulsch_rnti(module_id_t module_idP, nfapi_ul_config_request_body_t *ul_req_tmp_body = &ul_req_tmp->ul_config_request_body; //LOG_D(MAC, "entering ulsch preprocesor\n"); - ulsch_scheduler_pre_processor(module_idP, frameP, subframeP, first_rb); + ulsch_scheduler_pre_processor(module_idP, frameP, subframeP,sched_subframeP, first_rb); //LOG_D(MAC, "exiting ulsch preprocesor\n"); From 5ece3937d49e11b407a3cf889da3d01a598d513d Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Mon, 5 Feb 2018 17:37:34 +0800 Subject: [PATCH 03/63] CRS only send on first symbol in special subframe config 0 --- openair1/SCHED/phy_procedures_lte_eNb.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 79758c884c..c0662b5b8e 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -149,10 +149,20 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe) { // generate Cell-Specific Reference Signals for both slots VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX,1); - generate_pilots_slot(eNB, - txdataF, - AMP, - subframe<<1,0); + + if(subframe_select(fp,subframe) == SF_S) + generate_pilots_slot(eNB, + txdataF, + AMP, + subframe<<1,1); + else + generate_pilots_slot(eNB, + txdataF, + AMP, + subframe<<1,0); + + // check that 2nd slot is for DL + // check that 2nd slot is for DL if (subframe_select(fp,subframe) == SF_DL) generate_pilots_slot(eNB, From f9f20c7300103a7644cba636b11b393ca05fc659 Mon Sep 17 00:00:00 2001 From: Xu Bo Date: Mon, 5 Feb 2018 20:17:53 +0900 Subject: [PATCH 04/63] allocate_CCEs only called on dl subframes --- openair2/LAYER2/MAC/eNB_scheduler.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index adf81a3f92..176503ca1c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -817,9 +817,10 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, // Allocate CCEs for good after scheduling is done - for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) - allocate_CCEs(module_idP, CC_id, frameP, subframeP, 2); - + for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++){ + if(cc[CC_id].tdd_Config == NULL || !(is_UL_sf(&cc[CC_id],subframeP))) + allocate_CCEs(module_idP, CC_id, frameP, subframeP, 2); +} stop_meas(&RC.mac[module_idP]->eNB_scheduler); From 5c76360c2d831ce2b2394bc0e67e7915492204f4 Mon Sep 17 00:00:00 2001 From: Xu Bo Date: Tue, 6 Feb 2018 11:01:05 +0900 Subject: [PATCH 05/63] Fix special subframe only use 2 symbols to transmit pdcch --- .../LAYER2/MAC/eNB_scheduler_primitives.c | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 1d6c60c5df..7c8794e307 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -580,6 +580,30 @@ int is_UL_sf(COMMON_channels_t * ccP, sub_frame_t subframeP) } } +int is_S_sf(COMMON_channels_t * ccP, sub_frame_t subframeP) +{ + // if FDD return dummy value + if (ccP->tdd_Config == NULL) + return (0); + + switch (subframeP) { + case 1: + return (1); + break; + + case 6: + if(ccP->tdd_Config->subframeAssignment == 0 || ccP->tdd_Config->subframeAssignment == 1 + || ccP->tdd_Config->subframeAssignment == 2 || ccP->tdd_Config->subframeAssignment == 6) + return (1); + break; + + default: + return (0); + break; + } + return 0; +} + uint8_t ul_subframe2_k_phich(COMMON_channels_t * cc, sub_frame_t ul_subframe){ if(cc->tdd_Config){//TODO fill other tdd config @@ -3170,10 +3194,16 @@ allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, int fCCE; int i, j, idci; int nCCE = 0; + int max_symbol; eNB_MAC_INST *eNB = RC.mac[module_idP]; COMMON_channels_t *cc = &eNB->common_channels[CC_idP]; int ackNAK_absSF = get_pucch1_absSF(cc, (frameP*10+subframeP)); + if (cc->tdd_Config!=NULL && is_S_sf(cc,subframeP) > 0) + max_symbol = 2; + else + max_symbol = 3; + nfapi_ul_config_request_body_t *ul_req = &eNB->UL_req_tmp[CC_idP][ackNAK_absSF % 10].ul_config_request_body; LOG_D(MAC, @@ -3203,7 +3233,7 @@ allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, if (nCCE + (dl_config_pdu[i].dci_dl_pdu. dci_dl_pdu_rel8.aggregation_level) > nCCE_max) { - if (DL_req->number_pdcch_ofdm_symbols == 3) + if (DL_req->number_pdcch_ofdm_symbols == max_symbol) goto failed; LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n", @@ -3225,7 +3255,7 @@ allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, dci_dl_pdu.dci_dl_pdu_rel8.rnti, subframeP); if (fCCE == -1) { - if (DL_req->number_pdcch_ofdm_symbols == 3) { + if (DL_req->number_pdcch_ofdm_symbols == max_symbol) { LOG_D(MAC, "subframe %d: Dropping Allocation for RNTI %x\n", subframeP, @@ -3301,7 +3331,7 @@ allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, if (nCCE + (hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level) > nCCE_max) { - if (DL_req->number_pdcch_ofdm_symbols == 3) + if (DL_req->number_pdcch_ofdm_symbols == max_symbol) goto failed; LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n", @@ -3323,7 +3353,7 @@ allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8. rnti, subframeP); if (fCCE == -1) { - if (DL_req->number_pdcch_ofdm_symbols == 3) { + if (DL_req->number_pdcch_ofdm_symbols == max_symbol) { LOG_D(MAC, "subframe %d: Dropping Allocation for RNTI %x\n", subframeP, @@ -3391,7 +3421,7 @@ allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, if (nCCE + (dl_config_pdu[i].dci_dl_pdu. dci_dl_pdu_rel8.aggregation_level) > nCCE_max) { - if (DL_req->number_pdcch_ofdm_symbols == 3) + if (DL_req->number_pdcch_ofdm_symbols == max_symbol) goto failed; LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n", @@ -3414,7 +3444,7 @@ allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, dci_dl_pdu.dci_dl_pdu_rel8.rnti, subframeP); if (fCCE == -1) { - if (DL_req->number_pdcch_ofdm_symbols == 3) { + if (DL_req->number_pdcch_ofdm_symbols == max_symbol) { LOG_I(MAC, "subframe %d: Dropping Allocation for RNTI %x\n", subframeP, From 367e07634722993788a59c3e36f0cbc9fa181a48 Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Tue, 6 Feb 2018 11:58:25 +0800 Subject: [PATCH 06/63] Fix merge bug in return value of ul_ACK_subframe2_dl_frame --- openair1/SCHED/phy_procedures_lte_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c index fc63c12b8e..83ba5b4b97 100644 --- a/openair1/SCHED/phy_procedures_lte_common.c +++ b/openair1/SCHED/phy_procedures_lte_common.c @@ -336,7 +336,7 @@ unsigned char ul_ACK_subframe2_dl_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsig return(0); } -unsigned char ul_ACK_subframe2_dl_frame(LTE_DL_FRAME_PARMS *frame_parms,int frame, unsigned char subframe,unsigned char subframe_tx) +int ul_ACK_subframe2_dl_frame(LTE_DL_FRAME_PARMS *frame_parms,int frame, unsigned char subframe,unsigned char subframe_tx) { if (frame_parms->frame_type == FDD) { From e8300aa944b783061a930af69dd2c74fce4209a9 Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Tue, 6 Feb 2018 16:50:27 +0800 Subject: [PATCH 07/63] Don't use assert since the comment above said it's perfectly possible to have this NULL here. --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 7c8794e307..7fc7733f12 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1446,12 +1446,15 @@ fill_nfapi_harq_information(module_id_t module_idP, case 6: case 7: if (cc->tdd_Config != NULL) { - AssertFatal(UE_list-> - UE_template[CC_idP] - [UE_id].physicalConfigDedicated-> - pucch_ConfigDedicated != NULL, - "pucch_ConfigDedicated is null for TDD!\n"); +// AssertFatal(UE_list-> +// UE_template[CC_idP] +// [UE_id].physicalConfigDedicated-> +// pucch_ConfigDedicated != NULL, +// "pucch_ConfigDedicated is null for TDD!\n"); if ((UE_list-> + UE_template[CC_idP][UE_id].physicalConfigDedicated-> + pucch_ConfigDedicated != NULL) + && (UE_list-> UE_template[CC_idP][UE_id].physicalConfigDedicated-> pucch_ConfigDedicated->tdd_AckNackFeedbackMode != NULL) && (*UE_list-> From 0efa1185f3f7d5612e7cd4147d96bb9e5a2f988f Mon Sep 17 00:00:00 2001 From: naoi Date: Wed, 7 Feb 2018 20:40:06 +0900 Subject: [PATCH 08/63] fix: UE dosen't respond to pdcch order(contention based) --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 10 +++++++++- openair2/LAYER2/MAC/eNB_scheduler.c | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 3c6a5ded2c..ff31507979 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -907,6 +907,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->harq_pid = rel8->harq_process; ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->padding = 0; } else { dci_alloc->dci_length = sizeof_DCI1A_1_5MHz_FDD_t; ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->type = 1; @@ -917,6 +918,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; + ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } break; @@ -931,7 +933,8 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->padding = 0; // printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI1A_5MHz_FDD_t; @@ -943,6 +946,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a ((DCI1A_5MHz_FDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1A_5MHz_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_5MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; + ((DCI1A_5MHz_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } break; @@ -958,6 +962,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->harq_pid = rel8->harq_process; ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->padding = 0; // printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI1A_10MHz_FDD_t; @@ -969,6 +974,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a ((DCI1A_10MHz_FDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1A_10MHz_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_10MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; + ((DCI1A_10MHz_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } break; @@ -984,6 +990,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->harq_pid = rel8->harq_process; ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->padding = 0; // printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI1A_20MHz_FDD_t; @@ -995,6 +1002,7 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a ((DCI1A_20MHz_FDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1A_20MHz_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_20MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; + ((DCI1A_20MHz_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } break; diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index a69a721568..312c49094e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -550,7 +550,8 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id, UE_list->UE_sched_ctrl[UE_id].ul_failure_timer++; // check threshold - if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer > 20000) { + if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer > 4000) { + // note: probably ul_failure_timer is should be less than UE radio link failure time(see T310/N310/N311) // inform RRC of failure and clear timer LOG_I(MAC, "UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n", From 8fffe90dbe875b0dbd59ec0d56f768c038ce5ef2 Mon Sep 17 00:00:00 2001 From: Wu Jing Date: Thu, 8 Feb 2018 02:24:54 +0000 Subject: [PATCH 09/63] fix hundreds_of_ues issue(n1_PUCCH_AN DAI) for TDD cofnig1 --- .../nfapi/public_inc/nfapi_interface.h | 1 + openair1/PHY/LTE_TRANSPORT/dci_tools.c | 9 ++ openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 2 + openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 92 +++++++++++++++---- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 27 +++++- 5 files changed, 111 insertions(+), 20 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h index d5b1ce6af6..282739e315 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h @@ -2218,6 +2218,7 @@ typedef struct { uint8_t dl_assignment_index; uint32_t tpc_bitmap; uint16_t transmission_power; + uint8_t harq_pid; } nfapi_hi_dci0_dci_pdu_rel8_t; #define NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG 0x2020 diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 722341ea65..9f75a87b50 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -2565,6 +2565,8 @@ void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, uint32_t ndi = pdu->dci_pdu_rel8.new_data_indication_1; + uint16_t UE_id = -1; + #ifdef T_TRACER T(T_ENB_PHY_ULSCH_UE_DCI, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(pdu->dci_pdu_rel8.rnti), T_INT(((frame*10+subframe+4) % 8) /* TODO: correct harq pid */), @@ -2710,6 +2712,13 @@ void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, DevParam (frame_parms->N_RB_DL, 0, 0); break; } + + if(frame_parms->frame_type == TDD){ + UE_id = find_ulsch(pdu->dci_pdu_rel8.rnti, eNB,SEARCH_EXIST_OR_FREE); + if(UE_id != -1){ + eNB->ulsch[UE_id]->harq_processes[pdu->dci_pdu_rel8.harq_pid]->V_UL_DAI = dai +1; + } + } } void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index bed93bbde5..bb73f8c8bb 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -338,6 +338,7 @@ set_ul_DAI(int module_idP, int UE_idP, int CC_idP, int frameP, case 1: switch (subframeP) { + case 0: case 1: UE_list->UE_template[CC_idP][UE_idP].DAI_ul[7] = DAI; break; @@ -346,6 +347,7 @@ set_ul_DAI(int module_idP, int UE_idP, int CC_idP, int frameP, UE_list->UE_template[CC_idP][UE_idP].DAI_ul[8] = DAI; break; + case 5: case 6: UE_list->UE_template[CC_idP][UE_idP].DAI_ul[2] = DAI; break; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index ab3f32c83c..2c0524bcb2 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1097,10 +1097,25 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, for (i=0; ira[i].state == WAITMSG3) &&(cc->ra[i].Msg3_subframe == sched_subframe)) { ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].ue_priority = SCH_UL_MSG3; - if(frame_parms->N_RB_UL == 25){ - ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 1; - }else{ - ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 2; + if (cc->tdd_Config == NULL) { + if(frame_parms->N_RB_UL == 25){ + ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 1; + }else{ + ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 2; + } + } else { + switch(frame_parms->N_RB_UL){ + case 25: + default: + ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 1; + break; + case 50: + ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 2; + break; + case 100: + ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 3; + break; + } } ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].nb_rb = 1; ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].UE_id = -1; @@ -1696,25 +1711,62 @@ void schedule_ulsch_rnti(module_id_t module_idP, // This is the actual CC_id in the list N_RB_UL = to_prb(cc->mib->message.dl_Bandwidth); //leave out first RB for PUCCH - if(N_RB_UL == 25){ - first_rb[CC_id] = 1; - }else{ - first_rb[CC_id] = 2; + if (cc->tdd_Config == NULL) { + if(N_RB_UL == 25){ + first_rb[CC_id] = 1; + }else{ + first_rb[CC_id] = 2; + } + }else { + switch(N_RB_UL){ + case 25: + default: + first_rb[CC_id] = 1; + break; + case 50: + first_rb[CC_id] = 2; + break; + case 100: + first_rb[CC_id] = 3; + break; + } } for ( ulsch_ue_num = 0; ulsch_ue_num < ulsch_ue_select[CC_id].ue_num; ulsch_ue_num++ ) { UE_id = ulsch_ue_select[CC_id].list[ulsch_ue_num].UE_id; /* be sure that there are some free RBs */ - if(N_RB_UL == 25){ - if (first_rb[CC_id] >= N_RB_UL-1) { - LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", - module_idP,frameP,subframeP,UE_id,rnti,CC_id); - break; - } - }else{ - if (first_rb[CC_id] >= N_RB_UL-2) { - LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", - module_idP,frameP,subframeP,UE_id,rnti,CC_id); - break; + if (cc->tdd_Config == NULL){ + if(N_RB_UL == 25){ + if (first_rb[CC_id] >= N_RB_UL-1) { + LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", + module_idP,frameP,subframeP,UE_id,rnti,CC_id); + break; + } + }else{ + if (first_rb[CC_id] >= N_RB_UL-2) { + LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", + module_idP,frameP,subframeP,UE_id,rnti,CC_id); + break; + } + } + } else { + if(N_RB_UL == 25){ + if (first_rb[CC_id] >= N_RB_UL-1) { + LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d N_RB_UL %d first_rb %d: dropping, not enough RBs\n", + module_idP,frameP,subframeP,UE_id,rnti,CC_id, N_RB_UL, first_rb); + break; + } + }else if(N_RB_UL == 50){ + if (first_rb[CC_id] >= N_RB_UL-2) { + LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d N_RB_UL %d first_rb %d: dropping, not enough RBs\n", + module_idP,frameP,subframeP,UE_id,rnti,CC_id, N_RB_UL, first_rb); + break; + } + }else if(N_RB_UL == 100){ + if (first_rb[CC_id] >= N_RB_UL-3) { + LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d N_RB_UL %d first_rb %d: dropping, not enough RBs\n", + module_idP,frameP,subframeP,UE_id,rnti,CC_id, N_RB_UL, first_rb); + break; + } } } //MSG3 @@ -1857,6 +1909,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tpc = tpc; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = cqi_req; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframeP]; + hi_dci0_pdu->dci_pdu.dci_pdu_rel8.harq_pid = harq_pid; hi_dci0_req->number_of_dci++; @@ -1971,6 +2024,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, hi_dci0_pdu->dci_pdu.dci_pdu_rel8.tpc = tpc; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cqi_csi_request = cqi_req; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframeP]; + hi_dci0_pdu->dci_pdu.dci_pdu_rel8.harq_pid = harq_pid; hi_dci0_req->number_of_dci++; // fill in NAK information diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 94d8c17f0a..724b30a3d1 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1267,6 +1267,10 @@ do_RRCConnectionSetup( RRCConnectionSetup_t* rrcConnectionSetup = NULL; +#ifdef UE_EXPANSION + LTE_DL_FRAME_PARMS *frame_parms = &RC.eNB[ctxt_pP->module_id][CC_id]->frame_parms; +#endif + memset((void *)&dl_ccch_msg,0,sizeof(DL_CCCH_Message_t)); dl_ccch_msg.message.present = DL_CCCH_MessageType_PR_c1; dl_ccch_msg.message.choice.c1.present = DL_CCCH_MessageType__c1_PR_rrcConnectionSetup; @@ -1533,7 +1537,28 @@ do_RRCConnectionSetup( physicalConfigDedicated2->schedulingRequestConfig->present = SchedulingRequestConfig_PR_setup; #ifdef UE_EXPANSION - physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex = 31 - ue_context_pP->local_uid/10;//ue_context_pP->local_uid; + if (carrier->sib1->tdd_Config == NULL) { + physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex = 31 - ue_context_pP->local_uid/10;//ue_context_pP->local_uid; + } else { + switch (carrier->sib1->tdd_Config->subframeAssignment) { + case 1: + switch(frame_parms->N_RB_UL){ + case 25: + physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex = 15 - ue_context_pP->local_uid/4; + break; + case 50: + physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex = 31 - ue_context_pP->local_uid/4; + break; + case 100: + physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex = 63 - ue_context_pP->local_uid/4; + break; + } + break; + default: + physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex = 71 - ue_context_pP->local_uid/10;//ue_context_pP->local_uid; + break; + } + } #else physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex = 71 - ue_context_pP->local_uid/10;//ue_context_pP->local_uid; #endif From 89b261efe55202f6c3ee059dbfb6a9efec0fffd1 Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Thu, 8 Feb 2018 16:08:57 +0800 Subject: [PATCH 10/63] Fix bug in schedule_ulsch --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index ab3f32c83c..70bc926e3c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1004,8 +1004,8 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, switch (subframeP) { case 0: if ((tdd_sfa == 0)|| - (tdd_sfa == 3)|| - (tdd_sfa == 6)) sched_subframe = 4; + (tdd_sfa == 3)) sched_subframe = 4; + else if (tdd_sfa==6) sched_subframe = 7; else return; break; case 1: @@ -1026,11 +1026,11 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, break; case 5: if (tdd_sfa==0) sched_subframe = 9; - else if (tdd_sfa==6) sched_subframe = 3; + else if (tdd_sfa==6) sched_subframe = 2; else return; break; case 6: - if (tdd_sfa==1) sched_subframe = 2; + if (tdd_sfa==0 || tdd_sfa==1) sched_subframe = 2; else if (tdd_sfa==6) sched_subframe = 3; else return; break; From 9ba035500063a39e2b5a87892dac9cbf38bf35c1 Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Thu, 8 Feb 2018 18:04:23 +0800 Subject: [PATCH 11/63] add switch tdd config to Msg4 timing setting --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 70bc926e3c..68515b5bc5 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -661,8 +661,13 @@ rx_sdu(const module_id_t enb_mod_idP, if(mac->common_channels[CC_idP].tdd_Config!=NULL){ - ra->Msg4_frame = frameP + ((subframeP > 2) ? 1 : 0); - ra->Msg4_subframe = (subframeP + 7) % 10; // TODO need to be complete for other tdd configs. + switch(mac->common_channels[CC_idP].tdd_Config->subframeAssignment){ + case 1: + ra->Msg4_frame = frameP + ((subframeP > 2) ? 1 : 0); + ra->Msg4_subframe = (subframeP + 7) % 10; + break; + // TODO need to be complete for other tdd configs. + } }else{ // Program Msg4 PDCCH+DLSCH/MPDCCH transmission 4 subframes from now, // Check if this is ok for BL/CE, or if the rule is different ra->Msg4_frame = frameP + ((subframeP > 5) ? 1 : 0); From 593ebc4732f361aa798d38f0fdd55bd3a49a3b80 Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Thu, 8 Feb 2018 18:08:38 +0800 Subject: [PATCH 12/63] Fix bug in subframe2harq_pid. Remove if tdd condition while calling this method since there is already if-else in the method. --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 5 ----- openair1/SCHED/phy_procedures_lte_eNb.c | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 722341ea65..855571fe54 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -6587,12 +6587,7 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t } else { switch (frame_parms->tdd_config) { - case 1: - if ((subframe==2) || - (subframe==3) || - (subframe==7) || - (subframe==8)) switch (subframe) { case 2: case 3: diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index c0662b5b8e..bc9b0e4f4e 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1351,8 +1351,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) const int subframe = proc->subframe_rx; const int frame = proc->frame_rx; - if (fp->frame_type == FDD) harq_pid = ((10*frame) + subframe)&7; - else harq_pid = subframe2harq_pid(&eNB->frame_parms,frame,subframe); + harq_pid = subframe2harq_pid(&eNB->frame_parms,frame,subframe); for (i=0; iulsch[i]; From 0684f6dda1ee330bb39dcf3300d454a57b3e704e Mon Sep 17 00:00:00 2001 From: naoi Date: Fri, 9 Feb 2018 23:27:30 +0900 Subject: [PATCH 13/63] Fix: All UEs are detached when rf_tx_thread_busy occurs. --- targets/RT/USER/lte-ru.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 18d9cd42fc..ef641f6920 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1524,8 +1524,10 @@ static void* ru_thread( void* param ) { // the thread can now be woken up AssertFatal(pthread_cond_signal(&ru->proc.cond_phy_tx) == 0, "ERROR pthread_cond_signal for phy_tx thread\n"); + }else{ + LOG_E(PHY,"phy tx thread busy, skipping\n"); + ++ru->proc.instance_cnt_phy_tx; } - else LOG_W(PHY,"phy tx thread busy, skipping\n"); pthread_mutex_unlock( &ru->proc.mutex_phy_tx ); } else { phy_tx_end = 1; @@ -1793,8 +1795,10 @@ static void* eNB_thread_phy_tx( void* param ) { // the thread can now be woken up AssertFatal(pthread_cond_signal(&ru->proc.cond_rf_tx) == 0, "ERROR pthread_cond_signal for rf_tx thread\n"); + }else{ + LOG_E(PHY,"rf tx thread busy, skipping\n"); + ru->proc.instance_cnt_rf_tx++; } - else LOG_W(PHY,"rf tx thread busy, skipping\n"); pthread_mutex_unlock( &ru->proc.mutex_rf_tx ); } if (release_thread(&proc->mutex_phy_tx,&proc->instance_cnt_phy_tx,"eNB_thread_phy_tx") < 0) break; From 4898d609e698d8c1f84723db1c4ae00c0c317049 Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Sun, 11 Feb 2018 16:42:12 +0800 Subject: [PATCH 14/63] Fix a bug in HI_DCI0_req clear --- openair2/LAYER2/MAC/eNB_scheduler.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 176503ca1c..19ba879032 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -573,7 +573,7 @@ clear_nfapi_information(eNB_MAC_INST * eNB, int CC_idP, { nfapi_dl_config_request_t *DL_req = &eNB->DL_req[0]; nfapi_ul_config_request_t *UL_req = &eNB->UL_req[0]; - nfapi_hi_dci0_request_t *HI_DCI0_req = &eNB->HI_DCI0_req[0][subframeP]; + nfapi_hi_dci0_request_t *HI_DCI0_req = &eNB->HI_DCI0_req[CC_idP][subframeP]; nfapi_tx_request_t *TX_req = &eNB->TX_req[0]; eNB->pdu_index[CC_idP] = 0; @@ -586,8 +586,8 @@ clear_nfapi_information(eNB_MAC_INST * eNB, int CC_idP, DL_req[CC_idP].dl_config_request_body.number_pdsch_rnti = 0; DL_req[CC_idP].dl_config_request_body.transmission_power_pcfich = 6000; - HI_DCI0_req[CC_idP].hi_dci0_request_body.sfnsf = subframeP + (frameP<<4); - HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_dci = 0; + HI_DCI0_req->hi_dci0_request_body.sfnsf = subframeP + (frameP<<4); + HI_DCI0_req->hi_dci0_request_body.number_of_dci = 0; UL_req[CC_idP].ul_config_request_body.number_of_pdus = 0; From dcdda7ba356c0318e994fc77b2c0e6b275b7491e Mon Sep 17 00:00:00 2001 From: Xu Bo Date: Sun, 11 Feb 2018 18:10:11 +0900 Subject: [PATCH 15/63] set UL schedule period to 5Frame for TDD config1 --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 11 ++++++++++- openair2/LAYER2/MAC/pre_processor.c | 16 ++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 3740071299..1f004cc9e3 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1832,7 +1832,6 @@ void schedule_ulsch_rnti(module_id_t module_idP, } else { tpc = 1; //0 } - if (tpc!=1) { LOG_D(MAC,"[eNB %d] ULSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n", module_idP,frameP,subframeP,harq_pid,tpc, @@ -1917,6 +1916,11 @@ void schedule_ulsch_rnti(module_id_t module_idP, hi_dci0_pdu->dci_pdu.dci_pdu_rel8.harq_pid = harq_pid; hi_dci0_req->number_of_dci++; + hi_dci0_req->sfnsf = sfnsf_add_subframe(sched_frame, sched_subframeP, 0); //(frameP, subframeP, 4) + hi_dci0_req->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG; + nfapi_hi_dci0_request_t *nfapi_hi_dci0_req = &eNB->HI_DCI0_req[CC_id][subframeP]; + nfapi_hi_dci0_req->sfn_sf = frameP<<4|subframeP; // sfnsf_add_subframe(sched_frame, sched_subframeP, 0); // sunday! + nfapi_hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST; LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP); @@ -2042,6 +2046,11 @@ void schedule_ulsch_rnti(module_id_t module_idP, hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; hi_dci0_req->number_of_hi++; + hi_dci0_req->sfnsf = sfnsf_add_subframe(sched_frame, sched_subframeP, 0); //(frameP, subframeP, 4) + nfapi_hi_dci0_request_t *nfapi_hi_dci0_req = &eNB->HI_DCI0_req[CC_id][subframeP]; + nfapi_hi_dci0_req->sfn_sf = frameP<<4|subframeP; // sfnsf_add_subframe(sched_frame, sched_subframeP, 0); // sunday! + nfapi_hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST; + LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, round %d)\n", module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,UE_template->mcs_UL[harq_pid], ulsch_ue_select[CC_id].list[ulsch_ue_num].start_rb, ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb, diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index ae4f9b8112..b16ee172fd 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -2509,7 +2509,13 @@ void ulsch_scheduler_pre_ue_select( } if ( (ulsch_ue_select[CC_id].ue_num+ul_inactivity_num[CC_id] ) < ulsch_ue_max_num[CC_id] ) { UE_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; - if ( ((UE_sched_ctl->ul_inactivity_timer>20)&&(UE_sched_ctl->ul_scheduled==0)) || + uint8_t ul_period = 0; + if (cc->tdd_Config) { + ul_period = 50; + } else { + ul_period = 20; + } + if ( ((UE_sched_ctl->ul_inactivity_timer>ul_period)&&(UE_sched_ctl->ul_scheduled==0)) || ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) { ul_inactivity_id[CC_id][ul_inactivity_num[CC_id]]= UE_id; ul_inactivity_num[CC_id] ++; @@ -2615,7 +2621,13 @@ void ulsch_scheduler_pre_ue_select( //inactivity UE if ( (ulsch_ue_select[CC_id].ue_num+ul_inactivity_num[CC_id]) < ulsch_ue_max_num[CC_id] ) { UE_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; - if ( ((UE_sched_ctl->ul_inactivity_timer>20)&&(UE_sched_ctl->ul_scheduled==0)) || + uint8_t ul_period = 0; + if (cc->tdd_Config) { + ul_period = 50; + } else { + ul_period = 20; + } + if ( ((UE_sched_ctl->ul_inactivity_timer>ul_period)&&(UE_sched_ctl->ul_scheduled==0)) || ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) { ul_inactivity_id[CC_id][ul_inactivity_num[CC_id]]= UE_id; ul_inactivity_num[CC_id]++; From 2974c20c696d10fc42184ccfa01e8eb0c1bea36b Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Sun, 11 Feb 2018 19:55:52 +0800 Subject: [PATCH 16/63] Move tdd config case 1 to top --- openair1/SCHED/phy_procedures_lte_common.c | 41 +++++++++++----------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c index 83ba5b4b97..1981f53ee2 100644 --- a/openair1/SCHED/phy_procedures_lte_common.c +++ b/openair1/SCHED/phy_procedures_lte_common.c @@ -343,15 +343,15 @@ int ul_ACK_subframe2_dl_frame(LTE_DL_FRAME_PARMS *frame_parms,int frame, unsigne return (((subframe_tx > subframe ) ? frame-1 : frame)+1024)%1024; } else { switch (frame_parms->tdd_config) { + case 1: + return(((subframe_tx > subframe ) ? frame-1 : frame)+1024)%1024; + break; case 3: //TODO break; case 4: //TODO break; - case 1: - return(((subframe_tx > subframe ) ? frame-1 : frame)+1024)%1024; - break; } } @@ -366,6 +366,23 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s return(1); } else { switch (frame_parms->tdd_config) { + case 1: + return 1; // don't ACK special subframe for now + if (subframe == 2) { // ACK subframes 5 and 6 + return(2); + } else if (subframe == 3) { // ACK subframe 9 + return(1); // To be updated + } else if (subframe == 7) { // ACK subframes 0 and 1 + return(2); // To be updated + } else if (subframe == 8) { // ACK subframe 4 + return(1); // To be updated + } else { + LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n", + subframe,frame_parms->tdd_config); + return(0); + } + + break; case 3: if (subframe == 2) { // ACK subframes 5 and 6 return(2); // should be 3 @@ -404,24 +421,6 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s } break; - - case 1: - return 1; // don't ACK special subframe for now - if (subframe == 2) { // ACK subframes 5 and 6 - return(2); - } else if (subframe == 3) { // ACK subframe 9 - return(1); // To be updated - } else if (subframe == 7) { // ACK subframes 0 and 1 - return(2); // To be updated - } else if (subframe == 8) { // ACK subframe 4 - return(1); // To be updated - } else { - LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n", - subframe,frame_parms->tdd_config); - return(0); - } - - break; } } From bba24dc2fa9d6c7a1a29034968991f18264be356 Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Sun, 11 Feb 2018 20:33:07 +0800 Subject: [PATCH 17/63] Remove comments --- openair1/SCHED/phy_procedures_lte_eNb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index bc9b0e4f4e..51231ded48 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1999,12 +1999,12 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB, switch (harq_ack[0]) { case 0: - pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0;// anaake + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0; break; case 1: // check if M=1,4,7 if (uci->num_pucch_resources == 1 || uci->num_pucch_resources == 4 || tdd_config5_sf2scheds == 1 || tdd_config5_sf2scheds == 4 || tdd_config5_sf2scheds == 7) { - pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;// anaake + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1; release_harq(eNB,UE_id,0,frame,subframe,0xffff); release_harq(eNB,UE_id,1,frame,subframe,0xffff); } @@ -2012,7 +2012,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB, case 2: // check if M=2,5,8 if (uci->num_pucch_resources == 2 || tdd_config5_sf2scheds == 2 || tdd_config5_sf2scheds == 5 || tdd_config5_sf2scheds == 8) { - pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;// anaake + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1; release_harq(eNB,UE_id,0,frame,subframe,0xffff); release_harq(eNB,UE_id,1,frame,subframe,0xffff); } @@ -2020,7 +2020,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB, case 3: // check if M=3,6,9 if (uci->num_pucch_resources == 3 || tdd_config5_sf2scheds == 3 || tdd_config5_sf2scheds == 6 || tdd_config5_sf2scheds == 9) { - pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;// anaake + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1; release_harq(eNB,UE_id,0,frame,subframe,0xffff); release_harq(eNB,UE_id,1,frame,subframe,0xffff); } From 19a2b37c751445ef2a82ba41b0e21efc8124c19f Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Mon, 12 Feb 2018 16:52:48 +0800 Subject: [PATCH 18/63] Fix bug in Adaptive Retransmission for ULSCH. Fix Qm,mcs,TBS setting. --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 1 + openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 4 +++- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 13 +++++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index dc55a28ea0..4b857fffbd 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -2783,6 +2783,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu ulsch->harq_processes[harq_pid]->ndi, ulsch_pdu->ulsch_pdu_rel8.new_data_indication, new_ulsch, ulsch->harq_processes[harq_pid]->status); ulsch->harq_processes[harq_pid]->rvidx = ulsch_pdu->ulsch_pdu_rel8.redundancy_version; + if(ulsch_pdu->ulsch_pdu_rel8.modulation_type!=0) ulsch->harq_processes[harq_pid]->Qm = ulsch_pdu->ulsch_pdu_rel8.modulation_type; // Set O_ACK to 0 by default, will be set of DLSCH is scheduled and needs to be ulsch->harq_processes[harq_pid]->O_ACK = 0; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 7fc7733f12..a5fd7c7e6a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1705,8 +1705,10 @@ fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t * ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2; else if (mcs < 21) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 4; - else + else if(mcs < 29) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 6; + else + ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = cyclic_shift_2_for_drms; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8. diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 1f004cc9e3..db9025b258 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1997,8 +1997,13 @@ void schedule_ulsch_rnti(module_id_t module_idP, round = UE_sched_ctrl->round_UL[CC_id][harq_pid]; UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power=normalized_rx_power; UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power; - - UE_template->TBS_UL[harq_pid] = get_TBS_UL(UE_template->mcs_UL[harq_pid],ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb); + if(rvidx_tab[round&3]==1){ + UE_template->mcs_UL[harq_pid] = 29; + }else if(rvidx_tab[round&3]==2){ + UE_template->mcs_UL[harq_pid] = 30; + }else if(rvidx_tab[round&3]==3){ + UE_template->mcs_UL[harq_pid] = 31; + } UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS=UE_template->TBS_UL[harq_pid]; if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) @@ -2045,6 +2050,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = UE_template->cshift[harq_pid]; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; hi_dci0_req->number_of_hi++; + hi_dci0_pdu->hi_pdu.hi_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG; hi_dci0_req->sfnsf = sfnsf_add_subframe(sched_frame, sched_subframeP, 0); //(frameP, subframeP, 4) nfapi_hi_dci0_request_t *nfapi_hi_dci0_req = &eNB->HI_DCI0_req[CC_id][subframeP]; @@ -2077,8 +2083,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, 0, // ul_tx_mode 0, // current_tx_nb 0, // n_srs - get_TBS_UL(UE_template->mcs_UL[harq_pid], - ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb) + UE_template->TBS_UL[harq_pid] ); #ifdef Rel14 if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation From c641f334bb4114a9c79d20170aedeae5da2133b0 Mon Sep 17 00:00:00 2001 From: Wu Jing Date: Mon, 12 Feb 2018 18:38:26 +0900 Subject: [PATCH 19/63] fix total usable RBs when pucch rb=6 --- openair2/ENB_APP/enb_config.c | 4 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 11 +++++ openair2/LAYER2/MAC/pre_processor.c | 52 ++++++++++++++++++----- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c | 2 +- 4 files changed, 55 insertions(+), 14 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 09e00a8f6b..c87421a2c0 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -876,9 +876,9 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { AssertFatal (0, "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_freq_offset choice: 2(N_RB_DL %d)!\n", RC.config_file_name, i, prach_freq_offset,N_RB_DL); - if (((N_RB_DL == 50) || (N_RB_DL == 100)) && (prach_freq_offset != 3)) + if (((N_RB_DL == 50) || (N_RB_DL == 100)) && (prach_freq_offset < 3)) AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_freq_offset choice: 3(N_RB_DL %d)!\n", + "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_freq_offset choice: 3,4(N_RB_DL %d)!\n", RC.config_file_name, i, prach_freq_offset,N_RB_DL); #endif diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index db9025b258..bc15372823 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1710,6 +1710,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, hi_dci0_req = &eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body; eNB->HI_DCI0_req[CC_id][subframeP].sfn_sf = (frameP<<4)+subframeP; ul_req_tmp = &eNB->UL_req_tmp[CC_id][sched_subframeP].ul_config_request_body; + nfapi_ul_config_request_t *ul_req = &eNB->UL_req_tmp[CC_id][sched_subframeP]; ULSCH_first_end = 0; cc = &eNB->common_channels[CC_id]; @@ -1959,6 +1960,12 @@ void schedule_ulsch_rnti(module_id_t module_idP, #endif ul_req_tmp->number_of_pdus++; eNB->ul_handle++; + ul_req->header.message_id = NFAPI_UL_CONFIG_REQUEST; + ul_req_tmp->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; + uint16_t ul_sched_frame = sched_frame; + uint16_t ul_sched_subframeP = sched_subframeP; + add_subframe(&ul_sched_frame, &ul_sched_subframeP, 2); + ul_req->sfn_sf = ul_sched_frame<<4|ul_sched_subframeP; add_ue_ulsch_info(module_idP, CC_id, @@ -2096,6 +2103,10 @@ void schedule_ulsch_rnti(module_id_t module_idP, #endif ul_req_tmp->number_of_pdus++; eNB->ul_handle++; + ul_req->header.message_id = NFAPI_UL_CONFIG_REQUEST; + ul_req_tmp->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; + ul_req->sfn_sf = sched_frame<<4|sched_subframeP; + LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0(round >0)\n", module_idP,CC_id,frameP,subframeP,UE_id); // increment first rb for next UE allocation diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index b16ee172fd..af34a1774b 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -2700,6 +2700,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, int16_t tx_power; int UE_id; rnti_t rnti; + COMMON_channels_t *cc; LOG_D(MAC,"In ulsch_preprocessor: ulsch ue select\n"); //ue select ulsch_scheduler_pre_ue_select(module_idP,frameP,subframeP,sched_subframeP,ulsch_ue_select); @@ -2730,22 +2731,51 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, } rnti = UE_RNTI(CC_id,UE_id); - if(frame_parms->N_RB_UL == 25){ - if ( first_rb[CC_id] >= frame_parms->N_RB_UL-1 ){ + cc = &RC.mac[module_idP]->common_channels[CC_id]; + if (cc->tdd_Config) { + if (frame_parms->N_RB_UL == 25) { + if (first_rb[CC_id] >= frame_parms->N_RB_UL-1 ) { + LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", + module_idP,frameP,subframeP,UE_id,rnti,CC_id); + break; + } + // calculate the average rb ( remain UE) + total_rbs = frame_parms->N_RB_UL-1-first_rb[CC_id]; + } else if (frame_parms->N_RB_UL == 50) { + if (first_rb[CC_id] >= frame_parms->N_RB_UL-2 ) { + LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", + module_idP,frameP,subframeP,UE_id,rnti,CC_id); + break; + } + // calculate the average rb ( remain UE) + total_rbs = frame_parms->N_RB_UL-2-first_rb[CC_id]; + } else { + if (first_rb[CC_id] >= frame_parms->N_RB_UL-3 ) { + LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", + module_idP,frameP,subframeP,UE_id,rnti,CC_id); + break; + } + // calculate the average rb ( remain UE) + total_rbs = frame_parms->N_RB_UL-3-first_rb[CC_id]; + } + } else { + if(frame_parms->N_RB_UL == 25){ + if ( first_rb[CC_id] >= frame_parms->N_RB_UL-1 ){ LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id); - break; - } - // calculate the average rb ( remain UE) - total_rbs = frame_parms->N_RB_UL-1-first_rb[CC_id]; - }else{ - if ( first_rb[CC_id] >= frame_parms->N_RB_UL-2 ){ + break; + } + // calculate the average rb ( remain UE) + total_rbs = frame_parms->N_RB_UL-1-first_rb[CC_id]; + }else{ + if ( first_rb[CC_id] >= frame_parms->N_RB_UL-2 ){ LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id); - break; + break; + } + // calculate the average rb ( remain UE) + total_rbs = frame_parms->N_RB_UL-2-first_rb[CC_id]; } - // calculate the average rb ( remain UE) - total_rbs = frame_parms->N_RB_UL-2-first_rb[CC_id]; } average_rbs = (int)round((double)total_rbs/(double)ue_num_temp); if ( average_rbs < 3 ) { diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c index 881c7b14cc..318ec64d02 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c @@ -550,7 +550,7 @@ rlc_am_mac_status_indication ( } rlc->last_absolute_subframe_status_indication = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP); - + if (tb_sizeP > 0) rlc->nb_bytes_requested_by_mac = tb_sizeP; status_resp.buffer_occupancy_in_bytes = rlc_am_get_buffer_occupancy_in_bytes(ctxt_pP, rlc); From ebecb55733672aa03d8cb389656401c92ae2a2f9 Mon Sep 17 00:00:00 2001 From: Wu Jing Date: Tue, 13 Feb 2018 12:30:25 +0900 Subject: [PATCH 20/63] add if-else case for first_rb=3 when TDD config1 20MHz in ULSCH_pre_processor --- openair2/LAYER2/MAC/pre_processor.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index af34a1774b..b09601a0ac 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -2707,12 +2707,23 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, // MCS and RB assgin for ( CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++ ) { + cc = &RC.mac[module_idP]->common_channels[CC_id]; frame_parms = &(RC.eNB[module_idP][CC_id]->frame_parms); - if(frame_parms->N_RB_UL == 25){ - first_rb[CC_id] = 1; - }else{ - first_rb[CC_id] = 2; - } + if (cc->tdd_Config) { //TDD + if (frame_parms->N_RB_UL == 25) { + first_rb[CC_id] = 1; + } else if (frame_parms->N_RB_UL == 50) { + first_rb[CC_id] = 2; + } else { + first_rb[CC_id] = 3; + } + } else {//FDD + if (frame_parms->N_RB_UL == 25) { + first_rb[CC_id] = 1; + } else { + first_rb[CC_id] = 2; + } + } ue_num_temp = ulsch_ue_select[CC_id].ue_num; for ( ulsch_ue_num = 0; ulsch_ue_num < ulsch_ue_select[CC_id].ue_num; ulsch_ue_num++ ) { @@ -2731,7 +2742,6 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, } rnti = UE_RNTI(CC_id,UE_id); - cc = &RC.mac[module_idP]->common_channels[CC_id]; if (cc->tdd_Config) { if (frame_parms->N_RB_UL == 25) { if (first_rb[CC_id] >= frame_parms->N_RB_UL-1 ) { From 5eac636b343cd27588543c51d185952c696bdad5 Mon Sep 17 00:00:00 2001 From: naoi Date: Tue, 13 Feb 2018 17:57:44 +0900 Subject: [PATCH 21/63] FIX: E-RAB is removed when UE's status is E_RAB_STATUS_DONE. --- openair2/RRC/LITE/rrc_eNB.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index e57ed85b6f..94e4c71986 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -1448,7 +1448,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( memset(&create_tunnel_req, 0 , sizeof(create_tunnel_req)); for (j = 0, i = 0; i < NB_RB_MAX; i++) { - if (ue_context_pP->ue_context.e_rab[i].status == E_RAB_STATUS_ESTABLISHED) { + if (ue_context_pP->ue_context.e_rab[i].status == E_RAB_STATUS_ESTABLISHED || ue_context_pP->ue_context.e_rab[i].status == E_RAB_STATUS_DONE) { create_tunnel_req.eps_bearer_id[j] = ue_context_pP->ue_context.e_rab[i].param.e_rab_id; create_tunnel_req.sgw_S1u_teid[j] = ue_context_pP->ue_context.e_rab[i].param.gtp_teid; From 831ce2e910f215b90bfee5504cadfdbb71e001a7 Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Tue, 13 Feb 2018 17:08:32 +0800 Subject: [PATCH 22/63] Fix frame_cnt to prevent it from getting too big --- openair2/PHY_INTERFACE/IF_Module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index 6152e439eb..175fcb2e67 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -546,8 +546,8 @@ void UL_indication(UL_IND_t *UL_info) UL_info->frame,UL_info->subframe, module_id,CC_id, UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis, UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs); - if(UL_info->frame==1023&&UL_info->subframe==6){ // dl scheduling 0,0 - frame_cnt++; + if(UL_info->frame==1023&&UL_info->subframe==6){ // dl scheduling (0,0) + frame_cnt= (frame_cnt + 1)%7; // to prevent frame_cnt get too big LOG_D(MAC,"current (%d,%d) frame count dl is %d\n",UL_info->frame,UL_info->subframe,frame_cnt); } From 1ba01559448a04636caa71b9eece4b5c3e5ac056 Mon Sep 17 00:00:00 2001 From: naoi Date: Tue, 13 Feb 2018 18:22:38 +0900 Subject: [PATCH 23/63] clean: log modification. --- openair1/PHY/LTE_TRANSPORT/pucch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index c8da27bcb8..c8a4e7fd78 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -2457,7 +2457,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, #if defined(USRP_REC_PLAY) LOG_I(PHY,"PUCCH 1a/b: NAK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres); #else - LOG_I(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres); + LOG_D(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres); #endif *payload = 4; // DTX ((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re); From 4c0a8f88f99385d219ba818b3cac3f6d2ee93bdc Mon Sep 17 00:00:00 2001 From: Masayuki HARADA Date: Thu, 15 Feb 2018 10:58:47 +0900 Subject: [PATCH 24/63] Add fail safe when RF TX thread is busy. --- targets/RT/USER/lte-ru.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index ef641f6920..a2b436ef23 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1842,6 +1842,10 @@ static void* rf_tx( void* param ) { if (ru->fh_north_out) ru->fh_north_out(ru); } if (release_thread(&proc->mutex_rf_tx,&proc->instance_cnt_rf_tx,"rf_tx") < 0) break; + if(proc->instance_cnt_rf_tx >= 0){ + late_control=STATE_BURST_TERMINATE; + LOG_E(PHY,"detect rf tx busy change mode TX failsafe\n"); + } } LOG_I(PHY, "Exiting rf TX\n"); From 897d3c49df97af6501a3cae9ebf44a8d22f1f4e5 Mon Sep 17 00:00:00 2001 From: naoi Date: Thu, 15 Feb 2018 18:05:40 +0900 Subject: [PATCH 25/63] Fix: avoid conflict between pre-scd thread and ru thread. --- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c index 881c7b14cc..c8b8bce7aa 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c @@ -551,7 +551,9 @@ rlc_am_mac_status_indication ( rlc->last_absolute_subframe_status_indication = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP); - rlc->nb_bytes_requested_by_mac = tb_sizeP; + if (tb_sizeP > 0) { + rlc->nb_bytes_requested_by_mac = tb_sizeP; + } status_resp.buffer_occupancy_in_bytes = rlc_am_get_buffer_occupancy_in_bytes(ctxt_pP, rlc); From d82ebce55b06adc6e5b8abfe01a0f204b8ad6870 Mon Sep 17 00:00:00 2001 From: Masayuki HARADA Date: Thu, 15 Feb 2018 20:10:08 +0900 Subject: [PATCH 26/63] If TB buffer's all regments recieved is NOT equal RLC's all regments recieved, discard that TB buffer. --- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c index b1facdfb02..42bdd56e77 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c @@ -396,14 +396,20 @@ rlc_am_receive_process_data_pdu ( } if (pdu_info_p->sn == rlc_pP->vr_r) { +mem_block_t* cursor_p = rlc_pP->receiver_buffer.head; +rlc_am_rx_pdu_management_t * pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data); +if( (((rlc_am_rx_pdu_management_t*)(tb_pP->data))->all_segments_received) == (pdu_cursor_mgnt_p->all_segments_received)){ if (((rlc_am_rx_pdu_management_t*)(tb_pP->data))->all_segments_received) { rlc_am_rx_update_vr_r(ctxt_pP, rlc_pP, tb_pP); rlc_pP->vr_mr = (rlc_pP->vr_r + RLC_AM_WINDOW_SIZE) & RLC_AM_SN_MASK; } - reassemble = rlc_am_rx_check_vr_reassemble(ctxt_pP, rlc_pP); //TODO : optimization : check whether a reassembly is needed by looking at LI, FI, SO, etc... - +}else{ + LOG_E(RLC, "BAD all_segments_received!!! discard buffer!!!\n"); + /* Discard received block if out of window, duplicate or header error */ + free_mem_block (tb_pP, __func__); +} } //FNA: fix check VrX out of receiving window From de35844c424d8ea8f5222877986595394649ec2e Mon Sep 17 00:00:00 2001 From: Masayuki HARADA Date: Thu, 15 Feb 2018 20:23:54 +0900 Subject: [PATCH 27/63] Change priority of itti thread. --- common/utils/itti/intertask_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/itti/intertask_interface.c b/common/utils/itti/intertask_interface.c index 387d37d61d..a1bb6b072f 100644 --- a/common/utils/itti/intertask_interface.c +++ b/common/utils/itti/intertask_interface.c @@ -782,7 +782,7 @@ void itti_mark_task_ready(task_id_t task_id) /* Mark the thread as using LFDS queue */ lfds611_queue_use(itti_desc.tasks[task_id].message_queue); -#ifdef RTAI +#if defined(UE_EXPANSION) || defined(RTAI) /* Assign low priority to created threads */ { struct sched_param sched_param; From c80246a9a5b904654bddc06b3ac5a9b45c2a2c11 Mon Sep 17 00:00:00 2001 From: tomita Date: Mon, 19 Feb 2018 19:18:15 +0900 Subject: [PATCH 28/63] Changed log level. --- openair1/PHY/INIT/lte_init.c | 4 ++-- openair2/LAYER2/MAC/config.c | 6 +++--- targets/RT/USER/lte-ru.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index d662cf19de..b8a7495ebc 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -256,7 +256,7 @@ void phy_config_request(PHY_Config_t *phy_config) { AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] > 0, "prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]==0\n"); #else - LOG_E(PHY,"***DJP*** removed assert on preamble fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]:%d expecting >0 %s:%d\n\n\n", fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0], __FILE__, __LINE__); + LOG_D(PHY,"***DJP*** removed assert on preamble fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]:%d expecting >0 %s:%d\n\n\n", fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0], __FILE__, __LINE__); #endif fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0] = cfg->emtc_config.prach_ce_level_0_configuration_index.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0] = cfg->emtc_config.prach_ce_level_0_frequency_offset.value; @@ -1779,7 +1779,7 @@ int phy_init_RU(RU_t *ru) { AssertFatal(RC.nb_L1_inst <= NUMBER_OF_eNB_MAX,"eNB instances %d > %d\n", RC.nb_L1_inst,NUMBER_OF_eNB_MAX); - LOG_E(PHY,"[INIT] %s() RC.nb_L1_inst:%d \n", __FUNCTION__, RC.nb_L1_inst); + LOG_D(PHY,"[INIT] %s() RC.nb_L1_inst:%d \n", __FUNCTION__, RC.nb_L1_inst); for (i=0; irf_config.dl_channel_bandwidth.value = to_prb(dl_BandwidthP); cfg->rf_config.dl_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG; cfg->num_tlv++; -LOG_E(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP); +LOG_D(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP); cfg->rf_config.ul_channel_bandwidth.value = to_prb(dl_BandwidthP); cfg->rf_config.ul_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG; @@ -762,7 +762,7 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN); - LOG_E(MAC, "RC.mac:%p mib:%p\n", RC.mac, mib); + LOG_D(MAC, "RC.mac:%p mib:%p\n", RC.mac, mib); if (mib != NULL) { if (RC.mac == NULL) @@ -997,7 +997,7 @@ rrc_mac_config_req_eNB(module_id_t Mod_idP, } #endif - LOG_E(MAC, "%s() %s:%d RC.mac[Mod_idP]->if_inst->PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.mac[Mod_idP]->if_inst->PHY_config_req); + LOG_D(MAC, "%s() %s:%d RC.mac[Mod_idP]->if_inst->PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.mac[Mod_idP]->if_inst->PHY_config_req); // if in nFAPI mode if ( diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 7f5d1d9ab9..203217be2a 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -2222,7 +2222,7 @@ void init_RU(char *rf_config_file) { } else { - LOG_E(PHY,"DJP - delete code above this %s:%d\n", __FILE__, __LINE__); + LOG_D(PHY,"DJP - delete code above this %s:%d\n", __FILE__, __LINE__); } eNB0 = ru->eNB_list[0]; From a53e22c2944b64acd24fce7116f4f72d9cdc83c1 Mon Sep 17 00:00:00 2001 From: tomita Date: Mon, 19 Feb 2018 19:31:09 +0900 Subject: [PATCH 29/63] Fixed harq_pid calculation. --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index a5fd7c7e6a..186ade03d3 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3770,8 +3770,8 @@ uint8_t frame_subframe2_dl_harq_pid(TDD_Config_t *tdd_Config, int abs_frameP, su switch(tdd_Config->subframeAssignment){ //TODO fill in other tdd config case 1: - harq_pid = ((frame_cnt*1024 + abs_frameP) * 4 + get_dl_subframe_count(tdd_Config->subframeAssignment,subframeP))%7;//4 dl subframe in a frame - LOG_I(MAC,"[frame_subframe2_dl_harq_pid] (%d,%d) calculate harq_pid (( %d * 1024 + %d) *4 + %d)%7 = %d \n", + harq_pid = (((frame_cnt*1024 + abs_frameP) * 4) - 1 + get_dl_subframe_count(tdd_Config->subframeAssignment,subframeP))%7;//4 dl subframe in a frame + LOG_I(MAC,"[frame_subframe2_dl_harq_pid] (%d,%d) calculate harq_pid ((( %d * 1024 + %d) *4) - 1 + %d)%7 = %d \n", (abs_frameP+1024)%1024,subframeP,frame_cnt,abs_frameP, get_dl_subframe_count(tdd_Config->subframeAssignment,subframeP),harq_pid); return harq_pid; From ea3aecf486f2296c044cbcf505fdb92c167c85c2 Mon Sep 17 00:00:00 2001 From: tomita Date: Mon, 19 Feb 2018 19:42:06 +0900 Subject: [PATCH 30/63] Bug fix about harq_pid calculation (harq_pid is calculated less than 0). --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 186ade03d3..e7831ffe93 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3839,10 +3839,15 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id, int M = ul_ACK_subframe2_M(fp,subframeP); for(m=0;m5) - frame_tx= -1; - else - frame_tx = subframeP < 5 ? frameP-1:frameP; // not formal + switch (cc->tdd_Config->subframeAssignment){ + case 1: + if(frameP==0&&subframeP<4) + frame_tx= 0; + else + frame_tx = subframeP < 4 ? frameP-1:frameP; // not formal + break; + // TODO : Other TDD Config + } harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame_tx,subframe_tx); if(num_ack_nak==1){ if(harq_indication_tdd->harq_data[0].bundling.value_0==1){ //ack From 19509f08eb76ed2e83f5ae2bcdcf43da23246f6a Mon Sep 17 00:00:00 2001 From: tomita Date: Tue, 20 Feb 2018 18:40:05 +0900 Subject: [PATCH 31/63] Changed log level. --- openair1/SCHED/fapi_l1.c | 6 +++--- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index dd02154e9c..0a5ff283c6 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -681,16 +681,16 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) eNB->pdcch_vars[subframe&1].num_dci = 0; eNB->phich_vars[subframe&1].num_hi = 0; - LOG_I(PHY,"NFAPI: Sched_INFO:SFN/SF:%04d%d DL_req:SFN/SF:%04d%d:dl_pdu:%d tx_req:SFN/SF:%04d%d:pdus:%d\n", + LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SF:%04d%d DL_req:SFN/SF:%04d%d:dl_pdu:%d tx_req:SFN/SF:%04d%d:pdus:%d\n", frame,subframe, NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),number_dl_pdu, NFAPI_SFNSF2SFN(TX_req->sfn_sf),NFAPI_SFNSF2SF(TX_req->sfn_sf),TX_req->tx_request_body.number_of_pdus ); - LOG_I(PHY,"NFAPI: hi_dci0:SFN/SF:%04d%d:pdus:%d\n", + LOG_D(PHY,"NFAPI: hi_dci0:SFN/SF:%04d%d:pdus:%d\n", NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),number_hi_dci0_pdu ); if(UL_req!=NULL) - LOG_I(PHY,"NFAPI: ul_cfg:SFN/SF:%04d%d:pdus:%d num_pdcch_symbols:%d\n", + LOG_D(PHY,"NFAPI: ul_cfg:SFN/SF:%04d%d:pdus:%d num_pdcch_symbols:%d\n", NFAPI_SFNSF2SFN(UL_req->sfn_sf),NFAPI_SFNSF2SF(UL_req->sfn_sf),number_ul_pdu, eNB->pdcch_vars[subframe&1].num_pdcch_symbols); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index e7831ffe93..ea9ca52678 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3771,7 +3771,7 @@ uint8_t frame_subframe2_dl_harq_pid(TDD_Config_t *tdd_Config, int abs_frameP, su switch(tdd_Config->subframeAssignment){ //TODO fill in other tdd config case 1: harq_pid = (((frame_cnt*1024 + abs_frameP) * 4) - 1 + get_dl_subframe_count(tdd_Config->subframeAssignment,subframeP))%7;//4 dl subframe in a frame - LOG_I(MAC,"[frame_subframe2_dl_harq_pid] (%d,%d) calculate harq_pid ((( %d * 1024 + %d) *4) - 1 + %d)%7 = %d \n", + LOG_D(MAC,"[frame_subframe2_dl_harq_pid] (%d,%d) calculate harq_pid ((( %d * 1024 + %d) *4) - 1 + %d)%7 = %d \n", (abs_frameP+1024)%1024,subframeP,frame_cnt,abs_frameP, get_dl_subframe_count(tdd_Config->subframeAssignment,subframeP),harq_pid); return harq_pid; From 497a3275c62d397e8659961b64bc34081c2806ed Mon Sep 17 00:00:00 2001 From: naoi Date: Thu, 22 Feb 2018 10:17:34 +0900 Subject: [PATCH 32/63] fix: drop reestablishment request after UL failure is detected in layer2. eNB should be keep UE context longer than T311 timer after UL failure is detected in layer2. Configuration file(GENERIC-LTE-EPC) sets T311 to 10s, so eNB keep UE context up to 20s. --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 +- openair2/RRC/LITE/rrc_common.c | 6 +++--- openair2/RRC/LITE/rrc_eNB.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 6612fb25b9..0e4bbb84f1 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -302,7 +302,7 @@ rx_sdu(const module_id_t enb_mod_idP, // prepare transmission of Msg4(RRCConnectionReconfiguration) ra->state = MSGCRNTI; LOG_I(MAC, - "[eNB %d] Frame %d, Subframe %d CC_id %d : (rnti %x UE_id %d) RRCConnectionReconfiguration(Msg4)", + "[eNB %d] Frame %d, Subframe %d CC_id %d : (rnti %x UE_id %d) RRCConnectionReconfiguration(Msg4)\n", enb_mod_idP, frameP, subframeP, CC_idP, old_rnti, old_UE_id); // UE_id = old_UE_id; diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c index aad423418a..8bd3638f5a 100644 --- a/openair2/RRC/LITE/rrc_common.c +++ b/openair2/RRC/LITE/rrc_common.c @@ -350,7 +350,7 @@ rrc_rx_tx( } if (ue_context_p->ue_context.ul_failure_timer>0) { ue_context_p->ue_context.ul_failure_timer++; - if (ue_context_p->ue_context.ul_failure_timer >= 8) { + if (ue_context_p->ue_context.ul_failure_timer >= 20000) { // remove UE after 20 seconds after MAC has indicated UL failure LOG_I(RRC,"Removing UE %x instance\n",ue_context_p->ue_context.rnti); ue_to_be_removed = ue_context_p; @@ -515,14 +515,14 @@ rrc_rx_tx( } } if (ue_to_be_removed) { - if(ue_to_be_removed->ue_context.ul_failure_timer >= 8) { + if(ue_to_be_removed->ue_context.ul_failure_timer >= 20000) { ue_to_be_removed->ue_context.ue_release_timer_s1 = 1; ue_to_be_removed->ue_context.ue_release_timer_thres_s1 = 200; ue_to_be_removed->ue_context.ue_release_timer = 0; ue_to_be_removed->ue_context.ue_reestablishment_timer = 0; } rrc_eNB_free_UE(ctxt_pP->module_id,ue_to_be_removed); - if(ue_to_be_removed->ue_context.ul_failure_timer >= 8){ + if(ue_to_be_removed->ue_context.ul_failure_timer >= 20000){ ue_to_be_removed->ue_context.ul_failure_timer = 0; } } diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 94e4c71986..0772e76b74 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -822,7 +822,7 @@ rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s* LOG_W(RRC, "[eNB %d] Removing UE RNTI %x\n", enb_mod_idP, rnti); #if defined(ENABLE_USE_MME) - if( ue_context_pP->ue_context.ul_failure_timer >= 8 ) { + if( ue_context_pP->ue_context.ul_failure_timer >= 20000 ) { LOG_I(RRC, "[eNB %d] S1AP_UE_CONTEXT_RELEASE_REQ RNTI %x\n", enb_mod_idP, rnti); rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ(enb_mod_idP, ue_context_pP, S1AP_CAUSE_RADIO_NETWORK, 21); // send cause 21: connection with ue lost /* From 3GPP 36300v10 p129 : 19.2.2.2.2 S1 UE Context Release Request (eNB triggered) From 59623646cfb22e16c9c080931f7ae55d84661fdb Mon Sep 17 00:00:00 2001 From: Masayuki HARADA Date: Thu, 22 Feb 2018 11:11:15 +0900 Subject: [PATCH 33/63] Avoid NULL access in rrc_eNB_process_RRCConnectionReestablishmentComplete. --- openair2/RRC/LITE/rrc_eNB.c | 80 ++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 33 deletions(-) diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 94e4c71986..0c9f9e08ea 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -1371,8 +1371,10 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( SRB_configList2 = &ue_context_pP->ue_context.SRB_configList2[xid]; // get old configuration of SRB2 if (*SRB_configList2 != NULL) { - LOG_D(RRC, "SRB_configList2(%p) count is %d\n SRB_configList2->list.array[0] addr is %p", + if((*SRB_configList2)->list.count!=0){ + LOG_D(RRC, "SRB_configList2(%p) count is %d\n SRB_configList2->list.array[0] addr is %p", SRB_configList2, (*SRB_configList2)->list.count, (*SRB_configList2)->list.array[0]); + } for (i = 0; (i < (*SRB_configList2)->list.count) && (i < 3); i++) { if ((*SRB_configList2)->list.array[i]->srb_Identity == 2 ){ LOG_D(RRC, "get SRB2_config from (ue_context_pP->ue_context.SRB_configList2[%d])\n", xid); @@ -1384,9 +1386,13 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( SRB_configList2 = &ue_context_pP->ue_context.SRB_configList2[next_xid]; DRB_configList2 = &ue_context_pP->ue_context.DRB_configList2[next_xid]; - if (*SRB_configList2) { - free(*SRB_configList2); - LOG_D(RRC, "free(ue_context_pP->ue_context.SRB_configList2[%d])\n", next_xid); + if(SRB_configList2!=NULL){ + if (*SRB_configList2) { + free(*SRB_configList2); + LOG_D(RRC, "free(ue_context_pP->ue_context.SRB_configList2[%d])\n", next_xid); + } + }else{ + LOG_E(RRC, "SRB_configList2 is null\n"); } *SRB_configList2 = CALLOC(1, sizeof(**SRB_configList2)); if (SRB2_config != NULL) { @@ -1406,9 +1412,13 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( - if (*DRB_configList2) { - free(*DRB_configList2); - LOG_D(RRC, "free(ue_context_pP->ue_context.DRB_configList2[%d])\n", next_xid); + if(DRB_configList2!=NULL){ + if (*DRB_configList2) { + free(*DRB_configList2); + LOG_D(RRC, "free(ue_context_pP->ue_context.DRB_configList2[%d])\n", next_xid); + } + }else{ + LOG_E(RRC, "DRB_configList2 is null\n"); } *DRB_configList2 = CALLOC(1, sizeof(**DRB_configList2)); @@ -1863,35 +1873,39 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( } #endif + if(size==65535){ + LOG_E(RRC,"RRC decode err!!! do_RRCConnectionReconfiguration\n"); + put_UE_in_freelist(ctxt_pP->module_id, reestablish_rnti, 0); + return; + }else{ + LOG_I(RRC, + "[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate RRCConnectionReconfiguration (bytes %d, UE id %x)\n", + ctxt_pP->module_id, ctxt_pP->frame, size, ue_context_pP->ue_context.rnti); - LOG_I(RRC, - "[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate RRCConnectionReconfiguration (bytes %d, UE id %x)\n", - ctxt_pP->module_id, ctxt_pP->frame, size, ue_context_pP->ue_context.rnti); + LOG_D(RRC, + "[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", + ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH); - LOG_D(RRC, - "[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", - ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH); - - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" rrcConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); - - rrc_data_req( - ctxt_pP, - DCCH, - rrc_eNB_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + MSC_LOG_TX_MESSAGE( + MSC_RRC_ENB, + MSC_RRC_UE, + buffer, + size, + MSC_AS_TIME_FMT" rrcConnectionReconfiguration UE %x MUI %d size %u", + MSC_AS_TIME_ARGS(ctxt_pP), + ue_context_pP->ue_context.rnti, + rrc_eNB_mui, + size); + rrc_data_req( + ctxt_pP, + DCCH, + rrc_eNB_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); + } // delete UE data of prior RNTI. UE use current RNTI. // protocol_ctxt_t ctxt_prior = *ctxt_pP; // ctxt_prior.rnti = reestablish_rnti; From 1008080e3185606c6ea818a1a8e16ff8e7450df1 Mon Sep 17 00:00:00 2001 From: tomita Date: Thu, 22 Feb 2018 16:40:27 +0900 Subject: [PATCH 34/63] Bug fix for harq_pid calculation in MAC layer. --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index ea9ca52678..2aae8a7eab 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3771,6 +3771,8 @@ uint8_t frame_subframe2_dl_harq_pid(TDD_Config_t *tdd_Config, int abs_frameP, su switch(tdd_Config->subframeAssignment){ //TODO fill in other tdd config case 1: harq_pid = (((frame_cnt*1024 + abs_frameP) * 4) - 1 + get_dl_subframe_count(tdd_Config->subframeAssignment,subframeP))%7;//4 dl subframe in a frame + if(harq_pid < 0) + harq_pid += 7; LOG_D(MAC,"[frame_subframe2_dl_harq_pid] (%d,%d) calculate harq_pid ((( %d * 1024 + %d) *4) - 1 + %d)%7 = %d \n", (abs_frameP+1024)%1024,subframeP,frame_cnt,abs_frameP, get_dl_subframe_count(tdd_Config->subframeAssignment,subframeP),harq_pid); @@ -3839,15 +3841,10 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id, int M = ul_ACK_subframe2_M(fp,subframeP); for(m=0;mtdd_Config->subframeAssignment){ - case 1: - if(frameP==0&&subframeP<4) - frame_tx= 0; - else - frame_tx = subframeP < 4 ? frameP-1:frameP; // not formal - break; - // TODO : Other TDD Config - } + if(frameP==1023&&subframeP>5) + frame_tx=-1; + else + frame_tx = subframeP < 4 ? frameP -1 : frameP; harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame_tx,subframe_tx); if(num_ack_nak==1){ if(harq_indication_tdd->harq_data[0].bundling.value_0==1){ //ack From 2f4c21ced37f6e7f7c7f906d6210116558887b3b Mon Sep 17 00:00:00 2001 From: tomita Date: Thu, 22 Feb 2018 17:10:21 +0900 Subject: [PATCH 35/63] Fix to avoid Segmemtation Fault in case of physicalConfigDedicated is NULL. --- .../LAYER2/MAC/eNB_scheduler_primitives.c | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 2aae8a7eab..7f933a192a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1451,24 +1451,30 @@ fill_nfapi_harq_information(module_id_t module_idP, // [UE_id].physicalConfigDedicated-> // pucch_ConfigDedicated != NULL, // "pucch_ConfigDedicated is null for TDD!\n"); - if ((UE_list-> - UE_template[CC_idP][UE_id].physicalConfigDedicated-> - pucch_ConfigDedicated != NULL) - && (UE_list-> - UE_template[CC_idP][UE_id].physicalConfigDedicated-> - pucch_ConfigDedicated->tdd_AckNackFeedbackMode != NULL) - && (*UE_list-> - UE_template[CC_idP][UE_id].physicalConfigDedicated-> - pucch_ConfigDedicated->tdd_AckNackFeedbackMode == - PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing)) - { - harq_information->harq_information_rel10_tdd.harq_size = 2; // 2-bit ACK/NAK - harq_information->harq_information_rel10_tdd.ack_nack_mode = 1; // multiplexing - } else { - harq_information->harq_information_rel10_tdd.harq_size = 1; // 1-bit ACK/NAK - harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling - } - harq_information->harq_information_rel10_tdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG; + if (UE_list-> + UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL){ + if ((UE_list-> + UE_template[CC_idP][UE_id].physicalConfigDedicated-> + pucch_ConfigDedicated != NULL) + && (UE_list-> + UE_template[CC_idP][UE_id].physicalConfigDedicated-> + pucch_ConfigDedicated->tdd_AckNackFeedbackMode != NULL) + && (*UE_list-> + UE_template[CC_idP][UE_id].physicalConfigDedicated-> + pucch_ConfigDedicated->tdd_AckNackFeedbackMode == + PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing)) + { + harq_information->harq_information_rel10_tdd.harq_size = 2; // 2-bit ACK/NAK + harq_information->harq_information_rel10_tdd.ack_nack_mode = 1; // multiplexing + } else { + harq_information->harq_information_rel10_tdd.harq_size = 1; // 1-bit ACK/NAK + harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling + } + } else { + harq_information->harq_information_rel10_tdd.harq_size = 1; // 1-bit ACK/NAK + harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling + } + harq_information->harq_information_rel10_tdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG; harq_information->harq_information_rel10_tdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon. n1PUCCH_AN + cce_idxP; From 2d975ca61b7143f24f452a95fa5a0c860d0f935d Mon Sep 17 00:00:00 2001 From: Masayuki HARADA Date: Thu, 22 Feb 2018 22:11:44 +0900 Subject: [PATCH 36/63] Change scheduling priority : UL-SCH == MAC-CE --- openair2/LAYER2/MAC/pre_processor.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index f5980d60d3..b341c9ca3c 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -2511,7 +2511,15 @@ void ulsch_scheduler_pre_ue_select( ue_first_num[CC_id]++; continue; } - if ( (ulsch_ue_select[CC_id].ue_num+ul_inactivity_num[CC_id] ) < ulsch_ue_max_num[CC_id] ) { + UE_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + if ( ((UE_sched_ctl->ul_inactivity_timer>20)&&(UE_sched_ctl->ul_scheduled==0)) || + ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) { + first_ue_id[CC_id][ue_first_num[CC_id]]= UE_id; + first_ue_total[CC_id] [ue_first_num[CC_id]] = 0; + ue_first_num[CC_id]++; + continue; + } + /*if ( (ulsch_ue_select[CC_id].ue_num+ul_inactivity_num[CC_id] ) < ulsch_ue_max_num[CC_id] ) { UE_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; if ( ((UE_sched_ctl->ul_inactivity_timer>20)&&(UE_sched_ctl->ul_scheduled==0)) || ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) { @@ -2519,7 +2527,7 @@ void ulsch_scheduler_pre_ue_select( ul_inactivity_num[CC_id] ++; continue; } - } + }*/ } } @@ -2594,7 +2602,10 @@ void ulsch_scheduler_pre_ue_select( HI_DCI0_req = &eNB->HI_DCI0_req[CC_id].hi_dci0_request_body; //SR BSR - if ( (UE_list->UE_template[CC_id][UE_id].ul_total_buffer > 0) || (UE_list->UE_template[CC_id][UE_id].ul_SR > 0) ) { + UE_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; + if ( (UE_list->UE_template[CC_id][UE_id].ul_total_buffer > 0) || (UE_list->UE_template[CC_id][UE_id].ul_SR > 0) || + ((UE_sched_ctl->ul_inactivity_timer>20)&&(UE_sched_ctl->ul_scheduled==0)) || + ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED)) ){ hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi]; format_flag = 2; if (CCE_allocation_infeasible(module_idP,CC_id,format_flag,subframeP,aggregation,rnti) == 1) { @@ -2617,7 +2628,7 @@ void ulsch_scheduler_pre_ue_select( } } //inactivity UE - if ( (ulsch_ue_select[CC_id].ue_num+ul_inactivity_num[CC_id]) < ulsch_ue_max_num[CC_id] ) { +/* if ( (ulsch_ue_select[CC_id].ue_num+ul_inactivity_num[CC_id]) < ulsch_ue_max_num[CC_id] ) { UE_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; if ( ((UE_sched_ctl->ul_inactivity_timer>20)&&(UE_sched_ctl->ul_scheduled==0)) || ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) { @@ -2625,7 +2636,7 @@ void ulsch_scheduler_pre_ue_select( ul_inactivity_num[CC_id]++; continue; } - } + }*/ } for ( CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++ ) { From 0504659eb8b764bc0f819d4f3ef513fad7df8ef4 Mon Sep 17 00:00:00 2001 From: Wu Jing Date: Sat, 24 Feb 2018 15:16:17 +0900 Subject: [PATCH 37/63] fix RM778 PRACH failure by adding reset RA when CRNTI_ACK in extract_harq --- .../LAYER2/MAC/eNB_scheduler_primitives.c | 22 +++++++++++++++---- openair2/LAYER2/MAC/pre_processor.c | 9 ++++++++ openair2/LAYER2/MAC/rar_tools.c | 7 +++++- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 7f933a192a..2b0b5d7e53 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1475,9 +1475,9 @@ fill_nfapi_harq_information(module_id_t module_idP, harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling } harq_information->harq_information_rel10_tdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG; - harq_information->harq_information_rel10_tdd.n_pucch_1_0 = - cc->radioResourceConfigCommon->pucch_ConfigCommon. - n1PUCCH_AN + cce_idxP; + LTE_DL_FRAME_PARMS *frame_parms = &RC.eNB[module_idP][CC_idP]->frame_parms; + harq_information->harq_information_rel10_tdd.n_pucch_1_0 = get_Np(frame_parms->N_RB_DL,cce_idxP,0) + + cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP; harq_information-> harq_information_rel10_tdd.number_of_pucch_resources = 1; } else { @@ -3860,7 +3860,21 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id, if( sched_ctl->round[CC_idP][harq_pid]<8) sched_ctl->round[CC_idP][harq_pid]++; } - } + } + RA_t *ra = &RC.mac[mod_idP]->common_channels[CC_idP].ra[0]; + for (uint8_t ra_i = 0; ra_i < NB_RA_PROC_MAX; ra_i++) { + if ((ra[ra_i].rnti == rnti) && (ra[ra_i].state == MSGCRNTI_ACK) && (ra[ra_i].crnti_harq_pid == harq_pid)) { + LOG_D(MAC,"CRNTI Reconfiguration: ACK %d rnti %x round %d frame %d subframe %d \n",harq_indication_tdd->harq_data[0].bundling.value_0,rnti,sched_ctl->round[CC_idP][harq_pid],frameP,subframeP); + if(num_ack_nak == 1 && harq_indication_tdd->harq_data[0].bundling.value_0 == 1) { + cancel_ra_proc(mod_idP, CC_idP, frameP, ra[ra_i].rnti); + }else{ + if(sched_ctl->round[CC_idP][harq_pid] == 7){ + cancel_ra_proc(mod_idP, CC_idP, frameP, ra[ra_i].rnti); + } + } + break; + } + } } break; case 1: // Channel Selection diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index b09601a0ac..497c896133 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -2843,12 +2843,21 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); } }else{ + if (cc->tdd_Config && frame_parms->N_RB_UL == 100) { + while ( (tbs < UE_template->ul_total_buffer) && (rb_table[rb_table_index]<(frame_parms->N_RB_UL-3-first_rb[CC_id])) && + ((UE_template->phr_info - tx_power) > 0) && (rb_table_index < 32 )) { + rb_table_index++; + tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; + tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); + } + } else { while ( (tbs < UE_template->ul_total_buffer) && (rb_table[rb_table_index]<(frame_parms->N_RB_UL-2-first_rb[CC_id])) && ((UE_template->phr_info - tx_power) > 0) && (rb_table_index < 32 )) { rb_table_index++; tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); } + } } if ( rb_table[rb_table_index]<3 ) { rb_table_index=2; diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c index f48a53636f..4af67c8316 100644 --- a/openair2/LAYER2/MAC/rar_tools.c +++ b/openair2/LAYER2/MAC/rar_tools.c @@ -71,10 +71,15 @@ fill_rar(const module_id_t module_idP, ra->timing_offset /= 16; //T_A = N_TA/16, where N_TA should be on a 30.72Msps rar[0] = (uint8_t) (ra->timing_offset >> (2 + 4)); // 7 MSBs of timing advance + divide by 4 rar[1] = (uint8_t) (ra->timing_offset << (4 - 2)) & 0xf0; // 4 LSBs of timing advance + divide by 4 + COMMON_channels_t *cc = &RC.mac[module_idP]->common_channels[CC_id]; if(N_RB_UL == 25){ ra->msg3_first_rb = 1; }else{ - ra->msg3_first_rb = 2; + if (cc->tdd_Config && N_RB_UL == 100) { + ra->msg3_first_rb = 3; + } else { + ra->msg3_first_rb = 2; + } } ra->msg3_nb_rb = 1; uint16_t rballoc = mac_computeRIV(N_RB_UL, ra->msg3_first_rb, ra->msg3_nb_rb); // first PRB only for UL Grant From 699bbcb80fef8cf699d3138c64846e70cef1b55f Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Sat, 24 Feb 2018 17:27:18 +0800 Subject: [PATCH 38/63] simplify source of ulsch_scheduler_pre_processor --- openair2/LAYER2/MAC/pre_processor.c | 93 +++++++---------------------- 1 file changed, 21 insertions(+), 72 deletions(-) diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 497c896133..6ff45e732f 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -2696,6 +2696,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, uint16_t first_rb[MAX_NUM_CCs]; uint8_t mcs; uint8_t rb_table_index; + uint8_t num_pucch_rb; uint32_t tbs; int16_t tx_power; int UE_id; @@ -2711,19 +2712,21 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, frame_parms = &(RC.eNB[module_idP][CC_id]->frame_parms); if (cc->tdd_Config) { //TDD if (frame_parms->N_RB_UL == 25) { - first_rb[CC_id] = 1; + num_pucch_rb = 1; } else if (frame_parms->N_RB_UL == 50) { - first_rb[CC_id] = 2; + num_pucch_rb = 2; } else { - first_rb[CC_id] = 3; + num_pucch_rb = 3; } } else {//FDD if (frame_parms->N_RB_UL == 25) { - first_rb[CC_id] = 1; + num_pucch_rb = 1; } else { - first_rb[CC_id] = 2; + num_pucch_rb = 2; } } + + first_rb[CC_id] = num_pucch_rb; ue_num_temp = ulsch_ue_select[CC_id].ue_num; for ( ulsch_ue_num = 0; ulsch_ue_num < ulsch_ue_select[CC_id].ue_num; ulsch_ue_num++ ) { @@ -2742,51 +2745,14 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, } rnti = UE_RNTI(CC_id,UE_id); - if (cc->tdd_Config) { - if (frame_parms->N_RB_UL == 25) { - if (first_rb[CC_id] >= frame_parms->N_RB_UL-1 ) { - LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", - module_idP,frameP,subframeP,UE_id,rnti,CC_id); - break; - } - // calculate the average rb ( remain UE) - total_rbs = frame_parms->N_RB_UL-1-first_rb[CC_id]; - } else if (frame_parms->N_RB_UL == 50) { - if (first_rb[CC_id] >= frame_parms->N_RB_UL-2 ) { - LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", - module_idP,frameP,subframeP,UE_id,rnti,CC_id); - break; - } - // calculate the average rb ( remain UE) - total_rbs = frame_parms->N_RB_UL-2-first_rb[CC_id]; - } else { - if (first_rb[CC_id] >= frame_parms->N_RB_UL-3 ) { - LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", - module_idP,frameP,subframeP,UE_id,rnti,CC_id); - break; - } - // calculate the average rb ( remain UE) - total_rbs = frame_parms->N_RB_UL-3-first_rb[CC_id]; - } - } else { - if(frame_parms->N_RB_UL == 25){ - if ( first_rb[CC_id] >= frame_parms->N_RB_UL-1 ){ - LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", - module_idP,frameP,subframeP,UE_id,rnti,CC_id); - break; - } - // calculate the average rb ( remain UE) - total_rbs = frame_parms->N_RB_UL-1-first_rb[CC_id]; - }else{ - if ( first_rb[CC_id] >= frame_parms->N_RB_UL-2 ){ - LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", - module_idP,frameP,subframeP,UE_id,rnti,CC_id); - break; - } - // calculate the average rb ( remain UE) - total_rbs = frame_parms->N_RB_UL-2-first_rb[CC_id]; - } + + if (first_rb[CC_id] >= frame_parms->N_RB_UL-num_pucch_rb ) { + LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", + module_idP,frameP,subframeP,UE_id,rnti,CC_id); + break; } + total_rbs = frame_parms->N_RB_UL-num_pucch_rb-first_rb[CC_id]; + average_rbs = (int)round((double)total_rbs/(double)ue_num_temp); if ( average_rbs < 3 ) { ue_num_temp--; @@ -2835,30 +2801,13 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); } - if(frame_parms->N_RB_UL == 25){ - while ( (tbs < UE_template->ul_total_buffer) && (rb_table[rb_table_index]<(frame_parms->N_RB_UL-1-first_rb[CC_id])) && - ((UE_template->phr_info - tx_power) > 0) && (rb_table_index < 32 )) { - rb_table_index++; - tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; - tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); - } - }else{ - if (cc->tdd_Config && frame_parms->N_RB_UL == 100) { - while ( (tbs < UE_template->ul_total_buffer) && (rb_table[rb_table_index]<(frame_parms->N_RB_UL-3-first_rb[CC_id])) && - ((UE_template->phr_info - tx_power) > 0) && (rb_table_index < 32 )) { - rb_table_index++; - tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; - tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); - } - } else { - while ( (tbs < UE_template->ul_total_buffer) && (rb_table[rb_table_index]<(frame_parms->N_RB_UL-2-first_rb[CC_id])) && - ((UE_template->phr_info - tx_power) > 0) && (rb_table_index < 32 )) { - rb_table_index++; - tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; - tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); - } - } + while ( (tbs < UE_template->ul_total_buffer) && (rb_table[rb_table_index]<(frame_parms->N_RB_UL-num_pucch_rb-first_rb[CC_id])) && + ((UE_template->phr_info - tx_power) > 0) && (rb_table_index < 32 )) { + rb_table_index++; + tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; + tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); } + if ( rb_table[rb_table_index]<3 ) { rb_table_index=2; } From 9f31d41b4497ba3a0cf1417547ce47e3bb661e26 Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Mon, 26 Feb 2018 17:31:43 +0800 Subject: [PATCH 39/63] Add the setting ofharq_information_rel10_tdd.n_pucch_1_0 for tdd in allocate_CCEs --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 2b0b5d7e53..272e8b383a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3511,8 +3511,12 @@ allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, if(((ul_req->ul_config_pdu_list[ack_int].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) || (ul_req->ul_config_pdu_list[ack_int].pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE)) && (ul_req->ul_config_pdu_list[ack_int].uci_harq_pdu.ue_information.ue_information_rel8.rnti == dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti)){ - ul_req->ul_config_pdu_list[ack_int].uci_harq_pdu.harq_information.harq_information_rel9_fdd.n_pucch_1_0 = + if (cc->tdd_Config==NULL) + ul_req->ul_config_pdu_list[ack_int].uci_harq_pdu.harq_information.harq_information_rel9_fdd.n_pucch_1_0 = cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + fCCE; + else + ul_req->ul_config_pdu_list[ack_int].uci_harq_pdu.harq_information.harq_information_rel10_tdd.n_pucch_1_0 = + cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + fCCE + get_Np(to_prb(cc->mib->message.dl_Bandwidth),fCCE,0) ; } } } @@ -3852,13 +3856,16 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id, else frame_tx = subframeP < 4 ? frameP -1 : frameP; harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame_tx,subframe_tx); + if(num_ack_nak==1){ if(harq_indication_tdd->harq_data[0].bundling.value_0==1){ //ack sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process sched_ctl->tbcnt[CC_idP][harq_pid] = 0; + LOG_D(MAC,"frame %d subframe %d Acking (%d,%d) harq_pid %d round %d\n",frameP,subframeP,frame_tx,subframe_tx,harq_pid,sched_ctl->round[CC_idP][harq_pid]); }else{ //nack if( sched_ctl->round[CC_idP][harq_pid]<8) sched_ctl->round[CC_idP][harq_pid]++; + LOG_D(MAC,"frame %d subframe %d Nacking (%d,%d) harq_pid %d round %d\n",frameP,subframeP,frame_tx,subframe_tx,harq_pid,sched_ctl->round[CC_idP][harq_pid]); } } RA_t *ra = &RC.mac[mod_idP]->common_channels[CC_idP].ra[0]; From 5808ce3934dff6bdd64d9fff1f431b6d01179893 Mon Sep 17 00:00:00 2001 From: "Wang.shanshan" Date: Mon, 26 Feb 2018 20:21:16 +0900 Subject: [PATCH 40/63] Fix:harq_pid for TDD is not completely fixed in pre processer. --- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 9 ++------- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 6 +----- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 2 ++ openair2/LAYER2/MAC/pre_processor.c | 18 ++++++------------ 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index f14cce1707..03ec9ddcf9 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -853,10 +853,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, // set HARQ process round to 0 for this UE - if (cc->tdd_Config) ra->harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); - else - ra->harq_pid = ((frameP * 10) + subframeP) & 7; // Get RRCConnectionSetup for Piggyback rrc_sdu_length = mac_rrc_data_req(module_idP, CC_idP, frameP, CCCH, 1, // 1 transport block @@ -1310,10 +1307,8 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, lcid = 0; // put HARQ process round to 0 - if (cc->tdd_Config) - ra->harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); - else - ra->harq_pid = ((frameP * 10) + subframeP) & 7; + ra->harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); + UE_list->UE_sched_ctrl[UE_id].round[CC_idP][ra->harq_pid] = 0; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index bb73f8c8bb..768a9926f5 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -689,10 +689,7 @@ schedule_ue_spec(module_id_t module_idP, nb_available_rb = ue_sched_ctl->pre_nb_available_rbs[CC_id]; - if (cc->tdd_Config) harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); - else - harq_pid = ((frameP * 10) + subframeP) & 7; round = ue_sched_ctl->round[CC_id][harq_pid]; @@ -1609,8 +1606,7 @@ fill_DLSCH_dci( // clear scheduling flag eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_WAITING; rnti = UE_RNTI(module_idP,UE_id); - if (cc->tdd_Config) harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); - else harq_pid = ((frameP*10)+subframeP)&7; + harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 272e8b383a..41db5b3d90 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -3789,6 +3789,8 @@ uint8_t frame_subframe2_dl_harq_pid(TDD_Config_t *tdd_Config, int abs_frameP, su return harq_pid; break; } + }else{ + return ((abs_frameP*10)+subframeP)&7; } return -1; } diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 6ff45e732f..0a0a3e014e 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -299,10 +299,8 @@ maxround(module_id_t Mod_id, uint16_t rnti, int frame, cc = &RC.mac[Mod_id]->common_channels[CC_id]; UE_id = find_UE_id(Mod_id, rnti); - if (cc->tdd_Config) - harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame ,subframe); - else - harq_pid = ((frame * 10) + subframe) & 7; + + harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame ,subframe); round = UE_list->UE_sched_ctrl[UE_id].round[CC_id][harq_pid]; if (round > round_max) { @@ -676,8 +674,7 @@ void dlsch_scheduler_pre_ue_select( continue; } #endif - if (cc[CC_id].tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; - else harq_pid = ((frameP*10)+subframeP)&7; + harq_pid = frame_subframe2_dl_harq_pid(cc[CC_id].tdd_Config,frameP ,subframeP); round = ue_sched_ctl->round[CC_id][harq_pid]; if (round != 8) { // retransmission @@ -791,8 +788,7 @@ void dlsch_scheduler_pre_ue_select( if(i < dlsch_ue_select[CC_id].ue_num) continue; - if (cc[CC_id].tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; - else harq_pid = ((frameP*10)+subframeP)&7; + harq_pid = frame_subframe2_dl_harq_pid(cc[CC_id].tdd_Config,frameP ,subframeP); round = ue_sched_ctl->round[CC_id][harq_pid]; if (round == 8) { @@ -905,8 +901,7 @@ void dlsch_scheduler_pre_ue_select( if(i < dlsch_ue_select[CC_id].ue_num) continue; - if (cc[CC_id].tdd_Config) harq_pid = ((frameP*10)+subframeP)%10; - else harq_pid = ((frameP*10)+subframeP)&7; + harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); round = ue_sched_ctl->round[CC_id][harq_pid]; if (round == 8) { @@ -1128,8 +1123,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, rnti = dlsch_ue_select[CC_id].list[i].rnti; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; - if (cc->tdd_Config) harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); - else harq_pid = ((frameP*10)+subframeP)&7; + harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); Round = ue_sched_ctl->round[CC_id][harq_pid]; //if (mac_eNB_get_rrc_status(Mod_id, rnti) < RRC_RECONFIGURED || round > 0) { From dab82a27056b493ed9e59a9d98f516fac5afc01a Mon Sep 17 00:00:00 2001 From: Xu Bo Date: Tue, 27 Feb 2018 11:24:44 +0900 Subject: [PATCH 41/63] fix for-loop index in pdate_ul_dci --- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 768a9926f5..39bed78c37 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -1703,7 +1703,7 @@ update_ul_dci(module_id_t module_idP, for (i = 0; i < HI_DCI0_req->hi_dci0_request_body.number_of_dci + - HI_DCI0_req->hi_dci0_request_body.number_of_dci; i++) { + HI_DCI0_req->hi_dci0_request_body.number_of_hi; i++) { if ((hi_dci0_pdu[i].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) && (hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti == rntiP)) From 87fb55c79271c75f671eac7225135d7f294c3d9d Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Tue, 27 Feb 2018 11:55:53 +0800 Subject: [PATCH 42/63] Fix a bug in previous commit Fix:harq_pid.... --- openair2/LAYER2/MAC/pre_processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 0a0a3e014e..ef25fbf718 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -901,7 +901,7 @@ void dlsch_scheduler_pre_ue_select( if(i < dlsch_ue_select[CC_id].ue_num) continue; - harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); + harq_pid = frame_subframe2_dl_harq_pid(cc[CC_id].tdd_Config,frameP ,subframeP); round = ue_sched_ctl->round[CC_id][harq_pid]; if (round == 8) { From c9f89db89bf63cc624a4edf2cadda79efe379829 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 3 Jan 2018 11:19:54 +0100 Subject: [PATCH 43/63] hotfix: clear DCI padding bits The problem is the following (as reported by an user): "one UE is attached to OAI system. UE is near the antenna. Try to detach the UE and attach again. Repeat this procedure for 5-6 times. OAI system does not work and any the UE can not attach to this system. I use TEMS software and I can see MIB signaling on this UE but UE can not decode SIB1 and SIB2." What happens is that the DCI for SIB1 and SIB2 is not cleared before use. That is the bits in the 'padding' field keep the values that were set before. If the structure has been used to transmit other DCIs (eg. for UEs) in the past, it may be reused with some of those bits set to 1. When receiving this DCI, the UE won't accept it because it gets some bits at 1 where it expects them to be 0. The short-term/quick solution is to clear the 'padding' field. A better solution would be to rewrite this part of the code, which is way too complicated for what it does. But this takes too much time. In dci.h the field 'dummy' of some structures was renamed to 'padding'. The fields 'padding32' and 'padding64' were also renamed to 'padding' for consistency. Some structures (DCI2B_1_5MHz_TDD, DCI2B_10MHz_FDD, DCI2D_1_5MHz_FDD, DCI2D_5MHz_FDD, DCI2D_10MHz_FDD) had a 'padding' field at the end, which was renamed to 'padding0'. I don't know if this field should be here at all. To me this field looks very suspicious. When we test DCIs 2B and 2D we should be careful. (cherry picked from commit c5ca2bd86227d958175f2a5569546c1d60179d07) --- openair1/PHY/LTE_TRANSPORT/dci.h | 140 ++++++++++++------------- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 88 ++++++++++++---- 2 files changed, 135 insertions(+), 93 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.h b/openair1/PHY/LTE_TRANSPORT/dci.h index 0e74324b2c..9381dd63fd 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci.h +++ b/openair1/PHY/LTE_TRANSPORT/dci.h @@ -482,8 +482,8 @@ typedef struct DCI1A_20MHz_FDD DCI1A_20MHz_FDD_t; /// DCI Format Type 1 (1.5 MHz, TDD, 23 bits) struct DCI1_1_5MHz_TDD { - /// Dummy bits to align to 32-bits - uint32_t dummy:9; + /// padding bits to align to 32-bits + uint32_t padding:9; /// DAI (TDD) uint32_t dai:2; /// Power Control @@ -507,8 +507,8 @@ typedef struct DCI1_1_5MHz_TDD DCI1_1_5MHz_TDD_t; /// DCI Format Type 1 (5 MHz, TDD, 30 bits) struct DCI1_5MHz_TDD { - /// Dummy bits to align to 32-bits - uint32_t dummy:2; + /// padding bits to align to 32-bits + uint32_t padding:2; /// DAI (TDD) uint32_t dai:2; /// Power Control @@ -532,8 +532,8 @@ typedef struct DCI1_5MHz_TDD DCI1_5MHz_TDD_t; /// DCI Format Type 1 (10 MHz, TDD, 34 bits) struct DCI1_10MHz_TDD { - /// Dummy bits to align to 64-bits - uint64_t dummy:30; + /// padding bits to align to 64-bits + uint64_t padding:30; /// DAI (TDD) uint64_t dai:2; /// Power Control @@ -557,8 +557,8 @@ typedef struct DCI1_10MHz_TDD DCI1_10MHz_TDD_t; /// DCI Format Type 1 (20 MHz, TDD, 42 bits) struct DCI1_20MHz_TDD { - /// Dummy bits to align to 64-bits - uint64_t dummy:22; + /// padding bits to align to 64-bits + uint64_t padding:22; /// DAI (TDD) uint64_t dai:2; /// Power Control @@ -582,8 +582,8 @@ typedef struct DCI1_20MHz_TDD DCI1_20MHz_TDD_t; /// DCI Format Type 1 (1.5 MHz, FDD, 21 bits) struct DCI1_1_5MHz_FDD { - /// Dummy bits to align to 32-bits - uint32_t dummy:11; + /// padding bits to align to 32-bits + uint32_t padding:11; /// Power Control uint32_t TPC:2; /// Redundancy version @@ -605,8 +605,8 @@ typedef struct DCI1_1_5MHz_FDD DCI1_1_5MHz_FDD_t; /// DCI Format Type 1 (5 MHz, FDD, 27 bits) struct DCI1_5MHz_FDD { - /// dummy bits (not transmitted) - uint32_t dummy:5; + /// padding its (not transmitted) + uint32_t padding:5; /// Power Control uint32_t TPC:2; /// Redundancy version @@ -628,8 +628,8 @@ typedef struct DCI1_5MHz_FDD DCI1_5MHz_FDD_t; /// DCI Format Type 1 (10 MHz, FDD, 31 bits) struct DCI1_10MHz_FDD { - /// dummy bits (not transmitted) - uint32_t dummy:1; + /// padding bits (not transmitted) + uint32_t padding:1; /// Power Control uint32_t TPC:2; /// Redundancy version @@ -651,8 +651,8 @@ typedef struct DCI1_10MHz_FDD DCI1_10MHz_FDD_t; /// DCI Format Type 1 (20 MHz, FDD, 39 bits) struct DCI1_20MHz_FDD { - /// dummy bits (not transmitted) - uint64_t dummy:25; + /// padding bits (not transmitted) + uint64_t padding:25; /// Power Control uint64_t TPC:2; /// Redundancy version @@ -674,10 +674,8 @@ typedef struct DCI1_20MHz_FDD DCI1_20MHz_FDD_t; /// DCI Format Type 1A (5 MHz, TDD, frame 1-6, 27 bits) struct DCI1A_RA_5MHz_TDD_1_6 { - /// Dummy bits to align to 32-bits - uint32_t dummy:5; - /// Padding - uint32_t padding:6; + /// padding bits to align to 32-bits + uint32_t padding:11; /// PRACH mask index uint32_t prach_mask_index:4; /// Preamble Index @@ -822,7 +820,7 @@ typedef struct DCI1B_5MHz_4A_TDD DCI1B_5MHz_4A_TDD_t; struct DCI1C_1_5MHz { /// padding to 32bits - uint32_t padding32:24; + uint32_t padding:24; uint32_t mcs:5; uint32_t rballoc:3; // N_RB_step = 2, Ngap=Ngap1=3, NDLVRBGap = 6, ceil(log2((3*4)/2)) = 3 } __attribute__ ((__packed__)); @@ -836,7 +834,7 @@ typedef struct DCI1C_1_5MHz DCI1C_1_5MHz_t; struct DCI1C_5MHz { /// padding to 32bits - uint32_t padding32:20; + uint32_t padding:20; uint32_t mcs:5; uint32_t rballoc:7; // N_RB_step = 2, Ngap1=Ngap2=12, NDLVRBGap = 24, ceil(log2((12*13)/2)) = 7 } __attribute__ ((__packed__)); @@ -848,7 +846,7 @@ typedef struct DCI1C_5MHz DCI1C_5MHz_t; struct DCI1C_10MHz { /// padding to 32bits - uint32_t padding32:19; + uint32_t padding:19; uint32_t mcs:5; uint32_t rballoc:7; // N_RB_step = 4, Ngap1=27, NDLVRBGap = 46, ceil(log2(((11*12)/2)) = 7 uint32_t Ngap:1; @@ -861,7 +859,7 @@ typedef struct DCI1C_10MHz DCI1C_10MHz_t; struct DCI1C_15MHz { /// padding to 32bits - uint32_t padding32:18; + uint32_t padding:18; uint32_t mcs:5; uint32_t rballoc:8; // N_RB_step = 4, Ngap1=64, ceil(log2((16*17)/2)) = 8 uint32_t Ngap:1; @@ -874,7 +872,7 @@ typedef struct DCI1C_15MHz DCI1C_15MHz_t; struct DCI1C_20MHz { /// padding to 32bits - uint32_t padding32:17; + uint32_t padding:17; uint32_t mcs:5; uint32_t rballoc:9; // N_RB_step = 4, Ngap1=48, ceil(log2((24*25)/2)) = 9 uint32_t Ngap:1; @@ -1006,7 +1004,7 @@ typedef struct DCI1D_5MHz_4A_TDD DCI1D_5MHz_4A_TDD_t; /// DCI Format Type 1E (5 MHz, TDD, 2 Antenna Ports, more than 10 PRBs, 34 bits) struct DCI1E_5MHz_2A_M10PRB_TDD { /// padding to 64bits - uint64_t padding64:30; + uint64_t padding:30; /// Redundancy version 2 ///uint64_t rv2:2; /// New Data Indicator 2 @@ -1045,7 +1043,7 @@ typedef struct DCI1E_5MHz_2A_M10PRB_TDD DCI1E_5MHz_2A_M10PRB_TDD_t; /// DCI Format Type 2 (1.5 MHz, TDD, 2 Antenna Ports, 34 bits) struct DCI2_1_5MHz_2A_TDD { /// padding to 64bits - uint64_t padding64:30; + uint64_t padding:30; /// TPMI information for precoding uint64_t tpmi:3; /// Redundancy version 2 @@ -1078,7 +1076,7 @@ typedef struct DCI2_1_5MHz_2A_TDD DCI2_1_5MHz_2A_TDD_t; /// DCI Format Type 2 (1.5 MHz, TDD, 4 Antenna Ports, 37 bits) struct DCI2_1_5MHz_4A_TDD { /// padding for 64-bit - uint64_t padding64:27; + uint64_t padding:27; /// TPMI information for precoding uint64_t tpmi:6; /// Redundancy version 2 @@ -1111,7 +1109,7 @@ typedef struct DCI2_1_5MHz_4A_TDD DCI2_1_5MHz_4A_TDD_t; /// DCI Format Type 2 (5 MHz, TDD, 2 Antenna Ports, 42 bits) struct DCI2_5MHz_2A_TDD { /// padding to 64bits - uint64_t padding64:22; + uint64_t padding:22; /// TPMI information for precoding uint64_t tpmi:3; /// Redundancy version 2 @@ -1146,7 +1144,7 @@ typedef struct DCI2_5MHz_2A_TDD DCI2_5MHz_2A_TDD_t; /// DCI Format Type 2 (5 MHz, TDD, 4 Antenna Ports, 45 bits) struct DCI2_5MHz_4A_TDD { /// padding for 64-bit - uint64_t padding64:19; + uint64_t padding:19; /// TPMI information for precoding uint64_t tpmi:6; /// Redundancy version 2 @@ -1181,7 +1179,7 @@ typedef struct DCI2_5MHz_4A_TDD DCI2_5MHz_4A_TDD_t; /// DCI Format Type 2 (10 MHz, TDD, 2 Antenna Ports, 46 bits) struct DCI2_10MHz_2A_TDD { /// padding to 64bits - uint64_t padding64:18; + uint64_t padding:18; /// TPMI information for precoding uint64_t tpmi:3; /// Redundancy version 2 @@ -1216,7 +1214,7 @@ typedef struct DCI2_10MHz_2A_TDD DCI2_10MHz_2A_TDD_t; /// DCI Format Type 2 (10 MHz, TDD, 4 Antenna Ports, 49 bits) struct DCI2_10MHz_4A_TDD { /// padding for 64-bit - uint64_t padding64:15; + uint64_t padding:15; /// TPMI information for precoding uint64_t tpmi:6; /// Redundancy version 2 @@ -1251,7 +1249,7 @@ typedef struct DCI2_10MHz_4A_TDD DCI2_10MHz_4A_TDD_t; /// DCI Format Type 2 (20 MHz, TDD, 2 Antenna Ports, 54 bits) struct DCI2_20MHz_2A_TDD { /// padding to 64bits - uint64_t padding64:10; + uint64_t padding:10; /// TPMI information for precoding uint64_t tpmi:3; /// Redundancy version 2 @@ -1286,7 +1284,7 @@ typedef struct DCI2_20MHz_2A_TDD DCI2_20MHz_2A_TDD_t; /// DCI Format Type 2 (20 MHz, TDD, 4 Antenna Ports, 57 bits) struct DCI2_20MHz_4A_TDD { /// padding for 64-bit - uint64_t padding64:7; + uint64_t padding:7; /// TPMI information for precoding uint64_t tpmi:6; /// Redundancy version 2 @@ -1321,7 +1319,7 @@ typedef struct DCI2_20MHz_4A_TDD DCI2_20MHz_4A_TDD_t; /// DCI Format Type 2 (1.5 MHz, FDD, 2 Antenna Ports, 31 bits) struct DCI2_1_5MHz_2A_FDD { //padding for 32 bits - uint32_t padding32:1; + uint32_t padding:1; /// precoding bits uint32_t tpmi:3; /// Redundancy version 2 @@ -1352,7 +1350,7 @@ typedef struct DCI2_1_5MHz_2A_FDD DCI2_1_5MHz_2A_FDD_t; /// DCI Format Type 2 (1.5 MHz, FDD, 4 Antenna Ports, 34 bits) struct DCI2_1_5MHz_4A_FDD { /// padding for 32 bits - uint64_t padding64:30; + uint64_t padding:30; /// precoding bits uint64_t tpmi:6; /// Redundancy version 2 @@ -1383,7 +1381,7 @@ typedef struct DCI2_1_5MHz_4A_FDD DCI2_1_5MHz_4A_FDD_t; /// DCI Format Type 2 (5 MHz, FDD, 2 Antenna Ports, 39 bits) struct DCI2_5MHz_2A_FDD { /// padding for 64-bit - uint64_t padding64:25; + uint64_t padding:25; /// TPMI information for precoding uint64_t tpmi:3; /// Redundancy version 2 @@ -1416,7 +1414,7 @@ typedef struct DCI2_5MHz_2A_FDD DCI2_5MHz_2A_FDD_t; /// DCI Format Type 2 (5 MHz, TDD, 4 Antenna Ports, 42 bits) struct DCI2_5MHz_4A_FDD { /// padding for 64-bit - uint64_t padding64:21; + uint64_t padding:21; /// TPMI information for precoding uint64_t tpmi:6; /// Redundancy version 2 @@ -1448,7 +1446,7 @@ typedef struct DCI2_5MHz_4A_FDD DCI2_5MHz_4A_FDD_t; /// DCI Format Type 2 (10 MHz, FDD, 2 Antenna Ports, 43 bits) struct DCI2_10MHz_2A_FDD { /// padding for 64-bit - uint64_t padding64:21; + uint64_t padding:21; /// TPMI information for precoding uint64_t tpmi:3; /// Redundancy version 2 @@ -1481,7 +1479,7 @@ typedef struct DCI2_10MHz_2A_FDD DCI2_10MHz_2A_FDD_t; /// DCI Format Type 2 (5 MHz, TDD, 4 Antenna Ports, 46 bits) struct DCI2_10MHz_4A_FDD { /// padding for 64-bit - uint64_t padding64:18; + uint64_t padding:18; /// TPMI information for precoding uint64_t tpmi:6; /// Redundancy version 2 @@ -1513,7 +1511,7 @@ typedef struct DCI2_10MHz_4A_FDD DCI2_10MHz_4A_FDD_t; /// DCI Format Type 2 (20 MHz, FDD, 2 Antenna Ports, 51 bits) struct DCI2_20MHz_2A_FDD { /// padding for 64-bit - uint64_t padding64:13; + uint64_t padding:13; /// TPMI information for precoding uint64_t tpmi:3; /// Redundancy version 2 @@ -1546,7 +1544,7 @@ typedef struct DCI2_20MHz_2A_FDD DCI2_20MHz_2A_FDD_t; /// DCI Format Type 2 (20 MHz, FDD, 4 Antenna Ports, 54 bits) struct DCI2_20MHz_4A_FDD { /// padding for 64-bit - uint64_t padding64:10; + uint64_t padding:10; /// TPMI information for precoding uint64_t tpmi:6; /// Redundancy version 2 @@ -2083,7 +2081,7 @@ typedef struct DCI2A_20MHz_4A_FDD DCI2A_20MHz_4A_FDD_t; // ******************************************************************* /// DCI Format Type 2B (1.5 MHz, TDD, 33 bits) struct DCI2B_1_5MHz_TDD { - uint64_t padding64:31; + uint64_t padding:31; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2109,7 +2107,7 @@ struct DCI2B_1_5MHz_TDD { /// RB Assignment (ceil(log2(N_RB_DL/P)) bits) uint64_t rballoc:6; /// Padding for ambiguity - uint64_t padding:1; + uint64_t padding0:1; } __attribute__ ((__packed__)); typedef struct DCI2B_1_5MHz_TDD DCI2B_1_5MHz_TDD_t; @@ -2118,7 +2116,7 @@ typedef struct DCI2B_1_5MHz_TDD DCI2B_1_5MHz_TDD_t; /// DCI Format Type 2B (5 MHz, TDD, 39 bits) struct DCI2B_5MHz_TDD { /// padding to 64bits - uint64_t padding64:25; + uint64_t padding:25; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2153,7 +2151,7 @@ typedef struct DCI2B_5MHz_TDD DCI2B_5MHz_TDD_t; /// DCI Format Type 2B (10 MHz, TDD, 43 bits) struct DCI2B_10MHz_TDD { /// padding to 64bits - uint64_t padding64:21; + uint64_t padding:21; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2188,7 +2186,7 @@ typedef struct DCI2B_10MHz_TDD DCI2B_10MHz_TDD_t; /// DCI Format Type 2B (20 MHz, TDD, 51 bits) struct DCI2B_20MHz_TDD { /// padding to 64bits - uint64_t padding64:13; + uint64_t padding:13; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2223,7 +2221,7 @@ typedef struct DCI2B_20MHz_TDD DCI2B_20MHz_TDD_t; /// DCI Format Type 2B (1.5 MHz, FDD, 28 bits) struct DCI2B_1_5MHz_FDD { //padding for 32 bits - uint32_t padding32:4; + uint32_t padding:4; /// Redundancy version 2 uint32_t rv2:2; /// New Data Indicator 2 @@ -2252,7 +2250,7 @@ typedef struct DCI2B_1_5MHz_FDD DCI2B_1_5MHz_FDD_t; /// DCI Format Type 2B (5 MHz, FDD, 36 bits) struct DCI2B_5MHz_FDD { /// padding for 64-bit - uint64_t padding64:28; + uint64_t padding:28; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2283,7 +2281,7 @@ typedef struct DCI2B_5MHz_FDD DCI2B_5MHz_FDD_t; /// DCI Format Type 2B (10 MHz, FDD, 41 bits) struct DCI2B_10MHz_FDD { /// padding for 64-bit - uint64_t padding64:23; + uint64_t padding:23; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2307,7 +2305,7 @@ struct DCI2B_10MHz_FDD { /// Resource Allocation Header uint64_t rah:1; /// Padding for ambiguity - uint64_t padding:1; + uint64_t padding0:1; } __attribute__ ((__packed__)); #define sizeof_DCI2B_10MHz_FDD_t 41 @@ -2316,7 +2314,7 @@ typedef struct DCI2B_10MHz_FDD DCI2B_10MHz_FDD_t; /// DCI Format Type 2B (20 MHz, FDD, 48 bits) struct DCI2B_20MHz_FDD { /// padding for 64-bit - uint64_t padding64:16; + uint64_t padding:16; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2350,7 +2348,7 @@ typedef struct DCI2B_20MHz_FDD DCI2B_20MHz_FDD_t; /// DCI Format Type 2C (1.5 MHz, TDD, 34 bits) struct DCI2C_1_5MHz_TDD { - uint64_t padding64:30; + uint64_t padding:30; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2383,7 +2381,7 @@ typedef struct DCI2C_1_5MHz_TDD DCI2C_1_5MHz_TDD_t; /// DCI Format Type 2C (5 MHz, TDD, 41 bits) struct DCI2C_5MHz_TDD { /// padding to 64bits - uint64_t padding64:23; + uint64_t padding:23; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2418,7 +2416,7 @@ typedef struct DCI2C_5MHz_TDD DCI2C_5MHz_TDD_t; /// DCI Format Type 2C (10 MHz, TDD, 45 bits) struct DCI2C_10MHz_TDD { /// padding to 64bits - uint64_t padding64:19; + uint64_t padding:19; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2453,7 +2451,7 @@ typedef struct DCI2C_10MHz_TDD DCI2C_10MHz_TDD_t; /// DCI Format Type 2C (20 MHz, TDD, 53 bits) struct DCI2C_20MHz_TDD { /// padding to 64bits - uint64_t padding64:11; + uint64_t padding:11; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2488,7 +2486,7 @@ typedef struct DCI2C_20MHz_TDD DCI2C_20MHz_TDD_t; /// DCI Format Type 2C (1.5 MHz, FDD, 30 bits) struct DCI2C_1_5MHz_FDD { //padding for 32 bits - uint32_t padding32:2; + uint32_t padding:2; /// Redundancy version 2 uint32_t rv2:2; /// New Data Indicator 2 @@ -2517,7 +2515,7 @@ typedef struct DCI2C_1_5MHz_FDD DCI2C_1_5MHz_FDD_t; /// DCI Format Type 2C (5 MHz, FDD, 38 bits) struct DCI2C_5MHz_FDD { /// padding for 64-bit - uint64_t padding64:26; + uint64_t padding:26; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2548,7 +2546,7 @@ typedef struct DCI2C_5MHz_FDD DCI2C_5MHz_FDD_t; /// DCI Format Type 2C (10 MHz, FDD, 42 bits) struct DCI2C_10MHz_FDD { /// padding for 64-bit - uint64_t padding64:22; + uint64_t padding:22; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2579,7 +2577,7 @@ typedef struct DCI2C_10MHz_FDD DCI2C_10MHz_FDD_t; /// DCI Format Type 2C (20 MHz, FDD, 50 bits) struct DCI2C_20MHz_FDD { /// padding for 64-bit - uint64_t padding64:14; + uint64_t padding:14; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 @@ -2613,7 +2611,7 @@ typedef struct DCI2C_20MHz_FDD DCI2C_20MHz_FDD_t; /// DCI Format Type 2D (1.5 MHz, TDD, 36 bits) struct DCI2D_1_5MHz_TDD { - uint64_t padding64:28; + uint64_t padding:28; /// PDSCH REsource Mapping and Quasi-Co-Location Indicator uint64_t REMQCL:2; /// Redundancy version 2 @@ -2648,7 +2646,7 @@ typedef struct DCI2D_1_5MHz_TDD DCI2D_1_5MHz_TDD_t; /// DCI Format Type 2D (5 MHz, TDD, 43 bits) struct DCI2D_5MHz_TDD { /// padding to 64bits - uint64_t padding64:21; + uint64_t padding:21; /// PDSCH REsource Mapping and Quasi-Co-Location Indicator uint64_t REMQCL:2; /// Redundancy version 2 @@ -2685,7 +2683,7 @@ typedef struct DCI2D_5MHz_TDD DCI2D_5MHz_TDD_t; /// DCI Format Type 2D (10 MHz, TDD, 47 bits) struct DCI2D_10MHz_TDD { /// padding to 64bits - uint64_t padding64:17; + uint64_t padding:17; /// PDSCH REsource Mapping and Quasi-Co-Location Indicator uint64_t REMQCL:2; /// Redundancy version 2 @@ -2722,7 +2720,7 @@ typedef struct DCI2D_10MHz_TDD DCI2D_10MHz_TDD_t; /// DCI Format Type 2D (20 MHz, TDD, 55 bits) struct DCI2D_20MHz_TDD { /// padding to 64bits - uint64_t padding64:9; + uint64_t padding:9; /// PDSCH REsource Mapping and Quasi-Co-Location Indicator uint64_t REMQCL:2; /// Redundancy version 2 @@ -2759,7 +2757,7 @@ typedef struct DCI2D_20MHz_TDD DCI2D_20MHz_TDD_t; /// DCI Format Type 2D (1.5 MHz, FDD, 33 bits) struct DCI2D_1_5MHz_FDD { //padding for 33 bits - uint64_t padding64:31; + uint64_t padding:31; /// PDSCH REsource Mapping and Quasi-Co-Location Indicator uint64_t REMQCL:2; /// Redundancy version 2 @@ -2783,7 +2781,7 @@ struct DCI2D_1_5MHz_FDD { /// RB Assignment (ceil(log2(N_RB_DL/P)) bits) uint64_t rballoc:6; /// padding for ambiguity - uint64_t padding; + uint64_t padding0; } __attribute__ ((__packed__)); typedef struct DCI2D_1_5MHz_FDD DCI2D_1_5MHz_FDD_t; @@ -2792,7 +2790,7 @@ typedef struct DCI2D_1_5MHz_FDD DCI2D_1_5MHz_FDD_t; /// DCI Format Type 2D (5 MHz, FDD, 41 bits) struct DCI2D_5MHz_FDD { /// padding for 64-bit - uint64_t padding64:23; + uint64_t padding:23; /// PDSCH REsource Mapping and Quasi-Co-Location Indicator uint64_t REMQCL:2; /// Redundancy version 2 @@ -2818,7 +2816,7 @@ struct DCI2D_5MHz_FDD { /// Resource Allocation Header uint64_t rah:1; /// padding for ambiguity - uint64_t padding:1; + uint64_t padding0:1; } __attribute__ ((__packed__)); #define sizeof_DCI2D_5MHz_FDD_t 41 @@ -2827,7 +2825,7 @@ typedef struct DCI2D_5MHz_FDD DCI2D_5MHz_FDD_t; /// DCI Format Type 2D (10 MHz, FDD, 45 bits) struct DCI2D_10MHz_FDD { /// padding for 64-bit - uint64_t padding64:19; + uint64_t padding:19; /// PDSCH REsource Mapping and Quasi-Co-Location Indicator uint64_t REMQCL:2; /// Redundancy version 2 @@ -2853,7 +2851,7 @@ struct DCI2D_10MHz_FDD { /// Resource Allocation Header uint64_t rah:1; /// padding for ambiguity - uint64_t padding:1; + uint64_t padding0:1; } __attribute__ ((__packed__)); #define sizeof_DCI2D_10MHz_FDD_t 45 @@ -2862,7 +2860,7 @@ typedef struct DCI2D_10MHz_FDD DCI2D_10MHz_FDD_t; /// DCI Format Type 2D (20 MHz, FDD, 52 bits) struct DCI2D_20MHz_FDD { /// padding for 64-bit - uint64_t padding64:12; + uint64_t padding:12; /// Redundancy version 2 uint64_t rv2:2; /// New Data Indicator 2 diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index ff31507979..d943b91d3a 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -1113,6 +1113,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->harq_pid = rel8->harq_process; ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->padding = 0; } else { dci_alloc->dci_length = sizeof_DCI1A_1_5MHz_FDD_t; @@ -1124,6 +1125,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; + ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n"); @@ -1142,7 +1144,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->padding = 0; // printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI1A_5MHz_FDD_t; @@ -1154,6 +1157,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1A_5MHz_FDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1A_5MHz_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_5MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; + ((DCI1A_5MHz_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n"); @@ -1172,7 +1176,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->padding = 0; // printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI1A_10MHz_FDD_t; @@ -1184,6 +1189,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1A_10MHz_FDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1A_10MHz_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_10MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; + ((DCI1A_10MHz_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n"); @@ -1203,7 +1209,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->padding = 0; // printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI1A_20MHz_FDD_t; @@ -1215,6 +1222,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1A_20MHz_FDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1A_20MHz_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1A_20MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; + ((DCI1A_20MHz_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } AssertFatal(rel8->virtual_resource_block_assignment_flag==LOCALIZED,"Distributed RB allocation not done yet\n"); @@ -1286,7 +1294,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1_1_5MHz_TDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1_1_5MHz_TDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1_1_5MHz_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI1_1_5MHz_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1_1_5MHz_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1_1_5MHz_TDD_t *)dci_pdu)->padding = 0; // printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI1_1_5MHz_FDD_t; @@ -1297,6 +1306,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1_1_5MHz_FDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1_1_5MHz_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1_1_5MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; + ((DCI1_1_5MHz_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } break; @@ -1310,7 +1320,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1_5MHz_TDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1_5MHz_TDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1_5MHz_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI1_5MHz_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1_5MHz_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1_5MHz_TDD_t *)dci_pdu)->padding = 0; // printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI1_5MHz_FDD_t; @@ -1321,6 +1332,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1_5MHz_FDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1_5MHz_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1_5MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; + ((DCI1_5MHz_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } break; @@ -1334,7 +1346,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1_10MHz_TDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1_10MHz_TDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1_10MHz_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI1_10MHz_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1_10MHz_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1_10MHz_TDD_t *)dci_pdu)->padding = 0; // printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI1_10MHz_FDD_t; @@ -1345,6 +1358,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1_10MHz_FDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1_10MHz_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1_10MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; + ((DCI1_10MHz_FDD_t *)dci_pdu)->padding = 0; } break; case 100: @@ -1357,7 +1371,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1_20MHz_TDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1_20MHz_TDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1_20MHz_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI1_20MHz_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1_20MHz_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI1_20MHz_TDD_t *)dci_pdu)->padding = 0; // printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI1_20MHz_FDD_t; @@ -1368,6 +1383,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI1_20MHz_FDD_t *)dci_pdu)->rv = rel8->redundancy_version_1; ((DCI1_20MHz_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI1_20MHz_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; + ((DCI1_20MHz_FDD_t *)dci_pdu)->padding = 0; } break; } @@ -1456,6 +1472,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2A_1_5MHz_2A_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process; ((DCI2A_1_5MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; ((DCI2A_1_5MHz_2A_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + /* there is no padding in this structure, it is exactly 32 bits */ // printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI2A_1_5MHz_2A_FDD_t; @@ -1470,6 +1487,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; ((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; + ((DCI2A_1_5MHz_2A_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } break; @@ -1486,8 +1504,9 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->rv2 = rel8->redundancy_version_2; ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; - ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; + ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI2A_5MHz_2A_TDD_t *)dci_pdu)->padding = 0; // printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI2A_5MHz_2A_FDD_t; @@ -1502,6 +1521,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; + ((DCI2A_5MHz_2A_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } break; @@ -1518,8 +1538,9 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->rv2 = rel8->redundancy_version_2; ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; - ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; + ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI2A_10MHz_2A_TDD_t *)dci_pdu)->padding = 0; // printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI2A_10MHz_2A_FDD_t; @@ -1533,7 +1554,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->rv2 = rel8->redundancy_version_2; ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; + ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; + ((DCI2A_10MHz_2A_FDD_t *)dci_pdu)->padding = 0; } break; case 100: @@ -1549,8 +1571,9 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->rv2 = rel8->redundancy_version_2; ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; - ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; + ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->padding = 0; // printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI2A_20MHz_2A_FDD_t; @@ -1564,7 +1587,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->rv2 = rel8->redundancy_version_2; ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI2A_20MHz_2A_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; + ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; + ((DCI2A_20MHz_2A_TDD_t *)dci_pdu)->padding = 0; } break; @@ -1803,6 +1827,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tpmi = rel8->precoding_information; + ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->padding = 0; // printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI2_1_5MHz_2A_FDD_t; @@ -1817,6 +1842,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tpmi = rel8->precoding_information; + ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } break; @@ -1836,6 +1862,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tpmi = rel8->precoding_information; + ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->padding = 0; // printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI2_5MHz_2A_FDD_t; @@ -1850,7 +1877,8 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; - ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tpmi = rel8->precoding_information; + ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tpmi = rel8->precoding_information; + ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->padding = 0; // printf("FDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } break; @@ -1870,6 +1898,7 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tpmi = rel8->precoding_information; + ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->padding = 0; // printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { dci_alloc->dci_length = sizeof_DCI2_10MHz_2A_FDD_t; @@ -1883,13 +1912,14 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv2 = rel8->redundancy_version_2; ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; + ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tpmi = rel8->precoding_information; + ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->padding = 0; } break; case 100: if (fp->frame_type == TDD) { - dci_alloc->dci_length = sizeof_DCI2_20MHz_2A_TDD_t; + dci_alloc->dci_length = sizeof_DCI2_20MHz_2A_TDD_t; ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rah = rel8->resource_allocation_type; ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->mcs1 = rel8->mcs_1; ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->mcs2 = rel8->mcs_2; @@ -1900,12 +1930,13 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv2 = rel8->redundancy_version_2; ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; - ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; + ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; + ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->dai = rel8->downlink_assignment_index; ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tpmi = rel8->precoding_information; + ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->padding = 0; // printf("TDD 1: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } else { - dci_alloc->dci_length = sizeof_DCI2_20MHz_2A_FDD_t; + dci_alloc->dci_length = sizeof_DCI2_20MHz_2A_FDD_t; ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rah = rel8->resource_allocation_type; ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->mcs1 = rel8->mcs_1; ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->mcs2 = rel8->mcs_2; @@ -1916,8 +1947,9 @@ LOG_D(PHY,"NFAPI: harq_pid %d harq_mask %x, round %d ndi (%d,%d) rnti type %d\n" ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv2 = rel8->redundancy_version_2; ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->TPC = rel8->tpc; ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->harq_pid = rel8->harq_process; - ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; + ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tb_swap = rel8->transport_block_to_codeword_swap_flag; ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tpmi = rel8->precoding_information; + ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->padding = 0; } break; @@ -2300,6 +2332,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d ((DCI6_1A_5MHz_t *)dci_pdu)->srs_req = rel13->srs_request; ((DCI6_1A_5MHz_t *)dci_pdu)->harq_ack_off = rel13->harq_resource_offset; ((DCI6_1A_5MHz_t *)dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number-1; + ((DCI6_1A_5MHz_t *)dci_pdu)->padding = 0; break; case 50: @@ -2316,6 +2349,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d ((DCI6_1A_10MHz_t *)dci_pdu)->srs_req = rel13->srs_request; ((DCI6_1A_10MHz_t *)dci_pdu)->harq_ack_off = rel13->harq_resource_offset; ((DCI6_1A_10MHz_t *)dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number-1; + ((DCI6_1A_10MHz_t *)dci_pdu)->padding = 0; break; case 100: dci_alloc->dci_length = sizeof_DCI6_1A_20MHz_t; @@ -2331,6 +2365,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d ((DCI6_1A_20MHz_t *)dci_pdu)->srs_req = rel13->srs_request; ((DCI6_1A_20MHz_t *)dci_pdu)->harq_ack_off = rel13->harq_resource_offset; ((DCI6_1A_20MHz_t *)dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number-1; + ((DCI6_1A_20MHz_t *)dci_pdu)->padding = 0; break; } break; @@ -2353,6 +2388,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d ((DCI6_1B_5MHz_t *)dci_pdu)->ndi = rel13->new_data_indicator; ((DCI6_1B_5MHz_t *)dci_pdu)->harq_ack_off = rel13->harq_resource_offset; ((DCI6_1B_5MHz_t *)dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number-1; + ((DCI6_1B_5MHz_t *)dci_pdu)->padding = 0; break; case 50: @@ -2365,6 +2401,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d ((DCI6_1B_10MHz_t *)dci_pdu)->ndi = rel13->new_data_indicator; ((DCI6_1B_10MHz_t *)dci_pdu)->harq_ack_off = rel13->harq_resource_offset; ((DCI6_1B_10MHz_t *)dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number-1; + ((DCI6_1B_10MHz_t *)dci_pdu)->padding = 0; break; case 100: dci_alloc->dci_length = sizeof_DCI6_1B_20MHz_t; @@ -2376,6 +2413,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d ((DCI6_1B_20MHz_t *)dci_pdu)->ndi = rel13->new_data_indicator; ((DCI6_1B_20MHz_t *)dci_pdu)->harq_ack_off = rel13->harq_resource_offset; ((DCI6_1B_20MHz_t *)dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number-1; + ((DCI6_1B_20MHz_t *)dci_pdu)->padding = 0; break; } case 12: // Format 6-2 @@ -2391,6 +2429,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d if (rel13->paging_direct_indication_differentiation_flag==0) { ((DCI6_2_di_5MHz_t *)dci_pdu)->type = 0; ((DCI6_2_di_5MHz_t *)dci_pdu)->di_info = rel13->direct_indication; + ((DCI6_2_di_5MHz_t *)dci_pdu)->padding = 0; } else { ((DCI6_2_paging_5MHz_t *)dci_pdu)->type = 1; @@ -2398,6 +2437,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d ((DCI6_2_paging_5MHz_t *)dci_pdu)->mcs = rel13->mcs; ((DCI6_2_paging_5MHz_t *)dci_pdu)->rep = (rel13->pdsch_reptition_levels-1); ((DCI6_2_paging_5MHz_t *)dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number-1; + ((DCI6_2_paging_5MHz_t *)dci_pdu)->padding = 0; } break; @@ -2406,6 +2446,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d if (rel13->paging_direct_indication_differentiation_flag==0) { ((DCI6_2_di_10MHz_t *)dci_pdu)->type = 0; ((DCI6_2_di_10MHz_t *)dci_pdu)->di_info = rel13->direct_indication; + ((DCI6_2_di_10MHz_t *)dci_pdu)->padding = 0; } else { ((DCI6_2_paging_10MHz_t *)dci_pdu)->type = 1; @@ -2413,6 +2454,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d ((DCI6_2_paging_10MHz_t *)dci_pdu)->mcs = rel13->mcs; ((DCI6_2_paging_10MHz_t *)dci_pdu)->rep = (rel13->pdsch_reptition_levels-1); ((DCI6_2_paging_10MHz_t *)dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number-1; + ((DCI6_2_paging_10MHz_t *)dci_pdu)->padding = 0; } break; @@ -2421,6 +2463,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d if (rel13->paging_direct_indication_differentiation_flag==0) { ((DCI6_2_di_20MHz_t *)dci_pdu)->type = 0; ((DCI6_2_di_20MHz_t *)dci_pdu)->di_info = rel13->direct_indication; + ((DCI6_2_di_20MHz_t *)dci_pdu)->padding = 0; } else { ((DCI6_2_paging_20MHz_t *)dci_pdu)->type = 1; @@ -2428,6 +2471,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d ((DCI6_2_paging_20MHz_t *)dci_pdu)->mcs = rel13->mcs; ((DCI6_2_paging_20MHz_t *)dci_pdu)->rep = (rel13->pdsch_reptition_levels-1); ((DCI6_2_paging_20MHz_t *)dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number-1; + ((DCI6_2_paging_20MHz_t *)dci_pdu)->padding = 0; } break; From af6ca150208454c377f520dedc23929712506a8b Mon Sep 17 00:00:00 2001 From: naoi Date: Wed, 28 Feb 2018 17:11:37 +0900 Subject: [PATCH 44/63] Fix: Random access information is not released when Msg3(response to PDCCH order) re-transmission fails. --- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 1 + openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 83c184c0c2..bcd3984df9 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -1683,6 +1683,7 @@ cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, ra[i].RRC_timer = 20; ra[i].rnti = 0; ra[i].msg3_round = 0; + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Canceled RA procedure for UE rnti %x\n", module_idP, CC_id, frameP, rnti); } } } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 0e4bbb84f1..f4ad9a6e9d 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -157,18 +157,16 @@ rx_sdu(const module_id_t enb_mod_idP, UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid], ul_cqi); - // AssertFatal(1==0,"ulsch in error\n"); - if (UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] == - 3) { - UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= - (~(1 << harq_pid)); - UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] = - 0; - if (UE_list->UE_sched_ctrl[UE_id]. - ul_consecutive_errors++ == 10) - UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 1; - } else - UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid]++; + // AssertFatal(1==0,"ulsch in error\n"); + if (UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] == 3) { + UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1 << harq_pid)); + UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid] = 0; + if (UE_list->UE_sched_ctrl[UE_id].ul_consecutive_errors++ == 10) + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 1; + if(find_RA_id(enb_mod_idP, CC_idP, current_rnti) != -1) + cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti); + } else + UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid]++; return; } From 3d1b8a9cef0dfd4c827d8af0c0945156c518a312 Mon Sep 17 00:00:00 2001 From: naoi Date: Wed, 28 Feb 2018 17:50:10 +0900 Subject: [PATCH 45/63] Fix: S1-U Bearers is generated incorrectly when PDCCH order re-establishment succeeded. --- openair2/RRC/LITE/rrc_eNB.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 16e56b86f2..3da9a20aca 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -6274,7 +6274,7 @@ if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) { ue_context_p, ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier); } - }else { + }else if(dedicated_DRB == 0){ if(ue_context_p->ue_context.reestablishment_cause == ReestablishmentCause_spare1){ rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(ctxt_pP, ue_context_p); @@ -6288,7 +6288,15 @@ if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) { } } } - } + }else if(dedicated_DRB == 2){ + for (uint8_t e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) { + if (ue_context_p->ue_context.e_rab[e_rab].status == E_RAB_STATUS_DONE) { + ue_context_p->ue_context.e_rab[e_rab].status = E_RAB_STATUS_ESTABLISHED; + } else { + ue_context_p->ue_context.e_rab[e_rab].status = E_RAB_STATUS_FAILED; + } + } + } } #else // establish a dedicated bearer if (dedicated_DRB == 0 ) { From 95f677f735be1586376ef916575acb8cd0645da2 Mon Sep 17 00:00:00 2001 From: naoi Date: Wed, 28 Feb 2018 19:34:20 +0900 Subject: [PATCH 46/63] Fix: pucch procedures moves after UE removed. --- openair2/RRC/LITE/rrc_eNB.c | 60 ++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 3da9a20aca..7a7e1e3b08 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -851,8 +851,17 @@ rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s* LOG_I(RRC, "clean_eNb_ulsch UE %x \n", rnti); //clean_eNb_ulsch(ulsch); ulsch->rnti = 0; - break; } + if(eNB_PHY->uci_vars[i].rnti == rnti){ + LOG_I(MAC, "clean eNb uci_vars[%d] UE %x \n",i, rnti); + memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI)); + } + } + ulsch = eNB_PHY->ulsch[i]; + if((ulsch != NULL) && (ulsch->rnti == rnti)){ + LOG_I(RRC, "clean_eNb_ulsch UE %x \n", rnti); + //clean_eNb_ulsch(ulsch); + ulsch->rnti = 0; } for(j = 0; j < 10; j++){ @@ -860,12 +869,16 @@ rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s* if(ul_req_tmp){ pdu_number = ul_req_tmp->number_of_pdus; for(int pdu_index = pdu_number-1; pdu_index >= 0; pdu_index--){ - if(ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti){ - LOG_I(RRC, "remove UE %x from ul_config_pdu_list %d/%d\n", rnti, pdu_index, pdu_number); - if(pdu_index < pdu_number -1){ - memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index+1], (pdu_number-1-pdu_index) * sizeof(nfapi_ul_config_request_pdu_t)); - } - ul_req_tmp->number_of_pdus--; + if((ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti) || + (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_harq_pdu.ue_information.ue_information_rel8.rnti == rnti) || + (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_cqi_pdu.ue_information.ue_information_rel8.rnti == rnti) || + (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_sr_pdu.ue_information.ue_information_rel8.rnti == rnti) || + (ul_req_tmp->ul_config_pdu_list[pdu_index].srs_pdu.srs_pdu_rel8.rnti == rnti)){ + LOG_I(RRC, "remove UE %x from ul_config_pdu_list %d/%d\n", rnti, pdu_index, pdu_number); + if(pdu_index < pdu_number -1){ + memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index+1], (pdu_number-1-pdu_index) * sizeof(nfapi_ul_config_request_pdu_t)); + } + ul_req_tmp->number_of_pdus--; } } } @@ -945,12 +958,21 @@ void release_UE_in_freeList(module_id_t mod_id) PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, mod_id, ENB_FLAG_YES, rnti, 0, 0,mod_id); for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { eNB_PHY = RC.eNB[mod_id][CC_id]; - for (i=0; i<=NUMBER_OF_UE_MAX; i++) { + for (i=0; iulsch[i]; if((ulsch != NULL) && (ulsch->rnti == rnti)){ - LOG_I(RRC, "clean_eNb_ulsch ulsch[%d] UE %x\n", i, rnti); - clean_eNb_ulsch(ulsch); - } + LOG_I(RRC, "clean_eNb_ulsch ulsch[%d] UE %x\n", i, rnti); + clean_eNb_ulsch(ulsch); + } + if(eNB_PHY->uci_vars[i].rnti == rnti){ + LOG_I(MAC, "clean eNb uci_vars[%d] UE %x \n",i, rnti); + memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI)); + } + } + ulsch = eNB_PHY->ulsch[i]; + if((ulsch != NULL) && (ulsch->rnti == rnti)){ + LOG_I(RRC, "clean_eNb_ulsch ulsch[%d] UE %x\n", i, rnti); + clean_eNb_ulsch(ulsch); } for(j = 0; j < 10; j++){ @@ -958,12 +980,16 @@ void release_UE_in_freeList(module_id_t mod_id) if(ul_req_tmp){ pdu_number = ul_req_tmp->number_of_pdus; for(int pdu_index = pdu_number-1; pdu_index >= 0; pdu_index--){ - if(ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti){ - LOG_I(RRC, "remove UE %x from ul_config_pdu_list %d/%d\n", rnti, pdu_index, pdu_number); - if(pdu_index < pdu_number -1){ - memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index+1], (pdu_number-1-pdu_index) * sizeof(nfapi_ul_config_request_pdu_t)); - } - ul_req_tmp->number_of_pdus--; + if((ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti) || + (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_harq_pdu.ue_information.ue_information_rel8.rnti == rnti) || + (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_cqi_pdu.ue_information.ue_information_rel8.rnti == rnti) || + (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_sr_pdu.ue_information.ue_information_rel8.rnti == rnti) || + (ul_req_tmp->ul_config_pdu_list[pdu_index].srs_pdu.srs_pdu_rel8.rnti == rnti)){ + LOG_I(RRC, "remove UE %x from ul_config_pdu_list %d/%d\n", rnti, pdu_index, pdu_number); + if(pdu_index < pdu_number -1){ + memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index+1], (pdu_number-1-pdu_index) * sizeof(nfapi_ul_config_request_pdu_t)); + } + ul_req_tmp->number_of_pdus--; } } } From 4b02d818392a88a479628fc164c6f4c32bd8f685 Mon Sep 17 00:00:00 2001 From: naoi Date: Thu, 1 Mar 2018 16:21:32 +0900 Subject: [PATCH 47/63] Fix: Random access information may not release if msg3_round initial value is not zero. --- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 25 +++++++++++++++++++ .../LAYER2/MAC/eNB_scheduler_primitives.c | 12 ++------- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 +- openair2/LAYER2/MAC/proto.h | 3 +++ openair2/LAYER2/MAC/rar_tools.c | 1 + 5 files changed, 32 insertions(+), 11 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index bcd3984df9..5dee9b7a2c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -1565,6 +1565,8 @@ initiate_ra_proc(module_id_t module_idP, struct PRACH_ConfigSIB_v1310 *ext4_prach = NULL; PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13 = NULL; + + static uint8_t failure_cnt = 0; if (cc->radioResourceConfigCommon_BR && cc->radioResourceConfigCommon_BR->ext4) { @@ -1649,6 +1651,7 @@ initiate_ra_proc(module_id_t module_idP, } ra[i].RA_rnti = ra_rnti; ra[i].preamble_index = preamble_index; + failure_cnt = 0; LOG_D(MAC, "[eNB %d][RAPROC] CC_id %d Frame %d Activating RAR generation in Frame %d, subframe %d for process %d, rnti %x, state %d\n", module_idP, CC_id, frameP, ra[i].Msg2_frame, @@ -1661,6 +1664,13 @@ initiate_ra_proc(module_id_t module_idP, LOG_E(MAC, "[eNB %d][RAPROC] FAILURE: CC_id %d Frame %d Initiating RA procedure for preamble index %d\n", module_idP, CC_id, frameP, preamble_index); + + failure_cnt++; + if(failure_cnt > 20) { + LOG_E(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Clear Random access information\n"); + clear_ra_proc(module_idP, CC_id, frameP); + } + } void @@ -1687,3 +1697,18 @@ cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, } } } + +void clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP) +{ + unsigned char i; + RA_t *ra = (RA_t *) & RC.mac[module_idP]->common_channels[CC_id].ra[0]; + + for (i = 0; i < NB_RA_PROC_MAX; i++) { + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Clear Random access information rnti %x\n", module_idP, CC_id, frameP, ra[i].rnti); + ra[i].state = IDLE; + ra[i].timing_offset = 0; + ra[i].RRC_timer = 20; + ra[i].rnti = 0; + ra[i].msg3_round = 0; + } +} diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index fa462561af..ef41f4e850 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -2170,16 +2170,8 @@ int rrc_mac_remove_ue(module_id_t mod_idP, rnti_t rntiP) eNB_dlsch_info[mod_idP][pCC_id][UE_id].serving_num = 0; // check if this has an RA process active - RA_t *ra; - for (i = 0; i < NB_RA_PROC_MAX; i++) { - ra = (RA_t *) & RC.mac[mod_idP]->common_channels[pCC_id].ra[i]; - if (ra->rnti == rntiP) { - ra->state = IDLE; - ra->timing_offset = 0; - ra->RRC_timer = 20; - ra->rnti = 0; - //break; - } + if(find_RA_id(mod_idP, pCC_id, rntiP) != -1) { + cancel_ra_proc(mod_idP, pCC_id, 0, rntiP); } return 0; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index f4ad9a6e9d..6b5bf9a3d0 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -194,7 +194,7 @@ rx_sdu(const module_id_t enb_mod_idP, (int) mac->common_channels[CC_idP]. radioResourceConfigCommon->rach_ConfigCommon. maxHARQ_Msg3Tx); - if (ra[RA_id].msg3_round == + if (ra[RA_id].msg3_round >= mac->common_channels[CC_idP].radioResourceConfigCommon-> rach_ConfigCommon.maxHARQ_Msg3Tx - 1) { cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti); diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index d42c8f38dc..d2cf3e047b 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -299,6 +299,9 @@ void cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, @param Msg3_frame frame where scheduling takes place @param Msg3_subframe subframe where scheduling takes place */ + +void clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP); + void set_msg3_subframe(module_id_t Mod_id, int CC_id, int frame, diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c index f48a53636f..6a9b4fa987 100644 --- a/openair2/LAYER2/MAC/rar_tools.c +++ b/openair2/LAYER2/MAC/rar_tools.c @@ -84,6 +84,7 @@ fill_rar(const module_id_t module_idP, ra->msg3_TPC = 3; ra->msg3_ULdelay = 0; ra->msg3_cqireq = 0; + ra->msg3_round = 0; rar[2] |= ((ra->msg3_mcs & 0x8) >> 3); // mcs 10 rar[3] = (((ra->msg3_mcs & 0x7) << 5)) | ((ra->msg3_TPC & 7) << 2) | From 1f9a6c13691aa38e2de39603e83da7eebeff8ae9 Mon Sep 17 00:00:00 2001 From: naoi Date: Thu, 1 Mar 2018 17:12:36 +0900 Subject: [PATCH 48/63] Fix: improve success rate of lower layer re-establishment. --- openair2/LAYER2/MAC/eNB_scheduler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 312c49094e..2b8dfbea80 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -544,8 +544,8 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id, "UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n", UE_id, rnti, UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); - if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer % 40) == 0) - UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 0; // resend every 4 frames + if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer % 80) == 0) + UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 0; // resend every 8 frames } UE_list->UE_sched_ctrl[UE_id].ul_failure_timer++; From 57a9156f8866dedbd7333fe4e755330b28be52fe Mon Sep 17 00:00:00 2001 From: "Wang.shanshan" Date: Thu, 1 Mar 2018 18:59:19 +0900 Subject: [PATCH 49/63] Fix index used while checking harq result with SR collision --- openair1/SCHED/phy_procedures_lte_eNb.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 51231ded48..b402c7c0a5 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -904,12 +904,13 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) frame, subframe, PUCCH1_THRES); - LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (SR n1pucch is %d)\n", + LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (uci.type %d SR n1pucch is %d)\n", eNB->Mod_id, uci->rnti, frame, subframe, SR_payload, + uci->type, uci->n_pucch_1_0_sr[0]); if (uci->type == SR) { if (SR_payload == 1) { @@ -1021,21 +1022,23 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) } - + LOG_I(PHY,"RNTI %x type %d SR_payload %d Frame %d Subframe %d pucch_b0b1[0][0] %d pucch_b0b1[0][1] %d pucch_b0b1[1][0] %d pucch_b0b1[1][1] %d \n", + uci->rnti,uci->type,SR_payload,frame,subframe,pucch_b0b1[0][0],pucch_b0b1[0][1],pucch_b0b1[1][0],pucch_b0b1[1][1]); + if (SR_payload == 1) { // this implements Table 7.3.1 from 36.213 if (pucch_b0b1[0][0] == 4) { // there isn't a likely transmission harq_ack[0] = 4; // DTX } - else if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] == 1) { // 1/4/7 ACKs + else if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] == 1) { // 1/4/7 ACKs harq_ack[0] = 1; } - else if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] != 1) { // 2/5/8 ACKs + else if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] != 1) { // 2/5/8 ACKs harq_ack[0] = 2; } - else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] == 1) { // 3/6/9 ACKs + else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] == 1) { // 3/6/9 ACKs harq_ack[0] = 3; } - else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] != 1) { // 0 ACKs, or at least one DL assignment missed + else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1) { // 0 ACKs, or at least one DL assignment missed harq_ack[0] = 0; } uci->stat = metric[0]; From 7f03a6e32ae330520dc0bb879ef3d0941511c3c5 Mon Sep 17 00:00:00 2001 From: naoi Date: Thu, 1 Mar 2018 19:21:21 +0900 Subject: [PATCH 50/63] Fix: log argument issue. --- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 5dee9b7a2c..6a4c93ac3a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -1667,7 +1667,7 @@ initiate_ra_proc(module_id_t module_idP, failure_cnt++; if(failure_cnt > 20) { - LOG_E(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Clear Random access information\n"); + LOG_E(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Clear Random access information\n", module_idP, CC_id, frameP); clear_ra_proc(module_idP, CC_id, frameP); } From 54cf2d9aef452cfe334509aa89ed144bb6d22d5b Mon Sep 17 00:00:00 2001 From: Wu Jing Date: Tue, 6 Mar 2018 16:15:24 +0900 Subject: [PATCH 51/63] fix TBS_UL data_type from uint8_t to uint16_t --- openair2/LAYER2/MAC/defs.h | 2 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index fbf2c4316e..0338cd8c3c 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -667,7 +667,7 @@ typedef struct { /// mcs from last UL scheduling uint8_t mcs_UL[8]; /// TBS from last UL scheduling - uint8_t TBS_UL[8]; + uint16_t TBS_UL[8]; /// Flag to indicate UL has been scheduled at least once boolean_t ul_active; /// Flag to indicate UE has been configured (ACK from RRCConnectionSetup received) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index bc15372823..96450c8604 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -2090,7 +2090,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, 0, // ul_tx_mode 0, // current_tx_nb 0, // n_srs - UE_template->TBS_UL[harq_pid] + get_TBS_UL(UE_template->mcs_UL[harq_pid], ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb) ); #ifdef Rel14 if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation From 8a89a16fde6b8ccae542bcb906776853625416d7 Mon Sep 17 00:00:00 2001 From: Wu Jing Date: Thu, 8 Mar 2018 12:01:43 +0900 Subject: [PATCH 52/63] fix issue about att_rx and att_tx config --- openair2/ENB_APP/enb_config.c | 4 +++- targets/RT/USER/lte-ru.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index c87421a2c0..121400f2b4 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -180,6 +180,8 @@ void RCconfig_RU(void) { RC.ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);; RC.ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr); RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; + RC.ru[j]->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr); + RC.ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr); for (i=0;inum_bands;i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; } //strcmp(local_rf, "yes") == 0 else { @@ -215,7 +217,7 @@ void RCconfig_RU(void) { RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF5_MOBIPASS; } RC.ru[j]->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr); - RC.ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr); + RC.ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr); } /* strcmp(local_rf, "yes") != 0 */ RC.ru[j]->nb_tx = *(RUParamList.paramarray[j][RU_NB_TX_IDX].uptr); diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index e12fc3161e..5211ff6f53 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1308,8 +1308,8 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) { cfg->tx_freq[i] = (double)fp->dl_CarrierFreq; cfg->rx_freq[i] = (double)fp->ul_CarrierFreq; - cfg->tx_gain[i] = (double)fp->att_tx; - cfg->rx_gain[i] = ru->max_rxgain-(double)fp->att_rx; + cfg->tx_gain[i] = (double)ru->att_tx; + cfg->rx_gain[i] = ru->max_rxgain-(double)ru->att_rx; cfg->configFilename = rf_config_file; printf("channel %d, Setting tx_gain offset %f, rx_gain offset %f, tx_freq %f, rx_freq %f\n", From f58d4aa05f8ba9501f7d0e23a77ed1bd7cddd924 Mon Sep 17 00:00:00 2001 From: Wu Jing Date: Thu, 8 Mar 2018 12:26:39 +0900 Subject: [PATCH 53/63] fix pdcch_alloc2ul_subframe when TDD config1 --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 33 ++++++++++++++++---------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 4b857fffbd..974c3eb36d 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -6665,10 +6665,13 @@ uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n) uint8_t ul_subframe = 255; if ((frame_parms->frame_type == TDD) && - (frame_parms->tdd_config == 1) && - ((n==1)||(n==6))) // tdd_config 0,1 SF 1,5 - ul_subframe = ((n+6)%10); - else if ((frame_parms->frame_type == TDD) && + (frame_parms->tdd_config == 1)) { + if ((n==1)||(n==6)) { // tdd_config 0,1 SF 1,5 + ul_subframe = ((n+6)%10); + } else if ((n==4)||(n==9)) { + ul_subframe = ((n+4)%10); + } + } else if ((frame_parms->frame_type == TDD) && (frame_parms->tdd_config == 6) && ((n==0)||(n==1)||(n==5)||(n==6))) ul_subframe = ((n+7)%10); @@ -6688,10 +6691,13 @@ uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n) uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n) { if ((frame_parms->frame_type == TDD) && - (frame_parms->tdd_config == 1) && - ((n==7)||(n==2))) // tdd_config 0,1 SF 1,5 - return((n==7)? 1 : 6); - else if ((frame_parms->frame_type == TDD) && + (frame_parms->tdd_config == 1)) { + if ((n==7)||(n==2)) { // tdd_config 0,1 SF 1,5 + return((n==7)? 1 : 6); + } else if ((n==3)||(n==8)) { + return((n==3)? 9 : 4); + } + } else if ((frame_parms->frame_type == TDD) && (frame_parms->tdd_config == 6) && ((n==7)||(n==8)||(n==2)||(n==3))) return((n+3)%10); @@ -6705,13 +6711,14 @@ uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n) { - uint32_t ul_frame; + uint32_t ul_frame = frame; if ((frame_parms->frame_type == TDD) && - (frame_parms->tdd_config == 1) && - ((n==1)||(n==6))) // tdd_config 0,1 SF 1,5 - ul_frame = (frame + (n==1 ? 0 : 1)); - else if ((frame_parms->frame_type == TDD) && + (frame_parms->tdd_config == 1)) { + if ((n==1)||(n==6)||(n==4)||(n==9)) { // tdd_config 0,1 SF 1,5 + ul_frame = (frame + (n < 5 ? 0 : 1)); + } + } else if ((frame_parms->frame_type == TDD) && (frame_parms->tdd_config == 6) && ((n==0)||(n==1)||(n==5)||(n==6))) ul_frame = (frame + (n>=5 ? 1 : 0)); From d45572446c27de35e769a3d0e3bd3af782b91b73 Mon Sep 17 00:00:00 2001 From: Wu Jing Date: Thu, 8 Mar 2018 12:38:54 +0900 Subject: [PATCH 54/63] fix mcs when retranssmission --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 33 +++++++++-------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 3e8ad2b9e2..be566331d1 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -997,7 +997,6 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, start_meas(&mac->schedule_ulsch); int sched_subframe = (subframeP+4)%10; - if (sched_subframe < subframeP) sched_frame++; cc = &mac->common_channels[0]; int tdd_sfa; @@ -1050,7 +1049,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, break; } } - + if (sched_subframe < subframeP) sched_frame++; #ifndef UE_EXPANSION for (CC_id=0; CC_idul_scheduled |= (1<head) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED,UE_sched_ctrl->ul_scheduled); - - // adjust total UL buffer status by TBS, wait for UL sdus to do final update - LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,UE_template->TBS_UL[harq_pid]); - if (UE_template->ul_total_buffer > UE_template->TBS_UL[harq_pid]) - UE_template->ul_total_buffer -= UE_template->TBS_UL[harq_pid]; - else - UE_template->ul_total_buffer = 0; - LOG_D(MAC,"ul_total_buffer, new %d\n", UE_template->ul_total_buffer); // Cyclic shift for DM RS cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1) // save it for a potential retransmission @@ -1977,10 +1968,13 @@ void schedule_ulsch_rnti(module_id_t module_idP, first_rb[CC_id]+=rb_table[rb_table_index]; if(ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_FIRST) { if(ulsch_ue_select[CC_id].list[ulsch_ue_num].ul_total_buffer > 0){ + LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", + module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,UE_template->TBS_UL[harq_pid]); if (UE_template->ul_total_buffer > UE_template->TBS_UL[harq_pid]) UE_template->ul_total_buffer -= UE_template->TBS_UL[harq_pid]; else UE_template->ul_total_buffer = 0; + LOG_D(MAC,"ul_total_buffer, new %d\n", UE_template->ul_total_buffer); } else { UE_template->ul_SR = 0; } @@ -2002,20 +1996,20 @@ void schedule_ulsch_rnti(module_id_t module_idP, round = UE_sched_ctrl->round_UL[CC_id][harq_pid]; UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power=normalized_rx_power; UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power; + uint8_t mcs_rv = 0; if(rvidx_tab[round&3]==1){ - UE_template->mcs_UL[harq_pid] = 29; + mcs_rv = 29; }else if(rvidx_tab[round&3]==2){ - UE_template->mcs_UL[harq_pid] = 30; + mcs_rv = 30; }else if(rvidx_tab[round&3]==3){ - UE_template->mcs_UL[harq_pid] = 31; + mcs_rv = 31; } + UE_template->TBS_UL[harq_pid] = get_TBS_UL(UE_template->mcs_UL[harq_pid],ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb); UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS=UE_template->TBS_UL[harq_pid]; 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", - 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); + module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs_rv,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) //store for possible retransmission @@ -2036,7 +2030,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, hi_dci0_pdu->dci_pdu.dci_pdu_rel8.transmission_power = 6000; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.resource_block_start = ulsch_ue_select[CC_id].list[ulsch_ue_num].start_rb; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.number_of_resource_block = ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb; - hi_dci0_pdu->dci_pdu.dci_pdu_rel8.mcs_1 = UE_template->mcs_UL[harq_pid]; + hi_dci0_pdu->dci_pdu.dci_pdu_rel8.mcs_1 = mcs_rv; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.cyclic_shift_2_for_drms = cshift; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.frequency_hopping_enabled_flag = 0; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.new_data_indication_1 = UE_template->oldNDI_UL[harq_pid]; @@ -2063,7 +2057,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, nfapi_hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST; LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, round %d)\n", - module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,UE_template->mcs_UL[harq_pid], + module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs_rv, ulsch_ue_select[CC_id].list[ulsch_ue_num].start_rb, ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb, UE_template->TBS_UL[harq_pid],round); // Add UL_config PDUs @@ -2088,8 +2082,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, 0, // ul_tx_mode 0, // current_tx_nb 0, // n_srs -// get_TBS_UL(UE_template->mcs_UL[harq_pid], ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb) -UE_template->TBS_UL[harq_pid] + UE_template->TBS_UL[harq_pid] ); #ifdef Rel14 if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation From 485b7fc060d9171aa40254669b04268a5dbd9b80 Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Mon, 12 Mar 2018 11:07:59 +0800 Subject: [PATCH 55/63] Fix the defecitve process while there is an uci scheduled before an ulsch. --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 51 +++++++++++++++++++---- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index be566331d1..7558e41617 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -196,7 +196,7 @@ rx_sdu(const module_id_t enb_mod_idP, if (sduP == NULL) { // we've got an error on Msg3 LOG_D(MAC, - "[eNB %d] CC_id %d, RA %d ULSCH in error in round %d/%d\n", + "[eNB %d] CC_id %d, RA %d ULSCH in error in round(Msg3) %d/%d\n", enb_mod_idP, CC_idP, RA_id, ra[RA_id].msg3_round, (int) mac->common_channels[CC_idP]. @@ -1683,7 +1683,8 @@ void schedule_ulsch_rnti(module_id_t module_idP, UE_sched_ctrl *UE_sched_ctrl; int sched_frame=frameP; int rvidx_tab[4] = {0,2,3,1}; - + uint16_t ul_req_index; + uint8_t dlsch_flag; if (sched_subframeP < subframeP) sched_frame++; nfapi_hi_dci0_request_body_t *hi_dci0_req; @@ -1915,8 +1916,17 @@ void schedule_ulsch_rnti(module_id_t module_idP, LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP); + ul_req_index = 0; + dlsch_flag = 0; + for(ul_req_index = 0;ul_req_index < ul_req_tmp->number_of_pdus;ul_req_index++){ + if(ul_req_tmp->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; + } + } // Add UL_config PDUs - fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], + fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_index], cqi_req, cc, UE_template->physicalConfigDedicated, @@ -1940,14 +1950,22 @@ void schedule_ulsch_rnti(module_id_t module_idP, ); #ifdef Rel14 if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation - fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], + fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_index], UE_template->rach_resource_type>2 ? 2 : 1, 1, //total_number_of_repetitions 1, //repetition_number (frameP*10)+subframeP); } #endif - ul_req_tmp->number_of_pdus++; + if(dlsch_flag == 1){ + ul_req_tmp->ul_config_pdu_list[ul_req_index].pdu_type = NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE; + ul_req_tmp->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG; + ul_req_tmp->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial = 0; // last symbol not punctured + ul_req_tmp->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks = rb_table[rb_table_index]; + fill_nfapi_ulsch_harq_information(module_idP, CC_id,rnti, &ul_req_tmp->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.harq_information,subframeP); + }else{ + ul_req_tmp->number_of_pdus++; + } eNB->ul_handle++; ul_req->header.message_id = NFAPI_UL_CONFIG_REQUEST; ul_req_tmp->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; @@ -2063,7 +2081,16 @@ void schedule_ulsch_rnti(module_id_t module_idP, // Add UL_config PDUs LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP); - fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], + ul_req_index = 0; + dlsch_flag = 0; + for(ul_req_index = 0;ul_req_index < ul_req_tmp->number_of_pdus;ul_req_index++){ + if(ul_req_tmp->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(phich)\n",frameP,subframeP,rnti,ul_req_index); + break; + } + } + fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_index], cqi_req, cc, UE_template->physicalConfigDedicated, @@ -2086,14 +2113,22 @@ void schedule_ulsch_rnti(module_id_t module_idP, ); #ifdef Rel14 if (UE_template->rach_resource_type>0) { // This is a BL/CE UE allocation - fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus], + fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_index], UE_template->rach_resource_type>2 ? 2 : 1, 1, //total_number_of_repetitions 1, //repetition_number (frameP*10)+subframeP); } #endif - ul_req_tmp->number_of_pdus++; + if(dlsch_flag == 1){ + ul_req_tmp->ul_config_pdu_list[ul_req_index].pdu_type = NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE; + ul_req_tmp->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG; + ul_req_tmp->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial = 0; // last symbol not punctured + ul_req_tmp->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks = ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb; + fill_nfapi_ulsch_harq_information(module_idP, CC_id,rnti, &ul_req_tmp->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.harq_information,subframeP); + }else{ + ul_req_tmp->number_of_pdus++; + } eNB->ul_handle++; ul_req->header.message_id = NFAPI_UL_CONFIG_REQUEST; ul_req_tmp->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; From 2505f15eabdbab9be9e701fa8c72cd553b900e60 Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Mon, 12 Mar 2018 12:49:34 +0800 Subject: [PATCH 56/63] Fix previous problem for no-ue-extension version of schedule_ulsch_rnti --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 52 +++++++++++++++++++---- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 7558e41617..515adad525 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1174,7 +1174,8 @@ schedule_ulsch_rnti(module_id_t module_idP, UE_sched_ctrl *UE_sched_ctrl; int sched_frame = frameP; int rvidx_tab[4] = { 0, 2, 3, 1 }; - + uint16_t ul_req_index; + uint8_t dlsch_flag; if (sched_subframeP < subframeP) sched_frame++; @@ -1501,9 +1502,17 @@ schedule_ulsch_rnti(module_id_t module_idP, "[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", harq_pid, frameP, subframeP, UE_id, rnti, sched_frame, sched_subframeP); - + ul_req_index = 0; + dlsch_flag = 0; + for(ul_req_index = 0;ul_req_index < ul_req_tmp_body->number_of_pdus;ul_req_index++){ + if(ul_req_tmp_body->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; + } + } // Add UL_config PDUs - fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus], cqi_req, cc, UE_template->physicalConfigDedicated, get_tmode(module_idP, CC_id, UE_id), mac->ul_handle, rnti, first_rb[CC_id], // resource_block_start + fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp_body->ul_config_pdu_list[ul_req_index], cqi_req, cc, UE_template->physicalConfigDedicated, get_tmode(module_idP, CC_id, UE_id), mac->ul_handle, rnti, first_rb[CC_id], // resource_block_start rb_table[rb_table_index], // number_of_resource_blocks UE_template->mcs_UL[harq_pid], cshift, // cyclic_shift_2_for_drms 0, // frequency_hopping_enabled_flag @@ -1521,15 +1530,24 @@ schedule_ulsch_rnti(module_id_t module_idP, [rb_table_index])); #ifdef Rel14 if (UE_template->rach_resource_type > 0) { // This is a BL/CE UE allocation - fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus], UE_template->rach_resource_type > 2 ? 2 : 1, 1, //total_number_of_repetitions + fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp_body->ul_config_pdu_list[ul_req_index], UE_template->rach_resource_type > 2 ? 2 : 1, 1, //total_number_of_repetitions 1, //repetition_number (frameP * 10) + subframeP); } #endif + if(dlsch_flag == 1){ + ul_req_tmp_body->ul_config_pdu_list[ul_req_index].pdu_type = NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE; + ul_req_tmp_body->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG; + ul_req_tmp_body->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial = 0; // last symbol not punctured + ul_req_tmp_body->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks = rb_table[rb_table_index]; + fill_nfapi_ulsch_harq_information(module_idP, CC_id,rnti, &ul_req_tmp_body->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.harq_information,subframeP); + }else{ + ul_req_tmp_body->number_of_pdus++; + } ul_req_tmp->header.message_id = NFAPI_UL_CONFIG_REQUEST; - ul_req_tmp_body->number_of_pdus++; + ul_req_tmp_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; mac->ul_handle++; @@ -1588,7 +1606,16 @@ schedule_ulsch_rnti(module_id_t module_idP, "[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", harq_pid, frameP, subframeP, UE_id, rnti, sched_frame, sched_subframeP); - fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus], cqi_req, cc, UE_template->physicalConfigDedicated, get_tmode(module_idP, CC_id, UE_id), mac->ul_handle, rnti, UE_template->first_rb_ul[harq_pid], // resource_block_start + ul_req_index = 0; + dlsch_flag = 0; + for(ul_req_index = 0;ul_req_index < ul_req_tmp_body->number_of_pdus;ul_req_index++){ + if(ul_req_tmp_body->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; + } + } + fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp_body->ul_config_pdu_list[ul_req_index], cqi_req, cc, UE_template->physicalConfigDedicated, get_tmode(module_idP, CC_id, UE_id), mac->ul_handle, rnti, UE_template->first_rb_ul[harq_pid], // resource_block_start UE_template->nb_rb_ul[harq_pid], // number_of_resource_blocks UE_template->mcs_UL[harq_pid], cshift, // cyclic_shift_2_for_drms 0, // frequency_hopping_enabled_flag @@ -1603,14 +1630,23 @@ schedule_ulsch_rnti(module_id_t module_idP, TBS_UL[harq_pid]); #ifdef Rel14 if (UE_template->rach_resource_type > 0) { // This is a BL/CE UE allocation - fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus], UE_template->rach_resource_type > 2 ? 2 : 1, 1, //total_number_of_repetitions + fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp_body->ul_config_pdu_list[ul_req_index], UE_template->rach_resource_type > 2 ? 2 : 1, 1, //total_number_of_repetitions 1, //repetition_number (frameP * 10) + subframeP); } #endif - ul_req_tmp_body->number_of_pdus++; + if(dlsch_flag == 1){ + ul_req_tmp_body->ul_config_pdu_list[ul_req_index].pdu_type = NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE; + ul_req_tmp_body->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG; + ul_req_tmp_body->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial = 0; // last symbol not punctured + ul_req_tmp_body->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks = rb_table[rb_table_index]; + fill_nfapi_ulsch_harq_information(module_idP, CC_id,rnti, &ul_req_tmp_body->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.harq_information,subframeP); + }else{ + ul_req_tmp_body->number_of_pdus++; + } + mac->ul_handle++; ul_req_tmp_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; From f1f3b8a0a874f675082425966e7800f3b979a96f Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 22 Jan 2018 15:32:41 +0100 Subject: [PATCH 57/63] bugfix: fix issue 285 - connect/disconnect multiple time As reported by Emad Alizade: According to "Issue255 256 257 paging reesta release" that has been merged in develop version, we have a question: In rrc_eNB_free_UE() function only all ulsch related memory of user has been cleaned, but I think not only ulsch memory but also dlsch memory must be cleaned. I tested the latest develop version and with repetition UE attach-detach procedures we find that the dlsch memory has not been cleaned and after repeat this sequence (45 times) assertion with cause UE_id!=-1 (no free or exiting dlsch_context, dci_tools.c: fill_dci_and_dlsch() ) occurred and no UE will be attached to system. The fixes in this commit are from Emad Alizade. (cherry picked from commit 4b5b55649351b4fe3f46b35d4a533a7b778ccce0) # Conflicts: # openair1/PHY/LTE_TRANSPORT/dlsch_coding.c # openair2/LAYER2/MAC/eNB_scheduler.c # openair2/RRC/LITE/rrc_eNB.c --- openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 1 + openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 1 + openair2/LAYER2/MAC/eNB_scheduler.c | 11 ++++++++--- openair2/RRC/LITE/rrc_eNB.c | 19 ++++++++----------- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index 7482524d41..bd5c1b05c2 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -252,6 +252,7 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch) #else dlsch->active = 0; #endif + dlsch->harq_mask = 0; for (i=0; i<10; i++) dlsch->harq_ids[i] = Mdlharq; diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index a5f4666210..7a60e0fc90 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -170,6 +170,7 @@ void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch) //ulsch = (LTE_eNB_ULSCH_t *)malloc16(sizeof(LTE_eNB_ULSCH_t)); if (ulsch) { ulsch->rnti = 0; + ulsch->harq_mask = 0; for (i=0; i<8; i++) { if (ulsch->harq_processes[i]) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 2b8dfbea80..521030eb54 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -731,12 +731,17 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, pdcp_remove_UE(&ctxt); } for (int ii=0; iiulsch[ii]; + LTE_eNB_ULSCH_t *ulsch = RC.eNB[module_idP][CC_id]->ulsch[ii]; if((ulsch != NULL) && (ulsch->rnti == rnti)){ LOG_I(MAC, "clean_eNb_ulsch UE %x \n", rnti); clean_eNb_ulsch(ulsch); - break; + } + } + for (int ii=0; iidlsch[ii][0]; + if((dlsch != NULL) && (dlsch->rnti == rnti)){ + LOG_I(MAC, "clean_eNb_dlsch UE %x \n", rnti); + clean_eNb_dlsch(dlsch); } } diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 7a7e1e3b08..90b85f6c14 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -806,6 +806,7 @@ rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s* #ifndef UE_EXPANSION int i, j , CC_id, pdu_number; LTE_eNB_ULSCH_t *ulsch = NULL; + LTE_eNB_DLSCH_t *dlsch = NULL; nfapi_ul_config_request_body_t *ul_req_tmp = NULL; PHY_VARS_eNB *eNB_PHY = NULL; eNB_MAC_INST *eNB_MAC = RC.mac[enb_mod_idP]; @@ -849,19 +850,15 @@ rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s* ulsch = eNB_PHY->ulsch[i]; if((ulsch != NULL) && (ulsch->rnti == rnti)){ LOG_I(RRC, "clean_eNb_ulsch UE %x \n", rnti); - //clean_eNb_ulsch(ulsch); - ulsch->rnti = 0; - } - if(eNB_PHY->uci_vars[i].rnti == rnti){ - LOG_I(MAC, "clean eNb uci_vars[%d] UE %x \n",i, rnti); - memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI)); + clean_eNb_ulsch(ulsch); } } - ulsch = eNB_PHY->ulsch[i]; - if((ulsch != NULL) && (ulsch->rnti == rnti)){ - LOG_I(RRC, "clean_eNb_ulsch UE %x \n", rnti); - //clean_eNb_ulsch(ulsch); - ulsch->rnti = 0; + for (i=0; idlsch[i][0]; + if((dlsch != NULL) && (dlsch->rnti == rnti)){ + LOG_I(RRC, "clean_eNb_dlsch UE %x \n", rnti); + clean_eNb_dlsch(dlsch); + } } for(j = 0; j < 10; j++){ From dbe32083024d68d3bf3e7b1ace94e49b3ec4b6a0 Mon Sep 17 00:00:00 2001 From: Haruki NAOI Date: Fri, 16 Mar 2018 15:32:14 +0900 Subject: [PATCH 58/63] Fix: eNB can not accept attach more than 257 times. --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 16 ++++++++++++---- openair1/SCHED/fapi_l1.c | 19 ++++++++++++++----- openair1/SCHED/phy_procedures_lte_eNb.c | 12 ++++++++++-- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 10 +++++++--- openair2/RRC/LITE/rrc_eNB.c | 11 +++++++---- 5 files changed, 50 insertions(+), 18 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index d943b91d3a..0af9d9332a 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -1054,8 +1054,12 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci if ((rel8->rnti_type == 2 ) && (rel8->rnti != SI_RNTI) && (rel8->rnti != P_RNTI)) dci_alloc->ra_flag = 1; UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE); - AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n"); - AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); + if( (UE_id<0) || (UE_id>=NUMBER_OF_UE_MAX) ){ + LOG_E(PHY,"illegal UE_id found!!! rnti %04x UE_id %d\n",rel8->rnti,UE_id); + return; + } + //AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n"); + //AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); dlsch0 = eNB->dlsch[UE_id][0]; dlsch1 = eNB->dlsch[UE_id][1]; @@ -2298,8 +2302,12 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d if (rel13->rnti_type == 2 ) dci_alloc->ra_flag = 1; UE_id = find_dlsch(rel13->rnti,eNB,SEARCH_EXIST_OR_FREE); - AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n"); - AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); + if( (UE_id<0) || (UE_id>=NUMBER_OF_UE_MAX) ){ + LOG_E(PHY,"illegal UE_id found!!! rnti %04x UE_id %d\n",rel13->rnti,UE_id); + return; + } + //AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n"); + //AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); dlsch0 = eNB->dlsch[UE_id][0]; dlsch0_harq = dlsch0->harq_processes[rel13->harq_process]; diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index dbce91776d..32dba016d2 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -137,8 +137,12 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, int harq_pid; UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE); - AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n"); - AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); + if( (UE_id<0) || (UE_id>=NUMBER_OF_UE_MAX) ){ + LOG_E(PHY,"illegal UE_id found!!! rnti %04x UE_id %d\n",rel8->rnti,UE_id); + return; + } + //AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n"); + //AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); dlsch0 = eNB->dlsch[UE_id][0]; dlsch1 = eNB->dlsch[UE_id][1]; @@ -176,9 +180,14 @@ 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 - AssertFatal(sdu!=NULL,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d\n", - proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid, - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index); + if(sdu == NULL) { + LOG_E(PHY,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d\n", + proc->frame_tx, proc->subframe_tx, rel8->rnti, UE_id, harq_pid, dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index); + return; + } + //AssertFatal(sdu!=NULL,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d\n", + // proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid, + // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index); if (rel8->rnti != 0xFFFF) LOG_D(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; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 8500cd8b9b..d1f6e9a161 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1690,7 +1690,11 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling) { int UE_id = find_dlsch(rnti,eNB,SEARCH_EXIST); - AssertFatal(UE_id>=0,"UE_id doesn't exist\n"); + if( (UE_id<0) || (UE_id>=NUMBER_OF_UE_MAX) ){ + LOG_E(PHY,"illegal UE_id found!!! rnti %04x UE_id %d\n",rnti,UE_id); + return; + } + //AssertFatal(UE_id>=0,"UE_id doesn't exist\n"); pthread_mutex_lock(&eNB->UL_INFO_mutex); nfapi_harq_indication_pdu_t *pdu = &eNB->UL_INFO.harq_ind.harq_pdu_list[eNB->UL_INFO.harq_ind.number_of_harqs]; @@ -1759,7 +1763,11 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB, uint16_t tdd_multiplexing_mask) { int UE_id=find_dlsch(uci->rnti,eNB,SEARCH_EXIST); - AssertFatal(UE_id>=0,"UE_id doesn't exist\n"); + if( (UE_id<0) || (UE_id>=NUMBER_OF_UE_MAX) ){ + LOG_E(PHY,"illegal UE_id found!!! rnti %04x UE_id %d\n",uci->rnti,UE_id); + return; + } + //AssertFatal(UE_id>=0,"UE_id doesn't exist\n"); pthread_mutex_lock(&eNB->UL_INFO_mutex); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 6a4c93ac3a..5fe91571ab 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -782,9 +782,13 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, // Get RRCConnectionSetup for Piggyback rrc_sdu_length = mac_rrc_data_req(module_idP, CC_idP, frameP, CCCH, 1, // 1 transport block &cc[CC_idP].CCCH_pdu.payload[0], ENB_FLAG_YES, module_idP, 0); // not used in this case - - AssertFatal(rrc_sdu_length > 0, - "[MAC][eNB Scheduler] CCCH not allocated\n"); + + if(rrc_sdu_length <= 0) { + LOG_D(MAC,"[MAC][eNB Scheduler] CCCH not allocated\n %d",rrc_sdu_length); + return; + } + //AssertFatal(rrc_sdu_length > 0, + //"[MAC][eNB Scheduler] CCCH not allocated\n"); LOG_D(MAC, diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 90b85f6c14..3660fa2606 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -927,6 +927,7 @@ void release_UE_in_freeList(module_id_t mod_id) int i, j , CC_id, pdu_number; protocol_ctxt_t ctxt; LTE_eNB_ULSCH_t *ulsch = NULL; + LTE_eNB_DLSCH_t *dlsch = NULL; nfapi_ul_config_request_body_t *ul_req_tmp = NULL; PHY_VARS_eNB *eNB_PHY = NULL; struct rrc_eNB_ue_context_s *ue_context_pP = NULL; @@ -966,10 +967,12 @@ void release_UE_in_freeList(module_id_t mod_id) memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI)); } } - ulsch = eNB_PHY->ulsch[i]; - if((ulsch != NULL) && (ulsch->rnti == rnti)){ - LOG_I(RRC, "clean_eNb_ulsch ulsch[%d] UE %x\n", i, rnti); - clean_eNb_ulsch(ulsch); + for (i=0; idlsch[i][0]; + if((dlsch != NULL) && (dlsch->rnti == rnti)){ + LOG_I(RRC, "clean_eNb_dlsch dlsch[%d] UE %x \n", i, rnti); + clean_eNb_dlsch(dlsch); + } } for(j = 0; j < 10; j++){ From eaa3f533a5b2f469185d580a01f3e58093217242 Mon Sep 17 00:00:00 2001 From: Haruki NAOI Date: Tue, 20 Mar 2018 13:00:21 +0900 Subject: [PATCH 59/63] Fix: segmentation fault happens when clean_eNb_dlsch() function is executed while pdsch procedure running. --- openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c index 90450b7c1c..5e82fdcd0f 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c @@ -2063,6 +2063,10 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, if ((dlsch0 != NULL) && (dlsch1 != NULL)){ harq_pid = dlsch0->harq_ids[subframe_offset]; + if(harq_pid >= dlsch0->Mdlharq) { + LOG_E(PHY,"illegal harq_pid %d\n", harq_pid); + return(-1); + } dlsch0_harq = dlsch0->harq_processes[harq_pid]; mimo_mode = dlsch0_harq->mimo_mode; mod_order0 = dlsch0_harq->Qm; @@ -2080,6 +2084,10 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, }else if ((dlsch0 != NULL) && (dlsch1 == NULL)){ harq_pid = dlsch0->harq_ids[subframe_offset]; + if(harq_pid >= dlsch0->Mdlharq) { + LOG_E(PHY,"illegal harq_pid %d\n", harq_pid); + return(-1); + } dlsch0_harq = dlsch0->harq_processes[harq_pid]; mimo_mode = dlsch0_harq->mimo_mode; mod_order0 = dlsch0_harq->Qm; @@ -2097,6 +2105,10 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, }else if ((dlsch0 == NULL) && (dlsch1 != NULL)){ harq_pid = dlsch1->harq_ids[subframe_offset]; + if(harq_pid >= dlsch1->Mdlharq) { + LOG_E(PHY,"illegal harq_pid %d\n", harq_pid); + return(-1); + } dlsch1_harq = dlsch1->harq_processes[harq_pid]; mimo_mode = dlsch1_harq->mimo_mode; mod_order0 = dlsch1_harq->Qm; From 5646b07870a0518e0de93383481e811b1030a79c Mon Sep 17 00:00:00 2001 From: Masayuki HARADA Date: Fri, 23 Mar 2018 14:20:58 +0900 Subject: [PATCH 60/63] =?UTF-8?q?Fix=20ul=20scd=20problems.=20=E3=83=BBDel?= =?UTF-8?q?ete=20double=20BSR=20calculation.=20=E3=83=BBchange=20TBS=20for?= =?UTF-8?q?=20mcs=20setting=20bit=20to=20byte.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 39cd022424ebe98c95be32cbb4127aa9d0e0ff3b) --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 6 ++++-- openair2/LAYER2/MAC/pre_processor.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 6b5bf9a3d0..4e5eda84f0 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1788,12 +1788,12 @@ void schedule_ulsch_rnti(module_id_t module_idP, VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED,UE_sched_ctrl->ul_scheduled); // adjust total UL buffer status by TBS, wait for UL sdus to do final update - LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,UE_template->TBS_UL[harq_pid]); + /*LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,UE_template->TBS_UL[harq_pid]); if (UE_template->ul_total_buffer > UE_template->TBS_UL[harq_pid]) UE_template->ul_total_buffer -= UE_template->TBS_UL[harq_pid]; else UE_template->ul_total_buffer = 0; - LOG_D(MAC,"ul_total_buffer, new %d\n", UE_template->ul_total_buffer); + LOG_D(MAC,"ul_total_buffer, new %d\n", UE_template->ul_total_buffer);*/ // Cyclic shift for DM RS cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1) // save it for a potential retransmission @@ -1868,6 +1868,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, // increment first rb for next UE allocation first_rb[CC_id]+=rb_table[rb_table_index]; if(ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_FIRST) { + LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,UE_template->TBS_UL[harq_pid]); if(ulsch_ue_select[CC_id].list[ulsch_ue_num].ul_total_buffer > 0){ if (UE_template->ul_total_buffer > UE_template->TBS_UL[harq_pid]) UE_template->ul_total_buffer -= UE_template->TBS_UL[harq_pid]; @@ -1876,6 +1877,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, } else { UE_template->ul_SR = 0; } + LOG_D(MAC,"ul_total_buffer, new %d\n", UE_template->ul_total_buffer); } if((ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_INACTIVE) && (ULSCH_first_end == 0)) { ULSCH_first_end = 1; diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index b341c9ca3c..f3ec71bfcd 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -2788,28 +2788,28 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, if ( ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_FIRST ) { if ( ulsch_ue_select[CC_id].list[ulsch_ue_num].ul_total_buffer > 0 ) { rb_table_index = 2; - tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; - tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); + tbs = get_TBS_UL(mcs,rb_table[rb_table_index]); + tx_power= estimate_ue_tx_power(tbs*8,rb_table[rb_table_index],0,frame_parms->Ncp,0); while ( (((UE_template->phr_info - tx_power) < 0 ) || (tbs > UE_template->ul_total_buffer)) && (mcs > 3) ) { mcs--; - tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; - tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); + tbs = get_TBS_UL(mcs,rb_table[rb_table_index]); + tx_power= estimate_ue_tx_power(tbs*8,rb_table[rb_table_index],0,frame_parms->Ncp,0); } if(frame_parms->N_RB_UL == 25){ while ( (tbs < UE_template->ul_total_buffer) && (rb_table[rb_table_index]<(frame_parms->N_RB_UL-1-first_rb[CC_id])) && ((UE_template->phr_info - tx_power) > 0) && (rb_table_index < 32 )) { rb_table_index++; - tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; - tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); + tbs = get_TBS_UL(mcs,rb_table[rb_table_index]); + tx_power= estimate_ue_tx_power(tbs*8,rb_table[rb_table_index],0,frame_parms->Ncp,0); } }else{ while ( (tbs < UE_template->ul_total_buffer) && (rb_table[rb_table_index]<(frame_parms->N_RB_UL-2-first_rb[CC_id])) && ((UE_template->phr_info - tx_power) > 0) && (rb_table_index < 32 )) { rb_table_index++; - tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; - tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); + tbs = get_TBS_UL(mcs,rb_table[rb_table_index]); + tx_power= estimate_ue_tx_power(tbs*8,rb_table[rb_table_index],0,frame_parms->Ncp,0); } } if ( rb_table[rb_table_index]<3 ) { From 8f86f38d58ced447e507725fa9aef5c19a91782e Mon Sep 17 00:00:00 2001 From: Haruki NAOI Date: Fri, 23 Mar 2018 18:24:51 +0900 Subject: [PATCH 61/63] Fix: memory leak occurs when memblock is exhausted. (cherry picked from commit 0e550a32e46d797d03fd72e54e474762d4db7614) # Conflicts: # openair2/LAYER2/RLC/rlc.c --- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c | 1 + openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c | 1 + openair2/LAYER2/RLC/rlc.c | 4 ++++ openair2/LAYER2/RLC/rlc_mac.c | 1 + 4 files changed, 7 insertions(+) diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c index c8b8bce7aa..6f1516d3b9 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c @@ -509,6 +509,7 @@ rlc_am_rx ( default: LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" TX UNKNOWN PROTOCOL STATE 0x%02X\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP, rlc), rlc->protocol_state); + list_free (&data_indP.data); } } diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c index 2e1629f8c8..77d0563bba 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c @@ -421,6 +421,7 @@ rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, void *argP, struct mac_data_ind LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" TX UNKNOWN PROTOCOL STATE %02X hex\n", PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,l_rlc_p), l_rlc_p->protocol_state); + list_free (&data_indP.data); } } diff --git a/openair2/LAYER2/RLC/rlc.c b/openair2/LAYER2/RLC/rlc.c index d70d85f2d5..a1cda00235 100644 --- a/openair2/LAYER2/RLC/rlc.c +++ b/openair2/LAYER2/RLC/rlc.c @@ -441,6 +441,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP, return RLC_OP_STATUS_OK; } else { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); + free_mem_block(sdu_pP, __func__); return RLC_OP_STATUS_INTERNAL_ERROR; } @@ -465,6 +466,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP, return RLC_OP_STATUS_OK; } else { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); + free_mem_block(sdu_pP, __func__); return RLC_OP_STATUS_INTERNAL_ERROR; } @@ -487,6 +489,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP, } else { //handle_event(ERROR,"FILE %s FONCTION rlc_data_req() LINE %s : out of memory\n", __FILE__, __LINE__); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); + free_mem_block(sdu_pP, __func__); return RLC_OP_STATUS_INTERNAL_ERROR; } @@ -521,6 +524,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP, return RLC_OP_STATUS_OK; } else { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); + free_mem_block(sdu_pP, __func__); return RLC_OP_STATUS_BAD_PARAMETER; } } else { diff --git a/openair2/LAYER2/RLC/rlc_mac.c b/openair2/LAYER2/RLC/rlc_mac.c index d49393d959..04619eb067 100644 --- a/openair2/LAYER2/RLC/rlc_mac.c +++ b/openair2/LAYER2/RLC/rlc_mac.c @@ -299,6 +299,7 @@ void mac_rlc_data_ind ( switch (rlc_mode) { case RLC_MODE_NONE: //handle_event(WARNING,"FILE %s FONCTION mac_rlc_data_ind() LINE %s : no radio bearer configured :%d\n", __FILE__, __LINE__, channel_idP); + list_free (&data_ind.data); break; case RLC_MODE_AM: From 1846c56d54cce69c50142f80c4f9c43f7ad5ea06 Mon Sep 17 00:00:00 2001 From: jftt_wangshanshan Date: Wed, 4 Apr 2018 15:54:44 +0800 Subject: [PATCH 62/63] Add the missing part of DAI setting and harq_pid calculation to OAI SCD --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 5 +++-- openair2/LAYER2/MAC/pre_processor.c | 5 +---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 44c8e33a0a..ea33715596 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1489,6 +1489,7 @@ schedule_ulsch_rnti(module_id_t module_idP, cqi_req; hi_dci0_pdu->dci_pdu.dci_pdu_rel8.dl_assignment_index = UE_template->DAI_ul[sched_subframeP]; + hi_dci0_pdu->dci_pdu.dci_pdu_rel8.harq_pid = harq_pid; hi_dci0_req_body->number_of_dci++; hi_dci0_req_body->sfnsf = sfnsf_add_subframe(sched_frame, sched_subframeP, 0); //(frameP, subframeP, 4) @@ -1554,7 +1555,7 @@ schedule_ulsch_rnti(module_id_t module_idP, uint16_t ul_sched_frame = sched_frame; uint16_t ul_sched_subframeP = sched_subframeP; - add_subframe(&ul_sched_frame, &ul_sched_subframeP, 2); + // add_subframe(&ul_sched_frame, &ul_sched_subframeP, 2); ul_req_tmp->sfn_sf = ul_sched_frame<<4|ul_sched_subframeP; add_ue_ulsch_info(module_idP, @@ -1641,7 +1642,7 @@ schedule_ulsch_rnti(module_id_t module_idP, ul_req_tmp_body->ul_config_pdu_list[ul_req_index].pdu_type = NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE; ul_req_tmp_body->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG; ul_req_tmp_body->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.n_srs_initial = 0; // last symbol not punctured - ul_req_tmp_body->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks = rb_table[rb_table_index]; + ul_req_tmp_body->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.initial_transmission_parameters.initial_transmission_parameters_rel8.initial_number_of_resource_blocks = UE_template->nb_rb_ul[harq_pid]; fill_nfapi_ulsch_harq_information(module_idP, CC_id,rnti, &ul_req_tmp_body->ul_config_pdu_list[ul_req_index].ulsch_harq_pdu.harq_information,subframeP); }else{ ul_req_tmp_body->number_of_pdus++; diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index ee8e9f124c..7429489334 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -1182,10 +1182,7 @@ 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]; cc = &RC.mac[Mod_id]->common_channels[ii]; - if (cc->tdd_Config) - harq_pid = ((frameP * 10) + subframeP) % 10; - else - harq_pid = ((frameP * 10) + subframeP) & 7; + harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); round = ue_sched_ctl->round[CC_id][harq_pid]; average_rbs_per_user[CC_id] = 0; From dbddecb775de6424eb804bb2beddbfc901fa9eb8 Mon Sep 17 00:00:00 2001 From: Wu Jing Date: Wed, 4 Apr 2018 18:56:56 +0900 Subject: [PATCH 63/63] fix Paging bug when PO=subframe0 and sfn_sf error --- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 39bed78c37..2ac618ccd3 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -1844,7 +1844,7 @@ void schedule_PCH(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) LOG_D(MAC,"[eNB %d] Frame %d subframe %d: PCCH->PCH CC_id %d UE_id %d, Received %d bytes \n", module_idP, frameP, subframeP, CC_id,i, pcch_sdu_length); #ifdef FORMAT1C //NO SIB - if ((subframeP == 1 || subframeP == 2 || subframeP == 4 || subframeP == 6 || subframeP == 9) || + if ((subframeP == 0 || subframeP == 1 || subframeP == 2 || subframeP == 4 || subframeP == 6 || subframeP == 9) || (subframeP == 5 && ((frameP % 2) != 0 && (frameP % 8) != 1))) { switch (n_rb_dl) { #if 0 @@ -1963,7 +1963,7 @@ void schedule_PCH(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) } #else //NO SIB - if ((subframeP == 1 || subframeP == 2 || subframeP == 4 || subframeP == 6 || subframeP == 9) || + if ((subframeP == 0 || subframeP == 1 || subframeP == 2 || subframeP == 4 || subframeP == 6 || subframeP == 9) || (subframeP == 5 && ((frameP % 2) != 0 && (frameP % 8) != 1))) { switch (n_rb_dl) { case 25: @@ -2051,6 +2051,10 @@ void schedule_PCH(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for P_RNTI\n", frameP,subframeP); dl_req->number_dci++; dl_req->number_pdu++; + dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; + eNB->DL_req[CC_id].sfn_sf = frameP<<4 | subframeP; + eNB->DL_req[CC_id].header.message_id = NFAPI_DL_CONFIG_REQUEST; + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE; @@ -2091,6 +2095,7 @@ void schedule_PCH(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) TX_req->num_segments = 1; TX_req->segments[0].segment_length = pcch_sdu_length; TX_req->segments[0].segment_data = cc[CC_id].PCCH_pdu.payload; + eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG; eNB->TX_req[CC_id].tx_request_body.number_of_pdus++; } else { LOG_E(MAC,"[eNB %d] CCid %d Frame %d, subframe %d : Cannot add DCI 1A/1C for Paging\n",module_idP, CC_id, frameP, subframeP);