diff --git a/README.txt b/README.txt index 9a3b759915c6e35aae0ac05631139bd3b4b1ee47..0a99216435635c0447563e915ff19667d0f7aba6 100644 --- a/README.txt +++ b/README.txt @@ -63,3 +63,4 @@ v1.0.0 -> January 2019. This version first implements the architectural split de A lot of bugfixes and a proper automated Continuous Integration process validates contributions. v1.0.1 -> February 2019: Bug fix for the UE L1 simulator. v1.0.2 -> February 2019: Full OAI support for 3.13.1 UHD +v1.0.3 -> June 2019: Bug fix for LimeSuite v19.04.0 API diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index 2a27673686b12c4cc83a0119ff25b3fc4e64a744..d118dd270d043c96c0c1490a9fbcff3fe81a47b2 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -454,7 +454,7 @@ pipeline { steps { sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}" } - } + } } } stage ("Test MONOLITHIC - FDD - Band 7 - B210") { @@ -498,6 +498,7 @@ pipeline { stage ("Test IF4p5 - FDD - Band 7 - B210") { steps { script { + sh "sleep 60" triggerSlaveJob ('eNB-CI-IF4p5-FDD-Band7-B210', 'Test-IF4p5-FDD-Band7') } } @@ -517,6 +518,7 @@ pipeline { stage ("Test IF4p5 - TDD - Band 40 - B210") { steps { script { + sh "sleep 60" triggerSlaveJob ('eNB-CI-IF4p5-TDD-Band40-B210', 'Test-IF4p5-TDD-Band40') } } diff --git a/ci-scripts/Jenkinsfile-tmp-full-ran b/ci-scripts/Jenkinsfile-tmp-full-ran index 4ade6086e8fb36d6961e31835ee41d6816b2e76d..3e0777b6a7247f1ad83ca817e509be50bcb361f2 100644 --- a/ci-scripts/Jenkinsfile-tmp-full-ran +++ b/ci-scripts/Jenkinsfile-tmp-full-ran @@ -75,21 +75,6 @@ pipeline { if (params.pythonExecutor != null) { echo "eNB CI executor node : ${pythonExecutor}" } - // If not present picking a default XML file - if (params.pythonTestXmlFile == null) { - // picking default - testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' - echo "Test XML file(default): ${testXMLFile}" - mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " - } else { - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - if (fileExists("ci-scripts/" + xmlFile)) { - mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " - echo "Test XML file : ${xmlFile}" - } - } - } // If not present picking a default Stage Name if (params.pipelineTestStageName == null) { // picking default @@ -193,6 +178,21 @@ pipeline { script { dir ('ci-scripts') { echo "\u2705 \u001B[32m${testStageName}\u001B[0m" + // If not present picking a default XML file + if (params.pythonTestXmlFile == null) { + // picking default + testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' + echo "Test XML file(default): ${testXMLFile}" + mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " + } else { + String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") + for (xmlFile in myXmlTestSuite) { + if (fileExists(xmlFile)) { + mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " + echo "Test XML file : ${xmlFile}" + } + } + } withCredentials([ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.UE_Credentials}", usernameVariable: 'UE_Username', passwordVariable: 'UE_Password'], diff --git a/ci-scripts/Jenkinsfile-tmp-ran b/ci-scripts/Jenkinsfile-tmp-ran index 525ceec52502b1e74adc682d81a022d51d2d1f8b..5ffaefa89ff261cd5b54c1f3510b0337ef57a06d 100644 --- a/ci-scripts/Jenkinsfile-tmp-ran +++ b/ci-scripts/Jenkinsfile-tmp-ran @@ -106,21 +106,6 @@ pipeline { if (params.pythonExecutor != null) { echo "eNB CI executor node : ${pythonExecutor}" } - // If not present picking a default XML file - if (params.pythonTestXmlFile == null) { - // picking default - testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' - echo "Test XML file(default): ${testXMLFile}" - mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " - } else { - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - if (fileExists("ci-scripts/" + xmlFile)) { - mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " - echo "Test XML file : ${xmlFile}" - } - } - } // If not present picking a default Stage Name if (params.pipelineTestStageName == null) { // picking default @@ -212,6 +197,21 @@ pipeline { script { dir ('ci-scripts') { echo "\u2705 \u001B[32m${testStageName}\u001B[0m" + // If not present picking a default XML file + if (params.pythonTestXmlFile == null) { + // picking default + testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' + echo "Test XML file(default): ${testXMLFile}" + mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " + } else { + String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") + for (xmlFile in myXmlTestSuite) { + if (fileExists(xmlFile)) { + mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " + echo "Test XML file : ${xmlFile}" + } + } + } withCredentials([ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], diff --git a/ci-scripts/Jenkinsfile-tmp-ue b/ci-scripts/Jenkinsfile-tmp-ue index 70fe29879fa3e23c4ff5c75ac62da76341e5b8a0..c2db977bcb8ff4faf068ae68355bccbc810bce79 100644 --- a/ci-scripts/Jenkinsfile-tmp-ue +++ b/ci-scripts/Jenkinsfile-tmp-ue @@ -66,35 +66,6 @@ pipeline { ansiColor('xterm') lock (ciSmartPhoneResource) } - // the following parameter options are commented out so it shows the ones - // that you SHALL have to run the job. - // You can use them as template - /* - parameters { - //node-test parameters - string(name: 'pythonExecutor', defaultValue: 'nodea', description: 'Node where the pipeline - python scripts will be executed') - string(name: 'pythonTestXmlFile', defaultValue: 'enb_usrpB210_band7_50PRB.xml', description: 'Location of the Test XML to be run') - string(name: 'pipelineTestStageName', defaultValue: 'Test COTS-UE - OAI eNB - LTEBOX EPC', description: 'Naming of the Test Stage') - booleanParam(name: 'pipelineZipsConsoleLog', defaultValue: 'True', description: 'If true, the pipeline script retrieves the job console log, zips it and archives it as artifact') - string(name: 'smartphonesResource', defaultValue: 'CI-Bench-1-Phones', description: 'Lockeable Resource to prevent multiple jobs to run simultaneously with the same resource') - - //eNB parameters - string(name: 'eNB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of eNB') - credentials(name: 'eNB_Credentials', defaultValue: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', credentialType: "Username with password", required: true, description: 'Credentials for eNB') - string(name: 'eNB_SourceCodePath', defaultValue: '/tmp/CI-enb', description: 'Full path of eNB source code') - - //EPC parameters - string(name: 'EPC_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of EPC') - string(name: 'EPC_Type', defaultValue: 'ltebox', description: 'EPC type: OAI or ltebox') - credentials(name: 'EPC_Credentials', defaultValue: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', credentialType: "Username with password", required: true, description: 'Credentials for EPC') - string(name: 'EPC_SourceCodePath', defaultValue: '/tmp/CI-enb', description: 'Full path of EPC source code') - - //ADB server parameters - string(name: 'ADB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of ADB server') - credentials(name: 'ADB_Credentials', defaultValue: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', credentialType: "Username with password", required: true, description: 'Credentials for ADB') - } - */ - stages { stage ("Verify Parameters") { steps { @@ -106,21 +77,6 @@ pipeline { if (params.pythonExecutor != null) { echo "eNB CI executor node : ${pythonExecutor}" } - // If not present picking a default XML file - if (params.pythonTestXmlFile == null) { - // picking default - testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml' - echo "Test XML file(default): ${testXMLFile}" - mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " - } else { - String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") - for (xmlFile in myXmlTestSuite) { - if (fileExists("ci-scripts/" + xmlFile)) { - mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " - echo "Test XML file : ${xmlFile}" - } - } - } // If not present picking a default Stage Name if (params.pipelineTestStageName == null) { // picking default @@ -212,6 +168,21 @@ pipeline { script { dir ('ci-scripts') { echo "\u2705 \u001B[32m${testStageName}\u001B[0m" + // If not present picking a default XML file + if (params.pythonTestXmlFile == null) { + // picking default + testXMLFile = 'xml_files/ue_band20_build.xml' + echo "Test XML file(default): ${testXMLFile}" + mainPythonAllXmlFiles += "--XMLTestFile=" + testXMLFile + " " + } else { + String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") + for (xmlFile in myXmlTestSuite) { + if (fileExists(xmlFile)) { + mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " " + echo "Test XML file : ${xmlFile}" + } + } + } withCredentials([ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.UE_Credentials}", usernameVariable: 'UE_Username', passwordVariable: 'UE_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password'] diff --git a/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf b/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf index ea8a56e38571e452792402c54b193598e3509b18..e0969fbc31f25845434f40ed59873bb71cd69ad9 100644 --- a/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf +++ b/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf @@ -360,6 +360,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf index 370697660e62474d4410d818e47721964d83c62b..c588bc0c75257c98f366689949fdde47724833bc 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf index fbbc2f1154f6cd82f8708c38749b679d7fb605e9..9addb0c830c8f2e937121a551a8cf0aceba50274 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf index f49d860a51f263284140c2458536b7211dc0e2cb..a255e12680f661f962877b9a07bf5253b3f0305c 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf index c119e2f1c039f7d5cf4d755dd4bee195f9735e71..517c916c859af141d46dce8e5d51fc2f1efc19e4 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf @@ -178,6 +178,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf index a0d3ba6d06190d5392e211a0c3c7ef2380223ec3..6560fa41c5f902b8061ed0ecf515142ea209b5fb 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf @@ -18,6 +18,9 @@ eNBs = tr_s_preference = "local_mac" + // In seconds + rrc_inactivity_threshold = 30; + ////////// Physical parameters: component_carriers = ( @@ -178,6 +181,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ @@ -241,8 +246,8 @@ THREAD_STRUCT = ( NETWORK_CONTROLLER : { FLEXRAN_ENABLED = "no"; - FLEXRAN_INTERFACE_NAME = "lo"; - FLEXRAN_IPV4_ADDRESS = "127.0.0.1"; + FLEXRAN_INTERFACE_NAME = "eth0"; + FLEXRAN_IPV4_ADDRESS = "CI_MME_IP_ADDR"; FLEXRAN_PORT = 2210; FLEXRAN_CACHE = "/mnt/oai_agent_cache"; FLEXRAN_AWAIT_RECONF = "no"; diff --git a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf index 92a6e6f0bc49ae787a1ebbcde7077adae5a1f988..bdcc201fd9921ef88079d11e5696d9cdd03ad9e3 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf @@ -186,6 +186,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf index b006e04e91beb7356d5ca300d3a7ed40cfb3d7d1..0bcdba99fbef54564c5a99e0dacd1d97a3bf2764 100644 --- a/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf @@ -181,6 +181,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/lte-fdd-basic-sim.conf b/ci-scripts/conf_files/lte-fdd-basic-sim.conf index cabbed871a49bd74bdc7d3a649675a44c10e207a..24a2b400e63403f4d759c1ea0035542d5e604fe7 100644 --- a/ci-scripts/conf_files/lte-fdd-basic-sim.conf +++ b/ci-scripts/conf_files/lte-fdd-basic-sim.conf @@ -178,6 +178,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/lte-tdd-basic-sim.conf b/ci-scripts/conf_files/lte-tdd-basic-sim.conf index a376f45453a94f2cdcbd283ed1f6b88f24d49c84..3afdb5df60cde4ded5d1666993092da50586df4f 100644 --- a/ci-scripts/conf_files/lte-tdd-basic-sim.conf +++ b/ci-scripts/conf_files/lte-tdd-basic-sim.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf index d39f1e062064742373b0886fb071fb370246220d..2e13ba68a50b59426c3aab68fb73aa2492dbd38f 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf @@ -144,6 +144,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf index 0ae17356de40bd59002d4c66af947e24ed16bc3d..70a034e6472153c8cc19c0de32f9220372d27b62 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf @@ -144,6 +144,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf index c58f05c82f5ca41c25adf6811d838a7c321b49b6..456d45faf24f9bc340c247c872e78e86278ac1c2 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf @@ -144,6 +144,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf index 6f6aa987881ffb9905f68bca0d0a64a1ac0b6cb6..b842480e5d0112fa3b3c9f2745ecdc4c8653cfc0 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf @@ -181,6 +181,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf index ec7fce3dbf9d3f69361903df61ea688b0fd84734..98a546e8b506a24bccee70395e41f0d03dcadccc 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf @@ -181,6 +181,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf index 4ebbff4bdab963f049e6737772cca618eae409f4..2a8506a6604373643e627b38c1af6e153f278a94 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf @@ -181,6 +181,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf index 52c0593d1b3006072da5684d9eaf4248fc13a6d9..81fc7eedce43275998cfca24428ee77563e79452 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf @@ -179,6 +179,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 1ecccd0d687d9a08a6238393267503f13819e845..9809846c046ba6d0dc93119f310887441ff8de23 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -148,6 +148,9 @@ class SSHConnection(): self.Initialize_OAI_UE_args = '' self.Initialize_OAI_eNB_args = '' self.clean_repository = True + self.flexranCtrlInstalled = False + self.flexranCtrlStarted = False + self.expectedNbOfConnectedUEs = 0 def open(self, ipaddress, username, password): count = 0 @@ -339,12 +342,24 @@ class SSHConnection(): self.command('mkdir -p log', '\$', 5) self.command('chmod 777 log', '\$', 5) # no need to remove in log (git clean did the trick) - self.command('stdbuf -o0 ./build_oai ' + self.Build_eNB_args + ' 2>&1 | stdbuf -o0 tee compile_oai_enb.log', 'Bypassing the Tests', 600) + self.command('stdbuf -o0 ./build_oai ' + self.Build_eNB_args + ' 2>&1 | stdbuf -o0 tee compile_oai_enb.log', 'Bypassing the Tests|build have failed', 600) + self.command('ls lte_build_oai/build', '\$', 3) + self.command('ls lte_build_oai/build', '\$', 3) + buildStatus = True + result = re.search('lte-softmodem', str(self.ssh.before)) + if result is None: + buildStatus = False self.command('mkdir -p build_log_' + self.testCase_id, '\$', 5) self.command('mv log/* ' + 'build_log_' + self.testCase_id, '\$', 5) self.command('mv compile_oai_enb.log ' + 'build_log_' + self.testCase_id, '\$', 5) self.close() - self.CreateHtmlTestRow(self.Build_eNB_args, 'OK', ALL_PROCESSES_OK) + if buildStatus: + self.CreateHtmlTestRow(self.Build_eNB_args, 'OK', ALL_PROCESSES_OK) + else: + logging.error('\u001B[1m Building OAI eNB Failed\u001B[0m') + self.CreateHtmlTestRow(self.Build_eNB_args, 'KO', ALL_PROCESSES_OK) + self.CreateHtmlTabFooter(False) + sys.exit(1) def BuildOAIUE(self): if self.UEIPAddress == '' or self.eNBRepository == '' or self.eNBBranch == '' or self.UEUserName == '' or self.UEPassword == '' or self.UESourceCodePath == '': @@ -377,13 +392,24 @@ class SSHConnection(): self.command('mkdir -p log', '\$', 5) self.command('chmod 777 log', '\$', 5) # no need to remove in log (git clean did the trick) - self.command('stdbuf -o0 ./build_oai ' + self.Build_OAI_UE_args + ' 2>&1 | stdbuf -o0 tee compile_oai_ue.log', 'Bypassing the Tests', 600) + self.command('stdbuf -o0 ./build_oai ' + self.Build_OAI_UE_args + ' 2>&1 | stdbuf -o0 tee compile_oai_ue.log', 'Bypassing the Tests|build have failed', 600) + self.command('ls lte_build_oai/build', '\$', 3) + self.command('ls lte_build_oai/build', '\$', 3) + buildStatus = True + result = re.search('lte-uesoftmodem', str(self.ssh.before)) + if result is None: + buildStatus = False self.command('mkdir -p build_log_' + self.testCase_id, '\$', 5) self.command('mv log/* ' + 'build_log_' + self.testCase_id, '\$', 5) self.command('mv compile_oai_ue.log ' + 'build_log_' + self.testCase_id, '\$', 5) self.close() - self.CreateHtmlTestRow(self.Build_OAI_UE_args, 'OK', ALL_PROCESSES_OK, 'OAI UE') - + if buildStatus: + self.CreateHtmlTestRow(self.Build_OAI_UE_args, 'OK', ALL_PROCESSES_OK, 'OAI UE') + else: + logging.error('\u001B[1m Building OAI UE Failed\u001B[0m') + self.CreateHtmlTestRow(self.Build_OAI_UE_args, 'KO', ALL_PROCESSES_OK, 'OAI UE') + self.CreateHtmlTabFooter(False) + sys.exit(1) def InitializeHSS(self): if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '' or self.EPCSourceCodePath == '' or self.EPCType == '': @@ -444,6 +470,37 @@ class SSHConnection(): self.close() self.CreateHtmlTestRow(self.EPCType, 'OK', ALL_PROCESSES_OK) + def CheckFlexranCtrlInstallation(self): + if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '': + return + self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) + self.command('ls -ls /opt/flexran_rtc/*/rt_controller', '\$', 5) + result = re.search('/opt/flexran_rtc/build/rt_controller', str(self.ssh.before)) + if result is not None: + self.flexranCtrlInstalled = True + logging.debug('Flexran Controller is installed') + self.close() + + def InitializeFlexranCtrl(self): + if self.flexranCtrlInstalled == False: + return + if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '': + Usage() + sys.exit('Insufficient Parameter') + self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) + self.command('cd /opt/flexran_rtc', '\$', 5) + self.command('echo ' + self.EPCPassword + ' | sudo -S rm -f log/*.log', '\$', 5) + self.command('echo ' + self.EPCPassword + ' | sudo -S echo "build/rt_controller -c log_config/basic_log" > ./my-flexran-ctl.sh', '\$', 5) + self.command('echo ' + self.EPCPassword + ' | sudo -S chmod 755 ./my-flexran-ctl.sh', '\$', 5) + self.command('echo ' + self.EPCPassword + ' | sudo -S daemon --unsafe --name=flexran_rtc_daemon --chdir=/opt/flexran_rtc -o /opt/flexran_rtc/log/flexranctl_' + self.testCase_id + '.log ././my-flexran-ctl.sh', '\$', 5) + self.command('ps -aux | grep --color=never rt_controller', '\$', 5) + result = re.search('rt_controller -c ', str(self.ssh.before)) + if result is not None: + logging.debug('\u001B[1m Initialize FlexRan Controller Completed\u001B[0m') + self.flexranCtrlStarted = True + self.close() + self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + def InitializeeNB(self): if self.eNBIPAddress == '' or self.eNBUserName == '' or self.eNBPassword == '' or self.eNBSourceCodePath == '': Usage() @@ -507,6 +564,10 @@ class SSHConnection(): self.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5) self.command('sed -i -e \'s/CI_MME_IP_ADDR/' + self.EPCIPAddress + '/\' ' + ci_full_config_file, '\$', 2); self.command('sed -i -e \'s/CI_ENB_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2); + if self.flexranCtrlInstalled and self.flexranCtrlStarted: + self.command('sed -i -e \'s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED = "yes";/\' ' + ci_full_config_file, '\$', 2); + else: + self.command('sed -i -e \'s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED = "no";/\' ' + ci_full_config_file, '\$', 2); # Launch eNB with the modified config file self.command('source oaienv', '\$', 5) self.command('cd cmake_targets', '\$', 5) @@ -576,6 +637,9 @@ class SSHConnection(): logging.debug('send adb commands') try: self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + # enable data service + self.command('stdbuf -o0 adb -s ' + device_id + ' shell svc data enable', '\$', 60) + # The following commands are deprecated since we no longer work on Android 7+ # self.command('stdbuf -o0 adb -s ' + device_id + ' shell settings put global airplane_mode_on 1', '\$', 10) # self.command('stdbuf -o0 adb -s ' + device_id + ' shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true', '\$', 60) @@ -1203,6 +1267,54 @@ class SSHConnection(): job.join() self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + def DataDisableUE_common(self, device_id): + try: + self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + # enable data service + self.command('stdbuf -o0 adb -s ' + device_id + ' shell svc data disable', '\$', 60) + logging.debug('\u001B[1mUE (' + device_id + ') Disabled Data Service\u001B[0m') + self.close() + except: + os.kill(os.getppid(),signal.SIGUSR1) + + def DataDisableUE(self): + if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': + Usage() + sys.exit('Insufficient Parameter') + multi_jobs = [] + for device_id in self.UEDevices: + p = Process(target = self.DataDisableUE_common, args = (device_id,)) + p.daemon = True + p.start() + multi_jobs.append(p) + for job in multi_jobs: + job.join() + self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + + def DataEnableUE_common(self, device_id): + try: + self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + # enable data service + self.command('stdbuf -o0 adb -s ' + device_id + ' shell svc data enable', '\$', 60) + logging.debug('\u001B[1mUE (' + device_id + ') Enabled Data Service\u001B[0m') + self.close() + except: + os.kill(os.getppid(),signal.SIGUSR1) + + def DataEnableUE(self): + if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': + Usage() + sys.exit('Insufficient Parameter') + multi_jobs = [] + for device_id in self.UEDevices: + p = Process(target = self.DataEnableUE_common, args = (device_id,)) + p.daemon = True + p.start() + multi_jobs.append(p) + for job in multi_jobs: + job.join() + self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + def GetAllUEDevices(self, terminate_ue_flag): if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': Usage() @@ -1229,6 +1341,118 @@ class SSHConnection(): sys.exit(1) self.close() + def CheckUEStatus_common(self, lock, device_id, statusQueue): + try: + self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + self.command('stdbuf -o0 adb -s ' + device_id + ' shell dumpsys telephony.registry', '\$', 15) + result = re.search('mServiceState=(?P<serviceState>[0-9]+)', str(self.ssh.before)) + serviceState = 'Service State: UNKNOWN' + if result is not None: + lServiceState = int(result.group('serviceState')) + if lServiceState == 3: + serviceState = 'Service State: RADIO_POWERED_OFF' + if lServiceState == 1: + serviceState = 'Service State: OUT_OF_SERVICE' + if lServiceState == 0: + serviceState = 'Service State: IN_SERVICE' + if lServiceState == 2: + serviceState = 'Service State: EMERGENCY_ONLY' + result = re.search('mDataConnectionState=(?P<dataConnectionState>[0-9]+)', str(self.ssh.before)) + dataConnectionState = 'Data State: UNKNOWN' + if result is not None: + lDataConnectionState = int(result.group('dataConnectionState')) + if lDataConnectionState == 0: + dataConnectionState = 'Data State: DISCONNECTED' + if lDataConnectionState == 1: + dataConnectionState = 'Data State: CONNECTING' + if lDataConnectionState == 2: + dataConnectionState = 'Data State: CONNECTED' + if lDataConnectionState == 3: + dataConnectionState = 'Data State: SUSPENDED' + result = re.search('mDataConnectionReason=(?P<dataConnectionReason>[0-9a-zA-Z_]+)', str(self.ssh.before)) + dataConnectionReason = 'Data Reason: UNKNOWN' + if result is not None: + dataConnectionReason = 'Data Reason: ' + result.group('dataConnectionReason') + lock.acquire() + logging.debug('\u001B[1;37;44m Status Check (' + str(device_id) + ') \u001B[0m') + logging.debug('\u001B[1;34m ' + serviceState + '\u001B[0m') + logging.debug('\u001B[1;34m ' + dataConnectionState + '\u001B[0m') + logging.debug('\u001B[1;34m ' + dataConnectionReason + '\u001B[0m') + statusQueue.put(0) + statusQueue.put(device_id) + qMsg = serviceState + '\n' + dataConnectionState + '\n' + dataConnectionReason + statusQueue.put(qMsg) + lock.release() + self.close() + except: + os.kill(os.getppid(),signal.SIGUSR1) + + def CheckStatusUE(self): + if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': + Usage() + sys.exit('Insufficient Parameter') + check_eNB = True + check_OAI_UE = False + pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE) + if (pStatus < 0): + self.CreateHtmlTestRow('N/A', 'KO', pStatus) + self.CreateHtmlTabFooter(False) + sys.exit(1) + multi_jobs = [] + lock = Lock() + status_queue = SimpleQueue() + for device_id in self.UEDevices: + p = Process(target = self.CheckUEStatus_common, args = (lock,device_id,status_queue,)) + p.daemon = True + p.start() + multi_jobs.append(p) + for job in multi_jobs: + job.join() + if self.flexranCtrlInstalled and self.flexranCtrlStarted: + self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) + self.command('cd /opt/flexran_rtc', '\$', 5) + self.command('curl http://localhost:9999/stats | jq \'.\' > log/check_status_' + self.testCase_id + '.log 2>&1', '\$', 5) + self.command('cat log/check_status_' + self.testCase_id + '.log | jq \'.eNB_config[0].UE\' | grep -c rnti | sed -e "s#^#Nb Connected UE = #"', '\$', 5) + result = re.search('Nb Connected UE = (?P<nb_ues>[0-9]+)', str(self.ssh.before)) + passStatus = True + if result is not None: + nb_ues = int(result.group('nb_ues')) + htmlOptions = 'Nb Connected UE(s) to eNB = ' + str(nb_ues) + logging.debug('\u001B[1;37;44m ' + htmlOptions + ' \u001B[0m') + if self.expectedNbOfConnectedUEs > -1: + if nb_ues != self.expectedNbOfConnectedUEs: + passStatus = False + else: + htmlOptions = 'N/A' + self.close() + else: + passStatus = True + htmlOptions = 'N/A' + + if (status_queue.empty()): + self.CreateHtmlTestRow(htmlOptions, 'KO', ALL_PROCESSES_OK) + self.AutoTerminateUEandeNB() + self.CreateHtmlTabFooter(False) + sys.exit(1) + else: + check_status = True + html_queue = SimpleQueue() + while (not status_queue.empty()): + count = status_queue.get() + if (count < 0): + check_status = False + device_id = status_queue.get() + message = status_queue.get() + html_cell = '<pre style="background-color:white">UE (' + device_id + ')\n' + message + '</pre>' + html_queue.put(html_cell) + if check_status and passStatus: + self.CreateHtmlTestRowQueue(htmlOptions, 'OK', len(self.UEDevices), html_queue) + else: + self.CreateHtmlTestRowQueue(htmlOptions, 'KO', len(self.UEDevices), html_queue) + self.AutoTerminateUEandeNB() + self.CreateHtmlTabFooter(False) + sys.exit(1) + def GetAllUEIPAddresses(self): if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': Usage() @@ -1351,6 +1575,12 @@ class SSHConnection(): except: os.kill(os.getppid(),signal.SIGUSR1) + def PingNoS1_wrong_exit(self, qMsg): + html_queue = SimpleQueue() + html_cell = '<pre style="background-color:white">OAI UE ping result\n' + qMsg + '</pre>' + html_queue.put(html_cell) + self.CreateHtmlTestRowQueue(self.ping_args, 'KO', len(self.UEDevices), html_queue) + def PingNoS1(self): check_eNB = True check_OAI_UE = True @@ -1383,21 +1613,25 @@ class SSHConnection(): if ping_status < 0: message = 'Ping with OAI UE crashed due to TIMEOUT!' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.PingNoS1_wrong_exit(message) return result = re.search(', (?P<packetloss>[0-9\.]+)% packet loss, time [0-9\.]+ms', str(self.ssh.before)) if result is None: message = 'Packet Loss Not Found!' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.PingNoS1_wrong_exit(message) return packetloss = result.group('packetloss') if float(packetloss) == 100: message = 'Packet Loss is 100%' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.PingNoS1_wrong_exit(message) return result = re.search('rtt min\/avg\/max\/mdev = (?P<rtt_min>[0-9\.]+)\/(?P<rtt_avg>[0-9\.]+)\/(?P<rtt_max>[0-9\.]+)\/[0-9\.]+ ms', str(self.ssh.before)) if result is None: message = 'Ping RTT_Min RTT_Avg RTT_Max Not Found!' logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + self.PingNoS1_wrong_exit(message) return rtt_min = result.group('rtt_min') rtt_avg = result.group('rtt_avg') @@ -2195,6 +2429,8 @@ class SSHConnection(): if logStatus < 0: result = logStatus self.eNBLogFile = '' + if self.flexranCtrlInstalled and self.flexranCtrlStarted: + self.TerminateFlexranCtrl() return result def CheckOAIUEProcessExist(self, initialize_OAI_UE_flag): @@ -2361,7 +2597,7 @@ class SSHConnection(): result = re.search('LTE_RRCConnectionSetupComplete from UE', str(line)) if result is not None: rrcSetupComplete += 1 - result = re.search('Generate LTE_RRCConnectionRelease', str(line)) + result = re.search('Generate LTE_RRCConnectionRelease|Generate RRCConnectionRelease', str(line)) if result is not None: rrcReleaseRequest += 1 result = re.search('Generate LTE_RRCConnectionReconfiguration', str(line)) @@ -2713,7 +2949,6 @@ class SSHConnection(): else: self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('cd scripts', '\$', 5) - self.command('rm -f ./kill_hss.sh', '\$', 5) self.command('echo ' + self.EPCPassword + ' | sudo -S daemon --name=simulated_hss --stop', '\$', 5) time.sleep(1) self.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGKILL hss_sim', '\$', 5) @@ -2750,9 +2985,25 @@ class SSHConnection(): self.close() self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + def TerminateFlexranCtrl(self): + if self.flexranCtrlInstalled == False or self.flexranCtrlStarted == False: + return + if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '': + Usage() + sys.exit('Insufficient Parameter') + self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) + self.command('echo ' + self.EPCPassword + ' | sudo -S daemon --name=flexran_rtc_daemon --stop', '\$', 5) + time.sleep(1) + self.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGKILL rt_controller', '\$', 5) + time.sleep(1) + self.close() + self.flexranCtrlStarted = False + self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + def TerminateUE_common(self, device_id): try: self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + # back in airplane mode on (ie radio off) self.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/off', '\$', 60) logging.debug('\u001B[1mUE (' + device_id + ') Detach Completed\u001B[0m') @@ -3354,7 +3605,7 @@ def Usage(): print('------------------------------------------------------------') def CheckClassValidity(action,id): - if action != 'Build_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'Build_OAI_UE' and action != 'Initialize_OAI_UE' and action != 'Terminate_OAI_UE' and action != 'Initialize_OAI_eNB' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module' and action != 'Ping_CatM_module' and action != 'IdleSleep': + if action != 'Build_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'Build_OAI_UE' and action != 'Initialize_OAI_UE' and action != 'Terminate_OAI_UE' and action != 'Initialize_OAI_eNB' and action != 'DataDisable_UE' and action != 'DataEnable_UE' and action != 'CheckStatusUE' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_FlexranCtrl' and action != 'Terminate_FlexranCtrl' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module' and action != 'Ping_CatM_module' and action != 'IdleSleep': logging.debug('ERROR: test-case ' + id + ' has wrong class ' + action) return False return True @@ -3391,6 +3642,13 @@ def GetParametersFromXML(action): else: SSH.nbMaxUEtoAttach = int(nbMaxUEtoAttach) + if action == 'CheckStatusUE': + expectedNBUE = test.findtext('expectedNbOfConnectedUEs') + if (expectedNBUE is None): + SSH.expectedNbOfConnectedUEs = -1 + else: + SSH.expectedNbOfConnectedUEs = int(expectedNBUE) + if action == 'Build_OAI_UE': SSH.Build_OAI_UE_args = test.findtext('Build_OAI_UE_args') SSH.clean_repository = test.findtext('clean_repository') @@ -3718,6 +3976,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re else: logging.debug('ERROR: requested test is invalidly formatted: ' + test) sys.exit(1) + SSH.CheckFlexranCtrlInstallation() #get the list of tests to be done todo_tests=[] @@ -3745,7 +4004,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re continue SSH.ShowTestID() GetParametersFromXML(action) - if action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Ping' or action == 'Iperf' or action == 'Reboot_UE': + if action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Ping' or action == 'Iperf' or action == 'Reboot_UE' or action == 'DataDisable_UE' or action == 'DataEnable_UE' or action == 'CheckStatusUE': if (SSH.ADBIPAddress != 'none'): terminate_ue_flag = False SSH.GetAllUEDevices(terminate_ue_flag) @@ -3763,6 +4022,12 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re SSH.AttachUE() elif action == 'Detach_UE': SSH.DetachUE() + elif action == 'DataDisable_UE': + SSH.DataDisableUE() + elif action == 'DataEnable_UE': + SSH.DataEnableUE() + elif action == 'CheckStatusUE': + SSH.CheckStatusUE() elif action == 'Build_OAI_UE': SSH.BuildOAIUE() elif action == 'Initialize_OAI_UE': @@ -3799,6 +4064,10 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re SSH.InitializeSPGW() elif action == 'Terminate_SPGW': SSH.TerminateSPGW() + elif action == 'Initialize_FlexranCtrl': + SSH.InitializeFlexranCtrl() + elif action == 'Terminate_FlexranCtrl': + SSH.TerminateFlexranCtrl() elif action == 'IdleSleep': SSH.IdleSleep() else: diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool index af252ed958e6cab9f9b070efa395d93575cbac50..bd814cc3a43900af24bec5f7a947c081b4301dad 100755 --- a/ci-scripts/oai-ci-vm-tool +++ b/ci-scripts/oai-ci-vm-tool @@ -238,7 +238,7 @@ case $key in VM_NAME=ci-enb-usrp ARCHIVES_LOC=enb_usrp LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=7 + NB_PATTERN_FILES=9 BUILD_OPTIONS="--eNB -w USRP --mu" NBARGS=$[$NBARGS+256] shift @@ -246,9 +246,9 @@ case $key in -v2) VM_NAME=ci-basic-sim ARCHIVES_LOC=basic_sim - LOG_PATTERN=basic_simulator - NB_PATTERN_FILES=2 - BUILD_OPTIONS="--basic-simulator" + LOG_PATTERN=Rel14.txt + NB_PATTERN_FILES=13 + BUILD_OPTIONS="--eNB --UE" VM_MEMORY=8192 VM_CPU=4 RUN_OPTIONS="complex" @@ -300,8 +300,8 @@ case $key in VM_CPU=4 ARCHIVES_LOC=enb_eth LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--eNB -t ETHERNET" + NB_PATTERN_FILES=8 + BUILD_OPTIONS="--eNB" NBARGS=$[$NBARGS+256] shift ;; @@ -311,8 +311,8 @@ case $key in VM_CPU=4 ARCHIVES_LOC=ue_eth LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=10 - BUILD_OPTIONS="--UE -t ETHERNET" + NB_PATTERN_FILES=12 + BUILD_OPTIONS="--UE" NBARGS=$[$NBARGS+256] shift ;; @@ -353,16 +353,16 @@ case $key in VM_NAME=ci-enb-usrp ARCHIVES_LOC=enb_usrp LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=7 + NB_PATTERN_FILES=9 BUILD_OPTIONS="--eNB -w USRP --mu" NBARGS=$[$NBARGS+256] ;; basic-sim) VM_NAME=ci-basic-sim ARCHIVES_LOC=basic_sim - LOG_PATTERN=basic_simulator - NB_PATTERN_FILES=2 - BUILD_OPTIONS="--basic-simulator" + LOG_PATTERN=.Rel14.txt + NB_PATTERN_FILES=13 + BUILD_OPTIONS="--UE --eNB" VM_MEMORY=8192 VM_CPU=4 RUN_OPTIONS="complex" @@ -409,8 +409,8 @@ case $key in VM_CPU=4 ARCHIVES_LOC=enb_eth LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--eNB -t ETHERNET" + NB_PATTERN_FILES=8 + BUILD_OPTIONS="--eNB" NBARGS=$[$NBARGS+256] ;; ue-ethernet) @@ -419,8 +419,8 @@ case $key in VM_CPU=4 ARCHIVES_LOC=ue_eth LOG_PATTERN=.Rel15.txt - NB_PATTERN_FILES=10 - BUILD_OPTIONS="--UE -t ETHERNET" + NB_PATTERN_FILES=12 + BUILD_OPTIONS="--UE" NBARGS=$[$NBARGS+256] ;; flexran-rtc) diff --git a/ci-scripts/reportBuildLocally.sh b/ci-scripts/reportBuildLocally.sh index b28f8cf6e0abe1c6cbe15890adb01204eaf6f598..9fd6a6e8e90ce484c30ee8b37245bfb4127778cf 100755 --- a/ci-scripts/reportBuildLocally.sh +++ b/ci-scripts/reportBuildLocally.sh @@ -566,9 +566,11 @@ function report_build { summary_table_footer summary_table_header "OAI Build basic simulator option" ./archives/basic_sim - summary_table_row "Basic Simulator eNb - Release 15" ./archives/basic_sim/basic_simulator_enb.txt "Built target lte-softmodem" ./basic_sim_row1.html - summary_table_row "Basic Simulator UE - Release 15" ./archives/basic_sim/basic_simulator_ue.txt "Built target lte-uesoftmodem" ./basic_sim_row2.html - summary_table_row "Conf 2 UE data - Release 15" ./archives/basic_sim/conf2uedata.Rel15.txt "Built target conf2uedata" ./basic_sim_row3.html + summary_table_row "LTE SoftModem - Release 14" ./archives/basic_sim/lte-softmodem.Rel14.txt "Built target lte-softmodem" ./basic_sim_row1.html + summary_table_row "LTE UE SoftModem - Release 14" ./archives/basic_sim/lte-uesoftmodem.Rel14.txt "Built target lte-uesoftmodem" ./basic_sim_row2.htm + summary_table_row "Conf 2 UE data - Release 14" ./archives/basic_sim/conf2uedata.Rel14.txt "Built target conf2uedata" ./basic_sim_row3.html + summary_table_row "RB Tool - Release 14" ./archives/basic_sim/rb_tool.Rel14.txt "Built target rb_tool" ./basic_sim_row4.html + summary_table_row "NASMESH - Release 14" ./archives/basic_sim/nasmesh.Rel14.txt "Built target nasmesh" ./basic_sim_row5.html summary_table_footer summary_table_header "OAI Build Physical simulators option" ./archives/phy_sim @@ -665,7 +667,7 @@ function report_build { cat $DETAILS_TABLE >> ./build_results.html done fi - if [ -f ./basic_sim_row1.html ] || [ -f ./basic_sim_row2.html ] || [ -f ./basic_sim_row3.html ] + if [ -f ./basic_sim_row1.html ] || [ -f ./basic_sim_row2.html ] || [ -f ./basic_sim_row3.html ] || [ -f ./basic_sim_row4.html ] || [ -f ./basic_sim_row5.html ] then for DETAILS_TABLE in `ls ./basic_sim_row*.html` do diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh index e4195edde06a878c5e8e6f12bf596ad2e65e9d98..228f9882d72685319319b7341bba2277044fc2bf 100755 --- a/ci-scripts/reportTestLocally.sh +++ b/ci-scripts/reportTestLocally.sh @@ -508,26 +508,26 @@ function report_test { NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG` NB_UE_GOT_SYNC=`egrep -c "got sync" $UE_LOG` NB_ENB_SYNCED_WITH_UE=`egrep -c "Sending NFAPI_START_RESPONSE" $UE_LOG` - if [ $NB_ENB_GOT_SYNC -eq 1 ] && [ $NB_UE_GOT_SYNC -eq 3 ] && [ $NB_ENB_SYNCED_WITH_UE -eq 1 ] + if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 2 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ] then echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html else echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html fi echo " <td><pre>" >> ./test_simulator_results.html - if [ $NB_ENB_GOT_SYNC -eq 1 ] + if [ $NB_ENB_GOT_SYNC -gt 0 ] then echo "<font color = \"blue\">- eNB --> got sync</font>" >> ./test_simulator_results.html else echo "<font color = \"red\"><b>- eNB NEVER got sync</b></font>" >> ./test_simulator_results.html fi - if [ $NB_UE_GOT_SYNC -eq 3 ] + if [ $NB_UE_GOT_SYNC -gt 2 ] then echo "<font color = \"blue\">- UE --> got sync</font>" >> ./test_simulator_results.html else echo "<font color = \"red\"><b>- UE NEVER got sync</b></font>" >> ./test_simulator_results.html fi - if [ $NB_ENB_SYNCED_WITH_UE -eq 1 ] + if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ] then echo "<font color = \"blue\">- UE attached to eNB</font>" >> ./test_simulator_results.html else diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 95e712c2c44e6c134c81baa24a0c7fba6dae5b71..fde8f745d0772ab69cdcf13a8f0a6f303057661e 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -80,15 +80,15 @@ function start_basic_sim_enb { fi echo "echo \"grep N_RB_DL ci-$LOC_CONF_FILE\"" >> $1 echo "grep N_RB_DL ci-$LOC_CONF_FILE | sed -e 's#N_RB_DL.*=#N_RB_DL =#'" >> $1 - echo "echo \"cd /home/ubuntu/tmp/cmake_targets/basic_simulator/enb/\"" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/basic_simulator" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/basic_simulator/enb/" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/basic_simulator/enb/" >> $1 - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/\"" >> $1 + echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/" >> $1 + echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 + echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 + echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --basicsim\" > ./my-lte-softmodem-run.sh " >> $1 echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 echo "cat ./my-lte-softmodem-run.sh" >> $1 echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1 - echo "sudo -E daemon --inherit --unsafe --name=enb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/basic_simulator/enb -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1 + echo "sudo -E daemon --inherit --unsafe --name=enb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/lte_build_oai/build -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1 ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1 rm $1 @@ -123,14 +123,14 @@ function start_basic_sim_ue { local LOC_UE_LOG_FILE=$3 local LOC_NB_RBS=$4 local LOC_FREQUENCY=$5 - echo "echo \"cd /home/ubuntu/tmp/cmake_targets/basic_simulator/ue\"" > $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/basic_simulator/ue" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/basic_simulator/ue" >> $1 - echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --ue-rxgain 140\" > ./my-lte-uesoftmodem-run.sh" >> $1 + echo "echo \"cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/\"" > $1 + echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 + echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build" >> $1 + echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --log_config.global_log_options level,nocolor --basicsim\" > ./my-lte-uesoftmodem-run.sh" >> $1 echo "chmod 775 ./my-lte-uesoftmodem-run.sh" >> $1 echo "cat ./my-lte-uesoftmodem-run.sh" >> $1 echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE; fi" >> $1 - echo "sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/basic_simulator/ue -o /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ./my-lte-uesoftmodem-run.sh" >> $1 + echo "sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/lte_build_oai/build -o /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ./my-lte-uesoftmodem-run.sh" >> $1 ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 rm $1 @@ -418,14 +418,14 @@ function recover_core_dump { then local TC=`echo $3 | sed -e "s#^.*enb_##" -e "s#Hz.*#Hz#"` echo "Segmentation fault detected on enb -> recovering core dump" - echo "cd /home/ubuntu/tmp/cmake_targets/basic_simulator/enb" > $1 + echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" > $1 echo "sync" >> $1 echo "sudo tar -cjhf basic-simulator-enb-core-${TC}.bz2 core lte-softmodem *.so ci-lte-basic-sim.conf my-lte-softmodem-run.sh" >> $1 echo "sudo rm core" >> $1 echo "rm ci-lte-basic-sim.conf" >> $1 echo "sync" >> $1 ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/basic_simulator/enb/basic-simulator-enb-core-${TC}.bz2 $4 + scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/lte_build_oai/build/basic-simulator-enb-core-${TC}.bz2 $4 rm -f $1 fi } @@ -694,8 +694,8 @@ function build_ue_on_separate_folder { echo "cd cmake_targets/" >> $1 echo "mkdir log" >> $1 echo "chmod 777 log" >> $1 - echo "echo \"./build_oai --UE -t ETHERNET \"" >> $1 - echo "./build_oai --UE -t ETHERNET > log/ue-build.txt 2>&1" >> $1 + echo "echo \"./build_oai --UE \"" >> $1 + echo "./build_oai --UE > log/ue-build.txt 2>&1" >> $1 echo "cd tools" >> $1 echo "sudo ifconfig lo: 127.0.0.2 netmask 255.0.0.0 up" >> $1 echo "sudo chmod 666 /etc/iproute2/rt_tables" >> $1 @@ -729,9 +729,9 @@ function start_l2_sim_enb { echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 if [ $LOC_S1_CONFIGURATION -eq 0 ] then - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --noS1\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1 else - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor \" > ./my-lte-softmodem-run.sh " >> $1 fi echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 echo "cat ./my-lte-softmodem-run.sh" >> $1 @@ -837,9 +837,9 @@ function start_l2_sim_ue { echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 if [ $LOC_S1_CONFIGURATION -eq 0 ] then - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nokrnmod 1 --noS1\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nums_ue_thread $LOC_NB_UES --nokrnmod 1 --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1 else - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nokrnmod 1\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nums_ue_thread $LOC_NB_UES --nokrnmod 1 --log_config.global_log_options level,nocolor\" > ./my-lte-softmodem-run.sh " >> $1 fi echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 echo "cat ./my-lte-softmodem-run.sh" >> $1 @@ -949,9 +949,9 @@ function start_rf_sim_enb { echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 if [ $LOC_S1_CONFIGURATION -eq 0 ] then - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim --noS1\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1 else - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim --log_config.global_log_options level,nocolor \" > ./my-lte-softmodem-run.sh " >> $1 fi echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 echo "cat ./my-lte-softmodem-run.sh" >> $1 @@ -1028,9 +1028,9 @@ function start_rf_sim_ue { echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 if [ $LOC_S1_CONFIGURATION -eq 0 ] then - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --nokrnmod 1 --rfsim --noS1\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1 else - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --nokrnmod 1 --rfsim\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor\" > ./my-lte-softmodem-run.sh " >> $1 fi echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 echo "cat ./my-lte-softmodem-run.sh" >> $1 @@ -1277,9 +1277,8 @@ function run_test_on_vm { do for BW in ${BW_CASES[@]} do - # Not Running in TDD-10MHz and TDD-20MHz : too unstable - #if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*10.* ]]; then continue; fi - #if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then continue; fi + # Not Running in TDD-20MHz : too unstable + if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then continue; fi if [[ $BW =~ .*05.* ]]; then PRB=25; fi if [[ $BW =~ .*10.* ]]; then PRB=50; fi @@ -1300,15 +1299,9 @@ function run_test_on_vm { if [ $UE_SYNC -eq 0 ] then echo "Problem w/ eNB and UE not syncing" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR 0 - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - full_basic_sim_destroy - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log + full_terminate STATUS=-1 - return + continue fi get_ue_ip_addr $VM_CMDS $VM_IP_ADDR 1 @@ -1739,14 +1732,8 @@ function run_test_on_vm { terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2 scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - if [ $S1_NOS1_CFG -eq 1 ] - then - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - fi - full_l2_sim_destroy - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log STATUS=-1 - return + continue fi if [ $S1_NOS1_CFG -eq 1 ] diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_start.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_start.xml index e22c5b4da2653b0f9517c36a06ba8470e53f7f7d..aac71198f1826ce5440c28e84a6e2c2a4d7807c3 100644 --- a/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_start.xml +++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_epc_start.xml @@ -29,10 +29,10 @@ </TestCaseRequestedList> <TestCaseExclusionList></TestCaseExclusionList> - <testCase id="050101"> + <testCase id="050101"> <class>Initialize_HSS</class> <desc>Initialize HSS</desc> - </testCase> + </testCase> <testCase id="060101"> <class>Initialize_MME</class> diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml index cded08284a7f53e012ad7216e8065c0da25e01c3..29c9a29c2d2f9eeae14cc68dea9c59f5a52a8fd2 100644 --- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml @@ -26,32 +26,32 @@ <htmlTabIcon>tasks</htmlTabIcon> <TestCaseRequestedList> 030201 090109 - 030101 000001 090101 000002 040501 040502 000001 040601 040641 040642 000001 090109 030201 + 030101 000001 090101 000002 040501 040502 000001 040601 040602 040641 040642 000001 090109 030201 </TestCaseRequestedList> <TestCaseExclusionList></TestCaseExclusionList> - <testCase id="000001"> - <class>IdleSleep</class> - <desc>Sleep</desc> - <idle_sleep_time_in_sec>10</idle_sleep_time_in_sec> - </testCase> + <testCase id="000001"> + <class>IdleSleep</class> + <desc>Sleep</desc> + <idle_sleep_time_in_sec>10</idle_sleep_time_in_sec> + </testCase> - <testCase id="000002"> - <class>IdleSleep</class> - <desc>Sleep</desc> - <idle_sleep_time_in_sec>5</idle_sleep_time_in_sec> - </testCase> + <testCase id="000002"> + <class>IdleSleep</class> + <desc>Sleep</desc> + <idle_sleep_time_in_sec>5</idle_sleep_time_in_sec> + </testCase> - <testCase id="000003"> - <class>IdleSleep</class> - <desc>Sleep</desc> - <idle_sleep_time_in_sec>60</idle_sleep_time_in_sec> - </testCase> + <testCase id="000003"> + <class>IdleSleep</class> + <desc>Sleep</desc> + <idle_sleep_time_in_sec>60</idle_sleep_time_in_sec> + </testCase> <testCase id="030101"> <class>Initialize_eNB</class> <desc>Initialize eNB (FDD/Band7/5MHz)</desc> - <Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --noS1</Initialize_eNB_args> + <Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --noS1 --eNBs.[0].rrc_inactivity_threshold 0</Initialize_eNB_args> </testCase> <testCase id="030201"> @@ -59,44 +59,44 @@ <desc>Terminate eNB</desc> </testCase> - <testCase id="090101"> - <class>Initialize_OAI_UE</class> - <desc>Initialize OAI UE (FDD/Band7/5MHz)</desc> - <Initialize_OAI_UE_args>-C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 --noS1</Initialize_OAI_UE_args> - </testCase> - - <testCase id="090109"> - <class>Terminate_OAI_UE</class> - <desc>Terminate OAI UE</desc> - </testCase> - - <testCase id="040501"> - <class>Ping</class> - <desc>ping (5MHz - 20 sec)(from eNB to OAI UE)</desc> - <ping_args>-I oaitun_enb1 -c 20 10.0.1.2</ping_args> - <ping_packetloss_threshold>5</ping_packetloss_threshold> - </testCase> - - <testCase id="040502"> - <class>Ping</class> - <desc>ping (5MHz - 20 sec)(from OAI UE to eNB)</desc> - <ping_args>-I oaitun_ue1 -c 20 10.0.1.1</ping_args> - <ping_packetloss_threshold>5</ping_packetloss_threshold> - </testCase> - - <testCase id="040601"> + <testCase id="090101"> + <class>Initialize_OAI_UE</class> + <desc>Initialize OAI UE (FDD/Band7/5MHz)</desc> + <Initialize_OAI_UE_args>-C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 --noS1</Initialize_OAI_UE_args> + </testCase> + + <testCase id="090109"> + <class>Terminate_OAI_UE</class> + <desc>Terminate OAI UE</desc> + </testCase> + + <testCase id="040501"> + <class>Ping</class> + <desc>ping (5MHz - 20 sec)(from eNB to OAI UE)</desc> + <ping_args>-I oaitun_enb1 -c 20 10.0.1.2</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> + + <testCase id="040502"> + <class>Ping</class> + <desc>ping (5MHz - 20 sec)(from OAI UE to eNB)</desc> + <ping_args>-I oaitun_ue1 -c 20 10.0.1.1</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> + + <testCase id="040601"> <class>Iperf</class> <desc>iperf (5MHz - DL/1Mbps/UDP)(30 sec)</desc> <iperf_args>-c 10.0.1.2 -u -b 1M -t 30 -i 1 -fm -B 10.0.1.1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> - </testCase> + </testCase> - <testCase id="040602"> + <testCase id="040602"> <class>Iperf</class> - <desc>iperf (5MHz - DL/1.2Mbps/UDP)(30 sec)</desc> - <iperf_args>-c 10.0.1.2 -u -b 1.2M -t 30 -i 1 -fm -B 10.0.1.1</iperf_args> + <desc>iperf (5MHz - DL/14Mbps/UDP)(30 sec)</desc> + <iperf_args>-c 10.0.1.2 -u -b 14M -t 30 -i 1 -fm -B 10.0.1.1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> - </testCase> + </testCase> <testCase id="040641"> <class>Iperf</class> diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml index 15735d94db39cb8df794c356ae18ed422d97ee2d..2e6b9a0dc6c25f7ef8d2ff45780b3074b6be6aa9 100644 --- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml +++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml @@ -26,26 +26,26 @@ <htmlTabIcon>tasks</htmlTabIcon> <TestCaseRequestedList> 030201 090109 - 030102 000001 090102 000002 040503 000001 040603 040643 040644 000001 090109 030201 + 030102 000001 090102 000002 040503 000001 040603 040604 040643 040644 000001 090109 030201 </TestCaseRequestedList> <TestCaseExclusionList></TestCaseExclusionList> - <testCase id="000001"> - <class>IdleSleep</class> - <desc>Sleep</desc> - <idle_sleep_time_in_sec>10</idle_sleep_time_in_sec> - </testCase> + <testCase id="000001"> + <class>IdleSleep</class> + <desc>Sleep</desc> + <idle_sleep_time_in_sec>10</idle_sleep_time_in_sec> + </testCase> - <testCase id="000002"> - <class>IdleSleep</class> - <desc>Sleep</desc> - <idle_sleep_time_in_sec>5</idle_sleep_time_in_sec> - </testCase> + <testCase id="000002"> + <class>IdleSleep</class> + <desc>Sleep</desc> + <idle_sleep_time_in_sec>5</idle_sleep_time_in_sec> + </testCase> <testCase id="030102"> <class>Initialize_eNB</class> <desc>Initialize eNB (FDD/Band7/5MHz)</desc> - <Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf</Initialize_eNB_args> + <Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].rrc_inactivity_threshold 0</Initialize_eNB_args> </testCase> <testCase id="030201"> @@ -53,37 +53,37 @@ <desc>Terminate eNB</desc> </testCase> - <testCase id="090102"> - <class>Initialize_OAI_UE</class> - <desc>Initialize OAI UE (FDD/Band7/5MHz)</desc> - <Initialize_OAI_UE_args>-C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1</Initialize_OAI_UE_args> - </testCase> - - <testCase id="090109"> - <class>Terminate_OAI_UE</class> - <desc>Terminate OAI UE</desc> - </testCase> - - <testCase id="040503"> - <class>Ping</class> - <desc>ping (5MHz - 20 sec)</desc> - <ping_args>-c 20</ping_args> - <ping_packetloss_threshold>5</ping_packetloss_threshold> - </testCase> - - <testCase id="040603"> + <testCase id="090102"> + <class>Initialize_OAI_UE</class> + <desc>Initialize OAI UE (FDD/Band7/5MHz)</desc> + <Initialize_OAI_UE_args>-C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1</Initialize_OAI_UE_args> + </testCase> + + <testCase id="090109"> + <class>Terminate_OAI_UE</class> + <desc>Terminate OAI UE</desc> + </testCase> + + <testCase id="040503"> + <class>Ping</class> + <desc>ping (5MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> + + <testCase id="040603"> <class>Iperf</class> <desc>iperf (5MHz - DL/1Mbps/UDP)(30 sec)</desc> <iperf_args>-u -b 1M -t 30 -i 1 -fm</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> - </testCase> + </testCase> - <testCase id="040604"> + <testCase id="040604"> <class>Iperf</class> - <desc>iperf (5MHz - DL/1.2Mbps/UDP)(30 sec)</desc> - <iperf_args>-b 1.2M -t 30 -i 1 -fm</iperf_args> + <desc>iperf (5MHz - DL/14Mbps/UDP)(30 sec)</desc> + <iperf_args>-u -b 14M -t 30 -i 1 -fm</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> - </testCase> + </testCase> <testCase id="040643"> <class>Iperf</class> diff --git a/ci-scripts/xml_files/enb_usrp210_band13_build.xml b/ci-scripts/xml_files/enb_usrp210_band13_build.xml index 24283a52d0b38508ab7c148e664c1fb26b7020bb..96ab517b34cdba4710ca73fff195bf794250d403 100644 --- a/ci-scripts/xml_files/enb_usrp210_band13_build.xml +++ b/ci-scripts/xml_files/enb_usrp210_band13_build.xml @@ -37,10 +37,10 @@ <Build_eNB_args>-w USRP -c --eNB</Build_eNB_args> </testCase> - <testCase id="050101"> + <testCase id="050101"> <class>Initialize_HSS</class> <desc>Initialize HSS</desc> - </testCase> + </testCase> <testCase id="060101"> <class>Initialize_MME</class> diff --git a/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml index 5425428bc2691da4fc01f58bb463177269a4c117..1f4a82710cd1dcf469d77d5099aa5ac1596f8294 100644 --- a/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml @@ -32,11 +32,11 @@ <TestCaseExclusionList> </TestCaseExclusionList> - <testCase id="000001"> - <class>IdleSleep</class> - <desc>Waiting for a moment...</desc> - <idle_sleep_time_in_sec>15</idle_sleep_time_in_sec> - </testCase> + <testCase id="000001"> + <class>IdleSleep</class> + <desc>Waiting for a moment...</desc> + <idle_sleep_time_in_sec>15</idle_sleep_time_in_sec> + </testCase> <testCase id="030121"> <class>Initialize_eNB</class> @@ -49,31 +49,31 @@ <desc>Terminate eNB</desc> </testCase> - <testCase id="040102"> - <class>Initialize_CatM_module</class> - <desc>Initialize CAT-M Module</desc> - </testCase> + <testCase id="040102"> + <class>Initialize_CatM_module</class> + <desc>Initialize CAT-M Module</desc> + </testCase> - <testCase id="040202"> - <class>Terminate_CatM_module</class> - <desc>Terminate CAT-M Module</desc> - </testCase> + <testCase id="040202"> + <class>Terminate_CatM_module</class> + <desc>Terminate CAT-M Module</desc> + </testCase> - <testCase id="040302"> - <class>Attach_CatM_module</class> - <desc>Attach CAT-M Module</desc> - </testCase> + <testCase id="040302"> + <class>Attach_CatM_module</class> + <desc>Attach CAT-M Module</desc> + </testCase> - <testCase id="040402"> - <class>Detach_CatM_module</class> - <desc>Detach CAT-M Module</desc> - </testCase> + <testCase id="040402"> + <class>Detach_CatM_module</class> + <desc>Detach CAT-M Module</desc> + </testCase> - <testCase id="040502"> - <class>Ping_CatM_module</class> - <desc>ping (10MHz - 20 sec)</desc> - <ping_args>-c 20</ping_args> - <ping_packetloss_threshold>5</ping_packetloss_threshold> - </testCase> + <testCase id="040502"> + <class>Ping_CatM_module</class> + <desc>ping (10MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> </testCaseList> diff --git a/ci-scripts/xml_files/enb_usrp210_band40_build.xml b/ci-scripts/xml_files/enb_usrp210_band40_build.xml index 8f9489b03e609a6fbadb56419bc676d8f51c1056..fd32019bb55817393aa58b37182a7357f16d99d4 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_build.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_build.xml @@ -24,7 +24,7 @@ <htmlTabRef>build-tab</htmlTabRef> <htmlTabName>Build</htmlTabName> <htmlTabIcon>wrench</htmlTabIcon> - <TestCaseRequestedList> + <TestCaseRequestedList> 010101 050101 060101 070101 </TestCaseRequestedList> @@ -36,10 +36,10 @@ <Build_eNB_args>-w USRP -c --eNB</Build_eNB_args> </testCase> - <testCase id="050101"> + <testCase id="050101"> <class>Initialize_HSS</class> <desc>Initialize HSS</desc> - </testCase> + </testCase> <testCase id="060101"> <class>Initialize_MME</class> diff --git a/ci-scripts/xml_files/enb_usrp210_band40_epc_closure.xml b/ci-scripts/xml_files/enb_usrp210_band40_epc_closure.xml index ad34381a2a06ac89431e928a07310462e3cc52c4..07fb6951f8e99a35cabd2ee4e48232d2bd035f41 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_epc_closure.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_epc_closure.xml @@ -24,24 +24,24 @@ <htmlTabRef>epc-closure</htmlTabRef> <htmlTabName>EPC-Closure</htmlTabName> <htmlTabIcon>log-out</htmlTabIcon> - <TestCaseRequestedList> + <TestCaseRequestedList> 050201 060201 070201 </TestCaseRequestedList> <TestCaseExclusionList></TestCaseExclusionList> - <testCase id="050201"> - <class>Terminate_HSS</class> - <desc>Terminate HSS</desc> - </testCase> + <testCase id="050201"> + <class>Terminate_HSS</class> + <desc>Terminate HSS</desc> + </testCase> - <testCase id="060201"> - <class>Terminate_MME</class> - <desc>Terminate MME</desc> - </testCase> + <testCase id="060201"> + <class>Terminate_MME</class> + <desc>Terminate MME</desc> + </testCase> - <testCase id="070201"> - <class>Terminate_SPGW</class> - <desc>Terminate SPGW</desc> - </testCase> + <testCase id="070201"> + <class>Terminate_SPGW</class> + <desc>Terminate SPGW</desc> + </testCase> </testCaseList> diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml index 7fa7814238613cce645420bd43d22fc4a022e00b..6cf5634fcf0a72be9f73184d7d395872f337461d 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml @@ -24,7 +24,7 @@ <htmlTabRef>test-05-tm1</htmlTabRef> <htmlTabName>Test-05MHz-TM1</htmlTabName> <htmlTabIcon>tasks</htmlTabIcon> - <TestCaseRequestedList> + <TestCaseRequestedList> 030201 040101 030104 040301 040501 040602 040601 040603 040604 040605 040642 040641 040643 040644 040645 040401 040201 030201 @@ -52,61 +52,61 @@ <desc>Terminate UE</desc> </testCase> - <testCase id="040301"> - <class>Attach_UE</class> - <desc>Attach UE</desc> - </testCase> + <testCase id="040301"> + <class>Attach_UE</class> + <desc>Attach UE</desc> + </testCase> - <testCase id="040401"> - <class>Detach_UE</class> - <desc>Detach UE</desc> - </testCase> + <testCase id="040401"> + <class>Detach_UE</class> + <desc>Detach UE</desc> + </testCase> - <testCase id="040501"> - <class>Ping</class> - <desc>ping (5MHz - 20 sec)</desc> - <ping_args>-c 20</ping_args> - <ping_packetloss_threshold>25</ping_packetloss_threshold> - </testCase> + <testCase id="040501"> + <class>Ping</class> + <desc>ping (5MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>25</ping_packetloss_threshold> + </testCase> - <testCase id="040601"> + <testCase id="040601"> <class>Iperf</class> <desc>iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(balanced)</desc> <iperf_args>-u -b 6.5M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>balanced</iperf_profile> - </testCase> + </testCase> - <testCase id="040602"> + <testCase id="040602"> <class>Iperf</class> <desc>iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(single-ue)</desc> <iperf_args>-u -b 6.5M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> - <testCase id="040603"> + <testCase id="040603"> <class>Iperf</class> <desc>iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(unbalanced)</desc> <iperf_args>-u -b 6.5M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>unbalanced</iperf_profile> - </testCase> + </testCase> - <testCase id="040604"> + <testCase id="040604"> <class>Iperf</class> <desc>iperf (5MHz - DL/TCP)(30 sec)(single-ue profile)</desc> <iperf_args>-t 30 -i 1 -fm</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> - <testCase id="040605"> + <testCase id="040605"> <class>Iperf</class> <desc>iperf (5MHz - DL/TCP)(30 sec)</desc> <iperf_args>-t 30 -i 1 -fm</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> - </testCase> + </testCase> <testCase id="040641"> <class>Iperf</class> diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml index 4859224606f298db4af49f2767101c39eebc9b38..29699d3b3dfd35f7ee0de26774dfcbaf99137e4c 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml @@ -24,7 +24,7 @@ <htmlTabRef>test-10-tm1</htmlTabRef> <htmlTabName>Test-10MHz-TM1</htmlTabName> <htmlTabIcon>tasks</htmlTabIcon> - <TestCaseRequestedList> + <TestCaseRequestedList> 030201 040101 030114 040301 040511 040612 040611 040613 040614 040615 040652 040651 040653 040654 040655 040401 040201 030201 @@ -32,10 +32,10 @@ <TestCaseExclusionList></TestCaseExclusionList> <testCase id="030114"> - <class>Initialize_eNB</class> - <desc>Initialize eNB (TDD/Band40/10MHz/info)</desc> - <Initialize_eNB_args>-O ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf</Initialize_eNB_args> - </testCase> + <class>Initialize_eNB</class> + <desc>Initialize eNB (TDD/Band40/10MHz/info)</desc> + <Initialize_eNB_args>-O ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf</Initialize_eNB_args> + </testCase> <testCase id="030201"> <class>Terminate_eNB</class> diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml index bcbf742ef792af47f4a903308166e9aa9be7b6e2..79fc0b305c129fceb3c0c2a68bdf51e090329a41 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml @@ -24,7 +24,7 @@ <htmlTabRef>test-20-tm1</htmlTabRef> <htmlTabName>Test-20MHz-TM1</htmlTabName> <htmlTabIcon>tasks</htmlTabIcon> - <TestCaseRequestedList> + <TestCaseRequestedList> 030201 040101 030124 040301 040521 040622 040621 040623 040624 040625 040662 040661 040663 040664 040665 040401 040201 030201 @@ -32,10 +32,10 @@ <TestCaseExclusionList></TestCaseExclusionList> <testCase id="030124"> - <class>Initialize_eNB</class> - <desc>Initialize eNB (TDD/Band40/20MHz/info)</desc> - <Initialize_eNB_args>-O ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf</Initialize_eNB_args> - </testCase> + <class>Initialize_eNB</class> + <desc>Initialize eNB (TDD/Band40/20MHz/info)</desc> + <Initialize_eNB_args>-O ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf</Initialize_eNB_args> + </testCase> <testCase id="030201"> <class>Terminate_eNB</class> @@ -52,38 +52,38 @@ <desc>Terminate UE</desc> </testCase> - <testCase id="040301"> - <class>Attach_UE</class> - <desc>Attach UE</desc> - </testCase> + <testCase id="040301"> + <class>Attach_UE</class> + <desc>Attach UE</desc> + </testCase> - <testCase id="040401"> - <class>Detach_UE</class> - <desc>Detach UE</desc> - </testCase> + <testCase id="040401"> + <class>Detach_UE</class> + <desc>Detach UE</desc> + </testCase> - <testCase id="040521"> - <class>Ping</class> - <desc>ping (20MHz - 20 sec)</desc> - <ping_args>-c 20</ping_args> - <ping_packetloss_threshold>25</ping_packetloss_threshold> - </testCase> + <testCase id="040521"> + <class>Ping</class> + <desc>ping (20MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>25</ping_packetloss_threshold> + </testCase> <testCase id="040621"> - <class>Iperf</class> - <desc>iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(balanced)</desc> - <iperf_args>-u -b 13.5M -t 30 -i 1</iperf_args> - <iperf_packetloss_threshold>50</iperf_packetloss_threshold> - <iperf_profile>balanced</iperf_profile> - </testCase> - - <testCase id="040622"> - <class>Iperf</class> - <desc>iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue)</desc> - <iperf_args>-u -b 13.5M -t 30 -i 1</iperf_args> - <iperf_packetloss_threshold>50</iperf_packetloss_threshold> - <iperf_profile>single-ue</iperf_profile> - </testCase> + <class>Iperf</class> + <desc>iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(balanced)</desc> + <iperf_args>-u -b 13.5M -t 30 -i 1</iperf_args> + <iperf_packetloss_threshold>50</iperf_packetloss_threshold> + <iperf_profile>balanced</iperf_profile> + </testCase> + + <testCase id="040622"> + <class>Iperf</class> + <desc>iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue)</desc> + <iperf_args>-u -b 13.5M -t 30 -i 1</iperf_args> + <iperf_packetloss_threshold>50</iperf_packetloss_threshold> + <iperf_profile>single-ue</iperf_profile> + </testCase> <testCase id="040623"> <class>Iperf</class> @@ -93,20 +93,20 @@ <iperf_profile>unbalanced</iperf_profile> </testCase> - <testCase id="040624"> - <class>Iperf</class> - <desc>iperf (20MHz - DL/TCP)(30 sec)(single-ue)</desc> - <iperf_args>-t 30 -i 1 -fm</iperf_args> - <iperf_packetloss_threshold>50</iperf_packetloss_threshold> - <iperf_profile>single-ue</iperf_profile> - </testCase> - - <testCase id="040625"> - <class>Iperf</class> - <desc>iperf (20MHz - DL/TCP)(30 sec)</desc> - <iperf_args>-t 30 -i 1 -fm</iperf_args> - <iperf_packetloss_threshold>50</iperf_packetloss_threshold> - </testCase> + <testCase id="040624"> + <class>Iperf</class> + <desc>iperf (20MHz - DL/TCP)(30 sec)(single-ue)</desc> + <iperf_args>-t 30 -i 1 -fm</iperf_args> + <iperf_packetloss_threshold>50</iperf_packetloss_threshold> + <iperf_profile>single-ue</iperf_profile> + </testCase> + + <testCase id="040625"> + <class>Iperf</class> + <desc>iperf (20MHz - DL/TCP)(30 sec)</desc> + <iperf_args>-t 30 -i 1 -fm</iperf_args> + <iperf_packetloss_threshold>50</iperf_packetloss_threshold> + </testCase> <testCase id="040661"> <class>Iperf</class> diff --git a/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml b/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml index dceb6be97aaefcc3543c7ef1b324a60d6146ea20..08cef07c8cad6e861cd705ed2181d5fc12303be3 100644 --- a/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml +++ b/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml @@ -24,7 +24,7 @@ <htmlTabRef>tracer-test</htmlTabRef> <htmlTabName>T-Tracer</htmlTabName> <htmlTabIcon>duplicate</htmlTabIcon> - <TestCaseRequestedList> + <TestCaseRequestedList> 040101 030100 040300 040401 040201 030201 </TestCaseRequestedList> @@ -51,15 +51,15 @@ <desc>Terminate UE</desc> </testCase> - <testCase id="040300"> - <class>Attach_UE</class> - <desc>Attach single UE</desc> - <nbMaxUEtoAttach>1</nbMaxUEtoAttach> - </testCase> + <testCase id="040300"> + <class>Attach_UE</class> + <desc>Attach single UE</desc> + <nbMaxUEtoAttach>1</nbMaxUEtoAttach> + </testCase> - <testCase id="040401"> - <class>Detach_UE</class> - <desc>Detach UE</desc> - </testCase> + <testCase id="040401"> + <class>Detach_UE</class> + <desc>Detach UE</desc> + </testCase> </testCaseList> diff --git a/ci-scripts/xml_files/enb_usrp210_band7_build.xml b/ci-scripts/xml_files/enb_usrp210_band7_build.xml index 31ee57e94164bf6ecbf270927052bb5942eca65f..fd32019bb55817393aa58b37182a7357f16d99d4 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_build.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_build.xml @@ -36,10 +36,10 @@ <Build_eNB_args>-w USRP -c --eNB</Build_eNB_args> </testCase> - <testCase id="050101"> + <testCase id="050101"> <class>Initialize_HSS</class> <desc>Initialize HSS</desc> - </testCase> + </testCase> <testCase id="060101"> <class>Initialize_MME</class> diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml index edc87c90ff5f5a49e63c4e85c36716337529e5dc..afafd3fb65bdd746c0f27f0e5236488b64244960 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml @@ -28,15 +28,101 @@ 030201 040101 030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 + 030102 000010 040301 040502 000011 040302 000001 000012 040303 000002 000013 040503 040401 040201 030201 + 050102 + 030102 000020 040301 040504 000021 040302 000001 000022 040303 000002 040504 000023 040401 040201 030201 + 050202 </TestCaseRequestedList> <TestCaseExclusionList></TestCaseExclusionList> + <testCase id="000001"> + <class>IdleSleep</class> + <desc>Waiting for 35 seconds</desc> + <idle_sleep_time_in_sec>35</idle_sleep_time_in_sec> + </testCase> + + <testCase id="000002"> + <class>IdleSleep</class> + <desc>Waiting for 10 seconds</desc> + <idle_sleep_time_in_sec>10</idle_sleep_time_in_sec> + </testCase> + + <testCase id="000010"> + <class>CheckStatusUE</class> + <desc>Check UE(s) status before attachment</desc> + <expectedNbOfConnectedUEs>0</expectedNbOfConnectedUEs> + </testCase> + + <testCase id="000011"> + <class>CheckStatusUE</class> + <desc>Check UE(s) status before data disabling</desc> + <expectedNbOfConnectedUEs>2</expectedNbOfConnectedUEs> + </testCase> + + <testCase id="000012"> + <class>CheckStatusUE</class> + <desc>Check UE(s) status after data disabling</desc> + <expectedNbOfConnectedUEs>0</expectedNbOfConnectedUEs> + </testCase> + + <testCase id="000013"> + <class>CheckStatusUE</class> + <desc>Check UE(s) status after data re-enabling</desc> + <expectedNbOfConnectedUEs>2</expectedNbOfConnectedUEs> + </testCase> + + <testCase id="000020"> + <class>CheckStatusUE</class> + <desc>Check UE(s) status before attachment</desc> + <expectedNbOfConnectedUEs>0</expectedNbOfConnectedUEs> + </testCase> + + <testCase id="000021"> + <class>CheckStatusUE</class> + <desc>Check UE(s) status before data disabling</desc> + <expectedNbOfConnectedUEs>2</expectedNbOfConnectedUEs> + </testCase> + + <testCase id="000022"> + <class>CheckStatusUE</class> + <desc>Check UE(s) status after data disabling</desc> + <expectedNbOfConnectedUEs>0</expectedNbOfConnectedUEs> + </testCase> + + <testCase id="000023"> + <class>CheckStatusUE</class> + <desc>Check UE(s) status after data re-enabling</desc> + <expectedNbOfConnectedUEs>2</expectedNbOfConnectedUEs> + </testCase> + + <testCase id="050102"> + <class>Initialize_FlexranCtrl</class> + <desc>Starting Flexran Controller</desc> + </testCase> + + <testCase id="050202"> + <class>Terminate_FlexranCtrl</class> + <desc>Stopping Flexran Controller</desc> + </testCase> + <testCase id="030101"> <class>Initialize_eNB</class> <desc>Initialize eNB (FDD/Band7/5MHz)</desc> <Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf</Initialize_eNB_args> </testCase> + <testCase id="030102"> + <class>Initialize_eNB</class> + <desc>Initialize eNB (FDD/Band7/5MHz)</desc> + <Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf</Initialize_eNB_args> + </testCase> + + <testCase id="030103"> + <class>Initialize_eNB</class> + <desc>Initialize eNB (FDD/Band7/5MHz)</desc> + <Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf</Initialize_eNB_args> + </testCase> + <testCase id="030201"> <class>Terminate_eNB</class> <desc>Terminate eNB</desc> @@ -52,62 +138,100 @@ <desc>Terminate UE</desc> </testCase> - <testCase id="040301"> - <class>Attach_UE</class> - <desc>Attach UE</desc> - </testCase> + <testCase id="040301"> + <class>Attach_UE</class> + <desc>Attach UE</desc> + </testCase> + + <testCase id="040401"> + <class>Detach_UE</class> + <desc>Detach UE</desc> + </testCase> + + <testCase id="040302"> + <class>DataDisable_UE</class> + <desc>Disabling Data Service on UE</desc> + </testCase> + + <testCase id="040303"> + <class>DataEnable_UE</class> + <desc>Enabling Data Service on UE</desc> + </testCase> + + <testCase id="040501"> + <class>Ping</class> + <desc>ping (5MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> + + <testCase id="040502"> + <class>Ping</class> + <desc>ping (5MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> - <testCase id="040401"> - <class>Detach_UE</class> - <desc>Detach UE</desc> - </testCase> + <testCase id="040503"> + <class>Ping</class> + <desc>ping (5MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> - <testCase id="040501"> - <class>Ping</class> - <desc>ping (5MHz - 20 sec)</desc> - <ping_args>-c 20</ping_args> - <ping_packetloss_threshold>5</ping_packetloss_threshold> - </testCase> + <testCase id="040504"> + <class>Ping</class> + <desc>ping (5MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> + + <testCase id="040505"> + <class>Ping</class> + <desc>ping (5MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> - <testCase id="040603"> + <testCase id="040603"> <class>Iperf</class> <desc>iperf (5MHz - DL/15Mbps/UDP)(30 sec)(balanced profile)</desc> <iperf_args>-u -b 15M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>balanced</iperf_profile> - </testCase> + </testCase> - <testCase id="040604"> + <testCase id="040604"> <class>Iperf</class> <desc>iperf (5MHz - DL/15Mbps/UDP)(30 sec)(single-ue profile)</desc> <iperf_args>-u -b 15M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> - <testCase id="040605"> + <testCase id="040605"> <class>Iperf</class> <desc>iperf (5MHz - DL/15Mbps/UDP)(30 sec)(unbalanced profile)</desc> <iperf_args>-u -b 15M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>unbalanced</iperf_profile> - </testCase> + </testCase> - <testCase id="040606"> + <testCase id="040606"> <class>Iperf</class> <desc>iperf (5MHz - DL/TCP)(30 sec)(single-ue profile)</desc> <iperf_args>-t 30 -i 1 -fm</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> - <testCase id="040607"> + <testCase id="040607"> <class>Iperf</class> <desc>iperf (5MHz - DL/TCP)(30 sec)(balanced profile)</desc> <iperf_args>-t 30 -i 1 -fm</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>balanced</iperf_profile> - </testCase> + </testCase> <testCase id="040641"> <class>Iperf</class> @@ -125,20 +249,20 @@ <iperf_profile>single-ue</iperf_profile> </testCase> - <testCase id="040643"> + <testCase id="040643"> <class>Iperf</class> <desc>iperf (5MHz - UL/TCP)(30 sec)(single-ue profile)</desc> <iperf_args>-t 30 -i 1 -fm -R</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> - <testCase id="040644"> + <testCase id="040644"> <class>Iperf</class> <desc>iperf (5MHz - UL/TCP)(30 sec)(balanced profile)</desc> <iperf_args>-t 30 -i 1 -fm -R</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>balanced</iperf_profile> - </testCase> + </testCase> </testCaseList> diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml index ccbe71cd141d2a724ca9d6106d61caa9ef70f8ec..fd6aabcbbc82b4aefe9def99120c4680d37d61c5 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml @@ -52,62 +52,62 @@ <desc>Terminate UE</desc> </testCase> - <testCase id="040301"> - <class>Attach_UE</class> - <desc>Attach UE</desc> - </testCase> - - <testCase id="040401"> - <class>Detach_UE</class> - <desc>Detach UE</desc> - </testCase> - - <testCase id="040511"> - <class>Ping</class> - <desc>ping (10MHz - 20 sec)</desc> - <ping_args>-c 20</ping_args> - <ping_packetloss_threshold>5</ping_packetloss_threshold> - </testCase> - - <testCase id="040613"> + <testCase id="040301"> + <class>Attach_UE</class> + <desc>Attach UE</desc> + </testCase> + + <testCase id="040401"> + <class>Detach_UE</class> + <desc>Detach UE</desc> + </testCase> + + <testCase id="040511"> + <class>Ping</class> + <desc>ping (10MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> + + <testCase id="040613"> <class>Iperf</class> <desc>iperf (10MHz - DL/30Mbps/UDP)(30 sec)(balanced profile)</desc> <iperf_args>-u -b 30M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>balanced</iperf_profile> - </testCase> + </testCase> - <testCase id="040614"> + <testCase id="040614"> <class>Iperf</class> <desc>iperf (10MHz - DL/30Mbps/UDP)(30 sec)(single-ue profile)</desc> <iperf_args>-u -b 30M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> - <testCase id="040615"> + <testCase id="040615"> <class>Iperf</class> <desc>iperf (10MHz - DL/30Mbps/UDP)(30 sec)(unbalanced profile)</desc> <iperf_args>-u -b 30M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>unbalanced</iperf_profile> - </testCase> + </testCase> - <testCase id="040616"> + <testCase id="040616"> <class>Iperf</class> <desc>iperf (10MHz - DL/TCP)(30 sec)(single-ue profile)</desc> <iperf_args>-t 30 -i 1 -fm</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> - <testCase id="040617"> + <testCase id="040617"> <class>Iperf</class> <desc>iperf (10MHz - DL/TCP)(30 sec)(balanced profile)</desc> <iperf_args>-t 30 -i 1 -fm</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>balanced</iperf_profile> - </testCase> + </testCase> <testCase id="040651"> <class>Iperf</class> @@ -125,20 +125,20 @@ <iperf_profile>single-ue</iperf_profile> </testCase> - <testCase id="040653"> + <testCase id="040653"> <class>Iperf</class> <desc>iperf (10MHz - UL/TCP)(30 sec)(single-ue profile)</desc> <iperf_args>-t 30 -i 1 -fm -R</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> - <testCase id="040654"> + <testCase id="040654"> <class>Iperf</class> <desc>iperf (10MHz - UL/TCP)(30 sec)(balanced profile)</desc> <iperf_args>-t 30 -i 1 -fm -R</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>balanced</iperf_profile> - </testCase> + </testCase> </testCaseList> diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml index 03263bb86f8028016596be39b5da179f202cdac5..adde118128c5d61d11f2e20dd386e59939749f16 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml @@ -52,62 +52,62 @@ <desc>Terminate UE</desc> </testCase> - <testCase id="040301"> - <class>Attach_UE</class> - <desc>Attach UE</desc> - </testCase> - - <testCase id="040401"> - <class>Detach_UE</class> - <desc>Detach UE</desc> - </testCase> - - <testCase id="040521"> - <class>Ping</class> - <desc>ping (20MHz - 20 sec)</desc> - <ping_args>-c 20</ping_args> - <ping_packetloss_threshold>5</ping_packetloss_threshold> - </testCase> - - <testCase id="040623"> + <testCase id="040301"> + <class>Attach_UE</class> + <desc>Attach UE</desc> + </testCase> + + <testCase id="040401"> + <class>Detach_UE</class> + <desc>Detach UE</desc> + </testCase> + + <testCase id="040521"> + <class>Ping</class> + <desc>ping (20MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> + + <testCase id="040623"> <class>Iperf</class> <desc>iperf (20MHz - DL/70Mbps/UDP)(30 sec)(balanced profile)</desc> <iperf_args>-u -b 70M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>balanced</iperf_profile> - </testCase> + </testCase> - <testCase id="040624"> + <testCase id="040624"> <class>Iperf</class> <desc>iperf (20MHz - DL/70Mbps/UDP)(30 sec)(single-ue profile)</desc> <iperf_args>-u -b 70M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> - <testCase id="040625"> + <testCase id="040625"> <class>Iperf</class> <desc>iperf (20MHz - DL/70Mbps/UDP)(30 sec)(unbalanced profile)</desc> <iperf_args>-u -b 70M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>unbalanced</iperf_profile> - </testCase> + </testCase> - <testCase id="040626"> + <testCase id="040626"> <class>Iperf</class> <desc>iperf (20MHz - DL/TCP)(30 sec)(single-ue profile)</desc> <iperf_args>-t 30 -i 1 -fm</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> - <testCase id="040627"> + <testCase id="040627"> <class>Iperf</class> <desc>iperf (20MHz - DL/TCP)(30 sec)(balanced profile)</desc> <iperf_args>-t 30 -i 1 -fm</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>balanced</iperf_profile> - </testCase> + </testCase> <testCase id="040661"> <class>Iperf</class> @@ -125,20 +125,20 @@ <iperf_profile>single-ue</iperf_profile> </testCase> - <testCase id="040663"> + <testCase id="040663"> <class>Iperf</class> <desc>iperf (20MHz - UL/TCP)(30 sec)(single-ue profile)</desc> <iperf_args>-t 30 -i 1 -fm -R</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> - <testCase id="040664"> + <testCase id="040664"> <class>Iperf</class> <desc>iperf (20MHz - UL/TCP)(30 sec)(balanced profile)</desc> <iperf_args>-t 30 -i 1 -fm -R</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>balanced</iperf_profile> - </testCase> + </testCase> </testCaseList> diff --git a/ci-scripts/xml_files/enb_usrp210_band7_tracer.xml b/ci-scripts/xml_files/enb_usrp210_band7_tracer.xml index 4c74f52b0f0932ad241c991e5a0d192511162a87..e63f02ba3de8c974e5306dac0e9a166a32448586 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_tracer.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_tracer.xml @@ -51,15 +51,15 @@ <desc>Terminate UE</desc> </testCase> - <testCase id="040300"> - <class>Attach_UE</class> - <desc>Attach single UE</desc> - <nbMaxUEtoAttach>1</nbMaxUEtoAttach> - </testCase> + <testCase id="040300"> + <class>Attach_UE</class> + <desc>Attach single UE</desc> + <nbMaxUEtoAttach>1</nbMaxUEtoAttach> + </testCase> - <testCase id="040401"> - <class>Detach_UE</class> - <desc>Detach UE</desc> - </testCase> + <testCase id="040401"> + <class>Detach_UE</class> + <desc>Detach UE</desc> + </testCase> </testCaseList> diff --git a/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml b/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml index fdf795fb300233f0d5d75a519e533d996dd97e0e..2ed85f8a889e3578b01e1ac282ebc098e889416c 100644 --- a/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml +++ b/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml @@ -68,30 +68,30 @@ <desc>Terminate UE</desc> </testCase> - <testCase id="040301"> - <class>Attach_UE</class> - <desc>Attach UE</desc> - </testCase> - - <testCase id="040401"> - <class>Detach_UE</class> - <desc>Detach UE</desc> - </testCase> - - <testCase id="040541"> - <class>Ping</class> - <desc>ping (5MHz - 20 sec)</desc> - <ping_args>-c 20</ping_args> - <ping_packetloss_threshold>5</ping_packetloss_threshold> - </testCase> - - <testCase id="040601"> + <testCase id="040301"> + <class>Attach_UE</class> + <desc>Attach UE</desc> + </testCase> + + <testCase id="040401"> + <class>Detach_UE</class> + <desc>Detach UE</desc> + </testCase> + + <testCase id="040541"> + <class>Ping</class> + <desc>ping (5MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> + + <testCase id="040601"> <class>Iperf</class> <desc>iperf (5MHz - DL/15Mbps/UDP)(30 sec)(single-ue profile)</desc> <iperf_args>-u -b 15M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> <testCase id="040641"> <class>Iperf</class> diff --git a/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml b/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml index 3592759fc623052b6bc398216a81c341053e883f..23569f235020c2283169c00b1b1a11729af28e24 100644 --- a/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml +++ b/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml @@ -68,30 +68,30 @@ <desc>Terminate UE</desc> </testCase> - <testCase id="040301"> - <class>Attach_UE</class> - <desc>Attach UE</desc> - </testCase> - - <testCase id="040401"> - <class>Detach_UE</class> - <desc>Detach UE</desc> - </testCase> - - <testCase id="040551"> - <class>Ping</class> - <desc>ping (10MHz - 20 sec)</desc> - <ping_args>-c 20</ping_args> - <ping_packetloss_threshold>5</ping_packetloss_threshold> - </testCase> - - <testCase id="040611"> + <testCase id="040301"> + <class>Attach_UE</class> + <desc>Attach UE</desc> + </testCase> + + <testCase id="040401"> + <class>Detach_UE</class> + <desc>Detach UE</desc> + </testCase> + + <testCase id="040551"> + <class>Ping</class> + <desc>ping (10MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> + + <testCase id="040611"> <class>Iperf</class> <desc>iperf (10MHz - DL/32Mbps/UDP)(30 sec)(single-ue profile)</desc> <iperf_args>-u -b 32M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> <testCase id="040651"> <class>Iperf</class> diff --git a/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml b/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml index f2cb155127072dcf1e516cbd142ac0ce9007049f..1e4a835f84fd97c82a8c9d53c75d427f07b28190 100644 --- a/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml +++ b/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml @@ -68,30 +68,30 @@ <desc>Terminate UE</desc> </testCase> - <testCase id="040301"> - <class>Attach_UE</class> - <desc>Attach UE</desc> - </testCase> - - <testCase id="040401"> - <class>Detach_UE</class> - <desc>Detach UE</desc> - </testCase> - - <testCase id="040561"> - <class>Ping</class> - <desc>ping (20MHz - 20 sec)</desc> - <ping_args>-c 20</ping_args> - <ping_packetloss_threshold>5</ping_packetloss_threshold> - </testCase> - - <testCase id="040621"> + <testCase id="040301"> + <class>Attach_UE</class> + <desc>Attach UE</desc> + </testCase> + + <testCase id="040401"> + <class>Detach_UE</class> + <desc>Detach UE</desc> + </testCase> + + <testCase id="040561"> + <class>Ping</class> + <desc>ping (20MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> + + <testCase id="040621"> <class>Iperf</class> <desc>iperf (20MHz - DL/70Mbps/UDP)(30 sec)(single-ue profile)</desc> <iperf_args>-u -b 70M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> <testCase id="040661"> <class>Iperf</class> diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml index 5bb7db52990d6b6a7bae5764769cb0ab51a04e3b..752049349ffe550a63816c579c46e0d23024ed64 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml @@ -24,7 +24,7 @@ <htmlTabRef>build-tab</htmlTabRef> <htmlTabName>Build</htmlTabName> <htmlTabIcon>wrench</htmlTabIcon> - <TestCaseRequestedList> + <TestCaseRequestedList> 010101 050101 060101 070101 </TestCaseRequestedList> @@ -34,13 +34,13 @@ <testCase id="010101"> <class>Build_eNB</class> <desc>Build eNB (USRP -- Ethernet Fronthaul)</desc> - <Build_eNB_args>-t ETHERNET -w USRP -c --eNB</Build_eNB_args> + <Build_eNB_args>-w USRP -c --eNB</Build_eNB_args> </testCase> - <testCase id="050101"> + <testCase id="050101"> <class>Initialize_HSS</class> <desc>Initialize HSS</desc> - </testCase> + </testCase> <testCase id="060101"> <class>Initialize_MME</class> diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_epc_closure.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_epc_closure.xml index c04a8b3cf46940005090ebc835b09fd824d4c027..8587db959dde6db2d6485cc388bc3026643ee36f 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band40_epc_closure.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_epc_closure.xml @@ -24,25 +24,25 @@ <htmlTabRef>epc-closure</htmlTabRef> <htmlTabName>EPC-Closure</htmlTabName> <htmlTabIcon>log-out</htmlTabIcon> - <TestCaseRequestedList> + <TestCaseRequestedList> 050201 060201 070201 </TestCaseRequestedList> <TestCaseExclusionList> </TestCaseExclusionList> - <testCase id="050201"> - <class>Terminate_HSS</class> - <desc>Terminate HSS</desc> - </testCase> + <testCase id="050201"> + <class>Terminate_HSS</class> + <desc>Terminate HSS</desc> + </testCase> - <testCase id="060201"> - <class>Terminate_MME</class> - <desc>Terminate MME</desc> - </testCase> + <testCase id="060201"> + <class>Terminate_MME</class> + <desc>Terminate MME</desc> + </testCase> - <testCase id="070201"> - <class>Terminate_SPGW</class> - <desc>Terminate SPGW</desc> - </testCase> + <testCase id="070201"> + <class>Terminate_SPGW</class> + <desc>Terminate SPGW</desc> + </testCase> </testCaseList> diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml index 00c93f4faf31d5cabf7f7a45b90e2ef40dd15cbf..06763aa99531e47b968fdaafbe76589a61b2b8d3 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml @@ -24,7 +24,7 @@ <htmlTabRef>test-05</htmlTabRef> <htmlTabName>Test-05MHz</htmlTabName> <htmlTabIcon>tasks</htmlTabIcon> - <TestCaseRequestedList> + <TestCaseRequestedList> 030201 040101 030104 030105 040301 040501 040602 040642 040401 040201 030201 030202 diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml index 4371cb2a11bf42ee5aee675b2b90781977755734..e1644f393125ea4fd1ed2697a50593da3e7d8ae7 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml @@ -24,7 +24,7 @@ <htmlTabRef>test-10</htmlTabRef> <htmlTabName>Test-10MHz</htmlTabName> <htmlTabIcon>tasks</htmlTabIcon> - <TestCaseRequestedList> + <TestCaseRequestedList> 030201 040101 030114 030115 040301 040511 040612 040652 040401 040201 030201 030202 @@ -40,11 +40,11 @@ </testCase> <testCase id="030115"> - <class>Initialize_eNB</class> - <desc>Initialize RCC (TDD/Band40/10MHz/info)</desc> - <Initialize_eNB_args>-O ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf</Initialize_eNB_args> + <class>Initialize_eNB</class> + <desc>Initialize RCC (TDD/Band40/10MHz/info)</desc> + <Initialize_eNB_args>-O ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf</Initialize_eNB_args> <eNB_instance>1</eNB_instance> - </testCase> + </testCase> <testCase id="030201"> <class>Terminate_eNB</class> diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml index a2356891f1d7be0460b73bffc4c1161fffea9edb..17ede3f8305ec26db5e8204c3080717c48811f7c 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml @@ -24,7 +24,7 @@ <htmlTabRef>test-20</htmlTabRef> <htmlTabName>Test-20MHz</htmlTabName> <htmlTabIcon>tasks</htmlTabIcon> - <TestCaseRequestedList> + <TestCaseRequestedList> 030201 040101 030124 030125 040301 040521 040622 040662 040401 040201 030201 030202 @@ -68,30 +68,30 @@ <desc>Terminate UE</desc> </testCase> - <testCase id="040301"> - <class>Attach_UE</class> - <desc>Attach UE</desc> - </testCase> - - <testCase id="040401"> - <class>Detach_UE</class> - <desc>Detach UE</desc> - </testCase> - - <testCase id="040521"> - <class>Ping</class> - <desc>ping (20MHz - 20 sec)</desc> - <ping_args>-c 20</ping_args> - <ping_packetloss_threshold>25</ping_packetloss_threshold> - </testCase> - - <testCase id="040622"> - <class>Iperf</class> - <desc>iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue)</desc> - <iperf_args>-u -b 13.5M -t 30 -i 1</iperf_args> - <iperf_packetloss_threshold>50</iperf_packetloss_threshold> - <iperf_profile>single-ue</iperf_profile> - </testCase> + <testCase id="040301"> + <class>Attach_UE</class> + <desc>Attach UE</desc> + </testCase> + + <testCase id="040401"> + <class>Detach_UE</class> + <desc>Detach UE</desc> + </testCase> + + <testCase id="040521"> + <class>Ping</class> + <desc>ping (20MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>25</ping_packetloss_threshold> + </testCase> + + <testCase id="040622"> + <class>Iperf</class> + <desc>iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue)</desc> + <iperf_args>-u -b 13.5M -t 30 -i 1</iperf_args> + <iperf_packetloss_threshold>50</iperf_packetloss_threshold> + <iperf_profile>single-ue</iperf_profile> + </testCase> <testCase id="040662"> <class>Iperf</class> diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml index a0be9253dbd7878cbef23c64b81d2e8ab09ffa21..8cbd2d84c67695e5e172fc224b1a5adab07d8281 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml @@ -34,13 +34,13 @@ <testCase id="010101"> <class>Build_eNB</class> <desc>Build eNB (USRP -- Ethernet Fronthaul)</desc> - <Build_eNB_args>-t ETHERNET -w USRP -c --eNB</Build_eNB_args> + <Build_eNB_args>-w USRP -c --eNB</Build_eNB_args> </testCase> - <testCase id="050101"> + <testCase id="050101"> <class>Initialize_HSS</class> <desc>Initialize HSS</desc> - </testCase> + </testCase> <testCase id="060101"> <class>Initialize_MME</class> diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml index 1464a4a624438854f2b81f905bcc9c97b33528db..d72633159df638556f0429d4a35d8f6d114a4bfd 100644 --- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml +++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml @@ -68,30 +68,30 @@ <desc>Terminate UE</desc> </testCase> - <testCase id="040301"> - <class>Attach_UE</class> - <desc>Attach UE</desc> - </testCase> - - <testCase id="040401"> - <class>Detach_UE</class> - <desc>Detach UE</desc> - </testCase> - - <testCase id="040501"> - <class>Ping</class> - <desc>ping (5MHz - 20 sec)</desc> - <ping_args>-c 20</ping_args> - <ping_packetloss_threshold>5</ping_packetloss_threshold> - </testCase> - - <testCase id="040604"> + <testCase id="040301"> + <class>Attach_UE</class> + <desc>Attach UE</desc> + </testCase> + + <testCase id="040401"> + <class>Detach_UE</class> + <desc>Detach UE</desc> + </testCase> + + <testCase id="040501"> + <class>Ping</class> + <desc>ping (5MHz - 20 sec)</desc> + <ping_args>-c 20</ping_args> + <ping_packetloss_threshold>5</ping_packetloss_threshold> + </testCase> + + <testCase id="040604"> <class>Iperf</class> <desc>iperf (5MHz - DL/15Mbps/UDP)(30 sec)(single-ue profile)</desc> <iperf_args>-u -b 15M -t 30 -i 1</iperf_args> <iperf_packetloss_threshold>50</iperf_packetloss_threshold> <iperf_profile>single-ue</iperf_profile> - </testCase> + </testCase> <testCase id="040642"> <class>Iperf</class> diff --git a/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml index 594ea7b923c339016e750767f1d35f8a1807eaab..19d08d511968868d0751770ca44a8e2469f7c083 100644 --- a/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml +++ b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml @@ -21,9 +21,9 @@ --> <testCaseList> - <htmlTabRef>test-10mhz-orange</htmlTabRef> - <htmlTabName>Test-10Mhz-Orange</htmlTabName> - <htmlTabIcon>tasks</htmlTabIcon> + <htmlTabRef>test-10mhz-orange</htmlTabRef> + <htmlTabName>Test-10Mhz-Orange</htmlTabName> + <htmlTabIcon>tasks</htmlTabIcon> <TestCaseRequestedList> 090109 090110 000001 090109 diff --git a/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml b/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml index 89370be9839370a98e915131bd200b9cf05d6c2c..50912d3458108830b0db16229ba17d7dc9e457e5 100644 --- a/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml +++ b/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml @@ -21,9 +21,9 @@ --> <testCaseList> - <htmlTabRef>test-10mHz-sfr</htmlTabRef> - <htmlTabName>Test-10MHz-SFR</htmlTabName> - <htmlTabIcon>tasks</htmlTabIcon> + <htmlTabRef>test-10mHz-sfr</htmlTabRef> + <htmlTabName>Test-10MHz-SFR</htmlTabName> + <htmlTabIcon>tasks</htmlTabIcon> <TestCaseRequestedList> 090109 090111 000001 090109 diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index b44e52e15eba33b3ac4d041df9bba83d1562191b..584050cb0e09116d0fb84ee64043a853aef12494 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -231,7 +231,7 @@ add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"") # Debug related options ######################################### add_boolean_option(ASN_DEBUG False "ASN1 coder/decoder Debug") -add_boolean_option(ASN_EMIT_DEBUG False "ASN1 coder/decoder Debug") +add_boolean_option(EMIT_ASN_DEBUG False "ASN1 coder/decoder Debug") add_boolean_option(MSG_PRINT False "print debug messages") add_boolean_option(DISABLE_XER_PRINT False "print XER Format") add_boolean_option(XER_PRINT False "print XER Format") @@ -242,7 +242,6 @@ add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdo add_boolean_option(TRACE_RLC_PAYLOAD False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace add_boolean_option(TEST_OMG False "???") add_boolean_option(DEBUG_OMG False "???") -add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope") add_boolean_option(PRINT_STATS False "This adds the possibility to see the status") add_boolean_option(T_TRACER True "Activate the T tracer, a debugging/monitoring framework" ) add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs") @@ -253,8 +252,7 @@ add_boolean_option(USRP_REC_PLAY False "Enable USRP record playback mode") add_boolean_option(UE_NAS_USE_TUN False "Enable UE NAS TUN device instead of ue_ip.ko") add_boolean_option(NOS1 False "Allows to run without a EPC") add_boolean_option(BASIC_SIMULATOR False "Has to be True when building the basic simulator, False otherwise") - -add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering") +add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering") add_boolean_option(ENABLE_ITTI True "ITTI is internal messaging, should remain enabled for most targets") set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti) @@ -530,9 +528,9 @@ set(F1AP_ASN_FILES ) set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR}) -message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}") +message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}") execute_process(COMMAND mkdir -p ${F1AP_ASN_GENERATED_C_DIR} - COMMAND env "ASN1C_PREFIX=F1AP_" asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES} + COMMAND env "ASN1C_PREFIX=F1AP_" asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES} RESULT_VARIABLE ret OUTPUT_QUIET ERROR_QUIET) @@ -813,12 +811,19 @@ include_directories("${OPENAIR_BIN_DIR}") # Legacy exact order include_directories("${OPENAIR_DIR}/executables") -include_directories("${OPENAIR2_DIR}/COMMON") -include_directories("${OPENAIR2_DIR}/UTIL") -include_directories("${OPENAIR2_DIR}/UTIL/LOG") -include_directories("${OPENAIR3_DIR}/COMMON") -include_directories("${OPENAIR3_DIR}/UTILS") - +if(ENB_MODE) + include_directories("${OPENAIR2_DIR}/COMMON") + include_directories("${OPENAIR2_DIR}/UTIL") + include_directories("${OPENAIR2_DIR}/UTIL/LOG") + include_directories("${OPENAIR3_DIR}/COMMON") + include_directories("${OPENAIR3_DIR}/UTILS") +else() + include_directories("${OPENAIR3_DIR}/COMMON") + include_directories("${OPENAIR3_DIR}/UTILS") + include_directories("${OPENAIR2_DIR}/COMMON") + include_directories("${OPENAIR2_DIR}/UTIL") + include_directories("${OPENAIR2_DIR}/UTIL/LOG") +endif() include_directories("${NFAPI_DIR}/nfapi/public_inc") include_directories("${NFAPI_DIR}/common/public_inc") include_directories("${NFAPI_DIR}/pnf/public_inc") @@ -2236,26 +2241,34 @@ endif() list(APPEND ATLAS_LIBRARIES lapack lapacke) -if (${XFORMS}) - include_directories ("/usr/include/X11") - set(XFORMS_SOURCE - ${OPENAIR1_DIR}/PHY/TOOLS/lte_phy_scope.c - ) - set(XFORMS_SOURCE_NR - ${OPENAIR1_DIR}/PHY/TOOLS/nr_phy_scope.c - ) - set(XFORMS_SOURCE_SOFTMODEM - ${OPENAIR_DIR}/targets/RT/USER/stats.c - ) - set(XFORMS_LIBRARIES "forms") -endif (${XFORMS}) - include_directories ("/usr/include/X11") - -add_library(gnbScope MODULE +set(XFORMS_SOURCE + ${OPENAIR1_DIR}/PHY/TOOLS/lte_phy_scope.c + ) +set(XFORMS_ENB_SOURCE + ${OPENAIR1_DIR}/PHY/TOOLS/lte_enb_scope.c + ) +set(XFORMS_UE_SOURCE + ${OPENAIR1_DIR}/PHY/TOOLS/lte_ue_scope.c + ) +set(XFORMS_SOURCE_NR ${OPENAIR1_DIR}/PHY/TOOLS/nr_phy_scope.c ) -target_link_libraries(gnbScope forms) +set(XFORMS_SOURCE_SOFTMODEM + ${OPENAIR_TARGETS}/RT/USER/stats.c + ) +set(XFORMSINTERFACE_SOURCE + ${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c + ) +set(XFORMS_LIBRARIES "forms") + +add_library(enbscope MODULE ${XFORMS_SOURCE} ${XFORMS_SOURCE_SOFTMODEM} ${XFORMS_ENB_SOURCE}) +add_library(uescope MODULE ${XFORMS_SOURCE} ${XFORMS_SOURCE_SOFTMODEM} ${XFORMS_UE_SOURCE}) +target_link_libraries(enbscope ${XFORMS_LIBRARIES}) +target_link_libraries(uescope ${XFORMS_LIBRARIES}) + +add_library(gnbscope MODULE ${XFORMS_SOURCE_NR}) +target_link_libraries(gnbscope ${XFORMS_LIBRARIES}) set(CMAKE_MODULE_PATH "${OPENAIR_DIR}/cmake_targets/tools/MODULES" "${CMAKE_MODULE_PATH}") @@ -2267,7 +2280,7 @@ if (${T_TRACER}) set(T_SOURCE ${OPENAIR_DIR}/common/utils/T/T.c ${OPENAIR_DIR}/common/utils/T/local_tracer.c) - set (T_LIB "rt") + set(T_LIB "rt") endif (${T_TRACER}) #Some files in the T directory are generated. @@ -2341,8 +2354,7 @@ add_executable(lte-softmodem ${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/system.c ${GTPU_need_ITTI} - ${XFORMS_SOURCE} - ${XFORMS_SOURCE_SOFTMODEM} + ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} @@ -2351,10 +2363,15 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag) target_link_libraries (lte-softmodem -Wl,--start-group - RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} LFDS7 - NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB + RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB + PHY_COMMON PHY PHY_RU LFDS L2 NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 + ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} -Wl,--end-group z dl) + +target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES}) +target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) +target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES}) +target_link_libraries (lte-softmodem ${T_LIB}) add_executable(cu_test ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/cu_test.c @@ -2384,51 +2401,6 @@ target_link_libraries(du_test ${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ${ITTI_LIB} ) -target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) -target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES}) -target_link_libraries (lte-softmodem ${T_LIB}) - -# lte-softmodem-nos1 is both eNB and UE implementation -################################################### -add_executable(lte-softmodem-nos1 - ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c - ${OPENAIR_TARGETS}/RT/USER/lte-enb.c - ${OPENAIR_TARGETS}/RT/USER/lte-ru.c - ${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c - ${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c - ${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c - ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c - ${OPENAIR_TARGETS}/COMMON/create_tasks.c - ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c - ${OPENAIR2_DIR}/RRC/NAS/nas_config.c - ${OPENAIR2_DIR}/RRC/NAS/rb_config.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c - ${GTPU_need_ITTI} - ${XFORMS_SOURCE} - ${XFORMS_SOURCE_SOFTMODEM} - ${T_SOURCE} - ${CONFIG_SOURCES} - ${SHLIB_LOADER_SOURCES} - ) - -add_dependencies(lte-softmodem-nos1 rrc_flag s1ap_flag x2_flag) - -target_link_libraries (lte-softmodem-nos1 - -Wl,--start-group - RRC_LIB F1AP F1AP_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} LFDS7 - NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB - -Wl,--end-group z dl) - -target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) -target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES}) -target_link_libraries (lte-softmodem-nos1 ${T_LIB}) # lte-uesoftmodem is UE implementation ####################################### @@ -2450,8 +2422,7 @@ add_executable(lte-uesoftmodem ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/system.c - ${XFORMS_SOURCE} - ${XFORMS_SOURCE_SOFTMODEM} + ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} @@ -2464,58 +2435,16 @@ if (NOT ${NOS1}) endif() target_link_libraries (lte-uesoftmodem -Wl,--start-group - RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP F1AP_LIB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} + RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP F1AP_LIB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON + PHY_UE PHY_RU LFDS L2_UE SIMU ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -Wl,--end-group z dl) target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) +target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${T_LIB}) -# lte-uesoftmodem-nos1 is UE implementation -################################################### -add_executable(lte-uesoftmodem-nos1 - ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c - ${OPENAIR_TARGETS}/RT/USER/lte-ue.c - ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c - ${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c - ${OPENAIR_TARGETS}/RT/USER/lte-ru.c - ${OPENAIR_TARGETS}/RT/USER/rfsim.c - ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c - ${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c - ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c - ${OPENAIR2_DIR}/RRC/NAS/nas_config.c - ${OPENAIR2_DIR}/RRC/NAS/rb_config.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c - ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c - ${XFORMS_SOURCE} - ${XFORMS_SOURCE_SOFTMODEM} - ${T_SOURCE} - ${CONFIG_SOURCES} - ${SHLIB_LOADER_SOURCES} - ) - -add_dependencies(lte-uesoftmodem-nos1 rrc_flag s1ap_flag x2_flag) - -target_link_libraries (lte-uesoftmodem-nos1 - -Wl,--start-group - RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP F1AP_LIB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} - NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB - -Wl,--end-group z dl) - -target_link_libraries (lte-uesoftmodem-nos1 ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) -target_link_libraries (lte-uesoftmodem-nos1 ${LIB_LMS_LIBRARIES}) -target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB}) - - # nr-softmodem ################################################### @@ -2527,8 +2456,11 @@ add_executable(nr-softmodem ${OPENAIR_DIR}/executables/nr-gnb.c ${OPENAIR_DIR}/executables/nr-ru.c ${OPENAIR_DIR}/executables/nr-softmodem.c + ${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c + ${OPENAIR2_DIR}/RRC/NAS/nas_config.c + ${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/system.c @@ -2542,9 +2474,9 @@ add_executable(nr-softmodem target_link_libraries (nr-softmodem -Wl,--start-group UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA - ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} - RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB L2 L2_NR MAC_NR_COMMON - NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB + ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB + S1AP_LIB S1AP_ENB L2 L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB + X2AP_LIB X2AP_ENB F1AP_LIB F1AP ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} -Wl,--end-group z dl) target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES}) @@ -2579,7 +2511,7 @@ add_executable(nr-softmodem-nos1 target_link_libraries (nr-softmodem-nos1 -Wl,--start-group UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA - ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${MIH_LIB} + ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB L2 L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -Wl,--end-group z dl) @@ -2599,8 +2531,10 @@ add_executable(nr-uesoftmodem ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c ${OPENAIR_DIR}/executables/nr-uesoftmodem.c ${OPENAIR_DIR}/executables/nr-ue.c + ${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c + ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${OPENAIR_DIR}/common/utils/utils.c @@ -2613,8 +2547,9 @@ add_executable(nr-uesoftmodem target_link_libraries (nr-uesoftmodem -Wl,--start-group - RRC_LIB NR_RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_UE PHY_RU LFDS NR_L2_UE MAC_NR_COMMON - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} + RRC_LIB NR_RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB + ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} + PHY_COMMON PHY_NR_UE PHY_RU LFDS L2_UE NR_L2_UE MAC_NR_COMMON NFAPI_USER_LIB S1AP_LIB S1AP_ENB -Wl,--end-group z dl) target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES}) @@ -2622,7 +2557,7 @@ target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${C target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (nr-uesoftmodem ${T_LIB}) -# nr-uesoftmodem is UE implementation +# nr-uesoftmodem-nos1 ####################################### add_executable(nr-uesoftmodem-nos1 @@ -2694,7 +2629,7 @@ add_executable(dlsim_tm4 ) target_link_libraries (dlsim_tm4 -Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY LFDS ${ITTI_LIB} -Wl,--end-group - pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} + pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${T_LIB} ) add_executable(polartest @@ -2763,7 +2698,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr ) target_link_libraries (${myExe} -Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY PHY_UE PHY_RU LFDS ${ITTI_LIB} LFDS7 -Wl,--end-group - pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl + pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl ) endforeach(myExe) @@ -2827,12 +2762,11 @@ endforeach(myExe) if (${T_TRACER}) foreach(i #all "add_executable" definitions (except tests, rb_tool, updatefw) - lte-softmodem lte-softmodem-nos1 lte-uesoftmodem lte-uesoftmodem-nos1 - nr-softmodem nr-softmodem-nos1 nr-uesoftmodem nr-uesoftmodem-nos1 - dlsim_tm4 nr_dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim - pdcchsim pucchsim prachsim syncsim ulsim ldpctest polartest - cu_test du_test - + lte-softmodem lte-uesoftmodem nr-softmodem nr-softmodem-nos1 + nr-uesoftmodem nr-uesoftmodem-nos1 dlsim dlsim_tm4 dlsim_tm7 + ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim + syncsim ulsim nr_dlsim nr_dlschsim nr_pbchsim nr_pucchsim + nr_ulschsim ldpctest polartest smallblocktest cu_test du_test #all "add_library" definitions ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP_LIB F1AP params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf index d99ca88807d0fb16a714f3092aad74e9172e6129..7f920e7e384a4bc7c6e1f09b29747fb9f5031fbc 100644 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf index 86c54a82f710a602d371c6377719e3237f6a248d..e5c57ffda558fc8cf8a9ec4f76c6b99a61a28e25 100644 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf index dad0ab5a2301dcef69e43366bdf150a548760195..17a33805678cc4ec66bcdf1ad6ca5cc4dce06be9 100644 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf index 369b6184fd8f46460fbe26ff74a0ba2927f284d6..6721504f36608e30fb9e4f2d80b45ca475be88f4 100644 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf index 14ae99c80ca81be2c5dc5df9e25009e8a03fd122..4919ad3117c86a68096c6b2b203120e2f8997a45 100644 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf index 9302ac7c5828ea2cafe367336a0df1be19008919..c26a0ad698b82c59097e13338413d83e659f3694 100644 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf index 0ae9e659b41f300942f7b466ba739b690038c45c..ff0d3d7a004410f06ce20ea405c02d649394aabb 100644 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf index 1d22c19ec872f758658d7706f106f6a8590b0864..8195b21157e374a25de2f13d902a6e09504ef221 100644 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf index 3f35175ff49af72a4fa64ab8f37d45ea42f342be..8b172a7d7368b7720a84008ef149c21007cd5632 100644 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf @@ -141,6 +141,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf index 0a6a8cccc69087e49bc70f8043bd7e8e91e6a3c1..0d9a243b31c43caee4640312e0847acba1830ad0 100644 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf @@ -143,6 +143,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf index 7ffdd063a659fa8c7be540b7dc35498de93a036c..ac8591841e98a3ea183a3c4f0e0789064e717d52 100644 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf @@ -143,6 +143,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf index 409fa49910153f92fbde234666dcbe5a293c95c9..93bfc2449f99d550fe3cf640a34d613fefd863a1 100644 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf @@ -143,6 +143,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 4d302b9f68db63f963bbd39b4b70152ee75f773f..2f9bcead3298aa913ab352619e1020884ff51c6a 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -53,13 +53,13 @@ NR_REL="NR_Rel15" HW="None" TP="None" NOS1=0 -HW_LATENCY=0 EPC=0 VERBOSE_COMPILE=0 CFLAGS_PROCESSOR_USER="" RUN_GROUP=0 TEST_CASE_GROUP="" BUILD_DOXYGEN=0 +BUILD_COVERITY_SCAN=0 T_TRACER="True" DISABLE_HARDWARE_DEPENDENCY="False" CMAKE_BUILD_TYPE="" @@ -67,12 +67,10 @@ CMAKE_CMD="$CMAKE" UE_AUTOTEST_TRACE="False" UE_DEBUG_TRACE="False" UE_TIMING_TRACE="False" -DISABLE_LOG_X="False" USRP_REC_PLAY="False" BUILD_ECLIPSE=0 NR="False" -UE_NAS_USE_TUN="False" -BASIC_SIMULATOR=0 +OPTIONAL_LIBRARIES="telnetsrv enbscope uescope msc" trap handle_ctrl_c INT function print_help() { @@ -91,10 +89,11 @@ Options This option will require root password --install-optional-packages Install useful but not mandatory packages such as valgrind +-i | --install-system-files + Install OpenAirInterface required files in Linux system + This option will require root password -g | --run-with-gdb Add debugging symbols to compilation directives. It also disables any compiler optimization. Only for debugging. Do not use in normal operation! --h | --help - Print this help --eNB Makes the LTE softmodem --gNB @@ -116,14 +115,11 @@ Options Rel8 limits the implementation to 3GPP Release 8 version Rel10 limits the implementation to 3GPP Release 10 version -w | --hardware - EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, IRIS, ADRV9371_ZC706, SIMU, None (Default) + EXMIMO, USRP, BLADERF, LMSSDR, IRIS, ADRV9371_ZC706, SIMU, None (Default) Adds this RF board support (in external packages installation and in compilation) --t | --transport protocol - ETHERNET , None - Adds this trasport protocol support in compilation ---phy_simulators +-P | --phy_simulators Makes the unitary tests Layer 1 simulators ---core_simulators +-S | --core_simulators Makes the core security features unitary simulators -s | --check runs a set of auto-tests based on simulators and several compilation tests @@ -131,58 +127,47 @@ Options runs only specified test cases specified here. This flag is only valid with -s -V | --vcd Adds a debgging facility to the binary files: GUI with major internal synchronization events --x | --xforms - Adds a software oscilloscope feature to the produced binaries. ---install-system-files - Install OpenArInterface required files in Linux system - (will ask root password) ---noS1 - Compiles lte-softmodem without S1 interface, using direct link to IP instead --verbose-compile Shows detailed compilation instructions in makefile --cflags_processor Manually Add CFLAGS of processor if they are not detected correctly by script. Only add these flags if you know your processor supports them. Example flags: -msse3 -msse4.1 -msse4.2 -mavx2 --build-doxygen Builds doxygen based documentation. +--build-coverity-scan + Builds Coverity-Scan objects for upload --disable-deadline Disables deadline scheduler of Linux kernel (>=3.14.x). --enable-deadline Enable deadline scheduler of Linux kernel (>=3.14.x). --disable-cpu-affinity Disables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads +--enable-cpu-affinity --disable-T-Tracer Disables the T tracer. --disable-hardware-dependency Disable HW dependency during installation --ue-autotest-trace - Enable specific traces for UE autotest framework + Enable specific traces for UE autotest framework --ue-trace - Enable traces for UE debugging + Enable traces for UE debugging --ue-timing - Enable traces for timing ---disable-log - Disable all LOG_* macros + Enable traces for timing +--uhd-images-dir + Download UHD images in the indicated location --build-eclipse Build eclipse project files. Paths are auto corrected by fixprj.sh ---build-telnet - Build telnet server, specify --telnetsrv on command line to start it (eNB only) ---build-msc - Build MSC tracing utility, specify --msc on command line to start it (eNB and UE) +--build-lib <libraries> + Build optional shared library, <libraries> can be one or several of $OPTIONAL_LIBRARIES --usrp-recplay Build for I/Q record-playback modes ---ue-nas-use-tun - Use TUN devices for the UEs instead of ue_ip.ko ---basic-simulator - Generates a basic [1 UE + 1 eNB + no channel] simulator. - See targets/ARCH/tcp_bridge/README.tcp_bridge_oai for documentation. ---rfsimulator - Generate virtual RF driver - to use it, set the environement variable RFSIMULATOR to \"enb\" in the eNB and to the eNB IP address in the UEs +-h | --help + Print this help + Usage (first build): - NI/ETTUS B201 + COTS UE : ./build_oai -I --eNB -x --install-system-files -w USRP + NI/ETTUS B201 + COTS UE : ./build_oai -I --eNB --install-system-files -w USRP Usage (Regular): - Eurecom EXMIMO + OAI ENB : ./build_oai --eNB -x - NI/ETTUS B201 + OAI ENB : ./build_oai --eNB -x -w USRP" + Eurecom EXMIMO + OAI ENB : ./build_oai --eNB + NI/ETTUS B201 + OAI ENB : ./build_oai --eNB -w USRP" } @@ -209,6 +194,10 @@ function main() { INSTALL_OPTIONAL=1 echo_info "Will install optional packages" shift;; + -i | --install-system-files) + INSTALL_SYSTEM_FILES=1 + echo_info "Will copy OpenAirInterface files in Linux directories" + shift;; -g | --run-with-gdb) GDB=1 CMAKE_BUILD_TYPE="Debug" @@ -247,7 +236,7 @@ function main() { --UE-conf-nvram) conf_nvram_path=$(readlink -f $2) shift 2;; - --UE-gen-nvram) + --UE-gen-nvram) gen_nvram_path=$(readlink -f $2) shift 2;; -r | --3gpp-release) @@ -268,22 +257,14 @@ function main() { ;; *) echo_fatal "Unknown HW type $HW: exit..." - esac + esac echo_info "Setting hardware to: $HW" shift 2;; - -t | --transport_protocol) - TP="$2" #"${i#*=}" - if [ "$TP" != "ETHERNET" -a "$TP" != "None" ] ; then - echo_fatal "Unknown TP type $TP will exit..." - else - echo_info "Setting transport protocol to: $TP" - fi - shift 2;; - --phy_simulators) + -P | --phy_simulators) SIMUS_PHY=1 echo_info "Will compile dlsim, ulsim, ..." shift;; - --core_simulators) + -S | --core_simulators) SIMUS_CORE=1 echo_info "Will compile security unitary tests" shift;; @@ -302,16 +283,12 @@ function main() { EXE_ARGUMENTS="$EXE_ARGUMENTS -V" shift;; -x | --xforms) - XFORMS="True" + XFORMS=1 EXE_ARGUMENTS="$EXE_ARGUMENTS -d" echo_info "Will generate the software oscilloscope features" shift;; - --install-system-files) - INSTALL_SYSTEM_FILES=1 - echo_info "Will copy OpenAirInterface files in Linux directories" - shift;; --noS1) - NOS1=1 + NOS1=1 echo_info "Will compile without S1 interface" shift;; --HWLAT) @@ -323,7 +300,7 @@ function main() { echo_info "Will compile hw latency test program" shift;; --verbose-compile) - VERBOSE_COMPILE=1 + VERBOSE_COMPILE=1 echo_info "Will compile with verbose instructions" shift;; --cflags_processor) @@ -331,16 +308,20 @@ function main() { echo_info "Setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER" shift 2;; --build-doxygen) - BUILD_DOXYGEN=1 + BUILD_DOXYGEN=1 echo_info "Will build doxygen support" shift;; - --disable-deadline) - DEADLINE_SCHEDULER_FLAG_USER="False" - echo_info "Disabling the usage of deadline scheduler" - shift 1;; - --enable-deadline) - DEADLINE_SCHEDULER_FLAG_USER="True" - echo_info "Enabling the usage of deadline scheduler" + --build-coverity-scan) + BUILD_COVERITY_SCAN=1 + echo_info "Will build Coverity-Scan objects for upload" + shift;; + --disable-deadline) + DEADLINE_SCHEDULER_FLAG_USER="False" + echo_info "Disabling the usage of deadline scheduler" + shift 1;; + --enable-deadline) + DEADLINE_SCHEDULER_FLAG_USER="True" + echo_info "Enabling the usage of deadline scheduler" shift 1;; --enable-cpu-affinity) CPU_AFFINITY_FLAG_USER="True" @@ -358,23 +339,19 @@ function main() { echo_info "Disabling hardware dependency for compiling software" DISABLE_HARDWARE_DEPENDENCY="True" shift 1;; - --ue-autotest-trace) + --ue-autotest-trace) UE_AUTOTEST_TRACE="True" echo_info "Enabling autotest specific trace for UE" shift 1;; - --ue-trace) + --ue-trace) UE_DEBUG_TRACE="True" echo_info "Enabling UE trace for debug" shift 1;; - --ue-timing) + --ue-timing) UE_TIMING_TRACE="True" echo_info "Enabling UE timing trace" shift 1;; - --disable-log) - DISABLE_LOG_X="True" - echo_info "Disabling all LOG_* traces" - shift 1;; - --uhd-images-dir) + --uhd-images-dir) UHD_IMAGES_DIR=$2 echo_info "Downloading UHD images in the indicated location" shift 2;; @@ -383,30 +360,24 @@ function main() { CMAKE_CMD="$CMAKE_CMD"' -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -G"Eclipse CDT4 - Unix Makefiles"' echo_info "Enabling build eclipse project support" shift 1;; - --build-telnetsrv) - BUILD_TELNETSRV=1 - echo_info "Build embedded telnet server" - shift ;; - --build-msc) - MSC_GEN=1 - echo_info "Build MSC tracing utility" - shift ;; + --build-lib) + BUILD_OPTLIB="" + for alib in $2 ; do + for oklib in $OPTIONAL_LIBRARIES ; do + if [ "$alib" = "$oklib" ] ; then + BUILD_OPTLIB="$BUILD_OPTLIB $alib" + echo_info "Enabling build of lib${alib}.so" + fi + done + done + if [ "${BUILD_OPTLIB## }" != "$2" ] ; then + echo_fatal "Unknown optional library in $2, valid libraries are $OPTIONAL_LIBRARIES" + fi + shift 2;; --usrp-recplay) USRP_REC_PLAY="True" echo_info "Enabling USRP record playback mode" shift 1;; - --ue-nas-use-tun) - UE_NAS_USE_TUN="True" - echo_info "Enabling UE NAS TUN device usage instead of ue_ip.ko" - shift 1;; - --basic-simulator) - BASIC_SIMULATOR=1 - echo_info "Compiling the basic simulator" - shift 1;; - --rfsimulator) - RFSIMULATOR=true - echo_info "Compiling the RF simulator" - shift 1;; -h | --help) print_help exit 1;; @@ -416,7 +387,20 @@ function main() { break;; esac done - + + ######################################################### + # check if cov-build is installed + ######################################################### + if [ "$BUILD_COVERITY_SCAN" == "1" ] ; then + echo_info "Checking cov-build is installed" + IS_INSTALLED=`which cov-build | grep -c cov-build || true` + if [ $IS_INSTALLED -eq 1 ] ; then + echo_info "Found cov-build" + else + echo_fatal "Did NOT find cov-build in PATH!" + fi + fi + CMAKE_CMD="$CMAKE_CMD .." echo_info "CMAKE_CMD=$CMAKE_CMD" @@ -427,7 +411,7 @@ function main() { if [ "$eNB" = "1" -o "$gNB" = "1" ] ; then if [ "$HW" = "None" -a "$TP" = "None" ] ; then - echo_fatal "Define a local radio head (e.g. -w EXMIMO) or a transport protocol (e.g. -t ETHERNET) to communicate with a remote radio head!" + echo_info "No local radio head and no transport protocol selected" fi if [ "$HW" = "None" ] ; then echo_info "No radio head has been selected (HW set to $HW)" @@ -540,34 +524,34 @@ function main() { echo_info "3. building the compilation directives ..." DIR=$OPENAIR_DIR/cmake_targets + if [ "$NOS1" = "1" ] ; then build_dir=noS1_ran_build if [ "$gNB" = "1" ] ; then exec=nr-softmodem-nos1 - elif [ "$nrUE" = "1" ] ; then + elif [ "$nrUE" = "1" ] ; then exec=nr-uesoftmodem-nos1 - elif [ "$eNB" = "1" ] ; then - exec=lte-softmodem-nos1 - elif [ "$UE" = "1" ] ; then - exec=lte-uesoftmodem-nos1 - fi + fi else build_dir=ran_build if [ "$gNB" = "1" ] ; then exec=nr-softmodem - elif [ "$nrUE" = "1" ] ; then + elif [ "$nrUE" = "1" ] ; then exec=nr-uesoftmodem - elif [ "$eNB" = "1" ] ; then + elif [ "$eNB" = "1" ] ; then exec=lte-softmodem - elif [ "$UE" = "1" ] ; then + elif [ "$UE" = "1" ] ; then exec=lte-uesoftmodem - fi + fi fi + if [ "$T_TRACER" = "False" ] ; then - lte_build_dir=${lte_build_dir}_noLOG + noLOGDirsuffix="_noLOG" fi + lte_build_dir=lte_build_oai + bin_suffix="" - lte_build_dir="lte${noS1Dir}_build_oai${noLOGDirsuffix}" + lte_build_dir="lte_build_oai${noLOGDirsuffix}" # configuration module libraries, one currently available, using libconfig config_libconfig_shlib=params_libconfig @@ -582,33 +566,26 @@ function main() { if [ "$NOS1" = "1" ] ; then cat $DIR/$build_dir/CMakeLists.template >> $cmake_file fi - echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file - echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file - echo "set ( XFORMS $XFORMS )" >> $cmake_file - echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file -# echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file - echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file - echo "set ( UESIM_EXPANSION $UESIM_EXPANSION )" >> $cmake_file - echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file - echo "set ( NR_RRC_ASN1_VERSION \"${NR_REL}\")" >> $cmake_file - echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file - echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file - echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file - echo "set(PACKAGE_NAME \"${exec}\")" >> $cmake_file - echo "set (DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file - echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file - echo "set ( T_TRACER $T_TRACER )" >> $cmake_file - echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file - echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file - echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file - echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file - echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file - if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then - echo_info "Compiling UE S1 build : enabling Linux and NETLINK" - echo "set (LINUX True )" >> $cmake_file - echo "set (PDCP_USE_NETLINK True )" >> $cmake_file - fi - echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file + echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file + echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file + echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file +# echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file + echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file + echo "set ( UESIM_EXPANSION $UESIM_EXPANSION )" >> $cmake_file + echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file + echo "set ( NR_RRC_ASN1_VERSION \"${NR_REL}\")" >> $cmake_file + echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file + echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file + echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file + echo "set ( PACKAGE_NAME \"${exec}\")" >> $cmake_file + echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >> $cmake_file + echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >> $cmake_file + echo "set ( T_TRACER $T_TRACER )" >> $cmake_file + echo "set ( UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE )" >> $cmake_file + echo "set ( UE_DEBUG_TRACE $UE_DEBUG_TRACE )" >> $cmake_file + echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file + echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file + echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file cd $DIR/$build_dir/build eval $CMAKE_CMD fi @@ -624,44 +601,23 @@ function main() { $build_dir $config_libconfig_shlib \ lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so compilations \ - $build_dir coding \ - libcoding.so $dbin/libcoding.so - - if [ "$NOS1" = "1" ] ; then + $build_dir coding \ + libcoding.so $dbin/libcoding.so + +# optional libs (used when noS1 with kernel modules) + if [ "$NOS1" = "1" -o "$eNB" = "1" -o "$UE" = "1" ] ; then compilations \ $build_dir nasmesh \ CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko compilations \ $build_dir rb_tool \ rb_tool $dbin/rb_tool - cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin + cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin fi fi - - if [ "$UE" = 1 ] ; then - lte_exec=lte-uesoftmodem${bin_suffix} - compilations \ - $lte_build_dir $lte_exec \ - $lte_exec $dbin/$lte_exec.$REL - - # mandatory shared lib - compilations \ - $lte_build_dir $config_libconfig_shlib \ - lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so - compilations \ - $lte_build_dir coding \ - libcoding.so $dbin/libcoding.so - - if [ "$NOS1" = "1" ] ; then - compilations \ - $lte_build_dir nasmesh \ - CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko - compilations \ - $lte_build_dir rb_tool \ - rb_tool $dbin/rb_tool - cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin - else - # ue_ip driver compilation + + if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then + # ue_ip driver compilation echo_info "Compiling UE specific part" compilations \ $build_dir ue_ip \ @@ -686,8 +642,8 @@ function main() { nas_sim_tools nvram \ nvram $dbin/nvram compilations \ - nas_sim_tools conf2uedata \ - conf2uedata $dbin/conf2uedata + nas_sim_tools conf2uedata \ + conf2uedata $dbin/conf2uedata # generate USIM data if [ -f $dbin/conf2uedata ]; then @@ -700,7 +656,6 @@ function main() { echo_warning "not generated UE NAS files: binaries not found" fi fi - fi if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then cd $OPENAIR_DIR/cmake_targets/phy_simulators @@ -764,23 +719,17 @@ function main() { fi cp $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 $dbin fi - - # Telnet server compilation + + # optional libraries ##################### - if [ "$BUILD_TELNETSRV" = "1" ] ; then - compilations \ - $lte_build_dir telnetsrv \ - libtelnetsrv.so $dbin/libtelnetsrv.so - + if [ ! -z "$BUILD_OPTLIB" ] ; then + for oklib in $BUILD_OPTLIB ; do + compilations \ + $lte_build_dir $oklib \ + lib${oklib}.so $dbin/lib${oklib}.so + done fi - # msc library compilation - ##################### - if [ "$MSC_GEN" = "1" ] ; then - compilations \ - $lte_build_dir msc \ - libmsc.so $dbin/libmsc.so - fi # HWLAT compilation ##################### if [ "$HWLAT" = "1" ] ; then @@ -806,7 +755,7 @@ function main() { compilations \ lte-hwlat lte-hwlat \ lte-hwlat $dbin/lte-hwlat - + fi # HWLAT_TEST compilation @@ -835,7 +784,7 @@ function main() { lte-hwlat-test lte-hwlat-test \ lte-hwlat-test $dbin/lte-hwlat-test - fi + fi # build RF device and transport protocol libraries ##################################### @@ -849,29 +798,28 @@ function main() { # link liboai_device.so with the selected RF device library if [ "$HW" == "EXMIMO" ] ; then compilations \ - $lte_build_dir oai_exmimodevif \ - liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL + $lte_build_dir oai_exmimodevif \ + liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL ln -sf liboai_exmimodevif.so liboai_device.so ln -sf $dbin/liboai_exmimodevif.so.$REL $dbin/liboai_device.so echo_info "liboai_device.so is linked to EXMIMO device library" elif [ "$HW" == "OAI_ADRV9371_ZC706" ] ; then - SYRIQ_KVER=$(uname -r) - SYRIQ_KMAJ=$(echo $SYRIQ_KVER | sed -e 's/^\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*.*/\1/') - SYRIQ_KMIN=$(echo $SYRIQ_KVER | sed -e 's/^[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*.*/\1/') - #echo $SYRIQ_KMAJ$SYRIQ_KMIN - if [ "$SYRIQ_KMAJ$SYRIQ_KMIN" == "319" ] || [ "$SYRIQ_KMAJ$SYRIQ_KMIN" == "410" ] || [ "$SYRIQ_KMAJ$SYRIQ_KMIN" == "415" ] ; then + SYRIQ_KVER=$(uname -r) + SYRIQ_KMAJ=$(echo $SYRIQ_KVER | sed -e 's/^\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*.*/\1/') + SYRIQ_KMIN=$(echo $SYRIQ_KVER | sed -e 's/^[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*.*/\1/') + #echo $SYRIQ_KMAJ$SYRIQ_KMIN + if [ "$SYRIQ_KMAJ$SYRIQ_KMIN" == "319" ] || [ "$SYRIQ_KMAJ$SYRIQ_KMIN" == "410" ] || [ "$SYRIQ_KMAJ$SYRIQ_KMIN" == "415" ] ; then # echo "Kernel $SYRIQ_KMAJ.$SYRIQ_KMIN detected" ln -sf /usr/local/lib/syriq/libadrv9371zc706.so liboai_device.so - else + else echo_error "== FAILED == Unexpected Kernel $SYRIQ_KMAJ.$SYRIQ_KMIN" - fi - echo_info "liboai_device.so is linked to ADRV9371_ZC706 device library for Kernel $SYRIQ_KMAJ.$SYRIQ_KMIN" - + fi + echo_info "liboai_device.so is linked to ADRV9371_ZC706 device library for Kernel $SYRIQ_KMAJ.$SYRIQ_KMIN" elif [ "$HW" == "OAI_USRP" ] ; then - compilations \ - $lte_build_dir oai_usrpdevif \ + compilations \ + $build_dir oai_usrpdevif \ liboai_usrpdevif.so $dbin/liboai_usrpdevif.so.$REL ln -sf liboai_usrpdevif.so liboai_device.so @@ -880,7 +828,7 @@ function main() { elif [ "$HW" == "OAI_BLADERF" ] ; then if [ -f "/usr/include/libbladeRF.h" ] ; then compilations \ - $lte_build_dir oai_bladerfdevif \ + $lte_build_dir oai_bladerfdevif \ liboai_bladerfdevif.so $dbin/liboai_bladerfdevif.so.$REL fi @@ -980,123 +928,6 @@ function main() { echo_info "10. Bypassing the Tests ..." fi - # basic simulator - ##################### - if [ "$BASIC_SIMULATOR" = "1" ]; then - echo_info "Build basic simulator" - [ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/basic_simulator - [ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/nas_sim_tools/build - mkdir -p $OPENAIR_DIR/cmake_targets/basic_simulator - mkdir -p $OPENAIR_DIR/cmake_targets/basic_simulator/enb - mkdir -p $OPENAIR_DIR/cmake_targets/basic_simulator/ue - mkdir -p $OPENAIR_DIR/cmake_targets/nas_sim_tools/build - - # enb - - cmake_file=$OPENAIR_DIR/cmake_targets/basic_simulator/enb/CMakeLists.txt - echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file - echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file - echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file - echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file - echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file - echo "set ( XFORMS $XFORMS )" >> $cmake_file - echo "set ( RF_BOARD \"OAI_USRP\")" >> $cmake_file - echo "set ( TRANSP_PRO \"None\")" >> $cmake_file - echo "set(PACKAGE_NAME \"simulator_enb\")" >> $cmake_file - echo "set (DEADLINE_SCHEDULER \"False\" )" >> $cmake_file - echo "set (CPU_AFFINITY \"False\" )" >> $cmake_file - echo "set ( T_TRACER \"True\" )" >> $cmake_file - echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file - echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file - echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file - echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file - echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file - echo "set (BASIC_SIMULATOR \"True\" )" >> $cmake_file - echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file - - echo_info "Build eNB" - echo_info "logs are in $dlog/basic_simulator_enb.txt" - set +e - { - cd $OPENAIR_DIR/cmake_targets/basic_simulator/enb - cmake . - make -j`nproc` lte-softmodem - make -j`nproc` coding params_libconfig tcp_bridge_oai - ln -sf libtcp_bridge_oai.so liboai_device.so - cd ../.. - } > $dlog/basic_simulator_enb.txt 2>&1 - set -e - if [ -s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/lte-softmodem -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/libcoding.so -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/libparams_libconfig.so -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/libtcp_bridge_oai.so ] ; then - echo_success "eNB compiled" - check_warnings "$dlog/basic_simulator_enb.txt" - else - echo_error "eNB compilation failed" - exit 1 - fi - - # ue - - echo_info "Compile conf2uedata" - cd $OPENAIR_DIR/cmake_targets/nas_sim_tools/build - eval $CMAKE_CMD - compilations \ - nas_sim_tools conf2uedata \ - conf2uedata $dbin/conf2uedata - - cmake_file=$OPENAIR_DIR/cmake_targets/basic_simulator/ue/CMakeLists.txt - echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file - echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file - echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file - echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file - echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file - echo "set ( XFORMS $XFORMS )" >> $cmake_file - echo "set ( RF_BOARD \"OAI_USRP\")" >> $cmake_file - echo "set ( TRANSP_PRO \"None\")" >> $cmake_file - echo "set(PACKAGE_NAME \"simulator_ue\")" >> $cmake_file - echo "set (DEADLINE_SCHEDULER \"False\" )" >> $cmake_file - echo "set (CPU_AFFINITY \"False\" )" >> $cmake_file - echo "set ( T_TRACER \"True\" )" >> $cmake_file - echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file - echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file - echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file - echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file - echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file - echo "set (LINUX True )" >> $cmake_file - echo "set (PDCP_USE_NETLINK True )" >> $cmake_file - echo "set (BASIC_SIMULATOR \"True\" )" >> $cmake_file -# echo "set (UE_NAS_USE_TUN \"True\" )" >> $cmake_file - echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file - - echo_info "Build UE" - echo_info "logs are in $dlog/basic_simulator_ue.txt" - set +e - { - cd $OPENAIR_DIR/cmake_targets/basic_simulator/ue - cmake . - make -j`nproc` lte-uesoftmodem - make -j`nproc` coding params_libconfig tcp_bridge_oai - ln -sf libtcp_bridge_oai.so liboai_device.so - cd ../.. - } > $dlog/basic_simulator_ue.txt 2>&1 - set -e - if [ -s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/lte-uesoftmodem -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/libcoding.so -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/libparams_libconfig.so -a \ - -s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/libtcp_bridge_oai.so ] ; then - echo_success "UE compiled" - check_warnings "$dlog/basic_simulator_ue.txt" - else - echo_error "UE compilation failed" - exit 1 - fi - - echo_info "Generate UE SIM data" - $OPENAIR_DIR/targets/bin/conf2uedata -c $OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o $OPENAIR_DIR/cmake_targets/basic_simulator/ue - - fi } main "$@" diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index f31428478cb4803fd7161313f476e50678c800a2..3fa049ae95301a5c7a6dab1709f3d9bcfd2610a5 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -177,10 +177,15 @@ compilations() { set +e { rm -f $3 + if [ "$BUILD_COVERITY_SCAN" == "1" ]; then + COV_SCAN_PREFIX="cov-build --dir cov-int" + else + COV_SCAN_PREFIX="" + fi if [ "$VERBOSE_COMPILE" == "1" ]; then - make -j`nproc` $2 VERBOSE=$VERBOSE_COMPILE + $COV_SCAN_PREFIX make -j`nproc` $2 VERBOSE=$VERBOSE_COMPILE else - make -j`nproc` $2 + $COV_SCAN_PREFIX make -j`nproc` $2 fi } > $dlog/$2.$REL.txt 2>&1 diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c index 0083c2e66bf779924e549c1ee3506d8a721824e8..249765a46e4eeb8892b3b77b6bc5793d4d9d1a8d 100644 --- a/common/config/config_cmdline.c +++ b/common/config/config_cmdline.c @@ -41,7 +41,7 @@ int parse_stringlist(paramdef_t *cfgoptions, char *val) { char *atoken; - char *tokctx; + char *tokctx = NULL; char *tmpval=strdup(val); int numelt=0; cfgoptions->numelt=0; @@ -214,7 +214,7 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) /* first check help options, either --help, -h or --help_<section> */ if (strncmp(oneargv, "-h",2) == 0 || strncmp(oneargv, "--help",6) == 0 ) { - char *tokctx; + char *tokctx = NULL; pp=strtok_r(oneargv, "_",&tokctx); config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED; diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index abb9d0b2000deca7de5124da06500296a7c2d546..ba27c87cc183d905e4de6bdf539cc99116d90ebf 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -497,10 +497,10 @@ static inline void printMeas(char *txt, M->iterations, M->maxArray[1],M->maxArray[2], M->maxArray[3],M->maxArray[4], M->maxArray[5], M->maxArray[6],M->maxArray[7], M->maxArray[8],M->maxArray[9],M->maxArray[10]); -#if DISABLE_LOG_X - printf("%s",txt2); +#if T_TRACER + LOG_W(PHY,"%s",txt2); #else - LOG_W(PHY, "%s",txt2); + printf("%s",txt2); #endif } } diff --git a/common/utils/telnetsrv/DOC/telnetmeasur.md b/common/utils/telnetsrv/DOC/telnetmeasur.md new file mode 100644 index 0000000000000000000000000000000000000000..bafb876929a74d8d50d5130f9db1dcaea096c4a2 --- /dev/null +++ b/common/utils/telnetsrv/DOC/telnetmeasur.md @@ -0,0 +1,54 @@ +measur command can be used to get cpu usage or signal processing statistics from a running eNB instance. + + +Measurments can be displayed by groups, the list of available groups can be retrieved using the `measur show groups` command. +```bash +softmodem> measur show groups + name type +00 enb ltestats +01 enbues ltestats +02 rlc ltestats +03 phycpu cpustats +04 maccpu cpustats +05 pdcpcpu cpustats +softmodem> +``` +By default the oai softmodem doesn't compute cpu usage measurments, a specific command allows to enable them. +```bash +softmodem> measur cpustats enable +softmodem> measur show phycpu +--------------------------------- cpu (4 GHz) measurements: PHY (cpustats enabled) --------------------------------- +00 phy_proc_tx: 40.217 us; 178 | 01 phy_proc_rx: 0.000 us; 0 | +02 rx_prach: 40.123 us; 9 | 03 ofdm_mod: 0.000 us; 0 | +04 dlsch_common_and_dci: 39.311 us; 178 | 05 dlsch_ue_specific: 0.878 us; 178 | +06 dlsch_encoding: 5.667 us; 11 | 07 dlsch_modulation: 5.398 us; 11 | +08 dlsch_scrambling: 1.398 us; 11 | 09 dlsch_rate_matching: 1.367 us; 11 | +10 dlsch_turbo_encod_prep: 0.000 us; 0 | 11 dlsch_turbo_encod_segm: 0.000 us; 0 | +12 dlsch_turbo_encod: 2.408 us; 11 | 13 dlsch_turbo_encod_waiting: 0.000 us; 0 | +14 dlsch_turbo_encod_signal: 0.000 us; 0 | 15 dlsch_turbo_encod_main: 0.000 us; 0 | +16 dlsch_turbo_encod_wakeup0: 0.000 us; 0 | 17 dlsch_turbo_encod_wakeup1: 0.000 us; 0 | +18 dlsch_interleaving: 0.503 us; 11 | 19 rx_dft: 0.000 us; 0 | +20 ulsch_channel_estimation: 0.000 us; 0 | 21 ulsch_freq_offset_estimation: 0.000 us; 0 | +22 ulsch_decoding: 0.000 us; 0 | 23 ulsch_demodulation: 0.000 us; 0 | +24 ulsch_rate_unmatching: 0.000 us; 0 | 25 ulsch_turbo_decoding: 0.000 us; 0 | +26 ulsch_deinterleaving: 0.000 us; 0 | 27 ulsch_demultiplexing: 0.000 us; 0 | +softmodem> measur cpustats disable +``` + +signal processing statistics are always available. +```bash +softmodem> measur show enb +--------------------------------- eNB 0 mac stats CC 0 frame 68 --------------------------------- + total_num_bcch_pdu = 44 bcch_buffer = 17 total_bcch_buffer = 937 + bcch_mcs = 2 total_num_ccch_pdu = 0 ccch_buffer = 0 + total_ccch_buffer = 0 ccch_mcs = 0 total_num_pcch_pdu = 0 + pcch_buffer = 0 total_pcch_buffer = 0 pcch_mcs = 0 + num_dlactive_UEs = 0 available_prbs = 25 total_available_prbs = 16924 + available_ncces = 0 dlsch_bitrate = 0 dlsch_bytes_tx = 0 + dlsch_pdus_tx = 0 total_dlsch_bitrate = 0 total_dlsch_bytes_tx = 0 + total_dlsch_pdus_tx = 0 ulsch_bitrate = 0 ulsch_bytes_rx = 0 + ulsch_pdus_rx = 0 total_ulsch_bitrate = 0 total_ulsch_bytes_rx = 0 + total_ulsch_pdus_rx = 0 sched_decisions = 0 missed_deadlines = 0 +``` +[oai telnetserver home](telnetsrv.md) +[oai telnetserver usage home](telnetusage.md) diff --git a/common/utils/telnetsrv/DOC/telnetusage.md b/common/utils/telnetsrv/DOC/telnetusage.md index 03561432265076dc279e82b797f7cbf02b43512a..8326155a6a29eed3602d4e462a9885dc85d418dd 100644 --- a/common/utils/telnetsrv/DOC/telnetusage.md +++ b/common/utils/telnetsrv/DOC/telnetusage.md @@ -5,7 +5,7 @@ By default the embedded telnet server, which is implemented in a shared library, cd \<oai repository\>/openairinterface5g source oaienv cd cmake_targets - ./build_oai --build-telnetsrv + ./build_oai --build-lib telnetsrv ``` This will create the `libtelnetsrv.so` file in the `targets/bin` and `cmake_targets/lte_build_oai/build` sub directories of the oai repository. @@ -23,6 +23,7 @@ Below are examples of telnet sessions: * [using the loop command](telnetloop.md) * [loader command](telnetloader.md) * [log command](telnetlog.md) +* [measur command](telnetmeasur.md) # telnet server parameters The telnet server is using the [oai configuration module](Config/Rtusage). Telnet parameters must be specified in the `telnetsrv` section. Some parameters can be modified via the telnet telnet server command, as specified in the last column of the following table. diff --git a/configuration/bladeRF/enb-band7-5mhz.conf b/configuration/bladeRF/enb-band7-5mhz.conf index 127c8654227d8e3a40b410fa7ea246bbbe440210..df9b1cbc851de6404262957778e9551875ffa453 100644 --- a/configuration/bladeRF/enb-band7-5mhz.conf +++ b/configuration/bladeRF/enb-band7-5mhz.conf @@ -181,6 +181,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/doc/BUILD.md b/doc/BUILD.md index 1f971b7776aaccefb6dcb7507925bb29e5f74741..a2d62c31a0f14c787b87ae23cb5c9a82d25463d1 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -36,11 +36,7 @@ The oai softmodem supports many use cases, and new ones are regularly added. Mos - all simulators, with exception of PHY simulators, which are distinct executables. -Calling the `build_oai` script with the -h option gives the list of all available options, but a process to simplify and check the requirements of all these options is on-going. Check the - -[table]: BUILD.md "`build_oai` options" - -At the end of this page to know the status of `buid_oai` options which are not described hereafter. +Calling the `build_oai` script with the -h option gives the list of all available options, but a process to simplify and check the requirements of all these options is on-going. Check the [table](BUILD.md "# `build_oai` options") At the end of this page to know the status of `buid_oai` options which are not described hereafter. # Building PHY Simulators @@ -53,7 +49,7 @@ After downloading the source files, a single build command can be used to get th ``` cd <your oai installation directory>/openairinterface5g/ source oaienv -cd ../cmake_targets/ +cd cmake_targets/ ./build_oai -I -w USRP --eNB --UE ``` @@ -70,18 +66,24 @@ After completing the build, the binaries are available in the `cmake_targets/lte ## Telnet Server -The telnet server can be built with the --build-telnet option, after building the softmodem or while building it. +The telnet server can be built with the `--build-lib telnetsrv` option, after building the softmodem or while building it. -`./build_oai -I -w USRP --eNB --UE --build-telnetsrv` +`./build_oai -I -w USRP --eNB --UE --build-lib telnetsrv` or -`./build_oai --build-telnetsrv` +`./build_oai --build-lib telnetsrv` + +You can get documentation about the telnet server [here](common/utils/telnetsrv/DOC/telnetsrv.md) ## USRP record player The USRP record player today needs a specific build. Work to make it available as a run time option is under consideration +## Other optional libraries + +Using the help option of the build script you can get the list of available optional libraries. Those which haven't been mentioned above are known to need more tests and documentation + # `build_oai` options | Option | Status | Description | @@ -89,12 +91,11 @@ The USRP record player today needs a specific build. Work to make it available a | -h | maintained | get help | | -c | maintained | erase all previously built files for this target before starting the new build. | | -C | maintained, needs improvement | erase all previously built files for any target before starting the new build. | -| --verbose-compile | maintained | | +| --verbose-compile | maintained | get compilation messages, as when running `make` or `gcc` directly. | | --cflags_processor | maintained | used to pass options to the compiler | | --clean-kernel | unknown | no code in the script corresponding to this option | | --install-system-files | maintained | install oai built binaries in linux system files repositories | | -w | maintained and tested in CI for USRP device | build corresponding oai device and create the soft link to enforce this device usage at run-time | -| -t | maintained | build the specified transport library, which is used in some simulators and in non monolithic eNodeB deployments. Now of little interest as transport library build is enforced when building the eNodeB. | | --phy_simulators | maintained, tested in CI | build all PHY simulators, a set of executables allowing unitary tests of LTE channel implementation within oai. | | --core_simulators | | | | -s | | | @@ -106,24 +107,17 @@ The USRP record player today needs a specific build. Work to make it available a | --eNB | maintained and tested in CI | build `lte-softmodem` the LTE eNodeB | | --UE | maintained and tested in CI | build `lte-uesoftmodem` the LTE UE | | --usrp-recplay | maintained | build with support for the record player. Implementation will be soon reviewed to switch to a run-time option. | -| --build-telnet | maintained | build the telnet server shared library, which can then be loaded at run time via the --telnetsrv command line option. | -| --build-msc | unknown | build the msc shared library, which can then be loaded at run time via the --msc command line option. msc is a tracing utility which status is unknown. | +| --build-lib | maintained | build optional shared library(ies), which can then be loaded at run time via command line option. Use the --help option to get the list of supported optional libraries. | | --UE-conf-nvram | | | | --UE-gen-nvram | | | | -r | unknown, to be removed | specifies which 3GPP release to build for. Only the default (today rel14) is tested in CI and it is likely that future oai release will remove this option | | -V | deprecated | Used to build with support for synchronization diagram utility. This is now available via the T-Tracer and is included if T-Tracer is not disabled. | -| -x | deprecated | Used to build with support for embedded signal analyzer. This is now available via the T-Tracer and is included if T-Tracer is not disabled. | -| --noS1 | deprecated, to be removed | build noS1 version of oai softmodem binaries. noS1 allows running oai eNodeB and UE without an LTE core network (EPC). This functionality is now available via a run-time option. | | --build-doxygen | unknown | build doxygen documentation, many oai source files do not include doxygen comments | | --disable-deadline --enable-deadline --disable-cpu-affinity | deprecated | These options were used to activate or de-activate specific code depending on the choice of a specific linux scheduling mode. This has not been tested for a while and should be implemented as configuration options | | --disable-T-Tracer | maintained, to be tested | Remove T_Tracer and console LOG messages except error messages. | | --disable-hardware-dependency | | | | --ue-autotest-trace --ue-timing --ue-trace | deprecated | Were used to enable conditional code implementing debugging messages or debugging statistics. These functionalities are now either available from run-time options or not maintained. | -| --disable-log | deprecated, to be removed | Was used to disable LOG messages, replaced by `--disable-T-Tracer` build option to remove tracing code from the build or `--T-stdout 0` run time option to redirect LOG messages to T-Tracer client interface. | -| --ue-nas-use-tun | deprecated to be removed | Usage of tun in place of specific kernel modules is now a run time option. `--nokrnmod 0` option disable the default behavior which is to use tun to send or receive ip packets to/from the linux ip stack. | | --build-eclipse | unknown | | -| --basic-simulator | deprecated tested in CI | builds the basic simulator device. Now of little interest as this device build is enforced when building the eNodeB and it can be used at run time with the `--basicsim` option. More over the rf simulator is an enhanced basic simulator. | -| --rfsimulator | maintained | builds the rf simulator device. Now of little interest as this device build is enforced when building the eNodeB and it can be used at run time with the `--rfsim` option. | | | | | [oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home) diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index deb4fec994fa4544a41beee69191a360114325c1..d006e30912aa622b0c886b20a6f88de382c89c2e 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -122,6 +122,7 @@ The RRC layer is based on **3GPP 36.331** v14.3.0 and implements the following f - eMBMS for multicast and broadcast (experimental) - Handover (experimental) - Paging (soon) +- RRC inactivity timer (release of UE after a period of data inactivity) ## eNB X2AP ## diff --git a/executables/nr-ru.c b/executables/nr-ru.c index fc094193b4e8778a2c9896eb6f41b20b41f0579c..77f96b8bb0f913a17eefa46cbd4f880e9641c35b 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -2132,7 +2132,7 @@ void init_RU(char *rf_config_file) { } } - // LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],gNB_timing[ru->if_timing],ru->function); + // LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],NB_timing[ru->if_timing],ru->function); set_function_spec_param(ru); LOG_I(PHY,"Starting ru_thread %d\n",ru_id); init_RU_proc(ru); diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 8e58f552771e2bf8ef12e01ce0c28da1250ebff6..e20c0ad46746038fcc9b03c4b3fdff762de9a977 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -35,6 +35,7 @@ #include "common/ran_context.h" #include "PHY/defs_gNB.h" +#include "PHY/defs_common.h" #include "common/config/config_userapi.h" #include "common/utils/load_module_shlib.h" #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all @@ -80,25 +81,11 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "system.h" #include <openair2/GNB_APP/gnb_app.h> -#ifdef XFORMS - #include "PHY/TOOLS/nr_phy_scope.h" - #include "stats.h" -#endif +#include "PHY/TOOLS/nr_phy_scope.h" +#include "stats.h" #include "nr-softmodem.h" #include "NB_IoT_interface.h" -#ifdef XFORMS - // current status is that every UE has a DL scope for a SINGLE eNB (gnb_id=0) - // at eNB 0, an UL scope for every UE - - FD_phy_scope_gnb *form_gnb[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; - FD_stats_form *form_stats=NULL,*form_stats_l2=NULL; - char title[255]; - unsigned char scope_enb_num_ue = 2; - static pthread_t forms_thread; //xforms - -#endif //XFORMS - short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT] = {0,0,16384,16384,-16384,-16384,16384,16384,16384,-16384,-16384,16384,-16384,-16384,7327,7327,7327,21981,21981,7327,21981,21981,7327,-7327,7327,-21981,21981,-7327,21981,-21981,-7327,7327,-7327,21981,-21981,7327,-21981,21981,-7327,-7327,-7327,-21981,-21981,-7327,-21981,-21981,10726,10726,10726,3576,3576,10726,3576,3576,10726,17876,10726,25027,3576,17876,3576,25027,17876,10726,17876,3576,25027,10726,25027,3576,17876,17876,17876,25027,25027,17876,25027,25027,10726,-10726,10726,-3576,3576,-10726,3576,-3576,10726,-17876,10726,-25027,3576,-17876,3576,-25027,17876,-10726,17876,-3576,25027,-10726,25027,-3576,17876,-17876,17876,-25027,25027,-17876,25027,-25027,-10726,10726,-10726,3576,-3576,10726,-3576,3576,-10726,17876,-10726,25027,-3576,17876,-3576,25027,-17876,10726,-17876,3576,-25027,10726,-25027,3576,-17876,17876,-17876,25027,-25027,17876,-25027,25027,-10726,-10726,-10726,-3576,-3576,-10726,-3576,-3576,-10726,-17876,-10726,-25027,-3576,-17876,-3576,-25027,-17876,-10726,-17876,-3576,-25027,-10726,-25027,-3576,-17876,-17876,-17876,-25027,-25027,-17876,-25027,-25027,8886,8886,8886,12439,12439,8886,12439,12439,8886,5332,8886,1778,12439,5332,12439,1778,5332,8886,5332,12439,1778,8886,1778,12439,5332,5332,5332,1778,1778,5332,1778,1778,8886,19547,8886,15993,12439,19547,12439,15993,8886,23101,8886,26655,12439,23101,12439,26655,5332,19547,5332,15993,1778,19547,1778,15993,5332,23101,5332,26655,1778,23101,1778,26655,19547,8886,19547,12439,15993,8886,15993,12439,19547,5332,19547,1778,15993,5332,15993,1778,23101,8886,23101,12439,26655,8886,26655,12439,23101,5332,23101,1778,26655,5332,26655,1778,19547,19547,19547,15993,15993,19547,15993,15993,19547,23101,19547,26655,15993,23101,15993,26655,23101,19547,23101,15993,26655,19547,26655,15993,23101,23101,23101,26655,26655,23101,26655,26655,8886,-8886,8886,-12439,12439,-8886,12439,-12439,8886,-5332,8886,-1778,12439,-5332,12439,-1778,5332,-8886,5332,-12439,1778,-8886,1778,-12439,5332,-5332,5332,-1778,1778,-5332,1778,-1778,8886,-19547,8886,-15993,12439,-19547,12439,-15993,8886,-23101,8886,-26655,12439,-23101,12439,-26655,5332,-19547,5332,-15993,1778,-19547,1778,-15993,5332,-23101,5332,-26655,1778,-23101,1778,-26655,19547,-8886,19547,-12439,15993,-8886,15993,-12439,19547,-5332,19547,-1778,15993,-5332,15993,-1778,23101,-8886,23101,-12439,26655,-8886,26655,-12439,23101,-5332,23101,-1778,26655,-5332,26655,-1778,19547,-19547,19547,-15993,15993,-19547,15993,-15993,19547,-23101,19547,-26655,15993,-23101,15993,-26655,23101,-19547,23101,-15993,26655,-19547,26655,-15993,23101,-23101,23101,-26655,26655,-23101,26655,-26655,-8886,8886,-8886,12439,-12439,8886,-12439,12439,-8886,5332,-8886,1778,-12439,5332,-12439,1778,-5332,8886,-5332,12439,-1778,8886,-1778,12439,-5332,5332,-5332,1778,-1778,5332,-1778,1778,-8886,19547,-8886,15993,-12439,19547,-12439,15993,-8886,23101,-8886,26655,-12439,23101,-12439,26655,-5332,19547,-5332,15993,-1778,19547,-1778,15993,-5332,23101,-5332,26655,-1778,23101,-1778,26655,-19547,8886,-19547,12439,-15993,8886,-15993,12439,-19547,5332,-19547,1778,-15993,5332,-15993,1778,-23101,8886,-23101,12439,-26655,8886,-26655,12439,-23101,5332,-23101,1778,-26655,5332,-26655,1778,-19547,19547,-19547,15993,-15993,19547,-15993,15993,-19547,23101,-19547,26655,-15993,23101,-15993,26655,-23101,19547,-23101,15993,-26655,19547,-26655,15993,-23101,23101,-23101,26655,-26655,23101,-26655,26655,-8886,-8886,-8886,-12439,-12439,-8886,-12439,-12439,-8886,-5332,-8886,-1778,-12439,-5332,-12439,-1778,-5332,-8886,-5332,-12439,-1778,-8886,-1778,-12439,-5332,-5332,-5332,-1778,-1778,-5332,-1778,-1778,-8886,-19547,-8886,-15993,-12439,-19547,-12439,-15993,-8886,-23101,-8886,-26655,-12439,-23101,-12439,-26655,-5332,-19547,-5332,-15993,-1778,-19547,-1778,-15993,-5332,-23101,-5332,-26655,-1778,-23101,-1778,-26655,-19547,-8886,-19547,-12439,-15993,-8886,-15993,-12439,-19547,-5332,-19547,-1778,-15993,-5332,-15993,-1778,-23101,-8886,-23101,-12439,-26655,-8886,-26655,-12439,-23101,-5332,-23101,-1778,-26655,-5332,-26655,-1778,-19547,-19547,-19547,-15993,-15993,-19547,-15993,-15993,-19547,-23101,-19547,-26655,-15993,-23101,-15993,-26655,-23101,-19547,-23101,-15993,-26655,-19547,-26655,-15993,-23101,-23101,-23101,-26655,-26655,-23101,-26655,-26655}; @@ -121,13 +108,13 @@ volatile int oai_exit = 0; static clock_source_t clock_source = internal; static int wait_for_sync = 0; -unsigned int mmapped_dma=0; -int single_thread_flag=1; +unsigned int mmapped_dma=0; +int single_thread_flag=1; -static int8_t threequarter_fs=0; +static int8_t threequarter_fs=0; -uint32_t downlink_frequency[MAX_NUM_CCs][4]; -int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; +uint32_t downlink_frequency[MAX_NUM_CCs][4]; +int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; //Temp fix for inexisting NR upper layer unsigned char NB_gNB_INST = 1; @@ -158,9 +145,9 @@ double rx_gain_off = 0.0; double sample_rate=30.72e6; double bw = 10.0e6; -static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/; +static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/; -char rf_config_file[1024]="/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat"; +char rf_config_file[1024]="/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat"; int chain_offset=0; int phy_test = 0; @@ -175,14 +162,11 @@ uint8_t nb_antenna_rx = 1; char ref[128] = "internal"; char channels[128] = "0"; -int rx_input_level_dBm; +int rx_input_level_dBm; + +uint32_t do_forms=0; +int otg_enabled; -#ifdef XFORMS - extern int otg_enabled; - static char do_forms=0; -#else - int otg_enabled; -#endif //int number_of_cards = 1; @@ -203,10 +187,11 @@ extern void init_eNB_afterRU(void); int transmission_mode=1; int emulate_rf = 0; int numerology = 0; -char *parallel_config = NULL; -char *worker_config = NULL; +static char *parallel_config = NULL; +static char *worker_config = NULL; static THREAD_STRUCT thread_struct; + void set_parallel_conf(char *parallel_conf) { if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD; else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT; @@ -215,19 +200,18 @@ void set_parallel_conf(char *parallel_conf) { printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf); } void set_worker_conf(char *worker_conf) { - if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE; + if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE; else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE; printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf); } PARALLEL_CONF_t get_thread_parallel_conf(void) { - return thread_struct.parallel_conf; + return thread_struct.parallel_conf; } WORKER_CONF_t get_thread_worker_conf(void) { - return thread_struct.worker_conf; + return thread_struct.worker_conf; } - /* struct for ethernet specific parameters given in eNB conf file */ eth_params_t *eth_params; @@ -369,74 +353,6 @@ void exit_function(const char *file, const char *function, const int line, const exit(1); } -#ifdef XFORMS - - -void reset_stats(FL_OBJECT *button, long arg) { - PHY_VARS_gNB *phy_vars_gNB = RC.gNB[0][0]; - - for (int i=0; i<NUMBER_OF_UE_MAX; i++) { - for (int k=0; k<8; k++) { //harq_processes - /* for (j=0; j<phy_vars_gNB->dlsch[i][0]->Mlimit; j++) { - phy_vars_gNB->UE_stats[i].dlsch_NAK[k][j]=0; - phy_vars_gNB->UE_stats[i].dlsch_ACK[k][j]=0; - phy_vars_gNB->UE_stats[i].dlsch_trials[k][j]=0; - } - phy_vars_gNB->UE_stats[i].dlsch_l2_errors[k]=0; - phy_vars_gNB->UE_stats[i].ulsch_errors[k]=0; - phy_vars_gNB->UE_stats[i].ulsch_consecutive_errors=0; - phy_vars_gNB->UE_stats[i].dlsch_sliding_cnt=0; - phy_vars_gNB->UE_stats[i].dlsch_NAK_round0=0; - phy_vars_gNB->UE_stats[i].dlsch_mcs_offset=0; - */ - } - } -} - -static void *scope_thread(void *arg) { - int UE_id, CC_id; - int ue_cnt=0; -# ifdef ENABLE_XFORMS_WRITE_STATS - FILE *gNB_stats = fopen("gNB_stats.txt", "w"); -#endif - - while (!oai_exit) { - ue_cnt=0; - - for(UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { - for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - if ((ue_cnt<scope_enb_num_ue)) { - /* - //this function needs to be written - phy_scope_gNB(form_gnb[CC_id][ue_cnt], - RC.gNB[0][CC_id], - UE_id); - */ - ue_cnt++; - } - } - } - - sleep(1); - } - - // printf("%s",stats_buffer); -# ifdef ENABLE_XFORMS_WRITE_STATS - - if (eNB_stats) { - rewind (gNB_stats); - fwrite (stats_buffer, 1, len, gNB_stats); - fclose (gNB_stats); - } - -# endif - pthread_exit((void *)arg); -} -#endif - - - - #if defined(ENABLE_ITTI) void *l2l1_task(void *arg) { MessageDef *message_p = NULL; @@ -621,7 +537,7 @@ static void get_options(void) { if(parallel_config != NULL) set_parallel_conf(parallel_config); - if(worker_config != NULL) set_worker_conf(worker_config); + if(worker_config != NULL) set_worker_conf(worker_config); } @@ -942,16 +858,9 @@ static void wait_nfapi_init(char *thread_name) { printf( "NFAPI: got sync (%s)\n", thread_name); } -int main( int argc, char **argv ) { - int i; -#if defined (XFORMS) - //void *status; -#endif - int CC_id; - int ru_id; -#if defined (XFORMS) - int ret; -#endif +int main( int argc, char **argv ) +{ + int i, CC_id, ru_id; start_background_system(); ///static configuration for NR at the moment @@ -997,7 +906,7 @@ int main( int argc, char **argv ) { #endif if (opt_type != OPT_NONE) { - if (init_opt(in_path, in_ip) == -1) + if (init_opt() == -1) LOG_E(OPT,"failed to run OPT \n"); } @@ -1040,7 +949,7 @@ int main( int argc, char **argv ) { mlockall(MCL_CURRENT | MCL_FUTURE); pthread_cond_init(&sync_cond,NULL); pthread_mutex_init(&sync_mutex, NULL); -#ifdef XFORMS +/*#ifdef XFORMS int UE_id; if (do_forms==1) { @@ -1070,7 +979,7 @@ int main( int argc, char **argv ) { printf("Scope thread created, ret=%d\n",ret); } -#endif +#endif*/ usleep(10*1000); if (nfapi_mode) { @@ -1175,8 +1084,8 @@ int main( int argc, char **argv ) { printf("Terminating application - oai_exit=%d\n",oai_exit); #endif // stop threads -#ifdef XFORMS - /* +/*#ifdef XFORMS + printf("waiting for XFORMS thread\n"); if (do_forms==1) { @@ -1194,8 +1103,8 @@ int main( int argc, char **argv ) { } } } - */ -#endif + +#endif*/ printf("stopping MODEM threads\n"); // cleanup stop_gNB(NB_gNB_INST); diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h index 96774aa78e711adfc24c658459fcf0e23907a322..48ddfba20955cf2962c7263e284c201941957f8b 100644 --- a/executables/nr-softmodem.h +++ b/executables/nr-softmodem.h @@ -99,14 +99,14 @@ /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*------------------------------------------------------------------------------------------------------------------------------------------*/ #define CMDLINE_UEMODEPARAMS_DESC { \ - {"calib-ue-rx", CONFIG_HLP_CALUER, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ - {"calib-ue-rx-med", CONFIG_HLP_CALUERM, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ - {"calib-ue-rx-byp", CONFIG_HLP_CALUERB, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ - {"debug-ue-prach", CONFIG_HLP_DBGUEPR, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ - {"no-L2-connect", CONFIG_HLP_NOL2CN, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ - {"calib-prach-tx", CONFIG_HLP_CALPRACH, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ - {"loop-memory", CONFIG_HLP_UELOOP, 0, strptr:&loopfile, defstrval:"iqs.in", TYPE_STRING,0}, \ - {"ue-dump-frame", CONFIG_HLP_DUMPFRAME, PARAMFLAG_BOOL, iptr:&dumpframe, defintval:0, TYPE_INT, 0}, \ + {"calib-ue-rx", CONFIG_HLP_CALUER, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ + {"calib-ue-rx-med", CONFIG_HLP_CALUERM, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ + {"calib-ue-rx-byp", CONFIG_HLP_CALUERB, 0, iptr:&rx_input_level_dBm, defintval:0, TYPE_INT, 0}, \ + {"debug-ue-prach", CONFIG_HLP_DBGUEPR, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ + {"no-L2-connect", CONFIG_HLP_NOL2CN, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ + {"calib-prach-tx", CONFIG_HLP_CALPRACH, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ + {"loop-memory", CONFIG_HLP_UELOOP, 0, strptr:&loopfile, defstrval:"iqs.in", TYPE_STRING,0}, \ + {"ue-dump-frame", CONFIG_HLP_DUMPFRAME, PARAMFLAG_BOOL, iptr:&dumpframe, defintval:0, TYPE_INT, 0}, \ } #define CMDLINE_CALIBUERX_IDX 0 #define CMDLINE_CALIBUERXMED_IDX 1 @@ -155,7 +155,7 @@ } #define CONFIG_HLP_FLOG "Enable online log \n" -#define CONFIG_HLP_LOGL "Set the global log level, valide options: (9:trace, 8/7:debug, 6:info, 4:warn, 3:error)\n" +#define CONFIG_HLP_LOGL "Set the global log level, valid options: (9:trace, 8/7:debug, 6:info, 4:warn, 3:error)\n" #define CONFIG_HLP_LOGV "Set the global log verbosity \n" #define CONFIG_HLP_TELN "Start embedded telnet server \n" /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/executables/nr-ue.c b/executables/nr-ue.c index d6946f1ac787d7064a5a8bf6c527fde4e04539d8..a2a0bf11615e37df9fc91765a8ada1ac9d22880b 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -738,7 +738,7 @@ void *UE_thread(void *arg) { return NULL; } -void init_UE(int nb_inst) { +void init_NR_UE(int nb_inst) { int inst; NR_UE_MAC_INST_t *mac_inst; pthread_t threads[nb_inst]; diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index bafd794ed364899465d027b0f7c0e6f7c31e9d5e..64efe1597f085bac3d61587b8aa3d228e3e18ff8 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -159,10 +159,10 @@ uint8_t nb_antenna_rx = 1; char ref[128] = "internal"; char channels[128] = "0"; -char *parallel_config = NULL; -char *worker_config = NULL; - +static char *parallel_config = NULL; +static char *worker_config = NULL; static THREAD_STRUCT thread_struct; + void set_parallel_conf(char *parallel_conf) { if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD; else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT; @@ -182,20 +182,16 @@ PARALLEL_CONF_t get_thread_parallel_conf(void) { WORKER_CONF_t get_thread_worker_conf(void) { return thread_struct.worker_conf; } -int rx_input_level_dBm; +int rx_input_level_dBm; -//static int online_log_messages=0; +//static int online_log_messages=0; -#ifdef XFORMS - extern int otg_enabled; - int do_forms=0; -#else - int otg_enabled; -#endif +uint32_t do_forms=0; +int otg_enabled; //int number_of_cards = 1; -static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; -int16_t node_synch_ref[MAX_NUM_CCs]; +static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; +int16_t node_synch_ref[MAX_NUM_CCs]; uint32_t target_dl_mcs = 28; //maximum allowed mcs uint32_t target_ul_mcs = 20; @@ -423,8 +419,8 @@ static void get_options(void) { load_module_shlib("telnetsrv",NULL,0,NULL); } - paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC; - paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC; + paramdef_t cmdline_uemodeparams[] = CMDLINE_UEMODEPARAMS_DESC; + paramdef_t cmdline_ueparams[] = CMDLINE_NRUEPARAMS_DESC; config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL); @@ -676,7 +672,7 @@ int main( int argc, char **argv ) { itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); if (opt_type != OPT_NONE) { - if (init_opt(in_path, in_ip) == -1) + if (init_opt() == -1) LOG_E(OPT,"failed to run OPT \n"); } @@ -766,7 +762,7 @@ int main( int argc, char **argv ) { // wait for end of program printf("TYPE <CTRL-C> TO TERMINATE\n"); - init_UE(1); + init_NR_UE(1); while(true) sleep(3600); diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 4d45e08722efbfcb9563f0c31dad473919527a1d..168b0e4d22d11574d2a54a78c09d39cdc271325d 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -125,23 +125,23 @@ /*------------------------------------------------------------------------------------------------------------------------------------------*/ -/*--------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* command line parameters specific to UE */ -/* optname helpstr paramflags XXXptr defXXXval type numelt */ -/*--------------------------------------------------------------------------------------------------------------------------------------------------*/ -#define CMDLINE_UEPARAMS_DESC { \ - {"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ - {"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \ - {"ue-txgain", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ - {"ue-nb-ant-rx", CONFIG_HLP_UENANTR, 0, u8ptr:&nb_antenna_rx, defuintval:1, TYPE_UINT8, 0}, \ - {"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \ - {"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \ - {"ue-fo-compensation", CONFIG_HLP_UEFO, PARAMFLAG_BOOL, iptr:&UE_fo_compensation, defintval:0, TYPE_INT, 0}, \ - {"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \ - {"r" , CONFIG_HLP_PRB, 0, iptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT, 0}, \ - {"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ - {"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200", TYPE_STRING, 0}, \ - {"usrp-clksrc", CONFIG_HLP_USRP_CLK_SRC,0, strptr:(char **)&usrp_clksrc, defstrval:"internal", TYPE_STRING, 0} \ +/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* command line parameters specific to UE */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define CMDLINE_NRUEPARAMS_DESC { \ + {"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ + {"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \ + {"ue-txgain", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ + {"ue-nb-ant-rx", CONFIG_HLP_UENANTR, 0, u8ptr:&nb_antenna_rx, defuintval:1, TYPE_UINT8, 0}, \ + {"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \ + {"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \ + {"ue-fo-compensation", CONFIG_HLP_UEFO, PARAMFLAG_BOOL, iptr:&UE_fo_compensation, defintval:0, TYPE_INT, 0}, \ + {"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \ + {"r" , CONFIG_HLP_PRB, 0, iptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT, 0}, \ + {"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ + {"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200", TYPE_STRING, 0}, \ + {"usrp-clksrc", CONFIG_HLP_USRP_CLK_SRC,0, strptr:(char **)&usrp_clksrc, defstrval:"internal", TYPE_STRING, 0} \ } #define DEFAULT_DLF 2680000000 @@ -181,15 +181,15 @@ #define CONFIG_HLP_LOGL "Set the global log level, valide options: (9:trace, 8/7:debug, 6:info, 4:warn, 3:error)\n" #define CONFIG_HLP_LOGV "Set the global log verbosity \n" #define CONFIG_HLP_TELN "Start embedded telnet server \n" -/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* command line parameters for LOG utility */ -/* optname helpstr paramflags XXXptr defXXXval type numelt */ -/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/*-------------------------------------------------------------------------------------------------------------------------------*/ +/* command line parameters for LOG utility */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-------------------------------------------------------------------------------------------------------------------------------*/ #define CMDLINE_LOGPARAMS_DESC { \ - {"R" , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \ - {"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \ - {"G" , CONFIG_HLP_LOGV, 0, uptr:&glog_verbosity, defintval:0, TYPE_UINT16, 0}, \ - {"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \ + {"R" , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \ + {"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \ + {"G" , CONFIG_HLP_LOGV, 0, uptr:&glog_verbosity, defintval:0, TYPE_UINT16, 0}, \ + {"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \ } #define CMDLINE_ONLINELOG_IDX 0 #define CMDLINE_GLOGLEVEL_IDX 1 @@ -233,9 +233,9 @@ extern double cpuf; #endif // In nr-ue.c -extern int setup_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg); +extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg); extern void fill_ue_band_info(void); -extern void init_UE(int); +extern void init_NR_UE(int); extern void reset_opp_meas(void); extern void print_opp_meas(void); void *UE_thread(void *arg); diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 2e2c50d637aabfda17d48980bce6f571b073e220..64d454e6e7b39758604018e05a7b4392eb60eeb6 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -975,7 +975,7 @@ int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) dl_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!! - int retval = nfapi_vnf_p7_dl_config_req(p7_config, dl_config_req); + int retval = nfapi_vnf_p7_nr_dl_config_req(p7_config, dl_config_req); dl_config_req->dl_config_request_body.number_dci = 0; dl_config_req->dl_config_request_body.number_pdu = 0; diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h index 51f66c3075284a22ff65f9fbacce6e85108bf789..d9e88bac0d6cb80355c5b2b89d5e1010b9291445 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h @@ -19,6 +19,7 @@ #define _NFAPI_INTERFACE_H_ #include "stddef.h" +#include <stdint.h> // Constants - update based on implementation #define NFAPI_MAX_PHY_RF_INSTANCES 2 diff --git a/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h b/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h index 462901391a8cd63bfc9b25a239f8600870fdad52..525490629ac23f1d24baaa5842f3d5d29d653762 100644 --- a/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h +++ b/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h @@ -18,6 +18,7 @@ #define _NFAPI_VNF_INTERFACE_H_ #include "nfapi_interface.h" +#include "nfapi_nr_interface.h" #include "debug.h" #include "netinet/in.h" @@ -937,6 +938,7 @@ int nfapi_vnf_p7_del_pnf(nfapi_vnf_p7_config_t* config, int phy_id); * may be released after this function call has returned or at a later pointer */ int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_request_t* req); +int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_config_request_t* req); /*! Send the UL_CONFIG.request * \param config A pointer to the vnf p7 configuration diff --git a/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c index 4a85f7e4b3b9b245f5f5660e6c1a3a0dc8ce80eb..2798e04ae6d50402eee4cbf51fea2b32cae0b964 100644 --- a/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c +++ b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c @@ -482,6 +482,17 @@ int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_re return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header); } +int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_config_request_t* req) +{ + //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p req:%p)\n", __FUNCTION__, config, req); + + if(config == 0 || req == 0) + return -1; + + vnf_p7_t* vnf_p7 = (vnf_p7_t*)config; + return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header); +} + int nfapi_vnf_p7_ul_config_req(nfapi_vnf_p7_config_t* config, nfapi_ul_config_request_t* req) { if(config == 0 || req == 0) diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h index 2c37462f7525bd52f5b31483b589e857e10d373c..493b43ee74a737d4e606bf388d071b06cd84c75e 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h @@ -363,14 +363,16 @@ void updateCrcChecksum2(uint8_t **crcChecksum, static inline void nr_polar_interleaver(uint8_t *input, uint8_t *output, uint16_t *pattern, - uint16_t size) { + uint16_t size) +{ for (int i=0; i<size; i++) output[i]=input[pattern[i]]; } static inline void nr_polar_deinterleaver(uint8_t *input, uint8_t *output, uint16_t *pattern, - uint16_t size) { + uint16_t size) +{ for (int i=0; i<size; i++) output[pattern[i]]=input[i]; } diff --git a/openair1/PHY/INIT/lte_parms.c b/openair1/PHY/INIT/lte_parms.c index 03f226c6379098a05a56f92ce286db5a83a9d0bb..a41896222bc9bd15a0acad4eb9584cb27b83930d 100644 --- a/openair1/PHY/INIT/lte_parms.c +++ b/openair1/PHY/INIT/lte_parms.c @@ -22,33 +22,25 @@ #include "phy_init.h" #include "common/utils/LOG/log.h" -uint16_t dl_S_table_normal[10]={3,9,10,11,12,3,9,10,11,6}; -uint16_t dl_S_table_extended[10]={3,8,9,10,3,8,9,5,0,0}; - -void set_S_config(LTE_DL_FRAME_PARMS *fp) { +uint16_t dl_S_table_normal[10]= {3,9,10,11,12,3,9,10,11,6}; +uint16_t dl_S_table_extended[10]= {3,8,9,10,3,8,9,5,0,0}; +void set_S_config(LTE_DL_FRAME_PARMS *fp) +{ int X = fp->srsX; - fp->ul_symbols_in_S_subframe=(1+X); if ((fp->Ncp==EXTENDED) && (fp->tdd_config_S>7)) AssertFatal(1==0,"Illegal S subframe configuration for Extended Prefix mode\n"); fp->dl_symbols_in_S_subframe = (fp->Ncp==NORMAL)?dl_S_table_normal[fp->tdd_config_S] : dl_S_table_extended[fp->tdd_config_S]; - - } -int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) +int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms, + uint8_t osf) { - uint8_t log2_osf; - -#if DISABLE_LOG_X - printf("Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf); -#else LOG_I(PHY,"Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf); -#endif if (frame_parms->Ncp==EXTENDED) { frame_parms->nb_prefix_samples0=512; @@ -58,125 +50,109 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) frame_parms->nb_prefix_samples0 = 160; frame_parms->nb_prefix_samples = 144; frame_parms->symbols_per_tti = 14; - } - switch(osf) { - case 1: - log2_osf = 0; - break; + case 1: + log2_osf = 0; + break; - case 2: - log2_osf = 1; - break; + case 2: + log2_osf = 1; + break; - case 4: - log2_osf = 2; - break; + case 4: + log2_osf = 2; + break; - case 8: - log2_osf = 3; - break; + case 8: + log2_osf = 3; + break; - case 16: - log2_osf = 4; - break; + case 16: + log2_osf = 4; + break; - default: - AssertFatal(1==0,"Illegal oversampling %d\n",osf); - + default: + AssertFatal(1==0,"Illegal oversampling %d\n",osf); } switch (frame_parms->N_RB_DL) { - - case 100: - AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); - - - if (frame_parms->threequarter_fs) { + case 100: + AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + + if (frame_parms->threequarter_fs) { + frame_parms->ofdm_symbol_size = 1536; + frame_parms->samples_per_tti = 23040; + frame_parms->first_carrier_offset = 1536-600; + frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2; + frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2; + } else { + frame_parms->ofdm_symbol_size = 2048; + frame_parms->samples_per_tti = 30720; + frame_parms->first_carrier_offset = 2048-600; + } + + frame_parms->N_RBGS = 4; + frame_parms->N_RBG = 25; + break; + + case 75: + AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); frame_parms->ofdm_symbol_size = 1536; frame_parms->samples_per_tti = 23040; - frame_parms->first_carrier_offset = 1536-600; + frame_parms->first_carrier_offset = 1536-450; frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2; frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2; - - } - else { - frame_parms->ofdm_symbol_size = 2048; - frame_parms->samples_per_tti = 30720; - frame_parms->first_carrier_offset = 2048-600; - } - frame_parms->N_RBGS = 4; - frame_parms->N_RBG = 25; - break; - - case 75: - AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); - - frame_parms->ofdm_symbol_size = 1536; - frame_parms->samples_per_tti = 23040; - frame_parms->first_carrier_offset = 1536-450; - frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2; - frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2; - frame_parms->N_RBGS = 4; - frame_parms->N_RBG = 25; - break; - - case 50: - AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); - - frame_parms->ofdm_symbol_size = 1024*osf; - frame_parms->samples_per_tti = 15360*osf; - frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 300; - frame_parms->nb_prefix_samples>>=(1-log2_osf); - frame_parms->nb_prefix_samples0>>=(1-log2_osf); - frame_parms->N_RBGS = 3; - frame_parms->N_RBG = 17; - break; - - case 25: - AssertFatal(osf<=2,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); - - - frame_parms->ofdm_symbol_size = 512*osf; - - - frame_parms->samples_per_tti = 7680*osf; - frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150; - frame_parms->nb_prefix_samples>>=(2-log2_osf); - frame_parms->nb_prefix_samples0>>=(2-log2_osf); - frame_parms->N_RBGS = 2; - frame_parms->N_RBG = 13; - - break; - - case 15: - frame_parms->ofdm_symbol_size = 256*osf; - frame_parms->samples_per_tti = 3840*osf; - frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 90; - frame_parms->nb_prefix_samples>>=(3-log2_osf); - frame_parms->nb_prefix_samples0>>=(3-log2_osf); - frame_parms->N_RBGS = 2; - frame_parms->N_RBG = 8; - - break; - - case 6: - frame_parms->ofdm_symbol_size = 128*osf; - frame_parms->samples_per_tti = 1920*osf; - frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 36; - frame_parms->nb_prefix_samples>>=(4-log2_osf); - frame_parms->nb_prefix_samples0>>=(4-log2_osf); - frame_parms->N_RBGS = 1; - frame_parms->N_RBG = 6; - - break; - - default: - AssertFatal(1==0,"Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms); - - break; + frame_parms->N_RBGS = 4; + frame_parms->N_RBG = 25; + break; + + case 50: + AssertFatal(osf==1,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + frame_parms->ofdm_symbol_size = 1024*osf; + frame_parms->samples_per_tti = 15360*osf; + frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 300; + frame_parms->nb_prefix_samples>>=(1-log2_osf); + frame_parms->nb_prefix_samples0>>=(1-log2_osf); + frame_parms->N_RBGS = 3; + frame_parms->N_RBG = 17; + break; + + case 25: + AssertFatal(osf<=2,"Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + frame_parms->ofdm_symbol_size = 512*osf; + frame_parms->samples_per_tti = 7680*osf; + frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150; + frame_parms->nb_prefix_samples>>=(2-log2_osf); + frame_parms->nb_prefix_samples0>>=(2-log2_osf); + frame_parms->N_RBGS = 2; + frame_parms->N_RBG = 13; + break; + + case 15: + frame_parms->ofdm_symbol_size = 256*osf; + frame_parms->samples_per_tti = 3840*osf; + frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 90; + frame_parms->nb_prefix_samples>>=(3-log2_osf); + frame_parms->nb_prefix_samples0>>=(3-log2_osf); + frame_parms->N_RBGS = 2; + frame_parms->N_RBG = 8; + break; + + case 6: + frame_parms->ofdm_symbol_size = 128*osf; + frame_parms->samples_per_tti = 1920*osf; + frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 36; + frame_parms->nb_prefix_samples>>=(4-log2_osf); + frame_parms->nb_prefix_samples0>>=(4-log2_osf); + frame_parms->N_RBGS = 1; + frame_parms->N_RBG = 6; + break; + + default: + AssertFatal(1==0,"Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms); + break; } LOG_I(PHY,"lte_parms.c: Setting N_RB_DL to %d, ofdm_symbol_size %d\n",frame_parms->N_RB_DL, frame_parms->ofdm_symbol_size); diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index 0709cca69b409dcf94ac102535993d6cf8c1ce73..21d7602a97fe463341c84821b198d583809033c5 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -40,6 +40,7 @@ #include "SCHED/sched_eNB.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/log.h" +#include "targets/RT/USER/lte-softmodem.h" #include <syscall.h> //#define DEBUG_DLSCH_CODING @@ -57,6 +58,7 @@ uint64_t deadline, uint64_t period);*/ extern WORKER_CONF_t get_thread_worker_conf(void); +extern volatile int oai_exit; void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) { @@ -326,7 +328,6 @@ int dlsch_encoding_2threads0(te_params *tep) { } -extern int oai_exit; void *te_thread(void *param) { te_params *tep = (te_params *)param; diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c index e86b7ff37692f7663a8311a43a1897166e465fcc..defe86ef388b0e42363663e0ad45e1c00c979ab3 100644 --- a/openair1/PHY/LTE_TRANSPORT/print_stats.c +++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c @@ -31,25 +31,23 @@ */ #include "PHY/LTE_TRANSPORT/proto.h" - +#include "targets/RT/USER/lte-softmodem.h" #include "PHY/defs.h" #include "PHY/extern.h" #include "SCHED/extern.h" #ifdef OPENAIR2 -#include "openair2/LAYER2/MAC/proto.h" -#include "openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.h" + #include "openair2/LAYER2/MAC/proto.h" + #include "openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #endif extern int mac_get_rrc_status(uint8_t Mod_id,uint8_t eNB_flag,uint8_t index); -#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) + #include "common_lib.h" extern openair0_config_t openair0_cfg[]; -#endif -int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length, runmode_t mode, int input_level_dBm) -{ +int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char *buffer, int length, runmode_t mode, int input_level_dBm) { uint8_t eNB=0; uint32_t RRC_status; int len=length; @@ -60,13 +58,12 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length if ((mode == normal_txrx) || (mode == no_L2_connect)) { len += sprintf(&buffer[len], "[UE_PROC] UE %d, RNTI %x\n",ue->Mod_id, ue->pdcch_vars[0][0]->crnti); - len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE (NF %.1f dB)\n", - 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, - 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, - 10*log10(ue->measurements.rsrq[0]), - ue->measurements.n0_power_tot_dBm, - (double)ue->measurements.n0_power_tot_dBm+132.24); - + len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE (NF %.1f dB)\n", + 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, + 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, + 10*log10(ue->measurements.rsrq[0]), + ue->measurements.n0_power_tot_dBm, + (double)ue->measurements.n0_power_tot_dBm+132.24); /* len += sprintf(&buffer[len], "[UE PROC] Frame count: %d\neNB0 RSSI %d dBm/RE (%d dB, %d dB)\neNB1 RSSI %d dBm/RE (%d dB, %d dB)neNB2 RSSI %d dBm/RE (%d dB, %d dB)\nN0 %d dBm/RE, %f dBm/%dPRB (%d dB, %d dB)\n", @@ -86,31 +83,28 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ue->measurements.n0_power_dB[0], ue->measurements.n0_power_dB[1]); */ - #ifdef EXMIMO len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)\n",ue->rx_total_gain_dB, openair0_cfg[0].rxg_mode[0],(int)openair0_cfg[0].rx_gain[0]); #endif -#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB\n",ue->rx_total_gain_dB); -#endif -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) len += sprintf(&buffer[len], "[UE_PROC] Frequency offset %d Hz, estimated carrier frequency %f Hz\n",ue->common_vars.freq_offset,openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset); -#endif len += sprintf(&buffer[len], "[UE PROC] UE mode = %s (%d)\n",mode_string[ue->UE_mode[0]],ue->UE_mode[0]); len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",ue->timing_advance); + if (ue->UE_mode[0]==PUSCH) { - len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n", - ue->ulsch[0]->Po_PUSCH, - get_PL(ue->Mod_id,ue->CC_id,0), - ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH, - ue->ulsch[0]->PHR); - len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n", - get_PL(ue->Mod_id,ue->CC_id,0)+ - ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH+ - ue->dlsch[0][0][0]->g_pucch, - ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, - ue->dlsch[0][0][0]->g_pucch); + len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n", + ue->ulsch[0]->Po_PUSCH, + get_PL(ue->Mod_id,ue->CC_id,0), + ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH, + ue->ulsch[0]->PHR); + len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n", + get_PL(ue->Mod_id,ue->CC_id,0)+ + ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH+ + ue->dlsch[0][0][0]->g_pucch, + ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, + ue->dlsch[0][0][0]->g_pucch); } + //for (eNB=0;eNB<NUMBER_OF_eNB_MAX;eNB++) { for (eNB=0; eNB<1; eNB++) { len += sprintf(&buffer[len], "[UE PROC] RX spatial power eNB%d: [%d %d; %d %d] dB\n", @@ -119,7 +113,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length ue->measurements.rx_spatial_power_dB[eNB][0][1], ue->measurements.rx_spatial_power_dB[eNB][1][0], ue->measurements.rx_spatial_power_dB[eNB][1][1]); - len += sprintf(&buffer[len], "[UE PROC] RX total power eNB%d: %d dB, avg: %d dB\n",eNB,ue->measurements.rx_power_tot_dB[eNB],ue->measurements.rx_power_avg_dB[eNB]); len += sprintf(&buffer[len], "[UE PROC] RX total power lin: %d, avg: %d, RX total noise lin: %d, avg: %d\n",ue->measurements.rx_power_tot[eNB], ue->measurements.rx_power_avg[eNB], ue->measurements.n0_power_tot, ue->measurements.n0_power_avg); @@ -127,351 +120,324 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length len += sprintf(&buffer[len], "[UE PROC] Wideband CQI eNB %d: %d dB, avg: %d dB\n",eNB,ue->measurements.wideband_cqi_tot[eNB],ue->measurements.wideband_cqi_avg[eNB]); switch (ue->frame_parms.N_RB_DL) { - case 6: - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][0][0], - ue->measurements.subband_cqi_dB[eNB][0][1], - ue->measurements.subband_cqi_dB[eNB][0][2], - ue->measurements.subband_cqi_dB[eNB][0][3], - ue->measurements.subband_cqi_dB[eNB][0][4], - ue->measurements.subband_cqi_dB[eNB][0][5]); - - - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][1][0], - ue->measurements.subband_cqi_dB[eNB][1][1], - ue->measurements.subband_cqi_dB[eNB][1][2], - ue->measurements.subband_cqi_dB[eNB][1][3], - ue->measurements.subband_cqi_dB[eNB][1][4], - ue->measurements.subband_cqi_dB[eNB][1][5]); - - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][0], - ue->measurements.subband_pmi_im[eNB][0][0], - ue->measurements.subband_pmi_re[eNB][1][0], - ue->measurements.subband_pmi_im[eNB][1][0], - ue->measurements.subband_pmi_re[eNB][2][0], - ue->measurements.subband_pmi_im[eNB][2][0], - ue->measurements.subband_pmi_re[eNB][3][0], - ue->measurements.subband_pmi_im[eNB][3][0], - ue->measurements.subband_pmi_re[eNB][4][0], - ue->measurements.subband_pmi_im[eNB][4][0], - ue->measurements.subband_pmi_re[eNB][5][0], - ue->measurements.subband_pmi_im[eNB][5][0]); - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][1], - ue->measurements.subband_pmi_im[eNB][0][1], - ue->measurements.subband_pmi_re[eNB][1][1], - ue->measurements.subband_pmi_im[eNB][1][1], - ue->measurements.subband_pmi_re[eNB][2][1], - ue->measurements.subband_pmi_im[eNB][2][1], - ue->measurements.subband_pmi_re[eNB][3][1], - ue->measurements.subband_pmi_im[eNB][3][1], - ue->measurements.subband_pmi_re[eNB][4][1], - ue->measurements.subband_pmi_im[eNB][4][1], - ue->measurements.subband_pmi_re[eNB][5][1], - ue->measurements.subband_pmi_im[eNB][5][1]); - - len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d]\n", - eNB, - ue->measurements.selected_rx_antennas[eNB][0], - ue->measurements.selected_rx_antennas[eNB][1], - ue->measurements.selected_rx_antennas[eNB][2], - ue->measurements.selected_rx_antennas[eNB][3], - ue->measurements.selected_rx_antennas[eNB][4], - ue->measurements.selected_rx_antennas[eNB][5]); - - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,6))); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,6)), - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,6))); - break; - - case 25: - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][0][0], - ue->measurements.subband_cqi_dB[eNB][0][1], - ue->measurements.subband_cqi_dB[eNB][0][2], - ue->measurements.subband_cqi_dB[eNB][0][3], - ue->measurements.subband_cqi_dB[eNB][0][4], - ue->measurements.subband_cqi_dB[eNB][0][5], - ue->measurements.subband_cqi_dB[eNB][0][6]); - - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][1][0], - ue->measurements.subband_cqi_dB[eNB][1][1], - ue->measurements.subband_cqi_dB[eNB][1][2], - ue->measurements.subband_cqi_dB[eNB][1][3], - ue->measurements.subband_cqi_dB[eNB][1][4], - ue->measurements.subband_cqi_dB[eNB][1][5], - ue->measurements.subband_cqi_dB[eNB][1][6]); - - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][0], - ue->measurements.subband_pmi_im[eNB][0][0], - ue->measurements.subband_pmi_re[eNB][1][0], - ue->measurements.subband_pmi_im[eNB][1][0], - ue->measurements.subband_pmi_re[eNB][2][0], - ue->measurements.subband_pmi_im[eNB][2][0], - ue->measurements.subband_pmi_re[eNB][3][0], - ue->measurements.subband_pmi_im[eNB][3][0], - ue->measurements.subband_pmi_re[eNB][4][0], - ue->measurements.subband_pmi_im[eNB][4][0], - ue->measurements.subband_pmi_re[eNB][5][0], - ue->measurements.subband_pmi_im[eNB][5][0], - ue->measurements.subband_pmi_re[eNB][6][0], - ue->measurements.subband_pmi_im[eNB][6][0]); - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][1], - ue->measurements.subband_pmi_im[eNB][0][1], - ue->measurements.subband_pmi_re[eNB][1][1], - ue->measurements.subband_pmi_im[eNB][1][1], - ue->measurements.subband_pmi_re[eNB][2][1], - ue->measurements.subband_pmi_im[eNB][2][1], - ue->measurements.subband_pmi_re[eNB][3][1], - ue->measurements.subband_pmi_im[eNB][3][1], - ue->measurements.subband_pmi_re[eNB][4][1], - ue->measurements.subband_pmi_im[eNB][4][1], - ue->measurements.subband_pmi_re[eNB][5][1], - ue->measurements.subband_pmi_im[eNB][5][1], - ue->measurements.subband_pmi_re[eNB][6][1], - ue->measurements.subband_pmi_im[eNB][6][1]); - - len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d]\n", - eNB, - ue->measurements.selected_rx_antennas[eNB][0], - ue->measurements.selected_rx_antennas[eNB][1], - ue->measurements.selected_rx_antennas[eNB][2], - ue->measurements.selected_rx_antennas[eNB][3], - ue->measurements.selected_rx_antennas[eNB][4], - ue->measurements.selected_rx_antennas[eNB][5], - ue->measurements.selected_rx_antennas[eNB][6]); - - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,7))); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,7)), - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,7))); - break; - - case 50: - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][0][0], - ue->measurements.subband_cqi_dB[eNB][0][1], - ue->measurements.subband_cqi_dB[eNB][0][2], - ue->measurements.subband_cqi_dB[eNB][0][3], - ue->measurements.subband_cqi_dB[eNB][0][4], - ue->measurements.subband_cqi_dB[eNB][0][5], - ue->measurements.subband_cqi_dB[eNB][0][6], - ue->measurements.subband_cqi_dB[eNB][0][7], - ue->measurements.subband_cqi_dB[eNB][0][8]); - - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][1][0], - ue->measurements.subband_cqi_dB[eNB][1][1], - ue->measurements.subband_cqi_dB[eNB][1][2], - ue->measurements.subband_cqi_dB[eNB][1][3], - ue->measurements.subband_cqi_dB[eNB][1][4], - ue->measurements.subband_cqi_dB[eNB][1][5], - ue->measurements.subband_cqi_dB[eNB][1][6], - ue->measurements.subband_cqi_dB[eNB][1][7], - ue->measurements.subband_cqi_dB[eNB][1][8]); - - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][0], - ue->measurements.subband_pmi_im[eNB][0][0], - ue->measurements.subband_pmi_re[eNB][1][0], - ue->measurements.subband_pmi_im[eNB][1][0], - ue->measurements.subband_pmi_re[eNB][2][0], - ue->measurements.subband_pmi_im[eNB][2][0], - ue->measurements.subband_pmi_re[eNB][3][0], - ue->measurements.subband_pmi_im[eNB][3][0], - ue->measurements.subband_pmi_re[eNB][4][0], - ue->measurements.subband_pmi_im[eNB][4][0], - ue->measurements.subband_pmi_re[eNB][5][0], - ue->measurements.subband_pmi_im[eNB][5][0], - ue->measurements.subband_pmi_re[eNB][6][0], - ue->measurements.subband_pmi_im[eNB][6][0], - ue->measurements.subband_pmi_re[eNB][7][0], - ue->measurements.subband_pmi_im[eNB][7][0], - ue->measurements.subband_pmi_re[eNB][8][0], - ue->measurements.subband_pmi_im[eNB][8][0]); - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][1], - ue->measurements.subband_pmi_im[eNB][0][1], - ue->measurements.subband_pmi_re[eNB][1][1], - ue->measurements.subband_pmi_im[eNB][1][1], - ue->measurements.subband_pmi_re[eNB][2][1], - ue->measurements.subband_pmi_im[eNB][2][1], - ue->measurements.subband_pmi_re[eNB][3][1], - ue->measurements.subband_pmi_im[eNB][3][1], - ue->measurements.subband_pmi_re[eNB][4][1], - ue->measurements.subband_pmi_im[eNB][4][1], - ue->measurements.subband_pmi_re[eNB][5][1], - ue->measurements.subband_pmi_im[eNB][5][1], - ue->measurements.subband_pmi_re[eNB][6][1], - ue->measurements.subband_pmi_im[eNB][6][1], - ue->measurements.subband_pmi_re[eNB][7][1], - ue->measurements.subband_pmi_im[eNB][7][1], - ue->measurements.subband_pmi_re[eNB][8][1], - ue->measurements.subband_pmi_im[eNB][8][1]); - - len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d]\n", - eNB, - ue->measurements.selected_rx_antennas[eNB][0], - ue->measurements.selected_rx_antennas[eNB][1], - ue->measurements.selected_rx_antennas[eNB][2], - ue->measurements.selected_rx_antennas[eNB][3], - ue->measurements.selected_rx_antennas[eNB][4], - ue->measurements.selected_rx_antennas[eNB][5], - ue->measurements.selected_rx_antennas[eNB][6], - ue->measurements.selected_rx_antennas[eNB][7], - ue->measurements.selected_rx_antennas[eNB][8]); - - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,9))); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,9)), - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,9))); - break; - - case 100: - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][0][0], - ue->measurements.subband_cqi_dB[eNB][0][1], - ue->measurements.subband_cqi_dB[eNB][0][2], - ue->measurements.subband_cqi_dB[eNB][0][3], - ue->measurements.subband_cqi_dB[eNB][0][4], - ue->measurements.subband_cqi_dB[eNB][0][5], - ue->measurements.subband_cqi_dB[eNB][0][6], - ue->measurements.subband_cqi_dB[eNB][0][7], - ue->measurements.subband_cqi_dB[eNB][0][8], - ue->measurements.subband_cqi_dB[eNB][0][9], - ue->measurements.subband_cqi_dB[eNB][0][10], - ue->measurements.subband_cqi_dB[eNB][0][11], - ue->measurements.subband_cqi_dB[eNB][0][12]); - - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][1][0], - ue->measurements.subband_cqi_dB[eNB][1][1], - ue->measurements.subband_cqi_dB[eNB][1][2], - ue->measurements.subband_cqi_dB[eNB][1][3], - ue->measurements.subband_cqi_dB[eNB][1][4], - ue->measurements.subband_cqi_dB[eNB][1][5], - ue->measurements.subband_cqi_dB[eNB][1][6], - ue->measurements.subband_cqi_dB[eNB][1][7], - ue->measurements.subband_cqi_dB[eNB][1][8], - ue->measurements.subband_cqi_dB[eNB][1][9], - ue->measurements.subband_cqi_dB[eNB][1][10], - ue->measurements.subband_cqi_dB[eNB][1][11], - ue->measurements.subband_cqi_dB[eNB][1][12]); - - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][0], - ue->measurements.subband_pmi_im[eNB][0][0], - ue->measurements.subband_pmi_re[eNB][1][0], - ue->measurements.subband_pmi_im[eNB][1][0], - ue->measurements.subband_pmi_re[eNB][2][0], - ue->measurements.subband_pmi_im[eNB][2][0], - ue->measurements.subband_pmi_re[eNB][3][0], - ue->measurements.subband_pmi_im[eNB][3][0], - ue->measurements.subband_pmi_re[eNB][4][0], - ue->measurements.subband_pmi_im[eNB][4][0], - ue->measurements.subband_pmi_re[eNB][5][0], - ue->measurements.subband_pmi_im[eNB][5][0], - ue->measurements.subband_pmi_re[eNB][6][0], - ue->measurements.subband_pmi_im[eNB][6][0], - ue->measurements.subband_pmi_re[eNB][7][0], - ue->measurements.subband_pmi_im[eNB][7][0], - ue->measurements.subband_pmi_re[eNB][8][0], - ue->measurements.subband_pmi_im[eNB][8][0], - ue->measurements.subband_pmi_re[eNB][9][0], - ue->measurements.subband_pmi_im[eNB][9][0], - ue->measurements.subband_pmi_re[eNB][10][0], - ue->measurements.subband_pmi_im[eNB][10][0], - ue->measurements.subband_pmi_re[eNB][11][0], - ue->measurements.subband_pmi_im[eNB][11][0], - ue->measurements.subband_pmi_re[eNB][12][0], - ue->measurements.subband_pmi_im[eNB][12][0]); - - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][1], - ue->measurements.subband_pmi_im[eNB][0][1], - ue->measurements.subband_pmi_re[eNB][1][1], - ue->measurements.subband_pmi_im[eNB][1][1], - ue->measurements.subband_pmi_re[eNB][2][1], - ue->measurements.subband_pmi_im[eNB][2][1], - ue->measurements.subband_pmi_re[eNB][3][1], - ue->measurements.subband_pmi_im[eNB][3][1], - ue->measurements.subband_pmi_re[eNB][4][1], - ue->measurements.subband_pmi_im[eNB][4][1], - ue->measurements.subband_pmi_re[eNB][5][1], - ue->measurements.subband_pmi_im[eNB][5][1], - ue->measurements.subband_pmi_re[eNB][6][1], - ue->measurements.subband_pmi_im[eNB][6][1], - ue->measurements.subband_pmi_re[eNB][7][1], - ue->measurements.subband_pmi_im[eNB][7][1], - ue->measurements.subband_pmi_re[eNB][8][1], - ue->measurements.subband_pmi_im[eNB][8][1], - ue->measurements.subband_pmi_re[eNB][9][1], - ue->measurements.subband_pmi_im[eNB][9][1], - ue->measurements.subband_pmi_re[eNB][10][1], - ue->measurements.subband_pmi_im[eNB][10][1], - ue->measurements.subband_pmi_re[eNB][11][1], - ue->measurements.subband_pmi_im[eNB][11][1], - ue->measurements.subband_pmi_re[eNB][12][1], - ue->measurements.subband_pmi_im[eNB][12][1]); - - len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d %d %d %d %d]\n", - eNB, - ue->measurements.selected_rx_antennas[eNB][0], - ue->measurements.selected_rx_antennas[eNB][1], - ue->measurements.selected_rx_antennas[eNB][2], - ue->measurements.selected_rx_antennas[eNB][3], - ue->measurements.selected_rx_antennas[eNB][4], - ue->measurements.selected_rx_antennas[eNB][5], - ue->measurements.selected_rx_antennas[eNB][6], - ue->measurements.selected_rx_antennas[eNB][7], - ue->measurements.selected_rx_antennas[eNB][8], - ue->measurements.selected_rx_antennas[eNB][9], - ue->measurements.selected_rx_antennas[eNB][10], - ue->measurements.selected_rx_antennas[eNB][11], - ue->measurements.selected_rx_antennas[eNB][12]); - - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,13))); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,13)), - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,13))); - break; + case 6: + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][0][0], + ue->measurements.subband_cqi_dB[eNB][0][1], + ue->measurements.subband_cqi_dB[eNB][0][2], + ue->measurements.subband_cqi_dB[eNB][0][3], + ue->measurements.subband_cqi_dB[eNB][0][4], + ue->measurements.subband_cqi_dB[eNB][0][5]); + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][1][0], + ue->measurements.subband_cqi_dB[eNB][1][1], + ue->measurements.subband_cqi_dB[eNB][1][2], + ue->measurements.subband_cqi_dB[eNB][1][3], + ue->measurements.subband_cqi_dB[eNB][1][4], + ue->measurements.subband_cqi_dB[eNB][1][5]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][0], + ue->measurements.subband_pmi_im[eNB][0][0], + ue->measurements.subband_pmi_re[eNB][1][0], + ue->measurements.subband_pmi_im[eNB][1][0], + ue->measurements.subband_pmi_re[eNB][2][0], + ue->measurements.subband_pmi_im[eNB][2][0], + ue->measurements.subband_pmi_re[eNB][3][0], + ue->measurements.subband_pmi_im[eNB][3][0], + ue->measurements.subband_pmi_re[eNB][4][0], + ue->measurements.subband_pmi_im[eNB][4][0], + ue->measurements.subband_pmi_re[eNB][5][0], + ue->measurements.subband_pmi_im[eNB][5][0]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][1], + ue->measurements.subband_pmi_im[eNB][0][1], + ue->measurements.subband_pmi_re[eNB][1][1], + ue->measurements.subband_pmi_im[eNB][1][1], + ue->measurements.subband_pmi_re[eNB][2][1], + ue->measurements.subband_pmi_im[eNB][2][1], + ue->measurements.subband_pmi_re[eNB][3][1], + ue->measurements.subband_pmi_im[eNB][3][1], + ue->measurements.subband_pmi_re[eNB][4][1], + ue->measurements.subband_pmi_im[eNB][4][1], + ue->measurements.subband_pmi_re[eNB][5][1], + ue->measurements.subband_pmi_im[eNB][5][1]); + len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d]\n", + eNB, + ue->measurements.selected_rx_antennas[eNB][0], + ue->measurements.selected_rx_antennas[eNB][1], + ue->measurements.selected_rx_antennas[eNB][2], + ue->measurements.selected_rx_antennas[eNB][3], + ue->measurements.selected_rx_antennas[eNB][4], + ue->measurements.selected_rx_antennas[eNB][5]); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,6))); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,6)), + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,6))); + break; + + case 25: + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][0][0], + ue->measurements.subband_cqi_dB[eNB][0][1], + ue->measurements.subband_cqi_dB[eNB][0][2], + ue->measurements.subband_cqi_dB[eNB][0][3], + ue->measurements.subband_cqi_dB[eNB][0][4], + ue->measurements.subband_cqi_dB[eNB][0][5], + ue->measurements.subband_cqi_dB[eNB][0][6]); + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][1][0], + ue->measurements.subband_cqi_dB[eNB][1][1], + ue->measurements.subband_cqi_dB[eNB][1][2], + ue->measurements.subband_cqi_dB[eNB][1][3], + ue->measurements.subband_cqi_dB[eNB][1][4], + ue->measurements.subband_cqi_dB[eNB][1][5], + ue->measurements.subband_cqi_dB[eNB][1][6]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][0], + ue->measurements.subband_pmi_im[eNB][0][0], + ue->measurements.subband_pmi_re[eNB][1][0], + ue->measurements.subband_pmi_im[eNB][1][0], + ue->measurements.subband_pmi_re[eNB][2][0], + ue->measurements.subband_pmi_im[eNB][2][0], + ue->measurements.subband_pmi_re[eNB][3][0], + ue->measurements.subband_pmi_im[eNB][3][0], + ue->measurements.subband_pmi_re[eNB][4][0], + ue->measurements.subband_pmi_im[eNB][4][0], + ue->measurements.subband_pmi_re[eNB][5][0], + ue->measurements.subband_pmi_im[eNB][5][0], + ue->measurements.subband_pmi_re[eNB][6][0], + ue->measurements.subband_pmi_im[eNB][6][0]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][1], + ue->measurements.subband_pmi_im[eNB][0][1], + ue->measurements.subband_pmi_re[eNB][1][1], + ue->measurements.subband_pmi_im[eNB][1][1], + ue->measurements.subband_pmi_re[eNB][2][1], + ue->measurements.subband_pmi_im[eNB][2][1], + ue->measurements.subband_pmi_re[eNB][3][1], + ue->measurements.subband_pmi_im[eNB][3][1], + ue->measurements.subband_pmi_re[eNB][4][1], + ue->measurements.subband_pmi_im[eNB][4][1], + ue->measurements.subband_pmi_re[eNB][5][1], + ue->measurements.subband_pmi_im[eNB][5][1], + ue->measurements.subband_pmi_re[eNB][6][1], + ue->measurements.subband_pmi_im[eNB][6][1]); + len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d]\n", + eNB, + ue->measurements.selected_rx_antennas[eNB][0], + ue->measurements.selected_rx_antennas[eNB][1], + ue->measurements.selected_rx_antennas[eNB][2], + ue->measurements.selected_rx_antennas[eNB][3], + ue->measurements.selected_rx_antennas[eNB][4], + ue->measurements.selected_rx_antennas[eNB][5], + ue->measurements.selected_rx_antennas[eNB][6]); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,7))); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,7)), + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,7))); + break; + + case 50: + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][0][0], + ue->measurements.subband_cqi_dB[eNB][0][1], + ue->measurements.subband_cqi_dB[eNB][0][2], + ue->measurements.subband_cqi_dB[eNB][0][3], + ue->measurements.subband_cqi_dB[eNB][0][4], + ue->measurements.subband_cqi_dB[eNB][0][5], + ue->measurements.subband_cqi_dB[eNB][0][6], + ue->measurements.subband_cqi_dB[eNB][0][7], + ue->measurements.subband_cqi_dB[eNB][0][8]); + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][1][0], + ue->measurements.subband_cqi_dB[eNB][1][1], + ue->measurements.subband_cqi_dB[eNB][1][2], + ue->measurements.subband_cqi_dB[eNB][1][3], + ue->measurements.subband_cqi_dB[eNB][1][4], + ue->measurements.subband_cqi_dB[eNB][1][5], + ue->measurements.subband_cqi_dB[eNB][1][6], + ue->measurements.subband_cqi_dB[eNB][1][7], + ue->measurements.subband_cqi_dB[eNB][1][8]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][0], + ue->measurements.subband_pmi_im[eNB][0][0], + ue->measurements.subband_pmi_re[eNB][1][0], + ue->measurements.subband_pmi_im[eNB][1][0], + ue->measurements.subband_pmi_re[eNB][2][0], + ue->measurements.subband_pmi_im[eNB][2][0], + ue->measurements.subband_pmi_re[eNB][3][0], + ue->measurements.subband_pmi_im[eNB][3][0], + ue->measurements.subband_pmi_re[eNB][4][0], + ue->measurements.subband_pmi_im[eNB][4][0], + ue->measurements.subband_pmi_re[eNB][5][0], + ue->measurements.subband_pmi_im[eNB][5][0], + ue->measurements.subband_pmi_re[eNB][6][0], + ue->measurements.subband_pmi_im[eNB][6][0], + ue->measurements.subband_pmi_re[eNB][7][0], + ue->measurements.subband_pmi_im[eNB][7][0], + ue->measurements.subband_pmi_re[eNB][8][0], + ue->measurements.subband_pmi_im[eNB][8][0]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][1], + ue->measurements.subband_pmi_im[eNB][0][1], + ue->measurements.subband_pmi_re[eNB][1][1], + ue->measurements.subband_pmi_im[eNB][1][1], + ue->measurements.subband_pmi_re[eNB][2][1], + ue->measurements.subband_pmi_im[eNB][2][1], + ue->measurements.subband_pmi_re[eNB][3][1], + ue->measurements.subband_pmi_im[eNB][3][1], + ue->measurements.subband_pmi_re[eNB][4][1], + ue->measurements.subband_pmi_im[eNB][4][1], + ue->measurements.subband_pmi_re[eNB][5][1], + ue->measurements.subband_pmi_im[eNB][5][1], + ue->measurements.subband_pmi_re[eNB][6][1], + ue->measurements.subband_pmi_im[eNB][6][1], + ue->measurements.subband_pmi_re[eNB][7][1], + ue->measurements.subband_pmi_im[eNB][7][1], + ue->measurements.subband_pmi_re[eNB][8][1], + ue->measurements.subband_pmi_im[eNB][8][1]); + len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d]\n", + eNB, + ue->measurements.selected_rx_antennas[eNB][0], + ue->measurements.selected_rx_antennas[eNB][1], + ue->measurements.selected_rx_antennas[eNB][2], + ue->measurements.selected_rx_antennas[eNB][3], + ue->measurements.selected_rx_antennas[eNB][4], + ue->measurements.selected_rx_antennas[eNB][5], + ue->measurements.selected_rx_antennas[eNB][6], + ue->measurements.selected_rx_antennas[eNB][7], + ue->measurements.selected_rx_antennas[eNB][8]); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,9))); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,9)), + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,9))); + break; + + case 100: + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][0][0], + ue->measurements.subband_cqi_dB[eNB][0][1], + ue->measurements.subband_cqi_dB[eNB][0][2], + ue->measurements.subband_cqi_dB[eNB][0][3], + ue->measurements.subband_cqi_dB[eNB][0][4], + ue->measurements.subband_cqi_dB[eNB][0][5], + ue->measurements.subband_cqi_dB[eNB][0][6], + ue->measurements.subband_cqi_dB[eNB][0][7], + ue->measurements.subband_cqi_dB[eNB][0][8], + ue->measurements.subband_cqi_dB[eNB][0][9], + ue->measurements.subband_cqi_dB[eNB][0][10], + ue->measurements.subband_cqi_dB[eNB][0][11], + ue->measurements.subband_cqi_dB[eNB][0][12]); + len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n", + eNB, + ue->measurements.subband_cqi_dB[eNB][1][0], + ue->measurements.subband_cqi_dB[eNB][1][1], + ue->measurements.subband_cqi_dB[eNB][1][2], + ue->measurements.subband_cqi_dB[eNB][1][3], + ue->measurements.subband_cqi_dB[eNB][1][4], + ue->measurements.subband_cqi_dB[eNB][1][5], + ue->measurements.subband_cqi_dB[eNB][1][6], + ue->measurements.subband_cqi_dB[eNB][1][7], + ue->measurements.subband_cqi_dB[eNB][1][8], + ue->measurements.subband_cqi_dB[eNB][1][9], + ue->measurements.subband_cqi_dB[eNB][1][10], + ue->measurements.subband_cqi_dB[eNB][1][11], + ue->measurements.subband_cqi_dB[eNB][1][12]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][0], + ue->measurements.subband_pmi_im[eNB][0][0], + ue->measurements.subband_pmi_re[eNB][1][0], + ue->measurements.subband_pmi_im[eNB][1][0], + ue->measurements.subband_pmi_re[eNB][2][0], + ue->measurements.subband_pmi_im[eNB][2][0], + ue->measurements.subband_pmi_re[eNB][3][0], + ue->measurements.subband_pmi_im[eNB][3][0], + ue->measurements.subband_pmi_re[eNB][4][0], + ue->measurements.subband_pmi_im[eNB][4][0], + ue->measurements.subband_pmi_re[eNB][5][0], + ue->measurements.subband_pmi_im[eNB][5][0], + ue->measurements.subband_pmi_re[eNB][6][0], + ue->measurements.subband_pmi_im[eNB][6][0], + ue->measurements.subband_pmi_re[eNB][7][0], + ue->measurements.subband_pmi_im[eNB][7][0], + ue->measurements.subband_pmi_re[eNB][8][0], + ue->measurements.subband_pmi_im[eNB][8][0], + ue->measurements.subband_pmi_re[eNB][9][0], + ue->measurements.subband_pmi_im[eNB][9][0], + ue->measurements.subband_pmi_re[eNB][10][0], + ue->measurements.subband_pmi_im[eNB][10][0], + ue->measurements.subband_pmi_re[eNB][11][0], + ue->measurements.subband_pmi_im[eNB][11][0], + ue->measurements.subband_pmi_re[eNB][12][0], + ue->measurements.subband_pmi_im[eNB][12][0]); + len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", + eNB, + ue->measurements.subband_pmi_re[eNB][0][1], + ue->measurements.subband_pmi_im[eNB][0][1], + ue->measurements.subband_pmi_re[eNB][1][1], + ue->measurements.subband_pmi_im[eNB][1][1], + ue->measurements.subband_pmi_re[eNB][2][1], + ue->measurements.subband_pmi_im[eNB][2][1], + ue->measurements.subband_pmi_re[eNB][3][1], + ue->measurements.subband_pmi_im[eNB][3][1], + ue->measurements.subband_pmi_re[eNB][4][1], + ue->measurements.subband_pmi_im[eNB][4][1], + ue->measurements.subband_pmi_re[eNB][5][1], + ue->measurements.subband_pmi_im[eNB][5][1], + ue->measurements.subband_pmi_re[eNB][6][1], + ue->measurements.subband_pmi_im[eNB][6][1], + ue->measurements.subband_pmi_re[eNB][7][1], + ue->measurements.subband_pmi_im[eNB][7][1], + ue->measurements.subband_pmi_re[eNB][8][1], + ue->measurements.subband_pmi_im[eNB][8][1], + ue->measurements.subband_pmi_re[eNB][9][1], + ue->measurements.subband_pmi_im[eNB][9][1], + ue->measurements.subband_pmi_re[eNB][10][1], + ue->measurements.subband_pmi_im[eNB][10][1], + ue->measurements.subband_pmi_re[eNB][11][1], + ue->measurements.subband_pmi_im[eNB][11][1], + ue->measurements.subband_pmi_re[eNB][12][1], + ue->measurements.subband_pmi_im[eNB][12][1]); + len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d %d %d %d %d]\n", + eNB, + ue->measurements.selected_rx_antennas[eNB][0], + ue->measurements.selected_rx_antennas[eNB][1], + ue->measurements.selected_rx_antennas[eNB][2], + ue->measurements.selected_rx_antennas[eNB][3], + ue->measurements.selected_rx_antennas[eNB][4], + ue->measurements.selected_rx_antennas[eNB][5], + ue->measurements.selected_rx_antennas[eNB][6], + ue->measurements.selected_rx_antennas[eNB][7], + ue->measurements.selected_rx_antennas[eNB][8], + ue->measurements.selected_rx_antennas[eNB][9], + ue->measurements.selected_rx_antennas[eNB][10], + ue->measurements.selected_rx_antennas[eNB][11], + ue->measurements.selected_rx_antennas[eNB][12]); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,13))); + len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,13)), + pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,13))); + break; } #ifdef OPENAIR2 RRC_status = mac_UE_get_rrc_status(ue->Mod_id, 0); len += sprintf(&buffer[len],"[UE PROC] RRC status = %d\n",RRC_status); #endif - - len += sprintf(&buffer[len], "[UE PROC] Transmission Mode %d \n",ue->transmission_mode[eNB]); len += sprintf(&buffer[len], "[UE PROC] PBCH err conseq %d, PBCH error total %d, PBCH FER %d\n", ue->pbch_vars[eNB]->pdu_errors_conseq, @@ -481,27 +447,31 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length if (ue->transmission_mode[eNB] == 6) len += sprintf(&buffer[len], "[UE PROC] Mode 6 Wideband CQI eNB %d : %d dB\n",eNB,ue->measurements.precoded_cqi_dB[eNB][0]); - for (harq_pid=0;harq_pid<8;harq_pid++) { - len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 0 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][0]->harq_processes[harq_pid]->mcs); - for (round=0;round<8;round++) - len+=sprintf(&buffer[len],"%d/%d ", - ue->dlsch[0][0][0]->harq_processes[harq_pid]->errors[round], - ue->dlsch[0][0][0]->harq_processes[harq_pid]->trials[round]); - len+=sprintf(&buffer[len],"\n"); + for (harq_pid=0; harq_pid<8; harq_pid++) { + len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 0 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][0]->harq_processes[harq_pid]->mcs); + + for (round=0; round<8; round++) + len+=sprintf(&buffer[len],"%d/%d ", + ue->dlsch[0][0][0]->harq_processes[harq_pid]->errors[round], + ue->dlsch[0][0][0]->harq_processes[harq_pid]->trials[round]); + + len+=sprintf(&buffer[len],"\n"); } + if (ue->dlsch[0][0] && ue->dlsch[0][0][0] && ue->dlsch[0][0][1]) { len += sprintf(&buffer[len], "[UE PROC] Saved PMI for DLSCH eNB %d : %jx (%p)\n",eNB,pmi2hex_2Ar1(ue->dlsch[0][0][0]->pmi_alloc),ue->dlsch[0][0][0]); - len += sprintf(&buffer[len], "[UE PROC] eNB %d: dl_power_off = %d\n",eNB,ue->dlsch[0][0][0]->harq_processes[0]->dl_power_off); - for (harq_pid=0;harq_pid<8;harq_pid++) { - len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 1 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][1]->harq_processes[0]->mcs); - for (round=0;round<8;round++) - len+=sprintf(&buffer[len],"%d/%d ", - ue->dlsch[0][0][1]->harq_processes[harq_pid]->errors[round], - ue->dlsch[0][0][1]->harq_processes[harq_pid]->trials[round]); - len+=sprintf(&buffer[len],"\n"); - } + for (harq_pid=0; harq_pid<8; harq_pid++) { + len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 1 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][1]->harq_processes[0]->mcs); + + for (round=0; round<8; round++) + len+=sprintf(&buffer[len],"%d/%d ", + ue->dlsch[0][0][1]->harq_processes[harq_pid]->errors[round], + ue->dlsch[0][0][1]->harq_processes[harq_pid]->trials[round]); + + len+=sprintf(&buffer[len],"\n"); + } } len += sprintf(&buffer[len], "[UE PROC] DLSCH Total %d, Error %d, FER %d\n",ue->dlsch_received[0],ue->dlsch_errors[0],ue->dlsch_fer[0]); @@ -522,9 +492,7 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length len += sprintf(&buffer[len], "[UE PROC] DLSCH Bitrate %dkbps\n",(ue->bitrate[0]/1000)); len += sprintf(&buffer[len], "[UE PROC] Total Received Bits %dkbits\n",(ue->total_received_bits[0]/1000)); len += sprintf(&buffer[len], "[UE PROC] IA receiver %d\n",ue->use_ia_receiver); - } - } else { len += sprintf(&buffer[len], "[UE PROC] Frame count: %d, RSSI %3.2f dB (%d dB, %d dB), N0 %3.2f dB (%d dB, %d dB)\n", proc->frame_rx, @@ -546,7 +514,6 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length } len += sprintf(&buffer[len],"EOF\n"); - return len; } // is_clusterhead @@ -582,121 +549,121 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length) eNB->measurements.n0_power_dB[1]); len += sprintf(&buffer[len],"PRB I0 (%X.%X.%X.%X): ", - eNB->rb_mask_ul[0], - eNB->rb_mask_ul[1],eNB->rb_mask_ul[2],eNB->rb_mask_ul[3]); + eNB->rb_mask_ul[0], + eNB->rb_mask_ul[1],eNB->rb_mask_ul[2],eNB->rb_mask_ul[3]); for (i=0; i<eNB->frame_parms.N_RB_UL; i++) { len += sprintf(&buffer[len],"%4d ", eNB->measurements.n0_subband_power_tot_dBm[i]); - if ((i>0) && ((i%25) == 0)) - len += sprintf(&buffer[len],"\n"); + if ((i>0) && ((i%25) == 0)) + len += sprintf(&buffer[len],"\n"); } len += sprintf(&buffer[len],"\n"); len += sprintf(&buffer[len],"\nPERFORMANCE PARAMETERS\n"); for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { if (eNB && - (eNB->dlsch!=NULL) && - (eNB->dlsch[(uint8_t)UE_id]!=NULL) && - (eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&& - (eNB->UE_stats[UE_id].mode == PUSCH)) { + (eNB->dlsch!=NULL) && + (eNB->dlsch[(uint8_t)UE_id]!=NULL) && + (eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&& + (eNB->UE_stats[UE_id].mode == PUSCH)) { eNB->total_dlsch_bitrate = eNB->UE_stats[UE_id].dlsch_bitrate + eNB->total_dlsch_bitrate; eNB->total_transmitted_bits = eNB->UE_stats[UE_id].total_TBS + eNB->total_transmitted_bits; //eNB->total_system_throughput = eNB->UE_stats[UE_id].total_transmitted_bits + eNB->total_system_throughput; - - for (i=0; i<8; i++) - success = success + (eNB->UE_stats[UE_id].dlsch_trials[i][0] - eNB->UE_stats[UE_id].dlsch_l2_errors[i]); - - - - len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),proc->frame_tx+1); - len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(eNB->total_dlsch_bitrate/1000)); - len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,proc->frame_tx+1); - //len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->FULL_MUMIMO_transmissions,eNB->check_for_total_transmissions); - //len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_MUMIMO_transmissions,eNB->check_for_total_transmissions); - //len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_SUMIMO_transmissions,eNB->check_for_total_transmissions); - - len += sprintf(&buffer[len],"UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm, PUCCH1 Thres %d dBm \n", - UE_id, - eNB->UE_stats[UE_id].crnti, - dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[0]), - dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[1]), - eNB->UE_stats[UE_id].UL_rssi[0], - eNB->UE_stats[UE_id].UL_rssi[1], - dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, - eNB->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, - dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_below/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, - dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_above/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, - PUCCH1_THRES+eNB->measurements.n0_power_tot_dBm-dB_fixed(eNB->frame_parms.N_RB_UL)); - - len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ", - eNB->dlsch[(uint8_t)UE_id][0]->harq_processes[0]->mcs, - eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->mcs, - eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->nb_rb, - eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->delta_TF); - - len += sprintf(&buffer[len],"Wideband CQI: (%d,%d) dB\n", - eNB->measurements.wideband_cqi_dB[UE_id][0], - eNB->measurements.wideband_cqi_dB[UE_id][1]); - - len += sprintf(&buffer[len],"DL TM %d, DL_cqi %d, DL_pmi_single %jx ", - eNB->transmission_mode[UE_id], - eNB->UE_stats[UE_id].DL_cqi[0], - pmi2hex_2Ar1(eNB->UE_stats[UE_id].DL_pmi_single)); - - len += sprintf(&buffer[len],"Timing advance %d samples (%d 16Ts), update %d ", - eNB->UE_stats[UE_id].UE_timing_offset, - eNB->UE_stats[UE_id].UE_timing_offset>>2, - eNB->UE_stats[UE_id].timing_advance_update); - - len += sprintf(&buffer[len],"Mode = %s(%d) ", - mode_string[eNB->UE_stats[UE_id].mode], - eNB->UE_stats[UE_id].mode); - UE_id_mac = find_UE_id(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti); - - if (UE_id_mac != -1) { - RRC_status = mac_eNB_get_rrc_status(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti); - len += sprintf(&buffer[len],"UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status); - } else - len += sprintf(&buffer[len],"UE_id_mac = -1\n"); - + + for (i=0; i<8; i++) + success = success + (eNB->UE_stats[UE_id].dlsch_trials[i][0] - eNB->UE_stats[UE_id].dlsch_l2_errors[i]); + + + + len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),proc->frame_tx+1); + len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(eNB->total_dlsch_bitrate/1000)); + len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,proc->frame_tx+1); + //len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->FULL_MUMIMO_transmissions,eNB->check_for_total_transmissions); + //len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_MUMIMO_transmissions,eNB->check_for_total_transmissions); + //len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_SUMIMO_transmissions,eNB->check_for_total_transmissions); + + len += sprintf(&buffer[len],"UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm, PUCCH1 Thres %d dBm \n", + UE_id, + eNB->UE_stats[UE_id].crnti, + dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[0]), + dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[1]), + eNB->UE_stats[UE_id].UL_rssi[0], + eNB->UE_stats[UE_id].UL_rssi[1], + dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, + eNB->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, + dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_below/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, + dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_above/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, + PUCCH1_THRES+eNB->measurements.n0_power_tot_dBm-dB_fixed(eNB->frame_parms.N_RB_UL)); + + len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ", + eNB->dlsch[(uint8_t)UE_id][0]->harq_processes[0]->mcs, + eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->mcs, + eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->nb_rb, + eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->delta_TF); + + len += sprintf(&buffer[len],"Wideband CQI: (%d,%d) dB\n", + eNB->measurements.wideband_cqi_dB[UE_id][0], + eNB->measurements.wideband_cqi_dB[UE_id][1]); + + len += sprintf(&buffer[len],"DL TM %d, DL_cqi %d, DL_pmi_single %jx ", + eNB->transmission_mode[UE_id], + eNB->UE_stats[UE_id].DL_cqi[0], + pmi2hex_2Ar1(eNB->UE_stats[UE_id].DL_pmi_single)); + + len += sprintf(&buffer[len],"Timing advance %d samples (%d 16Ts), update %d ", + eNB->UE_stats[UE_id].UE_timing_offset, + eNB->UE_stats[UE_id].UE_timing_offset>>2, + eNB->UE_stats[UE_id].timing_advance_update); + + len += sprintf(&buffer[len],"Mode = %s(%d) ", + mode_string[eNB->UE_stats[UE_id].mode], + eNB->UE_stats[UE_id].mode); + UE_id_mac = find_UE_id(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti); + + if (UE_id_mac != -1) { + RRC_status = mac_eNB_get_rrc_status(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti); + len += sprintf(&buffer[len],"UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status); + } else + len += sprintf(&buffer[len],"UE_id_mac = -1\n"); + len += sprintf(&buffer[len],"SR received/total: %d/%d (diff %d)\n", eNB->UE_stats[UE_id].sr_received, eNB->UE_stats[UE_id].sr_total, eNB->UE_stats[UE_id].sr_total-eNB->UE_stats[UE_id].sr_received); - - len += sprintf(&buffer[len],"DL Subband CQI: "); - - int nb_sb; - switch (eNB->frame_parms.N_RB_DL) { - case 6: - nb_sb=0; - break; - case 15: - nb_sb = 4; - case 25: - nb_sb = 7; - break; - case 50: - nb_sb = 9; - break; - case 75: - nb_sb = 10; - break; - case 100: - nb_sb = 13; - break; - default: - nb_sb=0; - break; - } - for (i=0; i<nb_sb; i++) - len += sprintf(&buffer[len],"%2d ", - eNB->UE_stats[UE_id].DL_subband_cqi[0][i]); - len += sprintf(&buffer[len],"\n"); - + + len += sprintf(&buffer[len],"DL Subband CQI: "); + + int nb_sb; + switch (eNB->frame_parms.N_RB_DL) { + case 6: + nb_sb=0; + break; + case 15: + nb_sb = 4; + case 25: + nb_sb = 7; + break; + case 50: + nb_sb = 9; + break; + case 75: + nb_sb = 10; + break; + case 100: + nb_sb = 13; + break; + default: + nb_sb=0; + break; + } + for (i=0; i<nb_sb; i++) + len += sprintf(&buffer[len],"%2d ", + eNB->UE_stats[UE_id].DL_subband_cqi[0][i]); + len += sprintf(&buffer[len],"\n"); + ulsch_errors = 0; @@ -722,9 +689,9 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length) eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][2], eNB->UE_stats[UE_id].ulsch_round_errors[i][3], eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][3]); - if ((i&1) == 1) - len += sprintf(&buffer[len],"\n"); - + if ((i&1) == 1) + len += sprintf(&buffer[len],"\n"); + ulsch_errors+=eNB->UE_stats[UE_id].ulsch_errors[i]; for (j=0; j<4; j++) { @@ -767,8 +734,8 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length) eNB->UE_stats[UE_id].dlsch_ACK[i][3], eNB->UE_stats[UE_id].dlsch_NAK[i][3], eNB->UE_stats[UE_id].dlsch_trials[i][3]); - if ((i&1) == 1) - len += sprintf(&buffer[len],"\n"); + if ((i&1) == 1) + len += sprintf(&buffer[len],"\n"); dlsch_errors+=eNB->UE_stats[UE_id].dlsch_l2_errors[i]; @@ -790,15 +757,15 @@ int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length) len += sprintf(&buffer[len],"DLSCH total bits from MAC: %dkbit ",(eNB->UE_stats[UE_id].total_TBS_MAC)/1000); len += sprintf(&buffer[len],"DLSCH total bits ack'ed: %dkbit ",(eNB->UE_stats[UE_id].total_TBS)/1000); len += sprintf(&buffer[len],"DLSCH Average throughput (100 frames): %dkbps\n",(eNB->UE_stats[UE_id].dlsch_bitrate/1000)); - // len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",eNB->transmission_mode[UE_id]); + // len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",eNB->transmission_mode[UE_id]); } } len += sprintf(&buffer[len],"\n"); } - + len += sprintf(&buffer[len],"EOF\n"); - + return len; } */ diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 6d16c5fb0e78379bdbed21c20724f2c85ea78466..f758b217c6d14de0458583bf6265d67ffb231cc7 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -30,6 +30,7 @@ * \warning */ +//#define DEBUG_ULSCH_DECODING #include <syscall.h> #include "PHY/defs_eNB.h" @@ -39,12 +40,13 @@ #include "LAYER2/MAC/mac.h" #include "RRC/LTE/rrc_extern.h" #include "PHY_INTERFACE/phy_interface.h" - -#include "common/utils/LOG/vcd_signal_dumper.h" -//#define DEBUG_ULSCH_DECODING #include "transport_proto.h" +#include "common/utils/LOG/vcd_signal_dumper.h" + extern WORKER_CONF_t get_thread_worker_conf(void); +extern volatile int oai_exit; + void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) { int i,r; @@ -351,7 +353,7 @@ int ulsch_decoding_data_2thread0(td_params *tdp) { return(ret); } -extern int oai_exit; + void *td_thread(void *param) { PHY_VARS_eNB *eNB = ((td_params *)param)->eNB; L1_proc_t *proc = &eNB->proc; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c index aafd579899ad023de7cbc7e0c843b75bab09215d..9573f66f79b9c8b77b5c989b9140c96bdc00a45e 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -62,14 +62,6 @@ int16_t dlsch_demod_shift = 0; int16_t interf_unaw_shift = 13; -//#define DEBUG_HARQ - -//#define DEBUG_PHY 1 -//#define DEBUG_DLSCH_DEMOD 1 - -//#define DISABLE_LOG_X - -// [MCS][i_mod (0,1,2) = (2,4,6)] unsigned char offset_mumimo_llr_drange_fix=0; //inferference-free case unsigned char interf_unaw_shift_tm4_mcs[29]= {5, 3, 4, 3, 3, 2, 1, 1, 2, 0, 1, 1, 1, 1, 0, 0, @@ -379,14 +371,9 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot, - symbol,ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot,symbol, ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #endif -#endif #if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif @@ -412,13 +399,7 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif -#endif -#if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif @@ -527,15 +508,8 @@ int rx_pdsch(PHY_VARS_UE *ue, #endif #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag, - ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag, ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif -#endif -#if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif @@ -758,16 +732,8 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,proc->channel_level, - ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh, ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif -#endif - // MRC -#if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif @@ -840,13 +806,7 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif -#endif -#if UE_TIMING_TRACE start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif //printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol); @@ -1210,11 +1170,7 @@ int rx_pdsch(PHY_VARS_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#else LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); -#endif #endif // Please keep it: useful for debugging #if 0 @@ -1224,7 +1180,7 @@ int rx_pdsch(PHY_VARS_UE *ue, if(1) { #if 1 - LOG_M("rxdataF0.m" , "rxdataF0", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); + LOG_M("rxdataF0.m", "rxdataF0", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); //LOG_M("rxdataF1.m" , "rxdataF1", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1); LOG_M("dl_ch_estimates00.m", "dl_ch_estimates00", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1); //LOG_M("dl_ch_estimates01.m", "dl_ch_estimates01", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][1][0],14*frame_parms->ofdm_symbol_size,1,1); @@ -4767,8 +4723,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, dl_ch0+=12; rxF+=12; - } - else { // Odd number of RBs + } else { // Odd number of RBs for (rb=0; rb<frame_parms->N_RB_DL>>1; rb++) { #ifdef DEBUG_DLSCH_DEMOD printf("dlch_ext %u\n",dl_ch0_ext-&dl_ch_estimates_ext[aarx][0]); @@ -5811,8 +5766,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, dl_ch0+=12; rxF+=12; - } - else { // Odd number of RBs + } else { // Odd number of RBs for (rb=0; rb<frame_parms->N_RB_DL>>1; rb++) { skip_half=0; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c index 594a10da9539cc7ce68f248ff2f3961c6d88895d..2e90556125ef7ba0bc412277afa3eafdcbdc23fa 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c @@ -31,6 +31,7 @@ */ #include "PHY/types.h" #include "PHY/defs_UE.h" +#include "targets/RT/USER/lte-softmodem.h" #include "PHY/phy_extern_ue.h" #include "SCHED_UE/sched_UE.h" #include "transport_proto_ue.h" @@ -45,63 +46,57 @@ extern openair0_config_t openair0_cfg[]; //#define DEBUG_INITIAL_SYNCH -int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) -{ - +int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { uint8_t l,pbch_decoded,frame_mod4,pbch_tx_ant,dummy; LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; char phich_resource[6]; -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id, + LOG_D(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id, ue->rx_offset); -#endif for (l=0; l<frame_parms->symbols_per_tti/2; l++) { - slot_fep(ue, - l, - 0, - ue->rx_offset, - 0, - 1); + l, + 0, + ue->rx_offset, + 0, + 1); } - for (l=0; l<frame_parms->symbols_per_tti/2; l++) { + for (l=0; l<frame_parms->symbols_per_tti/2; l++) { slot_fep(ue, - l, - 1, - ue->rx_offset, - 0, - 1); + l, + 1, + ue->rx_offset, + 0, + 1); } - slot_fep(ue, - 0, - 2, - ue->rx_offset, - 0, - 1); + slot_fep(ue, + 0, + 2, + ue->rx_offset, + 0, + 1); lte_ue_measurements(ue, - ue->rx_offset, - 0, + ue->rx_offset, + 0, + 0, 0, - 0, 0); - if (ue->frame_parms.frame_type == TDD) { ue_rrc_measurements(ue, - 2, - 0); - } - else { + 2, + 0); + } else { ue_rrc_measurements(ue, - 0, - 0); + 0, + 0); } -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"[UE %d] RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n", + + + LOG_D(PHY,"[UE %d] RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n", ue->Mod_id, ue->measurements.rx_rssi_dBm[0] - ((ue->frame_parms.nb_antennas_rx==2) ? 3 : 0), ue->measurements.rx_power_dB[0][0], @@ -112,7 +107,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) ue->measurements.rx_power_avg[0], ue->rx_total_gain_dB); - LOG_I(PHY,"[UE %d] N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n", + LOG_D(PHY,"[UE %d] N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n", ue->Mod_id, ue->measurements.n0_power_tot_dBm, ue->measurements.n0_power_dB[0], @@ -121,7 +116,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) ue->measurements.n0_power[1], ue->measurements.n0_power_avg_dB, ue->measurements.n0_power_avg); -#endif pbch_decoded = 0; @@ -153,96 +147,87 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) } } - if (pbch_decoded) { - frame_parms->nb_antenna_ports_eNB = pbch_tx_ant; - // set initial transmission mode to 1 or 2 depending on number of detected TX antennas // openair_daq_vars.dlsch_transmission_mode = (pbch_tx_ant>1) ? 2 : 1; - - // flip byte endian on 24-bits for MIB // dummy = ue->pbch_vars[0]->decoded_output[0]; // ue->pbch_vars[0]->decoded_output[0] = ue->pbch_vars[0]->decoded_output[2]; // ue->pbch_vars[0]->decoded_output[2] = dummy; - // now check for Bandwidth of Cell dummy = (ue->pbch_vars[0]->decoded_output[2]>>5)&7; switch (dummy) { - - case 0 : - frame_parms->N_RB_DL = 6; - break; - - case 1 : - frame_parms->N_RB_DL = 15; - break; - - case 2 : - frame_parms->N_RB_DL = 25; - break; - - case 3 : - frame_parms->N_RB_DL = 50; - break; - - case 4 : - frame_parms->N_RB_DL = 75; - break; - - case 5: - frame_parms->N_RB_DL = 100; - break; - - default: - LOG_E(PHY,"[UE%d] Initial sync: PBCH decoding: Unknown N_RB_DL\n",ue->Mod_id); - return -1; - break; + case 0 : + frame_parms->N_RB_DL = 6; + break; + + case 1 : + frame_parms->N_RB_DL = 15; + break; + + case 2 : + frame_parms->N_RB_DL = 25; + break; + + case 3 : + frame_parms->N_RB_DL = 50; + break; + + case 4 : + frame_parms->N_RB_DL = 75; + break; + + case 5: + frame_parms->N_RB_DL = 100; + break; + + default: + LOG_E(PHY,"[UE%d] Initial sync: PBCH decoding: Unknown N_RB_DL\n",ue->Mod_id); + return -1; + break; } - // now check for PHICH parameters frame_parms->phich_config_common.phich_duration = (PHICH_DURATION_t)((ue->pbch_vars[0]->decoded_output[2]>>4)&1); dummy = (ue->pbch_vars[0]->decoded_output[2]>>2)&3; switch (dummy) { - case 0: - frame_parms->phich_config_common.phich_resource = oneSixth; - sprintf(phich_resource,"1/6"); - break; - - case 1: - frame_parms->phich_config_common.phich_resource = half; - sprintf(phich_resource,"1/2"); - break; - - case 2: - frame_parms->phich_config_common.phich_resource = one; - sprintf(phich_resource,"1"); - break; - - case 3: - frame_parms->phich_config_common.phich_resource = two; - sprintf(phich_resource,"2"); - break; + case 0: + frame_parms->phich_config_common.phich_resource = oneSixth; + sprintf(phich_resource,"1/6"); + break; + + case 1: + frame_parms->phich_config_common.phich_resource = half; + sprintf(phich_resource,"1/2"); + break; + + case 2: + frame_parms->phich_config_common.phich_resource = one; + sprintf(phich_resource,"1"); + break; + + case 3: + frame_parms->phich_config_common.phich_resource = two; + sprintf(phich_resource,"2"); + break; + + default: + LOG_E(PHY,"[UE%d] Initial sync: Unknown PHICH_DURATION\n",ue->Mod_id); + return -1; + break; + } - default: - LOG_E(PHY,"[UE%d] Initial sync: Unknown PHICH_DURATION\n",ue->Mod_id); - return -1; - break; + for(int i=0; i<RX_NB_TH; i++) { + ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; + ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; + ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx; } - for(int i=0; i<RX_NB_TH;i++) - { - ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; - ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2; - ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx; - } -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"[UE%d] Initial sync: pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!\n", + LOG_D(PHY,"[UE%d] Initial sync: pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!\n", ue->Mod_id, frame_parms->nb_antenna_ports_eNB, pbch_tx_ant, @@ -250,21 +235,17 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) frame_parms->N_RB_DL, frame_parms->phich_config_common.phich_duration, phich_resource); //frame_parms->phich_config_common.phich_resource); -#endif return(0); } else { return(-1); } - } char phich_string[13][4] = {"","1/6","","1/2","","","one","","","","","","two"}; char duplex_string[2][4] = {"FDD","TDD"}; char prefix_string[2][9] = {"NORMAL","EXTENDED"}; -int initial_sync(PHY_VARS_UE *ue, runmode_t mode) -{ - +int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { int32_t sync_pos,sync_pos2,sync_pos_slot; int32_t metric_fdd_ncp=0,metric_fdd_ecp=0,metric_tdd_ncp=0,metric_tdd_ecp=0; uint8_t phase_fdd_ncp,phase_fdd_ecp,phase_tdd_ncp,phase_tdd_ecp; @@ -273,15 +254,10 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; int ret=-1; int aarx,rx_power=0; - /*#ifdef OAI_USRP - __m128i *rxdata128; - #endif*/ - // LOG_I(PHY,"**************************************************************\n"); // First try FDD normal prefix frame_parms->Ncp=NORMAL; frame_parms->frame_type=FDD; frame_parms->nb_antenna_ports_eNB = 2; - init_frame_parms(frame_parms,1); /* LOG_M("rxdata0.m","rxd0",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); @@ -298,12 +274,10 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) else sync_pos2 = sync_pos + FRAME_LENGTH_COMPLEX_SAMPLES - frame_parms->nb_prefix_samples; -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id); -#endif - // SSS detection + LOG_D(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id); + // SSS detection // PSS is hypothesized in last symbol of first slot in Frame sync_pos_slot = (frame_parms->samples_per_tti>>1) - frame_parms->ofdm_symbol_size - frame_parms->nb_prefix_samples; @@ -314,9 +288,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) if (((sync_pos2 - sync_pos_slot) >=0 ) && ((sync_pos2 - sync_pos_slot) < ((FRAME_LENGTH_COMPLEX_SAMPLES-frame_parms->samples_per_tti/2)))) { -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"Calling sss detection (FDD normal CP)\n"); -#endif + LOG_D(PHY,"Calling sss detection (FDD normal CP)\n"); rx_sss(ue,&metric_fdd_ncp,&flip_fdd_ncp,&phase_fdd_ncp); frame_parms->nushift = frame_parms->Nid_cell%6; @@ -328,19 +300,14 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) ret = pbch_detection(ue,mode); // LOG_M("rxdata2.m","rxd2",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", + LOG_D(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", + frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret); -#endif } else { -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"FDD Normal prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot); -#endif + LOG_D(PHY,"FDD Normal prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot); } - if (ret==-1) { - // Now FDD extended prefix frame_parms->Ncp=EXTENDED; frame_parms->frame_type=FDD; @@ -363,7 +330,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) if (((sync_pos2 - sync_pos_slot) >=0 ) && ((sync_pos2 - sync_pos_slot) < ((FRAME_LENGTH_COMPLEX_SAMPLES-frame_parms->samples_per_tti/2)))) { - rx_sss(ue,&metric_fdd_ecp,&flip_fdd_ecp,&phase_fdd_ecp); frame_parms->nushift = frame_parms->Nid_cell%6; @@ -374,14 +340,10 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); // LOG_M("rxdata3.m","rxd3",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"FDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", + LOG_D(PHY,"FDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret); -#endif } else { -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"FDD Extended prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot); -#endif + LOG_D(PHY,"FDD Extended prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot); } if (ret==-1) { @@ -414,21 +376,19 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) frame_parms->nushift = frame_parms->Nid_cell%6; init_frame_parms(&ue->frame_parms,1); - lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); // LOG_M("rxdata4.m","rxd4",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", + LOG_D(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", + frame_parms->Nid_cell,metric_tdd_ncp,phase_tdd_ncp,flip_tdd_ncp,ret); -#endif if (ret==-1) { // Now TDD extended prefix frame_parms->Ncp=EXTENDED; frame_parms->frame_type=TDD; - frame_parms->tdd_config=1; + frame_parms->tdd_config=1; init_frame_parms(frame_parms,1); sync_pos2 = sync_pos - frame_parms->nb_prefix_samples; @@ -454,134 +414,77 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) init_frame_parms(&ue->frame_parms,1); lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); ret = pbch_detection(ue,mode); + // LOG_M("rxdata5.m","rxd5",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); + + LOG_D(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", - // LOG_M("rxdata5.m","rxd5",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", frame_parms->Nid_cell,metric_tdd_ecp,phase_tdd_ecp,flip_tdd_ecp,ret); -#endif } } } /* Consider this is a false detection if the offset is > 1000 Hz */ - if( (abs(ue->common_vars.freq_offset) > 150) && (ret == 0) ) - { - ret=-1; -#if DISABLE_LOG_X - printf("Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); -#else - LOG_E(HW, "Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); -#endif + if( (abs(ue->common_vars.freq_offset) > 150) && (ret == 0) ) { + ret=-1; + LOG_E(HW, "Ignore MIB with high freq offset [%d Hz] estimation \n",ue->common_vars.freq_offset); } if (ret==0) { // PBCH found so indicate sync to higher layers and configure frame parameters - - //#ifdef DEBUG_INITIAL_SYNCH -#if DISABLE_LOG_X - printf("[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); -#else LOG_I(PHY, "[UE%d] In synch, rx_offset %d samples\n",ue->Mod_id, ue->rx_offset); -#endif - //#endif if (ue->UE_scan_carrier == 0) { - - #if UE_AUTOTEST_TRACE +#if UE_AUTOTEST_TRACE LOG_I(PHY,"[UE %d] AUTOTEST Cell Sync : frame = %d, rx_offset %d, freq_offset %d \n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - ue->rx_offset, - ue->common_vars.freq_offset ); - #endif - -// send sync status to higher layers later when timing offset converge to target timing - + ue->Mod_id, + ue->proc.proc_rxtx[0].frame_rx, + ue->rx_offset, + ue->common_vars.freq_offset ); +#endif + // send sync status to higher layers later when timing offset converge to target timing generate_pcfich_reg_mapping(frame_parms); generate_phich_reg_mapping(frame_parms); - - ue->pbch_vars[0]->pdu_errors_conseq=0; - } -#if DISABLE_LOG_X - printf("[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, - 10*log10(ue->measurements.rssi), - ue->rx_total_gain_dB, - ue->measurements.n0_power_tot_dBm, - 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, - (10*log10(ue->measurements.rsrq[0]))); - - - printf("[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - duplex_string[ue->frame_parms.frame_type], - prefix_string[ue->frame_parms.Ncp], - ue->frame_parms.Nid_cell, - ue->frame_parms.N_RB_DL, - ue->frame_parms.phich_config_common.phich_duration, - phich_string[ue->frame_parms.phich_config_common.phich_resource], - ue->frame_parms.nb_antenna_ports_eNB); -#else LOG_I(PHY, "[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, - 10*log10(ue->measurements.rssi), - ue->rx_total_gain_dB, - ue->measurements.n0_power_tot_dBm, - 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, - (10*log10(ue->measurements.rsrq[0]))); - + ue->proc.proc_rxtx[0].frame_rx, + 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, + 10*log10(ue->measurements.rssi), + ue->rx_total_gain_dB, + ue->measurements.n0_power_tot_dBm, + 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, + (10*log10(ue->measurements.rsrq[0]))); LOG_I(PHY, "[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - duplex_string[ue->frame_parms.frame_type], - prefix_string[ue->frame_parms.Ncp], - ue->frame_parms.Nid_cell, - ue->frame_parms.N_RB_DL, - ue->frame_parms.phich_config_common.phich_duration, - phich_string[ue->frame_parms.phich_config_common.phich_resource], - ue->frame_parms.nb_antenna_ports_eNB); -#endif - -#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) -# if DISABLE_LOG_X - printf("[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, - ue->common_vars.freq_offset); -# else + ue->Mod_id, + ue->proc.proc_rxtx[0].frame_rx, + duplex_string[ue->frame_parms.frame_type], + prefix_string[ue->frame_parms.Ncp], + ue->frame_parms.Nid_cell, + ue->frame_parms.N_RB_DL, + ue->frame_parms.phich_config_common.phich_duration, + phich_string[ue->frame_parms.phich_config_common.phich_resource], + ue->frame_parms.nb_antenna_ports_eNB); LOG_I(PHY, "[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, - ue->common_vars.freq_offset); -# endif -#endif + ue->Mod_id, + ue->proc.proc_rxtx[0].frame_rx, + openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, + ue->common_vars.freq_offset); } else { -#ifdef DEBUG_INITIAL_SYNC - LOG_I(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id); - LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id); + LOG_D(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id); + LOG_D(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id); /* LOG_I(PHY,"[UE%d] Initial sync: (metric fdd_ncp %d (%d), metric fdd_ecp %d (%d), metric_tdd_ncp %d (%d), metric_tdd_ecp %d (%d))\n", ue->Mod_id, metric_fdd_ncp,Nid_cell_fdd_ncp, metric_fdd_ecp,Nid_cell_fdd_ecp, metric_tdd_ncp,Nid_cell_tdd_ncp, metric_tdd_ecp,Nid_cell_tdd_ecp);*/ - LOG_I(PHY,"[UE%d] Initial sync : Estimated Nid_cell %d, Frame_type %d\n",ue->Mod_id, + LOG_D(PHY,"[UE%d] Initial sync : Estimated Nid_cell %d, Frame_type %d\n",ue->Mod_id, frame_parms->Nid_cell,frame_parms->frame_type); -#endif ue->UE_mode[0] = NOT_SYNCHED; ue->pbch_vars[0]->pdu_errors_last=ue->pbch_vars[0]->pdu_errors; ue->pbch_vars[0]->pdu_errors++; ue->pbch_vars[0]->pdu_errors_conseq++; - } // gain control @@ -591,50 +494,27 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) // do a measurement on the best guess of the PSS for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) rx_power += signal_energy(&ue->common_vars.rxdata[aarx][sync_pos2], - frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples); + frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples); /* // do a measurement on the full frame for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) rx_power += signal_energy(&ue->common_vars.rxdata[aarx][0], - frame_parms->samples_per_tti*10); + frame_parms->samples_per_tti*10); */ - // we might add a low-pass filter here later ue->measurements.rx_power_avg[0] = rx_power/frame_parms->nb_antennas_rx; - ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]); -#ifdef DEBUG_INITIAL_SYNCH - LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] ); -#endif - -#ifndef OAI_USRP -#ifndef OAI_BLADERF -#ifndef OAI_LMSSDR -#ifndef OAI_ADRV9371_ZC706 - phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); -#endif -#endif -#endif -#endif - - } - else { - -#ifndef OAI_USRP -#ifndef OAI_BLADERF -#ifndef OAI_LMSSDR -#ifndef OAI_ADRV9371_ZC706 - phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); -#endif -#endif -#endif -#endif + LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] ); + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) + phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); + } else { + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) + phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); } - // exit_fun("debug exit"); return ret; } diff --git a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c index 481d0bcaf8510623a8c6c7712d960ab0335a83ee..8139c496aef3cfeb33ae137beb514d0b9a8f8d82 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c @@ -31,6 +31,7 @@ */ #include "PHY/sse_intrin.h" #include "PHY/defs_UE.h" +#include "targets/RT/USER/lte-softmodem.h" #include "PHY/phy_extern_ue.h" //#include "prach.h" #include "PHY/LTE_TRANSPORT/if4_tools.h" @@ -43,9 +44,7 @@ //#define PRACH_DEBUG 1 -int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint16_t Nf ) -{ - +int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint16_t Nf ) { lte_frame_type_t frame_type = ue->frame_parms.frame_type; //uint8_t tdd_config = ue->frame_parms.tdd_config; uint16_t rootSequenceIndex = ue->frame_parms.prach_config_common.rootSequenceIndex; @@ -67,7 +66,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 uint16_t preamble_offset,preamble_shift; uint16_t preamble_index0,n_shift_ra,n_shift_ra_bar; uint16_t d_start,numshift; - uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type); //uint8_t Nsp=2; //uint8_t f_ra,t1_ra; @@ -82,50 +80,46 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 int i, prach_len; uint16_t first_nonzero_root_idx=0; -#if defined(EXMIMO) || defined(OAI_USRP) - prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset); + if ( !(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) { + prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset); #ifdef PRACH_DEBUG LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id, - prach_start, - ue->rx_offset, - ue->hw_timing_advance, - ue->N_TA_offset); + prach_start, + ue->rx_offset, + ue->hw_timing_advance, + ue->N_TA_offset); #endif - if (prach_start<0) - prach_start+=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); - - if (prach_start>=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) - prach_start-=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); - -#else //normal case (simulation) - prach_start = subframe*ue->frame_parms.samples_per_tti-ue->N_TA_offset; - LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id, - prach_start, - ue->rx_offset, - ue->hw_timing_advance, - ue->N_TA_offset); - -#endif + if (prach_start<0) + prach_start+=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); + if (prach_start>=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) + prach_start-=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); + } else { //normal case (simulation) + prach_start = subframe*ue->frame_parms.samples_per_tti-ue->N_TA_offset; + LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id, + prach_start, + ue->rx_offset, + ue->hw_timing_advance, + ue->N_TA_offset); + } // First compute physical root sequence if (restricted_set == 0) { AssertFatal(Ncs_config <= 15, - "[PHY] FATAL, Illegal Ncs_config for unrestricted format %"PRIu8"\n", Ncs_config ); + "[PHY] FATAL, Illegal Ncs_config for unrestricted format %"PRIu8"\n", Ncs_config ); NCS = NCS_unrestricted[Ncs_config]; } else { AssertFatal(Ncs_config <= 14, - "[PHY] FATAL, Illegal Ncs_config for restricted format %"PRIu8"\n", Ncs_config ); + "[PHY] FATAL, Illegal Ncs_config for restricted format %"PRIu8"\n", Ncs_config ); NCS = NCS_restricted[Ncs_config]; } n_ra_prb = get_prach_prb_offset(&(ue->frame_parms), - ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, - ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset, - tdd_mapindex, Nf); + ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, + ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset, + tdd_mapindex, Nf); prach_root_sequence_map = (prach_fmt<4) ? prach_root_sequence_map0_3 : prach_root_sequence_map4; - /* // this code is not part of get_prach_prb_offset if (frame_type == TDD) { // TDD @@ -157,7 +151,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 } } */ - // This is the relative offset (for unrestricted case) in the root sequence table (5.7.2-4 from 36.211) for the given preamble index preamble_offset = ((NCS==0)? preamble_index : (preamble_index/(N_ZC/NCS))); @@ -166,11 +159,9 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 preamble_shift = (NCS==0)? 0 : (preamble_index % (N_ZC/NCS)); preamble_shift *= NCS; } else { // This is the high-speed case - #ifdef PRACH_DEBUG LOG_I(PHY,"[UE %d] High-speed mode, NCS_config %d\n",ue->Mod_id,Ncs_config); #endif - not_found = 1; preamble_index0 = preamble_index; // set preamble_offset to initial rootSequenceIndex and look if we need more root sequences for this @@ -190,7 +181,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 } u = prach_root_sequence_map[index]; - uint16_t n_group_ra = 0; if ( (du[u]<(N_ZC/3)) && (du[u]>=NCS) ) { @@ -217,7 +207,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 if (preamble_index0 < numshift) { not_found = 0; preamble_shift = (d_start * (preamble_index0/n_shift_ra)) + ((preamble_index0%n_shift_ra)*NCS); - } else { // skip to next rootSequenceIndex and recompute parameters preamble_offset++; preamble_index0 -= numshift; @@ -234,10 +223,8 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 preamble_offset,preamble_shift); #endif - // nsymb = (frame_parms->Ncp==0) ? 14:12; // subframe_offset = (unsigned int)frame_parms->ofdm_symbol_size*subframe*nsymb; - k = (12*n_ra_prb) - 6*ue->frame_parms.N_RB_UL; if (k<0) @@ -245,9 +232,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 k*=12; k+=13; - - Xu = (int16_t*)ue->X_u[preamble_offset-first_nonzero_root_idx]; - + Xu = (int16_t *)ue->X_u[preamble_offset-first_nonzero_root_idx]; /* k+=(12*ue->frame_parms.first_carrier_offset); if (k>(12*ue->frame_parms.ofdm_symbol_size)) @@ -256,36 +241,36 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 k*=2; switch (ue->frame_parms.N_RB_UL) { - case 6: - memset((void*)prachF,0,4*1536); - break; - - case 15: - memset((void*)prachF,0,4*3072); - break; - - case 25: - memset((void*)prachF,0,4*6144); - break; - - case 50: - memset((void*)prachF,0,4*12288); - break; - - case 75: - memset((void*)prachF,0,4*18432); - break; - - case 100: - if (ue->frame_parms.threequarter_fs == 0) - memset((void*)prachF,0,4*24576); - else - memset((void*)prachF,0,4*18432); - break; + case 6: + memset((void *)prachF,0,4*1536); + break; + + case 15: + memset((void *)prachF,0,4*3072); + break; + + case 25: + memset((void *)prachF,0,4*6144); + break; + + case 50: + memset((void *)prachF,0,4*12288); + break; + + case 75: + memset((void *)prachF,0,4*18432); + break; + + case 100: + if (ue->frame_parms.threequarter_fs == 0) + memset((void *)prachF,0,4*24576); + else + memset((void *)prachF,0,4*18432); + + break; } for (offset=0,offset2=0; offset<N_ZC; offset++,offset2+=preamble_shift) { - if (offset2 >= N_ZC) offset2 -= N_ZC; @@ -299,49 +284,49 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 } switch (prach_fmt) { - case 0: - Ncp = 3168; - break; - - case 1: - case 3: - Ncp = 21024; - break; - - case 2: - Ncp = 6240; - break; - - case 4: - Ncp = 448; - break; - - default: - Ncp = 3168; - break; + case 0: + Ncp = 3168; + break; + + case 1: + case 3: + Ncp = 21024; + break; + + case 2: + Ncp = 6240; + break; + + case 4: + Ncp = 448; + break; + + default: + Ncp = 3168; + break; } switch (ue->frame_parms.N_RB_UL) { - case 6: - Ncp>>=4; - prach+=4; // makes prach2 aligned to 128-bit - break; - - case 15: - Ncp>>=3; - break; - - case 25: - Ncp>>=2; - break; - - case 50: - Ncp>>=1; - break; - - case 75: - Ncp=(Ncp*3)>>2; - break; + case 6: + Ncp>>=4; + prach+=4; // makes prach2 aligned to 128-bit + break; + + case 15: + Ncp>>=3; + break; + + case 25: + Ncp>>=2; + break; + + case 50: + Ncp>>=1; + break; + + case 75: + Ncp=(Ncp*3)>>2; + break; } if (ue->frame_parms.threequarter_fs == 1) @@ -351,186 +336,184 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 // do IDFT switch (ue->frame_parms.N_RB_UL) { - case 6: - if (prach_fmt == 4) { - idft256(prachF,prach2,1); - memmove( prach, prach+512, Ncp<<2 ); - prach_len = 256+Ncp; - } else { - idft1536(prachF,prach2,1); - memmove( prach, prach+3072, Ncp<<2 ); - prach_len = 1536+Ncp; - - if (prach_fmt>1) { - memmove( prach2+3072, prach2, 6144 ); - prach_len = 2*1536+Ncp; - } - } - - break; - - case 15: - if (prach_fmt == 4) { - idft512(prachF,prach2,1); - //TODO: account for repeated format in dft output - memmove( prach, prach+1024, Ncp<<2 ); - prach_len = 512+Ncp; - } else { - idft3072(prachF,prach2,1); - memmove( prach, prach+6144, Ncp<<2 ); - prach_len = 3072+Ncp; - - if (prach_fmt>1) { - memmove( prach2+6144, prach2, 12288 ); - prach_len = 2*3072+Ncp; + case 6: + if (prach_fmt == 4) { + idft256(prachF,prach2,1); + memmove( prach, prach+512, Ncp<<2 ); + prach_len = 256+Ncp; + } else { + idft1536(prachF,prach2,1); + memmove( prach, prach+3072, Ncp<<2 ); + prach_len = 1536+Ncp; + + if (prach_fmt>1) { + memmove( prach2+3072, prach2, 6144 ); + prach_len = 2*1536+Ncp; + } } - } - break; + break; - case 25: - default: - if (prach_fmt == 4) { - idft1024(prachF,prach2,1); - memmove( prach, prach+2048, Ncp<<2 ); - prach_len = 1024+Ncp; - } else { - idft6144(prachF,prach2,1); - /*for (i=0;i<6144*2;i++) - prach2[i]<<=1;*/ - memmove( prach, prach+12288, Ncp<<2 ); - prach_len = 6144+Ncp; - - if (prach_fmt>1) { - memmove( prach2+12288, prach2, 24576 ); - prach_len = 2*6144+Ncp; + case 15: + if (prach_fmt == 4) { + idft512(prachF,prach2,1); + //TODO: account for repeated format in dft output + memmove( prach, prach+1024, Ncp<<2 ); + prach_len = 512+Ncp; + } else { + idft3072(prachF,prach2,1); + memmove( prach, prach+6144, Ncp<<2 ); + prach_len = 3072+Ncp; + + if (prach_fmt>1) { + memmove( prach2+6144, prach2, 12288 ); + prach_len = 2*3072+Ncp; + } } - } - - break; - case 50: - if (prach_fmt == 4) { - idft2048(prachF,prach2,1); - memmove( prach, prach+4096, Ncp<<2 ); - prach_len = 2048+Ncp; - } else { - idft12288(prachF,prach2,1); - memmove( prach, prach+24576, Ncp<<2 ); - prach_len = 12288+Ncp; + break; - if (prach_fmt>1) { - memmove( prach2+24576, prach2, 49152 ); - prach_len = 2*12288+Ncp; + case 25: + default: + if (prach_fmt == 4) { + idft1024(prachF,prach2,1); + memmove( prach, prach+2048, Ncp<<2 ); + prach_len = 1024+Ncp; + } else { + idft6144(prachF,prach2,1); + /*for (i=0;i<6144*2;i++) + prach2[i]<<=1;*/ + memmove( prach, prach+12288, Ncp<<2 ); + prach_len = 6144+Ncp; + + if (prach_fmt>1) { + memmove( prach2+12288, prach2, 24576 ); + prach_len = 2*6144+Ncp; + } } - } - - break; - case 75: - if (prach_fmt == 4) { - idft3072(prachF,prach2,1); - //TODO: account for repeated format in dft output - memmove( prach, prach+6144, Ncp<<2 ); - prach_len = 3072+Ncp; - } else { - idft18432(prachF,prach2,1); - memmove( prach, prach+36864, Ncp<<2 ); - prach_len = 18432+Ncp; + break; - if (prach_fmt>1) { - memmove( prach2+36834, prach2, 73728 ); - prach_len = 2*18432+Ncp; + case 50: + if (prach_fmt == 4) { + idft2048(prachF,prach2,1); + memmove( prach, prach+4096, Ncp<<2 ); + prach_len = 2048+Ncp; + } else { + idft12288(prachF,prach2,1); + memmove( prach, prach+24576, Ncp<<2 ); + prach_len = 12288+Ncp; + + if (prach_fmt>1) { + memmove( prach2+24576, prach2, 49152 ); + prach_len = 2*12288+Ncp; + } } - } - break; + break; - case 100: - if (ue->frame_parms.threequarter_fs == 0) { + case 75: if (prach_fmt == 4) { - idft4096(prachF,prach2,1); - memmove( prach, prach+8192, Ncp<<2 ); - prach_len = 4096+Ncp; + idft3072(prachF,prach2,1); + //TODO: account for repeated format in dft output + memmove( prach, prach+6144, Ncp<<2 ); + prach_len = 3072+Ncp; } else { - idft24576(prachF,prach2,1); - memmove( prach, prach+49152, Ncp<<2 ); - prach_len = 24576+Ncp; - - if (prach_fmt>1) { - memmove( prach2+49152, prach2, 98304 ); - prach_len = 2* 24576+Ncp; - } + idft18432(prachF,prach2,1); + memmove( prach, prach+36864, Ncp<<2 ); + prach_len = 18432+Ncp; + + if (prach_fmt>1) { + memmove( prach2+36834, prach2, 73728 ); + prach_len = 2*18432+Ncp; + } } - } - else { - if (prach_fmt == 4) { - idft3072(prachF,prach2,1); - //TODO: account for repeated format in dft output - memmove( prach, prach+6144, Ncp<<2 ); - prach_len = 3072+Ncp; + + break; + + case 100: + if (ue->frame_parms.threequarter_fs == 0) { + if (prach_fmt == 4) { + idft4096(prachF,prach2,1); + memmove( prach, prach+8192, Ncp<<2 ); + prach_len = 4096+Ncp; + } else { + idft24576(prachF,prach2,1); + memmove( prach, prach+49152, Ncp<<2 ); + prach_len = 24576+Ncp; + + if (prach_fmt>1) { + memmove( prach2+49152, prach2, 98304 ); + prach_len = 2* 24576+Ncp; + } + } } else { - idft18432(prachF,prach2,1); - memmove( prach, prach+36864, Ncp<<2 ); - prach_len = 18432+Ncp; - printf("Generated prach for 100 PRB, 3/4 sampling\n"); - if (prach_fmt>1) { - memmove( prach2+36834, prach2, 73728 ); - prach_len = 2*18432+Ncp; - } - } - } + if (prach_fmt == 4) { + idft3072(prachF,prach2,1); + //TODO: account for repeated format in dft output + memmove( prach, prach+6144, Ncp<<2 ); + prach_len = 3072+Ncp; + } else { + idft18432(prachF,prach2,1); + memmove( prach, prach+36864, Ncp<<2 ); + prach_len = 18432+Ncp; + printf("Generated prach for 100 PRB, 3/4 sampling\n"); + + if (prach_fmt>1) { + memmove( prach2+36834, prach2, 73728 ); + prach_len = 2*18432+Ncp; + } + } + } - break; + break; } //LOG_I(PHY,"prach_len=%d\n",prach_len); - AssertFatal(prach_fmt<4, - "prach_fmt4 not fully implemented" ); -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - int j; - int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti; - LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow ); - - for (i=prach_start,j=0; i<min(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,prach_start+prach_len); i++,j++) { - ((int16_t*)ue->common_vars.txdata[0])[2*i] = prach[2*j]; - ((int16_t*)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; - } - - for (i=0; i<overflow; i++,j++) { - ((int16_t*)ue->common_vars.txdata[0])[2*i] = prach[2*j]; - ((int16_t*)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; - } + "prach_fmt4 not fully implemented" ); + + if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) { + int j; + int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti; + LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow ); + + for (i=prach_start,j=0; i<min(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,prach_start+prach_len); i++,j++) { + ((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j]; + ((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; + } + + for (i=0; i<overflow; i++,j++) { + ((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j]; + ((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; + } + #if defined(EXMIMO) - // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on - for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; k<prach_start ; k++) { - if (k<0) - ue->common_vars.txdata[0][k+ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else if (k>(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) - ue->common_vars.txdata[0][k-ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else - ue->common_vars.txdata[0][k] &= 0xFFFEFFFE; - } + + // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on + for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; k<prach_start ; k++) { + if (k<0) + ue->common_vars.txdata[0][k+ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + else if (k>(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) + ue->common_vars.txdata[0][k-ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + else + ue->common_vars.txdata[0][k] &= 0xFFFEFFFE; + } + #endif -#else - - for (i=0; i<prach_len; i++) { - ((int16_t*)(&ue->common_vars.txdata[0][prach_start]))[2*i] = prach[2*i]; - ((int16_t*)(&ue->common_vars.txdata[0][prach_start]))[2*i+1] = prach[2*i+1]; + } else { // simulators + for (i=0; i<prach_len; i++) { + ((int16_t *)(&ue->common_vars.txdata[0][prach_start]))[2*i] = prach[2*i]; + ((int16_t *)(&ue->common_vars.txdata[0][prach_start]))[2*i+1] = prach[2*i+1]; + } } - -#endif - - #if defined(PRACH_WRITE_OUTPUT_DEBUG) LOG_M("prach_txF0.m","prachtxF0",prachF,prach_len-Ncp,1,1); LOG_M("prach_tx0.m","prachtx0",prach+(Ncp<<1),prach_len-Ncp,1,1); - LOG_M("txsig.m","txs",(int16_t*)(&ue->common_vars.txdata[0][0]),2*ue->frame_parms.samples_per_tti,1,1); + LOG_M("txsig.m","txs",(int16_t *)(&ue->common_vars.txdata[0][0]),2*ue->frame_parms.samples_per_tti,1,1); exit(-1); #endif - - return signal_energy( (int*)prach, 256 ); + return signal_energy( (int *)prach, 256 ); } diff --git a/openair1/PHY/TOOLS/lte_enb_scope.c b/openair1/PHY/TOOLS/lte_enb_scope.c new file mode 100644 index 0000000000000000000000000000000000000000..b2c6bd909fce5544f507091d3832990e68f9be56 --- /dev/null +++ b/openair1/PHY/TOOLS/lte_enb_scope.c @@ -0,0 +1,170 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file lte_enb_scope.c + * \brief enb specific softsope implementation + * \author Nokia BellLabs France, francois Taburet + * \date 2019 + * \version 0.1 + * \company Nokia Bell-Labs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ + +#include "targets/RT/USER/lte-softmodem.h" +#include "UTIL/OPT/opt.h" +#include "common/config/config_userapi.h" +#include "PHY/TOOLS/lte_phy_scope.h" +#include "targets/RT/USER/stats.h" + +// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) +// at eNB 0, an UL scope for every UE +FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX]; +FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; +FD_stats_form *form_stats=NULL,*form_stats_l2=NULL; +char title[255]; +unsigned char scope_enb_num_ue = 2; +static pthread_t forms_thread; //xforms +int otg_enabled=0; + +void reset_stats(FL_OBJECT *button, long arg) { + int i,j,k; + PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0]; + + for (i=0; i<NUMBER_OF_UE_MAX; i++) { + for (k=0; k<8; k++) { //harq_processes + for (j=0; j<phy_vars_eNB->dlsch[i][0]->Mlimit; j++) { + phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0; + phy_vars_eNB->UE_stats[i].dlsch_ACK[k][j]=0; + phy_vars_eNB->UE_stats[i].dlsch_trials[k][j]=0; + } + + phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0; + phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0; + phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0; + phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0; + phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0; + phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0; + } + } +} + + +static void *scope_thread_eNB(void *arg) { +# ifdef ENABLE_XFORMS_WRITE_STATS + FILE *eNB_stats; +# endif + struct sched_param sched_param; + int UE_id, CC_id; + int ue_cnt=0; + sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1; + sched_setscheduler(0, SCHED_FIFO,&sched_param); + printf("Scope thread has priority %d\n",sched_param.sched_priority); +# ifdef ENABLE_XFORMS_WRITE_STATS + eNB_stats = fopen("eNB_stats.txt", "w"); +#endif + + while (!oai_exit) { + ue_cnt=0; + + for(UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { + for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + if ((ue_cnt<scope_enb_num_ue)) { + phy_scope_eNB(form_enb[CC_id][ue_cnt], + RC.eNB[0][CC_id], + UE_id); + ue_cnt++; + } + } + } + + sleep(1); + } + + // printf("%s",stats_buffer); +# ifdef ENABLE_XFORMS_WRITE_STATS + + if (eNB_stats) { + rewind (eNB_stats); + fwrite (stats_buffer, 1, len, eNB_stats); + fclose (eNB_stats); + } + +# endif + pthread_exit((void *)arg); +} + + +int enbscope_autoinit(void) { + int UE_id; + printf("XFORMS\n"); + int argc=config_get_if()->argc; + char **argv=config_get_if()->argv; + fl_initialize (&argc, argv, NULL, 0, 0); + form_stats_l2 = create_form_stats_form(); + fl_show_form (form_stats_l2->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "l2 stats"); + form_stats = create_form_stats_form(); + fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats"); + + for(UE_id=0; UE_id<scope_enb_num_ue; UE_id++) { + for(int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + form_enb[CC_id][UE_id] = create_lte_phy_scope_enb(); + sprintf (title, "LTE UL SCOPE eNB for CC_id %d, UE %d",CC_id,UE_id); + fl_show_form (form_enb[CC_id][UE_id]->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); + + if (otg_enabled) { + fl_set_button(form_enb[CC_id][UE_id]->button_0,1); + fl_set_object_label(form_enb[CC_id][UE_id]->button_0,"DL Traffic ON"); + } else { + fl_set_button(form_enb[CC_id][UE_id]->button_0,0); + fl_set_object_label(form_enb[CC_id][UE_id]->button_0,"DL Traffic OFF"); + } + } // CC_id + } // UE_id + + int ret = pthread_create(&forms_thread, NULL, scope_thread_eNB, NULL); + + if (ret == 0) + pthread_setname_np( forms_thread, "xforms" ); + + printf("Scope thread created, ret=%d\n",ret); + return 0; +} // start_forms_eNB + + + +void end_forms(void) { + printf("waiting for XFORMS thread\n"); + pthread_join(forms_thread,NULL); + fl_hide_form(form_stats->stats_form); + fl_free_form(form_stats->stats_form); + fl_hide_form(form_stats_l2->stats_form); + fl_free_form(form_stats_l2->stats_form); + + for(int UE_id=0; UE_id<scope_enb_num_ue; UE_id++) { + for(int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + fl_hide_form(form_enb[CC_id][UE_id]->lte_phy_scope_enb); + fl_free_form(form_enb[CC_id][UE_id]->lte_phy_scope_enb); + } + } +} // end_forms + diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c index 000eb4861585adf34756dbbec7c8b32fc60e668c..3ac167698326e4659d56fcf35650a0ab49daf91f 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope.c +++ b/openair1/PHY/TOOLS/lte_phy_scope.c @@ -154,7 +154,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, PHY_VARS_eNB *phy_vars_enb, int UE_id) { - int eNB_id = 0; + int i,i2,arx,atx,ind,k; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->frame_parms; int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti; @@ -197,10 +197,10 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, llr = (float*) calloc(coded_bits_per_codeword,sizeof(float)); // init to zero bit = malloc(coded_bits_per_codeword*sizeof(float)); - rxsig_t = (int16_t**) phy_vars_enb->common_vars.rxdata[eNB_id]; + rxsig_t = (int16_t**) phy_vars_enb->RU_list[0]->common.rxdata; //chest_t = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id]; - chest_t = (int16_t**) phy_vars_enb->srs_vars[UE_id].srs_ch_estimates[eNB_id]; - chest_f = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates[eNB_id]; + chest_t = (int16_t**) phy_vars_enb->srs_vars[UE_id].srs_ch_estimates; + chest_f = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates; pusch_llr = (int16_t*) phy_vars_enb->pusch_vars[UE_id]->llr; pusch_comp = (int32_t*) phy_vars_enb->pusch_vars[UE_id]->rxdataF_comp[0]; pucch1_comp = (int32_t*) phy_vars_enb->pucch1_stats[UE_id]; @@ -209,7 +209,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, // Received signal in time domain of receive antenna 0 if (rxsig_t != NULL) { - if (rxsig_t[0] != NULL) { + if (rxsig_t[0] != NULL ) { for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES; i++) { rxsig_t_dB[0][i] = 10*log10(1.0+(float) ((rxsig_t[0][2*i])*(rxsig_t[0][2*i])+(rxsig_t[0][2*i+1])*(rxsig_t[0][2*i+1]))); time[i] = (float) i; diff --git a/openair1/PHY/TOOLS/lte_ue_scope.c b/openair1/PHY/TOOLS/lte_ue_scope.c new file mode 100644 index 0000000000000000000000000000000000000000..20d88ebdab5d33d41f278bacea1f22991d7acf73 --- /dev/null +++ b/openair1/PHY/TOOLS/lte_ue_scope.c @@ -0,0 +1,150 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + + +/*! \file lte_ue_scope.c + * \brief UE specific softsope implementation + * \author Nokia BellLabs France, francois Taburet + * \date 2019 + * \version 0.1 + * \company Nokia Bell-Labs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ + +#include "targets/RT/USER/lte-softmodem.h" +#include "UTIL/OPT/opt.h" +#include "common/config/config_userapi.h" +#include "PHY/TOOLS/lte_phy_scope.h" +#include "targets/RT/USER/stats.h" +#include "PHY/phy_vars_ue.h" +// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) +// at eNB 0, an UL scope for every UE +FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX]; +FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; +FD_stats_form *form_stats=NULL,*form_stats_l2=NULL; +char title[255]; +unsigned char scope_enb_num_ue = 2; +static pthread_t forms_thread; //xforms + + +void reset_stats(FL_OBJECT *button, long arg) { + int i,j,k; + PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0]; + + for (i=0; i<NUMBER_OF_UE_MAX; i++) { + for (k=0; k<8; k++) { //harq_processes + for (j=0; j<phy_vars_eNB->dlsch[i][0]->Mlimit; j++) { + phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0; + phy_vars_eNB->UE_stats[i].dlsch_ACK[k][j]=0; + phy_vars_eNB->UE_stats[i].dlsch_trials[k][j]=0; + } + + phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0; + phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0; + phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0; + phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0; + phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0; + phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0; + } + } +} + + +static void *scope_thread_UE(void *arg) { + char stats_buffer[16384]; +# ifdef ENABLE_XFORMS_WRITE_STATS + FILE *UE_stats, *eNB_stats; +# endif + struct sched_param sched_param; + sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1; + sched_setscheduler(0, SCHED_FIFO,&sched_param); + printf("Scope thread has priority %d\n",sched_param.sched_priority); +# ifdef ENABLE_XFORMS_WRITE_STATS + UE_stats = fopen("UE_stats.txt", "w"); +#endif + + while (!oai_exit) { + // dump_ue_stats (PHY_vars_UE_g[0][0], &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0],stats_buffer, 0, mode,rx_input_level_dBm); + //fl_set_object_label(form_stats->stats_text, stats_buffer); + fl_clear_browser(form_stats->stats_text); + fl_add_browser_line(form_stats->stats_text, stats_buffer); + phy_scope_UE(form_ue[0], + PHY_vars_UE_g[0][0], + 0, + 0,7); + // printf("%s",stats_buffer); + } + +# ifdef ENABLE_XFORMS_WRITE_STATS + + if (UE_stats) { + rewind (UE_stats); + fwrite (stats_buffer, 1, len, UE_stats); + fclose (UE_stats); + } + +# endif + pthread_exit((void *)arg); +} + + +int uescope_autoinit(void) { + int UE_id; + int argc=config_get_if()->argc; + char **argv=config_get_if()->argv; + printf("XFORMS\n"); + fl_initialize (&argc, argv, NULL, 0, 0); + form_stats = create_form_stats_form(); + fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats"); + UE_id = 0; + form_ue[UE_id] = create_lte_phy_scope_ue(); + sprintf (title, "LTE DL SCOPE UE"); + fl_show_form (form_ue[UE_id]->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); + /* + if (openair_daq_vars.use_ia_receiver) { + fl_set_button(form_ue[UE_id]->button_0,1); + fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver ON"); + } else { + fl_set_button(form_ue[UE_id]->button_0,0); + fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver OFF"); + }*/ + fl_set_button(form_ue[UE_id]->button_0,0); + fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver OFF"); + int ret = pthread_create(&forms_thread, NULL, scope_thread_UE, NULL); + + if (ret == 0) + pthread_setname_np( forms_thread, "xforms" ); + + printf("Scope thread created, ret=%d\n",ret); + return 0; +} // start_forms_UE + + +void end_forms(void) { + printf("waiting for XFORMS thread\n"); + pthread_join(forms_thread,NULL); + fl_hide_form(form_stats->stats_form); + fl_free_form(form_stats->stats_form); + fl_hide_form(form_ue[0]->lte_phy_scope_ue); + fl_free_form(form_ue[0]->lte_phy_scope_ue); +} // end_forms diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index c342fb73b1006b2a9369846d1fe7e192334b6376..7f12668b859cdb1706a93de6dbbef602bd9c45cd 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -481,14 +481,14 @@ FD_phy_scope_nrue *create_phy_scope_nrue( void ) } void phy_scope_nrUE(FD_phy_scope_nrue *form, - PHY_VARS_NR_UE *phy_vars_ue, - int eNB_id, - int UE_id, - uint8_t subframe) + PHY_VARS_NR_UE *phy_vars_ue, + int eNB_id, + int UE_id, + uint8_t subframe) { int i,arx,atx,ind,k; NR_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->frame_parms; - int nsymb_ce = frame_parms->ofdm_symbol_size;//*frame_parms->symbols_per_tti; + //int nsymb_ce = frame_parms->ofdm_symbol_size;//*frame_parms->symbols_per_tti; int samples_per_frame = frame_parms->samples_per_frame; uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx; uint8_t nb_antennas_tx = frame_parms->nb_antenna_ports_eNB; @@ -844,6 +844,7 @@ void phy_scope_nrUE(FD_phy_scope_nrue *form, */ } + typedef struct { FL_FORM *stats_form; void *vdata; @@ -853,11 +854,25 @@ typedef struct { FL_OBJECT *stats_button; } FD_stats_form; -void reset_stats_gNB(FL_OBJECT *button, long arg) { - PHY_VARS_gNB *phy_vars_gNB = RC.gNB[0][0]; - for (int i=0; i<NUMBER_OF_UE_MAX; i++) { - for (int k=0; k<8; k++) { //harq_processes +// current status is that every UE has a DL scope for a SINGLE eNB (gnb_id=0) +// at eNB 0, an UL scope for every UE +//FD_phy_scope_gnb *form_gnb[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; +static FD_phy_scope_gnb *form_gnb[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; +//FD_stats_form *form_stats=NULL,*form_stats_l2=NULL; +//char title[255]; +unsigned char scope_enb_num_ue = 2; +//static pthread_t forms_thread; //xforms + + +void reset_stats_gNB(FL_OBJECT *button, + long arg) +{ + int i,k; + //PHY_VARS_gNB *phy_vars_gNB = RC.gNB[0][0]; + + for (i=0; i<NUMBER_OF_UE_MAX; i++) { + for (k=0; k<8; k++) { //harq_processes /* for (j=0; j<phy_vars_gNB->dlsch[i][0]->Mlimit; j++) { phy_vars_gNB->UE_stats[i].dlsch_NAK[k][j]=0; phy_vars_gNB->UE_stats[i].dlsch_ACK[k][j]=0; @@ -873,22 +888,42 @@ void reset_stats_gNB(FL_OBJECT *button, long arg) { } } -static FD_phy_scope_gnb *form_gnb[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; -static void *scope_thread(void *arg) { + +static void *scope_thread_gNB(void *arg) { + int UE_id, CC_id; int ue_cnt=0; +# ifdef ENABLE_XFORMS_WRITE_STATS + FILE *gNB_stats = fopen("gNB_stats.txt", "w"); +#endif + while (!oai_exit) { ue_cnt=0; - for(int UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { - for(int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - if ((ue_cnt<scope_enb_num_ue)) + for(UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { + for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + if ((ue_cnt<scope_enb_num_ue)) { //this function needs to be written phy_scope_gNB(form_gnb[CC_id][ue_cnt], RC.gNB[0][CC_id], UE_id); - ue_cnt++; + ue_cnt++; + } } } sleep(1); } + +// printf("%s",stats_buffer); +/*#ifdef ENABLE_XFORMS_WRITE_STATS + + if (eNB_stats) { + rewind (gNB_stats); + fwrite (stats_buffer, 1, len, gNB_stats); + fclose (gNB_stats); + } + +#endif + pthread_exit((void *)arg); +}*/ + return NULL; } @@ -912,7 +947,7 @@ FD_stats_form * create_form_stats_form( void ) { } void startScope(scopeParms_t * p) { - FD_stats_form *form_stats=NULL,*form_stats_l2=NULL; + FD_stats_form *form_stats=NULL,*form_stats_l2=NULL; char title[255]; fl_initialize (p->argc, p->argv, NULL, 0, 0); form_stats_l2 = create_form_stats_form(); @@ -929,5 +964,5 @@ void startScope(scopeParms_t * p) { } // UE_id pthread_t forms_thread; - threadCreate(&forms_thread, scope_thread, NULL, "scope", -1, OAI_PRIORITY_RT_LOW); + threadCreate(&forms_thread, scope_thread_gNB, NULL, "scope", -1, OAI_PRIORITY_RT_LOW); } diff --git a/openair1/PHY/TOOLS/nr_phy_scope.h b/openair1/PHY/TOOLS/nr_phy_scope.h index 9c161988a168376b6aa4c9391ceb6ad691f6aa4f..37331b511da5c3abd48a38ffaa9ff0a634b613bd 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.h +++ b/openair1/PHY/TOOLS/nr_phy_scope.h @@ -65,7 +65,6 @@ typedef struct { FL_OBJECT * pdsch_llr1; FL_OBJECT * pdsch_tput; FL_OBJECT * button_0; - } FD_phy_scope_nrue; extern unsigned char scope_enb_num_ue; diff --git a/openair1/PHY/TOOLS/phy_scope_interface.c b/openair1/PHY/TOOLS/phy_scope_interface.c new file mode 100644 index 0000000000000000000000000000000000000000..835fb4ea7b2a028f4ddfb378c3c877b699b6bc27 --- /dev/null +++ b/openair1/PHY/TOOLS/phy_scope_interface.c @@ -0,0 +1,53 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file openair1/PHY/TOOLS/phy_scope_interface.c + * \brief soft scope API interface implementation + * \author Nokia BellLabs France, francois Taburet + * \date 2019 + * \version 0.1 + * \company Nokia BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ +#include <stdio.h> +#include "common/config/config_userapi.h" +#include "common/utils/load_module_shlib.h" +#include "phy_scope_interface.h" + +#define SOFTSCOPE_ENDFUNC_IDX 0 +static loader_shlibfunc_t scope_fdesc[]= {{"end_forms",NULL}}; + +int load_softscope(char *exectype) { + char libname[64]; + sprintf(libname,"%.10sscope",exectype); + return load_module_shlib(libname,scope_fdesc,1,NULL); +} + +int end_forms(void) { + if (scope_fdesc[SOFTSCOPE_ENDFUNC_IDX].fptr) { + scope_fdesc[SOFTSCOPE_ENDFUNC_IDX].fptr(); + return 0; + } + + return -1; +} diff --git a/openair1/PHY/TOOLS/phy_scope_interface.h b/openair1/PHY/TOOLS/phy_scope_interface.h new file mode 100644 index 0000000000000000000000000000000000000000..779a57a7202450327cc8d515066191f48e373613 --- /dev/null +++ b/openair1/PHY/TOOLS/phy_scope_interface.h @@ -0,0 +1,35 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file phy_scope_interface.h + * \brief softscope interface API include file + * \author Nokia BellLabs France, francois Taburet + * \date 2019 + * \version 0.1 + * \company Nokia BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ + + +int load_softscope(char *exectype); +int end_forms(void) ; diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index fbd7df21e985a2016f922d4f2d0add160af6618a..edd4cef7a403d8eb8792cb30a02e000479f3c8dd 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -142,12 +142,12 @@ typedef struct RU_proc_t_s { int frame_rx; /// frame to act upon for transmission int frame_tx; -#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) +/*#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) /// subframe to act upon for transmission int subframe_tx; /// subframe to act upon for reception int subframe_rx; -#endif +#endif*/ /// unwrapped frame count int frame_tx_unwrap; /// frame to act upon for reception of prach @@ -229,7 +229,7 @@ typedef struct RU_proc_t_s { struct sched_param sched_param_FH1; /// scheduling parameters for RU prach thread struct sched_param sched_param_prach; -#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) +#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) /// scheduling parameters for RU prach thread BL/CE UEs struct sched_param sched_param_prach_br; #endif @@ -431,10 +431,10 @@ typedef struct RU_t_s{ /// function pointer to wakeup routine in lte-enb/nr-gnb. void (*wakeup_prach_eNB)(struct PHY_VARS_eNB_s *eNB, struct RU_t_s *ru, int frame, int subframe); void (*wakeup_prach_gNB)(struct PHY_VARS_gNB_s *gNB, struct RU_t_s *ru, int frame, int subframe); -#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) +#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) /// function pointer to wakeup routine in lte-enb. void (*wakeup_prach_eNB_br)(struct PHY_VARS_eNB_s *eNB, struct RU_t_s *ru, int frame, int subframe); - #endif +#endif /// function pointer to NB entry routine void (*eNB_top)(struct PHY_VARS_eNB_s *eNB, int frame_rx, int subframe_rx, char *string, struct RU_t_s *ru); @@ -553,7 +553,7 @@ typedef struct RRU_config_s { int prach_FreqOffset[MAX_BANDS_PER_RRU]; /// prach_ConfigIndex for IF4p5 int prach_ConfigIndex[MAX_BANDS_PER_RRU]; -#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) +#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) int emtc_prach_CElevel_enable[MAX_BANDS_PER_RRU][4]; /// emtc_prach_FreqOffset for IF4p5 per CE Level int emtc_prach_FreqOffset[MAX_BANDS_PER_RRU][4]; diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h index 5a62bde2e74d3daa9fa6004c6992e41fac7ed777..1f9bde41c709cf1380eff39d9342223150a9aa70 100644 --- a/openair1/PHY/defs_common.h +++ b/openair1/PHY/defs_common.h @@ -733,8 +733,8 @@ typedef enum {format0, format2C, format2D, format3, - format3A, - format4, + format3A, + format4, format5, format6_0A, format6_0B, @@ -867,8 +867,8 @@ typedef enum { RESYNCH=4 } UE_MODE_t; -#define FOREACH_PARALLEL(GEN) \ - GEN(PARALLEL_SINGLE_THREAD) \ +#define FOREACH_PARALLEL(GEN) \ + GEN(PARALLEL_SINGLE_THREAD) \ GEN(PARALLEL_RU_L1_SPLIT) \ GEN(PARALLEL_RU_L1_TRX_SPLIT) @@ -888,7 +888,7 @@ typedef struct THREAD_STRUCT_s { PARALLEL_CONF_t parallel_conf; WORKER_CONF_t worker_conf; } THREAD_STRUCT; -extern THREAD_STRUCT thread_struct; +/*extern THREAD_STRUCT thread_struct; static inline void set_parallel_conf(char *parallel_conf) { mapping config[]= { @@ -907,7 +907,7 @@ static inline void set_worker_conf(char *worker_conf) { FOREACH_WORKER(GENERATE_ENUMTXT) {NULL, -1} }; - thread_struct.worker_conf = (WORKER_CONF_t)map_str_to_int(config, worker_conf); + thread_struct.worker_conf = (WORKER_CONF_t)map_str_to_int(config, worker_conf); if (thread_struct.worker_conf == -1 ) { LOG_E(ENB_APP,"Impossible value: %s\n", worker_conf); thread_struct.worker_conf = WORKER_DISABLE ; @@ -920,7 +920,7 @@ static inline PARALLEL_CONF_t get_thread_parallel_conf(void) { static inline WORKER_CONF_t get_thread_worker_conf(void) { return thread_struct.worker_conf; -} +}*/ typedef enum {SF_DL, SF_UL, SF_S} lte_subframe_t; @@ -973,25 +973,25 @@ extern int sync_var; typedef uint8_t(decoder_if_t)(int16_t *y, - int16_t *y2, - uint8_t *decoded_bytes, - uint8_t *decoded_bytes2, - uint16_t n, - uint8_t max_iterations, - uint8_t crc_type, - uint8_t F, - time_stats_t *init_stats, - time_stats_t *alpha_stats, - time_stats_t *beta_stats, - time_stats_t *gamma_stats, - time_stats_t *ext_stats, - time_stats_t *intl1_stats, - time_stats_t *intl2_stats); + int16_t *y2, + uint8_t *decoded_bytes, + uint8_t *decoded_bytes2, + uint16_t n, + uint8_t max_iterations, + uint8_t crc_type, + uint8_t F, + time_stats_t *init_stats, + time_stats_t *alpha_stats, + time_stats_t *beta_stats, + time_stats_t *gamma_stats, + time_stats_t *ext_stats, + time_stats_t *intl1_stats, + time_stats_t *intl2_stats); typedef uint8_t(encoder_if_t)(uint8_t *input, - uint16_t input_length_bytes, - uint8_t *output, - uint8_t F); + uint16_t input_length_bytes, + uint8_t *output, + uint8_t F); static inline void wait_sync(char *thread_name) { diff --git a/openair1/PHY/phy_extern.h b/openair1/PHY/phy_extern.h index e20d17db7a25a2650a52f965dc3f72ad745fa719..4280b684f9bd65ec4ce40842c833cfef64462d1b 100644 --- a/openair1/PHY/phy_extern.h +++ b/openair1/PHY/phy_extern.h @@ -40,8 +40,6 @@ extern int number_of_cards; extern short conjugate[8],conjugate2[8]; - - extern RAN_CONTEXT_t RC; extern short primary_synch0[144]; diff --git a/openair1/PHY/phy_extern_nr_ue.h b/openair1/PHY/phy_extern_nr_ue.h index ead709b886f9cd0abbc35dc1ab292df9d7bbf5f5..2a4292a7795dbcf3e4a7297dc795e2123bb27897 100644 --- a/openair1/PHY/phy_extern_nr_ue.h +++ b/openair1/PHY/phy_extern_nr_ue.h @@ -25,9 +25,9 @@ #include "PHY/defs_nr_UE.h" //#include "common/ran_context.h" -extern char* namepointer_chMag ; +extern char* namepointer_chMag ; extern char* namepointer_log2; -extern char fmageren_name2[512]; +extern char fmageren_name2[512]; extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX]; extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX]; @@ -94,8 +94,8 @@ extern double p_qam64[8]; extern double beta1_dlsch[6][MCS_COUNT]; extern double beta2_dlsch[6][MCS_COUNT]; -extern char eNB_functions[6][20]; -extern char eNB_timing[2][20]; +extern char NB_functions[7][20]; +extern char NB_timing[2][20]; extern char ru_if_types[MAX_RU_IF_TYPES][20]; extern int16_t unscrambling_lut[65536*16]; diff --git a/openair1/PHY/phy_vars_nr_ue.h b/openair1/PHY/phy_vars_nr_ue.h index 46260cf30615394f2a79c9cd3692fc9733fb3225..c3eecb90083a15bb8e74afdf49579688cbad1334 100644 --- a/openair1/PHY/phy_vars_nr_ue.h +++ b/openair1/PHY/phy_vars_nr_ue.h @@ -130,8 +130,8 @@ double beta2_dlsch[6][MCS_COUNT] = { {2.52163, 0.83231, 0.77472, 1.36536, 1.1682 #ifdef OCP_FRAMEWORK #include <enums.h> #else -char eNB_functions[6][20]={"eNodeB_3GPP","eNodeB_3GPP_BBU","NGFI_RAU_IF4p5","NGFI_RRU_IF5","NGFI_RRU_IF4p5",}; -char eNB_timing[2][20]={"synch_to_ext_device","synch_to_other"}; +char NB_functions[7][20]={"eNodeB_3GPP","eNodeB_3GPP_BBU","NGFI_RAU_IF4p5","NGFI_RRU_IF5","NGFI_RRU_IF4p5","gNodeB_3GPP",}; +char NB_timing[2][20]={"synch_to_ext_device","synch_to_other"}; char ru_if_types[MAX_RU_IF_TYPES][20]={"local RF","IF5 RRU","IF5 Mobipass","IF4p5 RRU","IF1pp RRU"}; #endif diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c index 5989a52507be595803e84ca28c19f1f5bfa3b753..e1e6cdb4db20089760bb0c90ed911a8ad791e500 100644 --- a/openair1/SCHED/phy_procedures_lte_common.c +++ b/openair1/SCHED/phy_procedures_lte_common.c @@ -752,9 +752,9 @@ int subframe_num(LTE_DL_FRAME_PARMS *frame_parms){ } } -lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,unsigned char subframe) +lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms, + unsigned char subframe) { - // if FDD return dummy value if (frame_parms->frame_type == FDD) return(SF_DL); diff --git a/openair1/SCHED/ru_procedures.c b/openair1/SCHED/ru_procedures.c index 2591a914a59c168bbbe4966af5efeafbe31fe7fb..85aa1dbc7afcf7b7089b38f486e9712cdb4f02aa 100644 --- a/openair1/SCHED/ru_procedures.c +++ b/openair1/SCHED/ru_procedures.c @@ -452,8 +452,8 @@ static void *fep_thread(void *param) { return(NULL); } -void init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx) { - +void init_feptx_thread(RU_t *ru, pthread_attr_t *attr_feptx) +{ RU_proc_t *proc = &ru->proc; proc->instance_cnt_feptx = -1; @@ -462,12 +462,10 @@ void init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx) { pthread_cond_init( &proc->cond_feptx, NULL); threadCreate(&proc->pthread_feptx, feptx_thread, (void*)ru, "feptx", -1, OAI_PRIORITY_RT); - - } -void init_fep_thread(RU_t *ru,pthread_attr_t *attr_fep) { - +void init_fep_thread(RU_t *ru, pthread_attr_t *attr_fep) +{ RU_proc_t *proc = &ru->proc; proc->instance_cnt_fep = -1; @@ -476,8 +474,6 @@ void init_fep_thread(RU_t *ru,pthread_attr_t *attr_fep) { pthread_cond_init( &proc->cond_fep, NULL); threadCreate(&proc->pthread_fep, fep_thread, (void*)ru, "fep", -1, OAI_PRIORITY_RT); - - } extern void kill_fep_thread(RU_t *ru) @@ -506,7 +502,7 @@ extern void kill_feptx_thread(RU_t *ru) pthread_cond_destroy( &proc->cond_feptx ); } -void ru_fep_full_2thread(RU_t *ru,int subframe) { +void ru_fep_full_2thread(RU_t *ru, int subframe) { RU_proc_t *proc = &ru->proc; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 72747b03dd3b980addaca2d7bbd380aceaab9276..b86b9381738820c65ae9d2cbe8555fdd69a762de 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -4353,14 +4353,13 @@ int is_pbch_in_slot(fapi_nr_pbch_config_t pbch_config, int frame, int slot, int } -int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id, - uint8_t do_pdcch_flag,runmode_t mode, - fapi_nr_pbch_config_t pbch_config) { - - - - int l,l2; - int pilot1; +int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, + UE_nr_rxtx_proc_t *proc, + uint8_t eNB_id, + uint8_t do_pdcch_flag, + runmode_t mode, + fapi_nr_pbch_config_t pbch_config) +{ int frame_rx = proc->frame_rx; int nr_tti_rx = proc->nr_tti_rx; int slot_pbch; @@ -4396,7 +4395,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN uint16_t coreset_start_rb = 6 * coreset_start; #ifdef NR_PDCCH_SCHED - nr_gold_pdcch(ue,0, 2); + nr_gold_pdcch(ue, 0, 2); LOG_D(PHY," ------ --> PDCCH ChannelComp/LLR Frame.slot %d.%d ------ \n", frame_rx%1024, nr_tti_rx); for (uint16_t l=0; l<nb_symb_pdcch; l++) { @@ -4406,17 +4405,17 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN #endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); nr_slot_fep(ue, - l, - nr_tti_rx, - 0, - 0); - - nr_pdcch_channel_estimation(ue,0, + l, nr_tti_rx, - l, - ue->frame_parms.first_carrier_offset+coreset_start_rb*12, - coreset_nb_rb); - + 0, + 0); + + nr_pdcch_channel_estimation(ue, + 0, + nr_tti_rx, + l, + ue->frame_parms.first_carrier_offset+coreset_start_rb*12, + coreset_nb_rb); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); #if UE_TIMING_TRACE @@ -4428,7 +4427,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN } - dci_cnt = nr_ue_pdcch_procedures(eNB_id,ue,proc); + dci_cnt = nr_ue_pdcch_procedures(eNB_id, ue, proc); if (dci_cnt > 0) { @@ -4437,14 +4436,13 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN if (ue->no_timing_correction==0) { LOG_I(PHY,"start adjust sync slot = %d no timing %d\n", nr_tti_rx, ue->no_timing_correction); nr_adjust_synch_ue(&ue->frame_parms, - ue, - eNB_id, - nr_tti_rx, - 0, - 16384); + ue, + eNB_id, + nr_tti_rx, + 0, + 16384); } - } - else { + } else { LOG_D(PHY,"[UE %d] Frame %d, nr_tti_rx %d: No DCIs found\n",ue->Mod_id,frame_rx,nr_tti_rx); } #endif //NR_PDCCH_SCHED diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c index c5573adaed25eeaa124f3f33c57f01db9612fc69..00fc4d185723bdeddc3958b3a8ba9718b42bd90a 100644 --- a/openair1/SCHED_UE/phy_procedures_lte_ue.c +++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c @@ -37,6 +37,7 @@ #include "PHY/defs_UE.h" #include "PHY/phy_extern_ue.h" #include "executables/nr-uesoftmodem.h" +#include "targets/RT/USER/lte-softmodem.h" #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" #include "SCHED_UE/sched_UE.h" @@ -74,12 +75,10 @@ char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"}; extern double cpuf; -void Msg1_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id); -void Msg3_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id); +void Msg1_transmitted(module_id_t module_idP, uint8_t CC_id, frame_t frameP, uint8_t eNB_id); +void Msg3_transmitted(module_id_t module_idP, uint8_t CC_id, frame_t frameP, uint8_t eNB_id); -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) - extern uint32_t downlink_frequency[MAX_NUM_CCs][4]; -#endif +extern uint32_t downlink_frequency[MAX_NUM_CCs][4]; void get_dumpparam(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, @@ -179,49 +178,12 @@ void dump_dlsch_SI(PHY_VARS_UE *ue, } } -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) -//unsigned int gain_table[31] = {100,112,126,141,158,178,200,224,251,282,316,359,398,447,501,562,631,708,794,891,1000,1122,1258,1412,1585,1778,1995,2239,2512,2818,3162}; -/* - unsigned int get_tx_amp_prach(int power_dBm, int power_max_dBm, int N_RB_UL) - { - - int gain_dB = power_dBm - power_max_dBm; - int amp_x_100; - - switch (N_RB_UL) { - case 6: - amp_x_100 = AMP; // PRACH is 6 PRBS so no scale - break; - case 15: - amp_x_100 = 158*AMP; // 158 = 100*sqrt(15/6) - break; - case 25: - amp_x_100 = 204*AMP; // 204 = 100*sqrt(25/6) - break; - case 50: - amp_x_100 = 286*AMP; // 286 = 100*sqrt(50/6) - break; - case 75: - amp_x_100 = 354*AMP; // 354 = 100*sqrt(75/6) - break; - case 100: - amp_x_100 = 408*AMP; // 408 = 100*sqrt(100/6) - break; - default: - LOG_E(PHY,"Unknown PRB size %d\n",N_RB_UL); - mac_xface->macphy_exit(""); - break; - } - if (gain_dB < -30) { - return(amp_x_100/3162); - } else if (gain_dB>0) - return(amp_x_100); - else - return(amp_x_100/gain_table[-gain_dB]); // 245 corresponds to the factor sqrt(25/6) - } -*/ -unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb) { +unsigned int get_tx_amp(int power_dBm, + int power_max_dBm, + int N_RB_UL, + int nb_rb) +{ int gain_dB; double gain_lin; @@ -235,7 +197,6 @@ unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb return((int)(AMP*sqrt(gain_lin*N_RB_UL/(double)nb_rb))); } -#endif void dump_dlsch_ra(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, @@ -1194,10 +1155,8 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, int subframe_tx = proc->subframe_tx; int ulsch_start; int overflow=0; -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) - int k,l; + int k, l; int dummy_tx_buffer[frame_parms->samples_per_tti] __attribute__((aligned(16))); -#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,VCD_FUNCTION_IN); if ( LOG_DEBUGFLAG(UE_TIMING)) { @@ -1205,23 +1164,21 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, } nsymb = (frame_parms->Ncp == 0) ? 14 : 12; -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)//this is the EXPRESS MIMO case - ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti- - ue->hw_timing_advance- - ue->timing_advance- - ue->N_TA_offset+5); - //LOG_E(PHY,"ul-signal [subframe: %d, ulsch_start %d]\n",subframe_tx, ulsch_start); - if(ulsch_start < 0) - ulsch_start = ulsch_start + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); + if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) { + ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti- + ue->hw_timing_advance- + ue->timing_advance- + ue->N_TA_offset+5); - if (ulsch_start > (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti)) - ulsch_start = ulsch_start % (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); + if(ulsch_start < 0) + ulsch_start = ulsch_start + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); - //LOG_E(PHY,"ul-signal [subframe: %d, ulsch_start %d]\n",subframe_tx, ulsch_start); -#else //this is the normal case - ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance; -#endif //else EXMIMO + if (ulsch_start > (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti)) + ulsch_start = ulsch_start % (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); + } else { //this is the simulators case + ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance; + } if (empty_subframe) { overflow = ulsch_start - 9*frame_parms->samples_per_tti; @@ -1239,71 +1196,63 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, } for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { - if (frame_parms->Ncp == 1) + int *Buff = (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ? &ue->common_vars.txdata[aa][ulsch_start] :dummy_tx_buffer; + + if (frame_parms->Ncp == 1) { PHY_ofdm_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size], -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) - dummy_tx_buffer, -#else - &ue->common_vars.txdata[aa][ulsch_start], -#endif + Buff, frame_parms->ofdm_symbol_size, nsymb, frame_parms->nb_prefix_samples, CYCLIC_PREFIX); - else { + } else { normal_prefix_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size], -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) - dummy_tx_buffer, -#else - &ue->common_vars.txdata[aa][ulsch_start], -#endif + Buff, nsymb>>1, &ue->frame_parms); + Buff += (frame_parms->samples_per_tti>>1); normal_prefix_mod(&ue->common_vars.txdataF[aa][((subframe_tx*nsymb)+(nsymb>>1))*frame_parms->ofdm_symbol_size], -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - dummy_tx_buffer+(frame_parms->samples_per_tti>>1), -#else - &ue->common_vars.txdata[aa][ulsch_start+(frame_parms->samples_per_tti>>1)], -#endif + Buff, nsymb>>1, &ue->frame_parms); } -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) - apply_7_5_kHz(ue,dummy_tx_buffer,0); - apply_7_5_kHz(ue,dummy_tx_buffer,1); -#else - apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],0); - apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],1); -#endif + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],0); + apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],1); + } else { + apply_7_5_kHz(ue,dummy_tx_buffer,0); + apply_7_5_kHz(ue,dummy_tx_buffer,1); + } -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) - overflow = ulsch_start - 9*frame_parms->samples_per_tti; + if (!(IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) ) { + overflow = ulsch_start - 9*frame_parms->samples_per_tti; - for (k=ulsch_start,l=0; k<cmin(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++,l++) { - ((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l]; - ((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1]; - } + for (k=ulsch_start,l=0; k<cmin(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++,l++) { + ((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l]; + ((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1]; + } - for (k=0; k<overflow; k++,l++) { - ((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l]; - ((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1]; - } + for (k=0; k<overflow; k++,l++) { + ((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l]; + ((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1]; + } #if defined(EXMIMO) - // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on - for (k=ulsch_start - (frame_parms->samples_per_tti>>1) ; k<ulsch_start ; k++) { - if (k<0) - ue->common_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else if (k>(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) - ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else - ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE; - } + // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on + for (k=ulsch_start - (frame_parms->samples_per_tti>>1) ; k<ulsch_start ; k++) { + if (k<0) + ue->common_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + else if (k>(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) + ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + else + ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE; + } #endif -#endif + } + /* only for debug LOG_I(PHY,"ul-signal [subframe: %d, ulsch_start %d, TA: %d, rxOffset: %d, timing_advance: %d, hw_timing_advance: %d]\n",subframe_tx, ulsch_start, ue->N_TA_offset, ue->rx_offset, ue->timing_advance, ue->hw_timing_advance); @@ -1380,14 +1329,15 @@ void ue_prach_procedures(PHY_VARS_UE *ue, ue->prach_resources[eNB_id]->ra_TDD_map_index, ue->prach_resources[eNB_id]->ra_RNTI); ue->tx_total_RE[subframe_tx] = 96; -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) - ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - 6); -#else - ue->prach_vars[eNB_id]->amp = AMP; -#endif + + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + 6); + } else { + ue->prach_vars[eNB_id]->amp = AMP; + } if ((mode == calib_prach_tx) && (((proc->frame_tx&0xfffe)%100)==0)) LOG_D(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : PRACH TX power %d dBm, amp %d\n", @@ -1403,12 +1353,12 @@ void ue_prach_procedures(PHY_VARS_UE *ue, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_OUT); // stop_meas(&ue->tx_prach); LOG_I(PHY,"[UE %d][RAPROC] PRACH PL %d dB, power %d dBm (max %d dBm), digital power %d dB (amp %d)\n", - ue->Mod_id, - get_PL(ue->Mod_id,ue->CC_id,eNB_id), - ue->tx_power_dBm[subframe_tx], + ue->Mod_id, + get_PL(ue->Mod_id,ue->CC_id,eNB_id), + ue->tx_power_dBm[subframe_tx], ue->tx_power_max_dBm, - dB_fixed(prach_power), - ue->prach_vars[eNB_id]->amp); + dB_fixed(prach_power), + ue->prach_vars[eNB_id]->amp); if (ue->mac_enabled==1) { Msg1_transmitted(ue->Mod_id, @@ -1754,15 +1704,16 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue, } ue->tx_total_RE[subframe_tx] = nb_rb*12; - -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) - tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - nb_rb); -#else - tx_amp = AMP; -#endif + + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + tx_amp = AMP; + } else { + tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + nb_rb); + } + T(T_UE_PHY_PUSCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->ulsch[eNB_id]->f_pusch),T_INT(get_PL(Mod_id,0,eNB_id)),T_INT(nb_rb)); @@ -1830,19 +1781,19 @@ void ue_srs_procedures(PHY_VARS_UE *ue, Po_SRS = ue->tx_power_max_dBm; } -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) - if (ue->mac_enabled==1) { - tx_amp = get_tx_amp(Po_SRS, - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - nb_rb_srs); + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + tx_amp = AMP; } else { + if (ue->mac_enabled==1) { + tx_amp = get_tx_amp(Po_SRS, + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + nb_rb_srs); + } else { tx_amp = AMP; + } } -#else - tx_amp = AMP; -#endif LOG_D(PHY,"SRS PROC; TX_MAX_POWER %d, Po_SRS %d, NB_RB_UL %d, NB_RB_SRS %d TX_AMPL %d\n",ue->tx_power_max_dBm, Po_SRS, ue->frame_parms.N_RB_UL, @@ -1989,7 +1940,6 @@ void ue_pucch_procedures(PHY_VARS_UE *ue, uint8_t isShortenPucch = (pSoundingrs_ul_config_dedicated->srsCellSubframe && frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission); bundling_flag = ue->pucch_config_dedicated[eNB_id].tdd_AckNackFeedbackMode; - // Part - I // Collect feedback that should be transmitted at this subframe // - SR @@ -2073,18 +2023,20 @@ void ue_pucch_procedures(PHY_VARS_UE *ue, Po_PUCCH = pucch_power_cntl(ue,proc,subframe_tx,eNB_id,format); } else { Po_PUCCH = ue->tx_power_max_dBm; - } - ue->tx_power_dBm[subframe_tx] = Po_PUCCH; - ue->tx_total_RE[subframe_tx] = 12; - -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) - tx_amp = get_tx_amp(Po_PUCCH, - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - 1); -#else - tx_amp = AMP; -#endif + } + + ue->tx_power_dBm[subframe_tx] = Po_PUCCH; + ue->tx_total_RE[subframe_tx] = 12; + + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + tx_amp = AMP; + } else { + tx_amp = get_tx_amp(Po_PUCCH, + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + 1); + } + T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); @@ -2157,14 +2109,15 @@ void ue_pucch_procedures(PHY_VARS_UE *ue, ue->tx_power_dBm[subframe_tx] = Po_PUCCH; ue->tx_total_RE[subframe_tx] = 12; -#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) - tx_amp = get_tx_amp(Po_PUCCH, - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - 1); -#else - tx_amp = AMP; -#endif + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + tx_amp = AMP; + } else { + tx_amp = get_tx_amp(Po_PUCCH, + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + 1); + } + T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); @@ -2266,7 +2219,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue, } if (subframe_select(&ue->frame_parms,proc->subframe_tx) == SF_UL || - ue->frame_parms.frame_type == FDD) { + ue->frame_parms.frame_type == FDD) { if (ue->UE_mode[eNB_id] > PRACH ) { // check cell srs subframe and ue srs subframe. This has an impact on pusch encoding isSubframeSRS = is_srs_occasion_common(&ue->frame_parms,proc->frame_tx,proc->subframe_tx); @@ -2414,15 +2367,9 @@ void ue_measurement_procedures(uint16_t l, // symbol index of each slot [0..6 if (( (slot%2) == 0) && (l==(4-frame_parms->Ncp))) { // AGC VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_IN); -#ifndef OAI_USRP -#ifndef OAI_BLADERF -#ifndef OAI_LMSSDR -#ifndef OAI_ADRV9371_ZC706 - phy_adjust_gain (ue,dB_fixed(ue->measurements.rssi),0); -#endif -#endif -#endif -#endif + + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) + phy_adjust_gain (ue,dB_fixed(ue->measurements.rssi),0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT); eNB_id = 0; @@ -2864,6 +2811,7 @@ int ue_pdcch_procedures(uint8_t eNB_id, T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb), T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb), T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS)); + if (LOG_DEBUGFLAG(DEBUG_UE_PHYPROC)) { LOG_USEDINLOG_VAR(int8_t,harq_pid) = subframe2harq_pid(&ue->frame_parms, pdcch_alloc2ul_frame(&ue->frame_parms,proc->frame_rx,proc->subframe_rx), @@ -4343,72 +4291,72 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue, } if (LOG_DEBUGFLAG(UE_TIMING)) { - stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]); - LOG_I(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); -} + stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]); + LOG_I(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); + } + + // duplicate harq structure + uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid; + LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[current_harq_pid]; + harq_status_t *current_harq_ack = &ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_ack[subframe_rx]; + + // For Debug parallelisation + //if (current_harq_ack->ack == 0) { + //printf("[slot0 dl processing][End of Channel Decoding] AbsSubframe %d.%d Decode Fail for HarqId%d Round%d\n",frame_rx,subframe_rx,current_harq_pid,current_harq_processes->round); + //} + for(uint8_t rx_th_idx=1; rx_th_idx<RX_NB_TH; rx_th_idx++) { + LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_processes[current_harq_pid]; + harq_status_t *harq_ack_dest = &ue->dlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_ack[subframe_rx]; + copy_harq_proc_struct(harq_processes_dest, current_harq_processes); + copy_ack_struct(harq_ack_dest, current_harq_ack); + } + + /* + LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; + LTE_DL_UE_HARQ_t *harq_processes_dest1 = ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; + + harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; + harq_status_t *harq_ack_dest = &ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; + harq_status_t *harq_ack_dest1 = &ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; -// duplicate harq structure -uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid; -LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[current_harq_pid]; -harq_status_t *current_harq_ack = &ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_ack[subframe_rx]; - -// For Debug parallelisation -//if (current_harq_ack->ack == 0) { -//printf("[slot0 dl processing][End of Channel Decoding] AbsSubframe %d.%d Decode Fail for HarqId%d Round%d\n",frame_rx,subframe_rx,current_harq_pid,current_harq_processes->round); -//} -for(uint8_t rx_th_idx=1; rx_th_idx<RX_NB_TH; rx_th_idx++) { - LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_processes[current_harq_pid]; - harq_status_t *harq_ack_dest = &ue->dlsch[ue->current_thread_id[(subframe_rx+rx_th_idx)%10]][eNB_id][0]->harq_ack[subframe_rx]; copy_harq_proc_struct(harq_processes_dest, current_harq_processes); copy_ack_struct(harq_ack_dest, current_harq_ack); -} -/* -LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; -LTE_DL_UE_HARQ_t *harq_processes_dest1 = ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_processes[current_harq_pid]; - -harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; -harq_status_t *harq_ack_dest = &ue->dlsch[(subframe_rx+1)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; -harq_status_t *harq_ack_dest1 = &ue->dlsch[(subframe_rx+2)%RX_NB_TH][eNB_id][0]->harq_ack[subframe_rx]; - -copy_harq_proc_struct(harq_processes_dest, current_harq_processes); -copy_ack_struct(harq_ack_dest, current_harq_ack); - -copy_harq_proc_struct(harq_processes_dest1, current_harq_processes); -copy_ack_struct(harq_ack_dest1, current_harq_ack); -*/ -if (subframe_rx==9) { - if (frame_rx % 10 == 0) { - if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0) - ue->dlsch_fer[eNB_id] = (100*(ue->dlsch_errors[eNB_id] - ue->dlsch_errors_last[eNB_id]))/(ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]); - - ue->dlsch_errors_last[eNB_id] = ue->dlsch_errors[eNB_id]; - ue->dlsch_received_last[eNB_id] = ue->dlsch_received[eNB_id]; - } + copy_harq_proc_struct(harq_processes_dest1, current_harq_processes); + copy_ack_struct(harq_ack_dest1, current_harq_ack); + */ + if (subframe_rx==9) { + if (frame_rx % 10 == 0) { + if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0) + ue->dlsch_fer[eNB_id] = (100*(ue->dlsch_errors[eNB_id] - ue->dlsch_errors_last[eNB_id]))/(ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]); + + ue->dlsch_errors_last[eNB_id] = ue->dlsch_errors[eNB_id]; + ue->dlsch_received_last[eNB_id] = ue->dlsch_received[eNB_id]; + } - ue->bitrate[eNB_id] = (ue->total_TBS[eNB_id] - ue->total_TBS_last[eNB_id])*100; - ue->total_TBS_last[eNB_id] = ue->total_TBS[eNB_id]; - LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n", - ue->Mod_id,frame_rx,ue->total_TBS[eNB_id], - ue->total_TBS_last[eNB_id],(float) ue->bitrate[eNB_id]/1000.0); + ue->bitrate[eNB_id] = (ue->total_TBS[eNB_id] - ue->total_TBS_last[eNB_id])*100; + ue->total_TBS_last[eNB_id] = ue->total_TBS[eNB_id]; + LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n", + ue->Mod_id,frame_rx,ue->total_TBS[eNB_id], + ue->total_TBS_last[eNB_id],(float) ue->bitrate[eNB_id]/1000.0); #if UE_AUTOTEST_TRACE - if ((frame_rx % 100 == 0)) { - LOG_I(PHY,"[UE %d] AUTOTEST Metric : UE_DLSCH_BITRATE = %5.2f kbps (frame = %d) \n", ue->Mod_id, (float) ue->bitrate[eNB_id]/1000.0, frame_rx); - } + if ((frame_rx % 100 == 0)) { + LOG_I(PHY,"[UE %d] AUTOTEST Metric : UE_DLSCH_BITRATE = %5.2f kbps (frame = %d) \n", ue->Mod_id, (float) ue->bitrate[eNB_id]/1000.0, frame_rx); + } #endif -} + } -VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); -if (LOG_DEBUGFLAG(UE_TIMING)) { - stop_meas(&ue->phy_proc_rx[ue->current_thread_id[subframe_rx]]); - LOG_I(PHY, "------FULL RX PROC [AbsSFN %d.%d]: %5.2f ------\n",frame_rx,subframe_rx,ue->phy_proc_rx[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); -} + if (LOG_DEBUGFLAG(UE_TIMING)) { + stop_meas(&ue->phy_proc_rx[ue->current_thread_id[subframe_rx]]); + LOG_I(PHY, "------FULL RX PROC [AbsSFN %d.%d]: %5.2f ------\n",frame_rx,subframe_rx,ue->phy_proc_rx[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); + } -LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); -return (0); + LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); + return (0); } #endif /*UE_SLOT_PARALLELISATION */ diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 14547c64ccae66d1d2f9c6d32b67105e544d911e..9342a339f9c6e00fe5b10dc0cca58c4fd6eda2c5 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -1631,15 +1631,13 @@ int main(int argc, char **argv) { UE->dlsch_eNB[0] = new_eNB_dlsch(Kmimo,8,Nsoft,N_RB_DL,0,&eNB->frame_parms); if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) { - eNB->UE_stats[0].DL_pmi_single = (unsigned short)(taus()&0xffff); + eNB->UE_stats[0].DL_pmi_single = (unsigned short)(taus()&0xffff); - if (n_users>1) - eNB->UE_stats[1].DL_pmi_single = (eNB->UE_stats[0].DL_pmi_single ^ 0x1555); //opposite PMI + if (n_users>1) eNB->UE_stats[1].DL_pmi_single = (eNB->UE_stats[0].DL_pmi_single ^ 0x1555); //opposite PMI } else { - eNB->UE_stats[0].DL_pmi_single = 0; + eNB->UE_stats[0].DL_pmi_single = 0; - if (n_users>1) - eNB->UE_stats[1].DL_pmi_single = 0; + if (n_users>1) eNB->UE_stats[1].DL_pmi_single = 0; } L1_rxtx_proc_t *proc_eNB = &eNB->proc.L1_proc; //&eNB->proc.proc_rxtx[0]; //UE->current_thread_id[subframe]]; diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 19e0e7dc25af48217c833b64cb9e2cbf29215644..c0e0eecc1d39e6695537fe654b9df8062010931e 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -85,8 +85,7 @@ int main(int argc, char **argv) { char c; - - int i,aa;//,l; + int i; double sigma2, sigma2_dB=10,SNR,snr0=-2.0,snr1=2.0; double cfo=0; uint8_t snr1set=0; @@ -98,8 +97,8 @@ int main(int argc, char **argv) uint8_t write_output_file=0; //int result; //int freq_offset; - // int subframe_offset; - // char fname[40], vname[40]; + //int subframe_offset; + //char fname[40], vname[40]; int trial,n_trials=1,n_errors=0; uint8_t transmission_mode = 1,n_tx=1,n_rx=1; uint16_t Nid_cell=0; @@ -107,8 +106,8 @@ int main(int argc, char **argv) channel_desc_t *gNB2UE; - uint8_t extended_prefix_flag=0; - int8_t interf1=-21,interf2=-21; + //uint8_t extended_prefix_flag=0; + //int8_t interf1=-21,interf2=-21; FILE *input_fd=NULL,*pbch_file_fd=NULL; @@ -123,26 +122,26 @@ int main(int argc, char **argv) int N_RB_DL=273,mu=1; - unsigned char frame_type = 0; + //unsigned char frame_type = 0; unsigned char pbch_phase = 0; - int frame=0,subframe=0; + //int frame=0,subframe=0; int frame_length_complex_samples; - int frame_length_complex_samples_no_prefix; + //int frame_length_complex_samples_no_prefix; NR_DL_FRAME_PARMS *frame_parms; - nfapi_nr_config_request_t *gNB_config; + //nfapi_nr_config_request_t *gNB_config; int loglvl=OAILOG_WARNING; cpuf = get_cpu_freq_GHz(); - if ( load_configmodule(argc,argv) == 0) { + if ( load_configmodule(argc,argv,0) == 0) { exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); } randominit(0); - while ((c = getopt (argc, argv, "f:hA:pf:g:i:j:n:o:s:S:t:x:y:z:N:F:GR:dP:IL:")) != -1) { + while ((c = getopt (argc, argv, "f:hA:f:g:n:o:s:S:t:x:y:z:N:F:GR:P:IL:")) != -1) { switch (c) { case 'f': write_output_file=1; @@ -155,9 +154,9 @@ int main(int argc, char **argv) break; - case 'd': + /*case 'd': frame_type = 1; - break; + break;*/ case 'g': switch((char)*optarg) { @@ -196,13 +195,13 @@ int main(int argc, char **argv) break; - case 'i': + /*case 'i': interf1=atoi(optarg); break; case 'j': interf2=atoi(optarg); - break; + break;*/ case 'n': n_trials = atoi(optarg); @@ -228,12 +227,12 @@ int main(int argc, char **argv) case 't': Td= atof(optarg); break; - */ + case 'p': extended_prefix_flag=1; break; - /* + case 'r': ricean_factor = pow(10,-.1*atof(optarg)); if (ricean_factor>1) { @@ -347,7 +346,7 @@ int main(int argc, char **argv) RC.gNB[0] = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *)); RC.gNB[0][0] = malloc(sizeof(PHY_VARS_gNB)); gNB = RC.gNB[0][0]; - gNB_config = &gNB->gNB_config; + //gNB_config = &gNB->gNB_config; frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH) frame_parms->nb_antennas_tx = n_tx; frame_parms->nb_antennas_rx = n_rx; @@ -411,7 +410,7 @@ int main(int argc, char **argv) } frame_length_complex_samples = frame_parms->samples_per_subframe*NR_NUMBER_OF_SUBFRAMES_PER_FRAME; - frame_length_complex_samples_no_prefix = frame_parms->samples_per_subframe_wCP; + //frame_length_complex_samples_no_prefix = frame_parms->samples_per_subframe_wCP; s_re = malloc(2*sizeof(double*)); s_im = malloc(2*sizeof(double*)); @@ -537,6 +536,3 @@ int main(int argc, char **argv) return(n_errors); } - - - diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 6fd10edf04aa9f89d91e3595e616c040014438c2..7b2188c7ce07bdfe32a365ad350273c4f0a6a878 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -178,9 +178,9 @@ typedef struct RrcConfigurationReq_s { uint16_t mnc[PLMN_LIST_MAX_SIZE]; uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE]; uint8_t num_plmn; - + int enable_measurement_reports; + int enable_x2; uint32_t rrc_inactivity_timer_thres; // for testing, maybe change later - paging_drx_t default_drx; int16_t nb_cc; lte_frame_type_t frame_type[MAX_NUM_CCs]; diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c index 7110f681d78efa51f03c25a809c467100c59a515..656cedfe6254b6ce95141b16e06a0142e5cecb90 100644 --- a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c +++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c @@ -122,8 +122,13 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, for (j = 0; j < ue_report[i]->n_rlc_report; j++) { rlc_reports[j] = malloc(sizeof(Protocol__FlexRlcBsr)); - if (rlc_reports[j] == NULL) + if (rlc_reports[j] == NULL){ + for (k = 0; k < j; k++){ + free(rlc_reports[k]); + } + free(rlc_reports); goto error; + } protocol__flex_rlc_bsr__init(rlc_reports[j]); rlc_reports[j]->lc_id = j+1; rlc_reports[j]->has_lc_id = 1; @@ -180,8 +185,10 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, //Create the actual CSI reports. Protocol__FlexDlCsi **csi_reports; csi_reports = malloc(sizeof(Protocol__FlexDlCsi *)*dl_report->n_csi_report); - if (csi_reports == NULL) + if (csi_reports == NULL) { + free(dl_report); goto error; + } for (j = 0; j < dl_report->n_csi_report; j++) { csi_reports[j] = malloc(sizeof(Protocol__FlexDlCsi)); @@ -402,14 +409,18 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, //Provide a report for each pending paging message Protocol__FlexPagingInfo **p_info; p_info = malloc(sizeof(Protocol__FlexPagingInfo *) * paging_report->n_paging_info); - if (p_info == NULL) + if (p_info == NULL){ + free(paging_report); goto error; + } for (j = 0; j < paging_report->n_paging_info; j++) { p_info[j] = malloc(sizeof(Protocol__FlexPagingInfo)); - if(p_info[j] == NULL) + if(p_info[j] == NULL){ + free(paging_report); goto error; + } protocol__flex_paging_info__init(p_info[j]); //TODO: Set paging index. This index is the same that will be used for the scheduling of the //paging message by the controller @@ -450,14 +461,22 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, full_ul_report->n_cqi_meas = 1; Protocol__FlexUlCqi **ul_report; ul_report = malloc(sizeof(Protocol__FlexUlCqi *) * full_ul_report->n_cqi_meas); - if(ul_report == NULL) + if(ul_report == NULL) { + free(full_ul_report); goto error; + } //Fill each UL report of the UE for each of the configured report types for(j = 0; j < full_ul_report->n_cqi_meas; j++) { ul_report[j] = malloc(sizeof(Protocol__FlexUlCqi)); - if(ul_report[j] == NULL) - goto error; + if(ul_report[j] == NULL) { + for (k = 0; k < j; k++) { + free(ul_report[k]); + } + free(ul_report); + free(full_ul_report); + goto error; + } protocol__flex_ul_cqi__init(ul_report[j]); //TODO: Set the type of the UL report. As an example set it to SRS UL report // See enum flex_ul_cqi_type in FlexRAN specification for more details @@ -468,8 +487,14 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, ul_report[j]->n_sinr = 0; uint32_t *sinr_meas; sinr_meas = (uint32_t *) malloc(sizeof(uint32_t) * ul_report[j]->n_sinr); - if (sinr_meas == NULL) + if (sinr_meas == NULL) { + for (k = 0; k < j; k++) { + free(ul_report[k]); + } + free(ul_report); + free(full_ul_report); goto error; + } //TODO:Set the SINR measurements for the specified type for (k = 0; k < ul_report[j]->n_sinr; k++) { sinr_meas[k] = 10; @@ -573,8 +598,10 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, Protocol__FlexMacSdusDl ** mac_sdus; mac_sdus = malloc(sizeof(Protocol__FlexMacSdusDl) * flexran_get_num_mac_sdu_tx(mod_id, UE_id, cc_id)); - if (mac_sdus == NULL) + if (mac_sdus == NULL) { + free(macstats); goto error; + } macstats->n_mac_sdus_dl = flexran_get_num_mac_sdu_tx(mod_id, UE_id, cc_id); @@ -653,10 +680,125 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, error: - if (cell_report != NULL) - free(cell_report); - if (ue_report != NULL) - free(ue_report); + if (cell_report != NULL) { + if (report_config->nr_cc > 0) { + for (i = 0; i < report_config->nr_cc; i++) { + if (cell_report[i]->noise_inter_report != NULL) { + free(cell_report[i]->noise_inter_report); + cell_report[i]->noise_inter_report = NULL; + } + } + } + free(cell_report); + cell_report = NULL; + } + + if (ue_report != NULL) { + if (report_config->nr_ue > 0) { + for (i = 0; i < report_config->nr_ue; i++) { + if (ue_report[i]->bsr != NULL) { + free(ue_report[i]->bsr); + ue_report[i]->bsr = NULL; + } + if (ue_report[i]->rlc_report != NULL) { + for (j = 0; j < ue_report[i]->n_rlc_report; j++) { + if (ue_report[i]->rlc_report[j] != NULL) { + free(ue_report[i]->rlc_report[j]); + ue_report[i]->rlc_report[j] = NULL; + } + } + free(ue_report[i]->rlc_report); + ue_report[i]->rlc_report = NULL; + } + if (ue_report[i]->dl_cqi_report != NULL) { + if (ue_report[i]->dl_cqi_report->csi_report != NULL) { + for (j = 0; j < ue_report[i]->dl_cqi_report->n_csi_report; j++) { + if (ue_report[i]->dl_cqi_report->csi_report[j] != NULL) { + if (ue_report[i]->dl_cqi_report->csi_report[j]->p10csi != NULL) { + free(ue_report[i]->dl_cqi_report->csi_report[j]->p10csi); + ue_report[i]->dl_cqi_report->csi_report[j]->p10csi = NULL; + } + if (ue_report[i]->dl_cqi_report->csi_report[j]->p11csi != NULL) { + if (ue_report[i]->dl_cqi_report->csi_report[j]->p11csi->wb_cqi != NULL) { + free(ue_report[i]->dl_cqi_report->csi_report[j]->p11csi->wb_cqi); + ue_report[i]->dl_cqi_report->csi_report[j]->p11csi->wb_cqi = NULL; + } + free(ue_report[i]->dl_cqi_report->csi_report[j]->p11csi); + ue_report[i]->dl_cqi_report->csi_report[j]->p11csi = NULL; + } + if (ue_report[i]->dl_cqi_report->csi_report[j]->p20csi != NULL) { + free(ue_report[i]->dl_cqi_report->csi_report[j]->p20csi); + ue_report[i]->dl_cqi_report->csi_report[j]->p20csi = NULL; + } + free(ue_report[i]->dl_cqi_report->csi_report[j]); + ue_report[i]->dl_cqi_report->csi_report[j] = NULL; + } + } + free(ue_report[i]->dl_cqi_report->csi_report); + ue_report[i]->dl_cqi_report->csi_report = NULL; + } + free(ue_report[i]->dl_cqi_report); + ue_report[i]->dl_cqi_report = NULL; + } + if (ue_report[i]->pbr != NULL) { + if (ue_report[i]->pbr->paging_info != NULL) { + for (j = 0; j < ue_report[i]->pbr->n_paging_info; j++) { + free(ue_report[i]->pbr->paging_info[j]); + ue_report[i]->pbr->paging_info[j] = NULL; + } + free(ue_report[i]->pbr->paging_info); + ue_report[i]->pbr->paging_info = NULL; + } + free(ue_report[i]->pbr); + ue_report[i]->pbr = NULL; + } + if (ue_report[i]->ul_cqi_report != NULL) { + if (ue_report[i]->ul_cqi_report->cqi_meas != NULL) { + for (j = 0; j < ue_report[i]->ul_cqi_report->n_cqi_meas; j++) { + if (ue_report[i]->ul_cqi_report->cqi_meas[j] != NULL) { + if (ue_report[i]->ul_cqi_report->cqi_meas[j]->sinr != NULL) { + free(ue_report[i]->ul_cqi_report->cqi_meas[j]->sinr); + ue_report[i]->ul_cqi_report->cqi_meas[j]->sinr = NULL; + } + free(ue_report[i]->ul_cqi_report->cqi_meas[j]); + ue_report[i]->ul_cqi_report->cqi_meas[j] = NULL; + } + } + free(ue_report[i]->ul_cqi_report->cqi_meas); + ue_report[i]->ul_cqi_report->cqi_meas = NULL; + } + if (ue_report[i]->ul_cqi_report->pucch_dbm != NULL) { + for (j = 0; j < MAX_NUM_CCs; j++) { + if (ue_report[i]->ul_cqi_report->pucch_dbm[j] != NULL) { + free(ue_report[i]->ul_cqi_report->pucch_dbm[j]); + ue_report[i]->ul_cqi_report->pucch_dbm[j] = NULL; + } + } + free(ue_report[i]->ul_cqi_report->pucch_dbm); + ue_report[i]->ul_cqi_report->pucch_dbm = NULL; + } + free(ue_report[i]->ul_cqi_report); + ue_report[i]->ul_cqi_report = NULL; + } + if (ue_report[i]->mac_stats != NULL) { + if (ue_report[i]->mac_stats->mac_sdus_dl != NULL) { + for (j = 0; j < ue_report[i]->mac_stats->n_mac_sdus_dl; j++) { + if (ue_report[i]->mac_stats->mac_sdus_dl[j] != NULL) { + free(ue_report[i]->mac_stats->mac_sdus_dl[j]); + ue_report[i]->mac_stats->mac_sdus_dl[j] = NULL; + } + } + free(ue_report[i]->mac_stats->mac_sdus_dl); + ue_report[i]->mac_stats->mac_sdus_dl = NULL; + } + free(ue_report[i]->mac_stats); + ue_report[i]->mac_stats = NULL; + } + } + } + free(ue_report); + ue_report = NULL; + } return -1; } @@ -1014,11 +1156,28 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle if (header != NULL) free(header); if (sf_trigger_msg != NULL) { - for (i = 0; i < sf_trigger_msg->n_dl_info; i++) { - free(sf_trigger_msg->dl_info[i]->harq_status); + if (sf_trigger_msg->dl_info != NULL) { + for (i = 0; i < sf_trigger_msg->n_dl_info; i++) { + if (sf_trigger_msg->dl_info[i] != NULL) { + if (sf_trigger_msg->dl_info[i]->harq_status != NULL) { + free(sf_trigger_msg->dl_info[i]->harq_status); + } + free(sf_trigger_msg->dl_info[i]); + } + } + free(sf_trigger_msg->dl_info); + } + if (sf_trigger_msg->ul_info != NULL) { + for (i = 0; i < sf_trigger_msg->n_ul_info; i++) { + if (sf_trigger_msg->ul_info[i] != NULL) { + if (sf_trigger_msg->ul_info[i]->ul_reception != NULL) { + free(sf_trigger_msg->ul_info[i]->ul_reception); + } + free(sf_trigger_msg->ul_info[i]); + } + } + free(sf_trigger_msg->ul_info); } - free(sf_trigger_msg->dl_info); - free(sf_trigger_msg->ul_info); free(sf_trigger_msg); } if(*msg != NULL) @@ -1063,6 +1222,7 @@ int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMess Protocol__FlexDlMacConfig *dl_mac_config_msg; dl_mac_config_msg = malloc(sizeof(Protocol__FlexDlMacConfig)); if (dl_mac_config_msg == NULL) { + free(header); goto error; } protocol__flex_dl_mac_config__init(dl_mac_config_msg); @@ -1072,8 +1232,11 @@ int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMess dl_mac_config_msg->sfn_sf = flexran_get_sfn_sf(mod_id); *msg = malloc(sizeof(Protocol__FlexranMessage)); - if(*msg == NULL) + if(*msg == NULL) { + free(dl_mac_config_msg); + free(header); goto error; + } protocol__flexran_message__init(*msg); (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG; (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE; @@ -1167,8 +1330,10 @@ int flexran_agent_mac_create_empty_ul_config(mid_t mod_id, Protocol__FlexranMess ul_mac_config_msg->sfn_sf = flexran_get_sfn_sf(mod_id); *msg = malloc(sizeof(Protocol__FlexranMessage)); - if(*msg == NULL) + if(*msg == NULL) { + free(ul_mac_config_msg); goto error; + } protocol__flexran_message__init(*msg); (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_UL_MAC_CONFIG_MSG; (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE; @@ -1177,6 +1342,10 @@ int flexran_agent_mac_create_empty_ul_config(mid_t mod_id, Protocol__FlexranMess return 0; error: + if(header){ + free(header); + header = NULL; + } return -1; } @@ -1292,7 +1461,7 @@ void flexran_agent_init_mac_agent(mid_t mod_id) { void flexran_agent_send_sr_info(mid_t mod_id) { int size; - Protocol__FlexranMessage *msg; + Protocol__FlexranMessage *msg = NULL; void *data; int priority = 0; err_code_t err_code; @@ -1322,7 +1491,7 @@ void flexran_agent_send_sr_info(mid_t mod_id) { void flexran_agent_send_sf_trigger(mid_t mod_id) { int size; - Protocol__FlexranMessage *msg; + Protocol__FlexranMessage *msg = NULL; void *data; int priority = 0; err_code_t err_code; diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c index 6ce9038923f21f5ede29e012cd8468c9f8e1726e..2a7d1fe186d06b62aadbb50e17a926756db9719a 100644 --- a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c +++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c @@ -151,6 +151,15 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol return msg; error: + if (stats_reply_msg) { + if (stats_reply_msg->ue_report) { + free(stats_reply_msg->ue_report); + } + if (stats_reply_msg->cell_report) { + free(stats_reply_msg->cell_report); + } + free(stats_reply_msg); + } return NULL; } @@ -233,6 +242,12 @@ Protocol__FlexUeStatsReport * copy_ue_stats_report(Protocol__FlexUeStatsReport * return copy; error: + if (copy){ + if (copy->bsr){ + free(copy->bsr); + } + free(copy); + } return NULL; } @@ -303,6 +318,20 @@ Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * origi return full_ul_report; error: + if (full_ul_report){ + if (ul_report){ + for (i = 0; i < full_ul_report->n_cqi_meas; i++){ + if (ul_report[i]){ + if ( ul_report[i]->sinr ){ + free(ul_report[i]->sinr); + } + free(ul_report[i]); + } + } + free(ul_report); + } + free(full_ul_report); + } return NULL; } @@ -369,6 +398,18 @@ Protocol__FlexPagingBufferReport * copy_paging_buffer_report(Protocol__FlexPagin error: /*TODO: free memory properly*/ + if (copy){ + if (p_info){ + for (i = 0; i < copy->n_paging_info; i++){ + if (p_info[i]){ + free(p_info[i]); + } + } + free(p_info); + } + free(copy); + copy = NULL; + } return NULL; } @@ -902,6 +943,13 @@ int load_dl_scheduler_function(mid_t mod_id, const char *function_name) { LOG_I(FLEXRAN_AGENT, "Scheduler could not be loaded\n"); } + if (flexran_agent_get_mac_xface(mod_id)) { + if (flexran_agent_get_mac_xface(mod_id)->dl_scheduler_loaded_lib != lib) { + dlclose(lib); + } + } else { + dlclose(lib); + } return 0; error: diff --git a/openair2/ENB_APP/CONTROL_MODULES/RRC/flexran_agent_rrc.c b/openair2/ENB_APP/CONTROL_MODULES/RRC/flexran_agent_rrc.c index a785c681635f2db9d0c6cb83b8a80a5f531dd5ae..dfc50683ff51baa5890263628066ee780e63ef39 100644 --- a/openair2/ENB_APP/CONTROL_MODULES/RRC/flexran_agent_rrc.c +++ b/openair2/ENB_APP/CONTROL_MODULES/RRC/flexran_agent_rrc.c @@ -44,6 +44,8 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch int size; Protocol__FlexranMessage *msg = NULL; Protocol__FlexHeader *header = NULL; + Protocol__FlexUeStateChange *ue_state_change_msg = NULL; + Protocol__FlexUeConfig *config = NULL; void *data; int priority = 0; err_code_t err_code=0; @@ -53,7 +55,6 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UE_STATE_CHANGE, &header) != 0) goto error; - Protocol__FlexUeStateChange *ue_state_change_msg; ue_state_change_msg = malloc(sizeof(Protocol__FlexUeStateChange)); if(ue_state_change_msg == NULL) { goto error; @@ -62,7 +63,6 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch ue_state_change_msg->has_type = 1; ue_state_change_msg->type = state_change; - Protocol__FlexUeConfig *config; config = malloc(sizeof(Protocol__FlexUeConfig)); if (config == NULL) { goto error; @@ -103,11 +103,24 @@ void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_ch } LOG_D(FLEXRAN_AGENT,"sent message with size %d\n", size); + free(header); return; error: if (err_code != 0) LOG_E(FLEXRAN_AGENT, "Could not send UE state message becasue of %d for RNTI %x\n", err_code, rnti); + if (header){ + free(header); + } + if (ue_state_change_msg) { + free(ue_state_change_msg); + } + if (config) { + free(config); + } + if (msg) { + free(msg); + } } @@ -405,8 +418,13 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, for (int j = 0; j < neigh_meas->n_eutra_meas; j++ ){ eutra_meas[j] = malloc(sizeof(Protocol__FlexEutraMeasurements)); - if (eutra_meas[j] == NULL) + if (eutra_meas[j] == NULL) { + for (int k = 0 ; k < j ; k++) { + free(eutra_meas[k]); + } + free(eutra_meas); goto error; + } protocol__flex_eutra_measurements__init(eutra_meas[j]); diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 555b328e8bb2f6fd2d60e1d4f9ef126e479ed15e..dc6c113b230df3016237ff323badff6b1ea7b8ef 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -48,19 +48,18 @@ #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "nfapi_vnf.h" #include "nfapi_pnf.h" - +#include "targets/RT/USER/lte-softmodem.h" #include "L1_paramdef.h" #include "MACRLC_paramdef.h" #include "common/config/config_userapi.h" #include "RRC_config_tools.h" #include "enb_paramdef.h" #include "proto_agent.h" -#define RRC_INACTIVITY_THRESH 0 extern void set_parallel_conf(char *parallel_conf); extern void set_worker_conf(char *worker_conf); -extern PARALLEL_CONF_t get_thread_parallel_conf(void); -extern WORKER_CONF_t get_thread_worker_conf(void); +//extern PARALLEL_CONF_t get_thread_parallel_conf(void); +//extern WORKER_CONF_t get_thread_worker_conf(void); extern uint32_t to_earfcn_DL(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw); extern uint32_t to_earfcn_UL(int eutra_bandP, uint32_t ul_CarrierFreq, uint32_t bw); extern char *parallel_config; @@ -383,7 +382,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { for (int I = 0; I < sizeof(PLMNParams) / sizeof(paramdef_t); ++I) PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]); - RRC_CONFIGURATION_REQ (msg_p).rrc_inactivity_timer_thres = RRC_INACTIVITY_THRESH; // set to 0 to deactivate + //RRC_CONFIGURATION_REQ (msg_p).rrc_inactivity_timer_thres = RRC_INACTIVITY_THRESH; // set to 0 to deactivate + // In the configuration file it is in seconds. For RRC it has to be in milliseconds + RRC_CONFIGURATION_REQ (msg_p).rrc_inactivity_timer_thres = (*ENBParamList.paramarray[i][ENB_RRC_INACTIVITY_THRES_IDX].uptr) * 1000; RRC_CONFIGURATION_REQ (msg_p).cell_identity = enb_id; RRC_CONFIGURATION_REQ (msg_p).tac = *ENBParamList.paramarray[i][ENB_TRACKING_AREA_CODE_IDX].uptr; AssertFatal(!ENBParamList.paramarray[i][ENB_MOBILE_COUNTRY_CODE_IDX_OLD].strptr @@ -413,6 +414,22 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) { RRC_CONFIGURATION_REQ(msg_p).mnc[l]); } + /* measurement reports enabled? */ + if (ENBParamList.paramarray[i][ENB_ENABLE_MEASUREMENT_REPORTS].strptr != NULL && + *(ENBParamList.paramarray[i][ENB_ENABLE_MEASUREMENT_REPORTS].strptr) != NULL && + !strcmp(*(ENBParamList.paramarray[i][ENB_ENABLE_MEASUREMENT_REPORTS].strptr), "yes")) + RRC_CONFIGURATION_REQ (msg_p).enable_measurement_reports = 1; + else + RRC_CONFIGURATION_REQ (msg_p).enable_measurement_reports = 0; + + /* x2 enabled? */ + if (ENBParamList.paramarray[i][ENB_ENABLE_X2].strptr != NULL && + *(ENBParamList.paramarray[i][ENB_ENABLE_X2].strptr) != NULL && + !strcmp(*(ENBParamList.paramarray[i][ENB_ENABLE_X2].strptr), "yes")) + RRC_CONFIGURATION_REQ (msg_p).enable_x2 = 1; + else + RRC_CONFIGURATION_REQ (msg_p).enable_x2 = 0; + // Parse optional physical parameters config_getlist( &CCsParamList,NULL,0,enbpath); LOG_I(RRC,"num component carriers %d \n",CCsParamList.numelt); @@ -2551,6 +2568,8 @@ int RCconfig_parallel(void) { set_worker_conf(worker_conf); } + free(worker_conf); + free(parallel_conf); return 0; } diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index effe8cc56a0357b3694b8a2ad0de42c97a682f7a..23d0764e40240b100f16546c5f7edfe74d5c8ee2 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -192,6 +192,9 @@ typedef enum { #define ENB_CONFIG_STRING_LOCAL_S_PORTD "local_s_portd" #define ENB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd" #define ENB_CONFIG_STRING_NR_CELLID "nr_cellid" +#define ENB_CONFIG_STRING_RRC_INACTIVITY_THRESHOLD "rrc_inactivity_threshold" +#define ENB_CONFIG_STRING_MEASUREMENT_REPORTS "enable_measurement_reports" +#define ENB_CONFIG_STRING_X2 "enable_x2" /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* cell configuration parameters */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ @@ -211,7 +214,10 @@ typedef enum { {ENB_CONFIG_STRING_REMOTE_S_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ -{ENB_CONFIG_STRING_NR_CELLID, NULL, 0, u64ptr:NULL, defint64val:0, TYPE_UINT64, 0}, \ +{ENB_CONFIG_STRING_NR_CELLID, NULL, 0, u64ptr:NULL, defint64val:0, TYPE_UINT64, 0}, \ +{ENB_CONFIG_STRING_RRC_INACTIVITY_THRESHOLD, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_MEASUREMENT_REPORTS, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{ENB_CONFIG_STRING_X2, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ } #define ENB_ENB_ID_IDX 0 #define ENB_CELL_TYPE_IDX 1 @@ -228,6 +234,9 @@ typedef enum { #define ENB_LOCAL_S_PORTD_IDX 12 #define ENB_REMOTE_S_PORTD_IDX 13 #define ENB_NRCELLID_IDX 14 +#define ENB_RRC_INACTIVITY_THRES_IDX 15 +#define ENB_ENABLE_MEASUREMENT_REPORTS 16 +#define ENB_ENABLE_X2 17 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define ENBPARAMS_CHECK { \ @@ -245,6 +254,8 @@ typedef enum { { .s5 = { NULL } }, \ { .s5 = { NULL } }, \ { .s5 = { NULL } }, \ + { .s5 = { NULL } }, \ + { .s5 = { NULL } }, \ } /*-------------------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/openair2/ENB_APP/flexran_agent_async.c b/openair2/ENB_APP/flexran_agent_async.c index fa2e0c9ff583c1f5d7e697f325f2b514b5f3cffb..26c0d9325905c51ca07fccdc650d643d0a67000c 100644 --- a/openair2/ENB_APP/flexran_agent_async.c +++ b/openair2/ENB_APP/flexran_agent_async.c @@ -84,6 +84,9 @@ flexran_agent_async_channel_t * flexran_agent_async_channel_info(mid_t mod_id, c error: LOG_I(FLEXRAN_AGENT, "%s(): there was an error\n", __func__); + if (channel){ + free(channel); + } return NULL; } diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c index 72b0866fd6f0ac95763f37f2f8d58322293256a1..16f74ccd2f89440a151a9e947115870c985dcf51 100644 --- a/openair2/ENB_APP/flexran_agent_common.c +++ b/openair2/ENB_APP/flexran_agent_common.c @@ -127,7 +127,6 @@ int flexran_agent_hello(mid_t mod_id, const void *params, Protocol__FlexranMessa hello_msg->bs_id = flexran_get_bs_id(mod_id); hello_msg->has_bs_id = 1; hello_msg->n_capabilities = flexran_get_capabilities(mod_id, &hello_msg->capabilities); - *msg = malloc(sizeof(Protocol__FlexranMessage)); if(*msg == NULL) @@ -296,8 +295,10 @@ int flexran_agent_destroy_enb_config_reply(Protocol__FlexranMessage *msg) { for (int i = 0; i < reply->n_cell_config; i++) { if (reply->cell_config[i]->mbsfn_subframe_config_rfoffset) free(reply->cell_config[i]->mbsfn_subframe_config_rfoffset); + if (reply->cell_config[i]->mbsfn_subframe_config_rfperiod) free(reply->cell_config[i]->mbsfn_subframe_config_rfperiod); + if (reply->cell_config[i]->mbsfn_subframe_config_sfalloc) free(reply->cell_config[i]->mbsfn_subframe_config_sfalloc); @@ -305,6 +306,7 @@ int flexran_agent_destroy_enb_config_reply(Protocol__FlexranMessage *msg) { for(int j = 0; j < reply->cell_config[i]->si_config->n_si_message; j++) { free(reply->cell_config[i]->si_config->si_message[j]); } + free(reply->cell_config[i]->si_config->si_message); free(reply->cell_config[i]->si_config); } @@ -319,6 +321,7 @@ int flexran_agent_destroy_enb_config_reply(Protocol__FlexranMessage *msg) { } free(reply->cell_config[i]->slice_config->dl); + for (int j = 0; j < reply->cell_config[i]->slice_config->n_ul; ++j) { if (reply->cell_config[i]->slice_config->ul[j]->n_sorting > 0) free(reply->cell_config[i]->slice_config->ul[j]->sorting); @@ -492,16 +495,15 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl goto error; lc_config_reply_msg->header = header; - /* the lc_config_reply entirely depends on MAC except for the * mac_eNB_get_rrc_status() function (which in the current OAI implementation * is reachable if F1 is present). Therefore we check here wether MAC CM is * present and the message gets properly filled if it is or remains empty if * not */ lc_config_reply_msg->n_lc_ue_config = - flexran_agent_get_mac_xface(mod_id) ? flexran_get_mac_num_ues(mod_id) : 0; - + flexran_agent_get_mac_xface(mod_id) ? flexran_get_mac_num_ues(mod_id) : 0; Protocol__FlexLcUeConfig **lc_ue_config = NULL; + if (lc_config_reply_msg->n_lc_ue_config > 0) { lc_ue_config = malloc(sizeof(Protocol__FlexLcUeConfig *) * lc_config_reply_msg->n_lc_ue_config); @@ -512,7 +514,13 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl // Fill the config for each UE for (int i = 0; i < lc_config_reply_msg->n_lc_ue_config; i++) { lc_ue_config[i] = malloc(sizeof(Protocol__FlexLcUeConfig)); - if (!lc_ue_config[i]) goto error; + if (!lc_ue_config[i]){ + for (int j = 0; j < i; j++){ + free(lc_ue_config[j]); + } + free(lc_ue_config); + goto error; + } protocol__flex_lc_ue_config__init(lc_ue_config[i]); const int UE_id = flexran_get_mac_ue_id(mod_id, i); @@ -524,8 +532,13 @@ int flexran_agent_lc_config_reply(mid_t mod_id, const void *params, Protocol__Fl *msg = malloc(sizeof(Protocol__FlexranMessage)); - if (*msg == NULL) + if (*msg == NULL){ + for (int k = 0; k < lc_config_reply_msg->n_lc_ue_config; k++){ + free(lc_ue_config[k]); + } + free(lc_ue_config); goto error; + } protocol__flexran_message__init(*msg); (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REPLY_MSG; @@ -554,8 +567,7 @@ error: * ************************************ */ -int sort_ue_config(const void *a, const void *b) -{ +int sort_ue_config(const void *a, const void *b) { const Protocol__FlexUeConfig *fa = a; const Protocol__FlexUeConfig *fb = b; @@ -563,6 +575,7 @@ int sort_ue_config(const void *a, const void *b) return -1; else if (fa->rnti < fb->rnti) return 1; + return 0; } @@ -584,8 +597,8 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl goto error; ue_config_reply_msg->header = header; - ue_config_reply_msg->n_ue_config = 0; + if (flexran_agent_get_rrc_xface(mod_id)) ue_config_reply_msg->n_ue_config = flexran_get_rrc_num_ues(mod_id); else if (flexran_agent_get_mac_xface(mod_id)) @@ -597,7 +610,7 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl const int nmac = flexran_get_mac_num_ues(mod_id); ue_config_reply_msg->n_ue_config = nrrc < nmac ? nrrc : nmac; LOG_E(FLEXRAN_AGENT, "%s(): different numbers of UEs in RRC (%d) and MAC (%d), reporting for %lu UEs\n", - __func__, nrrc, nmac, ue_config_reply_msg->n_ue_config); + __func__, nrrc, nmac, ue_config_reply_msg->n_ue_config); } Protocol__FlexUeConfig **ue_config; @@ -608,8 +621,10 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl if (ue_config == NULL) { goto error; } + rnti_t rntis[ue_config_reply_msg->n_ue_config]; flexran_get_rrc_rnti_list(mod_id, rntis, ue_config_reply_msg->n_ue_config); + for (int i = 0; i < ue_config_reply_msg->n_ue_config; i++) { const rnti_t rnti = rntis[i]; ue_config[i] = malloc(sizeof(Protocol__FlexUeConfig)); @@ -617,11 +632,13 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl if (flexran_agent_get_rrc_xface(mod_id)) flexran_agent_fill_rrc_ue_config(mod_id, rnti, ue_config[i]); + if (flexran_agent_get_mac_xface(mod_id)) { const int UE_id = flexran_get_mac_ue_id_rnti(mod_id, rnti); flexran_agent_fill_mac_ue_config(mod_id, UE_id, ue_config[i]); } } + ue_config_reply_msg->ue_config = ue_config; } @@ -725,14 +742,26 @@ int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__F if(cell_conf == NULL) goto error; - for(int i = 0; i < enb_config_reply_msg->n_cell_config; i++){ + + for(int i = 0; i < enb_config_reply_msg->n_cell_config; i++) { cell_conf[i] = malloc(sizeof(Protocol__FlexCellConfig)); - if (!cell_conf[i]) goto error; + + if (!cell_conf[i]) { + for (int j = 0; j < i; j++) { + free(cell_conf[j]); + } + free(cell_conf); + goto error; + } + protocol__flex_cell_config__init(cell_conf[i]); + if (flexran_agent_get_phy_xface(mod_id)) flexran_agent_fill_phy_cell_config(mod_id, i, cell_conf[i]); + if (flexran_agent_get_rrc_xface(mod_id)) flexran_agent_fill_rrc_cell_config(mod_id, i, cell_conf[i]); + if (flexran_agent_get_mac_xface(mod_id)) flexran_agent_fill_mac_cell_config(mod_id, i, cell_conf[i]); @@ -745,8 +774,13 @@ int flexran_agent_enb_config_reply(mid_t mod_id, const void *params, Protocol__F *msg = malloc(sizeof(Protocol__FlexranMessage)); - if(*msg == NULL) + if(*msg == NULL) { + for (int k = 0; k < enb_config_reply_msg->n_cell_config; k++) { + free(cell_conf[k]); + } + free(cell_conf); goto error; + } protocol__flexran_message__init(*msg); (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG; @@ -776,6 +810,8 @@ int flexran_agent_rrc_measurement(mid_t mod_id, const void *params, Protocol__Fl Protocol__FlexRrcTriggering *triggering = input->rrc_triggering; agent_reconf_rrc *reconf_param = malloc(sizeof(agent_reconf_rrc)); reconf_param->trigger_policy = triggering->rrc_trigger; + reconf_param->report_interval = 0; + reconf_param->report_amount = 0; struct rrc_eNB_ue_context_s *ue_context_p = NULL; RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[mod_id]->rrc_ue_head)) { PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, mod_id, ENB_FLAG_YES, ue_context_p->ue_context.rnti, flexran_get_current_frame(mod_id), flexran_get_current_subframe (mod_id), mod_id); @@ -804,10 +840,11 @@ int flexran_agent_handle_enb_config_reply(mid_t mod_id, const void *params, Prot if (enb_config->n_cell_config > 1) LOG_W(FLEXRAN_AGENT, "ignoring slice configs for other cell except cell 0\n"); + if (flexran_agent_get_mac_xface(mod_id) && enb_config->cell_config[0]->slice_config) { prepare_update_slice_config(mod_id, enb_config->cell_config[0]->slice_config); - //} else { - // initiate_soft_restart(mod_id, enb_config->cell_config[0]); + //} else { + // initiate_soft_restart(mod_id, enb_config->cell_config[0]); } *msg = NULL; diff --git a/openair2/ENB_APP/flexran_agent_handler.c b/openair2/ENB_APP/flexran_agent_handler.c index 9ffb1e6cecef63c49b4f38da4d057c4954c3664b..0c2c32e4d65d3312e98e889b5d2de2388a5c7047 100644 --- a/openair2/ENB_APP/flexran_agent_handler.c +++ b/openair2/ENB_APP/flexran_agent_handler.c @@ -293,7 +293,7 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr /* Check if request was periodical */ if (comp_req->report_frequency == PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_PERIODICAL) { /* Create a one off flexran message as an argument for the periodical task */ - Protocol__FlexranMessage *timer_msg; + Protocol__FlexranMessage *timer_msg = NULL; stats_request_config_t request_config; request_config.report_type = PROTOCOL__FLEX_STATS_TYPE__FLST_COMPLETE_STATS; request_config.report_frequency = PROTOCOL__FLEX_STATS_REPORT_FREQ__FLSRF_ONCE; @@ -311,7 +311,10 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr report_config.ue_report_type[0].ue_report_flags = ue_flags; } request_config.config = &report_config; - flexran_agent_stats_request(enb_id, xid, &request_config, &timer_msg); + if (flexran_agent_stats_request(enb_id, xid, &request_config, &timer_msg) == -1) { + err_code = -100; + goto error; + } /* Create a timer */ long timer_id = 0; flexran_agent_timer_args_t *timer_args = malloc(sizeof(flexran_agent_timer_args_t)); @@ -420,19 +423,21 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *report_config, Protocol__FlexranMessage **msg){ Protocol__FlexHeader *header = NULL; - err_code_t err_code; - int i; + Protocol__FlexUeStatsReport **ue_report = NULL; + Protocol__FlexCellStatsReport **cell_report = NULL; + Protocol__FlexStatsReply *stats_reply_msg = NULL; + err_code_t err_code = PROTOCOL__FLEXRAN_ERR__UNEXPECTED; + int i,j; - if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0) + if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0) { goto error; - - - Protocol__FlexStatsReply *stats_reply_msg; + } stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply)); - if (stats_reply_msg == NULL) + if (stats_reply_msg == NULL) { goto error; + } protocol__flex_stats_reply__init(stats_reply_msg); stats_reply_msg->header = header; @@ -442,16 +447,18 @@ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *re // UE report - Protocol__FlexUeStatsReport **ue_report; - - ue_report = malloc(sizeof(Protocol__FlexUeStatsReport *) * report_config->nr_ue); - if (ue_report == NULL) - goto error; + + if (ue_report == NULL) { + goto error; + } for (i = 0; i < report_config->nr_ue; i++) { ue_report[i] = malloc(sizeof(Protocol__FlexUeStatsReport)); + if (ue_report[i] == NULL) { + goto error; + } protocol__flex_ue_stats_report__init(ue_report[i]); ue_report[i]->rnti = report_config->ue_report_type[i].ue_rnti; ue_report[i]->has_rnti = 1; @@ -460,19 +467,18 @@ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *re } // cell rpoert - - Protocol__FlexCellStatsReport **cell_report; - cell_report = malloc(sizeof(Protocol__FlexCellStatsReport *) * report_config->nr_cc); - if (cell_report == NULL) + if (cell_report == NULL) { goto error; + } for (i = 0; i < report_config->nr_cc; i++) { cell_report[i] = malloc(sizeof(Protocol__FlexCellStatsReport)); - if(cell_report[i] == NULL) + if(cell_report[i] == NULL) { goto error; + } protocol__flex_cell_stats_report__init(cell_report[i]); cell_report[i]->carrier_index = report_config->cc_report_type[i].cc_id; @@ -507,8 +513,9 @@ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *re stats_reply_msg->ue_report = ue_report; *msg = malloc(sizeof(Protocol__FlexranMessage)); - if(*msg == NULL) + if(*msg == NULL) { goto error; + } protocol__flexran_message__init(*msg); (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_STATS_REPLY_MSG; (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__SUCCESSFUL_OUTCOME; @@ -518,8 +525,38 @@ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *re error : LOG_E(FLEXRAN_AGENT, "errno %d occured\n", err_code); - return err_code; + if (header != NULL) { + free(header); + header = NULL; + } + + if (stats_reply_msg != NULL) { + free(stats_reply_msg); + stats_reply_msg = NULL; + } + + if (ue_report != NULL) { + for (j = 0; j < report_config->nr_ue; j++) { + if (ue_report[j] != NULL) { + free(ue_report[j]); + } + } + free(ue_report); + ue_report = NULL; + } + + if (cell_report != NULL) { + for (j = 0; j < report_config->nr_cc; j++) { + if (cell_report[j] != NULL) { + free(cell_report[j]); + } + } + free(cell_report); + cell_report = NULL; + } + + return err_code; } /* @@ -705,7 +742,7 @@ err_code_t flexran_agent_enable_cont_stats_update(mid_t mod_id, goto error; } - Protocol__FlexranMessage *req_msg; + Protocol__FlexranMessage *req_msg = NULL; flexran_agent_stats_request(mod_id, xid, stats_req, &req_msg); stats_context[mod_id].stats_req = req_msg; diff --git a/openair2/F1AP/f1ap_common.c b/openair2/F1AP/f1ap_common.c index e9e69732beab8fcfc2a1a5670c30b5b05c19f58e..267626dd5ceecddea419461d7b2f7895d3430915 100644 --- a/openair2/F1AP/f1ap_common.c +++ b/openair2/F1AP/f1ap_common.c @@ -177,7 +177,7 @@ int f1ap_du_add_cu_ue_id(f1ap_cudu_inst_t *f1_inst, module_id_t du_ue_f1ap_id, module_id_t cu_ue_f1ap_id) { module_id_t f1ap_uid = f1ap_get_du_uid(f1_inst,du_ue_f1ap_id); - if (f1ap_uid < 0) return -1; + if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB) return -1; f1_inst->f1ap_ue[f1ap_uid].cu_ue_f1ap_id = cu_ue_f1ap_id; LOG_I(F1AP, "Adding cu_ue_f1ap_id %d for UE with RNTI %x\n", cu_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti); return 0; @@ -187,7 +187,7 @@ int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst, module_id_t cu_ue_f1ap_id, module_id_t du_ue_f1ap_id) { module_id_t f1ap_uid = f1ap_get_cu_uid(f1_inst,cu_ue_f1ap_id); - if (f1ap_uid < 0) return -1; + if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB) return -1; f1_inst->f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id; LOG_I(F1AP, "Adding du_ue_f1ap_id %d for UE with RNTI %x\n", du_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti); return 0; diff --git a/openair2/F1AP/f1ap_cu_interface_management.c b/openair2/F1AP/f1ap_cu_interface_management.c index b451a0145769111bec434951ef44d1989887b7a7..941dc41a4deb816d30e01503d9d7963c0d90b274 100644 --- a/openair2/F1AP/f1ap_cu_interface_management.c +++ b/openair2/F1AP/f1ap_cu_interface_management.c @@ -327,6 +327,7 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance, /* - nRCGI */ F1AP_NRCGI_t nRCGI; + memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(f1ap_setup_resp->mcc[i], f1ap_setup_resp->mnc[i], f1ap_setup_resp->mnc_digit_length[i], &nRCGI.pLMN_Identity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->nr_cellid[i], &nRCGI.nRCellIdentity); @@ -562,6 +563,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ /* - nRCGI */ F1AP_NRCGI_t nRCGI; + memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, &nRCGI.pLMN_Identity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); @@ -611,6 +613,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ /* - nRCGI */ F1AP_NRCGI_t nRCGI; + memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, &nRCGI.pLMN_Identity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); @@ -787,6 +790,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_ /* - nRCGI */ F1AP_NRCGI_t nRCGI; + memset(&nRCGI,0,sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, &nRCGI.pLMN_Identity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); diff --git a/openair2/F1AP/f1ap_cu_ue_context_management.c b/openair2/F1AP/f1ap_cu_ue_context_management.c index 6f6a84e40436dec5bf91b33d782db0d66c52d29d..edc5a2c0a9a30f0091a4345b8ad9db495493ff42 100644 --- a/openair2/F1AP/f1ap_cu_ue_context_management.c +++ b/openair2/F1AP/f1ap_cu_ue_context_management.c @@ -95,6 +95,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_NRCGI; /* - nRCGI */ F1AP_NRCGI_t nRCGI; + memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(f1ap_ue_context_setup_req->mcc, f1ap_ue_context_setup_req->mnc, f1ap_ue_context_setup_req->mnc_digit_length, @@ -1183,6 +1184,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) { // /* - sCell_ID */ F1AP_NRCGI_t nRCGI; + memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, &nRCGI.pLMN_Identity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); @@ -1222,6 +1224,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) { /* - sCell_ID */ F1AP_NRCGI_t nRCGI; + memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length, &nRCGI.pLMN_Identity); NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); diff --git a/openair2/F1AP/f1ap_du_interface_management.c b/openair2/F1AP/f1ap_du_interface_management.c index f076b28a44930fe37d228ed09d0b017733dd07bd..83f3da57b2a9cfffb5aee96ff1d8d57d26ae1e9e 100644 --- a/openair2/F1AP/f1ap_du_interface_management.c +++ b/openair2/F1AP/f1ap_du_interface_management.c @@ -169,6 +169,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) { /* - nRCGI */ F1AP_NRCGI_t nRCGI; + memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI.pLMN_Identity); LOG_D(F1AP, "plmn: (%d,%d)\n",f1ap_du_data->mcc[i],f1ap_du_data->mnc[i]); //MCC_MNC_TO_PLMNID(208, 95, 2, &nRCGI.pLMN_Identity); @@ -619,6 +620,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t)); /* - nRCGI */ F1AP_NRCGI_t nRCGI; + memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], &nRCGI.pLMN_Identity); LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n", nRCGI.nRCellIdentity.buf[0], @@ -778,6 +780,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, /* 3.1 oldNRCGI */ F1AP_NRCGI_t oldNRCGI; + memset(&oldNRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], &oldNRCGI.pLMN_Identity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &oldNRCGI.nRCellIdentity); @@ -790,6 +793,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, /* - nRCGI */ F1AP_NRCGI_t nRCGI; + memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], &nRCGI.pLMN_Identity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity); @@ -944,6 +948,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, /* 3.1 oldNRCGI */ F1AP_NRCGI_t oldNRCGI; + memset(&oldNRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], &oldNRCGI.pLMN_Identity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &oldNRCGI.nRCellIdentity); @@ -980,6 +985,7 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, /* 3.1 oldNRCGI */ F1AP_NRCGI_t nRCGI; + memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(f1ap_setup_req->mcc[i], f1ap_setup_req->mnc[i], f1ap_setup_req->mnc_digit_length[i], &nRCGI.pLMN_Identity); NR_CELL_ID_TO_BIT_STRING(f1ap_setup_req->nr_cellid[i], &nRCGI.nRCellIdentity); diff --git a/openair2/F1AP/f1ap_du_rrc_message_transfer.c b/openair2/F1AP/f1ap_du_rrc_message_transfer.c index bb477f56961fb48856fe4869215ce8048250b7cc..db1751c1e4c30170785b3bb54997b0694aa17d57 100644 --- a/openair2/F1AP/f1ap_du_rrc_message_transfer.c +++ b/openair2/F1AP/f1ap_du_rrc_message_transfer.c @@ -543,7 +543,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, , 0 , rrc_dl_sdu_len , pdcp_pdu_p -#ifdef Rel14 +#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) ,NULL ,NULL #endif @@ -799,6 +799,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP, ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_NRCGI; F1AP_NRCGI_t nRCGI; + memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[0], f1ap_du_data->mnc[0], f1ap_du_data->mnc_digit_length[0], &nRCGI.pLMN_Identity); NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[0], &nRCGI.nRCellIdentity); diff --git a/openair2/F1AP/f1ap_du_ue_context_management.c b/openair2/F1AP/f1ap_du_ue_context_management.c index 1a80132ea83d35fa47770c4e111cd1863b94d00f..2997f553c32b803ead2fe9c3fcb8d2ec5fd48be5 100644 --- a/openair2/F1AP/f1ap_du_ue_context_management.c +++ b/openair2/F1AP/f1ap_du_ue_context_management.c @@ -470,6 +470,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance) { /* sCell_ID */ F1AP_NRCGI_t nRCGI; // issue here + memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI.pLMN_Identity); NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[0], &nRCGI.nRCellIdentity); @@ -703,7 +704,7 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, , 0 , sdu_len , pdu_p -#ifdef Rel14 +#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) ,NULL ,NULL #endif @@ -1155,6 +1156,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) { /* - sCell_ID */ F1AP_NRCGI_t nRCGI; + memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t)); MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI.pLMN_Identity); diff --git a/openair2/F1AP/f1ap_handlers.c b/openair2/F1AP/f1ap_handlers.c index a5b6a0996303da9c8b05e1beedf9cc7287fa2c92..12aba18a9d857a0cf2c76641c84b0e38462850ca 100644 --- a/openair2/F1AP/f1ap_handlers.c +++ b/openair2/F1AP/f1ap_handlers.c @@ -98,7 +98,7 @@ int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream, } /* Checking procedure Code and direction of message */ - if (pdu.choice.initiatingMessage->procedureCode > sizeof(f1ap_messages_callback) / (3 * sizeof( + if (pdu.choice.initiatingMessage->procedureCode >= sizeof(f1ap_messages_callback) / (3 * sizeof( f1ap_message_decoded_callback)) || (pdu.present > F1AP_F1AP_PDU_PR_unsuccessfulOutcome)) { LOG_E(F1AP, "[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n", diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 95e2bf59e8ee6e8173c5b52376df39591fb5641b..1b73d33d4fa1a1c6c2859e6e291149d48bc1f2cd 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -44,6 +44,7 @@ #include "RRC/LTE/rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" +#include "openair2/RRC/LTE/rrc_eNB_UE_context.h" //#include "LAYER2/MAC/pre_processor.c" #include "pdcp.h" diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index e70ed082f97eefc83b0fa59717b270c50f8a19ce..f68db9ffec26af251aefb555e435347902f8cb10 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -1399,7 +1399,6 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP, // for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++) { - LOG_D(MAC, "Running preprocessor for UE %d (%x)\n", UE_id,(int)(UE_RNTI(module_idP, UE_id))); // initialize harq_pid and round cc = &RC.mac[module_idP]->common_channels[CC_id]; N_RBG[CC_id] = to_rbg(cc->mib->message.dl_Bandwidth); diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c index 6561cbf6259bcd7d6512629b124544ea20e0ea14..efc85b0025a9a08afed48f5de3fc5efe8c8f2dc3 100644 --- a/openair2/LAYER2/MAC/ue_procedures.c +++ b/openair2/LAYER2/MAC/ue_procedures.c @@ -54,6 +54,7 @@ #include "openair2/PHY_INTERFACE/phy_stub_UE.h" #include "pdcp.h" +#include "targets/RT/USER/lte-softmodem.h" #if defined(ENABLE_ITTI) #include "intertask_interface.h" @@ -3329,7 +3330,7 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframeP) { - mac_rlc_status_resp_t rlc_status; //, rlc_status_data; + mac_rlc_status_resp_t rlc_status = {0,0,0,0,0}; //, rlc_status_data; uint32_t absSF = (frameP*10)+subframeP; UE_MAC_INST *ue = &UE_mac_inst[module_idP]; int rvtab[4] = {0,2,3,1}; @@ -3370,10 +3371,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_ (ue->sltx_active == 1)) { // every 4th subframe, check for new data from RLC // 10 PRBs, mcs 19 int TBS = 4584/8; - int req; - - if (TBS <= rlc_status.bytes_in_buffer) req = TBS; - else req = rlc_status.bytes_in_buffer; + int req = (TBS <= rlc_status.bytes_in_buffer) ? TBS : rlc_status.bytes_in_buffer; if (req>0) { sdu_length = mac_rlc_data_req(module_idP, diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 81e59a7dd2c32ff760af8e39025370ad44397cff..42a2111e68c5c09012511d345494505a8772a272 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -80,13 +80,13 @@ void config_nr_mib(int Mod_idP, void config_common(int Mod_idP, int CC_idP, - int cellid, + int cellid, int nr_bandP, uint64_t ssb_pattern, - uint16_t ssb_periodicity, - uint64_t dl_CarrierFreqP, - uint32_t dl_BandwidthP){ - + uint16_t ssb_periodicity, + uint64_t dl_CarrierFreqP, + uint32_t dl_BandwidthP) +{ nfapi_nr_config_request_t *cfg = &RC.nrmac[Mod_idP]->config[CC_idP]; int mu = 1; @@ -134,19 +134,17 @@ void config_common(int Mod_idP, int rrc_mac_config_req_gNB(module_id_t Mod_idP, int CC_idP, - int cellid, + int cellid, int p_gNB, int nr_bandP, - uint64_t ssb_pattern, + uint64_t ssb_pattern, uint16_t ssb_enum_periodicity, uint64_t dl_CarrierFreqP, int dl_BandwidthP, NR_BCCH_BCH_Message_t *mib, - NR_ServingCellConfigCommon_t *servingcellconfigcommon - ){ - - - uint16_t ssb_periodicity; + NR_ServingCellConfigCommon_t *servingcellconfigcommon) +{ + uint16_t ssb_periodicity=0; switch (ssb_enum_periodicity) { case 0: @@ -167,7 +165,6 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, case 5: ssb_periodicity = 160; break; - } if( mib != NULL ){ @@ -191,17 +188,15 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, if( servingcellconfigcommon != NULL ){ config_common(Mod_idP, CC_idP, - cellid, + cellid, nr_bandP, - ssb_pattern, + ssb_pattern, ssb_periodicity, dl_CarrierFreqP, dl_BandwidthP ); }//END if( servingcellconfigcommon != NULL ) - - LOG_E(MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req); // if in nFAPI mode @@ -227,4 +222,3 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, return(0); }// END rrc_mac_config_req_gNB - diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index d1252c8d5afabc1643783df07ad9b9da2dc03fe3..46d8f1963682fef3b7571a63a5a1877039918ff3 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -55,7 +55,8 @@ #include "SIMULATION/ETH_TRANSPORT/proto.h" #include "UTIL/OSA/osa_defs.h" #include "openair2/RRC/NAS/nas_config.h" -# include "intertask_interface.h" +#include "intertask_interface.h" +#include "openair3/S1AP/s1ap_eNB.h" # include "gtpv1u_eNB_task.h" diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c index d588e833982e336e08487a7d18b1915fbe215636..2441094d7a48a7ffbc06b159669ca6cd7251ffff 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c @@ -499,7 +499,7 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP) (void)data_p; pdcp_t *pdcp_p = NULL; //TTN for D2D (PC5S) - int prose_addr_len; + int prose_addr_len = sizeof(prose_pdcp_addr); char send_buf[BUFSIZE], receive_buf[BUFSIZE]; //int optval; int bytes_received; diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent.c b/openair2/LAYER2/PROTO_AGENT/proto_agent.c index a39ebc6c84c44a17643a510ac587691db091f77d..bead6ad28d3fbc920f29fa8dbc4ec5370d5a83db 100644 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent.c +++ b/openair2/LAYER2/PROTO_AGENT/proto_agent.c @@ -40,14 +40,14 @@ #include "assertions.h" #include "proto_agent_net_comm.h" #include "proto_agent_async.h" - +#include <common/utils/system.h> #include <pthread.h> #define ENB_AGENT_MAX 9 proto_agent_instance_t proto_agent[MAX_DU]; -pthread_t new_thread(void *(*f)(void *), void *b); +//pthread_t new_thread(void *(*f)(void *), void *b); Protocol__FlexsplitMessage *proto_agent_timeout_fsp(void *args); @@ -117,7 +117,8 @@ int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p) { // over the channel // */ //} - proto_agent[mod_id].recv_thread = new_thread(proto_agent_receive, &proto_agent[mod_id]); + //proto_agent[mod_id].recv_thread = new_thread(proto_agent_receive, &proto_agent[mod_id]); + threadCreate(&proto_agent[mod_id].recv_thread, proto_agent_receive, &proto_agent[mod_id], "proto", -1, OAI_PRIORITY_RT_LOW); fprintf(stderr, "[PROTO_AGENT] server started at port %s:%d\n", p->local_ipv4_address, p->local_port); return 0; error: diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c index 1eca32b162d27bf98238dbde8d9d37dc63b0508b..835686fab1f55ec0b055ff04be07a23a48d06996 100644 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c +++ b/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c @@ -426,7 +426,7 @@ int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Proto ,confirmP ,pdcp_pdu_size ,pdcp_pdu_p - #ifdef Rel14 + #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) ,NULL ,NULL #endif diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c index 18db23eb5534291d239055b8d11632a4088f60d0..a0569b7f00d4f8c456b6c3840dbe7a193dc9d064 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c @@ -112,7 +112,7 @@ signed int rlc_um_get_pdu_infos( // PROTOCOL_RLC_UM_CTXT_FMT"[GET PDU INFO] SN %04d TOO MANY LIs ", // PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), // pdu_info_pP->sn); - if(pdu_info_pP->num_li > RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU) { + if(pdu_info_pP->num_li >= RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU) { LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT"[GET PDU INFO] SN %04d TOO MANY LIs \n", PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP, rlc_pP), pdu_info_pP->sn); diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index bfb8abfa06c284f1c928475e68068bf0d1d458bd..3dee6c61913416918bf84a917ca55244fb467a47 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -66,14 +66,14 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.preamble, UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance, UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti -#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) || (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) +#if (NR_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) || (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) //#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) ,0 #endif ); } -#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) +#if (NR_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) if (UL_info->rach_ind_br.rach_indication_body.number_of_preambles>0) { AssertFatal(UL_info->rach_ind_br.rach_indication_body.number_of_preambles<5,"More than 4 preambles not supported\n"); diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h index 63cbd68f227d2c076263d69a976a2e99a95cf077..b07068e08ed8ed72aa9ac20ee5eea368235e38d2 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h @@ -75,7 +75,7 @@ typedef struct{ /// RACH indication list nfapi_rach_indication_t rach_ind; -#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) +#if (NR_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) /// RACH indication list for BR UEs nfapi_rach_indication_t rach_ind_br; #endif diff --git a/openair2/RRC/LTE/L2_interface.c b/openair2/RRC/LTE/L2_interface.c index 7bfeb43b53d333249b812a88f6ea4801423a34e2..6cd61e0fd895539b2c96163832af8b6486d83b31 100644 --- a/openair2/RRC/LTE/L2_interface.c +++ b/openair2/RRC/LTE/L2_interface.c @@ -43,7 +43,8 @@ #include "flexran_agent_extern.h" #undef C_RNTI // C_RNTI is used in F1AP generated code, prevent preprocessor replace -#include "f1ap_du_rrc_message_transfer.h" +//#include "f1ap_du_rrc_message_transfer.h" +#include "openair2/F1AP/f1ap_du_rrc_message_transfer.h" extern RAN_CONTEXT_t RC; diff --git a/openair2/RRC/LTE/rrc_defs.h b/openair2/RRC/LTE/rrc_defs.h index 1da374dd4278d379a26ea04ad132f8ba56e36bd3..ba8cbe0f1c99f48895655d53acbf3fa060a175dd 100644 --- a/openair2/RRC/LTE/rrc_defs.h +++ b/openair2/RRC/LTE/rrc_defs.h @@ -809,7 +809,7 @@ typedef struct UE_RRC_INST_s { #endif #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) - uint8_t MBMS_flag; + uint8_t MBMS_flag; uint8_t *MCCH_MESSAGE[NB_CNX_UE]; uint8_t sizeof_MCCH_MESSAGE[NB_CNX_UE]; uint8_t MCCH_MESSAGEStatus[NB_CNX_UE]; diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 97755ec9aae8babcbdf66dda08bd970c41f64ddf..24d665e0398403bf52f8b044c8be262b9f1807a1 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -1460,7 +1460,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( /* for no gcc warnings */ (void)dedicatedInfoNas; LTE_C_RNTI_t *cba_RNTI = NULL; - int x2_enabled; + int measurements_enabled; uint8_t next_xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); ue_context_pP->ue_context.Status = RRC_CONNECTED; ue_context_pP->ue_context.ue_rrc_inactivity_timer = 1; // set rrc inactivity when UE goes into RRC_CONNECTED @@ -1872,7 +1872,8 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( dedicatedInfoNASList = NULL; } - x2_enabled = is_x2ap_enabled(); + measurements_enabled = RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2 || + RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_measurement_reports; // send LTE_RRCConnectionReconfiguration memset(buffer, 0, RRC_BUF_SIZE); @@ -1887,9 +1888,9 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( //#ifdef EXMIMO_IOT // NULL, NULL, NULL,NULL, //#else - x2_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, // MeasObj_list, - x2_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, // ReportConfig_list, - x2_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, //quantityConfig, + measurements_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, // MeasObj_list, + measurements_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, // ReportConfig_list, + measurements_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, //quantityConfig, (LTE_MeasIdToAddModList_t *)NULL, //#endif (LTE_MAC_MainConfig_t *)ue_context_pP->ue_context.mac_MainConfig, @@ -2798,7 +2799,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t /* For no gcc warnings */ (void) dedicatedInfoNas; LTE_C_RNTI_t *cba_RNTI = NULL; - int x2_enabled; + int measurements_enabled; uint8_t xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); //Transaction_id, uint8_t cc_id = ue_context_pP->ue_context.primaryCC_id; LTE_UE_EUTRA_Capability_t *UEcap = ue_context_pP->ue_context.UE_Capability; @@ -3340,7 +3341,8 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t dedicatedInfoNASList = NULL; } - x2_enabled = is_x2ap_enabled(); + measurements_enabled = RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2 || + RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_measurement_reports; memset(buffer, 0, RRC_BUF_SIZE); @@ -3352,10 +3354,10 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t (LTE_DRB_ToReleaseList_t *) NULL, // DRB2_list, (struct LTE_SPS_Config *) NULL, // *sps_Config, (struct LTE_PhysicalConfigDedicated *) *physicalConfigDedicated, - x2_enabled ? (LTE_MeasObjectToAddModList_t *) MeasObj_list : NULL, - x2_enabled ? (LTE_ReportConfigToAddModList_t *) ReportConfig_list : NULL, - x2_enabled ? (LTE_QuantityConfig_t *) quantityConfig : NULL, - x2_enabled ? (LTE_MeasIdToAddModList_t *) MeasId_list : NULL, + measurements_enabled ? (LTE_MeasObjectToAddModList_t *) MeasObj_list : NULL, + measurements_enabled ? (LTE_ReportConfigToAddModList_t *) ReportConfig_list : NULL, + measurements_enabled ? (LTE_QuantityConfig_t *) quantityConfig : NULL, + measurements_enabled ? (LTE_MeasIdToAddModList_t *) MeasId_list : NULL, (LTE_MAC_MainConfig_t *) mac_MainConfig, (LTE_MeasGapConfig_t *) NULL, (LTE_MobilityControlInfo_t *) NULL, @@ -3473,7 +3475,7 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt /* for no gcc warnings */ (void)dedicatedInfoNas; LTE_C_RNTI_t *cba_RNTI = NULL; - int x2_enabled; + int measurements_enabled; uint8_t xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); //Transaction_id, #ifdef CBA //struct PUSCH_CBAConfigDedicated_vlola *pusch_CBAConfigDedicated_vlola; @@ -3843,7 +3845,8 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt dedicatedInfoNASList = NULL; } - x2_enabled = is_x2ap_enabled(); + measurements_enabled = RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2 || + RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_measurement_reports; memset(buffer, 0, RRC_BUF_SIZE); size = do_RRCConnectionReconfiguration(ctxt_pP, @@ -3857,10 +3860,10 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt // #ifdef EXMIMO_IOT // NULL, NULL, NULL,NULL, // #else - x2_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, - x2_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, - x2_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, - x2_enabled ? (LTE_MeasIdToAddModList_t *)MeasId_list : NULL, + measurements_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, + measurements_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, + measurements_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, + measurements_enabled ? (LTE_MeasIdToAddModList_t *)MeasId_list : NULL, // #endif (LTE_MAC_MainConfig_t *)mac_MainConfig, (LTE_MeasGapConfig_t *)NULL, @@ -3912,6 +3915,27 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt size, buffer, PDCP_TRANSMISSION_MODE_CONTROL); + + free(quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ); + quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ = NULL; + + free(quantityConfig->quantityConfigEUTRA->filterCoefficientRSRP); + quantityConfig->quantityConfigEUTRA->filterCoefficientRSRP = NULL; + + free(quantityConfig->quantityConfigEUTRA); + quantityConfig->quantityConfigEUTRA = NULL; + + free(quantityConfig); + quantityConfig = NULL; + + free(mac_MainConfig->ul_SCH_Config); + mac_MainConfig->ul_SCH_Config = NULL; + + free(mac_MainConfig->phr_Config); + mac_MainConfig->phr_Config = NULL; + + free(mac_MainConfig); + mac_MainConfig = NULL; } @@ -4108,7 +4132,7 @@ rrc_eNB_process_MeasurementReport( return; /* if X2AP is disabled, do nothing */ - if (!is_x2ap_enabled()) + if (!RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2) return; LOG_D(RRC, "A3 event is triggered...\n"); @@ -4498,7 +4522,7 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct /* for no gcc warnings */ (void)dedicatedInfoNas; LTE_C_RNTI_t *cba_RNTI = NULL; - int x2_enabled; + int measurements_enabled; uint8_t xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); //Transaction_id, #ifdef CBA //struct PUSCH_CBAConfigDedicated_vlola *pusch_CBAConfigDedicated_vlola; @@ -5260,7 +5284,8 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct #endif - x2_enabled = is_x2ap_enabled(); + measurements_enabled = RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2 || + RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_measurement_reports; memset(buffer, 0, RRC_BUF_SIZE); char rrc_buf[1000 /* arbitrary, should be big enough, has to be less than size of return buf by a few bits/bytes */]; @@ -5276,10 +5301,10 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct //#ifdef EXMIMO_IOT // NULL, NULL, NULL,NULL, //#else - x2_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, - x2_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, - x2_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, - x2_enabled ? (LTE_MeasIdToAddModList_t *)MeasId_list : NULL, + measurements_enabled ? (LTE_MeasObjectToAddModList_t *)MeasObj_list : NULL, + measurements_enabled ? (LTE_ReportConfigToAddModList_t *)ReportConfig_list : NULL, + measurements_enabled ? (LTE_QuantityConfig_t *)quantityConfig : NULL, + measurements_enabled ? (LTE_MeasIdToAddModList_t *)MeasId_list : NULL, //#endif (LTE_MAC_MainConfig_t *)mac_MainConfig, (LTE_MeasGapConfig_t *)NULL, @@ -5604,7 +5629,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( rb_conf_ipv4(0, //add ue_module_id, //cx ctxt_pP->module_id, //inst - (ue_module_id * LTE_maxDRB) + DRB_configList->list.array[i]->drb_Identity, // RB + (ue_module_id * LTE_maxDRB) + DRB_configList->list.array[i]->drb_Identity, // RB 0, //dscp ipv4_address(ctxt_pP->module_id + 1, ctxt_pP->module_id + 1), //saddr ipv4_address(ctxt_pP->module_id + 1, dest_ip_offset + ue_module_id + 1)); //daddr @@ -7458,7 +7483,7 @@ void rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX, VCD_FUNCTION_IN); - if (is_x2ap_enabled()) { + if (RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2) { /* send a tick to x2ap */ msg = itti_alloc_new_message(TASK_RRC_ENB, X2AP_SUBFRAME_PROCESS); itti_send_msg_to_task(TASK_X2AP, ctxt_pP->module_id, msg); @@ -7732,9 +7757,9 @@ void *rrc_enb_process_itti_msg(void *notUsed) { &ctxt, RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size); - if (RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size >= RRC_BUFFER_SIZE_MAX) { + if (RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size >= CCCH_SDU_SIZE) { LOG_I(RRC, "CCCH message has size %d > %d\n", - RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size,RRC_BUFFER_SIZE_MAX); + RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size,CCCH_SDU_SIZE); break; } @@ -8150,7 +8175,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink( //----------------------------------------------------------------------------- { uint8_t buffer[RRC_BUF_SIZE]; - uint16_t size = -1; + uint16_t size = 0; memset(buffer, 0, RRC_BUF_SIZE); // allocate dedicated pools for UE -sl-CommConfig/sl-DiscConfig (sl-V2X-ConfigDedicated) @@ -8287,6 +8312,7 @@ LTE_SL_CommConfig_r12_t rrc_eNB_get_sidelink_commTXPool( const protocol_ctxt_t * LTE_SL_DiscConfig_r12_t rrc_eNB_get_sidelink_discTXPool( const protocol_ctxt_t *const ctxt_pP, rrc_eNB_ue_context_t *const ue_context_pP, int n_discoveryMessages ) { //TODO LTE_SL_DiscConfig_r12_t sl_DiscConfig; + memset(&sl_DiscConfig,0,sizeof(LTE_SL_DiscConfig_r12_t)); sl_DiscConfig.discTxResources_r12 = CALLOC(1,sizeof(*sl_DiscConfig.discTxResources_r12)); sl_DiscConfig.discTxResources_r12->present = LTE_SL_DiscConfig_r12__discTxResources_r12_PR_setup; sl_DiscConfig.discTxResources_r12->choice.setup.present = LTE_SL_DiscConfig_r12__discTxResources_r12__setup_PR_scheduled_r12; diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index 796c0cb26e55132e179f8a155f9a3095b796c375..789389aa71efa386c85122868f163b702ec265b7 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -256,23 +256,28 @@ rrc_eNB_S1AP_get_ue_ids( } if (ue_desc_p != NULL) { - result = rrc_eNB_S1AP_get_ue_ids(rrc_instance_pP, ue_desc_p->ue_initial_id, eNB_ue_s1ap_id); + if (ue_desc_p->ue_initial_id != UE_INITIAL_ID_INVALID) { + result = rrc_eNB_S1AP_get_ue_ids(rrc_instance_pP, ue_desc_p->ue_initial_id, eNB_ue_s1ap_id); - if (result != NULL) { - ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ENB_INSTANCE_TO_MODULE_ID(instance)], result->ue_rnti); + if (result != NULL) { + ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ENB_INSTANCE_TO_MODULE_ID(instance)], result->ue_rnti); - if ((ue_context_p != NULL) && (ue_context_p->ue_context.eNB_ue_s1ap_id == 0)) { - ue_context_p->ue_context.eNB_ue_s1ap_id = eNB_ue_s1ap_id; - } else { - LOG_E(RRC, "[eNB %ld] Incoherence between RRC context and S1AP context (%d != %d) for UE RNTI %d or UE RRC context doesn't exist\n", - rrc_instance_pP - RC.rrc[0], - (ue_context_p==NULL)?99999:ue_context_p->ue_context.eNB_ue_s1ap_id, - eNB_ue_s1ap_id, - result->ue_rnti); + if ((ue_context_p != NULL) && (ue_context_p->ue_context.eNB_ue_s1ap_id == 0)) { + ue_context_p->ue_context.eNB_ue_s1ap_id = eNB_ue_s1ap_id; + } else { + LOG_E(RRC, "[eNB %ld] Incoherence between RRC context and S1AP context (%d != %d) for UE RNTI %d or UE RRC context doesn't exist\n", + rrc_instance_pP - RC.rrc[0], + (ue_context_p==NULL)?99999:ue_context_p->ue_context.eNB_ue_s1ap_id, + eNB_ue_s1ap_id, + result->ue_rnti); + } } + } else { + LOG_E(S1AP, "[eNB %ld] S1AP context found but ue_initial_id is invalid (0)\n", rrc_instance_pP - RC.rrc[0]); + return NULL; } } else { - LOG_E(S1AP, "[eNB %ld] In hashtable_get, couldn't find in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32", even when looking at S1AP context\n", + LOG_E(S1AP, "[eNB %ld] In hashtable_get, couldn't find in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32", because ue_initial_id is invalid in S1AP context\n", rrc_instance_pP - RC.rrc[0], eNB_ue_s1ap_id); return NULL; @@ -840,6 +845,7 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS( uint8_t srb_id; struct rrc_eNB_ue_context_s *ue_context_p = NULL; protocol_ctxt_t ctxt; + memset(&ctxt, 0, sizeof(protocol_ctxt_t)); ue_initial_id = S1AP_DOWNLINK_NAS (msg_p).ue_initial_id; eNB_ue_s1ap_id = S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id; ue_context_p = rrc_eNB_get_ue_context_from_s1ap_ids(instance, ue_initial_id, eNB_ue_s1ap_id); diff --git a/openair2/RRC/NAS/nas_config.c b/openair2/RRC/NAS/nas_config.c index aa6696c864aee344f6c2594b45fc7a579ee89686..a2d90abb3e3ed1fed025b69dc51a7d1b3f1b82b3 100644 --- a/openair2/RRC/NAS/nas_config.c +++ b/openair2/RRC/NAS/nas_config.c @@ -61,9 +61,9 @@ void nas_getparams(void) { /* configuration parameters for netlink, includes network parameters when running in noS1 mode */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*--------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - {"NetworkPrefix", NASHLP_NETPREFIX, 0, strptr:&baseNetAddress, defstrval:"10.0", TYPE_STRING, 0 }, + {"NetworkPrefix", NASHLP_NETPREFIX, 0, strptr:&baseNetAddress, defstrval:"10.0", TYPE_STRING, 0 }, {"NetworkMask", NASHLP_NETMASK, 0, strptr:&netMask, defstrval:"255.255.255.0", TYPE_STRING, 0 }, - {"BroadcastAddr", NASHLP_BROADCASTADDR, 0, strptr:&broadcastAddr, defstrval:"10.0.255.255", TYPE_STRING, 0 }, + {"BroadcastAddr", NASHLP_BROADCASTADDR, 0, strptr:&broadcastAddr, defstrval:"10.0.255.255", TYPE_STRING, 0 }, }; config_get( nasoptions,sizeof(nasoptions)/sizeof(paramdef_t),"nas.noS1"); } diff --git a/openair2/UTIL/ASYNC_IF/link_manager.c b/openair2/UTIL/ASYNC_IF/link_manager.c index 85a4f48a8e42c0fc44a0af86a3f75404280887c2..b98dc3bad7337d9a4af1da5513d210bcc6c42ed7 100644 --- a/openair2/UTIL/ASYNC_IF/link_manager.c +++ b/openair2/UTIL/ASYNC_IF/link_manager.c @@ -95,7 +95,7 @@ link_manager_t *create_link_manager( socket_link_t *link) { link_manager_t *ret = NULL; - pthread_attr_t attr; + //pthread_attr_t attr; pthread_t t; LOG_D(MAC, "create new link manager\n"); diff --git a/openair2/UTIL/ASYNC_IF/socket_link.c b/openair2/UTIL/ASYNC_IF/socket_link.c index e40fba4a04da35bce9fd12ff173b65d0e9f286c3..571762493014b8ca8a19b9de2288f574f155b3e7 100644 --- a/openair2/UTIL/ASYNC_IF/socket_link.c +++ b/openair2/UTIL/ASYNC_IF/socket_link.c @@ -228,7 +228,7 @@ socket_link_t *new_link_udp_client(const char *server, int port){ struct sockaddr_in si_other; int s; - socklen_t slen; + socklen_t slen = sizeof(si_other); if ( (s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1){ goto error; @@ -402,7 +402,7 @@ static int socket_udp_receive(int socket_fd, void *buf, int size) LOG_D(PROTO_AGENT,"UDP RECEIVE\n"); struct sockaddr_in client; - socklen_t slen; + socklen_t slen = sizeof(client); int l; l = recvfrom(socket_fd, buf, size, 0, (struct sockaddr *) &client, &slen); diff --git a/openair2/X2AP/x2ap_eNB_handler.c b/openair2/X2AP/x2ap_eNB_handler.c index 96ffac162ebc2e62c8d249a7b2c72b9d40e7d2eb..dd59791ec94f75898ea9fb33da808dff6590cc95 100644 --- a/openair2/X2AP/x2ap_eNB_handler.c +++ b/openair2/X2AP/x2ap_eNB_handler.c @@ -192,7 +192,7 @@ int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stre case X2AP_X2AP_PDU_PR_initiatingMessage: /* Checking procedure Code and direction of message */ - if (pdu.choice.initiatingMessage.procedureCode > sizeof(x2ap_messages_callback) / (3 * sizeof( + if (pdu.choice.initiatingMessage.procedureCode >= sizeof(x2ap_messages_callback) / (3 * sizeof( x2ap_message_decoded_callback))) { //|| (pdu.present > X2AP_X2AP_PDU_PR_unsuccessfulOutcome)) { X2AP_ERROR("[SCTP %d] Either procedureCode %ld exceed expected\n", @@ -218,7 +218,7 @@ int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stre case X2AP_X2AP_PDU_PR_successfulOutcome: /* Checking procedure Code and direction of message */ - if (pdu.choice.successfulOutcome.procedureCode > sizeof(x2ap_messages_callback) / (3 * sizeof( + if (pdu.choice.successfulOutcome.procedureCode >= sizeof(x2ap_messages_callback) / (3 * sizeof( x2ap_message_decoded_callback))) { //|| (pdu.present > X2AP_X2AP_PDU_PR_unsuccessfulOutcome)) { X2AP_ERROR("[SCTP %d] Either procedureCode %ld exceed expected\n", @@ -244,7 +244,7 @@ int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stre case X2AP_X2AP_PDU_PR_unsuccessfulOutcome: /* Checking procedure Code and direction of message */ - if (pdu.choice.unsuccessfulOutcome.procedureCode > sizeof(x2ap_messages_callback) / (3 * sizeof( + if (pdu.choice.unsuccessfulOutcome.procedureCode >= sizeof(x2ap_messages_callback) / (3 * sizeof( x2ap_message_decoded_callback))) { //|| (pdu.present > X2AP_X2AP_PDU_PR_unsuccessfulOutcome)) { X2AP_ERROR("[SCTP %d] Either procedureCode %ld exceed expected\n", diff --git a/openair3/GTPV1-U/gtpv1u_eNB.c b/openair3/GTPV1-U/gtpv1u_eNB.c index d904e90f228238971ab64917480dda48868f9aab..b04d0dbf286565c01d17a60ec7b0fb2f65c7030d 100644 --- a/openair3/GTPV1-U/gtpv1u_eNB.c +++ b/openair3/GTPV1-U/gtpv1u_eNB.c @@ -986,7 +986,7 @@ void *gtpv1u_eNB_process_itti_msg(void *notUsed) { if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: while getting ue rnti %x in hashtable ue_mapping\n", data_req_p->rnti); } else { - if ((data_req_p->rab_id >= GTPV1U_BEARER_OFFSET) && (data_req_p->rab_id <= max_val_LTE_DRB_Identity)) { + if ((data_req_p->rab_id >= GTPV1U_BEARER_OFFSET) && (data_req_p->rab_id < max_val_LTE_DRB_Identity)) { enb_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_eNB; sgw_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_sgw; stack_req.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; diff --git a/openair3/S1AP/s1ap_eNB_handlers.c b/openair3/S1AP/s1ap_eNB_handlers.c index a8ee72edeb05104ffaebe07bd19bfb3f4cd81224..df6988a8a0352e7499f3020ea0d8e0048d0eda97 100644 --- a/openair3/S1AP/s1ap_eNB_handlers.c +++ b/openair3/S1AP/s1ap_eNB_handlers.c @@ -220,7 +220,7 @@ int s1ap_eNB_handle_message(uint32_t assoc_id, int32_t stream, } /* Checking procedure Code and direction of message */ - if (pdu.choice.initiatingMessage.procedureCode > sizeof(messages_callback) / (3 * sizeof( + if (pdu.choice.initiatingMessage.procedureCode >= sizeof(messages_callback) / (3 * sizeof( s1ap_message_decoded_callback)) || (pdu.present > S1AP_S1AP_PDU_PR_unsuccessfulOutcome)) { S1AP_ERROR("[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n", diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp index 1f0d78aba597575278293c9f4d70e17090c8f932..a57ebf8b6d85b5c8b1e28fccef6aa06ac448f120 100644 --- a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp @@ -193,7 +193,7 @@ int trx_lms_start(openair0_device *device){ LMS_EnableChannel(lms_device,LMS_CH_RX,1,true); LMS_EnableChannel(lms_device,LMS_CH_TX,1,true); } */ - LMS_VCTCXOWrite(lms_device,129, true); + LMS_VCTCXOWrite(lms_device, 129); if (LMS_SetSampleRate(lms_device,device->openair0_cfg->sample_rate,2)!=0) { diff --git a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.calisson.conf b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.calisson.conf index df60ee7fa8d6a9de6a627e4c42c9ca7b6dbd624d..d619ab2958079fcfba2703c205a8710f04824d10 100644 --- a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.calisson.conf +++ b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.calisson.conf @@ -37,6 +37,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf index f5dce0a178e72d21bb07356666b9e27d4806ead9..558676e99b268973892a4b77a697673bd63f432e 100644 --- a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf +++ b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf @@ -49,6 +49,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.nord.conf b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.nord.conf index d75837ff9793cc79d1aa9b0f6923818b954409a1..9a4a86341913fa3b5980de97600ec93eb8bca0f6 100644 --- a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.nord.conf +++ b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.nord.conf @@ -36,6 +36,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index 1f5aeaf777100ed1818b887615c7a07e4ee3949b..d79f5402d01633783b65250c4b14f1c50d03f200 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -360,6 +360,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf index 60142d8fe64cfa363c141bb8b71943c1269e4c4e..f248f515b892052f1bc459bdb13390d805e36256 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf @@ -142,6 +142,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf index addd70ca712f7e25f01ea6dc01eb5f361557e14f..dee6c298a7b2206aaf0bd77b36e275eb9f8ace10 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf @@ -178,6 +178,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf index 993acae34e95b894877aa7f88923d398b2d6a2c4..231581574aebb59019fb24ea9300b796a3bce26a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf @@ -142,6 +142,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf index 201a0c1839a10abf6cdb4e0a7c2ed9772835c736..54c12835ef38627d116207793fce88919a699c27 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf @@ -178,6 +178,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf index ac417c7e3a81cd7a7b11548d5d4c5b84d4c8fc82..feab0d69260abefb3f157abf78868b942afb1b91 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf @@ -145,6 +145,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf index 3507906affeb8abd3a1d112f2029cbc987a74faa..1a0466aad33b42de5991af1b84dd6c5e74872ca3 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf @@ -178,6 +178,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf index a683326639c9b7fc92c1431c4b679aa1437e9073..753c2d8b5c2966fb228e0820697accc640bd47dd 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf @@ -179,6 +179,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf index 5e750cb62652f2946d0c83116a897b91a5bd8f75..20646681d2cd25fc0666340e864b2cb9c4476776 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf @@ -179,6 +179,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 4b3ac5ffad271d03d782ce1249249fe3ad9c3f1a..3449479256bb34b26024fc8a81dee9764f7ec9ba 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -179,6 +179,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf index 497db9a306bab96faad656f7139cc904aff33243..8971633ce02743ea1603036df0320e3ddfc6c7b2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf @@ -146,6 +146,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf index ae2ba73782d6161d6576cbae55545986d087aa3b..d2c1aac31eead461547248c8a1a7593330292e3e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf @@ -148,6 +148,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf index f7be9e28d95f8a94535bd21cf38f3b7677f85744..7c2c2e0170999b922fab2c7e7eb2b277052dd537 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf @@ -148,6 +148,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf index 9d71b10740cc3ba7e036835735c3b058a29a106c..723147daeb66b3cd0967a572592eef4dc9d753ee 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf @@ -179,6 +179,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf index ec20ac3abff08d69e88d8f35657c865867b85a8b..2e62970b3f642f936efc2f0f74bf6522b3c09136 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf @@ -148,6 +148,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf index 5e5b191a0f206a7b9b310c4cc1fb90727871e33d..182568185e6e2543175e892e21eab7f4bb323067 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf @@ -147,6 +147,8 @@ eNBs = } ); + enable_measurement_reports = "no"; + ///X2 enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index bd04a0d87d05c4eceef1d1cc6d560e92ef288d2d..4ddd1aeac6851a4398f09037f93fb9890fb10e75 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -74,7 +74,7 @@ #include "common/utils/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "enb_config.h" - +#include "targets/RT/USER/lte-softmodem.h" #ifndef OPENAIR2 #include "UTIL/OTG/otg_extern.h" @@ -98,7 +98,7 @@ struct timing_info_t { // Fix per CC openair rf/if device update // extern openair0_device openair0; -extern volatile int oai_exit; +extern volatile int oai_exit; extern int transmission_mode; @@ -107,6 +107,8 @@ extern int oaisim_flag; //uint16_t sf_ahead=4; extern uint16_t sf_ahead; +extern PARALLEL_CONF_t get_thread_parallel_conf(void); +extern WORKER_CONF_t get_thread_worker_conf(void); //pthread_t main_eNB_thread; @@ -147,7 +149,10 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset); #define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials) -static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name) { +static inline int rxtx(PHY_VARS_eNB *eNB, + L1_rxtx_proc_t *proc, + char *thread_name) +{ start_meas(&softmodem_stats_rxtx_sf); //L1_rxtx_proc_t *L1_proc_tx = &eNB->proc.L1_proc_tx; // ******************************************************************* @@ -421,20 +426,21 @@ static void *L1_thread( void *param ) { void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, - char *string,RU_t *ru) + char *string, + RU_t *ru) { - L1_proc_t *proc = &eNB->proc; - L1_rxtx_proc_t *L1_proc = &proc->L1_proc; - LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; - RU_proc_t *ru_proc=&ru->proc; - proc->frame_rx = frame_rx; - proc->subframe_rx = subframe_rx; + L1_proc_t *proc = &eNB->proc; + L1_rxtx_proc_t *L1_proc= &proc->L1_proc; + LTE_DL_FRAME_PARMS *fp = ru->frame_parms; + RU_proc_t *ru_proc = &ru->proc; + proc->frame_rx = frame_rx; + proc->subframe_rx = subframe_rx; if (!oai_exit) { T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx)); L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); L1_proc->frame_rx = ru_proc->frame_rx; - L1_proc->subframe_rx = ru_proc->subframe_rx; + L1_proc->subframe_rx = ru_proc->tti_rx; L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; @@ -442,7 +448,7 @@ void eNB_top(PHY_VARS_eNB *eNB, LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id); ru_proc->timestamp_tx = L1_proc->timestamp_tx; - ru_proc->subframe_tx = L1_proc->subframe_tx; + ru_proc->tti_tx = L1_proc->subframe_tx; ru_proc->frame_tx = L1_proc->frame_tx; } } @@ -472,12 +478,12 @@ int wakeup_txfh(L1_rxtx_proc_t *proc, ru_proc = &ru->proc; if (ru_proc->instance_cnt_eNBs == 0) { - LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->subframe_tx, proc->frame_rx, proc->subframe_rx); + LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->tti_tx, proc->frame_rx, proc->subframe_rx); return(-1); } if (pthread_mutex_timedlock(&ru_proc->mutex_eNBs,&wait) != 0) { - LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", ru_proc->subframe_rx&1,ru_proc->instance_cnt_eNBs ); + LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", ru_proc->tti_rx&1,ru_proc->instance_cnt_eNBs ); exit_fun( "error locking mutex_eNB" ); return(-1); } @@ -540,7 +546,7 @@ int wakeup_tx(PHY_VARS_eNB *eNB) int wakeup_rxtx(PHY_VARS_eNB *eNB, RU_t *ru) { - L1_proc_t *proc=&eNB->proc; + L1_proc_t *proc =&eNB->proc; RU_proc_t *ru_proc=&ru->proc; L1_rxtx_proc_t *L1_proc=&proc->L1_proc; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; @@ -592,7 +598,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB, // and proc->subframe_tx = proc->subframe_rx+sf_ahead L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); L1_proc->frame_rx = ru_proc->frame_rx; - L1_proc->subframe_rx = ru_proc->subframe_rx; + L1_proc->subframe_rx = ru_proc->tti_rx; L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; @@ -607,7 +613,11 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB, return(0); } -void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) { +void wakeup_prach_eNB(PHY_VARS_eNB *eNB, + RU_t *ru, + int frame, + int subframe) +{ L1_proc_t *proc = &eNB->proc; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; int i; diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 79df7d52dba9b37ad1251494bb49e6b2f27308ee..54e70849bdc5197c501b1793a9fc323c935da7a2 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -100,26 +100,21 @@ static int DEFENBS[] = {0}; #include "SIMULATION/ETH_TRANSPORT/proto.h" - #include "T.h" #include "pdcp.h" -extern volatile int oai_exit; +extern volatile int oai_exit; extern int emulate_rf; extern int numerology; extern clock_source_t clock_source; -extern uint8_t dlsch_ue_select_tbl_in_use; - extern PARALLEL_CONF_t get_thread_parallel_conf(void); extern WORKER_CONF_t get_thread_worker_conf(void); -extern void phy_init_RU(RU_t *); -extern void phy_free_RU(RU_t *); - +extern void phy_init_RU(RU_t *); void stop_RU(int nb_ru); -void do_ru_sync(RU_t *ru); +void do_ru_synch(RU_t *ru); void configure_ru(int idx, void *arg); @@ -134,6 +129,7 @@ int connect_rau(RU_t *ru); extern uint16_t sf_ahead; #if defined(PRE_SCD_THREAD) + extern uint8_t dlsch_ue_select_tbl_in_use; void init_ru_vnf(void); #endif @@ -548,7 +544,7 @@ void fh_if4p5_north_in(RU_t *ru, /// **** incoming IF4p5 from remote RCC/RAU **** /// symbol_number = 0; symbol_mask = 0; - symbol_mask_full = (1<<ru->frame_parms.symbols_per_tti)-1; + symbol_mask_full = (1<<ru->frame_parms->symbols_per_tti)-1; do { recv_IF4p5(ru, frame, subframe, &packet_type, &symbol_number); @@ -700,6 +696,7 @@ static void *emulatedRF_thread(void *param) { req.tv_sec = 0; req.tv_nsec = (numerology>0)? ((microsec * 1000L)/numerology):(microsec * 1000L)*2; cpu_set_t cpuset; + CPU_ZERO(&cpuset); CPU_SET(1,&cpuset); pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); int policy; @@ -848,7 +845,7 @@ void tx_rf(RU_t *ru,int frame,int subframe,uint64_t timestamp) { lte_subframe_t SF_type = subframe_select(fp,subframe%10); lte_subframe_t prevSF_type = subframe_select(fp,(subframe+9)%10); - lte_subframe_t nextSF_type = subframe_select(fp,(subframe+1)%10); + //lte_subframe_t nextSF_type = subframe_select(fp,(subframe+1)%10); int sf_extension = 0; if ((SF_type == SF_DL) || @@ -982,7 +979,7 @@ static void *ru_thread_asynch_rxtx( void *param ) if (ru->fh_south_asynch_in) ru->fh_south_asynch_in(ru,&frame,&subframe); // asynchronous receive from north (RRU IF4/IF5) else if (ru->fh_north_asynch_in) { - if (subframe_select(&ru->frame_parms,subframe)!=SF_UL) + if (subframe_select(ru->frame_parms,subframe)!=SF_UL) ru->fh_north_asynch_in(ru,&frame,&subframe); } else AssertFatal(1==0,"Unknown function in ru_thread_asynch_rxtx\n"); } @@ -1227,9 +1224,8 @@ void do_ru_synch(RU_t *ru) void wakeup_L1s(RU_t *ru) { - int i; PHY_VARS_eNB **eNB_list = ru->eNB_list; - LOG_D(PHY,"wakeup_L1s (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top); + LOG_D(PHY,"wakeup_L1s (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB, ru->idx, ru->eNB_top); if (ru->num_eNB==1 && ru->eNB_top!=0 && get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) { // call eNB function directly @@ -1241,12 +1237,11 @@ void wakeup_L1s(RU_t *ru) } else { LOG_D(PHY,"ru->num_eNB:%d\n", ru->num_eNB); - for (i=0; i<ru->num_eNB; i++) { + for (int i=0; i<ru->num_eNB; i++) { LOG_D(PHY,"ru->wakeup_rxtx:%p\n", ru->wakeup_rxtx); - eNB_list[i]->proc.ru_proc = &ru->proc; - if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0) - { - LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.tti_rx); + + if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0) { + LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.tti_rx); } ru->proc.emulate_rf_busy = 0; @@ -1631,7 +1626,7 @@ static void *ru_thread( void *param ) pthread_setname_np( pthread_self(),"ru thread"); LOG_I(PHY,"thread ru created id=%ld\n", syscall(__NR_gettid)); - LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx,eNB_functions[ru->function],eNB_timing[ru->if_timing]); + LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx, NB_functions[ru->function], NB_timing[ru->if_timing]); if(get_softmodem_params()->emulate_rf) { fill_rf_config(ru,ru->rf_config_file); @@ -1656,7 +1651,7 @@ static void *ru_thread( void *param ) if (ru->if_south == LOCAL_RF) { // configure RF parameters only fill_rf_config(ru,ru->rf_config_file); - init_frame_parms(&ru->frame_parms,1); + init_frame_parms(ru->frame_parms,1); phy_init_RU(ru); ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg); } @@ -2115,8 +2110,8 @@ extern void ru_fep_full_2thread(RU_t *ru,int subframe); extern void feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx); extern void feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx); extern void feptx_prec(RU_t *ru,int frame_tx,int tti_tx); -extern void init_fep_thread(RU_t *ru); -extern void init_feptx_thread(RU_t *ru); +extern void init_fep_thread(RU_t *ru, pthread_attr_t *attr_fep); +extern void init_feptx_thread(RU_t *ru, pthread_attr_t *attr_feptx); extern void kill_fep_thread(RU_t *ru); extern void kill_feptx_thread(RU_t *ru); @@ -2238,8 +2233,8 @@ void init_RU_proc(RU_t *ru) { } if (get_thread_worker_conf() == WORKER_ENABLE) { - init_fep_thread(ru,NULL); - init_feptx_thread(ru,NULL); + init_fep_thread(ru, NULL); + init_feptx_thread(ru, NULL); } if (opp_enabled == 1) pthread_create(&ru->ru_stats_thread,NULL,ru_stats_thread,(void *)ru); @@ -2377,12 +2372,12 @@ int check_capabilities(RU_t *ru, FH_fmt_options_t fmt = cap->FH_fmt; int i; int found_band=0; - LOG_I(PHY,"RRU %d, num_bands %d, looking for band %d\n",ru->idx,cap->num_bands,ru->frame_parms.eutra_band); + LOG_I(PHY,"RRU %d, num_bands %d, looking for band %d\n",ru->idx,cap->num_bands,ru->frame_parms->eutra_band); for (i=0; i<cap->num_bands; i++) { LOG_I(PHY,"band %d on RRU %d\n",cap->band_list[i],ru->idx); - if (ru->frame_parms.eutra_band == cap->band_list[i]) { + if (ru->frame_parms->eutra_band == cap->band_list[i]) { found_band=1; break; } @@ -2447,20 +2442,20 @@ void configure_ru(int idx, ru->nb_rx = capabilities->nb_rx[0]; // Pass configuration to RRU - LOG_I(PHY, "Using %s fronthaul (%d), band %d \n",ru_if_formats[ru->if_south],ru->if_south,ru->frame_parms.eutra_band); + LOG_I(PHY, "Using %s fronthaul (%d), band %d \n",ru_if_formats[ru->if_south],ru->if_south,ru->frame_parms->eutra_band); // wait for configuration config->FH_fmt = ru->if_south; config->num_bands = 1; - config->band_list[0] = ru->frame_parms.eutra_band; - config->tx_freq[0] = ru->frame_parms.dl_CarrierFreq; - config->rx_freq[0] = ru->frame_parms.ul_CarrierFreq; - config->tdd_config[0] = ru->frame_parms.tdd_config; - config->tdd_config_S[0] = ru->frame_parms.tdd_config_S; + config->band_list[0] = ru->frame_parms->eutra_band; + config->tx_freq[0] = ru->frame_parms->dl_CarrierFreq; + config->rx_freq[0] = ru->frame_parms->ul_CarrierFreq; + config->tdd_config[0] = ru->frame_parms->tdd_config; + config->tdd_config_S[0] = ru->frame_parms->tdd_config_S; config->att_tx[0] = ru->att_tx; config->att_rx[0] = ru->att_rx; - config->N_RB_DL[0] = ru->frame_parms.N_RB_DL; - config->N_RB_UL[0] = ru->frame_parms.N_RB_UL; - config->threequarter_fs[0] = ru->frame_parms.threequarter_fs; + config->N_RB_DL[0] = ru->frame_parms->N_RB_DL; + config->N_RB_UL[0] = ru->frame_parms->N_RB_UL; + config->threequarter_fs[0] = ru->frame_parms->threequarter_fs; if (ru->if_south==REMOTE_IF4p5) { config->prach_FreqOffset[0] = ru->frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset; @@ -2471,9 +2466,9 @@ void configure_ru(int idx, int i; for (i=0; i<4; i++) { - config->emtc_prach_CElevel_enable[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i]; - config->emtc_prach_FreqOffset[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i]; - config->emtc_prach_ConfigIndex[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i]; + config->emtc_prach_CElevel_enable[0][i] = ru->frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i]; + config->emtc_prach_FreqOffset[0][i] = ru->frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i]; + config->emtc_prach_ConfigIndex[0][i] = ru->frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i]; } #endif @@ -2487,44 +2482,44 @@ void configure_rru(int idx, void *arg) { RRU_config_t *config = (RRU_config_t *)arg; - RU_t *ru = RC.ru[idx]; + RU_t *ru = RC.ru[idx]; - ru->frame_parms.eutra_band = config->band_list[0]; - ru->frame_parms.dl_CarrierFreq = config->tx_freq[0]; - ru->frame_parms.ul_CarrierFreq = config->rx_freq[0]; + ru->frame_parms->eutra_band = config->band_list[0]; + ru->frame_parms->dl_CarrierFreq = config->tx_freq[0]; + ru->frame_parms->ul_CarrierFreq = config->rx_freq[0]; - if (ru->frame_parms.dl_CarrierFreq == ru->frame_parms.ul_CarrierFreq) { + if (ru->frame_parms->dl_CarrierFreq == ru->frame_parms->ul_CarrierFreq) { LOG_I(PHY,"Setting RRU to TDD frame type\n"); - ru->frame_parms.frame_type = TDD; - ru->frame_parms.tdd_config = config->tdd_config[0]; - ru->frame_parms.tdd_config_S = config->tdd_config_S[0]; - } else ru->frame_parms.frame_type = FDD; - - ru->att_tx = config->att_tx[0]; - ru->att_rx = config->att_rx[0]; - ru->frame_parms.N_RB_DL = config->N_RB_DL[0]; - ru->frame_parms.N_RB_UL = config->N_RB_UL[0]; - ru->frame_parms.threequarter_fs = config->threequarter_fs[0]; - ru->frame_parms.pdsch_config_common.referenceSignalPower = ru->max_pdschReferenceSignalPower-config->att_tx[0]; + ru->frame_parms->frame_type = TDD; + ru->frame_parms->tdd_config = config->tdd_config[0]; + ru->frame_parms->tdd_config_S = config->tdd_config_S[0]; + } else ru->frame_parms->frame_type = FDD; + + ru->att_tx = config->att_tx[0]; + ru->att_rx = config->att_rx[0]; + ru->frame_parms->N_RB_DL = config->N_RB_DL[0]; + ru->frame_parms->N_RB_UL = config->N_RB_UL[0]; + ru->frame_parms->threequarter_fs = config->threequarter_fs[0]; + ru->frame_parms->pdsch_config_common.referenceSignalPower = ru->max_pdschReferenceSignalPower-config->att_tx[0]; if (ru->function==NGFI_RRU_IF4p5) { - ru->frame_parms.att_rx = ru->att_rx; - ru->frame_parms.att_tx = ru->att_tx; + ru->frame_parms->att_rx = ru->att_rx; + ru->frame_parms->att_tx = ru->att_tx; LOG_I(PHY,"Setting ru->function to NGFI_RRU_IF4p5, prach_FrequOffset %d, prach_ConfigIndex %d, att (%d,%d)\n", config->prach_FreqOffset[0],config->prach_ConfigIndex[0],ru->att_tx,ru->att_rx); - ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset = config->prach_FreqOffset[0]; - ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex = config->prach_ConfigIndex[0]; + ru->frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset = config->prach_FreqOffset[0]; + ru->frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex = config->prach_ConfigIndex[0]; #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) for (int i=0; i<4; i++) { - ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i] = config->emtc_prach_CElevel_enable[0][i]; - ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i] = config->emtc_prach_FreqOffset[0][i]; - ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i] = config->emtc_prach_ConfigIndex[0][i]; + ru->frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i] = config->emtc_prach_CElevel_enable[0][i]; + ru->frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i] = config->emtc_prach_FreqOffset[0][i]; + ru->frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i] = config->emtc_prach_ConfigIndex[0][i]; } #endif } - init_frame_parms(&ru->frame_parms,1); + init_frame_parms(ru->frame_parms,1); fill_rf_config(ru,ru->rf_config_file); phy_init_RU(ru); } @@ -2638,7 +2633,7 @@ void set_function_spec_param(RU_t *ru) /* if (ru->function == eNodeB_3GPP) { // configure RF parameters only for 3GPP eNodeB, we need to get them from RAU otherwise fill_rf_config(ru,rf_config_file); - init_frame_parms(&ru->frame_parms,1); + init_frame_parms(ru->frame_parms,1); phy_init_RU(ru); } @@ -2720,7 +2715,7 @@ void init_RU(char *rf_config_file) { int ru_id; RU_t *ru; - PHY_VARS_eNB *eNB0= (PHY_VARS_eNB *)NULL; + PHY_VARS_eNB *eNB0 = (PHY_VARS_eNB *)NULL; LTE_DL_FRAME_PARMS *fp = (LTE_DL_FRAME_PARMS *)NULL; int i; int CC_id; @@ -2784,7 +2779,7 @@ void init_RU(char *rf_config_file) } } - LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],eNB_timing[ru->if_timing],ru->function); + LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],NB_timing[ru->if_timing],ru->function); set_function_spec_param(ru); LOG_I(PHY,"Starting ru_thread %d\n",ru_id); init_RU_proc(ru); @@ -2874,7 +2869,7 @@ void init_ru_vnf(void) { } } */ - LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],eNB_timing[ru->if_timing],ru->function); + LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],NB_timing[ru->if_timing],ru->function); // set_function_spec_param(ru); LOG_I(PHY,"Starting ru_thread %d\n",ru_id); // init_RU_proc(ru); @@ -2897,8 +2892,7 @@ void init_ru_vnf(void) { /* from here function to use configuration module */ void RCconfig_RU(void) { - int j = 0; - int i = 0; + int i = 0; paramdef_t RUParams[] = RUPARAMS_DESC; paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0}; config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL); @@ -2908,7 +2902,7 @@ void RCconfig_RU(void) RC.ru_mask=(1<<RC.nb_RU) - 1; printf("Set RU mask to %lx\n",RC.ru_mask); - for (j = 0; j < RC.nb_RU; j++) { + for (int j = 0; j < RC.nb_RU; j++) { RC.ru[j] = (RU_t *)malloc(sizeof(RU_t)); memset((void *)RC.ru[j],0,sizeof(RU_t)); RC.ru[j]->idx = j; @@ -2989,12 +2983,12 @@ void RCconfig_RU(void) } //strcmp(local_rf, "yes") == 0 else { printf("RU %d: Transport %s\n",j,*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr)); - RC.ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr)); - RC.ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr)); + RC.ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr)); + RC.ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr)); RC.ru[j]->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr)); - RC.ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr); + RC.ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr); RC.ru[j]->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr); - RC.ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr); + RC.ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr); RC.ru[j]->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr); if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) { diff --git a/targets/RT/USER/lte-softmodem-common.c b/targets/RT/USER/lte-softmodem-common.c index 242d0b76d70fabf9f1c0dda109f0d045b899781b..f152e7c83dc7ff44ded52925883a7ac686121c47 100644 --- a/targets/RT/USER/lte-softmodem-common.c +++ b/targets/RT/USER/lte-softmodem-common.c @@ -60,6 +60,7 @@ void get_common_options(void) { uint32_t nonbiot; uint32_t rfsim; uint32_t basicsim; + uint32_t do_forms; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ; checkedparam_t cmdline_log_CheckParams[] = CMDLINE_LOGPARAMS_CHECK_DESC; @@ -100,6 +101,10 @@ void get_common_options(void) { set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT); } + if (do_forms) { + set_softmodem_optmask(SOFTMODEM_DOFORMS_BIT); + } + #if BASIC_SIMULATOR set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT); #endif diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 7bc619f17b05bf43a4d3fb3cb1242a86d58fc75c..89a4b535b37161031782256e9d98549248861a99 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -64,6 +64,7 @@ #include "LAYER2/MAC/mac_proto.h" #include "RRC/LTE/rrc_vars.h" #include "PHY_INTERFACE/phy_interface_vars.h" +#include "PHY/TOOLS/phy_scope_interface.h" #include "nfapi/oai_integration/vendor_ext.h" #ifdef SMBV #include "PHY/TOOLS/smbv.h" @@ -90,22 +91,9 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "system.h" -#ifdef XFORMS - #include "PHY/TOOLS/lte_phy_scope.h" - #include "stats.h" -#endif + #include "lte-softmodem.h" #include "NB_IoT_interface.h" -#ifdef XFORMS - // current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) - // at eNB 0, an UL scope for every UE - FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX]; - FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; - FD_stats_form *form_stats=NULL,*form_stats_l2=NULL; - char title[255]; - unsigned char scope_enb_num_ue = 2; - static pthread_t forms_thread; //xforms -#endif //XFORMS pthread_cond_t nfapi_sync_cond; @@ -137,7 +125,7 @@ FILE *input_fd=NULL; #if MAX_NUM_CCs == 1 -rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}}; +rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}}; double tx_gain[MAX_NUM_CCs][4] = {{20,0,0,0}}; double rx_gain[MAX_NUM_CCs][4] = {{110,0,0,0}}; #else @@ -151,7 +139,6 @@ double rx_gain_off = 0.0; double sample_rate=30.72e6; double bw = 10.0e6; - uint8_t dci_Format = 0; uint8_t agregation_Level =0xFF; @@ -161,14 +148,8 @@ uint8_t nb_antenna_rx = 1; char ref[128] = "internal"; char channels[128] = "0"; -int rx_input_level_dBm; - -#ifdef XFORMS - extern int otg_enabled; -#else - int otg_enabled; -#endif -//int number_of_cards = 1; +int rx_input_level_dBm; +int otg_enabled; uint8_t exit_missed_slots=1; @@ -192,7 +173,7 @@ eth_params_t *eth_params; double cpuf; int oaisim_flag=0; -threads_t threads= {-1,-1,-1,-1,-1,-1,-1,-1}; +//threads_t threads= {-1,-1,-1,-1,-1,-1,-1,-1}; /* forward declarations */ void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]); @@ -302,75 +283,6 @@ void exit_function(const char *file, const char *function, const int line, const exit(1); } -#ifdef XFORMS - - -void reset_stats(FL_OBJECT *button, long arg) { - int i,j,k; - PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0]; - - for (i=0; i<NUMBER_OF_UE_MAX; i++) { - for (k=0; k<8; k++) { //harq_processes - for (j=0; j<phy_vars_eNB->dlsch[i][0]->Mlimit; j++) { - phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0; - phy_vars_eNB->UE_stats[i].dlsch_ACK[k][j]=0; - phy_vars_eNB->UE_stats[i].dlsch_trials[k][j]=0; - } - - phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0; - phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0; - phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0; - phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0; - phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0; - phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0; - } - } -} - -static void *scope_thread(void *arg) { -# ifdef ENABLE_XFORMS_WRITE_STATS - FILE *eNB_stats; -# endif - struct sched_param sched_param; - int UE_id, CC_id; - int ue_cnt=0; - sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1; - sched_setscheduler(0, SCHED_FIFO,&sched_param); - printf("Scope thread has priority %d\n",sched_param.sched_priority); -# ifdef ENABLE_XFORMS_WRITE_STATS - eNB_stats = fopen("eNB_stats.txt", "w"); -#endif - - while (!oai_exit) { - ue_cnt=0; - - for(UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { - for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - if ((ue_cnt<scope_enb_num_ue)) { - phy_scope_eNB(form_enb[CC_id][ue_cnt], - RC.eNB[0][CC_id], - UE_id); - ue_cnt++; - } - } - } - - sleep(1); - } - - // printf("%s",stats_buffer); -# ifdef ENABLE_XFORMS_WRITE_STATS - - if (eNB_stats) { - rewind (eNB_stats); - fwrite (stats_buffer, 1, len, eNB_stats); - fclose (eNB_stats); - } - -# endif - pthread_exit((void *)arg); -} -#endif static void get_options(void) { @@ -580,9 +492,11 @@ void init_pdcp(void) { if (!NODE_IS_DU(RC.rrc[0]->node_type)) { pdcp_layer_init(); uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? - (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; + (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; + if (IS_SOFTMODEM_NOS1) pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ; + pdcp_module_init(pdcp_initmask); if (NODE_IS_CU(RC.rrc[0]->node_type)) { @@ -609,14 +523,8 @@ static void wait_nfapi_init(char *thread_name) { int main( int argc, char **argv ) { int i; -#if defined (XFORMS) - void *status; -#endif int CC_id = 0; int ru_id; -#if defined (XFORMS) - int ret; -#endif if ( load_configmodule(argc,argv,0) == NULL) { exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); @@ -676,9 +584,9 @@ int main( int argc, char **argv ) { /* Read configuration */ if (RC.nb_inst > 0) { read_config_and_init(); - /* Start the agent. If it is turned off in the configuration, it won't start */ RCconfig_flexran(); + for (i = 0; i < RC.nb_inst; i++) { flexran_agent_start(i); } @@ -708,6 +616,8 @@ int main( int argc, char **argv ) { ctxt.instance = 0; ctxt.rnti = 0; ctxt.enb_flag = 1; + ctxt.frame = 0; + ctxt.subframe = 0; pdcp_run(&ctxt); } @@ -719,42 +629,9 @@ int main( int argc, char **argv ) { mlockall(MCL_CURRENT | MCL_FUTURE); pthread_cond_init(&sync_cond,NULL); pthread_mutex_init(&sync_mutex, NULL); -#ifdef XFORMS - int UE_id; - printf("XFORMS\n"); - - if (get_softmodem_params()->do_forms==1) { - fl_initialize (&argc, argv, NULL, 0, 0); - form_stats_l2 = create_form_stats_form(); - fl_show_form (form_stats_l2->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "l2 stats"); - form_stats = create_form_stats_form(); - fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats"); - - for(UE_id=0; UE_id<scope_enb_num_ue; UE_id++) { - for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - form_enb[CC_id][UE_id] = create_lte_phy_scope_enb(); - sprintf (title, "LTE UL SCOPE eNB for CC_id %d, UE %d",CC_id,UE_id); - fl_show_form (form_enb[CC_id][UE_id]->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); - - if (otg_enabled) { - fl_set_button(form_enb[CC_id][UE_id]->button_0,1); - fl_set_object_label(form_enb[CC_id][UE_id]->button_0,"DL Traffic ON"); - } else { - fl_set_button(form_enb[CC_id][UE_id]->button_0,0); - fl_set_object_label(form_enb[CC_id][UE_id]->button_0,"DL Traffic OFF"); - } - } // CC_id - } // UE_id - - ret = pthread_create(&forms_thread, NULL, scope_thread, NULL); - - if (ret == 0) - pthread_setname_np( forms_thread, "xforms" ); - - printf("Scope thread created, ret=%d\n",ret); - } -#endif + + rt_sleep_ns(10*100000000ULL); if (NFAPI_MODE!=NFAPI_MONOLITHIC) { @@ -840,32 +717,17 @@ int main( int argc, char **argv ) { fflush(stderr); // end of CI modifications //getchar(); + if(IS_SOFTMODEM_DOFORMS) + load_softscope("enb"); itti_wait_tasks_end(); oai_exit=1; LOG_I(ENB_APP,"oai_exit=%d\n",oai_exit); // stop threads if (RC.nb_inst == 0 || !NODE_IS_CU(RC.rrc[0]->node_type)) { - int UE_id; -#ifdef XFORMS - printf("waiting for XFORMS thread\n"); - - if (get_softmodem_params()->do_forms==1) { - pthread_join(forms_thread,&status); - fl_hide_form(form_stats->stats_form); - fl_free_form(form_stats->stats_form); - fl_hide_form(form_stats_l2->stats_form); - fl_free_form(form_stats_l2->stats_form); - - for(UE_id=0; UE_id<scope_enb_num_ue; UE_id++) { - for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - fl_hide_form(form_enb[CC_id][UE_id]->lte_phy_scope_enb); - fl_free_form(form_enb[CC_id][UE_id]->lte_phy_scope_enb); - } - } - } + if(IS_SOFTMODEM_DOFORMS) + end_forms(); -#endif LOG_I(ENB_APP,"stopping MODEM threads\n"); stop_eNB(NB_eNB_INST); stop_RU(RC.nb_RU); diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 3735c377452abb03817f49f0169e6be821f0259e..715efe0bf36d997355e398909faeeed3292240ef 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -127,46 +127,46 @@ #define START_MSC softmodem_params.start_msc /*-------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* command line parameters specific to UE */ -/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ /*-------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define CMDLINE_UEPARAMS_DESC { \ - {"siml1", CONFIG_HLP_SIML1, PARAMFLAG_BOOL, iptr:&simL1flag, defintval:0, TYPE_INT, 0}, \ - {"U", CONFIG_HLP_NUMUE, 0, u16ptr:&NB_UE_INST, defuintval:1, TYPE_UINT16, 0}, \ - {"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:130, TYPE_DOUBLE, 0}, \ - {"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \ - {"ue-txgain", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ - {"ue-nb-ant-rx", CONFIG_HLP_UENANTR, 0, u8ptr:&nb_antenna_rx, defuintval:1, TYPE_UINT8, 0}, \ - {"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \ - {"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \ - {"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:23, TYPE_INT, 0}, \ - {"emul-iface", CONFIG_HLP_EMULIFACE, 0, strptr:&emul_iface, defstrval:"lo", TYPE_STRING, 100}, \ - {"L2-emul", NULL, 0, u8ptr:&nfapi_mode, defuintval:3, TYPE_UINT8, 0}, \ - {"num-ues", NULL, 0, u16ptr:&(NB_UE_INST), defuintval:1, TYPE_UINT16, 0}, \ - {"nums_ue_thread", NULL, 0, u16ptr:&(NB_THREAD_INST), defuintval:1, TYPE_UINT16, 0}, \ - {"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0}, \ - {"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ - {"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200",TYPE_STRING, 0}, \ - {"usrp-clksrc", CONFIG_HLP_USRP_CLK_SRC,0, strptr:(char **)&usrp_clksrc, defstrval:"internal", TYPE_STRING, 0}, \ - {"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \ - {"clock", CONFIG_HLP_CLK, 0, uptr:&clock_source, defintval:0, TYPE_UINT, 0}, \ - {"s" , CONFIG_HLP_SNR, 0, iptr:&snr_dB, defintval:25, TYPE_INT, 0}, \ - {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \ - {"A", CONFIG_HLP_TADV, 0, iptr:&(timingadv), defintval:0, TYPE_INT, 0} \ + {"siml1", CONFIG_HLP_SIML1, PARAMFLAG_BOOL, iptr:&simL1flag, defintval:0, TYPE_INT, 0}, \ + {"U", CONFIG_HLP_NUMUE, 0, u16ptr:&NB_UE_INST, defuintval:1, TYPE_UINT16, 0}, \ + {"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:130, TYPE_DOUBLE, 0}, \ + {"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \ + {"ue-txgain", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ + {"ue-nb-ant-rx", CONFIG_HLP_UENANTR, 0, u8ptr:&nb_antenna_rx, defuintval:1, TYPE_UINT8, 0}, \ + {"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \ + {"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \ + {"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:23, TYPE_INT, 0}, \ + {"emul-iface", CONFIG_HLP_EMULIFACE, 0, strptr:&emul_iface, defstrval:"lo", TYPE_STRING, 100}, \ + {"L2-emul", NULL, 0, u8ptr:&nfapi_mode, defuintval:3, TYPE_UINT8, 0}, \ + {"num-ues", NULL, 0, u16ptr:&(NB_UE_INST), defuintval:1, TYPE_UINT16, 0}, \ + {"nums_ue_thread", NULL, 0, u16ptr:&(NB_THREAD_INST), defuintval:1, TYPE_UINT16, 0}, \ + {"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0}, \ + {"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ + {"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200",TYPE_STRING, 0}, \ + {"usrp-clksrc", CONFIG_HLP_USRP_CLK_SRC,0, strptr:(char **)&usrp_clksrc, defstrval:"internal", TYPE_STRING, 0}, \ + {"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \ + {"clock", CONFIG_HLP_CLK, 0, uptr:&clock_source, defintval:0, TYPE_UINT, 0}, \ + {"s" , CONFIG_HLP_SNR, 0, iptr:&snr_dB, defintval:25, TYPE_INT, 0}, \ + {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \ + {"A", CONFIG_HLP_TADV, 0, iptr:&(timingadv), defintval:0, TYPE_INT, 0} \ } -/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* command line parameters specific to UE threads */ -/* optname helpstr paramflags XXXptr defXXXval type numelt */ -/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/*-----------------------------------------------------------------------------------------------------------------------------*/ +/* command line parameters specific to UE threads */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-----------------------------------------------------------------------------------------------------------------------------*/ #define CMDLINE_UETHREADSPARAMS_DESC { \ - {"threadIQ", NULL, 0, iptr:&(threads.iq), defintval:1, TYPE_INT, 0}, \ - {"threadOneSubframe", NULL, 0, iptr:&(threads.one), defintval:1, TYPE_INT, 0}, \ - {"threadTwoSubframe", NULL, 0, iptr:&(threads.two), defintval:1, TYPE_INT, 0}, \ - {"threadThreeSubframe", NULL, 0, iptr:&(threads.three), defintval:1, TYPE_INT, 0}, \ - {"threadSlot1ProcOne", NULL, 0, iptr:&(threads.slot1_proc_one), defintval:1, TYPE_INT, 0}, \ - {"threadSlot1ProcTwo", NULL, 0, iptr:&(threads.slot1_proc_two), defintval:1, TYPE_INT, 0}, \ + {"threadOneSubframe", NULL, 0, iptr:&(threads.one), defintval:1, TYPE_INT, 0}, \ + {"threadTwoSubframe", NULL, 0, iptr:&(threads.two), defintval:1, TYPE_INT, 0}, \ + {"threadThreeSubframe", NULL, 0, iptr:&(threads.three), defintval:1, TYPE_INT, 0}, \ + {"threadSlot1ProcOne", NULL, 0, iptr:&(threads.slot1_proc_one), defintval:1, TYPE_INT, 0}, \ + {"threadSlot1ProcTwo", NULL, 0, iptr:&(threads.slot1_proc_two), defintval:1, TYPE_INT, 0}, \ } +// {"threadIQ", NULL, 0, iptr:&(threads.iq), defintval:1, TYPE_INT, 0}, \ #define DEFAULT_DLF 2680000000 @@ -179,7 +179,6 @@ #define WAIT_FOR_SYNC softmodem_params.wait_for_sync #define SINGLE_THREAD_FLAG softmodem_params.single_thread_flag #define CHAIN_OFFSET softmodem_params.chain_offset -#define DO_FORMS softmodem_params.do_forms #define NUMEROLOGY softmodem_params.numerology #define EMULATE_RF softmodem_params.emulate_rf #define CLOCK_SOURCE softmodem_params.clock_source @@ -193,11 +192,9 @@ {"clock", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 0}, \ {"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \ {"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \ - {"threadMain", NULL, 0, iptr:&(threads.main), defintval:1, TYPE_INT, 0}, \ - {"threadSync", NULL, 0, iptr:&(threads.sync), defintval:1, TYPE_INT, 0}, \ {"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \ {"a" , CONFIG_HLP_CHOFF, 0, iptr:&CHAIN_OFFSET, defintval:0, TYPE_INT, 0}, \ - {"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&DO_FORMS, defintval:0, TYPE_INT8, 0}, \ + {"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \ {"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \ {"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \ {"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&NUMEROLOGY, defintval:0, TYPE_INT, 0}, \ @@ -211,7 +208,7 @@ } #define CONFIG_HLP_FLOG "Enable online log \n" -#define CONFIG_HLP_LOGL "Set the global log level, valide options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n" +#define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n" #define CONFIG_HLP_TELN "Start embedded telnet server \n" #define CONFIG_HLP_MSC "Enable the MSC tracing utility \n" /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ @@ -220,14 +217,15 @@ /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define START_MSC softmodem_params.start_msc #define CMDLINE_LOGPARAMS_DESC { \ - {"R" , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \ - {"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \ - {"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \ - {"msc", CONFIG_HLP_MSC, PARAMFLAG_BOOL, uptr:&START_MSC, defintval:0, TYPE_UINT, 0}, \ + {"R" , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \ + {"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \ + {"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \ + {"msc", CONFIG_HLP_MSC, PARAMFLAG_BOOL, uptr:&START_MSC, defintval:0, TYPE_UINT, 0}, \ } #define CMDLINE_ONLINELOG_IDX 0 #define CMDLINE_GLOGLEVEL_IDX 1 -#define CMDLINE_STARTTELN_IDX 2 +#define CMDLINE_GLOGVERBO_IDX 2 +#define CMDLINE_STARTTELN_IDX 3 /* check function for global log level */ #define CMDLINE_LOGPARAMS_CHECK_DESC { \ @@ -240,6 +238,51 @@ /***************************************************************************************************************************************/ /* */ #include "threads_t.h" +//extern threads_t threads; + +//extern THREAD_STRUCT thread_struct; +THREAD_STRUCT thread_struct; + +static inline void set_parallel_conf(char *parallel_conf) { + mapping config[]= { + FOREACH_PARALLEL(GENERATE_ENUMTXT) + {NULL,-1} + }; + thread_struct.parallel_conf = (PARALLEL_CONF_t)map_str_to_int(config, parallel_conf); + if (thread_struct.parallel_conf == -1 ) { + LOG_E(ENB_APP,"Impossible value: %s\n", parallel_conf); + thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD; + } +} + +static inline void set_worker_conf(char *worker_conf) { + mapping config[]={ + FOREACH_WORKER(GENERATE_ENUMTXT) + {NULL, -1} + }; + thread_struct.worker_conf = (WORKER_CONF_t)map_str_to_int(config, worker_conf); + if (thread_struct.worker_conf == -1 ) { + LOG_E(ENB_APP,"Impossible value: %s\n", worker_conf); + thread_struct.worker_conf = WORKER_DISABLE ; + } +} + +static inline PARALLEL_CONF_t get_thread_parallel_conf(void) { + return thread_struct.parallel_conf; +} + +static inline WORKER_CONF_t get_thread_worker_conf(void) { + return thread_struct.worker_conf; +} + +/*PARALLEL_CONF_t get_thread_parallel_conf(void); +WORKER_CONF_t get_thread_worker_conf(void); +void set_parallel_conf(char *parallel_conf); +void set_worker_conf(char *worker_conf); +*/ + + + #define SOFTMODEM_NOS1_BIT (1<<0) #define SOFTMODEM_NOKRNMOD_BIT (1<<1) @@ -247,6 +290,7 @@ #define SOFTMODEM_RFSIM_BIT (1<<10) #define SOFTMODEM_BASICSIM_BIT (1<<11) #define SOFTMODEM_SIML1_BIT (1<<12) +#define SOFTMODEM_DOFORMS_BIT (1<<15) typedef struct { uint64_t optmask; THREAD_STRUCT thread_struct; @@ -257,7 +301,6 @@ typedef struct { int wait_for_sync; //eNodeB only int single_thread_flag; //eNodeB only int chain_offset; - uint32_t do_forms; int numerology; unsigned int start_msc; uint32_t clock_source; @@ -270,6 +313,7 @@ typedef struct { #define IS_SOFTMODEM_RFSIM ( get_softmodem_optmask() & SOFTMODEM_RFSIM_BIT) #define IS_SOFTMODEM_BASICSIM ( get_softmodem_optmask() & SOFTMODEM_BASICSIM_BIT) #define IS_SOFTMODEM_SIML1 ( get_softmodem_optmask() & SOFTMODEM_SIML1_BIT) +#define IS_SOFTMODEM_DOFORMS ( get_softmodem_optmask() & SOFTMODEM_DOFORMS_BIT) extern uint64_t get_softmodem_optmask(void); extern uint64_t set_softmodem_optmask(uint64_t bitmask); extern void get_common_options(void); @@ -316,7 +360,16 @@ extern void set_function_spec_param(RU_t *ru); extern int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg); extern void fill_ue_band_info(void); -extern void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correction, int phy_test, int UE_scan, int UE_scan_carrier, runmode_t mode,int rxgain,int txpowermax, +extern void init_UE(int nb_inst, + int eMBMS_active, + int uecap_xer_in, + int timing_correction, + int phy_test, + int UE_scan, + int UE_scan_carrier, + runmode_t mode, + int rxgain, + int txpowermax, LTE_DL_FRAME_PARMS *fp); extern void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_t *cpuset, char *name); @@ -337,11 +390,6 @@ PHY_VARS_UE *init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms, uint8_t UE_id, uint8_t abstraction_flag); void init_eNB_afterRU(void); -PARALLEL_CONF_t get_thread_parallel_conf(void); -WORKER_CONF_t get_thread_worker_conf(void); -void set_parallel_conf(char *parallel_conf); -void set_worker_conf(char *worker_conf); - extern int stop_L1L2(module_id_t enb_id); extern int restart_L1L2(module_id_t enb_id); diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index aff7e915b9f8adc780e5d8b7031ce914903433c7..a628d1453a8ef634071ad3f4a80b7d01ec990e1a 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -161,7 +161,7 @@ static const eutra_band_t eutra_bands[] = { }; -threads_t threads= {-1,-1,-1,-1,-1,-1,-1}; +threads_t threads= {-1,-1,-1,-1,-1,-1,-1,-1}; pthread_t main_ue_thread; pthread_attr_t attr_UE_thread; @@ -286,8 +286,8 @@ void init_UE(int nb_inst, if ( !IS_SOFTMODEM_SIML1 ) PHY_vars_UE_g[inst][0] = init_ue_vars(fp0,inst,0); else { // needed for memcopy below. these are not used in the RU, but needed for UE - RC.ru[0]->frame_parms.nb_antennas_rx = fp0->nb_antennas_rx; - RC.ru[0]->frame_parms.nb_antennas_tx = fp0->nb_antennas_tx; + RC.ru[0]->frame_parms->nb_antennas_rx = fp0->nb_antennas_rx; + RC.ru[0]->frame_parms->nb_antennas_tx = fp0->nb_antennas_tx; PHY_vars_UE_g[inst][0] = init_ue_vars(&RC.ru[0]->frame_parms,inst,0); } @@ -1524,6 +1524,7 @@ void *UE_thread(void *arg) int i; int th_id; static uint8_t thread_idx = 0; + int ret; cpu_set_t cpuset; CPU_ZERO(&cpuset); if ( threads.main != -1 ) @@ -1743,15 +1744,27 @@ void *UE_thread(void *arg) } pickTime(gotIQs); - struct timespec tv= {0}; - tv.tv_nsec=10*1000; - if( IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) - tv.tv_sec=INT_MAX; + /* no timeout in IS_SOFTMODEM_BASICSIM or IS_SOFTMODEM_RFSIM mode */ + if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) { + ret = pthread_mutex_lock(&proc->mutex_rxtx); + } else { + struct timespec tv; + if (clock_gettime(CLOCK_REALTIME, &tv) != 0) { + perror("clock_gettime"); + exit(1); + } + tv.tv_nsec += 10*1000; + if (tv.tv_nsec >= 1000 * 1000 * 1000) { + tv.tv_sec++; + tv.tv_nsec -= 1000 * 1000 * 1000; + } + ret = pthread_mutex_timedlock(&proc->mutex_rxtx, &tv); + } // operate on thread sf mod 2 - if (pthread_mutex_timedlock(&proc->mutex_rxtx, &tv) !=0) { - if ( errno == ETIMEDOUT) { + if (ret != 0) { + if (ret == ETIMEDOUT) { LOG_E(PHY,"Missed real time\n"); continue; } else { @@ -1760,7 +1773,7 @@ void *UE_thread(void *arg) } } - //usleep(3000); + // usleep(3000); if(sub_frame == 0) { //UE->proc.proc_rxtx[0].frame_rx++; //UE->proc.proc_rxtx[1].frame_rx++; diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index f420bf519a4e0760c167c30284317c8da9a3ce50..d8ade1935c62b947cbb4d37bc36b6c54aba6e099 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -66,7 +66,7 @@ #include "LAYER2/MAC/mac_proto.h" #include "RRC/LTE/rrc_vars.h" #include "PHY_INTERFACE/phy_interface_vars.h" - +#include "PHY/TOOLS/phy_scope_interface.h" #include "common/utils/LOG/log.h" #include "nfapi/oai_integration/vendor_ext.h" #include "UTIL/OTG/otg_tx.h" @@ -85,26 +85,14 @@ #include "system.h" -#ifdef XFORMS - #include "PHY/TOOLS/lte_phy_scope.h" - #include "stats.h" -#endif + #include "lte-softmodem.h" /* temporary compilation wokaround (UE/eNB split */ uint16_t sf_ahead; -#ifdef XFORMS - // current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) - // at eNB 0, an UL scope for every UE - FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX]; - FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; - FD_stats_form *form_stats=NULL,*form_stats_l2=NULL; - char title[255]; - unsigned char scope_enb_num_ue = 2; - static pthread_t forms_thread; //xforms -#endif //XFORMS + pthread_cond_t nfapi_sync_cond; pthread_mutex_t nfapi_sync_mutex; @@ -148,7 +136,7 @@ int snr_dB=25; runmode_t mode = normal_txrx; FILE *input_fd=NULL; - +int otg_enabled=0; #if MAX_NUM_CCs == 1 rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}}; @@ -179,10 +167,6 @@ char channels[128] = "0"; int rx_input_level_dBm; -#ifdef XFORMS - extern int otg_enabled; -#endif -//int number_of_cards = 1; static LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; @@ -218,7 +202,7 @@ extern char uecap_xer[1024]; char uecap_xer_in=0; int oaisim_flag=0; -threads_t threads = {-1,-1,-1,-1,-1,-1,-1}; +//threads_t threads= {-1,-1,-1,-1,-1,-1,-1,-1}; /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed * this is very hackish - find a proper solution @@ -329,72 +313,6 @@ void exit_function(const char *file, const char *function, const int line, const exit(1); } -#ifdef XFORMS - - -void reset_stats(FL_OBJECT *button, long arg) { - int i,j,k; - PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0]; - - for (i=0; i<NUMBER_OF_UE_MAX; i++) { - for (k=0; k<8; k++) { //harq_processes - for (j=0; j<phy_vars_eNB->dlsch[i][0]->Mlimit; j++) { - phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0; - phy_vars_eNB->UE_stats[i].dlsch_ACK[k][j]=0; - phy_vars_eNB->UE_stats[i].dlsch_trials[k][j]=0; - } - - phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0; - phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0; - phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0; - phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0; - phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0; - phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0; - } - } -} - -static void *scope_thread(void *arg) { - char stats_buffer[16384]; -# ifdef ENABLE_XFORMS_WRITE_STATS - FILE *UE_stats, *eNB_stats; -# endif - struct sched_param sched_param; - sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1; - sched_setscheduler(0, SCHED_FIFO,&sched_param); - printf("Scope thread has priority %d\n",sched_param.sched_priority); -# ifdef ENABLE_XFORMS_WRITE_STATS - UE_stats = fopen("UE_stats.txt", "w"); -#endif - - while (!oai_exit) { - // dump_ue_stats (PHY_vars_UE_g[0][0], &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0],stats_buffer, 0, mode,rx_input_level_dBm); - //fl_set_object_label(form_stats->stats_text, stats_buffer); - fl_clear_browser(form_stats->stats_text); - fl_add_browser_line(form_stats->stats_text, stats_buffer); - - phy_scope_UE(form_ue[0], - PHY_vars_UE_g[0][0], - 0, - 0, - 7); - usleep(10000); - -# ifdef ENABLE_XFORMS_WRITE_STATS - - if (UE_stats) { - rewind (UE_stats); - fwrite (stats_buffer, 1, len, UE_stats); - fclose (UE_stats); - } - -# endif - pthread_exit((void *)arg); -} -#endif - - - extern int16_t dlsch_demod_shift; static void get_options(void) { @@ -676,9 +594,6 @@ void init_pdcp(void) { } int main( int argc, char **argv ) { -#if defined (XFORMS) - void *status; -#endif int CC_id; uint8_t abstraction_flag=0; #ifdef UESIM_EXPANSION @@ -688,9 +603,6 @@ int main( int argc, char **argv ) { // if not changed from the command line option --num-ues NB_UE_INST=1; NB_THREAD_INST=1; -#if defined (XFORMS) - int ret; -#endif configmodule_interface_t *config_mod; start_background_system(); config_mod = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY); @@ -751,9 +663,7 @@ int main( int argc, char **argv ) { MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX); init_opt(); - init_pdcp(); - //TTN for D2D printf ("RRC control socket\n"); rrc_control_socket_init(); @@ -904,37 +814,9 @@ int main( int argc, char **argv ) { PHY_vars_UE_g[0][0]->no_timing_correction = 1; } -#ifdef XFORMS - int UE_id; - printf("XFORMS\n"); - - if (get_softmodem_params()->do_forms==1) { - fl_initialize (&argc, argv, NULL, 0, 0); - form_stats = create_form_stats_form(); - fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats"); - UE_id = 0; - form_ue[UE_id] = create_lte_phy_scope_ue(); - sprintf (title, "LTE DL SCOPE UE"); - fl_show_form (form_ue[UE_id]->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); - /* - if (openair_daq_vars.use_ia_receiver) { - fl_set_button(form_ue[UE_id]->button_0,1); - fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver ON"); - } else { - fl_set_button(form_ue[UE_id]->button_0,0); - fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver OFF"); - }*/ - fl_set_button(form_ue[UE_id]->button_0,0); - fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver OFF"); - ret = pthread_create(&forms_thread, NULL, scope_thread, NULL); - - if (ret == 0) - pthread_setname_np( forms_thread, "xforms" ); - - printf("Scope thread created, ret=%d\n",ret); - } + if(IS_SOFTMODEM_DOFORMS) + load_softscope("ue"); -#endif config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS); printf("Sending sync to all threads (%p,%p,%p)\n",&sync_var,&sync_cond,&sync_mutex); pthread_mutex_lock(&sync_mutex); @@ -963,19 +845,11 @@ int main( int argc, char **argv ) { printf("Terminating application - oai_exit=%d\n",oai_exit); #endif + // stop threads -#ifdef XFORMS - printf("waiting for XFORMS thread\n"); - - if (get_softmodem_params()->do_forms==1) { - pthread_join(forms_thread,&status); - fl_hide_form(form_stats->stats_form); - fl_free_form(form_stats->stats_form); - fl_hide_form(form_ue[0]->lte_phy_scope_ue); - fl_free_form(form_ue[0]->lte_phy_scope_ue); - } + if(IS_SOFTMODEM_DOFORMS) + end_forms(); -#endif printf("stopping MODEM threads\n"); pthread_cond_destroy(&sync_cond); pthread_mutex_destroy(&sync_mutex);