From e2d46f8040bc1e693e58a7bb44171abd1f03818e Mon Sep 17 00:00:00 2001 From: Calisson <calisson@eurecom.fr> Date: Mon, 20 Mar 2017 09:49:03 +0100 Subject: [PATCH] adding mechanism for SRS scheduling of multiple UEs. --- openair1/SCHED/defs.h | 2 +- openair1/SCHED/phy_procedures_lte_ue.c | 4 +-- openair1/SIMULATION/LTE_PHY/ulsim.c | 3 +- openair2/ENB_APP/enb_config.c | 2 +- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 31 +++++++++++++++++-- .../CONF/enb.band7.tm1.usrpb210.conf | 6 ++-- 6 files changed, 37 insertions(+), 11 deletions(-) diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index 4aad186f76..f283014af7 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -379,7 +379,7 @@ void process_timing_advance_rar(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,ui unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb); -void phy_reset_ue( PHY_VARS_UE *ue ); +void phy_reset_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index); /*! \brief This function retrives the resource (n1_pucch) corresponding to a PDSCH transmission in subframe n-4 which is acknowledged in subframe n (for FDD) according to n1_pucch = Ncce + N1_pucch. For diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index ca9ee8df7c..41ea1339d5 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -258,14 +258,14 @@ void dump_dlsch_ra(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s write_output("dlsch_mag2.m","dlschmag2",ue->pdsch_vars_ra[0]->dl_ch_magb0,300*nsymb,1,1); } - -void phy_reset_ue(PHY_VARS_UE *ue) +void phy_reset_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index) { // This flushes ALL DLSCH and ULSCH harq buffers of ALL connected eNBs...add the eNB_index later // for more flexibility uint8_t i,j,k,s; + PHY_VARS_UE *ue = PHY_vars_UE_g[Mod_id][CC_id]; //[NUMBER_OF_CONNECTED_eNB_MAX][2]; for(i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) { diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 6b3c3c6bbc..02800b8520 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -932,7 +932,8 @@ int main(int argc, char **argv) ndi=0; - phy_reset_ue(UE); + PHY_vars_UE_g = UE; + phy_reset_ue(0,0,0); UE->UE_mode[eNB_id]=PUSCH; for (trials = 0; trials<n_frames; trials++) { diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 36b9e03935..2db6c0840a 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -427,7 +427,7 @@ void enb_config_display(void) if (enb_properties.properties[i]->srs_enable[j]) { printf( "\tsrs_BandwidthConfig for CC %d:\t%ld:\n",j,enb_properties.properties[i]->srs_BandwidthConfig[j]); - printf( "\tsrs_BandwidthConfig for CC %d:\t%ld:\n",j,enb_properties.properties[i]->srs_SubframeConfig[j]); + printf( "\tsrs_SubframeConfig for CC %d:\t%ld:\n",j,enb_properties.properties[i]->srs_SubframeConfig[j]); printf( "\tsrs_ackNackST for CC %d:\t%d:\n",j,enb_properties.properties[i]->srs_ackNackST[j]); printf( "\tsrs_MaxUpPts for CC %d:\t%d:\n",j,enb_properties.properties[i]->srs_MaxUpPts[j]); } diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index f6a5a0c9df..08584c883b 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -99,7 +99,7 @@ int errno; # endif #endif -//#define XER_PRINT +#define XER_PRINT extern Enb_properties_array_t enb_properties; typedef struct xer_sprint_string_s { @@ -1593,8 +1593,33 @@ do_RRCConnectionSetup( SoundingRS_UL_ConfigDedicated__setup__srs_HoppingBandwidth_hbw0; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition=0; physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.duration=1; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=2; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb=0; + 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", + enb_properties.properties[ctxt_pP->module_id]->srs_SubframeConfig[CC_id]); + if (ue_context_pP->local_uid >=10) + 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.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", + 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", + 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.transmissionComb= ue_context_pP->local_uid%2; + } + LOG_W(RRC,"local UID %d, srs ConfigIndex %d, TransmissionComb %d\n",ue_context_pP->local_uid, + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex, + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb); + physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift= SoundingRS_UL_ConfigDedicated__setup__cyclicShift_cs0; } 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 a9933a6444..878daf4cf8 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 @@ -62,9 +62,9 @@ eNBs = pusch_nDMRS1 = 1; phich_duration = "NORMAL"; phich_resource = "ONESIXTH"; - srs_enable = "ENABLE"; + srs_enable = "DISABLE"; srs_BandwidthConfig = 2; - srs_SubframeConfig = 3; + srs_SubframeConfig = 2; srs_ackNackST = "DISABLE"; srs_MaxUpPts = "DISABLE"; @@ -137,7 +137,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.70"; + mme_ip_address = ( { ipv4 = "192.168.12.26"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; -- GitLab