From 7685cf18118bc3f6042c202959d8049596029500 Mon Sep 17 00:00:00 2001 From: Calisson <calisson@eurecom.fr> Date: Tue, 21 Mar 2017 14:05:16 +0100 Subject: [PATCH] fixing srs in msg3. now all SRS subframe configs work. --- openair1/PHY/LTE_TRANSPORT/rar_tools.c | 17 +++++++++++++++-- openair1/SCHED/phy_procedures_lte_eNb.c | 11 +++-------- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 16 ++++++++-------- .../CONF/enb.band7.tm1.usrpb210.conf | 2 +- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/rar_tools.c b/openair1/PHY/LTE_TRANSPORT/rar_tools.c index 60fa52df16..2629c6ba7f 100644 --- a/openair1/PHY/LTE_TRANSPORT/rar_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/rar_tools.c @@ -31,6 +31,7 @@ */ #include "PHY/defs.h" #include "PHY/extern.h" +#include "SCHED/defs.h" #include "SCHED/extern.h" #include "LAYER2/MAC/defs.h" #include "SCHED/defs.h" @@ -69,6 +70,7 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu, uint8_t cqireq; uint16_t *RIV2nb_rb_LUT, *RIV2first_rb_LUT; uint16_t RIV_max; + uint16_t use_srs=0; LOG_D(PHY,"[eNB][RAPROC] generate_eNB_ulsch_params_from_rar: subframe %d (harq_pid %d)\n",subframe,harq_pid); @@ -133,8 +135,6 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu, ulsch->beta_offset_ri_times8 = 10; ulsch->beta_offset_harqack_times8 = 16; - - ulsch->harq_processes[harq_pid]->Nsymb_pusch = 12-(frame_parms->Ncp<<1); ulsch->rnti = (((uint16_t)rar[4])<<8)+rar[5]; if (ulsch->harq_processes[harq_pid]->round == 0) { @@ -151,6 +151,19 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu, ulsch->harq_processes[harq_pid]->round++; } + + ulsch->Msg3_active = 1; + + get_Msg3_alloc(frame_parms, + subframe, + frame, + &ulsch->Msg3_frame, + &ulsch->Msg3_subframe); + + use_srs = is_srs_occasion_common(frame_parms,ulsch->Msg3_frame,ulsch->Msg3_subframe); + ulsch->harq_processes[harq_pid]->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1); + ulsch->harq_processes[harq_pid]->srs_active = use_srs; + #ifdef DEBUG_RAR msg("ulsch ra (eNB): harq_pid %d\n",harq_pid); msg("ulsch ra (eNB): NBRB %d\n",ulsch->harq_processes[harq_pid]->nb_rb); diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 36d6ca8ff9..821cfef7df 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -822,10 +822,12 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; int frame = proc->frame_tx; int subframe = proc->subframe_tx; + /* uint16_t srsPeriodicity=0; uint16_t srsOffset=0; uint16_t srsConfigIndex=0; uint16_t do_srs=0; + */ uint16_t is_srs_pos=0; LOG_D(PHY, @@ -1006,17 +1008,10 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,LTE_eNB_DLSCH_t *d generate_eNB_ulsch_params_from_rar(DLSCH_pdu, frame, - (subframe), + subframe, eNB->ulsch[(uint32_t)UE_id], fp); - eNB->ulsch[(uint32_t)UE_id]->Msg3_active = 1; - - get_Msg3_alloc(fp, - subframe, - frame, - &eNB->ulsch[(uint32_t)UE_id]->Msg3_frame, - &eNB->ulsch[(uint32_t)UE_id]->Msg3_subframe); LOG_D(PHY,"[eNB][RAPROC] Frame %d subframe %d, Activated Msg3 demodulation for UE %"PRId8" in frame %"PRIu32", subframe %"PRIu8"\n", frame, subframe, diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 08584c883b..13fafcade8 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1594,26 +1594,26 @@ do_RRCConnectionSetup( physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition=0; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.duration=1; if (frame_parms->frame_type==FDD) { - if (enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]!=2) - LOG_W(RRC,"This code has been optimized for SRS Subframe Config 2, but current config is %d. Expect undefined behaviour!\n", + if (enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]!=0) + LOG_W(RRC,"This code has been optimized for SRS Subframe Config 0, but current config is %d. Expect undefined behaviour!\n", enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]); - if (ue_context_pP->local_uid >=10) + if (ue_context_pP->local_uid >=20) LOG_W(RRC,"This code has been optimized for up to 10 UEs, but current UE_id is %d. Expect undefined behaviour!\n", ue_context_pP->local_uid); //the current code will allow for 20 UEs - to be revised for more - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=8+2*(ue_context_pP->local_uid/2); + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=7+ue_context_pP->local_uid/2; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb= ue_context_pP->local_uid%2; } else { - if (enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]!=6) { - LOG_W(RRC,"This code has been optimized for SRS Subframe Config 6 and TDD config 3, but current configs are %d and %d. Expect undefined behaviour!\n", + if (enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]!=7) { + LOG_W(RRC,"This code has been optimized for SRS Subframe Config 7 and TDD config 3, but current configs are %d and %d. Expect undefined behaviour!\n", enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id], enb_properties.properties[ctxt_pP->module_id]->tdd_config[CC_id]); } if (ue_context_pP->local_uid >=6) - LOG_W(RRC,"This code has been optimized for up to 4 UEs, but current UE_id is %d. Expect undefined behaviour!\n", + LOG_W(RRC,"This code has been optimized for up to 6 UEs, but current UE_id is %d. Expect undefined behaviour!\n", ue_context_pP->local_uid); - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=18+ue_context_pP->local_uid/2; + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=17+ue_context_pP->local_uid/2; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb= ue_context_pP->local_uid%2; } LOG_W(RRC,"local UID %d, srs ConfigIndex %d, TransmissionComb %d\n",ue_context_pP->local_uid, diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index 878daf4cf8..d563f3af7e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -64,7 +64,7 @@ eNBs = phich_resource = "ONESIXTH"; srs_enable = "DISABLE"; srs_BandwidthConfig = 2; - srs_SubframeConfig = 2; + srs_SubframeConfig = 0; srs_ackNackST = "DISABLE"; srs_MaxUpPts = "DISABLE"; -- GitLab